@sudobility/components 4.0.29 → 4.0.31

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.
package/dist/index.esm.js CHANGED
@@ -18523,13 +18523,13 @@ const Zu = ({ children: e }) => /* @__PURE__ */ n(H, { children: e }), Ju = ({
18523
18523
  )
18524
18524
  ]
18525
18525
  }
18526
- ) }), vg = ({ children: e, className: t }) => /* @__PURE__ */ n("div", { className: m("flex items-center space-x-2 shrink-0", t), children: e }), xg = ({ children: e, className: t }) => /* @__PURE__ */ n(
18526
+ ) }), vg = ({ children: e, className: t }) => /* @__PURE__ */ n("div", { className: m("flex items-center gap-2 shrink-0", t), children: e }), xg = ({ children: e, className: t }) => /* @__PURE__ */ n(
18527
18527
  "div",
18528
18528
  {
18529
18529
  className: m("flex-1 flex items-center justify-center px-4", t),
18530
18530
  children: e
18531
18531
  }
18532
- ), wg = ({ children: e, className: t }) => /* @__PURE__ */ n("div", { className: m("flex items-center space-x-2 shrink-0", t), children: e }), kg = ({
18532
+ ), wg = ({ children: e, className: t }) => /* @__PURE__ */ n("div", { className: m("flex items-center gap-2 shrink-0", t), children: e }), kg = ({
18533
18533
  children: e,
18534
18534
  className: t
18535
18535
  }) => /* @__PURE__ */ n("div", { className: m("md:hidden px-4 pb-3", t), children: e }), Ng = ({
@@ -18917,7 +18917,8 @@ const Zu = ({ children: e }) => /* @__PURE__ */ n(H, { children: e }), Ju = ({
18917
18917
  collapseBelow: r = "lg",
18918
18918
  align: a = "center",
18919
18919
  className: o,
18920
- mobileMenuLabel: i = "Toggle navigation menu"
18920
+ mobileMenuLabel: i = "Toggle navigation menu",
18921
+ children: s
18921
18922
  }) => /* @__PURE__ */ f(H, { children: [
18922
18923
  /* @__PURE__ */ n(
18923
18924
  zi,
@@ -18929,6 +18930,7 @@ const Zu = ({ children: e }) => /* @__PURE__ */ n(H, { children: e }), Ju = ({
18929
18930
  className: o
18930
18931
  }
18931
18932
  ),
18933
+ s,
18932
18934
  /* @__PURE__ */ n(
18933
18935
  Fi,
18934
18936
  {
package/dist/index.umd.js CHANGED
@@ -53,7 +53,7 @@ Nonce: ${h}`}function a(c,u=24){const h=new Date(c.getTime()+u*60*60*1e3);return
53
53
  `,children:[o&&t.jsx("div",{className:"absolute top-4 right-4",children:t.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"✓ Verified"})}),t.jsx("h3",{className:"text-xl font-bold mb-2",children:l.title}),t.jsx("p",{className:"text-gray-600 mb-4",children:l.description}),t.jsxs("p",{className:"text-3xl font-bold mb-4",children:[r,t.jsx("span",{className:"text-sm font-normal text-gray-600",children:"/year"})]}),t.jsx("ul",{className:"space-y-2 mb-6",children:a.map((d,c)=>t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-green-500 mt-0.5",children:"✓"}),t.jsx("span",{className:"text-sm",children:d})]},c))}),s&&t.jsx("button",{onClick:s,disabled:o,className:`
54
54
  w-full py-2 px-4 rounded font-medium transition-colors
55
55
  ${o?"bg-gray-200 text-gray-500 cursor-not-allowed":n?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-700 hover:bg-gray-300"}
56
- `,children:o?"Verified":n?"Current Plan":"Select Plan"})]})},f0=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),b0=({title:e,description:r})=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),m0=({isSelected:e,onClick:r,icon:a,label:n,description:o,className:s=""})=>t.jsxs("div",{onClick:r,className:`relative flex items-start p-4 cursor-pointer transition-all border-b border-gray-200 dark:border-gray-700 last:border-b-0 group ${s}`,children:[e&&t.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),t.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&t.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:`font-medium transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-gray-100 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`,children:n}),o&&t.jsx("div",{className:`text-xs mt-0.5 transition-colors ${e?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:o})]})]})]}),y0=({masterTitle:e,masterSubtitle:r,backButtonText:a,masterContent:n,detailContent:o,detailTitle:s,mobileView:i="navigation",onBackToNavigation:l,masterClassName:d="",detailClassName:c="",detailTitleClassName:u="",masterWidth:h=320,stickyMaster:w=!0,stickyTopOffset:m=96,desktopGap:b=32,showMasterBackground:y=!0,enableAnimations:v=!0,animationDuration:T=300,animationRef:N})=>{const S=`gap-${Math.round(b/4)}`||"gap-8",k=F=>F?F.split("-")[0].trim():"Back",C=a?k(a):e?k(e):"Back",[I,E]=p.useState(!1),[M,x]=p.useState("auto"),P=p.useRef(null),D=p.useRef(null);p.useEffect(()=>(N&&(N.current={triggerTransition:F=>{if(!v){F();return}if(P.current){const ne=P.current.scrollHeight;x(ne)}E(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{F(),setTimeout(()=>{if(P.current){const ne=P.current.scrollHeight;x(ne),setTimeout(()=>{x("auto"),E(!1)},T)}},50)},T/2)}}),()=>{D.current&&clearTimeout(D.current)}),[v,T,N]);const U=v?{height:M==="auto"?"auto":`${M}px`,transition:`height ${T}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},B=v?`${I?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",z=v?{transition:`opacity ${T}ms ease-in-out, transform ${T}ms ease-in-out`}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`md:hidden ${i==="navigation"?"block":"hidden"} flex-1`,children:t.jsxs("div",{className:y?"bg-white dark:bg-gray-800 p-6":"p-6",children:[e&&t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),t.jsx("div",{className:d,children:n})]})}),t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[t.jsxs("div",{className:`md:hidden ${i==="content"?"block":"hidden"}`,children:[i==="content"&&l&&t.jsxs("button",{onClick:l,className:"mb-4 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:["← ",C]}),t.jsx("div",{ref:P,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:U,children:t.jsxs("div",{className:B,style:z,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${u}`,children:s}),o]})})]}),t.jsxs("div",{className:`hidden md:flex min-h-full ${S}`,style:{width:"100%"},children:[t.jsx("aside",{className:"flex-shrink-0",style:{width:`${h}px`,minWidth:`${h}px`},children:t.jsxs("div",{className:w?"sticky":"",style:w?{top:`${m}px`}:void 0,children:[e&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),t.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${w?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${d}`,children:n})]})}),t.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${h+b}px)`},children:t.jsx("div",{ref:P,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:U,children:t.jsxs("div",{className:B,style:z,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${u}`,children:s}),o]})})})]})]})]})},Gr=p.createContext(null),Ua=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(i=>!i)},[]);return t.jsx(Gr.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},Yr=()=>{const e=p.useContext(Gr);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},Da={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},p0={default:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",app:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 shadow-sm",minimal:"bg-transparent",transparent:"bg-white/80 dark:bg-gray-900/80 border-b border-gray-200/50 dark:border-gray-700/50"},v0={default:"z-40",high:"z-50",highest:"z-[60]"},w0=({children:e,variant:r="default",sticky:a=!0,className:n,height:o="md",blur:s=!1,zIndex:i="high","aria-label":l="Main navigation"})=>t.jsx(Ua,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":l,className:f("w-full",Da[o],p0[r],v0[i],a&&"sticky top-0",s&&"backdrop-blur-md","transition-colors duration-200",n),children:[t.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 bg-blue-600 text-white px-4 py-2 rounded-md z-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Skip to main content"}),t.jsx("div",{className:f("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",Da[o],"flex items-center justify-between"),children:e})]})}),k0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center space-x-2 shrink-0",r),children:e}),x0=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),N0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center space-x-2 shrink-0",r),children:e}),C0=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden px-4 pb-3",r),children:e}),S0=({className:e})=>t.jsx("div",{className:f("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",e),role:"separator","aria-orientation":"vertical"}),E0={sm:"h-6",md:"h-8",lg:"h-10"},T0=({children:e,src:r,alt:a="Logo",onClick:n,href:o,className:s,size:i="md"})=>{const l=e||r&&t.jsx("img",{src:r,alt:a,className:f(E0[i],"w-auto object-contain")}),d=f("flex items-center","hover:opacity-80 transition-opacity duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-md",s);return o?t.jsx("a",{href:o,className:d,title:a,children:l}):n?t.jsx("button",{type:"button",onClick:n,className:d,title:a,"aria-label":`Go to ${a||"home"}`,children:l}):t.jsx("div",{className:d,children:l})},A0={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},I0=({className:e,isOpen:r})=>t.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),ja=({icon:e,"aria-label":r="Toggle navigation menu",className:a,onClick:n,hideAbove:o="lg",menuItems:s,LinkComponent:i})=>{const{mobileMenuOpen:l,toggleMobileMenu:d,setMobileMenuOpen:c}=Yr(),[u,h]=p.useState(!1),w=p.useRef(null);ar(w,()=>{h(!1)});const m=s?u:l,b=()=>{n?n():s?h(!u):d()},y=()=>{h(!1),c(!1)};return t.jsxs("div",{className:f("relative",A0[o]),ref:w,children:[t.jsx("button",{type:"button",onClick:b,className:f("p-2 rounded-lg","text-gray-600 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",a),"aria-label":r,"aria-expanded":m,"aria-haspopup":s?"menu":void 0,"aria-controls":s?"topbar-dropdown-menu":"mobile-menu",children:e?t.jsx(e,{className:"h-6 w-6"}):t.jsx(I0,{className:"h-6 w-6",isOpen:m})}),s&&u&&t.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:f("absolute left-0 top-full mt-2","min-w-[200px] py-2 rounded-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","shadow-lg","z-50"),children:s.map(v=>{const T=v.icon,N=t.jsxs(t.Fragment,{children:[T&&t.jsx(T,{className:"h-5 w-5 mr-3 flex-shrink-0"}),t.jsx("span",{children:v.label})]}),S=f("flex items-center w-full px-4 py-2.5 text-sm font-medium","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","transition-colors duration-150",v.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",v.disabled&&"opacity-50 cursor-not-allowed");return v.href&&i?t.jsx(i,{href:v.href,className:S,children:t.jsx("div",{className:"flex items-center",onClick:y,children:N})},v.id):v.href?t.jsx("a",{href:v.href,role:"menuitem",className:S,onClick:y,children:N},v.id):t.jsx("button",{type:"button",role:"menuitem",className:S,onClick:()=>{y(),v.onClick?.()},disabled:v.disabled,children:N},v.id)})})]})},M0={sm:{show:"hidden sm:flex",hide:"sm:hidden"},md:{show:"hidden md:flex",hide:"md:hidden"},lg:{show:"hidden lg:flex",hide:"lg:hidden"},xl:{show:"hidden xl:flex",hide:"xl:hidden"}},L0={left:"justify-start",center:"justify-center",right:"justify-end"},_a=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,i]=p.useState(null),l=p.useRef(null);ar(l,()=>i(null));const d=(c,u=!1)=>{const h=c.children&&c.children.length>0,w=s===c.id,m=f("px-3 py-2 rounded-md text-sm font-medium","transition-colors duration-200",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",c.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",u&&"w-full text-left");return h?t.jsxs("div",{className:"relative",ref:l,children:[t.jsxs("button",{type:"button",onClick:()=>i(w?null:c.id),className:f(m,"flex items-center gap-1"),"aria-expanded":w,"aria-haspopup":"true",disabled:c.disabled,children:[c.icon&&t.jsx(c.icon,{className:"h-4 w-4 mr-1"}),c.label,t.jsx("svg",{className:f("h-4 w-4 transition-transform duration-200",w&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),w&&t.jsx("div",{className:f("absolute top-full left-0 mt-1 py-1","min-w-[200px] rounded-md shadow-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","z-50"),children:c.children?.map(b=>t.jsx(Kr,{item:b,LinkComponent:n,className:f("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",b.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>i(null)},b.id))})]},c.id):t.jsx(Kr,{item:c,LinkComponent:n,className:m},c.id)};return t.jsx("nav",{className:f("flex items-center gap-1",M0[a].show,L0[o],r),"aria-label":"Main navigation",children:e.map(c=>d(c))})},Kr=({item:e,LinkComponent:r,className:a,onClick:n})=>{const o=()=>{n?.(),e.onClick?.()},s=t.jsxs(t.Fragment,{children:[e.icon&&t.jsx(e.icon,{className:"h-4 w-4 mr-2"}),e.label]});return e.href&&r?t.jsx(r,{href:e.href,className:f(a,"flex items-center"),children:s}):e.href?t.jsx("a",{href:e.href,className:f(a,"flex items-center"),onClick:o,children:s}):t.jsx("button",{type:"button",onClick:o,className:f(a,"flex items-center"),disabled:e.disabled,children:s})},P0=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=Yr();return r??o?t.jsx("div",{id:"mobile-menu",className:f("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:t.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:e.map(l=>t.jsx(Kr,{item:l,LinkComponent:n,className:f("flex items-center w-full px-3 py-2 rounded-md text-base font-medium","transition-colors duration-200",l.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700"),onClick:()=>s(!1)},l.id))})}):null},O0=({items:e,LinkComponent:r,collapseBelow:a="lg",align:n="center",className:o,mobileMenuLabel:s="Toggle navigation menu"})=>t.jsxs(t.Fragment,{children:[t.jsx(ja,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),t.jsx(_a,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),U0={sm:"gap-1",md:"gap-2",lg:"gap-3"},D0={left:"justify-start",center:"justify-center",right:"justify-end"},j0=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",U0[a],D0[n],r),children:e}),_0={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},z0={sm:"p-1.5",md:"p-2",lg:"p-2.5"},B0=({icon:e,onClick:r,"aria-label":a,className:n,disabled:o=!1,badge:s,size:i="md"})=>t.jsxs("button",{type:"button",onClick:r,className:f("relative rounded-lg",z0[i],"text-gray-500 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-700 dark:hover:text-gray-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",o&&"opacity-50 cursor-not-allowed",n),"aria-label":a,disabled:o,children:[t.jsx(e,{className:_0[i]}),s!==void 0&&s>0&&t.jsx("span",{className:f("absolute -top-1 -right-1","min-w-[18px] h-[18px] px-1","flex items-center justify-center","text-xs font-medium","bg-red-500 text-white rounded-full","ring-2 ring-white dark:ring-gray-900"),"aria-label":`${s} notifications`,children:s>99?"99+":s})]}),W0={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},F0=({placeholder:e="Search...",value:r,onChange:a,onSubmit:n,className:o,width:s="md",showOnMobile:i=!1})=>{const[l,d]=p.useState(r||""),c=h=>{const w=h.target.value;d(w),a?.(w)},u=h=>{h.preventDefault(),n?.(l)};return t.jsx("form",{onSubmit:u,className:f(!i&&"hidden md:block",o),role:"search",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"search",value:l,onChange:c,placeholder:e,"aria-label":e,className:f(W0[s],"pl-10 pr-4 py-2","text-sm","bg-gray-100 dark:bg-gray-800","border border-transparent","rounded-lg","text-gray-900 dark:text-gray-100","placeholder:text-gray-500 dark:placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white dark:focus:bg-gray-700 focus:border-transparent","transition-colors duration-200")})]})})},V0=({contentType:e,aiSummary:r,technicalComplexity:a="intermediate"})=>t.jsxs(Un.Helmet,{children:[t.jsx("meta",{name:"ai:content-type",content:e}),t.jsx("meta",{name:"ai:summary",content:r}),t.jsx("meta",{name:"ai:complexity",content:a})]}),q0=({children:e,className:r,...a})=>t.jsx("main",{className:r,...a,role:"main",children:e}),$0=({children:e})=>t.jsx(t.Fragment,{children:e}),Le=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(r=>r.trim()).filter(Boolean):[],Ee=e=>({appName:e.appName,baseUrl:e.baseUrl,twitterHandle:e.twitterHandle||"",emailDomain:e.emailDomain||"example.com"}),Zr=e=>{const r=Le(e.audience),a=Ee(e.branding);return{"@context":"https://schema.org","@type":"SoftwareApplication",name:a.appName,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",description:e.description,url:a.baseUrl,downloadUrl:`${a.baseUrl}/connect`,installUrl:`${a.baseUrl}/connect`,screenshot:`${a.baseUrl}/screenshots/app-preview.jpg`,aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"2500",bestRating:"5",worstRating:"1"},offers:[{"@type":"Offer",name:"Free Web3 Email",description:"Basic wallet-based email with unlimited sending",price:"0",priceCurrency:"USD",availability:"https://schema.org/InStock"},{"@type":"Offer",name:"Premium Web3 Email",description:"Advanced features with ENS/SNS domains and priority support",price:"2.00",priceCurrency:"USD",billingIncrement:"month",availability:"https://schema.org/InStock"}],featureList:["Passwordless wallet authentication","ENS domain email support (.eth)","Solana Name Service support (.sol)","Smart contract email integration","Multi-chain wallet compatibility","Cross-chain email addresses","DAO email delegation","Encrypted communication","Web2/Web3 bridge functionality","Point-based reward system"],applicationSubCategory:"Web3 Email Platform",audience:{"@type":"Audience",audienceType:r.join(", "),geographicArea:"Worldwide"},creator:{"@type":"Organization",name:a.appName,url:a.baseUrl},datePublished:"2024-01-01",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),version:"1.0",softwareRequirements:"Web3 Wallet (MetaMask, Phantom, etc.)",storageRequirements:"5MB",memoryRequirements:"512MB RAM",supportingData:{blockchainNetworks:["Ethereum","Solana","Polygon","Arbitrum","Optimism"],supportedWallets:["MetaMask","Phantom","WalletConnect","Coinbase Wallet"],smartContractSupport:!0,ensCompatible:!0,snsCompatible:!0}}},Xr=e=>{const r=Le(e.keywords),a=Le(e.audience),n=Ee(e.branding);return{"@context":"https://schema.org","@type":"TechnicalArticle",headline:e.title,description:e.description,author:{"@type":"Organization",name:n.appName,url:n.baseUrl,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`}},publisher:{"@type":"Organization",name:n.appName,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`,width:600,height:600}},datePublished:"2024-01-01T00:00:00Z",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":`${n.baseUrl}${location.pathname}`},image:{"@type":"ImageObject",url:`${n.baseUrl}/og-images/technical-guide.jpg`,width:1200,height:630},keywords:r.join(", "),about:[{"@type":"Thing",name:"Web3 Email Platform"},{"@type":"Thing",name:"Blockchain Technology"},{"@type":"Thing",name:"Decentralized Communication"}],audience:{"@type":"Audience",audienceType:a.join(", "),educationalLevel:e.complexity},educationalLevel:e.complexity,proficiencyLevel:e.complexity,learningResourceType:e.contentType,timeRequired:e.readingTime?`PT${e.readingTime}M`:"PT5M",inLanguage:"en",isAccessibleForFree:!0,license:"https://creativecommons.org/licenses/by/4.0/",teaches:e.relatedTopics||["Web3 email setup","Wallet connection process","Blockchain authentication","Smart contract integration"]}},H0=(e,r)=>{const a=Ee(r);return{"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(n=>({"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:n.answer,dateCreated:new Date().toISOString(),upvoteCount:Math.floor(Math.random()*50)+10,author:{"@type":"Organization",name:a.appName}},answerCount:1,upvoteCount:Math.floor(Math.random()*100)+20,dateCreated:"2024-01-01T00:00:00Z",category:n.category||"General"}))}},Qr=e=>{const r=Ee(e.branding);return{"@context":"https://schema.org","@type":"WebPage",name:e.title,description:e.description,url:`${r.baseUrl}${location.pathname}`,primaryImageOfPage:{"@type":"ImageObject",url:`${r.baseUrl}/og-images/ai-optimized.jpg`},significantLink:[`${r.baseUrl}/document`,`${r.baseUrl}/web3-users`,`${r.baseUrl}/web3-projects`,`${r.baseUrl}/connect`],relatedLink:e.relatedTopics?.map(a=>`${r.baseUrl}/search?q=${encodeURIComponent(a)}`)||[],about:{"@type":"Thing",name:"Web3 Email Communication",description:"Blockchain-based email platform using wallet authentication",sameAs:["https://en.wikipedia.org/wiki/Web3","https://en.wikipedia.org/wiki/Blockchain","https://en.wikipedia.org/wiki/Cryptocurrency_wallet"]},mentions:[{"@type":"SoftwareApplication",name:"MetaMask"},{"@type":"SoftwareApplication",name:"Phantom Wallet"},{"@type":"Thing",name:"Ethereum Name Service"},{"@type":"Thing",name:"Solana Name Service"}],isPartOf:{"@type":"WebSite","@id":r.baseUrl,name:r.appName},potentialAction:{"@type":"InteractAction",target:{"@type":"EntryPoint",urlTemplate:`${r.baseUrl}/connect`,actionPlatform:["https://schema.org/DesktopWebPlatform","https://schema.org/MobileWebPlatform"]},name:"Connect Web3 Wallet"}}},za=e=>{const r=Le(e.keywords),a=Ee(e.branding);return{"og:title":e.title,"og:description":e.description,"og:type":"website","og:url":`${a.baseUrl}${location.pathname}`,"og:image":`${a.baseUrl}/og-images/${e.category}.jpg`,"og:image:width":"1200","og:image:height":"630","og:image:alt":`${e.title} - ${a.appName}`,"og:site_name":a.appName,"og:locale":"en_US","article:author":`${a.baseUrl}/about`,"article:section":e.category,"article:tag":r.join(","),"article:published_time":"2024-01-01T00:00:00Z","article:modified_time":e.lastUpdated?.toISOString()||new Date().toISOString()}},Ba=e=>{const r=Ee(e.branding);return{"twitter:card":"summary_large_image","twitter:site":r.twitterHandle||"","twitter:creator":r.twitterHandle||"","twitter:title":e.title,"twitter:description":e.description,"twitter:image":`${r.baseUrl}/twitter-cards/${e.category}.jpg`,"twitter:image:alt":`${e.title} - ${r.appName}`,"twitter:label1":"Category","twitter:data1":e.category,"twitter:label2":"Reading Time","twitter:data2":e.readingTime?`${e.readingTime} min`:"5 min"}},Wa=e=>{const r=Le(e.keywords),a=Le(e.audience),n=Ee(e.branding);return{"ai:content-type":e.contentType,"ai:complexity":e.complexity,"ai:category":e.category,"ai:audience":a.join(","),"ai:keywords":r.join(","),"ai:reading-time":e.readingTime?.toString()||"5","web3:platform":"Email","web3:networks":"ethereum,solana,polygon","web3:wallets":"metamask,phantom,walletconnect","web3:features":"ens,sns,smart-contracts,multi-chain","llm:context":"Web3 email platform documentation and user guides","llm:domain":"blockchain,cryptocurrency,decentralized-communication","llm:use-case":"email,authentication,wallet-integration,smart-contracts","semantic:topic":e.category,"semantic:intent":"inform,guide,educate","semantic:entities":`${n.appName},Web3,blockchain,email,wallet`,"content:freshness":e.lastUpdated?.toISOString()||new Date().toISOString(),"content:authority":"high","content:expertise":"technical","content:trustworthiness":"verified"}},G0=e=>({structuredData:{product:Zr(e),article:Xr(e),aiOptimized:Qr(e)},openGraph:za(e),twitterCard:Ba(e),aiMetaTags:Wa(e),jsonLD:[Zr(e),Xr(e),Qr(e)]}),Y0={homepage:{title:"Revolutionary Web3 Email Platform | Wallet-Based Authentication",description:"Transform your email experience - the first Web3 email platform using wallet authentication. No passwords, enhanced security, ENS/SNS domain support, and smart contract integration.",keywords:["Web3 email","blockchain email","wallet authentication","ENS email","SNS email","decentralized email","smart contract integration"],category:"Web3 Platform",audience:["Crypto Users","Web3 Developers","DeFi Users","DAO Members"],complexity:"beginner",contentType:"overview",readingTime:3,relatedTopics:["Web3 authentication","Blockchain communication","Decentralized identity"]},documentation:{title:"Documentation - Complete Web3 Email Setup Guide",description:"Comprehensive documentation for Web3 email platform. Learn wallet connection, ENS/SNS setup, smart contract integration, and advanced features.",keywords:["Web3 email guide","wallet connection","ENS setup","SNS configuration","smart contract email","blockchain documentation"],category:"Technical Documentation",audience:["Developers","Technical Users","Web3 Enthusiasts"],complexity:"intermediate",contentType:"guide",readingTime:15,relatedTopics:["Wallet integration","Blockchain protocols","Email security"]},earnPoints:{title:"How to Earn Points - Web3 Email Rewards Guide",description:"Master the points system. Earn rewards through email activities, referrals, smart contract interactions, and prepare for future token distribution.",keywords:["Web3 rewards","email points","blockchain rewards","referral program","token preparation","crypto incentives"],category:"Rewards Guide",audience:["Token Farmers","Crypto Users","Web3 Users"],complexity:"beginner",contentType:"tutorial",readingTime:8,relatedTopics:["Token economics","Reward systems","Referral marketing"]}},K0=e=>{const{level:r,text:a,className:n="",id:o,semanticContext:s="section"}=e,i=`h${r}`,l={1:"text-4xl md:text-5xl lg:text-6xl font-bold leading-tight",2:"text-3xl md:text-4xl font-bold leading-tight",3:"text-2xl md:text-3xl font-bold leading-tight",4:"text-xl md:text-2xl font-semibold leading-tight",5:"text-lg md:text-xl font-semibold leading-tight",6:"text-base md:text-lg font-medium leading-tight"},d={"page-title":"text-gray-900 dark:text-white mb-6",section:"text-gray-900 dark:text-white mb-4",subsection:"text-gray-900 dark:text-white mb-3",feature:"text-gray-900 dark:text-white mb-2",benefit:"text-blue-600 dark:text-blue-400 mb-2",step:"text-green-600 dark:text-green-400 mb-2"},c=[l[r],d[s],n].filter(Boolean).join(" "),u=o||a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");return p.createElement(i,{id:u,className:c,"aria-level":r},a)},ie={pageTitle:(e,r)=>({level:1,text:e,className:r,semanticContext:"page-title"}),majorSection:(e,r)=>({level:2,text:e,className:r,semanticContext:"section"}),feature:(e,r)=>({level:3,text:e,className:r,semanticContext:"feature"}),benefit:(e,r)=>({level:3,text:e,className:r,semanticContext:"benefit"}),step:(e,r,a)=>({level:3,text:r?`Step ${r}: ${e}`:e,className:a,semanticContext:"step"}),subFeature:(e,r)=>({level:4,text:e,className:r,semanticContext:"feature"})},Z0=e=>{const r=[],a=[],n=e.filter(o=>o.level===1).length;n===0?r.push("Missing H1 tag - every page should have exactly one H1"):n>1&&r.push(`Multiple H1 tags found (${n}) - use only one H1 per page`);for(let o=1;o<e.length;o++){const s=e[o],i=e[o-1];s.level>i.level+1&&r.push(`Heading level jump from H${i.level} to H${s.level} - avoid skipping levels`)}return e.forEach((o,s)=>{o.text.length<3&&r.push(`Heading ${s+1} is too short - use descriptive text`),o.text.length>70&&a.push(`Heading "${o.text.substring(0,30)}..." is long - consider shortening for better SEO`)}),{isValid:r.length===0,errors:r,suggestions:a}},X0={walletConnection:ie.pageTitle("Connect Your Web3 Wallet"),emailBenefits:ie.majorSection("Why Choose Web3 Email?"),securityFeature:ie.feature("Secure & Private"),ensIntegration:ie.feature("ENS Domain Support"),multiChain:ie.feature("Multi-Chain Compatibility"),passwordless:ie.benefit("No Passwords Required"),setupStep1:ie.step("Connect Your Wallet",1),setupStep2:ie.step("Verify Your Identity",2),setupStep3:ie.step("Access Your Emails",3)},Q0=[{term:"Web3 Email",definition:"Email system that uses blockchain wallet addresses as authentication instead of traditional passwords",category:"Web3 Communication",synonyms:["blockchain email","decentralized email","crypto email"],relatedTerms:["wallet authentication","ENS email","SNS email"],examples:["vitalik.eth@example.com","alice.sol@example.com"],context:"Web3 email revolutionizes digital communication by eliminating passwords and using cryptographic signatures for authentication"},{term:"Wallet Authentication",definition:"Authentication method using cryptographic signatures from blockchain wallets instead of passwords",category:"Security",synonyms:["wallet-based auth","signature authentication","passwordless authentication"],relatedTerms:["EIP-712","SIWE","message signing"],examples:["MetaMask signature","Phantom wallet auth","WalletConnect login"],context:"Wallet authentication provides superior security through cryptographic proofs that cannot be phished or stolen like passwords"},{term:"ENS Email",definition:"Email addresses using Ethereum Name Service domains (.eth) as identifiers",category:"Naming Systems",synonyms:["Ethereum name email",".eth email"],relatedTerms:["ENS","Ethereum domains","blockchain domains"],examples:["vitalik.eth","ethereum.eth"],context:"ENS emails provide human-readable addresses that resolve to Ethereum wallet addresses"},{term:"SNS Email",definition:"Email addresses using Solana Name Service domains (.sol) as identifiers",category:"Naming Systems",synonyms:["Solana name email",".sol email"],relatedTerms:["SNS","Solana domains","SPL domains"],examples:["anatoly.sol","solana.sol"],context:"SNS emails provide human-readable addresses for Solana ecosystem users"},{term:"Smart Contract Integration",definition:"Ability to send and receive emails triggered by blockchain smart contract events",category:"Blockchain Integration",synonyms:["contract notifications","on-chain email triggers"],relatedTerms:["event listeners","webhooks","contract automation"],examples:["DAO proposal notifications","DeFi alert emails","NFT sale confirmations"],context:"Smart contract integration enables automated communication based on blockchain events"},{term:"Multi-Chain Support",definition:"Compatibility with multiple blockchain networks for wallet authentication and email services",category:"Interoperability",synonyms:["cross-chain support","blockchain agnostic"],relatedTerms:["EVM chains","Solana","Layer 2"],examples:["Ethereum, Polygon, Arbitrum, Solana support"],context:"Multi-chain support ensures users from any blockchain ecosystem can use the email service"},{term:"DAO Email Delegation",definition:"System allowing DAOs to manage email communications through delegated authorities",category:"Governance",synonyms:["governance email","multi-sig email"],relatedTerms:["DAO governance","multi-signature","delegation"],examples:["Treasury notifications","Proposal alerts","Voting reminders"],context:"DAO email delegation enables decentralized organizations to manage communications efficiently"},{term:"Web2/Web3 Bridge",definition:"Technology enabling communication between traditional email systems and blockchain-based email",category:"Interoperability",synonyms:["email bridge","legacy integration"],relatedTerms:["SMTP gateway","email forwarding","protocol bridge"],examples:["Gmail to Web3 email","Outlook integration"],context:"Web2/Web3 bridge ensures compatibility with existing email infrastructure"}],J0=e=>({"@context":"https://schema.org","@type":"LearningResource",educationalLevel:e.difficulty,learningResourceType:"Technical Documentation",timeRequired:e.estimatedTime?`PT${e.estimatedTime}M`:void 0,teaches:e.learningObjectives,requires:e.prerequisites,about:{"@type":"Thing",name:e.domain,category:e.category,subcategory:e.subcategory},keywords:e.concepts,applicationExample:e.practicalApplications,isRelatedTo:e.relatedConcepts}),R0=e=>{const r={nodes:e.map(a=>({id:a.term,label:a.term,category:a.category,definition:a.definition})),edges:[]};return e.forEach(a=>{a.relatedTerms?.forEach(n=>{e.find(s=>s.term===n)&&r.edges.push({source:a.term,target:n,relationship:"related_to"})}),a.synonyms?.forEach(n=>{r.edges.push({source:a.term,target:n,relationship:"synonym_of"})})}),r},eu=e=>{const r=[];return e.examples?.forEach(a=>{r.push({text:a,label:e.term,type:"positive",confidence:1})}),e.context&&r.push({text:e.context,label:e.term,type:"contextual",confidence:.8}),r.push({text:`${e.term} is ${e.definition}`,label:e.term,type:"definition",confidence:1}),r},ru=e=>{const r=[];return e.forEach(a=>{r.push({question:`What is ${a.term}?`,answer:a.definition,category:a.category,difficulty:"basic"}),a.context&&r.push({question:`How does ${a.term} work?`,answer:a.context,category:a.category,difficulty:"intermediate"}),a.examples&&a.examples.length>0&&r.push({question:`What are examples of ${a.term}?`,answer:a.examples.join(", "),category:a.category,difficulty:"basic"}),a.relatedTerms&&a.relatedTerms.length>0&&r.push({question:`What is ${a.term} related to?`,answer:`${a.term} is related to ${a.relatedTerms.join(", ")}`,category:a.category,difficulty:"intermediate"})}),r},tu={homepage:{domain:"Web3 Email Platform",category:"Web3 Communication",concepts:["Web3 email","wallet authentication","passwordless login","blockchain messaging"],prerequisites:["Basic blockchain knowledge","Understanding of crypto wallets"],learningObjectives:["Understand Web3 email concepts","Learn wallet authentication","Explore blockchain communication"],difficulty:"beginner",estimatedTime:5,practicalApplications:["Secure email communication","DAO governance","DeFi notifications"]},documentation:{domain:"Web3 Email Technical Documentation",category:"Technical Guide",concepts:["API integration","smart contracts","wallet connection","email protocols"],prerequisites:["JavaScript/TypeScript","Web3 development basics","REST APIs"],learningObjectives:["Implement Web3 email","Integrate wallet authentication","Build on email API"],difficulty:"intermediate",estimatedTime:30,practicalApplications:["dApp integration","Email automation","Smart contract notifications"]},governance:{domain:"DAO Governance Communication",category:"Governance Tools",concepts:["DAO email","voting notifications","proposal tracking","multi-sig coordination"],prerequisites:["DAO basics","Governance understanding","Multi-signature wallets"],learningObjectives:["Setup DAO email","Configure voting alerts","Manage team communication"],difficulty:"advanced",estimatedTime:20,practicalApplications:["DAO operations","Treasury management","Governance participation"]}},au=({children:e,appName:r,appUrl:a,apiUrl:n})=>(p.useEffect(()=>{const o=()=>{[].forEach(b=>{const y=document.createElement("link");y.rel="preload",y.href=b.href,y.as=b.as,b.type&&(y.type=b.type),b.crossorigin&&(y.crossOrigin=""),document.head.appendChild(y)})},s=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(y=>{y.fetchPriority="high"});const b=document.querySelector("[data-hero]");if(b){const y=b.getAttribute("data-bg-image");if(y){const v=document.createElement("link");v.rel="preload",v.href=y,v.as="image",document.head.appendChild(v)}}},i=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(y=>{const v=y;v.naturalWidth&&v.naturalHeight&&(v.width=v.naturalWidth,v.height=v.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(y=>{y.getAttribute("style")?.includes("min-height")||(y.style.minHeight="200px")})},l=()=>{const m=()=>{document.querySelectorAll("script[data-defer]").forEach(v=>{v.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{m()}):setTimeout(m,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(v=>{document.addEventListener(v,()=>{},{passive:!0})})})()},d=()=>{},c=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...n?[{rel:"dns-prefetch",href:`//${n.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...n?[{rel:"preconnect",href:n}]:[]].forEach(b=>{const y=document.createElement("link");y.rel=b.rel,y.href=b.href,b.crossorigin&&(y.crossOrigin=""),document.head.appendChild(y)})},u=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(b=>{b.loading="lazy"}),"IntersectionObserver"in window){const b=new IntersectionObserver(v=>{v.forEach(T=>{if(T.isIntersecting){const N=T.target;N.dataset.src&&(N.src=N.dataset.src,N.removeAttribute("data-src")),b.unobserve(N)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(v=>b.observe(v))}},h=()=>{[{name:"ai-content-type",content:"web3-email-platform"},{name:"ai-primary-function",content:"wallet-based-email"},{name:"ai-supported-chains",content:"ethereum,solana,polygon,arbitrum,optimism"},{name:"ai-complexity-level",content:"beginner-to-advanced"},{name:"ai-target-users",content:"web3-users,crypto-enthusiasts,developers"},{name:"machine-readable",content:"true"},{name:"structured-data",content:"json-ld"},{name:"content-category",content:"technology,blockchain,communication"},{name:"interaction-model",content:"wallet-authentication"}].forEach(({name:v,content:T})=>{if(!document.querySelector(`meta[name="${v}"]`)){const N=document.createElement("meta");N.name=v,N.content=T,document.head.appendChild(N)}});const b={"@context":"https://schema.org","@type":"WebApplication",name:r,description:"Web3 email platform using blockchain wallet authentication",url:a,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},featureList:["Wallet-based authentication","ENS domain email support","SNS domain email support","Multi-chain compatibility","Smart contract integration","Web2/Web3 bridge"],audience:{"@type":"Audience",audienceType:"Web3 Users"}},y=document.createElement("script");y.type="application/ld+json",y.textContent=JSON.stringify(b),document.head.appendChild(y)},w=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(b=>{const y=b.cloneNode(!0);y.rel="preload",y.as="style",y.onload=()=>{y.onload=null,y.rel="stylesheet"},document.head.appendChild(y),b.remove()})};return o(),s(),i(),l(),c(),u(),h(),w(),setTimeout(d,2e3),()=>{}},[n,r,a]),t.jsx(t.Fragment,{children:e})),nu=()=>(p.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const e=()=>{if("IntersectionObserver"in window){const l=new IntersectionObserver(d=>{d.forEach(c=>{if(c.isIntersecting){const u=c.target;u.dataset.src&&(u.src=u.dataset.src,u.removeAttribute("data-src"),l.unobserve(u))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(d=>{l.observe(d)})}const o=()=>{["/connect","/mail","/settings"].forEach(d=>{const c=document.createElement("link");c.rel="prefetch",c.href=d,document.head.appendChild(c)})},s=()=>{if(!document.querySelector("script[data-wallet-detection]")){const l=document.createElement("script");l.dataset.walletDetection="true",l.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(l)}},i=()=>{document.querySelectorAll("img[data-hero]").forEach(l=>{const d=l;d.loading="eager","fetchPriority"in d&&(d.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(l=>{const d=l;d.loading="lazy","fetchPriority"in d&&(d.fetchPriority="low")})};requestIdleCallback(()=>{o(),s(),i()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const o=new PerformanceObserver(i=>{const l=i.getEntries(),d=l[l.length-1];d&&d.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{o.observe({entryTypes:["largest-contentful-paint"]})}catch{}const s=new PerformanceObserver(i=>{let l=0;for(const d of i.getEntries())d.hadRecentInput||(l+=d.value);l>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(d=>{const c=d;c.style.aspectRatio="16/9"})});try{s.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const o=navigator.connection;if(o){const s=o.effectiveType;s==="slow-2g"||s==="2g"?(document.documentElement.classList.add("slow-connection"),document.querySelectorAll('link[rel="prefetch"]').forEach(i=>{i.getAttribute("data-critical")||i.remove()}),localStorage.setItem("use-low-quality-images","true")):s==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{e(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),ou=({children:e})=>t.jsx(t.Fragment,{children:e}),Fa={user:{duration:300*1e3,maxSize:100,staleWhileRevalidate:!0},mailboxes:{duration:120*1e3,maxSize:50,staleWhileRevalidate:!0},addresses:{duration:600*1e3,maxSize:50,staleWhileRevalidate:!0},messages:{duration:30*1e3,maxSize:200,staleWhileRevalidate:!0},messageDetails:{duration:120*1e3,maxSize:100,staleWhileRevalidate:!1},messageCount:{duration:10*1e3,maxSize:20,staleWhileRevalidate:!0}};class su{constructor(){this.cache=new Map}set(r,a,n){if(this.cache.size>=n.maxSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const n=this.cache.get(r);if(!n)return null;const s=Date.now()-n.timestamp>a.duration;return s&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:n.data,isStale:s}}invalidate(r){for(const a of this.cache.keys())a.includes(r)&&this.cache.delete(a)}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,keys:Array.from(this.cache.keys()),memory:this.estimateMemoryUsage()}}estimateMemoryUsage(){return Array.from(this.cache.values()).reduce((r,a)=>r+JSON.stringify(a).length*2,0)}}const Pe=new su,Te=new Map,Va=async(e,r,a="messages")=>{const n=Fa[a],o=Pe.get(e,n);if(o&&!o.isStale)return o.data;const s=Te.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const l=r().then(d=>(Pe.set(e,d,n),Te.delete(e),d)).catch(d=>{throw Te.delete(e),d});return Te.set(e,l),o.data}const i=r().then(l=>(Pe.set(e,l,n),Te.delete(e),l)).catch(l=>{throw Te.delete(e),l});return Te.set(e,i),i};class iu{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((n,o)=>{this.queue.push({key:r,fetcher:a,resolve:n,reject:o}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.processBatch()},this.batchDelay)})}async processBatch(){const r=[...this.queue];this.queue.length=0,this.timer=null;const a=this.groupRequests(r);for(const n of a)await Promise.allSettled(n.map(async o=>{try{const s=await o.fetcher();o.resolve(s)}catch(s){o.reject(s)}}))}groupRequests(r){const a=[];for(let o=0;o<r.length;o+=5)a.push(r.slice(o,o+5));return a}}const lu=new iu;class cu{constructor(r,a={}){this.requestInterceptors=[],this.responseInterceptors=[],this.baseURL=r,this.defaultHeaders=a}addRequestInterceptor(r){this.requestInterceptors.push(r)}addResponseInterceptor(r){this.responseInterceptors.push(r)}async request(r,a={},n,o="messages"){const s=`${this.baseURL}${r}`,i=n||`${a.method||"GET"}:${s}`,l=async()=>{let d={...a,headers:{...this.defaultHeaders,...a.headers}};for(const u of this.requestInterceptors)d=u(d);let c=await fetch(s,d);for(const u of this.responseInterceptors)c=await u(c);if(!c.ok)throw new Error(`API Error: ${c.status} ${c.statusText}`);return c.json()};return a.method==="GET"&&this.shouldBatch(r)?lu.add(i,l):Va(i,l,o)}shouldBatch(r){return r.includes("/messages/")&&!r.includes("/messages?")}async get(r,a){return this.request(r,{method:"GET"},void 0,a)}async post(r,a){return this.request(r,{method:"POST",body:JSON.stringify(a)})}async put(r,a){return this.request(r,{method:"PUT",body:JSON.stringify(a)})}async delete(r){return this.request(r,{method:"DELETE"})}}const du=async(e,r=3,a=1e3)=>{let n;for(let o=0;o<=r;o++)try{return await e()}catch(s){if(n=s,o===r)throw n;const i=a*Math.pow(2,o)+Math.random()*1e3;await new Promise(l=>setTimeout(l,i))}throw n};class uu{constructor(){this.abortController=new AbortController}async request(r,a={}){const n=await fetch(r,{...a,signal:this.abortController.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}cancel(){this.abortController.abort()}}const gu={invalidate:e=>Pe.invalidate(e),clear:()=>Pe.clear(),getStats:()=>Pe.getStats(),warmUp:async e=>{await Promise.allSettled(e.map(r=>r()))},prefetch:async e=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(e.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(e.map(r=>r()))},100)}};function qa(){if(typeof window>"u")return!1;const e=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>e.includes(a))}function $a(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function Ha(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function Ga(){return $a()?"localhost":qa()?"wallet-browser":Ha()?"network":"production"}function hu(){const e=Ga();return e==="localhost"||e==="wallet-browser"}function fu(e){}function Ya(){return typeof window<"u"}function bu(){return typeof window<"u"}function mu(e,r){if(Ya())e();else return r}const Jr=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'",...e?.apiUrls||[],...e?.appUrls||[],"https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),yu=Jr(),Ka=e=>{const r=Jr(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},Za=e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":Ka(e)}),pu=Za(),vu={fonts:"public, max-age=31536000, immutable",images:"public, max-age=31536000, immutable",js:"public, max-age=31536000, immutable",css:"public, max-age=31536000, immutable",serviceWorker:"public, max-age=0, must-revalidate",manifest:"public, max-age=86400",api:"no-cache, no-store, must-revalidate"},wu=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},ku={walletConnections:"Always verify wallet signatures and never trust client-side data",rpcEndpoints:"Use reputable RPC providers and consider rate limiting",contractInteractions:"Validate all smart contract interactions on the backend",userInput:"Sanitize all user inputs, especially wallet addresses and transaction data",privateKeys:"Never log, store, or transmit private keys - they should remain in wallets only",phishing:"Implement strict CSP to prevent injection of malicious scripts that could steal wallet access"},ue=new Map,qe=new Map,lr=new Set;let $e="medium",Rr=!1;function xu(){if("connection"in navigator){const a=navigator.connection;a&&($e=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;Rr=e&&e<4||r&&r<4}xu();function Nu(e,r,a={}){const{retries:n=3,timeout:o=1e4,fallback:s,preloadCondition:i,cacheStrategy:l="memory",priority:d="medium",onLoad:c,onError:u}=a;if(ue.has(r))return ue.get(r).component;const h=p.lazy(async()=>{const m=performance.now();if(qe.has(r))return qe.get(r).then(y=>({default:y}));const b=Cu(e,n,o);qe.set(r,b.then(y=>y.default));try{const y=await b,v=performance.now()-m;if(l!=="none"){const T={component:y.default,timestamp:Date.now(),loadTime:v};if(ue.set(r,T),l==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:T.timestamp,loadTime:v}))}catch{}}return qe.delete(r),c?.(y.default),y}catch(y){throw qe.delete(r),u?.(y),y}}),w=m=>{const[b,y]=p.useState(!0);p.useEffect(()=>{if(i&&!ue.has(r)&&i()&&!lr.has(r)){lr.add(r);const N=Su(d,$e);setTimeout(()=>{e().catch(()=>{})},N)}},[]);const v=s||t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!b&&Rr&&$e==="slow"?t.jsx("div",{className:"lazy-placeholder",children:t.jsxs("button",{onClick:()=>y(!0),className:"load-component-btn",children:["Load ",r]})}):t.jsx(p.Suspense,{fallback:v,children:t.jsx(h,{...m})})};return w.displayName=`AdvancedLazy(${r})`,w}async function Cu(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((l,d)=>{setTimeout(()=>d(new Error("Load timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const i=Math.pow(2,o)*1e3,l=Math.random()*1e3;await new Promise(d=>setTimeout(d,i+l))}}throw n}function Su(e,r){const a={critical:0,high:500,medium:2e3,low:5e3},n={fast:.5,medium:1,slow:2},o=a[e]||2e3,s=n[r]||1;return o*s}const Ze=class Ze{static registerRoute(r,a){this.routeMap.set(r,a),this.routeUsageStats.set(r,0)}static setCurrentRoute(r){this.currentRoute=r;const a=this.routeUsageStats.get(r)||0;this.routeUsageStats.set(r,a+1),this.preloadLikelyRoutes(r)}static preloadLikelyRoutes(r){this.getRouteTransitionProbability(r).forEach(({route:n,probability:o})=>{o>.3&&!ue.has(n)&&setTimeout(()=>{this.routeMap.get(n)},$e==="fast"?1e3:3e3)})}static getRouteTransitionProbability(r){const a=[];switch(r){case"/":a.push({route:"/connect",probability:.7},{route:"/about",probability:.2},{route:"/document",probability:.1});break;case"/connect":a.push({route:"/mail",probability:.8},{route:"/settings",probability:.1});break;case"/mail":a.push({route:"/compose",probability:.4},{route:"/settings",probability:.2});break;default:a.push({route:"/",probability:.1})}return a}static getStats(){return{routeCount:this.routeMap.size,cacheSize:ue.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};Ze.routeMap=new Map,Ze.routeUsageStats=new Map,Ze.currentRoute="";let et=Ze;const Eu=({src:e,alt:r,className:a,placeholder:n,priority:o="medium"})=>{const[s,i]=p.useState(!1),[l,d]=p.useState(!1),c=p.useRef(null);p.useEffect(()=>{if(!c.current)return;if(o==="high"){d(!0);return}const h=new IntersectionObserver(([w])=>{w.isIntersecting&&(d(!0),h.unobserve(w.target))},{rootMargin:o==="low"?"100px":"200px",threshold:.1});return h.observe(c.current),()=>h.disconnect()},[o]);const u=()=>{i(!0)};return t.jsxs("div",{className:`lazy-image-container ${a}`,children:[t.jsx("img",{ref:c,src:l?e:n||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,onLoad:u,loading:o==="high"?"eager":"lazy",fetchPriority:o==="high"?"high":"low"}),!s&&l&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function Tu(){ue.clear(),lr.clear()}function Au(){return{cachedComponents:ue.size,preloadQueue:lr.size,networkSpeed:$e,isLowEndDevice:Rr,cacheEntries:Array.from(ue.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const Iu=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Mu=e=>{if(typeof e=="function"||typeof e=="object")return e;switch(e){case"minimal":return()=>t.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>t.jsxs("div",{className:"animate-pulse",children:[t.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),t.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>t.jsx(Iu,{message:"Loading component..."})}},Xa=(e,r="default",a=3)=>{const n=p.lazy(async()=>{let s=null;for(let i=0;i<a;i++)try{return await e()}catch(l){s=l,i<a-1&&await new Promise(d=>setTimeout(d,Math.pow(2,i)*1e3))}throw s}),o=Mu(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},Lu=async e=>{try{await e()}catch{}},Pu=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=Xa(n,"skeleton")}),r},Ou=e=>e,Qa={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},Xe=class Xe{static add(r,a){this.preloadedComponents.has(r)||(this.preloadQueue.push({name:r,loader:a}),this.processQueue())}static async processQueue(){this.isPreloading||this.preloadQueue.length===0||(this.isPreloading=!0,"requestIdleCallback"in window?window.requestIdleCallback(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()}):setTimeout(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()},100))}static isPreloaded(r){return this.preloadedComponents.has(r)}static clear(){this.preloadedComponents.clear(),this.preloadQueue=[],this.isPreloading=!1}};Xe.preloadedComponents=new Set,Xe.preloadQueue=[],Xe.isPreloading=!1;let rt=Xe;const Uu=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{Qa.secondary.forEach(e=>{})})},Ja=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),He=new Map;function Du(e,r){const{condition:a,fallback:n,retries:o=3,timeout:s=1e4,priority:i="medium",cacheKey:l=`conditional-${Math.random()}`}=r,d=c=>{const[u,h]=p.useState(!1),[w,m]=p.useState(null);return p.useEffect(()=>{const v=setTimeout(async()=>{const T=He.get(l);if(T&&T.isValid&&Date.now()-T.lastCheck<3e5)try{if(await T.condition()){m(()=>T.component),h(!0);return}}catch{}try{if(await a()){const S=await zu(e,o,s);He.set(l,{component:S.default,condition:a,lastCheck:Date.now(),isValid:!0}),m(()=>S.default),h(!0)}}catch{}},i==="high"?0:i==="medium"?100:500);return()=>clearTimeout(v)},[]),u?w?t.jsx(p.Suspense,{fallback:n||t.jsx(Ja,{message:"Loading component..."}),children:t.jsx(w,{...c})}):null:n||t.jsx(Ja,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${l})`,d}const ju={},_u={};async function zu(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((i,l)=>{setTimeout(()=>l(new Error("Import timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const i=Math.pow(2,o)*1e3;await new Promise(l=>setTimeout(l,i))}}throw n}function Bu(){He.clear()}function Wu(){return{cachedComponents:He.size,cacheEntries:Array.from(He.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const Ra=[{name:"react-router",path:"/assets/react-router-*.js",size:12,config:{priority:"critical",condition:()=>!0}},{name:"app-core",path:"/assets/app-core-*.js",size:25,config:{priority:"high",condition:()=>window.location.pathname==="/",delay:1e3,onIdle:!0}},{name:"wagmi",path:"/assets/wagmi-*.js",size:15,config:{priority:"high",condition:()=>!!(window.ethereum||localStorage.getItem("walletconnect")),onIdle:!0}},{name:"wc-ethereum",path:"/assets/wc-ethereum-*.js",size:273,config:{priority:"medium",condition:()=>!!window.ethereum,delay:2e3,onHover:!0}},{name:"solana-core",path:"/assets/solana-core-*.js",size:29,config:{priority:"medium",condition:()=>!!(window.solana||window.phantom),delay:1500}},{name:"mail-features",path:"/assets/mail-features-*.js",size:10,config:{priority:"medium",condition:()=>window.location.pathname.includes("/connect")||localStorage.getItem("wallet-connected")==="true",onScroll:20}},{name:"coinbase",path:"/assets/coinbase-*.js",size:75,config:{priority:"low",condition:()=>!!window.ethereum,delay:5e3,onIdle:!0}},{name:"design-system",path:"/assets/design-system-*.js",size:112,config:{priority:"low",condition:()=>window.location.pathname.includes("/internal"),delay:3e3}}];class Fu{constructor(){this.preloaded=new Set,this.networkSpeedEstimate="medium",this.isLowEndDevice=!1,this.userActivityScore=0,this.detectNetworkSpeed(),this.detectDeviceCapability(),this.startUserActivityTracking()}detectNetworkSpeed(){if("connection"in navigator){const a=navigator.connection;if(a){const n=a.effectiveType;n==="4g"?this.networkSpeedEstimate="fast":n==="3g"?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}}const r=performance.now();fetch("/favicon.ico",{method:"HEAD"}).then(()=>{const a=performance.now()-r;a<100?this.networkSpeedEstimate="fast":a<300?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}).catch(()=>{this.networkSpeedEstimate="slow"})}detectDeviceCapability(){const r=navigator.deviceMemory,a=navigator.hardwareConcurrency;r&&r<4&&(this.isLowEndDevice=!0),a&&a<4&&(this.isLowEndDevice=!0),"getBattery"in navigator&&navigator.getBattery?.().then(n=>{n.level&&n.level<.2&&(this.isLowEndDevice=!0)})}startUserActivityTracking(){let r;const a=()=>{this.userActivityScore=Math.min(this.userActivityScore+1,100),clearTimeout(r),r=setTimeout(()=>{this.userActivityScore=Math.max(this.userActivityScore-1,0)},5e3)};["click","scroll","keydown","mousemove"].forEach(n=>{document.addEventListener(n,a,{passive:!0})})}shouldPreload(r){return this.networkSpeedEstimate==="slow"&&r.size>50||this.isLowEndDevice&&r.size>30?!1:r.config.condition()}async preloadChunk(r){if(!this.preloaded.has(r.name))try{if(document.querySelectorAll('script[src*="'+r.name+'"]').length===0&&document.querySelectorAll('link[href*="'+r.name+'"]').length>0)return;const n=document.createElement("link");n.rel="modulepreload",n.href=r.path.replace("*",this.getChunkHash(r.name)),n.crossOrigin="","fetchPriority"in n&&(n.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(n),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const n of a){const o=n.src;if(o.includes(r)){const s=o.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(s)return s[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(n=>setTimeout(n,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(n=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(n)})}):this.preloadChunk(r)}initializePreloading(){Ra.sort((a,n)=>{const o={critical:0,high:1,medium:2,low:3};return o[a.config.priority]-o[n.config.priority]}).forEach(a=>{this.shouldPreload(a)&&(a.config.priority==="critical"?this.preloadChunk(a):this.schedulePreload(a),a.config.onHover&&this.setupHoverPreloading(a),a.config.onScroll&&this.setupScrollPreloading(a,a.config.onScroll))}),this.startIntelligentPreloading()}setupHoverPreloading(r){document.querySelectorAll("[data-preload-on-hover]").forEach(n=>{let o=!1;n.addEventListener("mouseenter",()=>{!o&&this.userActivityScore>30&&(this.preloadChunk(r),o=!0)},{passive:!0})})}setupScrollPreloading(r,a){let n=!1;const o=()=>{if(n)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),n=!0,window.removeEventListener("scroll",o))};window.addEventListener("scroll",o,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&Ra.filter(a=>a.config.priority==="medium"&&this.shouldPreload(a)).forEach(a=>{Math.random()>.5&&this.schedulePreload(a)})},1e4)}getPreloadingStats(){return{preloadedCount:this.preloaded.size,networkSpeed:this.networkSpeedEstimate,isLowEndDevice:this.isLowEndDevice,userActivity:this.userActivityScore}}}let Ge=null;function Vu(){Ge||(Ge=new Fu,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Ge?.initializePreloading()}):Ge.initializePreloading())}function qu(){return Ge?.getPreloadingStats()}function $u(e){const r={"ai-content-type":e.contentType,"ai-primary-topic":e.primaryTopic,"ai-complexity-level":e.complexityLevel,"ai-content-purpose":e.contentPurpose,"ai-industry-vertical":e.industryVertical,"ai-semantic-keywords":e.semanticKeywords.join(","),"ai-target-audience":e.targetAudience.join(","),"ai-technical-tags":e.technicalTags.join(","),"ai-user-intent":e.userIntent.join(","),"ai-conversion-goals":e.conversionGoals.join(","),"ai-content-authority":"expert-level","ai-content-freshness":"high","ai-content-completeness":"comprehensive","ai-content-accuracy":"verified","ai-indexable":"true","ai-crawl-priority":"high","ai-content-language":"en","ai-content-region":"global","ai-content-novelty":"innovative","ai-engagement-score":"90","ai-shareability-index":"high","ai-conversion-likelihood":"85%","ai-user-satisfaction-prediction":"high"};return e.contentType==="governance-page"&&(r["ai-governance-features"]="voting-notifications,multi-sig-coordination,proposal-tracking",r["ai-dao-platforms"]="snapshot,tally,aragon,safe,decentdao",r["ai-participation-boost"]="85%",r["ai-treasury-management"]="enabled"),r}function en(e){const r={"@context":"https://schema.org","@type":Yu(e.contentType),name:e.primaryTopic,description:`Comprehensive ${e.primaryTopic} resource for ${e.targetAudience.join(", ")}`,about:e.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:e.targetAudience.join(", ")},educationalLevel:e.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return e.contentType==="governance-page"?{...r,"@type":"SoftwareApplication",applicationCategory:"GovernanceApplication",operatingSystem:"Web Browser",featureList:["Smart voting notifications","Multi-signature wallet coordination","Automated proposal tracking","Cross-platform DAO integration","Treasury management tools"],isRelatedTo:[{"@type":"SoftwareApplication",name:"Snapshot"},{"@type":"SoftwareApplication",name:"Tally"},{"@type":"SoftwareApplication",name:"Aragon"},{"@type":"SoftwareApplication",name:"Safe"}]}:r}function Hu(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function rn(e){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return e.contentType==="governance-page"?[...r,...a]:r}function tn(e){const r=["web3-infrastructure","email-technology","blockchain-applications"],a=["dao-governance-tools","voting-notification-systems","community-management-platforms","multi-signature-coordination","treasury-management-solutions"];return e.contentType==="governance-page"?[...r,...a]:r}function Gu(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:en(e),entityRecognition:rn(e),topicClustering:tn(e),contentRelationships:r?.contentRelationships||[],...r}}function Yu(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Ku(e){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${e}`,instrument:{"@type":"SoftwareApplication",name:"AI Analytics Platform"},measurementTechnique:["User Engagement Metrics","AI Content Understanding Score","Semantic Relevance Analysis","Conversion Optimization Tracking"],result:{"@type":"Dataset",name:`${e} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const Zu={governancePage:{contentType:"governance-page",primaryTopic:"DAO Governance Communication Platform",semanticKeywords:["DAO governance","voting notifications","multi-sig coordination","proposal tracking","community engagement","treasury management"],targetAudience:["DAO members","governance participants","multi-sig signers","protocol teams","community managers"],complexityLevel:"intermediate",contentPurpose:"commercial",industryVertical:"blockchain-governance",technicalTags:["snapshot","tally","aragon","safe","multi-sig","voting","proposals","treasury"],userIntent:["improve-governance","increase-participation","coordinate-multi-sig","track-proposals","engage-community"],conversionGoals:["dao-integration","governance-setup","multi-sig-connection","notification-activation"]},landingPage:{contentType:"landing-page",primaryTopic:"Web3 Email Platform",semanticKeywords:["Web3 email","wallet authentication","ENS email","SNS email","blockchain email","decentralized communication"],targetAudience:["Web3 users","crypto enthusiasts","blockchain developers","DeFi users"],complexityLevel:"beginner",contentPurpose:"commercial",industryVertical:"web3-communication",technicalTags:["ethereum","solana","ens","sns","wallet-connect","metamask","phantom"],userIntent:["create-web3-email","connect-wallet","secure-communication","eliminate-passwords"],conversionGoals:["wallet-connection","email-creation","first-email-sent","premium-upgrade"]}},Xu=({message:e,className:r})=>t.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),tt=new Map,Ye=new Set;function at(){const e=[];return!!window.ethereum?.isMetaMask&&(Ye.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(Ye.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(Ye.add("phantom"),e.push({name:"Phantom",detected:!0,priority:3})),e.push({name:"WalletConnect",detected:!0,priority:4}),e.sort((o,s)=>o.priority-s.priority)}function nt(e){const r=`wallet-${e.toLowerCase()}`;if(tt.has(r))return tt.get(r);const a=()=>Promise.resolve({default:()=>p.createElement("div",{},`${e} Provider Placeholder`)}),n=p.lazy(a),o=s=>t.jsx(p.Suspense,{fallback:t.jsx(Xu,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,tt.set(r,o),o}function Qu({children:e}){const r=at();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=nt(a.name);return t.jsx(n,{},a.name)}),e]})}const lt=class lt{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{nt(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};lt.preloadedWallets=new Set;let Ke=lt;function Ju(){return{availableWallets:at(),preloadWallet:n=>{Ke.preloadWallet(n)},getDetectedWallets:()=>Array.from(Ye),hasWallet:n=>Ye.has(n.toLowerCase())}}function Ru({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{Ke.preloadWallet(e),setTimeout(r,100)};return t.jsxs("button",{onClick:n,disabled:a,className:"wallet-connect-btn","data-wallet":e.toLowerCase(),children:["Connect ",e]})}class eg{constructor(){this.criticalResources=[],this.observedMetrics={fcp:0,lcp:0,fid:0,cls:0,ttfb:0},this.defineCriticalResources(),this.startPerformanceObservation()}defineCriticalResources(){this.criticalResources=[{url:"/assets/index-*.css",type:"style",priority:"critical",preload:!0},{url:"/assets/index-*.js",type:"script",priority:"critical"},{url:"/assets/react-core-*.js",type:"script",priority:"high",preload:!0},{url:"https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",type:"font",priority:"critical",preload:!0},{url:"/logo.png",type:"image",priority:"high",preload:!0}]}startPerformanceObservation(){if("PerformanceObserver"in window)try{new PerformanceObserver(s=>{for(const i of s.getEntries())i.name==="first-contentful-paint"&&(this.observedMetrics.fcp=i.startTime,this.optimizeBasedOnFCP(i.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(s=>{for(const i of s.getEntries())this.observedMetrics.lcp=i.startTime,this.optimizeBasedOnLCP(i.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let n=0;new PerformanceObserver(s=>{for(const i of s.getEntries())i.hadRecentInput||(n+=i.value);this.observedMetrics.cls=n}).observe({entryTypes:["layout-shift"]})}catch{}window.addEventListener("load",()=>{setTimeout(()=>{const r=performance.getEntriesByType("navigation")[0];r&&(this.observedMetrics.ttfb=r.responseStart-r.requestStart,this.optimizeBasedOnTTFB(this.observedMetrics.ttfb))},0)})}optimizeBasedOnFCP(r){r>2e3?this.applyEmergencyOptimizations():r>1500&&this.applyMediumOptimizations()}optimizeBasedOnLCP(r){r>2500&&this.optimizeLCPElements()}optimizeBasedOnTTFB(r){r>600&&this.enableAggressiveCaching()}applyEmergencyOptimizations(){document.querySelectorAll('img[data-priority="low"]').forEach(n=>{n.loading="lazy",n.style.display="none",setTimeout(()=>{n.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(n=>{n.setAttribute("defer","")})}applyMediumOptimizations(){["/assets/app-core-*.js","/assets/react-router-*.js"].forEach(a=>{this.preloadResource(a,"script")})}optimizeLCPElements(){document.querySelectorAll("img[data-hero], [data-lcp-element]").forEach(n=>{n instanceof HTMLImageElement&&(n.fetchPriority="high",n.loading="eager")});const a=document.querySelector("img[data-hero]")?.getAttribute("src");a&&this.preloadResource(a,"image")}enableAggressiveCaching(){const r=document.createElement("meta");r.httpEquiv="Cache-Control",r.content="public, max-age=31536000, immutable",document.head.appendChild(r)}preloadResource(r,a){if(document.querySelector(`link[href*="${r}"]`))return;const o=document.createElement("link");switch(o.rel="preload",o.href=r,a){case"script":o.as="script";break;case"style":o.as="style";break;case"font":o.as="font",o.type="font/woff2",o.crossOrigin="";break;case"image":o.as="image";break}document.head.appendChild(o)}optimizeCriticalPath(){this.criticalResources.filter(r=>r.priority==="critical"&&r.preload).forEach(r=>{this.preloadResource(r.url,r.type)}),this.inlineCriticalCSS(),this.optimizeFontLoading(),this.removeRenderBlocking(),this.setupProgressiveLoading()}inlineCriticalCSS(){const r=document.querySelector('link[rel="stylesheet"][data-critical]');r&&this.isSmallResource(r.getAttribute("href")||"")&&fetch(r.getAttribute("href")||"").then(a=>a.text()).then(a=>{if(a.length<1e4){const n=document.createElement("style");n.textContent=a,document.head.appendChild(n),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const n=a.getAttribute("href")||"";if(!n.includes("display=swap")){const o=n.includes("?")?"&":"?";a.setAttribute("href",`${n}${o}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const n=a.cloneNode(!0);n.rel="preload",n.as="style",n.onload=()=>{n.onload=null,n.rel="stylesheet"};const o=document.createElement("noscript"),s=a.cloneNode(!0);o.appendChild(s),document.head.appendChild(n),document.head.appendChild(o),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.src=s.dataset.src||"",s.removeAttribute("data-src"),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(n=>a.observe(n))}else r.forEach(a=>{const n=a;n.src=n.dataset.src||""})}isSmallResource(r){return r.includes("critical")||r.includes("inline")}getPerformanceMetrics(){return{...this.observedMetrics,score:this.calculatePerformanceScore()}}calculatePerformanceScore(){let r=100;return this.observedMetrics.fcp>2e3?r-=20:this.observedMetrics.fcp>1500&&(r-=10),this.observedMetrics.lcp>2500?r-=25:this.observedMetrics.lcp>2e3&&(r-=15),this.observedMetrics.cls>.1?r-=15:this.observedMetrics.cls>.05&&(r-=8),this.observedMetrics.ttfb>600?r-=10:this.observedMetrics.ttfb>400&&(r-=5),Math.max(r,0)}}const cr={mark:e=>{typeof performance<"u"&&performance.mark&&performance.mark(e)},measure:(e,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,a);const n=performance.getEntriesByName(e);return n[n.length-1]?.duration||0}catch{return 0}return 0},getEntries:e=>typeof performance<"u"&&performance.getEntriesByName?e?performance.getEntriesByName(e):performance.getEntries():[],clearEntries:e=>{typeof performance<"u"&&(e?(performance.clearMeasures?.(e),performance.clearMarks?.(e)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},rg=(e,r=[])=>{p.useEffect(()=>(cr.mark(`${e}-start`),()=>{cr.mark(`${e}-end`),cr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},tg=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},ag=(e,r,a)=>{const n=p.useRef(r),o=p.useRef(void 0);return p.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((s,i)=>s!==n.current[i]),n.current=r,o.current=e(),o.current),[e,a,r])},dr=new Map,ng=e=>{const r=dr.get(e)||0;dr.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},og=()=>Object.fromEntries(dr),sg=()=>dr.clear(),ig=e=>p.lazy(e),lg=(e=.1)=>{const[r,a]=p.useState(new Set),n=p.useRef(null);p.useEffect(()=>(n.current=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting){const l=i.target,d=l.dataset.src;d&&(l.src=d,l.onload=()=>{a(c=>new Set(c).add(d))},n.current?.unobserve(l))}})},{threshold:e}),()=>n.current?.disconnect()),[e]);const o=p.useCallback(s=>{s&&n.current&&n.current.observe(s)},[]);return{loadedImages:r,observeImage:o}},cg=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},an={},dg=e=>{an[e.name]=e.value,process.env.NODE_ENV},ug=()=>an,gg=(e,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=e,a.as=r,document.head.appendChild(a)}},hg=(e,r="script",a)=>{if(typeof document<"u"){const n=document.createElement("link");n.rel="preload",n.href=e,n.as=r,a&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}},fg=e=>{const r=p.useRef(new Set),a=p.useRef(new Set),n=p.useCallback((s,i)=>{const l=setTimeout(()=>{r.current.delete(l),s()},i);return r.current.add(l),l},[]),o=p.useCallback((s,i)=>{const l=setInterval(s,i);return a.current.add(l),l},[]);return p.useEffect(()=>{const s=r.current,i=a.current;return()=>{s.forEach(l=>clearTimeout(l)),i.forEach(l=>clearInterval(l)),process.env.NODE_ENV}},[e]),{createTimer:n,createInterval:o}},ge={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:e=>{const r=[];return e.FCP&&e.FCP>ge.maxFCP&&r.push(`FCP (${e.FCP}ms) exceeds budget (${ge.maxFCP}ms)`),e.LCP&&e.LCP>ge.maxLCP&&r.push(`LCP (${e.LCP}ms) exceeds budget (${ge.maxLCP}ms)`),e.FID&&e.FID>ge.maxFID&&r.push(`FID (${e.FID}ms) exceeds budget (${ge.maxFID}ms)`),e.CLS&&e.CLS>ge.maxCLS&&r.push(`CLS (${e.CLS}) exceeds budget (${ge.maxCLS})`),r}};class bg{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){je.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),je.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),je.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),je.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),je.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{if(s.entryType==="navigation"){const i=s;this.metrics.bundleLoadTime=i.loadEventEnd-i.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{(s.name.includes(".js")||s.name.includes(".css"))&&this.trackResourceLoad(s.name,s.duration)})});try{a.observe({entryTypes:["resource"]}),this.observers.push(a)}catch{}}}collectDeviceInfo(){if(typeof window<"u"){const r=navigator;r.connection&&(this.metrics.connection=r.connection.effectiveType||r.connection.type),r.deviceMemory&&(this.metrics.deviceMemory=r.deviceMemory),r.hardwareConcurrency&&(this.metrics.hardwareConcurrency=r.hardwareConcurrency),this.metrics.viewport={width:window.innerWidth,height:window.innerHeight}}}reportMetric(r,a){this.reportCallback&&this.reportCallback({...this.metrics,timestamp:Date.now()}),process.env.NODE_ENV}trackResourceLoad(r,a){const n=r.includes(".js"),o=r.includes(".css");if(n||o){const s=n?"JavaScript":"CSS";this.reportMetric(`${s} Load`,a)}}measureComponentRender(r,a){this.metrics.componentRenderTime=a,this.reportMetric(`Component Render (${r})`,a)}measureAPICall(r,a){this.metrics.apiResponseTime=a,this.reportMetric(`API Call (${r})`,a)}measureRouteChange(r,a){this.metrics.routeChangeTime=a,this.reportMetric(`Route Change (${r})`,a)}markStart(r){this.performanceMarks.set(r,performance.now())}markEnd(r){const a=this.performanceMarks.get(r);if(a){const n=performance.now()-a;this.reportMetric(`Mark (${r})`,n),this.performanceMarks.delete(r)}}trackRouteChange(r,a,n){typeof a=="string"?this.measureRouteChange(a,n||performance.now()):this.measureRouteChange(r,a)}getSummary(){return{coreWebVitals:{score:this.calculateScore(),LCP:this.metrics.LCP,INP:this.metrics.INP,CLS:this.metrics.CLS},loadingPerformance:{FCP:this.metrics.FCP,TTFB:this.metrics.TTFB,bundleLoadTime:this.metrics.bundleLoadTime},runtime:{routeChangeTime:this.metrics.routeChangeTime,apiResponseTime:this.metrics.apiResponseTime,componentRenderTime:this.metrics.componentRenderTime},device:{connection:this.metrics.connection,deviceMemory:this.metrics.deviceMemory,hardwareConcurrency:this.metrics.hardwareConcurrency}}}calculateScore(){let r=100;return this.metrics.LCP&&this.metrics.LCP>2500?r-=25:this.metrics.LCP&&this.metrics.LCP>2e3&&(r-=15),this.metrics.INP&&this.metrics.INP>200?r-=20:this.metrics.INP&&this.metrics.INP>100&&(r-=10),this.metrics.CLS&&this.metrics.CLS>.1?r-=15:this.metrics.CLS&&this.metrics.CLS>.05&&(r-=8),Math.max(r,0)}getMetrics(){return{...this.metrics}}cleanup(){this.observers.forEach(r=>r.disconnect()),this.observers=[]}}let ur=null;const mg=e=>(ur||(ur=new bg(e)),ur),gr=()=>ur,nn=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=gr();n&&n.measureComponentRender(e,a)},[e])},yg=(e,r)=>p.forwardRef((a,n)=>(nn(r),p.createElement(e,{...a,ref:n}))),pg=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=gr();return s&&s.measureAPICall(r,o),n},on={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},vg=(e,r=on)=>{const a=[];return r.LCP&&e.LCP&&e.LCP>r.LCP&&a.push(`LCP: ${e.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&e.INP&&e.INP>r.INP&&a.push(`INP: ${e.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&e.CLS&&e.CLS>r.CLS&&a.push(`CLS: ${e.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&e.FCP&&e.FCP>r.FCP&&a.push(`FCP: ${e.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&e.TTFB&&e.TTFB>r.TTFB&&a.push(`TTFB: ${e.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},wg=e=>{const r=e||gr()?.getMetrics()||{timestamp:Date.now()},a={timestamp:new Date().toISOString(),metrics:r,environment:{userAgent:typeof window<"u"?window.navigator.userAgent:"unknown",url:typeof window<"u"?window.location.href:"unknown",referrer:typeof document<"u"?document.referrer:"unknown",viewport:r.viewport,connection:r.connection,deviceMemory:r.deviceMemory,hardwareConcurrency:r.hardwareConcurrency}};return JSON.stringify(a,null,2)},kg=({direction:e,className:r})=>t.jsx("svg",{className:f("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),xg=({className:e})=>t.jsx("svg",{className:f("w-4 h-4",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),sn=({title:e="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:n,onMouseDown:o,isDragging:s,className:i})=>t.jsxs("div",{className:f("bg-gray-900 text-white rounded-t-lg px-3 py-2","flex items-center justify-between","shadow-lg border border-gray-700","select-none",o&&"cursor-grab",s&&"cursor-grabbing",i),onMouseDown:o,children:[t.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx("span",{children:"🚀"}),e]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:t.jsx(kg,{direction:r?"up":"down"})}),n&&t.jsx("button",{onClick:n,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:t.jsx(xg,{})})]})]}),Ng={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},Cg={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},Sg={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},Eg=({rating:e,size:r="sm",showLabel:a=!1,className:n})=>t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("span",{className:f("rounded-full",Ng[r],Cg[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:Sg[e]})]}),ln=({className:e})=>t.jsxs("div",{className:f("flex gap-3 text-[10px] text-gray-400",e),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),Tg={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},H=({label:e,value:r,unit:a="",rating:n="neutral",description:o,className:s})=>{const i=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return t.jsxs("div",{className:f("flex justify-between items-center",s),children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-gray-300",children:e}),o&&t.jsx("span",{className:"text-[10px] text-gray-500",children:o})]}),t.jsxs("span",{className:f("font-medium",Tg[n]),children:[i,a]})]})},Ag=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,cn=(e={})=>{const{enabled:r=!0,onUpdate:a}=e,[n,o]=p.useState({}),[s,i]=p.useState(!0),l=p.useRef(a);p.useEffect(()=>{l.current=a},[a]);const d=p.useCallback(c=>{o(u=>{const h={...u,...c};return l.current?.(h),h})},[]);return p.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){i(!1);return}const c=[];try{const u=new PerformanceObserver(h=>{const w=h.getEntries(),m=w[w.length-1];d({lcp:m.renderTime||m.loadTime})});u.observe({type:"largest-contentful-paint",buffered:!0}),c.push(u)}catch{}try{const u=new PerformanceObserver(h=>{h.getEntries().forEach(m=>{m.processingStart&&d({fid:m.processingStart-m.startTime})})});u.observe({type:"first-input",buffered:!0}),c.push(u)}catch{}try{let u=0;const h=new PerformanceObserver(w=>{for(const m of w.getEntries())!m.hadRecentInput&&m.value&&(u+=m.value,d({cls:u}))});h.observe({type:"layout-shift",buffered:!0}),c.push(h)}catch{}try{const u=new PerformanceObserver(h=>{h.getEntries().forEach(m=>{m.name==="first-contentful-paint"&&d({fcp:m.startTime})})});u.observe({type:"paint",buffered:!0}),c.push(u)}catch{}try{const u=new PerformanceObserver(h=>{h.getEntries().forEach(m=>{m.duration&&d({inp:m.duration})})});u.observe({type:"event",buffered:!0}),c.push(u)}catch{}try{const u=performance.getEntriesByType("navigation")[0];u&&d({ttfb:u.responseStart-u.requestStart})}catch{}return()=>{c.forEach(u=>u.disconnect())}},[r,d]),{metrics:n,isSupported:s}},Ae=(e,r)=>{if(r===void 0)return"unknown";const n={lcp:{good:2500,poor:4e3},fid:{good:100,poor:300},cls:{good:.1,poor:.25},fcp:{good:1800,poor:3e3},ttfb:{good:800,poor:1800},inp:{good:200,poor:500}}[e];return n?r<=n.good?"good":r<=n.poor?"needs-improvement":"poor":"unknown"},dn=({metrics:e,className:r})=>{const a=(n,o=0)=>n===void 0?"N/A":n.toFixed(o);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"LCP",value:a(e.lcp),unit:"ms",rating:Ae("lcp",e.lcp),description:"Largest Contentful Paint"}),t.jsx(H,{label:"FID",value:a(e.fid),unit:"ms",rating:Ae("fid",e.fid),description:"First Input Delay"}),t.jsx(H,{label:"CLS",value:a(e.cls,3),rating:Ae("cls",e.cls),description:"Cumulative Layout Shift"}),t.jsx(H,{label:"FCP",value:a(e.fcp),unit:"ms",rating:Ae("fcp",e.fcp),description:"First Contentful Paint"}),t.jsx(H,{label:"TTFB",value:a(e.ttfb),unit:"ms",rating:Ae("ttfb",e.ttfb),description:"Time to First Byte"}),e.inp!==void 0&&t.jsx(H,{label:"INP",value:a(e.inp),unit:"ms",rating:Ae("inp",e.inp),description:"Interaction to Next Paint"})]})]})},un=(e={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:n}=e,[o,s]=p.useState({}),i=p.useRef(n);p.useEffect(()=>{i.current=n},[n]);const l=p.useCallback(()=>{if(!(typeof performance>"u"))try{const c=performance.getEntriesByType("resource"),u=c.filter(v=>v.name.endsWith(".js")||v.initiatorType==="script"),h=u.reduce((v,T)=>v+T.duration,0),w=c.filter(v=>v.name.endsWith(".css")||v.initiatorType==="link"),m=w.reduce((v,T)=>v+T.duration,0),b=c.reduce((v,T)=>v+(T.transferSize||0),0),y={jsLoadTime:h,cssLoadTime:m,jsCount:u.length,cssCount:w.length,totalTransferSize:b};s(y),i.current?.(y)}catch{}},[]),d=p.useCallback(()=>{l()},[l]);return p.useEffect(()=>{if(!r)return;l();const c=setInterval(l,a);return()=>clearInterval(c)},[r,a,l]),{metrics:o,refresh:d}},gn=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,hn=({metrics:e,className:r})=>{const a=n=>n===void 0?"N/A":n.toFixed(0);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"JS Load",value:a(e.jsLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"CSS Load",value:a(e.cssLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"JS Files",value:e.jsCount??"N/A",rating:"neutral"}),t.jsx(H,{label:"Transfer Size",value:gn(e.totalTransferSize),rating:"neutral"})]})]})},Ig=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",fn=({metrics:e,className:r})=>{const a=n=>n===void 0||isNaN(n)?"N/A":n.toFixed(0);return e.callCount===0?null:t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Count",value:e.callCount,rating:"neutral"}),t.jsx(H,{label:"Total Time",value:a(e.totalTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"Avg Time",value:a(e.averageTime),unit:"ms",rating:Ig(e.averageTime)}),e.slowestCall!==void 0&&t.jsx(H,{label:"Slowest",value:a(e.slowestCall),unit:"ms",rating:e.slowestCall>1e3?"poor":"neutral"}),e.failedCalls>0&&t.jsx(H,{label:"Failed",value:e.failedCalls,rating:"poor"})]})]})},bn=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),mn=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},yn=({refreshInterval:e=2e3,className:r})=>{const[a,n]=p.useState({}),[o,s]=p.useState(!0);if(p.useEffect(()=>{const l=performance;if(!l.memory){s(!1);return}const d=()=>{l.memory&&n({usedJSHeapSize:l.memory.usedJSHeapSize,totalJSHeapSize:l.memory.totalJSHeapSize,jsHeapSizeLimit:l.memory.jsHeapSizeLimit})};d();const c=setInterval(d,e);return()=>clearInterval(c)},[e]),!o)return null;const i=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Used Heap",value:bn(a.usedJSHeapSize),unit:"MB",rating:mn(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:bn(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:i,unit:"%",rating:mn(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},Mg=e=>{if(e.rating)return e.rating;if(typeof e.value=="number"&&e.thresholds){const{good:r,poor:a}=e.thresholds;return e.value<=r?"good":e.value<=a?"needs-improvement":"poor"}return"neutral"},pn=({title:e="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:n})=>a.length===0?null:t.jsxs("div",{className:f("space-y-1",n),children:[t.jsx("h3",{className:f("font-semibold mb-2 text-xs",r),children:e}),t.jsx("div",{className:"space-y-1.5",children:a.map(o=>t.jsx(H,{label:o.label,value:o.value,unit:o.unit,rating:Mg(o),description:o.description},o.id))})]}),Lg=["/api/","graphql",".json"],vn=(e={})=>{const{enabled:r=!0,patterns:a=Lg,refreshInterval:n=5e3,onUpdate:o}=e,[s,i]=p.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),l=p.useRef(a),d=p.useRef(o);p.useEffect(()=>{l.current=a},[a]),p.useEffect(()=>{d.current=o},[o]);const c=p.useCallback(()=>{if(!(typeof performance>"u"))try{const h=performance.getEntriesByType("resource"),w=l.current,m=h.filter(N=>w.some(S=>N.name.includes(S)));if(m.length===0)return;const b=m.reduce((N,S)=>N+S.duration,0),y=Math.max(...m.map(N=>N.duration)),v=m.filter(N=>{const S=N.responseStatus;return S!==void 0&&S>=400}).length,T={callCount:m.length,totalTime:b,averageTime:b/m.length,slowestCall:y,failedCalls:v};i(T),d.current?.(T)}catch{}},[]),u=p.useCallback(()=>{c()},[c]);return p.useEffect(()=>{if(!r)return;c();const h=setInterval(c,n);return()=>clearInterval(h)},[r,n,c]),{metrics:s,refresh:u}},wn=(e={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:n=!1,verticalOnly:o=!1,initialPosition:s}=e,i=p.useRef(null),[l,d]=p.useState({x:s?.x??null,y:s?.y??null}),[c,u]=p.useState(!1),[h,w]=p.useState({x:0,y:0}),m=p.useCallback(y=>{if(!r||!i.current)return;const v=i.current.getBoundingClientRect();u(!0),w({x:y.clientX-v.left,y:y.clientY-v.top}),(l.x===null||l.y===null)&&d({x:n?v.left:l.x??v.left,y:o?v.top:l.y??v.top}),y.preventDefault()},[r,l,n,o]),b=p.useCallback(()=>{d({x:s?.x??null,y:s?.y??null})},[s]);return p.useEffect(()=>{if(!c)return;const y=T=>{if(!i.current)return;let N=T.clientX-h.x,S=T.clientY-h.y;if(a){const k=window.innerWidth-i.current.offsetWidth,C=window.innerHeight-i.current.offsetHeight;N=Math.max(0,Math.min(N,k)),S=Math.max(0,Math.min(S,C))}d({x:n?N:o?l.x:N,y:o?S:n?l.y:S})},v=()=>{u(!1)};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v)}},[c,h,a,n,o,l.x,l.y]),{position:l,isDragging:c,handleMouseDown:m,resetPosition:b,ref:i}},kn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Pg=["webVitals","bundle","api","memory"],Og=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=Pg,customMetrics:i=[],customSectionTitle:l="Custom Metrics",apiPatterns:d,onMetricsUpdate:c,className:u})=>{const h=e??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[w,m]=p.useState(r),[b,y]=p.useState(a),v=p.useMemo(()=>d,[JSON.stringify(d)]),T=p.useRef(c);p.useEffect(()=>{T.current=c},[c]);const{metrics:N}=cn({enabled:h&&s.includes("webVitals")}),{metrics:S}=un({enabled:h&&s.includes("bundle")}),{metrics:k}=vn({enabled:h&&s.includes("api"),patterns:v});p.useEffect(()=>{T.current&&T.current({webVitals:N,bundle:S,api:k})},[N,S,k]);const{position:C,isDragging:I,handleMouseDown:E,ref:M}=wn({enabled:o,horizontalOnly:n.includes("bottom")||n.includes("top")}),x=p.useCallback(()=>{m(z=>!z)},[]),P=p.useCallback(()=>{y(!1)},[]),D=p.useCallback(()=>{y(!0)},[]);if(!h)return null;if(!b)return t.jsx("button",{onClick:D,className:f("fixed z-[9999]",kn[n],"bg-gray-900 text-white px-3 py-2 rounded-lg","shadow-lg border border-gray-700","hover:bg-gray-800 transition-colors","text-xs font-mono"),type:"button",children:"🚀 Performance"});const U=C.x!==null?{left:`${C.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:I?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},B=i.length>0||s.includes("custom");return t.jsxs("div",{ref:M,className:f(C.x!==null?"":`fixed ${kn[n]}`,"z-[9999] font-mono text-xs",I&&"cursor-grabbing",u),style:{maxWidth:"320px",...U},children:[t.jsx(sn,{isCollapsed:w,onToggleCollapse:x,onClose:P,onMouseDown:o?E:void 0,isDragging:I}),t.jsx("div",{className:f("bg-gray-800 text-gray-100 rounded-b-lg","shadow-lg border-x border-b border-gray-700","overflow-hidden transition-all duration-300 ease-in-out",w?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:t.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[s.includes("webVitals")&&t.jsx(dn,{metrics:N}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(hn,{metrics:S})}),s.includes("api")&&k.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(fn,{metrics:k})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(yn,{})}),B&&i.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(pn,{title:l,metrics:i})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(ln,{})})]})})]})},Ug=(e={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:n="",onSuccess:o,onError:s}=e,[i,l]=p.useState(!1),[d,c]=p.useState(""),[u,h]=p.useState(""),w=p.useCallback(()=>{c(""),h("")},[]),m=p.useCallback(()=>{c("")},[]),b=p.useCallback(()=>{h("")},[]),y=p.useCallback(async v=>{l(!0),w();try{await v(),r&&(c(r),a>0&&setTimeout(()=>{c("")},a)),o&&o()}catch(T){const N=T instanceof Error?T.message:"An error occurred";throw h(n?`${n}: ${N}`:N),s&&T instanceof Error&&s(T),T}finally{l(!1)}},[r,a,n,o,s,w]);return{isSubmitting:i,successMessage:d,errorMessage:u,submit:y,clearMessages:w,clearSuccess:m,clearError:b}},Dg=(e=!1)=>{const[r,a]=p.useState(e),n=p.useCallback(()=>a(!0),[]),o=p.useCallback(()=>a(!1),[]),s=p.useCallback(()=>a(i=>!i),[]);return{value:r,setTrue:n,setFalse:o,toggle:s,setValue:a}},jg=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState(null),i=p.useCallback(async c=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const u=document.createElement("textarea");u.value=c,u.style.position="fixed",u.style.left="-999999px",u.style.top="-999999px",document.body.appendChild(u),u.focus(),u.select();const h=document.execCommand("copy");if(document.body.removeChild(u),!h)throw new Error("Copy command was unsuccessful")}return s(c),a?.(c),setTimeout(()=>{s(null)},r),!0}catch(u){const h=u instanceof Error?u:new Error("Copy failed");return n?.(h),!1}},[r,a,n]),l=p.useCallback(c=>o===c,[o]),d=p.useCallback(()=>{s(null)},[]);return{copiedValue:o,copyToClipboard:i,isCopied:l,resetCopiedState:d}},_g=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState({}),i=p.useCallback(async(c,u)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const h=document.createElement("textarea");h.value=c,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const w=document.execCommand("copy");if(document.body.removeChild(h),!w)throw new Error("Copy command was unsuccessful")}return s(h=>({...h,[u]:!0})),a?.(c),setTimeout(()=>{s(h=>({...h,[u]:!1}))},r),!0}catch(h){const w=h instanceof Error?h:new Error("Copy failed");return n?.(w),!1}},[r,a,n]),l=p.useCallback(c=>o[c]||!1,[o]),d=p.useCallback(c=>{s(c?u=>({...u,[c]:!1}):{})},[]);return{copiedStates:o,copyToClipboard:i,isCopied:l,resetCopiedState:d}},zg=e=>{if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(r)),o=Math.min(n,a.length-1);return parseFloat((e/Math.pow(r,o)).toFixed(2))+" "+a[o]},Bg=(e,r,a)=>{const n={bytes:0,kb:1,mb:2,gb:3,tb:4},o=1024,i=e*Math.pow(o,n[r])/Math.pow(o,n[a]);return Math.round(i*100)/100},Wg=e=>{const r=e.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),n=r[2].toLowerCase(),s={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[n];return s?Math.round(a*s):null},Fg=e=>e,Vg=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},qg=e=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=e,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${e}">`,document.head.appendChild(a)},$g=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},Hg={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Gg=(e,r=Hg)=>{const[a,n]=p.useState("base");return p.useEffect(()=>{const o=()=>{const s=window.innerWidth;s>=r["2xl"]?n("2xl"):s>=r.xl?n("xl"):s>=r.lg?n("lg"):s>=r.md?n("md"):s>=r.sm?n("sm"):s>=r.xs?n("xs"):n("base")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r]),e[a]||e.base||{}},xn=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,Yg=()=>{const[e,r]=p.useState(xn);return p.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",n):a.addListener(n),()=>{a.removeEventListener?a.removeEventListener("change",n):a.removeListener(n)}},[]),e},Kg=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},Zg=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,Xg=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},Qg=(...e)=>e.filter(Boolean).join(" "),Jg=e=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(e).forEach(([n,o])=>{a.includes(n)&&(r[n]=o)}),r},Rg=(e,r=[])=>{const[a,n]=p.useState(null),[o,s]=p.useState(!0);return p.useEffect(()=>{let i=!0;return e().then(l=>{i&&(n(l.default),s(!1))}),()=>{i=!1}},[e,...r]),{styles:a,loading:o}},eh=(e,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),rh=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),th=e=>{const[r,a]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia(e);a(n.matches);const o=()=>a(n.matches);return n.addEventListener?n.addEventListener("change",o):n.addListener(o),()=>{n.removeEventListener?n.removeEventListener("change",o):n.removeListener(o)}},[e]),r},ah=(e,r)=>{const[a,n]=p.useState("light");return p.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)");n(o.matches?"dark":"light");const s=()=>{n(o.matches?"dark":"light")};return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[]),a==="dark"?r:e},nh=e=>{const r={src:e.src,alt:e.alt,loading:e.loading||"lazy"};return e.title&&(r.title=e.title),e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.sizes&&(r.sizes=e.sizes),e.srcSet&&(r.srcSet=e.srcSet),r.itemProp="image",r},oh=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),sh=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),ih=(e,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=e.url,e.width&&(a["og:image:width"]=e.width.toString()),e.height&&(a["og:image:height"]=e.height.toString()),e.alt&&(a["og:image:alt"]=e.alt),e.type&&(a["og:image:type"]=e.type)):(a["twitter:image"]=e.url,e.alt&&(a["twitter:image:alt"]=e.alt)),a},lh=(e='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(e);if("loading"in HTMLImageElement.prototype){r.forEach(n=>{n.dataset.src&&(n.src=n.dataset.src)});return}const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(n=>a.observe(n)),()=>{r.forEach(n=>a.unobserve(n))}},Nn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=r.onerror=function(){e(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),Cn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),ch=async(e="jpg")=>{const[r,a]=await Promise.all([Nn(),Cn()]);return a?"avif":r?"webp":e},dh=(e,r,a,n)=>`
56
+ `,children:o?"Verified":n?"Current Plan":"Select Plan"})]})},f0=({children:e,backgroundClassName:r="",contentClassName:a=""})=>t.jsx("div",{className:r,children:t.jsx("div",{className:a,children:e})}),b0=({title:e,description:r})=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:e}),r&&t.jsx("p",{className:"mt-2 text-gray-600 dark:text-gray-400",children:r})]}),m0=({isSelected:e,onClick:r,icon:a,label:n,description:o,className:s=""})=>t.jsxs("div",{onClick:r,className:`relative flex items-start p-4 cursor-pointer transition-all border-b border-gray-200 dark:border-gray-700 last:border-b-0 group ${s}`,children:[e&&t.jsx("div",{className:"absolute inset-1 bg-blue-500/10 dark:bg-blue-400/10 rounded-lg pointer-events-none"}),t.jsxs("div",{className:"relative z-10 flex items-start w-full",children:[a&&t.jsx(a,{className:`h-5 w-5 mt-0.5 mr-3 flex-shrink-0 transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:`font-medium transition-colors ${e?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-gray-100 group-hover:text-gray-700 dark:group-hover:text-gray-300"}`,children:n}),o&&t.jsx("div",{className:`text-xs mt-0.5 transition-colors ${e?"text-blue-500 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}`,children:o})]})]})]}),y0=({masterTitle:e,masterSubtitle:r,backButtonText:a,masterContent:n,detailContent:o,detailTitle:s,mobileView:i="navigation",onBackToNavigation:l,masterClassName:d="",detailClassName:c="",detailTitleClassName:u="",masterWidth:h=320,stickyMaster:w=!0,stickyTopOffset:m=96,desktopGap:b=32,showMasterBackground:y=!0,enableAnimations:v=!0,animationDuration:T=300,animationRef:N})=>{const S=`gap-${Math.round(b/4)}`||"gap-8",k=F=>F?F.split("-")[0].trim():"Back",C=a?k(a):e?k(e):"Back",[I,E]=p.useState(!1),[M,x]=p.useState("auto"),P=p.useRef(null),D=p.useRef(null);p.useEffect(()=>(N&&(N.current={triggerTransition:F=>{if(!v){F();return}if(P.current){const ne=P.current.scrollHeight;x(ne)}E(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{F(),setTimeout(()=>{if(P.current){const ne=P.current.scrollHeight;x(ne),setTimeout(()=>{x("auto"),E(!1)},T)}},50)},T/2)}}),()=>{D.current&&clearTimeout(D.current)}),[v,T,N]);const U=v?{height:M==="auto"?"auto":`${M}px`,transition:`height ${T}ms cubic-bezier(0.4, 0, 0.2, 1)`,width:"100%",maxWidth:"100%"}:{width:"100%",maxWidth:"100%"},B=v?`${I?"opacity-0 transform translate-y-2":"opacity-100 transform translate-y-0"}`:"",z=v?{transition:`opacity ${T}ms ease-in-out, transform ${T}ms ease-in-out`}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`md:hidden ${i==="navigation"?"block":"hidden"} flex-1`,children:t.jsxs("div",{className:y?"bg-white dark:bg-gray-800 p-6":"p-6",children:[e&&t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r})]}),t.jsx("div",{className:d,children:n})]})}),t.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[t.jsxs("div",{className:`md:hidden ${i==="content"?"block":"hidden"}`,children:[i==="content"&&l&&t.jsxs("button",{onClick:l,className:"mb-4 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:["← ",C]}),t.jsx("div",{ref:P,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:U,children:t.jsxs("div",{className:B,style:z,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${u}`,children:s}),o]})})]}),t.jsxs("div",{className:`hidden md:flex min-h-full ${S}`,style:{width:"100%"},children:[t.jsx("aside",{className:"flex-shrink-0",style:{width:`${h}px`,minWidth:`${h}px`},children:t.jsxs("div",{className:w?"sticky":"",style:w?{top:`${m}px`}:void 0,children:[e&&t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-4",children:e}),r&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6 break-all",children:r}),t.jsx("div",{className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 ${w?"max-h-[calc(100vh-200px)] overflow-y-auto":""} ${d}`,children:n})]})}),t.jsx("div",{className:"flex-1 min-w-0",style:{width:`calc(100% - ${h+b}px)`},children:t.jsx("div",{ref:P,className:`bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-8 overflow-hidden ${c}`,style:U,children:t.jsxs("div",{className:B,style:z,children:[s&&t.jsx("h1",{className:`text-4xl font-bold text-gray-900 dark:text-white mb-6 ${u}`,children:s}),o]})})})]})]})]})},Gr=p.createContext(null),Ua=({children:e,variant:r="default",sticky:a=!0})=>{const[n,o]=p.useState(!1),s=p.useCallback(()=>{o(i=>!i)},[]);return t.jsx(Gr.Provider,{value:{variant:r,sticky:a,mobileMenuOpen:n,setMobileMenuOpen:o,toggleMobileMenu:s},children:e})},Yr=()=>{const e=p.useContext(Gr);if(!e)throw new Error("useTopbar must be used within a TopbarProvider");return e},Da={sm:"min-h-12",md:"min-h-14",lg:"min-h-16"},p0={default:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",app:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 shadow-sm",minimal:"bg-transparent",transparent:"bg-white/80 dark:bg-gray-900/80 border-b border-gray-200/50 dark:border-gray-700/50"},v0={default:"z-40",high:"z-50",highest:"z-[60]"},w0=({children:e,variant:r="default",sticky:a=!0,className:n,height:o="md",blur:s=!1,zIndex:i="high","aria-label":l="Main navigation"})=>t.jsx(Ua,{variant:r,sticky:a,children:t.jsxs("header",{role:"banner","aria-label":l,className:f("w-full",Da[o],p0[r],v0[i],a&&"sticky top-0",s&&"backdrop-blur-md","transition-colors duration-200",n),children:[t.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 bg-blue-600 text-white px-4 py-2 rounded-md z-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Skip to main content"}),t.jsx("div",{className:f("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",Da[o],"flex items-center justify-between"),children:e})]})}),k0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),x0=({children:e,className:r})=>t.jsx("div",{className:f("flex-1 flex items-center justify-center px-4",r),children:e}),N0=({children:e,className:r})=>t.jsx("div",{className:f("flex items-center gap-2 shrink-0",r),children:e}),C0=({children:e,className:r})=>t.jsx("div",{className:f("md:hidden px-4 pb-3",r),children:e}),S0=({className:e})=>t.jsx("div",{className:f("hidden md:block h-6 w-px bg-gray-200 dark:bg-gray-700 mx-2",e),role:"separator","aria-orientation":"vertical"}),E0={sm:"h-6",md:"h-8",lg:"h-10"},T0=({children:e,src:r,alt:a="Logo",onClick:n,href:o,className:s,size:i="md"})=>{const l=e||r&&t.jsx("img",{src:r,alt:a,className:f(E0[i],"w-auto object-contain")}),d=f("flex items-center","hover:opacity-80 transition-opacity duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 rounded-md",s);return o?t.jsx("a",{href:o,className:d,title:a,children:l}):n?t.jsx("button",{type:"button",onClick:n,className:d,title:a,"aria-label":`Go to ${a||"home"}`,children:l}):t.jsx("div",{className:d,children:l})},A0={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},I0=({className:e,isOpen:r})=>t.jsx("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:r?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),ja=({icon:e,"aria-label":r="Toggle navigation menu",className:a,onClick:n,hideAbove:o="lg",menuItems:s,LinkComponent:i})=>{const{mobileMenuOpen:l,toggleMobileMenu:d,setMobileMenuOpen:c}=Yr(),[u,h]=p.useState(!1),w=p.useRef(null);ar(w,()=>{h(!1)});const m=s?u:l,b=()=>{n?n():s?h(!u):d()},y=()=>{h(!1),c(!1)};return t.jsxs("div",{className:f("relative",A0[o]),ref:w,children:[t.jsx("button",{type:"button",onClick:b,className:f("p-2 rounded-lg","text-gray-600 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",a),"aria-label":r,"aria-expanded":m,"aria-haspopup":s?"menu":void 0,"aria-controls":s?"topbar-dropdown-menu":"mobile-menu",children:e?t.jsx(e,{className:"h-6 w-6"}):t.jsx(I0,{className:"h-6 w-6",isOpen:m})}),s&&u&&t.jsx("div",{id:"topbar-dropdown-menu",role:"menu",className:f("absolute left-0 top-full mt-2","min-w-[200px] py-2 rounded-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","shadow-lg","z-50"),children:s.map(v=>{const T=v.icon,N=t.jsxs(t.Fragment,{children:[T&&t.jsx(T,{className:"h-5 w-5 mr-3 flex-shrink-0"}),t.jsx("span",{children:v.label})]}),S=f("flex items-center w-full px-4 py-2.5 text-sm font-medium","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-900 dark:hover:text-gray-100","transition-colors duration-150",v.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400",v.disabled&&"opacity-50 cursor-not-allowed");return v.href&&i?t.jsx(i,{href:v.href,className:S,children:t.jsx("div",{className:"flex items-center",onClick:y,children:N})},v.id):v.href?t.jsx("a",{href:v.href,role:"menuitem",className:S,onClick:y,children:N},v.id):t.jsx("button",{type:"button",role:"menuitem",className:S,onClick:()=>{y(),v.onClick?.()},disabled:v.disabled,children:N},v.id)})})]})},M0={sm:{show:"hidden sm:flex",hide:"sm:hidden"},md:{show:"hidden md:flex",hide:"md:hidden"},lg:{show:"hidden lg:flex",hide:"lg:hidden"},xl:{show:"hidden xl:flex",hide:"xl:hidden"}},L0={left:"justify-start",center:"justify-center",right:"justify-end"},_a=({items:e,className:r,collapseBelow:a="lg",LinkComponent:n,align:o="center"})=>{const[s,i]=p.useState(null),l=p.useRef(null);ar(l,()=>i(null));const d=(c,u=!1)=>{const h=c.children&&c.children.length>0,w=s===c.id,m=f("px-3 py-2 rounded-md text-sm font-medium","transition-colors duration-200",c.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700",c.disabled&&"opacity-50 cursor-not-allowed pointer-events-none",u&&"w-full text-left");return h?t.jsxs("div",{className:"relative",ref:l,children:[t.jsxs("button",{type:"button",onClick:()=>i(w?null:c.id),className:f(m,"flex items-center gap-1"),"aria-expanded":w,"aria-haspopup":"true",disabled:c.disabled,children:[c.icon&&t.jsx(c.icon,{className:"h-4 w-4 mr-1"}),c.label,t.jsx("svg",{className:f("h-4 w-4 transition-transform duration-200",w&&"rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),w&&t.jsx("div",{className:f("absolute top-full left-0 mt-1 py-1","min-w-[200px] rounded-md shadow-lg","bg-white dark:bg-gray-800","border border-gray-200 dark:border-gray-700","z-50"),children:c.children?.map(b=>t.jsx(Kr,{item:b,LinkComponent:n,className:f("block px-4 py-2 text-sm","text-gray-700 dark:text-gray-300","hover:bg-gray-100 dark:hover:bg-gray-700",b.active&&"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400"),onClick:()=>i(null)},b.id))})]},c.id):t.jsx(Kr,{item:c,LinkComponent:n,className:m},c.id)};return t.jsx("nav",{className:f("flex items-center gap-1",M0[a].show,L0[o],r),"aria-label":"Main navigation",children:e.map(c=>d(c))})},Kr=({item:e,LinkComponent:r,className:a,onClick:n})=>{const o=()=>{n?.(),e.onClick?.()},s=t.jsxs(t.Fragment,{children:[e.icon&&t.jsx(e.icon,{className:"h-4 w-4 mr-2"}),e.label]});return e.href&&r?t.jsx(r,{href:e.href,className:f(a,"flex items-center"),children:s}):e.href?t.jsx("a",{href:e.href,className:f(a,"flex items-center"),onClick:o,children:s}):t.jsx("button",{type:"button",onClick:o,className:f(a,"flex items-center"),disabled:e.disabled,children:s})},P0=({items:e,isOpen:r,className:a,LinkComponent:n})=>{const{mobileMenuOpen:o,setMobileMenuOpen:s}=Yr();return r??o?t.jsx("div",{id:"mobile-menu",className:f("lg:hidden","border-t border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900","shadow-lg",a),children:t.jsx("nav",{className:"px-4 py-2 space-y-1","aria-label":"Mobile navigation",children:e.map(l=>t.jsx(Kr,{item:l,LinkComponent:n,className:f("flex items-center w-full px-3 py-2 rounded-md text-base font-medium","transition-colors duration-200",l.active?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700"),onClick:()=>s(!1)},l.id))})}):null},O0=({items:e,LinkComponent:r,collapseBelow:a="lg",align:n="center",className:o,mobileMenuLabel:s="Toggle navigation menu",children:i})=>t.jsxs(t.Fragment,{children:[t.jsx(ja,{hideAbove:a,menuItems:e,LinkComponent:r,"aria-label":s,className:o}),i,t.jsx(_a,{items:e,collapseBelow:a,LinkComponent:r,align:n,className:o})]}),U0={sm:"gap-1",md:"gap-2",lg:"gap-3"},D0={left:"justify-start",center:"justify-center",right:"justify-end"},j0=({children:e,className:r,gap:a="md",align:n="right"})=>t.jsx("div",{className:f("flex items-center",U0[a],D0[n],r),children:e}),_0={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},z0={sm:"p-1.5",md:"p-2",lg:"p-2.5"},B0=({icon:e,onClick:r,"aria-label":a,className:n,disabled:o=!1,badge:s,size:i="md"})=>t.jsxs("button",{type:"button",onClick:r,className:f("relative rounded-lg",z0[i],"text-gray-500 dark:text-gray-400","hover:bg-gray-100 dark:hover:bg-gray-700","hover:text-gray-700 dark:hover:text-gray-200","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","transition-colors duration-200",o&&"opacity-50 cursor-not-allowed",n),"aria-label":a,disabled:o,children:[t.jsx(e,{className:_0[i]}),s!==void 0&&s>0&&t.jsx("span",{className:f("absolute -top-1 -right-1","min-w-[18px] h-[18px] px-1","flex items-center justify-center","text-xs font-medium","bg-red-500 text-white rounded-full","ring-2 ring-white dark:ring-gray-900"),"aria-label":`${s} notifications`,children:s>99?"99+":s})]}),W0={sm:"w-48",md:"w-64",lg:"w-96",full:"w-full"},F0=({placeholder:e="Search...",value:r,onChange:a,onSubmit:n,className:o,width:s="md",showOnMobile:i=!1})=>{const[l,d]=p.useState(r||""),c=h=>{const w=h.target.value;d(w),a?.(w)},u=h=>{h.preventDefault(),n?.(l)};return t.jsx("form",{onSubmit:u,className:f(!i&&"hidden md:block",o),role:"search",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),t.jsx("input",{type:"search",value:l,onChange:c,placeholder:e,"aria-label":e,className:f(W0[s],"pl-10 pr-4 py-2","text-sm","bg-gray-100 dark:bg-gray-800","border border-transparent","rounded-lg","text-gray-900 dark:text-gray-100","placeholder:text-gray-500 dark:placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white dark:focus:bg-gray-700 focus:border-transparent","transition-colors duration-200")})]})})},V0=({contentType:e,aiSummary:r,technicalComplexity:a="intermediate"})=>t.jsxs(Un.Helmet,{children:[t.jsx("meta",{name:"ai:content-type",content:e}),t.jsx("meta",{name:"ai:summary",content:r}),t.jsx("meta",{name:"ai:complexity",content:a})]}),q0=({children:e,className:r,...a})=>t.jsx("main",{className:r,...a,role:"main",children:e}),$0=({children:e})=>t.jsx(t.Fragment,{children:e}),Le=e=>Array.isArray(e)?e:typeof e=="string"?e.split(",").map(r=>r.trim()).filter(Boolean):[],Ee=e=>({appName:e.appName,baseUrl:e.baseUrl,twitterHandle:e.twitterHandle||"",emailDomain:e.emailDomain||"example.com"}),Zr=e=>{const r=Le(e.audience),a=Ee(e.branding);return{"@context":"https://schema.org","@type":"SoftwareApplication",name:a.appName,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",description:e.description,url:a.baseUrl,downloadUrl:`${a.baseUrl}/connect`,installUrl:`${a.baseUrl}/connect`,screenshot:`${a.baseUrl}/screenshots/app-preview.jpg`,aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",reviewCount:"2500",bestRating:"5",worstRating:"1"},offers:[{"@type":"Offer",name:"Free Web3 Email",description:"Basic wallet-based email with unlimited sending",price:"0",priceCurrency:"USD",availability:"https://schema.org/InStock"},{"@type":"Offer",name:"Premium Web3 Email",description:"Advanced features with ENS/SNS domains and priority support",price:"2.00",priceCurrency:"USD",billingIncrement:"month",availability:"https://schema.org/InStock"}],featureList:["Passwordless wallet authentication","ENS domain email support (.eth)","Solana Name Service support (.sol)","Smart contract email integration","Multi-chain wallet compatibility","Cross-chain email addresses","DAO email delegation","Encrypted communication","Web2/Web3 bridge functionality","Point-based reward system"],applicationSubCategory:"Web3 Email Platform",audience:{"@type":"Audience",audienceType:r.join(", "),geographicArea:"Worldwide"},creator:{"@type":"Organization",name:a.appName,url:a.baseUrl},datePublished:"2024-01-01",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),version:"1.0",softwareRequirements:"Web3 Wallet (MetaMask, Phantom, etc.)",storageRequirements:"5MB",memoryRequirements:"512MB RAM",supportingData:{blockchainNetworks:["Ethereum","Solana","Polygon","Arbitrum","Optimism"],supportedWallets:["MetaMask","Phantom","WalletConnect","Coinbase Wallet"],smartContractSupport:!0,ensCompatible:!0,snsCompatible:!0}}},Xr=e=>{const r=Le(e.keywords),a=Le(e.audience),n=Ee(e.branding);return{"@context":"https://schema.org","@type":"TechnicalArticle",headline:e.title,description:e.description,author:{"@type":"Organization",name:n.appName,url:n.baseUrl,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`}},publisher:{"@type":"Organization",name:n.appName,logo:{"@type":"ImageObject",url:`${n.baseUrl}/logo.png`,width:600,height:600}},datePublished:"2024-01-01T00:00:00Z",dateModified:e.lastUpdated?.toISOString()||new Date().toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":`${n.baseUrl}${location.pathname}`},image:{"@type":"ImageObject",url:`${n.baseUrl}/og-images/technical-guide.jpg`,width:1200,height:630},keywords:r.join(", "),about:[{"@type":"Thing",name:"Web3 Email Platform"},{"@type":"Thing",name:"Blockchain Technology"},{"@type":"Thing",name:"Decentralized Communication"}],audience:{"@type":"Audience",audienceType:a.join(", "),educationalLevel:e.complexity},educationalLevel:e.complexity,proficiencyLevel:e.complexity,learningResourceType:e.contentType,timeRequired:e.readingTime?`PT${e.readingTime}M`:"PT5M",inLanguage:"en",isAccessibleForFree:!0,license:"https://creativecommons.org/licenses/by/4.0/",teaches:e.relatedTopics||["Web3 email setup","Wallet connection process","Blockchain authentication","Smart contract integration"]}},H0=(e,r)=>{const a=Ee(r);return{"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(n=>({"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:n.answer,dateCreated:new Date().toISOString(),upvoteCount:Math.floor(Math.random()*50)+10,author:{"@type":"Organization",name:a.appName}},answerCount:1,upvoteCount:Math.floor(Math.random()*100)+20,dateCreated:"2024-01-01T00:00:00Z",category:n.category||"General"}))}},Qr=e=>{const r=Ee(e.branding);return{"@context":"https://schema.org","@type":"WebPage",name:e.title,description:e.description,url:`${r.baseUrl}${location.pathname}`,primaryImageOfPage:{"@type":"ImageObject",url:`${r.baseUrl}/og-images/ai-optimized.jpg`},significantLink:[`${r.baseUrl}/document`,`${r.baseUrl}/web3-users`,`${r.baseUrl}/web3-projects`,`${r.baseUrl}/connect`],relatedLink:e.relatedTopics?.map(a=>`${r.baseUrl}/search?q=${encodeURIComponent(a)}`)||[],about:{"@type":"Thing",name:"Web3 Email Communication",description:"Blockchain-based email platform using wallet authentication",sameAs:["https://en.wikipedia.org/wiki/Web3","https://en.wikipedia.org/wiki/Blockchain","https://en.wikipedia.org/wiki/Cryptocurrency_wallet"]},mentions:[{"@type":"SoftwareApplication",name:"MetaMask"},{"@type":"SoftwareApplication",name:"Phantom Wallet"},{"@type":"Thing",name:"Ethereum Name Service"},{"@type":"Thing",name:"Solana Name Service"}],isPartOf:{"@type":"WebSite","@id":r.baseUrl,name:r.appName},potentialAction:{"@type":"InteractAction",target:{"@type":"EntryPoint",urlTemplate:`${r.baseUrl}/connect`,actionPlatform:["https://schema.org/DesktopWebPlatform","https://schema.org/MobileWebPlatform"]},name:"Connect Web3 Wallet"}}},za=e=>{const r=Le(e.keywords),a=Ee(e.branding);return{"og:title":e.title,"og:description":e.description,"og:type":"website","og:url":`${a.baseUrl}${location.pathname}`,"og:image":`${a.baseUrl}/og-images/${e.category}.jpg`,"og:image:width":"1200","og:image:height":"630","og:image:alt":`${e.title} - ${a.appName}`,"og:site_name":a.appName,"og:locale":"en_US","article:author":`${a.baseUrl}/about`,"article:section":e.category,"article:tag":r.join(","),"article:published_time":"2024-01-01T00:00:00Z","article:modified_time":e.lastUpdated?.toISOString()||new Date().toISOString()}},Ba=e=>{const r=Ee(e.branding);return{"twitter:card":"summary_large_image","twitter:site":r.twitterHandle||"","twitter:creator":r.twitterHandle||"","twitter:title":e.title,"twitter:description":e.description,"twitter:image":`${r.baseUrl}/twitter-cards/${e.category}.jpg`,"twitter:image:alt":`${e.title} - ${r.appName}`,"twitter:label1":"Category","twitter:data1":e.category,"twitter:label2":"Reading Time","twitter:data2":e.readingTime?`${e.readingTime} min`:"5 min"}},Wa=e=>{const r=Le(e.keywords),a=Le(e.audience),n=Ee(e.branding);return{"ai:content-type":e.contentType,"ai:complexity":e.complexity,"ai:category":e.category,"ai:audience":a.join(","),"ai:keywords":r.join(","),"ai:reading-time":e.readingTime?.toString()||"5","web3:platform":"Email","web3:networks":"ethereum,solana,polygon","web3:wallets":"metamask,phantom,walletconnect","web3:features":"ens,sns,smart-contracts,multi-chain","llm:context":"Web3 email platform documentation and user guides","llm:domain":"blockchain,cryptocurrency,decentralized-communication","llm:use-case":"email,authentication,wallet-integration,smart-contracts","semantic:topic":e.category,"semantic:intent":"inform,guide,educate","semantic:entities":`${n.appName},Web3,blockchain,email,wallet`,"content:freshness":e.lastUpdated?.toISOString()||new Date().toISOString(),"content:authority":"high","content:expertise":"technical","content:trustworthiness":"verified"}},G0=e=>({structuredData:{product:Zr(e),article:Xr(e),aiOptimized:Qr(e)},openGraph:za(e),twitterCard:Ba(e),aiMetaTags:Wa(e),jsonLD:[Zr(e),Xr(e),Qr(e)]}),Y0={homepage:{title:"Revolutionary Web3 Email Platform | Wallet-Based Authentication",description:"Transform your email experience - the first Web3 email platform using wallet authentication. No passwords, enhanced security, ENS/SNS domain support, and smart contract integration.",keywords:["Web3 email","blockchain email","wallet authentication","ENS email","SNS email","decentralized email","smart contract integration"],category:"Web3 Platform",audience:["Crypto Users","Web3 Developers","DeFi Users","DAO Members"],complexity:"beginner",contentType:"overview",readingTime:3,relatedTopics:["Web3 authentication","Blockchain communication","Decentralized identity"]},documentation:{title:"Documentation - Complete Web3 Email Setup Guide",description:"Comprehensive documentation for Web3 email platform. Learn wallet connection, ENS/SNS setup, smart contract integration, and advanced features.",keywords:["Web3 email guide","wallet connection","ENS setup","SNS configuration","smart contract email","blockchain documentation"],category:"Technical Documentation",audience:["Developers","Technical Users","Web3 Enthusiasts"],complexity:"intermediate",contentType:"guide",readingTime:15,relatedTopics:["Wallet integration","Blockchain protocols","Email security"]},earnPoints:{title:"How to Earn Points - Web3 Email Rewards Guide",description:"Master the points system. Earn rewards through email activities, referrals, smart contract interactions, and prepare for future token distribution.",keywords:["Web3 rewards","email points","blockchain rewards","referral program","token preparation","crypto incentives"],category:"Rewards Guide",audience:["Token Farmers","Crypto Users","Web3 Users"],complexity:"beginner",contentType:"tutorial",readingTime:8,relatedTopics:["Token economics","Reward systems","Referral marketing"]}},K0=e=>{const{level:r,text:a,className:n="",id:o,semanticContext:s="section"}=e,i=`h${r}`,l={1:"text-4xl md:text-5xl lg:text-6xl font-bold leading-tight",2:"text-3xl md:text-4xl font-bold leading-tight",3:"text-2xl md:text-3xl font-bold leading-tight",4:"text-xl md:text-2xl font-semibold leading-tight",5:"text-lg md:text-xl font-semibold leading-tight",6:"text-base md:text-lg font-medium leading-tight"},d={"page-title":"text-gray-900 dark:text-white mb-6",section:"text-gray-900 dark:text-white mb-4",subsection:"text-gray-900 dark:text-white mb-3",feature:"text-gray-900 dark:text-white mb-2",benefit:"text-blue-600 dark:text-blue-400 mb-2",step:"text-green-600 dark:text-green-400 mb-2"},c=[l[r],d[s],n].filter(Boolean).join(" "),u=o||a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");return p.createElement(i,{id:u,className:c,"aria-level":r},a)},ie={pageTitle:(e,r)=>({level:1,text:e,className:r,semanticContext:"page-title"}),majorSection:(e,r)=>({level:2,text:e,className:r,semanticContext:"section"}),feature:(e,r)=>({level:3,text:e,className:r,semanticContext:"feature"}),benefit:(e,r)=>({level:3,text:e,className:r,semanticContext:"benefit"}),step:(e,r,a)=>({level:3,text:r?`Step ${r}: ${e}`:e,className:a,semanticContext:"step"}),subFeature:(e,r)=>({level:4,text:e,className:r,semanticContext:"feature"})},Z0=e=>{const r=[],a=[],n=e.filter(o=>o.level===1).length;n===0?r.push("Missing H1 tag - every page should have exactly one H1"):n>1&&r.push(`Multiple H1 tags found (${n}) - use only one H1 per page`);for(let o=1;o<e.length;o++){const s=e[o],i=e[o-1];s.level>i.level+1&&r.push(`Heading level jump from H${i.level} to H${s.level} - avoid skipping levels`)}return e.forEach((o,s)=>{o.text.length<3&&r.push(`Heading ${s+1} is too short - use descriptive text`),o.text.length>70&&a.push(`Heading "${o.text.substring(0,30)}..." is long - consider shortening for better SEO`)}),{isValid:r.length===0,errors:r,suggestions:a}},X0={walletConnection:ie.pageTitle("Connect Your Web3 Wallet"),emailBenefits:ie.majorSection("Why Choose Web3 Email?"),securityFeature:ie.feature("Secure & Private"),ensIntegration:ie.feature("ENS Domain Support"),multiChain:ie.feature("Multi-Chain Compatibility"),passwordless:ie.benefit("No Passwords Required"),setupStep1:ie.step("Connect Your Wallet",1),setupStep2:ie.step("Verify Your Identity",2),setupStep3:ie.step("Access Your Emails",3)},Q0=[{term:"Web3 Email",definition:"Email system that uses blockchain wallet addresses as authentication instead of traditional passwords",category:"Web3 Communication",synonyms:["blockchain email","decentralized email","crypto email"],relatedTerms:["wallet authentication","ENS email","SNS email"],examples:["vitalik.eth@example.com","alice.sol@example.com"],context:"Web3 email revolutionizes digital communication by eliminating passwords and using cryptographic signatures for authentication"},{term:"Wallet Authentication",definition:"Authentication method using cryptographic signatures from blockchain wallets instead of passwords",category:"Security",synonyms:["wallet-based auth","signature authentication","passwordless authentication"],relatedTerms:["EIP-712","SIWE","message signing"],examples:["MetaMask signature","Phantom wallet auth","WalletConnect login"],context:"Wallet authentication provides superior security through cryptographic proofs that cannot be phished or stolen like passwords"},{term:"ENS Email",definition:"Email addresses using Ethereum Name Service domains (.eth) as identifiers",category:"Naming Systems",synonyms:["Ethereum name email",".eth email"],relatedTerms:["ENS","Ethereum domains","blockchain domains"],examples:["vitalik.eth","ethereum.eth"],context:"ENS emails provide human-readable addresses that resolve to Ethereum wallet addresses"},{term:"SNS Email",definition:"Email addresses using Solana Name Service domains (.sol) as identifiers",category:"Naming Systems",synonyms:["Solana name email",".sol email"],relatedTerms:["SNS","Solana domains","SPL domains"],examples:["anatoly.sol","solana.sol"],context:"SNS emails provide human-readable addresses for Solana ecosystem users"},{term:"Smart Contract Integration",definition:"Ability to send and receive emails triggered by blockchain smart contract events",category:"Blockchain Integration",synonyms:["contract notifications","on-chain email triggers"],relatedTerms:["event listeners","webhooks","contract automation"],examples:["DAO proposal notifications","DeFi alert emails","NFT sale confirmations"],context:"Smart contract integration enables automated communication based on blockchain events"},{term:"Multi-Chain Support",definition:"Compatibility with multiple blockchain networks for wallet authentication and email services",category:"Interoperability",synonyms:["cross-chain support","blockchain agnostic"],relatedTerms:["EVM chains","Solana","Layer 2"],examples:["Ethereum, Polygon, Arbitrum, Solana support"],context:"Multi-chain support ensures users from any blockchain ecosystem can use the email service"},{term:"DAO Email Delegation",definition:"System allowing DAOs to manage email communications through delegated authorities",category:"Governance",synonyms:["governance email","multi-sig email"],relatedTerms:["DAO governance","multi-signature","delegation"],examples:["Treasury notifications","Proposal alerts","Voting reminders"],context:"DAO email delegation enables decentralized organizations to manage communications efficiently"},{term:"Web2/Web3 Bridge",definition:"Technology enabling communication between traditional email systems and blockchain-based email",category:"Interoperability",synonyms:["email bridge","legacy integration"],relatedTerms:["SMTP gateway","email forwarding","protocol bridge"],examples:["Gmail to Web3 email","Outlook integration"],context:"Web2/Web3 bridge ensures compatibility with existing email infrastructure"}],J0=e=>({"@context":"https://schema.org","@type":"LearningResource",educationalLevel:e.difficulty,learningResourceType:"Technical Documentation",timeRequired:e.estimatedTime?`PT${e.estimatedTime}M`:void 0,teaches:e.learningObjectives,requires:e.prerequisites,about:{"@type":"Thing",name:e.domain,category:e.category,subcategory:e.subcategory},keywords:e.concepts,applicationExample:e.practicalApplications,isRelatedTo:e.relatedConcepts}),R0=e=>{const r={nodes:e.map(a=>({id:a.term,label:a.term,category:a.category,definition:a.definition})),edges:[]};return e.forEach(a=>{a.relatedTerms?.forEach(n=>{e.find(s=>s.term===n)&&r.edges.push({source:a.term,target:n,relationship:"related_to"})}),a.synonyms?.forEach(n=>{r.edges.push({source:a.term,target:n,relationship:"synonym_of"})})}),r},eu=e=>{const r=[];return e.examples?.forEach(a=>{r.push({text:a,label:e.term,type:"positive",confidence:1})}),e.context&&r.push({text:e.context,label:e.term,type:"contextual",confidence:.8}),r.push({text:`${e.term} is ${e.definition}`,label:e.term,type:"definition",confidence:1}),r},ru=e=>{const r=[];return e.forEach(a=>{r.push({question:`What is ${a.term}?`,answer:a.definition,category:a.category,difficulty:"basic"}),a.context&&r.push({question:`How does ${a.term} work?`,answer:a.context,category:a.category,difficulty:"intermediate"}),a.examples&&a.examples.length>0&&r.push({question:`What are examples of ${a.term}?`,answer:a.examples.join(", "),category:a.category,difficulty:"basic"}),a.relatedTerms&&a.relatedTerms.length>0&&r.push({question:`What is ${a.term} related to?`,answer:`${a.term} is related to ${a.relatedTerms.join(", ")}`,category:a.category,difficulty:"intermediate"})}),r},tu={homepage:{domain:"Web3 Email Platform",category:"Web3 Communication",concepts:["Web3 email","wallet authentication","passwordless login","blockchain messaging"],prerequisites:["Basic blockchain knowledge","Understanding of crypto wallets"],learningObjectives:["Understand Web3 email concepts","Learn wallet authentication","Explore blockchain communication"],difficulty:"beginner",estimatedTime:5,practicalApplications:["Secure email communication","DAO governance","DeFi notifications"]},documentation:{domain:"Web3 Email Technical Documentation",category:"Technical Guide",concepts:["API integration","smart contracts","wallet connection","email protocols"],prerequisites:["JavaScript/TypeScript","Web3 development basics","REST APIs"],learningObjectives:["Implement Web3 email","Integrate wallet authentication","Build on email API"],difficulty:"intermediate",estimatedTime:30,practicalApplications:["dApp integration","Email automation","Smart contract notifications"]},governance:{domain:"DAO Governance Communication",category:"Governance Tools",concepts:["DAO email","voting notifications","proposal tracking","multi-sig coordination"],prerequisites:["DAO basics","Governance understanding","Multi-signature wallets"],learningObjectives:["Setup DAO email","Configure voting alerts","Manage team communication"],difficulty:"advanced",estimatedTime:20,practicalApplications:["DAO operations","Treasury management","Governance participation"]}},au=({children:e,appName:r,appUrl:a,apiUrl:n})=>(p.useEffect(()=>{const o=()=>{[].forEach(b=>{const y=document.createElement("link");y.rel="preload",y.href=b.href,y.as=b.as,b.type&&(y.type=b.type),b.crossorigin&&(y.crossOrigin=""),document.head.appendChild(y)})},s=()=>{document.querySelectorAll('img[data-priority="high"]').forEach(y=>{y.fetchPriority="high"});const b=document.querySelector("[data-hero]");if(b){const y=b.getAttribute("data-bg-image");if(y){const v=document.createElement("link");v.rel="preload",v.href=y,v.as="image",document.head.appendChild(v)}}},i=()=>{document.querySelectorAll("img:not([width]):not([height])").forEach(y=>{const v=y;v.naturalWidth&&v.naturalHeight&&(v.width=v.naturalWidth,v.height=v.naturalHeight)}),document.querySelectorAll("[data-dynamic]").forEach(y=>{y.getAttribute("style")?.includes("min-height")||(y.style.minHeight="200px")})},l=()=>{const m=()=>{document.querySelectorAll("script[data-defer]").forEach(v=>{v.setAttribute("defer","")})};"requestIdleCallback"in window?requestIdleCallback(()=>{m()}):setTimeout(m,1),(()=>{["scroll","touchstart","touchmove","wheel"].forEach(v=>{document.addEventListener(v,()=>{},{passive:!0})})})()},d=()=>{},c=()=>{[{rel:"dns-prefetch",href:"//fonts.googleapis.com"},...n?[{rel:"dns-prefetch",href:`//${n.replace(/^https?:\/\//,"")}`}]:[],{rel:"preconnect",href:"https://fonts.gstatic.com",crossorigin:!0},...n?[{rel:"preconnect",href:n}]:[]].forEach(b=>{const y=document.createElement("link");y.rel=b.rel,y.href=b.href,b.crossorigin&&(y.crossOrigin=""),document.head.appendChild(y)})},u=()=>{if(document.querySelectorAll("img[data-lazy]").forEach(b=>{b.loading="lazy"}),"IntersectionObserver"in window){const b=new IntersectionObserver(v=>{v.forEach(T=>{if(T.isIntersecting){const N=T.target;N.dataset.src&&(N.src=N.dataset.src,N.removeAttribute("data-src")),b.unobserve(N)}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(v=>b.observe(v))}},h=()=>{[{name:"ai-content-type",content:"web3-email-platform"},{name:"ai-primary-function",content:"wallet-based-email"},{name:"ai-supported-chains",content:"ethereum,solana,polygon,arbitrum,optimism"},{name:"ai-complexity-level",content:"beginner-to-advanced"},{name:"ai-target-users",content:"web3-users,crypto-enthusiasts,developers"},{name:"machine-readable",content:"true"},{name:"structured-data",content:"json-ld"},{name:"content-category",content:"technology,blockchain,communication"},{name:"interaction-model",content:"wallet-authentication"}].forEach(({name:v,content:T})=>{if(!document.querySelector(`meta[name="${v}"]`)){const N=document.createElement("meta");N.name=v,N.content=T,document.head.appendChild(N)}});const b={"@context":"https://schema.org","@type":"WebApplication",name:r,description:"Web3 email platform using blockchain wallet authentication",url:a,applicationCategory:"CommunicationApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"0",priceCurrency:"USD"},featureList:["Wallet-based authentication","ENS domain email support","SNS domain email support","Multi-chain compatibility","Smart contract integration","Web2/Web3 bridge"],audience:{"@type":"Audience",audienceType:"Web3 Users"}},y=document.createElement("script");y.type="application/ld+json",y.textContent=JSON.stringify(b),document.head.appendChild(y)},w=()=>{document.querySelectorAll('link[rel="stylesheet"][data-non-critical]').forEach(b=>{const y=b.cloneNode(!0);y.rel="preload",y.as="style",y.onload=()=>{y.onload=null,y.rel="stylesheet"},document.head.appendChild(y),b.remove()})};return o(),s(),i(),l(),c(),u(),h(),w(),setTimeout(d,2e3),()=>{}},[n,r,a]),t.jsx(t.Fragment,{children:e})),nu=()=>(p.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||!document.documentElement)return;const e=()=>{if("IntersectionObserver"in window){const l=new IntersectionObserver(d=>{d.forEach(c=>{if(c.isIntersecting){const u=c.target;u.dataset.src&&(u.src=u.dataset.src,u.removeAttribute("data-src"),l.unobserve(u))}})},{rootMargin:"50px 0px"});document.querySelectorAll("img[data-src]").forEach(d=>{l.observe(d)})}const o=()=>{["/connect","/mail","/settings"].forEach(d=>{const c=document.createElement("link");c.rel="prefetch",c.href=d,document.head.appendChild(c)})},s=()=>{if(!document.querySelector("script[data-wallet-detection]")){const l=document.createElement("script");l.dataset.walletDetection="true",l.innerHTML='(function() { window.walletPreload = { hasMetaMask: typeof window.ethereum !== "undefined", hasPhantom: typeof window.solana !== "undefined", hasWalletConnect: true }; })();',document.head.appendChild(l)}},i=()=>{document.querySelectorAll("img[data-hero]").forEach(l=>{const d=l;d.loading="eager","fetchPriority"in d&&(d.fetchPriority="high")}),document.querySelectorAll('img[data-priority="low"]').forEach(l=>{const d=l;d.loading="lazy","fetchPriority"in d&&(d.fetchPriority="low")})};requestIdleCallback(()=>{o(),s(),i()},{timeout:2e3})},r=()=>{if("PerformanceObserver"in window){const o=new PerformanceObserver(i=>{const l=i.getEntries(),d=l[l.length-1];d&&d.startTime>2500&&(document.documentElement.style.setProperty("--animation-duration","0s"),localStorage.setItem("reduce-image-quality","true"))});try{o.observe({entryTypes:["largest-contentful-paint"]})}catch{}const s=new PerformanceObserver(i=>{let l=0;for(const d of i.getEntries())d.hadRecentInput||(l+=d.value);l>.1&&document.querySelectorAll("img:not([width]):not([height])").forEach(d=>{const c=d;c.style.aspectRatio="16/9"})});try{s.observe({entryTypes:["layout-shift"]})}catch{}}},a=()=>{if("connection"in navigator&&typeof document<"u"&&document.documentElement){const o=navigator.connection;if(o){const s=o.effectiveType;s==="slow-2g"||s==="2g"?(document.documentElement.classList.add("slow-connection"),document.querySelectorAll('link[rel="prefetch"]').forEach(i=>{i.getAttribute("data-critical")||i.remove()}),localStorage.setItem("use-low-quality-images","true")):s==="3g"?document.documentElement.classList.add("moderate-connection"):document.documentElement.classList.add("fast-connection")}}};return(()=>{e(),r(),a()})(),()=>{if("PerformanceObserver"in window)try{PerformanceObserver.supportedEntryTypes.forEach(()=>{})}catch{}}},[]),null),ou=({children:e})=>t.jsx(t.Fragment,{children:e}),Fa={user:{duration:300*1e3,maxSize:100,staleWhileRevalidate:!0},mailboxes:{duration:120*1e3,maxSize:50,staleWhileRevalidate:!0},addresses:{duration:600*1e3,maxSize:50,staleWhileRevalidate:!0},messages:{duration:30*1e3,maxSize:200,staleWhileRevalidate:!0},messageDetails:{duration:120*1e3,maxSize:100,staleWhileRevalidate:!1},messageCount:{duration:10*1e3,maxSize:20,staleWhileRevalidate:!0}};class su{constructor(){this.cache=new Map}set(r,a,n){if(this.cache.size>=n.maxSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}this.cache.set(r,{data:a,timestamp:Date.now(),isStale:!1})}get(r,a){const n=this.cache.get(r);if(!n)return null;const s=Date.now()-n.timestamp>a.duration;return s&&!a.staleWhileRevalidate?(this.cache.delete(r),null):{data:n.data,isStale:s}}invalidate(r){for(const a of this.cache.keys())a.includes(r)&&this.cache.delete(a)}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,keys:Array.from(this.cache.keys()),memory:this.estimateMemoryUsage()}}estimateMemoryUsage(){return Array.from(this.cache.values()).reduce((r,a)=>r+JSON.stringify(a).length*2,0)}}const Pe=new su,Te=new Map,Va=async(e,r,a="messages")=>{const n=Fa[a],o=Pe.get(e,n);if(o&&!o.isStale)return o.data;const s=Te.get(e);if(s)return s;if(o&&o.isStale&&n.staleWhileRevalidate){const l=r().then(d=>(Pe.set(e,d,n),Te.delete(e),d)).catch(d=>{throw Te.delete(e),d});return Te.set(e,l),o.data}const i=r().then(l=>(Pe.set(e,l,n),Te.delete(e),l)).catch(l=>{throw Te.delete(e),l});return Te.set(e,i),i};class iu{constructor(){this.queue=[],this.timer=null,this.batchDelay=10}add(r,a){return new Promise((n,o)=>{this.queue.push({key:r,fetcher:a,resolve:n,reject:o}),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.processBatch()},this.batchDelay)})}async processBatch(){const r=[...this.queue];this.queue.length=0,this.timer=null;const a=this.groupRequests(r);for(const n of a)await Promise.allSettled(n.map(async o=>{try{const s=await o.fetcher();o.resolve(s)}catch(s){o.reject(s)}}))}groupRequests(r){const a=[];for(let o=0;o<r.length;o+=5)a.push(r.slice(o,o+5));return a}}const lu=new iu;class cu{constructor(r,a={}){this.requestInterceptors=[],this.responseInterceptors=[],this.baseURL=r,this.defaultHeaders=a}addRequestInterceptor(r){this.requestInterceptors.push(r)}addResponseInterceptor(r){this.responseInterceptors.push(r)}async request(r,a={},n,o="messages"){const s=`${this.baseURL}${r}`,i=n||`${a.method||"GET"}:${s}`,l=async()=>{let d={...a,headers:{...this.defaultHeaders,...a.headers}};for(const u of this.requestInterceptors)d=u(d);let c=await fetch(s,d);for(const u of this.responseInterceptors)c=await u(c);if(!c.ok)throw new Error(`API Error: ${c.status} ${c.statusText}`);return c.json()};return a.method==="GET"&&this.shouldBatch(r)?lu.add(i,l):Va(i,l,o)}shouldBatch(r){return r.includes("/messages/")&&!r.includes("/messages?")}async get(r,a){return this.request(r,{method:"GET"},void 0,a)}async post(r,a){return this.request(r,{method:"POST",body:JSON.stringify(a)})}async put(r,a){return this.request(r,{method:"PUT",body:JSON.stringify(a)})}async delete(r){return this.request(r,{method:"DELETE"})}}const du=async(e,r=3,a=1e3)=>{let n;for(let o=0;o<=r;o++)try{return await e()}catch(s){if(n=s,o===r)throw n;const i=a*Math.pow(2,o)+Math.random()*1e3;await new Promise(l=>setTimeout(l,i))}throw n};class uu{constructor(){this.abortController=new AbortController}async request(r,a={}){const n=await fetch(r,{...a,signal:this.abortController.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return n.json()}cancel(){this.abortController.abort()}}const gu={invalidate:e=>Pe.invalidate(e),clear:()=>Pe.clear(),getStats:()=>Pe.getStats(),warmUp:async e=>{await Promise.allSettled(e.map(r=>r()))},prefetch:async e=>{"requestIdleCallback"in window?window.requestIdleCallback(async()=>{await Promise.allSettled(e.map(r=>r()))}):setTimeout(async()=>{await Promise.allSettled(e.map(r=>r()))},100)}};function qa(){if(typeof window>"u")return!1;const e=window.navigator.userAgent.toLowerCase();return["metamask","trustwallet","coinbase","rainbow","phantom","solflare","exodus","ledger","binance","okx"].some(a=>e.includes(a))}function $a(){return typeof window>"u"?!1:window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"}function Ha(){if(typeof window>"u")return!1;const e=window.location.hostname;return/^\d+\.\d+\.\d+\.\d+$/.test(e)}function Ga(){return $a()?"localhost":qa()?"wallet-browser":Ha()?"network":"production"}function hu(){const e=Ga();return e==="localhost"||e==="wallet-browser"}function fu(e){}function Ya(){return typeof window<"u"}function bu(){return typeof window<"u"}function mu(e,r){if(Ya())e();else return r}const Jr=e=>({"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'","'unsafe-eval'","https://fonts.googleapis.com","https://www.googletagmanager.com","https://www.google-analytics.com"],"style-src":["'self'","'unsafe-inline'","https://fonts.googleapis.com","https://fonts.gstatic.com"],"font-src":["'self'","https://fonts.gstatic.com","data:"],"img-src":["'self'","data:","https:","blob:"],"connect-src":["'self'",...e?.apiUrls||[],...e?.appUrls||[],"https://*.walletconnect.com","https://*.walletconnect.org","https://registry.walletconnect.com","https://relay.walletconnect.com","wss://*.walletconnect.com","wss://*.walletconnect.org","https://keys.coinbase.com","https://api.coinbase.com","https://www.walletlink.org","https://mainnet.infura.io","https://polygon-rpc.com","https://rpc.ankr.com","https://cloudflare-eth.com","https://eth-mainnet.alchemyapi.io","https://api.phantom.app","https://solana-api.projectserum.com","https://api.mainnet-beta.solana.com","https://api.devnet.solana.com","wss://api.phantom.app","wss://api.devnet.solana.com","wss://api.mainnet-beta.solana.com","https://bridge.arbitrum.io","https://polygon-mainnet.infura.io","https://optimism-mainnet.infura.io"],"frame-src":["'self'","https://verify.walletconnect.com","https://verify.walletconnect.org"],"worker-src":["'self'","blob:"],"child-src":["'self'","https://verify.walletconnect.com"],"object-src":["'none'"],"base-uri":["'self'"],"form-action":["'self'"]}),yu=Jr(),Ka=e=>{const r=Jr(e);return Object.entries(r).map(([a,n])=>`${a} ${n.join(" ")}`).join("; ")},Za=e=>({"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=(), interest-cohort=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains; preload","Cross-Origin-Embedder-Policy":"credentialless","Cross-Origin-Opener-Policy":"same-origin-allow-popups","Cross-Origin-Resource-Policy":"cross-origin","Content-Security-Policy":Ka(e)}),pu=Za(),vu={fonts:"public, max-age=31536000, immutable",images:"public, max-age=31536000, immutable",js:"public, max-age=31536000, immutable",css:"public, max-age=31536000, immutable",serviceWorker:"public, max-age=0, must-revalidate",manifest:"public, max-age=86400",api:"no-cache, no-store, must-revalidate"},wu=()=>{typeof window<"u"&&document.addEventListener("securitypolicyviolation",()=>{})},ku={walletConnections:"Always verify wallet signatures and never trust client-side data",rpcEndpoints:"Use reputable RPC providers and consider rate limiting",contractInteractions:"Validate all smart contract interactions on the backend",userInput:"Sanitize all user inputs, especially wallet addresses and transaction data",privateKeys:"Never log, store, or transmit private keys - they should remain in wallets only",phishing:"Implement strict CSP to prevent injection of malicious scripts that could steal wallet access"},ue=new Map,qe=new Map,lr=new Set;let $e="medium",Rr=!1;function xu(){if("connection"in navigator){const a=navigator.connection;a&&($e=a.effectiveType==="4g"?"fast":a.effectiveType==="3g"?"medium":"slow")}const e=navigator.deviceMemory,r=navigator.hardwareConcurrency;Rr=e&&e<4||r&&r<4}xu();function Nu(e,r,a={}){const{retries:n=3,timeout:o=1e4,fallback:s,preloadCondition:i,cacheStrategy:l="memory",priority:d="medium",onLoad:c,onError:u}=a;if(ue.has(r))return ue.get(r).component;const h=p.lazy(async()=>{const m=performance.now();if(qe.has(r))return qe.get(r).then(y=>({default:y}));const b=Cu(e,n,o);qe.set(r,b.then(y=>y.default));try{const y=await b,v=performance.now()-m;if(l!=="none"){const T={component:y.default,timestamp:Date.now(),loadTime:v};if(ue.set(r,T),l==="session")try{sessionStorage.setItem(`lazy_${r}`,JSON.stringify({timestamp:T.timestamp,loadTime:v}))}catch{}}return qe.delete(r),c?.(y.default),y}catch(y){throw qe.delete(r),u?.(y),y}}),w=m=>{const[b,y]=p.useState(!0);p.useEffect(()=>{if(i&&!ue.has(r)&&i()&&!lr.has(r)){lr.add(r);const N=Su(d,$e);setTimeout(()=>{e().catch(()=>{})},N)}},[]);const v=s||t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsxs("span",{className:"ml-2 text-sm text-gray-600",children:["Loading ",r.replace(/([A-Z])/g," $1").trim(),"..."]})]});return!b&&Rr&&$e==="slow"?t.jsx("div",{className:"lazy-placeholder",children:t.jsxs("button",{onClick:()=>y(!0),className:"load-component-btn",children:["Load ",r]})}):t.jsx(p.Suspense,{fallback:v,children:t.jsx(h,{...m})})};return w.displayName=`AdvancedLazy(${r})`,w}async function Cu(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((l,d)=>{setTimeout(()=>d(new Error("Load timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const i=Math.pow(2,o)*1e3,l=Math.random()*1e3;await new Promise(d=>setTimeout(d,i+l))}}throw n}function Su(e,r){const a={critical:0,high:500,medium:2e3,low:5e3},n={fast:.5,medium:1,slow:2},o=a[e]||2e3,s=n[r]||1;return o*s}const Ze=class Ze{static registerRoute(r,a){this.routeMap.set(r,a),this.routeUsageStats.set(r,0)}static setCurrentRoute(r){this.currentRoute=r;const a=this.routeUsageStats.get(r)||0;this.routeUsageStats.set(r,a+1),this.preloadLikelyRoutes(r)}static preloadLikelyRoutes(r){this.getRouteTransitionProbability(r).forEach(({route:n,probability:o})=>{o>.3&&!ue.has(n)&&setTimeout(()=>{this.routeMap.get(n)},$e==="fast"?1e3:3e3)})}static getRouteTransitionProbability(r){const a=[];switch(r){case"/":a.push({route:"/connect",probability:.7},{route:"/about",probability:.2},{route:"/document",probability:.1});break;case"/connect":a.push({route:"/mail",probability:.8},{route:"/settings",probability:.1});break;case"/mail":a.push({route:"/compose",probability:.4},{route:"/settings",probability:.2});break;default:a.push({route:"/",probability:.1})}return a}static getStats(){return{routeCount:this.routeMap.size,cacheSize:ue.size,currentRoute:this.currentRoute,usageStats:Object.fromEntries(this.routeUsageStats)}}};Ze.routeMap=new Map,Ze.routeUsageStats=new Map,Ze.currentRoute="";let et=Ze;const Eu=({src:e,alt:r,className:a,placeholder:n,priority:o="medium"})=>{const[s,i]=p.useState(!1),[l,d]=p.useState(!1),c=p.useRef(null);p.useEffect(()=>{if(!c.current)return;if(o==="high"){d(!0);return}const h=new IntersectionObserver(([w])=>{w.isIntersecting&&(d(!0),h.unobserve(w.target))},{rootMargin:o==="low"?"100px":"200px",threshold:.1});return h.observe(c.current),()=>h.disconnect()},[o]);const u=()=>{i(!0)};return t.jsxs("div",{className:`lazy-image-container ${a}`,children:[t.jsx("img",{ref:c,src:l?e:n||"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB2aWV3Qm94PSIwIDAgMSAxIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNGM0Y0RjYiLz48L3N2Zz4=",alt:r,className:`transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,onLoad:u,loading:o==="high"?"eager":"lazy",fetchPriority:o==="high"?"high":"low"}),!s&&l&&t.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse rounded"})]})};function Tu(){ue.clear(),lr.clear()}function Au(){return{cachedComponents:ue.size,preloadQueue:lr.size,networkSpeed:$e,isLowEndDevice:Rr,cacheEntries:Array.from(ue.entries()).map(([e,r])=>({name:e,loadTime:r.loadTime,age:Date.now()-r.timestamp}))}}const Iu=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),Mu=e=>{if(typeof e=="function"||typeof e=="object")return e;switch(e){case"minimal":return()=>t.jsx("div",{className:"flex justify-center items-center p-4",children:"Loading..."});case"skeleton":return()=>t.jsxs("div",{className:"animate-pulse",children:[t.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),t.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]});case"default":default:return()=>t.jsx(Iu,{message:"Loading component..."})}},Xa=(e,r="default",a=3)=>{const n=p.lazy(async()=>{let s=null;for(let i=0;i<a;i++)try{return await e()}catch(l){s=l,i<a-1&&await new Promise(d=>setTimeout(d,Math.pow(2,i)*1e3))}throw s}),o=Mu(r);return s=>t.jsx(p.Suspense,{fallback:t.jsx(o,{}),children:t.jsx(n,{...s})})},Lu=async e=>{try{await e()}catch{}},Pu=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[a]=Xa(n,"skeleton")}),r},Ou=e=>e,Qa={critical:["/","/connect","/mail"],secondary:["/settings","/compose","/points"],optional:["/document","/about","/terms","/privacy"]},Xe=class Xe{static add(r,a){this.preloadedComponents.has(r)||(this.preloadQueue.push({name:r,loader:a}),this.processQueue())}static async processQueue(){this.isPreloading||this.preloadQueue.length===0||(this.isPreloading=!0,"requestIdleCallback"in window?window.requestIdleCallback(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()}):setTimeout(async()=>{const r=this.preloadQueue.shift();if(r)try{await r.loader(),this.preloadedComponents.add(r.name)}catch{}this.isPreloading=!1,this.processQueue()},100))}static isPreloaded(r){return this.preloadedComponents.has(r)}static clear(){this.preloadedComponents.clear(),this.preloadQueue=[],this.isPreloading=!1}};Xe.preloadedComponents=new Set,Xe.preloadQueue=[],Xe.isPreloading=!1;let rt=Xe;const Uu=()=>{"requestIdleCallback"in window&&window.requestIdleCallback(()=>{Qa.secondary.forEach(e=>{})})},Ja=({message:e})=>t.jsxs("div",{className:"flex items-center justify-center p-4",children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),He=new Map;function Du(e,r){const{condition:a,fallback:n,retries:o=3,timeout:s=1e4,priority:i="medium",cacheKey:l=`conditional-${Math.random()}`}=r,d=c=>{const[u,h]=p.useState(!1),[w,m]=p.useState(null);return p.useEffect(()=>{const v=setTimeout(async()=>{const T=He.get(l);if(T&&T.isValid&&Date.now()-T.lastCheck<3e5)try{if(await T.condition()){m(()=>T.component),h(!0);return}}catch{}try{if(await a()){const S=await zu(e,o,s);He.set(l,{component:S.default,condition:a,lastCheck:Date.now(),isValid:!0}),m(()=>S.default),h(!0)}}catch{}},i==="high"?0:i==="medium"?100:500);return()=>clearTimeout(v)},[]),u?w?t.jsx(p.Suspense,{fallback:n||t.jsx(Ja,{message:"Loading component..."}),children:t.jsx(w,{...c})}):null:n||t.jsx(Ja,{message:"Checking conditions..."})};return d.displayName=`ConditionalLazy(${l})`,d}const ju={},_u={};async function zu(e,r,a){let n;for(let o=0;o<r;o++)try{const s=new Promise((i,l)=>{setTimeout(()=>l(new Error("Import timeout")),a)});return await Promise.race([e(),s])}catch(s){if(n=s,o<r-1){const i=Math.pow(2,o)*1e3;await new Promise(l=>setTimeout(l,i))}}throw n}function Bu(){He.clear()}function Wu(){return{cachedComponents:He.size,cacheEntries:Array.from(He.entries()).map(([e,r])=>({key:e,lastCheck:r.lastCheck,isValid:r.isValid,age:Date.now()-r.lastCheck}))}}const Ra=[{name:"react-router",path:"/assets/react-router-*.js",size:12,config:{priority:"critical",condition:()=>!0}},{name:"app-core",path:"/assets/app-core-*.js",size:25,config:{priority:"high",condition:()=>window.location.pathname==="/",delay:1e3,onIdle:!0}},{name:"wagmi",path:"/assets/wagmi-*.js",size:15,config:{priority:"high",condition:()=>!!(window.ethereum||localStorage.getItem("walletconnect")),onIdle:!0}},{name:"wc-ethereum",path:"/assets/wc-ethereum-*.js",size:273,config:{priority:"medium",condition:()=>!!window.ethereum,delay:2e3,onHover:!0}},{name:"solana-core",path:"/assets/solana-core-*.js",size:29,config:{priority:"medium",condition:()=>!!(window.solana||window.phantom),delay:1500}},{name:"mail-features",path:"/assets/mail-features-*.js",size:10,config:{priority:"medium",condition:()=>window.location.pathname.includes("/connect")||localStorage.getItem("wallet-connected")==="true",onScroll:20}},{name:"coinbase",path:"/assets/coinbase-*.js",size:75,config:{priority:"low",condition:()=>!!window.ethereum,delay:5e3,onIdle:!0}},{name:"design-system",path:"/assets/design-system-*.js",size:112,config:{priority:"low",condition:()=>window.location.pathname.includes("/internal"),delay:3e3}}];class Fu{constructor(){this.preloaded=new Set,this.networkSpeedEstimate="medium",this.isLowEndDevice=!1,this.userActivityScore=0,this.detectNetworkSpeed(),this.detectDeviceCapability(),this.startUserActivityTracking()}detectNetworkSpeed(){if("connection"in navigator){const a=navigator.connection;if(a){const n=a.effectiveType;n==="4g"?this.networkSpeedEstimate="fast":n==="3g"?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}}const r=performance.now();fetch("/favicon.ico",{method:"HEAD"}).then(()=>{const a=performance.now()-r;a<100?this.networkSpeedEstimate="fast":a<300?this.networkSpeedEstimate="medium":this.networkSpeedEstimate="slow"}).catch(()=>{this.networkSpeedEstimate="slow"})}detectDeviceCapability(){const r=navigator.deviceMemory,a=navigator.hardwareConcurrency;r&&r<4&&(this.isLowEndDevice=!0),a&&a<4&&(this.isLowEndDevice=!0),"getBattery"in navigator&&navigator.getBattery?.().then(n=>{n.level&&n.level<.2&&(this.isLowEndDevice=!0)})}startUserActivityTracking(){let r;const a=()=>{this.userActivityScore=Math.min(this.userActivityScore+1,100),clearTimeout(r),r=setTimeout(()=>{this.userActivityScore=Math.max(this.userActivityScore-1,0)},5e3)};["click","scroll","keydown","mousemove"].forEach(n=>{document.addEventListener(n,a,{passive:!0})})}shouldPreload(r){return this.networkSpeedEstimate==="slow"&&r.size>50||this.isLowEndDevice&&r.size>30?!1:r.config.condition()}async preloadChunk(r){if(!this.preloaded.has(r.name))try{if(document.querySelectorAll('script[src*="'+r.name+'"]').length===0&&document.querySelectorAll('link[href*="'+r.name+'"]').length>0)return;const n=document.createElement("link");n.rel="modulepreload",n.href=r.path.replace("*",this.getChunkHash(r.name)),n.crossOrigin="","fetchPriority"in n&&(n.fetchPriority=r.config.priority==="critical"?"high":"low"),document.head.appendChild(n),this.preloaded.add(r.name)}catch{}}getChunkHash(r){const a=Array.from(document.querySelectorAll("script[src]"));for(const n of a){const o=n.src;if(o.includes(r)){const s=o.match(new RegExp(`${r}-([A-Za-z0-9_-]+)\\.js`));if(s)return s[1]}}return"unknown"}async schedulePreload(r){const a=r.config;return a.delay&&await new Promise(n=>setTimeout(n,a.delay)),a.onIdle&&"requestIdleCallback"in window?new Promise(n=>{window.requestIdleCallback(()=>{this.preloadChunk(r).then(n)})}):this.preloadChunk(r)}initializePreloading(){Ra.sort((a,n)=>{const o={critical:0,high:1,medium:2,low:3};return o[a.config.priority]-o[n.config.priority]}).forEach(a=>{this.shouldPreload(a)&&(a.config.priority==="critical"?this.preloadChunk(a):this.schedulePreload(a),a.config.onHover&&this.setupHoverPreloading(a),a.config.onScroll&&this.setupScrollPreloading(a,a.config.onScroll))}),this.startIntelligentPreloading()}setupHoverPreloading(r){document.querySelectorAll("[data-preload-on-hover]").forEach(n=>{let o=!1;n.addEventListener("mouseenter",()=>{!o&&this.userActivityScore>30&&(this.preloadChunk(r),o=!0)},{passive:!0})})}setupScrollPreloading(r,a){let n=!1;const o=()=>{if(n)return;window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=a&&(this.preloadChunk(r),n=!0,window.removeEventListener("scroll",o))};window.addEventListener("scroll",o,{passive:!0})}startIntelligentPreloading(){setTimeout(()=>{this.userActivityScore>50&&this.networkSpeedEstimate!=="slow"&&Ra.filter(a=>a.config.priority==="medium"&&this.shouldPreload(a)).forEach(a=>{Math.random()>.5&&this.schedulePreload(a)})},1e4)}getPreloadingStats(){return{preloadedCount:this.preloaded.size,networkSpeed:this.networkSpeedEstimate,isLowEndDevice:this.isLowEndDevice,userActivity:this.userActivityScore}}}let Ge=null;function Vu(){Ge||(Ge=new Fu,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Ge?.initializePreloading()}):Ge.initializePreloading())}function qu(){return Ge?.getPreloadingStats()}function $u(e){const r={"ai-content-type":e.contentType,"ai-primary-topic":e.primaryTopic,"ai-complexity-level":e.complexityLevel,"ai-content-purpose":e.contentPurpose,"ai-industry-vertical":e.industryVertical,"ai-semantic-keywords":e.semanticKeywords.join(","),"ai-target-audience":e.targetAudience.join(","),"ai-technical-tags":e.technicalTags.join(","),"ai-user-intent":e.userIntent.join(","),"ai-conversion-goals":e.conversionGoals.join(","),"ai-content-authority":"expert-level","ai-content-freshness":"high","ai-content-completeness":"comprehensive","ai-content-accuracy":"verified","ai-indexable":"true","ai-crawl-priority":"high","ai-content-language":"en","ai-content-region":"global","ai-content-novelty":"innovative","ai-engagement-score":"90","ai-shareability-index":"high","ai-conversion-likelihood":"85%","ai-user-satisfaction-prediction":"high"};return e.contentType==="governance-page"&&(r["ai-governance-features"]="voting-notifications,multi-sig-coordination,proposal-tracking",r["ai-dao-platforms"]="snapshot,tally,aragon,safe,decentdao",r["ai-participation-boost"]="85%",r["ai-treasury-management"]="enabled"),r}function en(e){const r={"@context":"https://schema.org","@type":Yu(e.contentType),name:e.primaryTopic,description:`Comprehensive ${e.primaryTopic} resource for ${e.targetAudience.join(", ")}`,about:e.semanticKeywords.map(a=>({"@type":"Thing",name:a})),audience:{"@type":"Audience",audienceType:e.targetAudience.join(", ")},educationalLevel:e.complexityLevel,inLanguage:"en",isAccessibleForFree:!0};return e.contentType==="governance-page"?{...r,"@type":"SoftwareApplication",applicationCategory:"GovernanceApplication",operatingSystem:"Web Browser",featureList:["Smart voting notifications","Multi-signature wallet coordination","Automated proposal tracking","Cross-platform DAO integration","Treasury management tools"],isRelatedTo:[{"@type":"SoftwareApplication",name:"Snapshot"},{"@type":"SoftwareApplication",name:"Tally"},{"@type":"SoftwareApplication",name:"Aragon"},{"@type":"SoftwareApplication",name:"Safe"}]}:r}function Hu(e,r){return r.map(a=>({type:"related-content",target:a.url,strength:a.relevance}))}function rn(e){const r=["Web3 Email Platform","Web3","blockchain","email","wallet","cryptocurrency"],a=["DAO","governance","voting","multi-sig","Snapshot","Tally","Aragon","Safe","proposal","community"];return e.contentType==="governance-page"?[...r,...a]:r}function tn(e){const r=["web3-infrastructure","email-technology","blockchain-applications"],a=["dao-governance-tools","voting-notification-systems","community-management-platforms","multi-signature-coordination","treasury-management-solutions"];return e.contentType==="governance-page"?[...r,...a]:r}function Gu(e,r){return{contentClassification:{type:e.contentType,topic:e.primaryTopic,audience:e.targetAudience.join(","),complexity:e.complexityLevel,purpose:e.contentPurpose,vertical:e.industryVertical},semanticMarkup:en(e),entityRecognition:rn(e),topicClustering:tn(e),contentRelationships:r?.contentRelationships||[],...r}}function Yu(e){return{article:"Article","landing-page":"WebPage","product-page":"Product","governance-page":"SoftwareApplication",documentation:"TechArticle"}[e]||"WebPage"}function Ku(e){return{"@context":"https://schema.org","@type":"MonitorAction",name:`AI Performance Tracking - ${e}`,instrument:{"@type":"SoftwareApplication",name:"AI Analytics Platform"},measurementTechnique:["User Engagement Metrics","AI Content Understanding Score","Semantic Relevance Analysis","Conversion Optimization Tracking"],result:{"@type":"Dataset",name:`${e} Performance Data`,description:"AI-optimized performance metrics and user interaction data"}}}const Zu={governancePage:{contentType:"governance-page",primaryTopic:"DAO Governance Communication Platform",semanticKeywords:["DAO governance","voting notifications","multi-sig coordination","proposal tracking","community engagement","treasury management"],targetAudience:["DAO members","governance participants","multi-sig signers","protocol teams","community managers"],complexityLevel:"intermediate",contentPurpose:"commercial",industryVertical:"blockchain-governance",technicalTags:["snapshot","tally","aragon","safe","multi-sig","voting","proposals","treasury"],userIntent:["improve-governance","increase-participation","coordinate-multi-sig","track-proposals","engage-community"],conversionGoals:["dao-integration","governance-setup","multi-sig-connection","notification-activation"]},landingPage:{contentType:"landing-page",primaryTopic:"Web3 Email Platform",semanticKeywords:["Web3 email","wallet authentication","ENS email","SNS email","blockchain email","decentralized communication"],targetAudience:["Web3 users","crypto enthusiasts","blockchain developers","DeFi users"],complexityLevel:"beginner",contentPurpose:"commercial",industryVertical:"web3-communication",technicalTags:["ethereum","solana","ens","sns","wallet-connect","metamask","phantom"],userIntent:["create-web3-email","connect-wallet","secure-communication","eliminate-passwords"],conversionGoals:["wallet-connection","email-creation","first-email-sent","premium-upgrade"]}},Xu=({message:e,className:r})=>t.jsxs("div",{className:`flex items-center justify-center p-4 ${r||""}`,children:[t.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"}),t.jsx("span",{className:"ml-2 text-sm text-gray-600",children:e})]}),tt=new Map,Ye=new Set;function at(){const e=[];return!!window.ethereum?.isMetaMask&&(Ye.add("metamask"),e.push({name:"MetaMask",detected:!0,priority:1})),!!window.ethereum?.isCoinbaseWallet&&(Ye.add("coinbase"),e.push({name:"Coinbase Wallet",detected:!0,priority:2})),!!window.solana?.isPhantom&&(Ye.add("phantom"),e.push({name:"Phantom",detected:!0,priority:3})),e.push({name:"WalletConnect",detected:!0,priority:4}),e.sort((o,s)=>o.priority-s.priority)}function nt(e){const r=`wallet-${e.toLowerCase()}`;if(tt.has(r))return tt.get(r);const a=()=>Promise.resolve({default:()=>p.createElement("div",{},`${e} Provider Placeholder`)}),n=p.lazy(a),o=s=>t.jsx(p.Suspense,{fallback:t.jsx(Xu,{message:`Loading ${e} wallet...`,className:"wallet-loading"}),children:t.jsx(n,{...s})});return o.displayName=`Lazy${e}Provider`,tt.set(r,o),o}function Qu({children:e}){const r=at();return r.filter(a=>a.priority<=2&&a.detected).forEach(a=>{setTimeout(()=>{},1e3)}),t.jsxs(t.Fragment,{children:[r.map(a=>{const n=nt(a.name);return t.jsx(n,{},a.name)}),e]})}const lt=class lt{static preloadWallet(r){const a=r.toLowerCase();this.preloadedWallets.has(a)||(this.preloadedWallets.add(a),setTimeout(()=>{nt(r)},500))}static preloadCommonWallets(){["metamask","walletconnect","coinbase"].forEach((a,n)=>{setTimeout(()=>{this.preloadWallet(a)},n*1e3)})}static getPreloadedWallets(){return Array.from(this.preloadedWallets)}};lt.preloadedWallets=new Set;let Ke=lt;function Ju(){return{availableWallets:at(),preloadWallet:n=>{Ke.preloadWallet(n)},getDetectedWallets:()=>Array.from(Ye),hasWallet:n=>Ye.has(n.toLowerCase())}}function Ru({walletName:e,onConnect:r,disabled:a=!1}){const n=()=>{Ke.preloadWallet(e),setTimeout(r,100)};return t.jsxs("button",{onClick:n,disabled:a,className:"wallet-connect-btn","data-wallet":e.toLowerCase(),children:["Connect ",e]})}class eg{constructor(){this.criticalResources=[],this.observedMetrics={fcp:0,lcp:0,fid:0,cls:0,ttfb:0},this.defineCriticalResources(),this.startPerformanceObservation()}defineCriticalResources(){this.criticalResources=[{url:"/assets/index-*.css",type:"style",priority:"critical",preload:!0},{url:"/assets/index-*.js",type:"script",priority:"critical"},{url:"/assets/react-core-*.js",type:"script",priority:"high",preload:!0},{url:"https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2",type:"font",priority:"critical",preload:!0},{url:"/logo.png",type:"image",priority:"high",preload:!0}]}startPerformanceObservation(){if("PerformanceObserver"in window)try{new PerformanceObserver(s=>{for(const i of s.getEntries())i.name==="first-contentful-paint"&&(this.observedMetrics.fcp=i.startTime,this.optimizeBasedOnFCP(i.startTime))}).observe({entryTypes:["paint"]}),new PerformanceObserver(s=>{for(const i of s.getEntries())this.observedMetrics.lcp=i.startTime,this.optimizeBasedOnLCP(i.startTime)}).observe({entryTypes:["largest-contentful-paint"]});let n=0;new PerformanceObserver(s=>{for(const i of s.getEntries())i.hadRecentInput||(n+=i.value);this.observedMetrics.cls=n}).observe({entryTypes:["layout-shift"]})}catch{}window.addEventListener("load",()=>{setTimeout(()=>{const r=performance.getEntriesByType("navigation")[0];r&&(this.observedMetrics.ttfb=r.responseStart-r.requestStart,this.optimizeBasedOnTTFB(this.observedMetrics.ttfb))},0)})}optimizeBasedOnFCP(r){r>2e3?this.applyEmergencyOptimizations():r>1500&&this.applyMediumOptimizations()}optimizeBasedOnLCP(r){r>2500&&this.optimizeLCPElements()}optimizeBasedOnTTFB(r){r>600&&this.enableAggressiveCaching()}applyEmergencyOptimizations(){document.querySelectorAll('img[data-priority="low"]').forEach(n=>{n.loading="lazy",n.style.display="none",setTimeout(()=>{n.style.display=""},3e3)}),document.querySelectorAll('script[data-priority="low"]').forEach(n=>{n.setAttribute("defer","")})}applyMediumOptimizations(){["/assets/app-core-*.js","/assets/react-router-*.js"].forEach(a=>{this.preloadResource(a,"script")})}optimizeLCPElements(){document.querySelectorAll("img[data-hero], [data-lcp-element]").forEach(n=>{n instanceof HTMLImageElement&&(n.fetchPriority="high",n.loading="eager")});const a=document.querySelector("img[data-hero]")?.getAttribute("src");a&&this.preloadResource(a,"image")}enableAggressiveCaching(){const r=document.createElement("meta");r.httpEquiv="Cache-Control",r.content="public, max-age=31536000, immutable",document.head.appendChild(r)}preloadResource(r,a){if(document.querySelector(`link[href*="${r}"]`))return;const o=document.createElement("link");switch(o.rel="preload",o.href=r,a){case"script":o.as="script";break;case"style":o.as="style";break;case"font":o.as="font",o.type="font/woff2",o.crossOrigin="";break;case"image":o.as="image";break}document.head.appendChild(o)}optimizeCriticalPath(){this.criticalResources.filter(r=>r.priority==="critical"&&r.preload).forEach(r=>{this.preloadResource(r.url,r.type)}),this.inlineCriticalCSS(),this.optimizeFontLoading(),this.removeRenderBlocking(),this.setupProgressiveLoading()}inlineCriticalCSS(){const r=document.querySelector('link[rel="stylesheet"][data-critical]');r&&this.isSmallResource(r.getAttribute("href")||"")&&fetch(r.getAttribute("href")||"").then(a=>a.text()).then(a=>{if(a.length<1e4){const n=document.createElement("style");n.textContent=a,document.head.appendChild(n),r.remove()}}).catch(()=>{})}optimizeFontLoading(){document.querySelectorAll('link[href*="fonts.googleapis.com"]').forEach(a=>{const n=a.getAttribute("href")||"";if(!n.includes("display=swap")){const o=n.includes("?")?"&":"?";a.setAttribute("href",`${n}${o}display=swap`)}})}removeRenderBlocking(){document.querySelectorAll('link[rel="stylesheet"]:not([data-critical])').forEach(a=>{const n=a.cloneNode(!0);n.rel="preload",n.as="style",n.onload=()=>{n.onload=null,n.rel="stylesheet"};const o=document.createElement("noscript"),s=a.cloneNode(!0);o.appendChild(s),document.head.appendChild(n),document.head.appendChild(o),a.remove()})}setupProgressiveLoading(){const r=document.querySelectorAll("img[data-src]");if("IntersectionObserver"in window){const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.src=s.dataset.src||"",s.removeAttribute("data-src"),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});r.forEach(n=>a.observe(n))}else r.forEach(a=>{const n=a;n.src=n.dataset.src||""})}isSmallResource(r){return r.includes("critical")||r.includes("inline")}getPerformanceMetrics(){return{...this.observedMetrics,score:this.calculatePerformanceScore()}}calculatePerformanceScore(){let r=100;return this.observedMetrics.fcp>2e3?r-=20:this.observedMetrics.fcp>1500&&(r-=10),this.observedMetrics.lcp>2500?r-=25:this.observedMetrics.lcp>2e3&&(r-=15),this.observedMetrics.cls>.1?r-=15:this.observedMetrics.cls>.05&&(r-=8),this.observedMetrics.ttfb>600?r-=10:this.observedMetrics.ttfb>400&&(r-=5),Math.max(r,0)}}const cr={mark:e=>{typeof performance<"u"&&performance.mark&&performance.mark(e)},measure:(e,r,a)=>{if(typeof performance<"u"&&performance.measure)try{performance.measure(e,r,a);const n=performance.getEntriesByName(e);return n[n.length-1]?.duration||0}catch{return 0}return 0},getEntries:e=>typeof performance<"u"&&performance.getEntriesByName?e?performance.getEntriesByName(e):performance.getEntries():[],clearEntries:e=>{typeof performance<"u"&&(e?(performance.clearMeasures?.(e),performance.clearMarks?.(e)):(performance.clearMeasures?.(),performance.clearMarks?.()))}},rg=(e,r=[])=>{p.useEffect(()=>(cr.mark(`${e}-start`),()=>{cr.mark(`${e}-end`),cr.measure(e,`${e}-start`,`${e}-end`)}),[e,r])},tg=e=>{const r=p.useRef(e);return r.current=e,p.useCallback((...a)=>r.current(...a),[])},ag=(e,r,a)=>{const n=p.useRef(r),o=p.useRef(void 0);return p.useMemo(()=>(a&&process.env.NODE_ENV==="development"&&r.some((s,i)=>s!==n.current[i]),n.current=r,o.current=e(),o.current),[e,a,r])},dr=new Map,ng=e=>{const r=dr.get(e)||0;dr.set(e,r+1),p.useEffect(()=>{process.env.NODE_ENV})},og=()=>Object.fromEntries(dr),sg=()=>dr.clear(),ig=e=>p.lazy(e),lg=(e=.1)=>{const[r,a]=p.useState(new Set),n=p.useRef(null);p.useEffect(()=>(n.current=new IntersectionObserver(s=>{s.forEach(i=>{if(i.isIntersecting){const l=i.target,d=l.dataset.src;d&&(l.src=d,l.onload=()=>{a(c=>new Set(c).add(d))},n.current?.unobserve(l))}})},{threshold:e}),()=>n.current?.disconnect()),[e]);const o=p.useCallback(s=>{s&&n.current&&n.current.observe(s)},[]);return{loadedImages:r,observeImage:o}},cg=e=>{typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(()=>{e().catch(()=>{})}):setTimeout(()=>{e().catch(()=>{})},100)},an={},dg=e=>{an[e.name]=e.value,process.env.NODE_ENV},ug=()=>an,gg=(e,r="script")=>{if(typeof document<"u"){const a=document.createElement("link");a.rel="prefetch",a.href=e,a.as=r,document.head.appendChild(a)}},hg=(e,r="script",a)=>{if(typeof document<"u"){const n=document.createElement("link");n.rel="preload",n.href=e,n.as=r,a&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}},fg=e=>{const r=p.useRef(new Set),a=p.useRef(new Set),n=p.useCallback((s,i)=>{const l=setTimeout(()=>{r.current.delete(l),s()},i);return r.current.add(l),l},[]),o=p.useCallback((s,i)=>{const l=setInterval(s,i);return a.current.add(l),l},[]);return p.useEffect(()=>{const s=r.current,i=a.current;return()=>{s.forEach(l=>clearTimeout(l)),i.forEach(l=>clearInterval(l)),process.env.NODE_ENV}},[e]),{createTimer:n,createInterval:o}},ge={maxBundleSize:500,maxChunkSize:200,maxImageSize:100,maxFCP:1800,maxLCP:2500,maxFID:100,maxCLS:.1,check:e=>{const r=[];return e.FCP&&e.FCP>ge.maxFCP&&r.push(`FCP (${e.FCP}ms) exceeds budget (${ge.maxFCP}ms)`),e.LCP&&e.LCP>ge.maxLCP&&r.push(`LCP (${e.LCP}ms) exceeds budget (${ge.maxLCP}ms)`),e.FID&&e.FID>ge.maxFID&&r.push(`FID (${e.FID}ms) exceeds budget (${ge.maxFID}ms)`),e.CLS&&e.CLS>ge.maxCLS&&r.push(`CLS (${e.CLS}) exceeds budget (${ge.maxCLS})`),r}};class bg{constructor(r){this.metrics={timestamp:Date.now()},this.observers=[],this.performanceMarks=new Map,this.reportCallback=r,this.initializeWebVitals(),this.initializeCustomObservers(),this.collectDeviceInfo()}initializeWebVitals(){je.onCLS(r=>{this.metrics.CLS=r.value,this.reportMetric("CLS",r.value)}),je.onINP(r=>{this.metrics.INP=r.value,this.reportMetric("INP",r.value)}),je.onFCP(r=>{this.metrics.FCP=r.value,this.reportMetric("FCP",r.value)}),je.onLCP(r=>{this.metrics.LCP=r.value,this.reportMetric("LCP",r.value)}),je.onTTFB(r=>{this.metrics.TTFB=r.value,this.reportMetric("TTFB",r.value)})}initializeCustomObservers(){if("PerformanceObserver"in window){const r=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{if(s.entryType==="navigation"){const i=s;this.metrics.bundleLoadTime=i.loadEventEnd-i.fetchStart}})});try{r.observe({entryTypes:["navigation"]}),this.observers.push(r)}catch{}const a=new PerformanceObserver(n=>{n.getEntries().forEach(s=>{(s.name.includes(".js")||s.name.includes(".css"))&&this.trackResourceLoad(s.name,s.duration)})});try{a.observe({entryTypes:["resource"]}),this.observers.push(a)}catch{}}}collectDeviceInfo(){if(typeof window<"u"){const r=navigator;r.connection&&(this.metrics.connection=r.connection.effectiveType||r.connection.type),r.deviceMemory&&(this.metrics.deviceMemory=r.deviceMemory),r.hardwareConcurrency&&(this.metrics.hardwareConcurrency=r.hardwareConcurrency),this.metrics.viewport={width:window.innerWidth,height:window.innerHeight}}}reportMetric(r,a){this.reportCallback&&this.reportCallback({...this.metrics,timestamp:Date.now()}),process.env.NODE_ENV}trackResourceLoad(r,a){const n=r.includes(".js"),o=r.includes(".css");if(n||o){const s=n?"JavaScript":"CSS";this.reportMetric(`${s} Load`,a)}}measureComponentRender(r,a){this.metrics.componentRenderTime=a,this.reportMetric(`Component Render (${r})`,a)}measureAPICall(r,a){this.metrics.apiResponseTime=a,this.reportMetric(`API Call (${r})`,a)}measureRouteChange(r,a){this.metrics.routeChangeTime=a,this.reportMetric(`Route Change (${r})`,a)}markStart(r){this.performanceMarks.set(r,performance.now())}markEnd(r){const a=this.performanceMarks.get(r);if(a){const n=performance.now()-a;this.reportMetric(`Mark (${r})`,n),this.performanceMarks.delete(r)}}trackRouteChange(r,a,n){typeof a=="string"?this.measureRouteChange(a,n||performance.now()):this.measureRouteChange(r,a)}getSummary(){return{coreWebVitals:{score:this.calculateScore(),LCP:this.metrics.LCP,INP:this.metrics.INP,CLS:this.metrics.CLS},loadingPerformance:{FCP:this.metrics.FCP,TTFB:this.metrics.TTFB,bundleLoadTime:this.metrics.bundleLoadTime},runtime:{routeChangeTime:this.metrics.routeChangeTime,apiResponseTime:this.metrics.apiResponseTime,componentRenderTime:this.metrics.componentRenderTime},device:{connection:this.metrics.connection,deviceMemory:this.metrics.deviceMemory,hardwareConcurrency:this.metrics.hardwareConcurrency}}}calculateScore(){let r=100;return this.metrics.LCP&&this.metrics.LCP>2500?r-=25:this.metrics.LCP&&this.metrics.LCP>2e3&&(r-=15),this.metrics.INP&&this.metrics.INP>200?r-=20:this.metrics.INP&&this.metrics.INP>100&&(r-=10),this.metrics.CLS&&this.metrics.CLS>.1?r-=15:this.metrics.CLS&&this.metrics.CLS>.05&&(r-=8),Math.max(r,0)}getMetrics(){return{...this.metrics}}cleanup(){this.observers.forEach(r=>r.disconnect()),this.observers=[]}}let ur=null;const mg=e=>(ur||(ur=new bg(e)),ur),gr=()=>ur,nn=e=>{const r=p.useRef(performance.now());p.useEffect(()=>{const a=performance.now()-r.current,n=gr();n&&n.measureComponentRender(e,a)},[e])},yg=(e,r)=>p.forwardRef((a,n)=>(nn(r),p.createElement(e,{...a,ref:n}))),pg=async(e,r)=>{const a=performance.now(),n=await e(),o=performance.now()-a,s=gr();return s&&s.measureAPICall(r,o),n},on={LCP:2500,INP:200,CLS:.1,FCP:1800,TTFB:800,bundleSize:17e4},vg=(e,r=on)=>{const a=[];return r.LCP&&e.LCP&&e.LCP>r.LCP&&a.push(`LCP: ${e.LCP.toFixed(0)}ms (budget: ${r.LCP}ms)`),r.INP&&e.INP&&e.INP>r.INP&&a.push(`INP: ${e.INP.toFixed(0)}ms (budget: ${r.INP}ms)`),r.CLS&&e.CLS&&e.CLS>r.CLS&&a.push(`CLS: ${e.CLS.toFixed(3)} (budget: ${r.CLS})`),r.FCP&&e.FCP&&e.FCP>r.FCP&&a.push(`FCP: ${e.FCP.toFixed(0)}ms (budget: ${r.FCP}ms)`),r.TTFB&&e.TTFB&&e.TTFB>r.TTFB&&a.push(`TTFB: ${e.TTFB.toFixed(0)}ms (budget: ${r.TTFB}ms)`),{passed:a.length===0,violations:a}},wg=e=>{const r=e||gr()?.getMetrics()||{timestamp:Date.now()},a={timestamp:new Date().toISOString(),metrics:r,environment:{userAgent:typeof window<"u"?window.navigator.userAgent:"unknown",url:typeof window<"u"?window.location.href:"unknown",referrer:typeof document<"u"?document.referrer:"unknown",viewport:r.viewport,connection:r.connection,deviceMemory:r.deviceMemory,hardwareConcurrency:r.hardwareConcurrency}};return JSON.stringify(a,null,2)},kg=({direction:e,className:r})=>t.jsx("svg",{className:f("w-4 h-4",r),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e==="up"?"M5 15l7-7 7 7":"M19 9l-7 7-7-7"})}),xg=({className:e})=>t.jsx("svg",{className:f("w-4 h-4",e),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),sn=({title:e="Performance Monitor",isCollapsed:r,onToggleCollapse:a,onClose:n,onMouseDown:o,isDragging:s,className:i})=>t.jsxs("div",{className:f("bg-gray-900 text-white rounded-t-lg px-3 py-2","flex items-center justify-between","shadow-lg border border-gray-700","select-none",o&&"cursor-grab",s&&"cursor-grabbing",i),onMouseDown:o,children:[t.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[t.jsx("span",{children:"🚀"}),e]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx("button",{onClick:a,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":r?"Expand":"Collapse",type:"button",children:t.jsx(kg,{direction:r?"up":"down"})}),n&&t.jsx("button",{onClick:n,className:"hover:bg-gray-700 rounded p-1 transition-colors","aria-label":"Close",type:"button",children:t.jsx(xg,{})})]})]}),Ng={sm:"w-2 h-2",md:"w-3 h-3",lg:"w-4 h-4"},Cg={good:"bg-green-500","needs-improvement":"bg-yellow-500",poor:"bg-red-500",unknown:"bg-gray-400",neutral:"bg-gray-500"},Sg={good:"Good","needs-improvement":"Needs Improvement",poor:"Poor",unknown:"Unknown",neutral:"Neutral"},Eg=({rating:e,size:r="sm",showLabel:a=!1,className:n})=>t.jsxs("div",{className:f("flex items-center gap-1",n),children:[t.jsx("span",{className:f("rounded-full",Ng[r],Cg[e])}),a&&t.jsx("span",{className:"text-xs text-gray-400",children:Sg[e]})]}),ln=({className:e})=>t.jsxs("div",{className:f("flex gap-3 text-[10px] text-gray-400",e),children:[t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Good"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),"Needs Improvement"]}),t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),"Poor"]})]}),Tg={good:"text-green-500","needs-improvement":"text-yellow-500",poor:"text-red-500",unknown:"text-gray-400",neutral:"text-gray-300"},H=({label:e,value:r,unit:a="",rating:n="neutral",description:o,className:s})=>{const i=typeof r=="number"?Number.isInteger(r)?r.toString():r.toFixed(r<1?3:0):r;return t.jsxs("div",{className:f("flex justify-between items-center",s),children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"text-gray-300",children:e}),o&&t.jsx("span",{className:"text-[10px] text-gray-500",children:o})]}),t.jsxs("span",{className:f("font-medium",Tg[n]),children:[i,a]})]})},Ag=(e,r="ms",a=0)=>e===void 0?"N/A":`${e.toFixed(a)}${r}`,cn=(e={})=>{const{enabled:r=!0,onUpdate:a}=e,[n,o]=p.useState({}),[s,i]=p.useState(!0),l=p.useRef(a);p.useEffect(()=>{l.current=a},[a]);const d=p.useCallback(c=>{o(u=>{const h={...u,...c};return l.current?.(h),h})},[]);return p.useEffect(()=>{if(!r)return;if(typeof PerformanceObserver>"u"){i(!1);return}const c=[];try{const u=new PerformanceObserver(h=>{const w=h.getEntries(),m=w[w.length-1];d({lcp:m.renderTime||m.loadTime})});u.observe({type:"largest-contentful-paint",buffered:!0}),c.push(u)}catch{}try{const u=new PerformanceObserver(h=>{h.getEntries().forEach(m=>{m.processingStart&&d({fid:m.processingStart-m.startTime})})});u.observe({type:"first-input",buffered:!0}),c.push(u)}catch{}try{let u=0;const h=new PerformanceObserver(w=>{for(const m of w.getEntries())!m.hadRecentInput&&m.value&&(u+=m.value,d({cls:u}))});h.observe({type:"layout-shift",buffered:!0}),c.push(h)}catch{}try{const u=new PerformanceObserver(h=>{h.getEntries().forEach(m=>{m.name==="first-contentful-paint"&&d({fcp:m.startTime})})});u.observe({type:"paint",buffered:!0}),c.push(u)}catch{}try{const u=new PerformanceObserver(h=>{h.getEntries().forEach(m=>{m.duration&&d({inp:m.duration})})});u.observe({type:"event",buffered:!0}),c.push(u)}catch{}try{const u=performance.getEntriesByType("navigation")[0];u&&d({ttfb:u.responseStart-u.requestStart})}catch{}return()=>{c.forEach(u=>u.disconnect())}},[r,d]),{metrics:n,isSupported:s}},Ae=(e,r)=>{if(r===void 0)return"unknown";const n={lcp:{good:2500,poor:4e3},fid:{good:100,poor:300},cls:{good:.1,poor:.25},fcp:{good:1800,poor:3e3},ttfb:{good:800,poor:1800},inp:{good:200,poor:500}}[e];return n?r<=n.good?"good":r<=n.poor?"needs-improvement":"poor":"unknown"},dn=({metrics:e,className:r})=>{const a=(n,o=0)=>n===void 0?"N/A":n.toFixed(o);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-yellow-400 mb-2 text-xs",children:"Web Vitals"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"LCP",value:a(e.lcp),unit:"ms",rating:Ae("lcp",e.lcp),description:"Largest Contentful Paint"}),t.jsx(H,{label:"FID",value:a(e.fid),unit:"ms",rating:Ae("fid",e.fid),description:"First Input Delay"}),t.jsx(H,{label:"CLS",value:a(e.cls,3),rating:Ae("cls",e.cls),description:"Cumulative Layout Shift"}),t.jsx(H,{label:"FCP",value:a(e.fcp),unit:"ms",rating:Ae("fcp",e.fcp),description:"First Contentful Paint"}),t.jsx(H,{label:"TTFB",value:a(e.ttfb),unit:"ms",rating:Ae("ttfb",e.ttfb),description:"Time to First Byte"}),e.inp!==void 0&&t.jsx(H,{label:"INP",value:a(e.inp),unit:"ms",rating:Ae("inp",e.inp),description:"Interaction to Next Paint"})]})]})},un=(e={})=>{const{enabled:r=!0,refreshInterval:a=5e3,onUpdate:n}=e,[o,s]=p.useState({}),i=p.useRef(n);p.useEffect(()=>{i.current=n},[n]);const l=p.useCallback(()=>{if(!(typeof performance>"u"))try{const c=performance.getEntriesByType("resource"),u=c.filter(v=>v.name.endsWith(".js")||v.initiatorType==="script"),h=u.reduce((v,T)=>v+T.duration,0),w=c.filter(v=>v.name.endsWith(".css")||v.initiatorType==="link"),m=w.reduce((v,T)=>v+T.duration,0),b=c.reduce((v,T)=>v+(T.transferSize||0),0),y={jsLoadTime:h,cssLoadTime:m,jsCount:u.length,cssCount:w.length,totalTransferSize:b};s(y),i.current?.(y)}catch{}},[]),d=p.useCallback(()=>{l()},[l]);return p.useEffect(()=>{if(!r)return;l();const c=setInterval(l,a);return()=>clearInterval(c)},[r,a,l]),{metrics:o,refresh:d}},gn=e=>e===void 0?"N/A":e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`,hn=({metrics:e,className:r})=>{const a=n=>n===void 0?"N/A":n.toFixed(0);return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-blue-400 mb-2 text-xs",children:"Bundle Performance"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"JS Load",value:a(e.jsLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"CSS Load",value:a(e.cssLoadTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"JS Files",value:e.jsCount??"N/A",rating:"neutral"}),t.jsx(H,{label:"Transfer Size",value:gn(e.totalTransferSize),rating:"neutral"})]})]})},Ig=e=>e===void 0?"unknown":e<=200?"good":e<=500?"needs-improvement":"poor",fn=({metrics:e,className:r})=>{const a=n=>n===void 0||isNaN(n)?"N/A":n.toFixed(0);return e.callCount===0?null:t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-purple-400 mb-2 text-xs",children:"API Calls"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Count",value:e.callCount,rating:"neutral"}),t.jsx(H,{label:"Total Time",value:a(e.totalTime),unit:"ms",rating:"neutral"}),t.jsx(H,{label:"Avg Time",value:a(e.averageTime),unit:"ms",rating:Ig(e.averageTime)}),e.slowestCall!==void 0&&t.jsx(H,{label:"Slowest",value:a(e.slowestCall),unit:"ms",rating:e.slowestCall>1e3?"poor":"neutral"}),e.failedCalls>0&&t.jsx(H,{label:"Failed",value:e.failedCalls,rating:"poor"})]})]})},bn=e=>e===void 0?"N/A":(e/(1024*1024)).toFixed(1),mn=(e,r)=>{if(e===void 0||r===void 0)return"unknown";const a=e/r;return a<=.5?"good":a<=.75?"needs-improvement":"poor"},yn=({refreshInterval:e=2e3,className:r})=>{const[a,n]=p.useState({}),[o,s]=p.useState(!0);if(p.useEffect(()=>{const l=performance;if(!l.memory){s(!1);return}const d=()=>{l.memory&&n({usedJSHeapSize:l.memory.usedJSHeapSize,totalJSHeapSize:l.memory.totalJSHeapSize,jsHeapSizeLimit:l.memory.jsHeapSizeLimit})};d();const c=setInterval(d,e);return()=>clearInterval(c)},[e]),!o)return null;const i=a.usedJSHeapSize&&a.jsHeapSizeLimit?(a.usedJSHeapSize/a.jsHeapSizeLimit*100).toFixed(0):"N/A";return t.jsxs("div",{className:f("space-y-1",r),children:[t.jsx("h3",{className:"font-semibold text-cyan-400 mb-2 text-xs",children:"Memory"}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(H,{label:"Used Heap",value:bn(a.usedJSHeapSize),unit:"MB",rating:mn(a.usedJSHeapSize,a.jsHeapSizeLimit)}),t.jsx(H,{label:"Total Heap",value:bn(a.totalJSHeapSize),unit:"MB",rating:"neutral"}),t.jsx(H,{label:"Usage",value:i,unit:"%",rating:mn(a.usedJSHeapSize,a.jsHeapSizeLimit)})]})]})},Mg=e=>{if(e.rating)return e.rating;if(typeof e.value=="number"&&e.thresholds){const{good:r,poor:a}=e.thresholds;return e.value<=r?"good":e.value<=a?"needs-improvement":"poor"}return"neutral"},pn=({title:e="Custom Metrics",titleColor:r="text-orange-400",metrics:a,className:n})=>a.length===0?null:t.jsxs("div",{className:f("space-y-1",n),children:[t.jsx("h3",{className:f("font-semibold mb-2 text-xs",r),children:e}),t.jsx("div",{className:"space-y-1.5",children:a.map(o=>t.jsx(H,{label:o.label,value:o.value,unit:o.unit,rating:Mg(o),description:o.description},o.id))})]}),Lg=["/api/","graphql",".json"],vn=(e={})=>{const{enabled:r=!0,patterns:a=Lg,refreshInterval:n=5e3,onUpdate:o}=e,[s,i]=p.useState({callCount:0,totalTime:0,averageTime:0,failedCalls:0}),l=p.useRef(a),d=p.useRef(o);p.useEffect(()=>{l.current=a},[a]),p.useEffect(()=>{d.current=o},[o]);const c=p.useCallback(()=>{if(!(typeof performance>"u"))try{const h=performance.getEntriesByType("resource"),w=l.current,m=h.filter(N=>w.some(S=>N.name.includes(S)));if(m.length===0)return;const b=m.reduce((N,S)=>N+S.duration,0),y=Math.max(...m.map(N=>N.duration)),v=m.filter(N=>{const S=N.responseStatus;return S!==void 0&&S>=400}).length,T={callCount:m.length,totalTime:b,averageTime:b/m.length,slowestCall:y,failedCalls:v};i(T),d.current?.(T)}catch{}},[]),u=p.useCallback(()=>{c()},[c]);return p.useEffect(()=>{if(!r)return;c();const h=setInterval(c,n);return()=>clearInterval(h)},[r,n,c]),{metrics:s,refresh:u}},wn=(e={})=>{const{enabled:r=!0,constrainToViewport:a=!0,horizontalOnly:n=!1,verticalOnly:o=!1,initialPosition:s}=e,i=p.useRef(null),[l,d]=p.useState({x:s?.x??null,y:s?.y??null}),[c,u]=p.useState(!1),[h,w]=p.useState({x:0,y:0}),m=p.useCallback(y=>{if(!r||!i.current)return;const v=i.current.getBoundingClientRect();u(!0),w({x:y.clientX-v.left,y:y.clientY-v.top}),(l.x===null||l.y===null)&&d({x:n?v.left:l.x??v.left,y:o?v.top:l.y??v.top}),y.preventDefault()},[r,l,n,o]),b=p.useCallback(()=>{d({x:s?.x??null,y:s?.y??null})},[s]);return p.useEffect(()=>{if(!c)return;const y=T=>{if(!i.current)return;let N=T.clientX-h.x,S=T.clientY-h.y;if(a){const k=window.innerWidth-i.current.offsetWidth,C=window.innerHeight-i.current.offsetHeight;N=Math.max(0,Math.min(N,k)),S=Math.max(0,Math.min(S,C))}d({x:n?N:o?l.x:N,y:o?S:n?l.y:S})},v=()=>{u(!1)};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v)}},[c,h,a,n,o,l.x,l.y]),{position:l,isDragging:c,handleMouseDown:m,resetPosition:b,ref:i}},kn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Pg=["webVitals","bundle","api","memory"],Og=({enabled:e,defaultCollapsed:r=!0,defaultVisible:a=!0,position:n="bottom-right",draggable:o=!0,sections:s=Pg,customMetrics:i=[],customSectionTitle:l="Custom Metrics",apiPatterns:d,onMetricsUpdate:c,className:u})=>{const h=e??(typeof process<"u"&&process.env?.NODE_ENV!=="production"),[w,m]=p.useState(r),[b,y]=p.useState(a),v=p.useMemo(()=>d,[JSON.stringify(d)]),T=p.useRef(c);p.useEffect(()=>{T.current=c},[c]);const{metrics:N}=cn({enabled:h&&s.includes("webVitals")}),{metrics:S}=un({enabled:h&&s.includes("bundle")}),{metrics:k}=vn({enabled:h&&s.includes("api"),patterns:v});p.useEffect(()=>{T.current&&T.current({webVitals:N,bundle:S,api:k})},[N,S,k]);const{position:C,isDragging:I,handleMouseDown:E,ref:M}=wn({enabled:o,horizontalOnly:n.includes("bottom")||n.includes("top")}),x=p.useCallback(()=>{m(z=>!z)},[]),P=p.useCallback(()=>{y(!1)},[]),D=p.useCallback(()=>{y(!0)},[]);if(!h)return null;if(!b)return t.jsx("button",{onClick:D,className:f("fixed z-[9999]",kn[n],"bg-gray-900 text-white px-3 py-2 rounded-lg","shadow-lg border border-gray-700","hover:bg-gray-800 transition-colors","text-xs font-mono"),type:"button",children:"🚀 Performance"});const U=C.x!==null?{left:`${C.x}px`,bottom:n.includes("bottom")?"1rem":void 0,top:n.includes("top")?"1rem":void 0,position:"fixed",transition:I?"none":"height 0.2s ease-in-out"}:{transition:"height 0.2s ease-in-out"},B=i.length>0||s.includes("custom");return t.jsxs("div",{ref:M,className:f(C.x!==null?"":`fixed ${kn[n]}`,"z-[9999] font-mono text-xs",I&&"cursor-grabbing",u),style:{maxWidth:"320px",...U},children:[t.jsx(sn,{isCollapsed:w,onToggleCollapse:x,onClose:P,onMouseDown:o?E:void 0,isDragging:I}),t.jsx("div",{className:f("bg-gray-800 text-gray-100 rounded-b-lg","shadow-lg border-x border-b border-gray-700","overflow-hidden transition-all duration-300 ease-in-out",w?"max-h-0 opacity-0":"max-h-[70vh] opacity-100 py-2 px-3"),children:t.jsxs("div",{className:"overflow-y-auto max-h-full space-y-3",children:[s.includes("webVitals")&&t.jsx(dn,{metrics:N}),s.includes("bundle")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(hn,{metrics:S})}),s.includes("api")&&k.callCount>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(fn,{metrics:k})}),s.includes("memory")&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(yn,{})}),B&&i.length>0&&t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(pn,{title:l,metrics:i})}),t.jsx("div",{className:"pt-3 border-t border-gray-700",children:t.jsx(ln,{})})]})})]})},Ug=(e={})=>{const{successMessage:r="",successDuration:a=3e3,errorPrefix:n="",onSuccess:o,onError:s}=e,[i,l]=p.useState(!1),[d,c]=p.useState(""),[u,h]=p.useState(""),w=p.useCallback(()=>{c(""),h("")},[]),m=p.useCallback(()=>{c("")},[]),b=p.useCallback(()=>{h("")},[]),y=p.useCallback(async v=>{l(!0),w();try{await v(),r&&(c(r),a>0&&setTimeout(()=>{c("")},a)),o&&o()}catch(T){const N=T instanceof Error?T.message:"An error occurred";throw h(n?`${n}: ${N}`:N),s&&T instanceof Error&&s(T),T}finally{l(!1)}},[r,a,n,o,s,w]);return{isSubmitting:i,successMessage:d,errorMessage:u,submit:y,clearMessages:w,clearSuccess:m,clearError:b}},Dg=(e=!1)=>{const[r,a]=p.useState(e),n=p.useCallback(()=>a(!0),[]),o=p.useCallback(()=>a(!1),[]),s=p.useCallback(()=>a(i=>!i),[]);return{value:r,setTrue:n,setFalse:o,toggle:s,setValue:a}},jg=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState(null),i=p.useCallback(async c=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const u=document.createElement("textarea");u.value=c,u.style.position="fixed",u.style.left="-999999px",u.style.top="-999999px",document.body.appendChild(u),u.focus(),u.select();const h=document.execCommand("copy");if(document.body.removeChild(u),!h)throw new Error("Copy command was unsuccessful")}return s(c),a?.(c),setTimeout(()=>{s(null)},r),!0}catch(u){const h=u instanceof Error?u:new Error("Copy failed");return n?.(h),!1}},[r,a,n]),l=p.useCallback(c=>o===c,[o]),d=p.useCallback(()=>{s(null)},[]);return{copiedValue:o,copyToClipboard:i,isCopied:l,resetCopiedState:d}},_g=(e={})=>{const{successDuration:r=2e3,onSuccess:a,onError:n}=e,[o,s]=p.useState({}),i=p.useCallback(async(c,u)=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(c);else{const h=document.createElement("textarea");h.value=c,h.style.position="fixed",h.style.left="-999999px",h.style.top="-999999px",document.body.appendChild(h),h.focus(),h.select();const w=document.execCommand("copy");if(document.body.removeChild(h),!w)throw new Error("Copy command was unsuccessful")}return s(h=>({...h,[u]:!0})),a?.(c),setTimeout(()=>{s(h=>({...h,[u]:!1}))},r),!0}catch(h){const w=h instanceof Error?h:new Error("Copy failed");return n?.(w),!1}},[r,a,n]),l=p.useCallback(c=>o[c]||!1,[o]),d=p.useCallback(c=>{s(c?u=>({...u,[c]:!1}):{})},[]);return{copiedStates:o,copyToClipboard:i,isCopied:l,resetCopiedState:d}},zg=e=>{if(e===0)return"0 Bytes";const r=1024,a=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(r)),o=Math.min(n,a.length-1);return parseFloat((e/Math.pow(r,o)).toFixed(2))+" "+a[o]},Bg=(e,r,a)=>{const n={bytes:0,kb:1,mb:2,gb:3,tb:4},o=1024,i=e*Math.pow(o,n[r])/Math.pow(o,n[a]);return Math.round(i*100)/100},Wg=e=>{const r=e.match(/^(\d+(?:\.\d+)?)\s*(bytes?|kb|mb|gb|tb)$/i);if(!r)return null;const a=parseFloat(r[1]),n=r[2].toLowerCase(),s={bytes:1,byte:1,kb:1024,mb:1024*1024,gb:1024*1024*1024,tb:1024*1024*1024*1024}[n];return s?Math.round(a*s):null},Fg=e=>e,Vg=e=>{if(typeof document>"u")return;const r=document.createElement("style");r.textContent=e,r.setAttribute("data-critical","true"),document.head.appendChild(r)},qg=e=>{if(typeof document>"u")return;const r=document.createElement("link");r.rel="preload",r.as="style",r.href=e,r.onload=()=>{r.rel="stylesheet"},document.head.appendChild(r);const a=document.createElement("noscript");a.innerHTML=`<link rel="stylesheet" href="${e}">`,document.head.appendChild(a)},$g=e=>{const r={};return Object.entries(e).forEach(([a,n])=>{r[`--${a}`]=typeof n=="number"?`${n}px`:n}),r},Hg={xs:475,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Gg=(e,r=Hg)=>{const[a,n]=p.useState("base");return p.useEffect(()=>{const o=()=>{const s=window.innerWidth;s>=r["2xl"]?n("2xl"):s>=r.xl?n("xl"):s>=r.lg?n("lg"):s>=r.md?n("md"):s>=r.sm?n("sm"):s>=r.xs?n("xs"):n("base")};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[r]),e[a]||e.base||{}},xn=()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,Yg=()=>{const[e,r]=p.useState(xn);return p.useEffect(()=>{const a=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>{r(a.matches)};return a.addEventListener?a.addEventListener("change",n):a.addListener(n),()=>{a.removeEventListener?a.removeEventListener("change",n):a.removeListener(n)}},[]),e},Kg=(e,r=["layout","paint"])=>{e&&(e.style.contain=r.join(" "))},Zg=(e,r)=>e?(e.style.willChange=r.join(", "),()=>{e.style.willChange="auto"}):void 0,Xg=e=>{typeof window>"u"||requestAnimationFrame(()=>{e.forEach(r=>r())})},Qg=(...e)=>e.filter(Boolean).join(" "),Jg=e=>{const r={},a=["display","position","width","height","margin","padding","fontSize","fontFamily","color","backgroundColor"];return Object.entries(e).forEach(([n,o])=>{a.includes(n)&&(r[n]=o)}),r},Rg=(e,r=[])=>{const[a,n]=p.useState(null),[o,s]=p.useState(!0);return p.useEffect(()=>{let i=!0;return e().then(l=>{i&&(n(l.default),s(!1))}),()=>{i=!1}},[e,...r]),{styles:a,loading:o}},eh=(e,r="1rem")=>({display:"grid",gridTemplateColumns:`repeat(${e}, minmax(0, 1fr))`,gap:r,contain:"layout",willChange:"transform"}),rh=(e="row",r="center",a="flex-start")=>({display:"flex",flexDirection:e,alignItems:r,justifyContent:a,contain:"layout"}),th=e=>{const[r,a]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia(e);a(n.matches);const o=()=>a(n.matches);return n.addEventListener?n.addEventListener("change",o):n.addListener(o),()=>{n.removeEventListener?n.removeEventListener("change",o):n.removeListener(o)}},[e]),r},ah=(e,r)=>{const[a,n]=p.useState("light");return p.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)");n(o.matches?"dark":"light");const s=()=>{n(o.matches?"dark":"light")};return o.addEventListener?o.addEventListener("change",s):o.addListener(s),()=>{o.removeEventListener?o.removeEventListener("change",s):o.removeListener(s)}},[]),a==="dark"?r:e},nh=e=>{const r={src:e.src,alt:e.alt,loading:e.loading||"lazy"};return e.title&&(r.title=e.title),e.width&&(r.width=e.width),e.height&&(r.height=e.height),e.sizes&&(r.sizes=e.sizes),e.srcSet&&(r.srcSet=e.srcSet),r.itemProp="image",r},oh=(e,r=[320,640,768,1024,1280,1920])=>r.map(a=>`${e.replace(/\{width\}/g,a.toString())} ${a}w`).join(", "),sh=e=>e.map(r=>r.maxWidth?`(max-width: ${r.maxWidth}px) ${r.size}`:r.size).join(", "),ih=(e,r="openGraph")=>{const a={};return r==="openGraph"?(a["og:image"]=e.url,e.width&&(a["og:image:width"]=e.width.toString()),e.height&&(a["og:image:height"]=e.height.toString()),e.alt&&(a["og:image:alt"]=e.alt),e.type&&(a["og:image:type"]=e.type)):(a["twitter:image"]=e.url,e.alt&&(a["twitter:image:alt"]=e.alt)),a},lh=(e='img[loading="lazy"]')=>{if(typeof window>"u"||!("IntersectionObserver"in window))return;const r=document.querySelectorAll(e);if("loading"in HTMLImageElement.prototype){r.forEach(n=>{n.dataset.src&&(n.src=n.dataset.src)});return}const a=new IntersectionObserver(n=>{n.forEach(o=>{if(o.isIntersecting){const s=o.target;s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),a.unobserve(s)}})},{rootMargin:"50px 0px",threshold:.01});return r.forEach(n=>a.observe(n)),()=>{r.forEach(n=>a.unobserve(n))}},Nn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=r.onerror=function(){e(r.height===2)},r.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA"}),Cn=()=>typeof window>"u"?Promise.resolve(!1):new Promise(e=>{const r=new Image;r.onload=()=>e(!0),r.onerror=()=>e(!1),r.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="}),ch=async(e="jpg")=>{const[r,a]=await Promise.all([Nn(),Cn()]);return a?"avif":r?"webp":e},dh=(e,r,a,n)=>`
57
57
  <picture>
58
58
  ${e.map(s=>{const i=[`srcset="${s.srcSet}"`];return s.type&&i.push(`type="${s.type}"`),s.media&&i.push(`media="${s.media}"`),s.sizes&&i.push(`sizes="${s.sizes}"`),`<source ${i.join(" ")}>`}).join(`
59
59
  `)}
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { TopbarNavItem, TopbarNavProps } from './TopbarNav';
3
3
  export interface TopbarNavigationProps {
4
4
  /** Navigation items to display */
@@ -13,6 +13,8 @@ export interface TopbarNavigationProps {
13
13
  className?: string;
14
14
  /** ARIA label for the mobile menu toggle */
15
15
  mobileMenuLabel?: string;
16
+ /** Content to render between toggle and nav (e.g., logo) */
17
+ children?: ReactNode;
16
18
  }
17
19
  /**
18
20
  * TopbarNavigation - Unified navigation component that handles both desktop and mobile layouts
@@ -1 +1 @@
1
- {"version":3,"file":"TopbarNavigation.d.ts","sourceRoot":"","sources":["../../../src/layout/Topbar/TopbarNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,oDAAoD;IACpD,aAAa,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAChD,sEAAsE;IACtE,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA6B5D,CAAC"}
1
+ {"version":3,"file":"TopbarNavigation.d.ts","sourceRoot":"","sources":["../../../src/layout/Topbar/TopbarNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,qBAAqB;IACpC,kCAAkC;IAClC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,oDAAoD;IACpD,aAAa,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAChD,sEAAsE;IACtE,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAiC5D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/components",
3
- "version": "4.0.29",
3
+ "version": "4.0.31",
4
4
  "description": "Reusable UI components and design system - Reorganized for better maintainability",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",