svg-site 1.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{r,j as s}from"./react-BNEptbwn-8068ec8f.js";import{$ as j,V as h,a0 as v}from"./index-COUSXtyQ-8068ec8f.js";/* empty css *//* empty css */import"./motion-B1hdS1Lc-8068ec8f.js";function m(i){if(!i)return"—";const a=new Date(i);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}function k({account:i}){var o;const[a,d]=r.useState(""),[x,c]=r.useState(!1);if(r.useEffect(()=>{var l;d(((l=i.user)==null?void 0:l.discordHandle)??""),c(!1)},[(o=i.user)==null?void 0:o.discordHandle]),i.status==="loading")return null;if(i.status!=="signed-in")return s.jsx("div",{className:"account-auth-auth-shell",children:s.jsx("div",{className:"account-auth-panel",children:s.jsx(j,{account:i,loginTagline:"Backs up your bookmarks, settings, and theme across devices.",brand:s.jsxs("div",{className:"account-auth-auth-brand",children:[s.jsx(h,{size:18}),s.jsx("span",{children:"Lucide Account"})]})})})});const{user:e,billing:n,isPlus:t}=i,g=n!=null&&n.cancelAtPeriodEnd?"Cancels on":"Renews on",u=async()=>{c(!1),await i.setDiscord(a.trim()||null)&&c(!0)};return s.jsx("div",{className:"settings-page account-settings",children:s.jsxs("div",{className:"settings-page-inner",children:[s.jsxs("div",{className:"settings-page-head",children:[s.jsx("h1",{children:"Account"}),s.jsx("p",{children:e==null?void 0:e.email})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Profile"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Email"}),s.jsx("div",{className:"settings-row-hint",children:e==null?void 0:e.email})]}),s.jsx("span",{className:`account-pill ${e!=null&&e.emailVerified?"ok":""}`,children:e!=null&&e.emailVerified?"Verified":"Unverified"})]}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Member since"}),s.jsx("div",{className:"settings-row-hint",children:"When you created this Lucide account"})]}),s.jsx("div",{className:"account-value",children:m(e==null?void 0:e.createdAt)})]}),s.jsx("div",{className:"settings-field-grid",children:s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{className:"settings-field-label",children:"Discord username or user ID"}),s.jsxs("div",{className:"settings-row",style:{gap:8},children:[s.jsx("input",{className:"settings-input",style:{flex:1},value:a,placeholder:"username or 17–20 digit ID",onChange:l=>{d(l.target.value),c(!1)}}),s.jsx("button",{type:"button",className:"account-btn ghost",disabled:i.busy,onClick:()=>void u(),children:"Save"})]}),s.jsx("span",{className:"settings-field-label",children:x?"Saved — used for the Plus role in the Lucide Discord.":"Optional. Used for the Plus role in the Lucide Discord. You can also enter this at checkout."})]})})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Lucide Plus"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Status"}),s.jsx("div",{className:"settings-row-hint",children:t?"3M AI tokens/day, exclusive links, and an ad-free experience are unlocked.":"Upgrade for 3M AI tokens/day, exclusive links, and an ad-free experience."})]}),s.jsx("span",{className:`account-pill ${t?"plus":""}`,children:t?"Active":"Free"})]}),t&&(n==null?void 0:n.currentPeriodEnd)&&s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:g}),s.jsx("div",{className:"settings-row-hint",children:"Manage or cancel anytime in the billing portal"})]}),s.jsx("div",{className:"account-value",children:m(n.currentPeriodEnd)})]}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:t?"Billing":"Upgrade"}),s.jsx("div",{className:"settings-row-hint",children:t?"Update payment, invoices, or cancel.":"Subscribe to Lucide Plus."})]}),t?s.jsx("button",{type:"button",className:"account-btn ghost",onClick:()=>void i.manageBilling(),children:"Manage billing"}):s.jsx("button",{type:"button",className:"account-btn primary",onClick:()=>void i.checkout((e==null?void 0:e.email)??void 0),children:"Upgrade to Plus"})]}),!t&&s.jsx(v,{}),i.authError&&s.jsx("div",{className:"account-error",children:i.authError})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Cloud sync"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Backup & device sync"}),s.jsx("div",{className:"settings-row-hint",children:"Bookmarks, settings, theme, and proxied-site logins (cookies) sync to this account automatically."})]}),s.jsx("span",{className:"account-pill ok",children:"On"})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Session"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Sign out"}),s.jsx("div",{className:"settings-row-hint",children:"Signs out on this device only."})]}),s.jsx("button",{type:"button",className:"account-btn ghost",onClick:()=>void i.logout(),children:"Sign out"})]})]}),s.jsxs("div",{className:"settings-page-foot",children:[s.jsx(h,{size:14}),s.jsx("span",{children:"Lucide"})]})]})})}export{k as AccountPage};
1
+ import{r,j as s}from"./react-BNEptbwn-8068ec8f.js";import{$ as j,V as h,a0 as v}from"./index-COUSXtyQ-8068ec8f.js";/* empty css *//* empty css */import"./motion-B1hdS1Lc-8068ec8f.js";function m(i){if(!i)return"—";const a=new Date(i);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}function k({account:i}){var o;const[a,d]=r.useState(""),[x,c]=r.useState(!1);if(r.useEffect(()=>{var l;d(((l=i.user)==null?void 0:l.discordHandle)??""),c(!1)},[(o=i.user)==null?void 0:o.discordHandle]),i.status==="loading")return null;if(i.status!=="signed-in")return s.jsx("div",{className:"account-auth-auth-shell",children:s.jsx("div",{className:"account-auth-panel",children:s.jsx(j,{account:i,loginTagline:"Backs up your bookmarks, settings, and theme across devices.",brand:s.jsxs("div",{className:"account-auth-auth-brand",children:[s.jsx(h,{size:18}),s.jsx("span",{children:"IGNITE OS BROWSER Account"})]})})})});const{user:e,billing:n,isPlus:t}=i,g=n!=null&&n.cancelAtPeriodEnd?"Cancels on":"Renews on",u=async()=>{c(!1),await i.setDiscord(a.trim()||null)&&c(!0)};return s.jsx("div",{className:"settings-page account-settings",children:s.jsxs("div",{className:"settings-page-inner",children:[s.jsxs("div",{className:"settings-page-head",children:[s.jsx("h1",{children:"Account"}),s.jsx("p",{children:e==null?void 0:e.email})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Profile"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Email"}),s.jsx("div",{className:"settings-row-hint",children:e==null?void 0:e.email})]}),s.jsx("span",{className:`account-pill ${e!=null&&e.emailVerified?"ok":""}`,children:e!=null&&e.emailVerified?"Verified":"Unverified"})]}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Member since"}),s.jsx("div",{className:"settings-row-hint",children:"When you created this IGNITE OS BROWSER account"})]}),s.jsx("div",{className:"account-value",children:m(e==null?void 0:e.createdAt)})]}),s.jsx("div",{className:"settings-field-grid",children:s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{className:"settings-field-label",children:"Discord username or user ID"}),s.jsxs("div",{className:"settings-row",style:{gap:8},children:[s.jsx("input",{className:"settings-input",style:{flex:1},value:a,placeholder:"username or 17–20 digit ID",onChange:l=>{d(l.target.value),c(!1)}}),s.jsx("button",{type:"button",className:"account-btn ghost",disabled:i.busy,onClick:()=>void u(),children:"Save"})]}),s.jsx("span",{className:"settings-field-label",children:x?"Saved — used for the Plus role in the IGNITE OS BROWSER Discord.":"Optional. Used for the Plus role in the IGNITE OS BROWSER Discord. You can also enter this at checkout."})]})})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"IGNITE OS BROWSER Plus"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Status"}),s.jsx("div",{className:"settings-row-hint",children:t?"3M AI tokens/day, exclusive links, and an ad-free experience are unlocked.":"Upgrade for 3M AI tokens/day, exclusive links, and an ad-free experience."})]}),s.jsx("span",{className:`account-pill ${t?"plus":""}`,children:t?"Active":"Free"})]}),t&&(n==null?void 0:n.currentPeriodEnd)&&s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:g}),s.jsx("div",{className:"settings-row-hint",children:"Manage or cancel anytime in the billing portal"})]}),s.jsx("div",{className:"account-value",children:m(n.currentPeriodEnd)})]}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:t?"Billing":"Upgrade"}),s.jsx("div",{className:"settings-row-hint",children:t?"Update payment, invoices, or cancel.":"Subscribe to IGNITE OS BROWSER Plus."})]}),t?s.jsx("button",{type:"button",className:"account-btn ghost",onClick:()=>void i.manageBilling(),children:"Manage billing"}):s.jsx("button",{type:"button",className:"account-btn primary",onClick:()=>void i.checkout((e==null?void 0:e.email)??void 0),children:"Upgrade to Plus"})]}),!t&&s.jsx(v,{}),i.authError&&s.jsx("div",{className:"account-error",children:i.authError})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Cloud sync"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Backup & device sync"}),s.jsx("div",{className:"settings-row-hint",children:"Bookmarks, settings, theme, and proxied-site logins (cookies) sync to this account automatically."})]}),s.jsx("span",{className:"account-pill ok",children:"On"})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Session"}),s.jsxs("div",{className:"settings-row",children:[s.jsxs("div",{className:"settings-row-text",children:[s.jsx("div",{className:"settings-row-label",children:"Sign out"}),s.jsx("div",{className:"settings-row-hint",children:"Signs out on this device only."})]}),s.jsx("button",{type:"button",className:"account-btn ghost",onClick:()=>void i.logout(),children:"Sign out"})]})]}),s.jsxs("div",{className:"settings-page-foot",children:[s.jsx(h,{size:14}),s.jsx("span",{children:"IGNITE OS BROWSER"})]})]})})}export{k as AccountPage};
@@ -1,4 +1,4 @@
1
- var Je=Object.defineProperty;var Ye=(e,t,s)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var J=(e,t,s)=>Ye(e,typeof t!="symbol"?t+"":t,s);import{r as o,j as n,c as Qe,a as Ze}from"./react-BNEptbwn-8068ec8f.js";import{r as et,a as tt,b as K,C as B,c as Le,G as fe,E as Ae,S as nt,d as st,R as at,e as rt,f as it,g as re,L as ot,I as ct,h as lt,i as ut,j as pe,M as dt,k as me,P as ft,T as pt,l as mt,m as ht,n as gt,o as xt,p as bt,q as be,w as ye,U as yt}from"./index-COUSXtyQ-8068ec8f.js";import{i as vt}from"./fingerprint-Y5nV5FVa-8068ec8f.js";import{M as wt,r as jt,a as kt,b as St}from"./markdown-BtlGIx_H-8068ec8f.js";import{m as Ie,A as Nt}from"./motion-B1hdS1Lc-8068ec8f.js";function ve(e){return Math.max(1,Math.round(e.trim().length/4))}function Et(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function De(e){const t=e;return!!t&&typeof t.id=="string"&&Array.isArray(t.messages)&&typeof t.title=="string"}function ie(){return Math.random().toString(36).slice(2,10)+Date.now().toString(36)}function Ct(e){const t=e.trim().replace(/\s+/g," ");return t?t.length>42?t.slice(0,42).trimEnd()+"…":t:"New chat"}const Tt="lucide-ai",H="threads",Mt=400,_e=100;let Y=null;function he(){return Y||(Y=new Promise((e,t)=>{const s=indexedDB.open(Tt,1);s.onupgradeneeded=()=>{s.result.objectStoreNames.contains(H)||s.result.createObjectStore(H,{keyPath:"id"})},s.onsuccess=()=>e(s.result),s.onerror=()=>t(s.error)})),Y}function ge(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}async function Pe(e){const t=await he();await ge(t.transaction(H,"readwrite").objectStore(H).put(e))}async function Rt(e){try{const t=await he();await ge(t.transaction(H,"readwrite").objectStore(H).delete(e))}catch{}}const Q=new Map;function Lt(e){const t=Q.get(e.id);t&&clearTimeout(t),Q.set(e.id,setTimeout(()=>{Q.delete(e.id),Pe(e).catch(()=>{})},Mt))}async function At(){const e=et("ai.threads",null);if(!(!Array.isArray(e)||e.length===0)){for(const t of e)De(t)&&await Pe(t);tt("ai.threads")}}async function It(){try{const e=await he();return await At(),(await ge(e.transaction(H,"readonly").objectStore(H).getAll())).filter(De).sort((s,r)=>r.updatedAt-s.updatedAt).slice(0,_e)}catch{return[]}}function Dt(e){return{id:ie(),title:"New chat",model:e,messages:[],updatedAt:Date.now()}}function _t(){const[e,t]=o.useState([]),[s,r]=o.useState(!1),[a,l]=o.useState(""),h=o.useRef([]);o.useEffect(()=>{let w=!0;return It().then(y=>{w&&(h.current=y,t(y),r(!0))}),()=>{w=!1}},[]),o.useEffect(()=>{if(!s)return;const w=new Map(h.current.map(b=>[b.id,b])),y=new Map(e.map(b=>[b.id,b]));for(const b of e)w.get(b.id)!==b&&Lt(b);for(const b of h.current)y.has(b.id)||Rt(b.id);h.current=e},[e,s]),o.useEffect(()=>{var w;a&&!e.some(y=>y.id===a)&&l(((w=e[0])==null?void 0:w.id)??"")},[e,a]);const g=e.find(w=>w.id===a),j=o.useCallback(w=>{const y=Dt(w);return t(b=>[y,...b].slice(0,_e)),l(y.id),y.id},[]),N=o.useCallback(w=>l(w),[]),M=o.useCallback(()=>l(""),[]),D=o.useCallback(w=>{t(y=>y.filter(b=>b.id!==w))},[]),f=o.useCallback((w,y)=>{const b=y.trim();b&&t(k=>k.map(T=>T.id===w?{...T,title:b}:T))},[]),x=o.useCallback((w,y)=>{t(b=>b.map(k=>k.id===w?y(k):k))},[]);return{threads:e,loaded:s,activeId:a,activeThread:g,create:j,select:N,startNew:M,remove:D,rename:f,update:x}}let Z=null,W=null;function Pt(){try{const e=[navigator.userAgent,navigator.language,screen.width,screen.height,screen.colorDepth,new Date().getTimezoneOffset(),navigator.hardwareConcurrency,navigator.deviceMemory].join("|");let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return`fb_${(t>>>0).toString(36)}`}catch{return""}}function we(e,t){return Promise.race([e,new Promise(s=>setTimeout(()=>s(null),t))])}async function $t(){try{const e=await we(vt.load(),2500);if(e){const t=await we(e.get(),2500);if(t!=null&&t.visitorId)return t.visitorId}}catch{}return Pt()}function $e(){return Z?Promise.resolve(Z):(W||(W=$t().then(e=>(Z=e||null,W=null,e))),W)}function ze(e){return!!e&&typeof e=="object"&&typeof e.p=="string"}function zt(e){let t="";for(let s=0;s<e.length;s+=1)t+=String.fromCharCode(e[s]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ot(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";const s=atob(t),r=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)r[a]=s.charCodeAt(a);return r}function Ft(e){return zt(new TextEncoder().encode(e))}function Oe(e){return new TextDecoder().decode(Ot(e))}function Ht(e){return{p:Ft(JSON.stringify(e))}}function qt(e){if(!ze(e))return null;try{return JSON.parse(Oe(e.p))}catch{return null}}function Fe(e){return Ht(e)}function Ut(e){const t=qt(e);if(t===null)throw new Error("packed");return t}function Wt(e){if(!ze(e))throw new Error("packed");return Oe(e.p)}class oe extends Error{constructor(s,r,a=null){super(s);J(this,"code");J(this,"reason");this.code=r,this.reason=a}}async function Vt(e){try{const t=await fetch(K("/api/ai/title"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Fe({message:e})),credentials:B});if(!t.ok)return null;const s=Ut(await t.json());return typeof(s==null?void 0:s.title)=="string"&&s.title?s.title:null}catch{return null}}async function He(e,t,s,r,a,l,h,g,j){var w,y,b,k;const N=await $e(),M=await fetch(K("/api/ai/chat"),{method:"POST",headers:{"content-type":"application/json","x-fingerprint":N,...Le("account")},body:JSON.stringify(Fe(e)),signal:t,credentials:B});if(!M.ok||!M.body){let T=`The AI request failed (${M.status}).`,p=null,c=null,v="";try{v=await M.text();const S=JSON.parse(v);S!=null&&S.error&&(T=S.error),S!=null&&S.code&&(p=S.code),S!=null&&S.reason&&(c=S.reason)}catch{}throw new oe(T,p,c)}const D=M.body.getReader(),f=new TextDecoder;let x="";try{for(;;){const{done:T,value:p}=await D.read();if(T)break;x+=f.decode(p,{stream:!0});const c=x.split(/\r?\n\r?\n/);x=c.pop()??"";for(const v of c)for(const S of v.split(/\r?\n/)){if(!S.startsWith("data:"))continue;const _=S.slice(5).trim();if(!_)continue;let C=_;try{C=Wt(JSON.parse(_))}catch{continue}if(C==="[DONE]")return;let m;try{m=JSON.parse(C)}catch{continue}if(m.error&&typeof m.error=="string"&&!m.choices)throw new oe(m.error,"provider");try{if(m.lucide_tool&&typeof m.lucide_tool=="object"){l==null||l(m.lucide_tool);continue}if(m.lucide_artifact&&typeof m.lucide_artifact=="object"){h==null||h(m.lucide_artifact);continue}if(m.lucide_ask&&typeof m.lucide_ask=="object"){g==null||g(m.lucide_ask);continue}if(m.lucide_fallback&&typeof m.lucide_fallback=="object"){j==null||j(m.lucide_fallback);continue}if(Array.isArray(m.lucide_sources)){const u=m.lucide_sources.map(d=>d).filter(d=>typeof d.title=="string"&&typeof d.url=="string").map(d=>({title:d.title,url:d.url}));u.length>0&&(a==null||a(u));continue}const A=(w=m.choices)==null?void 0:w[0],L=((y=A==null?void 0:A.delta)==null?void 0:y.content)??((b=A==null?void 0:A.message)==null?void 0:b.content);typeof L=="string"&&L&&s(L);const R=(k=m.usage)==null?void 0:k.total_tokens;typeof R=="number"&&R>0&&(r==null||r(R))}catch{}}}}catch(T){throw T}}const Kt=[{id:"none",label:"Off"},{id:"low",label:"Low"},{id:"medium",label:"Med"},{id:"high",label:"High"}],ce="medium",Bt=[{id:"deepseek",label:"DeepSeek"},{id:"qwen",label:"Qwen"},{id:"openai",label:"OpenAI"},{id:"anthropic",label:"Anthropic"}],G=[{id:"deepseek/deepseek-v4-flash-0731",label:"DeepSeek V4 Flash",provider:"deepseek",blurb:"Default chat",thinking:!0,vision:!1},{id:"qwen/qwen3.8-flash",label:"Qwen 3.8 Flash",provider:"qwen",blurb:"Vision and screenshare",thinking:!0,vision:!0},{id:"openai/gpt-6-luna",label:"GPT-6 Luna",provider:"openai",blurb:"Optional OpenAI lane",thinking:!0,vision:!0}],V="deepseek/deepseek-v4-flash-0731",le="qwen/qwen3.8-flash",ee={"openai/gpt-5.6-luna":"openai/gpt-6-luna","gpt-5.6-luna":"openai/gpt-6-luna","gpt-5.6-terra":"openai/gpt-6-luna","gpt-5.6-sol":"openai/gpt-6-luna","gpt-6-luna":"openai/gpt-6-luna","google/gemini-3.8-flash":"qwen/qwen3.8-flash","google/gemini-3.6-flash":"qwen/qwen3.8-flash","gemini-3.8-flash":"qwen/qwen3.8-flash","gemini-3.6-flash":"qwen/qwen3.8-flash","gemini-3.1-pro-preview":V,"google/gemini-3.1-pro-preview":V,"claude-sonnet-5":"openai/gpt-6-luna","claude-opus-5":"openai/gpt-6-luna","deepseek-v4-flash":"deepseek/deepseek-v4-flash-0731","deepseek-v4-pro":"deepseek/deepseek-v4-flash-0731"};function je(e){return G.some(t=>t.id===e)}function qe(e){return e&&je(e)?e:e&&ee[e]&&je(ee[e])?ee[e]:V}function Ue(e){var t;return((t=G.find(s=>s.id===e))==null?void 0:t.thinking)??!1}function ke(e){var t;return((t=G.find(s=>s.id===e))==null?void 0:t.provider)??null}function Gt(e){return e==="openai"||e==="deepseek"||e==="qwen"}function We(e){return e==="none"||e==="low"||e==="medium"||e==="high"}function Ve(e,t){return!Ue(e)||!Gt(ke(e))||!We(t)||t==="none"?null:ke(e)==="deepseek"?t==="low"?"low":"high":t}function Se(){return Bt.map(e=>({provider:e,models:G.filter(t=>t.provider===e.id)})).filter(e=>e.models.length>0)}function Xt(e){var t;return(t=e.files)!=null&&t.length?[e.content,...e.files.map(s=>`--- ${s.name} ---
1
+ var Je=Object.defineProperty;var Ye=(e,t,s)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var J=(e,t,s)=>Ye(e,typeof t!="symbol"?t+"":t,s);import{r as o,j as n,c as Qe,a as Ze}from"./react-BNEptbwn-8068ec8f.js";import{r as et,a as tt,b as K,C as B,c as Le,G as fe,E as Ae,S as nt,d as st,R as at,e as rt,f as it,g as re,L as ot,I as ct,h as lt,i as ut,j as pe,M as dt,k as me,P as ft,T as pt,l as mt,m as ht,n as gt,o as xt,p as bt,q as be,w as ye,U as yt}from"./index-COUSXtyQ-8068ec8f.js";import{i as vt}from"./fingerprint-Y5nV5FVa-8068ec8f.js";import{M as wt,r as jt,a as kt,b as St}from"./markdown-BtlGIx_H-8068ec8f.js";import{m as Ie,A as Nt}from"./motion-B1hdS1Lc-8068ec8f.js";function ve(e){return Math.max(1,Math.round(e.trim().length/4))}function Et(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function De(e){const t=e;return!!t&&typeof t.id=="string"&&Array.isArray(t.messages)&&typeof t.title=="string"}function ie(){return Math.random().toString(36).slice(2,10)+Date.now().toString(36)}function Ct(e){const t=e.trim().replace(/\s+/g," ");return t?t.length>42?t.slice(0,42).trimEnd()+"…":t:"New chat"}const Tt="IGNITE OS BROWSER-ai",H="threads",Mt=400,_e=100;let Y=null;function he(){return Y||(Y=new Promise((e,t)=>{const s=indexedDB.open(Tt,1);s.onupgradeneeded=()=>{s.result.objectStoreNames.contains(H)||s.result.createObjectStore(H,{keyPath:"id"})},s.onsuccess=()=>e(s.result),s.onerror=()=>t(s.error)})),Y}function ge(e){return new Promise((t,s)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>s(e.error)})}async function Pe(e){const t=await he();await ge(t.transaction(H,"readwrite").objectStore(H).put(e))}async function Rt(e){try{const t=await he();await ge(t.transaction(H,"readwrite").objectStore(H).delete(e))}catch{}}const Q=new Map;function Lt(e){const t=Q.get(e.id);t&&clearTimeout(t),Q.set(e.id,setTimeout(()=>{Q.delete(e.id),Pe(e).catch(()=>{})},Mt))}async function At(){const e=et("ai.threads",null);if(!(!Array.isArray(e)||e.length===0)){for(const t of e)De(t)&&await Pe(t);tt("ai.threads")}}async function It(){try{const e=await he();return await At(),(await ge(e.transaction(H,"readonly").objectStore(H).getAll())).filter(De).sort((s,r)=>r.updatedAt-s.updatedAt).slice(0,_e)}catch{return[]}}function Dt(e){return{id:ie(),title:"New chat",model:e,messages:[],updatedAt:Date.now()}}function _t(){const[e,t]=o.useState([]),[s,r]=o.useState(!1),[a,l]=o.useState(""),h=o.useRef([]);o.useEffect(()=>{let w=!0;return It().then(y=>{w&&(h.current=y,t(y),r(!0))}),()=>{w=!1}},[]),o.useEffect(()=>{if(!s)return;const w=new Map(h.current.map(b=>[b.id,b])),y=new Map(e.map(b=>[b.id,b]));for(const b of e)w.get(b.id)!==b&&Lt(b);for(const b of h.current)y.has(b.id)||Rt(b.id);h.current=e},[e,s]),o.useEffect(()=>{var w;a&&!e.some(y=>y.id===a)&&l(((w=e[0])==null?void 0:w.id)??"")},[e,a]);const g=e.find(w=>w.id===a),j=o.useCallback(w=>{const y=Dt(w);return t(b=>[y,...b].slice(0,_e)),l(y.id),y.id},[]),N=o.useCallback(w=>l(w),[]),M=o.useCallback(()=>l(""),[]),D=o.useCallback(w=>{t(y=>y.filter(b=>b.id!==w))},[]),f=o.useCallback((w,y)=>{const b=y.trim();b&&t(k=>k.map(T=>T.id===w?{...T,title:b}:T))},[]),x=o.useCallback((w,y)=>{t(b=>b.map(k=>k.id===w?y(k):k))},[]);return{threads:e,loaded:s,activeId:a,activeThread:g,create:j,select:N,startNew:M,remove:D,rename:f,update:x}}let Z=null,W=null;function Pt(){try{const e=[navigator.userAgent,navigator.language,screen.width,screen.height,screen.colorDepth,new Date().getTimezoneOffset(),navigator.hardwareConcurrency,navigator.deviceMemory].join("|");let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return`fb_${(t>>>0).toString(36)}`}catch{return""}}function we(e,t){return Promise.race([e,new Promise(s=>setTimeout(()=>s(null),t))])}async function $t(){try{const e=await we(vt.load(),2500);if(e){const t=await we(e.get(),2500);if(t!=null&&t.visitorId)return t.visitorId}}catch{}return Pt()}function $e(){return Z?Promise.resolve(Z):(W||(W=$t().then(e=>(Z=e||null,W=null,e))),W)}function ze(e){return!!e&&typeof e=="object"&&typeof e.p=="string"}function zt(e){let t="";for(let s=0;s<e.length;s+=1)t+=String.fromCharCode(e[s]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ot(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";const s=atob(t),r=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)r[a]=s.charCodeAt(a);return r}function Ft(e){return zt(new TextEncoder().encode(e))}function Oe(e){return new TextDecoder().decode(Ot(e))}function Ht(e){return{p:Ft(JSON.stringify(e))}}function qt(e){if(!ze(e))return null;try{return JSON.parse(Oe(e.p))}catch{return null}}function Fe(e){return Ht(e)}function Ut(e){const t=qt(e);if(t===null)throw new Error("packed");return t}function Wt(e){if(!ze(e))throw new Error("packed");return Oe(e.p)}class oe extends Error{constructor(s,r,a=null){super(s);J(this,"code");J(this,"reason");this.code=r,this.reason=a}}async function Vt(e){try{const t=await fetch(K("/api/ai/title"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Fe({message:e})),credentials:B});if(!t.ok)return null;const s=Ut(await t.json());return typeof(s==null?void 0:s.title)=="string"&&s.title?s.title:null}catch{return null}}async function He(e,t,s,r,a,l,h,g,j){var w,y,b,k;const N=await $e(),M=await fetch(K("/api/ai/chat"),{method:"POST",headers:{"content-type":"application/json","x-fingerprint":N,...Le("account")},body:JSON.stringify(Fe(e)),signal:t,credentials:B});if(!M.ok||!M.body){let T=`The AI request failed (${M.status}).`,p=null,c=null,v="";try{v=await M.text();const S=JSON.parse(v);S!=null&&S.error&&(T=S.error),S!=null&&S.code&&(p=S.code),S!=null&&S.reason&&(c=S.reason)}catch{}throw new oe(T,p,c)}const D=M.body.getReader(),f=new TextDecoder;let x="";try{for(;;){const{done:T,value:p}=await D.read();if(T)break;x+=f.decode(p,{stream:!0});const c=x.split(/\r?\n\r?\n/);x=c.pop()??"";for(const v of c)for(const S of v.split(/\r?\n/)){if(!S.startsWith("data:"))continue;const _=S.slice(5).trim();if(!_)continue;let C=_;try{C=Wt(JSON.parse(_))}catch{continue}if(C==="[DONE]")return;let m;try{m=JSON.parse(C)}catch{continue}if(m.error&&typeof m.error=="string"&&!m.choices)throw new oe(m.error,"provider");try{if(m.IGNITE OS BROWSER_tool&&typeof m.IGNITE OS BROWSER_tool=="object"){l==null||l(m.IGNITE OS BROWSER_tool);continue}if(m.IGNITE OS BROWSER_artifact&&typeof m.IGNITE OS BROWSER_artifact=="object"){h==null||h(m.IGNITE OS BROWSER_artifact);continue}if(m.IGNITE OS BROWSER_ask&&typeof m.IGNITE OS BROWSER_ask=="object"){g==null||g(m.IGNITE OS BROWSER_ask);continue}if(m.IGNITE OS BROWSER_fallback&&typeof m.IGNITE OS BROWSER_fallback=="object"){j==null||j(m.IGNITE OS BROWSER_fallback);continue}if(Array.isArray(m.IGNITE OS BROWSER_sources)){const u=m.IGNITE OS BROWSER_sources.map(d=>d).filter(d=>typeof d.title=="string"&&typeof d.url=="string").map(d=>({title:d.title,url:d.url}));u.length>0&&(a==null||a(u));continue}const A=(w=m.choices)==null?void 0:w[0],L=((y=A==null?void 0:A.delta)==null?void 0:y.content)??((b=A==null?void 0:A.message)==null?void 0:b.content);typeof L=="string"&&L&&s(L);const R=(k=m.usage)==null?void 0:k.total_tokens;typeof R=="number"&&R>0&&(r==null||r(R))}catch{}}}}catch(T){throw T}}const Kt=[{id:"none",label:"Off"},{id:"low",label:"Low"},{id:"medium",label:"Med"},{id:"high",label:"High"}],ce="medium",Bt=[{id:"deepseek",label:"DeepSeek"},{id:"qwen",label:"Qwen"},{id:"openai",label:"OpenAI"},{id:"anthropic",label:"Anthropic"}],G=[{id:"deepseek/deepseek-v4-flash-0731",label:"DeepSeek V4 Flash",provider:"deepseek",blurb:"Default chat",thinking:!0,vision:!1},{id:"qwen/qwen3.8-flash",label:"Qwen 3.8 Flash",provider:"qwen",blurb:"Vision and screenshare",thinking:!0,vision:!0},{id:"openai/gpt-6-luna",label:"GPT-6 Luna",provider:"openai",blurb:"Optional OpenAI lane",thinking:!0,vision:!0}],V="deepseek/deepseek-v4-flash-0731",le="qwen/qwen3.8-flash",ee={"openai/gpt-5.6-luna":"openai/gpt-6-luna","gpt-5.6-luna":"openai/gpt-6-luna","gpt-5.6-terra":"openai/gpt-6-luna","gpt-5.6-sol":"openai/gpt-6-luna","gpt-6-luna":"openai/gpt-6-luna","google/gemini-3.8-flash":"qwen/qwen3.8-flash","google/gemini-3.6-flash":"qwen/qwen3.8-flash","gemini-3.8-flash":"qwen/qwen3.8-flash","gemini-3.6-flash":"qwen/qwen3.8-flash","gemini-3.1-pro-preview":V,"google/gemini-3.1-pro-preview":V,"claude-sonnet-5":"openai/gpt-6-luna","claude-opus-5":"openai/gpt-6-luna","deepseek-v4-flash":"deepseek/deepseek-v4-flash-0731","deepseek-v4-pro":"deepseek/deepseek-v4-flash-0731"};function je(e){return G.some(t=>t.id===e)}function qe(e){return e&&je(e)?e:e&&ee[e]&&je(ee[e])?ee[e]:V}function Ue(e){var t;return((t=G.find(s=>s.id===e))==null?void 0:t.thinking)??!1}function ke(e){var t;return((t=G.find(s=>s.id===e))==null?void 0:t.provider)??null}function Gt(e){return e==="openai"||e==="deepseek"||e==="qwen"}function We(e){return e==="none"||e==="low"||e==="medium"||e==="high"}function Ve(e,t){return!Ue(e)||!Gt(ke(e))||!We(t)||t==="none"?null:ke(e)==="deepseek"?t==="low"?"low":"high":t}function Se(){return Bt.map(e=>({provider:e,models:G.filter(t=>t.provider===e.id)})).filter(e=>e.models.length>0)}function Xt(e){var t;return(t=e.files)!=null&&t.length?[e.content,...e.files.map(s=>`--- ${s.name} ---
2
2
  ${s.content}`)].filter(Boolean).join(`
3
3
 
4
4
  `):e.content}function Jt(e){const t=[];for(const s of e){if(s.error)continue;const r=Xt(s),a=s.role==="user"?s.images:void 0;if(!r.trim()&&!(a!=null&&a.length))continue;if(s.role==="user"&&(a!=null&&a.length)){const g={role:"user",content:[{type:"text",text:r},...a.map(N=>({type:"image_url",image_url:{url:N}}))]},j=t[t.length-1];(j==null?void 0:j.role)==="user"?t[t.length-1]=g:t.push(g);continue}const l={role:s.role,content:r},h=t[t.length-1];if((h==null?void 0:h.role)===l.role){l.role==="user"&&typeof h.content=="string"?h.content=[h.content,r].filter(Boolean).join(`
@@ -15,4 +15,4 @@ ${s.content}`)].filter(Boolean).join(`
15
15
  .md pre code { background: transparent; padding: 0; }
16
16
  .md a { color: var(--assistant-accent); text-decoration: underline; }
17
17
  .md blockquote { margin: 8px 0; border-left: 2px solid var(--assistant-border); padding-left: 8px; opacity: 0.9; }
18
- `,t.head.append(r)}if(!t.getElementById("_1u0ijh5")){const r=t.createElement("link");r.id="_1u0ijh5",r.rel="stylesheet",r.href=En,t.head.append(r)}const s=t.createElement("div");return s.style.width="100%",s.style.display="block",t.body.append(s),s}function Ln(){return new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})})}function An({onError:e,onStateChange:t}){const[s,r]=o.useState(!1),a=o.useRef(null),l=o.useRef(null),h=o.useRef(null),g=o.useRef(!1),j=o.useCallback(()=>{if(l.current)return l.current;const f=document.createElement("video");return f.muted=!0,f.autoplay=!0,f.playsInline=!0,l.current=f,f},[]),N=o.useCallback(()=>{const f=a.current;if(f)for(const x of f.getTracks())x.stop();a.current=null,l.current&&(l.current.srcObject=null),h.current=null,g.current=!1,r(!1),t()},[t]),M=o.useCallback(async f=>{if(a.current)return!0;try{const w=await(f??window).navigator.mediaDevices.getDisplayMedia(Cn);w.getVideoTracks()[0].addEventListener("ended",()=>N());const b=j();return b.srcObject=w,await b.play().catch(()=>{}),a.current=w,g.current=!0,r(!0),t(),!0}catch(x){const w=x instanceof Error?x.message:"Could not start screen sharing";return e(w),!1}},[j,e,t,N]),D=o.useCallback(async()=>{if(!a.current)throw new Error("Screen sharing is not active");const f=j();(!f.videoWidth||!f.videoHeight)&&await new Promise((S,_)=>{const C=window.setTimeout(()=>_(new Error("Timed out waiting for screen frame")),1200),m=()=>{window.clearTimeout(C),f.removeEventListener("loadeddata",m),S()};f.addEventListener("loadeddata",m)});const x=Math.max(1,f.videoWidth),w=Math.max(1,f.videoHeight),y=960,b=x>y?y/x:1,k=Math.max(1,Math.round(x*b)),T=Math.max(1,Math.round(w*b)),p=h.current??document.createElement("canvas");h.current=p,p.width=k,p.height=T;const c=p.getContext("2d");if(!c)throw new Error("Canvas context unavailable");c.drawImage(f,0,0,k,T);const v=await new Promise(S=>p.toBlob(S,"image/jpeg",.72));return v?await new Promise((S,_)=>{const C=new FileReader;C.onload=()=>{typeof C.result=="string"?S(C.result):_(new Error("Failed to encode screen capture"))},C.onerror=()=>_(new Error("Failed to encode screen capture")),C.readAsDataURL(v)}):p.toDataURL("image/jpeg",.72)},[j]);return{isSharing:s,isSharingRef:g,streamRef:a,startSharing:M,stopSharing:N,captureFrameDataUrl:D}}const In=380,Dn=240,_n=820,Pn=150;function $n(e){const t=e.document.body.firstElementChild;return t instanceof HTMLElement?Math.ceil(t.getBoundingClientRect().height):0}function de(e){try{if(e.closed)return;const t=$n(e)-e.innerHeight;if(Math.abs(t)<=1)return;const s=Math.min(_n,Math.max(Pn,e.outerHeight+t));s!==e.outerHeight&&e.resizeTo(e.outerWidth,s)}catch{}}function zn(e){try{e.requestAnimationFrame(()=>{de(e),e.setTimeout(()=>e.requestAnimationFrame(()=>de(e)),90)})}catch{}}function On({onAsk:e}){const[t,s]=o.useState("closed"),[r,a]=o.useState(""),[l,h]=o.useState(!1),[g,j]=o.useState(null),[N,M]=o.useState(null),[D,f]=o.useState(le),x=o.useRef(null),w=o.useRef(null),y=o.useRef(!1);y.current=l;const b=o.useCallback(d=>M(d),[]),k=o.useCallback(()=>{},[]),{isSharing:T,isSharingRef:p,streamRef:c,startSharing:v,stopSharing:S,captureFrameDataUrl:_}=An({onError:b,onStateChange:k}),C=o.useCallback(()=>{var i;const d=x.current;if(x.current=null,d){(i=d.resizeObserver)==null||i.disconnect(),window.setTimeout(()=>d.root.unmount(),0);try{d.window.close()}catch{}}},[]),m=o.useCallback(()=>{C(),S(),s("closed"),a(""),j(null)},[C,S]),A=o.useCallback(async d=>{var P,z,$;if(y.current)return;const i=d.trim();if(!i){j("Type a question first.");return}if(!p.current){j("Start screen sharing first.");return}h(!0),j(null),a("Thinking…");const E=x.current,I=(E==null?void 0:E.mountElement)??w.current;try{const q=(($=(z=(P=c.current)==null?void 0:P.getVideoTracks()[0])==null?void 0:z.getSettings())==null?void 0:$.displaySurface)==="monitor"&&I;q&&(I.style.visibility="hidden",await Ln());const Xe=await _();q&&(I.style.visibility="visible",E==null||E.window.focus());let xe=!1,X="";await e(i,Xe,{onDelta:U=>{xe||(X="",xe=!0),X+=U,a(X),j(null)},onError:U=>{a(U),j(U)},onComplete:()=>h(!1)})}catch(O){I&&(I.style.visibility="visible");const q=O instanceof Error?O.message:"Failed to ask about screen";a(q),j(q)}finally{h(!1)}},[_,p,e,c]),L=o.useCallback(()=>{var d;if(p.current){S();return}v(t==="window"?(d=x.current)==null?void 0:d.window:window)},[p,t,v,S]);o.useEffect(()=>{if(t!=="window")return;const d=x.current;if(!d)return;const i=ue(),E=d.window.document;E.documentElement.style.background=i.bg,E.body.style.background=i.bg,E.body.style.margin="0",E.body.style.padding="0",E.documentElement.style.setProperty("--assistant-border",i.border),E.documentElement.style.setProperty("--assistant-code-bg",`color-mix(in srgb, ${i.surface} 78%, black 22%)`),E.documentElement.style.setProperty("--assistant-accent",i.accent),d.root.render(n.jsx(Ge,{tokens:i,isSharing:T,isAsking:l,output:r,error:g,onAsk:I=>void A(I),onClose:m})),zn(d.window)},[t,T,l,r,g,A,m]);const R=o.useCallback(async()=>{const d=Tn(),i=d.documentPictureInPicture;let E=null;if(i!=null&&i.requestWindow)try{E=await i.requestWindow({width:In,height:Dn,disallowReturnToOpener:!0,preferInitialWindowPlacement:!0})}catch{E=null}if(!E)try{E=Mn(d)}catch{E=null}if(!E){s("inpage");return}const I=Rn(E),P=Qe.createRoot(I),z=E.ResizeObserver,$=z?new z(()=>de(E)):null;$==null||$.observe(I),x.current={window:E,root:P,mountElement:I,resizeObserver:$},E.addEventListener("pagehide",()=>{var O;((O=x.current)==null?void 0:O.window)===E&&m()},{once:!0}),s("window")},[m]),u=o.useCallback(async()=>{if(!p.current){if(!await v(window))return;M(null)}await R()},[p,v,R]);return o.useEffect(()=>()=>{C(),S()},[C,S]),{isSharing:T,mode:t,error:N,output:r,isAsking:l,askError:g,selectedModel:D,panelRef:w,start:u,popOut:R,stop:S,close:m,ask:A,toggleSharing:L,setSelectedModel:f,tokens:ue}}const Fn=""+new URL("verity-mini-DjLHPujK.png",import.meta.url).href,Me=16,Re=.14;function Hn(){const e=o.useRef(null);return o.useEffect(()=>{const t=e.current;if(!t)return;let s=0,r=0,a=0,l=0,h=0,g=!1;const j=()=>{l+=(r-l)*Re,h+=(a-h)*Re,t.style.transform=`translate3d(${l}px, ${h}px, 0)`,s=requestAnimationFrame(j)},N=D=>{r=D.clientX+Me,a=D.clientY+Me,g||(l=r,h=a,g=!0,t.dataset.visible="true")},M=()=>{g=!1,t.dataset.visible="false"};return window.addEventListener("mousemove",N,{passive:!0}),document.documentElement.addEventListener("mouseleave",M),s=requestAnimationFrame(j),()=>{window.removeEventListener("mousemove",N),document.documentElement.removeEventListener("mouseleave",M),cancelAnimationFrame(s)}},[]),Ze.createPortal(n.jsx("div",{className:"ai-verity-layer",children:n.jsx("img",{ref:e,className:"ai-verity-cursor",src:Fn,alt:"","aria-hidden":"true"})}),xt())}function qn({artifacts:e,onClose:t}){var h;const[s,r]=o.useState(((h=e[e.length-1])==null?void 0:h.id)??""),a=e.find(g=>g.id===s)??e[e.length-1],l=o.useMemo(()=>URL.createObjectURL(new Blob([(a==null?void 0:a.html)||"<!doctype html><title></title>"],{type:"text/html"})),[a==null?void 0:a.id,a==null?void 0:a.html]);return o.useEffect(()=>()=>URL.revokeObjectURL(l),[l]),a?n.jsxs("aside",{className:"ai-artifact",children:[n.jsxs("header",{className:"ai-artifact-head",children:[n.jsx(bt,{size:14}),n.jsx("nav",{className:"ai-artifact-tabs",children:e.map(g=>n.jsx("button",{type:"button",className:g.id===a.id?"on":"",onClick:()=>r(g.id),children:g.title||"Preview"},g.id))}),n.jsx("a",{className:"ai-act",href:l,target:"_blank",rel:"noreferrer",children:"Open"}),n.jsx("button",{type:"button",className:"ai-act","aria-label":"Close preview",onClick:t,children:n.jsx(re,{size:14})})]}),n.jsx("iframe",{className:"ai-artifact-frame",title:a.title||"Artifact",sandbox:"allow-scripts",src:l})]}):null}const ae=["What is the capital of france","What does a cow say","How do i become exit liquidity?","Plan a 3-day trip to Tokyo","Summarize the plot of Hamlet","Give me a 20-minute HIIT workout","Explain how HTTPS works","Suggest a name for my startup","What's the difference between TCP and UDP?","Recommend three sci-fi books","Turn this idea into a to-do list","Explain Docker like I'm five"];function Xn({account:e,onOpenAccount:t}){const s=_t(),[r,a]=o.useState(null),[l,h]=o.useState(!1),[g,j]=o.useState(()=>qe(be("ai.model")??V)),[N,M]=o.useState(()=>{const u=be("ai.thinking");return We(u)?u:ce}),[D,f]=o.useState(!1),[x,w]=o.useState(!1),[y,b]=o.useState(!0),k=Qt(s,g,N,a),T=o.useRef(null),p=On({onAsk:async(u,d,i)=>{const E=new AbortController,I=[{role:"user",content:[{type:"text",text:u},{type:"image_url",image_url:{url:d}}]}],P=Ve(le,N);try{await He({model:le,web_search:!1,screen:!0,messages:I,...P?{reasoning_effort:P}:{}},E.signal,i.onDelta),i.onComplete()}catch(z){i.onError(z instanceof Error?z.message:"Could not ask about your screen.")}}}),c=()=>{if(p.mode!=="closed"){p.close();return}p.start()};o.useEffect(()=>{ye("ai.model",g)},[g]),o.useEffect(()=>{ye("ai.thinking",N)},[N]),o.useEffect(()=>{const u=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),h(i=>!i))};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]);const v=s.activeThread,S=(v==null?void 0:v.messages)??[],[_]=o.useState(()=>Math.floor(Math.random()*ae.length)),C=Array.from({length:4},(u,d)=>ae[(_+d)%ae.length]);o.useEffect(()=>{const u=T.current;u&&(u.scrollTop=u.scrollHeight)},[S]);const m=D&&e.isPlus,A=(u,d,i)=>{k.send(u,d,i,m)},L=S[S.length-1],R=!k.isStreaming&&(L==null?void 0:L.role)==="assistant"&&!L.error;return n.jsxs("div",{className:"ai",children:[n.jsx(Hn,{}),n.jsx(xn,{threads:s.threads,activeId:s.activeId,streaming:k.isStreaming,isPlus:e.isPlus,screenSharing:p.isSharing,screenError:p.error,onToggleScreen:()=>void c(),onOpenSearch:()=>h(!0),onNew:s.startNew,onSelect:s.select,onRemove:s.remove,onRename:s.rename,onUpgrade:()=>a({code:"manual",reason:null})}),n.jsxs("div",{className:"ai-main",children:[n.jsx("div",{className:"ai-scroll",ref:T,children:S.length===0?n.jsxs("div",{className:"ai-empty",children:[n.jsx("h1",{className:"ai-empty-title",children:"How can Verity help?"}),n.jsx("p",{className:"ai-empty-sub",children:"Use the globe for live web search with Plus."}),n.jsx("div",{className:"ai-suggestions",children:C.map(u=>n.jsx("button",{type:"button",className:"ai-suggestion",onClick:()=>A(u,[],[]),children:u},u))},_)]}):n.jsx("div",{className:"ai-messages",children:S.map((u,d)=>n.jsx(ln,{message:u,canRegenerate:R&&d===S.length-1,onRegenerate:()=>k.regenerate(m,u.id),onEdit:u.role==="user"&&!k.isStreaming?i=>k.editResend(u.id,i,m):void 0,onSetVersion:i=>k.setVersion(u.id,i),onAskPick:i=>A(i,[],[])},u.id))})}),k.error&&n.jsx("div",{className:"ai-banner",children:k.error}),n.jsx(hn,{disabled:!s.loaded,isStreaming:k.isStreaming,webSearch:m,searchLocked:!e.isPlus,onToggleWebSearch:()=>{if(!e.isPlus){w(!0);return}f(u=>!u)},onSend:A,onStop:k.stop,modelSlot:n.jsx(Sn,{value:g,onChange:j,thinking:N,onThinkingChange:M})})]}),l&&n.jsx(vn,{threads:s.threads,onSelect:s.select,onClose:()=>h(!1)}),p.mode==="inpage"&&n.jsx("div",{className:"ai-screen-panel",ref:p.panelRef,children:n.jsx(Ge,{tokens:ue(),isSharing:p.isSharing,isAsking:p.isAsking,output:p.output,error:p.askError??p.error,onAsk:u=>void p.ask(u),onClose:p.close,onPopOut:()=>void p.popOut()})}),y&&S.some(u=>{var d;return(d=u.artifacts)==null?void 0:d.length})&&n.jsx(qn,{artifacts:S.flatMap(u=>u.artifacts??[]),onClose:()=>b(!1)}),n.jsx(yt,{open:!!r||x,onClose:()=>{a(null),w(!1)},account:e,heading:x?"Web search needs Lucide Plus":(r==null?void 0:r.code)==="rate_limit"?r.reason==="minute"?"Slow down a moment":"You've hit your daily AI limit":void 0,blurb:x?"Live web search is a Plus perk. Plus also includes 3M tokens/day and 50 messages a minute.":(r==null?void 0:r.code)==="rate_limit"?r.reason==="minute"?"Free accounts get 5 messages a minute. Lucide Plus raises that to 50/min — plus a 3M token/day budget.":"Free accounts get 60k AI tokens a day. Lucide Plus gives 3M tokens/day and 50/min.":void 0,onSignUp:()=>{a(null),w(!1),t==null||t()}})]})}export{Xn as AiPage};
18
+ `,t.head.append(r)}if(!t.getElementById("_1u0ijh5")){const r=t.createElement("link");r.id="_1u0ijh5",r.rel="stylesheet",r.href=En,t.head.append(r)}const s=t.createElement("div");return s.style.width="100%",s.style.display="block",t.body.append(s),s}function Ln(){return new Promise(e=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>e())})})}function An({onError:e,onStateChange:t}){const[s,r]=o.useState(!1),a=o.useRef(null),l=o.useRef(null),h=o.useRef(null),g=o.useRef(!1),j=o.useCallback(()=>{if(l.current)return l.current;const f=document.createElement("video");return f.muted=!0,f.autoplay=!0,f.playsInline=!0,l.current=f,f},[]),N=o.useCallback(()=>{const f=a.current;if(f)for(const x of f.getTracks())x.stop();a.current=null,l.current&&(l.current.srcObject=null),h.current=null,g.current=!1,r(!1),t()},[t]),M=o.useCallback(async f=>{if(a.current)return!0;try{const w=await(f??window).navigator.mediaDevices.getDisplayMedia(Cn);w.getVideoTracks()[0].addEventListener("ended",()=>N());const b=j();return b.srcObject=w,await b.play().catch(()=>{}),a.current=w,g.current=!0,r(!0),t(),!0}catch(x){const w=x instanceof Error?x.message:"Could not start screen sharing";return e(w),!1}},[j,e,t,N]),D=o.useCallback(async()=>{if(!a.current)throw new Error("Screen sharing is not active");const f=j();(!f.videoWidth||!f.videoHeight)&&await new Promise((S,_)=>{const C=window.setTimeout(()=>_(new Error("Timed out waiting for screen frame")),1200),m=()=>{window.clearTimeout(C),f.removeEventListener("loadeddata",m),S()};f.addEventListener("loadeddata",m)});const x=Math.max(1,f.videoWidth),w=Math.max(1,f.videoHeight),y=960,b=x>y?y/x:1,k=Math.max(1,Math.round(x*b)),T=Math.max(1,Math.round(w*b)),p=h.current??document.createElement("canvas");h.current=p,p.width=k,p.height=T;const c=p.getContext("2d");if(!c)throw new Error("Canvas context unavailable");c.drawImage(f,0,0,k,T);const v=await new Promise(S=>p.toBlob(S,"image/jpeg",.72));return v?await new Promise((S,_)=>{const C=new FileReader;C.onload=()=>{typeof C.result=="string"?S(C.result):_(new Error("Failed to encode screen capture"))},C.onerror=()=>_(new Error("Failed to encode screen capture")),C.readAsDataURL(v)}):p.toDataURL("image/jpeg",.72)},[j]);return{isSharing:s,isSharingRef:g,streamRef:a,startSharing:M,stopSharing:N,captureFrameDataUrl:D}}const In=380,Dn=240,_n=820,Pn=150;function $n(e){const t=e.document.body.firstElementChild;return t instanceof HTMLElement?Math.ceil(t.getBoundingClientRect().height):0}function de(e){try{if(e.closed)return;const t=$n(e)-e.innerHeight;if(Math.abs(t)<=1)return;const s=Math.min(_n,Math.max(Pn,e.outerHeight+t));s!==e.outerHeight&&e.resizeTo(e.outerWidth,s)}catch{}}function zn(e){try{e.requestAnimationFrame(()=>{de(e),e.setTimeout(()=>e.requestAnimationFrame(()=>de(e)),90)})}catch{}}function On({onAsk:e}){const[t,s]=o.useState("closed"),[r,a]=o.useState(""),[l,h]=o.useState(!1),[g,j]=o.useState(null),[N,M]=o.useState(null),[D,f]=o.useState(le),x=o.useRef(null),w=o.useRef(null),y=o.useRef(!1);y.current=l;const b=o.useCallback(d=>M(d),[]),k=o.useCallback(()=>{},[]),{isSharing:T,isSharingRef:p,streamRef:c,startSharing:v,stopSharing:S,captureFrameDataUrl:_}=An({onError:b,onStateChange:k}),C=o.useCallback(()=>{var i;const d=x.current;if(x.current=null,d){(i=d.resizeObserver)==null||i.disconnect(),window.setTimeout(()=>d.root.unmount(),0);try{d.window.close()}catch{}}},[]),m=o.useCallback(()=>{C(),S(),s("closed"),a(""),j(null)},[C,S]),A=o.useCallback(async d=>{var P,z,$;if(y.current)return;const i=d.trim();if(!i){j("Type a question first.");return}if(!p.current){j("Start screen sharing first.");return}h(!0),j(null),a("Thinking…");const E=x.current,I=(E==null?void 0:E.mountElement)??w.current;try{const q=(($=(z=(P=c.current)==null?void 0:P.getVideoTracks()[0])==null?void 0:z.getSettings())==null?void 0:$.displaySurface)==="monitor"&&I;q&&(I.style.visibility="hidden",await Ln());const Xe=await _();q&&(I.style.visibility="visible",E==null||E.window.focus());let xe=!1,X="";await e(i,Xe,{onDelta:U=>{xe||(X="",xe=!0),X+=U,a(X),j(null)},onError:U=>{a(U),j(U)},onComplete:()=>h(!1)})}catch(O){I&&(I.style.visibility="visible");const q=O instanceof Error?O.message:"Failed to ask about screen";a(q),j(q)}finally{h(!1)}},[_,p,e,c]),L=o.useCallback(()=>{var d;if(p.current){S();return}v(t==="window"?(d=x.current)==null?void 0:d.window:window)},[p,t,v,S]);o.useEffect(()=>{if(t!=="window")return;const d=x.current;if(!d)return;const i=ue(),E=d.window.document;E.documentElement.style.background=i.bg,E.body.style.background=i.bg,E.body.style.margin="0",E.body.style.padding="0",E.documentElement.style.setProperty("--assistant-border",i.border),E.documentElement.style.setProperty("--assistant-code-bg",`color-mix(in srgb, ${i.surface} 78%, black 22%)`),E.documentElement.style.setProperty("--assistant-accent",i.accent),d.root.render(n.jsx(Ge,{tokens:i,isSharing:T,isAsking:l,output:r,error:g,onAsk:I=>void A(I),onClose:m})),zn(d.window)},[t,T,l,r,g,A,m]);const R=o.useCallback(async()=>{const d=Tn(),i=d.documentPictureInPicture;let E=null;if(i!=null&&i.requestWindow)try{E=await i.requestWindow({width:In,height:Dn,disallowReturnToOpener:!0,preferInitialWindowPlacement:!0})}catch{E=null}if(!E)try{E=Mn(d)}catch{E=null}if(!E){s("inpage");return}const I=Rn(E),P=Qe.createRoot(I),z=E.ResizeObserver,$=z?new z(()=>de(E)):null;$==null||$.observe(I),x.current={window:E,root:P,mountElement:I,resizeObserver:$},E.addEventListener("pagehide",()=>{var O;((O=x.current)==null?void 0:O.window)===E&&m()},{once:!0}),s("window")},[m]),u=o.useCallback(async()=>{if(!p.current){if(!await v(window))return;M(null)}await R()},[p,v,R]);return o.useEffect(()=>()=>{C(),S()},[C,S]),{isSharing:T,mode:t,error:N,output:r,isAsking:l,askError:g,selectedModel:D,panelRef:w,start:u,popOut:R,stop:S,close:m,ask:A,toggleSharing:L,setSelectedModel:f,tokens:ue}}const Fn=""+new URL("verity-mini-DjLHPujK.png",import.meta.url).href,Me=16,Re=.14;function Hn(){const e=o.useRef(null);return o.useEffect(()=>{const t=e.current;if(!t)return;let s=0,r=0,a=0,l=0,h=0,g=!1;const j=()=>{l+=(r-l)*Re,h+=(a-h)*Re,t.style.transform=`translate3d(${l}px, ${h}px, 0)`,s=requestAnimationFrame(j)},N=D=>{r=D.clientX+Me,a=D.clientY+Me,g||(l=r,h=a,g=!0,t.dataset.visible="true")},M=()=>{g=!1,t.dataset.visible="false"};return window.addEventListener("mousemove",N,{passive:!0}),document.documentElement.addEventListener("mouseleave",M),s=requestAnimationFrame(j),()=>{window.removeEventListener("mousemove",N),document.documentElement.removeEventListener("mouseleave",M),cancelAnimationFrame(s)}},[]),Ze.createPortal(n.jsx("div",{className:"ai-verity-layer",children:n.jsx("img",{ref:e,className:"ai-verity-cursor",src:Fn,alt:"","aria-hidden":"true"})}),xt())}function qn({artifacts:e,onClose:t}){var h;const[s,r]=o.useState(((h=e[e.length-1])==null?void 0:h.id)??""),a=e.find(g=>g.id===s)??e[e.length-1],l=o.useMemo(()=>URL.createObjectURL(new Blob([(a==null?void 0:a.html)||"<!doctype html><title></title>"],{type:"text/html"})),[a==null?void 0:a.id,a==null?void 0:a.html]);return o.useEffect(()=>()=>URL.revokeObjectURL(l),[l]),a?n.jsxs("aside",{className:"ai-artifact",children:[n.jsxs("header",{className:"ai-artifact-head",children:[n.jsx(bt,{size:14}),n.jsx("nav",{className:"ai-artifact-tabs",children:e.map(g=>n.jsx("button",{type:"button",className:g.id===a.id?"on":"",onClick:()=>r(g.id),children:g.title||"Preview"},g.id))}),n.jsx("a",{className:"ai-act",href:l,target:"_blank",rel:"noreferrer",children:"Open"}),n.jsx("button",{type:"button",className:"ai-act","aria-label":"Close preview",onClick:t,children:n.jsx(re,{size:14})})]}),n.jsx("iframe",{className:"ai-artifact-frame",title:a.title||"Artifact",sandbox:"allow-scripts",src:l})]}):null}const ae=["What is the capital of france","What does a cow say","How do i become exit liquidity?","Plan a 3-day trip to Tokyo","Summarize the plot of Hamlet","Give me a 20-minute HIIT workout","Explain how HTTPS works","Suggest a name for my startup","What's the difference between TCP and UDP?","Recommend three sci-fi books","Turn this idea into a to-do list","Explain Docker like I'm five"];function Xn({account:e,onOpenAccount:t}){const s=_t(),[r,a]=o.useState(null),[l,h]=o.useState(!1),[g,j]=o.useState(()=>qe(be("ai.model")??V)),[N,M]=o.useState(()=>{const u=be("ai.thinking");return We(u)?u:ce}),[D,f]=o.useState(!1),[x,w]=o.useState(!1),[y,b]=o.useState(!0),k=Qt(s,g,N,a),T=o.useRef(null),p=On({onAsk:async(u,d,i)=>{const E=new AbortController,I=[{role:"user",content:[{type:"text",text:u},{type:"image_url",image_url:{url:d}}]}],P=Ve(le,N);try{await He({model:le,web_search:!1,screen:!0,messages:I,...P?{reasoning_effort:P}:{}},E.signal,i.onDelta),i.onComplete()}catch(z){i.onError(z instanceof Error?z.message:"Could not ask about your screen.")}}}),c=()=>{if(p.mode!=="closed"){p.close();return}p.start()};o.useEffect(()=>{ye("ai.model",g)},[g]),o.useEffect(()=>{ye("ai.thinking",N)},[N]),o.useEffect(()=>{const u=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),h(i=>!i))};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]);const v=s.activeThread,S=(v==null?void 0:v.messages)??[],[_]=o.useState(()=>Math.floor(Math.random()*ae.length)),C=Array.from({length:4},(u,d)=>ae[(_+d)%ae.length]);o.useEffect(()=>{const u=T.current;u&&(u.scrollTop=u.scrollHeight)},[S]);const m=D&&e.isPlus,A=(u,d,i)=>{k.send(u,d,i,m)},L=S[S.length-1],R=!k.isStreaming&&(L==null?void 0:L.role)==="assistant"&&!L.error;return n.jsxs("div",{className:"ai",children:[n.jsx(Hn,{}),n.jsx(xn,{threads:s.threads,activeId:s.activeId,streaming:k.isStreaming,isPlus:e.isPlus,screenSharing:p.isSharing,screenError:p.error,onToggleScreen:()=>void c(),onOpenSearch:()=>h(!0),onNew:s.startNew,onSelect:s.select,onRemove:s.remove,onRename:s.rename,onUpgrade:()=>a({code:"manual",reason:null})}),n.jsxs("div",{className:"ai-main",children:[n.jsx("div",{className:"ai-scroll",ref:T,children:S.length===0?n.jsxs("div",{className:"ai-empty",children:[n.jsx("h1",{className:"ai-empty-title",children:"How can Verity help?"}),n.jsx("p",{className:"ai-empty-sub",children:"Use the globe for live web search with Plus."}),n.jsx("div",{className:"ai-suggestions",children:C.map(u=>n.jsx("button",{type:"button",className:"ai-suggestion",onClick:()=>A(u,[],[]),children:u},u))},_)]}):n.jsx("div",{className:"ai-messages",children:S.map((u,d)=>n.jsx(ln,{message:u,canRegenerate:R&&d===S.length-1,onRegenerate:()=>k.regenerate(m,u.id),onEdit:u.role==="user"&&!k.isStreaming?i=>k.editResend(u.id,i,m):void 0,onSetVersion:i=>k.setVersion(u.id,i),onAskPick:i=>A(i,[],[])},u.id))})}),k.error&&n.jsx("div",{className:"ai-banner",children:k.error}),n.jsx(hn,{disabled:!s.loaded,isStreaming:k.isStreaming,webSearch:m,searchLocked:!e.isPlus,onToggleWebSearch:()=>{if(!e.isPlus){w(!0);return}f(u=>!u)},onSend:A,onStop:k.stop,modelSlot:n.jsx(Sn,{value:g,onChange:j,thinking:N,onThinkingChange:M})})]}),l&&n.jsx(vn,{threads:s.threads,onSelect:s.select,onClose:()=>h(!1)}),p.mode==="inpage"&&n.jsx("div",{className:"ai-screen-panel",ref:p.panelRef,children:n.jsx(Ge,{tokens:ue(),isSharing:p.isSharing,isAsking:p.isAsking,output:p.output,error:p.askError??p.error,onAsk:u=>void p.ask(u),onClose:p.close,onPopOut:()=>void p.popOut()})}),y&&S.some(u=>{var d;return(d=u.artifacts)==null?void 0:d.length})&&n.jsx(qn,{artifacts:S.flatMap(u=>u.artifacts??[]),onClose:()=>b(!1)}),n.jsx(yt,{open:!!r||x,onClose:()=>{a(null),w(!1)},account:e,heading:x?"Web search needs IGNITE OS BROWSER Plus":(r==null?void 0:r.code)==="rate_limit"?r.reason==="minute"?"Slow down a moment":"You've hit your daily AI limit":void 0,blurb:x?"Live web search is a Plus perk. Plus also includes 3M tokens/day and 50 messages a minute.":(r==null?void 0:r.code)==="rate_limit"?r.reason==="minute"?"Free accounts get 5 messages a minute. IGNITE OS BROWSER Plus raises that to 50/min — plus a 3M token/day budget.":"Free accounts get 60k AI tokens a day. IGNITE OS BROWSER Plus gives 3M tokens/day and 50/min.":void 0,onSignUp:()=>{a(null),w(!1),t==null||t()}})]})}export{Xn as AiPage};
@@ -1 +1 @@
1
- import{r as d,j as s}from"./react-BNEptbwn-8068ec8f.js";import{a0 as u,V as p}from"./index-COUSXtyQ-8068ec8f.js";/* empty css *//* empty css */import"./motion-B1hdS1Lc-8068ec8f.js";const h=["No ads","3M AI tokens/day","Exclusive Plus links","Discord Plus role"];function y({account:e,onOpenAccount:a}){var r;const[t,n]=d.useState(!1),l=e.status==="signed-in",c=e.isPlus,o=async()=>{var i;if(!l){a();return}n(!0);try{await e.checkout(((i=e.user)==null?void 0:i.email)??void 0)}finally{n(!1)}};return s.jsx("div",{className:"settings-page plus-page",children:s.jsxs("div",{className:"settings-page-inner",children:[s.jsxs("div",{className:"settings-page-head",children:[s.jsxs("h1",{children:["Lucide",s.jsx("span",{className:"plus-page-mark",children:"+"})]}),s.jsx("p",{children:"Remove ads, unlock 3M AI tokens/day, and get Discord perks."})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"What you get"}),s.jsx("ul",{className:"plus-page-perks",children:h.map(i=>s.jsx("li",{children:i},i))}),s.jsx("p",{className:"plus-page-price",children:"$6.99 / month · cancel anytime"})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Get Plus"}),e.status==="loading"?s.jsx("p",{className:"plus-page-hint",children:"Checking your account…"}):c?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"plus-page-hint",children:"You're already on Lucide Plus."}),s.jsx("button",{type:"button",className:"account-btn ghost",onClick:()=>void e.manageBilling(),children:"Manage billing"})]}):l?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"plus-page-hint",children:["Signed in as ",(r=e.user)==null?void 0:r.email,". Continue to Stripe to subscribe."]}),s.jsx(u,{}),e.authError&&s.jsx("div",{className:"account-error",children:e.authError}),s.jsx("button",{type:"button",className:"account-btn primary",disabled:t,onClick:()=>void o(),children:t?"Opening Stripe…":"Upgrade to Plus"})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"plus-page-hint",children:"Create a Lucide account first, then you can buy Plus."}),s.jsx("button",{type:"button",className:"account-btn primary",onClick:a,children:"Create an account"})]})]}),s.jsxs("div",{className:"settings-page-foot",children:[s.jsx(p,{size:14}),s.jsx("span",{children:"Lucide"})]})]})})}export{y as PlusPage};
1
+ import{r as d,j as s}from"./react-BNEptbwn-8068ec8f.js";import{a0 as u,V as p}from"./index-COUSXtyQ-8068ec8f.js";/* empty css *//* empty css */import"./motion-B1hdS1Lc-8068ec8f.js";const h=["No ads","3M AI tokens/day","Exclusive Plus links","Discord Plus role"];function y({account:e,onOpenAccount:a}){var r;const[t,n]=d.useState(!1),l=e.status==="signed-in",c=e.isPlus,o=async()=>{var i;if(!l){a();return}n(!0);try{await e.checkout(((i=e.user)==null?void 0:i.email)??void 0)}finally{n(!1)}};return s.jsx("div",{className:"settings-page plus-page",children:s.jsxs("div",{className:"settings-page-inner",children:[s.jsxs("div",{className:"settings-page-head",children:[s.jsxs("h1",{children:["IGNITE OS BROWSER",s.jsx("span",{className:"plus-page-mark",children:"+"})]}),s.jsx("p",{children:"Remove ads, unlock 3M AI tokens/day, and get Discord perks."})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"What you get"}),s.jsx("ul",{className:"plus-page-perks",children:h.map(i=>s.jsx("li",{children:i},i))}),s.jsx("p",{className:"plus-page-price",children:"$6.99 / month · cancel anytime"})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("div",{className:"settings-section-title",children:"Get Plus"}),e.status==="loading"?s.jsx("p",{className:"plus-page-hint",children:"Checking your account…"}):c?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"plus-page-hint",children:"You're already on IGNITE OS BROWSER Plus."}),s.jsx("button",{type:"button",className:"account-btn ghost",onClick:()=>void e.manageBilling(),children:"Manage billing"})]}):l?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"plus-page-hint",children:["Signed in as ",(r=e.user)==null?void 0:r.email,". Continue to Stripe to subscribe."]}),s.jsx(u,{}),e.authError&&s.jsx("div",{className:"account-error",children:e.authError}),s.jsx("button",{type:"button",className:"account-btn primary",disabled:t,onClick:()=>void o(),children:t?"Opening Stripe…":"Upgrade to Plus"})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"plus-page-hint",children:"Create a IGNITE OS BROWSER account first, then you can buy Plus."}),s.jsx("button",{type:"button",className:"account-btn primary",onClick:a,children:"Create an account"})]})]}),s.jsxs("div",{className:"settings-page-foot",children:[s.jsx(p,{size:14}),s.jsx("span",{children:"IGNITE OS BROWSER"})]})]})})}export{y as PlusPage};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./react-BNEptbwn-8068ec8f.js";import{A as S,B as A,D as L,F as N,H as P,J as T,K as _,N as R,O as F,Q as B,V as D,W as w,X as O,Y as k,Z as I,_ as C}from"./index-COUSXtyQ-8068ec8f.js";/* empty css */import"./motion-B1hdS1Lc-8068ec8f.js";const p="__auto__",f="__custom__";function U(){const t=l.useMemo(()=>S(),[]),i=l.useMemo(()=>A(),[]),a=R(),r=L(),o=t.includes(a)||i.includes(a),[d,h]=l.useState(()=>r&&!!a&&!o),[x,v]=l.useState(()=>r&&a&&!o?a:""),[g,m]=l.useState(null),j=d?f:r&&a&&o?a:p;return e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Backend"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"API host"}),e.jsxs("div",{className:"settings-row-hint",children:["Using ",a?N(a):"this site",r?" (pinned)":" (auto)","."]})]}),e.jsxs("select",{className:"settings-select",value:j,onChange:n=>{const u=n.target.value;if(m(null),u===p){P(),location.reload();return}if(u===f){h(!0),v(a&&!t.includes(a)?a:"");return}h(!1),T(u)&&location.reload()},children:[e.jsx("option",{value:p,children:"Auto"}),t.map(n=>e.jsx("option",{value:n,children:N(n)},n)),i.map(n=>e.jsx("option",{value:n,children:N(n)},n)),e.jsx("option",{value:f,children:"Custom…"})]})]}),d&&e.jsx("div",{className:"settings-field-grid",children:e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Custom URL"}),e.jsxs("div",{className:"settings-row",style:{gap:8},children:[e.jsx("input",{className:"settings-input",style:{flex:1},value:x,placeholder:"https://example.com",onChange:n=>v(n.target.value)}),e.jsx("button",{type:"button",className:"settings-danger",onClick:()=>{if(!_(x)){m("Enter a valid http(s) URL.");return}location.reload()},children:"Save"})]}),g&&e.jsx("span",{className:"settings-field-label",style:{color:"#f87171"},children:g})]})})]})}const M=["#ffffff","#4c8dff","#a06cff","#3dd68c","#ffd75c","#ff9a3d","#ff6c9a","#ff5c5c"];function H(t){return t===" "?"Space":t==="`"?"` (backtick)":t.length===1?t.toUpperCase():t}function $({settings:t,onUpdate:i,onClearData:a,showPlusCta:r,onUpgradePlus:o}){const[d,h]=l.useState(!1),[x,v]=l.useState(t.exitUrl),[g,m]=l.useState(null),[j,n]=l.useState(null);l.useEffect(()=>v(t.exitUrl),[t.exitUrl]),l.useEffect(()=>{if(!d)return;C(!0);const s=c=>{c.preventDefault(),c.stopPropagation(),i({exitKey:c.key}),h(!1)};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),C(!1)}},[d,i]);const u=s=>{if(s==="custom"||s==="none")i({coverPreset:s,coverTitle:s==="none"?"":t.coverTitle,coverFavicon:s==="none"?"":t.coverFavicon});else{const c=O(s);i({coverPreset:s,coverTitle:c.title,coverFavicon:c.favicon})}},y=()=>{const s=k(x);if(!s.valid||!s.value){m(s.error??"Invalid URL");return}m(null),i({exitUrl:s.value})},E=()=>{const s=k(t.exitUrl),c=s.valid&&s.value?s.value:"https://docs.google.com/document/u/0/",b=I(c,t.coverTitle,t.coverFavicon);n(b.ok?"Opened — this tab will redirect.":b.error??"Failed to open.")};return e.jsx("div",{className:"settings-page",children:e.jsxs("div",{className:"settings-page-inner",children:[e.jsxs("div",{className:"settings-page-head",children:[e.jsx("h1",{children:"Settings"}),e.jsx("p",{children:"Search, tab cover, and privacy for your Lucide browser."})]}),e.jsx(U,{}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Browsing"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Block ads on proxied sites"}),e.jsx("div",{className:"settings-row-hint",children:"Uses DNS to filter ads. Turn off if a site will not load."})]}),e.jsxs("label",{className:"settings-switch",children:[e.jsx("input",{type:"checkbox",checked:t.adblock,onChange:s=>i({adblock:s.target.checked})}),e.jsx("span",{})]})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Search"}),e.jsxs("div",{className:"settings-row",children:[e.jsx("div",{className:"settings-row-label",children:"Search engine"}),e.jsx("select",{className:"settings-select",value:t.searchEngineId,onChange:s=>i({searchEngineId:s.target.value}),children:F.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Appearance"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Background"}),e.jsx("div",{className:"settings-row-hint",children:"Choose the animated veil or a lightweight static background."})]}),e.jsxs("select",{className:"settings-select",value:t.backgroundMode,onChange:s=>i({backgroundMode:s.target.value}),children:[e.jsx("option",{value:"full",children:"DarkVeil"}),e.jsx("option",{value:"reduced",children:"DarkVeil (reduced)"}),e.jsx("option",{value:"mesh",children:"CSS mesh (faster)"}),e.jsx("option",{value:"off",children:"Off (fastest)"})]})]}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Accent color"}),e.jsx("div",{className:"settings-row-hint",children:"Tints the wordmark, borders, and focus rings."})]}),e.jsx("div",{className:"settings-swatches",children:M.map(s=>e.jsx("button",{type:"button",className:`settings-swatch ${t.accent.toLowerCase()===s?"active":""}`,style:{background:s},"aria-label":`Accent ${s}`,onClick:()=>i({accent:s})},s))})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Tab cover"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Tab disguise"}),e.jsx("div",{className:"settings-row-hint",children:"Change the tab's title and icon to blend in."})]}),e.jsx("select",{className:"settings-select",value:t.coverPreset,onChange:s=>u(s.target.value),children:B.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))})]}),e.jsxs("div",{className:"settings-field-grid",children:[e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Tab title"}),e.jsx("input",{className:"settings-input",value:t.coverTitle,placeholder:"Lucide",onChange:s=>i({coverTitle:s.target.value,coverPreset:"custom"})})]}),e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Favicon URL"}),e.jsx("input",{className:"settings-input",value:t.coverFavicon,placeholder:"https://…/favicon.ico",onChange:s=>i({coverFavicon:s.target.value,coverPreset:"custom"})})]})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Quick exit"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Exit key"}),e.jsxs("div",{className:"settings-row-hint",children:["Press this key anywhere to instantly bail to the exit URL. Current: ",H(t.exitKey)]})]}),e.jsx("button",{type:"button",className:"settings-danger",onClick:()=>h(s=>!s),children:d?"Press any key…":"Set key"})]}),e.jsx("div",{className:"settings-field-grid",children:e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Exit URL"}),e.jsxs("div",{className:"settings-row",style:{gap:8},children:[e.jsx("input",{className:"settings-input",style:{flex:1},value:x,onChange:s=>v(s.target.value),placeholder:"https://classroom.google.com"}),e.jsx("button",{type:"button",className:"settings-danger",onClick:y,children:"Save"})]}),g&&e.jsx("span",{className:"settings-field-label",style:{color:"#f87171"},children:g})]})}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Confirm before leaving"}),e.jsx("div",{className:"settings-row-hint",children:"Prompt when closing or navigating away."})]}),e.jsxs("label",{className:"settings-switch",children:[e.jsx("input",{type:"checkbox",checked:t.confirmLeave,onChange:s=>i({confirmLeave:s.target.checked})}),e.jsx("span",{})]})]}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Auto cover tab"}),e.jsx("div",{className:"settings-row-hint",children:"On your next interaction, move the _9gmixa5 into a decoy tab and redirect this one."})]}),e.jsxs("label",{className:"settings-switch",children:[e.jsx("input",{type:"checkbox",checked:t.autoCoverFrame,onChange:s=>i({autoCoverFrame:s.target.checked})}),e.jsx("span",{})]})]}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Open cover tab now"}),j&&e.jsx("div",{className:"settings-row-hint",children:j})]}),e.jsx("button",{type:"button",className:"settings-danger",onClick:E,children:"Open"})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Data"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Clear data"}),e.jsx("div",{className:"settings-row-hint",children:"Removes saved tabs, bookmarks, and settings."})]}),e.jsx("button",{className:"settings-danger",type:"button",onClick:a,children:"Clear"})]})]}),r&&o&&e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Lucide Plus"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Go ad-free"}),e.jsx("div",{className:"settings-row-hint",children:"Remove ads, unlock 3M AI tokens/day, and get exclusive links."})]}),e.jsx("button",{type:"button",className:"settings-upgrade",onClick:o,children:"Upgrade"})]})]}),e.jsxs("div",{className:"settings-page-foot",children:[e.jsx(D,{size:14}),e.jsx("span",{children:"Lucide"}),e.jsx("span",{children:"·"}),e.jsx("a",{href:w("terms.html"),target:"_blank",rel:"noreferrer",children:"Terms"}),e.jsx("span",{children:"·"}),e.jsx("a",{href:w("privacy.html"),target:"_blank",rel:"noreferrer",children:"Privacy"})]})]})})}export{$ as SettingsPage};
1
+ import{r as l,j as e}from"./react-BNEptbwn-8068ec8f.js";import{A as S,B as A,D as L,F as N,H as P,J as T,K as _,N as R,O as F,Q as B,V as D,W as w,X as O,Y as k,Z as I,_ as C}from"./index-COUSXtyQ-8068ec8f.js";/* empty css */import"./motion-B1hdS1Lc-8068ec8f.js";const p="__auto__",f="__custom__";function U(){const t=l.useMemo(()=>S(),[]),i=l.useMemo(()=>A(),[]),a=R(),r=L(),o=t.includes(a)||i.includes(a),[d,h]=l.useState(()=>r&&!!a&&!o),[x,v]=l.useState(()=>r&&a&&!o?a:""),[g,m]=l.useState(null),j=d?f:r&&a&&o?a:p;return e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Backend"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"API host"}),e.jsxs("div",{className:"settings-row-hint",children:["Using ",a?N(a):"this site",r?" (pinned)":" (auto)","."]})]}),e.jsxs("select",{className:"settings-select",value:j,onChange:n=>{const u=n.target.value;if(m(null),u===p){P(),location.reload();return}if(u===f){h(!0),v(a&&!t.includes(a)?a:"");return}h(!1),T(u)&&location.reload()},children:[e.jsx("option",{value:p,children:"Auto"}),t.map(n=>e.jsx("option",{value:n,children:N(n)},n)),i.map(n=>e.jsx("option",{value:n,children:N(n)},n)),e.jsx("option",{value:f,children:"Custom…"})]})]}),d&&e.jsx("div",{className:"settings-field-grid",children:e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Custom URL"}),e.jsxs("div",{className:"settings-row",style:{gap:8},children:[e.jsx("input",{className:"settings-input",style:{flex:1},value:x,placeholder:"https://example.com",onChange:n=>v(n.target.value)}),e.jsx("button",{type:"button",className:"settings-danger",onClick:()=>{if(!_(x)){m("Enter a valid http(s) URL.");return}location.reload()},children:"Save"})]}),g&&e.jsx("span",{className:"settings-field-label",style:{color:"#f87171"},children:g})]})})]})}const M=["#ffffff","#4c8dff","#a06cff","#3dd68c","#ffd75c","#ff9a3d","#ff6c9a","#ff5c5c"];function H(t){return t===" "?"Space":t==="`"?"` (backtick)":t.length===1?t.toUpperCase():t}function $({settings:t,onUpdate:i,onClearData:a,showPlusCta:r,onUpgradePlus:o}){const[d,h]=l.useState(!1),[x,v]=l.useState(t.exitUrl),[g,m]=l.useState(null),[j,n]=l.useState(null);l.useEffect(()=>v(t.exitUrl),[t.exitUrl]),l.useEffect(()=>{if(!d)return;C(!0);const s=c=>{c.preventDefault(),c.stopPropagation(),i({exitKey:c.key}),h(!1)};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),C(!1)}},[d,i]);const u=s=>{if(s==="custom"||s==="none")i({coverPreset:s,coverTitle:s==="none"?"":t.coverTitle,coverFavicon:s==="none"?"":t.coverFavicon});else{const c=O(s);i({coverPreset:s,coverTitle:c.title,coverFavicon:c.favicon})}},y=()=>{const s=k(x);if(!s.valid||!s.value){m(s.error??"Invalid URL");return}m(null),i({exitUrl:s.value})},E=()=>{const s=k(t.exitUrl),c=s.valid&&s.value?s.value:"https://docs.google.com/document/u/0/",b=I(c,t.coverTitle,t.coverFavicon);n(b.ok?"Opened — this tab will redirect.":b.error??"Failed to open.")};return e.jsx("div",{className:"settings-page",children:e.jsxs("div",{className:"settings-page-inner",children:[e.jsxs("div",{className:"settings-page-head",children:[e.jsx("h1",{children:"Settings"}),e.jsx("p",{children:"Search, tab cover, and privacy for your IGNITE OS BROWSER browser."})]}),e.jsx(U,{}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Browsing"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Block ads on proxied sites"}),e.jsx("div",{className:"settings-row-hint",children:"Uses DNS to filter ads. Turn off if a site will not load."})]}),e.jsxs("label",{className:"settings-switch",children:[e.jsx("input",{type:"checkbox",checked:t.adblock,onChange:s=>i({adblock:s.target.checked})}),e.jsx("span",{})]})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Search"}),e.jsxs("div",{className:"settings-row",children:[e.jsx("div",{className:"settings-row-label",children:"Search engine"}),e.jsx("select",{className:"settings-select",value:t.searchEngineId,onChange:s=>i({searchEngineId:s.target.value}),children:F.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Appearance"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Background"}),e.jsx("div",{className:"settings-row-hint",children:"Choose the animated veil or a lightweight static background."})]}),e.jsxs("select",{className:"settings-select",value:t.backgroundMode,onChange:s=>i({backgroundMode:s.target.value}),children:[e.jsx("option",{value:"full",children:"DarkVeil"}),e.jsx("option",{value:"reduced",children:"DarkVeil (reduced)"}),e.jsx("option",{value:"mesh",children:"CSS mesh (faster)"}),e.jsx("option",{value:"off",children:"Off (fastest)"})]})]}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Accent color"}),e.jsx("div",{className:"settings-row-hint",children:"Tints the wordmark, borders, and focus rings."})]}),e.jsx("div",{className:"settings-swatches",children:M.map(s=>e.jsx("button",{type:"button",className:`settings-swatch ${t.accent.toLowerCase()===s?"active":""}`,style:{background:s},"aria-label":`Accent ${s}`,onClick:()=>i({accent:s})},s))})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Tab cover"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Tab disguise"}),e.jsx("div",{className:"settings-row-hint",children:"Change the tab's title and icon to blend in."})]}),e.jsx("select",{className:"settings-select",value:t.coverPreset,onChange:s=>u(s.target.value),children:B.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))})]}),e.jsxs("div",{className:"settings-field-grid",children:[e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Tab title"}),e.jsx("input",{className:"settings-input",value:t.coverTitle,placeholder:"IGNITE OS BROWSER",onChange:s=>i({coverTitle:s.target.value,coverPreset:"custom"})})]}),e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Favicon URL"}),e.jsx("input",{className:"settings-input",value:t.coverFavicon,placeholder:"https://…/favicon.ico",onChange:s=>i({coverFavicon:s.target.value,coverPreset:"custom"})})]})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Quick exit"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Exit key"}),e.jsxs("div",{className:"settings-row-hint",children:["Press this key anywhere to instantly bail to the exit URL. Current: ",H(t.exitKey)]})]}),e.jsx("button",{type:"button",className:"settings-danger",onClick:()=>h(s=>!s),children:d?"Press any key…":"Set key"})]}),e.jsx("div",{className:"settings-field-grid",children:e.jsxs("label",{className:"settings-field",children:[e.jsx("span",{className:"settings-field-label",children:"Exit URL"}),e.jsxs("div",{className:"settings-row",style:{gap:8},children:[e.jsx("input",{className:"settings-input",style:{flex:1},value:x,onChange:s=>v(s.target.value),placeholder:"https://classroom.google.com"}),e.jsx("button",{type:"button",className:"settings-danger",onClick:y,children:"Save"})]}),g&&e.jsx("span",{className:"settings-field-label",style:{color:"#f87171"},children:g})]})}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Confirm before leaving"}),e.jsx("div",{className:"settings-row-hint",children:"Prompt when closing or navigating away."})]}),e.jsxs("label",{className:"settings-switch",children:[e.jsx("input",{type:"checkbox",checked:t.confirmLeave,onChange:s=>i({confirmLeave:s.target.checked})}),e.jsx("span",{})]})]}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Auto cover tab"}),e.jsx("div",{className:"settings-row-hint",children:"On your next interaction, move the _9gmixa5 into a decoy tab and redirect this one."})]}),e.jsxs("label",{className:"settings-switch",children:[e.jsx("input",{type:"checkbox",checked:t.autoCoverFrame,onChange:s=>i({autoCoverFrame:s.target.checked})}),e.jsx("span",{})]})]}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Open cover tab now"}),j&&e.jsx("div",{className:"settings-row-hint",children:j})]}),e.jsx("button",{type:"button",className:"settings-danger",onClick:E,children:"Open"})]})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"Data"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Clear data"}),e.jsx("div",{className:"settings-row-hint",children:"Removes saved tabs, bookmarks, and settings."})]}),e.jsx("button",{className:"settings-danger",type:"button",onClick:a,children:"Clear"})]})]}),r&&o&&e.jsxs("section",{className:"settings-section",children:[e.jsx("div",{className:"settings-section-title",children:"IGNITE OS BROWSER Plus"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("div",{className:"settings-row-text",children:[e.jsx("div",{className:"settings-row-label",children:"Go ad-free"}),e.jsx("div",{className:"settings-row-hint",children:"Remove ads, unlock 3M AI tokens/day, and get exclusive links."})]}),e.jsx("button",{type:"button",className:"settings-upgrade",onClick:o,children:"Upgrade"})]})]}),e.jsxs("div",{className:"settings-page-foot",children:[e.jsx(D,{size:14}),e.jsx("span",{children:"IGNITE OS BROWSER"}),e.jsx("span",{children:"·"}),e.jsx("a",{href:w("terms.html"),target:"_blank",rel:"noreferrer",children:"Terms"}),e.jsx("span",{children:"·"}),e.jsx("a",{href:w("privacy.html"),target:"_blank",rel:"noreferrer",children:"Privacy"})]})]})})}export{$ as SettingsPage};
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./boot-D3vqjHTs-8068ec8f.js","./proxy-runtime-hRo6K69j-8068ec8f.js","./react-BNEptbwn-8068ec8f.js","./motion-B1hdS1Lc-8068ec8f.js","./DarkVeil-CC-BBhGo-8068ec8f.js","./ogl-BWe_HKY6-8068ec8f.js","./AiPage-CbTtOj3W-8068ec8f.js","./fingerprint-Y5nV5FVa-8068ec8f.js","./markdown-BtlGIx_H-8068ec8f.js","./markdown-dIRGbAJA-8068ec8f.css","./AiPage-CTjB7gWo-8068ec8f.css","./GamesPage-D-HV0rpM-8068ec8f.js","./GamesPage--YRYDVtw-8068ec8f.css","./SettingsPage-CsV-N8Y0-8068ec8f.js","./settings-page-B-LiQw8a-8068ec8f.css","./AccountPage-DmlYaBSE-8068ec8f.js","./AccountPage-fg4fizGa-8068ec8f.css","./PlusPage-DBE836ej-8068ec8f.js","./PlusPage-vOvT9Zss-8068ec8f.css"])))=>i.map(i=>d[i]);
2
- var Kn=Object.defineProperty;var Ht=e=>{throw TypeError(e)};var Gn=(e,t,s)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ke=(e,t,s)=>Gn(e,typeof t!="symbol"?t+"":t,s),ot=(e,t,s)=>t.has(e)||Ht("Cannot "+s);var r=(e,t,s)=>(ot(e,t,"read from private field"),s?s.call(e):t.get(e)),se=(e,t,s)=>t.has(e)?Ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),W=(e,t,s,i)=>(ot(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),H=(e,t,s)=>(ot(e,t,"access private method"),s);import{j as n,r as l,c as Jn}from"./react-BNEptbwn-8068ec8f.js";import{A as Ue,m as Te,R as Yn,a as Xn}from"./motion-B1hdS1Lc-8068ec8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();const Vt=(()=>{const e=window;if(e.__lcHs)return e.__lcHs;const t={ps:History.prototype.pushState,rs:History.prototype.replaceState};return e.__lcHs=t,t})();function an(){const e=history;try{Object.defineProperty(e,"pushState",{value:Vt.ps.bind(e),configurable:!0,writable:!0}),Object.defineProperty(e,"replaceState",{value:Vt.rs.bind(e),configurable:!0,writable:!0})}catch{}}function Qn(e,t=null){history.replaceState(t,"",e)}an();const _t=typeof document<"u"?document.baseURI:"/";function Ze(e="",t=_t){const s=e.trim();return s?/^(https?:|data:|blob:)/i.test(s)?s:s.startsWith("#")?new URL(s,t).href:new URL(s.replace(/^\/+/,""),t).href:new URL(".",t).href}function ei(e="",t=_t){return new URL(Ze(e,t)).pathname}function Kt(){return new URL(".",_t).href}const Zn="modulepreload",es=function(e,t){return new URL(e,t).href},Gt={},Ae=function(t,s,i){let o=Promise.resolve();if(s&&s.length>0){let u=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const h=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),b=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=u(s.map(f=>{if(f=es(f,i),f in Gt)return;Gt[f]=!0;const g=f.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!i)for(let j=h.length-1;j>=0;j--){const I=h[j];if(I.href===f&&(!g||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=g?"stylesheet":Zn,g||(k.as="script"),k.crossOrigin="",k.href=f,b&&k.setAttribute("nonce",b),document.head.appendChild(k),g)return new Promise((j,I)=>{k.addEventListener("load",j),k.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return o.then(u=>{for(const h of u||[])h.status==="rejected"&&c(h.reason);return t().catch(c)})},cn="z9k2r",ut=["settings","tabs","theme","bookmarks","ai.model","ai.threads","_gs5mofn.collapsed","api.base","api.pinned","api.custom","ads.notice","games.saved.v2"],Nt="8068ec8f48688e3d";function ln(e){let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function un(e,t){return ln(e?`${e} ${t}`:t)}function et(e){return un(Nt,e)}function Qe(e){try{return localStorage.getItem(e)}catch{return null}}function Tt(e,t){try{localStorage.setItem(e,t)}catch{}}function dn(e){try{localStorage.removeItem(e)}catch{}}function ts(){const e=Qe(cn);if(e===null)return null;try{const t=JSON.parse(e);if(typeof(t==null?void 0:t.salt)=="string"&&Array.isArray(t.names))return t}catch{}return null}let Ce;function hn(){Tt(cn,JSON.stringify({salt:Nt,names:[...Ce]}))}function ns(){const e=ts(),t=e?e.salt:null;if(Ce=new Set([...ut,...(e==null?void 0:e.names)??[]]),t!==Nt)for(const s of Ce){const i=t===null?ln(s):un(t,s),o=et(s);if(i===o)continue;const c=Qe(i);c!==null&&(Qe(o)===null&&Tt(o,c),dn(i))}hn()}function ss(e){Ce.has(e)||(Ce.add(e),hn())}if(typeof window<"u")try{ns()}catch{Ce=new Set(ut)}else Ce=new Set(ut);function ge(e){return Qe(et(e))}function we(e,t){ss(e),Tt(et(e),t)}function ye(e){dn(et(e))}function tt(e,t){const s=ge(e);if(s===null)return t;try{return JSON.parse(s)}catch{return t}}function nt(e,t){we(e,JSON.stringify(t))}const pn={id:"tiktok",url:"https://www.tiktok.com/",label:"TikTok"},fn={id:"discord",url:"https://discord.com/_9gmixa5",label:"Discord"},rs=[pn,fn];function mn(){const e=tt("bookmarks",null);return Array.isArray(e)?e.filter(t=>typeof(t==null?void 0:t.url)=="string"&&typeof(t==null?void 0:t.id)=="string").map(t=>t.id==="instagram"?pn:t.id==="spotify"?fn:t):rs}function bn(e){nt("bookmarks",e)}function Jt(e,t){return{id:`bm-${Date.now().toString(36)}-${Math.floor(Math.random()*1e4).toString(36)}`,url:e,label:t}}function _e(e){try{return new URL(e).hostname}catch{return null}}function is(e){const t=_e(e);return t?[`https://icons.duckduckgo.com/ip3/${t}.ico`,`https://www.google.com/s2/favicons?domain=${t}&sz=64`]:[]}const Z=e=>({width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0});function ti({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),n.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function Pt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Lt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function It({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function Me({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"11",cy:"11",r:"7"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function dt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 5v14M5 12h14"})})}function gn({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function wn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),n.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"20"})]})}function os({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"6.3",y1:"6.3",x2:"17.7",y2:"17.7"}),n.jsx("line",{x1:"17.7",y1:"6.3",x2:"6.3",y2:"17.7"})]})}function vn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.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 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-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 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.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 1 1 2.83 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"})]})}function Rt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7z"}),n.jsx("path",{d:"M18.5 14l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z"})]})}function Mt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("line",{x1:"6",y1:"11",x2:"10",y2:"11"}),n.jsx("line",{x1:"8",y1:"9",x2:"8",y2:"13"}),n.jsx("line",{x1:"15",y1:"12",x2:"15.01",y2:"12"}),n.jsx("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),n.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"})]})}function ni({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function si({size:e=16}){return n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":!0,children:n.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"})})}function ri({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"9",cy:"9",r:"2"}),n.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function ii({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"9"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("ellipse",{cx:"12",cy:"12",rx:"4",ry:"9"})]})}function oi({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})}function ai({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]})}function ci({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),n.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function li({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"})})}function as({size:e=14,filled:t=!1}){return n.jsx("svg",{...Z(e),fill:t?"currentColor":"none",children:n.jsx("polygon",{points:"12 2 15 9 22 9.5 17 14.5 18.5 22 12 18 5.5 22 7 14.5 2 9.5 9 9 12 2"})})}function ui({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"5",y:"11",width:"14",height:"9",rx:"2"}),n.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function di({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}function yn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"8",r:"4"}),n.jsx("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}function hi({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M16 3h5v5"}),n.jsx("path",{d:"M4 20 21 3"}),n.jsx("path",{d:"M21 16v5h-5"}),n.jsx("path",{d:"M15 15l6 6"}),n.jsx("path",{d:"M4 4l5 5"})]})}var cs=["https://themannastore.com","https://21baseballacademy.com","https://theavancehotel.com","https://diamondstudsbaseball.com","https://broughton-hotel.com"];const Re=cs;let fe="https://theavancehotel.com";const xn="include",ls="pool-ok";function us(e){return typeof window>"u"||typeof document>"u"?Promise.resolve(!1):new Promise(t=>{const s=document.createElement("iframe"),i=crypto.randomUUID(),o=new URL(e).origin;let c=0,u=!1;const h=b=>{u||(u=!0,window.clearTimeout(c),window.removeEventListener("message",m),s.remove(),t(b))},m=b=>{if(b.source!==s.contentWindow||b.origin!==o||typeof b.data!="object"||b.data===null)return;const f=b.data;f.type===ls&&f.nonce===i&&h(!0)};s.hidden=!0,s.tabIndex=-1,s.setAttribute("aria-hidden","true"),s.setAttribute("sandbox","allow-scripts allow-same-origin"),s.onerror=()=>h(!1),s.src=new URL(`/api/probe?nonce=${encodeURIComponent(i)}`,e).href,window.addEventListener("message",m),c=window.setTimeout(()=>h(!1),2500),document.body.appendChild(s)})}async function kn(e){try{const t=await fetch(`${e}/api/ping`,{cache:"no-store",mode:"cors",signal:AbortSignal.timeout(4e3)});if(!t.ok)return!1;const s=await t.json();return typeof s!="object"||s===null||s.ok!==!0?!1:await us(e)}catch{return!1}}let Fe=null,ht=0;function ds(e){return e.length===0?Promise.resolve(null):new Promise(t=>{let s=e.length,i=!1;for(const o of e)kn(o).then(c=>{if(!i){if(c){i=!0,t(o);return}s-=1,s===0&&t(null)}})})}function hs(e){if(typeof window>"u")return;window.clearTimeout(ht);const t=window.setTimeout(()=>{pt()||fe!==e||kn(e).then(s=>{s||pt()||(Fe=null,ye("api.base"),En())})},45e3);ht=t,typeof t=="object"&&t&&"unref"in t&&t.unref()}function pi(){return[...Re]}function ps(){try{const e=JSON.parse(ge("api.custom")||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function fi(){return fe||(typeof location<"u"&&location.origin?location.origin:"")}function mi(e){try{return new URL(e).host}catch{return e.replace(/^https?:\/\//i,"")}}function jn(e){const t=e.trim();if(!t)return null;try{const s=/^https?:\/\//i.test(t)?t:`https://${t}`,i=new URL(s);return i.protocol!=="http:"&&i.protocol!=="https:"?null:i.origin}catch{return null}}function pt(){return ge("api.pinned")==="1"}function fs(e){const t=jn(e);return t?(fe=t,Fe=Promise.resolve(t),we("api.base",t),we("api.pinned","1"),!0):!1}function bi(){ye("api.pinned"),ye("api.base"),Fe=null,typeof window<"u"&&window.clearTimeout(ht),fe="https://theavancehotel.com"}function gi(e){const t=jn(e);if(!t)return null;const s=ps();return s.includes(t)||we("api.custom",JSON.stringify([...s,t])),fs(t),t}function En(){if(pt()){const e=ge("api.base");if(e)return fe=e,Promise.resolve(e)}return Re.length===0?Promise.resolve(fe):(Fe??(Fe=(async()=>{const e=ge("api.base"),t=Re.filter(o=>o!==e),s=e&&Re.includes(e)?[e,...t]:[...Re],i=await ds(s);return i?(fe=i,we("api.base",i),hs(i),i):(ye("api.base"),null)})()),Fe)}function Oe(e){return fe+e}function wi(e){return fe?fe.replace(/^http/,"ws")+e:`${location.protocol==="https:"?"wss":"ws"}://${location.host}${e}`}function ms(e){const t=ge(`token.${e}`);return t?{authorization:`Bearer ${t}`}:{}}function at(e,t){if(!t||typeof t!="object")return;const s=t.token;typeof s=="string"&&s&&we(`token.${e}`,s)}function bs(e){ye(`token.${e}`)}async function gs(e){try{const t=await fetch(Oe(`/api/ac?q=${encodeURIComponent(e)}`),{credentials:xn});if(!t.ok)return[];const s=await t.json();return Array.isArray(s)?s.filter(i=>typeof i=="string").slice(0,8):[]}catch{return[]}}function Cn(e){const[t,s]=l.useState([]);return l.useEffect(()=>{const i=e.trim();if(i.length<2){s([]);return}let o=!0;return gs(i).then(c=>{o&&s(c)}),()=>{o=!1}},[e]),t}function ct(e){if(!e)return"";try{const t=new URL(e),s=t.pathname==="/"?"":t.pathname;return t.hostname+s+t.search}catch{return e}}function Dt({url:e,variant:t,disabled:s,bookmarked:i,autoFocus:o,onNavigate:c,onToggleBookmark:u}){const[h,m]=l.useState(ct(e)),[b,f]=l.useState(!1),[g,y]=l.useState(-1),P=l.useRef(null),k=l.useRef(null),j=Cn(b?h:"");l.useEffect(()=>{b||m(ct(e))},[e,b]),l.useEffect(()=>{y(-1)},[j]);const I=()=>g>=0&&j[g]?j[g]:h,T=$=>{var q;const Y=$.trim();Y&&(c(Y),(q=P.current)==null||q.blur())},J=$=>{var Y;$.key==="Escape"?(m(ct(e)),(Y=P.current)==null||Y.blur()):$.key==="Enter"?($.preventDefault(),T(I())):$.key==="ArrowDown"?($.preventDefault(),y(q=>Math.min(j.length-1,q+1))):$.key==="ArrowUp"&&($.preventDefault(),y(q=>Math.max(-1,q-1)))},ne=n.jsx("input",{ref:P,value:h,disabled:s,autoFocus:o,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:$=>m($.target.value),onKeyDown:J,onFocus:$=>{k.current&&window.clearTimeout(k.current),f(!0),m(e||h),requestAnimationFrame(()=>$.target.select())},onBlur:()=>{k.current=window.setTimeout(()=>f(!1),120)}}),B=b&&j.length>0&&n.jsx("ul",{className:"omnibox-suggestions",children:j.map(($,Y)=>n.jsxs("li",{className:`omnibox-suggestion ${Y===g?"selected":""}`,onMouseEnter:()=>y(Y),onMouseDown:q=>q.preventDefault(),onClick:()=>T($),children:[n.jsx(Me,{size:13}),n.jsx("span",{children:$})]},`${$}-${Y}`))});return t==="_2ta3awx"?n.jsxs("div",{className:"newtab-search-wrap",children:[n.jsxs("form",{className:`_25dnvc2 ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:18}),ne]}),B]}):t==="_gs5mofn"?n.jsxs("div",{className:"sidebar-omnibox-wrap",children:[n.jsxs("form",{className:`sidebar-omnibox ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:13}),ne]}),B]}):n.jsxs("div",{className:"omnibox-wrap",children:[n.jsxs("form",{className:`_w5gq50s ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[ne,e&&u&&n.jsx("button",{type:"button",className:`omnibox-star ${i?"filled":""}`,"aria-label":i?"Remove bookmark":"Add bookmark",onMouseDown:$=>$.preventDefault(),onClick:u,children:n.jsx(as,{size:14,filled:i})})]}),B]})}function An({url:e,size:t=24,fallback:s}){const i=is(e),[o,c]=l.useState(0);return l.useEffect(()=>{c(0)},[e]),!e||o>=i.length?s?n.jsx("span",{className:"favicon-fallback",style:{width:t,height:t},children:s}):n.jsx("img",{src:Ze("favicon.svg"),alt:"",width:t,height:t}):n.jsx("img",{src:i[o],alt:"",width:t,height:t,onError:()=>c(u=>u+1)})}const ws={"/a":"ai","/g":"games","/s":"settings","/u":"account","/p":"plus"},vs={ai:"/a",games:"/g",settings:"/s",account:"/u",plus:"/p"},ys={ai:"Lucidity AI",games:"Education",settings:"Settings",account:"Account",plus:"Lucide Plus"};function be(e){return ws[e]??null}function xs(e){return vs[e]}function Sn(e,t){const s=be(e);return s==="ai"?n.jsx(Rt,{size:t}):s==="games"?n.jsx(Mt,{size:t}):e?n.jsx(An,{url:e,size:t+1}):n.jsx(os,{size:t})}function ks(e){return n.jsx("aside",{className:`_gs5mofn ${e.collapsed?"_hmrd7qx":""}`,children:e.collapsed?n.jsx(Es,{...e}):n.jsx(js,{...e})})}function js({tabs:e,activeId:t,activeUrl:s,bookmarks:i,disabled:o,onSelect:c,onNew:u,onClose:h,onReorder:m,onNavigate:b,onOpenBookmark:f,onAddBookmark:g,onRemoveBookmark:y,onToggleCollapse:P,onOpenAi:k,onOpenGames:j,onOpenSettings:I,onOpenAccount:T,onBack:J,onForward:ne,onReload:B}){const $=!!s,Y=be(s),q=e.filter(F=>!be(F.url)),ee=e.filter(F=>be(F.url));return n.jsxs("div",{className:"_shpbk0d",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsxs("div",{className:"header-left",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:o||!$,onClick:J,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:o||!$,onClick:ne,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:o||!$,onClick:B,children:n.jsx(It,{})})]}),n.jsx("div",{className:"header-right",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Collapse _gs5mofn",onClick:P,children:n.jsx(wn,{})})})]}),n.jsx(Dt,{url:s,variant:"_gs5mofn",disabled:o,onNavigate:b}),n.jsxs("div",{className:"bookmarks-grid",children:[i.map(F=>n.jsx("button",{className:"bookmark-tile",type:"button",title:F.label??_e(F.url)??F.url,onClick:()=>f(F.url),onContextMenu:E=>{E.preventDefault(),y(F.id)},children:n.jsx(An,{url:F.url,size:22,fallback:(F.label??_e(F.url)??"?").slice(0,1).toUpperCase()})},F.id)),n.jsx("button",{className:"bookmark-tile bookmark-add",type:"button","aria-label":"Add bookmark",onClick:g,children:n.jsx(dt,{size:16})})]}),n.jsxs("button",{className:"new-tab",type:"button",onClick:u,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(dt,{size:15})}),n.jsx("span",{children:"New tab"})]}),n.jsx(Yn,{as:"ul",axis:"y",values:q,onReorder:F=>m([...F,...ee]),className:"tab-list",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:q.map(F=>n.jsxs(Xn,{value:F,as:"li",className:`tab-item ${F.id===t?"active":""}`,onClick:()=>c(F.id),title:F.title||_e(F.url)||"New tab",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:.9,transition:{duration:.55,ease:[.16,1,.3,1]}},transition:{type:"spring",stiffness:700,damping:38,mass:.6},dragTransition:{bounceStiffness:700,bounceDamping:38},whileDrag:{scale:1.03},children:[n.jsx("span",{className:"_5t7l5je",children:Sn(F.url,15)}),n.jsx("span",{className:"tab-title",children:F.title||_e(F.url)||"New tab"}),q.length>1&&n.jsx("button",{className:"tab-close",type:"button","aria-label":"Close tab",onPointerDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),h(F.id)},children:n.jsx(gn,{size:13})})]},F.id))})}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="ai"?"active":""}`,type:"button",onClick:k,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Rt,{size:15})}),n.jsx("span",{children:"AI"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="games"?"active":""}`,type:"button",onClick:j,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Mt,{size:15})}),n.jsx("span",{children:"Education"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="account"?"active":""}`,type:"button",onClick:T,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(yn,{size:15})}),n.jsx("span",{children:"Account"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="settings"?"active":""}`,type:"button",onClick:I,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(vn,{size:15})}),n.jsx("span",{children:"Settings"})]})]})}function Es({tabs:e,activeId:t,activeUrl:s,disabled:i,onSelect:o,onNew:c,onToggleCollapse:u,onOpenAi:h,onOpenGames:m,onOpenSettings:b,onOpenAccount:f,onBack:g,onForward:y,onReload:P}){const k=!!s,j=be(s),I=e.filter(T=>!be(T.url));return n.jsxs("div",{className:"_shpbk0d _hmrd7qx",children:[n.jsx("div",{className:"_8i3hapm",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Expand _gs5mofn",title:"Expand _gs5mofn",onClick:u,children:n.jsx(wn,{})})}),n.jsxs("div",{className:"_9a6ojvc",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",title:"Back",disabled:i||!k,onClick:g,children:n.jsx(Pt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",title:"Forward",disabled:i||!k,onClick:y,children:n.jsx(Lt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",title:"Reload",disabled:i||!k,onClick:P,children:n.jsx(It,{size:15})})]}),n.jsx("button",{className:"_54mv697 compact-add",type:"button","aria-label":"New tab",title:"New tab",onClick:c,children:n.jsx(dt,{size:16})}),n.jsx("ul",{className:"_cnmfi4r",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:I.map(T=>n.jsx(Te.li,{layout:!0,className:`_54mv697 ${T.id===t?"active":""}`,onClick:()=>o(T.id),title:T.title||_e(T.url)||"New tab",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8,transition:{duration:.5,ease:[.16,1,.3,1]}},transition:{duration:.18,ease:[.16,1,.3,1]},whileTap:{scale:.92},children:Sn(T.url,17)},T.id))})}),n.jsxs("div",{className:"_c2b13pw",children:[n.jsx("button",{className:`_1lqv40d ${j==="ai"?"active":""}`,type:"button","aria-label":"AI",title:"AI",onClick:h,children:n.jsx(Rt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="games"?"active":""}`,type:"button","aria-label":"Education",title:"Education",onClick:m,children:n.jsx(Mt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="account"?"active":""}`,type:"button","aria-label":"Account",title:"Account",onClick:f,children:n.jsx(yn,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="settings"?"active":""}`,type:"button","aria-label":"Settings",title:"Settings",onClick:b,children:n.jsx(vn,{size:14})})]})]})}function Cs({url:e,disabled:t,collapsed:s,internal:i,bookmarked:o,onNavigate:c,onBack:u,onForward:h,onReload:m,onToggleBookmark:b}){return n.jsxs("div",{className:"_ynqudi4",children:[s&&!i&&n.jsxs("div",{className:"nav-group",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:t||!e,onClick:u,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:t||!e,onClick:h,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:t||!e,onClick:m,children:n.jsx(It,{})})]}),n.jsx(Dt,{url:e,variant:"_ynqudi4",disabled:t,bookmarked:i?!1:o,onNavigate:c,onToggleBookmark:i?void 0:b})]})}function As(){return n.jsxs("div",{className:"app-footer",children:[n.jsxs("a",{className:"discord-link",href:"https://discord.gg/chromebook",target:"_blank",rel:"noopener noreferrer","aria-label":"Join our Discord server (opens in a new tab)",children:[n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M20.32 4.37a19.79 19.79 0 0 0-4.89-1.52c-.21.38-.45.89-.62 1.3a18.43 18.43 0 0 0-5.62 0c-.17-.41-.42-.92-.63-1.3a19.74 19.74 0 0 0-4.89 1.53C.58 8.97-.26 13.45.16 17.87a19.9 19.9 0 0 0 6 3.03c.49-.66.92-1.36 1.29-2.1-.71-.26-1.38-.59-2.02-.98.17-.12.34-.25.5-.38 3.88 1.81 8.08 1.81 11.92 0 .16.13.33.26.5.38-.64.39-1.32.72-2.02.99.37.73.8 1.43 1.29 2.09a19.82 19.82 0 0 0 6-3.03c.5-5.13-.85-9.57-3.3-13.5ZM8.02 15.15c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Zm7.96 0c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Z"})}),"Join Discord"]}),n.jsx("span",{className:"build-id",title:"a0658664f8adc57eb7e44cf1829ae71127c42057",children:"a0658664f8adc57eb7e44cf1829ae71127c42057".slice(0,7)})]})}const Ft=["accelerometer","autoplay","clipboard-read","clipboard-write","encrypted-media","fullscreen","gamepad","gyroscope","keyboard-lock","keyboard-map","pointer-lock","screen-wake-lock","xr-spatial-tracking"],Ss=Ft,_n=Ft.map(e=>`${e} *`).join("; ");Ft.map(e=>`${e}=*`).join(", ");function _s(e){return e.split(/[\s=]/)[0]??""}function Nn(e){const t=(e.getAttribute("allow")??"").split(";").map(o=>o.trim()).filter(Boolean),s=new Set(t.map(_s).filter(Boolean));for(const o of Ss)s.has(o)||t.push(`${o} *`);const i=t.join("; ");e.getAttribute("allow")!==i&&e.setAttribute("allow",i),e.allowFullscreen=!0}function Ns(e){const t=e.getElementsByTagName("iframe"),s=()=>{for(let o=0;o<t.length;o+=1)Nn(t[o])};s();const i=new MutationObserver(s);return i.observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["allow"]}),i}function Ts(){return{frames:new Map,titleObservers:new Map,allowObservers:new Map,retryTimers:new Map}}function Ps(e,t){var o,c;const s=e.retryTimers.get(t);s&&clearTimeout(s),e.retryTimers.delete(t),(o=e.titleObservers.get(t))==null||o.disconnect(),e.titleObservers.delete(t),(c=e.allowObservers.get(t))==null||c.disconnect(),e.allowObservers.delete(t);const i=e.frames.get(t);if(i){const u=i.controller.frames.indexOf(i);u>=0&&i.controller.frames.splice(u,1)}e.frames.delete(t)}function Yt(e,t,s,i){var h,m;const o=s.retryTimers.get(t);o&&clearTimeout(o),s.retryTimers.delete(t),(h=s.titleObservers.get(t))==null||h.disconnect(),(m=s.allowObservers.get(t))==null||m.disconnect(),Nn(e);let c=0;const u=()=>{let b=null;try{b=e.contentDocument}catch{b=null}if(!b){if(++c<30){const P=setTimeout(()=>{s.retryTimers.delete(t),u()},200);s.retryTimers.set(t,P)}return}s.retryTimers.delete(t);const f=()=>{var k;const P=(k=b.title)==null?void 0:k.trim();P&&i(P)};f();const g=new MutationObserver(f),y=b.head??b.documentElement;y&&g.observe(y,{subtree:!0,childList:!0,characterData:!0}),s.titleObservers.set(t,g),s.allowObservers.set(t,Ns(b))};u()}function Ls(e,t,s,i,o){const c=new window._dln2p7n.Plugin(`_8qzdbvk${s}`);c.tap(e.hooks.init.post,u=>{const h=u;h.isTopLevel&&(o.onUrl(h.client.url.href),Yt(t,s,i,o.onTitle),c.tap(h.client.hooks.lifecycle.navigate,(m,b)=>{const f=b.url;let g=f;try{g=new URL(f,h.client.url.href).href}catch{}o.onUrl(g),Yt(t,s,i,o.onTitle)}))})}function Is(e,t,s,i,o){const c=i.frames.get(t);if(c)return c;const u=e.createFrame(s);return Ls(u,s,t,i,o),i.frames.set(t,u),u}function Rs(){return navigator.hardwareConcurrency<=4||(navigator.deviceMemory??8)<=4}const Ms=l.forwardRef(function({controller:t,tabs:s,activeId:i,onUrl:o,onTitle:c},u){const h=l.useRef(new Map),m=l.useRef(Ts()),b=l.useRef(new Map),f=l.useRef(new Map),g=l.useRef(Rs()).current,[,y]=l.useReducer(k=>k+1,0),P=l.useCallback(()=>{if(t)for(const k of s){const j=b.current.get(k.id);if(!j||f.current.get(k.id)===j)continue;const I=h.current.get(k.id);if(!I)continue;const T=Is(t,k.id,I,m.current,{onUrl:J=>o(k.id,J),onTitle:J=>c(k.id,J)});f.current.set(k.id,j),T.go(j)}},[t,s,o,c]);return l.useEffect(()=>{P()},[P]),l.useEffect(()=>{const k=s.find(j=>j.id===i);k&&k.url&&!be(k.url)&&(b.current.has(k.id)||b.current.set(k.id,k.url),P())},[i,s,P]),l.useEffect(()=>{const k=new Set(s.map(I=>I.id)),j=g?new Set([i]):k;for(const I of m.current.frames.keys())j.has(I)||(Ps(m.current,I),f.current.delete(I));for(const I of b.current.keys())k.has(I)||(b.current.delete(I),f.current.delete(I))},[i,s,g]),l.useImperativeHandle(u,()=>({goTo(k,j){b.current.set(k,j),y()},back(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.back()}catch{}},forward(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.forward()}catch{}},reload(){const k=b.current.get(i),j=m.current.frames.get(i);j&&k&&j.go(k)},getIframe(k){return h.current.get(k)}}),[i]),n.jsx("div",{className:"_rxi5qmt",children:t&&s.filter(k=>!be(k.url)&&(!g||k.id===i)).map(k=>n.jsx("iframe",{title:k.title,ref:j=>{j?h.current.set(k.id,j):h.current.delete(k.id)},className:"_0h17hzp","data-visible":k.id===i&&!!k.url,allow:_n,allowFullScreen:!0,onPointerDown:j=>j.currentTarget.focus()},k.id))})});function Ds({disabled:e,onNavigate:t}){return n.jsx("div",{className:"_2ta3awx",children:n.jsxs("div",{className:"_hfs48s5",children:[n.jsxs("div",{className:"_nbrh985",children:[n.jsx("h1",{className:"_idak361","aria-label":"Home"}),n.jsx("div",{className:"newtab-underline"})]}),n.jsx(Dt,{variant:"_2ta3awx",url:"",disabled:e,autoFocus:!0,onNavigate:t})]})})}function Fs({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),c=l.useRef(null);if(l.useEffect(()=>{if(!e)return;o(""),requestAnimationFrame(()=>{var m;return(m=c.current)==null?void 0:m.focus()});const h=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]),!e)return null;const u=h=>{h.preventDefault();const m=i.trim();m&&(s(m),t())};return n.jsx("div",{className:"_t97drno",onClick:t,children:n.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:"Add bookmark"}),n.jsxs("form",{onSubmit:u,children:[n.jsx("div",{className:"modal-field",children:n.jsx("input",{ref:c,value:i,onChange:h=>o(h.target.value),placeholder:"https://example.com",spellCheck:!1,autoComplete:"off"})}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Cancel"}),n.jsx("button",{type:"submit",className:"modal-btn primary",disabled:!i.trim(),children:"Add"})]})]})]})})}function Os({open:e,onAccept:t,onUpgrade:s}){const i=l.useRef(null);return l.useEffect(()=>{if(!e)return;requestAnimationFrame(()=>{var c;return(c=i.current)==null?void 0:c.focus()});const o=c=>{c.key==="Enter"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,t]),n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"_t97drno _ndpzvua",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:"easeOut"},children:n.jsxs(Te.div,{className:"modal _vepqnuc",role:"dialog","aria-labelledby":"ads-notice-title",initial:{opacity:0,y:12,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.97},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("div",{className:"modal-title",id:"ads-notice-title",children:"A quick note about ads"}),n.jsx("p",{className:"ads-notice-body",children:"Ads help keep Lucide free to run. You may see a few while using the site."}),n.jsx("p",{className:"ads-notice-body",children:"Ignore any ad that asks you to download something, install an extension, or enable notifications — those are not from us."}),n.jsxs("p",{className:"ads-notice-plus",children:["Prefer no ads?"," ",n.jsx("button",{type:"button",className:"ads-notice-plus-link",onClick:s,children:"Upgrade to Plus"})]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{ref:i,type:"button",className:"modal-btn primary",onClick:t,children:"Okay"})})]})})})}function Us({open:e,onClose:t,onUpgrade:s}){return l.useEffect(()=>{if(!e)return;const i=window.setTimeout(t,6e3);return()=>window.clearTimeout(i)},[e,t]),n.jsx(Ue,{children:e&&n.jsxs(Te.aside,{className:"plus-perks-toast",role:"status","aria-live":"polite",initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("button",{type:"button",className:"plus-perks-toast-x",onClick:t,"aria-label":"Dismiss",children:n.jsx(gn,{size:14})}),n.jsx("div",{className:"plus-perks-toast-title",children:"Lucide Plus"}),n.jsx("p",{className:"plus-perks-toast-body",children:"Go ad-free, unlock 3M tokens/day, and get exclusive links."}),n.jsx("button",{type:"button",className:"plus-perks-toast-cta",onClick:s,children:"Learn more"})]})})}function $s({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),[c,u]=l.useState(0),h=l.useRef(null),m=Cn(e?i:"");l.useEffect(()=>{e&&(o(""),u(0),requestAnimationFrame(()=>{var g;return(g=h.current)==null?void 0:g.focus()}))},[e]),l.useEffect(()=>{u(0)},[m]);const b=g=>{const y=g.trim();y&&(s(y),t())},f=g=>{g.key==="Enter"?(g.preventDefault(),b(m[c]??i)):g.key==="ArrowDown"?(g.preventDefault(),u(y=>Math.min(m.length-1,y+1))):g.key==="ArrowUp"&&(g.preventDefault(),u(y=>Math.max(0,y-1)))};return n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"spotlight-backdrop",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:n.jsxs(Te.div,{className:"spotlight",onClick:g=>g.stopPropagation(),initial:{opacity:0,y:-10,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.97},transition:{duration:.2,ease:[.16,1,.3,1]},children:[n.jsxs("div",{className:"spotlight-input",children:[n.jsx(Me,{size:18}),n.jsx("input",{ref:h,value:i,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:g=>o(g.target.value),onKeyDown:f})]}),m.length>0&&n.jsx("ul",{className:"spotlight-list",children:m.map((g,y)=>n.jsxs("li",{className:`spotlight-item ${y===c?"selected":""}`,onMouseEnter:()=>u(y),onMouseDown:P=>P.preventDefault(),onClick:()=>b(g),children:[n.jsx(Me,{size:14}),n.jsx("span",{children:g})]},`${g}-${y}`))})]})})})}function Tn(){return n.jsxs("p",{className:"plus-blocked-note",children:["Checkout opens a secure Stripe page, which may be blocked on your network. If it doesn't load, join"," ",n.jsx("a",{href:"https://discord.gg/chromebook",target:"_blank",rel:"noreferrer",children:"discord.gg/chromebook"})," ","to purchase there."]})}function Bs({open:e,onClose:t,account:s,heading:i,blurb:o,onSignUp:c}){if(!e)return null;const u=s.status==="signed-in",h=()=>{var f;u?s.checkout(((f=s.user)==null?void 0:f.email)??void 0):c==null||c()},m=i??"Lucide Plus",b=o??"Unlock 3M tokens/day, exclusive links, and an ad-free experience.";return n.jsx("div",{className:"_t97drno upgrade-backdrop",onClick:t,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:m}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:b}),u&&n.jsx(Tn,{}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Not now"}),n.jsx("button",{type:"button",className:"modal-btn primary",onClick:h,children:u?"Upgrade to Plus":"Sign up to upgrade"})]})]})})}function He(){return{id:`tab-${Date.now().toString(36)}-${Math.floor(Math.random()*1e6).toString(36)}`,title:"New Tab",url:""}}function qs(e){const t=e;return!!t&&typeof t.id=="string"&&typeof t.title=="string"&&typeof t.url=="string"}function zs(){const e=tt("tabs",{}),t=Array.isArray(e.tabs)?e.tabs.filter(qs):[];if(t.length>0){const s=t.some(i=>i.id===e.activeId)?e.activeId:t[0].id;return{tabs:t,activeId:s}}return Pn()}function Pn(){const e=He();return{tabs:[e],activeId:e.id}}function Ws(e,t){switch(t.type){case"open":{const s=He();return{tabs:[...e.tabs,s],activeId:s.id}}case"openInternal":{const s=e.tabs.find(o=>o.url===t.url);if(s)return{...e,activeId:s.id};const i={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,i],activeId:i.id}}case"openUrl":{const s={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,s],activeId:s.id}}case"close":{const s=e.tabs.findIndex(c=>c.id===t.id);if(s===-1)return e;const i=e.tabs.filter(c=>c.id!==t.id);if(i.length===0)return Pn();let o=e.activeId;return o===t.id&&(o=i[Math.min(s,i.length-1)].id),{tabs:i,activeId:o}}case"activate":return e.activeId===t.id?e:{...e,activeId:t.id};case"patch":return{...e,tabs:e.tabs.map(s=>s.id===t.id?{...s,...t.patch}:s)};case"reorder":return{...e,tabs:t.tabs};default:return e}}function Hs(){const[e,t]=l.useReducer(Ws,void 0,zs);l.useEffect(()=>{nt("tabs",e)},[e]);const s=l.useCallback(()=>t({type:"open"}),[]),i=l.useCallback((f,g)=>t({type:"openInternal",url:f,title:g}),[]),o=l.useCallback((f,g)=>t({type:"openUrl",url:f,title:g}),[]),c=l.useCallback(f=>t({type:"close",id:f}),[]),u=l.useCallback(f=>t({type:"activate",id:f}),[]),h=l.useCallback((f,g)=>t({type:"patch",id:f,patch:g}),[]),m=l.useCallback(f=>t({type:"reorder",tabs:f}),[]),b=l.useMemo(()=>e.tabs.find(f=>f.id===e.activeId)??e.tabs[0],[e.tabs,e.activeId]);return{tabs:e.tabs,activeId:e.activeId,activeTab:b,open:s,openInternal:i,openUrl:o,close:c,activate:u,patch:h,reorder:m}}function Vs(){const[e,t]=l.useState(()=>mn());l.useEffect(()=>{bn(e)},[e]);const s=l.useCallback(u=>{const h=u.trim();if(!h)return;const m=/^https?:\/\//.test(h)?h:`https://${h}`;t(b=>[...b,Jt(m)])},[]),i=l.useCallback(u=>{t(h=>h.filter(m=>m.id!==u))},[]),o=l.useCallback((u,h)=>{u&&t(m=>{const b=m.findIndex(f=>f.url===u);return b>=0?m.filter((f,g)=>g!==b):[...m,Jt(u,h)]})},[]),c=l.useCallback(u=>!!u&&e.some(h=>h.url===u),[e]);return{bookmarks:e,add:s,remove:i,toggleForUrl:o,has:c}}const ft=[{id:"dark",name:"Dark",mode:"dark"},{id:"light",name:"Light",mode:"light"}],Ks="dark";function mt(e){return ft.find(t=>t.id===e)??ft[0]}function Ot(){const e=ge("theme");return e&&ft.some(t=>t.id===e)?e:e&&e.includes("light")?"light":Ks}function Ut(e){const t=mt(e),s=document.documentElement;s.dataset.theme=t.mode,s.style.removeProperty("--wallpaper"),we("theme",t.id)}function Gs(){const[e,t]=l.useState(Ot),s=l.useRef(!1);l.useEffect(()=>{if(!s.current){s.current=!0;return}const c=document.documentElement;c.classList.add("theme-anim"),Ut(e);const u=window.setTimeout(()=>c.classList.remove("theme-anim"),320);return()=>window.clearTimeout(u)},[e]);const i=l.useCallback(c=>t(c),[]),o=l.useCallback(()=>{t(c=>mt(c).mode==="dark"?"light":"dark")},[]);return{id:e,mode:mt(e).mode,set:i,toggle:o}}const Xt=[{id:"none",label:"None",title:"",favicon:""},{id:"google-classroom",label:"Google Classroom",title:"Home - Classroom",favicon:"https://ssl.gstatic.com/classroom/favicon.png"},{id:"google-forms",label:"Google Forms",title:"Untitled form - Google Forms",favicon:"https://ssl.gstatic.com/docs/spreadsheets/forms/forms_icon_2023q4.ico"},{id:"google-drive",label:"Google Drive",title:"My Drive - Google Drive",favicon:"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png"},{id:"google-docs",label:"Google Docs",title:"Untitled document - Google Docs",favicon:"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico"},{id:"kahoot",label:"Kahoot!",title:"Kahoot!",favicon:"https://kahoot.com/favicon.ico"},{id:"quizlet",label:"Quizlet",title:"Quizlet",favicon:"https://quizlet.com/favicon.ico"},{id:"custom",label:"Custom",title:"",favicon:""}],Ln="Home",Js=Ze("branding/lucide-834cc7f9f1eda4fb.png"),Ys="about:blank";let In=!1;function vi(e){In=e}function Xs(){return In}function yi(e){return Xt.find(t=>t.id===e)??Xt[0]}function Qs(){let e=document.querySelector('link[rel~="icon"]');return e||(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e}function Zs(e,t){const s=e.trim(),i=t.trim();document.title=s||Ln,Qs().href=i||Js}function xi(e){const t=e.trim();if(!t)return{valid:!1,error:"URL is required"};const s=/^https?:\/\//i.test(t)?t:`https://${t}`;let i;try{i=new URL(s)}catch{return{valid:!1,error:"Invalid URL format"}}return i.protocol!=="http:"&&i.protocol!=="https:"?{valid:!1,error:"URL must start with http:// or https://"}:{valid:!0,value:i.toString()}}function er(e,t,s,i){const o=e.document;o.open(),o.close();const c=o.documentElement;let u=o.head,h=o.body;u||(u=o.createElement("head"),c.appendChild(u)),h||(h=o.createElement("body"),c.appendChild(h));const m=o.createElement("meta");m.setAttribute("charset","utf-8"),u.appendChild(m);const b=o.createElement("meta");if(b.name="_rxi5qmt",b.content="width=device-width,initial-scale=1",u.appendChild(b),o.title=s.trim()||Ln,i.trim()){const y=o.createElement("link");y.rel="icon",y.href=i.trim(),u.appendChild(y)}const f=o.createElement("style");f.textContent="html,body{margin:0;height:100%;background:#000}iframe{display:block;width:100%;height:100%;border:0}",u.appendChild(f);const g=o.createElement("iframe");g.src=t,g.referrerPolicy="no-referrer",g.allow=_n,g.allowFullscreen=!0,h.appendChild(g)}function tr(e,t,s){let i=window;try{window.top&&window.top!==window.self&&(i=window.top)}catch{}const o=i.open(Ys,"_blank");if(!o)return{ok:!1,error:"Popup blocked — allow popups for this site, then try again."};const c=location.href.startsWith("about:")?Ze():location.href;try{er(o,c,t,s)}catch{return{ok:!1,error:"Couldn't write to the new window."}}return window.setTimeout(()=>{try{i.location.replace(e)}catch{window.location.replace(e)}},40),{ok:!0}}let $t=document.body;function nr(e){$t=e}function sr(){return $t}function rr(){return $t}function Qt(e){return e===" "?"space":e.trim().toLowerCase()}function ir(e){const t=e;return!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function or(e){l.useEffect(()=>{Zs(e.coverTitle,e.coverFavicon)},[e.coverTitle,e.coverFavicon]),l.useEffect(()=>{const s=Qt(e.exitKey),i=e.exitUrl;if(!s||!i)return;const o=h=>{if(!(h.repeat||Xs()||ir(h.target))&&Qt(h.key)===s){h.preventDefault();try{if(window.top&&window.top!==window.self){window.top.location.assign(i);return}}catch{}window.location.assign(i)}},c=sr(),u=o;return c.addEventListener("keydown",u,!0),()=>c.removeEventListener("keydown",u,!0)},[e.exitKey,e.exitUrl]),l.useEffect(()=>{if(!e.confirmLeave)return;const s=i=>{i.preventDefault(),i.returnValue=""};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e.confirmLeave]);const t=l.useRef(!1);l.useEffect(()=>{if(!e.autoCoverFrame||t.current||window.self!==window.top)return;const s=()=>{t.current||(t.current=!0,i(),tr(e.exitUrl,e.coverTitle,e.coverFavicon))},i=()=>{window.removeEventListener("pointerdown",s),window.removeEventListener("keydown",s)};return window.addEventListener("pointerdown",s),window.addEventListener("keydown",s),i},[e.autoCoverFrame,e.exitUrl,e.coverTitle,e.coverFavicon])}const bt=[{id:"google",name:"Google",template:"https://www.google.com/search?q=%s"},{id:"duckduckgo",name:"DuckDuckGo",template:"https://duckduckgo.com/?q=%s"},{id:"bing",name:"Bing",template:"https://www.bing.com/search?q=%s"},{id:"brave",name:"Brave",template:"https://search.brave.com/search?q=%s"}],pe={searchEngineId:"duckduckgo",coverPreset:"none",coverTitle:"",coverFavicon:"",autoCoverFrame:!1,exitKey:"`",exitUrl:"https://docs.google.com/document/u/0/",confirmLeave:!1,backgroundMode:"full",accent:"#ffffff",adblock:!0};function ar(e){return bt.some(t=>t.id===e)}function cr(e){return e==="full"||e==="reduced"||e==="mesh"||e==="off"}function lr(e){return typeof e=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)}function Ie(e,t){return typeof e=="string"?e:t}function lt(e,t){return typeof e=="boolean"?e:t}function Bt(){const e=tt("settings",{});return{searchEngineId:ar(e.searchEngineId)?e.searchEngineId:pe.searchEngineId,coverPreset:Ie(e.coverPreset??e.cloakPreset,pe.coverPreset),coverTitle:Ie(e.coverTitle??e.cloakTitle,pe.coverTitle),coverFavicon:Ie(e.coverFavicon??e.cloakFavicon,pe.coverFavicon),autoCoverFrame:lt(e.autoCoverFrame??e.autoAboutBlank,pe.autoCoverFrame),exitKey:Ie(e.exitKey??e.panicKey,pe.exitKey),exitUrl:Ie(e.exitUrl??e.panicUrl,pe.exitUrl),confirmLeave:lt(e.confirmLeave,pe.confirmLeave),backgroundMode:cr(e.backgroundMode)?e.backgroundMode:pe.backgroundMode,accent:lr(e.accent)?e.accent:pe.accent,adblock:lt(e.adblock,pe.adblock)}}function Rn(e){nt("settings",e)}function Zt(e){return(bt.find(t=>t.id===e)??bt[0]).template}function ur(){const[e,t]=l.useState(Bt);l.useEffect(()=>{Rn(e)},[e]);const s=l.useCallback(i=>{t(o=>({...o,...i}))},[]);return{settings:e,update:s}}function dr(e){const t=l.useRef(e);t.current=e,l.useEffect(()=>{const s=i=>{if(!(i.ctrlKey||i.metaKey)||i.altKey)return;const o=i.key.toLowerCase();o==="t"?(i.preventDefault(),t.current.onNewTab()):o==="w"?(i.preventDefault(),t.current.onCloseTab()):o==="k"?(i.preventDefault(),t.current.onSpotlight()):o>="1"&&o<="9"&&(i.preventDefault(),t.current.onJumpToTab(Number(o)))};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[])}function hr(e){const[t,s]=l.useState(null),[i,o]=l.useState(null);return l.useEffect(()=>{let c=!0,u=0;const h=window.requestIdleCallback,m=f=>h?h(f,{timeout:2500}):window.setTimeout(f,200),b=()=>{Ae(async()=>{const{rebootController:f}=await import("./boot-D3vqjHTs-8068ec8f.js");return{rebootController:f}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({rebootController:f})=>f().then(g=>{an(),c&&s(g)},g=>{c&&(u+=1,u<30?window.setTimeout(b,Math.min(1e3*u,5e3)):o(g instanceof Error?g:new Error(String(g))))}))};return m(b),()=>{c=!1}},[e]),{controller:t,error:i}}let je=null,qe=null,Ve=null,Ke=!1;const en=new WeakSet;function Mn(){if(!je||Ve===null)return;const e=Ve;Ve=null,Ke=!0;try{je.cookieJar.clear(),je.cookieJar.load(e),je.persistCookies().finally(()=>{Ke=!1})}catch{Ke=!1}}function pr(e,t){if(qe=t,!!e){if(je=e,!en.has(e)){const s=e.persistCookies.bind(e);e.persistCookies=(async()=>{await s(),Ke||qe==null||qe()}),en.add(e)}Mn()}}function fr(){if(!je)return null;try{return je.cookieJar.dump()}catch{return null}}function mr(e){Ve=e,Mn()}const br="https://www.google.com/search?q=%s";function gr(e){return/\s/.test(e)?!1:/^https?:\/\//.test(e)||e.startsWith("localhost")?!0:/^[^\s.]+\.[^\s.]{2,}/.test(e)}function tn(e,t=br){const s=e.trim();return s?/^https?:\/\//.test(s)?s:gr(s)?`https://${s}`:t.replace("%s",encodeURIComponent(s)):""}class gt extends Error{constructor(s,i,o=null){super(i);ke(this,"status");ke(this,"code");this.status=s,this.code=o}}const ce="/api/account";async function wr(e){const t=await e.text();try{const s=JSON.parse(t);return{message:s.error??t,code:s.code??null}}catch{return{message:t||e.statusText,code:null}}}function vr(){async function e(t,s,i){const o={...i==null?void 0:i.headers};let c=i==null?void 0:i.body;(i==null?void 0:i.json)!==void 0&&(o["content-type"]="application/json",c=JSON.stringify(i.json));const u=await fetch(Oe(t+s),{...i,headers:{...o,...ms("account")},body:c,credentials:xn});if(!u.ok){const{message:h,code:m}=await wr(u);throw new gt(u.status,h,m)}if(u.status!==204)return await u.json()}return{me:()=>e(ce,"/me"),login:(t,s,i)=>e(ce,"/auth/login",{method:"POST",json:{email:t,password:s,captcha:i}}).then(o=>(at("account",o),o)),requestSetPassword:(t,s)=>e(ce,"/auth/set-password/request",{method:"POST",json:{email:t,captcha:s}}),setPassword:(t,s,i)=>e(ce,"/auth/set-password",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),requestReset:(t,s)=>e(ce,"/auth/reset/request",{method:"POST",json:{email:t,captcha:s}}),reset:(t,s,i)=>e(ce,"/auth/reset",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),logout:()=>(bs("account"),e(ce,"/logout",{method:"POST"})),getSync:()=>e(ce,"/me/sync"),putSync:t=>e(ce,"/me/sync",{method:"PUT",json:{data:t}}),billingStatus:()=>e(ce,"/billing/status"),checkout:(t,s)=>e(ce,"/billing/checkout",{method:"POST",json:{email:t,origin:s}}),billingPortal:t=>e(ce,"/billing/portal",{method:"POST",json:{origin:t}}),verifyCheckout:t=>e(ce,`/billing/verify?session_id=${encodeURIComponent(t)}`),setDiscord:t=>e(ce,"/me/discord",{method:"POST",json:{discordHandle:t}})}}function yr(){const e={bookmarks:mn(),settings:Bt(),themeId:Ot()},t=fr();return t!==null&&(e.proxyCookies=t),e}function xr(e){if(typeof e!="object"||e===null)return;const{bookmarks:t,settings:s,themeId:i,proxyCookies:o}=e;Array.isArray(t)&&bn(t),s&&typeof s=="object"&&Rn({...Bt(),...s}),typeof i=="string"&&Ut(i),typeof o=="string"&&mr(o)}var ze={exports:{}},nn;function kr(){return nn||(nn=1,(function(e,t){(()=>{var q,ee,F,E,R,S,M,z,oe,re,le,p,ue,ie,de,he,me,C,Se,wt,vt,Ge,yt,xt,kt,Dn,jt,Fn,On,Et,Je,Ct,Un,Ye,Be,$n,Xe;const s="vibrate"in navigator&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(typeof window>"u")return;const i=["#f5c2e7","#cba6f7","#f38ba8","#fab387","#f9e2af","#a6e3a1","#94e2d5","#89dceb","#b4befe"],o=(G,_,a)=>{const d=_===0?"9999px":"0",w=_===a-1?"9999px":"0";return`color:#1e1e2e;background:${(v=>{if(v==="cap")return"#89b4fa";let x=0;for(let A=0;A<v.length;A++)x=v.charCodeAt(A)+((x<<5)-x);return i[Math.abs(x)%i.length]})(G)};margin-left:${_?"-6px":0};padding:0 6px;border-radius:${d} ${w} ${w} ${d};font-weight:600`},c={};for(const G of["debug","info","warn","error"])c[G]=(_,...a)=>{if(window.CAP_SILENT||G==="debug"&&!window.CAP_DEBUG)return;const d=_.map(v=>`%c${v}`).join(" "),w=_.map((v,x)=>o(v,x,_.length))};const u=G=>G?["cap",G]:["cap"],h=G=>`${Math.round(performance.now()-G)}ms`,m=(G,_)=>Object.assign(new Error(_),{code:G}),b=(G,_={})=>window!=null&&window.CAP_CUSTOM_FETCH?window.CAP_CUSTOM_FETCH(G,_):fetch(G,_),f=(G,_)=>_?_.aborted?Promise.reject(m("aborted","aborted")):Promise.race([G,new Promise((a,d)=>_.addEventListener("abort",()=>d(m("aborted","aborted")),{once:!0}))]):G,g="initial-state,verifying-label,solved-label,error-label,required-label,troubleshooting-label,group-aria-label,verify-aria-label,verifying-aria-label,verified-aria-label,error-aria-label".split(","),y={"zh-cn":"确认你是真人/正在验证.../你是真人/出错了。请重试。/请确认你是真人/故障排除/Cap 验证/点击以确认你是真人/正在验证你是真人,请稍候/我们已确认你是真人,你可以继续了/发生错误,请重试",es:"Verifica que eres humano/Verificando.../Eres humano/Error. Inténtalo de nuevo./Verifica que eres humano/Solucionar problemas/Verificación de Cap/Haz clic para verificar que eres humano/Verificando que eres humano, espera/Hemos verificado que eres humano, ya puedes continuar/Se produjo un error, inténtalo de nuevo",hi:"पुष्टि करें कि आप मानव हैं/सत्यापित हो रहा है.../आप मानव हैं/त्रुटि। पुनः प्रयास करें।/कृपया पुष्टि करें कि आप मानव हैं/समस्या निवारण/Cap सत्यापन/पुष्टि करने के लिए क्लिक करें कि आप मानव हैं/सत्यापित किया जा रहा है कि आप मानव हैं, प्रतीक्षा करें/हमने पुष्टि कर दी है कि आप मानव हैं, अब आप जारी रख सकते हैं/एक त्रुटि हुई, पुनः प्रयास करें",ar:"تحقق من أنك إنسان/جارٍ التحقق.../أنت إنسان/خطأ. حاول مرة أخرى./يرجى التحقق من أنك إنسان/استكشاف الأخطاء وإصلاحها/تحقق Cap/انقر للتحقق من أنك إنسان/جارٍ التحقق من أنك إنسان، يرجى الانتظار/لقد تحققنا من أنك إنسان، يمكنك المتابعة الآن/حدث خطأ، يرجى المحاولة مرة أخرى",pt:"Sou humano/Verificando.../Você é humano/Erro. Tente novamente./Verifique que você é humano/Solução de problemas/Verificação Cap/Clique para verificar que você é humano/Verificando que você é humano, aguarde/Verificamos que você é humano, você pode continuar/Ocorreu um erro, tente novamente",ru:"Я человек/Проверка.../Вы человек/Ошибка. Повторите./Подтвердите, что вы человек/Устранение неполадок/Проверка Cap/Нажмите, чтобы подтвердить, что вы человек/Проверяем, что вы человек, подождите/Мы подтвердили, что вы человек, можете продолжить/Произошла ошибка, повторите попытку",ja:"私は人間です/確認中.../あなたは人間です/エラー。再試行を。/あなたが人間であることを確認してください/トラブルシューティング/Cap 認証/クリックして人間であることを確認/あなたが人間であることを確認しています。お待ちください/あなたが人間であることを確認しました。続行できます/エラーが発生しました。もう一度お試しください",de:"Ich bin ein Mensch/Wird überprüft.../Sie sind ein Mensch/Fehler. Erneut versuchen./Bitte bestätigen Sie, dass Sie ein Mensch sind/Fehlerbehebung/Cap-Verifizierung/Klicken, um zu bestätigen, dass Sie ein Mensch sind/Überprüfung, ob Sie ein Mensch sind, bitte warten/Wir haben bestätigt, dass Sie ein Mensch sind, Sie können fortfahren/Ein Fehler ist aufgetreten, bitte erneut versuchen",fr:"Je suis humain/Vérification.../Vous êtes humain/Erreur. Réessayez./Veuillez vérifier que vous êtes humain/Dépannage/Vérification Cap/Cliquez pour vérifier que vous êtes humain/Vérification que vous êtes humain, veuillez patienter/Nous avons vérifié que vous êtes humain, vous pouvez continuer/Une erreur s'est produite, veuillez réessayer"};function P(G,_){let a=(function(v){let x=2166136261;for(let A=0;A<v.length;A++)x^=v.charCodeAt(A),x+=(x<<1)+(x<<4)+(x<<7)+(x<<8)+(x<<24);return x>>>0})(G),d="";function w(){return a^=a<<13,a^=a>>>17,a^=a<<5,a>>>0}for(;d.length<_;)d+=w().toString(16).padStart(8,"0");return d.substring(0,_)}let k=null;async function j(G){const _=(d=>{const w=atob(d),v=new Uint8Array(w.length);for(let x=0;x<w.length;x++)v[x]=w.charCodeAt(x);return v})(G),a=new TextDecoder().decode(await(async function(d){if(typeof DecompressionStream<"u")try{const w=new DecompressionStream("deflate-raw"),v=w.writable.getWriter(),x=w.readable.getReader();v.write(d).then(()=>v.close()).catch(()=>{});const A=[];for(;;){const{done:X,value:te}=await x.read();if(X)break;A.push(te)}let N=0;for(const X of A)N+=X.length;const O=new Uint8Array(N);let L=0;for(const X of A)O.set(X,L),L+=X.length;return O}catch{}return k||(k=new Promise((w,v)=>{const x=window.CAP_PAKO_URL||"https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako_inflate.min.js";c.debug(u("instr"),"DecompressionStream unavailable, loading pako from",x);const A=document.createElement("script");A.src=x;const N=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE;N&&A.setAttribute("nonce",N),A.onload=()=>{var O;(O=window.pako)!=null&&O.inflateRaw?w(window.pako):v(new Error("pako loaded but inflateRaw is missing"))},A.onerror=()=>{k=null,v(new Error(`failed to load pako fallback from ${x}`))},document.head.appendChild(A)})),(await k).inflateRaw(d)})(_));return new Promise(d=>{var w=setTimeout(()=>{A(),d({__timeout:!0})},2e4),v=document.createElement("iframe");v.setAttribute("sandbox","allow-scripts"),v.setAttribute("aria-hidden","true"),v.style.cssText="position:absolute;width:1px;height:1px;top:-9999px;left:-9999px;border:none;opacity:0;pointer-events:none;";var x=!1;function A(){x||(x=!0,clearTimeout(w),window.removeEventListener("message",N),v.parentNode&&v.parentNode.removeChild(v))}function N(X){if(v.contentWindow&&X.source===v.contentWindow){var te=X.data;te&&typeof te=="object"&&(te.type==="cap:instr"?(A(),te.blocked?d({__blocked:!0,blockReason:te.blockReason||"automated_browser"}):te.result?d(te.result):d({__timeout:!0})):te.type==="cap:error"&&(A(),d({__timeout:!0})))}}window.addEventListener("message",N);const O=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE,L=O?` nonce="${String(O).replace(/"/g,"&quot;")}"`:"";v.srcdoc='<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><script'+L+">"+a+`
3
- <\/script></body></html>`,document.body.appendChild(v)})}let I=null;const T=()=>{if(I)return I;const G=window.CAP_CUSTOM_WASM_URL||"https://cdn.jsdelivr.net/npm/@cap.js/wasm@0.0.7/browser/cap_wasm_bg.wasm",_=performance.now();return c.debug(u("wasm"),"fetching",G),I=fetch(G).then(a=>{if(!a.ok)throw new Error(`Failed to fetch wasm: ${a.status}`);return a.arrayBuffer()}).then(a=>WebAssembly.compile(a)).then(a=>(c.debug(u("wasm"),`ready in ${h(_)}`),a)).catch(a=>{throw I=null,c.warn(u("wasm"),`load failed (${h(_)}):`,a.message||a),a}),I};typeof WebAssembly=="object"&&typeof WebAssembly.compile=="function"&&T().catch(()=>{});let J=null;function ne(){return J||(J=URL.createObjectURL(new Blob(['(()=>{const e=(e,...t)=>{self.CAP_SILENT||console[e]("[cap worker]",...t)},t=async({salt:t,target:n})=>{let s=0;const r=new TextEncoder,o=4*n.length,a=Math.floor(o/8),l=o%8,i=n.length%2==0?n:`${n}0`,c=i.length/2,f=new Uint8Array(c);for(let e=0;e<c;e++)f[e]=parseInt(i.substring(2*e,2*e+2),16);const g=l>0?255<<8-l&255:0;for(;;)try{for(let e=0;e<5e4;e++){const e=t+s,n=r.encode(e),o=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(o);let c=!0;for(let e=0;e<a;e++)if(i[e]!==f[e]){c=!1;break}if(c&&l>0&&(i[a]&g)!==(f[a]&g)&&(c=!1),c)return void self.postMessage({nonce:s,found:!0});s++}}catch(t){return e("error","fallback solver crashed:",t.message||t),void self.postMessage({found:!1,error:t.message})}},n=e=>{const t=BigInt("0x"+e.N);let n=BigInt("0x"+e.x);const s=0|e.t,r=Math.max(64,Math.floor(s/50)),o=performance.now();for(let e=0;e<s;e+=r){const o=Math.min(s,e+r);for(let s=e;s<o;s++)n=n*n%t;o<s&&self.postMessage({progress:o/s})}self.postMessage({found:!0,y:n.toString(16),durationMs:(performance.now()-o).toFixed(2)})};if("object"!=typeof WebAssembly||"function"!=typeof WebAssembly?.instantiate)return e("warn","WebAssembly unavailable, using JS fallback solver (significantly slower)"),void(self.onmessage=async({data:e})=>"rsw"===e?.kind?n(e):t({salt:e.salt,target:e.target}));let s=null;self.onmessage=async({data:r})=>{if("rsw"===r?.kind)return n(r);const{salt:o,target:a,wasmModule:l}=r;if(l instanceof WebAssembly.Module&&null===s){const n=(t=>{try{let e,n=0,r=null;const o=()=>(null!==r&&0!==r.byteLength||(r=new Uint8Array(e.memory.buffer)),r),a=new TextEncoder,l=(e,t,s)=>{if(void 0===s){const s=a.encode(e),r=t(s.length,1)>>>0;return o().subarray(r,r+s.length).set(s),n=s.length,r}let r=e.length,l=t(r,1)>>>0;const i=o();let c=0;for(;c<r;c++){const t=e.charCodeAt(c);if(t>127)break;i[l+c]=t}if(c!==r){0!==c&&(e=e.slice(c));const t=c+3*e.length;l=s(l,r,t,1)>>>0,r=t;const n=o().subarray(l+c,l+r),{written:i}=a.encodeInto(e,n);c+=i,l=s(l,r,c,1)>>>0}return n=c,l},i={wbg:{}};i.wbg.__wbindgen_init_externref_table=()=>{const t=e.__wbindgen_export_0,n=t.grow(4);t.set(0,void 0),t.set(n+0,void 0),t.set(n+1,null),t.set(n+2,!0),t.set(n+3,!1)};const c=new WebAssembly.Instance(t,i);return e=c.exports,e.__wbindgen_start&&e.__wbindgen_start(),s=(t,s)=>{const r=l(t,e.__wbindgen_malloc,e.__wbindgen_realloc),o=n,a=l(s,e.__wbindgen_malloc,e.__wbindgen_realloc),i=n;return BigInt.asUintN(64,e.solve_pow(r,o,a,i))},!0}catch(t){return e("error","wasm init failed:",t.message||t),!1}})(l);if(!n)return e("warn","wasm init failed, falling back to JS solver"),t({salt:o,target:a})}if(null===s)return e("warn","no wasm module provided, falling back to JS solver"),t({salt:o,target:a});try{const e=performance.now(),t=s(o,a),n=performance.now();self.postMessage({nonce:Number(t),found:!0,durationMs:(n-e).toFixed(2)})}catch(t){e("error","solve_pow threw:",t.message||t),self.postMessage({found:!1,error:t.message||String(t)})}},self.onerror=e=>{self.postMessage({found:!1,error:e})}})();'],{type:"application/javascript"})),J)}class B{constructor(_){this._size=_,this._workers=[],this._idle=[],this._queue=[],this._wasmModule=null,this._spawnFailures=0}setWasm(_){this._wasmModule=_}_spawn(){const _=ne(),a=new Worker(_);return a._busy=!1,this._workers.push(a),this._idle.push(a),a}_replaceWorker(_){const a=this._workers.indexOf(_);a!==-1&&this._workers.splice(a,1);const d=this._idle.indexOf(_);d!==-1&&this._idle.splice(d,1);try{_.terminate()}catch{}return this._spawnFailures++,c.warn(u("pool"),`worker died, replacing (attempt ${this._spawnFailures}/3)`),this._spawnFailures>3?(c.error(u("pool"),"worker spawn failed repeatedly, giving up"),null):this._spawn()}_ensureSize(_){for(;this._workers.length<_;)this._spawn()}run(_,a){return new Promise((d,w)=>{this._queue.push({salt:_,target:a,resolve:d,reject:w}),this._dispatch()})}runMsg(_,a){return new Promise((d,w)=>{this._queue.push({msg:_,onProgress:a,resolve:d,reject:w}),this._dispatch()})}_dispatch(){for(;this._idle.length>0&&this._queue.length>0;){const _=this._idle.shift(),a=this._queue.shift(),{resolve:d,reject:w}=a,v=a.msg!==void 0;let x=!1;const A=({data:O})=>{if(!x){if(!O||typeof O.progress!="number"||O.found)x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N),this._spawnFailures=0,this._idle.push(_),O.found?d(v?O:O.nonce):w(new Error(O.error||"worker failed")),this._dispatch();else if(a.onProgress)try{a.onProgress(O.progress)}catch{}}},N=O=>{if(x)return;x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N);const L=this._replaceWorker(_);w(O),L&&this._dispatch()};_.addEventListener("message",A),_.addEventListener("error",N),v?_.postMessage(a.msg):this._wasmModule?_.postMessage({salt:a.salt,target:a.target,wasmModule:this._wasmModule},[]):_.postMessage({salt:a.salt,target:a.target})}}terminate(){for(const _ of this._workers)try{_.terminate()}catch{}this._workers=[],this._idle=[],this._queue=[]}}class $ extends HTMLElement{constructor(){super();se(this,C);se(this,q,null);se(this,ee,navigator.hardwareConcurrency||8);ke(this,"token",null);se(this,F);se(this,E);se(this,R);se(this,S);se(this,M);se(this,z);se(this,oe,!1);se(this,re);se(this,le);se(this,p,null);se(this,ue,null);se(this,ie,null);se(this,de,null);se(this,he,null);se(this,me,null);se(this,Be,()=>{if(r(this,E)){try{this.scrollIntoView({behavior:"smooth",block:"center"})}catch{this.scrollIntoView()}r(this,E).classList.remove("invalid"),r(this,E).offsetWidth,r(this,E).classList.add("invalid"),setTimeout(()=>{var a;return(a=r(this,E))==null?void 0:a.classList.remove("invalid")},1500)}});r(this,re)&&r(this,re).forEach((a,d)=>{this.removeEventListener(d.slice(2),a)}),W(this,re,new Map),this.boundHandleProgress=this.handleProgress.bind(this),this.boundHandleSolve=this.handleSolve.bind(this),this.boundHandleError=this.handleError.bind(this),this.boundHandleReset=this.handleReset.bind(this);try{W(this,le,this.attachInternals())}catch{}}getI18nText(a,d){var w;return this.getAttribute(`data-cap-i18n-${a}`)||((w=r(this,he))==null?void 0:w[a])||d}static get observedAttributes(){return["onsolve","onprogress","onreset","onerror","data-cap-worker-count","data-cap-i18n-initial-state","required"]}initialize(){ne(),W(this,me,new AbortController),r(this,p)||W(this,p,H(this,C,wt).call(this)),r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn())}attributeChangedCallback(a,d,w){var v;if(a.startsWith("on")){const x=a.slice(2),A=r(this,re).get(a);if(A&&this.removeEventListener(x,A),w){const N=O=>{const L=this.getAttribute(a);typeof window[L]=="function"&&window[L].call(this,O)};r(this,re).set(a,N),this.addEventListener(x,N)}}a==="data-cap-worker-count"&&this.setWorkersCount(parseInt(w,10)),a==="data-cap-i18n-initial-state"&&r(this,E)&&((v=r(this,E))!=null&&v.querySelector(".label.active"))&&this.animateLabel(this.getI18nText("initial-state","Verify you're human")),a==="required"&&H(this,C,Ye).call(this)}async connectedCallback(){W(this,z,this),this.shadowRoot?W(this,F,this.shadowRoot):W(this,F,this.attachShadow({mode:"open"})),r(this,E)||W(this,E,document.createElement("div")),H(this,C,Un).call(this),this.createUI(),this.addEventListeners(),this.initialize(),r(this,R).removeAttribute("disabled");const a=this.getAttribute("data-cap-worker-count"),d=a?parseInt(a,10):null;this.setWorkersCount(d||navigator.hardwareConcurrency||8),r(this,z).innerHTML=`<input type="hidden" name="${r(this,C,Et)}">`,c.debug(u(),`widget ready (workers=${r(this,ee)}, haptics=${r(this,C,Se)})`),H(this,C,yt).call(this),H(this,C,Ye).call(this),this.addEventListener("invalid",r(this,Be))}async solve(){var w,v;if(r(this,oe))return;H(this,C,Xe).call(this);const a=performance.now(),d=(w=r(this,me))==null?void 0:w.signal;c.debug(u("solve"),"starting");try{W(this,oe,!0),this.updateUI("verifying",this.getI18nText("verifying-label","Verifying..."),!0),r(this,R).setAttribute("aria-label",this.getI18nText("verifying-aria-label","Verifying you're a human, please wait")),this.dispatchEvent("progress",{progress:0});try{let x,A,N=this.getAttribute("data-cap-api-endpoint");if(!N&&(window!=null&&window.CAP_CUSTOM_FETCH))N="/";else if(!N)throw m("missing_endpoint","Missing API endpoint. Either custom fetch or an API endpoint must be provided.");if(N.endsWith("/")||(N+="/"),r(this,p).state==="done"&&r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);if(r(this,p).state==="done")x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100});else if(r(this,p).state==="solving"||r(this,p).state==="redeeming"||r(this,p).state==="fetching"||r(this,p).state==="waiting"){r(this,p).state==="waiting"&&(r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,p).state="waiting",H(this,C,jt).call(this)),r(this,p).pendingPromotion=r(this,ee),r(this,p).promoteFn&&r(this,p).promoteFn(r(this,ee));const V=setInterval(()=>{if(d!=null&&d.aborted||!r(this,p))return void clearInterval(V);const Q=r(this,p).state;if(Q==="done"||Q==="error")return void clearInterval(V);const xe=r(this,p).challenges?r(this,p).challenges.length:1,Pe=r(this,p).completedCount,Le=Q==="redeeming"?99:Q==="fetching"||Q==="waiting"?0:Math.min(98,Math.round(Pe/xe*100));this.dispatchEvent("progress",{progress:Le})},150);if(await new Promise(Q=>r(this,p).onSettled(Q)),clearInterval(V),(d==null?void 0:d.aborted)||!r(this,p))return;if(r(this,p).state==="idle"&&((v=r(this,p).challengeResp)==null?void 0:v.format)===2&&Array.isArray(r(this,p).challengeResp.challenges))A=r(this,p).challengeResp,r(this,p).challengeResp=null,x=await this.solveChallengesV2(A.challenges,d);else{if(r(this,p).state!=="done")throw m("solve_failed","Unable to solve challenge, self-hosted instance likely down. This is not an issue with Cap.");if(r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100})}}else{const V=r(this,p).challengeResp;if((V==null?void 0:V.format)===2&&Array.isArray(V.challenges))A=V,r(this,p).challengeResp=null;else{const Q=await b(`${N}challenge`,{method:"POST",signal:d});try{A=await Q.json()}catch{throw m("challenge_parse_error","Failed to parse challenge response from server")}if(A.error)throw m("network_error",A.error)}if(A.format===2&&Array.isArray(A.challenges))x=await this.solveChallengesV2(A.challenges,d);else{const{challenge:Q,token:xe}=A;let Pe=Q;if(!Array.isArray(Pe)){let Le=0;Pe=Array.from({length:Q.c},()=>(Le++,[P(`${xe}${Le}`,Q.s),P(`${xe}${Le}d`,Q.d)]))}x=await this.solveChallenges(Pe,d)}}const O=A.instrumentation?j(A.instrumentation):Promise.resolve(null),L=await O;if(d!=null&&d.aborted||!r(this,p))return;if(L!=null&&L.__timeout||L!=null&&L.__blocked){b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:A.token,solutions:x,...L.__blocked&&{instr_blocked:!0},...L.__timeout&&{instr_timeout:!0}}),headers:{"Content-Type":"application/json"},signal:d}).catch(()=>{}),this.updateUIBlocked(this.getI18nText("error-label","Error"),L==null?void 0:L.__blocked),r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again"));const V=L!=null&&L.__blocked?"instr_blocked":"instr_timeout",Q=L!=null&&L.__blocked?`Instrumentation blocked (${L.blockReason||"automated_browser"})`:"Instrumentation timed out";this.removeEventListener("error",this.boundHandleError);const xe=new CustomEvent("error",{bubbles:!0,composed:!0,detail:{isCap:!0,code:V,message:Q}});return super.dispatchEvent(xe),this.addEventListener("error",this.boundHandleError),this.executeAttributeCode("onerror",xe),c.error(u("instr"),`[${V}] ${Q}`),void W(this,oe,!1)}const{token:X}=A,te=await b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:X,solutions:x,...L&&{instr:L}}),headers:{"Content-Type":"application/json"},signal:d});let U;try{U=await te.json()}catch{throw m("redeem_failed","Failed to parse server response")}if(d!=null&&d.aborted||!r(this,p))return;if(this.dispatchEvent("progress",{progress:100}),!U.success)throw m("invalid_solution",U.error||"Invalid solution");H(this,C,Je).call(this,U.token),this.dispatchEvent("solve",{token:U.token}),this.token=U.token,H(this,C,vt).call(this),r(this,q)&&clearTimeout(r(this,q));const K=new Date(U.expires).getTime()-Date.now();return K>0&&K<864e5?W(this,q,setTimeout(()=>this.reset(),K)):this.error("Invalid expiration time","invalid_expires"),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),c.debug(u("solve"),`verified in ${h(a)}`),H(this,C,kt).call(this),{success:!0,token:this.token}}catch(x){if(d!=null&&d.aborted||!r(this,p))return;throw r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again")),this.error(x.message,x.code||"solve_failed"),x}}finally{W(this,oe,!1)}}async solveChallengesV2(a,d){const w=a.length;let v=0;const x=new Array(a.length);for(let U=0;U<a.length;U++){const K=a[U];if(!K||typeof K!="object"||K.protocol!=="sha256-pow"&&K.protocol!=="rsw"&&K.protocol!=="instrumentation")throw m("challenge_unsupported",`unsupported format-2 protocol '${K==null?void 0:K.protocol}'`)}let A=null;if(typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function")try{A=await T()}catch(U){c.warn(u("wasm"),"unavailable, falling back to JS solver:",U.message||U)}const N=Math.max(1,Math.min(r(this,ee),a.length)),O=new B(N);O.setWasm(A),O._ensureSize(N);const L=(U,K)=>Promise.race([U,new Promise((V,Q)=>setTimeout(()=>Q(new Error(`[cap] ${K} timed out after 60000ms`)),6e4))]),X=new Array(a.length).fill(0),te=()=>{const U=X.reduce((V,Q)=>V+Q,0)+v,K=Math.min(99,Math.round(U/w*100));this.dispatchEvent("progress",{progress:K})};try{await f(Promise.all(a.map((U,K)=>U.protocol==="sha256-pow"?L(O.run(U.payload.salt,U.payload.target),`sha256-pow worker #${K}`).then(V=>{x[K]={nonce:Number(V)},X[K]=0,v++,te()}):U.protocol==="rsw"?L(O.runMsg({kind:"rsw",N:U.payload.N,x:U.payload.x,t:0|U.payload.t},V=>{X[K]=V,te()}),`rsw worker #${K}`).then(V=>{x[K]={y:V.y},X[K]=0,v++,te()}):j(U.payload.blob).then(V=>{x[K]=V!=null&&V.__timeout?{timeout:!0}:V!=null&&V.__blocked?{blocked:!0}:{instr:V},X[K]=0,v++,te()}))),d)}finally{O.terminate()}return x}async solveChallenges(a,d){const w=a.length;let v=0,x=null;const A=typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function";if(A)try{x=await T()}catch(L){c.warn(u("wasm"),"unavailable, falling back to JS solver:",L.message||L)}if(!A&&(c.warn(u("wasm"),"WebAssembly disabled in this browser, solver will be ~10x slower"),!r(this,F).querySelector(".warning"))){const L=document.createElement("div");L.className="warning",L.style.cssText="width:var(--cap-widget-width,230px);background:rgb(237,56,46);color:white;padding:4px 6px;padding-bottom:calc(var(--cap-border-radius,14px) + 5px);font-size:10px;box-sizing:border-box;font-family:system-ui;border-top-left-radius:8px;border-top-right-radius:8px;text-align:center;user-select:none;margin-bottom:-35.5px;opacity:0;transition:margin-bottom .3s,opacity .3s;",L.innerText=this.getI18nText("wasm-disabled","Enable WASM for significantly faster solving"),r(this,F).insertBefore(L,r(this,F).firstChild),setTimeout(()=>{L.style.marginBottom="calc(-1 * var(--cap-border-radius, 14px))",L.style.opacity=1},10)}const N=new B(r(this,ee));N.setWasm(x),N._ensureSize(r(this,ee));const O=[];try{for(let L=0;L<a.length;L+=r(this,ee)){const X=a.slice(L,Math.min(L+r(this,ee),a.length)),te=await f(Promise.all(X.map(([U,K])=>N.run(U,K).then(V=>{v++;const Q=Math.min(99,Math.round((0+v)/w*100));return this.dispatchEvent("progress",{progress:Q}),V}))),d);O.push(...te)}}finally{N.terminate()}return O}setWorkersCount(a){const d=parseInt(a,10),w=Math.min(navigator.hardwareConcurrency||8,16);W(this,ee,!Number.isNaN(d)&&d>0&&d<=w?d:navigator.hardwareConcurrency||8)}createUI(){r(this,E).classList.add("captcha"),r(this,E).setAttribute("role","group"),r(this,E).setAttribute("aria-label",this.getI18nText("group-aria-label","Cap verification")),W(this,R,document.createElement("div")),r(this,R).className="captcha-trigger",r(this,R).setAttribute("part","trigger"),r(this,R).setAttribute("role","button"),r(this,R).setAttribute("tabindex","0"),r(this,R).setAttribute("aria-label",this.getI18nText("verify-aria-label","Click to verify you're a human")),r(this,R).setAttribute("aria-live","polite"),r(this,R).setAttribute("disabled","true"),r(this,R).innerHTML=`<div class="checkbox" part="checkbox" aria-hidden="true"><svg class="progress-ring" viewBox="0 0 32 32" aria-hidden="true"><circle class="progress-ring-bg" cx="16" cy="16" r="14"></circle><circle class="progress-ring-circle" cx="16" cy="16" r="14"></circle></svg></div><p part="label" class="label-wrapper"><span class="label active">${this.getI18nText("initial-state","Verify you're human")}</span></p>`,r(this,E).appendChild(r(this,R)),W(this,M,document.createElement("a")),r(this,M).className="cap-troubleshoot-link",r(this,M).setAttribute("part","troubleshoot"),r(this,M).setAttribute("target","_blank"),r(this,M).setAttribute("rel","noopener"),r(this,M).hidden=!0,r(this,E).appendChild(r(this,M)),W(this,S,document.createElement("a")),r(this,S).className="credits",r(this,S).setAttribute("aria-label","Secured by Cap"),r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).setAttribute("target","_blank"),r(this,S).setAttribute("title","Secured by Cap: The self-hosted CAPTCHA for the modern web."),r(this,S).textContent="Cap",r(this,E).appendChild(r(this,S)),r(this,F).innerHTML=`<style${window.CAP_CSS_NONCE?` nonce=${window.CAP_CSS_NONCE}`:""}>:host{display:inline-block}@media (prefers-reduced-motion:reduce){.captcha,.captcha *{transition:none!important;animation:none!important}.label{filter:none!important;opacity:1!important;transition:none!important;transform:none!important}.label:not(.active),.label.exit{display:none!important}}.captcha,.captcha *{box-sizing:border-box}.captcha{width:var(--cap-widget-width,260px);height:var(--cap-widget-height,58px);background-color:var(--cap-background,#fdfdfd);border:1px solid var(--cap-border-color,#dddddd8f);border-radius:var(--cap-border-radius,14px);-webkit-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:#fff0;color:var(--cap-color,#212121);font-family:var(--cap-font,system, -apple-system, "BlinkMacSystemFont", ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", "Ubuntu", "arial", sans-serif);transition:filter .2s,transform .2s,height .2s;display:inline-block;position:relative;overflow:hidden}.captcha.has-troubleshoot{height:calc(var(--cap-widget-height,58px) + 26px)}.captcha.has-troubleshoot .captcha-trigger{inset-block-end:26px}.captcha:not([data-state]):active{transform:scale(.97)}.captcha:hover{filter:brightness(98%)}.captcha-trigger{padding:var(--cap-widget-padding,14px);align-items:center;gap:var(--cap-gap,15px);border-radius:inherit;transition:inset .2s;display:flex;position:absolute;inset:0}.captcha-trigger:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:-3px}.checkbox{width:var(--cap-checkbox-size,25px);height:var(--cap-checkbox-size,25px);border:var(--cap-checkbox-border,1px solid #aaaaaad1);border-radius:var(--cap-checkbox-border-radius,6px);background-color:var(--cap-checkbox-background,#fafafa91);margin-top:var(--cap-checkbox-margin,2px);margin-bottom:var(--cap-checkbox-margin,2px);flex-shrink:0;transition:opacity .2s}.captcha p{-webkit-user-select:none;user-select:none;margin:0;font-size:15px;font-weight:500}.label-wrapper{flex:1;align-items:center;min-width:0;height:2em;display:flex;position:relative;overflow:hidden}.label-wrapper:before,.label-wrapper:after{content:"";pointer-events:none;z-index:1;width:100%;height:.6em;position:absolute;inset-inline-start:0}.label-wrapper:before{background:linear-gradient(to bottom, var(--cap-background,#fdfdfd), transparent);top:0}.label-wrapper:after{background:linear-gradient(to top, var(--cap-background,#fdfdfd), transparent);bottom:0}.label{white-space:nowrap;opacity:0;filter:blur(2px);transition:transform .5s cubic-bezier(.25,1,.5,1),opacity .5s,filter .5s;position:absolute;transform:translateY(100%)}.label.active{opacity:1;filter:none;transform:translateY(0)}.label.exit{opacity:0;filter:blur(2px);transform:translateY(-100%)}.checkbox .progress-ring{width:100%;height:100%;display:none;transform:rotate(-90deg)}.checkbox .progress-ring-bg{fill:none;stroke:var(--cap-spinner-background-color,#eee);stroke-width:var(--cap-spinner-thickness,3)}.checkbox .progress-ring-circle{fill:none;stroke:var(--cap-spinner-color,#000);stroke-width:var(--cap-spinner-thickness,3);stroke-linecap:round;stroke-dasharray:87.96;stroke-dashoffset:87.96px;transition:stroke-dashoffset .3s}.captcha[data-state=verifying] .checkbox{background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;display:flex;transform:scale(1.1)}.captcha[data-state=verifying] .checkbox .progress-ring{display:block}.captcha[data-state=done] .checkbox{background-image:var(--cap-checkmark,url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cstyle%3E%40keyframes%20anim%7B0%25%7Bstroke-dashoffset%3A23.21320343017578px%7Dto%7Bstroke-dashoffset%3A0%7D%7D%3C%2Fstyle%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%2300a67d%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m5%2012%205%205L20%207%22%20style%3D%22stroke-dashoffset%3A0%3Bstroke-dasharray%3A23.21320343017578px%3Banimation%3Aanim%20.5s%20ease%22%2F%3E%3C%2Fsvg%3E));background-size:cover;border:1px solid #0000}.captcha[data-state=done] .checkbox .progress-ring{display:none}.captcha[data-state=error] .checkbox{background-image:var(--cap-error-cross,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24'%3E%3Cpath fill='%23f55b50' d='M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8'/%3E%3C%2Fsvg%3E"));background-size:cover;border:1px solid #0000}.captcha[data-state=error] .checkbox .progress-ring{display:none}.captcha.invalid{border-color:var(--cap-invalid-border-color,#f55b50);box-shadow:0 0 0 3px var(--cap-invalid-ring-color,#f55b5033);animation:.5s cubic-bezier(.36,.07,.19,.97) cap-shake}@keyframes cap-shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}@media (prefers-reduced-motion:reduce){.captcha.invalid{animation:none!important}}.captcha-trigger[disabled]{cursor:not-allowed}.captcha[data-state=verifying] .captcha-trigger{cursor:progress}.captcha[data-state=done] .captcha-trigger{cursor:default}.credits{color:var(--cap-color,#212121);text-underline-offset:.18em;z-index:2;border-radius:4px;justify-content:flex-end;align-items:center;min-width:24px;min-height:24px;padding:4px 6px;text-decoration:underline;text-decoration-thickness:.08em;position:absolute;inset-block-end:4px;inset-inline-end:4px;opacity:.8!important;font-size:12px!important;display:inline-flex!important}.captcha .credits{visibility:visible!important;pointer-events:all!important;display:inline-flex!important}.credits:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px;opacity:1!important}.cap-troubleshoot-link{min-width:24px;min-height:24px;color:var(--cap-troubleshoot-color,#0050a0);text-underline-offset:.15em;cursor:pointer;z-index:2;border-radius:4px;align-items:center;padding:4px 6px;font-size:13px;font-weight:500;text-decoration:underline;text-decoration-thickness:.08em;display:inline-flex;position:absolute;inset-block-end:4px;inset-inline-start:14px}.cap-troubleshoot-link[hidden]{display:none}.cap-troubleshoot-link:hover{opacity:.85}.cap-troubleshoot-link:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px}@media (forced-colors:active){.captcha,.checkbox{border-color:canvastext}:is(.captcha-trigger:focus-visible,.credits:focus-visible,.cap-troubleshoot-link:focus-visible){outline-color:highlight}.progress-ring-bg{stroke:graytext}.progress-ring-circle{stroke:canvastext}.captcha.invalid{box-shadow:none;border-color:mark}.credits{opacity:1!important}}</style>`,r(this,F).appendChild(r(this,E)),H(this,C,Xe).call(this),setTimeout(()=>H(this,C,Xe).call(this),100)}addEventListeners(){r(this,R)&&(r(this,S).addEventListener("click",a=>{a.preventDefault(),window.open(`https://trycap.dev/?${new URLSearchParams({utm_source:"cap_widget",utm_medium:"referral",utm_campaign:"widget",utm_content:window.CAP_DISABLE_WIDGET_REF?"":location.hostname,ref:window.CAP_DISABLE_WIDGET_REF?"":location.href||"",sub:window.CAP_DISABLE_WIDGET_REF?"":document.referrer||""}).toString()}`,"_blank")}),r(this,R).addEventListener("click",()=>{r(this,R).hasAttribute("disabled")||this.solve()}),r(this,R).addEventListener("mousedown",()=>{!r(this,R).hasAttribute("disabled")&&r(this,C,Se)&&navigator.vibrate(5)}),r(this,R).addEventListener("keydown",a=>{a.target===r(this,R)&&(a.key!=="Enter"&&a.key!==" "||r(this,R).hasAttribute("disabled")||(a.preventDefault(),a.stopPropagation(),this.solve()))}),this.addEventListener("progress",this.boundHandleProgress),this.addEventListener("solve",this.boundHandleSolve),this.addEventListener("error",this.boundHandleError),this.addEventListener("reset",this.boundHandleReset))}animateLabel(a){var x;if(!r(this,R))return;const d=r(this,R).querySelector(".label-wrapper");if(!d)return;if((x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches){const A=d.querySelector(".label.active");if(A)A.textContent=a;else{const N=document.createElement("span");N.className="label active",N.textContent=a,d.appendChild(N)}return}const w=d.querySelector(".label.active"),v=document.createElement("span");v.className="label",v.textContent=a,d.appendChild(v),v.offsetWidth,v.classList.add("active"),w&&(w.classList.remove("active"),w.classList.add("exit"),w.addEventListener("transitionend",()=>w.remove(),{once:!0}))}updateUI(a,d,w=!1){r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state",a),r(this,E).classList.remove("has-troubleshoot"),this.animateLabel(d),r(this,M)&&(r(this,M).hidden=!0),w?r(this,R).setAttribute("disabled","true"):r(this,R).removeAttribute("disabled"))}updateUIBlocked(a,d=!1){if(r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state","error"),r(this,R).removeAttribute("disabled"),this.animateLabel(a),r(this,M)))if(d){const w=this.getAttribute("data-cap-troubleshooting-url")||"https://trycap.dev/guide/troubleshooting/instrumentation.html";r(this,M).setAttribute("href",w),r(this,M).textContent=this.getI18nText("troubleshooting-label","Troubleshoot"),r(this,M).hidden=!1,r(this,E).classList.add("has-troubleshoot")}else r(this,M).hidden=!0,r(this,E).classList.remove("has-troubleshoot")}handleProgress(a){if(!r(this,R))return;const d=r(this,R).querySelector(".progress-ring-circle");if(d){const v=2*Math.PI*14,x=v-a.detail.progress/100*v;d.style.strokeDashoffset=x}const w=r(this,R).querySelector(".label-wrapper");if(w){const v=w.querySelector(".label.active");v&&(v.textContent=`${this.getI18nText("verifying-label","Verifying...")}`)}this.executeAttributeCode("onprogress",a)}handleSolve(a){var d,w,v;this.updateUI("done",this.getI18nText("solved-label","You're a human"),!0),this.executeAttributeCode("onsolve",a),(w=(d=r(this,le))==null?void 0:d.setValidity)==null||w.call(d,{}),(v=r(this,E))==null||v.classList.remove("invalid")}handleError(a){this.updateUI("error",this.getI18nText("error-label","Error. Try again.")),this.executeAttributeCode("onerror",a),r(this,C,Se)&&navigator.vibrate([10,40,10])}handleReset(a){this.updateUI("",this.getI18nText("initial-state","I'm a human")),this.executeAttributeCode("onreset",a),H(this,C,Ye).call(this)}executeAttributeCode(a,d){const w=this.getAttribute(a);w&&(c.warn(u(),"inline `onxxx='…'` handlers are deprecated. use `addEventListener` callbacks instead."),new Function("event",w).call(this,d))}error(a="Unknown error",d="unknown"){c.error(u("solve"),`[${d}] ${a}`),this.dispatchEvent("error",{isCap:!0,code:d,message:a})}dispatchEvent(a,d={}){const w=new CustomEvent(a,{bubbles:!0,composed:!0,detail:d});super.dispatchEvent(w)}reset(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),this.token=null,this.dispatchEvent("reset"),H(this,C,Je).call(this,"")}get tokenValue(){return this.token}disconnectedCallback(){var a;(a=r(this,me))==null||a.abort(),this.removeEventListener("progress",this.boundHandleProgress),this.removeEventListener("solve",this.boundHandleSolve),this.removeEventListener("error",this.boundHandleError),this.removeEventListener("reset",this.boundHandleReset),r(this,re).forEach((d,w)=>{this.removeEventListener(w.slice(2),d)}),r(this,re).clear(),r(this,F)&&(r(this,F).innerHTML=""),this.reset(),this.cleanup()}cleanup(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),H(this,C,Ge).call(this),r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,ie)&&(r(this,ie).terminate(),W(this,ie,null)),r(this,p)&&(r(this,p).state="error",r(this,p).notify(),W(this,p,null))}}q=new WeakMap,ee=new WeakMap,F=new WeakMap,E=new WeakMap,R=new WeakMap,S=new WeakMap,M=new WeakMap,z=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakMap,p=new WeakMap,ue=new WeakMap,ie=new WeakMap,de=new WeakMap,he=new WeakMap,me=new WeakMap,C=new WeakSet,Se=function(){return s&&!window.CAP_DISABLE_HAPTICS&&!this.hasAttribute("data-cap-disable-haptics")},wt=function(){return{state:"idle",challengeResp:null,challenges:null,results:[],completedCount:0,solvePromise:null,promoteFn:null,_listeners:[],pendingPromotion:null,token:null,tokenExpires:null,notify(){for(const a of this._listeners)a();this._listeners=[]},onSettled(a){this.state==="done"||this.state==="error"?a():this._listeners.push(a)}}},vt=function(){W(this,p,H(this,C,wt).call(this)),H(this,C,yt).call(this)},Ge=function(){r(this,de)&&(window.removeEventListener("mousemove",r(this,de)),window.removeEventListener("touchstart",r(this,de)),window.removeEventListener("keydown",r(this,de)),W(this,de,null))},yt=function(){H(this,C,Ge).call(this);const a=()=>{H(this,C,Ge).call(this),H(this,C,Dn).call(this)};W(this,de,a),window.addEventListener("mousemove",a,{passive:!0}),window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("keydown",a,{passive:!0})},xt=function(){return typeof this.checkVisibility=="function"?this.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!!(this.offsetParent||this.getClientRects().length>0)},kt=function(){H(this,C,xt).call(this)||c.info(u("challenges"),"solved invisible challenge")},Dn=function(){r(this,p).state==="idle"&&H(this,C,xt).call(this)&&(r(this,p).state="waiting",W(this,ue,setTimeout(()=>{H(this,C,jt).call(this)},2500)))},jt=async function(){var d;if(r(this,p).state!=="waiting")return;r(this,p).state="fetching",r(this,p)._t0=performance.now();let a=this.getAttribute("data-cap-api-endpoint");if(!a&&(window!=null&&window.CAP_CUSTOM_FETCH)&&(a="/"),a){a.endsWith("/")||(a+="/");try{const w=await b(`${a}challenge`,{method:"POST",signal:(d=r(this,me))==null?void 0:d.signal});let v;try{v=await w.json()}catch{throw new Error("Failed to parse speculative challenge response")}if(v.error)throw new Error(v.error);if(!r(this,p))return;if(v._apiEndpoint=a,r(this,p).challengeResp=v,v.format===2&&Array.isArray(v.challenges))return r(this,p).state="idle",void r(this,p).notify();const{challenge:x,token:A}=v;let N=x;if(!Array.isArray(N)){let O=0;N=Array.from({length:x.c},()=>(O++,[P(`${A}${O}`,x.s),P(`${A}${O}d`,x.d)]))}r(this,p).challenges=N,r(this,p).state="solving",r(this,p).solvePromise=H(this,C,Fn).call(this,N)}catch{if(!r(this,p))return;r(this,p).state="error",r(this,p).notify()}}else r(this,p).state="idle"},Fn=async function(a){ne();let d=null;try{d=await T()}catch{}r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn()),r(this,ie).setWasm(d);const w=a.length,v=new Array(w);let x=1,A=!1;r(this,p).promoteFn=O=>{A||(A=!0,x=O,r(this,ie)._size=O,r(this,ie)._ensureSize(O))},r(this,p).pendingPromotion!==null&&(r(this,p).promoteFn(r(this,p).pendingPromotion),r(this,p).pendingPromotion=null);let N=0;for(;N<w;){const O=x,L=[],X=[];for(let U=0;U<O&&N<w;U++)X.push(N),L.push(a[N]),N++;r(this,ie)._ensureSize(Math.max(x,O));const te=await Promise.all(L.map(U=>r(this,ie).run(U[0],U[1]).then(K=>(r(this,p)&&r(this,p).completedCount++,K))));for(let U=0;U<X.length;U++)v[X[U]]=te[U];!A&&N<w&&await new Promise(U=>setTimeout(U,120))}return r(this,p)&&(r(this,p).results=v,r(this,p).state="redeeming",H(this,C,On).call(this,v)),v},On=async function(a){var d;try{if(!r(this,p))return;const w=r(this,p).challengeResp,v=w._apiEndpoint;if(!v)throw m("missing_endpoint","speculative redeem: missing apiEndpoint");let x=null;if(w.instrumentation){if(x=await j(w.instrumentation),!r(this,p))return;if(x!=null&&x.__timeout||x!=null&&x.__blocked)return r(this,p).state="done",void r(this,p).notify()}const A=await b(`${v}redeem`,{method:"POST",body:JSON.stringify({token:w.token,solutions:a,...x&&{instr:x}}),headers:{"Content-Type":"application/json"},signal:(d=r(this,me))==null?void 0:d.signal});let N;try{N=await A.json()}catch{throw new Error("Failed to parse speculative redeem response")}if(!r(this,p))return;if(!N.success)throw new Error(N.error||"Speculative redeem failed");r(this,p).token=N.token,r(this,p).tokenExpires=new Date(N.expires).getTime(),r(this,p).state="done",r(this,p)._invisibleElapsed=r(this,p)._t0?h(r(this,p)._t0):"?",r(this,p).notify()}catch{if(!r(this,p))return;r(this,p).state="done",r(this,p).notify()}},Et=function(){return this.getAttribute("data-cap-hidden-field-name")||"cap-token"},Je=function(a){const d=this.querySelector(`input[name='${r(this,C,Et)}']`);d&&(d.value=a)},Ct=function(){c.debug(u("solve"),`served from speculative cache (saved ${r(this,p)._invisibleElapsed||"?"})`),this.dispatchEvent("progress",{progress:100}),H(this,C,Je).call(this,r(this,p).token),this.dispatchEvent("solve",{token:r(this,p).token}),this.token=r(this,p).token;const a=r(this,p).tokenExpires-Date.now();return r(this,q)&&clearTimeout(r(this,q)),W(this,q,setTimeout(()=>this.reset(),a)),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),H(this,C,kt).call(this),H(this,C,vt).call(this),W(this,oe,!1),{success:!0,token:this.token}},Un=function(){W(this,he,(function(a){const d=a?[a]:navigator.languages||[navigator.language||""];for(let w of d){if(!w)continue;if(w=w.toLowerCase(),w==="en"||w.startsWith("en-"))return null;const v=y[w]?w:y[w.split("-")[0]]?w.split("-")[0]:null;if(!v)return null;const x=y[v].split("/"),A={};return g.forEach((N,O)=>{A[N]=x[O]}),A}return null})(window.CAP_LANG||this.getAttribute("data-cap-lang")))},Ye=function(){var a;(a=r(this,le))!=null&&a.setValidity&&(this.hasAttribute("required")&&!this.token?r(this,le).setValidity({valueMissing:!0},this.getI18nText("required-label","Please verify you're human"),r(this,E)||this):r(this,le).setValidity({}))},Be=new WeakMap,$n=function(){if(!r(this,z))return!1;const a=r(this,z).getBoundingClientRect();if(a.width===0&&a.height===0)return!0;const d=window.getComputedStyle(r(this,z));return d.display==="none"||d.visibility==="hidden"},Xe=function(){r(this,S)&&r(this,E)&&!H(this,C,$n).call(this)&&(r(this,S).isConnected&&r(this,S).parentNode===r(this,E)||r(this,E).appendChild(r(this,S)),r(this,S).textContent&&r(this,S).textContent.trim()||(r(this,S).textContent="Cap"),r(this,S).getAttribute("href")!=="https://trycap.dev"&&r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).style.cssText=["display: inline-flex !important","visibility: visible !important","opacity: 0.8 !important","pointer-events: all !important","font-size: 12px !important","transform: none !important","clip-path: none !important","filter: none !important","position: absolute !important"].join("; "))},ke($,"formAssociated",!0);class Y{constructor(_={},a){const d=a||document.createElement("cap-widget");if(Object.entries(_).forEach(([w,v])=>{d.setAttribute(w,v)}),!_.apiEndpoint&&!(window!=null&&window.CAP_CUSTOM_FETCH))throw d.remove(),new Error("Missing API endpoint. Either custom fetch or an API endpoint must be provided.");_.apiEndpoint&&d.setAttribute("data-cap-api-endpoint",_.apiEndpoint),a||d.hasAttribute("data-cap-disable-haptics")||d.setAttribute("data-cap-disable-haptics",""),this.widget=d,this.solve=this.widget.solve.bind(this.widget),this.reset=this.widget.reset.bind(this.widget),this.addEventListener=this.widget.addEventListener.bind(this.widget),Object.defineProperty(this,"token",{get:()=>d.token,configurable:!0,enumerable:!0}),a||(d.style.display="none",document.documentElement.appendChild(d))}}window.Cap=Y,customElements.get("cap-widget")||window!=null&&window.CAP_DONT_SKIP_REDEFINE?customElements.get("cap-widget")&&c.warn(u(),"cap-widget custom element already defined, skipping re-define. set window.CAP_DONT_SKIP_REDEFINE = true to override"):customElements.define("cap-widget",$),e.exports=Y,t.default=Y})()})(ze,ze.exports)),ze.exports}kr();function sn(e=Oe("/api/account/cap/")){return new Promise((t,s)=>{const i=document.createElement("div");i.className="cap-overlay";const o=document.createElement("div");o.className="cap-overlay-panel";const c=document.createElement("div");c.className="cap-overlay-title",c.textContent="Verify you're human";const u=document.createElement("cap-widget");u.setAttribute("data-cap-api-endpoint",e);const h=document.createElement("button");h.type="button",h.className="cap-overlay-cancel",h.textContent="Cancel";let m=!1;const b=()=>{m=!0,i.remove()},f=()=>{m||(b(),s(new Error("captcha-failed")))};u.addEventListener("solve",g=>{var P;const y=(P=g.detail)==null?void 0:P.token;b(),y?t(y):s(new Error("captcha-failed"))}),u.addEventListener("error",f),h.addEventListener("click",f),i.addEventListener("mousedown",g=>{g.target===i&&f()}),o.append(c,u,h),i.append(o),rr().append(i)})}const jr=2e3,Bn=l.createContext(null);function Er(){const[e,t]=l.useState({status:"loading"}),[s,i]=l.useState(null),[o,c]=l.useState(!1),[u,h]=l.useState(!1),[m,b]=l.useState(null),[f,g]=l.useState(!1),y=l.useMemo(()=>vr(),[]),P=l.useRef(null),k=l.useCallback(async()=>{try{const S=await y.billingStatus();b(S),h(S.active)}catch{b(null)}finally{g(!0)}},[y]),j=l.useCallback(async()=>{try{await y.putSync(yr())}catch{}},[y]),I=l.useCallback(async()=>{try{const{data:S}=await y.getSync();S?xr(S):await j()}catch{}},[y,j]),T=l.useCallback(async(S,M)=>{t({status:"signed-in",user:S}),h(M),await I()},[I]);l.useEffect(()=>{let S=!1;return y.me().then(async({user:M,active:z})=>{S||await T(M,z)}).catch(()=>{S||(t({status:"signed-out"}),g(!0))}),()=>{S=!0}},[y,T]),l.useEffect(()=>{if(e.status==="signed-in"){g(!1),k();return}b(null),h(!1)},[e.status,k]),l.useEffect(()=>()=>{P.current&&window.clearTimeout(P.current)},[]);const J=(S,M)=>S instanceof Error&&S.message==="captcha-failed"?"Captcha failed. Please try again.":S instanceof gt?S.message:M,ne=l.useCallback(async(S,M)=>{c(!0),i(null);try{const{user:z,active:oe}=await y.login(S,M,await sn(Oe("/api/account/cap/")));return await T(z,oe),{ok:!0}}catch(z){return z instanceof gt&&z.code==="needs_password"?{ok:!1,needsPassword:!0}:(i(J(z,"Couldn't sign in.")),{ok:!1})}finally{c(!1)}},[y,T]),B=l.useCallback(async(S,M)=>{c(!0),i(null);try{const z=await sn(Oe("/api/account/cap/"));return M==="reset"?await y.requestReset(S,z):await y.requestSetPassword(S,z),!0}catch(z){return i(J(z,"Couldn't send a code.")),!1}finally{c(!1)}},[y]),$=l.useCallback(async(S,M,z,oe)=>{c(!0),i(null);try{const{user:re,active:le}=oe==="reset"?await y.reset(S,M,z):await y.setPassword(S,M,z);return await T(re,le),!0}catch(re){return i(J(re,"Couldn't verify the code.")),!1}finally{c(!1)}},[y,T]),Y=l.useCallback(async()=>{try{await y.logout()}catch{}t({status:"signed-out"})},[y]),q=l.useCallback(()=>{e.status==="signed-in"&&(P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>void j(),jr))},[e.status,j]),ee=l.useCallback(async S=>{try{const{url:M}=await y.checkout(S,Kt());window.location.href=M}catch(M){i(J(M,"Couldn't start checkout."))}},[y]),F=l.useCallback(async()=>{try{const{url:S}=await y.billingPortal(Kt());window.location.href=S}catch(S){i(J(S,"Couldn't open billing."))}},[y]),E=l.useCallback(async S=>{try{const M=await y.verifyCheckout(S);if(M.active){h(!0),await k();try{const{user:z,active:oe}=await y.me();t({status:"signed-in",user:z}),h(oe)}catch{}}return M}catch{return null}},[y,k]),R=l.useCallback(async S=>{c(!0),i(null);try{const{user:M,active:z}=await y.setDiscord(S);return t({status:"signed-in",user:M}),h(z),!0}catch(M){return i(J(M,"Couldn't save Discord.")),!1}finally{c(!1)}},[y]);return{status:e.status,user:e.status==="signed-in"?e.user:null,busy:o,authError:s,clearError:()=>i(null),billing:m,isPlus:u,entitlementReady:f,signIn:ne,sendCode:B,submitCode:$,logout:Y,scheduleSync:q,checkout:ee,manageBilling:F,verifyReturn:E,refreshBilling:k,setDiscord:R}}function Cr({children:e}){const t=Er();return n.jsx(Bn.Provider,{value:t,children:e})}function qn(){const e=l.useContext(Bn);if(!e)throw new Error("useAccount requires AccountProvider");return e}const Ar=2500,Sr=200;function zn(e){const t=window;let s=!1,i=0,o=0,c=0,u=0;const h=()=>{s||e()},m=()=>{if(t.requestIdleCallback){c=t.requestIdleCallback(h,{timeout:Ar});return}u=window.setTimeout(h,Sr)},b=()=>{i=window.requestAnimationFrame(()=>{o=window.requestAnimationFrame(m)})};return document.readyState==="complete"?b():window.addEventListener("load",b,{once:!0}),()=>{s=!0,window.removeEventListener("load",b),window.cancelAnimationFrame(i),window.cancelAnimationFrame(o),c&&t.cancelIdleCallback&&t.cancelIdleCallback(c),window.clearTimeout(u)}}const _r="//rv.curbingspider.com/rS4UwuG85t7WA/147093",Nr="//hj.doebirddrowner.com/sUWrzqOhnYv92MH6/147094",ve=new Map;let Ne=!1,At=!1,St=!1,Ee=null;function Tr(e){return new URLSearchParams(e).has("skip")}function Wn(){St||(St=!0,window.location.reload())}function rn(e,t){if(ve.has(e))return;const s=document.createElement("script");ve.set(e,s),s.dataset.cfasync="false",s.src=t,s.dataset.ext=t,s.async=!0,s.type="text/javascript",s.addEventListener("load",()=>{if(ve.get(e)!==s){Wn();return}if(At=!0,!Ne||!De()){Hn();return}},{once:!0}),s.addEventListener("error",()=>{s.remove(),ve.get(e)===s&&ve.delete(e)},{once:!0}),(document.head??document.documentElement).appendChild(s)}function Hn(){Ee==null||Ee(),Ee=null,Ne=!1;for(const t of ve.values())t.remove();ve.clear();const e=At;At=!1,e&&Wn()}function De(){return window.location.hostname!=="localhost"}function Pr(){const e=window.location.hostname!=="lucideon.top";!De()||Ee||Ne&&ve.size===(e?2:1)||(Ne||(St=!1),Ne=!0,Ee=zn(()=>{Ee=null,Ne&&(rn("pop",new URL(_r,document.baseURI).href),e&&rn("social",new URL(Nr,document.baseURI).href))}))}function Lr(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)?e:"#ffffff";document.documentElement.style.setProperty("--accent",t)}const Ir=l.lazy(()=>Ae(()=>import("./DarkVeil-CC-BBhGo-8068ec8f.js"),__vite__mapDeps([4,2,5]),import.meta.url));function Rr(e){const[t,s]=l.useState(!1);return l.useEffect(()=>zn(()=>s(!0)),[]),t?n.jsx(l.Suspense,{fallback:null,children:n.jsx(Ir,{...e})}):null}const Mr=l.lazy(()=>Ae(()=>import("./AiPage-CbTtOj3W-8068ec8f.js"),__vite__mapDeps([6,2,7,8,9,3,10]),import.meta.url).then(e=>({default:e.AiPage}))),Dr=l.lazy(()=>Ae(()=>import("./GamesPage-D-HV0rpM-8068ec8f.js"),__vite__mapDeps([11,2,3,12]),import.meta.url).then(e=>({default:e.GamesPage}))),Fr=l.lazy(()=>Ae(()=>import("./SettingsPage-CsV-N8Y0-8068ec8f.js"),__vite__mapDeps([13,2,3,14]),import.meta.url).then(e=>({default:e.SettingsPage}))),Or=l.lazy(()=>Ae(()=>import("./AccountPage-DmlYaBSE-8068ec8f.js"),__vite__mapDeps([15,2,3,14,16]),import.meta.url).then(e=>({default:e.AccountPage}))),Ur=l.lazy(()=>Ae(()=>import("./PlusPage-DBE836ej-8068ec8f.js"),__vite__mapDeps([17,2,3,18,16,14]),import.meta.url).then(e=>({default:e.PlusPage})));function $r(){const{tabs:e,activeId:t,activeTab:s,open:i,openInternal:o,openUrl:c,close:u,activate:h,patch:m,reorder:b}=Hs(),{settings:f,update:g}=ur(),{controller:y}=hr(f.adblock),P=Vs(),k=Gs(),j=qn(),I=(s==null?void 0:s.url)??"",T=be(I),J=l.useRef(!1),[ne]=l.useState(()=>Tr(window.location.search)),[B,$]=l.useState(()=>tt("_gs5mofn.collapsed",!1)),Y=l.useRef(!1),[q,ee]=l.useState(!1),[F,E]=l.useState(!1),[R,S]=l.useState(()=>De()&&!ne&&ge("ads.notice")!=="seen"),[M,z]=l.useState(null),[oe,re]=l.useState(!1),le=l.useRef(!1),p=l.useRef(null);l.useEffect(()=>{!ne||!De()||we("ads.notice","seen")},[ne]),l.useEffect(()=>{j.isPlus&&(S(!1),z(null),re(!1))},[j.isPlus]),l.useEffect(()=>{j.status==="loading"||j.isPlus||R||M||le.current||(le.current=!0,re(!0))},[j.status,j.isPlus,R,M]),l.useEffect(()=>{if(!(j.status==="loading"||!j.entitlementReady)){if(j.isPlus||!De()){Hn(),J.current=!1;return}J.current||R||ge("ads.notice")==="seen"&&(J.current=!0,Pr())}},[j.status,j.entitlementReady,j.isPlus,R,T]),l.useEffect(()=>{pr(y,j.scheduleSync)},[y,j.scheduleSync]),l.useEffect(()=>{j.scheduleSync()},[P.bookmarks,f,k.id,j.scheduleSync]),l.useEffect(()=>Lr(f.accent),[f.accent]),or(f);const ue=l.useCallback(()=>{we("ads.notice","seen"),S(!1)},[]),ie=l.useCallback((D,ae)=>m(D,{url:ae}),[m]),de=l.useCallback((D,ae)=>m(D,{title:ae}),[m]),he=l.useCallback((D,ae)=>{var Wt;const $e=tn(ae,Zt(f.searchEngineId));$e&&(m(D,{url:$e,title:$e}),(Wt=p.current)==null||Wt.goTo(D,$e))},[m,f.searchEngineId]),me=()=>{ye("tabs"),ye("bookmarks"),ye("settings"),location.reload()},C=l.useCallback(D=>o(xs(D),ys[D]),[o]),st=!1,rt=!I,it=!!I&&!T,qt=rt?"":I;l.useEffect(()=>{},[C]),l.useEffect(()=>{},[T]);const zt=l.useRef(T);l.useEffect(()=>{!Y.current&&T==="ai"&&zt.current!==T&&$(!0),zt.current=T},[T]);const Vn=l.useCallback(()=>{Y.current=!0,$(D=>{const ae=!D;return nt("_gs5mofn.collapsed",ae),ae})},[]);return dr({onNewTab:i,onCloseTab:()=>u(t),onSpotlight:()=>E(D=>!D),onJumpToTab:D=>{const ae=D===9?e[e.length-1]:e[D-1];ae&&h(ae.id)}}),n.jsxs("div",{className:`_9gmixa5 ${it?"_z51tprw":""}`,children:[n.jsx("div",{className:f.backgroundMode==="mesh"?"_v4jfozk mesh":"_v4jfozk","aria-hidden":!0,children:(f.backgroundMode==="full"||f.backgroundMode==="reduced")&&!it&&n.jsx(Rr,{speed:f.backgroundMode==="reduced"?1.2:2.1,warpAmount:1.1,scanlineFrequency:.5,resolutionScale:f.backgroundMode==="reduced"?.45:1})}),n.jsx("div",{className:"_rx2al0e","aria-hidden":!0}),n.jsx(ks,{tabs:e,activeId:t,activeUrl:qt,bookmarks:P.bookmarks,disabled:st,collapsed:B,onSelect:h,onNew:i,onClose:u,onReorder:b,onNavigate:D=>he(t,D),onOpenBookmark:D=>he(t,D),onAddBookmark:()=>ee(!0),onRemoveBookmark:P.remove,onToggleCollapse:Vn,onOpenAi:()=>C("ai"),onOpenGames:()=>C("games"),onOpenSettings:()=>C("settings"),onOpenAccount:()=>C("account"),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()}}),n.jsxs("main",{className:"content",children:[(it||T)&&n.jsx(Cs,{url:qt,disabled:st,collapsed:B,internal:!!T,bookmarked:P.has(I),onNavigate:D=>he(t,D),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()},onToggleBookmark:()=>P.toggleForUrl(I,s==null?void 0:s.title)}),n.jsxs("div",{className:"_vcmyz3z",children:[n.jsx(Ms,{ref:p,controller:y,tabs:e,activeId:t,onUrl:ie,onTitle:de}),rt&&n.jsx(Ds,{disabled:st,onNavigate:D=>he(t,D)}),n.jsxs(l.Suspense,{fallback:null,children:[T==="ai"&&n.jsx(Mr,{account:j,onOpenAccount:()=>C("account")}),T==="games"&&n.jsx(Dr,{controller:y,onOpenUrl:D=>{const ae=tn(D,Zt(f.searchEngineId));ae&&c(ae,ae)}}),T==="settings"&&n.jsx(Fr,{settings:f,onUpdate:g,onClearData:me,showPlusCta:!j.isPlus&&j.status!=="loading",onUpgradePlus:()=>z("settings")}),T==="account"&&n.jsx(Or,{account:j}),T==="plus"&&n.jsx(Ur,{account:j,onOpenAccount:()=>C("account")})]})]})]}),n.jsx(Fs,{open:q,onClose:()=>ee(!1),onSubmit:P.add}),n.jsx(Os,{open:R&&!M,onAccept:ue,onUpgrade:()=>z("ads")}),n.jsx(Us,{open:oe&&!R&&!M&&!j.isPlus,onClose:()=>re(!1),onUpgrade:()=>{re(!1),z("settings")}}),n.jsx(Bs,{open:M!==null,onClose:()=>z(null),account:j,heading:M==="ads"?"Go ad-free with Lucide Plus":"Lucide Plus",blurb:M==="ads"?"Lucide Plus removes ads entirely, plus 3M tokens/day and exclusive links.":"Remove ads, unlock 3M tokens/day, and get exclusive links.",onSignUp:()=>{z(null),C("account")}}),n.jsx($s,{open:F,onClose:()=>E(!1),onSubmit:D=>he(t,D)}),rt&&n.jsx(As,{})]})}const Br={login:"Welcome back",setup:"Activate your account",reset:"Reset password"};function qr({account:e,brand:t,loginTagline:s,onSubscribe:i,claim:o}){const[c,u]=l.useState("login"),[h,m]=l.useState("form"),[b,f]=l.useState((o==null?void 0:o.email)??""),[g,y]=l.useState(""),[P,k]=l.useState(""),[j,I]=l.useState(null),[T,J]=l.useState(0);l.useEffect(()=>{o&&(f(o.email),o.needsPassword?(u("setup"),m("code"),I("Payment confirmed — enter the code we emailed to set your password."),e.sendCode(o.email,"set-password"),J(30)):(u("login"),I("Payment confirmed — sign in to continue.")))},[o]),l.useEffect(()=>{if(T<=0)return;const E=window.setTimeout(()=>J(R=>R-1),1e3);return()=>window.clearTimeout(E)},[T]);const ne=E=>{e.clearError(),u(E),m("form"),y(""),k(""),I(null),J(0)},B=e.busy,$=async()=>{(await e.signIn(b,g)).needsPassword&&(u("setup"),m("form"),I("Finish activating your account by setting a password."))},Y=async()=>{const E=c==="reset"?"reset":"set-password";await e.sendCode(b,E)&&(m("code"),I(null),J(30))},q=()=>e.submitCode(b,P,g,c==="reset"?"reset":"set-password"),ee=async()=>{await e.sendCode(b,c==="reset"?"reset":"set-password")&&(I("New code sent. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver."),J(30))},F=h==="code"?"Enter the 6-digit code we emailed you. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver.":c==="login"?s??"Sign in to continue.":c==="setup"?"Enter your email and choose a password to get started.":"Enter your email and a new password — we'll email you a code to confirm.";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"_xdv7bcm",children:[t,n.jsx("h1",{children:Br[c]}),n.jsx("p",{className:"account-auth-auth-sub",children:F})]}),n.jsxs("div",{className:"account-auth-auth-form",children:[j&&n.jsx("div",{className:"account-auth-auth-ok",children:j}),e.authError&&n.jsx("div",{className:"account-auth-error",children:e.authError}),c==="login"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"Password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"current-password",disabled:B,onKeyDown:E=>E.key==="Enter"&&void $()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void $(),children:B?"Please wait…":"Sign in"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("reset"),children:"Forgot password?"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("setup"),children:"First time? Activate"})]}),i&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"account-auth-btn account-auth-auth-primary",disabled:B,onClick:()=>i(b),children:"Subscribe to Lucide Plus"}),n.jsx(Tn,{})]})]}),c!=="login"&&h==="form"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),c==="reset"&&n.jsxs("label",{children:[n.jsx("span",{children:"New password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),c==="setup"&&n.jsxs("label",{children:[n.jsx("span",{children:"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void Y(),children:B?"Please wait…":"Send code"}),n.jsx("div",{className:"account-auth-auth-alt",children:n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})})]}),c!=="login"&&h==="code"&&n.jsxs(n.Fragment,{children:[g.length===0&&n.jsxs("label",{children:[n.jsx("span",{children:c==="reset"?"New password":"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"6-digit code"}),n.jsx("input",{inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",maxLength:6,value:P,onChange:E=>k(E.target.value.replace(/\D/g,"").slice(0,6)),disabled:B,autoFocus:!0,onKeyDown:E=>E.key==="Enter"&&void q()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||P.length!==6||g.length<8,onClick:()=>void q(),children:B?"Please wait…":c==="reset"?"Reset password":"Activate account"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B||T>0,onClick:()=>void ee(),children:T>0?`Resend in ${T}s`:"Resend code"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})]})]})]})]})}function zr(){const e=qn(),[t,s]=l.useState("idle"),[i,o]=l.useState(null),[c,u]=l.useState(!1),h=l.useRef(e.verifyReturn);h.current=e.verifyReturn;const m=l.useRef(!1);if(l.useEffect(()=>{if(m.current)return;m.current=!0;const f=new URLSearchParams(window.location.search),g=f.get("checkout");if(g!=="success"&&g!=="cancel"||(Qn(window.location.pathname),g!=="success"))return;const y=f.get("session_id");y&&(s("checking"),h.current(y).then(P=>{P!=null&&P.email?(o({email:P.email,needsPassword:P.needsPassword}),u(!0)):s("error")}))},[]),l.useEffect(()=>{!c||t!=="checking"||e.status==="loading"||s(e.status==="signed-in"?"done":"claim")},[c,t,e.status]),l.useEffect(()=>{t==="claim"&&e.status==="signed-in"&&s("done")},[t,e.status]),t==="idle")return null;const b=()=>s("idle");return n.jsx("div",{className:"_t97drno",onClick:t==="checking"?void 0:b,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[t==="checking"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"Lucide+"}),n.jsx("p",{style:{margin:0,fontSize:13,color:"var(--muted)"},children:"Confirming your subscription…"})]}),t==="claim"&&i&&n.jsx(qr,{account:e,claim:i,brand:n.jsx("div",{className:"modal-title",children:"Lucide+"})}),t==="done"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"You're on Plus"}),n.jsxs("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:[i!=null&&i.email?`${i.email} is subscribed.`:"Your subscription is active."," Your Plus perks are unlocked."]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:b,children:"Continue"})})]}),t==="error"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"Couldn't confirm payment"}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:"We couldn't confirm your checkout. If you were charged, reach out on Discord and we'll sort it out."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:b,children:"Close"})})]})]})})}class Wr extends l.Component{constructor(){super(...arguments);ke(this,"state",{error:null,info:null});ke(this,"reset",()=>this.setState({error:null,info:null}))}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,i){this.setState({info:i})}render(){const{error:s,info:i}=this.state;if(!s)return this.props.children;const o=!1;return n.jsx("div",{className:"fixed inset-0 flex items-center justify-center overflow-auto bg-bg p-8 text-text",children:n.jsxs("div",{className:"w-[min(560px,100%)] rounded-[var(--radius)] border border-border bg-surface p-6 backdrop-blur-xl",children:[n.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color-mix(in_srgb,#ff6b6b_45%,var(--border-2))] bg-[color-mix(in_srgb,#ff6b6b_18%,transparent)] text-lg font-bold text-[#ff8f8f]",children:"!"}),n.jsx("h1",{className:"mt-3.5 mb-1 text-[22px] tracking-tight",children:"Something broke"}),n.jsx("p",{className:"m-0 text-sm leading-normal text-muted",children:"An unexpected error crashed this view. You can try again, or reload Lucide."}),n.jsxs("div",{className:"mt-[1.1rem] flex gap-2",children:[n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-transparent bg-text px-4 text-[13px] font-semibold text-bg hover:brightness-95",onClick:this.reset,children:"Try again"}),n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-border bg-surface-2 px-4 text-[13px] font-semibold text-text hover:brightness-95",onClick:()=>window.location.reload(),children:"Reload Lucide"})]}),n.jsxs("details",{className:"mt-5",open:o,children:[n.jsxs("summary",{className:"cursor-pointer break-words text-[13px] font-semibold text-[#ff8f8f]",children:[s.name,": ",s.message]}),o]})]})})}}function Hr(){return n.jsx(Wr,{children:n.jsx(Cr,{children:n.jsxs(n.Fragment,{children:[n.jsx($r,{}),n.jsx(zr,{})]})})})}function Vr(){return n.jsx("div",{className:"_t97drno backend-unavailable-backdrop",children:n.jsxs("section",{className:"modal backend-unavailable-modal",role:"alertdialog","aria-labelledby":"backend-unavailable-title",children:[n.jsx("div",{className:"modal-title",id:"backend-unavailable-title",children:"No available backend"}),n.jsx("p",{className:"backend-unavailable-body",children:"Lucide couldn’t reach any of its available links. They may be blocked by your network or temporarily offline."}),n.jsx("p",{className:"backend-unavailable-help",children:"Try again in a moment. If this keeps happening, switch networks or ask for a new link."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:()=>window.location.reload(),children:"Try again"})})]})})}const Kr=["assets.fern.best","checkout.jbquarterhorseranch.com","books.llteamstore.com"];let We=null;const Gr=new Set;function on(){for(const e of Gr)e()}async function Jr(e){try{const t=await fetch(`https://${e}/`,{method:"GET",redirect:"manual",cache:"no-store",mode:"cors"});return t.type==="opaqueredirect"||t.status===303}catch{return!1}}function Yr(){return We||(We=(async()=>{for(const e of Kr)if(await Jr(e))return on(),e;return on(),null})(),We)}Ut(Ot());Yr();En().then(e=>{const t=document.getElementById("root");let s=t;try{s=t.attachShadow({mode:"closed"})}catch{}if(nr(s),s instanceof ShadowRoot){const i=new Set,o=()=>{for(const c of document.querySelectorAll('link[rel="stylesheet"], style'))i.has(c)||(i.add(c),s.append(c.cloneNode(!0)))};o(),new MutationObserver(o).observe(document.head,{childList:!0})}Jn.createRoot(s).render(n.jsxs(l.StrictMode,{children:[n.jsx(Hr,{}),e===null&&n.jsx(Vr,{})]}))});export{qr as $,pi as A,ps as B,xn as C,pt as D,ai as E,mi as F,ii as G,bi as H,ri as I,fs as J,gi as K,ui as L,ti as M,fi as N,bt as O,dt as P,Xt as Q,It as R,hi as S,li as T,Bs as U,os as V,Ze as W,yi as X,xi as Y,tr as Z,vi as _,ye as a,Tn as a0,wi as a1,Bt as a2,ei as a3,_t as a4,Oe as b,ms as c,ci as d,Pt as e,Lt as f,gn as g,si as h,ni as i,Rt as j,Me as k,oi as l,di as m,sr as n,rr as o,wn as p,ge as q,tt as r,En as s,Ts as t,Is as u,Ps as v,we as w,_n as x,as as y,nt as z};
2
+ var Kn=Object.defineProperty;var Ht=e=>{throw TypeError(e)};var Gn=(e,t,s)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ke=(e,t,s)=>Gn(e,typeof t!="symbol"?t+"":t,s),ot=(e,t,s)=>t.has(e)||Ht("Cannot "+s);var r=(e,t,s)=>(ot(e,t,"read from private field"),s?s.call(e):t.get(e)),se=(e,t,s)=>t.has(e)?Ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),W=(e,t,s,i)=>(ot(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),H=(e,t,s)=>(ot(e,t,"access private method"),s);import{j as n,r as l,c as Jn}from"./react-BNEptbwn-8068ec8f.js";import{A as Ue,m as Te,R as Yn,a as Xn}from"./motion-B1hdS1Lc-8068ec8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function s(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();const Vt=(()=>{const e=window;if(e.__lcHs)return e.__lcHs;const t={ps:History.prototype.pushState,rs:History.prototype.replaceState};return e.__lcHs=t,t})();function an(){const e=history;try{Object.defineProperty(e,"pushState",{value:Vt.ps.bind(e),configurable:!0,writable:!0}),Object.defineProperty(e,"replaceState",{value:Vt.rs.bind(e),configurable:!0,writable:!0})}catch{}}function Qn(e,t=null){history.replaceState(t,"",e)}an();const _t=typeof document<"u"?document.baseURI:"/";function Ze(e="",t=_t){const s=e.trim();return s?/^(https?:|data:|blob:)/i.test(s)?s:s.startsWith("#")?new URL(s,t).href:new URL(s.replace(/^\/+/,""),t).href:new URL(".",t).href}function ei(e="",t=_t){return new URL(Ze(e,t)).pathname}function Kt(){return new URL(".",_t).href}const Zn="modulepreload",es=function(e,t){return new URL(e,t).href},Gt={},Ae=function(t,s,i){let o=Promise.resolve();if(s&&s.length>0){let u=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const h=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),b=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=u(s.map(f=>{if(f=es(f,i),f in Gt)return;Gt[f]=!0;const g=f.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!i)for(let j=h.length-1;j>=0;j--){const I=h[j];if(I.href===f&&(!g||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=g?"stylesheet":Zn,g||(k.as="script"),k.crossOrigin="",k.href=f,b&&k.setAttribute("nonce",b),document.head.appendChild(k),g)return new Promise((j,I)=>{k.addEventListener("load",j),k.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return o.then(u=>{for(const h of u||[])h.status==="rejected"&&c(h.reason);return t().catch(c)})},cn="z9k2r",ut=["settings","tabs","theme","bookmarks","ai.model","ai.threads","_gs5mofn.collapsed","api.base","api.pinned","api.custom","ads.notice","games.saved.v2"],Nt="8068ec8f48688e3d";function ln(e){let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function un(e,t){return ln(e?`${e} ${t}`:t)}function et(e){return un(Nt,e)}function Qe(e){try{return localStorage.getItem(e)}catch{return null}}function Tt(e,t){try{localStorage.setItem(e,t)}catch{}}function dn(e){try{localStorage.removeItem(e)}catch{}}function ts(){const e=Qe(cn);if(e===null)return null;try{const t=JSON.parse(e);if(typeof(t==null?void 0:t.salt)=="string"&&Array.isArray(t.names))return t}catch{}return null}let Ce;function hn(){Tt(cn,JSON.stringify({salt:Nt,names:[...Ce]}))}function ns(){const e=ts(),t=e?e.salt:null;if(Ce=new Set([...ut,...(e==null?void 0:e.names)??[]]),t!==Nt)for(const s of Ce){const i=t===null?ln(s):un(t,s),o=et(s);if(i===o)continue;const c=Qe(i);c!==null&&(Qe(o)===null&&Tt(o,c),dn(i))}hn()}function ss(e){Ce.has(e)||(Ce.add(e),hn())}if(typeof window<"u")try{ns()}catch{Ce=new Set(ut)}else Ce=new Set(ut);function ge(e){return Qe(et(e))}function we(e,t){ss(e),Tt(et(e),t)}function ye(e){dn(et(e))}function tt(e,t){const s=ge(e);if(s===null)return t;try{return JSON.parse(s)}catch{return t}}function nt(e,t){we(e,JSON.stringify(t))}const pn={id:"tiktok",url:"https://www.tiktok.com/",label:"TikTok"},fn={id:"discord",url:"https://discord.com/_9gmixa5",label:"Discord"},rs=[pn,fn];function mn(){const e=tt("bookmarks",null);return Array.isArray(e)?e.filter(t=>typeof(t==null?void 0:t.url)=="string"&&typeof(t==null?void 0:t.id)=="string").map(t=>t.id==="instagram"?pn:t.id==="spotify"?fn:t):rs}function bn(e){nt("bookmarks",e)}function Jt(e,t){return{id:`bm-${Date.now().toString(36)}-${Math.floor(Math.random()*1e4).toString(36)}`,url:e,label:t}}function _e(e){try{return new URL(e).hostname}catch{return null}}function is(e){const t=_e(e);return t?[`https://icons.duckduckgo.com/ip3/${t}.ico`,`https://www.google.com/s2/favicons?domain=${t}&sz=64`]:[]}const Z=e=>({width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0});function ti({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),n.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),n.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function Pt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Lt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function It({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function Me({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"11",cy:"11",r:"7"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function dt({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 5v14M5 12h14"})})}function gn({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}function wn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),n.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"20"})]})}function os({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round","aria-hidden":!0,children:[n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("line",{x1:"6.3",y1:"6.3",x2:"17.7",y2:"17.7"}),n.jsx("line",{x1:"17.7",y1:"6.3",x2:"6.3",y2:"17.7"})]})}function vn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.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 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-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 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.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 1 1 2.83 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"})]})}function Rt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7z"}),n.jsx("path",{d:"M18.5 14l.9 2.1 2.1.9-2.1.9-.9 2.1-.9-2.1-2.1-.9 2.1-.9z"})]})}function Mt({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("line",{x1:"6",y1:"11",x2:"10",y2:"11"}),n.jsx("line",{x1:"8",y1:"9",x2:"8",y2:"13"}),n.jsx("line",{x1:"15",y1:"12",x2:"15.01",y2:"12"}),n.jsx("line",{x1:"18",y1:"10",x2:"18.01",y2:"10"}),n.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"})]})}function ni({size:e=16}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function si({size:e=16}){return n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":!0,children:n.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2",fill:"currentColor"})})}function ri({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),n.jsx("circle",{cx:"9",cy:"9",r:"2"}),n.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function ii({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"12",r:"9"}),n.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),n.jsx("ellipse",{cx:"12",cy:"12",rx:"4",ry:"9"})]})}function oi({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})}function ai({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M12 20h9"}),n.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]})}function ci({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),n.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function li({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"})})}function as({size:e=14,filled:t=!1}){return n.jsx("svg",{...Z(e),fill:t?"currentColor":"none",children:n.jsx("polygon",{points:"12 2 15 9 22 9.5 17 14.5 18.5 22 12 18 5.5 22 7 14.5 2 9.5 9 9 12 2"})})}function ui({size:e=14}){return n.jsxs("svg",{...Z(e),children:[n.jsx("rect",{x:"5",y:"11",width:"14",height:"9",rx:"2"}),n.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function di({size:e=14}){return n.jsx("svg",{...Z(e),children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}function yn({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("circle",{cx:"12",cy:"8",r:"4"}),n.jsx("path",{d:"M5 20a7 7 0 0 1 14 0"})]})}function hi({size:e=16}){return n.jsxs("svg",{...Z(e),children:[n.jsx("path",{d:"M16 3h5v5"}),n.jsx("path",{d:"M4 20 21 3"}),n.jsx("path",{d:"M21 16v5h-5"}),n.jsx("path",{d:"M15 15l6 6"}),n.jsx("path",{d:"M4 4l5 5"})]})}var cs=["https://themannastore.com","https://21baseballacademy.com","https://theavancehotel.com","https://diamondstudsbaseball.com","https://broughton-hotel.com"];const Re=cs;let fe="https://theavancehotel.com";const xn="include",ls="pool-ok";function us(e){return typeof window>"u"||typeof document>"u"?Promise.resolve(!1):new Promise(t=>{const s=document.createElement("iframe"),i=crypto.randomUUID(),o=new URL(e).origin;let c=0,u=!1;const h=b=>{u||(u=!0,window.clearTimeout(c),window.removeEventListener("message",m),s.remove(),t(b))},m=b=>{if(b.source!==s.contentWindow||b.origin!==o||typeof b.data!="object"||b.data===null)return;const f=b.data;f.type===ls&&f.nonce===i&&h(!0)};s.hidden=!0,s.tabIndex=-1,s.setAttribute("aria-hidden","true"),s.setAttribute("sandbox","allow-scripts allow-same-origin"),s.onerror=()=>h(!1),s.src=new URL(`/api/probe?nonce=${encodeURIComponent(i)}`,e).href,window.addEventListener("message",m),c=window.setTimeout(()=>h(!1),2500),document.body.appendChild(s)})}async function kn(e){try{const t=await fetch(`${e}/api/ping`,{cache:"no-store",mode:"cors",signal:AbortSignal.timeout(4e3)});if(!t.ok)return!1;const s=await t.json();return typeof s!="object"||s===null||s.ok!==!0?!1:await us(e)}catch{return!1}}let Fe=null,ht=0;function ds(e){return e.length===0?Promise.resolve(null):new Promise(t=>{let s=e.length,i=!1;for(const o of e)kn(o).then(c=>{if(!i){if(c){i=!0,t(o);return}s-=1,s===0&&t(null)}})})}function hs(e){if(typeof window>"u")return;window.clearTimeout(ht);const t=window.setTimeout(()=>{pt()||fe!==e||kn(e).then(s=>{s||pt()||(Fe=null,ye("api.base"),En())})},45e3);ht=t,typeof t=="object"&&t&&"unref"in t&&t.unref()}function pi(){return[...Re]}function ps(){try{const e=JSON.parse(ge("api.custom")||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function fi(){return fe||(typeof location<"u"&&location.origin?location.origin:"")}function mi(e){try{return new URL(e).host}catch{return e.replace(/^https?:\/\//i,"")}}function jn(e){const t=e.trim();if(!t)return null;try{const s=/^https?:\/\//i.test(t)?t:`https://${t}`,i=new URL(s);return i.protocol!=="http:"&&i.protocol!=="https:"?null:i.origin}catch{return null}}function pt(){return ge("api.pinned")==="1"}function fs(e){const t=jn(e);return t?(fe=t,Fe=Promise.resolve(t),we("api.base",t),we("api.pinned","1"),!0):!1}function bi(){ye("api.pinned"),ye("api.base"),Fe=null,typeof window<"u"&&window.clearTimeout(ht),fe="https://theavancehotel.com"}function gi(e){const t=jn(e);if(!t)return null;const s=ps();return s.includes(t)||we("api.custom",JSON.stringify([...s,t])),fs(t),t}function En(){if(pt()){const e=ge("api.base");if(e)return fe=e,Promise.resolve(e)}return Re.length===0?Promise.resolve(fe):(Fe??(Fe=(async()=>{const e=ge("api.base"),t=Re.filter(o=>o!==e),s=e&&Re.includes(e)?[e,...t]:[...Re],i=await ds(s);return i?(fe=i,we("api.base",i),hs(i),i):(ye("api.base"),null)})()),Fe)}function Oe(e){return fe+e}function wi(e){return fe?fe.replace(/^http/,"ws")+e:`${location.protocol==="https:"?"wss":"ws"}://${location.host}${e}`}function ms(e){const t=ge(`token.${e}`);return t?{authorization:`Bearer ${t}`}:{}}function at(e,t){if(!t||typeof t!="object")return;const s=t.token;typeof s=="string"&&s&&we(`token.${e}`,s)}function bs(e){ye(`token.${e}`)}async function gs(e){try{const t=await fetch(Oe(`/api/ac?q=${encodeURIComponent(e)}`),{credentials:xn});if(!t.ok)return[];const s=await t.json();return Array.isArray(s)?s.filter(i=>typeof i=="string").slice(0,8):[]}catch{return[]}}function Cn(e){const[t,s]=l.useState([]);return l.useEffect(()=>{const i=e.trim();if(i.length<2){s([]);return}let o=!0;return gs(i).then(c=>{o&&s(c)}),()=>{o=!1}},[e]),t}function ct(e){if(!e)return"";try{const t=new URL(e),s=t.pathname==="/"?"":t.pathname;return t.hostname+s+t.search}catch{return e}}function Dt({url:e,variant:t,disabled:s,bookmarked:i,autoFocus:o,onNavigate:c,onToggleBookmark:u}){const[h,m]=l.useState(ct(e)),[b,f]=l.useState(!1),[g,y]=l.useState(-1),P=l.useRef(null),k=l.useRef(null),j=Cn(b?h:"");l.useEffect(()=>{b||m(ct(e))},[e,b]),l.useEffect(()=>{y(-1)},[j]);const I=()=>g>=0&&j[g]?j[g]:h,T=$=>{var q;const Y=$.trim();Y&&(c(Y),(q=P.current)==null||q.blur())},J=$=>{var Y;$.key==="Escape"?(m(ct(e)),(Y=P.current)==null||Y.blur()):$.key==="Enter"?($.preventDefault(),T(I())):$.key==="ArrowDown"?($.preventDefault(),y(q=>Math.min(j.length-1,q+1))):$.key==="ArrowUp"&&($.preventDefault(),y(q=>Math.max(-1,q-1)))},ne=n.jsx("input",{ref:P,value:h,disabled:s,autoFocus:o,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:$=>m($.target.value),onKeyDown:J,onFocus:$=>{k.current&&window.clearTimeout(k.current),f(!0),m(e||h),requestAnimationFrame(()=>$.target.select())},onBlur:()=>{k.current=window.setTimeout(()=>f(!1),120)}}),B=b&&j.length>0&&n.jsx("ul",{className:"omnibox-suggestions",children:j.map(($,Y)=>n.jsxs("li",{className:`omnibox-suggestion ${Y===g?"selected":""}`,onMouseEnter:()=>y(Y),onMouseDown:q=>q.preventDefault(),onClick:()=>T($),children:[n.jsx(Me,{size:13}),n.jsx("span",{children:$})]},`${$}-${Y}`))});return t==="_2ta3awx"?n.jsxs("div",{className:"newtab-search-wrap",children:[n.jsxs("form",{className:`_25dnvc2 ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:18}),ne]}),B]}):t==="_gs5mofn"?n.jsxs("div",{className:"sidebar-omnibox-wrap",children:[n.jsxs("form",{className:`sidebar-omnibox ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[n.jsx(Me,{size:13}),ne]}),B]}):n.jsxs("div",{className:"omnibox-wrap",children:[n.jsxs("form",{className:`_w5gq50s ${b?"focused":""}`,onSubmit:$=>{$.preventDefault(),T(I())},children:[ne,e&&u&&n.jsx("button",{type:"button",className:`omnibox-star ${i?"filled":""}`,"aria-label":i?"Remove bookmark":"Add bookmark",onMouseDown:$=>$.preventDefault(),onClick:u,children:n.jsx(as,{size:14,filled:i})})]}),B]})}function An({url:e,size:t=24,fallback:s}){const i=is(e),[o,c]=l.useState(0);return l.useEffect(()=>{c(0)},[e]),!e||o>=i.length?s?n.jsx("span",{className:"favicon-fallback",style:{width:t,height:t},children:s}):n.jsx("img",{src:Ze("favicon.svg"),alt:"",width:t,height:t}):n.jsx("img",{src:i[o],alt:"",width:t,height:t,onError:()=>c(u=>u+1)})}const ws={"/a":"ai","/g":"games","/s":"settings","/u":"account","/p":"plus"},vs={ai:"/a",games:"/g",settings:"/s",account:"/u",plus:"/p"},ys={ai:"Lucidity AI",games:"Education",settings:"Settings",account:"Account",plus:"IGNITE OS Plus"};function be(e){return ws[e]??null}function xs(e){return vs[e]}function Sn(e,t){const s=be(e);return s==="ai"?n.jsx(Rt,{size:t}):s==="games"?n.jsx(Mt,{size:t}):e?n.jsx(An,{url:e,size:t+1}):n.jsx(os,{size:t})}function ks(e){return n.jsx("aside",{className:`_gs5mofn ${e.collapsed?"_hmrd7qx":""}`,children:e.collapsed?n.jsx(Es,{...e}):n.jsx(js,{...e})})}function js({tabs:e,activeId:t,activeUrl:s,bookmarks:i,disabled:o,onSelect:c,onNew:u,onClose:h,onReorder:m,onNavigate:b,onOpenBookmark:f,onAddBookmark:g,onRemoveBookmark:y,onToggleCollapse:P,onOpenAi:k,onOpenGames:j,onOpenSettings:I,onOpenAccount:T,onBack:J,onForward:ne,onReload:B}){const $=!!s,Y=be(s),q=e.filter(F=>!be(F.url)),ee=e.filter(F=>be(F.url));return n.jsxs("div",{className:"_shpbk0d",children:[n.jsxs("div",{className:"sidebar-header",children:[n.jsxs("div",{className:"header-left",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:o||!$,onClick:J,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:o||!$,onClick:ne,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:o||!$,onClick:B,children:n.jsx(It,{})})]}),n.jsx("div",{className:"header-right",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Collapse _gs5mofn",onClick:P,children:n.jsx(wn,{})})})]}),n.jsx(Dt,{url:s,variant:"_gs5mofn",disabled:o,onNavigate:b}),n.jsxs("div",{className:"bookmarks-grid",children:[i.map(F=>n.jsx("button",{className:"bookmark-tile",type:"button",title:F.label??_e(F.url)??F.url,onClick:()=>f(F.url),onContextMenu:E=>{E.preventDefault(),y(F.id)},children:n.jsx(An,{url:F.url,size:22,fallback:(F.label??_e(F.url)??"?").slice(0,1).toUpperCase()})},F.id)),n.jsx("button",{className:"bookmark-tile bookmark-add",type:"button","aria-label":"Add bookmark",onClick:g,children:n.jsx(dt,{size:16})})]}),n.jsxs("button",{className:"new-tab",type:"button",onClick:u,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(dt,{size:15})}),n.jsx("span",{children:"New tab"})]}),n.jsx(Yn,{as:"ul",axis:"y",values:q,onReorder:F=>m([...F,...ee]),className:"tab-list",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:q.map(F=>n.jsxs(Xn,{value:F,as:"li",className:`tab-item ${F.id===t?"active":""}`,onClick:()=>c(F.id),title:F.title||_e(F.url)||"New tab",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:.9,transition:{duration:.55,ease:[.16,1,.3,1]}},transition:{type:"spring",stiffness:700,damping:38,mass:.6},dragTransition:{bounceStiffness:700,bounceDamping:38},whileDrag:{scale:1.03},children:[n.jsx("span",{className:"_5t7l5je",children:Sn(F.url,15)}),n.jsx("span",{className:"tab-title",children:F.title||_e(F.url)||"New tab"}),q.length>1&&n.jsx("button",{className:"tab-close",type:"button","aria-label":"Close tab",onPointerDown:E=>E.stopPropagation(),onClick:E=>{E.stopPropagation(),h(F.id)},children:n.jsx(gn,{size:13})})]},F.id))})}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="ai"?"active":""}`,type:"button",onClick:k,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Rt,{size:15})}),n.jsx("span",{children:"AI"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="games"?"active":""}`,type:"button",onClick:j,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(Mt,{size:15})}),n.jsx("span",{children:"Education"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="account"?"active":""}`,type:"button",onClick:T,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(yn,{size:15})}),n.jsx("span",{children:"Account"})]}),n.jsxs("button",{className:`_u1z2hr2 ${Y==="settings"?"active":""}`,type:"button",onClick:I,children:[n.jsx("span",{className:"_5t7l5je",children:n.jsx(vn,{size:15})}),n.jsx("span",{children:"Settings"})]})]})}function Es({tabs:e,activeId:t,activeUrl:s,disabled:i,onSelect:o,onNew:c,onToggleCollapse:u,onOpenAi:h,onOpenGames:m,onOpenSettings:b,onOpenAccount:f,onBack:g,onForward:y,onReload:P}){const k=!!s,j=be(s),I=e.filter(T=>!be(T.url));return n.jsxs("div",{className:"_shpbk0d _hmrd7qx",children:[n.jsx("div",{className:"_8i3hapm",children:n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Expand _gs5mofn",title:"Expand _gs5mofn",onClick:u,children:n.jsx(wn,{})})}),n.jsxs("div",{className:"_9a6ojvc",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",title:"Back",disabled:i||!k,onClick:g,children:n.jsx(Pt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",title:"Forward",disabled:i||!k,onClick:y,children:n.jsx(Lt,{size:15})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",title:"Reload",disabled:i||!k,onClick:P,children:n.jsx(It,{size:15})})]}),n.jsx("button",{className:"_54mv697 compact-add",type:"button","aria-label":"New tab",title:"New tab",onClick:c,children:n.jsx(dt,{size:16})}),n.jsx("ul",{className:"_cnmfi4r",children:n.jsx(Ue,{mode:"popLayout",initial:!1,children:I.map(T=>n.jsx(Te.li,{layout:!0,className:`_54mv697 ${T.id===t?"active":""}`,onClick:()=>o(T.id),title:T.title||_e(T.url)||"New tab",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8,transition:{duration:.5,ease:[.16,1,.3,1]}},transition:{duration:.18,ease:[.16,1,.3,1]},whileTap:{scale:.92},children:Sn(T.url,17)},T.id))})}),n.jsxs("div",{className:"_c2b13pw",children:[n.jsx("button",{className:`_1lqv40d ${j==="ai"?"active":""}`,type:"button","aria-label":"AI",title:"AI",onClick:h,children:n.jsx(Rt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="games"?"active":""}`,type:"button","aria-label":"Education",title:"Education",onClick:m,children:n.jsx(Mt,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="account"?"active":""}`,type:"button","aria-label":"Account",title:"Account",onClick:f,children:n.jsx(yn,{size:14})}),n.jsx("button",{className:`_1lqv40d ${j==="settings"?"active":""}`,type:"button","aria-label":"Settings",title:"Settings",onClick:b,children:n.jsx(vn,{size:14})})]})]})}function Cs({url:e,disabled:t,collapsed:s,internal:i,bookmarked:o,onNavigate:c,onBack:u,onForward:h,onReload:m,onToggleBookmark:b}){return n.jsxs("div",{className:"_ynqudi4",children:[s&&!i&&n.jsxs("div",{className:"nav-group",children:[n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Back",disabled:t||!e,onClick:u,children:n.jsx(Pt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Forward",disabled:t||!e,onClick:h,children:n.jsx(Lt,{})}),n.jsx("button",{className:"_1lqv40d",type:"button","aria-label":"Reload",disabled:t||!e,onClick:m,children:n.jsx(It,{})})]}),n.jsx(Dt,{url:e,variant:"_ynqudi4",disabled:t,bookmarked:i?!1:o,onNavigate:c,onToggleBookmark:i?void 0:b})]})}function As(){return n.jsxs("div",{className:"app-footer",children:[n.jsxs("a",{className:"discord-link",href:"https://discord.gg/chromebook",target:"_blank",rel:"noopener noreferrer","aria-label":"Join our Discord server (opens in a new tab)",children:[n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{d:"M20.32 4.37a19.79 19.79 0 0 0-4.89-1.52c-.21.38-.45.89-.62 1.3a18.43 18.43 0 0 0-5.62 0c-.17-.41-.42-.92-.63-1.3a19.74 19.74 0 0 0-4.89 1.53C.58 8.97-.26 13.45.16 17.87a19.9 19.9 0 0 0 6 3.03c.49-.66.92-1.36 1.29-2.1-.71-.26-1.38-.59-2.02-.98.17-.12.34-.25.5-.38 3.88 1.81 8.08 1.81 11.92 0 .16.13.33.26.5.38-.64.39-1.32.72-2.02.99.37.73.8 1.43 1.29 2.09a19.82 19.82 0 0 0 6-3.03c.5-5.13-.85-9.57-3.3-13.5ZM8.02 15.15c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Zm7.96 0c-1.17 0-2.13-1.07-2.13-2.39s.94-2.39 2.13-2.39c1.19 0 2.15 1.08 2.13 2.39 0 1.32-.94 2.39-2.13 2.39Z"})}),"Join Discord"]}),n.jsx("span",{className:"build-id",title:"a0658664f8adc57eb7e44cf1829ae71127c42057",children:"a0658664f8adc57eb7e44cf1829ae71127c42057".slice(0,7)})]})}const Ft=["accelerometer","autoplay","clipboard-read","clipboard-write","encrypted-media","fullscreen","gamepad","gyroscope","keyboard-lock","keyboard-map","pointer-lock","screen-wake-lock","xr-spatial-tracking"],Ss=Ft,_n=Ft.map(e=>`${e} *`).join("; ");Ft.map(e=>`${e}=*`).join(", ");function _s(e){return e.split(/[\s=]/)[0]??""}function Nn(e){const t=(e.getAttribute("allow")??"").split(";").map(o=>o.trim()).filter(Boolean),s=new Set(t.map(_s).filter(Boolean));for(const o of Ss)s.has(o)||t.push(`${o} *`);const i=t.join("; ");e.getAttribute("allow")!==i&&e.setAttribute("allow",i),e.allowFullscreen=!0}function Ns(e){const t=e.getElementsByTagName("iframe"),s=()=>{for(let o=0;o<t.length;o+=1)Nn(t[o])};s();const i=new MutationObserver(s);return i.observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["allow"]}),i}function Ts(){return{frames:new Map,titleObservers:new Map,allowObservers:new Map,retryTimers:new Map}}function Ps(e,t){var o,c;const s=e.retryTimers.get(t);s&&clearTimeout(s),e.retryTimers.delete(t),(o=e.titleObservers.get(t))==null||o.disconnect(),e.titleObservers.delete(t),(c=e.allowObservers.get(t))==null||c.disconnect(),e.allowObservers.delete(t);const i=e.frames.get(t);if(i){const u=i.controller.frames.indexOf(i);u>=0&&i.controller.frames.splice(u,1)}e.frames.delete(t)}function Yt(e,t,s,i){var h,m;const o=s.retryTimers.get(t);o&&clearTimeout(o),s.retryTimers.delete(t),(h=s.titleObservers.get(t))==null||h.disconnect(),(m=s.allowObservers.get(t))==null||m.disconnect(),Nn(e);let c=0;const u=()=>{let b=null;try{b=e.contentDocument}catch{b=null}if(!b){if(++c<30){const P=setTimeout(()=>{s.retryTimers.delete(t),u()},200);s.retryTimers.set(t,P)}return}s.retryTimers.delete(t);const f=()=>{var k;const P=(k=b.title)==null?void 0:k.trim();P&&i(P)};f();const g=new MutationObserver(f),y=b.head??b.documentElement;y&&g.observe(y,{subtree:!0,childList:!0,characterData:!0}),s.titleObservers.set(t,g),s.allowObservers.set(t,Ns(b))};u()}function Ls(e,t,s,i,o){const c=new window._dln2p7n.Plugin(`_8qzdbvk${s}`);c.tap(e.hooks.init.post,u=>{const h=u;h.isTopLevel&&(o.onUrl(h.client.url.href),Yt(t,s,i,o.onTitle),c.tap(h.client.hooks.lifecycle.navigate,(m,b)=>{const f=b.url;let g=f;try{g=new URL(f,h.client.url.href).href}catch{}o.onUrl(g),Yt(t,s,i,o.onTitle)}))})}function Is(e,t,s,i,o){const c=i.frames.get(t);if(c)return c;const u=e.createFrame(s);return Ls(u,s,t,i,o),i.frames.set(t,u),u}function Rs(){return navigator.hardwareConcurrency<=4||(navigator.deviceMemory??8)<=4}const Ms=l.forwardRef(function({controller:t,tabs:s,activeId:i,onUrl:o,onTitle:c},u){const h=l.useRef(new Map),m=l.useRef(Ts()),b=l.useRef(new Map),f=l.useRef(new Map),g=l.useRef(Rs()).current,[,y]=l.useReducer(k=>k+1,0),P=l.useCallback(()=>{if(t)for(const k of s){const j=b.current.get(k.id);if(!j||f.current.get(k.id)===j)continue;const I=h.current.get(k.id);if(!I)continue;const T=Is(t,k.id,I,m.current,{onUrl:J=>o(k.id,J),onTitle:J=>c(k.id,J)});f.current.set(k.id,j),T.go(j)}},[t,s,o,c]);return l.useEffect(()=>{P()},[P]),l.useEffect(()=>{const k=s.find(j=>j.id===i);k&&k.url&&!be(k.url)&&(b.current.has(k.id)||b.current.set(k.id,k.url),P())},[i,s,P]),l.useEffect(()=>{const k=new Set(s.map(I=>I.id)),j=g?new Set([i]):k;for(const I of m.current.frames.keys())j.has(I)||(Ps(m.current,I),f.current.delete(I));for(const I of b.current.keys())k.has(I)||(b.current.delete(I),f.current.delete(I))},[i,s,g]),l.useImperativeHandle(u,()=>({goTo(k,j){b.current.set(k,j),y()},back(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.back()}catch{}},forward(){var k,j;try{(j=(k=h.current.get(i))==null?void 0:k.contentWindow)==null||j.history.forward()}catch{}},reload(){const k=b.current.get(i),j=m.current.frames.get(i);j&&k&&j.go(k)},getIframe(k){return h.current.get(k)}}),[i]),n.jsx("div",{className:"_rxi5qmt",children:t&&s.filter(k=>!be(k.url)&&(!g||k.id===i)).map(k=>n.jsx("iframe",{title:k.title,ref:j=>{j?h.current.set(k.id,j):h.current.delete(k.id)},className:"_0h17hzp","data-visible":k.id===i&&!!k.url,allow:_n,allowFullScreen:!0,onPointerDown:j=>j.currentTarget.focus()},k.id))})});function Ds({disabled:e,onNavigate:t}){return n.jsx("div",{className:"_2ta3awx",children:n.jsxs("div",{className:"_hfs48s5",children:[n.jsxs("div",{className:"_nbrh985",children:[n.jsx("h1",{className:"_idak361","aria-label":"Home"}),n.jsx("div",{className:"newtab-underline"})]}),n.jsx(Dt,{variant:"_2ta3awx",url:"",disabled:e,autoFocus:!0,onNavigate:t})]})})}function Fs({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),c=l.useRef(null);if(l.useEffect(()=>{if(!e)return;o(""),requestAnimationFrame(()=>{var m;return(m=c.current)==null?void 0:m.focus()});const h=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]),!e)return null;const u=h=>{h.preventDefault();const m=i.trim();m&&(s(m),t())};return n.jsx("div",{className:"_t97drno",onClick:t,children:n.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:"Add bookmark"}),n.jsxs("form",{onSubmit:u,children:[n.jsx("div",{className:"modal-field",children:n.jsx("input",{ref:c,value:i,onChange:h=>o(h.target.value),placeholder:"https://example.com",spellCheck:!1,autoComplete:"off"})}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Cancel"}),n.jsx("button",{type:"submit",className:"modal-btn primary",disabled:!i.trim(),children:"Add"})]})]})]})})}function Os({open:e,onAccept:t,onUpgrade:s}){const i=l.useRef(null);return l.useEffect(()=>{if(!e)return;requestAnimationFrame(()=>{var c;return(c=i.current)==null?void 0:c.focus()});const o=c=>{c.key==="Enter"&&t()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,t]),n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"_t97drno _ndpzvua",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:"easeOut"},children:n.jsxs(Te.div,{className:"modal _vepqnuc",role:"dialog","aria-labelledby":"ads-notice-title",initial:{opacity:0,y:12,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.97},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("div",{className:"modal-title",id:"ads-notice-title",children:"A quick note about ads"}),n.jsx("p",{className:"ads-notice-body",children:"Ads help keep IGNITE OS free to run. You may see a few while using the site."}),n.jsx("p",{className:"ads-notice-body",children:"Ignore any ad that asks you to download something, install an extension, or enable notifications — those are not from us."}),n.jsxs("p",{className:"ads-notice-plus",children:["Prefer no ads?"," ",n.jsx("button",{type:"button",className:"ads-notice-plus-link",onClick:s,children:"Upgrade to Plus"})]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{ref:i,type:"button",className:"modal-btn primary",onClick:t,children:"Okay"})})]})})})}function Us({open:e,onClose:t,onUpgrade:s}){return l.useEffect(()=>{if(!e)return;const i=window.setTimeout(t,6e3);return()=>window.clearTimeout(i)},[e,t]),n.jsx(Ue,{children:e&&n.jsxs(Te.aside,{className:"plus-perks-toast",role:"status","aria-live":"polite",initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},transition:{duration:.28,ease:[.16,1,.3,1]},children:[n.jsx("button",{type:"button",className:"plus-perks-toast-x",onClick:t,"aria-label":"Dismiss",children:n.jsx(gn,{size:14})}),n.jsx("div",{className:"plus-perks-toast-title",children:"IGNITE OS Plus"}),n.jsx("p",{className:"plus-perks-toast-body",children:"Go ad-free, unlock 3M tokens/day, and get exclusive links."}),n.jsx("button",{type:"button",className:"plus-perks-toast-cta",onClick:s,children:"Learn more"})]})})}function $s({open:e,onClose:t,onSubmit:s}){const[i,o]=l.useState(""),[c,u]=l.useState(0),h=l.useRef(null),m=Cn(e?i:"");l.useEffect(()=>{e&&(o(""),u(0),requestAnimationFrame(()=>{var g;return(g=h.current)==null?void 0:g.focus()}))},[e]),l.useEffect(()=>{u(0)},[m]);const b=g=>{const y=g.trim();y&&(s(y),t())},f=g=>{g.key==="Enter"?(g.preventDefault(),b(m[c]??i)):g.key==="ArrowDown"?(g.preventDefault(),u(y=>Math.min(m.length-1,y+1))):g.key==="ArrowUp"&&(g.preventDefault(),u(y=>Math.max(0,y-1)))};return n.jsx(Ue,{children:e&&n.jsx(Te.div,{className:"spotlight-backdrop",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:"easeOut"},children:n.jsxs(Te.div,{className:"spotlight",onClick:g=>g.stopPropagation(),initial:{opacity:0,y:-10,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.97},transition:{duration:.2,ease:[.16,1,.3,1]},children:[n.jsxs("div",{className:"spotlight-input",children:[n.jsx(Me,{size:18}),n.jsx("input",{ref:h,value:i,placeholder:"Search or enter URL",spellCheck:!1,autoComplete:"off",onChange:g=>o(g.target.value),onKeyDown:f})]}),m.length>0&&n.jsx("ul",{className:"spotlight-list",children:m.map((g,y)=>n.jsxs("li",{className:`spotlight-item ${y===c?"selected":""}`,onMouseEnter:()=>u(y),onMouseDown:P=>P.preventDefault(),onClick:()=>b(g),children:[n.jsx(Me,{size:14}),n.jsx("span",{children:g})]},`${g}-${y}`))})]})})})}function Tn(){return n.jsxs("p",{className:"plus-blocked-note",children:["Checkout opens a secure Stripe page, which may be blocked on your network. If it doesn't load, join"," ",n.jsx("a",{href:"https://discord.gg/chromebook",target:"_blank",rel:"noreferrer",children:"discord.gg/chromebook"})," ","to purchase there."]})}function Bs({open:e,onClose:t,account:s,heading:i,blurb:o,onSignUp:c}){if(!e)return null;const u=s.status==="signed-in",h=()=>{var f;u?s.checkout(((f=s.user)==null?void 0:f.email)??void 0):c==null||c()},m=i??"IGNITE OS Plus",b=o??"Unlock 3M tokens/day, exclusive links, and an ad-free experience.";return n.jsx("div",{className:"_t97drno upgrade-backdrop",onClick:t,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[n.jsx("div",{className:"modal-title",children:m}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:b}),u&&n.jsx(Tn,{}),n.jsxs("div",{className:"modal-actions",children:[n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:t,children:"Not now"}),n.jsx("button",{type:"button",className:"modal-btn primary",onClick:h,children:u?"Upgrade to Plus":"Sign up to upgrade"})]})]})})}function He(){return{id:`tab-${Date.now().toString(36)}-${Math.floor(Math.random()*1e6).toString(36)}`,title:"New Tab",url:""}}function qs(e){const t=e;return!!t&&typeof t.id=="string"&&typeof t.title=="string"&&typeof t.url=="string"}function zs(){const e=tt("tabs",{}),t=Array.isArray(e.tabs)?e.tabs.filter(qs):[];if(t.length>0){const s=t.some(i=>i.id===e.activeId)?e.activeId:t[0].id;return{tabs:t,activeId:s}}return Pn()}function Pn(){const e=He();return{tabs:[e],activeId:e.id}}function Ws(e,t){switch(t.type){case"open":{const s=He();return{tabs:[...e.tabs,s],activeId:s.id}}case"openInternal":{const s=e.tabs.find(o=>o.url===t.url);if(s)return{...e,activeId:s.id};const i={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,i],activeId:i.id}}case"openUrl":{const s={...He(),url:t.url,title:t.title};return{tabs:[...e.tabs,s],activeId:s.id}}case"close":{const s=e.tabs.findIndex(c=>c.id===t.id);if(s===-1)return e;const i=e.tabs.filter(c=>c.id!==t.id);if(i.length===0)return Pn();let o=e.activeId;return o===t.id&&(o=i[Math.min(s,i.length-1)].id),{tabs:i,activeId:o}}case"activate":return e.activeId===t.id?e:{...e,activeId:t.id};case"patch":return{...e,tabs:e.tabs.map(s=>s.id===t.id?{...s,...t.patch}:s)};case"reorder":return{...e,tabs:t.tabs};default:return e}}function Hs(){const[e,t]=l.useReducer(Ws,void 0,zs);l.useEffect(()=>{nt("tabs",e)},[e]);const s=l.useCallback(()=>t({type:"open"}),[]),i=l.useCallback((f,g)=>t({type:"openInternal",url:f,title:g}),[]),o=l.useCallback((f,g)=>t({type:"openUrl",url:f,title:g}),[]),c=l.useCallback(f=>t({type:"close",id:f}),[]),u=l.useCallback(f=>t({type:"activate",id:f}),[]),h=l.useCallback((f,g)=>t({type:"patch",id:f,patch:g}),[]),m=l.useCallback(f=>t({type:"reorder",tabs:f}),[]),b=l.useMemo(()=>e.tabs.find(f=>f.id===e.activeId)??e.tabs[0],[e.tabs,e.activeId]);return{tabs:e.tabs,activeId:e.activeId,activeTab:b,open:s,openInternal:i,openUrl:o,close:c,activate:u,patch:h,reorder:m}}function Vs(){const[e,t]=l.useState(()=>mn());l.useEffect(()=>{bn(e)},[e]);const s=l.useCallback(u=>{const h=u.trim();if(!h)return;const m=/^https?:\/\//.test(h)?h:`https://${h}`;t(b=>[...b,Jt(m)])},[]),i=l.useCallback(u=>{t(h=>h.filter(m=>m.id!==u))},[]),o=l.useCallback((u,h)=>{u&&t(m=>{const b=m.findIndex(f=>f.url===u);return b>=0?m.filter((f,g)=>g!==b):[...m,Jt(u,h)]})},[]),c=l.useCallback(u=>!!u&&e.some(h=>h.url===u),[e]);return{bookmarks:e,add:s,remove:i,toggleForUrl:o,has:c}}const ft=[{id:"dark",name:"Dark",mode:"dark"},{id:"light",name:"Light",mode:"light"}],Ks="dark";function mt(e){return ft.find(t=>t.id===e)??ft[0]}function Ot(){const e=ge("theme");return e&&ft.some(t=>t.id===e)?e:e&&e.includes("light")?"light":Ks}function Ut(e){const t=mt(e),s=document.documentElement;s.dataset.theme=t.mode,s.style.removeProperty("--wallpaper"),we("theme",t.id)}function Gs(){const[e,t]=l.useState(Ot),s=l.useRef(!1);l.useEffect(()=>{if(!s.current){s.current=!0;return}const c=document.documentElement;c.classList.add("theme-anim"),Ut(e);const u=window.setTimeout(()=>c.classList.remove("theme-anim"),320);return()=>window.clearTimeout(u)},[e]);const i=l.useCallback(c=>t(c),[]),o=l.useCallback(()=>{t(c=>mt(c).mode==="dark"?"light":"dark")},[]);return{id:e,mode:mt(e).mode,set:i,toggle:o}}const Xt=[{id:"none",label:"None",title:"",favicon:""},{id:"google-classroom",label:"Google Classroom",title:"Home - Classroom",favicon:"https://ssl.gstatic.com/classroom/favicon.png"},{id:"google-forms",label:"Google Forms",title:"Untitled form - Google Forms",favicon:"https://ssl.gstatic.com/docs/spreadsheets/forms/forms_icon_2023q4.ico"},{id:"google-drive",label:"Google Drive",title:"My Drive - Google Drive",favicon:"https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png"},{id:"google-docs",label:"Google Docs",title:"Untitled document - Google Docs",favicon:"https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico"},{id:"kahoot",label:"Kahoot!",title:"Kahoot!",favicon:"https://kahoot.com/favicon.ico"},{id:"quizlet",label:"Quizlet",title:"Quizlet",favicon:"https://quizlet.com/favicon.ico"},{id:"custom",label:"Custom",title:"",favicon:""}],Ln="Home",Js=Ze("branding/IGNITE OS-834cc7f9f1eda4fb.png"),Ys="about:blank";let In=!1;function vi(e){In=e}function Xs(){return In}function yi(e){return Xt.find(t=>t.id===e)??Xt[0]}function Qs(){let e=document.querySelector('link[rel~="icon"]');return e||(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e}function Zs(e,t){const s=e.trim(),i=t.trim();document.title=s||Ln,Qs().href=i||Js}function xi(e){const t=e.trim();if(!t)return{valid:!1,error:"URL is required"};const s=/^https?:\/\//i.test(t)?t:`https://${t}`;let i;try{i=new URL(s)}catch{return{valid:!1,error:"Invalid URL format"}}return i.protocol!=="http:"&&i.protocol!=="https:"?{valid:!1,error:"URL must start with http:// or https://"}:{valid:!0,value:i.toString()}}function er(e,t,s,i){const o=e.document;o.open(),o.close();const c=o.documentElement;let u=o.head,h=o.body;u||(u=o.createElement("head"),c.appendChild(u)),h||(h=o.createElement("body"),c.appendChild(h));const m=o.createElement("meta");m.setAttribute("charset","utf-8"),u.appendChild(m);const b=o.createElement("meta");if(b.name="_rxi5qmt",b.content="width=device-width,initial-scale=1",u.appendChild(b),o.title=s.trim()||Ln,i.trim()){const y=o.createElement("link");y.rel="icon",y.href=i.trim(),u.appendChild(y)}const f=o.createElement("style");f.textContent="html,body{margin:0;height:100%;background:#000}iframe{display:block;width:100%;height:100%;border:0}",u.appendChild(f);const g=o.createElement("iframe");g.src=t,g.referrerPolicy="no-referrer",g.allow=_n,g.allowFullscreen=!0,h.appendChild(g)}function tr(e,t,s){let i=window;try{window.top&&window.top!==window.self&&(i=window.top)}catch{}const o=i.open(Ys,"_blank");if(!o)return{ok:!1,error:"Popup blocked — allow popups for this site, then try again."};const c=location.href.startsWith("about:")?Ze():location.href;try{er(o,c,t,s)}catch{return{ok:!1,error:"Couldn't write to the new window."}}return window.setTimeout(()=>{try{i.location.replace(e)}catch{window.location.replace(e)}},40),{ok:!0}}let $t=document.body;function nr(e){$t=e}function sr(){return $t}function rr(){return $t}function Qt(e){return e===" "?"space":e.trim().toLowerCase()}function ir(e){const t=e;return!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function or(e){l.useEffect(()=>{Zs(e.coverTitle,e.coverFavicon)},[e.coverTitle,e.coverFavicon]),l.useEffect(()=>{const s=Qt(e.exitKey),i=e.exitUrl;if(!s||!i)return;const o=h=>{if(!(h.repeat||Xs()||ir(h.target))&&Qt(h.key)===s){h.preventDefault();try{if(window.top&&window.top!==window.self){window.top.location.assign(i);return}}catch{}window.location.assign(i)}},c=sr(),u=o;return c.addEventListener("keydown",u,!0),()=>c.removeEventListener("keydown",u,!0)},[e.exitKey,e.exitUrl]),l.useEffect(()=>{if(!e.confirmLeave)return;const s=i=>{i.preventDefault(),i.returnValue=""};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[e.confirmLeave]);const t=l.useRef(!1);l.useEffect(()=>{if(!e.autoCoverFrame||t.current||window.self!==window.top)return;const s=()=>{t.current||(t.current=!0,i(),tr(e.exitUrl,e.coverTitle,e.coverFavicon))},i=()=>{window.removeEventListener("pointerdown",s),window.removeEventListener("keydown",s)};return window.addEventListener("pointerdown",s),window.addEventListener("keydown",s),i},[e.autoCoverFrame,e.exitUrl,e.coverTitle,e.coverFavicon])}const bt=[{id:"google",name:"Google",template:"https://www.google.com/search?q=%s"},{id:"duckduckgo",name:"DuckDuckGo",template:"https://duckduckgo.com/?q=%s"},{id:"bing",name:"Bing",template:"https://www.bing.com/search?q=%s"},{id:"brave",name:"Brave",template:"https://search.brave.com/search?q=%s"}],pe={searchEngineId:"duckduckgo",coverPreset:"none",coverTitle:"",coverFavicon:"",autoCoverFrame:!1,exitKey:"`",exitUrl:"https://docs.google.com/document/u/0/",confirmLeave:!1,backgroundMode:"full",accent:"#ffffff",adblock:!0};function ar(e){return bt.some(t=>t.id===e)}function cr(e){return e==="full"||e==="reduced"||e==="mesh"||e==="off"}function lr(e){return typeof e=="string"&&/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)}function Ie(e,t){return typeof e=="string"?e:t}function lt(e,t){return typeof e=="boolean"?e:t}function Bt(){const e=tt("settings",{});return{searchEngineId:ar(e.searchEngineId)?e.searchEngineId:pe.searchEngineId,coverPreset:Ie(e.coverPreset??e.cloakPreset,pe.coverPreset),coverTitle:Ie(e.coverTitle??e.cloakTitle,pe.coverTitle),coverFavicon:Ie(e.coverFavicon??e.cloakFavicon,pe.coverFavicon),autoCoverFrame:lt(e.autoCoverFrame??e.autoAboutBlank,pe.autoCoverFrame),exitKey:Ie(e.exitKey??e.panicKey,pe.exitKey),exitUrl:Ie(e.exitUrl??e.panicUrl,pe.exitUrl),confirmLeave:lt(e.confirmLeave,pe.confirmLeave),backgroundMode:cr(e.backgroundMode)?e.backgroundMode:pe.backgroundMode,accent:lr(e.accent)?e.accent:pe.accent,adblock:lt(e.adblock,pe.adblock)}}function Rn(e){nt("settings",e)}function Zt(e){return(bt.find(t=>t.id===e)??bt[0]).template}function ur(){const[e,t]=l.useState(Bt);l.useEffect(()=>{Rn(e)},[e]);const s=l.useCallback(i=>{t(o=>({...o,...i}))},[]);return{settings:e,update:s}}function dr(e){const t=l.useRef(e);t.current=e,l.useEffect(()=>{const s=i=>{if(!(i.ctrlKey||i.metaKey)||i.altKey)return;const o=i.key.toLowerCase();o==="t"?(i.preventDefault(),t.current.onNewTab()):o==="w"?(i.preventDefault(),t.current.onCloseTab()):o==="k"?(i.preventDefault(),t.current.onSpotlight()):o>="1"&&o<="9"&&(i.preventDefault(),t.current.onJumpToTab(Number(o)))};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[])}function hr(e){const[t,s]=l.useState(null),[i,o]=l.useState(null);return l.useEffect(()=>{let c=!0,u=0;const h=window.requestIdleCallback,m=f=>h?h(f,{timeout:2500}):window.setTimeout(f,200),b=()=>{Ae(async()=>{const{rebootController:f}=await import("./boot-D3vqjHTs-8068ec8f.js");return{rebootController:f}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(({rebootController:f})=>f().then(g=>{an(),c&&s(g)},g=>{c&&(u+=1,u<30?window.setTimeout(b,Math.min(1e3*u,5e3)):o(g instanceof Error?g:new Error(String(g))))}))};return m(b),()=>{c=!1}},[e]),{controller:t,error:i}}let je=null,qe=null,Ve=null,Ke=!1;const en=new WeakSet;function Mn(){if(!je||Ve===null)return;const e=Ve;Ve=null,Ke=!0;try{je.cookieJar.clear(),je.cookieJar.load(e),je.persistCookies().finally(()=>{Ke=!1})}catch{Ke=!1}}function pr(e,t){if(qe=t,!!e){if(je=e,!en.has(e)){const s=e.persistCookies.bind(e);e.persistCookies=(async()=>{await s(),Ke||qe==null||qe()}),en.add(e)}Mn()}}function fr(){if(!je)return null;try{return je.cookieJar.dump()}catch{return null}}function mr(e){Ve=e,Mn()}const br="https://www.google.com/search?q=%s";function gr(e){return/\s/.test(e)?!1:/^https?:\/\//.test(e)||e.startsWith("localhost")?!0:/^[^\s.]+\.[^\s.]{2,}/.test(e)}function tn(e,t=br){const s=e.trim();return s?/^https?:\/\//.test(s)?s:gr(s)?`https://${s}`:t.replace("%s",encodeURIComponent(s)):""}class gt extends Error{constructor(s,i,o=null){super(i);ke(this,"status");ke(this,"code");this.status=s,this.code=o}}const ce="/api/account";async function wr(e){const t=await e.text();try{const s=JSON.parse(t);return{message:s.error??t,code:s.code??null}}catch{return{message:t||e.statusText,code:null}}}function vr(){async function e(t,s,i){const o={...i==null?void 0:i.headers};let c=i==null?void 0:i.body;(i==null?void 0:i.json)!==void 0&&(o["content-type"]="application/json",c=JSON.stringify(i.json));const u=await fetch(Oe(t+s),{...i,headers:{...o,...ms("account")},body:c,credentials:xn});if(!u.ok){const{message:h,code:m}=await wr(u);throw new gt(u.status,h,m)}if(u.status!==204)return await u.json()}return{me:()=>e(ce,"/me"),login:(t,s,i)=>e(ce,"/auth/login",{method:"POST",json:{email:t,password:s,captcha:i}}).then(o=>(at("account",o),o)),requestSetPassword:(t,s)=>e(ce,"/auth/set-password/request",{method:"POST",json:{email:t,captcha:s}}),setPassword:(t,s,i)=>e(ce,"/auth/set-password",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),requestReset:(t,s)=>e(ce,"/auth/reset/request",{method:"POST",json:{email:t,captcha:s}}),reset:(t,s,i)=>e(ce,"/auth/reset",{method:"POST",json:{email:t,code:s,password:i}}).then(o=>(at("account",o),o)),logout:()=>(bs("account"),e(ce,"/logout",{method:"POST"})),getSync:()=>e(ce,"/me/sync"),putSync:t=>e(ce,"/me/sync",{method:"PUT",json:{data:t}}),billingStatus:()=>e(ce,"/billing/status"),checkout:(t,s)=>e(ce,"/billing/checkout",{method:"POST",json:{email:t,origin:s}}),billingPortal:t=>e(ce,"/billing/portal",{method:"POST",json:{origin:t}}),verifyCheckout:t=>e(ce,`/billing/verify?session_id=${encodeURIComponent(t)}`),setDiscord:t=>e(ce,"/me/discord",{method:"POST",json:{discordHandle:t}})}}function yr(){const e={bookmarks:mn(),settings:Bt(),themeId:Ot()},t=fr();return t!==null&&(e.proxyCookies=t),e}function xr(e){if(typeof e!="object"||e===null)return;const{bookmarks:t,settings:s,themeId:i,proxyCookies:o}=e;Array.isArray(t)&&bn(t),s&&typeof s=="object"&&Rn({...Bt(),...s}),typeof i=="string"&&Ut(i),typeof o=="string"&&mr(o)}var ze={exports:{}},nn;function kr(){return nn||(nn=1,(function(e,t){(()=>{var q,ee,F,E,R,S,M,z,oe,re,le,p,ue,ie,de,he,me,C,Se,wt,vt,Ge,yt,xt,kt,Dn,jt,Fn,On,Et,Je,Ct,Un,Ye,Be,$n,Xe;const s="vibrate"in navigator&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(typeof window>"u")return;const i=["#f5c2e7","#cba6f7","#f38ba8","#fab387","#f9e2af","#a6e3a1","#94e2d5","#89dceb","#b4befe"],o=(G,_,a)=>{const d=_===0?"9999px":"0",w=_===a-1?"9999px":"0";return`color:#1e1e2e;background:${(v=>{if(v==="cap")return"#89b4fa";let x=0;for(let A=0;A<v.length;A++)x=v.charCodeAt(A)+((x<<5)-x);return i[Math.abs(x)%i.length]})(G)};margin-left:${_?"-6px":0};padding:0 6px;border-radius:${d} ${w} ${w} ${d};font-weight:600`},c={};for(const G of["debug","info","warn","error"])c[G]=(_,...a)=>{if(window.CAP_SILENT||G==="debug"&&!window.CAP_DEBUG)return;const d=_.map(v=>`%c${v}`).join(" "),w=_.map((v,x)=>o(v,x,_.length))};const u=G=>G?["cap",G]:["cap"],h=G=>`${Math.round(performance.now()-G)}ms`,m=(G,_)=>Object.assign(new Error(_),{code:G}),b=(G,_={})=>window!=null&&window.CAP_CUSTOM_FETCH?window.CAP_CUSTOM_FETCH(G,_):fetch(G,_),f=(G,_)=>_?_.aborted?Promise.reject(m("aborted","aborted")):Promise.race([G,new Promise((a,d)=>_.addEventListener("abort",()=>d(m("aborted","aborted")),{once:!0}))]):G,g="initial-state,verifying-label,solved-label,error-label,required-label,troubleshooting-label,group-aria-label,verify-aria-label,verifying-aria-label,verified-aria-label,error-aria-label".split(","),y={"zh-cn":"确认你是真人/正在验证.../你是真人/出错了。请重试。/请确认你是真人/故障排除/Cap 验证/点击以确认你是真人/正在验证你是真人,请稍候/我们已确认你是真人,你可以继续了/发生错误,请重试",es:"Verifica que eres humano/Verificando.../Eres humano/Error. Inténtalo de nuevo./Verifica que eres humano/Solucionar problemas/Verificación de Cap/Haz clic para verificar que eres humano/Verificando que eres humano, espera/Hemos verificado que eres humano, ya puedes continuar/Se produjo un error, inténtalo de nuevo",hi:"पुष्टि करें कि आप मानव हैं/सत्यापित हो रहा है.../आप मानव हैं/त्रुटि। पुनः प्रयास करें।/कृपया पुष्टि करें कि आप मानव हैं/समस्या निवारण/Cap सत्यापन/पुष्टि करने के लिए क्लिक करें कि आप मानव हैं/सत्यापित किया जा रहा है कि आप मानव हैं, प्रतीक्षा करें/हमने पुष्टि कर दी है कि आप मानव हैं, अब आप जारी रख सकते हैं/एक त्रुटि हुई, पुनः प्रयास करें",ar:"تحقق من أنك إنسان/جارٍ التحقق.../أنت إنسان/خطأ. حاول مرة أخرى./يرجى التحقق من أنك إنسان/استكشاف الأخطاء وإصلاحها/تحقق Cap/انقر للتحقق من أنك إنسان/جارٍ التحقق من أنك إنسان، يرجى الانتظار/لقد تحققنا من أنك إنسان، يمكنك المتابعة الآن/حدث خطأ، يرجى المحاولة مرة أخرى",pt:"Sou humano/Verificando.../Você é humano/Erro. Tente novamente./Verifique que você é humano/Solução de problemas/Verificação Cap/Clique para verificar que você é humano/Verificando que você é humano, aguarde/Verificamos que você é humano, você pode continuar/Ocorreu um erro, tente novamente",ru:"Я человек/Проверка.../Вы человек/Ошибка. Повторите./Подтвердите, что вы человек/Устранение неполадок/Проверка Cap/Нажмите, чтобы подтвердить, что вы человек/Проверяем, что вы человек, подождите/Мы подтвердили, что вы человек, можете продолжить/Произошла ошибка, повторите попытку",ja:"私は人間です/確認中.../あなたは人間です/エラー。再試行を。/あなたが人間であることを確認してください/トラブルシューティング/Cap 認証/クリックして人間であることを確認/あなたが人間であることを確認しています。お待ちください/あなたが人間であることを確認しました。続行できます/エラーが発生しました。もう一度お試しください",de:"Ich bin ein Mensch/Wird überprüft.../Sie sind ein Mensch/Fehler. Erneut versuchen./Bitte bestätigen Sie, dass Sie ein Mensch sind/Fehlerbehebung/Cap-Verifizierung/Klicken, um zu bestätigen, dass Sie ein Mensch sind/Überprüfung, ob Sie ein Mensch sind, bitte warten/Wir haben bestätigt, dass Sie ein Mensch sind, Sie können fortfahren/Ein Fehler ist aufgetreten, bitte erneut versuchen",fr:"Je suis humain/Vérification.../Vous êtes humain/Erreur. Réessayez./Veuillez vérifier que vous êtes humain/Dépannage/Vérification Cap/Cliquez pour vérifier que vous êtes humain/Vérification que vous êtes humain, veuillez patienter/Nous avons vérifié que vous êtes humain, vous pouvez continuer/Une erreur s'est produite, veuillez réessayer"};function P(G,_){let a=(function(v){let x=2166136261;for(let A=0;A<v.length;A++)x^=v.charCodeAt(A),x+=(x<<1)+(x<<4)+(x<<7)+(x<<8)+(x<<24);return x>>>0})(G),d="";function w(){return a^=a<<13,a^=a>>>17,a^=a<<5,a>>>0}for(;d.length<_;)d+=w().toString(16).padStart(8,"0");return d.substring(0,_)}let k=null;async function j(G){const _=(d=>{const w=atob(d),v=new Uint8Array(w.length);for(let x=0;x<w.length;x++)v[x]=w.charCodeAt(x);return v})(G),a=new TextDecoder().decode(await(async function(d){if(typeof DecompressionStream<"u")try{const w=new DecompressionStream("deflate-raw"),v=w.writable.getWriter(),x=w.readable.getReader();v.write(d).then(()=>v.close()).catch(()=>{});const A=[];for(;;){const{done:X,value:te}=await x.read();if(X)break;A.push(te)}let N=0;for(const X of A)N+=X.length;const O=new Uint8Array(N);let L=0;for(const X of A)O.set(X,L),L+=X.length;return O}catch{}return k||(k=new Promise((w,v)=>{const x=window.CAP_PAKO_URL||"https://cdn.jsdelivr.net/npm/pako@2.1.0/dist/pako_inflate.min.js";c.debug(u("instr"),"DecompressionStream unavailable, loading pako from",x);const A=document.createElement("script");A.src=x;const N=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE;N&&A.setAttribute("nonce",N),A.onload=()=>{var O;(O=window.pako)!=null&&O.inflateRaw?w(window.pako):v(new Error("pako loaded but inflateRaw is missing"))},A.onerror=()=>{k=null,v(new Error(`failed to load pako fallback from ${x}`))},document.head.appendChild(A)})),(await k).inflateRaw(d)})(_));return new Promise(d=>{var w=setTimeout(()=>{A(),d({__timeout:!0})},2e4),v=document.createElement("iframe");v.setAttribute("sandbox","allow-scripts"),v.setAttribute("aria-hidden","true"),v.style.cssText="position:absolute;width:1px;height:1px;top:-9999px;left:-9999px;border:none;opacity:0;pointer-events:none;";var x=!1;function A(){x||(x=!0,clearTimeout(w),window.removeEventListener("message",N),v.parentNode&&v.parentNode.removeChild(v))}function N(X){if(v.contentWindow&&X.source===v.contentWindow){var te=X.data;te&&typeof te=="object"&&(te.type==="cap:instr"?(A(),te.blocked?d({__blocked:!0,blockReason:te.blockReason||"automated_browser"}):te.result?d(te.result):d({__timeout:!0})):te.type==="cap:error"&&(A(),d({__timeout:!0})))}}window.addEventListener("message",N);const O=window.CAP_SCRIPT_NONCE||window.CAP_CSS_NONCE,L=O?` nonce="${String(O).replace(/"/g,"&quot;")}"`:"";v.srcdoc='<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><script'+L+">"+a+`
3
+ <\/script></body></html>`,document.body.appendChild(v)})}let I=null;const T=()=>{if(I)return I;const G=window.CAP_CUSTOM_WASM_URL||"https://cdn.jsdelivr.net/npm/@cap.js/wasm@0.0.7/browser/cap_wasm_bg.wasm",_=performance.now();return c.debug(u("wasm"),"fetching",G),I=fetch(G).then(a=>{if(!a.ok)throw new Error(`Failed to fetch wasm: ${a.status}`);return a.arrayBuffer()}).then(a=>WebAssembly.compile(a)).then(a=>(c.debug(u("wasm"),`ready in ${h(_)}`),a)).catch(a=>{throw I=null,c.warn(u("wasm"),`load failed (${h(_)}):`,a.message||a),a}),I};typeof WebAssembly=="object"&&typeof WebAssembly.compile=="function"&&T().catch(()=>{});let J=null;function ne(){return J||(J=URL.createObjectURL(new Blob(['(()=>{const e=(e,...t)=>{self.CAP_SILENT||console[e]("[cap worker]",...t)},t=async({salt:t,target:n})=>{let s=0;const r=new TextEncoder,o=4*n.length,a=Math.floor(o/8),l=o%8,i=n.length%2==0?n:`${n}0`,c=i.length/2,f=new Uint8Array(c);for(let e=0;e<c;e++)f[e]=parseInt(i.substring(2*e,2*e+2),16);const g=l>0?255<<8-l&255:0;for(;;)try{for(let e=0;e<5e4;e++){const e=t+s,n=r.encode(e),o=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(o);let c=!0;for(let e=0;e<a;e++)if(i[e]!==f[e]){c=!1;break}if(c&&l>0&&(i[a]&g)!==(f[a]&g)&&(c=!1),c)return void self.postMessage({nonce:s,found:!0});s++}}catch(t){return e("error","fallback solver crashed:",t.message||t),void self.postMessage({found:!1,error:t.message})}},n=e=>{const t=BigInt("0x"+e.N);let n=BigInt("0x"+e.x);const s=0|e.t,r=Math.max(64,Math.floor(s/50)),o=performance.now();for(let e=0;e<s;e+=r){const o=Math.min(s,e+r);for(let s=e;s<o;s++)n=n*n%t;o<s&&self.postMessage({progress:o/s})}self.postMessage({found:!0,y:n.toString(16),durationMs:(performance.now()-o).toFixed(2)})};if("object"!=typeof WebAssembly||"function"!=typeof WebAssembly?.instantiate)return e("warn","WebAssembly unavailable, using JS fallback solver (significantly slower)"),void(self.onmessage=async({data:e})=>"rsw"===e?.kind?n(e):t({salt:e.salt,target:e.target}));let s=null;self.onmessage=async({data:r})=>{if("rsw"===r?.kind)return n(r);const{salt:o,target:a,wasmModule:l}=r;if(l instanceof WebAssembly.Module&&null===s){const n=(t=>{try{let e,n=0,r=null;const o=()=>(null!==r&&0!==r.byteLength||(r=new Uint8Array(e.memory.buffer)),r),a=new TextEncoder,l=(e,t,s)=>{if(void 0===s){const s=a.encode(e),r=t(s.length,1)>>>0;return o().subarray(r,r+s.length).set(s),n=s.length,r}let r=e.length,l=t(r,1)>>>0;const i=o();let c=0;for(;c<r;c++){const t=e.charCodeAt(c);if(t>127)break;i[l+c]=t}if(c!==r){0!==c&&(e=e.slice(c));const t=c+3*e.length;l=s(l,r,t,1)>>>0,r=t;const n=o().subarray(l+c,l+r),{written:i}=a.encodeInto(e,n);c+=i,l=s(l,r,c,1)>>>0}return n=c,l},i={wbg:{}};i.wbg.__wbindgen_init_externref_table=()=>{const t=e.__wbindgen_export_0,n=t.grow(4);t.set(0,void 0),t.set(n+0,void 0),t.set(n+1,null),t.set(n+2,!0),t.set(n+3,!1)};const c=new WebAssembly.Instance(t,i);return e=c.exports,e.__wbindgen_start&&e.__wbindgen_start(),s=(t,s)=>{const r=l(t,e.__wbindgen_malloc,e.__wbindgen_realloc),o=n,a=l(s,e.__wbindgen_malloc,e.__wbindgen_realloc),i=n;return BigInt.asUintN(64,e.solve_pow(r,o,a,i))},!0}catch(t){return e("error","wasm init failed:",t.message||t),!1}})(l);if(!n)return e("warn","wasm init failed, falling back to JS solver"),t({salt:o,target:a})}if(null===s)return e("warn","no wasm module provided, falling back to JS solver"),t({salt:o,target:a});try{const e=performance.now(),t=s(o,a),n=performance.now();self.postMessage({nonce:Number(t),found:!0,durationMs:(n-e).toFixed(2)})}catch(t){e("error","solve_pow threw:",t.message||t),self.postMessage({found:!1,error:t.message||String(t)})}},self.onerror=e=>{self.postMessage({found:!1,error:e})}})();'],{type:"application/javascript"})),J)}class B{constructor(_){this._size=_,this._workers=[],this._idle=[],this._queue=[],this._wasmModule=null,this._spawnFailures=0}setWasm(_){this._wasmModule=_}_spawn(){const _=ne(),a=new Worker(_);return a._busy=!1,this._workers.push(a),this._idle.push(a),a}_replaceWorker(_){const a=this._workers.indexOf(_);a!==-1&&this._workers.splice(a,1);const d=this._idle.indexOf(_);d!==-1&&this._idle.splice(d,1);try{_.terminate()}catch{}return this._spawnFailures++,c.warn(u("pool"),`worker died, replacing (attempt ${this._spawnFailures}/3)`),this._spawnFailures>3?(c.error(u("pool"),"worker spawn failed repeatedly, giving up"),null):this._spawn()}_ensureSize(_){for(;this._workers.length<_;)this._spawn()}run(_,a){return new Promise((d,w)=>{this._queue.push({salt:_,target:a,resolve:d,reject:w}),this._dispatch()})}runMsg(_,a){return new Promise((d,w)=>{this._queue.push({msg:_,onProgress:a,resolve:d,reject:w}),this._dispatch()})}_dispatch(){for(;this._idle.length>0&&this._queue.length>0;){const _=this._idle.shift(),a=this._queue.shift(),{resolve:d,reject:w}=a,v=a.msg!==void 0;let x=!1;const A=({data:O})=>{if(!x){if(!O||typeof O.progress!="number"||O.found)x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N),this._spawnFailures=0,this._idle.push(_),O.found?d(v?O:O.nonce):w(new Error(O.error||"worker failed")),this._dispatch();else if(a.onProgress)try{a.onProgress(O.progress)}catch{}}},N=O=>{if(x)return;x=!0,_.removeEventListener("message",A),_.removeEventListener("error",N);const L=this._replaceWorker(_);w(O),L&&this._dispatch()};_.addEventListener("message",A),_.addEventListener("error",N),v?_.postMessage(a.msg):this._wasmModule?_.postMessage({salt:a.salt,target:a.target,wasmModule:this._wasmModule},[]):_.postMessage({salt:a.salt,target:a.target})}}terminate(){for(const _ of this._workers)try{_.terminate()}catch{}this._workers=[],this._idle=[],this._queue=[]}}class $ extends HTMLElement{constructor(){super();se(this,C);se(this,q,null);se(this,ee,navigator.hardwareConcurrency||8);ke(this,"token",null);se(this,F);se(this,E);se(this,R);se(this,S);se(this,M);se(this,z);se(this,oe,!1);se(this,re);se(this,le);se(this,p,null);se(this,ue,null);se(this,ie,null);se(this,de,null);se(this,he,null);se(this,me,null);se(this,Be,()=>{if(r(this,E)){try{this.scrollIntoView({behavior:"smooth",block:"center"})}catch{this.scrollIntoView()}r(this,E).classList.remove("invalid"),r(this,E).offsetWidth,r(this,E).classList.add("invalid"),setTimeout(()=>{var a;return(a=r(this,E))==null?void 0:a.classList.remove("invalid")},1500)}});r(this,re)&&r(this,re).forEach((a,d)=>{this.removeEventListener(d.slice(2),a)}),W(this,re,new Map),this.boundHandleProgress=this.handleProgress.bind(this),this.boundHandleSolve=this.handleSolve.bind(this),this.boundHandleError=this.handleError.bind(this),this.boundHandleReset=this.handleReset.bind(this);try{W(this,le,this.attachInternals())}catch{}}getI18nText(a,d){var w;return this.getAttribute(`data-cap-i18n-${a}`)||((w=r(this,he))==null?void 0:w[a])||d}static get observedAttributes(){return["onsolve","onprogress","onreset","onerror","data-cap-worker-count","data-cap-i18n-initial-state","required"]}initialize(){ne(),W(this,me,new AbortController),r(this,p)||W(this,p,H(this,C,wt).call(this)),r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn())}attributeChangedCallback(a,d,w){var v;if(a.startsWith("on")){const x=a.slice(2),A=r(this,re).get(a);if(A&&this.removeEventListener(x,A),w){const N=O=>{const L=this.getAttribute(a);typeof window[L]=="function"&&window[L].call(this,O)};r(this,re).set(a,N),this.addEventListener(x,N)}}a==="data-cap-worker-count"&&this.setWorkersCount(parseInt(w,10)),a==="data-cap-i18n-initial-state"&&r(this,E)&&((v=r(this,E))!=null&&v.querySelector(".label.active"))&&this.animateLabel(this.getI18nText("initial-state","Verify you're human")),a==="required"&&H(this,C,Ye).call(this)}async connectedCallback(){W(this,z,this),this.shadowRoot?W(this,F,this.shadowRoot):W(this,F,this.attachShadow({mode:"open"})),r(this,E)||W(this,E,document.createElement("div")),H(this,C,Un).call(this),this.createUI(),this.addEventListeners(),this.initialize(),r(this,R).removeAttribute("disabled");const a=this.getAttribute("data-cap-worker-count"),d=a?parseInt(a,10):null;this.setWorkersCount(d||navigator.hardwareConcurrency||8),r(this,z).innerHTML=`<input type="hidden" name="${r(this,C,Et)}">`,c.debug(u(),`widget ready (workers=${r(this,ee)}, haptics=${r(this,C,Se)})`),H(this,C,yt).call(this),H(this,C,Ye).call(this),this.addEventListener("invalid",r(this,Be))}async solve(){var w,v;if(r(this,oe))return;H(this,C,Xe).call(this);const a=performance.now(),d=(w=r(this,me))==null?void 0:w.signal;c.debug(u("solve"),"starting");try{W(this,oe,!0),this.updateUI("verifying",this.getI18nText("verifying-label","Verifying..."),!0),r(this,R).setAttribute("aria-label",this.getI18nText("verifying-aria-label","Verifying you're a human, please wait")),this.dispatchEvent("progress",{progress:0});try{let x,A,N=this.getAttribute("data-cap-api-endpoint");if(!N&&(window!=null&&window.CAP_CUSTOM_FETCH))N="/";else if(!N)throw m("missing_endpoint","Missing API endpoint. Either custom fetch or an API endpoint must be provided.");if(N.endsWith("/")||(N+="/"),r(this,p).state==="done"&&r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);if(r(this,p).state==="done")x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100});else if(r(this,p).state==="solving"||r(this,p).state==="redeeming"||r(this,p).state==="fetching"||r(this,p).state==="waiting"){r(this,p).state==="waiting"&&(r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,p).state="waiting",H(this,C,jt).call(this)),r(this,p).pendingPromotion=r(this,ee),r(this,p).promoteFn&&r(this,p).promoteFn(r(this,ee));const V=setInterval(()=>{if(d!=null&&d.aborted||!r(this,p))return void clearInterval(V);const Q=r(this,p).state;if(Q==="done"||Q==="error")return void clearInterval(V);const xe=r(this,p).challenges?r(this,p).challenges.length:1,Pe=r(this,p).completedCount,Le=Q==="redeeming"?99:Q==="fetching"||Q==="waiting"?0:Math.min(98,Math.round(Pe/xe*100));this.dispatchEvent("progress",{progress:Le})},150);if(await new Promise(Q=>r(this,p).onSettled(Q)),clearInterval(V),(d==null?void 0:d.aborted)||!r(this,p))return;if(r(this,p).state==="idle"&&((v=r(this,p).challengeResp)==null?void 0:v.format)===2&&Array.isArray(r(this,p).challengeResp.challenges))A=r(this,p).challengeResp,r(this,p).challengeResp=null,x=await this.solveChallengesV2(A.challenges,d);else{if(r(this,p).state!=="done")throw m("solve_failed","Unable to solve challenge, self-hosted instance likely down. This is not an issue with Cap.");if(r(this,p).token&&r(this,p).tokenExpires&&Date.now()<r(this,p).tokenExpires)return H(this,C,Ct).call(this);x=r(this,p).results,A=r(this,p).challengeResp,this.dispatchEvent("progress",{progress:100})}}else{const V=r(this,p).challengeResp;if((V==null?void 0:V.format)===2&&Array.isArray(V.challenges))A=V,r(this,p).challengeResp=null;else{const Q=await b(`${N}challenge`,{method:"POST",signal:d});try{A=await Q.json()}catch{throw m("challenge_parse_error","Failed to parse challenge response from server")}if(A.error)throw m("network_error",A.error)}if(A.format===2&&Array.isArray(A.challenges))x=await this.solveChallengesV2(A.challenges,d);else{const{challenge:Q,token:xe}=A;let Pe=Q;if(!Array.isArray(Pe)){let Le=0;Pe=Array.from({length:Q.c},()=>(Le++,[P(`${xe}${Le}`,Q.s),P(`${xe}${Le}d`,Q.d)]))}x=await this.solveChallenges(Pe,d)}}const O=A.instrumentation?j(A.instrumentation):Promise.resolve(null),L=await O;if(d!=null&&d.aborted||!r(this,p))return;if(L!=null&&L.__timeout||L!=null&&L.__blocked){b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:A.token,solutions:x,...L.__blocked&&{instr_blocked:!0},...L.__timeout&&{instr_timeout:!0}}),headers:{"Content-Type":"application/json"},signal:d}).catch(()=>{}),this.updateUIBlocked(this.getI18nText("error-label","Error"),L==null?void 0:L.__blocked),r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again"));const V=L!=null&&L.__blocked?"instr_blocked":"instr_timeout",Q=L!=null&&L.__blocked?`Instrumentation blocked (${L.blockReason||"automated_browser"})`:"Instrumentation timed out";this.removeEventListener("error",this.boundHandleError);const xe=new CustomEvent("error",{bubbles:!0,composed:!0,detail:{isCap:!0,code:V,message:Q}});return super.dispatchEvent(xe),this.addEventListener("error",this.boundHandleError),this.executeAttributeCode("onerror",xe),c.error(u("instr"),`[${V}] ${Q}`),void W(this,oe,!1)}const{token:X}=A,te=await b(`${N}redeem`,{method:"POST",body:JSON.stringify({token:X,solutions:x,...L&&{instr:L}}),headers:{"Content-Type":"application/json"},signal:d});let U;try{U=await te.json()}catch{throw m("redeem_failed","Failed to parse server response")}if(d!=null&&d.aborted||!r(this,p))return;if(this.dispatchEvent("progress",{progress:100}),!U.success)throw m("invalid_solution",U.error||"Invalid solution");H(this,C,Je).call(this,U.token),this.dispatchEvent("solve",{token:U.token}),this.token=U.token,H(this,C,vt).call(this),r(this,q)&&clearTimeout(r(this,q));const K=new Date(U.expires).getTime()-Date.now();return K>0&&K<864e5?W(this,q,setTimeout(()=>this.reset(),K)):this.error("Invalid expiration time","invalid_expires"),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),c.debug(u("solve"),`verified in ${h(a)}`),H(this,C,kt).call(this),{success:!0,token:this.token}}catch(x){if(d!=null&&d.aborted||!r(this,p))return;throw r(this,R).setAttribute("aria-label",this.getI18nText("error-aria-label","An error occurred, please try again")),this.error(x.message,x.code||"solve_failed"),x}}finally{W(this,oe,!1)}}async solveChallengesV2(a,d){const w=a.length;let v=0;const x=new Array(a.length);for(let U=0;U<a.length;U++){const K=a[U];if(!K||typeof K!="object"||K.protocol!=="sha256-pow"&&K.protocol!=="rsw"&&K.protocol!=="instrumentation")throw m("challenge_unsupported",`unsupported format-2 protocol '${K==null?void 0:K.protocol}'`)}let A=null;if(typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function")try{A=await T()}catch(U){c.warn(u("wasm"),"unavailable, falling back to JS solver:",U.message||U)}const N=Math.max(1,Math.min(r(this,ee),a.length)),O=new B(N);O.setWasm(A),O._ensureSize(N);const L=(U,K)=>Promise.race([U,new Promise((V,Q)=>setTimeout(()=>Q(new Error(`[cap] ${K} timed out after 60000ms`)),6e4))]),X=new Array(a.length).fill(0),te=()=>{const U=X.reduce((V,Q)=>V+Q,0)+v,K=Math.min(99,Math.round(U/w*100));this.dispatchEvent("progress",{progress:K})};try{await f(Promise.all(a.map((U,K)=>U.protocol==="sha256-pow"?L(O.run(U.payload.salt,U.payload.target),`sha256-pow worker #${K}`).then(V=>{x[K]={nonce:Number(V)},X[K]=0,v++,te()}):U.protocol==="rsw"?L(O.runMsg({kind:"rsw",N:U.payload.N,x:U.payload.x,t:0|U.payload.t},V=>{X[K]=V,te()}),`rsw worker #${K}`).then(V=>{x[K]={y:V.y},X[K]=0,v++,te()}):j(U.payload.blob).then(V=>{x[K]=V!=null&&V.__timeout?{timeout:!0}:V!=null&&V.__blocked?{blocked:!0}:{instr:V},X[K]=0,v++,te()}))),d)}finally{O.terminate()}return x}async solveChallenges(a,d){const w=a.length;let v=0,x=null;const A=typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function";if(A)try{x=await T()}catch(L){c.warn(u("wasm"),"unavailable, falling back to JS solver:",L.message||L)}if(!A&&(c.warn(u("wasm"),"WebAssembly disabled in this browser, solver will be ~10x slower"),!r(this,F).querySelector(".warning"))){const L=document.createElement("div");L.className="warning",L.style.cssText="width:var(--cap-widget-width,230px);background:rgb(237,56,46);color:white;padding:4px 6px;padding-bottom:calc(var(--cap-border-radius,14px) + 5px);font-size:10px;box-sizing:border-box;font-family:system-ui;border-top-left-radius:8px;border-top-right-radius:8px;text-align:center;user-select:none;margin-bottom:-35.5px;opacity:0;transition:margin-bottom .3s,opacity .3s;",L.innerText=this.getI18nText("wasm-disabled","Enable WASM for significantly faster solving"),r(this,F).insertBefore(L,r(this,F).firstChild),setTimeout(()=>{L.style.marginBottom="calc(-1 * var(--cap-border-radius, 14px))",L.style.opacity=1},10)}const N=new B(r(this,ee));N.setWasm(x),N._ensureSize(r(this,ee));const O=[];try{for(let L=0;L<a.length;L+=r(this,ee)){const X=a.slice(L,Math.min(L+r(this,ee),a.length)),te=await f(Promise.all(X.map(([U,K])=>N.run(U,K).then(V=>{v++;const Q=Math.min(99,Math.round((0+v)/w*100));return this.dispatchEvent("progress",{progress:Q}),V}))),d);O.push(...te)}}finally{N.terminate()}return O}setWorkersCount(a){const d=parseInt(a,10),w=Math.min(navigator.hardwareConcurrency||8,16);W(this,ee,!Number.isNaN(d)&&d>0&&d<=w?d:navigator.hardwareConcurrency||8)}createUI(){r(this,E).classList.add("captcha"),r(this,E).setAttribute("role","group"),r(this,E).setAttribute("aria-label",this.getI18nText("group-aria-label","Cap verification")),W(this,R,document.createElement("div")),r(this,R).className="captcha-trigger",r(this,R).setAttribute("part","trigger"),r(this,R).setAttribute("role","button"),r(this,R).setAttribute("tabindex","0"),r(this,R).setAttribute("aria-label",this.getI18nText("verify-aria-label","Click to verify you're a human")),r(this,R).setAttribute("aria-live","polite"),r(this,R).setAttribute("disabled","true"),r(this,R).innerHTML=`<div class="checkbox" part="checkbox" aria-hidden="true"><svg class="progress-ring" viewBox="0 0 32 32" aria-hidden="true"><circle class="progress-ring-bg" cx="16" cy="16" r="14"></circle><circle class="progress-ring-circle" cx="16" cy="16" r="14"></circle></svg></div><p part="label" class="label-wrapper"><span class="label active">${this.getI18nText("initial-state","Verify you're human")}</span></p>`,r(this,E).appendChild(r(this,R)),W(this,M,document.createElement("a")),r(this,M).className="cap-troubleshoot-link",r(this,M).setAttribute("part","troubleshoot"),r(this,M).setAttribute("target","_blank"),r(this,M).setAttribute("rel","noopener"),r(this,M).hidden=!0,r(this,E).appendChild(r(this,M)),W(this,S,document.createElement("a")),r(this,S).className="credits",r(this,S).setAttribute("aria-label","Secured by Cap"),r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).setAttribute("target","_blank"),r(this,S).setAttribute("title","Secured by Cap: The self-hosted CAPTCHA for the modern web."),r(this,S).textContent="Cap",r(this,E).appendChild(r(this,S)),r(this,F).innerHTML=`<style${window.CAP_CSS_NONCE?` nonce=${window.CAP_CSS_NONCE}`:""}>:host{display:inline-block}@media (prefers-reduced-motion:reduce){.captcha,.captcha *{transition:none!important;animation:none!important}.label{filter:none!important;opacity:1!important;transition:none!important;transform:none!important}.label:not(.active),.label.exit{display:none!important}}.captcha,.captcha *{box-sizing:border-box}.captcha{width:var(--cap-widget-width,260px);height:var(--cap-widget-height,58px);background-color:var(--cap-background,#fdfdfd);border:1px solid var(--cap-border-color,#dddddd8f);border-radius:var(--cap-border-radius,14px);-webkit-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:#fff0;color:var(--cap-color,#212121);font-family:var(--cap-font,system, -apple-system, "BlinkMacSystemFont", ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", "Ubuntu", "arial", sans-serif);transition:filter .2s,transform .2s,height .2s;display:inline-block;position:relative;overflow:hidden}.captcha.has-troubleshoot{height:calc(var(--cap-widget-height,58px) + 26px)}.captcha.has-troubleshoot .captcha-trigger{inset-block-end:26px}.captcha:not([data-state]):active{transform:scale(.97)}.captcha:hover{filter:brightness(98%)}.captcha-trigger{padding:var(--cap-widget-padding,14px);align-items:center;gap:var(--cap-gap,15px);border-radius:inherit;transition:inset .2s;display:flex;position:absolute;inset:0}.captcha-trigger:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:-3px}.checkbox{width:var(--cap-checkbox-size,25px);height:var(--cap-checkbox-size,25px);border:var(--cap-checkbox-border,1px solid #aaaaaad1);border-radius:var(--cap-checkbox-border-radius,6px);background-color:var(--cap-checkbox-background,#fafafa91);margin-top:var(--cap-checkbox-margin,2px);margin-bottom:var(--cap-checkbox-margin,2px);flex-shrink:0;transition:opacity .2s}.captcha p{-webkit-user-select:none;user-select:none;margin:0;font-size:15px;font-weight:500}.label-wrapper{flex:1;align-items:center;min-width:0;height:2em;display:flex;position:relative;overflow:hidden}.label-wrapper:before,.label-wrapper:after{content:"";pointer-events:none;z-index:1;width:100%;height:.6em;position:absolute;inset-inline-start:0}.label-wrapper:before{background:linear-gradient(to bottom, var(--cap-background,#fdfdfd), transparent);top:0}.label-wrapper:after{background:linear-gradient(to top, var(--cap-background,#fdfdfd), transparent);bottom:0}.label{white-space:nowrap;opacity:0;filter:blur(2px);transition:transform .5s cubic-bezier(.25,1,.5,1),opacity .5s,filter .5s;position:absolute;transform:translateY(100%)}.label.active{opacity:1;filter:none;transform:translateY(0)}.label.exit{opacity:0;filter:blur(2px);transform:translateY(-100%)}.checkbox .progress-ring{width:100%;height:100%;display:none;transform:rotate(-90deg)}.checkbox .progress-ring-bg{fill:none;stroke:var(--cap-spinner-background-color,#eee);stroke-width:var(--cap-spinner-thickness,3)}.checkbox .progress-ring-circle{fill:none;stroke:var(--cap-spinner-color,#000);stroke-width:var(--cap-spinner-thickness,3);stroke-linecap:round;stroke-dasharray:87.96;stroke-dashoffset:87.96px;transition:stroke-dashoffset .3s}.captcha[data-state=verifying] .checkbox{background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;display:flex;transform:scale(1.1)}.captcha[data-state=verifying] .checkbox .progress-ring{display:block}.captcha[data-state=done] .checkbox{background-image:var(--cap-checkmark,url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cstyle%3E%40keyframes%20anim%7B0%25%7Bstroke-dashoffset%3A23.21320343017578px%7Dto%7Bstroke-dashoffset%3A0%7D%7D%3C%2Fstyle%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%2300a67d%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m5%2012%205%205L20%207%22%20style%3D%22stroke-dashoffset%3A0%3Bstroke-dasharray%3A23.21320343017578px%3Banimation%3Aanim%20.5s%20ease%22%2F%3E%3C%2Fsvg%3E));background-size:cover;border:1px solid #0000}.captcha[data-state=done] .checkbox .progress-ring{display:none}.captcha[data-state=error] .checkbox{background-image:var(--cap-error-cross,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 24 24'%3E%3Cpath fill='%23f55b50' d='M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8'/%3E%3C%2Fsvg%3E"));background-size:cover;border:1px solid #0000}.captcha[data-state=error] .checkbox .progress-ring{display:none}.captcha.invalid{border-color:var(--cap-invalid-border-color,#f55b50);box-shadow:0 0 0 3px var(--cap-invalid-ring-color,#f55b5033);animation:.5s cubic-bezier(.36,.07,.19,.97) cap-shake}@keyframes cap-shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}@media (prefers-reduced-motion:reduce){.captcha.invalid{animation:none!important}}.captcha-trigger[disabled]{cursor:not-allowed}.captcha[data-state=verifying] .captcha-trigger{cursor:progress}.captcha[data-state=done] .captcha-trigger{cursor:default}.credits{color:var(--cap-color,#212121);text-underline-offset:.18em;z-index:2;border-radius:4px;justify-content:flex-end;align-items:center;min-width:24px;min-height:24px;padding:4px 6px;text-decoration:underline;text-decoration-thickness:.08em;position:absolute;inset-block-end:4px;inset-inline-end:4px;opacity:.8!important;font-size:12px!important;display:inline-flex!important}.captcha .credits{visibility:visible!important;pointer-events:all!important;display:inline-flex!important}.credits:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px;opacity:1!important}.cap-troubleshoot-link{min-width:24px;min-height:24px;color:var(--cap-troubleshoot-color,#0050a0);text-underline-offset:.15em;cursor:pointer;z-index:2;border-radius:4px;align-items:center;padding:4px 6px;font-size:13px;font-weight:500;text-decoration:underline;text-decoration-thickness:.08em;display:inline-flex;position:absolute;inset-block-end:4px;inset-inline-start:14px}.cap-troubleshoot-link[hidden]{display:none}.cap-troubleshoot-link:hover{opacity:.85}.cap-troubleshoot-link:focus-visible{outline:2px solid var(--cap-focus-ring,#06c);outline-offset:2px}@media (forced-colors:active){.captcha,.checkbox{border-color:canvastext}:is(.captcha-trigger:focus-visible,.credits:focus-visible,.cap-troubleshoot-link:focus-visible){outline-color:highlight}.progress-ring-bg{stroke:graytext}.progress-ring-circle{stroke:canvastext}.captcha.invalid{box-shadow:none;border-color:mark}.credits{opacity:1!important}}</style>`,r(this,F).appendChild(r(this,E)),H(this,C,Xe).call(this),setTimeout(()=>H(this,C,Xe).call(this),100)}addEventListeners(){r(this,R)&&(r(this,S).addEventListener("click",a=>{a.preventDefault(),window.open(`https://trycap.dev/?${new URLSearchParams({utm_source:"cap_widget",utm_medium:"referral",utm_campaign:"widget",utm_content:window.CAP_DISABLE_WIDGET_REF?"":location.hostname,ref:window.CAP_DISABLE_WIDGET_REF?"":location.href||"",sub:window.CAP_DISABLE_WIDGET_REF?"":document.referrer||""}).toString()}`,"_blank")}),r(this,R).addEventListener("click",()=>{r(this,R).hasAttribute("disabled")||this.solve()}),r(this,R).addEventListener("mousedown",()=>{!r(this,R).hasAttribute("disabled")&&r(this,C,Se)&&navigator.vibrate(5)}),r(this,R).addEventListener("keydown",a=>{a.target===r(this,R)&&(a.key!=="Enter"&&a.key!==" "||r(this,R).hasAttribute("disabled")||(a.preventDefault(),a.stopPropagation(),this.solve()))}),this.addEventListener("progress",this.boundHandleProgress),this.addEventListener("solve",this.boundHandleSolve),this.addEventListener("error",this.boundHandleError),this.addEventListener("reset",this.boundHandleReset))}animateLabel(a){var x;if(!r(this,R))return;const d=r(this,R).querySelector(".label-wrapper");if(!d)return;if((x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches){const A=d.querySelector(".label.active");if(A)A.textContent=a;else{const N=document.createElement("span");N.className="label active",N.textContent=a,d.appendChild(N)}return}const w=d.querySelector(".label.active"),v=document.createElement("span");v.className="label",v.textContent=a,d.appendChild(v),v.offsetWidth,v.classList.add("active"),w&&(w.classList.remove("active"),w.classList.add("exit"),w.addEventListener("transitionend",()=>w.remove(),{once:!0}))}updateUI(a,d,w=!1){r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state",a),r(this,E).classList.remove("has-troubleshoot"),this.animateLabel(d),r(this,M)&&(r(this,M).hidden=!0),w?r(this,R).setAttribute("disabled","true"):r(this,R).removeAttribute("disabled"))}updateUIBlocked(a,d=!1){if(r(this,E)&&r(this,R)&&(r(this,E).setAttribute("data-state","error"),r(this,R).removeAttribute("disabled"),this.animateLabel(a),r(this,M)))if(d){const w=this.getAttribute("data-cap-troubleshooting-url")||"https://trycap.dev/guide/troubleshooting/instrumentation.html";r(this,M).setAttribute("href",w),r(this,M).textContent=this.getI18nText("troubleshooting-label","Troubleshoot"),r(this,M).hidden=!1,r(this,E).classList.add("has-troubleshoot")}else r(this,M).hidden=!0,r(this,E).classList.remove("has-troubleshoot")}handleProgress(a){if(!r(this,R))return;const d=r(this,R).querySelector(".progress-ring-circle");if(d){const v=2*Math.PI*14,x=v-a.detail.progress/100*v;d.style.strokeDashoffset=x}const w=r(this,R).querySelector(".label-wrapper");if(w){const v=w.querySelector(".label.active");v&&(v.textContent=`${this.getI18nText("verifying-label","Verifying...")}`)}this.executeAttributeCode("onprogress",a)}handleSolve(a){var d,w,v;this.updateUI("done",this.getI18nText("solved-label","You're a human"),!0),this.executeAttributeCode("onsolve",a),(w=(d=r(this,le))==null?void 0:d.setValidity)==null||w.call(d,{}),(v=r(this,E))==null||v.classList.remove("invalid")}handleError(a){this.updateUI("error",this.getI18nText("error-label","Error. Try again.")),this.executeAttributeCode("onerror",a),r(this,C,Se)&&navigator.vibrate([10,40,10])}handleReset(a){this.updateUI("",this.getI18nText("initial-state","I'm a human")),this.executeAttributeCode("onreset",a),H(this,C,Ye).call(this)}executeAttributeCode(a,d){const w=this.getAttribute(a);w&&(c.warn(u(),"inline `onxxx='…'` handlers are deprecated. use `addEventListener` callbacks instead."),new Function("event",w).call(this,d))}error(a="Unknown error",d="unknown"){c.error(u("solve"),`[${d}] ${a}`),this.dispatchEvent("error",{isCap:!0,code:d,message:a})}dispatchEvent(a,d={}){const w=new CustomEvent(a,{bubbles:!0,composed:!0,detail:d});super.dispatchEvent(w)}reset(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),this.token=null,this.dispatchEvent("reset"),H(this,C,Je).call(this,"")}get tokenValue(){return this.token}disconnectedCallback(){var a;(a=r(this,me))==null||a.abort(),this.removeEventListener("progress",this.boundHandleProgress),this.removeEventListener("solve",this.boundHandleSolve),this.removeEventListener("error",this.boundHandleError),this.removeEventListener("reset",this.boundHandleReset),r(this,re).forEach((d,w)=>{this.removeEventListener(w.slice(2),d)}),r(this,re).clear(),r(this,F)&&(r(this,F).innerHTML=""),this.reset(),this.cleanup()}cleanup(){r(this,q)&&(clearTimeout(r(this,q)),W(this,q,null)),H(this,C,Ge).call(this),r(this,ue)&&(clearTimeout(r(this,ue)),W(this,ue,null)),r(this,ie)&&(r(this,ie).terminate(),W(this,ie,null)),r(this,p)&&(r(this,p).state="error",r(this,p).notify(),W(this,p,null))}}q=new WeakMap,ee=new WeakMap,F=new WeakMap,E=new WeakMap,R=new WeakMap,S=new WeakMap,M=new WeakMap,z=new WeakMap,oe=new WeakMap,re=new WeakMap,le=new WeakMap,p=new WeakMap,ue=new WeakMap,ie=new WeakMap,de=new WeakMap,he=new WeakMap,me=new WeakMap,C=new WeakSet,Se=function(){return s&&!window.CAP_DISABLE_HAPTICS&&!this.hasAttribute("data-cap-disable-haptics")},wt=function(){return{state:"idle",challengeResp:null,challenges:null,results:[],completedCount:0,solvePromise:null,promoteFn:null,_listeners:[],pendingPromotion:null,token:null,tokenExpires:null,notify(){for(const a of this._listeners)a();this._listeners=[]},onSettled(a){this.state==="done"||this.state==="error"?a():this._listeners.push(a)}}},vt=function(){W(this,p,H(this,C,wt).call(this)),H(this,C,yt).call(this)},Ge=function(){r(this,de)&&(window.removeEventListener("mousemove",r(this,de)),window.removeEventListener("touchstart",r(this,de)),window.removeEventListener("keydown",r(this,de)),W(this,de,null))},yt=function(){H(this,C,Ge).call(this);const a=()=>{H(this,C,Ge).call(this),H(this,C,Dn).call(this)};W(this,de,a),window.addEventListener("mousemove",a,{passive:!0}),window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("keydown",a,{passive:!0})},xt=function(){return typeof this.checkVisibility=="function"?this.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!!(this.offsetParent||this.getClientRects().length>0)},kt=function(){H(this,C,xt).call(this)||c.info(u("challenges"),"solved invisible challenge")},Dn=function(){r(this,p).state==="idle"&&H(this,C,xt).call(this)&&(r(this,p).state="waiting",W(this,ue,setTimeout(()=>{H(this,C,jt).call(this)},2500)))},jt=async function(){var d;if(r(this,p).state!=="waiting")return;r(this,p).state="fetching",r(this,p)._t0=performance.now();let a=this.getAttribute("data-cap-api-endpoint");if(!a&&(window!=null&&window.CAP_CUSTOM_FETCH)&&(a="/"),a){a.endsWith("/")||(a+="/");try{const w=await b(`${a}challenge`,{method:"POST",signal:(d=r(this,me))==null?void 0:d.signal});let v;try{v=await w.json()}catch{throw new Error("Failed to parse speculative challenge response")}if(v.error)throw new Error(v.error);if(!r(this,p))return;if(v._apiEndpoint=a,r(this,p).challengeResp=v,v.format===2&&Array.isArray(v.challenges))return r(this,p).state="idle",void r(this,p).notify();const{challenge:x,token:A}=v;let N=x;if(!Array.isArray(N)){let O=0;N=Array.from({length:x.c},()=>(O++,[P(`${A}${O}`,x.s),P(`${A}${O}d`,x.d)]))}r(this,p).challenges=N,r(this,p).state="solving",r(this,p).solvePromise=H(this,C,Fn).call(this,N)}catch{if(!r(this,p))return;r(this,p).state="error",r(this,p).notify()}}else r(this,p).state="idle"},Fn=async function(a){ne();let d=null;try{d=await T()}catch{}r(this,ie)||(W(this,ie,new B(1)),r(this,ie)._spawn()),r(this,ie).setWasm(d);const w=a.length,v=new Array(w);let x=1,A=!1;r(this,p).promoteFn=O=>{A||(A=!0,x=O,r(this,ie)._size=O,r(this,ie)._ensureSize(O))},r(this,p).pendingPromotion!==null&&(r(this,p).promoteFn(r(this,p).pendingPromotion),r(this,p).pendingPromotion=null);let N=0;for(;N<w;){const O=x,L=[],X=[];for(let U=0;U<O&&N<w;U++)X.push(N),L.push(a[N]),N++;r(this,ie)._ensureSize(Math.max(x,O));const te=await Promise.all(L.map(U=>r(this,ie).run(U[0],U[1]).then(K=>(r(this,p)&&r(this,p).completedCount++,K))));for(let U=0;U<X.length;U++)v[X[U]]=te[U];!A&&N<w&&await new Promise(U=>setTimeout(U,120))}return r(this,p)&&(r(this,p).results=v,r(this,p).state="redeeming",H(this,C,On).call(this,v)),v},On=async function(a){var d;try{if(!r(this,p))return;const w=r(this,p).challengeResp,v=w._apiEndpoint;if(!v)throw m("missing_endpoint","speculative redeem: missing apiEndpoint");let x=null;if(w.instrumentation){if(x=await j(w.instrumentation),!r(this,p))return;if(x!=null&&x.__timeout||x!=null&&x.__blocked)return r(this,p).state="done",void r(this,p).notify()}const A=await b(`${v}redeem`,{method:"POST",body:JSON.stringify({token:w.token,solutions:a,...x&&{instr:x}}),headers:{"Content-Type":"application/json"},signal:(d=r(this,me))==null?void 0:d.signal});let N;try{N=await A.json()}catch{throw new Error("Failed to parse speculative redeem response")}if(!r(this,p))return;if(!N.success)throw new Error(N.error||"Speculative redeem failed");r(this,p).token=N.token,r(this,p).tokenExpires=new Date(N.expires).getTime(),r(this,p).state="done",r(this,p)._invisibleElapsed=r(this,p)._t0?h(r(this,p)._t0):"?",r(this,p).notify()}catch{if(!r(this,p))return;r(this,p).state="done",r(this,p).notify()}},Et=function(){return this.getAttribute("data-cap-hidden-field-name")||"cap-token"},Je=function(a){const d=this.querySelector(`input[name='${r(this,C,Et)}']`);d&&(d.value=a)},Ct=function(){c.debug(u("solve"),`served from speculative cache (saved ${r(this,p)._invisibleElapsed||"?"})`),this.dispatchEvent("progress",{progress:100}),H(this,C,Je).call(this,r(this,p).token),this.dispatchEvent("solve",{token:r(this,p).token}),this.token=r(this,p).token;const a=r(this,p).tokenExpires-Date.now();return r(this,q)&&clearTimeout(r(this,q)),W(this,q,setTimeout(()=>this.reset(),a)),r(this,R).setAttribute("aria-label",this.getI18nText("verified-aria-label","We have verified you're a human, you may now continue")),r(this,C,Se)&&navigator.vibrate([10,50,20,30,40]),H(this,C,kt).call(this),H(this,C,vt).call(this),W(this,oe,!1),{success:!0,token:this.token}},Un=function(){W(this,he,(function(a){const d=a?[a]:navigator.languages||[navigator.language||""];for(let w of d){if(!w)continue;if(w=w.toLowerCase(),w==="en"||w.startsWith("en-"))return null;const v=y[w]?w:y[w.split("-")[0]]?w.split("-")[0]:null;if(!v)return null;const x=y[v].split("/"),A={};return g.forEach((N,O)=>{A[N]=x[O]}),A}return null})(window.CAP_LANG||this.getAttribute("data-cap-lang")))},Ye=function(){var a;(a=r(this,le))!=null&&a.setValidity&&(this.hasAttribute("required")&&!this.token?r(this,le).setValidity({valueMissing:!0},this.getI18nText("required-label","Please verify you're human"),r(this,E)||this):r(this,le).setValidity({}))},Be=new WeakMap,$n=function(){if(!r(this,z))return!1;const a=r(this,z).getBoundingClientRect();if(a.width===0&&a.height===0)return!0;const d=window.getComputedStyle(r(this,z));return d.display==="none"||d.visibility==="hidden"},Xe=function(){r(this,S)&&r(this,E)&&!H(this,C,$n).call(this)&&(r(this,S).isConnected&&r(this,S).parentNode===r(this,E)||r(this,E).appendChild(r(this,S)),r(this,S).textContent&&r(this,S).textContent.trim()||(r(this,S).textContent="Cap"),r(this,S).getAttribute("href")!=="https://trycap.dev"&&r(this,S).setAttribute("href","https://trycap.dev"),r(this,S).style.cssText=["display: inline-flex !important","visibility: visible !important","opacity: 0.8 !important","pointer-events: all !important","font-size: 12px !important","transform: none !important","clip-path: none !important","filter: none !important","position: absolute !important"].join("; "))},ke($,"formAssociated",!0);class Y{constructor(_={},a){const d=a||document.createElement("cap-widget");if(Object.entries(_).forEach(([w,v])=>{d.setAttribute(w,v)}),!_.apiEndpoint&&!(window!=null&&window.CAP_CUSTOM_FETCH))throw d.remove(),new Error("Missing API endpoint. Either custom fetch or an API endpoint must be provided.");_.apiEndpoint&&d.setAttribute("data-cap-api-endpoint",_.apiEndpoint),a||d.hasAttribute("data-cap-disable-haptics")||d.setAttribute("data-cap-disable-haptics",""),this.widget=d,this.solve=this.widget.solve.bind(this.widget),this.reset=this.widget.reset.bind(this.widget),this.addEventListener=this.widget.addEventListener.bind(this.widget),Object.defineProperty(this,"token",{get:()=>d.token,configurable:!0,enumerable:!0}),a||(d.style.display="none",document.documentElement.appendChild(d))}}window.Cap=Y,customElements.get("cap-widget")||window!=null&&window.CAP_DONT_SKIP_REDEFINE?customElements.get("cap-widget")&&c.warn(u(),"cap-widget custom element already defined, skipping re-define. set window.CAP_DONT_SKIP_REDEFINE = true to override"):customElements.define("cap-widget",$),e.exports=Y,t.default=Y})()})(ze,ze.exports)),ze.exports}kr();function sn(e=Oe("/api/account/cap/")){return new Promise((t,s)=>{const i=document.createElement("div");i.className="cap-overlay";const o=document.createElement("div");o.className="cap-overlay-panel";const c=document.createElement("div");c.className="cap-overlay-title",c.textContent="Verify you're human";const u=document.createElement("cap-widget");u.setAttribute("data-cap-api-endpoint",e);const h=document.createElement("button");h.type="button",h.className="cap-overlay-cancel",h.textContent="Cancel";let m=!1;const b=()=>{m=!0,i.remove()},f=()=>{m||(b(),s(new Error("captcha-failed")))};u.addEventListener("solve",g=>{var P;const y=(P=g.detail)==null?void 0:P.token;b(),y?t(y):s(new Error("captcha-failed"))}),u.addEventListener("error",f),h.addEventListener("click",f),i.addEventListener("mousedown",g=>{g.target===i&&f()}),o.append(c,u,h),i.append(o),rr().append(i)})}const jr=2e3,Bn=l.createContext(null);function Er(){const[e,t]=l.useState({status:"loading"}),[s,i]=l.useState(null),[o,c]=l.useState(!1),[u,h]=l.useState(!1),[m,b]=l.useState(null),[f,g]=l.useState(!1),y=l.useMemo(()=>vr(),[]),P=l.useRef(null),k=l.useCallback(async()=>{try{const S=await y.billingStatus();b(S),h(S.active)}catch{b(null)}finally{g(!0)}},[y]),j=l.useCallback(async()=>{try{await y.putSync(yr())}catch{}},[y]),I=l.useCallback(async()=>{try{const{data:S}=await y.getSync();S?xr(S):await j()}catch{}},[y,j]),T=l.useCallback(async(S,M)=>{t({status:"signed-in",user:S}),h(M),await I()},[I]);l.useEffect(()=>{let S=!1;return y.me().then(async({user:M,active:z})=>{S||await T(M,z)}).catch(()=>{S||(t({status:"signed-out"}),g(!0))}),()=>{S=!0}},[y,T]),l.useEffect(()=>{if(e.status==="signed-in"){g(!1),k();return}b(null),h(!1)},[e.status,k]),l.useEffect(()=>()=>{P.current&&window.clearTimeout(P.current)},[]);const J=(S,M)=>S instanceof Error&&S.message==="captcha-failed"?"Captcha failed. Please try again.":S instanceof gt?S.message:M,ne=l.useCallback(async(S,M)=>{c(!0),i(null);try{const{user:z,active:oe}=await y.login(S,M,await sn(Oe("/api/account/cap/")));return await T(z,oe),{ok:!0}}catch(z){return z instanceof gt&&z.code==="needs_password"?{ok:!1,needsPassword:!0}:(i(J(z,"Couldn't sign in.")),{ok:!1})}finally{c(!1)}},[y,T]),B=l.useCallback(async(S,M)=>{c(!0),i(null);try{const z=await sn(Oe("/api/account/cap/"));return M==="reset"?await y.requestReset(S,z):await y.requestSetPassword(S,z),!0}catch(z){return i(J(z,"Couldn't send a code.")),!1}finally{c(!1)}},[y]),$=l.useCallback(async(S,M,z,oe)=>{c(!0),i(null);try{const{user:re,active:le}=oe==="reset"?await y.reset(S,M,z):await y.setPassword(S,M,z);return await T(re,le),!0}catch(re){return i(J(re,"Couldn't verify the code.")),!1}finally{c(!1)}},[y,T]),Y=l.useCallback(async()=>{try{await y.logout()}catch{}t({status:"signed-out"})},[y]),q=l.useCallback(()=>{e.status==="signed-in"&&(P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>void j(),jr))},[e.status,j]),ee=l.useCallback(async S=>{try{const{url:M}=await y.checkout(S,Kt());window.location.href=M}catch(M){i(J(M,"Couldn't start checkout."))}},[y]),F=l.useCallback(async()=>{try{const{url:S}=await y.billingPortal(Kt());window.location.href=S}catch(S){i(J(S,"Couldn't open billing."))}},[y]),E=l.useCallback(async S=>{try{const M=await y.verifyCheckout(S);if(M.active){h(!0),await k();try{const{user:z,active:oe}=await y.me();t({status:"signed-in",user:z}),h(oe)}catch{}}return M}catch{return null}},[y,k]),R=l.useCallback(async S=>{c(!0),i(null);try{const{user:M,active:z}=await y.setDiscord(S);return t({status:"signed-in",user:M}),h(z),!0}catch(M){return i(J(M,"Couldn't save Discord.")),!1}finally{c(!1)}},[y]);return{status:e.status,user:e.status==="signed-in"?e.user:null,busy:o,authError:s,clearError:()=>i(null),billing:m,isPlus:u,entitlementReady:f,signIn:ne,sendCode:B,submitCode:$,logout:Y,scheduleSync:q,checkout:ee,manageBilling:F,verifyReturn:E,refreshBilling:k,setDiscord:R}}function Cr({children:e}){const t=Er();return n.jsx(Bn.Provider,{value:t,children:e})}function qn(){const e=l.useContext(Bn);if(!e)throw new Error("useAccount requires AccountProvider");return e}const Ar=2500,Sr=200;function zn(e){const t=window;let s=!1,i=0,o=0,c=0,u=0;const h=()=>{s||e()},m=()=>{if(t.requestIdleCallback){c=t.requestIdleCallback(h,{timeout:Ar});return}u=window.setTimeout(h,Sr)},b=()=>{i=window.requestAnimationFrame(()=>{o=window.requestAnimationFrame(m)})};return document.readyState==="complete"?b():window.addEventListener("load",b,{once:!0}),()=>{s=!0,window.removeEventListener("load",b),window.cancelAnimationFrame(i),window.cancelAnimationFrame(o),c&&t.cancelIdleCallback&&t.cancelIdleCallback(c),window.clearTimeout(u)}}const _r="//rv.curbingspider.com/rS4UwuG85t7WA/147093",Nr="//hj.doebirddrowner.com/sUWrzqOhnYv92MH6/147094",ve=new Map;let Ne=!1,At=!1,St=!1,Ee=null;function Tr(e){return new URLSearchParams(e).has("skip")}function Wn(){St||(St=!0,window.location.reload())}function rn(e,t){if(ve.has(e))return;const s=document.createElement("script");ve.set(e,s),s.dataset.cfasync="false",s.src=t,s.dataset.ext=t,s.async=!0,s.type="text/javascript",s.addEventListener("load",()=>{if(ve.get(e)!==s){Wn();return}if(At=!0,!Ne||!De()){Hn();return}},{once:!0}),s.addEventListener("error",()=>{s.remove(),ve.get(e)===s&&ve.delete(e)},{once:!0}),(document.head??document.documentElement).appendChild(s)}function Hn(){Ee==null||Ee(),Ee=null,Ne=!1;for(const t of ve.values())t.remove();ve.clear();const e=At;At=!1,e&&Wn()}function De(){return window.location.hostname!=="localhost"}function Pr(){const e=window.location.hostname!=="IGNITE OSon.top";!De()||Ee||Ne&&ve.size===(e?2:1)||(Ne||(St=!1),Ne=!0,Ee=zn(()=>{Ee=null,Ne&&(rn("pop",new URL(_r,document.baseURI).href),e&&rn("social",new URL(Nr,document.baseURI).href))}))}function Lr(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e)?e:"#ffffff";document.documentElement.style.setProperty("--accent",t)}const Ir=l.lazy(()=>Ae(()=>import("./DarkVeil-CC-BBhGo-8068ec8f.js"),__vite__mapDeps([4,2,5]),import.meta.url));function Rr(e){const[t,s]=l.useState(!1);return l.useEffect(()=>zn(()=>s(!0)),[]),t?n.jsx(l.Suspense,{fallback:null,children:n.jsx(Ir,{...e})}):null}const Mr=l.lazy(()=>Ae(()=>import("./AiPage-CbTtOj3W-8068ec8f.js"),__vite__mapDeps([6,2,7,8,9,3,10]),import.meta.url).then(e=>({default:e.AiPage}))),Dr=l.lazy(()=>Ae(()=>import("./GamesPage-D-HV0rpM-8068ec8f.js"),__vite__mapDeps([11,2,3,12]),import.meta.url).then(e=>({default:e.GamesPage}))),Fr=l.lazy(()=>Ae(()=>import("./SettingsPage-CsV-N8Y0-8068ec8f.js"),__vite__mapDeps([13,2,3,14]),import.meta.url).then(e=>({default:e.SettingsPage}))),Or=l.lazy(()=>Ae(()=>import("./AccountPage-DmlYaBSE-8068ec8f.js"),__vite__mapDeps([15,2,3,14,16]),import.meta.url).then(e=>({default:e.AccountPage}))),Ur=l.lazy(()=>Ae(()=>import("./PlusPage-DBE836ej-8068ec8f.js"),__vite__mapDeps([17,2,3,18,16,14]),import.meta.url).then(e=>({default:e.PlusPage})));function $r(){const{tabs:e,activeId:t,activeTab:s,open:i,openInternal:o,openUrl:c,close:u,activate:h,patch:m,reorder:b}=Hs(),{settings:f,update:g}=ur(),{controller:y}=hr(f.adblock),P=Vs(),k=Gs(),j=qn(),I=(s==null?void 0:s.url)??"",T=be(I),J=l.useRef(!1),[ne]=l.useState(()=>Tr(window.location.search)),[B,$]=l.useState(()=>tt("_gs5mofn.collapsed",!1)),Y=l.useRef(!1),[q,ee]=l.useState(!1),[F,E]=l.useState(!1),[R,S]=l.useState(()=>De()&&!ne&&ge("ads.notice")!=="seen"),[M,z]=l.useState(null),[oe,re]=l.useState(!1),le=l.useRef(!1),p=l.useRef(null);l.useEffect(()=>{!ne||!De()||we("ads.notice","seen")},[ne]),l.useEffect(()=>{j.isPlus&&(S(!1),z(null),re(!1))},[j.isPlus]),l.useEffect(()=>{j.status==="loading"||j.isPlus||R||M||le.current||(le.current=!0,re(!0))},[j.status,j.isPlus,R,M]),l.useEffect(()=>{if(!(j.status==="loading"||!j.entitlementReady)){if(j.isPlus||!De()){Hn(),J.current=!1;return}J.current||R||ge("ads.notice")==="seen"&&(J.current=!0,Pr())}},[j.status,j.entitlementReady,j.isPlus,R,T]),l.useEffect(()=>{pr(y,j.scheduleSync)},[y,j.scheduleSync]),l.useEffect(()=>{j.scheduleSync()},[P.bookmarks,f,k.id,j.scheduleSync]),l.useEffect(()=>Lr(f.accent),[f.accent]),or(f);const ue=l.useCallback(()=>{we("ads.notice","seen"),S(!1)},[]),ie=l.useCallback((D,ae)=>m(D,{url:ae}),[m]),de=l.useCallback((D,ae)=>m(D,{title:ae}),[m]),he=l.useCallback((D,ae)=>{var Wt;const $e=tn(ae,Zt(f.searchEngineId));$e&&(m(D,{url:$e,title:$e}),(Wt=p.current)==null||Wt.goTo(D,$e))},[m,f.searchEngineId]),me=()=>{ye("tabs"),ye("bookmarks"),ye("settings"),location.reload()},C=l.useCallback(D=>o(xs(D),ys[D]),[o]),st=!1,rt=!I,it=!!I&&!T,qt=rt?"":I;l.useEffect(()=>{},[C]),l.useEffect(()=>{},[T]);const zt=l.useRef(T);l.useEffect(()=>{!Y.current&&T==="ai"&&zt.current!==T&&$(!0),zt.current=T},[T]);const Vn=l.useCallback(()=>{Y.current=!0,$(D=>{const ae=!D;return nt("_gs5mofn.collapsed",ae),ae})},[]);return dr({onNewTab:i,onCloseTab:()=>u(t),onSpotlight:()=>E(D=>!D),onJumpToTab:D=>{const ae=D===9?e[e.length-1]:e[D-1];ae&&h(ae.id)}}),n.jsxs("div",{className:`_9gmixa5 ${it?"_z51tprw":""}`,children:[n.jsx("div",{className:f.backgroundMode==="mesh"?"_v4jfozk mesh":"_v4jfozk","aria-hidden":!0,children:(f.backgroundMode==="full"||f.backgroundMode==="reduced")&&!it&&n.jsx(Rr,{speed:f.backgroundMode==="reduced"?1.2:2.1,warpAmount:1.1,scanlineFrequency:.5,resolutionScale:f.backgroundMode==="reduced"?.45:1})}),n.jsx("div",{className:"_rx2al0e","aria-hidden":!0}),n.jsx(ks,{tabs:e,activeId:t,activeUrl:qt,bookmarks:P.bookmarks,disabled:st,collapsed:B,onSelect:h,onNew:i,onClose:u,onReorder:b,onNavigate:D=>he(t,D),onOpenBookmark:D=>he(t,D),onAddBookmark:()=>ee(!0),onRemoveBookmark:P.remove,onToggleCollapse:Vn,onOpenAi:()=>C("ai"),onOpenGames:()=>C("games"),onOpenSettings:()=>C("settings"),onOpenAccount:()=>C("account"),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()}}),n.jsxs("main",{className:"content",children:[(it||T)&&n.jsx(Cs,{url:qt,disabled:st,collapsed:B,internal:!!T,bookmarked:P.has(I),onNavigate:D=>he(t,D),onBack:()=>{var D;return(D=p.current)==null?void 0:D.back()},onForward:()=>{var D;return(D=p.current)==null?void 0:D.forward()},onReload:()=>{var D;return(D=p.current)==null?void 0:D.reload()},onToggleBookmark:()=>P.toggleForUrl(I,s==null?void 0:s.title)}),n.jsxs("div",{className:"_vcmyz3z",children:[n.jsx(Ms,{ref:p,controller:y,tabs:e,activeId:t,onUrl:ie,onTitle:de}),rt&&n.jsx(Ds,{disabled:st,onNavigate:D=>he(t,D)}),n.jsxs(l.Suspense,{fallback:null,children:[T==="ai"&&n.jsx(Mr,{account:j,onOpenAccount:()=>C("account")}),T==="games"&&n.jsx(Dr,{controller:y,onOpenUrl:D=>{const ae=tn(D,Zt(f.searchEngineId));ae&&c(ae,ae)}}),T==="settings"&&n.jsx(Fr,{settings:f,onUpdate:g,onClearData:me,showPlusCta:!j.isPlus&&j.status!=="loading",onUpgradePlus:()=>z("settings")}),T==="account"&&n.jsx(Or,{account:j}),T==="plus"&&n.jsx(Ur,{account:j,onOpenAccount:()=>C("account")})]})]})]}),n.jsx(Fs,{open:q,onClose:()=>ee(!1),onSubmit:P.add}),n.jsx(Os,{open:R&&!M,onAccept:ue,onUpgrade:()=>z("ads")}),n.jsx(Us,{open:oe&&!R&&!M&&!j.isPlus,onClose:()=>re(!1),onUpgrade:()=>{re(!1),z("settings")}}),n.jsx(Bs,{open:M!==null,onClose:()=>z(null),account:j,heading:M==="ads"?"Go ad-free with IGNITE OS Plus":"IGNITE OS Plus",blurb:M==="ads"?"IGNITE OS Plus removes ads entirely, plus 3M tokens/day and exclusive links.":"Remove ads, unlock 3M tokens/day, and get exclusive links.",onSignUp:()=>{z(null),C("account")}}),n.jsx($s,{open:F,onClose:()=>E(!1),onSubmit:D=>he(t,D)}),rt&&n.jsx(As,{})]})}const Br={login:"Welcome back",setup:"Activate your account",reset:"Reset password"};function qr({account:e,brand:t,loginTagline:s,onSubscribe:i,claim:o}){const[c,u]=l.useState("login"),[h,m]=l.useState("form"),[b,f]=l.useState((o==null?void 0:o.email)??""),[g,y]=l.useState(""),[P,k]=l.useState(""),[j,I]=l.useState(null),[T,J]=l.useState(0);l.useEffect(()=>{o&&(f(o.email),o.needsPassword?(u("setup"),m("code"),I("Payment confirmed — enter the code we emailed to set your password."),e.sendCode(o.email,"set-password"),J(30)):(u("login"),I("Payment confirmed — sign in to continue.")))},[o]),l.useEffect(()=>{if(T<=0)return;const E=window.setTimeout(()=>J(R=>R-1),1e3);return()=>window.clearTimeout(E)},[T]);const ne=E=>{e.clearError(),u(E),m("form"),y(""),k(""),I(null),J(0)},B=e.busy,$=async()=>{(await e.signIn(b,g)).needsPassword&&(u("setup"),m("form"),I("Finish activating your account by setting a password."))},Y=async()=>{const E=c==="reset"?"reset":"set-password";await e.sendCode(b,E)&&(m("code"),I(null),J(30))},q=()=>e.submitCode(b,P,g,c==="reset"?"reset":"set-password"),ee=async()=>{await e.sendCode(b,c==="reset"?"reset":"set-password")&&(I("New code sent. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver."),J(30))},F=h==="code"?"Enter the 6-digit code we emailed you. If you don't receive anything, check your spam — if you used a school email, our mail might not deliver.":c==="login"?s??"Sign in to continue.":c==="setup"?"Enter your email and choose a password to get started.":"Enter your email and a new password — we'll email you a code to confirm.";return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"_xdv7bcm",children:[t,n.jsx("h1",{children:Br[c]}),n.jsx("p",{className:"account-auth-auth-sub",children:F})]}),n.jsxs("div",{className:"account-auth-auth-form",children:[j&&n.jsx("div",{className:"account-auth-auth-ok",children:j}),e.authError&&n.jsx("div",{className:"account-auth-error",children:e.authError}),c==="login"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"Password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"current-password",disabled:B,onKeyDown:E=>E.key==="Enter"&&void $()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void $(),children:B?"Please wait…":"Sign in"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("reset"),children:"Forgot password?"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("setup"),children:"First time? Activate"})]}),i&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"account-auth-btn account-auth-auth-primary",disabled:B,onClick:()=>i(b),children:"Subscribe to IGNITE OS Plus"}),n.jsx(Tn,{})]})]}),c!=="login"&&h==="form"&&n.jsxs(n.Fragment,{children:[n.jsxs("label",{children:[n.jsx("span",{children:"Email"}),n.jsx("input",{type:"email",placeholder:"you@example.com",value:b,onChange:E=>f(E.target.value),autoComplete:"email",disabled:B})]}),c==="reset"&&n.jsxs("label",{children:[n.jsx("span",{children:"New password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),c==="setup"&&n.jsxs("label",{children:[n.jsx("span",{children:"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||!b.trim()||g.length<8,onClick:()=>void Y(),children:B?"Please wait…":"Send code"}),n.jsx("div",{className:"account-auth-auth-alt",children:n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})})]}),c!=="login"&&h==="code"&&n.jsxs(n.Fragment,{children:[g.length===0&&n.jsxs("label",{children:[n.jsx("span",{children:c==="reset"?"New password":"Choose a password"}),n.jsx("input",{type:"password",value:g,onChange:E=>y(E.target.value),autoComplete:"new-password",disabled:B})]}),n.jsxs("label",{children:[n.jsx("span",{children:"6-digit code"}),n.jsx("input",{inputMode:"numeric",autoComplete:"one-time-code",placeholder:"000000",maxLength:6,value:P,onChange:E=>k(E.target.value.replace(/\D/g,"").slice(0,6)),disabled:B,autoFocus:!0,onKeyDown:E=>E.key==="Enter"&&void q()})]}),n.jsx("button",{type:"button",className:"account-auth-btn primary account-auth-auth-primary",disabled:B||P.length!==6||g.length<8,onClick:()=>void q(),children:B?"Please wait…":c==="reset"?"Reset password":"Activate account"}),n.jsxs("div",{className:"account-auth-auth-alt",children:[n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B||T>0,onClick:()=>void ee(),children:T>0?`Resend in ${T}s`:"Resend code"}),n.jsx("span",{className:"account-auth-auth-dot",children:"·"}),n.jsx("button",{type:"button",className:"account-auth-auth-link",disabled:B,onClick:()=>ne("login"),children:"Back to sign in"})]})]})]})]})}function zr(){const e=qn(),[t,s]=l.useState("idle"),[i,o]=l.useState(null),[c,u]=l.useState(!1),h=l.useRef(e.verifyReturn);h.current=e.verifyReturn;const m=l.useRef(!1);if(l.useEffect(()=>{if(m.current)return;m.current=!0;const f=new URLSearchParams(window.location.search),g=f.get("checkout");if(g!=="success"&&g!=="cancel"||(Qn(window.location.pathname),g!=="success"))return;const y=f.get("session_id");y&&(s("checking"),h.current(y).then(P=>{P!=null&&P.email?(o({email:P.email,needsPassword:P.needsPassword}),u(!0)):s("error")}))},[]),l.useEffect(()=>{!c||t!=="checking"||e.status==="loading"||s(e.status==="signed-in"?"done":"claim")},[c,t,e.status]),l.useEffect(()=>{t==="claim"&&e.status==="signed-in"&&s("done")},[t,e.status]),t==="idle")return null;const b=()=>s("idle");return n.jsx("div",{className:"_t97drno",onClick:t==="checking"?void 0:b,children:n.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[t==="checking"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"IGNITE OS+"}),n.jsx("p",{style:{margin:0,fontSize:13,color:"var(--muted)"},children:"Confirming your subscription…"})]}),t==="claim"&&i&&n.jsx(qr,{account:e,claim:i,brand:n.jsx("div",{className:"modal-title",children:"IGNITE OS+"})}),t==="done"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"You're on Plus"}),n.jsxs("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:[i!=null&&i.email?`${i.email} is subscribed.`:"Your subscription is active."," Your Plus perks are unlocked."]}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:b,children:"Continue"})})]}),t==="error"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"modal-title",children:"Couldn't confirm payment"}),n.jsx("p",{style:{margin:"0 0 0.9rem",fontSize:13,color:"var(--muted)"},children:"We couldn't confirm your checkout. If you were charged, reach out on Discord and we'll sort it out."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn ghost",onClick:b,children:"Close"})})]})]})})}class Wr extends l.Component{constructor(){super(...arguments);ke(this,"state",{error:null,info:null});ke(this,"reset",()=>this.setState({error:null,info:null}))}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,i){this.setState({info:i})}render(){const{error:s,info:i}=this.state;if(!s)return this.props.children;const o=!1;return n.jsx("div",{className:"fixed inset-0 flex items-center justify-center overflow-auto bg-bg p-8 text-text",children:n.jsxs("div",{className:"w-[min(560px,100%)] rounded-[var(--radius)] border border-border bg-surface p-6 backdrop-blur-xl",children:[n.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[color-mix(in_srgb,#ff6b6b_45%,var(--border-2))] bg-[color-mix(in_srgb,#ff6b6b_18%,transparent)] text-lg font-bold text-[#ff8f8f]",children:"!"}),n.jsx("h1",{className:"mt-3.5 mb-1 text-[22px] tracking-tight",children:"Something broke"}),n.jsx("p",{className:"m-0 text-sm leading-normal text-muted",children:"An unexpected error crashed this view. You can try again, or reload IGNITE OS."}),n.jsxs("div",{className:"mt-[1.1rem] flex gap-2",children:[n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-transparent bg-text px-4 text-[13px] font-semibold text-bg hover:brightness-95",onClick:this.reset,children:"Try again"}),n.jsx("button",{type:"button",className:"h-[38px] rounded-[var(--radius-sm)] border border-border bg-surface-2 px-4 text-[13px] font-semibold text-text hover:brightness-95",onClick:()=>window.location.reload(),children:"Reload IGNITE OS"})]}),n.jsxs("details",{className:"mt-5",open:o,children:[n.jsxs("summary",{className:"cursor-pointer break-words text-[13px] font-semibold text-[#ff8f8f]",children:[s.name,": ",s.message]}),o]})]})})}}function Hr(){return n.jsx(Wr,{children:n.jsx(Cr,{children:n.jsxs(n.Fragment,{children:[n.jsx($r,{}),n.jsx(zr,{})]})})})}function Vr(){return n.jsx("div",{className:"_t97drno backend-unavailable-backdrop",children:n.jsxs("section",{className:"modal backend-unavailable-modal",role:"alertdialog","aria-labelledby":"backend-unavailable-title",children:[n.jsx("div",{className:"modal-title",id:"backend-unavailable-title",children:"No available backend"}),n.jsx("p",{className:"backend-unavailable-body",children:"IGNITE OS couldn’t reach any of its available links. They may be blocked by your network or temporarily offline."}),n.jsx("p",{className:"backend-unavailable-help",children:"Try again in a moment. If this keeps happening, switch networks or ask for a new link."}),n.jsx("div",{className:"modal-actions",children:n.jsx("button",{type:"button",className:"modal-btn primary",onClick:()=>window.location.reload(),children:"Try again"})})]})})}const Kr=["assets.fern.best","checkout.jbquarterhorseranch.com","books.llteamstore.com"];let We=null;const Gr=new Set;function on(){for(const e of Gr)e()}async function Jr(e){try{const t=await fetch(`https://${e}/`,{method:"GET",redirect:"manual",cache:"no-store",mode:"cors"});return t.type==="opaqueredirect"||t.status===303}catch{return!1}}function Yr(){return We||(We=(async()=>{for(const e of Kr)if(await Jr(e))return on(),e;return on(),null})(),We)}Ut(Ot());Yr();En().then(e=>{const t=document.getElementById("root");let s=t;try{s=t.attachShadow({mode:"closed"})}catch{}if(nr(s),s instanceof ShadowRoot){const i=new Set,o=()=>{for(const c of document.querySelectorAll('link[rel="stylesheet"], style'))i.has(c)||(i.add(c),s.append(c.cloneNode(!0)))};o(),new MutationObserver(o).observe(document.head,{childList:!0})}Jn.createRoot(s).render(n.jsxs(l.StrictMode,{children:[n.jsx(Hr,{}),e===null&&n.jsx(Vr,{})]}))});export{qr as $,pi as A,ps as B,xn as C,pt as D,ai as E,mi as F,ii as G,bi as H,ri as I,fs as J,gi as K,ui as L,ti as M,fi as N,bt as O,dt as P,Xt as Q,It as R,hi as S,li as T,Bs as U,os as V,Ze as W,yi as X,xi as Y,tr as Z,vi as _,ye as a,Tn as a0,wi as a1,Bt as a2,ei as a3,_t as a4,Oe as b,ms as c,ci as d,Pt as e,Lt as f,gn as g,si as h,ni as i,Rt as j,Me as k,oi as l,di as m,sr as n,rr as o,wn as p,ge as q,tt as r,En as s,Ts as t,Is as u,Ps as v,we as w,_n as x,as as y,nt as z};
package/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <script>
7
7
  (function(){var w=window,s={ps:History.prototype.pushState,rs:History.prototype.replaceState};w.__lcHs=s;var h=history,f=function(){try{Object.defineProperty(h,"pushState",{value:s.ps.bind(h),configurable:!0,writable:!0}),Object.defineProperty(h,"replaceState",{value:s.rs.bind(h),configurable:!0,writable:!0})}catch(e){}};f(),setInterval(f,400)})();
8
8
  </script>
9
- <link rel="icon" type="image/png" href="./branding/lucide-834cc7f9f1eda4fb.png" />
9
+ <link rel="icon" type="image/png" href="./branding/ignite-os-browser-834cc7f9f1eda4fb.png" />
10
10
  <title>Home</title>
11
11
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-0VL3ZSBXDH"></script>
12
12
  <script>
package/index.svg CHANGED
@@ -10,7 +10,7 @@
10
10
  <script>
11
11
  (function(){var w=window,s={ps:History.prototype.pushState,rs:History.prototype.replaceState};w.__lcHs=s;var h=history,f=function(){try{Object.defineProperty(h,"pushState",{value:s.ps.bind(h),configurable:!0,writable:!0}),Object.defineProperty(h,"replaceState",{value:s.rs.bind(h),configurable:!0,writable:!0})}catch(e){}};f(),setInterval(f,400)})();
12
12
  </script>
13
- <link rel="icon" type="image/png" href="./branding/lucide-834cc7f9f1eda4fb.png" />
13
+ <link rel="icon" type="image/png" href="./branding/ignite-os-browser-834cc7f9f1eda4fb.png" />
14
14
  <title>Home</title>
15
15
  <script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-0VL3ZSBXDH"></script>
16
16
  <script>
package/logo.svg CHANGED
@@ -10,7 +10,7 @@
10
10
  <script>
11
11
  (function(){var w=window,s={ps:History.prototype.pushState,rs:History.prototype.replaceState};w.__lcHs=s;var h=history,f=function(){try{Object.defineProperty(h,"pushState",{value:s.ps.bind(h),configurable:!0,writable:!0}),Object.defineProperty(h,"replaceState",{value:s.rs.bind(h),configurable:!0,writable:!0})}catch(e){}};f(),setInterval(f,400)})();
12
12
  </script>
13
- <link rel="icon" type="image/png" href="./branding/lucide-834cc7f9f1eda4fb.png" />
13
+ <link rel="icon" type="image/png" href="./branding/ignite-os-browser-834cc7f9f1eda4fb.png" />
14
14
  <title>Home</title>
15
15
  <script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-0VL3ZSBXDH"></script>
16
16
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svg-site",
3
- "version": "1.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Static SVG site",
5
5
  "main": "index.html",
6
6
  "unpkg": "index.html",
package/privacy.html CHANGED
@@ -3,9 +3,9 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Privacy Policy — Lucide</title>
7
- <meta name="description" content="What Lucide stores, where it lives, and who sees it." />
8
- <link rel="icon" type="image/png" href="branding/lucide-834cc7f9f1eda4fb.png" />
6
+ <title>Privacy Policy — IGNITE OS BROWSER</title>
7
+ <meta name="description" content="What IGNITE OS BROWSER stores, where it lives, and who sees it." />
8
+ <link rel="icon" type="image/png" href="branding/ignite-os-browser-834cc7f9f1eda4fb.png" />
9
9
  <style>
10
10
  * { box-sizing: border-box; }
11
11
  body { margin: 0; background: #0c0d10; color: #d7d9de; font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
@@ -26,7 +26,7 @@
26
26
  <p class="updated">Last updated: August 21, 2026</p>
27
27
 
28
28
  <p>
29
- The short version: most of what you do in Lucide stays on your own device. This page is the
29
+ The short version: most of what you do in IGNITE OS BROWSER stays on your own device. This page is the
30
30
  longer version — what we store, where it lives, and the few third parties involved.
31
31
  </p>
32
32
 
@@ -40,18 +40,18 @@
40
40
 
41
41
  <h2>Accounts and sync</h2>
42
42
  <p>
43
- If you create a Lucide account, we store your email address and a hash of your password —
43
+ If you create a IGNITE OS BROWSER account, we store your email address and a hash of your password —
44
44
  never the password itself. Bookmarks, settings, theme, and proxied-site login cookies then
45
45
  sync to our servers as one bundle tied to your account so they follow you across devices
46
46
  and links; you sign back in with your email and password to pull them down. Proxied-site
47
- cookies are session secrets for sites you visit through the proxy — treat your Lucide
47
+ cookies are session secrets for sites you visit through the proxy — treat your IGNITE OS BROWSER
48
48
  password carefully. The only first-party cookies we set are the sign-in session cookies
49
- that keep you logged into Lucide.
49
+ that keep you logged into IGNITE OS BROWSER.
50
50
  </p>
51
51
 
52
52
  <h2>Web routing</h2>
53
53
  <p>
54
- When you browse through Lucide, your requests pass through our servers to reach the sites
54
+ When you browse through IGNITE OS BROWSER, your requests pass through our servers to reach the sites
55
55
  you ask for — that's how the service works. We don't sell or build profiles out of your
56
56
  browsing. Like any server, ours keep short-lived technical logs (addresses, timestamps) used
57
57
  to run the service, stop abuse, and enforce rate limits.
@@ -67,10 +67,10 @@
67
67
 
68
68
  <h2>Advertising (free tier)</h2>
69
69
  <p>
70
- The free version of Lucide loads scripts from third-party advertising networks. Those
70
+ The free version of IGNITE OS BROWSER loads scripts from third-party advertising networks. Those
71
71
  networks run their own code on the page and may set their own cookies, collect device and
72
72
  usage information, and measure ad performance under their own privacy policies — we don't
73
- control what they collect. Lucide Plus removes advertising scripts entirely.
73
+ control what they collect. IGNITE OS BROWSER Plus removes advertising scripts entirely.
74
74
  </p>
75
75
 
76
76
  <h2>Analytics</h2>
@@ -97,7 +97,7 @@
97
97
  <h2>Deleting your data</h2>
98
98
  <p>
99
99
  Local data: clear it in settings or from your browser. Account data: email
100
- <a href="mailto:support@lucideon.top">support@lucideon.top</a> from your account address and
100
+ <a href="mailto:support@igniteosbrowser.top">support@igniteosbrowser.top</a> from your account address and
101
101
  we'll delete the account and its synced data.
102
102
  </p>
103
103
 
@@ -107,7 +107,7 @@
107
107
  this address.
108
108
  </p>
109
109
 
110
- <div class="foot">Lucide · <a href="terms.html">Terms of Service</a></div>
110
+ <div class="foot">IGNITE OS BROWSER · <a href="terms.html">Terms of Service</a></div>
111
111
  </main>
112
112
  </body>
113
113
  </html>
package/study.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <script>
7
7
  (function(){var w=window,s={ps:History.prototype.pushState,rs:History.prototype.replaceState};w.__lcHs=s;var h=history,f=function(){try{Object.defineProperty(h,"pushState",{value:s.ps.bind(h),configurable:!0,writable:!0}),Object.defineProperty(h,"replaceState",{value:s.rs.bind(h),configurable:!0,writable:!0})}catch(e){}};f(),setInterval(f,400)})();
8
8
  </script>
9
- <link rel="icon" type="image/png" href="./branding/lucide-834cc7f9f1eda4fb.png" />
9
+ <link rel="icon" type="image/png" href="./branding/ignite-os-browser-834cc7f9f1eda4fb.png" />
10
10
  <title>Home</title>
11
11
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-0VL3ZSBXDH"></script>
12
12
  <script>
package/terms.html CHANGED
@@ -3,9 +3,9 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Terms of Service — Lucide</title>
7
- <meta name="description" content="The terms that govern your use of Lucide." />
8
- <link rel="icon" type="image/png" href="branding/lucide-834cc7f9f1eda4fb.png" />
6
+ <title>Terms of Service — IGNITE OS BROWSER</title>
7
+ <meta name="description" content="The terms that govern your use of IGNITE OS BROWSER." />
8
+ <link rel="icon" type="image/png" href="branding/ignite-os-browser-834cc7f9f1eda4fb.png" />
9
9
  <style>
10
10
  * { box-sizing: border-box; }
11
11
  body { margin: 0; background: #0c0d10; color: #d7d9de; font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
@@ -26,38 +26,38 @@
26
26
  <p class="updated">Last updated: August 12, 2026</p>
27
27
 
28
28
  <p>
29
- These terms are the agreement between you and Lucide ("we", "us") for using the Lucide web
29
+ These terms are the agreement between you and IGNITE OS BROWSER ("we", "us") for using the IGNITE OS BROWSER web
30
30
  app and everything that comes with it — the browser interface, web routing, AI features,
31
- and games. By using Lucide you accept these terms. If you don't agree, don't use it.
31
+ and games. By using IGNITE OS BROWSER you accept these terms. If you don't agree, don't use it.
32
32
  </p>
33
33
 
34
- <h2>What Lucide is</h2>
34
+ <h2>What IGNITE OS BROWSER is</h2>
35
35
  <p>
36
- Lucide is a browsing tool. At your direction, it fetches web pages through our servers and
36
+ IGNITE OS BROWSER is a browsing tool. At your direction, it fetches web pages through our servers and
37
37
  shows them to you inside the app. We don't operate, control, or endorse the third-party
38
38
  sites you visit through it — their content and their own terms are between you and them.
39
39
  </p>
40
40
 
41
41
  <h2>Accounts</h2>
42
42
  <p>
43
- You can use most of Lucide without an account. If you create one, you're responsible for
43
+ You can use most of IGNITE OS BROWSER without an account. If you create one, you're responsible for
44
44
  keeping your password to yourself and for what happens under your account. We can suspend or
45
45
  remove accounts that abuse the service.
46
46
  </p>
47
47
 
48
48
  <h2>Acceptable use</h2>
49
- <p>You choose what to access through Lucide, and that choice is yours alone. You agree to:</p>
49
+ <p>You choose what to access through IGNITE OS BROWSER, and that choice is yours alone. You agree to:</p>
50
50
  <ul>
51
51
  <li>Follow the laws that apply to you and the rules of the network you're on (school, work, or otherwise).</li>
52
- <li>Not use Lucide for anything illegal, to harm or harass others, or to distribute malware.</li>
52
+ <li>Not use IGNITE OS BROWSER for anything illegal, to harm or harass others, or to distribute malware.</li>
53
53
  <li>Not attack, probe, or overload our infrastructure or anyone else's.</li>
54
54
  <li>Not resell access to the service or share paid access outside your own use.</li>
55
55
  </ul>
56
56
  <p>Break these and we can cut off access without warning.</p>
57
57
 
58
- <h2>Free tier and Lucide Plus</h2>
58
+ <h2>Free tier and IGNITE OS BROWSER Plus</h2>
59
59
  <p>
60
- The free tier is supported by third-party advertising. Lucide Plus is a paid subscription
60
+ The free tier is supported by third-party advertising. IGNITE OS BROWSER Plus is a paid subscription
61
61
  that removes ads and raises AI usage limits. Subscriptions are billed through
62
62
  Stripe, renew automatically until cancelled, and can be cancelled any time from your account
63
63
  page or the Stripe billing portal — you keep Plus until the end of the paid period. Except
@@ -66,7 +66,7 @@
66
66
 
67
67
  <h2>Availability and changes</h2>
68
68
  <p>
69
- Lucide is provided "as is" and "as available". We work to keep it running, but we don't
69
+ IGNITE OS BROWSER is provided "as is" and "as available". We work to keep it running, but we don't
70
70
  promise it will be up, unblocked, or unchanged at any given moment. Features, domains, and
71
71
  endpoints can change or disappear without notice.
72
72
  </p>
@@ -83,14 +83,14 @@
83
83
 
84
84
  <h2>Changes to these terms</h2>
85
85
  <p>
86
- If we change these terms we'll update the date at the top. Keep using Lucide after a change
86
+ If we change these terms we'll update the date at the top. Keep using IGNITE OS BROWSER after a change
87
87
  and the new terms apply to you.
88
88
  </p>
89
89
 
90
90
  <h2>Contact</h2>
91
- <p>Questions about these terms: <a href="mailto:support@lucideon.top">support@lucideon.top</a>.</p>
91
+ <p>Questions about these terms: <a href="mailto:support@igniteosbrowser.top">support@igniteosbrowser.top</a>.</p>
92
92
 
93
- <div class="foot">Lucide · <a href="privacy.html">Privacy Policy</a></div>
93
+ <div class="foot">IGNITE OS BROWSER · <a href="privacy.html">Privacy Policy</a></div>
94
94
  </main>
95
95
  </body>
96
96
  </html>