vendor: 14,760 bytes, line 1
1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74081,e=>{"use strict";let t,r;var s,a,n,l,o,i=e.i(43476),d=e.i(71645),c=e.i(75254);let u=(0,c.default)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),h=(0,c.default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),m=(0,c.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var g=e.i(74886),x=e.i(43531),f=e.i(39312);let p=(0,c.default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),y=(0,c.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var b=e.i(52754);let w=(0,c.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),j=(0,c.default)("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);e.i(85269);var N=e.i(22831),v=e.i(42783),C=e.i(37362),E=e.i(55057),M=e.i(37016),R=Object.defineProperty,S=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,A=(e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F=(e,t)=>{for(var r in t||(t={}))k.call(t,r)&&A(e,r,t[r]);if(S)for(var r of S(t))T.call(t,r)&&A(e,r,t[r]);return e},_=(e,t)=>{var r={};for(var s in e)k.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&S)for(var s of S(e))0>t.indexOf(s)&&T.call(e,s)&&(r[s]=e[s]);return r};(e=>{let t=class t{constructor(e,r,s,n){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version value out of range");if(n<-1||n>7)throw RangeError("Mask value out of range");this.size=4*e+17;let l=[];for(let e=0;e<this.size;e++)l.push(!1);for(let e=0;e<this.size;e++)this.modules.push(l.slice()),this.isFunction.push(l.slice());this.drawFunctionPatterns();const o=this.addEccAndInterleave(s);if(this.drawCodewords(o),-1==n){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const r=this.getPenaltyScore();r<e&&(n=t,e=r),this.applyMask(t)}}a(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}static encodeText(r,s){let a=e.QrSegment.makeSegments(r);return t.encodeSegments(a,s)}static encodeBinary(r,s){let a=e.QrSegment.makeBytes(r);return t.encodeSegments([a],s)}static encodeSegments(e,s,n=1,o=40,i=-1,d=!0){let c,u;if(!(t.MIN_VERSION<=n&&n<=o&&o<=t.MAX_VERSION)||i<-1||i>7)throw RangeError("Invalid value");for(c=n;;c++){let r=8*t.getNumDataCodewords(c,s),a=l.getTotalBits(e,c);if(a<=r){u=a;break}if(c>=o)throw RangeError("Data too long")}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])d&&u<=8*t.getNumDataCodewords(c,e)&&(s=e);let h=[];for(let t of e)for(let e of(r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(c),h),t.getData()))h.push(e);a(h.length==u);let m=8*t.getNumDataCodewords(c,s);a(h.length<=m),r(0,Math.min(4,m-h.length),h),r(0,(8-h.length%8)%8,h),a(h.length%8==0);for(let e=236;h.length<m;e^=253)r(e,8,h);let g=[];for(;8*g.length<h.length;)g.push(0);return h.forEach((e,t)=>g[t>>>3]|=e<<7-(7&t)),new t(c,s,g,i)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let r=0;r<t;r++)for(let s=0;s<t;s++)(0!=r||0!=s)&&(0!=r||s!=t-1)&&(r!=t-1||0!=s)&&this.drawAlignmentPattern(e[r],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,r=t;for(let e=0;e<10;e++)r=r<<1^(r>>>9)*1335;let n=(t<<10|r)^21522;a(n>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,s(n,e));this.setFunctionModule(8,7,s(n,6)),this.setFunctionModule(8,8,s(n,7)),this.setFunctionModule(7,8,s(n,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,s(n,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,s(n,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,s(n,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;a(t>>>18==0);for(let e=0;e<18;e++){let r=s(t,e),a=this.size-11+e%3,n=Math.floor(e/3);this.setFunctionModule(a,n,r),this.setFunctionModule(n,a,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let s=-4;s<=4;s++){let a=Math.max(Math.abs(s),Math.abs(r)),n=e+s,l=t+r;0<=n&&n<this.size&&0<=l&&l<this.size&&this.setFunctionModule(n,l,2!=a&&4!=a)}}drawAlignmentPattern(e,t){for(let r=-2;r<=2;r++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+r,1!=Math.max(Math.abs(s),Math.abs(r)))}setFunctionModule(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0}addEccAndInterleave(e){let r=this.version,s=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(r,s))throw RangeError("Invalid argument");let n=t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][r],l=t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][r],o=Math.floor(t.getNumRawDataModules(r)/8),i=n-o%n,d=Math.floor(o/n),c=[],u=t.reedSolomonComputeDivisor(l);for(let r=0,s=0;r<n;r++){let a=e.slice(s,s+d-l+(r<i?0:1));s+=a.length;let n=t.reedSolomonComputeRemainder(a,u);r<i&&a.push(0),c.push(a.concat(n))}let h=[];for(let e=0;e<c[0].length;e++)c.forEach((t,r)=>{(e!=d-l||r>=i)&&h.push(t[e])});return a(h.length==o),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let a=0;a<this.size;a++)for(let n=0;n<2;n++){let l=t-n,o=(t+1&2)==0?this.size-1-a:a;!this.isFunction[o][l]&&r<8*e.length&&(this.modules[o][l]=s(e[r>>>3],7-(7&r)),r++)}}a(r==8*e.length)}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let r=0;r<this.size;r++){let s;switch(e){case 0:s=(r+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=r%3==0;break;case 3:s=(r+t)%3==0;break;case 4:s=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:s=r*t%2+r*t%3==0;break;case 6:s=(r*t%2+r*t%3)%2==0;break;case 7:s=((r+t)%2+r*t%3)%2==0;break;default:throw Error("Unreachable")}!this.isFunction[t][r]&&s&&(this.modules[t][r]=!this.modules[t][r])}}getPenaltyScore(){let e=0;for(let r=0;r<this.size;r++){let s=!1,a=0,n=[0,0,0,0,0,0,0];for(let l=0;l<this.size;l++)this.modules[r][l]==s?5==++a?e+=t.PENALTY_N1:a>5&&e++:(this.finderPenaltyAddHistory(a,n),s||(e+=this.finderPenaltyCountPatterns(n)*t.PENALTY_N3),s=this.modules[r][l],a=1);e+=this.finderPenaltyTerminateAndCount(s,a,n)*t.PENALTY_N3}for(let r=0;r<this.size;r++){let s=!1,a=0,n=[0,0,0,0,0,0,0];for(let l=0;l<this.size;l++)this.modules[l][r]==s?5==++a?e+=t.PENALTY_N1:a>5&&e++:(this.finderPenaltyAddHistory(a,n),s||(e+=this.finderPenaltyCountPatterns(n)*t.PENALTY_N3),s=this.modules[l][r],a=1);e+=this.finderPenaltyTerminateAndCount(s,a,n)*t.PENALTY_N3}for(let r=0;r<this.size-1;r++)for(let s=0;s<this.size-1;s++){let a=this.modules[r][s];a==this.modules[r][s+1]&&a==this.modules[r+1][s]&&a==this.modules[r+1][s+1]&&(e+=t.PENALTY_N2)}let r=0;for(let e of this.modules)r=e.reduce((e,t)=>e+ +!!t,r);let s=this.size*this.size,n=Math.ceil(Math.abs(20*r-10*s)/s)-1;return a(0<=n&&n<=9),a(0<=(e+=n*t.PENALTY_N4)&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{let e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),r=[6];for(let s=this.size-7;r.length<e;s-=t)r.splice(1,0,s);return r}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return a(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError("Degree out of range");let r=[];for(let t=0;t<e-1;t++)r.push(0);r.push(1);let s=1;for(let a=0;a<e;a++){for(let e=0;e<r.length;e++)r[e]=t.reedSolomonMultiply(r[e],s),e+1<r.length&&(r[e]^=r[e+1]);s=t.reedSolomonMultiply(s,2)}return r}static reedSolomonComputeRemainder(e,r){let s=r.map(e=>0);for(let a of e){let e=a^s.shift();s.push(0),r.forEach((r,a)=>s[a]^=t.reedSolomonMultiply(r,e))}return s}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let r=0;for(let s=7;s>=0;s--)r=r<<1^(r>>>7)*285^(t>>>s&1)*e;return a(r>>>8==0),r}finderPenaltyCountPatterns(e){let t=e[1];a(t<=3*this.size);let r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function r(e,t,r){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let s=t-1;s>=0;s--)r.push(e>>>s&1)}function s(e,t){return(e>>>t&1)!=0}function a(e){if(!e)throw Error("Assertion error")}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;let n=class e{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(t){let s=[];for(let e of t)r(e,8,s);return new e(e.Mode.BYTE,t.length,s)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError("String contains non-numeric characters");let s=[];for(let e=0;e<t.length;){let a=Math.min(t.length-e,3);r(parseInt(t.substring(e,e+a),10),3*a+1,s),e+=a}return new e(e.Mode.NUMERIC,t.length,s)}static makeAlphanumeric(t){let s;if(!e.isAlphanumeric(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let a=[];for(s=0;s+2<=t.length;s+=2){let n=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(s));r(n+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(s+1)),11,a)}return s<t.length&&r(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(s)),6,a),new e(e.Mode.ALPHANUMERIC,t.length,a)}static makeSegments(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let s=[];if(t<0)throw RangeError("ECI assignment value out of range");if(t<128)r(t,8,s);else if(t<16384)r(2,2,s),r(t,14,s);else if(t<1e6)r(6,3,s),r(t,21,s);else throw RangeError("ECI assignment value out of range");return new e(e.Mode.ECI,0,s)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let r=0;for(let s of e){let e=s.mode.numCharCountBits(t);if(s.numChars>=1<<e)return 1/0;r+=4+e+s.bitData.length}return r}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t}};n.NUMERIC_REGEX=/^[0-9]*$/,n.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,n.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let l=n;e.QrSegment=n})(o||(o={})),a=(s=o||(o={})).QrCode||(s.QrCode={}),(t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}}).LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),a.Ecc=t,l=(n=o||(o={})).QrSegment||(n.QrSegment={}),(r=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}}).NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),l.Mode=r;var U=o,P={L:U.QrCode.Ecc.LOW,M:U.QrCode.Ecc.MEDIUM,Q:U.QrCode.Ecc.QUARTILE,H:U.QrCode.Ecc.HIGH},O="#FFFFFF",z="#000000";function L(e,t=0){let r=[];return e.forEach(function(e,s){let a=null;e.forEach(function(n,l){if(!n&&null!==a){r.push(`M${a+t} ${s+t}h${l-a}v1H${a+t}z`),a=null;return}if(l===e.length-1){if(!n)return;null===a?r.push(`M${l+t},${s+t} h1v1H${l+t}z`):r.push(`M${a+t},${s+t} h${l+1-a}v1H${a+t}z`);return}n&&null===a&&(a=l)})}),r.join("")}function I(e,t){return e.slice().map((e,r)=>r<t.y||r>=t.y+t.h?e:e.map((e,r)=>(r<t.x||r>=t.x+t.w)&&e))}function D({value:e,level:t,minVersion:r,includeMargin:s,marginSize:a,imageSettings:n,size:l,boostLevel:o}){let i=d.default.useMemo(()=>{let s=(Array.isArray(e)?e:[e]).reduce((e,t)=>
1(e.push(...U.QrSegment.makeSegments(t)),e),[]);return U.QrCode.encodeSegments(s,P[t],r,void 0,void 0,o)},[e,t,r,o]),{cells:c,margin:u,numCells:h,calculatedImageSettings:m}=d.default.useMemo(()=>{let e=i.getModules(),t=null!=a?Math.max(Math.floor(a),0):4*!!s,r=e.length+2*t,o=function(e,t,r,s){if(null==s)return null;let a=e.length+2*r,n=Math.floor(.1*t),l=a/t,o=(s.width||n)*l,i=(s.height||n)*l,d=null==s.x?e.length/2-o/2:s.x*l,c=null==s.y?e.length/2-i/2:s.y*l,u=null==s.opacity?1:s.opacity,h=null;if(s.excavate){let e=Math.floor(d),t=Math.floor(c),r=Math.ceil(o+d-e),s=Math.ceil(i+c-t);h={x:e,y:t,w:r,h:s}}return{x:d,y:c,h:i,w:o,excavation:h,opacity:u,crossOrigin:s.crossOrigin}}(e,l,t,n);return{cells:e,margin:t,numCells:r,calculatedImageSettings:o}},[i,l,n,s,a]);return{qrcode:i,margin:u,cells:c,numCells:h,calculatedImageSettings:m}}var $=function(){try{new Path2D().addPath(new Path2D)}catch(e){return!1}return!0}();d.default.forwardRef(function(e,t){let{value:r,size:s=128,level:a="L",bgColor:n=O,fgColor:l=z,includeMargin:o=!1,minVersion:i=1,boostLevel:c,marginSize:u,imageSettings:h}=e,m=_(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:g}=m,x=_(m,["style"]),f=null==h?void 0:h.src,p=d.default.useRef(null),y=d.default.useRef(null),b=d.default.useCallback(e=>{p.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]),[w,j]=d.default.useState(!1),{margin:N,cells:v,numCells:C,calculatedImageSettings:E}=D({value:r,level:a,minVersion:i,boostLevel:c,includeMargin:o,marginSize:u,imageSettings:h,size:s});d.default.useEffect(()=>{if(null!=p.current){let e=p.current,t=e.getContext("2d");if(!t)return;let r=v,a=y.current,o=null!=E&&null!==a&&a.complete&&0!==a.naturalHeight&&0!==a.naturalWidth;o&&null!=E.excavation&&(r=I(v,E.excavation));let i=window.devicePixelRatio||1;e.height=e.width=s*i;let d=s/C*i;t.scale(d,d),t.fillStyle=n,t.fillRect(0,0,C,C),t.fillStyle=l,$?t.fill(new Path2D(L(r,N))):v.forEach(function(e,r){e.forEach(function(e,s){e&&t.fillRect(s+N,r+N,1,1)})}),E&&(t.globalAlpha=E.opacity),o&&t.drawImage(a,E.x+N,E.y+N,E.w,E.h)}}),d.default.useEffect(()=>{j(!1)},[f]);let M=F({height:s,width:s},g),R=null;return null!=f&&(R=d.default.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{j(!0)},ref:y,crossOrigin:null==E?void 0:E.crossOrigin})),d.default.createElement(d.default.Fragment,null,d.default.createElement("canvas",F({style:M,height:s,width:s,ref:b,role:"img"},x)),R)}).displayName="QRCodeCanvas";var B=d.default.forwardRef(function(e,t){let{value:r,size:s=128,level:a="L",bgColor:n=O,fgColor:l=z,includeMargin:o=!1,minVersion:i=1,boostLevel:c,title:u,marginSize:h,imageSettings:m}=e,g=_(e,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:x,cells:f,numCells:p,calculatedImageSettings:y}=D({value:r,level:a,minVersion:i,boostLevel:c,includeMargin:o,marginSize:h,imageSettings:m,size:s}),b=f,w=null;null!=m&&null!=y&&(null!=y.excavation&&(b=I(f,y.excavation)),w=d.default.createElement("image",{href:m.src,height:y.h,width:y.w,x:y.x+x,y:y.y+x,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));let j=L(b,x);return d.default.createElement("svg",F({height:s,width:s,viewBox:`0 0 ${p} ${p}`,ref:t,role:"img"},g),!!u&&d.default.createElement("title",null,u),d.default.createElement("path",{fill:n,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),d.default.createElement("path",{fill:l,d:j,shapeRendering:"crispEdges"}),w)});B.displayName="QRCodeSVG";let H="TSVLtQdUr8yusn8QQfqFSuskvXSj34SR6e",V="TM3sC93hs7i45zWcMz3kLmuM9epaArdt3w",Q="TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t";e.s(["default",0,()=>{let e,{t}=(0,N.useTranslation)(),[r,s]=(0,d.useState)("usdt"),[a,n]=(0,d.useState)(!1),[l,o]=(0,d.useState)(0),[c,R]=(0,d.useState)(!1),[S,k]=(0,d.useState)("idle"),[T,A]=(0,d.useState)(""),[F,_]=(0,d.useState)(0),[U,P]=(0,d.useState)(!1),O=(0,d.useRef)(null),z=(0,d.useRef)(null),L=(0,d.useRef)(null),[I,D]=(0,d.useState)(""),[$,X]=(0,d.useState)(""),[Y,q]=(0,d.useState)(null),[W,K]=(0,d.useState)(!1),[G,Z]=(0,d.useState)(0),[J,ee]=(0,d.useState)(!1),[et,er]=(0,d.useState)(!1),[es,ea]=(0,d.useState)(null),[en,el]=(0,d.useState)([{status:"pending",message:t("energy.form.processing.steps.signEnergyRental")},{status:"pending",message:t("energy.form.processing.steps.processEnergyRental")},{status:"pending",message:t("energy.form.processing.steps.signUsdtTransfer")},{status:"pending",message:t("energy.form.processing.steps.completeUsdtTransfer")}]),[eo,ei]=(0,d.useState)("usdt"),[ed,ec]=(0,d.useState)(""),[eu,eh]=(0,d.useState)(null),[em,eg]=(0,d.useState)(!1),[ex,ef]=(0,d.useState)(""),ep="TModgWURHiZFcziiXmApoU1E67KVhW1Vmp",{wallet:ey,sendTransaction:eb}=(0,v.useTronWallet)(),{calculateCost:ew,loading:ej}=(0,C.useEnergyPrice)(),eN=ew(l),ev=ew(65e3),eC=ew(131e3),eE=l>=65e3;(0,d.useEffect)(()=>{let e=!1,t=async(r=0)=>{if(!ey.isConnected||!ey.address)return void Z(0);ee(!0);try{let t=window.tronWeb;if(t){let r=await t.contract().at(Q),s=await r.balanceOf(ey.address).call(),a=parseFloat(t.fromSun(s));e||Z(a)}}catch(n){let s=n instanceof Error&&("Network Error"===n.message||n.message.toLowerCase().includes("network")||"ER
1R_NETWORK"===n.code),a=n instanceof Error&&n.message.includes("429");if((s||a)&&r<5){let s=Math.min(2e3*Math.pow(2,r),16e3);console.warn(`USDT balance fetch ${a?"rate limited":"network error"}, retrying in ${s}ms (attempt ${r+1}/5)`),setTimeout(()=>{e||t(r+1)},s);return}e||(s||console.warn("Failed to fetch USDT balance:",n),Z(0))}finally{e||ee(!1)}},r=setTimeout(()=>t(),1e3);return()=>{e=!0,clearTimeout(r)}},[ey.isConnected,ey.address]),(0,d.useEffect)(()=>{let e=setTimeout(async()=>{if(!I||!ey.address||I.length<34){q(null),X(""),A("");return}er(!0),A("");try{if(G<2){A(t("energy.form.errors.insufficientUsdt",{required:2,current:G.toFixed(2)})),er(!1);return}let e=await fetch(`/api/estimate_usdt?from_address=${ey.address}&to_address=${I}`),r=await e.json();if(e.ok){if(G<r.total_cost){A(t("energy.form.errors.insufficientForService",{required:r.total_cost,available:G.toFixed(2)})),er(!1);return}q(r);let e=Math.max(0,G-r.total_cost-.01);e>0?X(e.toFixed(2)):(X("0"),A(t("energy.form.errors.cannotSend",{cost:r.total_cost,balance:G.toFixed(2)})))}else A(r.detail||t("energy.form.errors.networkError"))}catch(e){A(t("energy.form.errors.networkError"))}finally{er(!1)}},500);return()=>clearTimeout(e)},[I,ey.address,G]),(0,d.useEffect)(()=>{if(!Y||!$)return void A("");let e=parseFloat($);if(isNaN(e)||e<=0)return void A(t("energy.form.errors.validAmount"));let r=Math.max(0,G-Y.total_cost-.01),s=Y.total_cost+e;s>G?A(t("energy.form.errors.totalExceedsBalance",{total:s.toFixed(2),balance:G.toFixed(2),maxSendable:r.toFixed(2)})):A("")},[$,Y,G]),(0,d.useEffect)(()=>{},[r,a]);let eM=e=>{s(e),n(!0),z.current&&z.current.scrollIntoView({behavior:"smooth",block:"start"})};(0,d.useEffect)(()=>{let e=setTimeout(async()=>{if(!ed||0>=parseFloat(ed)){eh(null),ef("");return}eg(!0),ef("");try{let e=await fetch("/api/v1/swap/estimate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:eo,amount:parseFloat(ed)})}),r=await e.json();e.ok?eh(r):ef(r.detail||t("energy.form.errors.swapNetworkError"))}catch(e){ef(t("energy.form.errors.swapNetworkError"))}finally{eg(!1)}},500);return()=>clearTimeout(e)},[ed,eo]);let eR=e=>{ec(e.toString())},eS=()=>{P(!0),setTimeout(()=>P(!1),2e3)},ek=(0,d.useCallback)(e=>` 2ð§¾ Receipt 3---------------------- 4Energy Required: ${e.energyUnits.toLocaleString()} units 5TRX Topup Fee: ${e.bandwidth} USDT 6Activation Required: ${e.activation} USDT 7Energy Fee: ${e.energyFee} USDT 8 9Send USDT: ${e.usdtAmount} USDT 10Total Service Cost: ${e.totalFees} USDT 11---------------------- 12Total Amount: ${e.totalPaid} USDT`,[]),eT=e=>{o(e)},eA=(e,t,r)=>{el(s=>s.map((s,a)=>a===e?{status:t,message:r||s.message}:s))},eF=async()=>{if(!Y||!$)return;let e=Y.total_cost+parseFloat($);if(G<e)return void A(t("energy.form.errors.totalExceedsBalance",{total:e.toFixed(2),balance:G.toFixed(2),maxSendable:"0.00"}));R(!0),A(""),el(e=>e.map(e=>({...e,status:"pending"}))),setTimeout(()=>{L.current&&L.current.scrollIntoView({behavior:"smooth",block:"start"})},100);try{let e=Math.floor(1e6*parseFloat($)),t=Math.floor(1e6*Y.total_cost),r=window.tronWeb;eA(0,"processing");let s=await r.transactionBuilder.triggerSmartContract(Q,"transfer(address,uint256)",{},[{type:"address",value:r.address.toHex(V)},{type:"uint256",value:t}],ey.address),a=await r.trx.sign(s.transaction);eA(0,"completed"),eA(1,"processing");let n=await fetch("/api/rent_usdt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signedTransaction:JSON.stringify(a),to_address:I})}),l=await n.json();if(!n.ok)throw Error(l.detail||"Energy rental failed");eA(1,"completed"),eA(2,"processing");let o=await r.transactionBuilder.triggerSmartContract(Q,"transfer(address,uint256)",{},[{type:"address",value:r.address.toHex(I)},{type:"uint256",value:e}],ey.address),i=await r.trx.sign(o.transaction);eA(2,"completed"),eA(3,"processing");let d=await r.trx.sendRawTransaction(i);if(!d.result)throw Error("USDT transfer failed");eA(3,"completed");let c={energyUnits:Y.energy_units,bandwidth:Y.trx_topup_fee,activation:Y.activation_fee,energyFee:Y.energy_fee,usdtAmount:$,totalFees:Y.total_cost,totalPaid:Y.total_cost+parseFloat($),txHash:d.txid};ea(c),R(!1),K(!0)}catch(t){A(t.message||"Transaction failed");let e=en.findIndex(e=>"processing"===e.status);-1!==e&&eA(e,"error")}},e_=async()=>
12{if(!ey.isConnected)return void A(t("energy.form.errors.walletNotConnected"));if(!l||l<65e3)return void A(t("energy.form.errors.invalidAmount",{amount:65e3.toLocaleString()}));R(!0),k("processing"),A(""),_(0);try{let e=await eb(V,eN);if(e)await (0,E.submitRentRequest)({signedTransaction:JSON.stringify(e)}),k("success");else throw Error("Transaction failed")}catch(e){console.error("Failed to rent energy:",e),k("error"),A(t("energy.form.errors.transactionFailed"))}finally{R(!1),_(0)}};return(0,i.jsxs)("div",{ref:z,className:"relative w-full p-4 lg:p-6 rounded-xl bg-gray-900/80 backdrop-blur-md transition-all duration-500",children:[(0,i.jsxs)("div",{className:"grid grid-cols-4 gap-2 mb-6",children:[(0,i.jsxs)("button",{onClick:()=>eM("manual"),className:`h-24 px-4 rounded-lg transition-colors flex flex-col items-center justify-start gap-3 13 bg-gray-900/50 backdrop-blur-md border border-gray-700 14 ${"manual"===r?"bg-teal-700 text-white border-teal-500":"text-gray-400 hover:text-white hover:bg-gray-800/70"}`,children:[(0,i.jsx)(f.Zap,{className:"w-10 h-10 text-current"}),(0,i.jsx)("span",{className:"font-bold text-base text-center",children:t("energy.form.tabs.manual")})]}),(0,i.jsxs)("button",{onClick:()=>eM("swap"),className:`h-24 px-4 rounded-lg transition-colors flex flex-col items-center justify-center gap-3 15 bg-gray-900/50 backdrop-blur-md border border-gray-700 16 ${"swap"===r?"bg-teal-700 text-white border-teal-500":"text-gray-400 hover:text-white hover:bg-gray-800/70"}`,children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(f.Zap,{className:"w-10 h-10 text-current"}),(0,i.jsx)(j,{className:"w-4 h-4 text-current absolute -bottom-1 -right-1 bg-gray-900 rounded-sm p-0.5"})]}),(0,i.jsx)("span",{className:"font-bold text-base text-center",children:t("energy.form.tabs.rent")})]}),(0,i.jsxs)("button",{onClick:()=>eM("exchange"),className:`relative h-24 px-4 rounded-lg transition-colors flex flex-col items-center justify-center gap-2 17 bg-gray-900/50 backdrop-blur-md border border-gray-700 18 ${"exchange"===r?"bg-teal-700 text-white border-teal-500":"text-gray-400 hover:text-white hover:bg-gray-800/70"}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[(0,i.jsx)("img",{src:"https://i.ibb.co/twV160Y8/tether-usdt-logo.png",alt:"USDT",className:"w-6 h-6",width:"24",height:"24"}),(0,i.jsx)("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),(0,i.jsx)("img",{src:"/assets/trx.svg",alt:"TRX",className:"w-6 h-6",width:"24",height:"24"})]}),(0,i.jsx)("span",{className:"font-bold text-base text-center",children:t("energy.form.tabs.swap")})]}),(0,i.jsxs)("button",{onClick:()=>eM("usdt"),className:`relative h-24 px-4 rounded-lg transition-colors flex flex-col items-center justify-center gap-3 19 bg-gray-900/50 backdrop-blur-md border border-gray-700 20 ${"usdt"===r?"bg-teal-700 text-white border-teal-500":"text-gray-400 hover:text-white hover:bg-gray-800/70"}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[(0,i.jsx)("img",{src:"https://i.ibb.co/twV160Y8/tether-usdt-logo.png",alt:"USDT",className:"w-6 h-6",width:"24",height:"24"}),(0,i.jsx)(w,{className:"w-4 h-4 text-current"}),(0,i.jsx)(b.Wallet,{className:"w-6 h-6 text-current"})]}),(0,i.jsx)("span",{className:"font-bold text-base text-center",children:t("energy.form.tabs.usdt")}),(0,i.jsx)("span",{className:"absolute -top-2 right-2 bg-amber-400 text-amber-900 text-[9px] font-black px-1.5 py-0.5 rounded-full leading-none tracking-wide uppercase animate-pulse",children:t("energyFreeNode.newBadge")})]})]}),"manual"===r?(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"energyAmount",className:"block text-sm font-medium text-gray-300 mb-1",children:t("energy.form.labels.energyAmount")}),(0,i.jsx)("input",{id:"energyAmount",type:"number",min:65e3,value:l||"",onChange:e=>{o(Number(e.target.value))},className:` 21 w-full px-3 py-2 lg:px-4 lg:py-3 rounded-lg 22 bg-gray-800 border text-white 23 focus:ring-2 transition-all duration-200 24 ${l>0&&!eE?"border-red-500 focus:ring-red-500":"border-gray-700 focus:ring-teal-500"}
25 ${ey.isConnected&&"focus:ring-teal-400 focus:border-teal-400"} 26 `,placeholder:t("energy.form.placeholders.minimum",{amount:65e3.toLocaleString()})}),l>0&&!eE&&(0,i.jsxs)("div",{className:"mt-2 text-red-400 text-sm flex items-center",children:[(0,i.jsx)(h,{className:"w-4 h-4 mr-1"}),t("energy.form.errors.minimumEnergy",{amount:65e3.toLocaleString()})]})]}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,i.jsx)("button",{onClick:()=>eT(65e3),className:` 27 px-3 py-2 rounded-lg font-medium text-sm lg:text-base 28 transition-colors duration-300 29 ${ey.isConnected?"bg-teal-600 hover:bg-teal-700 text-white":"bg-gray-700 hover:bg-gray-600 text-gray-200"} 30 `,children:"65k"}),(0,i.jsx)("button",{onClick:()=>eT(131e3),className:` 31 px-3 py-2 rounded-lg font-medium text-sm lg:text-base 32 transition-colors duration-300 33 ${ey.isConnected?"bg-teal-600 hover:bg-teal-700 text-white":"bg-gray-700 hover:bg-gray-600 text-gray-200"} 34 `,children:"131k"})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{htmlFor:"trxAddress",className:"block text-sm font-medium text-gray-300 mb-1",children:t("energy.form.labels.trxAddress")}),(0,i.jsx)("input",{id:"trxAddress",type:"text",value:ey.address,readOnly:!0,className:` 35 wallet-address w-full px-3 py-2 lg:px-4 lg:py-3 rounded-lg 36 bg-gray-800 border text-white 37 focus:ring-2 transition-all duration-200 38 ${ey.isConnected?"border-teal-500/30 focus:ring-teal-400 focus:border-teal-400":"border-gray-700 focus:ring-teal-500"} 39 `,placeholder:t("energy.form.placeholders.enterTrxAddress")})]}),T&&(0,i.jsxs)("div",{className:"bg-red-900/40 border border-red-500/50 text-red-200 px-3 py-2 rounded-lg text-sm flex items-center",children:[(0,i.jsx)(h,{className:"w-4 h-4 mr-2 flex-shrink-0"}),(0,i.jsx)("span",{children:T})]}),"success"===S&&(0,i.jsx)("div",{className:"bg-green-900/40 border border-green-500/50 text-green-200 px-3 py-2 rounded-lg text-sm",children:t("energy.form.success.energyRented")}),(0,i.jsx)("button",{onClick:e_,disabled:!ey.isConnected||c||!eE||ej,className:` 40 w-full flex justify-center items-center space-x-2 41 px-4 py-2 lg:px-6 lg:py-3 rounded-lg 42 font-semibold transition-all duration-300 43 disabled:opacity-50 disabled:cursor-not-allowed 44 text-sm lg:text-base 45 ${ey.isConnected?"bg-teal-600 hover:bg-teal-700 text-white shadow-lg hover:shadow-teal-500/25":"bg-gray-700 text-gray-300"} 46 `,children:c?(0,i.jsx)(i.Fragment,{children:F>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{className:"w-4 h-4 lg:w-5 lg:h-5 animate-spin"}),(0,i.jsx)("span",{children:t("energy.form.buttons.retrying",{current:F,max:3})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 lg:h-5 lg:w-5 border-b-2 border-white"}),(0,i.jsx)("span",{children:t("energy.form.buttons.processing")})]})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u,{className:"w-4 h-4 lg:w-5 lg:h-5"}),(0,i.jsx)("span",{children:eN>0?t("energy.form.buttons.rentEnergyWithCost",{cost:eN.toFixed(3)}):t("energy.form.buttons.rentEnergy")})]})})]}):"swap"===r?(0,i.jsxs)("div",{className:"space-y-6",children:[(0,i.jsxs)("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700",children:[(0,i.jsx)("h3",{className:"text-sm md:text-xl font-semibold text-white mb-4",children:t("energy.form.labels.sendTrxTo")}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,i.jsxs)("div",{className:"flex flex-col items-center justify-between bg-gray-700/30 p-3 rounded-lg h-full",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,i.jsx)("img",{src:"/assets/trx.svg",alt:"TRX",className:"w-4 h-4 md:w-5 md:h-5",width:"20",height:"20"}),(0,i.jsx)("span",{className:"text-gray-300 text-xs md:text-sm",children:ej?"...":`${ev.toFixed(1)} TRX = `})]}),(0,i.jsx)("span",{className:"text-teal-400 font-semibold text-xs md:text-base",children:"65,000 Energy"})]}),(0,i.jsxs)("div",{className:"flex flex-col items-center justify-between bg-gray-700/30 p-3 rounded-lg h-full",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,i.jsx)("img",{src:"/assets/trx.svg",alt:"TRX",className:"w-4 h-4 md:w-5 md:h-5",width:"20",height:"20"}),(0,i.jsx)("span",{className:"text-gray-300 text-xs md:text-sm",children:ej?"...":`${eC.toFixed(1)} TRX = `})]}),(0,i.jsx)("span",{className:"text-teal-400 font-semibold text-xs md:text-base",children:"131,000 Energy"})]})]})]}),(0,i.jsxs)("div",{className:"md:hidden w-full bg-gray-800/50 rounded-lg p-4 border border-gray-700",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsx)("span",{className:"text-gray-400 text-sm",children:t("energy.form.labels.swapAddress")}),(0,i.jsx)(M.CopyToClipboard,{text:H,onCopy:eS,children:(0,i.jsx)("button",{className:"flex items-center space-x-1 text-teal-400 hover:text-teal-300 transition-colors text-sm",children:U?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Check,{className:"w-4 h-4"}),(0,i.jsx)("span",{children:t("energy.form.buttons.addressCopied")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.Copy,{className:"w-4 h-4"}),(0,i.jsx)("span",{children:t("energy.form.buttons.copyAddress")})]})})})]}),(0,i.jsx)(M.CopyToClipboard,{text:H,onCopy:eS,children:(0,i.jsx)("button",{className:"wallet-address
46w-full bg-gray-900 border border-gray-700 rounded-lg px-4 py-3 text-white text-sm font-mono mb-4 hover:bg-gray-800 hover:border-teal-500/30 transition-all text-left break-all",children:H})}),(0,i.jsx)(M.CopyToClipboard,{text:H,onCopy:eS,children:(0,i.jsx)("button",{className:"flex justify-center bg-white p-4 rounded-lg w-full hover:bg-gray-100 transition-colors",children:(0,i.jsx)(B,{value:H,size:200,level:"H"})})})]}),(0,i.jsxs)("div",{className:"hidden md:block w-full bg-gray-800/50 rounded-lg p-4 border border-gray-700",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsx)("span",{className:"text-gray-400 text-sm",children:t("energy.form.labels.swapAddress")}),(0,i.jsx)(M.CopyToClipboard,{text:H,onCopy:eS,children:(0,i.jsx)("button",{className:"flex items-center space-x-1 text-teal-400 hover:text-teal-300 transition-colors text-sm",children:U?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Check,{className:"w-4 h-4"}),(0,i.jsx)("span",{children:t("energy.form.buttons.addressCopied")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.Copy,{className:"w-4 h-4"}),(0,i.jsx)("span",{children:t("energy.form.buttons.copyAddress")})]})})})]}),(0,i.jsx)(M.CopyToClipboard,{text:H,onCopy:eS,children:(0,i.jsx)("button",{className:"wallet-address w-full bg-gray-900 border border-gray-700 rounded-lg px-4 py-3 text-white text-sm font-mono mb-4 hover:bg-gray-800 hover:border-teal-500/30 transition-all text-left break-all",children:H})}),(0,i.jsx)(M.CopyToClipboard,{text:H,onCopy:eS,children:(0,i.jsx)("button",{className:"flex justify-center bg-white p-4 rounded-lg w-full hover:bg-gray-100 transition-colors",children:(0,i.jsx)(B,{value:H,size:200,level:"H"})})})]})]}):"exchange"===r?(0,i.jsx)("div",{className:"space-y-6",children:(0,i.jsxs)("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700",children:[(0,i.jsxs)("h3",{className:"text-xl font-semibold text-white mb-4 flex items-center",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mr-3",children:[(0,i.jsx)("img",{src:"usdt"===eo?"https://i.ibb.co/twV160Y8/tether-usdt-logo.png":"/assets/trx.svg",alt:eo.toUpperCase(),className:"w-6 h-6",width:"24",height:"24",loading:"lazy"}),(0,i.jsx)("svg",{className:"w-4 h-4 text-teal-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),(0,i.jsx)("img",{src:"usdt"===eo?"/assets/trx.svg":"https://i.ibb.co/twV160Y8/tether-usdt-logo.png",alt:"usdt"===eo?"TRX":"USDT",className:"w-6 h-6",width:"24",height:"24",loading:"lazy"})]}),t("energy.form.swap.title")]}),(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{className:"bg-gray-700/50 rounded-lg p-4",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsx)("label",{className:"text-sm font-medium text-gray-300",children:t("energy.form.labels.payUsdt",{currency:eo.toUpperCase()})}),(0,i.jsxs)("button",{onClick:()=>{ei(e=>"usdt"===e?"trx":"usdt"),ec(""),eh(null),ef("")},className:"flex items-center gap-1 text-teal-400 hover:text-teal-300 transition-colors text-sm",children:[(0,i.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),t("energy.form.buttons.switch")]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("input",{type:"number",value:ed,onChange:e=>ec(e.target.value),placeholder:t("energy.form.placeholders.minSwap",{currency:eo.toUpperCase()}),className:"w-[62.5%] pl-4 pr-4 py-4 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-teal-500 focus:border-transparent text-base",min:"5"}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("img",{src:"usdt"===eo?"https://i.ibb.co/twV160Y8/tether-usdt-logo.png":"/assets/trx.svg",alt:eo.toUpperCase(),className:"w-6 h-6",width:"24",height:"24",loading:"lazy"}),(0,i.jsx)("span",{className:"text-gray-300 font-medium",children:eo.toUpperCase()})]})]}),(0,i.jsx)("div",{className:"grid grid-cols-4 gap-2 mt-3",children:"usdt"===eo?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{onClick:()=>eR(20),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"20"}),(0,i.jsx)("button",{onClick:()=>eR(100),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"100"}),(0,i.jsx)("button",{onClick:()=>eR(200),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"200"}),(0,i.jsx)("button",{onClick:()=>eR(1e3),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"1000"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{onClick:()=>eR(50),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"50"}),(0,i.jsx)("button",{onClick:()=>eR(100),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"100"}),(0,i.jsx)("button",{onClick:()=>eR(500),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"500"}),(0,i.jsx)("button",{onClick:()=>eR(1e3),className:"bg-gray-600 hover:bg-gray-500 text-white px-3 py-1 rounded text-sm transition-colors",children:"1000"})]})})]}),(0,i.jsxs)("div",{className:"bg-gray-700/50 rounded-lg p-4",children:[(0,i.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("energy.form.labels.receiveApprox",{currency:"usdt"===eo?"TRX":"USDT"})}),(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"flex-1 text-2xl font-bold text-white",children:em?(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("div",{className:"w-5 h-5 border-2 border-teal-400 border-t-transparent roun
46ded-full animate-spin"}),(0,i.jsx)("span",{className:"text-gray-400",children:t("energy.form.notices.calculating")})]}):eu?eu.to_amount.toFixed(6):(0,i.jsx)("span",{className:"text-gray-500",children:"0"})}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("img",{src:"usdt"===eo?"/assets/trx.svg":"https://i.ibb.co/twV160Y8/tether-usdt-logo.png",alt:"usdt"===eo?"TRX":"USDT",className:"w-6 h-6",width:"24",height:"24",loading:"lazy"}),(0,i.jsx)("span",{className:"text-gray-300 font-medium",children:"usdt"===eo?"TRX":"USDT"})]})]})]}),eu&&(0,i.jsxs)("div",{className:"bg-blue-900/30 border border-blue-500/30 rounded-lg p-4",children:[(0,i.jsx)("h4",{className:"text-blue-300 font-medium mb-2",children:t("energy.form.swap.instructions.title")}),(0,i.jsx)("p",{className:"text-sm text-gray-300 mb-3",children:t("energy.form.swap.instructions.description",{amount:ed,fromCurrency:eo.toUpperCase(),toAmount:eu.to_amount.toFixed(6),toCurrency:"usdt"===eo?"TRX":"USDT"})}),(0,i.jsxs)("div",{className:"bg-gray-800 rounded-lg p-3 mb-3",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,i.jsx)("span",{className:"text-gray-400 text-sm",children:t("energy.form.labels.swapAddress")}),(0,i.jsx)(M.CopyToClipboard,{text:ep,onCopy:eS,children:(0,i.jsx)("button",{className:"flex items-center space-x-1 text-teal-400 hover:text-teal-300 transition-colors text-sm",children:U?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Check,{className:"w-4 h-4"}),(0,i.jsx)("span",{children:t("energy.form.buttons.copied")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.Copy,{className:"w-4 h-4"}),(0,i.jsx)("span",{children:t("energy.form.buttons.copy")})]})})})]}),(0,i.jsx)("div",{className:"wallet-address font-mono text-sm text-white break-all bg-gray-900 p-2 rounded",children:ep}),(0,i.jsx)("div",{className:"mt-2 text-red-400 text-sm font-medium bg-red-900/20 border border-red-500/30 rounded p-2",children:t("energy.form.swap.instructions.warning")}),(0,i.jsx)("div",{className:"mt-3 flex justify-center",children:(0,i.jsx)("div",{className:"bg-white p-3 rounded-lg",children:(0,i.jsx)(B,{value:ep,size:150,level:"H"})})})]}),(0,i.jsxs)("div",{className:"text-xs text-gray-400 space-y-1",children:[(0,i.jsx)("p",{children:t("energy.form.swap.instructions.minAmount",{currency:eo.toUpperCase()})}),(0,i.jsx)("p",{children:t("energy.form.swap.instructions.processingTime")}),(0,i.jsx)("p",{children:t("energy.form.swap.instructions.defaultSender",{toCurrency:"usdt"===eo?"TRX":"USDT",fromCurrency:eo.toUpperCase()})}),(0,i.jsxs)("p",{children:[t("energy.form.swap.instructions.support")," ",(0,i.jsx)("a",{href:"https://t.me/Renttron",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300 underline transition-colors",children:"24/7 support"})]})]})]}),(ex||ed&&5>parseFloat(ed))&&(0,i.jsx)("div",{className:"bg-red-900/50 border border-red-700 text-red-300 p-4 rounded-lg",children:ed&&5>parseFloat(ed)?t("energy.form.errors.minSwapAmount",{currency:eo.toUpperCase()}):ex})]})]})}):(0,i.jsxs)("div",{className:"space-y-6",children:[(0,i.jsxs)("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700",children:[(0,i.jsx)("h3",{className:"text-xl font-semibold text-white mb-4",children:t("energy.form.tabs.usdt")}),(0,i.jsxs)("p",{className:"text-gray-300 mb-6",children:[t("energy.form.notices.usdtDirect"),(0,i.jsx)("br",{}),t("energy.form.notices.noFeesRequired")]}),(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("energy.form.labels.recipientAddress")}),(0,i.jsx)("input",{type:"text",value:I,onChange:e=>D(e.target.value),placeholder:t("energy.form.placeholders.enterTronAddress"),className:"wallet-address w-full p-3 bg-gray-700 border border-gray-600 rounded-lg focus:border-blue-500 outline-none text-white"})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[t("energy.form.labels.amount"),G>0&&(0,i.jsxs)("span",{className:"text-gray-400 text-xs ml-2",children:["(",J?t("energy.form.notices.loadingBalance"):t("energy.form.labels.balance",{balance:G.toFixed(2)}),")"]})]}),(0,i.jsx)("input",{type:"number",value:$,onChange:e=>X(e.target.value),placeholder:t("energy.form.placeholders.enterAmount"),step:"0.01",max:Y?Math.max(0,G-Y.total_cost-.01).toFixed(2):void 0,className:"w-full p-3 bg-gray-700 border border-gray-600 rounded-lg focus:border-blue-500 outline-none text-white"}),Y&&(0,i.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:t("energy.form.success.maxSendable",{amount:Math.max(0,G-Y.total_cost-.01).toFixed(2)})})]}),(0,i.jsx)("button",{onClick:eF,disabled:!!(c||et||J||!ey.isConnected||G<2||!Y||!I||G<Y.total_cost||!$||0>=parseFloat($))||G<Y.total_cost+parseFloat($||"0"),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 text-white font-bold py-3 px-4 roun
46ded-lg transition",children:(()=>{if(c)return t("energy.form.buttons.processing");if(et)return t("energy.form.buttons.gettingEstimate");if(!ey.isConnected)return t("energy.form.buttons.connectWallet");if(J)return t("energy.form.buttons.loadingBalance");if(G<2)return t("energy.form.buttons.needMinUsdt",{amount:2});if(!Y)return I?t("energy.form.buttons.gettingEstimate"):t("energy.form.buttons.enterRecipient");if(G<Y.total_cost)return t("energy.form.buttons.insufficientBalance",{balance:G.toFixed(2)});if(!$||0>=parseFloat($))return t("energy.form.buttons.enterAmount");let e=Y.total_cost+parseFloat($);return G<e?t("energy.form.buttons.insufficientBalance",{balance:G.toFixed(2)}):t("energy.form.buttons.sendUsdt",{amount:$,total:e.toFixed(2)})})()})]})]}),Y&&(0,i.jsxs)("div",{ref:O,className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700",children:[(0,i.jsx)("h2",{className:"text-xl font-semibold mb-4",children:t("energy.form.estimate.title")}),(0,i.jsxs)("div",{className:"space-y-3",children:[Y.activation_fee>0&&(0,i.jsxs)("div",{className:"flex items-center justify-between p-3 bg-yellow-900/30 rounded",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(h,{className:"w-5 h-5 text-yellow-500"}),(0,i.jsx)("span",{children:t("energy.form.estimate.activationRequired")})]}),(0,i.jsxs)("span",{className:"font-mono",children:[Y.activation_fee," USDT"]})]}),Y.trx_topup_fee>0&&(0,i.jsxs)("div",{className:"flex items-center justify-between p-3 bg-blue-900/30 rounded",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(p,{className:"w-5 h-5 text-blue-500"}),(0,i.jsx)("span",{children:t("energy.form.estimate.trxTopupFee")})]}),(0,i.jsxs)("span",{className:"font-mono",children:[Y.trx_topup_fee," USDT (",Y.trx_to_send," TRX)"]})]}),(0,i.jsxs)("div",{className:"flex items-center justify-between p-3 bg-purple-900/30 rounded",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(f.Zap,{className:"w-5 h-5 text-purple-500"}),(0,i.jsx)("span",{children:t("energy.form.estimate.energyRequired")})]}),(0,i.jsxs)("span",{className:"font-mono",children:[Y.energy_units.toLocaleString()," ",t("energy.form.estimate.units")]})]}),(0,i.jsxs)("div",{className:"flex items-center justify-between p-3 bg-green-900/30 rounded",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(y,{className:"w-5 h-5 text-green-500"}),(0,i.jsx)("span",{children:t("energy.form.estimate.energyFee")})]}),(0,i.jsxs)("span",{className:"font-mono",children:[Y.energy_fee," USDT"]})]}),(0,i.jsx)("div",{className:"border-t border-gray-700 pt-3",children:(0,i.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-700 rounded font-bold",children:[(0,i.jsx)("span",{children:t("energy.form.estimate.totalServiceCost")}),(0,i.jsxs)("span",{className:"font-mono text-yellow-400",children:[Y.total_cost," USDT"]})]})})]}),c&&(0,i.jsx)("div",{ref:L,className:"space-y-2 mt-4 border-t border-gray-700 pt-4",children:en.map((e,t)=>(0,i.jsxs)("div",{className:`flex items-center justify-between p-2 rounded ${"completed"===e.status?"bg-green-900/30":"processing"===e.status?"bg-blue-900/30":"error"===e.status?"bg-red-900/30":"bg-gray-800/30"}`,children:[(0,i.jsx)("span",{className:"text-sm",children:e.message}),"completed"===e.status&&(0,i.jsx)(x.Check,{className:"w-5 h-5 text-green-400"}),"processing"===e.status&&(0,i.jsx)("div",{className:"w-5 h-5 border-2 border-blue-400 border-t-transparent rounded-full animate-spin"}),"error"===e.status&&(0,i.jsx)(h,{className:"w-5 h-5 text-red-400"})]},t))}),W&&es&&(0,i.jsx)("div",{className:"mt-4 bg-green-900/20 border border-green-500/30 rounded-lg p-4",children:(0,i.jsxs)("pre",{className:"whitespace-pre-wrap font-mono text-green-300 text-sm",children:[ek(es),(0,i.jsx)("br",{}),"Txn Hash: ",(0,i.jsx)("a",{className:"tx-hash",href:`https://tronscan.org/#/transaction/${es.txHash||""}`,target:"_blank",children:(e=es.txHash||"",`${e.slice(0,7)}...${e.slice(-7)}`)})]})})]}),T&&(0,i.jsx)("div",{className:"bg-red-900/50 border border-red-700 text-red-300 p-4 rounded-lg",children:T})]}),U&&(0,i.jsx)("div",{className:"fixed bottom-4 right-4 bg-teal-600 text-white px-4 py-2 rounded-lg shadow-lg animate-fade-in-up",children:t("energy.form.buttons.addressCopied")})]})}],74081)},32704,e=>{e.n(e.i(74081))}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.