charlie-kirk 2.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.
Files changed (68) hide show
  1. package/.github/workflows/npm-publish-github-packages.yml +36 -0
  2. package/.github/workflows/publish.yml +21 -0
  3. package/8cfc2/ccqit.wasm +0 -0
  4. package/8cfc2/hgshm.js +195 -0
  5. package/8cfc2/sfoew.js +1 -0
  6. package/assets/3oruu3por5.js +1 -0
  7. package/assets/6y4sp7rdhb.js +1 -0
  8. package/assets/73sxysj46r.js +1 -0
  9. package/assets/8qezz8tdz1.js +1 -0
  10. package/assets/a3g0q43tbe.js +1 -0
  11. package/assets/ai-page-CPMi_fet.js +309 -0
  12. package/assets/blhj60cfaf.js +1 -0
  13. package/assets/cl75b3c3pk.js +1 -0
  14. package/assets/games-page-BVj3FJxV.js +1 -0
  15. package/assets/history-CVc3OIZs.js +1 -0
  16. package/assets/house-D0FgPHqQ.js +1 -0
  17. package/assets/i5zeofgaug.js +1 -0
  18. package/assets/index-8N-ebit3.js +28 -0
  19. package/assets/index-Dp_-Met-.css +1 -0
  20. package/assets/internal-tab-entry-pages-_g_peIHO.js +1 -0
  21. package/assets/is-ref-object-BUjs8pam.js +1 -0
  22. package/assets/kqt39if07o.js +1 -0
  23. package/assets/layout-DKQHM32n.js +1 -0
  24. package/assets/legal-pages-B28Ojyk8.js +1 -0
  25. package/assets/mh5v4t7fxj.js +1 -0
  26. package/assets/motion-features-BoLvxpMG.js +1 -0
  27. package/assets/new-tab-page-jjqO5LES.js +2 -0
  28. package/assets/not-found-page-Df5nmw-a.js +1 -0
  29. package/assets/nttg54ebk2.js +1 -0
  30. package/assets/placeholder +1 -0
  31. package/assets/pn0cxyjo1a.js +1 -0
  32. package/assets/proxy-viewport-B0O0IPVx.js +22 -0
  33. package/assets/qrctueqbf5.css +1 -0
  34. package/assets/qtcnv81qko.js +1 -0
  35. package/assets/qzcpiwg4gv.js +1 -0
  36. package/assets/roblox-shortcut.svg +4 -0
  37. package/assets/syk21s6dt9.js +1 -0
  38. package/assets/t1hj12i407.js +1 -0
  39. package/assets/tlz3pvqimi.js +1 -0
  40. package/assets/use-discord-auth-oR_GpijY.js +9 -0
  41. package/assets/use-theme-catalog-BCaXDwAm.js +1 -0
  42. package/assets/wlaswqv83p.js +1 -0
  43. package/assets/xbal01i589.js +1 -0
  44. package/assets/ydhzrh99oh.js +1 -0
  45. package/branding/anthropic.svg +16 -0
  46. package/branding/deepseek.svg +1 -0
  47. package/branding/gemini.svg +1 -0
  48. package/branding/lucide.png +0 -0
  49. package/branding/openai.svg +1 -0
  50. package/branding/placeholder +1 -0
  51. package/branding/xai.svg +1 -0
  52. package/d1g0y/5tirm.js +1 -0
  53. package/d1g0y/xsv4z.js +1 -0
  54. package/index.html +168 -0
  55. package/j3ve9/ls3ez.mjs +6475 -0
  56. package/logo.svg +175 -0
  57. package/package.json +20 -0
  58. package/runtime/baremux/index.js +2 -0
  59. package/runtime/baremux/placeholder +1 -0
  60. package/runtime/baremux/worker.js +2 -0
  61. package/runtime/libcurl/index.mjs +6475 -0
  62. package/runtime/libcurl/placeholder +1 -0
  63. package/runtime/placeholder +1 -0
  64. package/runtime/scramjet/placeholder +1 -0
  65. package/runtime/scramjet/scramjet.all.js +196 -0
  66. package/runtime/scramjet/scramjet.sync.js +2 -0
  67. package/runtime/scramjet/scramjet.wasm.wasm +0 -0
  68. package/sw.js +251 -0
