From 6b77f003966b1453101c895ace261f82b9890a8b Mon Sep 17 00:00:00 2001 From: abingyyds Date: Sat, 28 Mar 2026 00:36:44 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=86=E7=AB=99=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E9=A1=B5=E9=A2=9D=E5=BA=A6=E6=98=BE=E7=A4=BA=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=BA=BA=E6=B0=91=E5=B8=81=EF=BC=8C=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 套餐卡片的每日额度从 $2.20 改为 ¥16.06 显示 - 确认弹窗的额度也改为人民币 - 翻译 key 里 $ 符号改为 ¥ Co-Authored-By: Claude Sonnet 4.6 --- dist/assets/{CountUp-2H8PJb3I.js => CountUp-Ytak2XTa.js} | 2 +- .../assets/{Dashboard-CMrh_5yV.js => Dashboard-6T-v2duE.js} | 2 +- .../{FadeContent-DnAL-lQG.js => FadeContent-DN0-6f2h.js} | 2 +- dist/assets/{Home-CdwZT6r7.js => Home-BBk8paQW.js} | 2 +- dist/assets/{Home-D4cv4oTQ.js => Home-BxpaS5R5.js} | 2 +- dist/assets/{Home-DCfMIsOA.js => Home-CR3Oy2_s.js} | 2 +- dist/assets/{Home-DLOG4B7x.js => Home-DMzxmSBb.js} | 2 +- dist/assets/{Home-C5feFwVH.js => Home-DuzKUQBe.js} | 2 +- dist/assets/{Home-BI1Qa494.js => Home-KTKrKeDU.js} | 2 +- dist/assets/{Home-D7LBRdbE.js => Home-NjW2RUrZ.js} | 2 +- ...anguageSwitch-fmTd22QU.js => LanguageSwitch-Dn1Lth1H.js} | 2 +- dist/assets/{Layout-Cv1wXPfX.js => Layout-CISyGCfm.js} | 2 +- dist/assets/{Layout-Cu3KXPx6.js => Layout-CPY5kYpQ.js} | 2 +- dist/assets/{Layout--sek2SXK.js => Layout-CUZzo-Vw.js} | 2 +- dist/assets/{Layout-Bs88cVzM.js => Layout-D-RGC5l0.js} | 2 +- dist/assets/{Layout-BjSxzlL0.js => Layout-D0gFUpiK.js} | 2 +- dist/assets/{Layout-CAIME1iu.js => Layout-DaloeA7I.js} | 2 +- dist/assets/{Layout-3U5lz1BM.js => Layout-lQQhtT0p.js} | 2 +- dist/assets/{Login-BZ-Yy-uQ.js => Login-BiHdkYGn.js} | 2 +- dist/assets/{Logs-Br0U5gGP.js => Logs-DPdRMLgj.js} | 2 +- dist/assets/{Packages-DkFQKW15.js => Packages-DTfyBY5U.js} | 2 +- dist/assets/{Pricing-CdVyLR6o.js => Pricing-BYGRhypH.js} | 2 +- dist/assets/{Register-DKE8xt5X.js => Register-BJzJhrQt.js} | 2 +- ...{RotatingEquiv-BiNhXD16.js => RotatingEquiv-Dcm5hOLy.js} | 2 +- dist/assets/{Tokens-CuYAJu3t.js => Tokens-BD_w3cXB.js} | 2 +- dist/assets/{Topup-CKiSzFS9.js => Topup-BkvooF5h.js} | 2 +- dist/assets/{index-ZavRXCeN.js => index-DOUW22cV.js} | 4 ++-- ...seTranslation-KkRwPkkT.js => useTranslation-Ce9HcVki.js} | 2 +- dist/index.html | 2 +- src/i18n/locales/en.json | 6 +++--- src/i18n/locales/zh.json | 6 +++--- src/pages/Packages.jsx | 6 +++--- 32 files changed, 39 insertions(+), 39 deletions(-) rename dist/assets/{CountUp-2H8PJb3I.js => CountUp-Ytak2XTa.js} (99%) rename dist/assets/{Dashboard-CMrh_5yV.js => Dashboard-6T-v2duE.js} (97%) rename dist/assets/{FadeContent-DnAL-lQG.js => FadeContent-DN0-6f2h.js} (91%) rename dist/assets/{Home-CdwZT6r7.js => Home-BBk8paQW.js} (97%) rename dist/assets/{Home-D4cv4oTQ.js => Home-BxpaS5R5.js} (96%) rename dist/assets/{Home-DCfMIsOA.js => Home-CR3Oy2_s.js} (96%) rename dist/assets/{Home-DLOG4B7x.js => Home-DMzxmSBb.js} (97%) rename dist/assets/{Home-C5feFwVH.js => Home-DuzKUQBe.js} (97%) rename dist/assets/{Home-BI1Qa494.js => Home-KTKrKeDU.js} (97%) rename dist/assets/{Home-D7LBRdbE.js => Home-NjW2RUrZ.js} (96%) rename dist/assets/{LanguageSwitch-fmTd22QU.js => LanguageSwitch-Dn1Lth1H.js} (86%) rename dist/assets/{Layout-Cv1wXPfX.js => Layout-CISyGCfm.js} (97%) rename dist/assets/{Layout-Cu3KXPx6.js => Layout-CPY5kYpQ.js} (97%) rename dist/assets/{Layout--sek2SXK.js => Layout-CUZzo-Vw.js} (96%) rename dist/assets/{Layout-Bs88cVzM.js => Layout-D-RGC5l0.js} (97%) rename dist/assets/{Layout-BjSxzlL0.js => Layout-D0gFUpiK.js} (97%) rename dist/assets/{Layout-CAIME1iu.js => Layout-DaloeA7I.js} (97%) rename dist/assets/{Layout-3U5lz1BM.js => Layout-lQQhtT0p.js} (96%) rename dist/assets/{Login-BZ-Yy-uQ.js => Login-BiHdkYGn.js} (94%) rename dist/assets/{Logs-Br0U5gGP.js => Logs-DPdRMLgj.js} (97%) rename dist/assets/{Packages-DkFQKW15.js => Packages-DTfyBY5U.js} (55%) rename dist/assets/{Pricing-CdVyLR6o.js => Pricing-BYGRhypH.js} (97%) rename dist/assets/{Register-DKE8xt5X.js => Register-BJzJhrQt.js} (96%) rename dist/assets/{RotatingEquiv-BiNhXD16.js => RotatingEquiv-Dcm5hOLy.js} (97%) rename dist/assets/{Tokens-CuYAJu3t.js => Tokens-BD_w3cXB.js} (99%) rename dist/assets/{Topup-CKiSzFS9.js => Topup-BkvooF5h.js} (99%) rename dist/assets/{index-ZavRXCeN.js => index-DOUW22cV.js} (94%) rename dist/assets/{useTranslation-KkRwPkkT.js => useTranslation-Ce9HcVki.js} (98%) diff --git a/dist/assets/CountUp-2H8PJb3I.js b/dist/assets/CountUp-Ytak2XTa.js similarity index 99% rename from dist/assets/CountUp-2H8PJb3I.js rename to dist/assets/CountUp-Ytak2XTa.js index a0f7388..ec904d1 100644 --- a/dist/assets/CountUp-2H8PJb3I.js +++ b/dist/assets/CountUp-Ytak2XTa.js @@ -1 +1 @@ -import{r as S,j as Qt}from"./index-ZavRXCeN.js";function kt(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const Yt=typeof window<"u",te=Yt?S.useLayoutEffect:S.useEffect;function ee(t,e){t.indexOf(e)===-1&&t.push(e)}function ne(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const U=(t,e,n)=>n>e?e:n{};const ft={},Y=t=>t,se=(t,e)=>n=>e(t(n)),ht=(...t)=>t.reduce(se),Vt=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class re{constructor(){this.subscriptions=[]}add(e){return ee(this.subscriptions,e),()=>ne(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;it*1e3,P=t=>t/1e3;function It(t,e){return e?t*(1e3/e):0}const Et=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ie=1e-7,oe=12;function ae(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=Et(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>ie&&++aae(i,0,1,t,n);return i=>i===0||i===1?i:Et(s(i),e,r)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pt=t=>e=>1-t(1-e),Nt=j(.33,1.53,.69,.99),dt=Pt(Nt),ce=Rt(dt),ue=t=>t>=1?1:(t*=2)<1?.5*dt(t):.5*(2-Math.pow(2,-10*(t-1))),pt=t=>1-Math.sin(Math.acos(t)),le=Pt(pt),fe=Rt(pt),he=j(.42,0,1,1),de=j(0,0,.58,1),Ot=j(.42,0,.58,1),pe=t=>Array.isArray(t)&&typeof t[0]!="number",me=t=>Array.isArray(t)&&typeof t[0]=="number",ge={linear:Y,easeIn:he,easeInOut:Ot,easeOut:de,circIn:pt,circInOut:fe,circOut:le,backIn:dt,backInOut:ce,backOut:Nt,anticipate:ue},ye=t=>typeof t=="string",Tt=t=>{if(me(t)){Ct(t.length===4);const[e,n,r,s]=t;return j(e,n,r,s)}else if(ye(t))return ge[t];return t},z=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function be(t,e){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),t()),c(a)}const l={schedule:(c,f=!1,d=!1)=>{const x=d&&s?n:r;return f&&o.add(c),x.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(u),n.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const Te=40;function ve(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=z.reduce((T,g)=>(T[g]=be(i),T),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:f,preRender:d,render:M,postRender:x}=o,m=()=>{const T=ft.useManualTiming,g=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,Te),1)),s.timestamp=g,s.isProcessing=!0,a.process(s),u.process(s),l.process(s),c.process(s),f.process(s),d.process(s),M.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(m))},v=()=>{n=!0,r=!0,s.isProcessing||t(m)};return{schedule:z.reduce((T,g)=>{const y=o[g];return T[g]=(D,C=!1,b=!1)=>(n||v(),y.schedule(D,C,b)),T},{}),cancel:T=>{for(let g=0;g(Z===void 0&&V.set(J.isProcessing||ft.useManualTiming?J.timestamp:performance.now()),Z),set:t=>{Z=t,queueMicrotask(xe)}},Me=t=>e=>typeof e=="string"&&e.startsWith(t),Ae=Me("var(--"),De=t=>Ae(t)?Fe.test(t.split("/*")[0].trim()):!1,Fe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Kt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Gt={...Kt,transform:t=>U(0,1,t)},q=t=>Math.round(t*1e5)/1e5,Lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Se(t){return t==null}const we=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mt=(t,e)=>n=>!!(typeof n=="string"&&we.test(n)&&n.startsWith(t)||e&&!Se(n)&&Object.prototype.hasOwnProperty.call(n,e)),qt=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Lt);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ke=t=>U(0,255,t),nt={...Kt,transform:t=>Math.round(ke(t))},O={test:mt("rgb","red"),parse:qt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+q(Gt.transform(r))+")"};function Ce(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const at={test:mt("#"),parse:Ce,transform:O.transform},Ve=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),vt=Ve("%"),G={test:mt("hsl","hue"),parse:qt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+vt.transform(q(e))+", "+vt.transform(q(n))+", "+q(Gt.transform(r))+")"},I={test:t=>O.test(t)||at.test(t)||G.test(t),parse:t=>O.test(t)?O.parse(t):G.test(t)?G.parse(t):at.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?O.transform(t):G.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},Ie=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ee(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Lt))==null?void 0:e.length)||0)+(((n=t.match(Ie))==null?void 0:n.length)||0)>0}const Wt="number",Bt="color",Re="var",Pe="var(",xt="${}",Ne=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function _(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(Ne,u=>(I.test(u)?(r.color.push(i),s.push(Bt),n.push(I.parse(u))):u.startsWith(Pe)?(r.var.push(i),s.push(Re),n.push(u)):(r.number.push(i),s.push(Wt),n.push(parseFloat(u))),++i,xt)).split(xt);return{values:n,split:a,indexes:r,types:s}}function Oe(t){return _(t).values}function _t({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;itypeof t=="number"?0:I.test(t)?I.getAnimatableNone(t):t,Ge=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ke(t);function Le(t){const e=_(t);return _t(e)(e.values.map((r,s)=>Ge(r,e.split[s])))}const qe={test:Ee,parse:Oe,createTransformer:Ue,getAnimatableNone:Le};function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function We({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;s=st(u,a,t+1/3),i=st(u,a,t),o=st(u,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function H(t,e){return n=>n>0?e:t}const et=(t,e,n)=>t+(e-t)*n,rt=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Be=[at,O,G],_e=t=>Be.find(e=>e.test(t));function Mt(t){const e=_e(t);if(!e)return!1;let n=e.parse(t);return e===G&&(n=We(n)),n}const At=(t,e)=>{const n=Mt(t),r=Mt(e);if(!n||!r)return H(t,e);const s={...n};return i=>(s.red=rt(n.red,r.red,i),s.green=rt(n.green,r.green,i),s.blue=rt(n.blue,r.blue,i),s.alpha=et(n.alpha,r.alpha,i),O.transform(s))},ct=new Set(["none","hidden"]);function je(t,e){return ct.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function $e(t,e){return n=>et(t,e,n)}function gt(t){return typeof t=="number"?$e:typeof t=="string"?De(t)?H:I.test(t)?At:Je:Array.isArray(t)?jt:typeof t=="object"?I.test(t)?At:ze:H}function jt(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>gt(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)n[i]=r[i](s);return n}}function Ze(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=qe.createTransformer(e),r=_(t),s=_(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ct.has(t)&&!s.values.length||ct.has(e)&&!r.values.length?je(t,e):ht(jt(Ze(r,s),s.values),n):H(t,e)};function $t(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?et(t,e,n):gt(t)(t,e)}const He=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>tt.update(e,n),stop:()=>Ut(e),now:()=>J.isProcessing?J.timestamp:V.now()}},Xe=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i=X?1/0:e}function Qe(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(yt(r),X);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:P(s)}}const A={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ut(t,e){return t*Math.sqrt(1-e*e)}const Ye=12;function tn(t,e,n){let r=n;for(let s=1;s{const c=l*o,f=c*t,d=c-n,M=ut(l,o),x=Math.exp(-f);return it-d/M*x},i=l=>{const f=l*o*t,d=f*n+n,M=Math.pow(o,2)*Math.pow(l,2)*t,x=Math.exp(-f),m=ut(Math.pow(l,2),o);return(-s(l)+it>0?-1:1)*((d-M)*x)/m}):(s=l=>{const c=Math.exp(-l*t),f=(l-n)*t+1;return-it+c*f},i=l=>{const c=Math.exp(-l*t),f=(n-l)*(t*t);return c*f});const a=5/t,u=tn(s,i,a);if(t=L(t),isNaN(u))return{stiffness:A.stiffness,damping:A.damping,duration:t};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const nn=["duration","bounce"],sn=["stiffness","damping","mass"];function Dt(t,e){return e.some(n=>t[n]!==void 0)}function rn(t){let e={velocity:A.velocity,stiffness:A.stiffness,damping:A.damping,mass:A.mass,isResolvedFromDuration:!1,...t};if(!Dt(t,sn)&&Dt(t,nn))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*U(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:A.mass,stiffness:s,damping:i}}else{const n=en({...t,velocity:0});e={...e,...n,mass:A.mass},e.isResolvedFromDuration=!0}return e}function Q(t=A.visualDuration,e=A.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:f,velocity:d,isResolvedFromDuration:M}=rn({...n,velocity:-P(n.velocity||0)}),x=d||0,m=l/(2*Math.sqrt(u*c)),v=o-i,p=P(Math.sqrt(u/c)),w=Math.abs(v)<5;r||(r=w?A.restSpeed.granular:A.restSpeed.default),s||(s=w?A.restDelta.granular:A.restDelta.default);let T,g,y,D,C,b;if(m<1)y=ut(p,m),D=(x+m*p*v)/y,T=h=>{const F=Math.exp(-m*p*h);return o-F*(D*Math.sin(y*h)+v*Math.cos(y*h))},C=m*p*D+v*y,b=m*p*v-D*y,g=h=>Math.exp(-m*p*h)*(C*Math.sin(y*h)+b*Math.cos(y*h));else if(m===1){T=F=>o-Math.exp(-p*F)*(v+(x+p*v)*F);const h=x+p*v;g=F=>Math.exp(-p*F)*(p*h*F-x)}else{const h=p*Math.sqrt(m*m-1);T=R=>{const K=Math.exp(-m*p*R),N=Math.min(h*R,300);return o-K*((x+m*p*v)*Math.sinh(N)+h*v*Math.cosh(N))/h};const F=(x+m*p*v)/h,E=m*p*F-v*h,$=m*p*v-F*h;g=R=>{const K=Math.exp(-m*p*R),N=Math.min(h*R,300);return K*(E*Math.sinh(N)+$*Math.cosh(N))}}const k={calculatedDuration:M&&f||null,velocity:h=>L(g(h)),next:h=>{if(!M&&m<1){const E=Math.exp(-m*p*h),$=Math.sin(y*h),R=Math.cos(y*h),K=o-E*(D*$+v*R),N=L(E*(C*$+b*R));return a.done=Math.abs(N)<=r&&Math.abs(o-K)<=s,a.value=a.done?o:K,a}const F=T(h);if(M)a.done=h>=f;else{const E=L(g(h));a.done=Math.abs(E)<=r&&Math.abs(o-F)<=s}return a.value=a.done?o:F,a},toString:()=>{const h=Math.min(yt(k),X),F=Xe(E=>k.next(h*E).value,h,30);return h+"ms "+F},toTransition:()=>{}};return k}Q.applyToOptions=t=>{const e=Qe(t,100,Q);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};const on=5;function zt(t,e,n){const r=Math.max(e-on,0);return It(n-t(r),e-r)}function lt({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},M=b=>a!==void 0&&bu,x=b=>a===void 0?u:u===void 0||Math.abs(a-b)-m*Math.exp(-b/r),T=b=>p+w(b),g=b=>{const k=w(b),h=T(b);d.done=Math.abs(k)<=l,d.value=d.done?p:h};let y,D;const C=b=>{M(d.value)&&(y=b,D=Q({keyframes:[d.value,x(d.value)],velocity:zt(T,b,d.value),damping:s,stiffness:i,restDelta:l,restSpeed:c}))};return C(0),{calculatedDuration:null,next:b=>{let k=!1;return!D&&y===void 0&&(k=!0,g(b),C(b)),y!==void 0&&b>=y?D.next(b-y):(!k&&g(b),d)}}}function an(t,e,n){const r=[],s=n||ft.mix||$t,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=an(e,r,s),u=a.length,l=c=>{if(o&&c1)for(;fl(U(t[0],t[i-1],c)):l}function cn(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Vt(0,e,r);t.push(et(n,1,s))}}function un(t){const e=[0];return cn(e,t.length-1),e}function ln(t,e){return t.map(n=>n*e)}function fn(t,e){return t.map(()=>e||Ot).splice(0,t.length-1)}function W({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=pe(r)?r.map(Tt):Tt(r),i={done:!1,value:e[0]},o=ln(n&&n.length===e.length?n:un(e),t),a=Zt(o,e,{ease:Array.isArray(s)?s:fn(e,s)});return{calculatedDuration:t,next:u=>(i.value=a(u),i.done=u>=t,i)}}const hn=t=>t!==null;function dn(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(hn),a=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const pn={decay:lt,inertia:lt,tween:W,keyframes:W,spring:Q};function mn(t){typeof t.type=="string"&&(t.type=pn[t.type])}class gn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const yn=t=>t/100;class bn extends gn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==V.now()&&this.tick(V.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;mn(e);const{type:n=W,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const u=n||W;u!==W&&typeof a[0]!="number"&&(this.mixKeyframes=ht(yn,$t(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=yt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:c,repeat:f,repeatType:d,repeatDelay:M,type:x,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?p<0:p>s;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,g=r;if(f){const b=Math.min(this.currentTime,s)/a;let k=Math.floor(b),h=b%1;!h&&b>=1&&(h=1),h===1&&k--,k=Math.min(k,f+1),!!(k%2)&&(d==="reverse"?(h=1-h,M&&(h-=M/a)):d==="mirror"&&(g=o)),T=U(0,1,h)*a}let y;w?(this.delayState.value=c[0],y=this.delayState):y=g.next(T),i&&!w&&(y.value=i(y.value));let{done:D}=y;!w&&u!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return C&&x!==lt&&(y.value=dn(c,this.options,v,this.speed)),m&&m(y.value),C&&this.finish(),y}then(e,n){return this.finished.then(e,n)}get duration(){return P(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+P(e)}get time(){return P(this.currentTime)}set time(e){e=L(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return zt(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(V.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=P(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=He,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(V.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}const Ft=30,Tn=t=>!isNaN(parseFloat(t)),B={current:void 0};class vn{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=V.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=V.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Tn(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new re);const r=this.events[e].add(n);return e==="change"?()=>{r(),tt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return B.current&&B.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=V.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ft)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ft);return It(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xn(t,e){return new vn(t,e)}const Jt=t=>!!(t&&t.getVelocity);function Mn(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}function An(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],s=t[1+n],i=t[2+n],o=t[3+n],a=Zt(s,i,o);return e?a(r):a}function Dn(t,e,n={}){const r=t.get();let s=null,i=r,o;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{s&&(s.stop(),s=null),t.animation=void 0},l=()=>{const f=St(t.get()),d=St(i);if(f===d){u();return}const M=s?s.getGeneratorVelocity():t.getVelocity();u(),s=new bn({keyframes:[f,d],velocity:M,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},c=()=>{var f;l(),t.animation=s??void 0,(f=t.events.animationStart)==null||f.notify(),s==null||s.then(()=>{var d;t.animation=void 0,(d=t.events.animationComplete)==null||d.notify()})};if(t.attach((f,d)=>{i=f,o=M=>d(ot(M,a)),tt.postRender(c)},u),Jt(e)){let f=n.skipInitialAnimation===!0;const d=e.on("change",x=>{f?(f=!1,t.jump(ot(x,a),!1)):t.set(ot(x,a))}),M=t.on("destroy",d);return()=>{d(),M()}}return u}function ot(t,e){return e?t+e:t}function St(t){return typeof t=="number"?t:parseFloat(t)}const Ht=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function bt(t){const e=kt(()=>xn(t)),{isStatic:n}=S.useContext(Ht);if(n){const[,r]=S.useState(t);S.useEffect(()=>e.on("change",r),[])}return e}function Xt(t,e){const n=bt(e()),r=()=>n.set(e());return r(),te(()=>{const s=()=>tt.preRender(r,!1,!0),i=t.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),Ut(r)}}),n}function Fn(t){B.current=[],t();const e=Xt(B.current,t);return B.current=void 0,e}function Sn(t,e,n,r){if(typeof t=="function")return Fn(t);const i=An(e,n,r),o=Array.isArray(t)?wt(t,i):wt([t],([u])=>i(u)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function wt(t,e){const n=kt(()=>[]);return Xt(t,()=>{n.length=0;const r=t.length;for(let s=0;sJt(t)?t.get():t;if(n)return Sn(r);const s=bt(r());return S.useInsertionEffect(()=>Dn(s,t,e),[s,JSON.stringify(e)]),s}function kn(t,e={}){return wn(t,{type:"spring",...e})}const Cn={some:0,all:1};function Vn(t,e,{root:n,margin:r,amount:s="some"}={}){const i=Mn(t),o=new WeakMap,a=l=>{l.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):u.unobserve(c.target)}else typeof f=="function"&&(f(c),o.delete(c.target))})},u=new IntersectionObserver(a,{root:n,rootMargin:r,threshold:typeof s=="number"?s:Cn[s]});return i.forEach(l=>u.observe(l)),()=>u.disconnect()}function In(t,{root:e,margin:n,amount:r,once:s=!1,initial:i=!1}={}){const[o,a]=S.useState(i);return S.useEffect(()=>{if(!t.current||s&&o)return;const u=()=>(a(!0),s?void 0:()=>a(!1)),l={root:e&&e.current||void 0,margin:n,amount:r};return Vn(t.current,u,l)},[e,t,n,s,r]),o}function Rn({to:t,from:e=0,direction:n="up",delay:r=0,duration:s=2,className:i="",startWhen:o=!0,separator:a="",onStart:u,onEnd:l}){const c=S.useRef(null),f=bt(n==="down"?t:e),d=20+40*(1/s),M=100*(1/s),x=kn(f,{damping:d,stiffness:M}),m=In(c,{once:!0,margin:"0px"}),v=T=>{const g=T.toString();if(g.includes(".")){const y=g.split(".")[1];if(parseInt(y)!==0)return y.length}return 0},p=Math.max(v(e),v(t)),w=S.useCallback(T=>{const g=p>0,y={useGrouping:!!a,minimumFractionDigits:g?p:0,maximumFractionDigits:g?p:0},D=Intl.NumberFormat("en-US",y).format(T);return a?D.replace(/,/g,a):D},[p,a]);return S.useEffect(()=>{c.current&&(c.current.textContent=w(n==="down"?t:e))},[e,t,n,w]),S.useEffect(()=>{if(m&&o){typeof u=="function"&&u();const T=setTimeout(()=>{f.set(n==="down"?e:t)},r*1e3),g=setTimeout(()=>{typeof l=="function"&&l()},r*1e3+s*1e3);return()=>{clearTimeout(T),clearTimeout(g)}}},[m,o,f,n,e,t,r,u,l,s]),S.useEffect(()=>{const T=x.on("change",g=>{c.current&&(c.current.textContent=w(g))});return()=>T()},[x,w]),Qt.jsx("span",{className:i,ref:c})}export{Rn as C}; +import{r as S,j as Qt}from"./index-DOUW22cV.js";function kt(t){const e=S.useRef(null);return e.current===null&&(e.current=t()),e.current}const Yt=typeof window<"u",te=Yt?S.useLayoutEffect:S.useEffect;function ee(t,e){t.indexOf(e)===-1&&t.push(e)}function ne(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const U=(t,e,n)=>n>e?e:n{};const ft={},Y=t=>t,se=(t,e)=>n=>e(t(n)),ht=(...t)=>t.reduce(se),Vt=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class re{constructor(){this.subscriptions=[]}add(e){return ee(this.subscriptions,e),()=>ne(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;it*1e3,P=t=>t/1e3;function It(t,e){return e?t*(1e3/e):0}const Et=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ie=1e-7,oe=12;function ae(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=Et(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>ie&&++aae(i,0,1,t,n);return i=>i===0||i===1?i:Et(s(i),e,r)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pt=t=>e=>1-t(1-e),Nt=j(.33,1.53,.69,.99),dt=Pt(Nt),ce=Rt(dt),ue=t=>t>=1?1:(t*=2)<1?.5*dt(t):.5*(2-Math.pow(2,-10*(t-1))),pt=t=>1-Math.sin(Math.acos(t)),le=Pt(pt),fe=Rt(pt),he=j(.42,0,1,1),de=j(0,0,.58,1),Ot=j(.42,0,.58,1),pe=t=>Array.isArray(t)&&typeof t[0]!="number",me=t=>Array.isArray(t)&&typeof t[0]=="number",ge={linear:Y,easeIn:he,easeInOut:Ot,easeOut:de,circIn:pt,circInOut:fe,circOut:le,backIn:dt,backInOut:ce,backOut:Nt,anticipate:ue},ye=t=>typeof t=="string",Tt=t=>{if(me(t)){Ct(t.length===4);const[e,n,r,s]=t;return j(e,n,r,s)}else if(ye(t))return ge[t];return t},z=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function be(t,e){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(c){o.has(c)&&(l.schedule(c),t()),c(a)}const l={schedule:(c,f=!1,d=!1)=>{const x=d&&s?n:r;return f&&o.add(c),x.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(u),n.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const Te=40;function ve(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=z.reduce((T,g)=>(T[g]=be(i),T),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:f,preRender:d,render:M,postRender:x}=o,m=()=>{const T=ft.useManualTiming,g=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(g-s.timestamp,Te),1)),s.timestamp=g,s.isProcessing=!0,a.process(s),u.process(s),l.process(s),c.process(s),f.process(s),d.process(s),M.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(m))},v=()=>{n=!0,r=!0,s.isProcessing||t(m)};return{schedule:z.reduce((T,g)=>{const y=o[g];return T[g]=(D,C=!1,b=!1)=>(n||v(),y.schedule(D,C,b)),T},{}),cancel:T=>{for(let g=0;g(Z===void 0&&V.set(J.isProcessing||ft.useManualTiming?J.timestamp:performance.now()),Z),set:t=>{Z=t,queueMicrotask(xe)}},Me=t=>e=>typeof e=="string"&&e.startsWith(t),Ae=Me("var(--"),De=t=>Ae(t)?Fe.test(t.split("/*")[0].trim()):!1,Fe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Kt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Gt={...Kt,transform:t=>U(0,1,t)},q=t=>Math.round(t*1e5)/1e5,Lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Se(t){return t==null}const we=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mt=(t,e)=>n=>!!(typeof n=="string"&&we.test(n)&&n.startsWith(t)||e&&!Se(n)&&Object.prototype.hasOwnProperty.call(n,e)),qt=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Lt);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ke=t=>U(0,255,t),nt={...Kt,transform:t=>Math.round(ke(t))},O={test:mt("rgb","red"),parse:qt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+q(Gt.transform(r))+")"};function Ce(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const at={test:mt("#"),parse:Ce,transform:O.transform},Ve=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),vt=Ve("%"),G={test:mt("hsl","hue"),parse:qt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+vt.transform(q(e))+", "+vt.transform(q(n))+", "+q(Gt.transform(r))+")"},I={test:t=>O.test(t)||at.test(t)||G.test(t),parse:t=>O.test(t)?O.parse(t):G.test(t)?G.parse(t):at.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?O.transform(t):G.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},Ie=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ee(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Lt))==null?void 0:e.length)||0)+(((n=t.match(Ie))==null?void 0:n.length)||0)>0}const Wt="number",Bt="color",Re="var",Pe="var(",xt="${}",Ne=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function _(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(Ne,u=>(I.test(u)?(r.color.push(i),s.push(Bt),n.push(I.parse(u))):u.startsWith(Pe)?(r.var.push(i),s.push(Re),n.push(u)):(r.number.push(i),s.push(Wt),n.push(parseFloat(u))),++i,xt)).split(xt);return{values:n,split:a,indexes:r,types:s}}function Oe(t){return _(t).values}function _t({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;itypeof t=="number"?0:I.test(t)?I.getAnimatableNone(t):t,Ge=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ke(t);function Le(t){const e=_(t);return _t(e)(e.values.map((r,s)=>Ge(r,e.split[s])))}const qe={test:Ee,parse:Oe,createTransformer:Ue,getAnimatableNone:Le};function st(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function We({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;s=st(u,a,t+1/3),i=st(u,a,t),o=st(u,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function H(t,e){return n=>n>0?e:t}const et=(t,e,n)=>t+(e-t)*n,rt=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},Be=[at,O,G],_e=t=>Be.find(e=>e.test(t));function Mt(t){const e=_e(t);if(!e)return!1;let n=e.parse(t);return e===G&&(n=We(n)),n}const At=(t,e)=>{const n=Mt(t),r=Mt(e);if(!n||!r)return H(t,e);const s={...n};return i=>(s.red=rt(n.red,r.red,i),s.green=rt(n.green,r.green,i),s.blue=rt(n.blue,r.blue,i),s.alpha=et(n.alpha,r.alpha,i),O.transform(s))},ct=new Set(["none","hidden"]);function je(t,e){return ct.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function $e(t,e){return n=>et(t,e,n)}function gt(t){return typeof t=="number"?$e:typeof t=="string"?De(t)?H:I.test(t)?At:Je:Array.isArray(t)?jt:typeof t=="object"?I.test(t)?At:ze:H}function jt(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>gt(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)n[i]=r[i](s);return n}}function Ze(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=qe.createTransformer(e),r=_(t),s=_(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ct.has(t)&&!s.values.length||ct.has(e)&&!r.values.length?je(t,e):ht(jt(Ze(r,s),s.values),n):H(t,e)};function $t(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?et(t,e,n):gt(t)(t,e)}const He=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>tt.update(e,n),stop:()=>Ut(e),now:()=>J.isProcessing?J.timestamp:V.now()}},Xe=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i=X?1/0:e}function Qe(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(yt(r),X);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:P(s)}}const A={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ut(t,e){return t*Math.sqrt(1-e*e)}const Ye=12;function tn(t,e,n){let r=n;for(let s=1;s{const c=l*o,f=c*t,d=c-n,M=ut(l,o),x=Math.exp(-f);return it-d/M*x},i=l=>{const f=l*o*t,d=f*n+n,M=Math.pow(o,2)*Math.pow(l,2)*t,x=Math.exp(-f),m=ut(Math.pow(l,2),o);return(-s(l)+it>0?-1:1)*((d-M)*x)/m}):(s=l=>{const c=Math.exp(-l*t),f=(l-n)*t+1;return-it+c*f},i=l=>{const c=Math.exp(-l*t),f=(n-l)*(t*t);return c*f});const a=5/t,u=tn(s,i,a);if(t=L(t),isNaN(u))return{stiffness:A.stiffness,damping:A.damping,duration:t};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const nn=["duration","bounce"],sn=["stiffness","damping","mass"];function Dt(t,e){return e.some(n=>t[n]!==void 0)}function rn(t){let e={velocity:A.velocity,stiffness:A.stiffness,damping:A.damping,mass:A.mass,isResolvedFromDuration:!1,...t};if(!Dt(t,sn)&&Dt(t,nn))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*U(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:A.mass,stiffness:s,damping:i}}else{const n=en({...t,velocity:0});e={...e,...n,mass:A.mass},e.isResolvedFromDuration=!0}return e}function Q(t=A.visualDuration,e=A.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:f,velocity:d,isResolvedFromDuration:M}=rn({...n,velocity:-P(n.velocity||0)}),x=d||0,m=l/(2*Math.sqrt(u*c)),v=o-i,p=P(Math.sqrt(u/c)),w=Math.abs(v)<5;r||(r=w?A.restSpeed.granular:A.restSpeed.default),s||(s=w?A.restDelta.granular:A.restDelta.default);let T,g,y,D,C,b;if(m<1)y=ut(p,m),D=(x+m*p*v)/y,T=h=>{const F=Math.exp(-m*p*h);return o-F*(D*Math.sin(y*h)+v*Math.cos(y*h))},C=m*p*D+v*y,b=m*p*v-D*y,g=h=>Math.exp(-m*p*h)*(C*Math.sin(y*h)+b*Math.cos(y*h));else if(m===1){T=F=>o-Math.exp(-p*F)*(v+(x+p*v)*F);const h=x+p*v;g=F=>Math.exp(-p*F)*(p*h*F-x)}else{const h=p*Math.sqrt(m*m-1);T=R=>{const K=Math.exp(-m*p*R),N=Math.min(h*R,300);return o-K*((x+m*p*v)*Math.sinh(N)+h*v*Math.cosh(N))/h};const F=(x+m*p*v)/h,E=m*p*F-v*h,$=m*p*v-F*h;g=R=>{const K=Math.exp(-m*p*R),N=Math.min(h*R,300);return K*(E*Math.sinh(N)+$*Math.cosh(N))}}const k={calculatedDuration:M&&f||null,velocity:h=>L(g(h)),next:h=>{if(!M&&m<1){const E=Math.exp(-m*p*h),$=Math.sin(y*h),R=Math.cos(y*h),K=o-E*(D*$+v*R),N=L(E*(C*$+b*R));return a.done=Math.abs(N)<=r&&Math.abs(o-K)<=s,a.value=a.done?o:K,a}const F=T(h);if(M)a.done=h>=f;else{const E=L(g(h));a.done=Math.abs(E)<=r&&Math.abs(o-F)<=s}return a.value=a.done?o:F,a},toString:()=>{const h=Math.min(yt(k),X),F=Xe(E=>k.next(h*E).value,h,30);return h+"ms "+F},toTransition:()=>{}};return k}Q.applyToOptions=t=>{const e=Qe(t,100,Q);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};const on=5;function zt(t,e,n){const r=Math.max(e-on,0);return It(n-t(r),e-r)}function lt({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},M=b=>a!==void 0&&bu,x=b=>a===void 0?u:u===void 0||Math.abs(a-b)-m*Math.exp(-b/r),T=b=>p+w(b),g=b=>{const k=w(b),h=T(b);d.done=Math.abs(k)<=l,d.value=d.done?p:h};let y,D;const C=b=>{M(d.value)&&(y=b,D=Q({keyframes:[d.value,x(d.value)],velocity:zt(T,b,d.value),damping:s,stiffness:i,restDelta:l,restSpeed:c}))};return C(0),{calculatedDuration:null,next:b=>{let k=!1;return!D&&y===void 0&&(k=!0,g(b),C(b)),y!==void 0&&b>=y?D.next(b-y):(!k&&g(b),d)}}}function an(t,e,n){const r=[],s=n||ft.mix||$t,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=an(e,r,s),u=a.length,l=c=>{if(o&&c1)for(;fl(U(t[0],t[i-1],c)):l}function cn(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Vt(0,e,r);t.push(et(n,1,s))}}function un(t){const e=[0];return cn(e,t.length-1),e}function ln(t,e){return t.map(n=>n*e)}function fn(t,e){return t.map(()=>e||Ot).splice(0,t.length-1)}function W({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=pe(r)?r.map(Tt):Tt(r),i={done:!1,value:e[0]},o=ln(n&&n.length===e.length?n:un(e),t),a=Zt(o,e,{ease:Array.isArray(s)?s:fn(e,s)});return{calculatedDuration:t,next:u=>(i.value=a(u),i.done=u>=t,i)}}const hn=t=>t!==null;function dn(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(hn),a=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const pn={decay:lt,inertia:lt,tween:W,keyframes:W,spring:Q};function mn(t){typeof t.type=="string"&&(t.type=pn[t.type])}class gn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const yn=t=>t/100;class bn extends gn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==V.now()&&this.tick(V.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;mn(e);const{type:n=W,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const u=n||W;u!==W&&typeof a[0]!="number"&&(this.mixKeyframes=ht(yn,$t(a[0],a[1])),a=[0,100]);const l=u({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=yt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:c,repeat:f,repeatType:d,repeatDelay:M,type:x,onUpdate:m,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?p<0:p>s;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,g=r;if(f){const b=Math.min(this.currentTime,s)/a;let k=Math.floor(b),h=b%1;!h&&b>=1&&(h=1),h===1&&k--,k=Math.min(k,f+1),!!(k%2)&&(d==="reverse"?(h=1-h,M&&(h-=M/a)):d==="mirror"&&(g=o)),T=U(0,1,h)*a}let y;w?(this.delayState.value=c[0],y=this.delayState):y=g.next(T),i&&!w&&(y.value=i(y.value));let{done:D}=y;!w&&u!==null&&(D=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return C&&x!==lt&&(y.value=dn(c,this.options,v,this.speed)),m&&m(y.value),C&&this.finish(),y}then(e,n){return this.finished.then(e,n)}get duration(){return P(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+P(e)}get time(){return P(this.currentTime)}set time(e){e=L(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return zt(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(V.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=P(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=He,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(V.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}const Ft=30,Tn=t=>!isNaN(parseFloat(t)),B={current:void 0};class vn{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=V.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=V.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Tn(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new re);const r=this.events[e].add(n);return e==="change"?()=>{r(),tt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return B.current&&B.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=V.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ft)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ft);return It(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xn(t,e){return new vn(t,e)}const Jt=t=>!!(t&&t.getVelocity);function Mn(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}function An(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],s=t[1+n],i=t[2+n],o=t[3+n],a=Zt(s,i,o);return e?a(r):a}function Dn(t,e,n={}){const r=t.get();let s=null,i=r,o;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{s&&(s.stop(),s=null),t.animation=void 0},l=()=>{const f=St(t.get()),d=St(i);if(f===d){u();return}const M=s?s.getGeneratorVelocity():t.getVelocity();u(),s=new bn({keyframes:[f,d],velocity:M,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},c=()=>{var f;l(),t.animation=s??void 0,(f=t.events.animationStart)==null||f.notify(),s==null||s.then(()=>{var d;t.animation=void 0,(d=t.events.animationComplete)==null||d.notify()})};if(t.attach((f,d)=>{i=f,o=M=>d(ot(M,a)),tt.postRender(c)},u),Jt(e)){let f=n.skipInitialAnimation===!0;const d=e.on("change",x=>{f?(f=!1,t.jump(ot(x,a),!1)):t.set(ot(x,a))}),M=t.on("destroy",d);return()=>{d(),M()}}return u}function ot(t,e){return e?t+e:t}function St(t){return typeof t=="number"?t:parseFloat(t)}const Ht=S.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function bt(t){const e=kt(()=>xn(t)),{isStatic:n}=S.useContext(Ht);if(n){const[,r]=S.useState(t);S.useEffect(()=>e.on("change",r),[])}return e}function Xt(t,e){const n=bt(e()),r=()=>n.set(e());return r(),te(()=>{const s=()=>tt.preRender(r,!1,!0),i=t.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),Ut(r)}}),n}function Fn(t){B.current=[],t();const e=Xt(B.current,t);return B.current=void 0,e}function Sn(t,e,n,r){if(typeof t=="function")return Fn(t);const i=An(e,n,r),o=Array.isArray(t)?wt(t,i):wt([t],([u])=>i(u)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function wt(t,e){const n=kt(()=>[]);return Xt(t,()=>{n.length=0;const r=t.length;for(let s=0;sJt(t)?t.get():t;if(n)return Sn(r);const s=bt(r());return S.useInsertionEffect(()=>Dn(s,t,e),[s,JSON.stringify(e)]),s}function kn(t,e={}){return wn(t,{type:"spring",...e})}const Cn={some:0,all:1};function Vn(t,e,{root:n,margin:r,amount:s="some"}={}){const i=Mn(t),o=new WeakMap,a=l=>{l.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):u.unobserve(c.target)}else typeof f=="function"&&(f(c),o.delete(c.target))})},u=new IntersectionObserver(a,{root:n,rootMargin:r,threshold:typeof s=="number"?s:Cn[s]});return i.forEach(l=>u.observe(l)),()=>u.disconnect()}function In(t,{root:e,margin:n,amount:r,once:s=!1,initial:i=!1}={}){const[o,a]=S.useState(i);return S.useEffect(()=>{if(!t.current||s&&o)return;const u=()=>(a(!0),s?void 0:()=>a(!1)),l={root:e&&e.current||void 0,margin:n,amount:r};return Vn(t.current,u,l)},[e,t,n,s,r]),o}function Rn({to:t,from:e=0,direction:n="up",delay:r=0,duration:s=2,className:i="",startWhen:o=!0,separator:a="",onStart:u,onEnd:l}){const c=S.useRef(null),f=bt(n==="down"?t:e),d=20+40*(1/s),M=100*(1/s),x=kn(f,{damping:d,stiffness:M}),m=In(c,{once:!0,margin:"0px"}),v=T=>{const g=T.toString();if(g.includes(".")){const y=g.split(".")[1];if(parseInt(y)!==0)return y.length}return 0},p=Math.max(v(e),v(t)),w=S.useCallback(T=>{const g=p>0,y={useGrouping:!!a,minimumFractionDigits:g?p:0,maximumFractionDigits:g?p:0},D=Intl.NumberFormat("en-US",y).format(T);return a?D.replace(/,/g,a):D},[p,a]);return S.useEffect(()=>{c.current&&(c.current.textContent=w(n==="down"?t:e))},[e,t,n,w]),S.useEffect(()=>{if(m&&o){typeof u=="function"&&u();const T=setTimeout(()=>{f.set(n==="down"?e:t)},r*1e3),g=setTimeout(()=>{typeof l=="function"&&l()},r*1e3+s*1e3);return()=>{clearTimeout(T),clearTimeout(g)}}},[m,o,f,n,e,t,r,u,l,s]),S.useEffect(()=>{const T=x.on("change",g=>{c.current&&(c.current.textContent=w(g))});return()=>T()},[x,w]),Qt.jsx("span",{className:i,ref:c})}export{Rn as C}; diff --git a/dist/assets/Dashboard-CMrh_5yV.js b/dist/assets/Dashboard-6T-v2duE.js similarity index 97% rename from dist/assets/Dashboard-CMrh_5yV.js rename to dist/assets/Dashboard-6T-v2duE.js index 24f0be6..02349aa 100644 --- a/dist/assets/Dashboard-CMrh_5yV.js +++ b/dist/assets/Dashboard-6T-v2duE.js @@ -1 +1 @@ -import{u as k,d as w,r,j as e,Q as b,L as d,g as U,e as C,z as S}from"./index-ZavRXCeN.js";import{C as n}from"./CountUp-2H8PJb3I.js";import{u as L}from"./useTranslation-KkRwPkkT.js";function E(){const{t:s}=L(),{user:a,refreshUser:j}=k(),{symbol:c,rate:i}=w(),[t,N]=r.useState(null),[l,x]=r.useState(""),[m,p]=r.useState(!1),h=async()=>{try{const o=await U();o.data.success&&N(o.data.data)}catch{}};r.useEffect(()=>{h()},[]);const f=async o=>{if(o.preventDefault(),!!l.trim()){p(!0);try{(await C(l.trim())).data.success&&(S.success(s("dashboard.redeemSuccess")),x(""),await Promise.all([h(),j()]))}catch{}p(!1)}},g=(t==null?void 0:t.quota)??(a==null?void 0:a.quota)??0,u=(t==null?void 0:t.used_quota)??(a==null?void 0:a.used_quota)??0,v=(t==null?void 0:t.request_count)??(a==null?void 0:a.request_count)??0,y=g/b*i;return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:[s("dashboard.welcome")," ",(a==null?void 0:a.display_name)||(a==null?void 0:a.username)||"User"]}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("dashboard.manageDesc")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[c,e.jsx(n,{from:0,to:Math.round(y*100)/100,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:g.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[c,e.jsx(n,{from:0,to:Math.round(u/b*i*100)/100,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:u.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-page",children:e.jsx(n,{from:0,to:v,duration:1.5})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("dashboard.redeemCode")}),e.jsxs("form",{onSubmit:f,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:l,onChange:o=>x(o.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:m,className:"btn-primary whitespace-nowrap",children:s(m?"dashboard.redeeming":"dashboard.redeem")})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("dashboard.quickLinks")}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(d,{to:"/tokens",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.apiKeys")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.manageKeys")})]}),e.jsxs(d,{to:"/packages",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.packages")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.viewPlans")})]}),e.jsxs(d,{to:"/pricing",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.pricing")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.modelPrices")})]}),e.jsxs(d,{to:"/logs",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.logs")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.viewLogs")})]})]})]})]})]})}export{E as default}; +import{u as k,d as w,r,j as e,Q as b,L as d,g as U,e as C,z as S}from"./index-DOUW22cV.js";import{C as n}from"./CountUp-Ytak2XTa.js";import{u as L}from"./useTranslation-Ce9HcVki.js";function E(){const{t:s}=L(),{user:a,refreshUser:j}=k(),{symbol:c,rate:i}=w(),[t,N]=r.useState(null),[l,x]=r.useState(""),[m,p]=r.useState(!1),h=async()=>{try{const o=await U();o.data.success&&N(o.data.data)}catch{}};r.useEffect(()=>{h()},[]);const f=async o=>{if(o.preventDefault(),!!l.trim()){p(!0);try{(await C(l.trim())).data.success&&(S.success(s("dashboard.redeemSuccess")),x(""),await Promise.all([h(),j()]))}catch{}p(!1)}},g=(t==null?void 0:t.quota)??(a==null?void 0:a.quota)??0,u=(t==null?void 0:t.used_quota)??(a==null?void 0:a.used_quota)??0,v=(t==null?void 0:t.request_count)??(a==null?void 0:a.request_count)??0,y=g/b*i;return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:[s("dashboard.welcome")," ",(a==null?void 0:a.display_name)||(a==null?void 0:a.username)||"User"]}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("dashboard.manageDesc")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[c,e.jsx(n,{from:0,to:Math.round(y*100)/100,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:g.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[c,e.jsx(n,{from:0,to:Math.round(u/b*i*100)/100,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:u.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-page",children:e.jsx(n,{from:0,to:v,duration:1.5})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("dashboard.redeemCode")}),e.jsxs("form",{onSubmit:f,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:l,onChange:o=>x(o.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:m,className:"btn-primary whitespace-nowrap",children:s(m?"dashboard.redeeming":"dashboard.redeem")})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("dashboard.quickLinks")}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(d,{to:"/tokens",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.apiKeys")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.manageKeys")})]}),e.jsxs(d,{to:"/packages",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.packages")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.viewPlans")})]}),e.jsxs(d,{to:"/pricing",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.pricing")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.modelPrices")})]}),e.jsxs(d,{to:"/logs",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-page-surface-hover transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-page group-hover:text-page-link transition-colors",children:s("dashboard.logs")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.viewLogs")})]})]})]})]})]})}export{E as default}; diff --git a/dist/assets/FadeContent-DnAL-lQG.js b/dist/assets/FadeContent-DN0-6f2h.js similarity index 91% rename from dist/assets/FadeContent-DnAL-lQG.js rename to dist/assets/FadeContent-DN0-6f2h.js index 7a69a30..dbb2c2a 100644 --- a/dist/assets/FadeContent-DnAL-lQG.js +++ b/dist/assets/FadeContent-DN0-6f2h.js @@ -1 +1 @@ -import{r as n,j as b}from"./index-ZavRXCeN.js";const $=({children:c,blur:f=!1,duration:e=800,delay:t=0,threshold:o=.1,initialOpacity:l=0,className:u="",...m})=>{const i=n.useRef(null),[s,p]=n.useState(!1);return n.useEffect(()=>{const a=i.current;if(!a)return;const r=new IntersectionObserver(([x])=>{x.isIntersecting&&(p(!0),r.disconnect())},{threshold:o});return r.observe(a),()=>r.disconnect()},[o]),b.jsx("div",{ref:i,className:u,style:{opacity:s?1:l,filter:f?s?"blur(0px)":"blur(10px)":void 0,transform:s?"translateY(0)":"translateY(20px)",transition:`opacity ${e}ms ease-out ${t}ms, filter ${e}ms ease-out ${t}ms, transform ${e}ms ease-out ${t}ms`,willChange:"opacity, filter, transform"},...m,children:c})};export{$ as F}; +import{r as n,j as b}from"./index-DOUW22cV.js";const $=({children:c,blur:f=!1,duration:e=800,delay:t=0,threshold:o=.1,initialOpacity:l=0,className:u="",...m})=>{const i=n.useRef(null),[s,p]=n.useState(!1);return n.useEffect(()=>{const a=i.current;if(!a)return;const r=new IntersectionObserver(([x])=>{x.isIntersecting&&(p(!0),r.disconnect())},{threshold:o});return r.observe(a),()=>r.disconnect()},[o]),b.jsx("div",{ref:i,className:u,style:{opacity:s?1:l,filter:f?s?"blur(0px)":"blur(10px)":void 0,transform:s?"translateY(0)":"translateY(20px)",transition:`opacity ${e}ms ease-out ${t}ms, filter ${e}ms ease-out ${t}ms, transform ${e}ms ease-out ${t}ms`,willChange:"opacity, filter, transform"},...m,children:c})};export{$ as F}; diff --git a/dist/assets/Home-CdwZT6r7.js b/dist/assets/Home-BBk8paQW.js similarity index 97% rename from dist/assets/Home-CdwZT6r7.js rename to dist/assets/Home-BBk8paQW.js index 18c3f60..2b3d5fc 100644 --- a/dist/assets/Home-CdwZT6r7.js +++ b/dist/assets/Home-BBk8paQW.js @@ -1 +1 @@ -import{u as f,a as w,d as N,r as m,h as y,m as M,j as e,L as l,Q as k}from"./index-ZavRXCeN.js";import{c as D,R as q}from"./RotatingEquiv-BiNhXD16.js";import{C as L}from"./CountUp-2H8PJb3I.js";import{F as i}from"./FadeContent-DnAL-lQG.js";import{u as S}from"./useTranslation-KkRwPkkT.js";function T(){const{t:s}=S(),{user:n}=f(),{site:c}=w(),{symbol:h}=N(),[j,g]=m.useState([]),[u,v]=m.useState([]);m.useEffect(()=>{y().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{}),M().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})},[]);const o=j.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute -top-40 left-1/4 w-[600px] h-[600px] bg-violet-600/10 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute top-20 right-1/4 w-[400px] h-[400px] bg-blue-600/8 rounded-full blur-3xl"})]}),e.jsxs("section",{className:"relative max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("h1",{className:"text-5xl md:text-7xl font-heading font-extrabold text-white leading-[1.08] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:n?e.jsx(l,{to:"/dashboard",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.getStarted")}),e.jsx(l,{to:"/pricing",className:"px-8 py-3.5 rounded-2xl border border-white/15 text-white font-medium text-sm hover:bg-white/5 transition-all",children:s("home.viewPricing")})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsx("div",{className:"grid grid-cols-3 gap-6 max-w-xl mx-auto mt-24",children:[{value:o.length||50,suffix:"+",label:s("home.aiModels")},{value:99.9,suffix:"%",label:s("home.uptime")},{value:50,suffix:"ms",label:s("home.latency"),prefix:"<"}].map((t,a)=>e.jsxs("div",{className:"text-center p-5 rounded-2xl bg-white/[0.03] border border-white/[0.06]",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[t.prefix,e.jsx(L,{from:0,to:t.value,duration:2}),t.suffix]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.label})]},a))})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),color:"violet",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),color:"cyan",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,a)=>e.jsxs("div",{className:"p-6 rounded-xl bg-white/[0.02] border border-white/[0.06] hover:border-white/[0.12] transition-colors",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${t.color}-500/10 text-${t.color}-400 flex items-center justify-center mb-4`,children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t.desc})]},a))})]})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-violet-400 hover:text-violet-300 transition-colors",children:[s("home.viewAllModels",{count:o.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:o.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-white/[0.06] hover:border-white/[0.12] transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),u.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:u.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const x=t.quota_amount>0?t.quota_amount/k:0,d=t.quota_reset_period||"never";let b=x;if(d!=="never"&&t.duration>0&&x>0){let r=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;r<1&&(r=1),b=x*r}const p=D(o,b);return e.jsxs("div",{className:`rounded-2xl p-6 flex flex-col border transition-colors ${a===1?"bg-white/[0.04] border-white/[0.12]":"bg-white/[0.02] border-white/[0.06] hover:border-white/[0.1]"}`,children:[a===1&&e.jsx("span",{className:"text-xs text-violet-400 font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[h,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[h,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),p.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(q,{items:p,text:r=>s("packages.officialEquiv",{model:r.label,amount:r.equivDollars})})]}),e.jsx(l,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-xl font-medium text-sm text-center transition-colors ${a===1?"bg-white text-black hover:bg-neutral-100":"bg-white/[0.06] text-white hover:bg-white/[0.1]"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-white/[0.06] pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsx(l,{to:"/dashboard",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.createFreeAccount")}),e.jsx(l,{to:"/login",className:"px-8 py-3.5 rounded-2xl border border-white/15 text-white font-medium text-sm hover:bg-white/5 transition-all",children:s("home.signIn")})]})})]})})})]})}export{T as default}; +import{u as f,a as w,d as N,r as m,h as y,m as M,j as e,L as l,Q as k}from"./index-DOUW22cV.js";import{c as D,R as q}from"./RotatingEquiv-Dcm5hOLy.js";import{C as L}from"./CountUp-Ytak2XTa.js";import{F as i}from"./FadeContent-DN0-6f2h.js";import{u as S}from"./useTranslation-Ce9HcVki.js";function T(){const{t:s}=S(),{user:n}=f(),{site:c}=w(),{symbol:h}=N(),[j,g]=m.useState([]),[u,v]=m.useState([]);m.useEffect(()=>{y().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{}),M().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})},[]);const o=j.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute -top-40 left-1/4 w-[600px] h-[600px] bg-violet-600/10 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute top-20 right-1/4 w-[400px] h-[400px] bg-blue-600/8 rounded-full blur-3xl"})]}),e.jsxs("section",{className:"relative max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("h1",{className:"text-5xl md:text-7xl font-heading font-extrabold text-white leading-[1.08] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:n?e.jsx(l,{to:"/dashboard",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.getStarted")}),e.jsx(l,{to:"/pricing",className:"px-8 py-3.5 rounded-2xl border border-white/15 text-white font-medium text-sm hover:bg-white/5 transition-all",children:s("home.viewPricing")})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsx("div",{className:"grid grid-cols-3 gap-6 max-w-xl mx-auto mt-24",children:[{value:o.length||50,suffix:"+",label:s("home.aiModels")},{value:99.9,suffix:"%",label:s("home.uptime")},{value:50,suffix:"ms",label:s("home.latency"),prefix:"<"}].map((t,a)=>e.jsxs("div",{className:"text-center p-5 rounded-2xl bg-white/[0.03] border border-white/[0.06]",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[t.prefix,e.jsx(L,{from:0,to:t.value,duration:2}),t.suffix]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.label})]},a))})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),color:"violet",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),color:"cyan",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,a)=>e.jsxs("div",{className:"p-6 rounded-xl bg-white/[0.02] border border-white/[0.06] hover:border-white/[0.12] transition-colors",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${t.color}-500/10 text-${t.color}-400 flex items-center justify-center mb-4`,children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t.desc})]},a))})]})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-violet-400 hover:text-violet-300 transition-colors",children:[s("home.viewAllModels",{count:o.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:o.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-white/[0.06] hover:border-white/[0.12] transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),u.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:u.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const x=t.quota_amount>0?t.quota_amount/k:0,d=t.quota_reset_period||"never";let b=x;if(d!=="never"&&t.duration>0&&x>0){let r=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;r<1&&(r=1),b=x*r}const p=D(o,b);return e.jsxs("div",{className:`rounded-2xl p-6 flex flex-col border transition-colors ${a===1?"bg-white/[0.04] border-white/[0.12]":"bg-white/[0.02] border-white/[0.06] hover:border-white/[0.1]"}`,children:[a===1&&e.jsx("span",{className:"text-xs text-violet-400 font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[h,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[h,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),p.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(q,{items:p,text:r=>s("packages.officialEquiv",{model:r.label,amount:r.equivDollars})})]}),e.jsx(l,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-xl font-medium text-sm text-center transition-colors ${a===1?"bg-white text-black hover:bg-neutral-100":"bg-white/[0.06] text-white hover:bg-white/[0.1]"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-white/[0.06] pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsx(l,{to:"/dashboard",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.goToDashboard")}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-8 py-3.5 rounded-2xl bg-white text-black font-semibold text-sm hover:bg-neutral-100 transition-all",children:s("home.createFreeAccount")}),e.jsx(l,{to:"/login",className:"px-8 py-3.5 rounded-2xl border border-white/15 text-white font-medium text-sm hover:bg-white/5 transition-all",children:s("home.signIn")})]})})]})})})]})}export{T as default}; diff --git a/dist/assets/Home-D4cv4oTQ.js b/dist/assets/Home-BxpaS5R5.js similarity index 96% rename from dist/assets/Home-D4cv4oTQ.js rename to dist/assets/Home-BxpaS5R5.js index 343862d..c07b6bf 100644 --- a/dist/assets/Home-D4cv4oTQ.js +++ b/dist/assets/Home-BxpaS5R5.js @@ -1 +1 @@ -import{u as N,a as v,d as w,r as x,h as y,m as q,j as e,L as l,Q as D}from"./index-ZavRXCeN.js";import{c as M,R as S}from"./RotatingEquiv-BiNhXD16.js";import{C as m}from"./CountUp-2H8PJb3I.js";import{F as n}from"./FadeContent-DnAL-lQG.js";import{u as F}from"./useTranslation-KkRwPkkT.js";function A(){const{t:s}=F(),{user:i}=N(),{site:c}=v(),{symbol:h}=w(),[p,g]=x.useState([]),[u,f]=x.useState([]);x.useEffect(()=>{y().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{})},[]);const r=p.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.getStarted")," →"]}),e.jsx(l,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.viewPricing")})]})})]})}),e.jsx(n,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(m,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(m,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(m,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc")},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc")},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc")}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-neutral-600 mt-0.5",children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),u.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:u.filter(t=>t.enabled).slice(0,3).map(t=>{const a=t.quota_amount>0?t.quota_amount/D:0,d=t.quota_reset_period||"never";let j=a;if(d!=="never"&&t.duration>0&&a>0){let o=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;o<1&&(o=1),j=a*o}const b=M(r,j);return e.jsxs("div",{className:"rounded-xl p-6 flex flex-col border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:[e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[h,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[h,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),b.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(S,{items:b,text:o=>s("packages.officialEquiv",{model:o.label,amount:o.equivDollars})})]}),e.jsx(l,{to:i?"/packages":"/register",className:"mt-4 py-2.5 rounded-lg bg-neutral-800 text-white font-medium text-sm text-center hover:bg-neutral-700 transition-colors",children:s(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{A as default}; +import{u as N,a as v,d as w,r as x,h as y,m as q,j as e,L as l,Q as D}from"./index-DOUW22cV.js";import{c as M,R as S}from"./RotatingEquiv-Dcm5hOLy.js";import{C as m}from"./CountUp-Ytak2XTa.js";import{F as n}from"./FadeContent-DN0-6f2h.js";import{u as F}from"./useTranslation-Ce9HcVki.js";function A(){const{t:s}=F(),{user:i}=N(),{site:c}=v(),{symbol:h}=w(),[p,g]=x.useState([]),[u,f]=x.useState([]);x.useEffect(()=>{y().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{})},[]);const r=p.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.getStarted")," →"]}),e.jsx(l,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.viewPricing")})]})})]})}),e.jsx(n,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(m,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(m,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(m,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc")},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc")},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc")}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-neutral-600 mt-0.5",children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),u.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:u.filter(t=>t.enabled).slice(0,3).map(t=>{const a=t.quota_amount>0?t.quota_amount/D:0,d=t.quota_reset_period||"never";let j=a;if(d!=="never"&&t.duration>0&&a>0){let o=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;o<1&&(o=1),j=a*o}const b=M(r,j);return e.jsxs("div",{className:"rounded-xl p-6 flex flex-col border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:[e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[h,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[h,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),b.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(S,{items:b,text:o=>s("packages.officialEquiv",{model:o.label,amount:o.equivDollars})})]}),e.jsx(l,{to:i?"/packages":"/register",className:"mt-4 py-2.5 rounded-lg bg-neutral-800 text-white font-medium text-sm text-center hover:bg-neutral-700 transition-colors",children:s(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-neutral-900 font-medium text-sm hover:bg-neutral-200 transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{A as default}; diff --git a/dist/assets/Home-DCfMIsOA.js b/dist/assets/Home-CR3Oy2_s.js similarity index 96% rename from dist/assets/Home-DCfMIsOA.js rename to dist/assets/Home-CR3Oy2_s.js index e6982ab..fc87464 100644 --- a/dist/assets/Home-DCfMIsOA.js +++ b/dist/assets/Home-CR3Oy2_s.js @@ -1 +1 @@ -import{u as N,a as v,d as y,r as m,h as E,m as w,j as e,L as l,Q as F}from"./index-ZavRXCeN.js";import{c as B,R as C}from"./RotatingEquiv-BiNhXD16.js";import{C as h}from"./CountUp-2H8PJb3I.js";import{F as i}from"./FadeContent-DnAL-lQG.js";import{u as q}from"./useTranslation-KkRwPkkT.js";function A(){const{t:s}=q(),{user:n}=N(),{site:c}=v(),{symbol:u}=y(),[D,f]=m.useState([]),[b,g]=m.useState([]);m.useEffect(()=>{E().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),w().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{})},[]);const o=D.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-[#3D3024] leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-[#6B5D4F] mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:n?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:s("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 pt-10 border-t border-[#E8DDD0]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(h,{from:0,to:o.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"bg-[#F5EEE6]",children:e.jsx("div",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc")},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc")},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc")}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-[#E8DDD0] last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-[#D97757]/50 mt-0.5",children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-[#3D3024] mb-1 group-hover:text-[#D97757] transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B5D4F] leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-[#8B7D6E]",children:s("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-[#D97757] hover:text-[#C4613F] transition-colors",children:[s("home.viewAllModels",{count:o.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:o.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-[#E8DDD0] hover:border-[#D9C5B2] transition-colors",children:e.jsx("span",{className:"text-sm text-[#6B5D4F] font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const x=t.quota_amount>0?t.quota_amount/F:0,d=t.quota_reset_period||"never";let j=x;if(d!=="never"&&t.duration>0&&x>0){let r=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;r<1&&(r=1),j=x*r}const p=B(o,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${a===1?"border-[#D97757]/30 bg-[#D97757]/[0.04]":"border-[#E8DDD0] hover:border-[#D9C5B2]"}`,children:[a===1&&e.jsx("span",{className:"text-xs text-[#D97757] font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-[#3D3024]",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-[#3D3024]",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-[#8B7D6E] line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-[#8B7D6E] mt-1",children:s("home.days",{count:t.duration})})]}),p.length>0&&e.jsxs("p",{className:"text-xs text-[#D97757] mt-2",children:["🔥 ",e.jsx(C,{items:p,text:r=>s("packages.officialEquiv",{model:r.label,amount:r.equivDollars})})]}),e.jsx(l,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-full font-medium text-sm text-center transition-colors ${a===1?"bg-[#D97757] text-white hover:bg-[#C4613F]":"bg-[#E8DDD0] text-[#3D3024] hover:bg-[#D9C5B2]"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-[#E8DDD0] pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-[#8B7D6E] mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:s("home.signIn")})]})})]})})})]})}export{A as default}; +import{u as N,a as v,d as y,r as m,h as E,m as w,j as e,L as l,Q as F}from"./index-DOUW22cV.js";import{c as B,R as C}from"./RotatingEquiv-Dcm5hOLy.js";import{C as h}from"./CountUp-Ytak2XTa.js";import{F as i}from"./FadeContent-DN0-6f2h.js";import{u as q}from"./useTranslation-Ce9HcVki.js";function A(){const{t:s}=q(),{user:n}=N(),{site:c}=v(),{symbol:u}=y(),[D,f]=m.useState([]),[b,g]=m.useState([]);m.useEffect(()=>{E().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),w().then(t=>{t.data.success&&g(t.data.data||[])}).catch(()=>{})},[]);const o=D.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-[#3D3024] leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-[#6B5D4F] mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:n?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:s("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 pt-10 border-t border-[#E8DDD0]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(h,{from:0,to:o.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"bg-[#F5EEE6]",children:e.jsx("div",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc")},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc")},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc")}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-[#E8DDD0] last:border-0 group",children:[e.jsxs("span",{className:"text-sm font-mono text-[#D97757]/50 mt-0.5",children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-[#3D3024] mb-1 group-hover:text-[#D97757] transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B5D4F] leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-[#8B7D6E]",children:s("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-[#D97757] hover:text-[#C4613F] transition-colors",children:[s("home.viewAllModels",{count:o.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:o.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-[#E8DDD0] hover:border-[#D9C5B2] transition-colors",children:e.jsx("span",{className:"text-sm text-[#6B5D4F] font-mono",children:t.display_name||t.model_name})},t.id||a))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const x=t.quota_amount>0?t.quota_amount/F:0,d=t.quota_reset_period||"never";let j=x;if(d!=="never"&&t.duration>0&&x>0){let r=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;r<1&&(r=1),j=x*r}const p=B(o,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${a===1?"border-[#D97757]/30 bg-[#D97757]/[0.04]":"border-[#E8DDD0] hover:border-[#D9C5B2]"}`,children:[a===1&&e.jsx("span",{className:"text-xs text-[#D97757] font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-[#3D3024]",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-[#3D3024]",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-[#8B7D6E] line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-[#8B7D6E] mt-1",children:s("home.days",{count:t.duration})})]}),p.length>0&&e.jsxs("p",{className:"text-xs text-[#D97757] mt-2",children:["🔥 ",e.jsx(C,{items:p,text:r=>s("packages.officialEquiv",{model:r.label,amount:r.equivDollars})})]}),e.jsx(l,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-full font-medium text-sm text-center transition-colors ${a===1?"bg-[#D97757] text-white hover:bg-[#C4613F]":"bg-[#E8DDD0] text-[#3D3024] hover:bg-[#D9C5B2]"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-[#E8DDD0] pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-[#8B7D6E] mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:s("home.signIn")})]})})]})})})]})}export{A as default}; diff --git a/dist/assets/Home-DLOG4B7x.js b/dist/assets/Home-DMzxmSBb.js similarity index 97% rename from dist/assets/Home-DLOG4B7x.js rename to dist/assets/Home-DMzxmSBb.js index 073a37b..2523e7c 100644 --- a/dist/assets/Home-DLOG4B7x.js +++ b/dist/assets/Home-DMzxmSBb.js @@ -1 +1 @@ -import{u as f,a as y,d as w,r as m,h as M,m as q,j as e,L as a,Q as C}from"./index-ZavRXCeN.js";import{c as D,R as L}from"./RotatingEquiv-BiNhXD16.js";import{C as h}from"./CountUp-2H8PJb3I.js";import{F as i}from"./FadeContent-DnAL-lQG.js";import{u as S}from"./useTranslation-KkRwPkkT.js";function T(){const{t:s}=S(),{user:n}=f(),{site:c}=y(),{symbol:u}=w(),[g,v]=m.useState([]),[j,N]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const l=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-bold text-slate-900 leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-slate-500 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-slate-900 text-white font-medium text-sm hover:bg-slate-800 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-lg bg-slate-900 text-white font-medium text-sm hover:bg-slate-800 transition-colors",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-slate-500 font-medium text-sm hover:text-slate-900 transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center divide-x divide-slate-200 mt-20 pt-10 border-t border-slate-200",children:[e.jsxs("div",{className:"pr-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(h,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"px-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"pl-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"bg-slate-50 border-y border-slate-200",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-slate-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl bg-white border border-slate-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-slate-100 flex items-center justify-center mb-4",children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-slate-900 mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:t.desc})]},o))})]})})}),l.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-slate-500",children:s("home.availableModelsDesc",{count:l.length})})]}),l.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-slate-600 hover:text-slate-900 transition-colors font-medium",children:[s("home.viewAllModels",{count:l.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:l.slice(0,8).map((t,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-slate-200 hover:border-slate-300 transition-colors",children:e.jsx("span",{className:"text-sm text-slate-600 font-mono",children:t.display_name||t.model_name})},t.id||o))})]})}),j.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-slate-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5 max-w-4xl",children:j.filter(t=>t.enabled).slice(0,3).map((t,o)=>{const x=t.quota_amount>0?t.quota_amount/C:0,d=t.quota_reset_period||"never";let p=x;if(d!=="never"&&t.duration>0&&x>0){let r=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;r<1&&(r=1),p=x*r}const b=D(l,p);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${o===1?"border-slate-900 shadow-sm":"border-slate-200 hover:border-slate-300"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-slate-900 font-semibold mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-slate-900",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-slate-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-slate-900",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-slate-500 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s("home.days",{count:t.duration})})]}),b.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(L,{items:b,text:r=>s("packages.officialEquiv",{model:r.label,amount:r.equivDollars})})]}),e.jsx(a,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-slate-900 text-white hover:bg-slate-800":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"bg-slate-900",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20 text-center",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-slate-400 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-slate-900 font-medium text-sm hover:bg-slate-100 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-slate-900 font-medium text-sm hover:bg-slate-100 transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-slate-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{T as default}; +import{u as f,a as y,d as w,r as m,h as M,m as q,j as e,L as a,Q as C}from"./index-DOUW22cV.js";import{c as D,R as L}from"./RotatingEquiv-Dcm5hOLy.js";import{C as h}from"./CountUp-Ytak2XTa.js";import{F as i}from"./FadeContent-DN0-6f2h.js";import{u as S}from"./useTranslation-Ce9HcVki.js";function T(){const{t:s}=S(),{user:n}=f(),{site:c}=y(),{symbol:u}=w(),[g,v]=m.useState([]),[j,N]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const l=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-5xl md:text-6xl font-bold text-slate-900 leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-slate-500 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-slate-900 text-white font-medium text-sm hover:bg-slate-800 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-lg bg-slate-900 text-white font-medium text-sm hover:bg-slate-800 transition-colors",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-slate-500 font-medium text-sm hover:text-slate-900 transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center divide-x divide-slate-200 mt-20 pt-10 border-t border-slate-200",children:[e.jsxs("div",{className:"pr-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(h,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"px-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"pl-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"bg-slate-50 border-y border-slate-200",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-slate-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),icon:e.jsx("svg",{className:"w-5 h-5 text-slate-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl bg-white border border-slate-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-slate-100 flex items-center justify-center mb-4",children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-slate-900 mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:t.desc})]},o))})]})})}),l.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-slate-500",children:s("home.availableModelsDesc",{count:l.length})})]}),l.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-slate-600 hover:text-slate-900 transition-colors font-medium",children:[s("home.viewAllModels",{count:l.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:l.slice(0,8).map((t,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-slate-200 hover:border-slate-300 transition-colors",children:e.jsx("span",{className:"text-sm text-slate-600 font-mono",children:t.display_name||t.model_name})},t.id||o))})]})}),j.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-slate-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5 max-w-4xl",children:j.filter(t=>t.enabled).slice(0,3).map((t,o)=>{const x=t.quota_amount>0?t.quota_amount/C:0,d=t.quota_reset_period||"never";let p=x;if(d!=="never"&&t.duration>0&&x>0){let r=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;r<1&&(r=1),p=x*r}const b=D(l,p);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${o===1?"border-slate-900 shadow-sm":"border-slate-200 hover:border-slate-300"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-slate-900 font-semibold mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-slate-900",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-slate-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-slate-900",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-slate-500 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s("home.days",{count:t.duration})})]}),b.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(L,{items:b,text:r=>s("packages.officialEquiv",{model:r.label,amount:r.equivDollars})})]}),e.jsx(a,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-slate-900 text-white hover:bg-slate-800":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"bg-slate-900",children:e.jsx("div",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20 text-center",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-slate-400 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-white text-slate-900 font-medium text-sm hover:bg-slate-100 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-lg bg-white text-slate-900 font-medium text-sm hover:bg-slate-100 transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-slate-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{T as default}; diff --git a/dist/assets/Home-C5feFwVH.js b/dist/assets/Home-DuzKUQBe.js similarity index 97% rename from dist/assets/Home-C5feFwVH.js rename to dist/assets/Home-DuzKUQBe.js index 4e0ba58..6489e5f 100644 --- a/dist/assets/Home-C5feFwVH.js +++ b/dist/assets/Home-DuzKUQBe.js @@ -1 +1 @@ -import{u as N,a as w,d as y,r as m,h as M,m as S,j as e,L as a,Q as q}from"./index-ZavRXCeN.js";import{c as D,R as L}from"./RotatingEquiv-BiNhXD16.js";import{C as h}from"./CountUp-2H8PJb3I.js";import{F as l}from"./FadeContent-DnAL-lQG.js";import{u as P}from"./useTranslation-KkRwPkkT.js";function T(){const{t:s}=P(),{user:i}=N(),{site:c}=w(),{symbol:u}=y(),[g,f]=m.useState([]),[b,v]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),S().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})},[]);const r=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[900px] h-[500px] bg-gradient-radial from-brand-600/15 to-transparent blur-3xl opacity-60"})}),e.jsxs("section",{className:"relative max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-brand-400 mb-4 tracking-wide uppercase",children:s("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(l,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-neutral-800/60",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl border border-neutral-800/60 hover:border-brand-500/25 transition-colors group",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-brand-500/10 text-brand-400 flex items-center justify-center mb-4",children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t.desc})]},o))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-brand-400 hover:text-brand-300 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||o))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,o)=>{const x=t.quota_amount>0?t.quota_amount/q:0,d=t.quota_reset_period||"never";let j=x;if(d!=="never"&&t.duration>0&&x>0){let n=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;n<1&&(n=1),j=x*n}const p=D(r,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-colors ${o===1?"border-brand-500/30 bg-brand-500/[0.04]":"border-neutral-800/60 hover:border-neutral-700"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-brand-400 font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),p.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(L,{items:p,text:n=>s("packages.officialEquiv",{model:n.label,amount:n.equivDollars})})]}),e.jsx(a,{to:i?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-brand-600 text-white hover:bg-brand-500":"bg-neutral-800 text-white hover:bg-neutral-700"}`,children:s(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{T as default}; +import{u as N,a as w,d as y,r as m,h as M,m as S,j as e,L as a,Q as q}from"./index-DOUW22cV.js";import{c as D,R as L}from"./RotatingEquiv-Dcm5hOLy.js";import{C as h}from"./CountUp-Ytak2XTa.js";import{F as l}from"./FadeContent-DN0-6f2h.js";import{u as P}from"./useTranslation-Ce9HcVki.js";function T(){const{t:s}=P(),{user:i}=N(),{site:c}=w(),{symbol:u}=y(),[g,f]=m.useState([]),[b,v]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),S().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})},[]);const r=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[900px] h-[500px] bg-gradient-radial from-brand-600/15 to-transparent blur-3xl opacity-60"})}),e.jsxs("section",{className:"relative max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-brand-400 mb-4 tracking-wide uppercase",children:s("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(l,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-neutral-800/60",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl border border-neutral-800/60 hover:border-brand-500/25 transition-colors group",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-brand-500/10 text-brand-400 flex items-center justify-center mb-4",children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:t.desc})]},o))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-brand-400 hover:text-brand-300 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-neutral-700 transition-colors",children:e.jsx("span",{className:"text-sm text-neutral-300 font-mono",children:t.display_name||t.model_name})},t.id||o))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(l,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,o)=>{const x=t.quota_amount>0?t.quota_amount/q:0,d=t.quota_reset_period||"never";let j=x;if(d!=="never"&&t.duration>0&&x>0){let n=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;n<1&&(n=1),j=x*n}const p=D(r,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-colors ${o===1?"border-brand-500/30 bg-brand-500/[0.04]":"border-neutral-800/60 hover:border-neutral-700"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-brand-400 font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),p.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(L,{items:p,text:n=>s("packages.officialEquiv",{model:n.label,amount:n.equivDollars})})]}),e.jsx(a,{to:i?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-brand-600 text-white hover:bg-brand-500":"bg-neutral-800 text-white hover:bg-neutral-700"}`,children:s(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(l,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-brand-600 text-white font-medium text-sm hover:bg-brand-500 transition-colors shadow-lg shadow-brand-600/20",children:[s("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{T as default}; diff --git a/dist/assets/Home-BI1Qa494.js b/dist/assets/Home-KTKrKeDU.js similarity index 97% rename from dist/assets/Home-BI1Qa494.js rename to dist/assets/Home-KTKrKeDU.js index a93e6bd..18a359f 100644 --- a/dist/assets/Home-BI1Qa494.js +++ b/dist/assets/Home-KTKrKeDU.js @@ -1 +1 @@ -import{u as f,a as v,d as w,r as m,h as M,m as q,j as e,L as a,Q as C}from"./index-ZavRXCeN.js";import{c as D,R as L}from"./RotatingEquiv-BiNhXD16.js";import{C as h}from"./CountUp-2H8PJb3I.js";import{F as i}from"./FadeContent-DnAL-lQG.js";import{u as P}from"./useTranslation-KkRwPkkT.js";function T(){const{t:s}=P(),{user:n}=f(),{site:c}=v(),{symbol:u}=w(),[p,y]=m.useState([]),[g,N]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&y(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const r=p.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-blue-600 mb-4 tracking-wide",children:s("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-gray-900 leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-gray-500 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-gray-100",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-gray-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),color:"indigo",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),color:"emerald",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl border border-gray-100 hover:border-gray-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${t.color}-50 text-${t.color}-600 flex items-center justify-center mb-4`,children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:t.desc})]},o))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-gray-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-blue-600 hover:text-blue-700 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-gray-100 hover:border-gray-200 transition-colors",children:e.jsx("span",{className:"text-sm text-gray-600 font-mono",children:t.display_name||t.model_name})},t.id||o))})]})}),g.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-gray-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:g.filter(t=>t.enabled).slice(0,3).map((t,o)=>{const x=t.quota_amount>0?t.quota_amount/C:0,d=t.quota_reset_period||"never";let b=x;if(d!=="never"&&t.duration>0&&x>0){let l=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;l<1&&(l=1),b=x*l}const j=D(r,b);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${o===1?"border-blue-200 bg-blue-50/50 shadow-sm":"border-gray-100 hover:border-gray-200"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-blue-600 font-semibold mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-gray-500 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s("home.days",{count:t.duration})})]}),j.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(L,{items:j,text:l=>s("packages.officialEquiv",{model:l.label,amount:l.equivDollars})})]}),e.jsx(a,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-gray-100 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-gray-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:s("home.signIn")})]})})]})})})]})}export{T as default}; +import{u as f,a as v,d as w,r as m,h as M,m as q,j as e,L as a,Q as C}from"./index-DOUW22cV.js";import{c as D,R as L}from"./RotatingEquiv-Dcm5hOLy.js";import{C as h}from"./CountUp-Ytak2XTa.js";import{F as i}from"./FadeContent-DN0-6f2h.js";import{u as P}from"./useTranslation-Ce9HcVki.js";function T(){const{t:s}=P(),{user:n}=f(),{site:c}=v(),{symbol:u}=w(),[p,y]=m.useState([]),[g,N]=m.useState([]);m.useEffect(()=>{M().then(t=>{t.data.success&&y(t.data.data||[])}).catch(()=>{}),q().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const r=p.filter(t=>t.enabled!==!1);return e.jsxs("div",{children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-20",children:[e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[e.jsx("p",{className:"text-sm font-medium text-blue-600 mb-4 tracking-wide",children:s("home.heroTagline")||"AI API Platform"}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-gray-900 leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-gray-500 mt-6 leading-relaxed max-w-xl mx-auto",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:s("home.getStarted")}),e.jsxs(a,{to:"/pricing",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(i,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"grid grid-cols-3 gap-8 max-w-lg mx-auto mt-20 pt-10 border-t border-gray-100",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-gray-500",children:s("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),color:"blue",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),color:"indigo",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),color:"emerald",icon:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}].map((t,o)=>e.jsxs("div",{className:"p-6 rounded-xl border border-gray-100 hover:border-gray-200 hover:shadow-sm transition-all",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg bg-${t.color}-50 text-${t.color}-600 flex items-center justify-center mb-4`,children:t.icon}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:t.title}),e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:t.desc})]},o))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-gray-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-blue-600 hover:text-blue-700 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,o)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-gray-100 hover:border-gray-200 transition-colors",children:e.jsx("span",{className:"text-sm text-gray-600 font-mono",children:t.display_name||t.model_name})},t.id||o))})]})}),g.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(i,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-gray-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:g.filter(t=>t.enabled).slice(0,3).map((t,o)=>{const x=t.quota_amount>0?t.quota_amount/C:0,d=t.quota_reset_period||"never";let b=x;if(d!=="never"&&t.duration>0&&x>0){let l=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;l<1&&(l=1),b=x*l}const j=D(r,b);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-all ${o===1?"border-blue-200 bg-blue-50/50 shadow-sm":"border-gray-100 hover:border-gray-200"}`,children:[o===1&&e.jsx("span",{className:"text-xs text-blue-600 font-semibold mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-gray-500 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s("home.days",{count:t.duration})})]}),j.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(L,{items:j,text:l=>s("packages.officialEquiv",{model:l.label,amount:l.equivDollars})})]}),e.jsx(a,{to:n?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${o===1?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:s(n?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(i,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-gray-100 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-gray-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:n?e.jsxs(a,{to:"/dashboard",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{to:"/register",className:"px-7 py-3 rounded-xl bg-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[s("home.createFreeAccount")," →"]}),e.jsx(a,{to:"/login",className:"px-7 py-3 text-gray-500 font-medium text-sm hover:text-gray-900 transition-colors",children:s("home.signIn")})]})})]})})})]})}export{T as default}; diff --git a/dist/assets/Home-D7LBRdbE.js b/dist/assets/Home-NjW2RUrZ.js similarity index 96% rename from dist/assets/Home-D7LBRdbE.js rename to dist/assets/Home-NjW2RUrZ.js index 21e0351..ea8fcc5 100644 --- a/dist/assets/Home-D7LBRdbE.js +++ b/dist/assets/Home-NjW2RUrZ.js @@ -1 +1 @@ -import{u as v,a as y,d as w,r as x,h as D,m as S,j as e,L as l,Q as q}from"./index-ZavRXCeN.js";import{c as F,R as M}from"./RotatingEquiv-BiNhXD16.js";import{C as h}from"./CountUp-2H8PJb3I.js";import{F as n}from"./FadeContent-DnAL-lQG.js";import{u as P}from"./useTranslation-KkRwPkkT.js";function L(){const{t:s}=P(),{user:i}=v(),{site:c}=y(),{symbol:u}=w(),[g,f]=x.useState([]),[b,N]=x.useState([]);x.useEffect(()=>{D().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),S().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const r=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-emerald-500/20 mb-8",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),e.jsx("span",{className:"text-xs text-emerald-400/80 font-medium tracking-wide",children:s("home.heroTagline")||"All Systems Operational"})]}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:s("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(n,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-emerald-400",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),accent:"emerald"},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),accent:"cyan"},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),accent:"violet"}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:`text-sm font-mono text-${t.accent}-500/60 mt-0.5`,children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-emerald-400 hover:text-emerald-300 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-emerald-500/20 transition-colors group",children:e.jsx("span",{className:"text-sm text-neutral-400 font-mono group-hover:text-neutral-300 transition-colors truncate block",children:t.display_name||t.model_name})},t.id||a))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const m=t.quota_amount>0?t.quota_amount/q:0,d=t.quota_reset_period||"never";let p=m;if(d!=="never"&&t.duration>0&&m>0){let o=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;o<1&&(o=1),p=m*o}const j=F(r,p);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-colors ${a===1?"border-emerald-500/25 bg-emerald-500/[0.04]":"border-neutral-800/60 hover:border-neutral-700"}`,children:[a===1&&e.jsx("span",{className:"text-xs text-emerald-400 font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),j.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(M,{items:j,text:o=>s("packages.officialEquiv",{model:o.label,amount:o.equivDollars})})]}),e.jsx(l,{to:i?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${a===1?"bg-emerald-500 text-black hover:bg-emerald-400":"bg-neutral-800 text-white hover:bg-neutral-700"}`,children:s(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{L as default}; +import{u as v,a as y,d as w,r as x,h as D,m as S,j as e,L as l,Q as q}from"./index-DOUW22cV.js";import{c as F,R as M}from"./RotatingEquiv-Dcm5hOLy.js";import{C as h}from"./CountUp-Ytak2XTa.js";import{F as n}from"./FadeContent-DN0-6f2h.js";import{u as P}from"./useTranslation-Ce9HcVki.js";function L(){const{t:s}=P(),{user:i}=v(),{site:c}=y(),{symbol:u}=w(),[g,f]=x.useState([]),[b,N]=x.useState([]);x.useEffect(()=>{D().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{}),S().then(t=>{t.data.success&&N(t.data.data||[])}).catch(()=>{})},[]);const r=g.filter(t=>t.enabled!==!1);return e.jsxs("div",{className:"relative",children:[e.jsxs("section",{className:"max-w-5xl mx-auto px-6 pt-32 pb-24",children:[e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-emerald-500/20 mb-8",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),e.jsx("span",{className:"text-xs text-emerald-400/80 font-medium tracking-wide",children:s("home.heroTagline")||"All Systems Operational"})]}),e.jsx("h1",{className:"text-5xl md:text-6xl font-heading font-bold text-white leading-[1.1] tracking-tight",children:(c==null?void 0:c.name)||s("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:s("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:s("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:[s("home.viewPricing")," →"]})]})})]})}),e.jsx(n,{blur:!0,duration:800,delay:400,children:e.jsxs("div",{className:"flex items-center gap-12 mt-20 border-t border-neutral-800 pt-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-emerald-400",children:[e.jsx(h,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(h,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(h,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:s("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:s("home.lightningFast"),desc:s("home.lightningFastDesc"),accent:"emerald"},{title:s("home.securePrivate"),desc:s("home.securePrivateDesc"),accent:"cyan"},{title:s("home.payAsYouGo"),desc:s("home.payAsYouGoDesc"),accent:"violet"}].map((t,a)=>e.jsxs("div",{className:"flex gap-6 items-start py-6 border-b border-neutral-800/60 last:border-0 group",children:[e.jsxs("span",{className:`text-sm font-mono text-${t.accent}-500/60 mt-0.5`,children:["0",a+1]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-white mb-1 group-hover:text-neutral-300 transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:t.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:s("home.availableModelsDesc",{count:r.length})})]}),r.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-emerald-400 hover:text-emerald-300 transition-colors",children:[s("home.viewAllModels",{count:r.length})," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:r.slice(0,8).map((t,a)=>e.jsx("div",{className:"px-4 py-3 rounded-lg border border-neutral-800/60 hover:border-emerald-500/20 transition-colors group",children:e.jsx("span",{className:"text-sm text-neutral-400 font-mono group-hover:text-neutral-300 transition-colors truncate block",children:t.display_name||t.model_name})},t.id||a))})]})}),b.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(n,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:s("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:s("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:b.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const m=t.quota_amount>0?t.quota_amount/q:0,d=t.quota_reset_period||"never";let p=m;if(d!=="never"&&t.duration>0&&m>0){let o=d==="daily"?t.duration:d==="weekly"?Math.floor(t.duration/7):d==="monthly"?Math.floor(t.duration/30):1;o<1&&(o=1),p=m*o}const j=F(r,p);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-colors ${a===1?"border-emerald-500/25 bg-emerald-500/[0.04]":"border-neutral-800/60 hover:border-neutral-700"}`,children:[a===1&&e.jsx("span",{className:"text-xs text-emerald-400 font-medium mb-2 uppercase tracking-wider",children:s("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:t.name}),t.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:t.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:[u,Number(t.price).toFixed(2)]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:[u,Number(t.original_price).toFixed(2)]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),j.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(M,{items:j,text:o=>s("packages.officialEquiv",{model:o.label,amount:o.equivDollars})})]}),e.jsx(l,{to:i?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${a===1?"bg-emerald-500 text-black hover:bg-emerald-400":"bg-neutral-800 text-white hover:bg-neutral-700"}`,children:s(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(n,{blur:!0,duration:800,delay:100,children:e.jsxs("div",{className:"border-t border-neutral-800 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:s("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:s("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:i?e.jsxs(l,{to:"/dashboard",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(l,{to:"/register",className:"px-7 py-3 rounded-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[s("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:s("home.signIn")})]})})]})})})]})}export{L as default}; diff --git a/dist/assets/LanguageSwitch-fmTd22QU.js b/dist/assets/LanguageSwitch-Dn1Lth1H.js similarity index 86% rename from dist/assets/LanguageSwitch-fmTd22QU.js rename to dist/assets/LanguageSwitch-Dn1Lth1H.js index 149848d..6aaa420 100644 --- a/dist/assets/LanguageSwitch-fmTd22QU.js +++ b/dist/assets/LanguageSwitch-Dn1Lth1H.js @@ -1 +1 @@ -import{j as n}from"./index-ZavRXCeN.js";import{u as a}from"./useTranslation-KkRwPkkT.js";function u({className:t=""}){var s;const{i18n:e}=a(),o=(s=e.language)==null?void 0:s.startsWith("zh"),r=()=>{e.changeLanguage(o?"en":"zh")};return n.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs transition-colors ${t}`,"aria-label":"Switch language",children:[n.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.6 9h16.8M3.6 15h16.8"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3a15.3 15.3 0 0 1 4 9 15.3 15.3 0 0 1-4 9 15.3 15.3 0 0 1-4-9 15.3 15.3 0 0 1 4-9Z"})]}),n.jsx("span",{children:o?"EN":"中文"})]})}export{u as L}; +import{j as n}from"./index-DOUW22cV.js";import{u as a}from"./useTranslation-Ce9HcVki.js";function u({className:t=""}){var s;const{i18n:e}=a(),o=(s=e.language)==null?void 0:s.startsWith("zh"),r=()=>{e.changeLanguage(o?"en":"zh")};return n.jsxs("button",{onClick:r,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs transition-colors ${t}`,"aria-label":"Switch language",children:[n.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.6 9h16.8M3.6 15h16.8"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3a15.3 15.3 0 0 1 4 9 15.3 15.3 0 0 1-4 9 15.3 15.3 0 0 1-4-9 15.3 15.3 0 0 1 4-9Z"})]}),n.jsx("span",{children:o?"EN":"中文"})]})}export{u as L}; diff --git a/dist/assets/Layout-Cv1wXPfX.js b/dist/assets/Layout-CISyGCfm.js similarity index 97% rename from dist/assets/Layout-Cv1wXPfX.js rename to dist/assets/Layout-CISyGCfm.js index 5a54cd0..f849577 100644 --- a/dist/assets/Layout-Cv1wXPfX.js +++ b/dist/assets/Layout-CISyGCfm.js @@ -1 +1 @@ -import{u as h,a as u,b as p,c as g,r as b,j as e,L as o,O as j}from"./index-ZavRXCeN.js";import{L as v}from"./LanguageSwitch-fmTd22QU.js";import{u as f}from"./useTranslation-KkRwPkkT.js";function L(){const{t:s}=f(),{user:n,logout:m}=h(),{site:t}=u(),d=p(),i=g(),[r,c]=b.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},{to:"/logs",label:s("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||n);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-slate-900 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-slate-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white border-b border-gray-200",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:l,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-900 flex items-center justify-center text-white font-bold text-sm",children:l.charAt(0)}),e.jsx("span",{className:"text-lg font-bold text-slate-900 tracking-tight",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-0.5",children:x.map(a=>e.jsx(o,{to:a.to,className:`px-4 py-2 text-sm font-medium transition-colors ${i.pathname===a.to?"text-slate-900 border-b-2 border-slate-900":"text-slate-500 hover:text-slate-900"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-slate-400 hover:text-slate-700 hover:bg-slate-50"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-slate-600 hidden sm:block font-medium",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-slate-400 hover:text-slate-700 transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-slate-600 hover:text-slate-900 px-3 py-2 hidden sm:block transition-colors font-medium",children:s("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-slate-900 text-white text-sm font-medium hover:bg-slate-800 transition-colors",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-slate-50 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-slate-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-gray-200 bg-white",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col",children:x.map(a=>e.jsx(o,{to:a.to,onClick:()=>c(!1),className:`px-4 py-3 text-sm font-medium border-b border-gray-100 last:border-0 transition-colors ${i.pathname===a.to?"text-slate-900 bg-slate-50":"text-slate-500 hover:text-slate-900"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(j,{})}),e.jsx("footer",{className:"border-t border-gray-200 mt-auto bg-white",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-10",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-bold text-slate-900 tracking-tight",children:l}),e.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:["© ",new Date().getFullYear()," ",l,". All rights reserved."]})]}),e.jsx("div",{className:"flex items-center gap-6",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:s("nav.contact")})})]})})})]})}export{L as default}; +import{u as h,a as u,b as p,c as g,r as b,j as e,L as o,O as j}from"./index-DOUW22cV.js";import{L as v}from"./LanguageSwitch-Dn1Lth1H.js";import{u as f}from"./useTranslation-Ce9HcVki.js";function L(){const{t:s}=f(),{user:n,logout:m}=h(),{site:t}=u(),d=p(),i=g(),[r,c]=b.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:s("nav.home"),auth:!1},{to:"/pricing",label:s("nav.pricing"),auth:!1},{to:"/packages",label:s("nav.packages"),auth:!1},{to:"/dashboard",label:s("nav.dashboard"),auth:!0},{to:"/tokens",label:s("nav.apiKeys"),auth:!0},{to:"/logs",label:s("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||n);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-slate-900 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-slate-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white border-b border-gray-200",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:l,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-900 flex items-center justify-center text-white font-bold text-sm",children:l.charAt(0)}),e.jsx("span",{className:"text-lg font-bold text-slate-900 tracking-tight",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-0.5",children:x.map(a=>e.jsx(o,{to:a.to,className:`px-4 py-2 text-sm font-medium transition-colors ${i.pathname===a.to?"text-slate-900 border-b-2 border-slate-900":"text-slate-500 hover:text-slate-900"}`,children:a.label},a.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-slate-400 hover:text-slate-700 hover:bg-slate-50"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-slate-600 hidden sm:block font-medium",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-slate-400 hover:text-slate-700 transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-slate-600 hover:text-slate-900 px-3 py-2 hidden sm:block transition-colors font-medium",children:s("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-slate-900 text-white text-sm font-medium hover:bg-slate-800 transition-colors",children:s("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-slate-50 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-slate-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-gray-200 bg-white",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col",children:x.map(a=>e.jsx(o,{to:a.to,onClick:()=>c(!1),className:`px-4 py-3 text-sm font-medium border-b border-gray-100 last:border-0 transition-colors ${i.pathname===a.to?"text-slate-900 bg-slate-50":"text-slate-500 hover:text-slate-900"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(j,{})}),e.jsx("footer",{className:"border-t border-gray-200 mt-auto bg-white",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 lg:px-8 py-10",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-bold text-slate-900 tracking-tight",children:l}),e.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:["© ",new Date().getFullYear()," ",l,". All rights reserved."]})]}),e.jsx("div",{className:"flex items-center gap-6",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:s("nav.contact")})})]})})})]})}export{L as default}; diff --git a/dist/assets/Layout-Cu3KXPx6.js b/dist/assets/Layout-CPY5kYpQ.js similarity index 97% rename from dist/assets/Layout-Cu3KXPx6.js rename to dist/assets/Layout-CPY5kYpQ.js index 516715f..3f0f67c 100644 --- a/dist/assets/Layout-Cu3KXPx6.js +++ b/dist/assets/Layout-CPY5kYpQ.js @@ -1 +1 @@ -import{u as h,a as u,b as p,c as g,r as b,j as e,L as o,O as D}from"./index-ZavRXCeN.js";import{L as v}from"./LanguageSwitch-fmTd22QU.js";import{u as f}from"./useTranslation-KkRwPkkT.js";function w(){const{t:a}=f(),{user:l,logout:m}=h(),{site:t}=u(),d=p(),i=g(),[r,c]=b.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light theme-claude min-h-screen flex flex-col bg-[#FAF6F1] text-[#3D3024]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-[#D97757] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-white font-medium",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-[#FAF6F1]/85 backdrop-blur-xl border-b border-[#E8DDD0]",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-gradient-to-br from-[#D97757] to-[#C4613F] flex items-center justify-center text-white font-bold text-sm shadow-sm",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-[#3D3024] group-hover:text-[#D97757] transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-[#D97757] bg-[#D97757]/8 font-medium":"text-[#6B5D4F] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{className:"text-[#8B7D6E] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[#6B5D4F] hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-[#8B7D6E] hover:text-[#3D3024] transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-[#6B5D4F] hover:text-[#3D3024] px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-full bg-[#D97757] text-white text-sm font-medium hover:bg-[#C4613F] transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-[#E8DDD0]/50 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-[#6B5D4F]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-[#E8DDD0] bg-[#FAF6F1]",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-[#D97757] bg-[#D97757]/8 font-medium":"text-[#6B5D4F] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(D,{})}),e.jsx("footer",{className:"border-t border-[#E8DDD0] mt-auto bg-[#F5EEE6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-[#8B7D6E]",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-[#8B7D6E] hover:text-[#D97757] transition-colors",children:a("nav.contact")})})]})})]})}export{w as default}; +import{u as h,a as u,b as p,c as g,r as b,j as e,L as o,O as D}from"./index-DOUW22cV.js";import{L as v}from"./LanguageSwitch-Dn1Lth1H.js";import{u as f}from"./useTranslation-Ce9HcVki.js";function w(){const{t:a}=f(),{user:l,logout:m}=h(),{site:t}=u(),d=p(),i=g(),[r,c]=b.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light theme-claude min-h-screen flex flex-col bg-[#FAF6F1] text-[#3D3024]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-[#D97757] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-white font-medium",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-[#FAF6F1]/85 backdrop-blur-xl border-b border-[#E8DDD0]",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-gradient-to-br from-[#D97757] to-[#C4613F] flex items-center justify-center text-white font-bold text-sm shadow-sm",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-[#3D3024] group-hover:text-[#D97757] transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-[#D97757] bg-[#D97757]/8 font-medium":"text-[#6B5D4F] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{className:"text-[#8B7D6E] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[#6B5D4F] hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-[#8B7D6E] hover:text-[#3D3024] transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-[#6B5D4F] hover:text-[#3D3024] px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-full bg-[#D97757] text-white text-sm font-medium hover:bg-[#C4613F] transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-[#E8DDD0]/50 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-[#6B5D4F]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-[#E8DDD0] bg-[#FAF6F1]",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-[#D97757] bg-[#D97757]/8 font-medium":"text-[#6B5D4F] hover:text-[#3D3024] hover:bg-[#E8DDD0]/50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(D,{})}),e.jsx("footer",{className:"border-t border-[#E8DDD0] mt-auto bg-[#F5EEE6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-[#8B7D6E]",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-[#8B7D6E] hover:text-[#D97757] transition-colors",children:a("nav.contact")})})]})})]})}export{w as default}; diff --git a/dist/assets/Layout--sek2SXK.js b/dist/assets/Layout-CUZzo-Vw.js similarity index 96% rename from dist/assets/Layout--sek2SXK.js rename to dist/assets/Layout-CUZzo-Vw.js index e57cb9c..efbb014 100644 --- a/dist/assets/Layout--sek2SXK.js +++ b/dist/assets/Layout-CUZzo-Vw.js @@ -1 +1 @@ -import{u as d,a as u,b as p,c as b,r as g,j as e,L as l,O as j}from"./index-ZavRXCeN.js";import{L as v}from"./LanguageSwitch-fmTd22QU.js";import{u as f}from"./useTranslation-KkRwPkkT.js";function L(){const{t:a}=f(),{user:n,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=g.useState(!1),o=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-neutral-950 text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"border-b border-neutral-800/60 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-neutral-400",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-lg bg-neutral-950/80 border-b border-neutral-800/40",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-2.5 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:o,className:"h-7 w-auto"}):e.jsx("span",{className:"text-base font-semibold text-white",children:o}),(t==null?void 0:t.logo)&&e.jsx("span",{className:"text-base font-semibold text-white",children:o})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-6",children:x.map(s=>e.jsx(l,{to:s.to,className:`text-sm transition-colors ${i.pathname===s.to?"text-white":"text-neutral-500 hover:text-white"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-neutral-500 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"px-4 py-1.5 rounded-lg bg-white text-neutral-900 text-sm font-medium hover:bg-neutral-200 transition-colors",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1",onClick:()=>c(!r),children:e.jsx("svg",{className:"w-5 h-5 text-neutral-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-neutral-800/40 bg-neutral-950/95",children:e.jsx("nav",{className:"max-w-5xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===s.to?"text-white":"text-neutral-500 hover:text-white"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(j,{})}),e.jsx("footer",{className:"border-t border-neutral-800/40 mt-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-xs text-neutral-600",children:["© ",new Date().getFullYear()," ",o]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-white transition-colors",children:a("nav.contact")})]})})]})}export{L as default}; +import{u as d,a as u,b as p,c as b,r as g,j as e,L as l,O as j}from"./index-DOUW22cV.js";import{L as v}from"./LanguageSwitch-Dn1Lth1H.js";import{u as f}from"./useTranslation-Ce9HcVki.js";function L(){const{t:a}=f(),{user:n,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=g.useState(!1),o=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-neutral-950 text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"border-b border-neutral-800/60 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-neutral-400",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-lg bg-neutral-950/80 border-b border-neutral-800/40",children:[e.jsxs("div",{className:"max-w-5xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-2.5 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:o,className:"h-7 w-auto"}):e.jsx("span",{className:"text-base font-semibold text-white",children:o}),(t==null?void 0:t.logo)&&e.jsx("span",{className:"text-base font-semibold text-white",children:o})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-6",children:x.map(s=>e.jsx(l,{to:s.to,className:`text-sm transition-colors ${i.pathname===s.to?"text-white":"text-neutral-500 hover:text-white"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"text-neutral-500 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"px-4 py-1.5 rounded-lg bg-white text-neutral-900 text-sm font-medium hover:bg-neutral-200 transition-colors",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1",onClick:()=>c(!r),children:e.jsx("svg",{className:"w-5 h-5 text-neutral-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-neutral-800/40 bg-neutral-950/95",children:e.jsx("nav",{className:"max-w-5xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===s.to?"text-white":"text-neutral-500 hover:text-white"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(j,{})}),e.jsx("footer",{className:"border-t border-neutral-800/40 mt-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-3",children:[e.jsxs("p",{className:"text-xs text-neutral-600",children:["© ",new Date().getFullYear()," ",o]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-white transition-colors",children:a("nav.contact")})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-Bs88cVzM.js b/dist/assets/Layout-D-RGC5l0.js similarity index 97% rename from dist/assets/Layout-Bs88cVzM.js rename to dist/assets/Layout-D-RGC5l0.js index 7c0f780..3f31e51 100644 --- a/dist/assets/Layout-Bs88cVzM.js +++ b/dist/assets/Layout-D-RGC5l0.js @@ -1 +1 @@ -import{u as h,a as u,b,c as p,r as g,j as e,L as l,O as v}from"./index-ZavRXCeN.js";import{L as f}from"./LanguageSwitch-fmTd22QU.js";import{u as j}from"./useTranslation-KkRwPkkT.js";function L(){const{t:a}=j(),{user:o,logout:d}=h(),{site:t}=u(),m=b(),i=p(),[r,c]=g.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||o);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#09090b]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-gradient-to-r from-violet-600/10 via-blue-600/10 to-cyan-600/10 border-b border-white/[0.06] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-neutral-300",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-2xl bg-[#09090b]/80 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 via-blue-500 to-cyan-500 flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-blue-500/20",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-blue-400 transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1 bg-white/[0.04] rounded-full px-1.5 py-1 border border-white/[0.06]",children:x.map(s=>e.jsx(l,{to:s.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===s.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await d(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-400 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"px-5 py-2 rounded-full bg-white text-black text-sm font-medium hover:bg-neutral-100 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-[#09090b]/95 backdrop-blur-2xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto bg-[#09090b]",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default}; +import{u as h,a as u,b,c as p,r as g,j as e,L as l,O as v}from"./index-DOUW22cV.js";import{L as f}from"./LanguageSwitch-Dn1Lth1H.js";import{u as j}from"./useTranslation-Ce9HcVki.js";function L(){const{t:a}=j(),{user:o,logout:d}=h(),{site:t}=u(),m=b(),i=p(),[r,c]=g.useState(!1),n=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||o);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#09090b]",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-gradient-to-r from-violet-600/10 via-blue-600/10 to-cyan-600/10 border-b border-white/[0.06] text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-neutral-300",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-2xl bg-[#09090b]/80 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:n,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 via-blue-500 to-cyan-500 flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-blue-500/20",children:n.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-blue-400 transition-colors",children:n})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1 bg-white/[0.04] rounded-full px-1.5 py-1 border border-white/[0.06]",children:x.map(s=>e.jsx(l,{to:s.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===s.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await d(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-400 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"px-5 py-2 rounded-full bg-white text-black text-sm font-medium hover:bg-neutral-100 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!r),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),r&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-[#09090b]/95 backdrop-blur-2xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto bg-[#09090b]",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",n,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-BjSxzlL0.js b/dist/assets/Layout-D0gFUpiK.js similarity index 97% rename from dist/assets/Layout-BjSxzlL0.js rename to dist/assets/Layout-D0gFUpiK.js index eb895f5..6ae44b8 100644 --- a/dist/assets/Layout-BjSxzlL0.js +++ b/dist/assets/Layout-D0gFUpiK.js @@ -1 +1 @@ -import{u as h,a as u,b as p,c as b,r as f,j as e,L as s,O as g}from"./index-ZavRXCeN.js";import{L as j}from"./LanguageSwitch-fmTd22QU.js";import{u as v}from"./useTranslation-KkRwPkkT.js";function L(){const{t:a}=v(),{user:l,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(o=>!o.auth||l);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#030712] text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-emerald-500/5 border-b border-emerald-500/10 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-emerald-300/80 font-mono",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-[#030712]/80 border-b border-emerald-500/[0.08]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-7 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-400 font-bold font-mono text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-base font-semibold text-emerald-400 font-mono group-hover:text-emerald-300 transition-colors tracking-wide",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(o=>e.jsx(s,{to:o.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===o.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:o.label},o.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-500 hover:text-emerald-400 hover:bg-emerald-500/5 font-mono"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 font-mono hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{to:"/login",className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors hidden sm:block px-3 py-1.5",children:a("nav.login")}),e.jsx(s,{to:"/register",className:"px-4 py-1.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm font-mono hover:bg-emerald-500/15 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded hover:bg-white/5",onClick:()=>d(!n),children:e.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-emerald-500/[0.08] bg-[#030712]/95 backdrop-blur-xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:c.map(o=>e.jsx(s,{to:o.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===o.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:o.label},o.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-emerald-500/[0.08] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-xs text-neutral-600 font-mono",children:["© ",new Date().getFullYear()," ",r]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-emerald-400 font-mono transition-colors",children:a("nav.contact")})]})})]})}export{L as default}; +import{u as h,a as u,b as p,c as b,r as f,j as e,L as s,O as g}from"./index-DOUW22cV.js";import{L as j}from"./LanguageSwitch-Dn1Lth1H.js";import{u as v}from"./useTranslation-Ce9HcVki.js";function L(){const{t:a}=v(),{user:l,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(o=>!o.auth||l);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#030712] text-white",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-emerald-500/5 border-b border-emerald-500/10 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-emerald-300/80 font-mono",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-[#030712]/80 border-b border-emerald-500/[0.08]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-14 flex items-center justify-between",children:[e.jsxs(s,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-7 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-400 font-bold font-mono text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-base font-semibold text-emerald-400 font-mono group-hover:text-emerald-300 transition-colors tracking-wide",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(o=>e.jsx(s,{to:o.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===o.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:o.label},o.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-500 hover:text-emerald-400 hover:bg-emerald-500/5 font-mono"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 font-mono hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{to:"/login",className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors hidden sm:block px-3 py-1.5",children:a("nav.login")}),e.jsx(s,{to:"/register",className:"px-4 py-1.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm font-mono hover:bg-emerald-500/15 transition-all",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded hover:bg-white/5",onClick:()=>d(!n),children:e.jsx("svg",{className:"w-5 h-5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-emerald-500/[0.08] bg-[#030712]/95 backdrop-blur-xl",children:e.jsx("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:c.map(o=>e.jsx(s,{to:o.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===o.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:o.label},o.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),e.jsx("footer",{className:"border-t border-emerald-500/[0.08] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-6 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-xs text-neutral-600 font-mono",children:["© ",new Date().getFullYear()," ",r]}),(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-xs text-neutral-600 hover:text-emerald-400 font-mono transition-colors",children:a("nav.contact")})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-CAIME1iu.js b/dist/assets/Layout-DaloeA7I.js similarity index 97% rename from dist/assets/Layout-CAIME1iu.js rename to dist/assets/Layout-DaloeA7I.js index 6c7902d..304fbdd 100644 --- a/dist/assets/Layout-CAIME1iu.js +++ b/dist/assets/Layout-DaloeA7I.js @@ -1 +1 @@ -import{u as h,a as u,b as p,c as b,r as g,j as e,L as l,O as v}from"./index-ZavRXCeN.js";import{L as j}from"./LanguageSwitch-fmTd22QU.js";import{u as f}from"./useTranslation-KkRwPkkT.js";function M(){const{t:a}=f(),{user:n,logout:o}=h(),{site:t}=u(),m=p(),x=b(),[i,c]=g.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",d=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-brand-600/20 border-b border-brand-500/20 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-brand-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-black/60 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-purple-600 flex items-center justify-center text-white font-bold text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-brand-400 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:d.map(s=>e.jsx(N,{to:s.to,active:x.pathname===s.to,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await o(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-300 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"btn-primary text-sm !px-4 !py-1.5",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!i),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),i&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-black/90 backdrop-blur-xl",children:e.jsxs("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:[d.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${x.pathname===s.to?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to)),!n&&e.jsx(l,{to:"/login",onClick:()=>c(!1),className:"px-3 py-2 text-sm text-neutral-400 hover:text-white rounded-lg hover:bg-white/5 transition-colors sm:hidden",children:a("nav.login")})]})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}function N({to:a,children:n,active:o}){return e.jsx(l,{to:a,className:`px-3 py-1.5 text-sm rounded-lg transition-all ${o?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:n})}export{M as default}; +import{u as h,a as u,b as p,c as b,r as g,j as e,L as l,O as v}from"./index-DOUW22cV.js";import{L as j}from"./LanguageSwitch-Dn1Lth1H.js";import{u as f}from"./useTranslation-Ce9HcVki.js";function M(){const{t:a}=f(),{user:n,logout:o}=h(),{site:t}=u(),m=p(),x=b(),[i,c]=g.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",d=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||n);return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-brand-600/20 border-b border-brand-500/20 text-center py-2 px-4",children:e.jsx("p",{className:"text-sm text-brand-200",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 backdrop-blur-xl bg-black/60 border-b border-white/[0.06]",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(l,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-brand-500 to-purple-600 flex items-center justify-center text-white font-bold text-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-white group-hover:text-brand-400 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:d.map(s=>e.jsx(N,{to:s.to,active:x.pathname===s.to,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-neutral-400 hover:text-white hover:bg-white/5"}),n?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-400 hidden sm:block",children:n.display_name||n.username}),e.jsx("button",{onClick:async()=>{await o(),m("/")},className:"text-sm text-neutral-400 hover:text-white transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/login",className:"text-sm text-neutral-300 hover:text-white transition-colors px-3 py-1.5 hidden sm:block",children:a("nav.login")}),e.jsx(l,{to:"/register",className:"btn-primary text-sm !px-4 !py-1.5",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-1.5 rounded-lg hover:bg-white/5 transition-colors",onClick:()=>c(!i),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-neutral-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),i&&e.jsx("div",{className:"md:hidden border-t border-white/[0.06] bg-black/90 backdrop-blur-xl",children:e.jsxs("nav",{className:"max-w-7xl mx-auto px-6 py-3 flex flex-col gap-1",children:[d.map(s=>e.jsx(l,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${x.pathname===s.to?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:s.label},s.to)),!n&&e.jsx(l,{to:"/login",onClick:()=>c(!1),className:"px-3 py-2 text-sm text-neutral-400 hover:text-white rounded-lg hover:bg-white/5 transition-colors sm:hidden",children:a("nav.login")})]})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-white/[0.06] mt-auto",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-neutral-500",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-neutral-500 hover:text-neutral-300 transition-colors",children:a("nav.contact")})})]})})]})}function N({to:a,children:n,active:o}){return e.jsx(l,{to:a,className:`px-3 py-1.5 text-sm rounded-lg transition-all ${o?"text-brand-400 bg-brand-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:n})}export{M as default}; diff --git a/dist/assets/Layout-3U5lz1BM.js b/dist/assets/Layout-lQQhtT0p.js similarity index 96% rename from dist/assets/Layout-3U5lz1BM.js rename to dist/assets/Layout-lQQhtT0p.js index ba9a340..3a3f6a1 100644 --- a/dist/assets/Layout-3U5lz1BM.js +++ b/dist/assets/Layout-lQQhtT0p.js @@ -1 +1 @@ -import{u as h,a as g,b as u,c as b,r as p,j as e,L as o,O as v}from"./index-ZavRXCeN.js";import{L as j}from"./LanguageSwitch-fmTd22QU.js";import{u as y}from"./useTranslation-KkRwPkkT.js";function L(){const{t:a}=y(),{user:l,logout:m}=h(),{site:t}=g(),d=u(),i=b(),[n,c]=p.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-blue-50 border-b border-blue-100 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-blue-700",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white/80 backdrop-blur-xl border-b border-gray-100",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-600 flex items-center justify-center text-white font-bold text-sm shadow-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-gray-400 hover:text-gray-700 hover:bg-gray-50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-gray-400 hover:text-gray-700 transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-gray-500 hover:text-gray-900 px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-blue-600 text-white text-sm font-medium hover:bg-blue-700 transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:()=>c(!n),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-gray-100 bg-white",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-gray-100 mt-auto bg-gray-50/50",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-gray-400",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-gray-400 hover:text-gray-600 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default}; +import{u as h,a as g,b as u,c as b,r as p,j as e,L as o,O as v}from"./index-DOUW22cV.js";import{L as j}from"./LanguageSwitch-Dn1Lth1H.js";import{u as y}from"./useTranslation-Ce9HcVki.js";function L(){const{t:a}=y(),{user:l,logout:m}=h(),{site:t}=g(),d=u(),i=b(),[n,c]=p.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-blue-50 border-b border-blue-100 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-blue-700",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white/80 backdrop-blur-xl border-b border-gray-100",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-600 flex items-center justify-center text-white font-bold text-sm shadow-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-gray-400 hover:text-gray-700 hover:bg-gray-50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-gray-400 hover:text-gray-700 transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-gray-500 hover:text-gray-900 px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-blue-600 text-white text-sm font-medium hover:bg-blue-700 transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:()=>c(!n),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-gray-100 bg-white",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-gray-100 mt-auto bg-gray-50/50",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-gray-400",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-gray-400 hover:text-gray-600 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default}; diff --git a/dist/assets/Login-BZ-Yy-uQ.js b/dist/assets/Login-BiHdkYGn.js similarity index 94% rename from dist/assets/Login-BZ-Yy-uQ.js rename to dist/assets/Login-BiHdkYGn.js index a009666..9b9fb93 100644 --- a/dist/assets/Login-BZ-Yy-uQ.js +++ b/dist/assets/Login-BiHdkYGn.js @@ -1 +1 @@ -import{u as v,a as w,b as y,c as k,r as p,j as e,N as L,L as S,z as x}from"./index-ZavRXCeN.js";import{u as C}from"./useTranslation-KkRwPkkT.js";function A(){var c,m;const{t:s}=C(),{login:g,user:h}=v(),{site:n}=w(),f=y(),l=k(),[t,o]=p.useState({username:"",password:""}),[r,i]=p.useState(!1);if(h){const a=((m=(c=l.state)==null?void 0:c.from)==null?void 0:m.pathname)||"/dashboard";return e.jsx(L,{to:a,replace:!0})}const b=async a=>{var u,d;if(a.preventDefault(),!t.username||!t.password){x.error(s("login.fillAllFields"));return}i(!0);try{if((await g(t.username,t.password)).success){x.success(s("login.welcomeBackToast"));const N=((d=(u=l.state)==null?void 0:u.from)==null?void 0:d.pathname)||"/dashboard";f(N,{replace:!0});return}}catch{}i(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-2",children:s("login.welcomeBack")}),e.jsx("p",{className:"text-sm text-page-secondary",children:n!=null&&n.name?s("login.signInTo",{name:n.name}):s("login.signInToDefault")})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("login.username")}),e.jsx("input",{type:"text",value:t.username,onChange:a=>o({...t,username:a.target.value}),className:"input",placeholder:s("login.enterUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("login.password")}),e.jsx("input",{type:"password",value:t.password,onChange:a=>o({...t,password:a.target.value}),className:"input",placeholder:s("login.enterPassword"),autoComplete:"current-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:r,className:"btn-primary w-full flex items-center justify-center gap-2",children:[r&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(r?"login.signingIn":"login.signInBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-page-secondary",children:[s("login.noAccount")," ",e.jsx(S,{to:"/register",className:"text-page-link hover:text-page-link transition-colors font-medium",children:s("login.createOne")})]})})]})})})}export{A as default}; +import{u as v,a as w,b as y,c as k,r as p,j as e,N as L,L as S,z as x}from"./index-DOUW22cV.js";import{u as C}from"./useTranslation-Ce9HcVki.js";function A(){var c,m;const{t:s}=C(),{login:g,user:h}=v(),{site:n}=w(),f=y(),l=k(),[t,o]=p.useState({username:"",password:""}),[r,i]=p.useState(!1);if(h){const a=((m=(c=l.state)==null?void 0:c.from)==null?void 0:m.pathname)||"/dashboard";return e.jsx(L,{to:a,replace:!0})}const b=async a=>{var u,d;if(a.preventDefault(),!t.username||!t.password){x.error(s("login.fillAllFields"));return}i(!0);try{if((await g(t.username,t.password)).success){x.success(s("login.welcomeBackToast"));const N=((d=(u=l.state)==null?void 0:u.from)==null?void 0:d.pathname)||"/dashboard";f(N,{replace:!0});return}}catch{}i(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-2",children:s("login.welcomeBack")}),e.jsx("p",{className:"text-sm text-page-secondary",children:n!=null&&n.name?s("login.signInTo",{name:n.name}):s("login.signInToDefault")})]}),e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("login.username")}),e.jsx("input",{type:"text",value:t.username,onChange:a=>o({...t,username:a.target.value}),className:"input",placeholder:s("login.enterUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("login.password")}),e.jsx("input",{type:"password",value:t.password,onChange:a=>o({...t,password:a.target.value}),className:"input",placeholder:s("login.enterPassword"),autoComplete:"current-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:r,className:"btn-primary w-full flex items-center justify-center gap-2",children:[r&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(r?"login.signingIn":"login.signInBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-page-secondary",children:[s("login.noAccount")," ",e.jsx(S,{to:"/register",className:"text-page-link hover:text-page-link transition-colors font-medium",children:s("login.createOne")})]})})]})})})}export{A as default}; diff --git a/dist/assets/Logs-Br0U5gGP.js b/dist/assets/Logs-DPdRMLgj.js similarity index 97% rename from dist/assets/Logs-Br0U5gGP.js rename to dist/assets/Logs-DPdRMLgj.js index a75021d..463b9a4 100644 --- a/dist/assets/Logs-Br0U5gGP.js +++ b/dist/assets/Logs-DPdRMLgj.js @@ -1 +1 @@ -import{d as S,r as l,A as $,j as e,Q as b}from"./index-ZavRXCeN.js";import{u as F}from"./useTranslation-KkRwPkkT.js";function v(s){if(!s)return"-";const a=new Date(s*1e3),n=c=>String(c).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())} ${n(a.getHours())}:${n(a.getMinutes())}:${n(a.getSeconds())}`}function L(){const{t:s}=F(),{symbol:a,rate:n}=S(),[c,k]=l.useState([]),[p,w]=l.useState(0),[d,x]=l.useState(1),[_,j]=l.useState(!0),[h,f]=l.useState(""),[g,y]=l.useState(""),m=20,N=l.useCallback(async()=>{var t,i;j(!0);try{const o={p:d,page_size:m,type:2};h&&(o.model_name=h),g&&(o.token_name=g);const r=await $(o);r.data.success&&(k(((t=r.data.data)==null?void 0:t.items)||[]),w(((i=r.data.data)==null?void 0:i.total)||0))}catch{}j(!1)},[d,h,g]);l.useEffect(()=>{N()},[N]);const u=Math.max(1,Math.ceil(p/m));return e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:s("logs.title")}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("logs.subtitle")})]}),e.jsx("div",{className:"glass rounded-2xl p-4 mb-6",children:e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx("div",{className:"flex-1 min-w-[180px]",children:e.jsx("input",{type:"text",value:h,onChange:t=>{f(t.target.value),x(1)},className:"input w-full",placeholder:s("logs.filterModel")})}),e.jsx("div",{className:"flex-1 min-w-[180px]",children:e.jsx("input",{type:"text",value:g,onChange:t=>{y(t.target.value),x(1)},className:"input w-full",placeholder:s("logs.filterToken")})}),e.jsx("button",{onClick:()=>{f(""),y(""),x(1)},className:"btn-secondary text-sm",children:s("logs.clearFilter")})]})}),e.jsx("div",{className:"glass rounded-2xl overflow-hidden",children:_?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):c.length===0?e.jsx("div",{className:"text-center py-16 text-page-secondary",children:e.jsx("p",{children:s("logs.noLogs")})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-page-divider",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.time")}),e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.model")}),e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.token")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.promptTokens")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.completionTokens")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.cost")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.duration")})]})}),e.jsx("tbody",{children:c.map((t,i)=>{var o,r;return e.jsxs("tr",{className:"border-b border-page-divider last:border-0 hover:bg-page-surface transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-page-secondary text-xs whitespace-nowrap",children:v(t.created_at)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"font-mono text-xs text-page",children:t.model_name||"-"})}),e.jsx("td",{className:"px-4 py-3 text-xs text-page-secondary",children:t.token_name||"-"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-label",children:((o=t.prompt_tokens)==null?void 0:o.toLocaleString())||"0"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-label",children:((r=t.completion_tokens)==null?void 0:r.toLocaleString())||"0"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-warning",children:t.quota>0?`${a}${(t.quota/b*n).toFixed(6)}`:"-"}),e.jsx("td",{className:"px-4 py-3 text-right text-xs text-page-secondary",children:t.use_time>0?`${(t.use_time/1e3).toFixed(1)}s`:"-"})]},i)})})]})}),e.jsx("div",{className:"md:hidden divide-y divide-page-divider",children:c.map((t,i)=>e.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs text-page font-medium",children:t.model_name||"-"}),e.jsx("span",{className:"font-mono text-xs text-page-warning",children:t.quota>0?`${a}${(t.quota/b*n).toFixed(6)}`:"-"})]}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-page-secondary",children:[e.jsx("span",{children:v(t.created_at)}),e.jsxs("span",{children:[t.prompt_tokens||0," / ",t.completion_tokens||0," tokens"]})]}),t.token_name&&e.jsx("div",{className:"text-[11px] text-page-muted",children:t.token_name})]},i))})]})}),p>m&&e.jsxs("div",{className:"flex items-center justify-between mt-6",children:[e.jsx("p",{className:"text-sm text-page-secondary",children:s("logs.showing",{from:(d-1)*m+1,to:Math.min(d*m,p),total:p})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>x(t=>Math.max(1,t-1)),disabled:d<=1,className:"btn-secondary text-sm px-3 py-1.5 disabled:opacity-30",children:s("logs.prev")}),e.jsxs("span",{className:"text-sm text-page-secondary px-2",children:[d," / ",u]}),e.jsx("button",{onClick:()=>x(t=>Math.min(u,t+1)),disabled:d>=u,className:"btn-secondary text-sm px-3 py-1.5 disabled:opacity-30",children:s("logs.next")})]})]})]})}export{L as default}; +import{d as S,r as l,A as $,j as e,Q as b}from"./index-DOUW22cV.js";import{u as F}from"./useTranslation-Ce9HcVki.js";function v(s){if(!s)return"-";const a=new Date(s*1e3),n=c=>String(c).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())} ${n(a.getHours())}:${n(a.getMinutes())}:${n(a.getSeconds())}`}function L(){const{t:s}=F(),{symbol:a,rate:n}=S(),[c,k]=l.useState([]),[p,w]=l.useState(0),[d,x]=l.useState(1),[_,j]=l.useState(!0),[h,f]=l.useState(""),[g,y]=l.useState(""),m=20,N=l.useCallback(async()=>{var t,i;j(!0);try{const o={p:d,page_size:m,type:2};h&&(o.model_name=h),g&&(o.token_name=g);const r=await $(o);r.data.success&&(k(((t=r.data.data)==null?void 0:t.items)||[]),w(((i=r.data.data)==null?void 0:i.total)||0))}catch{}j(!1)},[d,h,g]);l.useEffect(()=>{N()},[N]);const u=Math.max(1,Math.ceil(p/m));return e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:s("logs.title")}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("logs.subtitle")})]}),e.jsx("div",{className:"glass rounded-2xl p-4 mb-6",children:e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx("div",{className:"flex-1 min-w-[180px]",children:e.jsx("input",{type:"text",value:h,onChange:t=>{f(t.target.value),x(1)},className:"input w-full",placeholder:s("logs.filterModel")})}),e.jsx("div",{className:"flex-1 min-w-[180px]",children:e.jsx("input",{type:"text",value:g,onChange:t=>{y(t.target.value),x(1)},className:"input w-full",placeholder:s("logs.filterToken")})}),e.jsx("button",{onClick:()=>{f(""),y(""),x(1)},className:"btn-secondary text-sm",children:s("logs.clearFilter")})]})}),e.jsx("div",{className:"glass rounded-2xl overflow-hidden",children:_?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):c.length===0?e.jsx("div",{className:"text-center py-16 text-page-secondary",children:e.jsx("p",{children:s("logs.noLogs")})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-page-divider",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.time")}),e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.model")}),e.jsx("th",{className:"text-left px-4 py-3 font-medium text-page-secondary",children:s("logs.token")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.promptTokens")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.completionTokens")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.cost")}),e.jsx("th",{className:"text-right px-4 py-3 font-medium text-page-secondary",children:s("logs.duration")})]})}),e.jsx("tbody",{children:c.map((t,i)=>{var o,r;return e.jsxs("tr",{className:"border-b border-page-divider last:border-0 hover:bg-page-surface transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-page-secondary text-xs whitespace-nowrap",children:v(t.created_at)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"font-mono text-xs text-page",children:t.model_name||"-"})}),e.jsx("td",{className:"px-4 py-3 text-xs text-page-secondary",children:t.token_name||"-"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-label",children:((o=t.prompt_tokens)==null?void 0:o.toLocaleString())||"0"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-label",children:((r=t.completion_tokens)==null?void 0:r.toLocaleString())||"0"}),e.jsx("td",{className:"px-4 py-3 text-right font-mono text-xs text-page-warning",children:t.quota>0?`${a}${(t.quota/b*n).toFixed(6)}`:"-"}),e.jsx("td",{className:"px-4 py-3 text-right text-xs text-page-secondary",children:t.use_time>0?`${(t.use_time/1e3).toFixed(1)}s`:"-"})]},i)})})]})}),e.jsx("div",{className:"md:hidden divide-y divide-page-divider",children:c.map((t,i)=>e.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs text-page font-medium",children:t.model_name||"-"}),e.jsx("span",{className:"font-mono text-xs text-page-warning",children:t.quota>0?`${a}${(t.quota/b*n).toFixed(6)}`:"-"})]}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-page-secondary",children:[e.jsx("span",{children:v(t.created_at)}),e.jsxs("span",{children:[t.prompt_tokens||0," / ",t.completion_tokens||0," tokens"]})]}),t.token_name&&e.jsx("div",{className:"text-[11px] text-page-muted",children:t.token_name})]},i))})]})}),p>m&&e.jsxs("div",{className:"flex items-center justify-between mt-6",children:[e.jsx("p",{className:"text-sm text-page-secondary",children:s("logs.showing",{from:(d-1)*m+1,to:Math.min(d*m,p),total:p})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>x(t=>Math.max(1,t-1)),disabled:d<=1,className:"btn-secondary text-sm px-3 py-1.5 disabled:opacity-30",children:s("logs.prev")}),e.jsxs("span",{className:"text-sm text-page-secondary px-2",children:[d," / ",u]}),e.jsx("button",{onClick:()=>x(t=>Math.min(u,t+1)),disabled:d>=u,className:"btn-secondary text-sm px-3 py-1.5 disabled:opacity-30",children:s("logs.next")})]})]})]})}export{L as default}; diff --git a/dist/assets/Packages-DkFQKW15.js b/dist/assets/Packages-DTfyBY5U.js similarity index 55% rename from dist/assets/Packages-DkFQKW15.js rename to dist/assets/Packages-DTfyBY5U.js index 9fcfe8e..5ffdf1b 100644 --- a/dist/assets/Packages-DkFQKW15.js +++ b/dist/assets/Packages-DTfyBY5U.js @@ -1 +1 @@ -import{u as R,b as W,d as z,r,m as I,h as T,n as w,j as e,Q as x,L as U,s as $,z as S}from"./index-ZavRXCeN.js";import{c as K,R as O}from"./RotatingEquiv-BiNhXD16.js";import{u as G}from"./useTranslation-KkRwPkkT.js";const _={never:"packages.resetNever",daily:"packages.resetDaily",weekly:"packages.resetWeekly",monthly:"packages.resetMonthly"};function L(a){return a?new Date(a*1e3).toLocaleDateString():""}function X(){const{t:a}=G(),{user:o,refreshUser:q}=R(),M=W(),{symbol:u,rate:h}=z(),[P,C]=r.useState([]),[b,F]=r.useState([]),[D,E]=r.useState(!0),[m,j]=r.useState(null),[N,v]=r.useState([]),[l,p]=r.useState(null),f=s=>a(_[s]||_.never);r.useEffect(()=>{Promise.all([I().then(s=>{s.data.success&&C(s.data.data||[])}).catch(()=>{}),T().then(s=>{s.data.success&&F(s.data.data||[])}).catch(()=>{})]).finally(()=>E(!1))},[]),r.useEffect(()=>{o&&w().then(s=>{s.data.success&&v(s.data.data||[])}).catch(()=>{})},[o]);const B=async s=>{if(!o){M("/register");return}p(s)},A=async()=>{if(!l)return;const s=l.id;j(s);try{const n=await $(s);n.data.success?(S.success(a("packages.subscribedSuccess")),p(null),await q(),w().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})):S.error(n.data.message||a("common.requestFailed"))}catch{}j(null)},Q=r.useMemo(()=>b.filter(s=>s.enabled!==!1),[b]);if(D)return e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});const k=P.filter(s=>s.enabled);return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:a("packages.title")}),e.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:a("packages.subtitle")})]}),N.length>0&&e.jsxs("div",{className:"max-w-3xl mx-auto mb-10",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:a("packages.mySubscriptions")}),e.jsx("div",{className:"space-y-3",children:N.map(s=>{const n=s.amount_total||0,t=s.amount_used||0,i=Math.max(0,n-t),d=n>0?Math.min(100,t/n*100):0;return e.jsxs("div",{className:"glass rounded-xl p-4 border border-page-divider",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-page",children:a("packages.subscriptionId",{id:s.id})}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-green-500/10 text-page-success border border-green-500/20",children:a("packages.active")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-page-secondary mb-3",children:[e.jsxs("span",{children:[a("packages.expires"),": ",L(s.end_time)]}),s.next_reset_time>0&&e.jsxs("span",{children:[a("packages.nextReset"),": ",L(s.next_reset_time)]})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("div",{className:"flex-1 h-2 bg-page-surface rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-brand-500 to-purple-500 transition-all",style:{width:`${d}%`}})}),e.jsxs("span",{className:"text-xs text-page-secondary whitespace-nowrap",children:[u,(i/x*h).toFixed(2)," / ",u,(n/x*h).toFixed(2)]})]})]},s.id)})})]}),k.length===0?e.jsxs("div",{className:"text-center py-12 text-page-secondary",children:[e.jsx("p",{children:a("packages.noPackages")}),e.jsxs(U,{to:"/pricing",className:"text-page-link hover:text-page-link transition-colors mt-2 inline-block",children:[a("packages.checkPricing")," →"]})]}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-5xl mx-auto",children:k.map((s,n)=>{const t=s.quota_reset_period||"never",i=t!=="never",d=s.quota_amount>0?s.quota_amount/x:0;let g=d;if(i&&s.duration>0&&d>0){let c=1;t==="daily"?c=s.duration:t==="weekly"?c=Math.floor(s.duration/7):t==="monthly"&&(c=Math.floor(s.duration/30)),c<1&&(c=1),g=d*c}const y=K(Q,g);return e.jsx("div",{className:"glass rounded-2xl flex flex-col",children:e.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-xl font-semibold text-page",children:s.name}),i&&e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-purple-500/10 text-page-info border border-purple-500/20",children:f(t)})]}),s.description&&e.jsx("p",{className:"text-sm text-page-secondary mt-1",children:s.description})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-4xl font-bold text-page",children:[u,Number(s.price).toFixed(2)]}),s.original_price>0&&s.original_price>s.price&&e.jsxs("span",{className:"text-lg text-page-muted line-through",children:[u,Number(s.original_price).toFixed(2)]})]}),s.duration>0&&e.jsx("p",{className:"text-sm text-page-muted mt-1",children:a("packages.daysAccess",{count:s.duration})})]}),y.length>0&&e.jsx("div",{className:"bg-gradient-to-r from-amber-500/10 to-orange-500/10 border border-amber-500/20 rounded-xl p-3 mb-4",children:e.jsxs("p",{className:"text-xs text-page-warning font-medium",children:["🔥 ",e.jsx(O,{items:y,text:c=>a("packages.officialEquiv",{model:c.label,amount:c.equivDollars})})]})}),e.jsxs("ul",{className:"space-y-2 mb-6 flex-1",children:[s.quota_amount>0&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-success flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),i?a("packages.periodicQuota",{amount:(s.quota_amount/x).toFixed(2),period:f(t)}):a("packages.creditIncluded",{amount:(s.quota_amount/x).toFixed(2)})]}),i&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-warning flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),a("packages.unusedQuotaExpires")]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-success flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a("packages.allModels")]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-success flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a("packages.openaiApi")]})]}),e.jsx("button",{onClick:()=>B(s),disabled:m===s.id,className:"btn-primary w-full text-center",children:m===s.id?a("packages.processing"):a(o?"packages.subscribeNow":"packages.signUpToSubscribe")})]})},s.id)})}),l&&(()=>{const s=((o==null?void 0:o.quota)||0)/x*h,n=Number(l.price),t=s!m&&p(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:g=>g.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-3",children:a("packages.confirmTitle")}),e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:a("packages.confirmDesc",{name:l.name,price:n.toFixed(2)})}),d&&e.jsx("div",{className:"bg-purple-500/10 border border-purple-500/20 rounded-xl p-3 mb-3",children:e.jsx("p",{className:"text-xs text-page-info",children:a("packages.subscriptionInfo",{period:f(i),days:l.duration||30,amount:(l.quota_amount/x).toFixed(2)})})}),e.jsxs("p",{className:"text-sm text-page-secondary mb-4",children:[a("packages.yourBalance")," ",e.jsxs("span",{className:`font-medium ${t?"text-page-danger":"text-page-success"}`,children:[u,s.toFixed(2)]})]}),t&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/20 rounded-xl p-3 mb-4",children:e.jsx("p",{className:"text-sm text-page-danger",children:a("packages.insufficientBalance")})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>p(null),disabled:m,className:"btn-secondary",children:a("tokens.cancel")}),e.jsx("button",{onClick:A,disabled:t||m,className:"btn-primary",children:a(m?"packages.processing":"packages.confirm")})]})]})})})()]})}export{X as default}; +import{u as R,b as W,d as z,r,m as I,h as T,n as w,j as e,Q as x,L as U,s as $,z as S}from"./index-DOUW22cV.js";import{c as K,R as O}from"./RotatingEquiv-Dcm5hOLy.js";import{u as G}from"./useTranslation-Ce9HcVki.js";const _={never:"packages.resetNever",daily:"packages.resetDaily",weekly:"packages.resetWeekly",monthly:"packages.resetMonthly"};function L(a){return a?new Date(a*1e3).toLocaleDateString():""}function X(){const{t:a}=G(),{user:o,refreshUser:q}=R(),M=W(),{symbol:p,rate:m}=z(),[P,C]=r.useState([]),[b,F]=r.useState([]),[D,E]=r.useState(!0),[u,j]=r.useState(null),[N,v]=r.useState([]),[l,g]=r.useState(null),f=s=>a(_[s]||_.never);r.useEffect(()=>{Promise.all([I().then(s=>{s.data.success&&C(s.data.data||[])}).catch(()=>{}),T().then(s=>{s.data.success&&F(s.data.data||[])}).catch(()=>{})]).finally(()=>E(!1))},[]),r.useEffect(()=>{o&&w().then(s=>{s.data.success&&v(s.data.data||[])}).catch(()=>{})},[o]);const B=async s=>{if(!o){M("/register");return}g(s)},A=async()=>{if(!l)return;const s=l.id;j(s);try{const n=await $(s);n.data.success?(S.success(a("packages.subscribedSuccess")),g(null),await q(),w().then(t=>{t.data.success&&v(t.data.data||[])}).catch(()=>{})):S.error(n.data.message||a("common.requestFailed"))}catch{}j(null)},Q=r.useMemo(()=>b.filter(s=>s.enabled!==!1),[b]);if(D)return e.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});const k=P.filter(s=>s.enabled);return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:a("packages.title")}),e.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:a("packages.subtitle")})]}),N.length>0&&e.jsxs("div",{className:"max-w-3xl mx-auto mb-10",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:a("packages.mySubscriptions")}),e.jsx("div",{className:"space-y-3",children:N.map(s=>{const n=s.amount_total||0,t=s.amount_used||0,i=Math.max(0,n-t),d=n>0?Math.min(100,t/n*100):0;return e.jsxs("div",{className:"glass rounded-xl p-4 border border-page-divider",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-page",children:a("packages.subscriptionId",{id:s.id})}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-green-500/10 text-page-success border border-green-500/20",children:a("packages.active")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-page-secondary mb-3",children:[e.jsxs("span",{children:[a("packages.expires"),": ",L(s.end_time)]}),s.next_reset_time>0&&e.jsxs("span",{children:[a("packages.nextReset"),": ",L(s.next_reset_time)]})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("div",{className:"flex-1 h-2 bg-page-surface rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-brand-500 to-purple-500 transition-all",style:{width:`${d}%`}})}),e.jsxs("span",{className:"text-xs text-page-secondary whitespace-nowrap",children:[p,(i/x*m).toFixed(2)," / ",p,(n/x*m).toFixed(2)]})]})]},s.id)})})]}),k.length===0?e.jsxs("div",{className:"text-center py-12 text-page-secondary",children:[e.jsx("p",{children:a("packages.noPackages")}),e.jsxs(U,{to:"/pricing",className:"text-page-link hover:text-page-link transition-colors mt-2 inline-block",children:[a("packages.checkPricing")," →"]})]}):e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-5xl mx-auto",children:k.map((s,n)=>{const t=s.quota_reset_period||"never",i=t!=="never",d=s.quota_amount>0?s.quota_amount/x:0;let h=d;if(i&&s.duration>0&&d>0){let c=1;t==="daily"?c=s.duration:t==="weekly"?c=Math.floor(s.duration/7):t==="monthly"&&(c=Math.floor(s.duration/30)),c<1&&(c=1),h=d*c}const y=K(Q,h);return e.jsx("div",{className:"glass rounded-2xl flex flex-col",children:e.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-xl font-semibold text-page",children:s.name}),i&&e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-purple-500/10 text-page-info border border-purple-500/20",children:f(t)})]}),s.description&&e.jsx("p",{className:"text-sm text-page-secondary mt-1",children:s.description})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-4xl font-bold text-page",children:[p,Number(s.price).toFixed(2)]}),s.original_price>0&&s.original_price>s.price&&e.jsxs("span",{className:"text-lg text-page-muted line-through",children:[p,Number(s.original_price).toFixed(2)]})]}),s.duration>0&&e.jsx("p",{className:"text-sm text-page-muted mt-1",children:a("packages.daysAccess",{count:s.duration})})]}),y.length>0&&e.jsx("div",{className:"bg-gradient-to-r from-amber-500/10 to-orange-500/10 border border-amber-500/20 rounded-xl p-3 mb-4",children:e.jsxs("p",{className:"text-xs text-page-warning font-medium",children:["🔥 ",e.jsx(O,{items:y,text:c=>a("packages.officialEquiv",{model:c.label,amount:c.equivDollars})})]})}),e.jsxs("ul",{className:"space-y-2 mb-6 flex-1",children:[s.quota_amount>0&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-success flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),i?a("packages.periodicQuota",{amount:(s.quota_amount/x*m).toFixed(2),period:f(t)}):a("packages.creditIncluded",{amount:(s.quota_amount/x*m).toFixed(2)})]}),i&&e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-warning flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),a("packages.unusedQuotaExpires")]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-success flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a("packages.allModels")]}),e.jsxs("li",{className:"flex items-center gap-2 text-sm text-page-label",children:[e.jsx("svg",{className:"w-4 h-4 text-page-success flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),a("packages.openaiApi")]})]}),e.jsx("button",{onClick:()=>B(s),disabled:u===s.id,className:"btn-primary w-full text-center",children:u===s.id?a("packages.processing"):a(o?"packages.subscribeNow":"packages.signUpToSubscribe")})]})},s.id)})}),l&&(()=>{const s=((o==null?void 0:o.quota)||0)/x*m,n=Number(l.price),t=s!u&&g(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:h=>h.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-3",children:a("packages.confirmTitle")}),e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:a("packages.confirmDesc",{name:l.name,price:n.toFixed(2)})}),d&&e.jsx("div",{className:"bg-purple-500/10 border border-purple-500/20 rounded-xl p-3 mb-3",children:e.jsx("p",{className:"text-xs text-page-info",children:a("packages.subscriptionInfo",{period:f(i),days:l.duration||30,amount:(l.quota_amount/x*m).toFixed(2)})})}),e.jsxs("p",{className:"text-sm text-page-secondary mb-4",children:[a("packages.yourBalance")," ",e.jsxs("span",{className:`font-medium ${t?"text-page-danger":"text-page-success"}`,children:[p,s.toFixed(2)]})]}),t&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/20 rounded-xl p-3 mb-4",children:e.jsx("p",{className:"text-sm text-page-danger",children:a("packages.insufficientBalance")})}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx("button",{onClick:()=>g(null),disabled:u,className:"btn-secondary",children:a("tokens.cancel")}),e.jsx("button",{onClick:A,disabled:t||u,className:"btn-primary",children:a(u?"packages.processing":"packages.confirm")})]})]})})})()]})}export{X as default}; diff --git a/dist/assets/Pricing-CdVyLR6o.js b/dist/assets/Pricing-BYGRhypH.js similarity index 97% rename from dist/assets/Pricing-CdVyLR6o.js rename to dist/assets/Pricing-BYGRhypH.js index a566876..397a9d3 100644 --- a/dist/assets/Pricing-CdVyLR6o.js +++ b/dist/assets/Pricing-BYGRhypH.js @@ -1 +1 @@ -import{d as N,r as n,h as v,j as t}from"./index-ZavRXCeN.js";import{u as w}from"./useTranslation-KkRwPkkT.js";function S(){const{t:s}=w(),{symbol:d,rate:c}=N(),[h,g]=n.useState([]),[x,f]=n.useState([]),[l,b]=n.useState(""),[r,p]=n.useState(""),[j,y]=n.useState(!0);n.useEffect(()=>{v().then(e=>{e.data.success&&(g(e.data.data||[]),f(e.data.vendors||[]))}).catch(()=>{}).finally(()=>y(!1))},[]);const i=h.filter(e=>e.enabled!==!1),m=n.useMemo(()=>{const e=new Set(i.map(a=>a.vendor_name).filter(Boolean));return x.filter(a=>e.has(a.name))},[i,x]),u=n.useMemo(()=>{let e=i;if(r&&(e=e.filter(a=>a.vendor_name===r)),l){const a=l.toLowerCase();e=e.filter(o=>(o.display_name||o.model_name||"").toLowerCase().includes(a))}return e=[...e].sort((a,o)=>(Number(a.input_price)||0)-(Number(o.input_price)||0)),e},[i,r,l]);return j?t.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:t.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):t.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[t.jsxs("div",{className:"text-center mb-10",children:[t.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:s("pricing.title")}),t.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:s("pricing.subtitle")})]}),m.length>0&&t.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-6",children:[t.jsx("button",{onClick:()=>p(""),className:`inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all ${r?"glass-sm text-page-secondary hover:text-page hover:bg-page-surface-hover":"bg-brand-500 text-white shadow-lg shadow-brand-500/25"}`,children:s("pricing.allVendors")}),m.map(e=>t.jsx("button",{onClick:()=>p(e.name),className:`inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all ${r===e.name?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-secondary hover:text-page hover:bg-page-surface-hover"}`,children:e.name},e.id))]}),t.jsx("div",{className:"max-w-md mx-auto mb-8",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-page-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",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:"text",value:l,onChange:e=>b(e.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),u.length===0?t.jsx("div",{className:"text-center py-12 text-page-secondary",children:s(l||r?"pricing.noMatch":"pricing.noModels")}):t.jsx("div",{className:"glass-sm rounded-xl overflow-hidden",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-page-divider",children:[t.jsx("th",{className:"text-left px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.model")}),t.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.inputPrice")}),t.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.outputPrice")}),t.jsx("th",{className:"text-center px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.status")})]})}),t.jsx("tbody",{children:u.map((e,a)=>t.jsxs("tr",{className:"border-b border-page-divider last:border-0 hover:bg-page-surface transition-colors",children:[t.jsx("td",{className:"px-5 py-3.5",children:t.jsx("span",{className:"font-mono text-page",children:e.display_name||e.model_name})}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.input_price!=null?`${d}${(Number(e.input_price)*1e3*c).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.output_price!=null?`${d}${(Number(e.output_price)*1e3*c).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-center",children:t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${e.status==="healthy"?"bg-green-500/10 text-page-success border-green-500/20":"bg-page-surface text-page-secondary border-page-divider"}`,children:[t.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${e.status==="healthy"?"bg-green-500":"bg-neutral-500"}`}),e.status==="healthy"?s("pricing.online"):s("pricing.unknown")]})})]},e.model_name||a))})]})})]})}export{S as default}; +import{d as N,r as n,h as v,j as t}from"./index-DOUW22cV.js";import{u as w}from"./useTranslation-Ce9HcVki.js";function S(){const{t:s}=w(),{symbol:d,rate:c}=N(),[h,g]=n.useState([]),[x,f]=n.useState([]),[l,b]=n.useState(""),[r,p]=n.useState(""),[j,y]=n.useState(!0);n.useEffect(()=>{v().then(e=>{e.data.success&&(g(e.data.data||[]),f(e.data.vendors||[]))}).catch(()=>{}).finally(()=>y(!1))},[]);const i=h.filter(e=>e.enabled!==!1),m=n.useMemo(()=>{const e=new Set(i.map(a=>a.vendor_name).filter(Boolean));return x.filter(a=>e.has(a.name))},[i,x]),u=n.useMemo(()=>{let e=i;if(r&&(e=e.filter(a=>a.vendor_name===r)),l){const a=l.toLowerCase();e=e.filter(o=>(o.display_name||o.model_name||"").toLowerCase().includes(a))}return e=[...e].sort((a,o)=>(Number(a.input_price)||0)-(Number(o.input_price)||0)),e},[i,r,l]);return j?t.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:t.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):t.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[t.jsxs("div",{className:"text-center mb-10",children:[t.jsx("h1",{className:"text-3xl font-heading font-bold text-page mb-3",children:s("pricing.title")}),t.jsx("p",{className:"text-page-secondary max-w-xl mx-auto",children:s("pricing.subtitle")})]}),m.length>0&&t.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-6",children:[t.jsx("button",{onClick:()=>p(""),className:`inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all ${r?"glass-sm text-page-secondary hover:text-page hover:bg-page-surface-hover":"bg-brand-500 text-white shadow-lg shadow-brand-500/25"}`,children:s("pricing.allVendors")}),m.map(e=>t.jsx("button",{onClick:()=>p(e.name),className:`inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-sm font-medium transition-all ${r===e.name?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-secondary hover:text-page hover:bg-page-surface-hover"}`,children:e.name},e.id))]}),t.jsx("div",{className:"max-w-md mx-auto mb-8",children:t.jsxs("div",{className:"relative",children:[t.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-page-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",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:"text",value:l,onChange:e=>b(e.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),u.length===0?t.jsx("div",{className:"text-center py-12 text-page-secondary",children:s(l||r?"pricing.noMatch":"pricing.noModels")}):t.jsx("div",{className:"glass-sm rounded-xl overflow-hidden",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-page-divider",children:[t.jsx("th",{className:"text-left px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.model")}),t.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.inputPrice")}),t.jsx("th",{className:"text-right px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.outputPrice")}),t.jsx("th",{className:"text-center px-5 py-3.5 font-medium text-page-secondary",children:s("pricing.status")})]})}),t.jsx("tbody",{children:u.map((e,a)=>t.jsxs("tr",{className:"border-b border-page-divider last:border-0 hover:bg-page-surface transition-colors",children:[t.jsx("td",{className:"px-5 py-3.5",children:t.jsx("span",{className:"font-mono text-page",children:e.display_name||e.model_name})}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.input_price!=null?`${d}${(Number(e.input_price)*1e3*c).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.output_price!=null?`${d}${(Number(e.output_price)*1e3*c).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-center",children:t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs border ${e.status==="healthy"?"bg-green-500/10 text-page-success border-green-500/20":"bg-page-surface text-page-secondary border-page-divider"}`,children:[t.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${e.status==="healthy"?"bg-green-500":"bg-neutral-500"}`}),e.status==="healthy"?s("pricing.online"):s("pricing.unknown")]})})]},e.model_name||a))})]})})]})}export{S as default}; diff --git a/dist/assets/Register-DKE8xt5X.js b/dist/assets/Register-BJzJhrQt.js similarity index 96% rename from dist/assets/Register-DKE8xt5X.js rename to dist/assets/Register-BJzJhrQt.js index 6940356..def6729 100644 --- a/dist/assets/Register-DKE8xt5X.js +++ b/dist/assets/Register-BJzJhrQt.js @@ -1 +1 @@ -import{u as x,a as h,b as w,r as c,j as e,N as f,L as b,z as a}from"./index-ZavRXCeN.js";import{u as j}from"./useTranslation-KkRwPkkT.js";function y(){const{t:s}=j(),{register:d,user:m}=x(),{site:l}=h(),u=w(),[r,i]=c.useState({username:"",password:"",password2:"",email:""}),[n,o]=c.useState(!1);if(m)return e.jsx(f,{to:"/dashboard",replace:!0});const p=async t=>{if(t.preventDefault(),!r.username||!r.password){a.error(s("register.fillRequired"));return}if(r.password!==r.password2){a.error(s("register.passwordMismatch"));return}if(r.password.length<8){a.error(s("register.passwordLength"));return}if(r.password.length>20){a.error(s("register.passwordLength"));return}o(!0);try{if((await d({username:r.username,password:r.password,email:r.email||void 0})).success){a.success(s("register.accountCreated")),u("/login",{replace:!0});return}}catch{}o(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-2",children:s("register.createAccount")}),e.jsx("p",{className:"text-sm text-page-secondary",children:l!=null&&l.name?s("register.getStartedWith",{name:l.name}):s("register.getStartedDefault")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.username")," *"]}),e.jsx("input",{type:"text",value:r.username,onChange:t=>i({...r,username:t.target.value}),className:"input",placeholder:s("register.chooseUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("register.email")}),e.jsx("input",{type:"email",value:r.email,onChange:t=>i({...r,email:t.target.value}),className:"input",placeholder:s("register.emailPlaceholder"),autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.password")," *"]}),e.jsx("input",{type:"password",value:r.password,onChange:t=>i({...r,password:t.target.value}),className:"input",placeholder:s("register.passwordPlaceholder"),autoComplete:"new-password",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.confirmPassword")," *"]}),e.jsx("input",{type:"password",value:r.password2,onChange:t=>i({...r,password2:t.target.value}),className:"input",placeholder:s("register.repeatPassword"),autoComplete:"new-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:n,className:"btn-primary w-full flex items-center justify-center gap-2",children:[n&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(n?"register.creating":"register.createAccountBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-page-secondary",children:[s("register.hasAccount")," ",e.jsx(b,{to:"/login",className:"text-page-link hover:text-page-link transition-colors font-medium",children:s("register.signIn")})]})})]})})})}export{y as default}; +import{u as x,a as h,b as w,r as c,j as e,N as f,L as b,z as a}from"./index-DOUW22cV.js";import{u as j}from"./useTranslation-Ce9HcVki.js";function y(){const{t:s}=j(),{register:d,user:m}=x(),{site:l}=h(),u=w(),[r,i]=c.useState({username:"",password:"",password2:"",email:""}),[n,o]=c.useState(!1);if(m)return e.jsx(f,{to:"/dashboard",replace:!0});const p=async t=>{if(t.preventDefault(),!r.username||!r.password){a.error(s("register.fillRequired"));return}if(r.password!==r.password2){a.error(s("register.passwordMismatch"));return}if(r.password.length<8){a.error(s("register.passwordLength"));return}if(r.password.length>20){a.error(s("register.passwordLength"));return}o(!0);try{if((await d({username:r.username,password:r.password,email:r.email||void 0})).success){a.success(s("register.accountCreated")),u("/login",{replace:!0});return}}catch{}o(!1)};return e.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-6",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"glass rounded-2xl p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-2",children:s("register.createAccount")}),e.jsx("p",{className:"text-sm text-page-secondary",children:l!=null&&l.name?s("register.getStartedWith",{name:l.name}):s("register.getStartedDefault")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.username")," *"]}),e.jsx("input",{type:"text",value:r.username,onChange:t=>i({...r,username:t.target.value}),className:"input",placeholder:s("register.chooseUsername"),autoComplete:"username",required:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:s("register.email")}),e.jsx("input",{type:"email",value:r.email,onChange:t=>i({...r,email:t.target.value}),className:"input",placeholder:s("register.emailPlaceholder"),autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.password")," *"]}),e.jsx("input",{type:"password",value:r.password,onChange:t=>i({...r,password:t.target.value}),className:"input",placeholder:s("register.passwordPlaceholder"),autoComplete:"new-password",required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-page-label mb-1.5",children:[s("register.confirmPassword")," *"]}),e.jsx("input",{type:"password",value:r.password2,onChange:t=>i({...r,password2:t.target.value}),className:"input",placeholder:s("register.repeatPassword"),autoComplete:"new-password",required:!0})]}),e.jsxs("button",{type:"submit",disabled:n,className:"btn-primary w-full flex items-center justify-center gap-2",children:[n&&e.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),s(n?"register.creating":"register.createAccountBtn")]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-page-secondary",children:[s("register.hasAccount")," ",e.jsx(b,{to:"/login",className:"text-page-link hover:text-page-link transition-colors font-medium",children:s("register.signIn")})]})})]})})})}export{y as default}; diff --git a/dist/assets/RotatingEquiv-BiNhXD16.js b/dist/assets/RotatingEquiv-Dcm5hOLy.js similarity index 97% rename from dist/assets/RotatingEquiv-BiNhXD16.js rename to dist/assets/RotatingEquiv-Dcm5hOLy.js index 5e43ee0..004f93e 100644 --- a/dist/assets/RotatingEquiv-BiNhXD16.js +++ b/dist/assets/RotatingEquiv-Dcm5hOLy.js @@ -1 +1 @@ -import{r as s,j as P}from"./index-ZavRXCeN.js";const c=[{pattern:"claude-opus-4-5",label:"Claude Opus 4.5",inputPerMtok:5},{pattern:"claude-opus-4-6",label:"Claude Opus 4.6",inputPerMtok:5},{pattern:"claude-opus-4-1",label:"Claude Opus 4.1",inputPerMtok:15},{pattern:"claude-opus-4",label:"Claude Opus 4",inputPerMtok:15},{pattern:"claude-3-opus",label:"Claude 3 Opus",inputPerMtok:15},{pattern:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",inputPerMtok:3},{pattern:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",inputPerMtok:3},{pattern:"claude-sonnet-4",label:"Claude Sonnet 4",inputPerMtok:3},{pattern:"claude-3-7-sonnet",label:"Claude 3.7 Sonnet",inputPerMtok:3},{pattern:"claude-3-5-sonnet",label:"Claude 3.5 Sonnet",inputPerMtok:3},{pattern:"claude-haiku-4-5",label:"Claude Haiku 4.5",inputPerMtok:1},{pattern:"claude-3-5-haiku",label:"Claude 3.5 Haiku",inputPerMtok:.8},{pattern:"claude-3-haiku",label:"Claude 3 Haiku",inputPerMtok:.25},{pattern:"gpt-4o-mini",label:"GPT-4o Mini",inputPerMtok:.15},{pattern:"gpt-4o-2024-05-13",label:"GPT-4o",inputPerMtok:5},{pattern:"chatgpt-4o-latest",label:"GPT-4o",inputPerMtok:5},{pattern:"gpt-4o",label:"GPT-4o",inputPerMtok:2.5},{pattern:"gpt-4.1-mini",label:"GPT-4.1 Mini",inputPerMtok:.4},{pattern:"gpt-4.1-nano",label:"GPT-4.1 Nano",inputPerMtok:.1},{pattern:"gpt-4.1",label:"GPT-4.1",inputPerMtok:2},{pattern:"gpt-5.4",label:"GPT-5.4",inputPerMtok:2.5},{pattern:"gpt-5.3",label:"GPT-5.3",inputPerMtok:1.75},{pattern:"gpt-5.2",label:"GPT-5.2",inputPerMtok:1.75},{pattern:"gpt-5.1",label:"GPT-5.1",inputPerMtok:1.25},{pattern:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash Lite",inputPerMtok:.04},{pattern:"gemini-2.5-flash",label:"Gemini 2.5 Flash",inputPerMtok:.15},{pattern:"gemini-2.5-pro",label:"Gemini 2.5 Pro",inputPerMtok:1.25},{pattern:"gemini-2.0-flash",label:"Gemini 2.0 Flash",inputPerMtok:.1},{pattern:"gemini-1.5-pro",label:"Gemini 1.5 Pro",inputPerMtok:1.25},{pattern:"gemini-1.5-flash",label:"Gemini 1.5 Flash",inputPerMtok:.075},{pattern:"deepseek-r1",label:"DeepSeek R1",inputPerMtok:.55},{pattern:"deepseek-chat",label:"DeepSeek V3",inputPerMtok:.27},{pattern:"deepseek-v3",label:"DeepSeek V3",inputPerMtok:.27}];function b(e,r){if(!e||e.length===0||r<=0)return[];const l={};for(const t of e){const n=Number(t.input_price);if(!n||n<=0)continue;const o=(t.model_name||"").toLowerCase();for(const a of c)if(o.includes(a.pattern.toLowerCase())){const p=n*1e3,u=a.inputPerMtok/p,i=r*u;i>r&&(!l[a.label]||i>l[a.label])&&(l[a.label]=i);break}}return Object.entries(l).map(([t,n])=>({label:t,equivDollars:Math.round(n)})).sort((t,n)=>n.equivDollars-t.equivDollars).slice(0,3)}function M({items:e,text:r,className:l="",interval:t=3e3}){const[n,o]=s.useState(0),[a,p]=s.useState(!0);return s.useEffect(()=>{if(e.length<=1)return;const u=setInterval(()=>{p(!1),setTimeout(()=>{o(i=>(i+1)%e.length),p(!0)},300)},t);return()=>clearInterval(u)},[e.length,t]),!e||e.length===0?null:P.jsx("span",{className:`inline-block transition-all duration-300 ${a?"opacity-100 translate-y-0":"opacity-0 translate-y-1"} ${l}`,children:r(e[n])})}export{M as R,b as c}; +import{r as s,j as P}from"./index-DOUW22cV.js";const c=[{pattern:"claude-opus-4-5",label:"Claude Opus 4.5",inputPerMtok:5},{pattern:"claude-opus-4-6",label:"Claude Opus 4.6",inputPerMtok:5},{pattern:"claude-opus-4-1",label:"Claude Opus 4.1",inputPerMtok:15},{pattern:"claude-opus-4",label:"Claude Opus 4",inputPerMtok:15},{pattern:"claude-3-opus",label:"Claude 3 Opus",inputPerMtok:15},{pattern:"claude-sonnet-4-5",label:"Claude Sonnet 4.5",inputPerMtok:3},{pattern:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",inputPerMtok:3},{pattern:"claude-sonnet-4",label:"Claude Sonnet 4",inputPerMtok:3},{pattern:"claude-3-7-sonnet",label:"Claude 3.7 Sonnet",inputPerMtok:3},{pattern:"claude-3-5-sonnet",label:"Claude 3.5 Sonnet",inputPerMtok:3},{pattern:"claude-haiku-4-5",label:"Claude Haiku 4.5",inputPerMtok:1},{pattern:"claude-3-5-haiku",label:"Claude 3.5 Haiku",inputPerMtok:.8},{pattern:"claude-3-haiku",label:"Claude 3 Haiku",inputPerMtok:.25},{pattern:"gpt-4o-mini",label:"GPT-4o Mini",inputPerMtok:.15},{pattern:"gpt-4o-2024-05-13",label:"GPT-4o",inputPerMtok:5},{pattern:"chatgpt-4o-latest",label:"GPT-4o",inputPerMtok:5},{pattern:"gpt-4o",label:"GPT-4o",inputPerMtok:2.5},{pattern:"gpt-4.1-mini",label:"GPT-4.1 Mini",inputPerMtok:.4},{pattern:"gpt-4.1-nano",label:"GPT-4.1 Nano",inputPerMtok:.1},{pattern:"gpt-4.1",label:"GPT-4.1",inputPerMtok:2},{pattern:"gpt-5.4",label:"GPT-5.4",inputPerMtok:2.5},{pattern:"gpt-5.3",label:"GPT-5.3",inputPerMtok:1.75},{pattern:"gpt-5.2",label:"GPT-5.2",inputPerMtok:1.75},{pattern:"gpt-5.1",label:"GPT-5.1",inputPerMtok:1.25},{pattern:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash Lite",inputPerMtok:.04},{pattern:"gemini-2.5-flash",label:"Gemini 2.5 Flash",inputPerMtok:.15},{pattern:"gemini-2.5-pro",label:"Gemini 2.5 Pro",inputPerMtok:1.25},{pattern:"gemini-2.0-flash",label:"Gemini 2.0 Flash",inputPerMtok:.1},{pattern:"gemini-1.5-pro",label:"Gemini 1.5 Pro",inputPerMtok:1.25},{pattern:"gemini-1.5-flash",label:"Gemini 1.5 Flash",inputPerMtok:.075},{pattern:"deepseek-r1",label:"DeepSeek R1",inputPerMtok:.55},{pattern:"deepseek-chat",label:"DeepSeek V3",inputPerMtok:.27},{pattern:"deepseek-v3",label:"DeepSeek V3",inputPerMtok:.27}];function b(e,r){if(!e||e.length===0||r<=0)return[];const l={};for(const t of e){const n=Number(t.input_price);if(!n||n<=0)continue;const o=(t.model_name||"").toLowerCase();for(const a of c)if(o.includes(a.pattern.toLowerCase())){const p=n*1e3,u=a.inputPerMtok/p,i=r*u;i>r&&(!l[a.label]||i>l[a.label])&&(l[a.label]=i);break}}return Object.entries(l).map(([t,n])=>({label:t,equivDollars:Math.round(n)})).sort((t,n)=>n.equivDollars-t.equivDollars).slice(0,3)}function M({items:e,text:r,className:l="",interval:t=3e3}){const[n,o]=s.useState(0),[a,p]=s.useState(!0);return s.useEffect(()=>{if(e.length<=1)return;const u=setInterval(()=>{p(!1),setTimeout(()=>{o(i=>(i+1)%e.length),p(!0)},300)},t);return()=>clearInterval(u)},[e.length,t]),!e||e.length===0?null:P.jsx("span",{className:`inline-block transition-all duration-300 ${a?"opacity-100 translate-y-0":"opacity-0 translate-y-1"} ${l}`,children:r(e[n])})}export{M as R,b as c}; diff --git a/dist/assets/Tokens-CuYAJu3t.js b/dist/assets/Tokens-BD_w3cXB.js similarity index 99% rename from dist/assets/Tokens-CuYAJu3t.js rename to dist/assets/Tokens-BD_w3cXB.js index fbafed8..0ba579f 100644 --- a/dist/assets/Tokens-CuYAJu3t.js +++ b/dist/assets/Tokens-BD_w3cXB.js @@ -1,4 +1,4 @@ -import{r as o,f as E,h as I,j as e,z as C,i as P,k as W,l as U}from"./index-ZavRXCeN.js";import{u as K}from"./useTranslation-KkRwPkkT.js";const F=()=>{var D;const{t}=K(),[v,_]=o.useState([]),[i,L]=o.useState(null),[S,m]=o.useState([]),[l,j]=o.useState(""),[p,A]=o.useState("claudecode"),[H,$]=o.useState(!0),[y,M]=o.useState(!1),[u,x]=o.useState(""),[h,k]=o.useState(!1),T=o.useRef(null),d=window.location.origin,N=[{id:"claudecode",name:"Claude Code",path:"~/.claude/settings.json"},{id:"openclaw",name:"OpenClaw",path:"~/.openclaw/openclaw.json"},{id:"opencode",name:"OpenCode",path:"~/.config/opencode/opencode.json"},{id:"cursor",name:"Cursor",path:"Settings → Models → OpenAI API Key"},{id:"curl",name:"cURL",path:"Terminal"},{id:"python",name:"Python SDK",path:"main.py"},{id:"anthropic",name:"Anthropic SDK",path:"main.py"}];o.useEffect(()=>{a()},[]),o.useEffect(()=>{i&&f(i)},[i]),o.useEffect(()=>{const s=n=>{T.current&&!T.current.contains(n.target)&&k(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const a=async()=>{$(!0);try{const s=await E();if(s.data.success){const n=s.data.data||[];_(n),n.length>0&&L(n[0])}}catch{}$(!1)},f=async s=>{try{if(s.model_limits_enabled&&s.model_limits){const r=s.model_limits.split(",").filter(g=>g.trim());m(r),r.length>0&&j(r[0]);return}const n=await I();if(n.data.success&&n.data.data){const g=(Array.isArray(n.data.data)?n.data.data:n.data.data.items||[]).map(b=>b.model_name||b.id||b);m(g),g.length>0&&j(g[0])}}catch{}},c=s=>{const n=s.toLowerCase();return n.includes("claude")?{provider:"anthropic",api:"anthropic-messages"}:n.includes("gpt")||n.includes("o1")||n.includes("o3")?{provider:"openai",api:"openai-chat"}:n.includes("gemini")?{provider:"google",api:"google-chat"}:{provider:"openai",api:"openai-chat"}},w=()=>{if(!i||!l)return"";const s="sk-"+i.key;switch(p){case"claudecode":return`{ +import{r as o,f as E,h as I,j as e,z as C,i as P,k as W,l as U}from"./index-DOUW22cV.js";import{u as K}from"./useTranslation-Ce9HcVki.js";const F=()=>{var D;const{t}=K(),[v,_]=o.useState([]),[i,L]=o.useState(null),[S,m]=o.useState([]),[l,j]=o.useState(""),[p,A]=o.useState("claudecode"),[H,$]=o.useState(!0),[y,M]=o.useState(!1),[u,x]=o.useState(""),[h,k]=o.useState(!1),T=o.useRef(null),d=window.location.origin,N=[{id:"claudecode",name:"Claude Code",path:"~/.claude/settings.json"},{id:"openclaw",name:"OpenClaw",path:"~/.openclaw/openclaw.json"},{id:"opencode",name:"OpenCode",path:"~/.config/opencode/opencode.json"},{id:"cursor",name:"Cursor",path:"Settings → Models → OpenAI API Key"},{id:"curl",name:"cURL",path:"Terminal"},{id:"python",name:"Python SDK",path:"main.py"},{id:"anthropic",name:"Anthropic SDK",path:"main.py"}];o.useEffect(()=>{a()},[]),o.useEffect(()=>{i&&f(i)},[i]),o.useEffect(()=>{const s=n=>{T.current&&!T.current.contains(n.target)&&k(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const a=async()=>{$(!0);try{const s=await E();if(s.data.success){const n=s.data.data||[];_(n),n.length>0&&L(n[0])}}catch{}$(!1)},f=async s=>{try{if(s.model_limits_enabled&&s.model_limits){const r=s.model_limits.split(",").filter(g=>g.trim());m(r),r.length>0&&j(r[0]);return}const n=await I();if(n.data.success&&n.data.data){const g=(Array.isArray(n.data.data)?n.data.data:n.data.data.items||[]).map(b=>b.model_name||b.id||b);m(g),g.length>0&&j(g[0])}}catch{}},c=s=>{const n=s.toLowerCase();return n.includes("claude")?{provider:"anthropic",api:"anthropic-messages"}:n.includes("gpt")||n.includes("o1")||n.includes("o3")?{provider:"openai",api:"openai-chat"}:n.includes("gemini")?{provider:"google",api:"google-chat"}:{provider:"openai",api:"openai-chat"}},w=()=>{if(!i||!l)return"";const s="sk-"+i.key;switch(p){case"claudecode":return`{ "env": { "ANTHROPIC_API_KEY": "${s}", "ANTHROPIC_BASE_URL": "${d}/", diff --git a/dist/assets/Topup-CKiSzFS9.js b/dist/assets/Topup-BkvooF5h.js similarity index 99% rename from dist/assets/Topup-CKiSzFS9.js rename to dist/assets/Topup-BkvooF5h.js index 314ec82..2c71a50 100644 --- a/dist/assets/Topup-CKiSzFS9.js +++ b/dist/assets/Topup-BkvooF5h.js @@ -1 +1 @@ -import{u as Oe,a as $e,d as Me,r as n,g as Ee,o as Le,j as e,Q as ae,e as Ue,z as d,p as He,q as Re,t as Fe,v as De,w as ze,x as Be,y as We}from"./index-ZavRXCeN.js";import{C as H}from"./CountUp-2H8PJb3I.js";import{u as Qe}from"./useTranslation-KkRwPkkT.js";function Xe(){var ee;const{t:s}=Qe(),{user:i,refreshUser:R}=Oe(),{site:r}=$e(),{symbol:S,rate:$}=Me(),[m,le]=n.useState(null),[l,ne]=n.useState(null),[re,F]=n.useState(!0),[M,D]=n.useState(""),[z,B]=n.useState(!1),[h,E]=n.useState(""),[ce,L]=n.useState(null),[W,Q]=n.useState(null),[oe,J]=n.useState(!1),[b,y]=n.useState(!1),[U,f]=n.useState(""),[C,k]=n.useState(null),[de,j]=n.useState(!1),[p,V]=n.useState(""),[P,ie]=n.useState("usdt"),[N,me]=n.useState(null),[A,pe]=n.useState(!1),[G,ue]=n.useState([]),[xe,K]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const q=n.useCallback(async()=>{var t;F(!0);try{const[a,c]=await Promise.all([Ee(),r!=null&&r.enable_topup?Le().catch(()=>null):Promise.resolve(null)]);a.data.success&&le(a.data.data),(t=c==null?void 0:c.data)!=null&&t.data&&ne(c.data.data)}catch{}F(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{q()},[q]);const X=(m==null?void 0:m.quota)??(i==null?void 0:i.quota)??0,ge=(m==null?void 0:m.used_quota)??(i==null?void 0:i.used_quota)??0,he=(m==null?void 0:m.request_count)??(i==null?void 0:i.request_count)??0,be=X/ae*$,ye=async t=>{if(t.preventDefault(),!!M.trim()){B(!0);try{(await Ue(M.trim())).data.success&&(d.success(s("topup.redeemSuccess")),D(""),await Promise.all([q(),R()]))}catch{}B(!1)}},Y=async t=>{if(!t||t<=0){Q(null);return}J(!0);try{const a=await He({amount:parseInt(t)});a.data.message==="success"&&Q(a.data.data)}catch{}J(!1)},fe=t=>{L(t),E(t),Y(t)},je=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),Ne=async t=>{var c;const a=parseInt(h);if(!a||a<=0){d.error(s("topup.enterAmount"));return}y(!0),f(t);try{const u=window.location.origin+"/topup",_={amount:a,payment_method:t,return_url:u};if(je(t)){const o=await Re(_);if(o.data.message==="success"&&((c=o.data.data)!=null&&c.pay_link))window.open(o.data.data.pay_link,"_blank");else if(o.data.message!=="success"){const x=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(x||s("common.requestFailed"))}}else{const o=await Fe(_);if(o.data.message==="success"){const x=o.data.data,te=o.data.url;if(te&&x){const g=document.createElement("form");g.action=te,g.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(g.target="_blank");for(const se in x){const O=document.createElement("input");O.type="hidden",O.name=se,O.value=x[se],g.appendChild(O)}document.body.appendChild(g),g.submit(),document.body.removeChild(g)}}else{const x=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(x||s("common.requestFailed"))}}}catch{}y(!1),f("")},ve=async t=>{var a;y(!0),f("creem");try{const c=await De({product_id:t.productId,payment_method:"creem"});if(c.data.message==="success"&&((a=c.data.data)!=null&&a.checkout_url))window.open(c.data.data.checkout_url,"_blank");else if(c.data.message!=="success"){const u=typeof c.data.data=="string"?c.data.data:c.data.message;d.error(u||s("common.requestFailed"))}}catch{}y(!1),f("")},we=async()=>{const t=parseInt(h);if(!t||t<=0){d.error(s("topup.enterAmount"));return}if(!p){d.error(s("topup.selectChain"));return}if(!P){d.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await ze({amount:t,chain:p,token:P});if(a.data.message==="success"&&a.data.data)k(a.data.data),Ce(a.data.data.trade_no);else if(a.data.message!=="success"){const c=typeof a.data.data=="string"?a.data.data:a.data.message;d.error(c||s("common.requestFailed"))}}catch{}y(!1),f("")},Ce=t=>{j(!0);const a=setInterval(async()=>{var u,_;try{const o=await Be(t);((u=o.data.data)==null?void 0:u.status)==="success"?(clearInterval(a),j(!1),k(null),d.success(s("topup.paymentSuccess")),await Promise.all([q(),R()])):((_=o.data.data)==null?void 0:_.status)==="expired"&&(clearInterval(a),j(!1),d.error(s("topup.orderExpired")))}catch{clearInterval(a),j(!1)}},5e3),c=((l==null?void 0:l.crypto_expiry_minutes)||30)*60*1e3;setTimeout(()=>{clearInterval(a),j(!1)},c)},v=(l==null?void 0:l.crypto_wallets)||{},w=n.useMemo(()=>{const t=[];return v.tron&&t.push({key:"tron",label:"TRON (TRC20)"}),v.eth&&t.push({key:"eth",label:"Ethereum (ERC20)"}),v.bsc&&t.push({key:"bsc",label:"BSC (BEP20)"}),t},[v.tron,v.eth,v.bsc]);n.useEffect(()=>{w.length>0&&!p&&V(w[0].key)},[w,p]);const Z=n.useMemo(()=>{if(!(l!=null&&l.creem_products))return[];try{const t=typeof l.creem_products=="string"?JSON.parse(l.creem_products):l.creem_products;return Array.isArray(t)?t:[]}catch{return[]}},[l==null?void 0:l.creem_products]),_e=async()=>{var t;K(!0);try{const a=await We({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&ue(a.data.data.items)}catch{}K(!1)},Se=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],T=(l==null?void 0:l.min_topup)||1,ke=(l==null?void 0:l.pay_methods)||[],Pe=l==null?void 0:l.enable_online_topup,Ae=l==null?void 0:l.enable_stripe_topup,qe=l==null?void 0:l.enable_creem_topup,Te=l==null?void 0:l.enable_crypto_topup,I=ke.filter(t=>t.type!=="creem"&&t.type!=="crypto");return re?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:s("topup.title")}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("topup.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[S,e.jsx(H,{from:0,to:be,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:X.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[S,e.jsx(H,{from:0,to:ge/ae*$,duration:1.5})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-page",children:e.jsx(H,{from:0,to:he,duration:1.5})})]})]}),(r==null?void 0:r.enable_topup)&&(Pe||Ae)&&I.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page",children:s("topup.onlineTopup")}),e.jsx("button",{onClick:()=>{pe(!A),A||_e()},className:"text-sm text-page-secondary hover:text-page transition-colors",children:s(A?"topup.hideHistory":"topup.viewHistory")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-3",children:s("topup.selectAmount")}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Se.map(t=>e.jsxs("button",{onClick:()=>fe(t),className:`py-2.5 px-3 rounded-xl text-sm font-medium transition-all ${ce===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-label hover:text-page hover:bg-page-surface-hover"}`,children:[S,t]},t))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.customAmount")}),e.jsx("div",{className:"flex gap-3",children:e.jsx("input",{type:"number",value:h,onChange:t=>{E(t.target.value),L(null)},onBlur:t=>Y(t.target.value),min:T,placeholder:s("topup.amountPlaceholder",{min:T}),className:"input flex-1"})}),oe?e.jsx("p",{className:"text-xs text-page-muted mt-2",children:s("topup.calculating")}):W?e.jsxs("p",{className:"text-xs text-page-secondary mt-2",children:[s("topup.payAmountLabel"),": ",e.jsxs("span",{className:"text-page-success font-medium",children:["¥",W]})]}):null]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-3",children:s("topup.paymentMethod")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:I.map(t=>{const a=b&&U===t.type;return e.jsx("button",{onClick:()=>Ne(t.type),disabled:b||!h,className:"px-4 py-2.5 rounded-xl text-sm font-medium glass-sm text-page-label hover:text-page hover:bg-page-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:a?s("topup.processing"):t.name},t.type)})})]})]}),(r==null?void 0:r.enable_topup)&&qe&&Z.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.creemPayment")||"Creem Payment"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Z.map(t=>e.jsxs("div",{className:`glass-sm rounded-xl p-4 cursor-pointer transition-all ${(N==null?void 0:N.productId)===t.productId?"ring-2 ring-brand-500 bg-brand-500/10":"hover:bg-page-surface"}`,onClick:()=>me(t),children:[e.jsx("h3",{className:"text-sm font-semibold text-page mb-1",children:t.name}),e.jsxs("p",{className:"text-xl font-bold text-page-success mb-1",children:["$",t.price," ",e.jsx("span",{className:"text-xs text-page-muted font-normal",children:t.currency||"USD"})]}),t.quota&&e.jsx("p",{className:"text-xs text-page-secondary",children:s("topup.quotaIncluded")||`${t.quota} quota`})]},t.productId))}),N&&e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{onClick:()=>ve(N),disabled:b,className:"btn-primary px-6",children:b&&U==="creem"?s("topup.processing"):`${s("topup.payNow")||"Pay"} $${N.price}`})})]}),(r==null?void 0:r.enable_topup)&&Te&&w.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.amount")}),e.jsx("input",{type:"number",value:h,onChange:t=>{E(t.target.value),L(null)},min:T,placeholder:s("topup.amountPlaceholder",{min:T}),className:"input w-full"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.chain")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(t=>e.jsx("button",{onClick:()=>V(t.key),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${p===t.key?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-label hover:text-page hover:bg-page-surface-hover"}`,children:t.label},t.key))})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.token")||"Token"}),e.jsx("div",{className:"flex gap-2",children:["usdt","usdc"].map(t=>e.jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${P===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-label hover:text-page hover:bg-page-surface-hover"}`,children:t.toUpperCase()},t))})]}),e.jsx("button",{onClick:we,disabled:b||!h,className:"btn-primary w-full",children:b&&U==="crypto"?s("topup.processing"):`${s("topup.payWith")||"Pay with"} ${P.toUpperCase()} (${((ee=w.find(t=>t.key===p))==null?void 0:ee.label)||p})`})]}),C&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>k(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 max-w-md w-full mx-4",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{className:"text-lg font-semibold text-page mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-4",children:[e.jsx("p",{className:"text-xs text-page-secondary mb-1",children:s("topup.walletAddress")}),e.jsx("p",{className:"text-sm text-page font-mono break-all",children:C.wallet})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-page-secondary mb-1",children:s("topup.amount")}),e.jsxs("p",{className:"text-sm text-page font-medium",children:[C.amount," ",C.token]})]}),e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-page-secondary mb-1",children:s("topup.chain")}),e.jsx("p",{className:"text-sm text-page font-medium",children:C.chain})]})]}),de&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-page-secondary",children:[e.jsx("div",{className:"w-4 h-4 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"}),s("topup.waitingPayment")]}),e.jsx("button",{onClick:()=>{k(null),j(!1)},className:"w-full py-2 rounded-xl text-sm glass-sm text-page-secondary hover:text-page transition-colors",children:s("topup.close")})]})]})}),A&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.history")}),xe?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"w-6 h-6 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):G.length===0?e.jsx("p",{className:"text-sm text-page-muted text-center py-8",children:s("topup.noHistory")}):e.jsx("div",{className:"space-y-2",children:G.map((t,a)=>e.jsxs("div",{className:"flex items-center justify-between glass-sm rounded-xl px-4 py-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-page",children:[S,(Number(t.amount)*$).toFixed(2)]}),e.jsxs("p",{className:"text-xs text-page-muted",children:[new Date(t.create_time*1e3).toLocaleString()," · ",t.payment_method||s("topup.redeemCode")]})]}),e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${t.status==="success"?"bg-green-500/10 text-page-success":t.status==="pending"?"bg-yellow-500/10 text-page-warning":"bg-red-500/10 text-page-danger"}`,children:t.status==="success"?s("topup.statusSuccess"):t.status==="pending"?s("topup.statusPending"):s("topup.statusFailed")})]},a))})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.redeemTitle")}),e.jsxs("form",{onSubmit:ye,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:M,onChange:t=>D(t.target.value),className:"input flex-1",placeholder:s("topup.enterRedeemCode")}),e.jsx("button",{type:"submit",disabled:z,className:"btn-primary whitespace-nowrap",children:s(z?"topup.redeeming":"topup.redeem")})]})]})]})}export{Xe as default}; +import{u as Oe,a as $e,d as Me,r as n,g as Ee,o as Le,j as e,Q as ae,e as Ue,z as d,p as He,q as Re,t as Fe,v as De,w as ze,x as Be,y as We}from"./index-DOUW22cV.js";import{C as H}from"./CountUp-Ytak2XTa.js";import{u as Qe}from"./useTranslation-Ce9HcVki.js";function Xe(){var ee;const{t:s}=Qe(),{user:i,refreshUser:R}=Oe(),{site:r}=$e(),{symbol:S,rate:$}=Me(),[m,le]=n.useState(null),[l,ne]=n.useState(null),[re,F]=n.useState(!0),[M,D]=n.useState(""),[z,B]=n.useState(!1),[h,E]=n.useState(""),[ce,L]=n.useState(null),[W,Q]=n.useState(null),[oe,J]=n.useState(!1),[b,y]=n.useState(!1),[U,f]=n.useState(""),[C,k]=n.useState(null),[de,j]=n.useState(!1),[p,V]=n.useState(""),[P,ie]=n.useState("usdt"),[N,me]=n.useState(null),[A,pe]=n.useState(!1),[G,ue]=n.useState([]),[xe,K]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const q=n.useCallback(async()=>{var t;F(!0);try{const[a,c]=await Promise.all([Ee(),r!=null&&r.enable_topup?Le().catch(()=>null):Promise.resolve(null)]);a.data.success&&le(a.data.data),(t=c==null?void 0:c.data)!=null&&t.data&&ne(c.data.data)}catch{}F(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{q()},[q]);const X=(m==null?void 0:m.quota)??(i==null?void 0:i.quota)??0,ge=(m==null?void 0:m.used_quota)??(i==null?void 0:i.used_quota)??0,he=(m==null?void 0:m.request_count)??(i==null?void 0:i.request_count)??0,be=X/ae*$,ye=async t=>{if(t.preventDefault(),!!M.trim()){B(!0);try{(await Ue(M.trim())).data.success&&(d.success(s("topup.redeemSuccess")),D(""),await Promise.all([q(),R()]))}catch{}B(!1)}},Y=async t=>{if(!t||t<=0){Q(null);return}J(!0);try{const a=await He({amount:parseInt(t)});a.data.message==="success"&&Q(a.data.data)}catch{}J(!1)},fe=t=>{L(t),E(t),Y(t)},je=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),Ne=async t=>{var c;const a=parseInt(h);if(!a||a<=0){d.error(s("topup.enterAmount"));return}y(!0),f(t);try{const u=window.location.origin+"/topup",_={amount:a,payment_method:t,return_url:u};if(je(t)){const o=await Re(_);if(o.data.message==="success"&&((c=o.data.data)!=null&&c.pay_link))window.open(o.data.data.pay_link,"_blank");else if(o.data.message!=="success"){const x=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(x||s("common.requestFailed"))}}else{const o=await Fe(_);if(o.data.message==="success"){const x=o.data.data,te=o.data.url;if(te&&x){const g=document.createElement("form");g.action=te,g.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(g.target="_blank");for(const se in x){const O=document.createElement("input");O.type="hidden",O.name=se,O.value=x[se],g.appendChild(O)}document.body.appendChild(g),g.submit(),document.body.removeChild(g)}}else{const x=typeof o.data.data=="string"?o.data.data:o.data.message;d.error(x||s("common.requestFailed"))}}}catch{}y(!1),f("")},ve=async t=>{var a;y(!0),f("creem");try{const c=await De({product_id:t.productId,payment_method:"creem"});if(c.data.message==="success"&&((a=c.data.data)!=null&&a.checkout_url))window.open(c.data.data.checkout_url,"_blank");else if(c.data.message!=="success"){const u=typeof c.data.data=="string"?c.data.data:c.data.message;d.error(u||s("common.requestFailed"))}}catch{}y(!1),f("")},we=async()=>{const t=parseInt(h);if(!t||t<=0){d.error(s("topup.enterAmount"));return}if(!p){d.error(s("topup.selectChain"));return}if(!P){d.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await ze({amount:t,chain:p,token:P});if(a.data.message==="success"&&a.data.data)k(a.data.data),Ce(a.data.data.trade_no);else if(a.data.message!=="success"){const c=typeof a.data.data=="string"?a.data.data:a.data.message;d.error(c||s("common.requestFailed"))}}catch{}y(!1),f("")},Ce=t=>{j(!0);const a=setInterval(async()=>{var u,_;try{const o=await Be(t);((u=o.data.data)==null?void 0:u.status)==="success"?(clearInterval(a),j(!1),k(null),d.success(s("topup.paymentSuccess")),await Promise.all([q(),R()])):((_=o.data.data)==null?void 0:_.status)==="expired"&&(clearInterval(a),j(!1),d.error(s("topup.orderExpired")))}catch{clearInterval(a),j(!1)}},5e3),c=((l==null?void 0:l.crypto_expiry_minutes)||30)*60*1e3;setTimeout(()=>{clearInterval(a),j(!1)},c)},v=(l==null?void 0:l.crypto_wallets)||{},w=n.useMemo(()=>{const t=[];return v.tron&&t.push({key:"tron",label:"TRON (TRC20)"}),v.eth&&t.push({key:"eth",label:"Ethereum (ERC20)"}),v.bsc&&t.push({key:"bsc",label:"BSC (BEP20)"}),t},[v.tron,v.eth,v.bsc]);n.useEffect(()=>{w.length>0&&!p&&V(w[0].key)},[w,p]);const Z=n.useMemo(()=>{if(!(l!=null&&l.creem_products))return[];try{const t=typeof l.creem_products=="string"?JSON.parse(l.creem_products):l.creem_products;return Array.isArray(t)?t:[]}catch{return[]}},[l==null?void 0:l.creem_products]),_e=async()=>{var t;K(!0);try{const a=await We({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&ue(a.data.data.items)}catch{}K(!1)},Se=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],T=(l==null?void 0:l.min_topup)||1,ke=(l==null?void 0:l.pay_methods)||[],Pe=l==null?void 0:l.enable_online_topup,Ae=l==null?void 0:l.enable_stripe_topup,qe=l==null?void 0:l.enable_creem_topup,Te=l==null?void 0:l.enable_crypto_topup,I=ke.filter(t=>t.type!=="creem"&&t.type!=="crypto");return re?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-heading font-bold text-page mb-1",children:s("topup.title")}),e.jsx("p",{className:"text-sm text-page-secondary",children:s("topup.subtitle")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.balance")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[S,e.jsx(H,{from:0,to:be,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:X.toLocaleString()})})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.used")}),e.jsxs("div",{className:"text-3xl font-bold text-page",children:[S,e.jsx(H,{from:0,to:ge/ae*$,duration:1.5})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("p",{className:"text-sm text-page-secondary mb-2",children:s("dashboard.totalRequests")}),e.jsx("div",{className:"text-3xl font-bold text-page",children:e.jsx(H,{from:0,to:he,duration:1.5})})]})]}),(r==null?void 0:r.enable_topup)&&(Pe||Ae)&&I.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page",children:s("topup.onlineTopup")}),e.jsx("button",{onClick:()=>{pe(!A),A||_e()},className:"text-sm text-page-secondary hover:text-page transition-colors",children:s(A?"topup.hideHistory":"topup.viewHistory")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-3",children:s("topup.selectAmount")}),e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:Se.map(t=>e.jsxs("button",{onClick:()=>fe(t),className:`py-2.5 px-3 rounded-xl text-sm font-medium transition-all ${ce===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-label hover:text-page hover:bg-page-surface-hover"}`,children:[S,t]},t))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.customAmount")}),e.jsx("div",{className:"flex gap-3",children:e.jsx("input",{type:"number",value:h,onChange:t=>{E(t.target.value),L(null)},onBlur:t=>Y(t.target.value),min:T,placeholder:s("topup.amountPlaceholder",{min:T}),className:"input flex-1"})}),oe?e.jsx("p",{className:"text-xs text-page-muted mt-2",children:s("topup.calculating")}):W?e.jsxs("p",{className:"text-xs text-page-secondary mt-2",children:[s("topup.payAmountLabel"),": ",e.jsxs("span",{className:"text-page-success font-medium",children:["¥",W]})]}):null]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-3",children:s("topup.paymentMethod")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:I.map(t=>{const a=b&&U===t.type;return e.jsx("button",{onClick:()=>Ne(t.type),disabled:b||!h,className:"px-4 py-2.5 rounded-xl text-sm font-medium glass-sm text-page-label hover:text-page hover:bg-page-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-all",children:a?s("topup.processing"):t.name},t.type)})})]})]}),(r==null?void 0:r.enable_topup)&&qe&&Z.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.creemPayment")||"Creem Payment"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Z.map(t=>e.jsxs("div",{className:`glass-sm rounded-xl p-4 cursor-pointer transition-all ${(N==null?void 0:N.productId)===t.productId?"ring-2 ring-brand-500 bg-brand-500/10":"hover:bg-page-surface"}`,onClick:()=>me(t),children:[e.jsx("h3",{className:"text-sm font-semibold text-page mb-1",children:t.name}),e.jsxs("p",{className:"text-xl font-bold text-page-success mb-1",children:["$",t.price," ",e.jsx("span",{className:"text-xs text-page-muted font-normal",children:t.currency||"USD"})]}),t.quota&&e.jsx("p",{className:"text-xs text-page-secondary",children:s("topup.quotaIncluded")||`${t.quota} quota`})]},t.productId))}),N&&e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{onClick:()=>ve(N),disabled:b,className:"btn-primary px-6",children:b&&U==="creem"?s("topup.processing"):`${s("topup.payNow")||"Pay"} $${N.price}`})})]}),(r==null?void 0:r.enable_topup)&&Te&&w.length>0&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.amount")}),e.jsx("input",{type:"number",value:h,onChange:t=>{E(t.target.value),L(null)},min:T,placeholder:s("topup.amountPlaceholder",{min:T}),className:"input w-full"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.chain")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(t=>e.jsx("button",{onClick:()=>V(t.key),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${p===t.key?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-label hover:text-page hover:bg-page-surface-hover"}`,children:t.label},t.key))})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium text-page-label mb-2",children:s("topup.token")||"Token"}),e.jsx("div",{className:"flex gap-2",children:["usdt","usdc"].map(t=>e.jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${P===t?"bg-brand-500 text-white shadow-lg shadow-brand-500/25":"glass-sm text-page-label hover:text-page hover:bg-page-surface-hover"}`,children:t.toUpperCase()},t))})]}),e.jsx("button",{onClick:we,disabled:b||!h,className:"btn-primary w-full",children:b&&U==="crypto"?s("topup.processing"):`${s("topup.payWith")||"Pay with"} ${P.toUpperCase()} (${((ee=w.find(t=>t.key===p))==null?void 0:ee.label)||p})`})]}),C&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>k(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 max-w-md w-full mx-4",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{className:"text-lg font-semibold text-page mb-4",children:s("topup.cryptoPayment")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-4",children:[e.jsx("p",{className:"text-xs text-page-secondary mb-1",children:s("topup.walletAddress")}),e.jsx("p",{className:"text-sm text-page font-mono break-all",children:C.wallet})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-page-secondary mb-1",children:s("topup.amount")}),e.jsxs("p",{className:"text-sm text-page font-medium",children:[C.amount," ",C.token]})]}),e.jsxs("div",{className:"glass-sm rounded-xl p-3",children:[e.jsx("p",{className:"text-xs text-page-secondary mb-1",children:s("topup.chain")}),e.jsx("p",{className:"text-sm text-page font-medium",children:C.chain})]})]}),de&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-page-secondary",children:[e.jsx("div",{className:"w-4 h-4 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"}),s("topup.waitingPayment")]}),e.jsx("button",{onClick:()=>{k(null),j(!1)},className:"w-full py-2 rounded-xl text-sm glass-sm text-page-secondary hover:text-page transition-colors",children:s("topup.close")})]})]})}),A&&e.jsxs("div",{className:"glass rounded-2xl p-6 mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.history")}),xe?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("div",{className:"w-6 h-6 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):G.length===0?e.jsx("p",{className:"text-sm text-page-muted text-center py-8",children:s("topup.noHistory")}):e.jsx("div",{className:"space-y-2",children:G.map((t,a)=>e.jsxs("div",{className:"flex items-center justify-between glass-sm rounded-xl px-4 py-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-page",children:[S,(Number(t.amount)*$).toFixed(2)]}),e.jsxs("p",{className:"text-xs text-page-muted",children:[new Date(t.create_time*1e3).toLocaleString()," · ",t.payment_method||s("topup.redeemCode")]})]}),e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${t.status==="success"?"bg-green-500/10 text-page-success":t.status==="pending"?"bg-yellow-500/10 text-page-warning":"bg-red-500/10 text-page-danger"}`,children:t.status==="success"?s("topup.statusSuccess"):t.status==="pending"?s("topup.statusPending"):s("topup.statusFailed")})]},a))})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-page mb-4",children:s("topup.redeemTitle")}),e.jsxs("form",{onSubmit:ye,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:M,onChange:t=>D(t.target.value),className:"input flex-1",placeholder:s("topup.enterRedeemCode")}),e.jsx("button",{type:"submit",disabled:z,className:"btn-primary whitespace-nowrap",children:s(z?"topup.redeeming":"topup.redeem")})]})]})]})}export{Xe as default}; diff --git a/dist/assets/index-ZavRXCeN.js b/dist/assets/index-DOUW22cV.js similarity index 94% rename from dist/assets/index-ZavRXCeN.js rename to dist/assets/index-DOUW22cV.js index fe70e19..df88aa0 100644 --- a/dist/assets/index-ZavRXCeN.js +++ b/dist/assets/index-DOUW22cV.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-C5feFwVH.js","assets/RotatingEquiv-BiNhXD16.js","assets/CountUp-2H8PJb3I.js","assets/FadeContent-DnAL-lQG.js","assets/useTranslation-KkRwPkkT.js","assets/Layout-CAIME1iu.js","assets/LanguageSwitch-fmTd22QU.js","assets/Home-CdwZT6r7.js","assets/Layout-Bs88cVzM.js","assets/Home-D7LBRdbE.js","assets/Layout-BjSxzlL0.js","assets/Home-D4cv4oTQ.js","assets/Layout--sek2SXK.js","assets/Home-BI1Qa494.js","assets/Layout-3U5lz1BM.js","assets/Home-DLOG4B7x.js","assets/Layout-Cv1wXPfX.js","assets/Home-DCfMIsOA.js","assets/Layout-Cu3KXPx6.js","assets/Login-BZ-Yy-uQ.js","assets/Register-DKE8xt5X.js","assets/Dashboard-CMrh_5yV.js","assets/Tokens-CuYAJu3t.js","assets/Packages-DkFQKW15.js","assets/Pricing-CdVyLR6o.js","assets/Topup-CKiSzFS9.js","assets/Logs-Br0U5gGP.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-DuzKUQBe.js","assets/RotatingEquiv-Dcm5hOLy.js","assets/CountUp-Ytak2XTa.js","assets/FadeContent-DN0-6f2h.js","assets/useTranslation-Ce9HcVki.js","assets/Layout-DaloeA7I.js","assets/LanguageSwitch-Dn1Lth1H.js","assets/Home-BBk8paQW.js","assets/Layout-D-RGC5l0.js","assets/Home-NjW2RUrZ.js","assets/Layout-D0gFUpiK.js","assets/Home-BxpaS5R5.js","assets/Layout-CUZzo-Vw.js","assets/Home-KTKrKeDU.js","assets/Layout-lQQhtT0p.js","assets/Home-DMzxmSBb.js","assets/Layout-CISyGCfm.js","assets/Home-CR3Oy2_s.js","assets/Layout-CPY5kYpQ.js","assets/Login-BiHdkYGn.js","assets/Register-BJzJhrQt.js","assets/Dashboard-6T-v2duE.js","assets/Tokens-BD_w3cXB.js","assets/Packages-DTfyBY5U.js","assets/Pricing-BYGRhypH.js","assets/Topup-BkvooF5h.js","assets/Logs-DPdRMLgj.js"])))=>i.map(i=>d[i]); function Hp(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ic={exports:{}},mi={},Dc={exports:{}},z={};/** * @license React * react.production.min.js @@ -246,4 +246,4 @@ to { `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[rc]=this[rc]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=lr(s);r[l]||(E0(o,s),r[l]=!0)}return S.isArray(t)?t.forEach(i):i(t),this}};De.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);S.reduceDescriptors(De.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});S.freezeMethods(De);function ys(e,t){const n=this||eo,r=t||n,o=De.from(r.headers);let i=r.data;return S.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ep(e){return!!(e&&e.__CANCEL__)}let to=class extends I{constructor(t,n,r){super(t??"canceled",I.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Cp(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new I("Request failed with status code "+n.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function C0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function P0(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=r[i];s||(s=u),n[o]=a,r[o]=u;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-s{n=c,o=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?s(u,c):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-f)))},()=>o&&s(o)]}const di=(e,t,n=3)=>{let r=0;const o=P0(50,250);return O0(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,a=s-r,u=o(a),c=s<=l;r=s;const f={loaded:s,total:l,progress:l?s/l:void 0,bytes:a,rate:u||void 0,estimated:u&&l&&c?(l-s)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},oc=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ic=e=>(...t)=>S.asap(()=>e(...t)),R0=we.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,we.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(we.origin),we.navigator&&/(msie|trident)/i.test(we.navigator.userAgent)):()=>!0,_0=we.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),S.isString(r)&&l.push(`path=${r}`),S.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),S.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function L0(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function T0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Pp(e,t,n){let r=!L0(t);return e&&(r||n==!1)?T0(e,t):t}const sc=e=>e instanceof De?{...e}:e;function hn(e,t){t=t||{};const n={};function r(u,c,f,p){return S.isPlainObject(u)&&S.isPlainObject(c)?S.merge.call({caseless:p},u,c):S.isPlainObject(c)?S.merge({},c):S.isArray(c)?c.slice():c}function o(u,c,f,p){if(S.isUndefined(c)){if(!S.isUndefined(u))return r(void 0,u,f,p)}else return r(u,c,f,p)}function i(u,c){if(!S.isUndefined(c))return r(void 0,c)}function s(u,c){if(S.isUndefined(c)){if(!S.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const a={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,c,f)=>o(sc(u),sc(c),f,!0)};return S.forEach(Object.keys({...e,...t}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const f=S.hasOwnProp(a,c)?a[c]:o,p=f(e[c],t[c],c);S.isUndefined(p)&&f!==l||(n[c]=p)}),n}const Op=e=>{const t=hn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=De.from(s),t.url=kp(Pp(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(n)){if(we.hasStandardBrowserEnv||we.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(S.isFunction(n.getHeaders)){const a=n.getHeaders(),u=["content-type","content-length"];Object.entries(a).forEach(([c,f])=>{u.includes(c.toLowerCase())&&s.set(c,f)})}}if(we.hasStandardBrowserEnv&&(r&&S.isFunction(r)&&(r=r(t)),r||r!==!1&&R0(t.url))){const a=o&&i&&_0.read(i);a&&s.set(o,a)}return t},N0=typeof XMLHttpRequest<"u",A0=N0&&function(e){return new Promise(function(n,r){const o=Op(e);let i=o.data;const s=De.from(o.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:u}=o,c,f,p,y,d;function v(){y&&y(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function g(){if(!w)return;const m=De.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:m,config:e,request:w};Cp(function(P){n(P),v()},function(P){r(P),v()},E),w=null}"onloadend"in w?w.onloadend=g:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(g)},w.onabort=function(){w&&(r(new I("Request aborted",I.ECONNABORTED,e,w)),w=null)},w.onerror=function(k){const E=k&&k.message?k.message:"Network Error",R=new I(E,I.ERR_NETWORK,e,w);R.event=k||null,r(R),w=null},w.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const E=o.transitional||La;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),r(new I(k,E.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,w)),w=null},i===void 0&&s.setContentType(null),"setRequestHeader"in w&&S.forEach(s.toJSON(),function(k,E){w.setRequestHeader(E,k)}),S.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),l&&l!=="json"&&(w.responseType=o.responseType),u&&([p,d]=di(u,!0),w.addEventListener("progress",p)),a&&w.upload&&([f,y]=di(a),w.upload.addEventListener("progress",f),w.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(c=m=>{w&&(r(!m||m.type?new to(null,e,w):m),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const h=C0(o.url);if(h&&we.protocols.indexOf(h)===-1){r(new I("Unsupported protocol "+h+":",I.ERR_BAD_REQUEST,e));return}w.send(i||null)})},I0=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,l();const c=u instanceof Error?u:this.reason;r.abort(c instanceof I?c:new to(c instanceof Error?c.message:c))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout of ${t}ms exceeded`,I.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>S.asap(l),a}},D0=function*(e,t){let n=e.byteLength;if(n{const o=F0(e,t);let i=0,s,l=a=>{s||(s=!0,r&&r(a))};return new ReadableStream({async pull(a){try{const{done:u,value:c}=await o.next();if(u){l(),a.close();return}let f=c.byteLength;if(n){let p=i+=f;n(p)}a.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(a){return l(a),o.return()}},{highWaterMark:2})},ac=64*1024,{isFunction:xo}=S,$0=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:uc,TextEncoder:cc}=S.global,fc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},z0=e=>{e=S.merge.call({skipUndefined:!0},$0,e);const{fetch:t,Request:n,Response:r}=e,o=t?xo(t):typeof fetch=="function",i=xo(n),s=xo(r);if(!o)return!1;const l=o&&xo(uc),a=o&&(typeof cc=="function"?(d=>v=>d.encode(v))(new cc):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=i&&l&&fc(()=>{let d=!1;const v=new n(we.origin,{body:new uc,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!v}),c=s&&l&&fc(()=>S.isReadableStream(new r("").body)),f={stream:c&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(v,w)=>{let g=v&&v[d];if(g)return g.call(v);throw new I(`Response type '${d}' is not supported`,I.ERR_NOT_SUPPORT,w)})});const p=async d=>{if(d==null)return 0;if(S.isBlob(d))return d.size;if(S.isSpecCompliantForm(d))return(await new n(we.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(S.isArrayBufferView(d)||S.isArrayBuffer(d))return d.byteLength;if(S.isURLSearchParams(d)&&(d=d+""),S.isString(d))return(await a(d)).byteLength},y=async(d,v)=>{const w=S.toFiniteNumber(d.getContentLength());return w??p(v)};return async d=>{let{url:v,method:w,data:g,signal:h,cancelToken:m,timeout:k,onDownloadProgress:E,onUploadProgress:R,responseType:P,headers:L,withCredentials:$="same-origin",fetchOptions:T}=Op(d),pe=t||fetch;P=P?(P+"").toLowerCase():"text";let Be=I0([h,m&&m.toAbortSignal()],k),V=null;const X=Be&&Be.unsubscribe&&(()=>{Be.unsubscribe()});let Yt;try{if(R&&u&&w!=="get"&&w!=="head"&&(Yt=await y(L,g))!==0){let F=new n(v,{method:"POST",body:g,duplex:"half"}),U;if(S.isFormData(g)&&(U=F.headers.get("content-type"))&&L.setContentType(U),F.body){const[Re,ke]=oc(Yt,di(ic(R)));g=lc(F.body,ac,Re,ke)}}S.isString($)||($=$?"include":"omit");const b=i&&"credentials"in n.prototype,he={...T,signal:Be,method:w.toUpperCase(),headers:L.normalize().toJSON(),body:g,duplex:"half",credentials:b?$:void 0};V=i&&new n(v,he);let O=await(i?pe(V,T):pe(v,he));const N=c&&(P==="stream"||P==="response");if(c&&(E||N&&X)){const F={};["status","statusText","headers"].forEach(ft=>{F[ft]=O[ft]});const U=S.toFiniteNumber(O.headers.get("content-length")),[Re,ke]=E&&oc(U,di(ic(E),!0))||[];O=new r(lc(O.body,ac,Re,()=>{ke&&ke(),X&&X()}),F)}P=P||"text";let j=await f[S.findKey(f,P)||"text"](O,d);return!N&&X&&X(),await new Promise((F,U)=>{Cp(F,U,{data:j,headers:De.from(O.headers),status:O.status,statusText:O.statusText,config:d,request:V})})}catch(b){throw X&&X(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,d,V,b&&b.response),{cause:b.cause||b}):I.from(b,b&&b.code,d,V,b&&b.response)}}},U0=new Map,Rp=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s=i.length,l=s,a,u,c=U0;for(;l--;)a=i[l],u=c.get(a),u===void 0&&c.set(a,u=l?new Map:z0(t)),c=u;return u};Rp();const Na={http:n0,xhr:A0,fetch:{get:Rp}};S.forEach(Na,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const dc=e=>`- ${e}`,M0=e=>S.isFunction(e)||e===null||e===!1;function b0(e,t){e=S.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=n?s.length>1?`since : `+s.map(dc).join(` `):" "+dc(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const _p={getAdapter:b0,adapters:Na};function vs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new to(null,e)}function pc(e){return vs(e),e.headers=De.from(e.headers),e.data=ys.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_p.getAdapter(e.adapter||eo.adapter,e)(e).then(function(r){return vs(e),r.data=ys.call(e,e.transformResponse,r),r.headers=De.from(r.headers),r},function(r){return Ep(r)||(vs(e),r&&r.response&&(r.response.data=ys.call(e,e.transformResponse,r.response),r.response.headers=De.from(r.response.headers))),Promise.reject(r)})}const Lp="1.13.6",Ui={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ui[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const hc={};Ui.transitional=function(t,n,r){function o(i,s){return"[Axios v"+Lp+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,l)=>{if(t===!1)throw new I(o(s," has been removed"+(n?" in "+n:"")),I.ERR_DEPRECATED);return n&&!hc[s]&&(hc[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,l):!0}};Ui.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function B0(e,t,n){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const l=e[i],a=l===void 0||s(l,i,e);if(a!==!0)throw new I("option "+i+" must be "+a,I.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Uo={assertOptions:B0,validators:Ui},Ve=Uo.validators;let an=class{constructor(t){this.defaults=t||{},this.interceptors={request:new nc,response:new nc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Uo.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean),legacyInterceptorReqResOrdering:Ve.transitional(Ve.boolean)},!1),o!=null&&(S.isFunction(o)?n.paramsSerializer={serialize:o}:Uo.assertOptions(o,{encode:Ve.function,serialize:Ve.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Uo.assertOptions(n,{baseUrl:Ve.spelling("baseURL"),withXsrfToken:Ve.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=De.concat(s,i);const l=[];let a=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;a=a&&v.synchronous;const w=n.transitional||La;w&&w.legacyInterceptorReqResOrdering?l.unshift(v.fulfilled,v.rejected):l.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,p;if(!a){const d=[pc.bind(this),void 0];for(d.unshift(...l),d.push(...u),p=d.length,c=Promise.resolve(n);f{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,l){r.reason||(r.reason=new to(i,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Tp(function(o){t=o}),cancel:t}}};function H0(e){return function(n){return e.apply(null,n)}}function K0(e){return S.isObject(e)&&e.isAxiosError===!0}const Cl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Cl).forEach(([e,t])=>{Cl[t]=e});function Np(e){const t=new an(e),n=cp(an.prototype.request,t);return S.extend(n,an.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Np(hn(e,o))},n}const re=Np(eo);re.Axios=an;re.CanceledError=to;re.CancelToken=V0;re.isCancel=Ep;re.VERSION=Lp;re.toFormData=zi;re.AxiosError=I;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=H0;re.isAxiosError=K0;re.mergeConfig=hn;re.AxiosHeaders=De;re.formToJSON=e=>xp(S.isHTMLForm(e)?new FormData(e):e);re.getAdapter=_p.getAdapter;re.HttpStatusCode=Cl;re.default=re;const{Axios:g1,AxiosError:m1,CanceledError:y1,isCancel:v1,CancelToken:w1,VERSION:S1,all:k1,Cancel:x1,isAxiosError:E1,spread:C1,toFormData:P1,AxiosHeaders:O1,HttpStatusCode:R1,formToJSON:_1,getAdapter:L1,mergeConfig:T1}=re,N1=5e5,K=re.create({baseURL:"",timeout:3e4,withCredentials:!0,headers:{"Content-Type":"application/json"}});K.interceptors.request.use(e=>{const t=localStorage.getItem("dist_user_id");return t&&(e.headers["New-Api-User"]=t),e});K.interceptors.response.use(e=>(e.data&&e.data.success===!1&&e.data.message&&hs.error(e.data.message),e),e=>{var n,r,o;const t=((r=(n=e.response)==null?void 0:n.data)==null?void 0:r.message)||e.message||"Request failed";return((o=e.response)==null?void 0:o.status)===401?(localStorage.removeItem("dist_user_id"),window.dispatchEvent(new Event("auth:logout")),hs.error("Session expired, please log in again")):hs.error(t),Promise.reject(e)});const W0=()=>K.get("/api/dist/site/info"),A1=()=>K.get("/api/dist/site/models"),I1=()=>K.get("/api/dist/site/packages"),Q0=e=>K.post("/api/dist/user/register",e),q0=e=>K.post("/api/dist/user/login",e),J0=()=>K.post("/api/dist/user/logout"),ws=()=>K.get("/api/dist/user/self"),D1=()=>K.get("/api/dist/user/usage"),F1=e=>K.get("/api/dist/user/logs",{params:e}),j1=()=>K.get("/api/dist/token/list"),$1=e=>K.post("/api/dist/token/create",e),z1=(e,t)=>K.put(`/api/dist/token/${e}`,t),U1=e=>K.delete(`/api/dist/token/${e}`),M1=e=>K.post("/api/dist/topup/redeem",{key:e}),b1=e=>K.post("/api/dist/package/subscribe",{package_id:e}),B1=()=>K.get("/api/dist/package/subscriptions"),V1=()=>K.get("/api/dist/topup/info"),H1=e=>K.post("/api/dist/topup/amount",e),K1=e=>K.post("/api/dist/topup/pay",e),W1=e=>K.post("/api/dist/topup/stripe/pay",e),Q1=e=>K.post("/api/dist/topup/creem/pay",e),q1=e=>K.post("/api/dist/topup/crypto/pay",e),J1=e=>K.get(`/api/dist/topup/crypto/status?trade_no=${e}`),Y1=e=>K.get("/api/dist/topup/history",{params:e}),Ap=x.createContext(null);function Y0({children:e}){const[t,n]=x.useState(null),[r,o]=x.useState(!0),i=x.useCallback(async()=>{try{const u=await ws();if(u.data.success)return n(u.data.data),u.data.data}catch{}return null},[]);x.useEffect(()=>{localStorage.getItem("dist_user_id")?ws().then(c=>{c.data.success?n(c.data.data):localStorage.removeItem("dist_user_id")}).catch(()=>{localStorage.removeItem("dist_user_id")}).finally(()=>o(!1)):o(!1)},[]),x.useEffect(()=>{const u=()=>{n(null)};return window.addEventListener("auth:logout",u),()=>window.removeEventListener("auth:logout",u)},[]);const s=x.useCallback(async(u,c)=>{const f=await q0({username:u,password:c});if(f.data.success){const p=f.data.data;p!=null&&p.id&&localStorage.setItem("dist_user_id",String(p.id));const y=await ws();return y.data.success?n(y.data.data):n(p),{success:!0}}return{success:!1,message:f.data.message}},[]),l=x.useCallback(async u=>{const c=await Q0(u);return c.data.success?{success:!0,needsLogin:!0}:{success:!1,message:c.data.message}},[]),a=x.useCallback(async()=>{try{await J0()}catch{}localStorage.removeItem("dist_user_id"),n(null)},[]);return A.jsx(Ap.Provider,{value:{user:t,loading:r,login:s,register:l,logout:a,refreshUser:i},children:e})}function G0(){const e=x.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function X0(){const{user:e,loading:t}=G0(),n=Gn();return t?A.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:A.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e?A.jsx(fy,{}):A.jsx(np,{to:"/login",state:{from:n},replace:!0})}const Ip=x.createContext(null),Z0={starter:"",default:"theme-default",dark:"theme-dark",minimal:"theme-minimal",clean:"theme-light",corporate:"theme-light",claude:"theme-light theme-claude"};function ew(e){const t=Z0[e]||"";document.body.className=t+(t?" ":"")+"antialiased";try{localStorage.setItem("dist-theme-class",t)}catch{}}function tw({children:e}){const[t,n]=x.useState(null),[r,o]=x.useState(!0);return x.useEffect(()=>{W0().then(i=>{var s,l,a;if(i.data.success&&(n(i.data.data),ew((s=i.data.data)==null?void 0:s.theme_template),(l=i.data.data)!=null&&l.name&&(document.title=i.data.data.name),(a=i.data.data)!=null&&a.favicon)){const u=document.querySelector("link[rel~='icon']")||document.createElement("link");u.rel="icon",u.href=i.data.data.favicon,document.head.appendChild(u)}}).catch(()=>{}).finally(()=>o(!1))},[]),A.jsx(Ip.Provider,{value:{site:t,loading:r},children:e})}function Dp(){const e=x.useContext(Ip);if(!e)throw new Error("useSite must be used within SiteProvider");return e}function G1(){const{site:e}=Dp(),t=e==null?void 0:e.currency,n=(t==null?void 0:t.symbol)||"¥",r=(t==null?void 0:t.exchange_rate)||7,o=(t==null?void 0:t.code)||"CNY";return{symbol:n,rate:r,code:o,fmt:(s,l=4)=>{if(s==null||isNaN(s))return"-";const a=Number(s)*r;return n+a.toFixed(l)}}}const Fp=x.createContext(null),gc={starter:{Home:ye.lazy(()=>Z(()=>import("./Home-C5feFwVH.js"),__vite__mapDeps([0,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-CAIME1iu.js"),__vite__mapDeps([5,6,4])))},default:{Home:ye.lazy(()=>Z(()=>import("./Home-CdwZT6r7.js"),__vite__mapDeps([7,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-Bs88cVzM.js"),__vite__mapDeps([8,6,4])))},dark:{Home:ye.lazy(()=>Z(()=>import("./Home-D7LBRdbE.js"),__vite__mapDeps([9,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-BjSxzlL0.js"),__vite__mapDeps([10,6,4])))},minimal:{Home:ye.lazy(()=>Z(()=>import("./Home-D4cv4oTQ.js"),__vite__mapDeps([11,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout--sek2SXK.js"),__vite__mapDeps([12,6,4])))},clean:{Home:ye.lazy(()=>Z(()=>import("./Home-BI1Qa494.js"),__vite__mapDeps([13,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-3U5lz1BM.js"),__vite__mapDeps([14,6,4])))},corporate:{Home:ye.lazy(()=>Z(()=>import("./Home-DLOG4B7x.js"),__vite__mapDeps([15,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-Cv1wXPfX.js"),__vite__mapDeps([16,6,4])))},claude:{Home:ye.lazy(()=>Z(()=>import("./Home-DCfMIsOA.js"),__vite__mapDeps([17,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-Cu3KXPx6.js"),__vite__mapDeps([18,6,4])))}};function nw(){return A.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--page-bg)"},children:A.jsx("div",{className:"w-8 h-8 rounded-full animate-spin",style:{border:"2px solid var(--page-spinner-track)",borderTopColor:"var(--page-spinner)"}})})}function rw({children:e}){const{site:t,loading:n}=Dp();if(n)return A.jsx(nw,{});const r=(t==null?void 0:t.theme_template)||"starter";return A.jsx(ow,{themeName:r,children:e})}function ow({themeName:e,children:t}){const n=x.useMemo(()=>{const r=gc[e]||gc.starter;return{name:e,...r}},[e]);return A.jsx(Fp.Provider,{value:n,children:t})}function iw(){const e=x.useContext(Fp);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const sw=x.lazy(()=>Z(()=>import("./Login-BZ-Yy-uQ.js"),__vite__mapDeps([19,4]))),lw=x.lazy(()=>Z(()=>import("./Register-DKE8xt5X.js"),__vite__mapDeps([20,4]))),aw=x.lazy(()=>Z(()=>import("./Dashboard-CMrh_5yV.js"),__vite__mapDeps([21,2,4]))),uw=x.lazy(()=>Z(()=>import("./Tokens-CuYAJu3t.js"),__vite__mapDeps([22,4]))),cw=x.lazy(()=>Z(()=>import("./Packages-DkFQKW15.js"),__vite__mapDeps([23,1,4]))),fw=x.lazy(()=>Z(()=>import("./Pricing-CdVyLR6o.js"),__vite__mapDeps([24,4]))),dw=x.lazy(()=>Z(()=>import("./Topup-CKiSzFS9.js"),__vite__mapDeps([25,2,4]))),pw=x.lazy(()=>Z(()=>import("./Logs-Br0U5gGP.js"),__vite__mapDeps([26,4]))),hw=()=>A.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--page-bg)"},children:A.jsx("div",{className:"w-8 h-8 rounded-full animate-spin",style:{border:"2px solid var(--page-spinner-track)",borderTopColor:"var(--page-spinner)"}})});function gw(){const{Home:e,Layout:t}=iw();return A.jsx(x.Suspense,{fallback:A.jsx(hw,{}),children:A.jsxs(py,{children:[A.jsxs(Fe,{element:A.jsx(t,{}),children:[A.jsx(Fe,{path:"/",element:A.jsx(e,{})}),A.jsx(Fe,{path:"/pricing",element:A.jsx(fw,{})}),A.jsx(Fe,{path:"/packages",element:A.jsx(cw,{})}),A.jsx(Fe,{path:"/login",element:A.jsx(sw,{})}),A.jsx(Fe,{path:"/register",element:A.jsx(lw,{})}),A.jsxs(Fe,{element:A.jsx(X0,{}),children:[A.jsx(Fe,{path:"/dashboard",element:A.jsx(aw,{})}),A.jsx(Fe,{path:"/tokens",element:A.jsx(uw,{})}),A.jsx(Fe,{path:"/logs",element:A.jsx(pw,{})}),A.jsx(Fe,{path:"/topup",element:A.jsx(dw,{})})]})]}),A.jsx(Fe,{path:"*",element:A.jsx(np,{to:"/",replace:!0})})]})})}function mw(){return A.jsx(rw,{children:A.jsx(gw,{})})}const D=e=>typeof e=="string",ar=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},mc=e=>e==null?"":""+e,yw=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},vw=/###/g,yc=e=>e&&e.indexOf("###")>-1?e.replace(vw,"."):e,vc=e=>!e||D(e),xr=(e,t,n)=>{const r=D(t)?t.split("."):t;let o=0;for(;o{const{obj:r,k:o}=xr(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),l=xr(e,s,Object);for(;l.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),l=xr(e,s,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=n},ww=(e,t,n,r)=>{const{obj:o,k:i}=xr(e,t,Object);o[i]=o[i]||[],o[i].push(n)},pi=(e,t)=>{const{obj:n,k:r}=xr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Sw=(e,t,n)=>{const r=pi(e,n);return r!==void 0?r:pi(t,n)},jp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?D(e[r])||e[r]instanceof String||D(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):jp(e[r],t[r],n):e[r]=t[r]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const xw=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>kw[t]):e;class Ew{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Cw=[" ",",","?","!",";"],Pw=new Ew(20),Ow=(e,t,n)=>{t=t||"",n=n||"";const r=Cw.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const o=Pw.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!o.test(e);if(!i){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i},Pl=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let i=0;i-1&&ae==null?void 0:e.replace(/_/g,"-"),Rw={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class hi{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Rw,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new hi(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new hi(this.logger,t)}}var at=new hi;class Mi{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,i])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,r,o={}){var u,c;const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):D(r)&&i?l.push(...r.split(i)):l.push(r)));const a=pi(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!s||!D(r)?a:Pl((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,i)}addResource(t,n,r,o,i={silent:!1}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."),o=n,n=l[1]),this.addNamespaces(n),wc(this.data,l,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(const i in r)(D(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i,s={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),o=r,r=n,n=l[1]),this.addNamespaces(n);let a=pi(this.data,l)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?jp(a,r,i):a={...a,...r},wc(this.data,l,a),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var $p={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{var s;t=((s=this.processors[i])==null?void 0:s.process(t,n,r,o))??t}),t}};const zp=Symbol("i18next/PATH_KEY");function _w(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),o===zp?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Er(e,t){const{[zp]:n}=e(_w()),r=(t==null?void 0:t.keySeparator)??".",o=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&o){const i=t==null?void 0:t.ns,s=Array.isArray(i)?i:null;if(s&&s.length>1&&s.slice(1).includes(n[0]))return`${n[0]}${o}${n.slice(1).join(r)}`}return n.join(r)}const kc={},Ss=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class gi extends Mi{constructor(t,n={}){super(),yw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=at.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const o=this.resolve(t,r);if((o==null?void 0:o.res)===void 0)return!1;const i=Ss(o.res);return!(r.returnObjects===!1&&i)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ow(t,r,o);if(s&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:D(i)?[i]:i};const u=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(o)}return{key:t,namespaces:D(i)?[i]:i}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=Er(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?Er(V,{...this.options,...o}):String(V));const i=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:l,namespaces:a}=this.extractFromKey(t[t.length-1],o),u=a[a.length-1];let c=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=o.lng||this.language,p=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?i?{res:`${u}${c}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(o)}:`${u}${c}${l}`:i?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(o)}:l;const y=this.resolve(t,o);let d=y==null?void 0:y.res;const v=(y==null?void 0:y.usedKey)||l,w=(y==null?void 0:y.exactUsedKey)||l,g=["[object Number]","[object Function]","[object RegExp]"],h=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,k=o.count!==void 0&&!D(o.count),E=gi.hasDefaultValue(o),R=k?this.pluralResolver.getSuffix(f,o.count,o):"",P=o.ordinal&&k?this.pluralResolver.getSuffix(f,o.count,{ordinal:!1}):"",L=k&&!o.ordinal&&o.count===0,$=L&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${R}`]||o[`defaultValue${P}`]||o.defaultValue;let T=d;m&&!d&&E&&(T=$);const pe=Ss(T),Be=Object.prototype.toString.apply(T);if(m&&T&&pe&&g.indexOf(Be)<0&&!(D(h)&&Array.isArray(T))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,T,{...o,ns:a}):`key '${l} (${this.language})' returned an object instead of string.`;return i?(y.res=V,y.usedParams=this.getUsedParamsDetails(o),y):V}if(s){const V=Array.isArray(T),X=V?[]:{},Yt=V?w:v;for(const b in T)if(Object.prototype.hasOwnProperty.call(T,b)){const he=`${Yt}${s}${b}`;E&&!d?X[b]=this.translate(he,{...o,defaultValue:Ss($)?$[b]:void 0,joinArrays:!1,ns:a}):X[b]=this.translate(he,{...o,joinArrays:!1,ns:a}),X[b]===he&&(X[b]=T[b])}d=X}}else if(m&&D(h)&&Array.isArray(d))d=d.join(h),d&&(d=this.extendTranslation(d,t,o,r));else{let V=!1,X=!1;!this.isValidLookup(d)&&E&&(V=!0,d=$),this.isValidLookup(d)||(X=!0,d=l);const b=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&X?void 0:d,he=E&&$!==d&&this.options.updateMissing;if(X||V||he){if(this.logger.log(he?"updateKey":"missingKey",f,u,l,he?$:d),s){const F=this.resolve(l,{...o,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let O=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let F=0;F{var ft;const ke=E&&Re!==d?Re:b;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,U,ke,he,o):(ft=this.backendConnector)!=null&&ft.saveMissing&&this.backendConnector.saveMissing(F,u,U,ke,he,o),this.emit("missingKey",F,u,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?O.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,o);L&&o[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(Re=>{j([F],l+Re,o[`defaultValue${Re}`]||$)})}):j(O,l,$))}d=this.extendTranslation(d,t,o,y,r),X&&d===l&&this.options.appendNamespaceToMissingKey&&(d=`${u}${c}${l}`),(X||V)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${l}`:l,V?d:void 0,o))}return i?(y.res=d,y.usedParams=this.getUsedParamsDetails(o),y):d}extendTranslation(t,n,r,o,i){var a,u;if((a=this.i18nFormat)!=null&&a.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=D(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const y=t.match(this.interpolator.nestingRegexp);f=y&&y.length}let p=r.replace&&!D(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||o.usedLng,r),c){const y=t.match(this.interpolator.nestingRegexp),d=y&&y.length;f(i==null?void 0:i[0])===y[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):this.translate(...y,n),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=D(s)?[s]:s;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=$p.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,i,s,l;return D(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(a=>typeof a=="function"?Er(a,{...this.options,...n}):a)),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),c=u.key;o=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!D(n.count),y=p&&!n.ordinal&&n.count===0,d=n.context!==void 0&&(D(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{var g,h;this.isValidLookup(r)||(l=w,!kc[`${v[0]}-${w}`]&&((g=this.utils)!=null&&g.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(l))&&(kc[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${o}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(m=>{var R;if(this.isValidLookup(r))return;s=m;const k=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(k,c,m,w,n);else{let P;p&&(P=this.pluralResolver.getSuffix(m,n.count,n));const L=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(n.ordinal&&P.indexOf($)===0&&k.push(c+P.replace($,this.options.pluralSeparator)),k.push(c+P),y&&k.push(c+L)),d){const T=`${c}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),p&&(n.ordinal&&P.indexOf($)===0&&k.push(T+P.replace($,this.options.pluralSeparator)),k.push(T+P),y&&k.push(T+L))}}let E;for(;E=k.pop();)this.isValidLookup(r)||(i=E,r=this.getResource(m,w,E,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!D(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class xc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=at.create("languageUtils")}getScriptPartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(D(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),D(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return D(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):D(t)&&i(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&i(this.formatLanguageCode(s))}),o}}const Ec={zero:0,one:1,two:2,few:3,many:4,other:5},Cc={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Lw{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=at.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Hr(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(r,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Cc;if(!t.match(/-|_/))return Cc;const a=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(a,n)}return this.pluralRulesCache[i]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,i)=>Ec[o]-Ec[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Pc=(e,t,n,r=".",o=!0)=>{let i=Sw(e,t,n);return!i&&o&&D(n)&&(i=Pl(e,n,r),i===void 0&&(i=Pl(t,n,r))),i},ks=e=>e.replace(/\$/g,"$$$$");class Oc{constructor(t={}){var n;this.logger=at.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:g,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:xw,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Xt(i):s||"{{",this.suffix=l?Xt(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Xt(p):y||Xt("$t("),this.nestingSuffix=d?Xt(d):v||Xt(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=g||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,o){var y;let i,s,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=d=>{if(d.indexOf(this.formatSeparator)<0){const h=Pc(n,a,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...o,...n,interpolationkey:d}):h}const v=d.split(this.formatSeparator),w=v.shift().trim(),g=v.join(this.formatSeparator).trim();return this.format(Pc(n,a,w,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...o,...n,interpolationkey:w})};this.resetRegExp();const c=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((y=o==null?void 0:o.interpolation)==null?void 0:y.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>ks(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?ks(this.escape(d)):ks(d)}].forEach(d=>{for(l=0;i=d.regex.exec(t);){const v=i[1].trim();if(s=u(v),s===void 0)if(typeof c=="function"){const g=c(t,i,o);s=D(g)?g:""}else if(o&&Object.prototype.hasOwnProperty.call(o,v))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else!D(s)&&!this.useRawValueToEscape&&(s=mc(s));const w=d.safeValue(s);if(t=t.replace(i[0],w),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=i[0].length):d.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,i,s;const l=(a,u)=>{const c=this.nestingOptionsSeparator;if(a.indexOf(c)<0)return a;const f=a.split(new RegExp(`${Xt(c)}[ ]*{`));let p=`{${f[1]}`;a=f[0],p=this.interpolate(p,s);const y=p.match(/'/g),d=p.match(/"/g);(((y==null?void 0:y.length)??0)%2===0&&!d||((d==null?void 0:d.length)??0)%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${c}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,a};for(;o=this.nestingRegexp.exec(t);){let a=[];s={...r},s=s.replace&&!D(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(u!==-1&&(a=o[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),o[1]=o[1].slice(0,u)),i=n(l.call(this,o[1].trim(),s),s),i&&o[0]===t&&!D(i))return i;D(i)||(i=mc(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),a.length&&(i=a.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}const Tw=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[l,...a]=s.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),c=l.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Rc=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let l=t[s];return l||(l=e(Hr(r),o),t[s]=l),l(n)}},Nw=e=>(t,n,r)=>e(Hr(n),r)(t);class Aw{constructor(t={}){this.logger=at.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Rc:Nw;this.formats={number:r((o,i)=>{const s=new Intl.NumberFormat(o,{...i});return l=>s.format(l)}),currency:r((o,i)=>{const s=new Intl.NumberFormat(o,{...i,style:"currency"});return l=>s.format(l)}),datetime:r((o,i)=>{const s=new Intl.DateTimeFormat(o,{...i});return l=>s.format(l)}),relativetime:r((o,i)=>{const s=new Intl.RelativeTimeFormat(o,{...i});return l=>s.format(l,i.range||"day")}),list:r((o,i)=>{const s=new Intl.ListFormat(o,{...i});return l=>s.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Rc(n)}format(t,n,r,o={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(a=>a.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,a)=>{var f;const{formatName:u,formatOptions:c}=Tw(a);if(this.formats[u]){let p=l;try{const y=((f=o==null?void 0:o.formatParams)==null?void 0:f[o.interpolationkey])||{},d=y.locale||y.lng||o.locale||o.lng||r;p=this.formats[u](l,d,{...c,...o,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const Iw=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Dw extends Mi{constructor(t,n,r,o={}){var i,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=at.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(s=(i=this.backend)==null?void 0:i.init)==null||s.call(i,r,o.backend,o)}queueLoad(t,n,r,o){const i={},s={},l={},a={};return t.forEach(u=>{let c=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,c=!1,s[p]===void 0&&(s[p]=!0),i[p]===void 0&&(i[p]=!0),a[f]===void 0&&(a[f]=!0)))}),c||(l[u]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const o=t.split("|"),i=o[0],s=o[1];n&&this.emit("failedLoading",i,s,n),!n&&r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{ww(a.loaded,[i],s),Iw(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const c=a.loaded[u];c.length&&c.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r,o=0,i=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:s});return}this.readingCalls++;const l=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&o{this.read.call(this,t,n,r,o+1,i*2,s)},i);return}s(u,c)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(c=>l(null,c)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,s),!s&&l&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,l),this.loaded(t,s,l)})}saveMissing(t,n,r,o,i,s={},l=()=>{}){var a,u,c,f,p;if((u=(a=this.services)==null?void 0:a.utils)!=null&&u.hasLoadedNamespace&&!((f=(c=this.services)==null?void 0:c.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const y={...s,isUpdate:i},d=this.backend.create.bind(this.backend);if(d.length<6)try{let v;d.length===5?v=d(t,n,r,o,y):v=d(t,n,r,o),v&&typeof v.then=="function"?v.then(w=>l(null,w)).catch(l):l(null,v)}catch(v){l(v)}else d(t,n,r,o,l,y)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const xs=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),D(e[1])&&(t.defaultValue=e[1]),D(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_c=e=>{var t,n;return D(e.ns)&&(e.ns=[e.ns]),D(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),D(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Eo=()=>{},Fw=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},Up="__i18next_supportNoticeShown",jw=()=>typeof globalThis<"u"&&!!globalThis[Up],$w=()=>{typeof globalThis<"u"&&(globalThis[Up]=!0)},zw=e=>{var t,n,r,o,i,s,l,a,u,c,f,p,y;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((l=(s=(i=(o=e==null?void 0:e.modules)==null?void 0:o.backend)==null?void 0:i.constructor)==null?void 0:s.name)==null?void 0:l.indexOf("Locize"))>0||(u=(a=e==null?void 0:e.options)==null?void 0:a.backend)!=null&&u.backends&&e.options.backend.backends.some(d=>{var v,w,g;return((v=d==null?void 0:d.name)==null?void 0:v.indexOf("Locize"))>0||((g=(w=d==null?void 0:d.constructor)==null?void 0:w.name)==null?void 0:g.indexOf("Locize"))>0})||(f=(c=e==null?void 0:e.options)==null?void 0:c.backend)!=null&&f.projectId||(y=(p=e==null?void 0:e.options)==null?void 0:p.backend)!=null&&y.backendOptions&&e.options.backend.backendOptions.some(d=>d==null?void 0:d.projectId))};class Cr extends Mi{constructor(t={},n){if(super(),this.options=_c(t),this.services={},this.logger=at,this.modules={external:[]},Fw(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(D(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=xs();this.options={...r,...this.options,..._c(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!zw(this)&&!jw()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),$w());const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?at.init(o(this.modules.logger),this.options):at.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Aw;const c=new xc(this.options);this.store=new Sc(this.options.resources,this.options);const f=this.services;f.logger=at,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Lw(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=o(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Oc(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Dw(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new gi(this.services,this.options),this.translator.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Eo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const l=ar(),a=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),l}loadResources(t,n=Eo){var i,s;let r=n;const o=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};o?a(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),(s=(i=this.options.preload)==null?void 0:i.forEach)==null||s.call(i,u=>a(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const o=ar();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Eo),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&$p.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ar();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},i=(l,a)=>{a?this.isLanguageChangingTo===t&&(o(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},s=l=>{var c,f;!t&&!l&&this.services.languageDetector&&(l=[]);const a=D(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(a)?a:this.services.languageUtils.getBestMatchFromCodes(D(l)?[l]:l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),(f=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||f.call(c,u)),this.loadResources(u,p=>{i(p,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r){const o=(i,s,...l)=>{let a;typeof s!="object"?a=this.options.overloadTranslationOptionHandler([i,s].concat(l)):a={...s},a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs,a.ns=a.ns||o.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||o.keyPrefix);const u={...this.options,...a},c=this.options.keySeparator||".";let f;return a.keyPrefix&&Array.isArray(i)?f=i.map(p=>(typeof p=="function"&&(p=Er(p,u)),`${a.keyPrefix}${c}${p}`)):(typeof i=="function"&&(i=Er(i,u)),f=a.keyPrefix?`${a.keyPrefix}${c}${i}`:i),this.t(f,a)};return D(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,s);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(i,t)))}loadNamespaces(t,n){const r=ar();return this.options.ns?(D(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ar();D(t)&&(t=[t]);const o=this.options.preload||[],i=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var o,i;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const s=new Intl.Locale(t);if(s&&s.getTextInfo){const l=s.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new xc(xs());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Cr(t,n);return r.createInstance=Cr.createInstance,r}cloneInstance(t={},n=Eo){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new Cr(o);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const l=Object.keys(this.store.data).reduce((a,u)=>(a[u]={...this.store.data[u]},a[u]=Object.keys(a[u]).reduce((c,f)=>(c[f]={...a[u][f]},c),a[u]),a),{});i.store=new Sc(l,o),i.services.resourceStore=i.store}if(t.interpolation){const a={...xs().interpolation,...this.options.interpolation,...t.interpolation},u={...o,interpolation:a};i.services.interpolator=new Oc(u)}return i.translator=new gi(i.services,o),i.translator.on("*",(l,...a)=>{i.emit(l,...a)}),i.init(o,n),i.translator.options=o,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Oe=Cr.createInstance();Oe.createInstance;Oe.dir;Oe.init;Oe.loadResources;Oe.reloadResources;Oe.use;Oe.changeLanguage;Oe.getFixedT;Oe.t;Oe.exists;Oe.setDefaultNamespace;Oe.hasLoadedNamespace;Oe.loadNamespaces;Oe.loadLanguages;const Uw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Mw={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},bw=e=>Mw[e],Bw=e=>e.replace(Uw,bw);let Ol={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Bw,transDefaultProps:void 0};const Vw=(e={})=>{Ol={...Ol,...e}},X1=()=>Ol;let Mp;const Hw=e=>{Mp=e},Z1=()=>Mp,Kw={type:"3rdParty",init(e){Vw(e.options.react),Hw(e)}},{slice:Ww,forEach:Qw}=[];function qw(e){return Qw.call(Ww.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Jw(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Lc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yw=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!Lc.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!Lc.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},Tc={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=Yw(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const s=o.substring(1).split("&");for(let l=0;l0&&s[l].substring(0,a)===t&&(n=s[l].substring(a+1))}}return n}},Zw={name:"hash",lookup(e){var o;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const s=i.substring(1);if(t){const l=s.split("&");for(let a=0;a0&&l[a].substring(0,u)===t&&(r=l[a].substring(u+1))}}if(r)return r;if(!r&&n>-1){const l=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(o=l[typeof n=="number"?n:0])==null?void 0:o.replace("/",""):void 0}}}return r}};let vn=null;const Nc=()=>{if(vn!==null)return vn;try{if(vn=typeof window<"u"&&window.localStorage!==null,!vn)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{vn=!1}return vn};var e1={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Nc())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Nc()&&window.localStorage.setItem(n,e)}};let wn=null;const Ac=()=>{if(wn!==null)return wn;try{if(wn=typeof window<"u"&&window.sessionStorage!==null,!wn)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{wn=!1}return wn};var t1={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ac())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ac()&&window.sessionStorage.setItem(n,e)}},n1={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i0?t:void 0}},r1={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},o1={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},i1={name:"subdomain",lookup(e){var o,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let bp=!1;try{document.cookie,bp=!0}catch{}const Bp=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];bp||Bp.splice(1,1);const s1=()=>({order:Bp,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Vp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=qw(n,this.options||{},s1()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Gw),this.addDetector(Xw),this.addDetector(e1),this.addDetector(t1),this.addDetector(n1),this.addDetector(r1),this.addDetector(o1),this.addDetector(i1),this.addDetector(Zw)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.filter(r=>r!=null&&!Jw(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Vp.type="languageDetector";const l1={"nav.home":"Home","nav.pricing":"Pricing","nav.packages":"Packages","nav.dashboard":"Dashboard","nav.apiKeys":"API Keys","nav.login":"Login","nav.signUp":"Sign Up","nav.logout":"Logout","nav.contact":"Contact","home.heroSubtitle":"Access the world's most powerful AI models through a single API endpoint. Simple, affordable, reliable.","home.getStarted":"Get Started Free","home.viewPricing":"View Pricing","home.goToDashboard":"Go to Dashboard","home.aiModels":"AI Models","home.uptime":"Uptime","home.latency":"Latency","home.whyChooseUs":"Why Choose Us","home.whyChooseUsDesc":"Everything you need to build AI-powered applications","home.lightningFast":"Lightning Fast","home.lightningFastDesc":"Optimized routing and caching deliver responses with minimal latency. Load-balanced across multiple providers for maximum reliability.","home.securePrivate":"Secure & Private","home.securePrivateDesc":"Enterprise-grade security with encrypted API keys. No request logging by default. Your data stays your data.","home.payAsYouGo":"Pay As You Go","home.payAsYouGoDesc":"Transparent pricing with no hidden fees. Only pay for what you use. Multiple top-up options and subscription packages available.","home.availableModels":"Available Models","home.availableModelsDesc":"Access {{count}} AI models through a unified API","home.viewAllModels":"View all {{count}} models","home.plansPackages":"Plans & Packages","home.choosePlan":"Choose a plan that fits your needs","home.subscribe":"Subscribe","home.days":"{{count}} days","home.readyToStart":"Ready to Get Started?","home.readyToStartDesc":"Create your account and start building with AI in minutes. No credit card required.","home.createFreeAccount":"Create Free Account","home.signIn":"Sign In","home.defaultHeroTitle":"AI API Platform","login.welcomeBack":"Welcome Back","login.signInTo":"Sign in to {{name}}","login.signInToDefault":"Sign in to your account","login.username":"Username","login.password":"Password","login.enterUsername":"Enter your username","login.enterPassword":"Enter your password","login.signingIn":"Signing in...","login.signInBtn":"Sign In","login.noAccount":"Don't have an account?","login.createOne":"Create one","login.fillAllFields":"Please fill in all fields","login.welcomeBackToast":"Welcome back!","register.createAccount":"Create Account","register.getStartedWith":"Get started with {{name}}","register.getStartedDefault":"Get started with our platform","register.username":"Username","register.email":"Email","register.password":"Password","register.confirmPassword":"Confirm Password","register.chooseUsername":"Choose a username","register.emailPlaceholder":"your@email.com (optional)","register.passwordPlaceholder":"8-20 characters","register.repeatPassword":"Repeat your password","register.creating":"Creating...","register.createAccountBtn":"Create Account","register.hasAccount":"Already have an account?","register.signIn":"Sign in","register.fillRequired":"Please fill in all required fields","register.passwordMismatch":"Passwords do not match","register.passwordLength":"Password must be 8-20 characters","register.accountCreated":"Account created! Please sign in.","dashboard.welcome":"Welcome,","dashboard.manageDesc":"Manage your API usage, keys, and account","dashboard.balance":"Balance","dashboard.quotaUnits":"{{count}} quota units","dashboard.used":"Used","dashboard.totalRequests":"Total Requests","dashboard.redeemCode":"Redeem Code","dashboard.enterCode":"Enter redemption code","dashboard.redeeming":"Redeeming...","dashboard.redeem":"Redeem","dashboard.redeemSuccess":"Code redeemed successfully!","dashboard.quickLinks":"Quick Links","dashboard.apiKeys":"API Keys","dashboard.manageKeys":"Manage your keys","dashboard.packages":"Packages","dashboard.viewPlans":"View plans","dashboard.pricing":"Pricing","dashboard.modelPrices":"Model prices","dashboard.apiDocs":"API Docs","dashboard.comingSoon":"Coming soon","tokens.title":"API Keys","tokens.subtitle":"Manage your API access tokens","tokens.newKey":"+ New Key","tokens.createApiKey":"Create API Key","tokens.name":"Name","tokens.namePlaceholder":"e.g. my-app-key","tokens.cancel":"Cancel","tokens.creating":"Creating...","tokens.create":"Create","tokens.newApiKey":"Your New API Key","tokens.keyWarning":"This is the only time you'll see this key. Copy it now and store it securely.","tokens.copied":"Copied!","tokens.copy":"Copy","tokens.copiedToClipboard":"Copied to clipboard!","tokens.savedKey":"I've saved my key","tokens.deleteToken":"Delete Token","tokens.deleteConfirm":'Delete "{{name}}"? This cannot be undone.',"tokens.delete":"Delete","tokens.noKeys":"No API keys yet","tokens.createFirst":"Create Your First Key","tokens.enabled":"Enabled","tokens.disabled":"Disabled","tokens.tokenDisabled":"Token disabled","tokens.tokenEnabled":"Token enabled","tokens.tokenDeleted":"Token deleted","tokens.enterName":"Please enter a name","tokens.quickStart":"Quick Start","tokens.quickStartComment":"# Use your API key with OpenAI-compatible endpoint","config.title":"Config File Export","config.subtitle":"Select your API Key and model to generate config files","config.selectKey":"Select API Key","config.selectModel":"Select Model","config.selectTool":"Select Tool","config.copy":"Copy","config.download":"Download","config.copied":"Copied to clipboard!","config.downloaded":"Config file downloaded","config.loading":"Loading...","config.loginPrompt":"Log in to generate your config","config.loginDesc":"Select your API Key and model to auto-fill config files","config.searchModel":"Search models...","config.noModelMatch":"No models match your search","pricing.title":"Model Pricing","pricing.subtitle":"Transparent, pay-as-you-go pricing for all available models. Prices shown per 1M tokens.","pricing.searchPlaceholder":"Search models...","pricing.noMatch":"No models match your search","pricing.noModels":"No models available","pricing.model":"Model","pricing.inputPrice":"Input / 1M tokens","pricing.outputPrice":"Output / 1M tokens","pricing.status":"Status","pricing.online":"Online","pricing.unknown":"Unknown","pricing.vendor":"Vendor","pricing.allVendors":"All","packages.title":"Packages & Plans","packages.subtitle":"Choose a package that fits your usage. All plans include access to all available models.","packages.noPackages":"No packages available at the moment.","packages.checkPricing":"Check model pricing","packages.daysAccess":"{{count}} days access","packages.creditIncluded":"${{amount}} credit included","packages.requestsMin":"{{count}} requests/min","packages.allModels":"All models access","packages.openaiApi":"OpenAI-compatible API","packages.subscribeNow":"Subscribe Now","packages.signUpToSubscribe":"Sign Up to Subscribe","packages.processing":"Processing...","packages.confirmTitle":"Confirm Subscription","packages.confirmDesc":"Subscribe to {{name}} for ${{price}}?","packages.yourBalance":"Your balance:","packages.insufficientBalance":"Insufficient balance. Please top up before subscribing.","packages.confirm":"Confirm","packages.subscribedSuccess":"Subscribed successfully!","packages.mySubscriptions":"My Subscriptions","packages.subscriptionId":"Subscription #{{id}}","packages.active":"Active","packages.expires":"Expires","packages.nextReset":"Next reset","packages.remaining":"Remaining","packages.unusedQuotaExpires":"Unused quota expires each period","packages.resetNever":"One-time","packages.resetDaily":"Resets daily","packages.resetWeekly":"Resets weekly","packages.resetMonthly":"Resets monthly","packages.periodicQuota":"${{amount}} {{period}} quota","packages.subscriptionInfo":"This is a subscription ({{period}}), valid for {{days}} days. Each period grants ${{amount}} quota. Unused quota expires.","packages.officialEquiv":"Equivalent to ${{amount}} at {{model}} official pricing","common.sessionExpired":"Session expired, please log in again","common.requestFailed":"Request failed","nav.topup":"Top Up","topup.title":"Top Up","topup.subtitle":"Recharge your account balance via online payment or redemption code","topup.onlineTopup":"Online Top Up","topup.selectAmount":"Select Amount","topup.customAmount":"Custom Amount","topup.amountPlaceholder":"Enter amount (min ${{min}})","topup.paymentMethod":"Payment Method","topup.processing":"Processing...","topup.calculating":"Calculating...","topup.payAmountLabel":"Amount to pay","topup.enterAmount":"Please enter a top-up amount","topup.paymentSuccess":"Payment successful! Balance updated.","topup.orderExpired":"Payment order expired","topup.viewHistory":"View History","topup.hideHistory":"Hide History","topup.history":"Top-Up History","topup.noHistory":"No top-up records yet","topup.statusSuccess":"Success","topup.statusPending":"Pending","topup.statusFailed":"Failed","topup.redeemTitle":"Redeem Code","topup.enterRedeemCode":"Enter redemption code","topup.redeeming":"Redeeming...","topup.redeem":"Redeem","topup.redeemCode":"Redeem Code","topup.redeemSuccess":"Code redeemed successfully!","topup.cryptoPayment":"Crypto Payment","topup.walletAddress":"Wallet Address","topup.amount":"Amount","topup.chain":"Chain","topup.waitingPayment":"Waiting for payment...","topup.close":"Close","topup.selectChain":"Please select a blockchain network","topup.selectToken":"Please select a token","topup.token":"Token","topup.payWith":"Pay with","topup.payNow":"Pay","topup.quotaIncluded":"{{count}} quota included","topup.creemPayment":"Creem Payment","nav.logs":"Logs","dashboard.logs":"Call Logs","dashboard.viewLogs":"View usage details","logs.title":"Call Logs","logs.subtitle":"View detailed records of every API call","logs.filterModel":"Filter by model...","logs.filterToken":"Filter by token...","logs.clearFilter":"Clear","logs.noLogs":"No call records yet","logs.time":"Time","logs.model":"Model","logs.token":"Token","logs.promptTokens":"Input","logs.completionTokens":"Output","logs.cost":"Cost","logs.duration":"Duration","logs.showing":"{{from}}-{{to}} of {{total}}","logs.prev":"Prev","logs.next":"Next"},a1={translation:l1},u1={"nav.home":"首页","nav.pricing":"定价","nav.packages":"套餐","nav.dashboard":"控制台","nav.apiKeys":"API 密钥","nav.login":"登录","nav.signUp":"注册","nav.logout":"退出","nav.contact":"联系我们","home.heroSubtitle":"通过单一 API 端点访问全球最强大的 AI 模型。简单、实惠、可靠。","home.getStarted":"免费开始","home.viewPricing":"查看定价","home.goToDashboard":"进入控制台","home.aiModels":"AI 模型","home.uptime":"在线率","home.latency":"延迟","home.whyChooseUs":"为什么选择我们","home.whyChooseUsDesc":"构建 AI 应用所需的一切","home.lightningFast":"极速响应","home.lightningFastDesc":"优化的路由和缓存以最低延迟交付响应。跨多个供应商负载均衡,确保最大可靠性。","home.securePrivate":"安全可靠","home.securePrivateDesc":"企业级安全性,API 密钥加密存储。默认不记录请求日志。您的数据由您掌控。","home.payAsYouGo":"按量付费","home.payAsYouGoDesc":"透明定价,无隐藏费用。按使用量付费。提供多种充值方式和订阅套餐。","home.availableModels":"可用模型","home.availableModelsDesc":"通过统一 API 访问 {{count}} 个 AI 模型","home.viewAllModels":"查看全部 {{count}} 个模型","home.plansPackages":"套餐方案","home.choosePlan":"选择适合您需求的方案","home.subscribe":"订阅","home.days":"{{count}} 天","home.readyToStart":"准备好了吗?","home.readyToStartDesc":"创建账户,几分钟内即可开始使用 AI 构建应用。无需信用卡。","home.createFreeAccount":"免费创建账户","home.signIn":"登录","home.defaultHeroTitle":"AI API 平台","login.welcomeBack":"欢迎回来","login.signInTo":"登录到 {{name}}","login.signInToDefault":"登录您的账户","login.username":"用户名","login.password":"密码","login.enterUsername":"请输入用户名","login.enterPassword":"请输入密码","login.signingIn":"登录中...","login.signInBtn":"登录","login.noAccount":"还没有账户?","login.createOne":"立即注册","login.fillAllFields":"请填写所有字段","login.welcomeBackToast":"欢迎回来!","register.createAccount":"创建账户","register.getStartedWith":"开始使用 {{name}}","register.getStartedDefault":"开始使用我们的平台","register.username":"用户名","register.email":"邮箱","register.password":"密码","register.confirmPassword":"确认密码","register.chooseUsername":"请选择用户名","register.emailPlaceholder":"your@email.com(可选)","register.passwordPlaceholder":"8-20 个字符","register.repeatPassword":"请再次输入密码","register.creating":"创建中...","register.createAccountBtn":"创建账户","register.hasAccount":"已有账户?","register.signIn":"立即登录","register.fillRequired":"请填写所有必填字段","register.passwordMismatch":"两次密码不一致","register.passwordLength":"密码长度需为 8-20 个字符","register.accountCreated":"账户创建成功!请登录。","dashboard.welcome":"欢迎,","dashboard.manageDesc":"管理您的 API 用量、密钥和账户","dashboard.balance":"余额","dashboard.quotaUnits":"{{count}} 额度单位","dashboard.used":"已使用","dashboard.totalRequests":"总请求数","dashboard.redeemCode":"兑换码","dashboard.enterCode":"请输入兑换码","dashboard.redeeming":"兑换中...","dashboard.redeem":"兑换","dashboard.redeemSuccess":"兑换码兑换成功!","dashboard.quickLinks":"快捷入口","dashboard.apiKeys":"API 密钥","dashboard.manageKeys":"管理您的密钥","dashboard.packages":"套餐","dashboard.viewPlans":"查看方案","dashboard.pricing":"定价","dashboard.modelPrices":"模型价格","dashboard.apiDocs":"API 文档","dashboard.comingSoon":"即将推出","tokens.title":"API 密钥","tokens.subtitle":"管理您的 API 访问令牌","tokens.newKey":"+ 新建密钥","tokens.createApiKey":"创建 API 密钥","tokens.name":"名称","tokens.namePlaceholder":"例如 my-app-key","tokens.cancel":"取消","tokens.creating":"创建中...","tokens.create":"创建","tokens.newApiKey":"您的新 API 密钥","tokens.keyWarning":"这是您唯一一次看到此密钥的机会。请立即复制并安全保存。","tokens.copied":"已复制!","tokens.copy":"复制","tokens.copiedToClipboard":"已复制到剪贴板!","tokens.savedKey":"我已保存密钥","tokens.deleteToken":"删除令牌","tokens.deleteConfirm":'删除 "{{name}}"?此操作不可撤销。',"tokens.delete":"删除","tokens.noKeys":"暂无 API 密钥","tokens.createFirst":"创建您的第一个密钥","tokens.enabled":"已启用","tokens.disabled":"已禁用","tokens.tokenDisabled":"令牌已禁用","tokens.tokenEnabled":"令牌已启用","tokens.tokenDeleted":"令牌已删除","tokens.enterName":"请输入名称","tokens.quickStart":"快速开始","tokens.quickStartComment":"# 使用 OpenAI 兼容端点调用 API","config.title":"配置文件导出","config.subtitle":"选择您的 API Key 和模型,一键生成配置文件","config.selectKey":"选择 API Key","config.selectModel":"选择模型","config.selectTool":"选择工具","config.copy":"复制","config.download":"下载","config.copied":"已复制到剪贴板","config.downloaded":"配置文件已下载","config.loading":"加载中...","config.loginPrompt":"登录后可生成您的专属配置","config.loginDesc":"选择 API Key 和模型,自动填充到配置文件中","config.searchModel":"搜索模型...","config.noModelMatch":"没有匹配的模型","pricing.title":"模型定价","pricing.subtitle":"透明的按量付费定价。价格以每百万 token 计。","pricing.searchPlaceholder":"搜索模型...","pricing.noMatch":"没有匹配的模型","pricing.noModels":"暂无可用模型","pricing.model":"模型","pricing.inputPrice":"输入 / 百万 token","pricing.outputPrice":"输出 / 百万 token","pricing.status":"状态","pricing.online":"在线","pricing.unknown":"未知","pricing.vendor":"厂商","pricing.allVendors":"全部","packages.title":"套餐方案","packages.subtitle":"选择适合您用量的套餐。所有方案均可访问全部可用模型。","packages.noPackages":"暂无可用套餐。","packages.checkPricing":"查看模型定价","packages.daysAccess":"{{count}} 天有效期","packages.creditIncluded":"含 ${{amount}} 额度","packages.requestsMin":"{{count}} 次请求/分钟","packages.allModels":"全部模型可用","packages.openaiApi":"OpenAI 兼容 API","packages.subscribeNow":"立即订阅","packages.signUpToSubscribe":"注册后订阅","packages.processing":"处理中...","packages.confirmTitle":"确认订阅","packages.confirmDesc":"订阅 {{name}},价格 ${{price}}?","packages.yourBalance":"您的余额:","packages.insufficientBalance":"余额不足,请先充值。","packages.confirm":"确认","packages.subscribedSuccess":"订阅成功!","packages.mySubscriptions":"我的订阅","packages.subscriptionId":"订阅 #{{id}}","packages.active":"活跃","packages.expires":"到期","packages.nextReset":"下次重置","packages.remaining":"剩余","packages.unusedQuotaExpires":"未用完额度到期作废","packages.resetNever":"一次性","packages.resetDaily":"每日重置","packages.resetWeekly":"每周重置","packages.resetMonthly":"每月重置","packages.periodicQuota":"{{period}}额度 ${{amount}}","packages.subscriptionInfo":"📋 此套餐为周期订阅({{period}}),有效期 {{days}} 天。每个周期获得 ${{amount}} 额度,未用完作废。","packages.officialEquiv":"相当于 {{model}} 官方 ${{amount}} 额度","common.sessionExpired":"会话已过期,请重新登录","common.requestFailed":"请求失败","nav.topup":"充值","topup.title":"充值中心","topup.subtitle":"通过在线支付或兑换码为账户充值","topup.onlineTopup":"在线充值","topup.selectAmount":"选择金额","topup.customAmount":"自定义金额","topup.amountPlaceholder":"输入金额(最低 ${{min}})","topup.paymentMethod":"支付方式","topup.processing":"处理中...","topup.calculating":"计算中...","topup.payAmountLabel":"实付金额","topup.enterAmount":"请输入充值金额","topup.paymentSuccess":"支付成功!余额已更新。","topup.orderExpired":"支付订单已过期","topup.viewHistory":"查看记录","topup.hideHistory":"隐藏记录","topup.history":"充值记录","topup.noHistory":"暂无充值记录","topup.statusSuccess":"成功","topup.statusPending":"待支付","topup.statusFailed":"失败","topup.redeemTitle":"兑换码充值","topup.enterRedeemCode":"请输入兑换码","topup.redeeming":"兑换中...","topup.redeem":"兑换","topup.redeemCode":"兑换码","topup.redeemSuccess":"兑换码兑换成功!","topup.cryptoPayment":"加密货币支付","topup.walletAddress":"钱包地址","topup.amount":"金额","topup.chain":"链","topup.waitingPayment":"等待支付中...","topup.close":"关闭","topup.selectChain":"请选择区块链网络","topup.selectToken":"请选择代币","topup.token":"代币","topup.payWith":"使用","topup.payNow":"支付","topup.quotaIncluded":"含 {{count}} 额度","topup.creemPayment":"Creem 支付","nav.logs":"调用日志","dashboard.logs":"调用日志","dashboard.viewLogs":"查看使用明细","logs.title":"调用日志","logs.subtitle":"查看每次 API 调用的详细记录","logs.filterModel":"按模型筛选...","logs.filterToken":"按令牌筛选...","logs.clearFilter":"清除","logs.noLogs":"暂无调用记录","logs.time":"时间","logs.model":"模型","logs.token":"令牌","logs.promptTokens":"输入","logs.completionTokens":"输出","logs.cost":"消费","logs.duration":"耗时","logs.showing":"第 {{from}}-{{to}} 条,共 {{total}} 条","logs.prev":"上一页","logs.next":"下一页"},c1={translation:u1};Oe.use(Vp).use(Kw).init({load:"languageOnly",resources:{en:a1,zh:c1},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag","querystring"],caches:["localStorage"]}});Es.createRoot(document.getElementById("root")).render(A.jsx(ye.StrictMode,{children:A.jsx(Sy,{children:A.jsx(tw,{children:A.jsxs(Y0,{children:[A.jsx(mw,{}),A.jsx(fv,{position:"top-center",toastOptions:{duration:3e3,style:{background:"#1a1a2e",color:"#fff",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",fontSize:"14px"}}})]})})})}));export{F1 as A,X1 as B,Z1 as C,f1 as L,np as N,fy as O,N1 as Q,Dp as a,Gd as b,Gn as c,G1 as d,M1 as e,j1 as f,D1 as g,A1 as h,$1 as i,A as j,z1 as k,U1 as l,I1 as m,B1 as n,V1 as o,H1 as p,W1 as q,x as r,b1 as s,K1 as t,G0 as u,Q1 as v,q1 as w,J1 as x,Y1 as y,hs as z}; +`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Uo.assertOptions(r,{silentJSONParsing:Ve.transitional(Ve.boolean),forcedJSONParsing:Ve.transitional(Ve.boolean),clarifyTimeoutError:Ve.transitional(Ve.boolean),legacyInterceptorReqResOrdering:Ve.transitional(Ve.boolean)},!1),o!=null&&(S.isFunction(o)?n.paramsSerializer={serialize:o}:Uo.assertOptions(o,{encode:Ve.function,serialize:Ve.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Uo.assertOptions(n,{baseUrl:Ve.spelling("baseURL"),withXsrfToken:Ve.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&S.merge(i.common,i[n.method]);i&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=De.concat(s,i);const l=[];let a=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;a=a&&v.synchronous;const w=n.transitional||La;w&&w.legacyInterceptorReqResOrdering?l.unshift(v.fulfilled,v.rejected):l.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,p;if(!a){const d=[pc.bind(this),void 0];for(d.unshift(...l),d.push(...u),p=d.length,c=Promise.resolve(n);f{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,l){r.reason||(r.reason=new to(i,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Tp(function(o){t=o}),cancel:t}}};function H0(e){return function(n){return e.apply(null,n)}}function K0(e){return S.isObject(e)&&e.isAxiosError===!0}const Cl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Cl).forEach(([e,t])=>{Cl[t]=e});function Np(e){const t=new an(e),n=cp(an.prototype.request,t);return S.extend(n,an.prototype,t,{allOwnKeys:!0}),S.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Np(hn(e,o))},n}const re=Np(eo);re.Axios=an;re.CanceledError=to;re.CancelToken=V0;re.isCancel=Ep;re.VERSION=Lp;re.toFormData=zi;re.AxiosError=I;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=H0;re.isAxiosError=K0;re.mergeConfig=hn;re.AxiosHeaders=De;re.formToJSON=e=>xp(S.isHTMLForm(e)?new FormData(e):e);re.getAdapter=_p.getAdapter;re.HttpStatusCode=Cl;re.default=re;const{Axios:g1,AxiosError:m1,CanceledError:y1,isCancel:v1,CancelToken:w1,VERSION:S1,all:k1,Cancel:x1,isAxiosError:E1,spread:C1,toFormData:P1,AxiosHeaders:O1,HttpStatusCode:R1,formToJSON:_1,getAdapter:L1,mergeConfig:T1}=re,N1=5e5,K=re.create({baseURL:"",timeout:3e4,withCredentials:!0,headers:{"Content-Type":"application/json"}});K.interceptors.request.use(e=>{const t=localStorage.getItem("dist_user_id");return t&&(e.headers["New-Api-User"]=t),e});K.interceptors.response.use(e=>(e.data&&e.data.success===!1&&e.data.message&&hs.error(e.data.message),e),e=>{var n,r,o;const t=((r=(n=e.response)==null?void 0:n.data)==null?void 0:r.message)||e.message||"Request failed";return((o=e.response)==null?void 0:o.status)===401?(localStorage.removeItem("dist_user_id"),window.dispatchEvent(new Event("auth:logout")),hs.error("Session expired, please log in again")):hs.error(t),Promise.reject(e)});const W0=()=>K.get("/api/dist/site/info"),A1=()=>K.get("/api/dist/site/models"),I1=()=>K.get("/api/dist/site/packages"),Q0=e=>K.post("/api/dist/user/register",e),q0=e=>K.post("/api/dist/user/login",e),J0=()=>K.post("/api/dist/user/logout"),ws=()=>K.get("/api/dist/user/self"),D1=()=>K.get("/api/dist/user/usage"),F1=e=>K.get("/api/dist/user/logs",{params:e}),j1=()=>K.get("/api/dist/token/list"),$1=e=>K.post("/api/dist/token/create",e),z1=(e,t)=>K.put(`/api/dist/token/${e}`,t),U1=e=>K.delete(`/api/dist/token/${e}`),M1=e=>K.post("/api/dist/topup/redeem",{key:e}),b1=e=>K.post("/api/dist/package/subscribe",{package_id:e}),B1=()=>K.get("/api/dist/package/subscriptions"),V1=()=>K.get("/api/dist/topup/info"),H1=e=>K.post("/api/dist/topup/amount",e),K1=e=>K.post("/api/dist/topup/pay",e),W1=e=>K.post("/api/dist/topup/stripe/pay",e),Q1=e=>K.post("/api/dist/topup/creem/pay",e),q1=e=>K.post("/api/dist/topup/crypto/pay",e),J1=e=>K.get(`/api/dist/topup/crypto/status?trade_no=${e}`),Y1=e=>K.get("/api/dist/topup/history",{params:e}),Ap=x.createContext(null);function Y0({children:e}){const[t,n]=x.useState(null),[r,o]=x.useState(!0),i=x.useCallback(async()=>{try{const u=await ws();if(u.data.success)return n(u.data.data),u.data.data}catch{}return null},[]);x.useEffect(()=>{localStorage.getItem("dist_user_id")?ws().then(c=>{c.data.success?n(c.data.data):localStorage.removeItem("dist_user_id")}).catch(()=>{localStorage.removeItem("dist_user_id")}).finally(()=>o(!1)):o(!1)},[]),x.useEffect(()=>{const u=()=>{n(null)};return window.addEventListener("auth:logout",u),()=>window.removeEventListener("auth:logout",u)},[]);const s=x.useCallback(async(u,c)=>{const f=await q0({username:u,password:c});if(f.data.success){const p=f.data.data;p!=null&&p.id&&localStorage.setItem("dist_user_id",String(p.id));const y=await ws();return y.data.success?n(y.data.data):n(p),{success:!0}}return{success:!1,message:f.data.message}},[]),l=x.useCallback(async u=>{const c=await Q0(u);return c.data.success?{success:!0,needsLogin:!0}:{success:!1,message:c.data.message}},[]),a=x.useCallback(async()=>{try{await J0()}catch{}localStorage.removeItem("dist_user_id"),n(null)},[]);return A.jsx(Ap.Provider,{value:{user:t,loading:r,login:s,register:l,logout:a,refreshUser:i},children:e})}function G0(){const e=x.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function X0(){const{user:e,loading:t}=G0(),n=Gn();return t?A.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:A.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e?A.jsx(fy,{}):A.jsx(np,{to:"/login",state:{from:n},replace:!0})}const Ip=x.createContext(null),Z0={starter:"",default:"theme-default",dark:"theme-dark",minimal:"theme-minimal",clean:"theme-light",corporate:"theme-light",claude:"theme-light theme-claude"};function ew(e){const t=Z0[e]||"";document.body.className=t+(t?" ":"")+"antialiased";try{localStorage.setItem("dist-theme-class",t)}catch{}}function tw({children:e}){const[t,n]=x.useState(null),[r,o]=x.useState(!0);return x.useEffect(()=>{W0().then(i=>{var s,l,a;if(i.data.success&&(n(i.data.data),ew((s=i.data.data)==null?void 0:s.theme_template),(l=i.data.data)!=null&&l.name&&(document.title=i.data.data.name),(a=i.data.data)!=null&&a.favicon)){const u=document.querySelector("link[rel~='icon']")||document.createElement("link");u.rel="icon",u.href=i.data.data.favicon,document.head.appendChild(u)}}).catch(()=>{}).finally(()=>o(!1))},[]),A.jsx(Ip.Provider,{value:{site:t,loading:r},children:e})}function Dp(){const e=x.useContext(Ip);if(!e)throw new Error("useSite must be used within SiteProvider");return e}function G1(){const{site:e}=Dp(),t=e==null?void 0:e.currency,n=(t==null?void 0:t.symbol)||"¥",r=(t==null?void 0:t.exchange_rate)||7,o=(t==null?void 0:t.code)||"CNY";return{symbol:n,rate:r,code:o,fmt:(s,l=4)=>{if(s==null||isNaN(s))return"-";const a=Number(s)*r;return n+a.toFixed(l)}}}const Fp=x.createContext(null),gc={starter:{Home:ye.lazy(()=>Z(()=>import("./Home-DuzKUQBe.js"),__vite__mapDeps([0,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-DaloeA7I.js"),__vite__mapDeps([5,6,4])))},default:{Home:ye.lazy(()=>Z(()=>import("./Home-BBk8paQW.js"),__vite__mapDeps([7,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-D-RGC5l0.js"),__vite__mapDeps([8,6,4])))},dark:{Home:ye.lazy(()=>Z(()=>import("./Home-NjW2RUrZ.js"),__vite__mapDeps([9,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-D0gFUpiK.js"),__vite__mapDeps([10,6,4])))},minimal:{Home:ye.lazy(()=>Z(()=>import("./Home-BxpaS5R5.js"),__vite__mapDeps([11,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-CUZzo-Vw.js"),__vite__mapDeps([12,6,4])))},clean:{Home:ye.lazy(()=>Z(()=>import("./Home-KTKrKeDU.js"),__vite__mapDeps([13,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-lQQhtT0p.js"),__vite__mapDeps([14,6,4])))},corporate:{Home:ye.lazy(()=>Z(()=>import("./Home-DMzxmSBb.js"),__vite__mapDeps([15,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-CISyGCfm.js"),__vite__mapDeps([16,6,4])))},claude:{Home:ye.lazy(()=>Z(()=>import("./Home-CR3Oy2_s.js"),__vite__mapDeps([17,1,2,3,4]))),Layout:ye.lazy(()=>Z(()=>import("./Layout-CPY5kYpQ.js"),__vite__mapDeps([18,6,4])))}};function nw(){return A.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--page-bg)"},children:A.jsx("div",{className:"w-8 h-8 rounded-full animate-spin",style:{border:"2px solid var(--page-spinner-track)",borderTopColor:"var(--page-spinner)"}})})}function rw({children:e}){const{site:t,loading:n}=Dp();if(n)return A.jsx(nw,{});const r=(t==null?void 0:t.theme_template)||"starter";return A.jsx(ow,{themeName:r,children:e})}function ow({themeName:e,children:t}){const n=x.useMemo(()=>{const r=gc[e]||gc.starter;return{name:e,...r}},[e]);return A.jsx(Fp.Provider,{value:n,children:t})}function iw(){const e=x.useContext(Fp);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const sw=x.lazy(()=>Z(()=>import("./Login-BiHdkYGn.js"),__vite__mapDeps([19,4]))),lw=x.lazy(()=>Z(()=>import("./Register-BJzJhrQt.js"),__vite__mapDeps([20,4]))),aw=x.lazy(()=>Z(()=>import("./Dashboard-6T-v2duE.js"),__vite__mapDeps([21,2,4]))),uw=x.lazy(()=>Z(()=>import("./Tokens-BD_w3cXB.js"),__vite__mapDeps([22,4]))),cw=x.lazy(()=>Z(()=>import("./Packages-DTfyBY5U.js"),__vite__mapDeps([23,1,4]))),fw=x.lazy(()=>Z(()=>import("./Pricing-BYGRhypH.js"),__vite__mapDeps([24,4]))),dw=x.lazy(()=>Z(()=>import("./Topup-BkvooF5h.js"),__vite__mapDeps([25,2,4]))),pw=x.lazy(()=>Z(()=>import("./Logs-DPdRMLgj.js"),__vite__mapDeps([26,4]))),hw=()=>A.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--page-bg)"},children:A.jsx("div",{className:"w-8 h-8 rounded-full animate-spin",style:{border:"2px solid var(--page-spinner-track)",borderTopColor:"var(--page-spinner)"}})});function gw(){const{Home:e,Layout:t}=iw();return A.jsx(x.Suspense,{fallback:A.jsx(hw,{}),children:A.jsxs(py,{children:[A.jsxs(Fe,{element:A.jsx(t,{}),children:[A.jsx(Fe,{path:"/",element:A.jsx(e,{})}),A.jsx(Fe,{path:"/pricing",element:A.jsx(fw,{})}),A.jsx(Fe,{path:"/packages",element:A.jsx(cw,{})}),A.jsx(Fe,{path:"/login",element:A.jsx(sw,{})}),A.jsx(Fe,{path:"/register",element:A.jsx(lw,{})}),A.jsxs(Fe,{element:A.jsx(X0,{}),children:[A.jsx(Fe,{path:"/dashboard",element:A.jsx(aw,{})}),A.jsx(Fe,{path:"/tokens",element:A.jsx(uw,{})}),A.jsx(Fe,{path:"/logs",element:A.jsx(pw,{})}),A.jsx(Fe,{path:"/topup",element:A.jsx(dw,{})})]})]}),A.jsx(Fe,{path:"*",element:A.jsx(np,{to:"/",replace:!0})})]})})}function mw(){return A.jsx(rw,{children:A.jsx(gw,{})})}const D=e=>typeof e=="string",ar=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},mc=e=>e==null?"":""+e,yw=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},vw=/###/g,yc=e=>e&&e.indexOf("###")>-1?e.replace(vw,"."):e,vc=e=>!e||D(e),xr=(e,t,n)=>{const r=D(t)?t.split("."):t;let o=0;for(;o{const{obj:r,k:o}=xr(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let i=t[t.length-1],s=t.slice(0,t.length-1),l=xr(e,s,Object);for(;l.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),l=xr(e,s,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=n},ww=(e,t,n,r)=>{const{obj:o,k:i}=xr(e,t,Object);o[i]=o[i]||[],o[i].push(n)},pi=(e,t)=>{const{obj:n,k:r}=xr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Sw=(e,t,n)=>{const r=pi(e,n);return r!==void 0?r:pi(t,n)},jp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?D(e[r])||e[r]instanceof String||D(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):jp(e[r],t[r],n):e[r]=t[r]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const xw=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>kw[t]):e;class Ew{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Cw=[" ",",","?","!",";"],Pw=new Ew(20),Ow=(e,t,n)=>{t=t||"",n=n||"";const r=Cw.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const o=Pw.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!o.test(e);if(!i){const s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i},Pl=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let o=e;for(let i=0;i-1&&ae==null?void 0:e.replace(/_/g,"-"),Rw={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class hi{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Rw,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new hi(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new hi(this.logger,t)}}var at=new hi;class Mi{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,i])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,r,o={}){var u,c;const i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,s=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):D(r)&&i?l.push(...r.split(i)):l.push(r)));const a=pi(this.data,l);return!a&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),a||!s||!D(r)?a:Pl((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,i)}addResource(t,n,r,o,i={silent:!1}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."),o=n,n=l[1]),this.addNamespaces(n),wc(this.data,l,o),i.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(const i in r)(D(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,i,s={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),o=r,r=n,n=l[1]),this.addNamespaces(n);let a=pi(this.data,l)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?jp(a,r,i):a={...a,...r},wc(this.data,l,a),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var $p={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(i=>{var s;t=((s=this.processors[i])==null?void 0:s.process(t,n,r,o))??t}),t}};const zp=Symbol("i18next/PATH_KEY");function _w(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),o===zp?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Er(e,t){const{[zp]:n}=e(_w()),r=(t==null?void 0:t.keySeparator)??".",o=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&o){const i=t==null?void 0:t.ns,s=Array.isArray(i)?i:null;if(s&&s.length>1&&s.slice(1).includes(n[0]))return`${n[0]}${o}${n.slice(1).join(r)}`}return n.join(r)}const kc={},Ss=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class gi extends Mi{constructor(t,n={}){super(),yw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=at.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const o=this.resolve(t,r);if((o==null?void 0:o.res)===void 0)return!1;const i=Ss(o.res);return!(r.returnObjects===!1&&i)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ow(t,r,o);if(s&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:D(i)?[i]:i};const u=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(o)}return{key:t,namespaces:D(i)?[i]:i}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=Er(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?Er(V,{...this.options,...o}):String(V));const i=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:l,namespaces:a}=this.extractFromKey(t[t.length-1],o),u=a[a.length-1];let c=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=o.lng||this.language,p=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?i?{res:`${u}${c}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(o)}:`${u}${c}${l}`:i?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(o)}:l;const y=this.resolve(t,o);let d=y==null?void 0:y.res;const v=(y==null?void 0:y.usedKey)||l,w=(y==null?void 0:y.exactUsedKey)||l,g=["[object Number]","[object Function]","[object RegExp]"],h=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,k=o.count!==void 0&&!D(o.count),E=gi.hasDefaultValue(o),R=k?this.pluralResolver.getSuffix(f,o.count,o):"",P=o.ordinal&&k?this.pluralResolver.getSuffix(f,o.count,{ordinal:!1}):"",L=k&&!o.ordinal&&o.count===0,$=L&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${R}`]||o[`defaultValue${P}`]||o.defaultValue;let T=d;m&&!d&&E&&(T=$);const pe=Ss(T),Be=Object.prototype.toString.apply(T);if(m&&T&&pe&&g.indexOf(Be)<0&&!(D(h)&&Array.isArray(T))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,T,{...o,ns:a}):`key '${l} (${this.language})' returned an object instead of string.`;return i?(y.res=V,y.usedParams=this.getUsedParamsDetails(o),y):V}if(s){const V=Array.isArray(T),X=V?[]:{},Yt=V?w:v;for(const b in T)if(Object.prototype.hasOwnProperty.call(T,b)){const he=`${Yt}${s}${b}`;E&&!d?X[b]=this.translate(he,{...o,defaultValue:Ss($)?$[b]:void 0,joinArrays:!1,ns:a}):X[b]=this.translate(he,{...o,joinArrays:!1,ns:a}),X[b]===he&&(X[b]=T[b])}d=X}}else if(m&&D(h)&&Array.isArray(d))d=d.join(h),d&&(d=this.extendTranslation(d,t,o,r));else{let V=!1,X=!1;!this.isValidLookup(d)&&E&&(V=!0,d=$),this.isValidLookup(d)||(X=!0,d=l);const b=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&X?void 0:d,he=E&&$!==d&&this.options.updateMissing;if(X||V||he){if(this.logger.log(he?"updateKey":"missingKey",f,u,l,he?$:d),s){const F=this.resolve(l,{...o,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let O=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let F=0;F{var ft;const ke=E&&Re!==d?Re:b;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,U,ke,he,o):(ft=this.backendConnector)!=null&&ft.saveMissing&&this.backendConnector.saveMissing(F,u,U,ke,he,o),this.emit("missingKey",F,u,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?O.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,o);L&&o[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(Re=>{j([F],l+Re,o[`defaultValue${Re}`]||$)})}):j(O,l,$))}d=this.extendTranslation(d,t,o,y,r),X&&d===l&&this.options.appendNamespaceToMissingKey&&(d=`${u}${c}${l}`),(X||V)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${l}`:l,V?d:void 0,o))}return i?(y.res=d,y.usedParams=this.getUsedParamsDetails(o),y):d}extendTranslation(t,n,r,o,i){var a,u;if((a=this.i18nFormat)!=null&&a.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=D(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(c){const y=t.match(this.interpolator.nestingRegexp);f=y&&y.length}let p=r.replace&&!D(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||o.usedLng,r),c){const y=t.match(this.interpolator.nestingRegexp),d=y&&y.length;f(i==null?void 0:i[0])===y[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):this.translate(...y,n),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=D(s)?[s]:s;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=$p.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,i,s,l;return D(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(a=>typeof a=="function"?Er(a,{...this.options,...n}):a)),t.forEach(a=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(a,n),c=u.key;o=c;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!D(n.count),y=p&&!n.ordinal&&n.count===0,d=n.context!==void 0&&(D(n.context)||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{var g,h;this.isValidLookup(r)||(l=w,!kc[`${v[0]}-${w}`]&&((g=this.utils)!=null&&g.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(l))&&(kc[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${o}" for languages "${v.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(m=>{var R;if(this.isValidLookup(r))return;s=m;const k=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(k,c,m,w,n);else{let P;p&&(P=this.pluralResolver.getSuffix(m,n.count,n));const L=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(n.ordinal&&P.indexOf($)===0&&k.push(c+P.replace($,this.options.pluralSeparator)),k.push(c+P),y&&k.push(c+L)),d){const T=`${c}${this.options.contextSeparator||"_"}${n.context}`;k.push(T),p&&(n.ordinal&&P.indexOf($)===0&&k.push(T+P.replace($,this.options.pluralSeparator)),k.push(T+P),y&&k.push(T+L))}}let E;for(;E=k.pop();)this.isValidLookup(r)||(i=E,r=this.getResource(m,w,E,n))}))})}),{res:r,usedKey:o,exactUsedKey:i,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!D(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const i of n)delete o[i]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class xc{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=at.create("languageUtils")}getScriptPartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Hr(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(D(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),D(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),o=[],i=s=>{s&&(this.isSupportedCode(s)?o.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return D(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):D(t)&&i(this.formatLanguageCode(t)),r.forEach(s=>{o.indexOf(s)<0&&i(this.formatLanguageCode(s))}),o}}const Ec={zero:0,one:1,two:2,few:3,many:4,other:5},Cc={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Lw{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=at.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Hr(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(r,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Cc;if(!t.match(/-|_/))return Cc;const a=this.languageUtils.getLanguagePartFromCode(t);s=this.getRule(a,n)}return this.pluralRulesCache[i]=s,s}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,i)=>Ec[o]-Ec[i]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Pc=(e,t,n,r=".",o=!0)=>{let i=Sw(e,t,n);return!i&&o&&D(n)&&(i=Pl(e,n,r),i===void 0&&(i=Pl(t,n,r))),i},ks=e=>e.replace(/\$/g,"$$$$");class Oc{constructor(t={}){var n;this.logger=at.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:o,prefix:i,prefixEscaped:s,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:g,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:xw,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=i?Xt(i):s||"{{",this.suffix=l?Xt(l):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Xt(p):y||Xt("$t("),this.nestingSuffix=d?Xt(d):v||Xt(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=g||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,o){var y;let i,s,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=d=>{if(d.indexOf(this.formatSeparator)<0){const h=Pc(n,a,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,r,{...o,...n,interpolationkey:d}):h}const v=d.split(this.formatSeparator),w=v.shift().trim(),g=v.join(this.formatSeparator).trim();return this.format(Pc(n,a,w,this.options.keySeparator,this.options.ignoreJSONStructure),g,r,{...o,...n,interpolationkey:w})};this.resetRegExp();const c=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((y=o==null?void 0:o.interpolation)==null?void 0:y.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:d=>ks(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?ks(this.escape(d)):ks(d)}].forEach(d=>{for(l=0;i=d.regex.exec(t);){const v=i[1].trim();if(s=u(v),s===void 0)if(typeof c=="function"){const g=c(t,i,o);s=D(g)?g:""}else if(o&&Object.prototype.hasOwnProperty.call(o,v))s="";else if(f){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else!D(s)&&!this.useRawValueToEscape&&(s=mc(s));const w=d.safeValue(s);if(t=t.replace(i[0],w),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=i[0].length):d.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,i,s;const l=(a,u)=>{const c=this.nestingOptionsSeparator;if(a.indexOf(c)<0)return a;const f=a.split(new RegExp(`${Xt(c)}[ ]*{`));let p=`{${f[1]}`;a=f[0],p=this.interpolate(p,s);const y=p.match(/'/g),d=p.match(/"/g);(((y==null?void 0:y.length)??0)%2===0&&!d||((d==null?void 0:d.length)??0)%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,v),`${a}${c}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,a};for(;o=this.nestingRegexp.exec(t);){let a=[];s={...r},s=s.replace&&!D(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const u=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(u!==-1&&(a=o[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),o[1]=o[1].slice(0,u)),i=n(l.call(this,o[1].trim(),s),s),i&&o[0]===t&&!D(i))return i;D(i)||(i=mc(i)),i||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),i=""),a.length&&(i=a.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:o[1].trim()}),i.trim())),t=t.replace(o[0],i),this.regexp.lastIndex=0}return t}}const Tw=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(s=>{if(s){const[l,...a]=s.split(":"),u=a.join(":").trim().replace(/^'+|'+$/g,""),c=l.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},Rc=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let l=t[s];return l||(l=e(Hr(r),o),t[s]=l),l(n)}},Nw=e=>(t,n,r)=>e(Hr(n),r)(t);class Aw{constructor(t={}){this.logger=at.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Rc:Nw;this.formats={number:r((o,i)=>{const s=new Intl.NumberFormat(o,{...i});return l=>s.format(l)}),currency:r((o,i)=>{const s=new Intl.NumberFormat(o,{...i,style:"currency"});return l=>s.format(l)}),datetime:r((o,i)=>{const s=new Intl.DateTimeFormat(o,{...i});return l=>s.format(l)}),relativetime:r((o,i)=>{const s=new Intl.RelativeTimeFormat(o,{...i});return l=>s.format(l,i.range||"day")}),list:r((o,i)=>{const s=new Intl.ListFormat(o,{...i});return l=>s.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Rc(n)}format(t,n,r,o={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(a=>a.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,a)=>{var f;const{formatName:u,formatOptions:c}=Tw(a);if(this.formats[u]){let p=l;try{const y=((f=o==null?void 0:o.formatParams)==null?void 0:f[o.interpolationkey])||{},d=y.locale||y.lng||o.locale||o.lng||r;p=this.formats[u](l,d,{...c,...o,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const Iw=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Dw extends Mi{constructor(t,n,r,o={}){var i,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=at.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(s=(i=this.backend)==null?void 0:i.init)==null||s.call(i,r,o.backend,o)}queueLoad(t,n,r,o){const i={},s={},l={},a={};return t.forEach(u=>{let c=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,c=!1,s[p]===void 0&&(s[p]=!0),i[p]===void 0&&(i[p]=!0),a[f]===void 0&&(a[f]=!0)))}),c||(l[u]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const o=t.split("|"),i=o[0],s=o[1];n&&this.emit("failedLoading",i,s,n),!n&&r&&this.store.addResourceBundle(i,s,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(a=>{ww(a.loaded,[i],s),Iw(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(u=>{l[u]||(l[u]={});const c=a.loaded[u];c.length&&c.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r,o=0,i=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:i,callback:s});return}this.readingCalls++;const l=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&c&&o{this.read.call(this,t,n,r,o+1,i*2,s)},i);return}s(u,c)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const u=a(t,n);u&&typeof u.then=="function"?u.then(c=>l(null,c)).catch(l):l(null,u)}catch(u){l(u)}return}return a(t,n,l)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const i=this.queueLoad(t,n,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${n}loading namespace ${i} for language ${o} failed`,s),!s&&l&&this.logger.log(`${n}loaded namespace ${i} for language ${o}`,l),this.loaded(t,s,l)})}saveMissing(t,n,r,o,i,s={},l=()=>{}){var a,u,c,f,p;if((u=(a=this.services)==null?void 0:a.utils)!=null&&u.hasLoadedNamespace&&!((f=(c=this.services)==null?void 0:c.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((p=this.backend)!=null&&p.create){const y={...s,isUpdate:i},d=this.backend.create.bind(this.backend);if(d.length<6)try{let v;d.length===5?v=d(t,n,r,o,y):v=d(t,n,r,o),v&&typeof v.then=="function"?v.then(w=>l(null,w)).catch(l):l(null,v)}catch(v){l(v)}else d(t,n,r,o,l,y)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const xs=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),D(e[1])&&(t.defaultValue=e[1]),D(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_c=e=>{var t,n;return D(e.ns)&&(e.ns=[e.ns]),D(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),D(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Eo=()=>{},Fw=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},Up="__i18next_supportNoticeShown",jw=()=>typeof globalThis<"u"&&!!globalThis[Up],$w=()=>{typeof globalThis<"u"&&(globalThis[Up]=!0)},zw=e=>{var t,n,r,o,i,s,l,a,u,c,f,p,y;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((l=(s=(i=(o=e==null?void 0:e.modules)==null?void 0:o.backend)==null?void 0:i.constructor)==null?void 0:s.name)==null?void 0:l.indexOf("Locize"))>0||(u=(a=e==null?void 0:e.options)==null?void 0:a.backend)!=null&&u.backends&&e.options.backend.backends.some(d=>{var v,w,g;return((v=d==null?void 0:d.name)==null?void 0:v.indexOf("Locize"))>0||((g=(w=d==null?void 0:d.constructor)==null?void 0:w.name)==null?void 0:g.indexOf("Locize"))>0})||(f=(c=e==null?void 0:e.options)==null?void 0:c.backend)!=null&&f.projectId||(y=(p=e==null?void 0:e.options)==null?void 0:p.backend)!=null&&y.backendOptions&&e.options.backend.backendOptions.some(d=>d==null?void 0:d.projectId))};class Cr extends Mi{constructor(t={},n){if(super(),this.options=_c(t),this.services={},this.logger=at,this.modules={external:[]},Fw(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(D(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=xs();this.options={...r,...this.options,..._c(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!zw(this)&&!jw()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),$w());const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?at.init(o(this.modules.logger),this.options):at.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Aw;const c=new xc(this.options);this.store=new Sc(this.options.resources,this.options);const f=this.services;f.logger=at,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Lw(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=o(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Oc(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Dw(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new gi(this.services,this.options),this.translator.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Eo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const l=ar(),a=()=>{const u=(c,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(c,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),l}loadResources(t,n=Eo){var i,s;let r=n;const o=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};o?a(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),(s=(i=this.options.preload)==null?void 0:i.forEach)==null||s.call(i,u=>a(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const o=ar();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Eo),this.services.backendConnector.reload(t,n,i=>{o.resolve(),r(i)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&$p.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ar();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},i=(l,a)=>{a?this.isLanguageChangingTo===t&&(o(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},s=l=>{var c,f;!t&&!l&&this.services.languageDetector&&(l=[]);const a=D(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(a)?a:this.services.languageUtils.getBestMatchFromCodes(D(l)?[l]:l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),(f=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||f.call(c,u)),this.loadResources(u,p=>{i(p,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),r}getFixedT(t,n,r){const o=(i,s,...l)=>{let a;typeof s!="object"?a=this.options.overloadTranslationOptionHandler([i,s].concat(l)):a={...s},a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs,a.ns=a.ns||o.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||o.keyPrefix);const u={...this.options,...a},c=this.options.keySeparator||".";let f;return a.keyPrefix&&Array.isArray(i)?f=i.map(p=>(typeof p=="function"&&(p=Er(p,u)),`${a.keyPrefix}${c}${p}`)):(typeof i=="function"&&(i=Er(i,u)),f=a.keyPrefix?`${a.keyPrefix}${c}${i}`:i),this.t(f,a)};return D(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(l,a)=>{const u=this.services.backendConnector.state[`${l}|${a}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,s);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(i,t)))}loadNamespaces(t,n){const r=ar();return this.options.ns?(D(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ar();D(t)&&(t=[t]);const o=this.options.preload||[],i=t.filter(s=>o.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=o.concat(i),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var o,i;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const s=new Intl.Locale(t);if(s&&s.getTextInfo){const l=s.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new xc(xs());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Cr(t,n);return r.createInstance=Cr.createInstance,r}cloneInstance(t={},n=Eo){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},i=new Cr(o);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const l=Object.keys(this.store.data).reduce((a,u)=>(a[u]={...this.store.data[u]},a[u]=Object.keys(a[u]).reduce((c,f)=>(c[f]={...a[u][f]},c),a[u]),a),{});i.store=new Sc(l,o),i.services.resourceStore=i.store}if(t.interpolation){const a={...xs().interpolation,...this.options.interpolation,...t.interpolation},u={...o,interpolation:a};i.services.interpolator=new Oc(u)}return i.translator=new gi(i.services,o),i.translator.on("*",(l,...a)=>{i.emit(l,...a)}),i.init(o,n),i.translator.options=o,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Oe=Cr.createInstance();Oe.createInstance;Oe.dir;Oe.init;Oe.loadResources;Oe.reloadResources;Oe.use;Oe.changeLanguage;Oe.getFixedT;Oe.t;Oe.exists;Oe.setDefaultNamespace;Oe.hasLoadedNamespace;Oe.loadNamespaces;Oe.loadLanguages;const Uw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Mw={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},bw=e=>Mw[e],Bw=e=>e.replace(Uw,bw);let Ol={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Bw,transDefaultProps:void 0};const Vw=(e={})=>{Ol={...Ol,...e}},X1=()=>Ol;let Mp;const Hw=e=>{Mp=e},Z1=()=>Mp,Kw={type:"3rdParty",init(e){Vw(e.options.react),Hw(e)}},{slice:Ww,forEach:Qw}=[];function qw(e){return Qw.call(Ww.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Jw(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Lc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yw=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!Lc.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!Lc.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},Tc={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=Yw(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const s=o.substring(1).split("&");for(let l=0;l0&&s[l].substring(0,a)===t&&(n=s[l].substring(a+1))}}return n}},Zw={name:"hash",lookup(e){var o;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const s=i.substring(1);if(t){const l=s.split("&");for(let a=0;a0&&l[a].substring(0,u)===t&&(r=l[a].substring(u+1))}}if(r)return r;if(!r&&n>-1){const l=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(o=l[typeof n=="number"?n:0])==null?void 0:o.replace("/",""):void 0}}}return r}};let vn=null;const Nc=()=>{if(vn!==null)return vn;try{if(vn=typeof window<"u"&&window.localStorage!==null,!vn)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{vn=!1}return vn};var e1={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Nc())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Nc()&&window.localStorage.setItem(n,e)}};let wn=null;const Ac=()=>{if(wn!==null)return wn;try{if(wn=typeof window<"u"&&window.sessionStorage!==null,!wn)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{wn=!1}return wn};var t1={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ac())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ac()&&window.sessionStorage.setItem(n,e)}},n1={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i0?t:void 0}},r1={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},o1={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},i1={name:"subdomain",lookup(e){var o,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let bp=!1;try{document.cookie,bp=!0}catch{}const Bp=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];bp||Bp.splice(1,1);const s1=()=>({order:Bp,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Vp{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=qw(n,this.options||{},s1()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Gw),this.addDetector(Xw),this.addDetector(e1),this.addDetector(t1),this.addDetector(n1),this.addDetector(r1),this.addDetector(o1),this.addDetector(i1),this.addDetector(Zw)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.filter(r=>r!=null&&!Jw(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Vp.type="languageDetector";const l1={"nav.home":"Home","nav.pricing":"Pricing","nav.packages":"Packages","nav.dashboard":"Dashboard","nav.apiKeys":"API Keys","nav.login":"Login","nav.signUp":"Sign Up","nav.logout":"Logout","nav.contact":"Contact","home.heroSubtitle":"Access the world's most powerful AI models through a single API endpoint. Simple, affordable, reliable.","home.getStarted":"Get Started Free","home.viewPricing":"View Pricing","home.goToDashboard":"Go to Dashboard","home.aiModels":"AI Models","home.uptime":"Uptime","home.latency":"Latency","home.whyChooseUs":"Why Choose Us","home.whyChooseUsDesc":"Everything you need to build AI-powered applications","home.lightningFast":"Lightning Fast","home.lightningFastDesc":"Optimized routing and caching deliver responses with minimal latency. Load-balanced across multiple providers for maximum reliability.","home.securePrivate":"Secure & Private","home.securePrivateDesc":"Enterprise-grade security with encrypted API keys. No request logging by default. Your data stays your data.","home.payAsYouGo":"Pay As You Go","home.payAsYouGoDesc":"Transparent pricing with no hidden fees. Only pay for what you use. Multiple top-up options and subscription packages available.","home.availableModels":"Available Models","home.availableModelsDesc":"Access {{count}} AI models through a unified API","home.viewAllModels":"View all {{count}} models","home.plansPackages":"Plans & Packages","home.choosePlan":"Choose a plan that fits your needs","home.subscribe":"Subscribe","home.days":"{{count}} days","home.readyToStart":"Ready to Get Started?","home.readyToStartDesc":"Create your account and start building with AI in minutes. No credit card required.","home.createFreeAccount":"Create Free Account","home.signIn":"Sign In","home.defaultHeroTitle":"AI API Platform","login.welcomeBack":"Welcome Back","login.signInTo":"Sign in to {{name}}","login.signInToDefault":"Sign in to your account","login.username":"Username","login.password":"Password","login.enterUsername":"Enter your username","login.enterPassword":"Enter your password","login.signingIn":"Signing in...","login.signInBtn":"Sign In","login.noAccount":"Don't have an account?","login.createOne":"Create one","login.fillAllFields":"Please fill in all fields","login.welcomeBackToast":"Welcome back!","register.createAccount":"Create Account","register.getStartedWith":"Get started with {{name}}","register.getStartedDefault":"Get started with our platform","register.username":"Username","register.email":"Email","register.password":"Password","register.confirmPassword":"Confirm Password","register.chooseUsername":"Choose a username","register.emailPlaceholder":"your@email.com (optional)","register.passwordPlaceholder":"8-20 characters","register.repeatPassword":"Repeat your password","register.creating":"Creating...","register.createAccountBtn":"Create Account","register.hasAccount":"Already have an account?","register.signIn":"Sign in","register.fillRequired":"Please fill in all required fields","register.passwordMismatch":"Passwords do not match","register.passwordLength":"Password must be 8-20 characters","register.accountCreated":"Account created! Please sign in.","dashboard.welcome":"Welcome,","dashboard.manageDesc":"Manage your API usage, keys, and account","dashboard.balance":"Balance","dashboard.quotaUnits":"{{count}} quota units","dashboard.used":"Used","dashboard.totalRequests":"Total Requests","dashboard.redeemCode":"Redeem Code","dashboard.enterCode":"Enter redemption code","dashboard.redeeming":"Redeeming...","dashboard.redeem":"Redeem","dashboard.redeemSuccess":"Code redeemed successfully!","dashboard.quickLinks":"Quick Links","dashboard.apiKeys":"API Keys","dashboard.manageKeys":"Manage your keys","dashboard.packages":"Packages","dashboard.viewPlans":"View plans","dashboard.pricing":"Pricing","dashboard.modelPrices":"Model prices","dashboard.apiDocs":"API Docs","dashboard.comingSoon":"Coming soon","tokens.title":"API Keys","tokens.subtitle":"Manage your API access tokens","tokens.newKey":"+ New Key","tokens.createApiKey":"Create API Key","tokens.name":"Name","tokens.namePlaceholder":"e.g. my-app-key","tokens.cancel":"Cancel","tokens.creating":"Creating...","tokens.create":"Create","tokens.newApiKey":"Your New API Key","tokens.keyWarning":"This is the only time you'll see this key. Copy it now and store it securely.","tokens.copied":"Copied!","tokens.copy":"Copy","tokens.copiedToClipboard":"Copied to clipboard!","tokens.savedKey":"I've saved my key","tokens.deleteToken":"Delete Token","tokens.deleteConfirm":'Delete "{{name}}"? This cannot be undone.',"tokens.delete":"Delete","tokens.noKeys":"No API keys yet","tokens.createFirst":"Create Your First Key","tokens.enabled":"Enabled","tokens.disabled":"Disabled","tokens.tokenDisabled":"Token disabled","tokens.tokenEnabled":"Token enabled","tokens.tokenDeleted":"Token deleted","tokens.enterName":"Please enter a name","tokens.quickStart":"Quick Start","tokens.quickStartComment":"# Use your API key with OpenAI-compatible endpoint","config.title":"Config File Export","config.subtitle":"Select your API Key and model to generate config files","config.selectKey":"Select API Key","config.selectModel":"Select Model","config.selectTool":"Select Tool","config.copy":"Copy","config.download":"Download","config.copied":"Copied to clipboard!","config.downloaded":"Config file downloaded","config.loading":"Loading...","config.loginPrompt":"Log in to generate your config","config.loginDesc":"Select your API Key and model to auto-fill config files","config.searchModel":"Search models...","config.noModelMatch":"No models match your search","pricing.title":"Model Pricing","pricing.subtitle":"Transparent, pay-as-you-go pricing for all available models. Prices shown per 1M tokens.","pricing.searchPlaceholder":"Search models...","pricing.noMatch":"No models match your search","pricing.noModels":"No models available","pricing.model":"Model","pricing.inputPrice":"Input / 1M tokens","pricing.outputPrice":"Output / 1M tokens","pricing.status":"Status","pricing.online":"Online","pricing.unknown":"Unknown","pricing.vendor":"Vendor","pricing.allVendors":"All","packages.title":"Packages & Plans","packages.subtitle":"Choose a package that fits your usage. All plans include access to all available models.","packages.noPackages":"No packages available at the moment.","packages.checkPricing":"Check model pricing","packages.daysAccess":"{{count}} days access","packages.creditIncluded":"¥{{amount}} credit included","packages.requestsMin":"{{count}} requests/min","packages.allModels":"All models access","packages.openaiApi":"OpenAI-compatible API","packages.subscribeNow":"Subscribe Now","packages.signUpToSubscribe":"Sign Up to Subscribe","packages.processing":"Processing...","packages.confirmTitle":"Confirm Subscription","packages.confirmDesc":"Subscribe to {{name}} for ${{price}}?","packages.yourBalance":"Your balance:","packages.insufficientBalance":"Insufficient balance. Please top up before subscribing.","packages.confirm":"Confirm","packages.subscribedSuccess":"Subscribed successfully!","packages.mySubscriptions":"My Subscriptions","packages.subscriptionId":"Subscription #{{id}}","packages.active":"Active","packages.expires":"Expires","packages.nextReset":"Next reset","packages.remaining":"Remaining","packages.unusedQuotaExpires":"Unused quota expires each period","packages.resetNever":"One-time","packages.resetDaily":"Resets daily","packages.resetWeekly":"Resets weekly","packages.resetMonthly":"Resets monthly","packages.periodicQuota":"¥{{amount}} {{period}} quota","packages.subscriptionInfo":"This is a subscription ({{period}}), valid for {{days}} days. Each period grants ¥{{amount}} quota. Unused quota expires.","packages.officialEquiv":"Equivalent to ${{amount}} at {{model}} official pricing","common.sessionExpired":"Session expired, please log in again","common.requestFailed":"Request failed","nav.topup":"Top Up","topup.title":"Top Up","topup.subtitle":"Recharge your account balance via online payment or redemption code","topup.onlineTopup":"Online Top Up","topup.selectAmount":"Select Amount","topup.customAmount":"Custom Amount","topup.amountPlaceholder":"Enter amount (min ${{min}})","topup.paymentMethod":"Payment Method","topup.processing":"Processing...","topup.calculating":"Calculating...","topup.payAmountLabel":"Amount to pay","topup.enterAmount":"Please enter a top-up amount","topup.paymentSuccess":"Payment successful! Balance updated.","topup.orderExpired":"Payment order expired","topup.viewHistory":"View History","topup.hideHistory":"Hide History","topup.history":"Top-Up History","topup.noHistory":"No top-up records yet","topup.statusSuccess":"Success","topup.statusPending":"Pending","topup.statusFailed":"Failed","topup.redeemTitle":"Redeem Code","topup.enterRedeemCode":"Enter redemption code","topup.redeeming":"Redeeming...","topup.redeem":"Redeem","topup.redeemCode":"Redeem Code","topup.redeemSuccess":"Code redeemed successfully!","topup.cryptoPayment":"Crypto Payment","topup.walletAddress":"Wallet Address","topup.amount":"Amount","topup.chain":"Chain","topup.waitingPayment":"Waiting for payment...","topup.close":"Close","topup.selectChain":"Please select a blockchain network","topup.selectToken":"Please select a token","topup.token":"Token","topup.payWith":"Pay with","topup.payNow":"Pay","topup.quotaIncluded":"{{count}} quota included","topup.creemPayment":"Creem Payment","nav.logs":"Logs","dashboard.logs":"Call Logs","dashboard.viewLogs":"View usage details","logs.title":"Call Logs","logs.subtitle":"View detailed records of every API call","logs.filterModel":"Filter by model...","logs.filterToken":"Filter by token...","logs.clearFilter":"Clear","logs.noLogs":"No call records yet","logs.time":"Time","logs.model":"Model","logs.token":"Token","logs.promptTokens":"Input","logs.completionTokens":"Output","logs.cost":"Cost","logs.duration":"Duration","logs.showing":"{{from}}-{{to}} of {{total}}","logs.prev":"Prev","logs.next":"Next"},a1={translation:l1},u1={"nav.home":"首页","nav.pricing":"定价","nav.packages":"套餐","nav.dashboard":"控制台","nav.apiKeys":"API 密钥","nav.login":"登录","nav.signUp":"注册","nav.logout":"退出","nav.contact":"联系我们","home.heroSubtitle":"通过单一 API 端点访问全球最强大的 AI 模型。简单、实惠、可靠。","home.getStarted":"免费开始","home.viewPricing":"查看定价","home.goToDashboard":"进入控制台","home.aiModels":"AI 模型","home.uptime":"在线率","home.latency":"延迟","home.whyChooseUs":"为什么选择我们","home.whyChooseUsDesc":"构建 AI 应用所需的一切","home.lightningFast":"极速响应","home.lightningFastDesc":"优化的路由和缓存以最低延迟交付响应。跨多个供应商负载均衡,确保最大可靠性。","home.securePrivate":"安全可靠","home.securePrivateDesc":"企业级安全性,API 密钥加密存储。默认不记录请求日志。您的数据由您掌控。","home.payAsYouGo":"按量付费","home.payAsYouGoDesc":"透明定价,无隐藏费用。按使用量付费。提供多种充值方式和订阅套餐。","home.availableModels":"可用模型","home.availableModelsDesc":"通过统一 API 访问 {{count}} 个 AI 模型","home.viewAllModels":"查看全部 {{count}} 个模型","home.plansPackages":"套餐方案","home.choosePlan":"选择适合您需求的方案","home.subscribe":"订阅","home.days":"{{count}} 天","home.readyToStart":"准备好了吗?","home.readyToStartDesc":"创建账户,几分钟内即可开始使用 AI 构建应用。无需信用卡。","home.createFreeAccount":"免费创建账户","home.signIn":"登录","home.defaultHeroTitle":"AI API 平台","login.welcomeBack":"欢迎回来","login.signInTo":"登录到 {{name}}","login.signInToDefault":"登录您的账户","login.username":"用户名","login.password":"密码","login.enterUsername":"请输入用户名","login.enterPassword":"请输入密码","login.signingIn":"登录中...","login.signInBtn":"登录","login.noAccount":"还没有账户?","login.createOne":"立即注册","login.fillAllFields":"请填写所有字段","login.welcomeBackToast":"欢迎回来!","register.createAccount":"创建账户","register.getStartedWith":"开始使用 {{name}}","register.getStartedDefault":"开始使用我们的平台","register.username":"用户名","register.email":"邮箱","register.password":"密码","register.confirmPassword":"确认密码","register.chooseUsername":"请选择用户名","register.emailPlaceholder":"your@email.com(可选)","register.passwordPlaceholder":"8-20 个字符","register.repeatPassword":"请再次输入密码","register.creating":"创建中...","register.createAccountBtn":"创建账户","register.hasAccount":"已有账户?","register.signIn":"立即登录","register.fillRequired":"请填写所有必填字段","register.passwordMismatch":"两次密码不一致","register.passwordLength":"密码长度需为 8-20 个字符","register.accountCreated":"账户创建成功!请登录。","dashboard.welcome":"欢迎,","dashboard.manageDesc":"管理您的 API 用量、密钥和账户","dashboard.balance":"余额","dashboard.quotaUnits":"{{count}} 额度单位","dashboard.used":"已使用","dashboard.totalRequests":"总请求数","dashboard.redeemCode":"兑换码","dashboard.enterCode":"请输入兑换码","dashboard.redeeming":"兑换中...","dashboard.redeem":"兑换","dashboard.redeemSuccess":"兑换码兑换成功!","dashboard.quickLinks":"快捷入口","dashboard.apiKeys":"API 密钥","dashboard.manageKeys":"管理您的密钥","dashboard.packages":"套餐","dashboard.viewPlans":"查看方案","dashboard.pricing":"定价","dashboard.modelPrices":"模型价格","dashboard.apiDocs":"API 文档","dashboard.comingSoon":"即将推出","tokens.title":"API 密钥","tokens.subtitle":"管理您的 API 访问令牌","tokens.newKey":"+ 新建密钥","tokens.createApiKey":"创建 API 密钥","tokens.name":"名称","tokens.namePlaceholder":"例如 my-app-key","tokens.cancel":"取消","tokens.creating":"创建中...","tokens.create":"创建","tokens.newApiKey":"您的新 API 密钥","tokens.keyWarning":"这是您唯一一次看到此密钥的机会。请立即复制并安全保存。","tokens.copied":"已复制!","tokens.copy":"复制","tokens.copiedToClipboard":"已复制到剪贴板!","tokens.savedKey":"我已保存密钥","tokens.deleteToken":"删除令牌","tokens.deleteConfirm":'删除 "{{name}}"?此操作不可撤销。',"tokens.delete":"删除","tokens.noKeys":"暂无 API 密钥","tokens.createFirst":"创建您的第一个密钥","tokens.enabled":"已启用","tokens.disabled":"已禁用","tokens.tokenDisabled":"令牌已禁用","tokens.tokenEnabled":"令牌已启用","tokens.tokenDeleted":"令牌已删除","tokens.enterName":"请输入名称","tokens.quickStart":"快速开始","tokens.quickStartComment":"# 使用 OpenAI 兼容端点调用 API","config.title":"配置文件导出","config.subtitle":"选择您的 API Key 和模型,一键生成配置文件","config.selectKey":"选择 API Key","config.selectModel":"选择模型","config.selectTool":"选择工具","config.copy":"复制","config.download":"下载","config.copied":"已复制到剪贴板","config.downloaded":"配置文件已下载","config.loading":"加载中...","config.loginPrompt":"登录后可生成您的专属配置","config.loginDesc":"选择 API Key 和模型,自动填充到配置文件中","config.searchModel":"搜索模型...","config.noModelMatch":"没有匹配的模型","pricing.title":"模型定价","pricing.subtitle":"透明的按量付费定价。价格以每百万 token 计。","pricing.searchPlaceholder":"搜索模型...","pricing.noMatch":"没有匹配的模型","pricing.noModels":"暂无可用模型","pricing.model":"模型","pricing.inputPrice":"输入 / 百万 token","pricing.outputPrice":"输出 / 百万 token","pricing.status":"状态","pricing.online":"在线","pricing.unknown":"未知","pricing.vendor":"厂商","pricing.allVendors":"全部","packages.title":"套餐方案","packages.subtitle":"选择适合您用量的套餐。所有方案均可访问全部可用模型。","packages.noPackages":"暂无可用套餐。","packages.checkPricing":"查看模型定价","packages.daysAccess":"{{count}} 天有效期","packages.creditIncluded":"含 ¥{{amount}} 额度","packages.requestsMin":"{{count}} 次请求/分钟","packages.allModels":"全部模型可用","packages.openaiApi":"OpenAI 兼容 API","packages.subscribeNow":"立即订阅","packages.signUpToSubscribe":"注册后订阅","packages.processing":"处理中...","packages.confirmTitle":"确认订阅","packages.confirmDesc":"订阅 {{name}},价格 ${{price}}?","packages.yourBalance":"您的余额:","packages.insufficientBalance":"余额不足,请先充值。","packages.confirm":"确认","packages.subscribedSuccess":"订阅成功!","packages.mySubscriptions":"我的订阅","packages.subscriptionId":"订阅 #{{id}}","packages.active":"活跃","packages.expires":"到期","packages.nextReset":"下次重置","packages.remaining":"剩余","packages.unusedQuotaExpires":"未用完额度到期作废","packages.resetNever":"一次性","packages.resetDaily":"每日重置","packages.resetWeekly":"每周重置","packages.resetMonthly":"每月重置","packages.periodicQuota":"{{period}}额度 ¥{{amount}}","packages.subscriptionInfo":"📋 此套餐为周期订阅({{period}}),有效期 {{days}} 天。每个周期获得 ¥{{amount}} 额度,未用完作废。","packages.officialEquiv":"相当于 {{model}} 官方 ${{amount}} 额度","common.sessionExpired":"会话已过期,请重新登录","common.requestFailed":"请求失败","nav.topup":"充值","topup.title":"充值中心","topup.subtitle":"通过在线支付或兑换码为账户充值","topup.onlineTopup":"在线充值","topup.selectAmount":"选择金额","topup.customAmount":"自定义金额","topup.amountPlaceholder":"输入金额(最低 ${{min}})","topup.paymentMethod":"支付方式","topup.processing":"处理中...","topup.calculating":"计算中...","topup.payAmountLabel":"实付金额","topup.enterAmount":"请输入充值金额","topup.paymentSuccess":"支付成功!余额已更新。","topup.orderExpired":"支付订单已过期","topup.viewHistory":"查看记录","topup.hideHistory":"隐藏记录","topup.history":"充值记录","topup.noHistory":"暂无充值记录","topup.statusSuccess":"成功","topup.statusPending":"待支付","topup.statusFailed":"失败","topup.redeemTitle":"兑换码充值","topup.enterRedeemCode":"请输入兑换码","topup.redeeming":"兑换中...","topup.redeem":"兑换","topup.redeemCode":"兑换码","topup.redeemSuccess":"兑换码兑换成功!","topup.cryptoPayment":"加密货币支付","topup.walletAddress":"钱包地址","topup.amount":"金额","topup.chain":"链","topup.waitingPayment":"等待支付中...","topup.close":"关闭","topup.selectChain":"请选择区块链网络","topup.selectToken":"请选择代币","topup.token":"代币","topup.payWith":"使用","topup.payNow":"支付","topup.quotaIncluded":"含 {{count}} 额度","topup.creemPayment":"Creem 支付","nav.logs":"调用日志","dashboard.logs":"调用日志","dashboard.viewLogs":"查看使用明细","logs.title":"调用日志","logs.subtitle":"查看每次 API 调用的详细记录","logs.filterModel":"按模型筛选...","logs.filterToken":"按令牌筛选...","logs.clearFilter":"清除","logs.noLogs":"暂无调用记录","logs.time":"时间","logs.model":"模型","logs.token":"令牌","logs.promptTokens":"输入","logs.completionTokens":"输出","logs.cost":"消费","logs.duration":"耗时","logs.showing":"第 {{from}}-{{to}} 条,共 {{total}} 条","logs.prev":"上一页","logs.next":"下一页"},c1={translation:u1};Oe.use(Vp).use(Kw).init({load:"languageOnly",resources:{en:a1,zh:c1},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag","querystring"],caches:["localStorage"]}});Es.createRoot(document.getElementById("root")).render(A.jsx(ye.StrictMode,{children:A.jsx(Sy,{children:A.jsx(tw,{children:A.jsxs(Y0,{children:[A.jsx(mw,{}),A.jsx(fv,{position:"top-center",toastOptions:{duration:3e3,style:{background:"#1a1a2e",color:"#fff",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",fontSize:"14px"}}})]})})})}));export{F1 as A,X1 as B,Z1 as C,f1 as L,np as N,fy as O,N1 as Q,Dp as a,Gd as b,Gn as c,G1 as d,M1 as e,j1 as f,D1 as g,A1 as h,$1 as i,A as j,z1 as k,U1 as l,I1 as m,B1 as n,V1 as o,H1 as p,W1 as q,x as r,b1 as s,K1 as t,G0 as u,Q1 as v,q1 as w,J1 as x,Y1 as y,hs as z}; diff --git a/dist/assets/useTranslation-KkRwPkkT.js b/dist/assets/useTranslation-Ce9HcVki.js similarity index 98% rename from dist/assets/useTranslation-KkRwPkkT.js rename to dist/assets/useTranslation-Ce9HcVki.js index 53f7a0a..a82b982 100644 --- a/dist/assets/useTranslation-KkRwPkkT.js +++ b/dist/assets/useTranslation-Ce9HcVki.js @@ -1,4 +1,4 @@ -import{r as l,B as Y,C as q}from"./index-ZavRXCeN.js";const H=(e,t,r,i)=>{var n,d,y,g;const s=[r,{code:t,...i||{}}];if((d=(n=e==null?void 0:e.services)==null?void 0:n.logger)!=null&&d.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);p(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(y=e==null?void 0:e.services)==null?void 0:y.logger)!=null&&g.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},z={},U=(e,t,r,i)=>{p(r)&&z[r]||(p(r)&&(z[r]=new Date),H(e,t,r,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},O=(e,t,r)=>{e.loadNamespaces(t,F(e,r))},A=(e,t,r,i)=>{if(p(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O(e,r,i);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,F(e,i))},J=(e,t,r={})=>!t.languages||!t.languages.length?(U(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),p=e=>typeof e=="string",K=e=>typeof e=="object"&&e!==null,Q=l.createContext();class V{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var M={exports:{}},$={};/** +import{r as l,B as Y,C as q}from"./index-DOUW22cV.js";const H=(e,t,r,i)=>{var n,d,y,g;const s=[r,{code:t,...i||{}}];if((d=(n=e==null?void 0:e.services)==null?void 0:n.logger)!=null&&d.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);p(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(g=(y=e==null?void 0:e.services)==null?void 0:y.logger)!=null&&g.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},z={},U=(e,t,r,i)=>{p(r)&&z[r]||(p(r)&&(z[r]=new Date),H(e,t,r,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},O=(e,t,r)=>{e.loadNamespaces(t,F(e,r))},A=(e,t,r,i)=>{if(p(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O(e,r,i);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,F(e,i))},J=(e,t,r={})=>!t.languages||!t.languages.length?(U(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),p=e=>typeof e=="string",K=e=>typeof e=="object"&&e!==null,Q=l.createContext();class V{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var M={exports:{}},$={};/** * @license React * use-sync-external-store-shim.production.js * diff --git a/dist/index.html b/dist/index.html index 1f611f2..5dfe416 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,7 +7,7 @@ AI Platform - + diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 79732c3..a38ecb9 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -156,7 +156,7 @@ "packages.noPackages": "No packages available at the moment.", "packages.checkPricing": "Check model pricing", "packages.daysAccess": "{{count}} days access", - "packages.creditIncluded": "${{amount}} credit included", + "packages.creditIncluded": "¥{{amount}} credit included", "packages.requestsMin": "{{count}} requests/min", "packages.allModels": "All models access", "packages.openaiApi": "OpenAI-compatible API", @@ -180,8 +180,8 @@ "packages.resetDaily": "Resets daily", "packages.resetWeekly": "Resets weekly", "packages.resetMonthly": "Resets monthly", - "packages.periodicQuota": "${{amount}} {{period}} quota", - "packages.subscriptionInfo": "This is a subscription ({{period}}), valid for {{days}} days. Each period grants ${{amount}} quota. Unused quota expires.", + "packages.periodicQuota": "¥{{amount}} {{period}} quota", + "packages.subscriptionInfo": "This is a subscription ({{period}}), valid for {{days}} days. Each period grants ¥{{amount}} quota. Unused quota expires.", "packages.officialEquiv": "Equivalent to ${{amount}} at {{model}} official pricing", "common.sessionExpired": "Session expired, please log in again", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 609139c..364aa5e 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -156,7 +156,7 @@ "packages.noPackages": "暂无可用套餐。", "packages.checkPricing": "查看模型定价", "packages.daysAccess": "{{count}} 天有效期", - "packages.creditIncluded": "含 ${{amount}} 额度", + "packages.creditIncluded": "含 ¥{{amount}} 额度", "packages.requestsMin": "{{count}} 次请求/分钟", "packages.allModels": "全部模型可用", "packages.openaiApi": "OpenAI 兼容 API", @@ -180,8 +180,8 @@ "packages.resetDaily": "每日重置", "packages.resetWeekly": "每周重置", "packages.resetMonthly": "每月重置", - "packages.periodicQuota": "{{period}}额度 ${{amount}}", - "packages.subscriptionInfo": "📋 此套餐为周期订阅({{period}}),有效期 {{days}} 天。每个周期获得 ${{amount}} 额度,未用完作废。", + "packages.periodicQuota": "{{period}}额度 ¥{{amount}}", + "packages.subscriptionInfo": "📋 此套餐为周期订阅({{period}}),有效期 {{days}} 天。每个周期获得 ¥{{amount}} 额度,未用完作废。", "packages.officialEquiv": "相当于 {{model}} 官方 ${{amount}} 额度", "common.sessionExpired": "会话已过期,请重新登录", diff --git a/src/pages/Packages.jsx b/src/pages/Packages.jsx index b422a6d..0d16b6a 100644 --- a/src/pages/Packages.jsx +++ b/src/pages/Packages.jsx @@ -236,8 +236,8 @@ export default function Packages() { {isSubscription - ? t('packages.periodicQuota', { amount: (pkg.quota_amount / Q).toFixed(2), period: getResetLabel(resetPeriod) }) - : t('packages.creditIncluded', { amount: (pkg.quota_amount / Q).toFixed(2) }) + ? t('packages.periodicQuota', { amount: (pkg.quota_amount / Q * rate).toFixed(2), period: getResetLabel(resetPeriod) }) + : t('packages.creditIncluded', { amount: (pkg.quota_amount / Q * rate).toFixed(2) }) } )} @@ -297,7 +297,7 @@ export default function Packages() { {t('packages.subscriptionInfo', { period: getResetLabel(resetPeriod), days: confirmPkg.duration || 30, - amount: (confirmPkg.quota_amount / Q).toFixed(2), + amount: (confirmPkg.quota_amount / Q * rate).toFixed(2), })}