diff --git a/dist/assets/CountUp-M8KqDP8n.js b/dist/assets/CountUp-BixuEoA6.js similarity index 99% rename from dist/assets/CountUp-M8KqDP8n.js rename to dist/assets/CountUp-BixuEoA6.js index 56fa87f..7a3e9c9 100644 --- a/dist/assets/CountUp-M8KqDP8n.js +++ b/dist/assets/CountUp-BixuEoA6.js @@ -1 +1 @@ -import{r as S,j as Qt}from"./index-C1LcEmdp.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-D8eKls75.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-DDH6EKjw.js b/dist/assets/Dashboard-sLmY72mU.js similarity index 97% rename from dist/assets/Dashboard-DDH6EKjw.js rename to dist/assets/Dashboard-sLmY72mU.js index 61b56ee..8da7d80 100644 --- a/dist/assets/Dashboard-DDH6EKjw.js +++ b/dist/assets/Dashboard-sLmY72mU.js @@ -1 +1 @@ -import{u as y,r as o,j as e,Q as g,L as l,g as q,d as k,z as U}from"./index-C1LcEmdp.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{u as w}from"./useTranslation-kIlHvV5e.js";function L(){const{t:s}=w(),{user:a,refreshUser:u}=y(),[t,b]=o.useState(null),[r,n]=o.useState(""),[i,x]=o.useState(!1),m=async()=>{try{const d=await q();d.data.success&&b(d.data.data)}catch{}};o.useEffect(()=>{m()},[]);const j=async d=>{if(d.preventDefault(),!!r.trim()){x(!0);try{(await k(r.trim())).data.success&&(U.success(s("dashboard.redeemSuccess")),n(""),await Promise.all([m(),u()]))}catch{}x(!1)}},p=(t==null?void 0:t.quota)??(a==null?void 0:a.quota)??0,h=(t==null?void 0:t.used_quota)??(a==null?void 0:a.used_quota)??0,N=(t==null?void 0:t.request_count)??(a==null?void 0:a.request_count)??0,f=p/g;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:["$",e.jsx(c,{from:0,to:f,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:p.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:["$",e.jsx(c,{from:0,to:h/g,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:h.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(c,{from:0,to:N,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:j,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:r,onChange:d=>n(d.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:i,className:"btn-primary whitespace-nowrap",children:s(i?"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(l,{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(l,{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(l,{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("div",{className:"glass-sm !rounded-xl px-4 py-3 opacity-50",children:[e.jsx("p",{className:"text-sm font-medium text-page",children:s("dashboard.apiDocs")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.comingSoon")})]})]})]})]})]})}export{L as default}; +import{u as y,r as o,j as e,Q as g,L as l,g as q,d as k,z as U}from"./index-D8eKls75.js";import{C as c}from"./CountUp-BixuEoA6.js";import{u as w}from"./useTranslation-D_OVvIX9.js";function L(){const{t:s}=w(),{user:a,refreshUser:u}=y(),[t,b]=o.useState(null),[r,n]=o.useState(""),[i,x]=o.useState(!1),m=async()=>{try{const d=await q();d.data.success&&b(d.data.data)}catch{}};o.useEffect(()=>{m()},[]);const j=async d=>{if(d.preventDefault(),!!r.trim()){x(!0);try{(await k(r.trim())).data.success&&(U.success(s("dashboard.redeemSuccess")),n(""),await Promise.all([m(),u()]))}catch{}x(!1)}},p=(t==null?void 0:t.quota)??(a==null?void 0:a.quota)??0,h=(t==null?void 0:t.used_quota)??(a==null?void 0:a.used_quota)??0,N=(t==null?void 0:t.request_count)??(a==null?void 0:a.request_count)??0,f=p/g;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:["$",e.jsx(c,{from:0,to:f,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:p.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:["$",e.jsx(c,{from:0,to:h/g,duration:1.5})]}),e.jsx("p",{className:"text-xs text-page-muted mt-1",children:s("dashboard.quotaUnits",{count:h.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(c,{from:0,to:N,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:j,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:r,onChange:d=>n(d.target.value),className:"input flex-1",placeholder:s("dashboard.enterCode")}),e.jsx("button",{type:"submit",disabled:i,className:"btn-primary whitespace-nowrap",children:s(i?"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(l,{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(l,{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(l,{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("div",{className:"glass-sm !rounded-xl px-4 py-3 opacity-50",children:[e.jsx("p",{className:"text-sm font-medium text-page",children:s("dashboard.apiDocs")}),e.jsx("p",{className:"text-xs text-page-muted",children:s("dashboard.comingSoon")})]})]})]})]})]})}export{L as default}; diff --git a/dist/assets/FadeContent-CEb-jr-E.js b/dist/assets/FadeContent-B3Mc1Ysf.js similarity index 91% rename from dist/assets/FadeContent-CEb-jr-E.js rename to dist/assets/FadeContent-B3Mc1Ysf.js index eef035b..082bb0d 100644 --- a/dist/assets/FadeContent-CEb-jr-E.js +++ b/dist/assets/FadeContent-B3Mc1Ysf.js @@ -1 +1 @@ -import{r as n,j as b}from"./index-C1LcEmdp.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-D8eKls75.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-Z4Xt2qzF.js b/dist/assets/Home-B_aQfVX_.js similarity index 96% rename from dist/assets/Home-Z4Xt2qzF.js rename to dist/assets/Home-B_aQfVX_.js index bd96c07..458ddc1 100644 --- a/dist/assets/Home-Z4Xt2qzF.js +++ b/dist/assets/Home-B_aQfVX_.js @@ -1 +1 @@ -import{u as D,a as g,r as d,f,l as N,j as e,L as l,Q as v}from"./index-C1LcEmdp.js";import{c as y,R as E}from"./RotatingEquiv-ByYi0mto.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{F as r}from"./FadeContent-CEb-jr-E.js";import{u as w}from"./useTranslation-kIlHvV5e.js";function P(){const{t}=w(),{user:i}=D(),{site:n}=g(),[u,p]=d.useState([]),[x,j]=d.useState([]);d.useEffect(()=>{f().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{}),N().then(s=>{s.data.success&&j(s.data.data||[])}).catch(()=>{})},[]);const o=u.filter(s=>s.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(r,{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:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-[#6B5D4F] mt-6 leading-relaxed max-w-xl",children:t("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-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[t("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:t("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(r,{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(c,{from:0,to:o.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:t("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(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,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:s.title}),e.jsx("p",{className:"text-sm text-[#6B5D4F] leading-relaxed max-w-lg",children:s.desc})]})]},a))})]})})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(r,{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:t("home.availableModels")}),e.jsx("p",{className:"text-[#8B7D6E]",children:t("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-[#D97757] hover:text-[#C4613F] transition-colors",children:[t("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((s,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:s.display_name||s.model_name})},s.id||a))})]})}),x.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,a)=>{const b=s.quota_amount>0?s.quota_amount/v:0,m=y(o,b);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-[#3D3024]",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-[#3D3024]",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-[#8B7D6E] line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-[#8B7D6E] mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-[#D97757] mt-2",children:["🔥 ",e.jsx(E,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(l,{to:i?"/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:t(i?"home.subscribe":"home.getStarted")})]},s.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(r,{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:t("home.readyToStart")}),e.jsx("p",{className:"text-[#8B7D6E] mb-8 max-w-md mx-auto",children:t("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-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[t("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:[t("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:t("home.signIn")})]})})]})})})]})}export{P as default}; +import{u as D,a as g,r as d,f,l as N,j as e,L as l,Q as v}from"./index-D8eKls75.js";import{c as y,R as E}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as r}from"./FadeContent-B3Mc1Ysf.js";import{u as w}from"./useTranslation-D_OVvIX9.js";function P(){const{t}=w(),{user:i}=D(),{site:n}=g(),[u,p]=d.useState([]),[x,j]=d.useState([]);d.useEffect(()=>{f().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{}),N().then(s=>{s.data.success&&j(s.data.data||[])}).catch(()=>{})},[]);const o=u.filter(s=>s.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(r,{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:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-[#6B5D4F] mt-6 leading-relaxed max-w-xl",children:t("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-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[t("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:t("home.getStarted")}),e.jsxs(l,{to:"/pricing",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(r,{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(c,{from:0,to:o.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-[#3D3024]",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-0.5",children:t("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(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,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:s.title}),e.jsx("p",{className:"text-sm text-[#6B5D4F] leading-relaxed max-w-lg",children:s.desc})]})]},a))})]})})}),o.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(r,{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:t("home.availableModels")}),e.jsx("p",{className:"text-[#8B7D6E]",children:t("home.availableModelsDesc",{count:o.length})})]}),o.length>8&&e.jsxs(l,{to:"/pricing",className:"text-sm text-[#D97757] hover:text-[#C4613F] transition-colors",children:[t("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((s,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:s.display_name||s.model_name})},s.id||a))})]})}),x.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-[#3D3024] mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-[#8B7D6E] mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,a)=>{const b=s.quota_amount>0?s.quota_amount/v:0,m=y(o,b);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-[#3D3024]",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-[#8B7D6E] mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-[#3D3024]",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-[#8B7D6E] line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-[#8B7D6E] mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-[#D97757] mt-2",children:["🔥 ",e.jsx(E,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(l,{to:i?"/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:t(i?"home.subscribe":"home.getStarted")})]},s.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(r,{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:t("home.readyToStart")}),e.jsx("p",{className:"text-[#8B7D6E] mb-8 max-w-md mx-auto",children:t("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-full bg-[#D97757] text-white font-medium text-sm hover:bg-[#C4613F] transition-colors",children:[t("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:[t("home.createFreeAccount")," →"]}),e.jsx(l,{to:"/login",className:"px-7 py-3 text-[#8B7D6E] font-medium text-sm hover:text-[#3D3024] transition-colors",children:t("home.signIn")})]})})]})})})]})}export{P as default}; diff --git a/dist/assets/Home-5Rp4O19m.js b/dist/assets/Home-Biz_0NAt.js similarity index 96% rename from dist/assets/Home-5Rp4O19m.js rename to dist/assets/Home-Biz_0NAt.js index 1bcd80d..ec2b8c4 100644 --- a/dist/assets/Home-5Rp4O19m.js +++ b/dist/assets/Home-Biz_0NAt.js @@ -1 +1 @@ -import{u as g,a as f,r as d,f as N,l as v,j as e,L as l,Q as y}from"./index-C1LcEmdp.js";import{c as w,R as D}from"./RotatingEquiv-ByYi0mto.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{F as o}from"./FadeContent-CEb-jr-E.js";import{u as S}from"./useTranslation-kIlHvV5e.js";function k(){const{t}=S(),{user:n}=g(),{site:i}=f(),[u,b]=d.useState([]),[m,p]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{}),v().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.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(o,{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:t("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:(i==null?void 0:i.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("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-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[t("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:t("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:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(o,{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(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc"),accent:"emerald"},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc"),accent:"cyan"},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc"),accent:"violet"}].map((s,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-${s.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:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{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:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("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:[t("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((s,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:s.display_name||s.model_name})},s.id||a))})]})}),m.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:m.filter(s=>s.enabled).slice(0,3).map((s,a)=>{const j=s.quota_amount>0?s.quota_amount/y:0,x=w(r,j);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),x.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(D,{items:x,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(l,{to:n?"/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:t(n?"home.subscribe":"home.getStarted")})]},s.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(o,{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:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("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-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{k as default}; +import{u as g,a as f,r as d,f as N,l as v,j as e,L as l,Q as y}from"./index-D8eKls75.js";import{c as w,R as D}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as o}from"./FadeContent-B3Mc1Ysf.js";import{u as S}from"./useTranslation-D_OVvIX9.js";function k(){const{t}=S(),{user:n}=g(),{site:i}=f(),[u,b]=d.useState([]),[m,p]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{}),v().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.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(o,{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:t("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:(i==null?void 0:i.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("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-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[t("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:t("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:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(o,{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(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.latency")})]})]})})]}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-0",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc"),accent:"emerald"},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc"),accent:"cyan"},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc"),accent:"violet"}].map((s,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-${s.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:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},a))})]})}),r.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{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:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("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:[t("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((s,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:s.display_name||s.model_name})},s.id||a))})]})}),m.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(o,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:m.filter(s=>s.enabled).slice(0,3).map((s,a)=>{const j=s.quota_amount>0?s.quota_amount/y:0,x=w(r,j);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),x.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(D,{items:x,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(l,{to:n?"/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:t(n?"home.subscribe":"home.getStarted")})]},s.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(o,{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:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("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-lg bg-emerald-500 text-black font-semibold text-sm hover:bg-emerald-400 transition-colors",children:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{k as default}; diff --git a/dist/assets/Home-D_VkCxtC.js b/dist/assets/Home-BofCv9GQ.js similarity index 96% rename from dist/assets/Home-D_VkCxtC.js rename to dist/assets/Home-BofCv9GQ.js index 0279982..5c63365 100644 --- a/dist/assets/Home-D_VkCxtC.js +++ b/dist/assets/Home-BofCv9GQ.js @@ -1 +1 @@ -import{u as b,a as g,r as d,f,l as N,j as e,L as a,Q as v}from"./index-C1LcEmdp.js";import{c as w,R as y}from"./RotatingEquiv-ByYi0mto.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{F as n}from"./FadeContent-CEb-jr-E.js";import{u as D}from"./useTranslation-kIlHvV5e.js";function E(){const{t}=D(),{user:o}=b(),{site:i}=g(),[u,j]=d.useState([]),[x,p]=d.useState([]);d.useEffect(()=>{f().then(s=>{s.data.success&&j(s.data.data||[])}).catch(()=>{}),N().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{})},[]);const l=u.filter(s=>s.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:(i==null?void 0:i.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:o?e.jsxs(a,{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:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{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:[t("home.getStarted")," →"]}),e.jsx(a,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("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(c,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("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:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,r)=>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",r+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:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},r))})]})}),l.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:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("home.availableModelsDesc",{count:l.length})})]}),l.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[t("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((s,r)=>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:s.display_name||s.model_name})},s.id||r))})]})}),x.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:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map(s=>{const r=s.quota_amount>0?s.quota_amount/v:0,m=w(l,r);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:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(y,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(a,{to:o?"/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:t(o?"home.subscribe":"home.getStarted")})]},s.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:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:o?e.jsxs(a,{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:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{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:[t("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:t("home.signIn")})]})})]})})})]})}export{E as default}; +import{u as b,a as g,r as d,f,l as N,j as e,L as a,Q as v}from"./index-D8eKls75.js";import{c as w,R as y}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as n}from"./FadeContent-B3Mc1Ysf.js";import{u as D}from"./useTranslation-D_OVvIX9.js";function E(){const{t}=D(),{user:o}=b(),{site:i}=g(),[u,j]=d.useState([]),[x,p]=d.useState([]);d.useEffect(()=>{f().then(s=>{s.data.success&&j(s.data.data||[])}).catch(()=>{}),N().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{})},[]);const l=u.filter(s=>s.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:(i==null?void 0:i.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:o?e.jsxs(a,{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:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{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:[t("home.getStarted")," →"]}),e.jsx(a,{to:"/pricing",className:"px-7 py-3 text-neutral-400 font-medium text-sm hover:text-white transition-colors",children:t("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(c,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("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:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"space-y-6",children:[{title:t("home.lightningFast"),desc:t("home.lightningFastDesc")},{title:t("home.securePrivate"),desc:t("home.securePrivateDesc")},{title:t("home.payAsYouGo"),desc:t("home.payAsYouGoDesc")}].map((s,r)=>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",r+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:s.title}),e.jsx("p",{className:"text-sm text-neutral-500 leading-relaxed max-w-lg",children:s.desc})]})]},r))})]})}),l.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:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("home.availableModelsDesc",{count:l.length})})]}),l.length>8&&e.jsxs(a,{to:"/pricing",className:"text-sm text-neutral-400 hover:text-white transition-colors",children:[t("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((s,r)=>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:s.display_name||s.model_name})},s.id||r))})]})}),x.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:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map(s=>{const r=s.quota_amount>0?s.quota_amount/v:0,m=w(l,r);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:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(y,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(a,{to:o?"/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:t(o?"home.subscribe":"home.getStarted")})]},s.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:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:o?e.jsxs(a,{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:[t("home.goToDashboard")," →"]}):e.jsxs(e.Fragment,{children:[e.jsxs(a,{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:[t("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:t("home.signIn")})]})})]})})})]})}export{E as default}; diff --git a/dist/assets/Home-Cd5nSY1a.js b/dist/assets/Home-BuJm_vIH.js similarity index 96% rename from dist/assets/Home-Cd5nSY1a.js rename to dist/assets/Home-BuJm_vIH.js index 89c6400..1d8b23d 100644 --- a/dist/assets/Home-Cd5nSY1a.js +++ b/dist/assets/Home-BuJm_vIH.js @@ -1 +1 @@ -import{u as j,a as g,r as d,f as v,l as f,j as e,L as l,Q as w}from"./index-C1LcEmdp.js";import{c as N,R as y}from"./RotatingEquiv-ByYi0mto.js";import{C as k}from"./CountUp-M8KqDP8n.js";import{F as r}from"./FadeContent-CEb-jr-E.js";import{u as M}from"./useTranslation-kIlHvV5e.js";function P(){const{t:s}=M(),{user:i}=j(),{site:n}=g(),[h,u]=d.useState([]),[c,b]=d.useState([]);d.useEffect(()=>{v().then(t=>{t.data.success&&u(t.data.data||[])}).catch(()=>{}),f().then(t=>{t.data.success&&b(t.data.data||[])}).catch(()=>{})},[]);const o=h.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(r,{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:(n==null?void 0:n.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.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(r,{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(k,{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(r,{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(r,{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))})]})}),c.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(r,{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:c.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const p=t.quota_amount>0?t.quota_amount/w:0,x=N(o,p);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:["$",t.price]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",t.original_price]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),x.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(y,{items:x,text:m=>s("packages.officialEquiv",{model:m.label,amount:m.equivDollars})})]}),e.jsx(l,{to:i?"/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(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(r,{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:i?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{P as default}; +import{u as j,a as g,r as d,f as v,l as f,j as e,L as l,Q as w}from"./index-D8eKls75.js";import{c as N,R as y}from"./RotatingEquiv-DkCC_t4y.js";import{C as k}from"./CountUp-BixuEoA6.js";import{F as r}from"./FadeContent-B3Mc1Ysf.js";import{u as M}from"./useTranslation-D_OVvIX9.js";function P(){const{t:s}=M(),{user:i}=j(),{site:n}=g(),[h,u]=d.useState([]),[c,b]=d.useState([]);d.useEffect(()=>{v().then(t=>{t.data.success&&u(t.data.data||[])}).catch(()=>{}),f().then(t=>{t.data.success&&b(t.data.data||[])}).catch(()=>{})},[]);const o=h.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(r,{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:(n==null?void 0:n.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.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(r,{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(k,{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(r,{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(r,{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))})]})}),c.length>0&&e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-20",children:e.jsxs(r,{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:c.filter(t=>t.enabled).slice(0,3).map((t,a)=>{const p=t.quota_amount>0?t.quota_amount/w:0,x=N(o,p);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:["$",t.price]}),t.original_price>t.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",t.original_price]}),t.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:s("home.days",{count:t.duration})})]}),x.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(y,{items:x,text:m=>s("packages.officialEquiv",{model:m.label,amount:m.equivDollars})})]}),e.jsx(l,{to:i?"/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(i?"home.subscribe":"home.getStarted")})]},t.id)})})]})}),e.jsx("section",{className:"max-w-5xl mx-auto px-6 py-24",children:e.jsx(r,{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:i?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{P as default}; diff --git a/dist/assets/Home-CyhK9Wc-.js b/dist/assets/Home-hgWoWuW8.js similarity index 96% rename from dist/assets/Home-CyhK9Wc-.js rename to dist/assets/Home-hgWoWuW8.js index bb8da0e..c6496d3 100644 --- a/dist/assets/Home-CyhK9Wc-.js +++ b/dist/assets/Home-hgWoWuW8.js @@ -1 +1 @@ -import{u as g,a as v,r as d,f as N,l as f,j as e,L as a,Q as w}from"./index-C1LcEmdp.js";import{c as y,R as M}from"./RotatingEquiv-ByYi0mto.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{F as r}from"./FadeContent-CEb-jr-E.js";import{u as k}from"./useTranslation-kIlHvV5e.js";function P(){const{t}=k(),{user:i}=g(),{site:n}=v(),[u,p]=d.useState([]),[x,j]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{}),f().then(s=>{s.data.success&&j(s.data.data||[])}).catch(()=>{})},[]);const l=u.filter(s=>s.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(r,{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:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-slate-500 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?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:[t("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:t("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:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(r,{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(c,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"px-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"pl-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t("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(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-slate-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:[{title:t("home.lightningFast"),desc:t("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:t("home.securePrivate"),desc:t("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:t("home.payAsYouGo"),desc:t("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((s,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:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-slate-900 mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:s.desc})]},o))})]})})}),l.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(r,{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:t("home.availableModels")}),e.jsx("p",{className:"text-slate-500",children:t("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:[t("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((s,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:s.display_name||s.model_name})},s.id||o))})]})}),x.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-slate-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,o)=>{const b=s.quota_amount>0?s.quota_amount/w:0,m=y(l,b);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-slate-900",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-slate-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-slate-900",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-slate-500 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.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-slate-900 text-white hover:bg-slate-800":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:t(i?"home.subscribe":"home.getStarted")})]},s.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(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-slate-400 mb-8 max-w-md mx-auto",children:t("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-lg bg-white text-slate-900 font-medium text-sm hover:bg-slate-100 transition-colors",children:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{P as default}; +import{u as g,a as v,r as d,f as N,l as f,j as e,L as a,Q as w}from"./index-D8eKls75.js";import{c as y,R as M}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as r}from"./FadeContent-B3Mc1Ysf.js";import{u as k}from"./useTranslation-D_OVvIX9.js";function P(){const{t}=k(),{user:i}=g(),{site:n}=v(),[u,p]=d.useState([]),[x,j]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{}),f().then(s=>{s.data.success&&j(s.data.data||[])}).catch(()=>{})},[]);const l=u.filter(s=>s.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(r,{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:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-slate-500 mt-6 leading-relaxed max-w-xl",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center gap-4 mt-10",children:i?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:[t("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:t("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:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(r,{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(c,{from:0,to:l.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"px-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"pl-12",children:[e.jsxs("div",{className:"text-2xl font-bold text-slate-900",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t("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(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-slate-500 mb-10",children:t("home.whyChooseUsDesc")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:[{title:t("home.lightningFast"),desc:t("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:t("home.securePrivate"),desc:t("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:t("home.payAsYouGo"),desc:t("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((s,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:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-slate-900 mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:s.desc})]},o))})]})})}),l.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(r,{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:t("home.availableModels")}),e.jsx("p",{className:"text-slate-500",children:t("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:[t("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((s,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:s.display_name||s.model_name})},s.id||o))})]})}),x.length>0&&e.jsx("section",{className:"max-w-6xl mx-auto px-6 lg:px-8 py-20",children:e.jsxs(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-slate-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,o)=>{const b=s.quota_amount>0?s.quota_amount/w:0,m=y(l,b);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-slate-900",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-slate-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-slate-900",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-slate-500 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.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-slate-900 text-white hover:bg-slate-800":"bg-slate-100 text-slate-700 hover:bg-slate-200"}`,children:t(i?"home.subscribe":"home.getStarted")})]},s.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(r,{blur:!0,duration:800,delay:100,children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-slate-400 mb-8 max-w-md mx-auto",children:t("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-lg bg-white text-slate-900 font-medium text-sm hover:bg-slate-100 transition-colors",children:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{P as default}; diff --git a/dist/assets/Home-B2GlE1Mp.js b/dist/assets/Home-qfwynDF2.js similarity index 97% rename from dist/assets/Home-B2GlE1Mp.js rename to dist/assets/Home-qfwynDF2.js index b8acf41..0119d32 100644 --- a/dist/assets/Home-B2GlE1Mp.js +++ b/dist/assets/Home-qfwynDF2.js @@ -1 +1 @@ -import{u as g,a as v,r as d,f,l as N,j as e,L as a,Q as w}from"./index-C1LcEmdp.js";import{c as y,R as M}from"./RotatingEquiv-ByYi0mto.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{F as n}from"./FadeContent-CEb-jr-E.js";import{u as k}from"./useTranslation-kIlHvV5e.js";function C(){const{t}=k(),{user:o}=g(),{site:i}=v(),[u,b]=d.useState([]),[x,p]=d.useState([]);d.useEffect(()=>{f().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{}),N().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.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(n,{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:t("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:(i==null?void 0:i.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:o?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:[t("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:t("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:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(n,{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(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("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.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:t("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:t("home.lightningFast"),desc:t("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:t("home.securePrivate"),desc:t("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:t("home.payAsYouGo"),desc:t("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((s,l)=>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:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:s.desc})]},l))})]})}),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:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("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:[t("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((s,l)=>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:s.display_name||s.model_name})},s.id||l))})]})}),x.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:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,l)=>{const j=s.quota_amount>0?s.quota_amount/w:0,m=y(r,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-colors ${l===1?"border-brand-500/30 bg-brand-500/[0.04]":"border-neutral-800/60 hover:border-neutral-700"}`,children:[l===1&&e.jsx("span",{className:"text-xs text-brand-400 font-medium mb-2 uppercase tracking-wider",children:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(a,{to:o?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${l===1?"bg-brand-600 text-white hover:bg-brand-500":"bg-neutral-800 text-white hover:bg-neutral-700"}`,children:t(o?"home.subscribe":"home.getStarted")})]},s.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:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:o?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:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{C as default}; +import{u as g,a as v,r as d,f,l as N,j as e,L as a,Q as w}from"./index-D8eKls75.js";import{c as y,R as M}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as n}from"./FadeContent-B3Mc1Ysf.js";import{u as k}from"./useTranslation-D_OVvIX9.js";function C(){const{t}=k(),{user:o}=g(),{site:i}=v(),[u,b]=d.useState([]),[x,p]=d.useState([]);d.useEffect(()=>{f().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{}),N().then(s=>{s.data.success&&p(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.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(n,{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:t("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:(i==null?void 0:i.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-neutral-400 mt-6 leading-relaxed max-w-xl mx-auto",children:t("home.heroSubtitle")}),e.jsx("div",{className:"flex items-center justify-center gap-4 mt-10",children:o?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:[t("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:t("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:[t("home.viewPricing")," →"]})]})})]})}),e.jsx(n,{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(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-white",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-neutral-500 mt-0.5",children:t("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.jsxs("div",{className:"text-center mb-14",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-white mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-neutral-500",children:t("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:t("home.lightningFast"),desc:t("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:t("home.securePrivate"),desc:t("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:t("home.payAsYouGo"),desc:t("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((s,l)=>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:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-white mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-neutral-400 leading-relaxed",children:s.desc})]},l))})]})}),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:t("home.availableModels")}),e.jsx("p",{className:"text-neutral-500",children:t("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:[t("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((s,l)=>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:s.display_name||s.model_name})},s.id||l))})]})}),x.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:t("home.plansPackages")}),e.jsx("p",{className:"text-neutral-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,l)=>{const j=s.quota_amount>0?s.quota_amount/w:0,m=y(r,j);return e.jsxs("div",{className:`rounded-xl p-6 flex flex-col border transition-colors ${l===1?"border-brand-500/30 bg-brand-500/[0.04]":"border-neutral-800/60 hover:border-neutral-700"}`,children:[l===1&&e.jsx("span",{className:"text-xs text-brand-400 font-medium mb-2 uppercase tracking-wider",children:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-white",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-neutral-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-white",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-neutral-600 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-neutral-600 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-300/80 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.equivDollars})})]}),e.jsx(a,{to:o?"/packages":"/register",className:`mt-4 py-2.5 rounded-lg font-medium text-sm text-center transition-colors ${l===1?"bg-brand-600 text-white hover:bg-brand-500":"bg-neutral-800 text-white hover:bg-neutral-700"}`,children:t(o?"home.subscribe":"home.getStarted")})]},s.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:t("home.readyToStart")}),e.jsx("p",{className:"text-neutral-500 mb-8 max-w-md mx-auto",children:t("home.readyToStartDesc")}),e.jsx("div",{className:"flex items-center justify-center gap-4",children:o?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:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{C as default}; diff --git a/dist/assets/Home-D-ipNZp0.js b/dist/assets/Home-zDwhMuTN.js similarity index 97% rename from dist/assets/Home-D-ipNZp0.js rename to dist/assets/Home-zDwhMuTN.js index 7b7ee53..1030592 100644 --- a/dist/assets/Home-D-ipNZp0.js +++ b/dist/assets/Home-zDwhMuTN.js @@ -1 +1 @@ -import{u as p,a as y,r as d,f as N,l as v,j as e,L as a,Q as f}from"./index-C1LcEmdp.js";import{c as w,R as M}from"./RotatingEquiv-ByYi0mto.js";import{C as c}from"./CountUp-M8KqDP8n.js";import{F as l}from"./FadeContent-CEb-jr-E.js";import{u as k}from"./useTranslation-kIlHvV5e.js";function q(){const{t}=k(),{user:i}=p(),{site:n}=y(),[u,g]=d.useState([]),[x,b]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&g(s.data.data||[])}).catch(()=>{}),v().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.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(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-blue-600 mb-4 tracking-wide",children:t("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:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-gray-500 mt-6 leading-relaxed max-w-xl mx-auto",children:t("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-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("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:t("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:[t("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-gray-100",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("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-gray-900 mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-gray-500",children:t("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:t("home.lightningFast"),desc:t("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:t("home.securePrivate"),desc:t("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:t("home.payAsYouGo"),desc:t("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((s,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-${s.color}-50 text-${s.color}-600 flex items-center justify-center mb-4`,children:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:s.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-gray-900 mb-2",children:t("home.availableModels")}),e.jsx("p",{className:"text-gray-500",children:t("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:[t("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((s,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:s.display_name||s.model_name})},s.id||o))})]})}),x.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-gray-900 mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-gray-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,o)=>{const j=s.quota_amount>0?s.quota_amount/f:0,m=w(r,j);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-gray-500 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.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-blue-600 text-white hover:bg-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:t(i?"home.subscribe":"home.getStarted")})]},s.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-gray-100 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-gray-500 mb-8 max-w-md mx-auto",children:t("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-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{q as default}; +import{u as p,a as y,r as d,f as N,l as v,j as e,L as a,Q as f}from"./index-D8eKls75.js";import{c as w,R as M}from"./RotatingEquiv-DkCC_t4y.js";import{C as c}from"./CountUp-BixuEoA6.js";import{F as l}from"./FadeContent-B3Mc1Ysf.js";import{u as k}from"./useTranslation-D_OVvIX9.js";function q(){const{t}=k(),{user:i}=p(),{site:n}=y(),[u,g]=d.useState([]),[x,b]=d.useState([]);d.useEffect(()=>{N().then(s=>{s.data.success&&g(s.data.data||[])}).catch(()=>{}),v().then(s=>{s.data.success&&b(s.data.data||[])}).catch(()=>{})},[]);const r=u.filter(s=>s.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(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-blue-600 mb-4 tracking-wide",children:t("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:(n==null?void 0:n.name)||t("home.defaultHeroTitle")}),e.jsx("p",{className:"text-lg text-gray-500 mt-6 leading-relaxed max-w-xl mx-auto",children:t("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-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("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:t("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:[t("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-gray-100",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(c,{from:0,to:r.length||50,duration:2}),"+"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.aiModels")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:[e.jsx(c,{from:0,to:99.9,duration:2.5}),"%"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("home.uptime")})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900",children:["<",e.jsx(c,{from:200,to:50,duration:2,direction:"down"}),"ms"]}),e.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:t("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-gray-900 mb-3",children:t("home.whyChooseUs")}),e.jsx("p",{className:"text-gray-500",children:t("home.whyChooseUsDesc")})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5",children:[{title:t("home.lightningFast"),desc:t("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:t("home.securePrivate"),desc:t("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:t("home.payAsYouGo"),desc:t("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((s,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-${s.color}-50 text-${s.color}-600 flex items-center justify-center mb-4`,children:s.icon}),e.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:s.title}),e.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:s.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-gray-900 mb-2",children:t("home.availableModels")}),e.jsx("p",{className:"text-gray-500",children:t("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:[t("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((s,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:s.display_name||s.model_name})},s.id||o))})]})}),x.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-gray-900 mb-2",children:t("home.plansPackages")}),e.jsx("p",{className:"text-gray-500 mb-10",children:t("home.choosePlan")}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 max-w-4xl",children:x.filter(s=>s.enabled).slice(0,3).map((s,o)=>{const j=s.quota_amount>0?s.quota_amount/f:0,m=w(r,j);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:t("home.popular")||"Popular"}),e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:s.name}),s.description&&e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s.description}),e.jsxs("div",{className:"mt-auto pt-6",children:[e.jsxs("span",{className:"text-3xl font-bold text-gray-900",children:["$",s.price]}),s.original_price>s.price&&e.jsxs("span",{className:"text-sm text-gray-500 line-through ml-2",children:["$",s.original_price]}),s.duration>0&&e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("home.days",{count:s.duration})})]}),m.length>0&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["🔥 ",e.jsx(M,{items:m,text:h=>t("packages.officialEquiv",{model:h.label,amount:h.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-blue-600 text-white hover:bg-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:t(i?"home.subscribe":"home.getStarted")})]},s.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-gray-100 pt-16 text-center",children:[e.jsx("h2",{className:"text-2xl font-heading font-bold text-gray-900 mb-3",children:t("home.readyToStart")}),e.jsx("p",{className:"text-gray-500 mb-8 max-w-md mx-auto",children:t("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-blue-600 text-white font-medium text-sm hover:bg-blue-700 transition-colors shadow-sm",children:[t("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:[t("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:t("home.signIn")})]})})]})})})]})}export{q as default}; diff --git a/dist/assets/LanguageSwitch-rovTNa8V.js b/dist/assets/LanguageSwitch-CG9YcMHq.js similarity index 86% rename from dist/assets/LanguageSwitch-rovTNa8V.js rename to dist/assets/LanguageSwitch-CG9YcMHq.js index 6b0e86a..2b57c20 100644 --- a/dist/assets/LanguageSwitch-rovTNa8V.js +++ b/dist/assets/LanguageSwitch-CG9YcMHq.js @@ -1 +1 @@ -import{j as n}from"./index-C1LcEmdp.js";import{u as a}from"./useTranslation-kIlHvV5e.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-D8eKls75.js";import{u as a}from"./useTranslation-D_OVvIX9.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-CAsa4KKn.js b/dist/assets/Layout-0cB1qtYA.js similarity index 97% rename from dist/assets/Layout-CAsa4KKn.js rename to dist/assets/Layout-0cB1qtYA.js index b84b562..db2b62e 100644 --- a/dist/assets/Layout-CAsa4KKn.js +++ b/dist/assets/Layout-0cB1qtYA.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-C1LcEmdp.js";import{L as j}from"./LanguageSwitch-rovTNa8V.js";import{u as f}from"./useTranslation-kIlHvV5e.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},...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-D8eKls75.js";import{L as j}from"./LanguageSwitch-CG9YcMHq.js";import{u as f}from"./useTranslation-D_OVvIX9.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},...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-ZfNECSe_.js b/dist/assets/Layout-2sjWYmyT.js similarity index 96% rename from dist/assets/Layout-ZfNECSe_.js rename to dist/assets/Layout-2sjWYmyT.js index 39ee5c0..672f9f4 100644 --- a/dist/assets/Layout-ZfNECSe_.js +++ b/dist/assets/Layout-2sjWYmyT.js @@ -1 +1 @@ -import{u as h,a as g,b as u,c as b,r as p,j as e,L as r,O as v}from"./index-C1LcEmdp.js";import{L as j}from"./LanguageSwitch-rovTNa8V.js";import{u as y}from"./useTranslation-kIlHvV5e.js";function L(){const{t:s}=y(),{user:o,logout:m}=h(),{site:t}=g(),d=u(),i=b(),[n,c]=p.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},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||o);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(r,{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-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:l.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(a=>e.jsx(r,{to:a.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===a.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:a.label},a.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"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-gray-400 hover:text-gray-700 transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{to:"/login",className:"text-sm text-gray-500 hover:text-gray-900 px-3 py-2 hidden sm:block transition-colors",children:s("nav.login")}),e.jsx(r,{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:s("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(a=>e.jsx(r,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===a.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:a.label},a.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()," ",l,"."]}),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:s("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 r,O as v}from"./index-D8eKls75.js";import{L as j}from"./LanguageSwitch-CG9YcMHq.js";import{u as y}from"./useTranslation-D_OVvIX9.js";function L(){const{t:s}=y(),{user:o,logout:m}=h(),{site:t}=g(),d=u(),i=b(),[n,c]=p.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},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||o);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(r,{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-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:l.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(a=>e.jsx(r,{to:a.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===a.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:a.label},a.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"}),o?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:block",children:o.display_name||o.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-gray-400 hover:text-gray-700 transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(r,{to:"/login",className:"text-sm text-gray-500 hover:text-gray-900 px-3 py-2 hidden sm:block transition-colors",children:s("nav.login")}),e.jsx(r,{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:s("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(a=>e.jsx(r,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===a.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:a.label},a.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()," ",l,"."]}),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:s("nav.contact")})})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-B5NB7HJ5.js b/dist/assets/Layout-BCQLwwoq.js similarity index 96% rename from dist/assets/Layout-B5NB7HJ5.js rename to dist/assets/Layout-BCQLwwoq.js index 3a43d11..d6a4ab3 100644 --- a/dist/assets/Layout-B5NB7HJ5.js +++ b/dist/assets/Layout-BCQLwwoq.js @@ -1 +1 @@ -import{u as d,a as u,b as p,c as b,r as j,j as e,L as n,O as g}from"./index-C1LcEmdp.js";import{L as v}from"./LanguageSwitch-rovTNa8V.js";import{u as f}from"./useTranslation-kIlHvV5e.js";function L(){const{t:s}=f(),{user:l,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=j.useState(!1),o=(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},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||l);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(n,{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(a=>e.jsx(n,{to:a.to,className:`text-sm transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.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"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(n,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:s("nav.login")}),e.jsx(n,{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:s("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(a=>e.jsx(n,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),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:s("nav.contact")})]})})]})}export{L as default}; +import{u as d,a as u,b as p,c as b,r as j,j as e,L as n,O as g}from"./index-D8eKls75.js";import{L as v}from"./LanguageSwitch-CG9YcMHq.js";import{u as f}from"./useTranslation-D_OVvIX9.js";function L(){const{t:s}=f(),{user:l,logout:m}=d(),{site:t}=u(),h=p(),i=b(),[r,c]=j.useState(!1),o=(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},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||l);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(n,{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(a=>e.jsx(n,{to:a.to,className:`text-sm transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.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"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-neutral-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),h("/")},className:"text-sm text-neutral-500 hover:text-white transition-colors",children:s("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(n,{to:"/login",className:"text-sm text-neutral-500 hover:text-white transition-colors hidden sm:block",children:s("nav.login")}),e.jsx(n,{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:s("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(a=>e.jsx(n,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded transition-colors ${i.pathname===a.to?"text-white":"text-neutral-500 hover:text-white"}`,children:a.label},a.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(g,{})}),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:s("nav.contact")})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-BS8ZSjrH.js b/dist/assets/Layout-D-Bm8TiX.js similarity index 97% rename from dist/assets/Layout-BS8ZSjrH.js rename to dist/assets/Layout-D-Bm8TiX.js index 468a540..ac557f0 100644 --- a/dist/assets/Layout-BS8ZSjrH.js +++ b/dist/assets/Layout-D-Bm8TiX.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-C1LcEmdp.js";import{L as f}from"./LanguageSwitch-rovTNa8V.js";import{u as j}from"./useTranslation-kIlHvV5e.js";function L(){const{t:s}=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: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},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.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(a=>e.jsx(l,{to:a.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===a.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:a.label},a.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:s("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:s("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:s("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(a=>e.jsx(l,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===a.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:a.label},a.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:s("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-D8eKls75.js";import{L as f}from"./LanguageSwitch-CG9YcMHq.js";import{u as j}from"./useTranslation-D_OVvIX9.js";function L(){const{t:s}=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: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},...t!=null&&t.enable_topup?[{to:"/topup",label:s("nav.topup"),auth:!0}]:[]].filter(a=>!a.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(a=>e.jsx(l,{to:a.to,className:`px-4 py-1.5 text-sm rounded-full transition-all ${i.pathname===a.to?"text-white bg-white/[0.08]":"text-neutral-400 hover:text-white"}`,children:a.label},a.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:s("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:s("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:s("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(a=>e.jsx(l,{to:a.to,onClick:()=>c(!1),className:`px-3 py-2 text-sm rounded-lg transition-colors ${i.pathname===a.to?"text-blue-400 bg-blue-500/10":"text-neutral-400 hover:text-white hover:bg-white/5"}`,children:a.label},a.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:s("nav.contact")})})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-SPj6Qlsc.js b/dist/assets/Layout-DmqKjR6M.js similarity index 97% rename from dist/assets/Layout-SPj6Qlsc.js rename to dist/assets/Layout-DmqKjR6M.js index a3e5689..557cdc9 100644 --- a/dist/assets/Layout-SPj6Qlsc.js +++ b/dist/assets/Layout-DmqKjR6M.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-C1LcEmdp.js";import{L as j}from"./LanguageSwitch-rovTNa8V.js";import{u as v}from"./useTranslation-kIlHvV5e.js";function L(){const{t:o}=v(),{user:r,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:o("nav.home"),auth:!1},{to:"/pricing",label:o("nav.pricing"),auth:!1},{to:"/packages",label:o("nav.packages"),auth:!1},{to:"/dashboard",label:o("nav.dashboard"),auth:!0},{to:"/tokens",label:o("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:o("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||r);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:l,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:l.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:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(a=>e.jsx(s,{to:a.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.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"}),r?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:r.display_name||r.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:o("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:o("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:o("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(a=>e.jsx(s,{to:a.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.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()," ",l]}),(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:o("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-D8eKls75.js";import{L as j}from"./LanguageSwitch-CG9YcMHq.js";import{u as v}from"./useTranslation-D_OVvIX9.js";function L(){const{t:o}=v(),{user:r,logout:i}=h(),{site:t}=u(),x=p(),m=b(),[n,d]=f.useState(!1),l=(t==null?void 0:t.name)||"AI Platform",c=[{to:"/",label:o("nav.home"),auth:!1},{to:"/pricing",label:o("nav.pricing"),auth:!1},{to:"/packages",label:o("nav.packages"),auth:!1},{to:"/dashboard",label:o("nav.dashboard"),auth:!0},{to:"/tokens",label:o("nav.apiKeys"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:o("nav.topup"),auth:!0}]:[]].filter(a=>!a.auth||r);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:l,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:l.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:l})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:c.map(a=>e.jsx(s,{to:a.to,className:`px-3 py-1.5 text-sm font-mono rounded transition-all ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.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"}),r?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:r.display_name||r.username}),e.jsx("button",{onClick:async()=>{await i(),x("/")},className:"text-sm text-neutral-500 hover:text-emerald-400 font-mono transition-colors",children:o("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:o("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:o("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(a=>e.jsx(s,{to:a.to,onClick:()=>d(!1),className:`px-3 py-2 text-sm font-mono rounded transition-colors ${m.pathname===a.to?"text-emerald-400 bg-emerald-500/10":"text-neutral-500 hover:text-emerald-400"}`,children:a.label},a.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()," ",l]}),(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:o("nav.contact")})]})})]})}export{L as default}; diff --git a/dist/assets/Layout-C1rCV4ZQ.js b/dist/assets/Layout-NO9JLeRC.js similarity index 97% rename from dist/assets/Layout-C1rCV4ZQ.js rename to dist/assets/Layout-NO9JLeRC.js index 9eeb665..182e784 100644 --- a/dist/assets/Layout-C1rCV4ZQ.js +++ b/dist/assets/Layout-NO9JLeRC.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-C1LcEmdp.js";import{L as f}from"./LanguageSwitch-rovTNa8V.js";import{u as v}from"./useTranslation-kIlHvV5e.js";function w(){const{t:a}=v(),{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},...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(f,{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-D8eKls75.js";import{L as f}from"./LanguageSwitch-CG9YcMHq.js";import{u as v}from"./useTranslation-D_OVvIX9.js";function w(){const{t:a}=v(),{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},...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(f,{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-Dys-46k2.js b/dist/assets/Layout-qJz07ANC.js similarity index 97% rename from dist/assets/Layout-Dys-46k2.js rename to dist/assets/Layout-qJz07ANC.js index 4a03b49..01c80b5 100644 --- a/dist/assets/Layout-Dys-46k2.js +++ b/dist/assets/Layout-qJz07ANC.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-C1LcEmdp.js";import{L as f}from"./LanguageSwitch-rovTNa8V.js";import{u as v}from"./useTranslation-kIlHvV5e.js";function L(){const{t:a}=v(),{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: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},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.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(s=>e.jsx(o,{to:s.to,className:`px-4 py-2 text-sm font-medium transition-colors ${i.pathname===s.to?"text-slate-900 border-b-2 border-slate-900":"text-slate-500 hover:text-slate-900"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(f,{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:a("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:a("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:a("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(s=>e.jsx(o,{to:s.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===s.to?"text-slate-900 bg-slate-50":"text-slate-500 hover:text-slate-900"}`,children:s.label},s.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:a("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-D8eKls75.js";import{L as f}from"./LanguageSwitch-CG9YcMHq.js";import{u as v}from"./useTranslation-D_OVvIX9.js";function L(){const{t:a}=v(),{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: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},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.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(s=>e.jsx(o,{to:s.to,className:`px-4 py-2 text-sm font-medium transition-colors ${i.pathname===s.to?"text-slate-900 border-b-2 border-slate-900":"text-slate-500 hover:text-slate-900"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(f,{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:a("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:a("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:a("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(s=>e.jsx(o,{to:s.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===s.to?"text-slate-900 bg-slate-50":"text-slate-500 hover:text-slate-900"}`,children:s.label},s.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:a("nav.contact")})})]})})})]})}export{L as default}; diff --git a/dist/assets/Login-WL0R6qgx.js b/dist/assets/Login-B-uSRrNm.js similarity index 94% rename from dist/assets/Login-WL0R6qgx.js rename to dist/assets/Login-B-uSRrNm.js index b4a2af4..eddc53d 100644 --- a/dist/assets/Login-WL0R6qgx.js +++ b/dist/assets/Login-B-uSRrNm.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-C1LcEmdp.js";import{u as C}from"./useTranslation-kIlHvV5e.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-D8eKls75.js";import{u as C}from"./useTranslation-D_OVvIX9.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/Packages-DO4E8cNd.js b/dist/assets/Packages-CTK12U-8.js similarity index 97% rename from dist/assets/Packages-DO4E8cNd.js rename to dist/assets/Packages-CTK12U-8.js index 11232b7..e090601 100644 --- a/dist/assets/Packages-DO4E8cNd.js +++ b/dist/assets/Packages-CTK12U-8.js @@ -1 +1 @@ -import{u as D,b as $,r as c,l as A,f as R,m as k,j as e,Q as o,L as W,s as z,z as v}from"./index-C1LcEmdp.js";import{c as I,R as Q}from"./RotatingEquiv-ByYi0mto.js";import{u as T}from"./useTranslation-kIlHvV5e.js";const y={never:"packages.resetNever",daily:"packages.resetDaily",weekly:"packages.resetWeekly",monthly:"packages.resetMonthly"};function w(a){return a?new Date(a*1e3).toLocaleDateString():""}function G(){const{t:a}=T(),{user:l,refreshUser:S}=D(),_=$(),[L,q]=c.useState([]),[g,P]=c.useState([]),[M,C]=c.useState(!0),[d,h]=c.useState(null),[b,f]=c.useState([]),[i,m]=c.useState(null),p=s=>a(y[s]||y.never);c.useEffect(()=>{Promise.all([A().then(s=>{s.data.success&&q(s.data.data||[])}).catch(()=>{}),R().then(s=>{s.data.success&&P(s.data.data||[])}).catch(()=>{})]).finally(()=>C(!1))},[]),c.useEffect(()=>{l&&k().then(s=>{s.data.success&&f(s.data.data||[])}).catch(()=>{})},[l]);const F=async s=>{if(!l){_("/register");return}m(s)},E=async()=>{if(!i)return;const s=i.id;h(s);try{const n=await z(s);n.data.success?(v.success(a("packages.subscribedSuccess")),m(null),await S(),k().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{})):v.error(n.data.message||a("common.requestFailed"))}catch{}h(null)},B=c.useMemo(()=>g.filter(s=>s.enabled!==!1),[g]);if(M)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 j=L.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")})]}),b.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:b.map(s=>{const n=s.amount_total||0,t=s.amount_used||0,r=Math.max(0,n-t),x=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"),": ",w(s.end_time)]}),s.next_reset_time>0&&e.jsxs("span",{children:[a("packages.nextReset"),": ",w(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:`${x}%`}})}),e.jsxs("span",{className:"text-xs text-page-secondary whitespace-nowrap",children:["$",(r/o).toFixed(2)," / $",(n/o).toFixed(2)]})]})]},s.id)})})]}),j.length===0?e.jsxs("div",{className:"text-center py-12 text-page-secondary",children:[e.jsx("p",{children:a("packages.noPackages")}),e.jsxs(W,{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:j.map((s,n)=>{const t=s.quota_reset_period||"never",r=t!=="never",x=s.quota_amount>0?s.quota_amount/o:0,u=I(B,x);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}),r&&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:p(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:["$",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:["$",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})})]}),u.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(Q,{items:u,text:N=>a("packages.officialEquiv",{model:N.label,amount:N.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"})}),r?a("packages.periodicQuota",{amount:(s.quota_amount/o).toFixed(2),period:p(t)}):a("packages.creditIncluded",{amount:(s.quota_amount/o).toFixed(2)})]}),r&&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:()=>F(s),disabled:d===s.id,className:"btn-primary w-full text-center",children:d===s.id?a("packages.processing"):a(l?"packages.subscribeNow":"packages.signUpToSubscribe")})]})},s.id)})}),i&&(()=>{const s=((l==null?void 0:l.quota)||0)/o,n=Number(i.price),t=s!d&&m(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:u=>u.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:i.name,price:n.toFixed(2)})}),x&&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:p(r),days:i.duration||30,amount:(i.quota_amount/o).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:["$",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:()=>m(null),disabled:d,className:"btn-secondary",children:a("tokens.cancel")}),e.jsx("button",{onClick:E,disabled:t||d,className:"btn-primary",children:a(d?"packages.processing":"packages.confirm")})]})]})})})()]})}export{G as default}; +import{u as D,b as $,r as c,l as A,f as R,m as k,j as e,Q as o,L as W,s as z,z as v}from"./index-D8eKls75.js";import{c as I,R as Q}from"./RotatingEquiv-DkCC_t4y.js";import{u as T}from"./useTranslation-D_OVvIX9.js";const y={never:"packages.resetNever",daily:"packages.resetDaily",weekly:"packages.resetWeekly",monthly:"packages.resetMonthly"};function w(a){return a?new Date(a*1e3).toLocaleDateString():""}function G(){const{t:a}=T(),{user:l,refreshUser:S}=D(),_=$(),[L,q]=c.useState([]),[g,P]=c.useState([]),[M,C]=c.useState(!0),[d,h]=c.useState(null),[b,f]=c.useState([]),[i,m]=c.useState(null),p=s=>a(y[s]||y.never);c.useEffect(()=>{Promise.all([A().then(s=>{s.data.success&&q(s.data.data||[])}).catch(()=>{}),R().then(s=>{s.data.success&&P(s.data.data||[])}).catch(()=>{})]).finally(()=>C(!1))},[]),c.useEffect(()=>{l&&k().then(s=>{s.data.success&&f(s.data.data||[])}).catch(()=>{})},[l]);const F=async s=>{if(!l){_("/register");return}m(s)},E=async()=>{if(!i)return;const s=i.id;h(s);try{const n=await z(s);n.data.success?(v.success(a("packages.subscribedSuccess")),m(null),await S(),k().then(t=>{t.data.success&&f(t.data.data||[])}).catch(()=>{})):v.error(n.data.message||a("common.requestFailed"))}catch{}h(null)},B=c.useMemo(()=>g.filter(s=>s.enabled!==!1),[g]);if(M)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 j=L.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")})]}),b.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:b.map(s=>{const n=s.amount_total||0,t=s.amount_used||0,r=Math.max(0,n-t),x=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"),": ",w(s.end_time)]}),s.next_reset_time>0&&e.jsxs("span",{children:[a("packages.nextReset"),": ",w(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:`${x}%`}})}),e.jsxs("span",{className:"text-xs text-page-secondary whitespace-nowrap",children:["$",(r/o).toFixed(2)," / $",(n/o).toFixed(2)]})]})]},s.id)})})]}),j.length===0?e.jsxs("div",{className:"text-center py-12 text-page-secondary",children:[e.jsx("p",{children:a("packages.noPackages")}),e.jsxs(W,{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:j.map((s,n)=>{const t=s.quota_reset_period||"never",r=t!=="never",x=s.quota_amount>0?s.quota_amount/o:0,u=I(B,x);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}),r&&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:p(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:["$",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:["$",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})})]}),u.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(Q,{items:u,text:N=>a("packages.officialEquiv",{model:N.label,amount:N.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"})}),r?a("packages.periodicQuota",{amount:(s.quota_amount/o).toFixed(2),period:p(t)}):a("packages.creditIncluded",{amount:(s.quota_amount/o).toFixed(2)})]}),r&&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:()=>F(s),disabled:d===s.id,className:"btn-primary w-full text-center",children:d===s.id?a("packages.processing"):a(l?"packages.subscribeNow":"packages.signUpToSubscribe")})]})},s.id)})}),i&&(()=>{const s=((l==null?void 0:l.quota)||0)/o,n=Number(i.price),t=s!d&&m(null),children:e.jsxs("div",{className:"glass rounded-2xl p-6 w-full max-w-sm",onClick:u=>u.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:i.name,price:n.toFixed(2)})}),x&&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:p(r),days:i.duration||30,amount:(i.quota_amount/o).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:["$",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:()=>m(null),disabled:d,className:"btn-secondary",children:a("tokens.cancel")}),e.jsx("button",{onClick:E,disabled:t||d,className:"btn-primary",children:a(d?"packages.processing":"packages.confirm")})]})]})})})()]})}export{G as default}; diff --git a/dist/assets/Pricing-BO8JIN62.js b/dist/assets/Pricing-DcAHcsau.js similarity index 97% rename from dist/assets/Pricing-BO8JIN62.js rename to dist/assets/Pricing-DcAHcsau.js index aec9397..6398c78 100644 --- a/dist/assets/Pricing-BO8JIN62.js +++ b/dist/assets/Pricing-DcAHcsau.js @@ -1 +1 @@ -import{r as n,f as j,j as t}from"./index-C1LcEmdp.js";import{u as N}from"./useTranslation-kIlHvV5e.js";function w(){const{t:s}=N(),[m,u]=n.useState([]),[d,h]=n.useState([]),[l,g]=n.useState(""),[r,c]=n.useState(""),[f,b]=n.useState(!0);n.useEffect(()=>{j().then(e=>{e.data.success&&(u(e.data.data||[]),h(e.data.vendors||[]))}).catch(()=>{}).finally(()=>b(!1))},[]);const i=m.filter(e=>e.enabled!==!1),x=n.useMemo(()=>{const e=new Set(i.map(a=>a.vendor_name).filter(Boolean));return d.filter(a=>e.has(a.name))},[i,d]),p=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 f?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")})]}),x.length>0&&t.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-6",children:[t.jsx("button",{onClick:()=>c(""),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")}),x.map(e=>t.jsx("button",{onClick:()=>c(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=>g(e.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),p.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:p.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?`$${(Number(e.input_price)*1e3).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.output_price!=null?`$${(Number(e.output_price)*1e3).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{w as default}; +import{r as n,f as j,j as t}from"./index-D8eKls75.js";import{u as N}from"./useTranslation-D_OVvIX9.js";function w(){const{t:s}=N(),[m,u]=n.useState([]),[d,h]=n.useState([]),[l,g]=n.useState(""),[r,c]=n.useState(""),[f,b]=n.useState(!0);n.useEffect(()=>{j().then(e=>{e.data.success&&(u(e.data.data||[]),h(e.data.vendors||[]))}).catch(()=>{}).finally(()=>b(!1))},[]);const i=m.filter(e=>e.enabled!==!1),x=n.useMemo(()=>{const e=new Set(i.map(a=>a.vendor_name).filter(Boolean));return d.filter(a=>e.has(a.name))},[i,d]),p=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 f?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")})]}),x.length>0&&t.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-6",children:[t.jsx("button",{onClick:()=>c(""),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")}),x.map(e=>t.jsx("button",{onClick:()=>c(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=>g(e.target.value),className:"input !pl-10",placeholder:s("pricing.searchPlaceholder")})]})}),p.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:p.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?`$${(Number(e.input_price)*1e3).toFixed(4)}`:"-"}),t.jsx("td",{className:"px-5 py-3.5 text-right font-mono text-page-label",children:e.output_price!=null?`$${(Number(e.output_price)*1e3).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{w as default}; diff --git a/dist/assets/Register-BxoHOOlN.js b/dist/assets/Register-Cqb3fCW-.js similarity index 96% rename from dist/assets/Register-BxoHOOlN.js rename to dist/assets/Register-Cqb3fCW-.js index 378317d..2981948 100644 --- a/dist/assets/Register-BxoHOOlN.js +++ b/dist/assets/Register-Cqb3fCW-.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-C1LcEmdp.js";import{u as j}from"./useTranslation-kIlHvV5e.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-D8eKls75.js";import{u as j}from"./useTranslation-D_OVvIX9.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-ByYi0mto.js b/dist/assets/RotatingEquiv-ByYi0mto.js deleted file mode 100644 index d17df4d..0000000 --- a/dist/assets/RotatingEquiv-ByYi0mto.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s,j as c}from"./index-C1LcEmdp.js";const P=[{pattern:"claude-4-sonnet",label:"Claude Sonnet 4",inputPerMtok:3},{pattern:"claude-sonnet-4",label:"Claude Sonnet 4",inputPerMtok:3},{pattern:"claude-4.5-sonnet",label:"Claude 4.5 Sonnet",inputPerMtok:3},{pattern:"claude-4.6-sonnet",label:"Claude 4.6 Sonnet",inputPerMtok:3},{pattern:"claude-4-opus",label:"Claude Opus 4",inputPerMtok:15},{pattern:"claude-opus-4",label:"Claude Opus 4",inputPerMtok:15},{pattern:"claude-4.1-opus",label:"Claude Opus 4.1",inputPerMtok:15},{pattern:"claude-4.5-opus",label:"Claude Opus 4.5",inputPerMtok:5},{pattern:"claude-4.6-opus",label:"Claude Opus 4.6",inputPerMtok:5},{pattern:"claude-3.5-haiku",label:"Claude 3.5 Haiku",inputPerMtok:.8},{pattern:"claude-3-5-haiku",label:"Claude 3.5 Haiku",inputPerMtok:.8},{pattern:"gpt-5.1",label:"GPT-5.1",inputPerMtok:1.25},{pattern:"gpt-5.2",label:"GPT-5.2",inputPerMtok:1.75},{pattern:"gpt-5.3",label:"GPT-5.3",inputPerMtok:1.75},{pattern:"gpt-5.4",label:"GPT-5.4",inputPerMtok:2.5},{pattern:"gpt-4o",label:"GPT-4o",inputPerMtok:2.5},{pattern:"gpt-4.1",label:"GPT-4.1",inputPerMtok:2},{pattern:"gemini-2.5-pro",label:"Gemini 2.5 Pro",inputPerMtok:1.25},{pattern:"gemini-2.5-flash",label:"Gemini 2.5 Flash",inputPerMtok:.15},{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}];function k(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 P)if(o.includes(a.pattern.toLowerCase())){const u=n*1e3,p=a.inputPerMtok/u,i=r*p;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 d({items:e,text:r,className:l="",interval:t=3e3}){const[n,o]=s.useState(0),[a,u]=s.useState(!0);return s.useEffect(()=>{if(e.length<=1)return;const p=setInterval(()=>{u(!1),setTimeout(()=>{o(i=>(i+1)%e.length),u(!0)},300)},t);return()=>clearInterval(p)},[e.length,t]),!e||e.length===0?null:c.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{d as R,k as c}; diff --git a/dist/assets/RotatingEquiv-DkCC_t4y.js b/dist/assets/RotatingEquiv-DkCC_t4y.js new file mode 100644 index 0000000..d2b95e4 --- /dev/null +++ b/dist/assets/RotatingEquiv-DkCC_t4y.js @@ -0,0 +1 @@ +import{r as s,j as P}from"./index-D8eKls75.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-Bshgut1A.js b/dist/assets/Tokens-C1-BGu0J.js similarity index 99% rename from dist/assets/Tokens-Bshgut1A.js rename to dist/assets/Tokens-C1-BGu0J.js index 11f0c50..7e4aedd 100644 --- a/dist/assets/Tokens-Bshgut1A.js +++ b/dist/assets/Tokens-C1-BGu0J.js @@ -1,4 +1,4 @@ -import{r as o,e as E,f as I,j as e,z as C,h as P,i as W,k as U}from"./index-C1LcEmdp.js";import{u as K}from"./useTranslation-kIlHvV5e.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,e as E,f as I,j as e,z as C,h as P,i as W,k as U}from"./index-D8eKls75.js";import{u as K}from"./useTranslation-D_OVvIX9.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-DJNXKsov.js b/dist/assets/Topup-CS3pbNbp.js similarity index 99% rename from dist/assets/Topup-DJNXKsov.js rename to dist/assets/Topup-CS3pbNbp.js index 945b67f..31f52aa 100644 --- a/dist/assets/Topup-DJNXKsov.js +++ b/dist/assets/Topup-CS3pbNbp.js @@ -1 +1 @@ -import{u as qe,a as $e,r as n,g as Te,n as Oe,j as e,Q as te,d as Me,z as d,o as Ee,p as Le,q as Ue,t as He,v as Re,w as De,x as Fe}from"./index-C1LcEmdp.js";import{C as L}from"./CountUp-M8KqDP8n.js";import{u as ze}from"./useTranslation-kIlHvV5e.js";function Ve(){var Z;const{t:s}=ze(),{user:i,refreshUser:U}=qe(),{site:r}=$e(),[m,se]=n.useState(null),[l,ae]=n.useState(null),[le,H]=n.useState(!0),[T,R]=n.useState(""),[D,F]=n.useState(!1),[h,O]=n.useState(""),[ne,M]=n.useState(null),[z,B]=n.useState(null),[re,W]=n.useState(!1),[b,y]=n.useState(!1),[E,f]=n.useState(""),[C,S]=n.useState(null),[ce,j]=n.useState(!1),[p,Q]=n.useState(""),[k,oe]=n.useState("usdt"),[N,de]=n.useState(null),[P,ie]=n.useState(!1),[J,me]=n.useState([]),[pe,V]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const A=n.useCallback(async()=>{var t;H(!0);try{const[a,c]=await Promise.all([Te(),r!=null&&r.enable_topup?Oe().catch(()=>null):Promise.resolve(null)]);a.data.success&&se(a.data.data),(t=c==null?void 0:c.data)!=null&&t.data&&ae(c.data.data)}catch{}H(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{A()},[A]);const G=(m==null?void 0:m.quota)??(i==null?void 0:i.quota)??0,ue=(m==null?void 0:m.used_quota)??(i==null?void 0:i.used_quota)??0,xe=(m==null?void 0:m.request_count)??(i==null?void 0:i.request_count)??0,ge=G/te,he=async t=>{if(t.preventDefault(),!!T.trim()){F(!0);try{(await Me(T.trim())).data.success&&(d.success(s("topup.redeemSuccess")),R(""),await Promise.all([A(),U()]))}catch{}F(!1)}},K=async t=>{if(!t||t<=0){B(null);return}W(!0);try{const a=await Ee({amount:parseInt(t)});a.data.message==="success"&&B(a.data.data)}catch{}W(!1)},be=t=>{M(t),O(t),K(t)},ye=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),fe=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(ye(t)){const o=await Le(_);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 Ue(_);if(o.data.message==="success"){const x=o.data.data,I=o.data.url;if(I&&x){const g=document.createElement("form");g.action=I,g.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(g.target="_blank");for(const ee in x){const $=document.createElement("input");$.type="hidden",$.name=ee,$.value=x[ee],g.appendChild($)}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("")},je=async t=>{var a;y(!0),f("creem");try{const c=await He({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("")},Ne=async()=>{const t=parseInt(h);if(!t||t<=0){d.error(s("topup.enterAmount"));return}if(!p){d.error(s("topup.selectChain"));return}if(!k){d.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await Re({amount:t,chain:p,token:k});if(a.data.message==="success"&&a.data.data)S(a.data.data),ve(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("")},ve=t=>{j(!0);const a=setInterval(async()=>{var u,_;try{const o=await De(t);((u=o.data.data)==null?void 0:u.status)==="success"?(clearInterval(a),j(!1),S(null),d.success(s("topup.paymentSuccess")),await Promise.all([A(),U()])):((_=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&&Q(w[0].key)},[w,p]);const X=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]),we=async()=>{var t;V(!0);try{const a=await Fe({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&me(a.data.data.items)}catch{}V(!1)},Ce=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],q=(l==null?void 0:l.min_topup)||1,_e=(l==null?void 0:l.pay_methods)||[],Se=l==null?void 0:l.enable_online_topup,ke=l==null?void 0:l.enable_stripe_topup,Pe=l==null?void 0:l.enable_creem_topup,Ae=l==null?void 0:l.enable_crypto_topup,Y=_e.filter(t=>t.type!=="creem"&&t.type!=="crypto");return le?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:["$",e.jsx(L,{from:0,to:ge,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:["$",e.jsx(L,{from:0,to:ue/te,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(L,{from:0,to:xe,duration:1.5})})]})]}),(r==null?void 0:r.enable_topup)&&(Se||ke)&&Y.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:()=>{ie(!P),P||we()},className:"text-sm text-page-secondary hover:text-page transition-colors",children:s(P?"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:Ce.map(t=>e.jsxs("button",{onClick:()=>be(t),className:`py-2.5 px-3 rounded-xl text-sm font-medium transition-all ${ne===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]},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=>{O(t.target.value),M(null)},onBlur:t=>K(t.target.value),min:q,placeholder:s("topup.amountPlaceholder",{min:q}),className:"input flex-1"})}),re?e.jsx("p",{className:"text-xs text-page-muted mt-2",children:s("topup.calculating")}):z?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:["¥",z]})]}):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:Y.map(t=>{const a=b&&E===t.type;return e.jsx("button",{onClick:()=>fe(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)&&Pe&&X.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:X.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:()=>de(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:()=>je(N),disabled:b,className:"btn-primary px-6",children:b&&E==="creem"?s("topup.processing"):`${s("topup.payNow")||"Pay"} $${N.price}`})})]}),(r==null?void 0:r.enable_topup)&&Ae&&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=>{O(t.target.value),M(null)},min:q,placeholder:s("topup.amountPlaceholder",{min:q}),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:()=>Q(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:()=>oe(t),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${k===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:Ne,disabled:b||!h,className:"btn-primary w-full",children:b&&E==="crypto"?s("topup.processing"):`${s("topup.payWith")||"Pay with"} ${k.toUpperCase()} (${((Z=w.find(t=>t.key===p))==null?void 0:Z.label)||p})`})]}),C&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>S(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})]})]}),ce&&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:()=>{S(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")})]})]})}),P&&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")}),pe?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"})}):J.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:J.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:["$",t.amount]}),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:he,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:T,onChange:t=>R(t.target.value),className:"input flex-1",placeholder:s("topup.enterRedeemCode")}),e.jsx("button",{type:"submit",disabled:D,className:"btn-primary whitespace-nowrap",children:s(D?"topup.redeeming":"topup.redeem")})]})]})]})}export{Ve as default}; +import{u as qe,a as $e,r as n,g as Te,n as Oe,j as e,Q as te,d as Me,z as d,o as Ee,p as Le,q as Ue,t as He,v as Re,w as De,x as Fe}from"./index-D8eKls75.js";import{C as L}from"./CountUp-BixuEoA6.js";import{u as ze}from"./useTranslation-D_OVvIX9.js";function Ve(){var Z;const{t:s}=ze(),{user:i,refreshUser:U}=qe(),{site:r}=$e(),[m,se]=n.useState(null),[l,ae]=n.useState(null),[le,H]=n.useState(!0),[T,R]=n.useState(""),[D,F]=n.useState(!1),[h,O]=n.useState(""),[ne,M]=n.useState(null),[z,B]=n.useState(null),[re,W]=n.useState(!1),[b,y]=n.useState(!1),[E,f]=n.useState(""),[C,S]=n.useState(null),[ce,j]=n.useState(!1),[p,Q]=n.useState(""),[k,oe]=n.useState("usdt"),[N,de]=n.useState(null),[P,ie]=n.useState(!1),[J,me]=n.useState([]),[pe,V]=n.useState(!1);r!=null&&r.enable_topup,r==null||r.topup_config;const A=n.useCallback(async()=>{var t;H(!0);try{const[a,c]=await Promise.all([Te(),r!=null&&r.enable_topup?Oe().catch(()=>null):Promise.resolve(null)]);a.data.success&&se(a.data.data),(t=c==null?void 0:c.data)!=null&&t.data&&ae(c.data.data)}catch{}H(!1)},[r==null?void 0:r.enable_topup]);n.useEffect(()=>{A()},[A]);const G=(m==null?void 0:m.quota)??(i==null?void 0:i.quota)??0,ue=(m==null?void 0:m.used_quota)??(i==null?void 0:i.used_quota)??0,xe=(m==null?void 0:m.request_count)??(i==null?void 0:i.request_count)??0,ge=G/te,he=async t=>{if(t.preventDefault(),!!T.trim()){F(!0);try{(await Me(T.trim())).data.success&&(d.success(s("topup.redeemSuccess")),R(""),await Promise.all([A(),U()]))}catch{}F(!1)}},K=async t=>{if(!t||t<=0){B(null);return}W(!0);try{const a=await Ee({amount:parseInt(t)});a.data.message==="success"&&B(a.data.data)}catch{}W(!1)},be=t=>{M(t),O(t),K(t)},ye=t=>["stripe","alipay","wxpay"].includes(t)&&!t.startsWith("epay_"),fe=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(ye(t)){const o=await Le(_);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 Ue(_);if(o.data.message==="success"){const x=o.data.data,I=o.data.url;if(I&&x){const g=document.createElement("form");g.action=I,g.method="POST",navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<1||(g.target="_blank");for(const ee in x){const $=document.createElement("input");$.type="hidden",$.name=ee,$.value=x[ee],g.appendChild($)}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("")},je=async t=>{var a;y(!0),f("creem");try{const c=await He({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("")},Ne=async()=>{const t=parseInt(h);if(!t||t<=0){d.error(s("topup.enterAmount"));return}if(!p){d.error(s("topup.selectChain"));return}if(!k){d.error(s("topup.selectToken"));return}y(!0),f("crypto");try{const a=await Re({amount:t,chain:p,token:k});if(a.data.message==="success"&&a.data.data)S(a.data.data),ve(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("")},ve=t=>{j(!0);const a=setInterval(async()=>{var u,_;try{const o=await De(t);((u=o.data.data)==null?void 0:u.status)==="success"?(clearInterval(a),j(!1),S(null),d.success(s("topup.paymentSuccess")),await Promise.all([A(),U()])):((_=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&&Q(w[0].key)},[w,p]);const X=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]),we=async()=>{var t;V(!0);try{const a=await Fe({page:1,page_size:20});(t=a.data.data)!=null&&t.items&&me(a.data.data.items)}catch{}V(!1)},Ce=(l==null?void 0:l.amount_options)||[1,5,10,20,50,100],q=(l==null?void 0:l.min_topup)||1,_e=(l==null?void 0:l.pay_methods)||[],Se=l==null?void 0:l.enable_online_topup,ke=l==null?void 0:l.enable_stripe_topup,Pe=l==null?void 0:l.enable_creem_topup,Ae=l==null?void 0:l.enable_crypto_topup,Y=_e.filter(t=>t.type!=="creem"&&t.type!=="crypto");return le?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:["$",e.jsx(L,{from:0,to:ge,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:["$",e.jsx(L,{from:0,to:ue/te,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(L,{from:0,to:xe,duration:1.5})})]})]}),(r==null?void 0:r.enable_topup)&&(Se||ke)&&Y.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:()=>{ie(!P),P||we()},className:"text-sm text-page-secondary hover:text-page transition-colors",children:s(P?"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:Ce.map(t=>e.jsxs("button",{onClick:()=>be(t),className:`py-2.5 px-3 rounded-xl text-sm font-medium transition-all ${ne===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]},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=>{O(t.target.value),M(null)},onBlur:t=>K(t.target.value),min:q,placeholder:s("topup.amountPlaceholder",{min:q}),className:"input flex-1"})}),re?e.jsx("p",{className:"text-xs text-page-muted mt-2",children:s("topup.calculating")}):z?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:["¥",z]})]}):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:Y.map(t=>{const a=b&&E===t.type;return e.jsx("button",{onClick:()=>fe(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)&&Pe&&X.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:X.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:()=>de(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:()=>je(N),disabled:b,className:"btn-primary px-6",children:b&&E==="creem"?s("topup.processing"):`${s("topup.payNow")||"Pay"} $${N.price}`})})]}),(r==null?void 0:r.enable_topup)&&Ae&&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=>{O(t.target.value),M(null)},min:q,placeholder:s("topup.amountPlaceholder",{min:q}),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:()=>Q(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:()=>oe(t),className:`px-4 py-2 rounded-xl text-sm font-medium transition-all ${k===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:Ne,disabled:b||!h,className:"btn-primary w-full",children:b&&E==="crypto"?s("topup.processing"):`${s("topup.payWith")||"Pay with"} ${k.toUpperCase()} (${((Z=w.find(t=>t.key===p))==null?void 0:Z.label)||p})`})]}),C&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:()=>S(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})]})]}),ce&&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:()=>{S(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")})]})]})}),P&&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")}),pe?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"})}):J.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:J.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:["$",t.amount]}),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:he,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:T,onChange:t=>R(t.target.value),className:"input flex-1",placeholder:s("topup.enterRedeemCode")}),e.jsx("button",{type:"submit",disabled:D,className:"btn-primary whitespace-nowrap",children:s(D?"topup.redeeming":"topup.redeem")})]})]})]})}export{Ve as default}; diff --git a/dist/assets/index-C1LcEmdp.js b/dist/assets/index-D8eKls75.js similarity index 99% rename from dist/assets/index-C1LcEmdp.js rename to dist/assets/index-D8eKls75.js index 1eeec88..f3c31a0 100644 --- a/dist/assets/index-C1LcEmdp.js +++ b/dist/assets/index-D8eKls75.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-B2GlE1Mp.js","assets/RotatingEquiv-ByYi0mto.js","assets/CountUp-M8KqDP8n.js","assets/FadeContent-CEb-jr-E.js","assets/useTranslation-kIlHvV5e.js","assets/Layout-CAsa4KKn.js","assets/LanguageSwitch-rovTNa8V.js","assets/Home-Cd5nSY1a.js","assets/Layout-BS8ZSjrH.js","assets/Home-5Rp4O19m.js","assets/Layout-SPj6Qlsc.js","assets/Home-D_VkCxtC.js","assets/Layout-B5NB7HJ5.js","assets/Home-D-ipNZp0.js","assets/Layout-ZfNECSe_.js","assets/Home-CyhK9Wc-.js","assets/Layout-Dys-46k2.js","assets/Home-Z4Xt2qzF.js","assets/Layout-C1rCV4ZQ.js","assets/Login-WL0R6qgx.js","assets/Register-BxoHOOlN.js","assets/Dashboard-DDH6EKjw.js","assets/Tokens-Bshgut1A.js","assets/Packages-DO4E8cNd.js","assets/Pricing-BO8JIN62.js","assets/Topup-DJNXKsov.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-qfwynDF2.js","assets/RotatingEquiv-DkCC_t4y.js","assets/CountUp-BixuEoA6.js","assets/FadeContent-B3Mc1Ysf.js","assets/useTranslation-D_OVvIX9.js","assets/Layout-0cB1qtYA.js","assets/LanguageSwitch-CG9YcMHq.js","assets/Home-BuJm_vIH.js","assets/Layout-D-Bm8TiX.js","assets/Home-Biz_0NAt.js","assets/Layout-DmqKjR6M.js","assets/Home-BofCv9GQ.js","assets/Layout-BCQLwwoq.js","assets/Home-zDwhMuTN.js","assets/Layout-2sjWYmyT.js","assets/Home-hgWoWuW8.js","assets/Layout-qJz07ANC.js","assets/Home-B_aQfVX_.js","assets/Layout-NO9JLeRC.js","assets/Login-B-uSRrNm.js","assets/Register-Cqb3fCW-.js","assets/Dashboard-sLmY72mU.js","assets/Tokens-C1-BGu0J.js","assets/Packages-CTK12U-8.js","assets/Pricing-DcAHcsau.js","assets/Topup-CS3pbNbp.js"])))=>i.map(i=>d[i]); function Vp(e,t){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Hp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ic={exports:{}},go={},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(i=>r.set(i)),r}static accessor(t){const r=(this[rc]=this[rc]={accessors:{}}).accessors,i=this.prototype;function o(s){const l=lr(s);r[l]||(x0(i,s),r[l]=!0)}return S.isArray(t)?t.forEach(o):o(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||ei,r=t||n,i=De.from(r.headers);let o=r.data;return S.forEach(e,function(l){o=l.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Ep(e){return!!(e&&e.__CANCEL__)}let ti=class extends A{constructor(t,n,r){super(t??"canceled",A.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 A("Request failed with status code "+n.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function E0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function C0(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=r[o];s||(s=u),n[i]=a,r[i]=u;let f=o,p=0;for(;f!==i;)p+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),u-s{n=c,i=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?s(u,c):(i=u,o||(o=setTimeout(()=>{o=null,s(i)},r-f)))},()=>i&&s(i)]}const fo=(e,t,n=3)=>{let r=0;const i=C0(50,250);return P0(o=>{const s=o.loaded,l=o.lengthComputable?o.total:void 0,a=s-r,u=i(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:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},ic=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},oc=e=>(...t)=>S.asap(()=>e(...t)),O0=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,R0=we.hasStandardBrowserEnv?{write(e,t,n,r,i,o,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(i)&&l.push(`domain=${i}`),o===!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 _0(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function L0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Pp(e,t,n){let r=!_0(t);return e&&(r||n==!1)?L0(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 i(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 o(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:o,method:o,data:o,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)=>i(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]:i,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:i,xsrfCookieName:o,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&&O0(t.url))){const a=i&&o&&R0.read(o);a&&s.set(i,a)}return t},T0=typeof XMLHttpRequest<"u",N0=T0&&function(e){return new Promise(function(n,r){const i=Op(e);let o=i.data;const s=De.from(i.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:u}=i,c,f,p,y,d;function v(){y&&y(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function m(){if(!w)return;const g=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:g,config:e,request:w};Cp(function(P){n(P),v()},function(P){r(P),v()},E),w=null}"onloadend"in w?w.onloadend=m:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(m)},w.onabort=function(){w&&(r(new A("Request aborted",A.ECONNABORTED,e,w)),w=null)},w.onerror=function(k){const E=k&&k.message?k.message:"Network Error",R=new A(E,A.ERR_NETWORK,e,w);R.event=k||null,r(R),w=null},w.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||La;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),r(new A(k,E.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,e,w)),w=null},o===void 0&&s.setContentType(null),"setRequestHeader"in w&&S.forEach(s.toJSON(),function(k,E){w.setRequestHeader(E,k)}),S.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),l&&l!=="json"&&(w.responseType=i.responseType),u&&([p,d]=fo(u,!0),w.addEventListener("progress",p)),a&&w.upload&&([f,y]=fo(a),w.upload.addEventListener("progress",f),w.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(c=g=>{w&&(r(!g||g.type?new ti(null,e,w):g),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const h=E0(i.url);if(h&&we.protocols.indexOf(h)===-1){r(new A("Unsupported protocol "+h+":",A.ERR_BAD_REQUEST,e));return}w.send(o||null)})},A0=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(u){if(!i){i=!0,l();const c=u instanceof Error?u:this.reason;r.abort(c instanceof A?c:new ti(c instanceof Error?c.message:c))}};let s=t&&setTimeout(()=>{s=null,o(new A(`timeout of ${t}ms exceeded`,A.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>S.asap(l),a}},I0=function*(e,t){let n=e.byteLength;if(n{const i=D0(e,t);let o=0,s,l=a=>{s||(s=!0,r&&r(a))};return new ReadableStream({async pull(a){try{const{done:u,value:c}=await i.next();if(u){l(),a.close();return}let f=c.byteLength;if(n){let p=o+=f;n(p)}a.enqueue(new Uint8Array(c))}catch(u){throw l(u),u}},cancel(a){return l(a),i.return()}},{highWaterMark:2})},ac=64*1024,{isFunction:ki}=S,j0=(({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}},$0=e=>{e=S.merge.call({skipUndefined:!0},j0,e);const{fetch:t,Request:n,Response:r}=e,i=t?ki(t):typeof fetch=="function",o=ki(n),s=ki(r);if(!i)return!1;const l=i&&ki(uc),a=i&&(typeof cc=="function"?(d=>v=>d.encode(v))(new cc):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&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)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(v,w)=>{let m=v&&v[d];if(m)return m.call(v);throw new A(`Response type '${d}' is not supported`,A.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:m,signal:h,cancelToken:g,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=A0([h,g&&g.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,m))!==0){let F=new n(v,{method:"POST",body:m,duplex:"half"}),U;if(S.isFormData(m)&&(U=F.headers.get("content-type"))&&L.setContentType(U),F.body){const[Re,ke]=ic(Yt,fo(oc(R)));m=lc(F.body,ac,Re,ke)}}S.isString($)||($=$?"include":"omit");const b=o&&"credentials"in n.prototype,he={...T,signal:be,method:w.toUpperCase(),headers:L.normalize().toJSON(),body:m,duplex:"half",credentials:b?$:void 0};V=o&&new n(v,he);let O=await(o?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&&ic(U,fo(oc(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 A("Network Error",A.ERR_NETWORK,d,V,b&&b.response),{cause:b.cause||b}):A.from(b,b&&b.code,d,V,b&&b.response)}}},z0=new Map,Rp=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s=o.length,l=s,a,u,c=z0;for(;l--;)a=o[l],u=c.get(a),u===void 0&&c.set(a,u=l?new Map:$0(t)),c=u;return u};Rp();const Na={http:t0,xhr:N0,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}`,U0=e=>S.isFunction(e)||e===null||e===!1;function M0(e,t){e=S.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};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 A("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i}const _p={getAdapter:M0,adapters:Na};function vs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ti(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||ei.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",Uo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Uo[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const hc={};Uo.transitional=function(t,n,r){function i(o,s){return"[Axios v"+Lp+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,l)=>{if(t===!1)throw new A(i(s," has been removed"+(n?" in "+n:"")),A.ERR_DEPRECATED);return n&&!hc[s]&&(hc[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,l):!0}};Uo.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 A("options must be an object",A.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const l=e[o],a=l===void 0||s(l,o,e);if(a!==!0)throw new A("option "+o+" must be "+a,A.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new A("Unknown option "+o,A.ERR_BAD_OPTION)}}const zi={assertOptions:b0,validators:Uo},Be=zi.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 i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}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:i,headers:o}=n;r!==void 0&&zi.assertOptions(r,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean),legacyInterceptorReqResOrdering:Be.transitional(Be.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:zi.assertOptions(i,{encode:Be.function,serialize:Be.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zi.assertOptions(n,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=De.concat(s,o);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 o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{r.subscribe(l),o=l}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,l){r.reason||(r.reason=new ti(o,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(i){t=i}),cancel:t}}};function V0(e){return function(n){return e.apply(null,n)}}function H0(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(i){return Np(hn(e,i))},n}const re=Np(ei);re.Axios=an;re.CanceledError=ti;re.CancelToken=B0;re.isCancel=Ep;re.VERSION=Lp;re.toFormData=zo;re.AxiosError=A;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=V0;re.isAxiosError=H0;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:d1,AxiosError:p1,CanceledError:h1,isCancel:m1,CancelToken:g1,VERSION:y1,all:v1,Cancel:w1,isAxiosError:S1,spread:k1,toFormData:x1,AxiosHeaders:E1,HttpStatusCode:C1,formToJSON:P1,getAdapter:O1,mergeConfig:R1}=re,_1=5e5,Q=re.create({baseURL:"",timeout:3e4,withCredentials:!0,headers:{"Content-Type":"application/json"}});Q.interceptors.request.use(e=>{const t=localStorage.getItem("dist_user_id");return t&&(e.headers["New-Api-User"]=t),e});Q.interceptors.response.use(e=>(e.data&&e.data.success===!1&&e.data.message&&hs.error(e.data.message),e),e=>{var n,r,i;const t=((r=(n=e.response)==null?void 0:n.data)==null?void 0:r.message)||e.message||"Request failed";return((i=e.response)==null?void 0:i.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 K0=()=>Q.get("/api/dist/site/info"),L1=()=>Q.get("/api/dist/site/models"),T1=()=>Q.get("/api/dist/site/packages"),W0=e=>Q.post("/api/dist/user/register",e),Q0=e=>Q.post("/api/dist/user/login",e),q0=()=>Q.post("/api/dist/user/logout"),ws=()=>Q.get("/api/dist/user/self"),N1=()=>Q.get("/api/dist/user/usage"),A1=()=>Q.get("/api/dist/token/list"),I1=e=>Q.post("/api/dist/token/create",e),D1=(e,t)=>Q.put(`/api/dist/token/${e}`,t),F1=e=>Q.delete(`/api/dist/token/${e}`),j1=e=>Q.post("/api/dist/topup/redeem",{key:e}),$1=e=>Q.post("/api/dist/package/subscribe",{package_id:e}),z1=()=>Q.get("/api/dist/package/subscriptions"),U1=()=>Q.get("/api/dist/topup/info"),M1=e=>Q.post("/api/dist/topup/amount",e),b1=e=>Q.post("/api/dist/topup/pay",e),B1=e=>Q.post("/api/dist/topup/stripe/pay",e),V1=e=>Q.post("/api/dist/topup/creem/pay",e),H1=e=>Q.post("/api/dist/topup/crypto/pay",e),K1=e=>Q.get(`/api/dist/topup/crypto/status?trade_no=${e}`),W1=e=>Q.get("/api/dist/topup/history",{params:e}),Ap=x.createContext(null);function J0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0),o=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(()=>i(!1)):i(!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 W0(u);return c.data.success?{success:!0,needsLogin:!0}:{success:!1,message:c.data.message}},[]),a=x.useCallback(async()=>{try{await q0()}catch{}localStorage.removeItem("dist_user_id"),n(null)},[]);return I.jsx(Ap.Provider,{value:{user:t,loading:r,login:s,register:l,logout:a,refreshUser:o},children:e})}function Y0(){const e=x.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function G0(){const{user:e,loading:t}=Y0(),n=Gn();return t?I.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e?I.jsx(cy,{}):I.jsx(np,{to:"/login",state:{from:n},replace:!0})}const Ip=x.createContext(null);function X0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0);return x.useEffect(()=>{K0().then(o=>{var s,l;if(o.data.success&&(n(o.data.data),(s=o.data.data)!=null&&s.name&&(document.title=o.data.data.name),(l=o.data.data)!=null&&l.favicon)){const a=document.querySelector("link[rel~='icon']")||document.createElement("link");a.rel="icon",a.href=o.data.data.favicon,document.head.appendChild(a)}}).catch(()=>{}).finally(()=>i(!1))},[]),I.jsx(Ip.Provider,{value:{site:t,loading:r},children:e})}function Z0(){const e=x.useContext(Ip);if(!e)throw new Error("useSite must be used within SiteProvider");return e}const Dp=x.createContext(null),mc={starter:{Home:ye.lazy(()=>ee(()=>import("./Home-B2GlE1Mp.js"),__vite__mapDeps([0,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-CAsa4KKn.js"),__vite__mapDeps([5,6,4])))},default:{Home:ye.lazy(()=>ee(()=>import("./Home-Cd5nSY1a.js"),__vite__mapDeps([7,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-BS8ZSjrH.js"),__vite__mapDeps([8,6,4])))},dark:{Home:ye.lazy(()=>ee(()=>import("./Home-5Rp4O19m.js"),__vite__mapDeps([9,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-SPj6Qlsc.js"),__vite__mapDeps([10,6,4])))},minimal:{Home:ye.lazy(()=>ee(()=>import("./Home-D_VkCxtC.js"),__vite__mapDeps([11,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-B5NB7HJ5.js"),__vite__mapDeps([12,6,4])))},clean:{Home:ye.lazy(()=>ee(()=>import("./Home-D-ipNZp0.js"),__vite__mapDeps([13,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-ZfNECSe_.js"),__vite__mapDeps([14,6,4])))},corporate:{Home:ye.lazy(()=>ee(()=>import("./Home-CyhK9Wc-.js"),__vite__mapDeps([15,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-Dys-46k2.js"),__vite__mapDeps([16,6,4])))},claude:{Home:ye.lazy(()=>ee(()=>import("./Home-Z4Xt2qzF.js"),__vite__mapDeps([17,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-C1rCV4ZQ.js"),__vite__mapDeps([18,6,4])))}};function ew(){return I.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-950",children:I.jsx("div",{className:"w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full animate-spin"})})}function tw({children:e}){const{site:t,loading:n}=Z0();if(n)return I.jsx(ew,{});const r=(t==null?void 0:t.theme_template)||"starter";return I.jsx(nw,{themeName:r,children:e})}function nw({themeName:e,children:t}){const n=x.useMemo(()=>{const r=mc[e]||mc.starter;return{name:e,...r}},[e]);return I.jsx(Dp.Provider,{value:n,children:t})}function rw(){const e=x.useContext(Dp);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const iw=x.lazy(()=>ee(()=>import("./Login-WL0R6qgx.js"),__vite__mapDeps([19,4]))),ow=x.lazy(()=>ee(()=>import("./Register-BxoHOOlN.js"),__vite__mapDeps([20,4]))),sw=x.lazy(()=>ee(()=>import("./Dashboard-DDH6EKjw.js"),__vite__mapDeps([21,2,4]))),lw=x.lazy(()=>ee(()=>import("./Tokens-Bshgut1A.js"),__vite__mapDeps([22,4]))),aw=x.lazy(()=>ee(()=>import("./Packages-DO4E8cNd.js"),__vite__mapDeps([23,1,4]))),uw=x.lazy(()=>ee(()=>import("./Pricing-BO8JIN62.js"),__vite__mapDeps([24,4]))),cw=x.lazy(()=>ee(()=>import("./Topup-DJNXKsov.js"),__vite__mapDeps([25,2,4]))),fw=()=>I.jsx("div",{className:"flex items-center justify-center min-h-screen",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});function dw(){const{Home:e,Layout:t}=rw();return I.jsx(x.Suspense,{fallback:I.jsx(fw,{}),children:I.jsxs(dy,{children:[I.jsxs(Ve,{element:I.jsx(t,{}),children:[I.jsx(Ve,{path:"/",element:I.jsx(e,{})}),I.jsx(Ve,{path:"/pricing",element:I.jsx(uw,{})}),I.jsx(Ve,{path:"/packages",element:I.jsx(aw,{})}),I.jsx(Ve,{path:"/login",element:I.jsx(iw,{})}),I.jsx(Ve,{path:"/register",element:I.jsx(ow,{})}),I.jsxs(Ve,{element:I.jsx(G0,{}),children:[I.jsx(Ve,{path:"/dashboard",element:I.jsx(sw,{})}),I.jsx(Ve,{path:"/tokens",element:I.jsx(lw,{})}),I.jsx(Ve,{path:"/topup",element:I.jsx(cw,{})})]})]}),I.jsx(Ve,{path:"*",element:I.jsx(np,{to:"/",replace:!0})})]})})}function pw(){return I.jsx(tw,{children:I.jsx(dw,{})})}const D=e=>typeof e=="string",ar=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},gc=e=>e==null?"":""+e,hw=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},mw=/###/g,yc=e=>e&&e.indexOf("###")>-1?e.replace(mw,"."):e,vc=e=>!e||D(e),xr=(e,t,n)=>{const r=D(t)?t.split("."):t;let i=0;for(;i{const{obj:r,k:i}=xr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),l=xr(e,s,Object);for(;l.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),l=xr(e,s,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},gw=(e,t,n,r)=>{const{obj:i,k:o}=xr(e,t,Object);i[o]=i[o]||[],i[o].push(n)},po=(e,t)=>{const{obj:n,k:r}=xr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},yw=(e,t,n)=>{const r=po(e,n);return r!==void 0?r:po(t,n)},Fp=(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]):Fp(e[r],t[r],n):e[r]=t[r]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ww=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>vw[t]):e;class Sw{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 kw=[" ",",","?","!",";"],xw=new Sw(20),Ew=(e,t,n)=>{t=t||"",n=n||"";const r=kw.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=xw.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},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 i=e;for(let o=0;o-1&&ae==null?void 0:e.replace(/_/g,"-"),Cw={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 ho{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Cw,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,i){return i&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ho(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ho(this.logger,t)}}var at=new ho;class Mo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+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(([i,o])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var u,c;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):D(r)&&o?l.push(...r.split(o)):l.push(r)));const a=po(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,o)}addResource(t,n,r,i,o={silent:!1}){const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),wc(this.data,l,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(D(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,s={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let a=po(this.data,l)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Fp(a,r,o):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(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var jp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var s;t=((s=this.processors[o])==null?void 0:s.process(t,n,r,i))??t}),t}};const $p=Symbol("i18next/PATH_KEY");function Pw(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===$p?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Er(e,t){const{[$p]:n}=e(Pw()),r=(t==null?void 0:t.keySeparator)??".",i=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&i){const o=t==null?void 0:t.ns,s=Array.isArray(o)?o:null;if(s&&s.length>1&&s.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const kc={},Ss=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class mo extends Mo{constructor(t,n={}){super(),hw(["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 i=this.resolve(t,r);if((i==null?void 0:i.res)===void 0)return!1;const o=Ss(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ew(t,r,i);if(s&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:D(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:D(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Er(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?Er(V,{...this.options,...i}):String(V));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:a}=this.extractFromKey(t[t.length-1],i),u=a[a.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?o?{res:`${u}${c}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:l;const y=this.resolve(t,i);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,m=["[object Number]","[object Function]","[object RegExp]"],h=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!D(i.count),E=mo.hasDefaultValue(i),R=k?this.pluralResolver.getSuffix(f,i.count,i):"",P=i.ordinal&&k?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",L=k&&!i.ordinal&&i.count===0,$=L&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${R}`]||i[`defaultValue${P}`]||i.defaultValue;let T=d;g&&!d&&E&&(T=$);const pe=Ss(T),be=Object.prototype.toString.apply(T);if(g&&T&&pe&&m.indexOf(be)<0&&!(D(h)&&Array.isArray(T))){if(!i.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,{...i,ns:a}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=V,y.usedParams=this.getUsedParamsDetails(i),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,{...i,defaultValue:Ss($)?$[b]:void 0,joinArrays:!1,ns:a}):X[b]=this.translate(he,{...i,joinArrays:!1,ns:a}),X[b]===he&&(X[b]=T[b])}d=X}}else if(g&&D(h)&&Array.isArray(d))d=d.join(h),d&&(d=this.extendTranslation(d,t,i,r));else{let V=!1,X=!1;!this.isValidLookup(d)&&E&&(V=!0,d=$),this.isValidLookup(d)||(X=!0,d=l);const b=(i.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,{...i,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,i.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,i):(ft=this.backendConnector)!=null&&ft.saveMissing&&this.backendConnector.saveMissing(F,u,U,ke,he,i),this.emit("missingKey",F,u,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?O.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,i);L&&i[`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,i[`defaultValue${Re}`]||$)})}):j(O,l,$))}d=this.extendTranslation(d,t,i,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,i))}return o?(y.res=d,y.usedParams=this.getUsedParamsDetails(i),y):d}extendTranslation(t,n,r,i,o){var a,u;if((a=this.i18nFormat)!=null&&a.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});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||i.usedLng,r),c){const y=t.match(this.interpolator.nestingRegexp),d=y&&y.length;f(o==null?void 0:o[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=jp.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,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;i=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 m,h;this.isValidLookup(r)||(l=w,!kc[`${v[0]}-${w}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(l))&&(kc[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${i}" 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(g=>{var R;if(this.isValidLookup(r))return;s=g;const k=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(k,c,g,w,n);else{let P;p&&(P=this.pluralResolver.getSuffix(g,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)||(o=E,r=this.getResource(g,w,E,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}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 i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}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 i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.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),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.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"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):D(t)&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}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 Ow{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),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}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[o]=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(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Ec[i]-Ec[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Pc=(e,t,n,r=".",i=!0)=>{let o=yw(e,t,n);return!o&&i&&D(n)&&(o=Pl(e,n,r),o===void 0&&(o=Pl(t,n,r))),o},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:i,prefix:o,prefixEscaped:s,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:ww,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Xt(o):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=m||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,i){var y;let o,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,{...i,...n,interpolationkey:d}):h}const v=d.split(this.formatSeparator),w=v.shift().trim(),m=v.join(this.formatSeparator).trim();return this.format(Pc(n,a,w,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:w})};this.resetRegExp();const c=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((y=i==null?void 0:i.interpolation)==null?void 0:y.skipOnVariables)!==void 0?i.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;o=d.regex.exec(t);){const v=o[1].trim();if(s=u(v),s===void 0)if(typeof c=="function"){const m=c(t,o,i);s=D(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))s="";else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else!D(s)&&!this.useRawValueToEscape&&(s=gc(s));const w=d.safeValue(s);if(t=t.replace(o[0],w),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=o[0].length):d.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,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(;i=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(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(a=i[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),o=n(l.call(this,i[1].trim(),s),s),o&&i[0]===t&&!D(o))return o;D(o)||(o=gc(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),a.length&&(o=a.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const Rw=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.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,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let l=t[s];return l||(l=e(Hr(r),i),t[s]=l),l(n)}},_w=e=>(t,n,r)=>e(Hr(n),r)(t);class Lw{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:_w;this.formats={number:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o});return l=>s.format(l)}),currency:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o,style:"currency"});return l=>s.format(l)}),datetime:r((i,o)=>{const s=new Intl.DateTimeFormat(i,{...o});return l=>s.format(l)}),relativetime:r((i,o)=>{const s=new Intl.RelativeTimeFormat(i,{...o});return l=>s.format(l,o.range||"day")}),list:r((i,o)=>{const s=new Intl.ListFormat(i,{...o});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,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(a=>a.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,a)=>{var f;const{formatName:u,formatOptions:c}=Rw(a);if(this.formats[u]){let p=l;try{const y=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},d=y.locale||y.lng||i.locale||i.lng||r;p=this.formats[u](l,d,{...c,...i,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const Tw=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Nw extends Mo{constructor(t,n,r,i={}){var o,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=at.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(s=(o=this.backend)==null?void 0:o.init)==null||s.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},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),o[p]===void 0&&(o[p]=!0),a[f]===void 0&&(a[f]=!0)))}),c||(l[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,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=>{gw(a.loaded,[o],s),Tw(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,i=0,o=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,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&&i{this.read.call(this,t,n,r,i+1,o*2,s)},o);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={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.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("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,l),this.loaded(t,s,l)})}saveMissing(t,n,r,i,o,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:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let v;d.length===5?v=d(t,n,r,i,y):v=d(t,n,r,i),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,i,l,y)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}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},xi=()=>{},Aw=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},zp="__i18next_supportNoticeShown",Iw=()=>typeof globalThis<"u"&&!!globalThis[zp],Dw=()=>{typeof globalThis<"u"&&(globalThis[zp]=!0)},Fw=e=>{var t,n,r,i,o,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=(o=(i=e==null?void 0:e.modules)==null?void 0:i.backend)==null?void 0:o.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,m;return((v=d==null?void 0:d.name)==null?void 0:v.indexOf("Locize"))>0||((m=(w=d==null?void 0:d.constructor)==null?void 0:w.name)==null?void 0:m.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 Mo{constructor(t={},n){if(super(),this.options=_c(t),this.services={},this.logger=at,this.modules={external:[]},Aw(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&&!Fw(this)&&!Iw()&&(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 💙"),Dw());const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?at.init(i(this.modules.logger),this.options):at.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Lw;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 Ow(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=i(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 Nw(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new mo(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=xi),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=xi){var o,s;let r=n;const i=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.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)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),(s=(o=this.options.preload)==null?void 0:o.forEach)==null||s.call(o,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 i=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=xi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}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"&&jp.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 i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,a)=>{a?this.isLanguageChangingTo===t&&(i(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||i(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=>{o(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 i=(o,s,...l)=>{let a;typeof s!="object"?a=this.options.overloadTranslationOptionHandler([o,s].concat(l)):a={...s},a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||i.keyPrefix);const u={...this.options,...a},c=this.options.keySeparator||".";let f;return a.keyPrefix&&Array.isArray(o)?f=o.map(p=>(typeof p=="function"&&(p=Er(p,u)),`${a.keyPrefix}${c}${p}`)):(typeof o=="function"&&(o=Er(o,u)),f=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o),this.t(f,a)};return D(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}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],i=this.options?this.options.fallbackLng:!1,o=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)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=ar();return this.options.ns?(D(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ar();D(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.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=((o=this.services)==null?void 0:o.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=xi){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Cr(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},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),{});o.store=new Sc(l,i),o.services.resourceStore=o.store}if(t.interpolation){const a={...xs().interpolation,...this.options.interpolation,...t.interpolation},u={...i,interpolation:a};o.services.interpolator=new Oc(u)}return o.translator=new mo(o.services,i),o.translator.on("*",(l,...a)=>{o.emit(l,...a)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}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 jw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,$w={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},zw=e=>$w[e],Uw=e=>e.replace(jw,zw);let Ol={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Uw,transDefaultProps:void 0};const Mw=(e={})=>{Ol={...Ol,...e}},Q1=()=>Ol;let Up;const bw=e=>{Up=e},q1=()=>Up,Bw={type:"3rdParty",init(e){Mw(e.options.react),bw(e)}},{slice:Vw,forEach:Hw}=[];function Kw(e){return Hw.call(Vw.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Ww(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]+$/,Qw=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!Lc.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Lc.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Tc={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Qw(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const s=i.substring(1).split("&");for(let l=0;l0&&s[l].substring(0,a)===t&&(n=s[l].substring(a+1))}}return n}},Yw={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const s=o.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=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(i=l[typeof n=="number"?n:0])==null?void 0:i.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 Gw={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 Xw={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)}},Zw={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o0?t:void 0}},e1={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}},t1={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},n1={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Mp=!1;try{document.cookie,Mp=!0}catch{}const bp=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Mp||bp.splice(1,1);const r1=()=>({order:bp,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Bp{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=Kw(n,this.options||{},r1()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(qw),this.addDetector(Jw),this.addDetector(Gw),this.addDetector(Xw),this.addDetector(Zw),this.addDetector(e1),this.addDetector(t1),this.addDetector(n1),this.addDetector(Yw)}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 i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!Ww(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)}))}}Bp.type="languageDetector";const i1={"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"},o1={translation:i1},s1={"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 支付"},l1={translation:s1};Oe.use(Bp).use(Bw).init({load:"languageOnly",resources:{en:o1,zh:l1},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag","querystring"],caches:["localStorage"]}});Es.createRoot(document.getElementById("root")).render(I.jsx(ye.StrictMode,{children:I.jsx(wy,{children:I.jsx(X0,{children:I.jsxs(J0,{children:[I.jsx(pw,{}),I.jsx(cv,{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{q1 as A,a1 as L,np as N,cy as O,_1 as Q,Z0 as a,Gd as b,Gn as c,j1 as d,A1 as e,L1 as f,N1 as g,I1 as h,D1 as i,I as j,F1 as k,T1 as l,z1 as m,U1 as n,M1 as o,B1 as p,b1 as q,x as r,$1 as s,V1 as t,Y0 as u,H1 as v,K1 as w,W1 as x,Q1 as y,hs as z}; +`+o):r.stack=o}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:i,headers:o}=n;r!==void 0&&zi.assertOptions(r,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean),legacyInterceptorReqResOrdering:Be.transitional(Be.boolean)},!1),i!=null&&(S.isFunction(i)?n.paramsSerializer={serialize:i}:zi.assertOptions(i,{encode:Be.function,serialize:Be.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zi.assertOptions(n,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&S.merge(o.common,o[n.method]);o&&S.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=De.concat(s,o);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 o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{r.subscribe(l),o=l}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,l){r.reason||(r.reason=new ti(o,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(i){t=i}),cancel:t}}};function V0(e){return function(n){return e.apply(null,n)}}function H0(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(i){return Np(hn(e,i))},n}const re=Np(ei);re.Axios=an;re.CanceledError=ti;re.CancelToken=B0;re.isCancel=Ep;re.VERSION=Lp;re.toFormData=zo;re.AxiosError=A;re.Cancel=re.CanceledError;re.all=function(t){return Promise.all(t)};re.spread=V0;re.isAxiosError=H0;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:d1,AxiosError:p1,CanceledError:h1,isCancel:m1,CancelToken:g1,VERSION:y1,all:v1,Cancel:w1,isAxiosError:S1,spread:k1,toFormData:x1,AxiosHeaders:E1,HttpStatusCode:C1,formToJSON:P1,getAdapter:O1,mergeConfig:R1}=re,_1=5e5,Q=re.create({baseURL:"",timeout:3e4,withCredentials:!0,headers:{"Content-Type":"application/json"}});Q.interceptors.request.use(e=>{const t=localStorage.getItem("dist_user_id");return t&&(e.headers["New-Api-User"]=t),e});Q.interceptors.response.use(e=>(e.data&&e.data.success===!1&&e.data.message&&hs.error(e.data.message),e),e=>{var n,r,i;const t=((r=(n=e.response)==null?void 0:n.data)==null?void 0:r.message)||e.message||"Request failed";return((i=e.response)==null?void 0:i.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 K0=()=>Q.get("/api/dist/site/info"),L1=()=>Q.get("/api/dist/site/models"),T1=()=>Q.get("/api/dist/site/packages"),W0=e=>Q.post("/api/dist/user/register",e),Q0=e=>Q.post("/api/dist/user/login",e),q0=()=>Q.post("/api/dist/user/logout"),ws=()=>Q.get("/api/dist/user/self"),N1=()=>Q.get("/api/dist/user/usage"),A1=()=>Q.get("/api/dist/token/list"),I1=e=>Q.post("/api/dist/token/create",e),D1=(e,t)=>Q.put(`/api/dist/token/${e}`,t),F1=e=>Q.delete(`/api/dist/token/${e}`),j1=e=>Q.post("/api/dist/topup/redeem",{key:e}),$1=e=>Q.post("/api/dist/package/subscribe",{package_id:e}),z1=()=>Q.get("/api/dist/package/subscriptions"),U1=()=>Q.get("/api/dist/topup/info"),M1=e=>Q.post("/api/dist/topup/amount",e),b1=e=>Q.post("/api/dist/topup/pay",e),B1=e=>Q.post("/api/dist/topup/stripe/pay",e),V1=e=>Q.post("/api/dist/topup/creem/pay",e),H1=e=>Q.post("/api/dist/topup/crypto/pay",e),K1=e=>Q.get(`/api/dist/topup/crypto/status?trade_no=${e}`),W1=e=>Q.get("/api/dist/topup/history",{params:e}),Ap=x.createContext(null);function J0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0),o=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(()=>i(!1)):i(!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 W0(u);return c.data.success?{success:!0,needsLogin:!0}:{success:!1,message:c.data.message}},[]),a=x.useCallback(async()=>{try{await q0()}catch{}localStorage.removeItem("dist_user_id"),n(null)},[]);return I.jsx(Ap.Provider,{value:{user:t,loading:r,login:s,register:l,logout:a,refreshUser:o},children:e})}function Y0(){const e=x.useContext(Ap);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function G0(){const{user:e,loading:t}=Y0(),n=Gn();return t?I.jsx("div",{className:"flex items-center justify-center min-h-[50vh]",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})}):e?I.jsx(cy,{}):I.jsx(np,{to:"/login",state:{from:n},replace:!0})}const Ip=x.createContext(null);function X0({children:e}){const[t,n]=x.useState(null),[r,i]=x.useState(!0);return x.useEffect(()=>{K0().then(o=>{var s,l;if(o.data.success&&(n(o.data.data),(s=o.data.data)!=null&&s.name&&(document.title=o.data.data.name),(l=o.data.data)!=null&&l.favicon)){const a=document.querySelector("link[rel~='icon']")||document.createElement("link");a.rel="icon",a.href=o.data.data.favicon,document.head.appendChild(a)}}).catch(()=>{}).finally(()=>i(!1))},[]),I.jsx(Ip.Provider,{value:{site:t,loading:r},children:e})}function Z0(){const e=x.useContext(Ip);if(!e)throw new Error("useSite must be used within SiteProvider");return e}const Dp=x.createContext(null),mc={starter:{Home:ye.lazy(()=>ee(()=>import("./Home-qfwynDF2.js"),__vite__mapDeps([0,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-0cB1qtYA.js"),__vite__mapDeps([5,6,4])))},default:{Home:ye.lazy(()=>ee(()=>import("./Home-BuJm_vIH.js"),__vite__mapDeps([7,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-D-Bm8TiX.js"),__vite__mapDeps([8,6,4])))},dark:{Home:ye.lazy(()=>ee(()=>import("./Home-Biz_0NAt.js"),__vite__mapDeps([9,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-DmqKjR6M.js"),__vite__mapDeps([10,6,4])))},minimal:{Home:ye.lazy(()=>ee(()=>import("./Home-BofCv9GQ.js"),__vite__mapDeps([11,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-BCQLwwoq.js"),__vite__mapDeps([12,6,4])))},clean:{Home:ye.lazy(()=>ee(()=>import("./Home-zDwhMuTN.js"),__vite__mapDeps([13,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-2sjWYmyT.js"),__vite__mapDeps([14,6,4])))},corporate:{Home:ye.lazy(()=>ee(()=>import("./Home-hgWoWuW8.js"),__vite__mapDeps([15,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-qJz07ANC.js"),__vite__mapDeps([16,6,4])))},claude:{Home:ye.lazy(()=>ee(()=>import("./Home-B_aQfVX_.js"),__vite__mapDeps([17,1,2,3,4]))),Layout:ye.lazy(()=>ee(()=>import("./Layout-NO9JLeRC.js"),__vite__mapDeps([18,6,4])))}};function ew(){return I.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gray-950",children:I.jsx("div",{className:"w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full animate-spin"})})}function tw({children:e}){const{site:t,loading:n}=Z0();if(n)return I.jsx(ew,{});const r=(t==null?void 0:t.theme_template)||"starter";return I.jsx(nw,{themeName:r,children:e})}function nw({themeName:e,children:t}){const n=x.useMemo(()=>{const r=mc[e]||mc.starter;return{name:e,...r}},[e]);return I.jsx(Dp.Provider,{value:n,children:t})}function rw(){const e=x.useContext(Dp);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const iw=x.lazy(()=>ee(()=>import("./Login-B-uSRrNm.js"),__vite__mapDeps([19,4]))),ow=x.lazy(()=>ee(()=>import("./Register-Cqb3fCW-.js"),__vite__mapDeps([20,4]))),sw=x.lazy(()=>ee(()=>import("./Dashboard-sLmY72mU.js"),__vite__mapDeps([21,2,4]))),lw=x.lazy(()=>ee(()=>import("./Tokens-C1-BGu0J.js"),__vite__mapDeps([22,4]))),aw=x.lazy(()=>ee(()=>import("./Packages-CTK12U-8.js"),__vite__mapDeps([23,1,4]))),uw=x.lazy(()=>ee(()=>import("./Pricing-DcAHcsau.js"),__vite__mapDeps([24,4]))),cw=x.lazy(()=>ee(()=>import("./Topup-CS3pbNbp.js"),__vite__mapDeps([25,2,4]))),fw=()=>I.jsx("div",{className:"flex items-center justify-center min-h-screen",children:I.jsx("div",{className:"w-8 h-8 border-2 border-brand-500/30 border-t-brand-500 rounded-full animate-spin"})});function dw(){const{Home:e,Layout:t}=rw();return I.jsx(x.Suspense,{fallback:I.jsx(fw,{}),children:I.jsxs(dy,{children:[I.jsxs(Ve,{element:I.jsx(t,{}),children:[I.jsx(Ve,{path:"/",element:I.jsx(e,{})}),I.jsx(Ve,{path:"/pricing",element:I.jsx(uw,{})}),I.jsx(Ve,{path:"/packages",element:I.jsx(aw,{})}),I.jsx(Ve,{path:"/login",element:I.jsx(iw,{})}),I.jsx(Ve,{path:"/register",element:I.jsx(ow,{})}),I.jsxs(Ve,{element:I.jsx(G0,{}),children:[I.jsx(Ve,{path:"/dashboard",element:I.jsx(sw,{})}),I.jsx(Ve,{path:"/tokens",element:I.jsx(lw,{})}),I.jsx(Ve,{path:"/topup",element:I.jsx(cw,{})})]})]}),I.jsx(Ve,{path:"*",element:I.jsx(np,{to:"/",replace:!0})})]})})}function pw(){return I.jsx(tw,{children:I.jsx(dw,{})})}const D=e=>typeof e=="string",ar=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},gc=e=>e==null?"":""+e,hw=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},mw=/###/g,yc=e=>e&&e.indexOf("###")>-1?e.replace(mw,"."):e,vc=e=>!e||D(e),xr=(e,t,n)=>{const r=D(t)?t.split("."):t;let i=0;for(;i{const{obj:r,k:i}=xr(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],s=t.slice(0,t.length-1),l=xr(e,s,Object);for(;l.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),l=xr(e,s,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},gw=(e,t,n,r)=>{const{obj:i,k:o}=xr(e,t,Object);i[o]=i[o]||[],i[o].push(n)},po=(e,t)=>{const{obj:n,k:r}=xr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},yw=(e,t,n)=>{const r=po(e,n);return r!==void 0?r:po(t,n)},Fp=(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]):Fp(e[r],t[r],n):e[r]=t[r]);return e},Xt=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vw={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ww=e=>D(e)?e.replace(/[&<>"'\/]/g,t=>vw[t]):e;class Sw{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 kw=[" ",",","?","!",";"],xw=new Sw(20),Ew=(e,t,n)=>{t=t||"",n=n||"";const r=kw.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=xw.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o},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 i=e;for(let o=0;o-1&&ae==null?void 0:e.replace(/_/g,"-"),Cw={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 ho{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Cw,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,i){return i&&!this.debug?null:(D(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new ho(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ho(this.logger,t)}}var at=new ho;class Mo{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+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(([i,o])=>{for(let s=0;s{for(let s=0;s-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var u,c;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):D(r)&&o?l.push(...r.split(o)):l.push(r)));const a=po(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,o)}addResource(t,n,r,i,o={silent:!1}){const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),wc(this.data,l,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(D(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,s={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let a=po(this.data,l)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Fp(a,r,o):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(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var jp={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var s;t=((s=this.processors[o])==null?void 0:s.process(t,n,r,i))??t}),t}};const $p=Symbol("i18next/PATH_KEY");function Pw(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===$p?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Er(e,t){const{[$p]:n}=e(Pw()),r=(t==null?void 0:t.keySeparator)??".",i=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&i){const o=t==null?void 0:t.ns,s=Array.isArray(o)?o:null;if(s&&s.length>1&&s.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const kc={},Ss=e=>!D(e)&&typeof e!="boolean"&&typeof e!="number";class mo extends Mo{constructor(t,n={}){super(),hw(["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 i=this.resolve(t,r);if((i==null?void 0:i.res)===void 0)return!1;const o=Ss(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ew(t,r,i);if(s&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:D(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:D(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Er(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(V=>typeof V=="function"?Er(V,{...this.options,...i}):String(V));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:a}=this.extractFromKey(t[t.length-1],i),u=a[a.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const f=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return p?o?{res:`${u}${c}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:l;const y=this.resolve(t,i);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,m=["[object Number]","[object Function]","[object RegExp]"],h=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!D(i.count),E=mo.hasDefaultValue(i),R=k?this.pluralResolver.getSuffix(f,i.count,i):"",P=i.ordinal&&k?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",L=k&&!i.ordinal&&i.count===0,$=L&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${R}`]||i[`defaultValue${P}`]||i.defaultValue;let T=d;g&&!d&&E&&(T=$);const pe=Ss(T),be=Object.prototype.toString.apply(T);if(g&&T&&pe&&m.indexOf(be)<0&&!(D(h)&&Array.isArray(T))){if(!i.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,{...i,ns:a}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=V,y.usedParams=this.getUsedParamsDetails(i),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,{...i,defaultValue:Ss($)?$[b]:void 0,joinArrays:!1,ns:a}):X[b]=this.translate(he,{...i,joinArrays:!1,ns:a}),X[b]===he&&(X[b]=T[b])}d=X}}else if(g&&D(h)&&Array.isArray(d))d=d.join(h),d&&(d=this.extendTranslation(d,t,i,r));else{let V=!1,X=!1;!this.isValidLookup(d)&&E&&(V=!0,d=$),this.isValidLookup(d)||(X=!0,d=l);const b=(i.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,{...i,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,i.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,i):(ft=this.backendConnector)!=null&&ft.saveMissing&&this.backendConnector.saveMissing(F,u,U,ke,he,i),this.emit("missingKey",F,u,U,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?O.forEach(F=>{const U=this.pluralResolver.getSuffixes(F,i);L&&i[`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,i[`defaultValue${Re}`]||$)})}):j(O,l,$))}d=this.extendTranslation(d,t,i,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,i))}return o?(y.res=d,y.usedParams=this.getUsedParamsDetails(i),y):d}extendTranslation(t,n,r,i,o){var a,u;if((a=this.i18nFormat)!=null&&a.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});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||i.usedLng,r),c){const y=t.match(this.interpolator.nestingRegexp),d=y&&y.length;f(o==null?void 0:o[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=jp.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,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;i=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 m,h;this.isValidLookup(r)||(l=w,!kc[`${v[0]}-${w}`]&&((m=this.utils)!=null&&m.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(l))&&(kc[`${v[0]}-${w}`]=!0,this.logger.warn(`key "${i}" 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(g=>{var R;if(this.isValidLookup(r))return;s=g;const k=[c];if((R=this.i18nFormat)!=null&&R.addLookupKeys)this.i18nFormat.addLookupKeys(k,c,g,w,n);else{let P;p&&(P=this.pluralResolver.getSuffix(g,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)||(o=E,r=this.getResource(g,w,E,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}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 i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}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 i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.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),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.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"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):D(t)&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}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 Ow{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),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}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[o]=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(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Ec[i]-Ec[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Pc=(e,t,n,r=".",i=!0)=>{let o=yw(e,t,n);return!o&&i&&D(n)&&(o=Pl(e,n,r),o===void 0&&(o=Pl(t,n,r))),o},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:i,prefix:o,prefixEscaped:s,suffix:l,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:y,nestingSuffix:d,nestingSuffixEscaped:v,nestingOptionsSeparator:w,maxReplaces:m,alwaysFormat:h}=t.interpolation;this.escape=n!==void 0?n:ww,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Xt(o):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=m||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,i){var y;let o,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,{...i,...n,interpolationkey:d}):h}const v=d.split(this.formatSeparator),w=v.shift().trim(),m=v.join(this.formatSeparator).trim();return this.format(Pc(n,a,w,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...i,...n,interpolationkey:w})};this.resetRegExp();const c=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((y=i==null?void 0:i.interpolation)==null?void 0:y.skipOnVariables)!==void 0?i.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;o=d.regex.exec(t);){const v=o[1].trim();if(s=u(v),s===void 0)if(typeof c=="function"){const m=c(t,o,i);s=D(m)?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))s="";else if(f){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else!D(s)&&!this.useRawValueToEscape&&(s=gc(s));const w=d.safeValue(s);if(t=t.replace(o[0],w),f?(d.regex.lastIndex+=s.length,d.regex.lastIndex-=o[0].length):d.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,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(;i=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(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(a=i[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),o=n(l.call(this,i[1].trim(),s),s),o&&i[0]===t&&!D(o))return o;D(o)||(o=gc(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),a.length&&(o=a.reduce((c,f)=>this.format(c,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const Rw=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.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,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let l=t[s];return l||(l=e(Hr(r),i),t[s]=l),l(n)}},_w=e=>(t,n,r)=>e(Hr(n),r)(t);class Lw{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:_w;this.formats={number:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o});return l=>s.format(l)}),currency:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o,style:"currency"});return l=>s.format(l)}),datetime:r((i,o)=>{const s=new Intl.DateTimeFormat(i,{...o});return l=>s.format(l)}),relativetime:r((i,o)=>{const s=new Intl.RelativeTimeFormat(i,{...o});return l=>s.format(l,o.range||"day")}),list:r((i,o)=>{const s=new Intl.ListFormat(i,{...o});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,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(a=>a.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,a)=>{var f;const{formatName:u,formatOptions:c}=Rw(a);if(this.formats[u]){let p=l;try{const y=((f=i==null?void 0:i.formatParams)==null?void 0:f[i.interpolationkey])||{},d=y.locale||y.lng||i.locale||i.lng||r;p=this.formats[u](l,d,{...c,...i,...y})}catch(y){this.logger.warn(y)}return p}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const Tw=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Nw extends Mo{constructor(t,n,r,i={}){var o,s;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=at.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(s=(o=this.backend)==null?void 0:o.init)==null||s.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},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),o[p]===void 0&&(o[p]=!0),a[f]===void 0&&(a[f]=!0)))}),c||(l[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),!n&&r&&this.store.addResourceBundle(o,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=>{gw(a.loaded,[o],s),Tw(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,i=0,o=this.retryTimeout,s){if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,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&&i{this.read.call(this,t,n,r,i+1,o*2,s)},o);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={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();D(t)&&(t=this.languageUtils.toResolveHierarchy(t)),D(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.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("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,l),this.loaded(t,s,l)})}saveMissing(t,n,r,i,o,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:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let v;d.length===5?v=d(t,n,r,i,y):v=d(t,n,r,i),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,i,l,y)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}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},xi=()=>{},Aw=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},zp="__i18next_supportNoticeShown",Iw=()=>typeof globalThis<"u"&&!!globalThis[zp],Dw=()=>{typeof globalThis<"u"&&(globalThis[zp]=!0)},Fw=e=>{var t,n,r,i,o,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=(o=(i=e==null?void 0:e.modules)==null?void 0:i.backend)==null?void 0:o.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,m;return((v=d==null?void 0:d.name)==null?void 0:v.indexOf("Locize"))>0||((m=(w=d==null?void 0:d.constructor)==null?void 0:w.name)==null?void 0:m.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 Mo{constructor(t={},n){if(super(),this.options=_c(t),this.services={},this.logger=at,this.modules={external:[]},Aw(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&&!Fw(this)&&!Iw()&&(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 💙"),Dw());const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?at.init(i(this.modules.logger),this.options):at.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Lw;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 Ow(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=i(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 Nw(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(y,...d)=>{this.emit(y,...d)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new mo(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=xi),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=xi){var o,s;let r=n;const i=D(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.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)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),(s=(o=this.options.preload)==null?void 0:o.forEach)==null||s.call(o,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 i=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=xi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}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"&&jp.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 i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,a)=>{a?this.isLanguageChangingTo===t&&(i(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||i(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=>{o(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 i=(o,s,...l)=>{let a;typeof s!="object"?a=this.options.overloadTranslationOptionHandler([o,s].concat(l)):a={...s},a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==""&&(a.keyPrefix=a.keyPrefix||r||i.keyPrefix);const u={...this.options,...a},c=this.options.keySeparator||".";let f;return a.keyPrefix&&Array.isArray(o)?f=o.map(p=>(typeof p=="function"&&(p=Er(p,u)),`${a.keyPrefix}${c}${p}`)):(typeof o=="function"&&(o=Er(o,u)),f=a.keyPrefix?`${a.keyPrefix}${c}${o}`:o),this.t(f,a)};return D(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}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],i=this.options?this.options.fallbackLng:!1,o=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)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=ar();return this.options.ns?(D(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ar();D(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.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=((o=this.services)==null?void 0:o.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=xi){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Cr(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},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),{});o.store=new Sc(l,i),o.services.resourceStore=o.store}if(t.interpolation){const a={...xs().interpolation,...this.options.interpolation,...t.interpolation},u={...i,interpolation:a};o.services.interpolator=new Oc(u)}return o.translator=new mo(o.services,i),o.translator.on("*",(l,...a)=>{o.emit(l,...a)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}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 jw=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,$w={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},zw=e=>$w[e],Uw=e=>e.replace(jw,zw);let Ol={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Uw,transDefaultProps:void 0};const Mw=(e={})=>{Ol={...Ol,...e}},Q1=()=>Ol;let Up;const bw=e=>{Up=e},q1=()=>Up,Bw={type:"3rdParty",init(e){Mw(e.options.react),bw(e)}},{slice:Vw,forEach:Hw}=[];function Kw(e){return Hw.call(Vw.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Ww(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]+$/,Qw=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!Lc.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Lc.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Tc={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Qw(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const s=i.substring(1).split("&");for(let l=0;l0&&s[l].substring(0,a)===t&&(n=s[l].substring(a+1))}}return n}},Yw={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const s=o.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=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(i=l[typeof n=="number"?n:0])==null?void 0:i.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 Gw={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 Xw={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)}},Zw={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o0?t:void 0}},e1={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}},t1={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},n1={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Mp=!1;try{document.cookie,Mp=!0}catch{}const bp=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Mp||bp.splice(1,1);const r1=()=>({order:bp,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Bp{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=Kw(n,this.options||{},r1()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(qw),this.addDetector(Jw),this.addDetector(Gw),this.addDetector(Xw),this.addDetector(Zw),this.addDetector(e1),this.addDetector(t1),this.addDetector(n1),this.addDetector(Yw)}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 i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!Ww(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)}))}}Bp.type="languageDetector";const i1={"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"},o1={translation:i1},s1={"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 支付"},l1={translation:s1};Oe.use(Bp).use(Bw).init({load:"languageOnly",resources:{en:o1,zh:l1},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag","querystring"],caches:["localStorage"]}});Es.createRoot(document.getElementById("root")).render(I.jsx(ye.StrictMode,{children:I.jsx(wy,{children:I.jsx(X0,{children:I.jsxs(J0,{children:[I.jsx(pw,{}),I.jsx(cv,{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{q1 as A,a1 as L,np as N,cy as O,_1 as Q,Z0 as a,Gd as b,Gn as c,j1 as d,A1 as e,L1 as f,N1 as g,I1 as h,D1 as i,I as j,F1 as k,T1 as l,z1 as m,U1 as n,M1 as o,B1 as p,b1 as q,x as r,$1 as s,V1 as t,Y0 as u,H1 as v,K1 as w,W1 as x,Q1 as y,hs as z}; diff --git a/dist/assets/useTranslation-kIlHvV5e.js b/dist/assets/useTranslation-D_OVvIX9.js similarity index 98% rename from dist/assets/useTranslation-kIlHvV5e.js rename to dist/assets/useTranslation-D_OVvIX9.js index 61cc4c0..ba6ce84 100644 --- a/dist/assets/useTranslation-kIlHvV5e.js +++ b/dist/assets/useTranslation-D_OVvIX9.js @@ -1,4 +1,4 @@ -import{r as l,y as q,A as B}from"./index-C1LcEmdp.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,y as q,A as B}from"./index-D8eKls75.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 e21d210..5cbfd0c 100644 --- a/dist/index.html +++ b/dist/index.html @@ -7,7 +7,7 @@ AI Platform - + diff --git a/src/utils/officialEquiv.js b/src/utils/officialEquiv.js index 3c28ddb..506f44f 100644 --- a/src/utils/officialEquiv.js +++ b/src/utils/officialEquiv.js @@ -1,31 +1,48 @@ import { Q } from '../api'; -// Official prices (input $/1M tokens) for reference models +// Official prices (input $/1M tokens) for reference models. +// These are the REAL official API prices from Anthropic, OpenAI, Google etc. +// IMPORTANT: More specific patterns MUST come before less specific ones +// (e.g. "claude-opus-4-5" before "claude-opus-4") to avoid false matches. +// Patterns must match actual backend model_name format (e.g. "claude-opus-4-5-20251101"). const OFFICIAL_PRICES = [ - // Claude - { pattern: 'claude-4-sonnet', label: 'Claude Sonnet 4', inputPerMtok: 3 }, - { pattern: 'claude-sonnet-4', label: 'Claude Sonnet 4', inputPerMtok: 3 }, - { pattern: 'claude-4.5-sonnet', label: 'Claude 4.5 Sonnet', inputPerMtok: 3 }, - { pattern: 'claude-4.6-sonnet', label: 'Claude 4.6 Sonnet', inputPerMtok: 3 }, - { pattern: 'claude-4-opus', label: 'Claude Opus 4', inputPerMtok: 15 }, + // Claude — order matters: longer/more-specific first + { 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-4.1-opus', label: 'Claude Opus 4.1', inputPerMtok: 15 }, - { pattern: 'claude-4.5-opus', label: 'Claude Opus 4.5', inputPerMtok: 5 }, - { pattern: 'claude-4.6-opus', label: 'Claude Opus 4.6', inputPerMtok: 5 }, - { pattern: 'claude-3.5-haiku', label: 'Claude 3.5 Haiku', inputPerMtok: 0.8 }, + { 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: 0.8 }, - // OpenAI - { pattern: 'gpt-5.1', label: 'GPT-5.1', inputPerMtok: 1.25 }, - { pattern: 'gpt-5.2', label: 'GPT-5.2', inputPerMtok: 1.75 }, - { pattern: 'gpt-5.3', label: 'GPT-5.3', inputPerMtok: 1.75 }, - { pattern: 'gpt-5.4', label: 'GPT-5.4', inputPerMtok: 2.5 }, + { pattern: 'claude-3-haiku', label: 'Claude 3 Haiku', inputPerMtok: 0.25 }, + // OpenAI — more specific first + { pattern: 'gpt-4o-mini', label: 'GPT-4o Mini', inputPerMtok: 0.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: 0.4 }, + { pattern: 'gpt-4.1-nano', label: 'GPT-4.1 Nano', inputPerMtok: 0.1 }, { pattern: 'gpt-4.1', label: 'GPT-4.1', inputPerMtok: 2 }, - // Gemini - { pattern: 'gemini-2.5-pro', label: 'Gemini 2.5 Pro', inputPerMtok: 1.25 }, + { 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 }, + // Gemini — more specific first + { pattern: 'gemini-2.5-flash-lite', label: 'Gemini 2.5 Flash Lite', inputPerMtok: 0.04 }, { pattern: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', inputPerMtok: 0.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: 0.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: 0.075 }, + // DeepSeek + { pattern: 'deepseek-r1', label: 'DeepSeek R1', inputPerMtok: 0.55 }, + { pattern: 'deepseek-chat', label: 'DeepSeek V3', inputPerMtok: 0.27 }, + { pattern: 'deepseek-v3', label: 'DeepSeek V3', inputPerMtok: 0.27 }, ]; /**