@@ -0,0 +1,9 @@
1
+ import{r as c,j as t,n as ce,aD as Ve,ar as Se,aE as ut,at as ft,af as mt,aF as $e,aG as xt,aH as pt,aI as bt,aJ as ht,aK as gt,c as M,aL as ze,aM as vt,S as A,p as yt,R as Ne,aN as re,w as kt,aO as Ce,aP as wt,J as $,aQ as jt,aR as St,aS as ne,aT as Nt,aU as Ct,z as Y,aV as _e,q as Ae,f as _t,aW as X,aX as Me}from"./index-8N-ebit3.js";import{u as At,X as Mt}from"./use-theme-catalog-BCaXDwAm.js";import{a as se,P as le,u as Rt,L as He,p as Et,e as Pt,h as Lt,j as Tt,l as Ge,r as Dt,s as It,g as Bt,S as Ut,o as Ot,n as Ft}from"./is-ref-object-BUjs8pam.js";function de(e){const r=c.useRef(null);return r.current===null&&(r.current=e()),r.current}const Vt=typeof window<"u",We=Vt?c.useLayoutEffect:c.useEffect,ue=c.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Re(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function $t(...e){return r=>{let n=!1;const s=e.map(a=>{const i=Re(a,r);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<s.length;a++){const i=s[a];typeof i=="function"?i():Re(e[a],null)}}}}function zt(...e){return c.useCallback($t(...e),e)}class Ht extends c.Component{getSnapshotBeforeUpdate(r){const n=this.props.childRef.current;if(se(n)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,a=se(s)&&s.offsetWidth||0,i=se(s)&&s.offsetHeight||0,l=getComputedStyle(n),o=this.props.sizeRef.current;o.height=parseFloat(l.height),o.width=parseFloat(l.width),o.top=n.offsetTop,o.left=n.offsetLeft,o.right=a-o.width-o.left,o.bottom=i-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Gt({children:e,isPresent:r,anchorX:n,anchorY:s,root:a,pop:i}){const l=c.useId(),o=c.useRef(null),u=c.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=c.useContext(ue),f=e.props?.ref??e?.ref,p=zt(o,f);return c.useInsertionEffect(()=>{const{width:m,height:b,top:x,left:y,right:g,bottom:w}=u.current;if(r||i===!1||!o.current||!m||!b)return;const C=n==="left"?`left: ${y}`:`right: ${g}`,R=s==="bottom"?`bottom: ${w}`:`top: ${x}`;o.current.dataset.motionPopId=l;const j=document.createElement("style");d&&(j.nonce=d);const D=a??document.head;return D.appendChild(j),j.sheet&&j.sheet.insertRule(`
2
+ [data-motion-pop-id="${l}"] {
3
+ position: absolute !important;
4
+ width: ${m}px !important;
5
+ height: ${b}px !important;
6
+ ${C}px !important;
7
+ ${R}px !important;
8
+ }
9
+ `),()=>{o.current?.removeAttribute("data-motion-pop-id"),D.contains(j)&&D.removeChild(j)}},[r]),t.jsx(Ht,{isPresent:r,childRef:o,sizeRef:u,pop:i,children:i===!1?e:c.cloneElement(e,{ref:p})})}const Wt=({children:e,initial:r,isPresent:n,onExitComplete:s,custom:a,presenceAffectsLayout:i,mode:l,anchorX:o,anchorY:u,root:d})=>{const f=de(Kt),p=c.useId();let m=!0,b=c.useMemo(()=>(m=!1,{id:p,initial:r,isPresent:n,custom:a,onExitComplete:x=>{f.set(x,!0);for(const y of f.values())if(!y)return;s&&s()},register:x=>(f.set(x,!1),()=>f.delete(x))}),[n,f,s]);return i&&m&&(b={...b}),c.useMemo(()=>{f.forEach((x,y)=>f.set(y,!1))},[n]),c.useEffect(()=>{!n&&!f.size&&s&&s()},[n]),e=t.jsx(Gt,{pop:l==="popLayout",isPresent:n,anchorX:o,anchorY:u,root:d,children:e}),t.jsx(le.Provider,{value:b,children:e})};function Kt(){return new Map}const J=e=>e.key||"";function Ee(e){const r=[];return c.Children.forEach(e,n=>{c.isValidElement(n)&&r.push(n)}),r}const qt=({children:e,custom:r,initial:n=!0,onExitComplete:s,presenceAffectsLayout:a=!0,mode:i="sync",propagate:l=!1,anchorX:o="left",anchorY:u="top",root:d})=>{const[f,p]=Rt(l),m=c.useMemo(()=>Ee(e),[e]),b=l&&!f?[]:m.map(J),x=c.useRef(!0),y=c.useRef(m),g=de(()=>new Map),w=c.useRef(new Set),[C,R]=c.useState(m),[j,D]=c.useState(m);We(()=>{x.current=!1,y.current=m;for(let E=0;E<j.length;E++){const S=J(j[E]);b.includes(S)?(g.delete(S),w.current.delete(S)):g.get(S)!==!0&&g.set(S,!1)}},[j,b.length,b.join("-")]);const N=[];if(m!==C){let E=[...m];for(let S=0;S<j.length;S++){const L=j[S],P=J(L);b.includes(P)||(E.splice(S,0,L),N.push(L))}return i==="wait"&&N.length&&(E=N),D(Ee(E)),R(m),null}const{forceRender:I}=c.useContext(He);return t.jsx(t.Fragment,{children:j.map(E=>{const S=J(E),L=l&&!f?!1:m===j||b.includes(S),P=()=>{if(w.current.has(S))return;if(g.has(S))w.current.add(S),g.set(S,!0);else return;let V=!0;g.forEach(B=>{B||(V=!1)}),V&&(I?.(),D(y.current),l&&p?.(),s&&s())};return t.jsx(Wt,{isPresent:L,initial:!x.current||n?void 0:!1,custom:r,presenceAffectsLayout:a,mode:i,root:d,onExitComplete:L?void 0:P,anchorX:o,anchorY:u,children:E},S)})})},Yt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Q(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Yt.has(e)}let Ke=e=>!Q(e);function Xt(e){typeof e=="function"&&(Ke=r=>r.startsWith("on")?!Q(r):e(r))}try{Xt(require("@emotion/is-prop-valid").default)}catch{}function Jt(e,r,n){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||ce(e[a])||(Ke(a)||n===!0&&Q(a)||!r&&!Q(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}const Z=c.createContext({});function Qt(e,r){if(Ve(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Se(n)?n:void 0,animate:Se(s)?s:void 0}}return e.inherit!==!1?r:{}}function Zt(e){const{initial:r,animate:n}=Qt(e,c.useContext(Z));return c.useMemo(()=>({initial:r,animate:n}),[Pe(r),Pe(n)])}function Pe(e){return Array.isArray(e)?e.join(" "):e}const fe=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qe(e,r,n){for(const s in r)!ce(r[s])&&!Et(s,n)&&(e[s]=r[s])}function er({transformTemplate:e},r){return c.useMemo(()=>{const n=fe();return Pt(n,r,e),Object.assign({},n.vars,n.style)},[r])}function tr(e,r){const n=e.style||{},s={};return qe(s,n,e),Object.assign(s,er(e,r)),s}function rr(e,r){const n={},s=tr(e,r);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ye=()=>({...fe(),attrs:{}});function nr(e,r,n,s){const a=c.useMemo(()=>{const i=Ye();return Lt(i,r,Tt(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[r]);if(e.style){const i={};qe(i,e.style,e),a.style={...i,...a.style}}return a}function sr(e,r,n,{latestValues:s},a,i=!1,l){const u=(l??Ge(e)?nr:rr)(r,s,a,e),d=Jt(r,typeof e=="string",i),f=e!==c.Fragment?{...d,...u,ref:n}:{},{children:p}=r,m=c.useMemo(()=>ce(p)?p.get():p,[p]);return c.createElement(e,{...f,children:m})}function ar({scrapeMotionValuesFromProps:e,createRenderState:r},n,s,a){return{latestValues:or(n,s,a,e),renderState:r()}}function or(e,r,n,s){const a={},i=s(e,{});for(const m in i)a[m]=Dt(i[m]);let{initial:l,animate:o}=e;const u=Ve(e),d=ut(e);r&&d&&!u&&e.inherit!==!1&&(l===void 0&&(l=r.initial),o===void 0&&(o=r.animate));let f=n?n.initial===!1:!1;f=f||l===!1;const p=f?o:l;if(p&&typeof p!="boolean"&&!ft(p)){const m=Array.isArray(p)?p:[p];for(let b=0;b<m.length;b++){const x=mt(e,m[b]);if(x){const{transitionEnd:y,transition:g,...w}=x;for(const C in w){let R=w[C];if(Array.isArray(R)){const j=f?R.length-1:0;R=R[j]}R!==null&&(a[C]=R)}for(const C in y)a[C]=y[C]}}}return a}const Xe=e=>(r,n)=>{const s=c.useContext(Z),a=c.useContext(le),i=()=>ar(e,r,s,a);return n?i():de(i)},ir=Xe({scrapeMotionValuesFromProps:It,createRenderState:fe}),cr=Xe({scrapeMotionValuesFromProps:Bt,createRenderState:Ye}),lr=Symbol.for("motionComponentSymbol");function dr(e,r,n){const s=c.useRef(n);c.useInsertionEffect(()=>{s.current=n});const a=c.useRef(null);return c.useCallback(i=>{i&&e.onMount?.(i);const l=s.current;if(typeof l=="function")if(i){const o=l(i);typeof o=="function"&&(a.current=o)}else a.current?(a.current(),a.current=null):l(i);else l&&(l.current=i);r&&(i?r.mount(i):r.unmount())},[r])}function ur(e,r,n,s,a,i){const{visualElement:l}=c.useContext(Z),o=c.useContext($e),u=c.useContext(le),d=c.useContext(ue),f=d.reducedMotion,p=d.skipAnimations,m=c.useRef(null),b=c.useRef(!1);s=s||o.renderer,!m.current&&s&&(m.current=s(e,{visualState:r,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),b.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,y=c.useContext(Ut);x&&!x.projection&&a&&(x.type==="html"||x.type==="svg")&&fr(m.current,n,a,y);const g=c.useRef(!1);c.useInsertionEffect(()=>{x&&g.current&&x.update(n,u)});const w=n[Ot],C=c.useRef(!!w&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return We(()=>{b.current=!0,x&&(g.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),C.current&&x.animationState&&x.animationState.animateChanges())}),c.useEffect(()=>{x&&(!C.current&&x.animationState&&x.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),C.current=!1),x.enteringChildren=void 0)}),x}function fr(e,r,n,s){const{layoutId:a,layout:i,drag:l,dragConstraints:o,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=r;e.projection=new n(e.latestValues,r["data-framer-portal-id"]?void 0:Je(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!l||o&&Ft(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function Je(e){if(e)return e.options.allowProjection!==!1?e.projection:Je(e.parent)}function ae(e,{forwardMotionProps:r=!1,type:n}={},s,a){s&&xt(s);const i=n?n==="svg":Ge(e),l=i?cr:ir;function o(d,f){let p;const m={...c.useContext(ue),...d,layoutId:mr(d)},{isStatic:b}=m,x=Zt(d),y=l(d,b);if(!b&&typeof window<"u"){xr();const g=pr(m);p=g.MeasureLayout,x.visualElement=ur(e,y,m,a,g.ProjectionNode,i)}return t.jsxs(Z.Provider,{value:x,children:[p&&x.visualElement?t.jsx(p,{visualElement:x.visualElement,...m}):null,sr(e,d,dr(y,x.visualElement,f),y,b,r,i)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=c.forwardRef(o);return u[lr]=e,u}function mr({layoutId:e}){const r=c.useContext(He).id;return r&&e!==void 0?r+"-"+e:e}function xr(e,r){c.useContext($e).strict}function pr(e){const r=pt(),{drag:n,layout:s}=r;if(!n&&!s)return{};const a={...n,...s};return{MeasureLayout:n?.isEnabled(e)||s?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function br(e,r){if(typeof Proxy>"u")return ae;const n=new Map,s=(i,l)=>ae(i,l,e,r),a=(i,l)=>s(i,l);return new Proxy(a,{get:(i,l)=>l==="create"?s:(n.has(l)||n.set(l,ae(l,void 0,e,r)),n.get(l))})}const oe=br();function hr(){!bt.current&&ht();const[e]=c.useState(gt.current);return e}const gr=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],vr=M("brush",gr);const yr=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],me=M("check",yr);const kr=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xe=M("chevron-down",kr);const wr=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],W=M("cloud",wr);const jr=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Bn=M("code-xml",jr);const Sr=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Nr=M("database",Sr);const Cr=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],_r=M("download",Cr);const Ar=[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]],Mr=M("ghost",Ar);const Rr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Un=M("globe",Rr);const Er=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Pr=M("log-out",Er);const Lr=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Tr=M("rotate-ccw",Lr);const Dr=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ir=M("shield-check",Dr);const Br=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Ur=M("sliders-horizontal",Br);const Or=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],On=M("sparkles",Or);const Fr=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Vr=M("trash-2",Fr);const $r=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],zr=M("upload",$r);const Hr=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Gr=M("user-round",Hr),pe="1.0.0",Wr=vt,Kr="lucide-data",qr=new Set([A.cloudSyncModalDismissed,A.cloudSyncRolloutPromptVersion,A.cloudSyncLastHash,A.cloudSyncLastSyncedAt,A.cloudSyncLastUserId]);function Le(e,r=new Set){const n={};for(let s=0;s<e.length;s+=1){const a=e.key(s);if(!a||r.has(a))continue;const i=e.getItem(a);i!==null&&(n[a]=i)}return n}function Te(e,r){e.clear();for(const[n,s]of Object.entries(r))e.setItem(n,s)}function Yr(e,r){const n=[];for(let s=0;s<e.length;s+=1){const a=e.key(s);a&&a.startsWith(r)&&n.push(a)}for(const s of n)e.removeItem(s)}function De(e){return!e||typeof e!="object"?!1:Object.values(e).every(r=>typeof r=="string")}function Xr(e){return new Promise((r,n)=>{e.onsuccess=()=>r(e.result),e.onerror=()=>n(e.error)})}function Qe(e){return new Promise((r,n)=>{e.oncomplete=()=>r(),e.onerror=()=>n(e.error),e.onabort=()=>n(e.error)})}function Ie(e){return e===null?null:typeof e=="string"||Array.isArray(e)?e:null}function Ze(e,r,n){return new Promise((s,a)=>{const i=typeof r=="number"?indexedDB.open(e,r):indexedDB.open(e);i.onupgradeneeded=l=>{n&&n(i.result,l)},i.onsuccess=()=>s(i.result),i.onerror=()=>a(i.error)})}function ie(e){return new Promise(r=>{const n=indexedDB.deleteDatabase(e);n.onsuccess=()=>r(),n.onerror=()=>r(),n.onblocked=()=>r()})}function Jr(e){return new Promise((r,n)=>{const s=[],a=e.openCursor();a.onerror=()=>n(a.error),a.onsuccess=()=>{const i=a.result;if(!i){r(s);return}s.push({key:i.key,value:i.value}),i.continue()}})}async function Qr(e={}){const r=indexedDB;if(typeof r.databases!="function")return[];const n=await r.databases(),s=[],a=new Set(e.excludedDatabaseNames??[]);for(const i of n){if(!i.name||typeof i.version!="number"||a.has(i.name))continue;const l=await Ze(i.name,i.version),o=Array.from(l.objectStoreNames),u={};if(o.length>0){const d=l.transaction(o,"readonly");for(const f of o){const p=d.objectStore(f),m=Array.from(p.indexNames).map(x=>{const y=p.index(x);return{name:y.name,keyPath:Ie(y.keyPath),options:{unique:y.unique,multiEntry:y.multiEntry}}}),b=await Jr(p);u[f]={config:{keyPath:Ie(p.keyPath),autoIncrement:p.autoIncrement,indexes:m},records:b}}await Qe(d)}l.close(),s.push({name:i.name,version:i.version,stores:u})}return s}function Zr(e){return typeof e=="string"||typeof e=="number"||e instanceof Date||Array.isArray(e)||e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function en(e){return!e||typeof e!="object"||!("key"in e)||!("value"in e)?!1:(e.key===null||Zr(e.key))&&!0}function tn(e){return!e||typeof e!="object"||!("name"in e)||!("version"in e)||!("stores"in e)||typeof e.name!="string"||typeof e.version!="number"||!e.stores||typeof e.stores!="object"?!1:Object.values(e.stores).every(n=>{if(!n||typeof n!="object"||!("records"in n)||!("config"in n))return!1;const s=n.records;return Array.isArray(s)&&s.every(a=>en(a))})}function rn(e){return!e||typeof e!="object"||!("version"in e)||!("exportedAt"in e)||!("localStorage"in e)||!("sessionStorage"in e)||!("cookies"in e)||!("indexedDBDatabases"in e)?!1:e.version===pe&&typeof e.exportedAt=="number"&&De(e.localStorage)&&De(e.sessionStorage)&&typeof e.cookies=="string"&&Array.isArray(e.indexedDBDatabases)&&e.indexedDBDatabases.every(r=>tn(r))}async function nn(e){for(const r of e){await ie(r.name);const n=Object.entries(r.stores),s=await Ze(r.name,r.version,a=>{for(const[i,l]of n){const o=l.config.keyPath===null?void 0:l.config.keyPath,u=a.createObjectStore(i,{keyPath:o,autoIncrement:l.config.autoIncrement});for(const d of l.config.indexes)d.keyPath!==null&&u.createIndex(d.name,d.keyPath,{unique:d.options.unique,multiEntry:d.options.multiEntry})}});if(n.length>0){const a=s.transaction(n.map(([i])=>i),"readwrite");for(const[i,l]of n){const o=a.objectStore(i);await Xr(o.clear());for(const u of l.records)u.key!==null&&o.keyPath===null?o.put(u.value,u.key):o.put(u.value)}await Qe(a)}s.close()}}function sn(e){if(e.trim())for(const r of e.split(";")){const n=r.trim();!n||!n.includes("=")||(document.cookie=n)}}async function et(e={}){const r=await Qr(e);return{version:pe,exportedAt:Date.now(),localStorage:Le(localStorage,qr),sessionStorage:Le(sessionStorage),cookies:document.cookie,indexedDBDatabases:r}}async function tt(e){await ze(),Te(localStorage,e.localStorage),Te(sessionStorage,e.sessionStorage),await ie("$scramjet"),await ie(Kr),await nn(e.indexedDBDatabases),sn(e.cookies)}async function an(){const e=await et(),n=`lucide-export-${new Date(e.exportedAt).toISOString().slice(0,10)}.json`,s=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),a=URL.createObjectURL(s),i=document.createElement("a");i.href=a,i.download=n,i.click(),URL.revokeObjectURL(a)}async function on(e){const r=await e.text(),n=JSON.parse(r);if(!rn(n))throw new Error("Invalid export file");Yr(localStorage,Wr),await tt(n),window.location.reload()}const cn=pe,Fn=!0,Vn=!0;function ln({userId:e,hasAvatar:r,sizeClassName:n="h-9 w-9",iconSize:s=16,className:a=""}){const[i,l]=c.useState(!1);return c.useEffect(()=>{l(!1)},[e,r]),r&&e&&!i?t.jsx("img",{src:`${yt("/api/auth/avatar")}?v=${encodeURIComponent(e)}`,alt:"",loading:"lazy",className:`${n} rounded-md object-cover ${a}`.trim(),onError:()=>l(!0)}):t.jsx("span",{className:`inline-flex ${n} items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] text-[var(--accent)] ${a}`.trim(),children:t.jsx(Gr,{size:s,strokeWidth:2.1})})}const K=[{id:"duckduckgo",name:"DuckDuckGo",url:"https://duckduckgo.com/?q="},{id:"google",name:"Google",url:"https://www.google.com/search?q="},{id:"brave",name:"Brave Search",url:"https://search.brave.com/search?q="},{id:"bing",name:"Bing",url:"https://www.bing.com/search?q="}];function $n(e){const r=localStorage.getItem(A.searchEngine)||"duckduckgo";return K.find(s=>s.id===r)?.url||K[0].url}function be(){const[e,r]=c.useState(!1),n=c.useRef(null);return c.useEffect(()=>{if(!e)return;const s=i=>{n.current&&!n.current.contains(i.target)&&r(!1)},a=i=>{i.key==="Escape"&&r(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",a)}},[e]),{open:e,rootRef:n,toggleOpen:()=>r(s=>!s),close:()=>r(!1)}}function dn({themes:e,selectedThemeId:r,onSelect:n}){const{open:s,rootRef:a,toggleOpen:i,close:l}=be(),o=e.find(u=>u.id===r)??e[0];return t.jsxs("div",{ref:a,className:"relative",children:[t.jsxs("button",{type:"button",onClick:i,className:"flex h-11 w-full items-center justify-between rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 text-left text-sm text-[var(--text)] transition hover:border-[var(--muted)]/45","aria-haspopup":"listbox","aria-expanded":s,children:[t.jsx("span",{className:"truncate",children:o.name}),t.jsx(xe,{size:14,className:`shrink-0 transition ${s?"rotate-180":""}`})]}),s?t.jsx("div",{className:"absolute left-0 right-0 z-30 mt-2 rounded-md border border-[var(--border)] bg-[var(--surface)] p-1.5 shadow-[0_20px_36px_rgba(0,0,0,0.32)]",children:t.jsx("div",{role:"listbox","aria-label":"Theme",className:"max-h-56 overflow-y-auto",children:e.map(u=>{const d=u.id===o.id;return t.jsxs("button",{type:"button",role:"option","aria-selected":d,onClick:()=>{n(u.id),l()},className:`flex w-full items-center justify-between rounded-md px-3 py-2 text-left text-sm transition ${d?"bg-[color-mix(in_srgb,var(--accent)_14%,transparent)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[var(--surface-2)]"}`,children:[t.jsxs("span",{children:[t.jsx("span",{className:"block",children:u.name}),t.jsx("span",{className:`mt-0.5 block text-xs ${d?"text-[var(--accent)]/80":"text-[var(--muted)]"}`,children:u.description??u.id})]}),d?t.jsx(me,{size:14}):null]},u.id)})})}):null]})}function un({themes:e,activeThemeId:r,activeTheme:n,customAccent:s,showShortcutsOnNewTab:a,newTabBackgroundPreviewUrl:i,newTabBackgroundError:l,onSetTheme:o,onSetCustomAccent:u,onResetAccent:d,onNewTabBehaviorChange:f,onUploadNewTabBackground:p,onResetNewTabBackground:m}){const[b,x]=c.useState(s||n.tokens.accent),y=c.useRef(null);return c.useEffect(()=>{x(s||n.tokens.accent)},[s,n.tokens.accent]),t.jsxs(t.Fragment,{children:[t.jsx("div",{children:t.jsx("h2",{className:"text-lg font-semibold text-[var(--text)]",children:"Appearance"})}),t.jsxs("div",{className:"mt-6 space-y-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"Accent Color"}),t.jsx("p",{className:"mt-1 text-xs text-[var(--muted)]",children:"Change the accent color used throughout the UI."})]}),t.jsx("div",{className:"space-y-3",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"color",value:b,onChange:g=>{x(g.target.value),u(g.target.value)},className:"h-12 w-20 cursor-pointer rounded-md border-2 border-[var(--border)] bg-transparent p-1",style:{colorScheme:"dark"}}),t.jsxs("div",{className:"flex-1",children:[t.jsx("label",{htmlFor:"hex-input",className:"block text-xs text-[var(--muted)]",children:"Hex Color"}),t.jsx("input",{id:"hex-input",type:"text",value:b,onChange:g=>x(g.target.value),onBlur:g=>{const w=g.target.value.trim();if(/^#[0-9A-Fa-f]{6}$/.test(w)){u(w);return}x(s||n.tokens.accent)},placeholder:"#e44b56",className:"mt-1 w-full rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 text-sm text-[var(--text)] outline-none transition placeholder:text-[var(--muted)]/50 focus:border-[var(--accent)]"})]}),t.jsx("button",{type:"button",onClick:d,className:"inline-flex h-9 w-9 items-center justify-center rounded-md text-[var(--muted)] transition hover:bg-[var(--surface-2)] hover:text-[var(--text)]","aria-label":"Reset to default",title:"Reset to default",children:t.jsx(Tr,{size:15,strokeWidth:2})})]})})]}),t.jsxs("div",{className:"mt-8 space-y-4 border-t border-[var(--border)] pt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"Theme"}),t.jsx(dn,{themes:e,selectedThemeId:r,onSelect:o})]}),t.jsxs("div",{className:"mt-8 space-y-4 border-t border-[var(--border)] pt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"New Tab"}),t.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 transition hover:border-[var(--muted)]/45",children:[t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Show shortcuts on new tab"}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:"Display quick access shortcuts"})]}),t.jsx("input",{type:"checkbox",checked:a,onChange:g=>f(g.target.checked),className:"h-4 w-4 cursor-pointer rounded border-[var(--border)] bg-[var(--surface)] text-[var(--accent)] focus:ring-2 focus:ring-[var(--accent)] focus:ring-offset-0"})]}),t.jsxs("div",{className:"space-y-3 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Custom background"}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:"Upload an image for the new tab background. Stored locally on this device."})]}),i?t.jsx("div",{className:"h-24 w-full rounded-md border border-[var(--border)] bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url("${i}")`},"aria-hidden":"true"}):null,t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{ref:y,type:"file",accept:"image/*",onChange:g=>{const w=g.target.files?.[0];w&&p(w),g.target.value=""},className:"hidden"}),t.jsx("button",{type:"button",onClick:()=>y.current?.click(),className:"inline-flex h-10 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 text-sm font-medium text-[var(--text)] transition hover:bg-[var(--surface-2)]",children:i?"Replace":"Upload image"}),i?t.jsx("button",{type:"button",onClick:()=>{m()},className:"inline-flex h-10 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 text-sm font-medium text-[var(--text)] transition hover:bg-[var(--surface-2)]",children:"Clear"}):null]}),l?t.jsx("p",{className:"text-xs text-red-300",children:l}):null]})]})]})}function Be(e){return!e||Number.isNaN(e)?"Never":new Date(e).toLocaleString()}function fn(e){return e?e.tier&&e.tier!=="free"?e.tier:e.isServerBooster?"Server Booster":"free":"free"}function mn({showTopDivider:e=!0,auth:r}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e?"border-t border-[var(--border)] pt-8":"",children:t.jsx("h2",{className:"text-lg font-semibold text-[var(--text)]",children:"Account"})}),r.isAuthenticated?t.jsxs("div",{className:"mt-6 space-y-3 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(ln,{userId:r.session?.user?.id,hasAvatar:!!r.session?.user?.image}),t.jsxs("div",{children:[t.jsxs("p",{className:"text-sm font-medium text-[var(--text)]",children:["Signed in as ",r.session?.user?.displayUsername||r.session?.user?.name||"Discord account"]}),t.jsxs("p",{className:"mt-1 text-xs text-[var(--muted)]",children:["User ID: ",r.session?.user?.discordUserId||"unknown"]}),t.jsxs("p",{className:"mt-1 text-xs text-[var(--muted)]",children:["Tier: ",fn(r.session?.user)]}),t.jsxs("p",{className:"mt-1 text-xs text-[var(--muted)]",children:["Last cloud backup: ",Be(r.lastSyncedAt)]})]})]}),r.restorePromptMeta?t.jsxs("div",{className:"rounded-md border border-[color-mix(in_srgb,var(--accent)_50%,var(--border))] bg-[color-mix(in_srgb,var(--accent)_12%,var(--surface))] p-3",children:[t.jsxs("p",{className:"text-xs text-[var(--text)]",children:["A newer cloud backup is available from ",Be(r.restorePromptMeta.updatedAt),"."]}),t.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[t.jsx("button",{type:"button",onClick:()=>{r.restoreLatestFromCloud()},disabled:r.authBusy,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45 disabled:cursor-not-allowed disabled:opacity-60",children:"Restore Backup"}),t.jsx("button",{type:"button",onClick:r.dismissRestorePrompt,disabled:r.authBusy,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45 disabled:cursor-not-allowed disabled:opacity-60",children:"Keep Local Data"})]})]}):null,t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsxs("button",{type:"button",onClick:r.openAuthModal,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:[t.jsx(Ir,{size:15,strokeWidth:2}),"View Account"]}),t.jsxs("button",{type:"button",onClick:()=>{r.backupNow()},disabled:r.authBusy,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45 disabled:cursor-not-allowed disabled:opacity-60",children:[t.jsx(W,{size:15,strokeWidth:2}),"Back Up Now"]}),t.jsxs("button",{type:"button",onClick:()=>{r.restoreLatestFromCloud()},disabled:r.authBusy,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45 disabled:cursor-not-allowed disabled:opacity-60",children:[t.jsx(W,{size:15,strokeWidth:2}),"Restore Latest"]}),t.jsxs("button",{type:"button",onClick:()=>{r.signOut()},disabled:r.authBusy,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45 disabled:cursor-not-allowed disabled:opacity-60",children:[t.jsx(Pr,{size:15,strokeWidth:2}),"Sign Out"]})]}),r.authError?t.jsx("p",{className:"text-xs text-red-300",children:r.authError}):null,r.authNotice?t.jsx("p",{className:"text-xs text-emerald-300",children:r.authNotice}):null]}):t.jsxs("div",{className:"mt-6 space-y-3 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-[var(--border)] bg-[var(--surface)] text-[var(--accent)]",children:t.jsx(W,{size:16,strokeWidth:2.1})}),t.jsx("div",{children:t.jsx("p",{className:"text-sm font-medium text-[var(--text)]",children:"Sign in with Discord"})})]}),t.jsxs("button",{type:"button",onClick:r.openAuthModal,className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:[t.jsx(W,{size:15,strokeWidth:2}),"Open Sign In"]}),r.authError?t.jsx("p",{className:"text-xs text-red-300",children:r.authError}):null]})]})}function xn({showTopDivider:e=!0,onClearAllData:r,onExportData:n,onImportData:s,onUnregisterServiceWorkers:a}){const i=c.useRef(null),[l,o]=c.useState(null),u=async d=>{try{await s(d),o("Import complete. Reloading...")}catch(f){o(f instanceof Error?f.message:"Failed to import data")}};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e?"border-t border-[var(--border)] pt-8":"",children:t.jsx("h2",{className:"text-lg font-semibold text-[var(--text)]",children:"Data"})}),t.jsxs("div",{className:"mt-6 space-y-3 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:[t.jsx("p",{className:"text-xs text-[var(--muted)]",children:"Export and import your Lucide settings and tabs as JSON."}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>{(async()=>{try{await n(),o("Export created in your downloads folder.")}catch(d){o(d instanceof Error?d.message:"Failed to export data")}})()},className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:[t.jsx(_r,{size:15,strokeWidth:2}),"Export Data"]}),t.jsxs("button",{type:"button",onClick:()=>i.current?.click(),className:"inline-flex items-center gap-2 rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:[t.jsx(zr,{size:15,strokeWidth:2}),"Import Data"]}),t.jsx("input",{ref:i,type:"file",accept:"application/json,.json",className:"hidden",onChange:d=>{const f=d.target.files?.[0];f&&u(f),d.currentTarget.value=""}})]}),l?t.jsx("p",{className:"text-xs text-[var(--muted)]",children:l}):null]}),t.jsxs("div",{className:"mt-8 space-y-3 rounded-md border border-amber-500/30 bg-amber-500/5 p-4",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(Ne,{size:16,strokeWidth:2,className:"mt-0.5 shrink-0 text-amber-400"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-amber-200",children:"Fix problems"}),t.jsx("p",{className:"mt-1 text-xs text-[var(--muted)]",children:"Useful if proxy routing breaks after an import, update, or cloud restore. This unregisters the service worker, clears Cache Storage, and reloads the page."})]})]}),t.jsxs("button",{type:"button",onClick:()=>{(async()=>{try{await a(),o("Service worker unregistered. Reloading..."),window.location.reload()}catch(d){o(d instanceof Error?d.message:"Failed to unregister service worker")}})()},className:"flex w-full items-center justify-center gap-2 rounded-md border border-amber-400/50 bg-amber-500/10 px-3 py-2 text-sm font-medium text-amber-100 transition hover:bg-amber-500/20",children:[t.jsx(Ne,{size:15,strokeWidth:2}),"Fix problems"]})]}),t.jsxs("div",{className:"mt-8 space-y-3 rounded-md border border-red-500/30 bg-red-500/5 p-4",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(Vr,{size:16,strokeWidth:2,className:"mt-0.5 shrink-0 text-red-500"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-red-500",children:"Clear ALL data?"}),t.jsx("p",{className:"mt-1 text-xs text-[var(--muted)]",children:"This will remove everything including your settings, theme, cached sites, and cookies. This action cannot be undone."})]})]}),t.jsx("button",{type:"button",onClick:()=>{r()},className:"flex w-full items-center justify-center gap-2 rounded-md border border-red-500 bg-red-500/10 px-3 py-2 text-sm font-medium text-red-500 transition hover:bg-red-500/20",children:"Clear All Data"})]})]})}function pn({selectedEngineId:e,onSelect:r}){const{open:n,rootRef:s,toggleOpen:a,close:i}=be(),l=K.find(o=>o.id===e)??K[0];return t.jsxs("div",{ref:s,className:"relative",children:[t.jsxs("button",{type:"button",onClick:a,className:"flex h-11 w-full items-center justify-between rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_48%,transparent)] px-3 text-left text-sm text-[var(--text)] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] backdrop-blur-2xl transition hover:border-[var(--muted)]/45","aria-haspopup":"listbox","aria-expanded":n,children:[t.jsx("span",{className:"truncate",children:l.name}),t.jsx(xe,{size:14,className:`shrink-0 transition ${n?"rotate-180":""}`})]}),n?t.jsx("div",{className:"absolute left-0 right-0 z-30 mt-2 rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_50%,transparent)] p-1.5 shadow-[0_20px_42px_rgba(0,0,0,0.3)] backdrop-blur-2xl",children:t.jsx("div",{role:"listbox","aria-label":"Search engine",className:"max-h-56 overflow-y-auto",children:K.map(o=>{const u=o.id===l.id;return t.jsxs("button",{type:"button",role:"option","aria-selected":u,onClick:()=>{r(o.id),i()},className:`flex w-full items-center justify-between rounded-md px-3 py-2 text-left text-sm transition ${u?"bg-[color-mix(in_srgb,var(--accent)_12%,transparent)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[color-mix(in_srgb,var(--surface)_70%,white_3%)]"}`,children:[t.jsx("span",{children:o.name}),u?t.jsx(me,{size:14}):null]},o.id)})})}):null]})}function bn({showTopDivider:e=!0,settings:r,onSearchEngineChange:n,onPersistTabsChange:s,globalShortcutModifierLabel:a,listeningForGlobalShortcutModifier:i,onToggleGlobalShortcutModifierCapture:l,browserShortcutLabels:o}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e?"border-t border-[var(--border)] pt-8":"",children:t.jsx("h2",{className:"text-lg font-semibold text-[var(--text)]",children:"Proxy"})}),t.jsxs("div",{className:"mt-6 space-y-4",children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"Search Engine"}),t.jsx(pn,{selectedEngineId:r.searchEngine,onSelect:n})]}),t.jsxs("div",{className:"mt-8 space-y-4 border-t border-[var(--border)] pt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"Behavior"}),t.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 transition hover:border-[var(--muted)]/45",children:[t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Persist tabs on reload"}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:"Remember open tabs between sessions"})]}),t.jsx("input",{type:"checkbox",checked:r.persistTabs,onChange:u=>s(u.target.checked),className:"h-4 w-4 cursor-pointer rounded border-[var(--border)] bg-[var(--surface)] text-[var(--accent)] focus:ring-2 focus:ring-[var(--accent)] focus:ring-offset-0"})]}),t.jsxs("div",{className:"space-y-4 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Global shortcut"}),t.jsxs("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:["Prefix for browser actions: ",a]})]}),t.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:i?"Press modifier...":"Set shortcut"})]}),t.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[t.jsxs("div",{className:"rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2",children:[t.jsx("div",{className:"text-xs uppercase tracking-[0.18em] text-[var(--muted)]",children:"Shortcuts"}),t.jsxs("div",{className:"mt-2 space-y-1.5 text-sm text-[var(--text)]",children:[t.jsxs("div",{children:["Spotlight: ",o.spotlight]}),t.jsxs("div",{children:["New tab: ",o.newTab]}),t.jsxs("div",{children:["Close tab: ",o.closeTab]}),t.jsxs("div",{children:["Reload tab: ",o.reloadTab]})]})]}),t.jsxs("div",{className:"rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2",children:[t.jsx("div",{className:"text-xs uppercase tracking-[0.18em] text-[var(--muted)]",children:"Navigation"}),t.jsxs("div",{className:"mt-2 space-y-1.5 text-sm text-[var(--text)]",children:[t.jsxs("div",{children:["Address bar: ",o.focusAddressBar]}),t.jsxs("div",{children:["Next tab: ",o.nextTab]}),t.jsxs("div",{children:["Previous tab: ",o.previousTab]}),t.jsxs("div",{children:["Jump to tab: ",o.firstNineTabs]})]})]})]})]})]})]})}function hn({selectedPresetId:e,onSelect:r}){const{open:n,rootRef:s,toggleOpen:a,close:i}=be(),l=re.find(o=>o.id===e)??re[0];return t.jsxs("div",{ref:s,className:"relative",children:[t.jsxs("button",{type:"button",onClick:a,className:"flex h-11 w-full items-center justify-between rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_48%,transparent)] px-3 text-left text-sm text-[var(--text)] shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] backdrop-blur-2xl transition hover:border-[var(--muted)]/45","aria-haspopup":"listbox","aria-expanded":n,children:[t.jsx("span",{className:"truncate",children:l.label}),t.jsx(xe,{size:14,className:`shrink-0 transition ${n?"rotate-180":""}`})]}),n?t.jsx("div",{className:"absolute left-0 right-0 z-30 mt-2 rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_50%,transparent)] p-1.5 shadow-[0_20px_42px_rgba(0,0,0,0.3)] backdrop-blur-2xl",children:t.jsx("div",{role:"listbox","aria-label":"Cloak preset",className:"max-h-64 overflow-y-auto",children:re.map(o=>{const u=o.id===l.id;return t.jsxs("button",{type:"button",role:"option","aria-selected":u,onClick:()=>{r(o.id),i()},className:`flex w-full items-center justify-between rounded-md px-3 py-2 text-left text-sm transition ${u?"bg-[color-mix(in_srgb,var(--accent)_12%,transparent)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[color-mix(in_srgb,var(--surface)_70%,white_3%)]"}`,children:[t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block truncate",children:o.label}),o.title?t.jsx("span",{className:"mt-0.5 block truncate text-xs text-[var(--muted)]",children:o.title}):null]}),u?t.jsx(me,{size:14,className:"shrink-0"}):null]},o.id)})})}):null]})}function gn({showTopDivider:e=!0,settings:r,panicKeyLabel:n,listeningForPanicKey:s,panicUrlInput:a,panicUrlError:i,onTogglePanicKeyCapture:l,onPanicUrlChange:o,onSavePanicUrl:u,onCloakPresetChange:d,onOpenAboutBlankCloak:f,onAutoAboutBlankChange:p,onAutoCloakOnLightspeedChange:m,onConfirmLeaveChange:b}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:e?"border-t border-[var(--border)] pt-8":"",children:t.jsx("h2",{className:"text-lg font-semibold text-[var(--text)]",children:"Cloaking"})}),t.jsxs("div",{className:"mt-6 space-y-3 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:[t.jsx("p",{className:"text-xs text-[var(--muted)]",children:"Configure a panic shortcut and tab cloaking behavior."}),t.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto] sm:items-center",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-[var(--text)]",children:"Panic key"}),t.jsxs("p",{className:"text-xs text-[var(--muted)]",children:["Current key: ",n]})]}),t.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:s?"Press a key...":"Set key"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{htmlFor:"panic-url",className:"text-xs text-[var(--muted)]",children:"Panic redirect URL"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{id:"panic-url",type:"text",value:a,onChange:x=>o(x.target.value),placeholder:"https://classroom.google.com",className:"w-full rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm text-[var(--text)] outline-none transition placeholder:text-[var(--muted)]/60 focus:border-[var(--accent)]"}),t.jsx("button",{type:"button",onClick:u,disabled:!!i,className:"rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45 disabled:cursor-not-allowed disabled:opacity-50",children:"Save"})]}),i?t.jsx("p",{className:"text-xs text-red-400",children:i}):null]})]}),t.jsxs("div",{className:"mt-8 space-y-4 border-t border-[var(--border)] pt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"Tab Disguise"}),t.jsx("div",{className:"grid gap-3 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-xs text-[var(--muted)]",children:"Preset"}),t.jsx("p",{className:"text-xs text-[var(--muted)]",children:"Select a cloak to always disguise this tab. Choose None to disable."}),t.jsx(hn,{selectedPresetId:r.cloakPreset,onSelect:d})]})})]}),t.jsxs("div",{className:"mt-8 space-y-4 border-t border-[var(--border)] pt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-[var(--text)]",children:"about:blank"}),t.jsxs("div",{className:"space-y-2 rounded-md border border-[var(--border)] bg-[var(--surface-2)] p-4",children:[t.jsx("p",{className:"text-sm text-[var(--text)]",children:"about:blank cloak"}),t.jsx("p",{className:"text-xs text-[var(--muted)]",children:"Open Lucide inside an about:blank tab and redirect this tab to your panic URL."}),t.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-[var(--border)] bg-[var(--surface)] px-3 py-2 text-sm font-medium text-[var(--text)] transition hover:border-[var(--muted)]/45",children:"Open about:blank cloak"})]}),t.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 transition hover:border-[var(--muted)]/45",children:[t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Auto about:blank"}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:"Automatically open in an about:blank tab when you visit the site."})]}),t.jsx("input",{type:"checkbox",checked:r.autoAboutBlank,onChange:x=>p(x.target.checked),className:"h-4 w-4 cursor-pointer rounded border-[var(--border)] bg-[var(--surface)] text-[var(--accent)] focus:ring-2 focus:ring-[var(--accent)] focus:ring-offset-0"})]}),t.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 transition hover:border-[var(--muted)]/45",children:[t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Auto-cloak when Lightspeed is detected"}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:"If Lightspeed Filter Agent or Classroom is installed, silently open Lucide inside an about:blank tab so the filter cannot see the URL."})]}),t.jsx("input",{type:"checkbox",checked:r.autoCloakOnLightspeed,onChange:x=>m(x.target.checked),className:"h-4 w-4 cursor-pointer rounded border-[var(--border)] bg-[var(--surface)] text-[var(--accent)] focus:ring-2 focus:ring-[var(--accent)] focus:ring-offset-0"})]}),t.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-3 py-2 transition hover:border-[var(--muted)]/45",children:[t.jsxs("span",{children:[t.jsx("span",{className:"block text-sm text-[var(--text)]",children:"Confirm before leaving"}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--muted)]",children:"Show a confirmation prompt when closing or navigating away from the page."})]}),t.jsx("input",{type:"checkbox",checked:r.confirmLeave,onChange:x=>b(x.target.checked),className:"h-4 w-4 cursor-pointer rounded border-[var(--border)] bg-[var(--surface)] text-[var(--accent)] focus:ring-2 focus:ring-[var(--accent)] focus:ring-offset-0"})]})]})]})}const F="images",he="newTab",rt="lucide-backgrounds";function ge(){return new Promise((e,r)=>{const n=indexedDB.open(rt,1);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(F)||s.createObjectStore(F)},n.onsuccess=()=>e(n.result),n.onerror=()=>r(n.error)})}function ve(e){return new Promise((r,n)=>{e.onsuccess=()=>r(e.result),e.onerror=()=>n(e.error)})}async function vn(){if(typeof window>"u")return null;try{const e=await ge();try{const n=e.transaction(F,"readonly").objectStore(F),s=await ve(n.get(he));return s instanceof Blob?s:null}finally{e.close()}}catch{return null}}async function yn(e){const r=await ge();try{const n=r.transaction(F,"readwrite"),s=n.objectStore(F);await ve(s.put(e,he)),await new Promise((a,i)=>{n.oncomplete=()=>a(),n.onerror=()=>i(n.error),n.onabort=()=>i(n.error)})}finally{r.close()}}async function kn(){try{const e=await ge();try{const r=e.transaction(F,"readwrite"),n=r.objectStore(F);await ve(n.delete(he)),await new Promise((s,a)=>{r.oncomplete=()=>s(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error)})}finally{e.close()}}catch{}}const wn=8*1024*1024;function jn(){const{themes:e,activeThemeId:r,activeTheme:n,customAccent:s,setTheme:a,setCustomAccent:i,resetAccent:l}=At(),o=e.filter(h=>h.id==="dark"||h.id==="light"),[u,d]=c.useState(kt),[f,p]=c.useState(null),[m,b]=c.useState(null),[x,y]=c.useState(u.panicUrl),[g,w]=c.useState(null),[C,R]=c.useState(!1),[j,D]=c.useState(!1),N=(h,v)=>{d(U=>({...U,[h]:v})),Y(h,v)};c.useEffect(()=>{let h=!1,v=null;return vn().then(U=>{h||!U||(v=URL.createObjectURL(U),p(v))}),()=>{h=!0,v&&URL.revokeObjectURL(v)}},[]);const I=async h=>{if(!h.type.startsWith("image/")){b("Please choose an image file.");return}if(h.size>wn){b("Image is too large (max 8 MB).");return}try{await yn(h),p(v=>(v&&URL.revokeObjectURL(v),URL.createObjectURL(h))),b(null),_e(),Ae("setting-updated")}catch{b("Failed to save background.")}},E=async()=>{await kn(),p(h=>(h&&URL.revokeObjectURL(h),null)),b(null),_e(),Ae("setting-updated")},S=h=>{y(h);const v=ne(h);w(v.valid?null:v.error||null)},L=()=>{const h=ne(x);if(!h.valid||!h.value){w(h.error||"Invalid URL");return}y(h.value),w(null),N("panicUrl",h.value)},P=h=>{const v=Ct(h);d(U=>({...U,cloakPreset:v.id,cloakTitle:v.title,cloakFavicon:v.favicon})),Y("cloakPreset",v.id),Y("cloakTitle",v.title),Y("cloakFavicon",v.favicon)},V=()=>{const h=ne(u.panicUrl);if(!h.valid||!h.value){w("Set a valid panic URL before using about:blank cloak.");return}const v=Nt({panicUrl:h.value,cloakTitle:u.cloakTitle||"Untitled",cloakFavicon:u.cloakFavicon||"https://ssl.gstatic.com/classroom/favicon.png"});v.success||w(v.error||"Failed to open about:blank cloak.")},B=h=>{N("autoAboutBlank",h)};c.useEffect(()=>{if(!C)return;const h=v=>{St(v.key)&&(v.preventDefault(),v.stopPropagation(),N("globalShortcutModifier",v.key),R(!1))};return window.addEventListener("keydown",h,!0),()=>{window.removeEventListener("keydown",h,!0)}},[C]),c.useEffect(()=>{if(!j)return;Ce(!0);const h=v=>{v.preventDefault(),v.stopPropagation(),N("panicKey",v.key),D(!1)};return window.addEventListener("keydown",h,!0),()=>{window.removeEventListener("keydown",h,!0),Ce(!1)}},[j]);const T=u.panicKey===" "?"Space":u.panicKey,H=wt(u.globalShortcutModifier),ee={spotlight:$(u.globalShortcutModifier,"F"),newTab:$(u.globalShortcutModifier,"T"),closeTab:$(u.globalShortcutModifier,"W"),reloadTab:$(u.globalShortcutModifier,"R"),focusAddressBar:$(u.globalShortcutModifier,"L"),nextTab:$(u.globalShortcutModifier,"ArrowRight"),previousTab:$(u.globalShortcutModifier,"ArrowLeft"),firstNineTabs:`${H} + 1-9`};return{themes:o,activeThemeId:r,activeTheme:n,customAccent:s,setTheme:a,setCustomAccent:i,resetAccent:l,proxySettings:u,newTabBackgroundPreviewUrl:f,newTabBackgroundError:m,panicUrlInput:x,panicUrlError:g,listeningForGlobalShortcutModifier:C,setListeningForGlobalShortcutModifier:R,listeningForPanicKey:j,setListeningForPanicKey:D,handleUpdateProxySetting:N,handleUploadNewTabBackground:I,handleResetNewTabBackground:E,handlePanicUrlChange:S,handleSavePanicUrl:L,handleCloakPresetChange:P,handleOpenAboutBlankCloak:V,handleAutoAboutBlankChange:B,panicKeyLabel:T,globalShortcutModifierLabel:H,browserShortcutLabels:ee,clearAllData:jt,exportSettingsData:an,importSettingsData:on,unregisterServiceWorkers:ze}}const Sn=[{id:"appearance",title:"Appearance",subtitle:"Themes and accents",icon:vr},{id:"proxy",title:"Proxy",subtitle:"Transport and behavior",icon:Ur},{id:"cloud",title:"Account",subtitle:"Discord sign-in and tier",icon:W},{id:"safety",title:"Cloaking",subtitle:"Panic key and disguises",icon:Mr},{id:"data",title:"Data",subtitle:"Import, export, reset",icon:Nr}];function zn({open:e,onClose:r,auth:n,initialSection:s="appearance"}){const a=hr(),[i,l]=c.useState(s),o=jn(),u=()=>{switch(i){case"appearance":return t.jsx(un,{themes:o.themes,activeThemeId:o.activeThemeId,activeTheme:o.activeTheme,customAccent:o.customAccent,showShortcutsOnNewTab:o.proxySettings.newTabBehavior==="shortcuts",newTabBackgroundPreviewUrl:o.newTabBackgroundPreviewUrl,newTabBackgroundError:o.newTabBackgroundError,onSetTheme:o.setTheme,onSetCustomAccent:o.setCustomAccent,onResetAccent:o.resetAccent,onNewTabBehaviorChange:d=>o.handleUpdateProxySetting("newTabBehavior",d?"shortcuts":"blank"),onUploadNewTabBackground:o.handleUploadNewTabBackground,onResetNewTabBackground:o.handleResetNewTabBackground});case"proxy":return t.jsx(bn,{showTopDivider:!1,settings:o.proxySettings,onSearchEngineChange:d=>o.handleUpdateProxySetting("searchEngine",d),onPersistTabsChange:d=>o.handleUpdateProxySetting("persistTabs",d),globalShortcutModifierLabel:o.globalShortcutModifierLabel,listeningForGlobalShortcutModifier:o.listeningForGlobalShortcutModifier,onToggleGlobalShortcutModifierCapture:()=>o.setListeningForGlobalShortcutModifier(d=>!d),browserShortcutLabels:o.browserShortcutLabels});case"safety":return t.jsx(gn,{showTopDivider:!1,settings:o.proxySettings,panicKeyLabel:o.panicKeyLabel,listeningForPanicKey:o.listeningForPanicKey,panicUrlInput:o.panicUrlInput,panicUrlError:o.panicUrlError,onTogglePanicKeyCapture:()=>o.setListeningForPanicKey(d=>!d),onPanicUrlChange:o.handlePanicUrlChange,onSavePanicUrl:o.handleSavePanicUrl,onCloakPresetChange:o.handleCloakPresetChange,onOpenAboutBlankCloak:o.handleOpenAboutBlankCloak,onAutoAboutBlankChange:o.handleAutoAboutBlankChange,onAutoCloakOnLightspeedChange:d=>o.handleUpdateProxySetting("autoCloakOnLightspeed",d),onConfirmLeaveChange:d=>o.handleUpdateProxySetting("confirmLeave",d)});case"cloud":return t.jsx(mn,{showTopDivider:!1,auth:n});case"data":return t.jsx(xn,{showTopDivider:!1,onClearAllData:o.clearAllData,onExportData:o.exportSettingsData,onImportData:o.importSettingsData,onUnregisterServiceWorkers:o.unregisterServiceWorkers});default:return null}};return c.useEffect(()=>{e&&l(s)},[s,e]),c.useEffect(()=>{if(!e)return;const d=document.body;if(!d)return;const f=d.style.overflow,p=m=>{m.key==="Escape"&&(m.preventDefault(),r())};return d.style.overflow="hidden",window.addEventListener("keydown",p),()=>{d.style.overflow=f,window.removeEventListener("keydown",p)}},[e,r]),t.jsx(qt,{initial:!1,children:e?t.jsxs(oe.div,{className:"fixed inset-0 z-40 flex items-center justify-center p-3 sm:p-6",initial:a?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:a?0:.08},onClick:r,children:[t.jsx(oe.div,{className:"absolute inset-0 bg-[rgba(6,10,18,0.48)] backdrop-blur-[8px]","aria-hidden":"true",initial:a?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:a?0:.08}}),t.jsxs(oe.section,{role:"dialog","aria-modal":"true","aria-labelledby":"lucide-settings-modal-title",onClick:d=>d.stopPropagation(),initial:a?!1:{opacity:0,y:-18,scale:.98},animate:{opacity:1,y:0,scale:1},exit:a?{opacity:0}:{opacity:0,y:-12,scale:.98},transition:{duration:a?0:.1},className:"relative z-10 flex h-[min(79vh,660px)] w-full max-w-[58rem] flex-col overflow-hidden rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_58%,transparent)] shadow-[0_28px_68px_rgba(0,0,0,0.5)] backdrop-blur-xl",style:{fontFamily:"Manrope Variable, Geist Variable, ui-sans-serif, system-ui, sans-serif"},children:[t.jsxs("header",{className:"relative flex items-center justify-between border-b border-[color-mix(in_srgb,var(--border)_58%,transparent)] px-4 py-3 sm:px-6 sm:py-4",children:[t.jsx("div",{children:t.jsx("h2",{id:"lucide-settings-modal-title",className:"text-lg font-semibold text-[var(--text)] sm:text-xl",children:"Settings"})}),t.jsx("button",{type:"button",onClick:r,className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-[color-mix(in_srgb,var(--surface)_56%,transparent)] text-[var(--muted)] transition hover:bg-[var(--surface-2)] hover:text-[var(--text)]","aria-label":"Close settings",children:t.jsx(Mt,{size:15,strokeWidth:2.2})})]}),t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col md:flex-row",children:[t.jsx("aside",{className:"relative border-b border-[color-mix(in_srgb,var(--border)_58%,transparent)] bg-transparent p-2.5 md:w-[15.75rem] md:border-b-0 md:border-r md:p-3",children:t.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1 md:flex-col md:gap-2.5 md:overflow-visible md:pb-0",children:Sn.map(d=>{const f=d.id===i,p=d.icon;return t.jsxs("button",{type:"button",onClick:()=>l(d.id),className:`group flex shrink-0 items-center gap-2 rounded-md border px-3 py-2 text-left transition md:w-full ${f?"border-[color-mix(in_srgb,var(--accent)_55%,var(--border))] bg-[color-mix(in_srgb,var(--accent)_16%,var(--surface))] text-[var(--text)]":"border-[var(--border)] bg-[var(--surface)] text-[var(--muted)] hover:bg-[var(--surface-2)] hover:text-[var(--text)]"}`,"aria-pressed":f,children:[t.jsx("span",{className:`inline-flex h-8 w-8 items-center justify-center rounded-md border transition ${f?"border-[color-mix(in_srgb,var(--accent)_35%,var(--border))] bg-[var(--surface)] text-[var(--accent)]":"border-[var(--border)] bg-[var(--surface)] text-[var(--muted)] group-hover:text-[var(--text)]"}`,children:t.jsx(p,{size:15,strokeWidth:2.1})}),t.jsxs("span",{className:"pr-1",children:[t.jsx("span",{className:"block text-sm font-semibold leading-tight",children:d.title}),t.jsx("span",{className:"mt-0.5 block text-[11px] leading-tight text-[var(--muted)]",children:d.subtitle})]})]},d.id)})})}),t.jsx("div",{className:"min-h-0 flex-1 overflow-hidden bg-transparent",children:t.jsx("div",{className:"h-full overflow-y-auto px-4 py-4 sm:px-6 sm:py-6",children:u()})})]})]})]}):null})}const Nn=[rt];async function ye(e,r){const n=new Headers(r?.headers);if(r?.body&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),!n.has("Authorization"))try{const a=window.localStorage.getItem("lucide.shellToken");a&&a.length>0&&n.set("Authorization",`Bearer ${a}`)}catch{}const s=await _t(e,{credentials:"include",...r,headers:n});if(s.status===401)throw new Error("unauthorized");if(!s.ok){const a=await s.json().catch(()=>null);throw new Error(a?.message||`Cloud sync request failed with status ${s.status}`)}return await s.json()}async function Cn(){return(await ye("/api/sync/latest/meta",{method:"GET"})).snapshot}async function Ue(){return(await ye("/api/sync/latest",{method:"GET"})).snapshot}async function _n(e){const r={...e,exportedAt:0},n=new TextEncoder().encode(JSON.stringify(r)),s=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(s)).map(a=>a.toString(16).padStart(2,"0")).join("")}async function An(){const e=await et({excludedDatabaseNames:Nn}),r=await _n(e);return{payload:e,payloadHash:r}}async function Mn(e){const r=await ye("/api/sync/latest",{method:"PUT",body:JSON.stringify({schemaVersion:cn,payload:e})});if(!r.snapshot)throw new Error("Cloud sync save failed");return r.snapshot}async function Oe(e){await tt(e.payload)}const Rn=15e3,En=6e4,Pn=5*6e4;function Fe(e){const r=Number(localStorage.getItem(e)||"");return Number.isFinite(r)?r:0}function Hn(){const{data:e,isPending:r,refetch:n}=X.useSession(),[s,a]=c.useState(!1),[i,l]=c.useState(!1),[o,u]=c.useState(!1),[d,f]=c.useState(null),[p,m]=c.useState(null),[b,x]=c.useState(null),[y,g]=c.useState(null),w=Fe(A.cloudSyncLastSyncedAt),[C,R]=c.useState(w),j=c.useRef(null),D=c.useRef(!1),N=c.useRef(!1),I=c.useRef(null),E=c.useRef(w),S=c.useRef(localStorage.getItem(A.cloudSyncLastHash)||""),L=!!e?.user?.id,P=e?.user?.id??null,V=c.useCallback(()=>{S.current="",E.current=0,I.current=null,R(0),g(null),localStorage.removeItem(A.cloudSyncLastHash),localStorage.removeItem(A.cloudSyncLastSyncedAt),localStorage.removeItem(A.cloudSyncLastUserId)},[]),B=c.useCallback((k,_,O)=>{S.current=k,E.current=_,I.current=null,R(_),localStorage.setItem(A.cloudSyncLastHash,k),localStorage.setItem(A.cloudSyncLastSyncedAt,String(_)),localStorage.setItem(A.cloudSyncLastUserId,O)},[]),T=c.useCallback(async k=>{if(!L||!P||D.current||!N.current&&!k)return!1;const _=Date.now();if(!k&&_-E.current<En)return!1;D.current=!0,u(!0),f(null);try{const{payload:O,payloadHash:z}=await An();if(!k&&z===S.current)return N.current=!1,!0;const G=await Mn(O);return B(G.payloadHash,G.updatedAt,P),g(null),N.current=!1,!0}catch(O){const z=O instanceof Error?O.message:"Cloud sync failed";return f(z),!1}finally{D.current=!1,u(!1)}},[P,L,B]),H=c.useCallback(()=>{N.current=!0,j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{T(!1)},Rn)},[T]),ee=c.useCallback(async()=>{N.current=!0;const k=await T(!0);return k&&m("Cloud backup uploaded."),k},[T]),h=c.useCallback(async()=>{if(!P)return!1;f(null),m(null),u(!0);try{const k=await Ue();return k?(I.current=null,g(null),m("Restoring latest cloud backup..."),await Oe(k),B(k.payloadHash,k.updatedAt,P),window.location.reload(),!0):(f("No cloud backup found yet."),!1)}catch(k){const _=k instanceof Error?k.message:"Failed to restore cloud backup";return f(_),!1}finally{u(!1)}},[P,B]),v=c.useCallback(()=>{I.current=y?.payloadHash??null,g(null)},[y]),U=c.useCallback(()=>{a(!0),f(null),m(null)},[]),nt=c.useCallback(()=>{a(!1),f(null),m(null)},[]),st=c.useCallback(()=>{x(null),f(null),m(null)},[]),at=c.useCallback(async k=>{l(!0),f(null),m(null);try{const _=await X.requestDiscordCode({discordUsername:k});return _.error?(f(_.error.message),!1):_.data?(x(_.data),m(`Sent a sign-in code to ${_.data.deliveryTarget} on Discord.`),!0):(f("Could not send a Discord sign-in code"),!1)}finally{l(!1)}},[]),ot=c.useCallback(async k=>{if(!b)return f("Request a Discord sign-in code first."),!1;l(!0),f(null),m(null);try{const _=await X.verifyDiscordCode({challengeId:b.challengeId,otpCode:k});return _.error?(f(_.error.message),!1):(x(null),await n(),a(!1),!0)}finally{l(!1)}},[b,n]),it=c.useCallback(async()=>{l(!0),f(null),m(null);try{await X.signOut(),x(null),N.current=!1,g(null),V(),await n()}finally{l(!1)}},[V,n]);return c.useEffect(()=>{const k=()=>{H()};return window.addEventListener(Me,k),()=>{window.removeEventListener(Me,k)}},[H]),c.useEffect(()=>{if(!L||!P)return;let k=!1;(async()=>{try{const te=await Cn();if(k)return;const ct=Fe(A.cloudSyncLastSyncedAt),ke=localStorage.getItem(A.cloudSyncLastHash)||"",we=localStorage.getItem(A.cloudSyncLastUserId)||"",lt=we!==""&&we!==P;if(!te){g(null),N.current=!0,T(!1);return}const je=te.payloadHash!==ke,dt=te.updatedAt>ct&&je;if(je&&(lt||!ke||dt)){const q=await Ue();if(k)return;if(!q){N.current=!0,T(!1);return}I.current=null,g(null),m("Restoring latest cloud backup..."),u(!0);try{if(await Oe(q),k)return;B(q.payloadHash,q.updatedAt,P),window.location.reload()}finally{k||u(!1)}return}g(null),I.current=null,m(null),N.current=!0,T(!1)}catch{g(null),N.current=!0,T(!1)}})();const O=window.setInterval(()=>{document.visibilityState==="visible"&&(N.current=!0,T(!1))},Pn),z=()=>{document.visibilityState==="hidden"&&T(!0)},G=()=>{T(!0)};return document.addEventListener("visibilitychange",z),window.addEventListener("pagehide",G),()=>{k=!0,window.clearInterval(O),document.removeEventListener("visibilitychange",z),window.removeEventListener("pagehide",G)}},[P,T,L,B]),c.useEffect(()=>()=>{j.current!==null&&window.clearTimeout(j.current)},[]),{session:e,sessionPending:r,modalOpen:s,authBusy:i||o,authError:d,authNotice:p,pendingChallenge:b,restorePromptMeta:y,lastSyncedAt:C,isAuthenticated:L,openAuthModal:U,closeAuthModal:nt,resetChallenge:st,requestDiscordCode:at,verifyDiscordCode:ot,signOut:it,backupNow:ee,restoreLatestFromCloud:h,dismissRestorePrompt:v}}export{qt as A,me as C,ln as D,Fn as E,Un as G,Pr as L,ue as M,Tr as R,On as S,Vr as T,Hn as a,Bn as b,xe as c,zn as d,We as e,br as f,de as g,Ur as h,W as i,K as j,$n as k,Vn as l,oe as m,vn as r,hr as u};
@@ -0,0 +1 @@
1
+ import{c as t,r as o,aZ as c}from"./index-8N-ebit3.js";const r=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],n=t("search",r);const s=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],d=t("x",s);function h(){const e=o.useContext(c);if(!e)throw new Error("useThemeCatalog must be used inside ThemeProvider");return e}export{n as S,d as X,h as u};
@@ -0,0 +1 @@
1
+ (function(_0x3a0a25,_0x2a5452){const _0x3ecfec={_0x588074:0x41d,_0x52a16f:0x429,_0x55116a:0x42c,_0x12a97d:0x40d,_0x1ab661:0x40c,_0xb5a3b9:0x418,_0x17f1e4:0x414,_0x357208:0x410,_0x30fbba:0x40f,_0xd4fb95:0x417,_0x23a9b8:0x35c,_0x442268:0x35e,_0x550872:0x361,_0x15ceca:0x409,_0x3e8e23:0x3fe,_0x4741a9:0x354,_0x869b8:0x34e,_0x1bfd1e:0x40d,_0x31790c:0x403,_0x4f6950:0x353,_0x18e181:0x34d,_0x8142a:0x350,_0x254036:0x35a,_0x31aba4:0x359,_0x4b245f:0x411,_0xb42a75:0x416,_0x5bcd97:0x41a,_0x5097d0:0x418},_0x31b75a={_0x587e6b:0x2ae};function _0x173219(_0x42ad2c,_0x264d39,_0x105a32,_0x454888){return _0xeaef(_0x454888-0x36a,_0x264d39);}function _0x47ae4f(_0x5d9298,_0x14366a,_0x47469f,_0x50f684){return _0xeaef(_0x50f684-_0x31b75a._0x587e6b,_0x14366a);}const _0x2b53b5=_0x3a0a25();while(!![]){try{const _0x31e0b3=parseInt(_0x173219(_0x3ecfec._0x588074,_0x3ecfec._0x52a16f,_0x3ecfec._0x55116a,0x41f))/(0x3e8+0x23e9+-0x27d0)+-parseInt(_0x173219(_0x3ecfec._0x12a97d,_0x3ecfec._0x1ab661,_0x3ecfec._0xb5a3b9,_0x3ecfec._0x17f1e4))/(-0x21cb+0x5fd*-0x6+0x1*0x45bb)+-parseInt(_0x173219(_0x3ecfec._0x357208,_0x3ecfec._0x30fbba,_0x3ecfec._0xd4fb95,0x41e))/(0xd*-0x53+0x6*0x1ab+-0x5c8)*(-parseInt(_0x47ae4f(_0x3ecfec._0x23a9b8,_0x3ecfec._0x442268,_0x3ecfec._0x550872,0x356))/(0x10*-0xb8+0x780*0x2+-0x37c))+-parseInt(_0x173219(_0x3ecfec._0x17f1e4,_0x3ecfec._0x15ceca,_0x3ecfec._0x3e8e23,_0x3ecfec._0x1ab661))/(0x198d*0x1+-0x1*0x542+-0x1446)+parseInt(_0x47ae4f(_0x3ecfec._0x4741a9,_0x3ecfec._0x869b8,0x35c,0x35b))/(-0x97*-0x16+0xc5e+0x39e*-0x7)*(-parseInt(_0x173219(_0x3ecfec._0x1bfd1e,0x408,0x3f4,_0x3ecfec._0x31790c))/(-0x4c*-0x49+-0x167*-0x11+-0x2*0x16be))+parseInt(_0x47ae4f(_0x3ecfec._0x4f6950,0x346,0x33e,_0x3ecfec._0x18e181))/(-0x1*-0x1e1e+0xc4b+0x23b*-0x13)+-parseInt(_0x47ae4f(0x363,_0x3ecfec._0x8142a,_0x3ecfec._0x254036,_0x3ecfec._0x31aba4))/(0x4be+0x2ae+-0x763)*(parseInt(_0x173219(_0x3ecfec._0x4b245f,_0x3ecfec._0xb42a75,_0x3ecfec._0x5bcd97,_0x3ecfec._0x5097d0))/(-0x101b*0x1+-0x90f*0x3+-0x8aa*-0x5));if(_0x31e0b3===_0x2a5452)break;else _0x2b53b5['push'](_0x2b53b5['shift']());}catch(_0x306050){_0x2b53b5['push'](_0x2b53b5['shift']());}}}(_0x2b2e,-0x153cdf*0x1+0x179fb3*0x1+-0x26fb*-0x40));const _0x4c15f6=(function(){let _0x2a7b1c=!![];return function(_0x35a594,_0x4142a6){const _0xf5b272={_0x3c663e:0x3,_0x40098f:0x19},_0x5b104a={_0x507c9a:0xb3},_0x1bf340=_0x2a7b1c?function(){function _0x1554fc(_0x10ae95,_0x4a5ff4,_0x6bf7a1,_0x59c778){return _0xeaef(_0x4a5ff4- -_0x5b104a._0x507c9a,_0x10ae95);}if(_0x4142a6){const _0x30f7bf=_0x4142a6[_0x1554fc(-_0xf5b272._0x3c663e,-0x10,-0x8,-_0xf5b272._0x40098f)](_0x35a594,arguments);return _0x4142a6=null,_0x30f7bf;}}:function(){};return _0x2a7b1c=![],_0x1bf340;};}());function _0x28a554(_0xde490,_0x335173,_0x2fccb8,_0x477633){return _0xeaef(_0x477633- -0xa3,_0x2fccb8);}const _0xa3f9dc=_0x4c15f6(this,function(){const _0x39bcd7={_0x3d7c5f:0x9d,_0xc21ee9:0x91,_0x4f7381:0x85,_0x207b71:0x94,_0x325bba:0x87,_0x2a89a5:0xa2,_0x38e411:0x98,_0x10203b:0x9c,_0x230ea1:0x93,_0x177ffb:0x83,_0x173734:0x75,_0x187bff:0x94,_0x4b8371:0x91,_0x26ab2c:0x8a,_0x499248:0x94,_0x591055:0x91,_0x71ac1d:0x9a,_0x41ae44:0x9a,_0x44bf07:0x92,_0x5d869d:0x98},_0x5868f6={_0x2f5fb1:0x15},_0x416bf7={_0x58c9b0:0x13a},_0x183c46={};function _0x130958(_0x2d0c3a,_0x3ecc87,_0xa4e072,_0xdc512a){return _0xeaef(_0x3ecc87- -_0x416bf7._0x58c9b0,_0xa4e072);}_0x183c46[_0x130958(-_0x39bcd7._0x3d7c5f,-_0x39bcd7._0xc21ee9,-0x84,-0x82)]=_0x130958(-_0x39bcd7._0x4f7381,-_0x39bcd7._0x207b71,-_0x39bcd7._0x325bba,-_0x39bcd7._0x2a89a5)+'+$';function _0x57f712(_0x5a4031,_0x2fbb38,_0x1fc30d,_0x36f75d){return _0xeaef(_0x2fbb38- -_0x5868f6._0x2f5fb1,_0x36f75d);}const _0x4f420e=_0x183c46;return _0xa3f9dc[_0x57f712(_0x39bcd7._0x38e411,_0x39bcd7._0x10203b,_0x39bcd7._0x230ea1,_0x39bcd7._0x230ea1)]()[_0x57f712(0x8c,_0x39bcd7._0x177ffb,_0x39bcd7._0x173734,0x77)](_0x4f420e[_0x130958(-_0x39bcd7._0x187bff,-_0x39bcd7._0x4b8371,-_0x39bcd7._0x26ab2c,-_0x39bcd7._0x499248)])['toString']()[_0x57f712(_0x39bcd7._0x591055,_0x39bcd7._0x71ac1d,_0x39bcd7._0x41ae44,0xa9)+'r'](_0xa3f9dc)['search'](_0x4f420e[_0x130958(-_0x39bcd7._0x44bf07,-0x91,-_0x39bcd7._0x5d869d,-0x9f)]);});_0xa3f9dc();function _0x6c4b49(_0x4ca3d1,_0x2e418a,_0x4465eb,_0x4e934e){return _0xeaef(_0x4e934e- -0x53,_0x2e418a);}import{Q as _0x54d6fb}from'./73sxysj46r.js';function _0xeaef(_0xeaefbe,_0x17a0d4){_0xeaefbe=_0xeaefbe-(0x76f+0x24ea+-0x1*0x2bc1);const _0x321657=_0x2b2e();let _0x3271f3=_0x321657[_0xeaefbe];return _0x3271f3;}function _0x2b2e(){const _0x5bc69f=['path','toString','67-.01C7.5','1c2\x200\x204.5-','3qMOzAF','1309026EFRsEp','search','28viMqNN','1\x200\x200\x201\x201\x20','\x205\x2019\x205a1\x20','\x204\x2013V6a1\x20','1\x200\x200\x201\x201-','.17\x200\x200\x201\x20','3709384GbzxKd','1.2\x206.24-2','M20\x2013c0\x205','7645215chwNCV','apply','.72a1.17\x201','.66\x208.95a1','(((.+)+)+)','1.52\x200C14.','4859956fMclkW','wRGXF','709162VuRTAi','18qUEdLz','shield','283278fDdpqD','600920VLUuMz','constructo'];_0x2b2e=function(){return _0x5bc69f;};return _0x2b2e();}const _0x3eceb2={};_0x3eceb2['d']=_0x28a554(-0x6,0x6,0xb,-0x2)+'-3.5\x207.5-7'+_0x6c4b49(0x50,0x45,0x5c,0x52)+'\x201\x200\x200\x201-.'+_0x6c4b49(0x60,0x52,0x5a,0x5f)+'\x2020.5\x204\x2018'+_0x28a554(-0xb,0x3,-0x7,-0x7)+_0x6c4b49(0x46,0x41,0x49,0x4a)+_0x28a554(0x1a,0x7,0x1,0x10)+_0x6c4b49(0x50,0x4c,0x43,0x4d)+_0x6c4b49(0x4f,0x4d,0x49,0x51)+_0x28a554(0x9,-0x11,0x3,-0x5)+_0x28a554(0x7,-0x7,0x9,0x4)+'51\x203.81\x2017'+_0x28a554(-0x1,0x4,-0xa,-0x8)+_0x6c4b49(0x51,0x55,0x4d,0x47)+'1z',_0x3eceb2['key']='oel41y';const o=[[_0x6c4b49(0x54,0x54,0x52,0x5d),_0x3eceb2]],c=_0x54d6fb(_0x6c4b49(0x4c,0x61,0x68,0x59),o);export{c as S};