-
Notifications
You must be signed in to change notification settings - Fork 0
/
src__pages__PPP__Burn.async.js
1 lines (1 loc) · 29.7 KB
/
src__pages__PPP__Burn.async.js
1
(self.webpackChunk=self.webpackChunk||[]).push([[8183],{64317:function(e,t,r){"use strict";var n=r(1413),a=r(91),s=r(22270),i=r(62435),o=r(66758),c=r(56499),l=r(86074),u=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],d=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],f=function(e,t){var r=e.fieldProps,d=e.children,f=e.params,p=e.proFieldProps,m=e.mode,h=e.valueEnum,v=e.request,x=e.showSearch,g=e.options,b=(0,a.Z)(e,u),j=(0,i.useContext)(o.Z);return(0,l.jsx)(c.Z,(0,n.Z)((0,n.Z)({valueEnum:(0,s.h)(h),request:v,params:f,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,n.Z)({options:g,mode:m,showSearch:x,getPopupContainer:j.getPopupContainer},r),ref:t,proFieldProps:p},b),{},{children:d}))},p=i.forwardRef((function(e,t){var r=e.fieldProps,u=e.children,f=e.params,p=e.proFieldProps,m=e.mode,h=e.valueEnum,v=e.request,x=e.options,g=(0,a.Z)(e,d),b=(0,n.Z)({options:x,mode:m||"multiple",labelInValue:!0,showSearch:!0,suffixIcon:null,autoClearSearchValue:!0,optionLabelProp:"label"},r),j=(0,i.useContext)(o.Z);return(0,l.jsx)(c.Z,(0,n.Z)((0,n.Z)({valueEnum:(0,s.h)(h),request:v,params:f,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,n.Z)({getPopupContainer:j.getPopupContainer},b),ref:t,proFieldProps:p},g),{},{children:u}))})),m=i.forwardRef(f);m.SearchSelect=p,m.displayName="ProFormComponent",t.Z=m},91604:function(e,t,r){"use strict";r.d(t,{Z:function(){return v}});var n=r(1413),a=r(87462),s=r(62435),i={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},o=r(84089),c=function(e,t){return s.createElement(o.Z,(0,a.Z)({},e,{ref:t,icon:i}))};var l=s.forwardRef(c),u=r(28459),d=r(2058),f=r(9105),p=r(90789),m=r(86074),h=s.forwardRef((function(e,t){var r=e.fieldProps,a=e.title,i=void 0===a?"单击或拖动文件到此区域进行上传":a,o=e.icon,c=void 0===o?(0,m.jsx)(l,{}):o,p=e.description,h=void 0===p?"支持单次或批量上传":p,v=e.action,x=e.accept,g=e.onChange,b=e.value,j=e.children,S=e.max,w=e.proFieldProps,y=(0,s.useContext)(u.ZP.ConfigContext),C=(0,s.useContext)(f.A),k=(null==w?void 0:w.mode)||C.mode||"edit",N=y.getPrefixCls("upload"),Z=(void 0===S||!b||(null==b?void 0:b.length)<S)&&"read"!==k&&!0!==(null==w?void 0:w.readonly);return(0,m.jsxs)(d.Z.Dragger,(0,n.Z)((0,n.Z)({ref:t,name:"files",action:v,accept:x,fileList:b},r),{},{onChange:function(e){null==g||g(e),null!=r&&r.onChange&&(null==r||r.onChange(e))},style:(0,n.Z)((0,n.Z)({},null==r?void 0:r.style),{},{display:Z?void 0:"none"}),children:[(0,m.jsx)("p",{className:"".concat(N,"-drag-icon"),children:c}),(0,m.jsx)("p",{className:"".concat(N,"-text"),children:i}),(0,m.jsx)("p",{className:"".concat(N,"-hint"),children:h}),j?(0,m.jsx)("div",{className:"".concat(N,"-extra"),style:{padding:16},children:j}):null]}))})),v=(0,p.G)(h,{getValueFromEvent:function(e){return e.fileList}})},218:function(e,t,r){"use strict";r.d(t,{s:function(){return f}});var n=r(5574),a=r.n(n),s=r(37476),i=r(90672),o=r(59530),c=r(45360),l=r(62435),u=r(86074),d=l.forwardRef((function(e,t){var r=c.ZP.useMessage(),n=a()(r,2),d=n[0],f=n[1],p=(0,l.useRef)(),m=(0,l.useState)(!1),h=a()(m,2),v=h[0],x=h[1],g=(0,l.useState)(""),b=a()(g,2),j=b[0],S=b[1],w=(0,l.useState)(""),y=a()(w,2),C=y[0],k=y[1],N=(0,o.useIntl)(),Z=N.formatMessage({id:"msig.intlPreviewFail"}),_=N.formatMessage({id:"msig.intlClose"}),F=(0,l.useCallback)((function(e){var t=new FileReader;t.readAsText(e.originFileObj),t.onload=function(){try{var r,n=JSON.parse(t.result);if(n)null===(r=p.current)||void 0===r||r.setFieldValue("content",JSON.stringify(n,null,2)),S(JSON.stringify(n,null,2)),k(e.name),x(!0);else d.error("".concat(Z))}catch(e){d.error("".concat(Z))}}}),[]);return(0,l.useImperativeHandle)(t,(function(){return{handleOpen:F}})),(0,u.jsxs)(s.Y,{formRef:p,title:(0,u.jsx)("div",{className:"mt-3",children:C}),open:v,onOpenChange:function(e){x(e)},layout:"vertical",width:"700px",modalProps:{style:{top:25}},submitter:{searchConfig:{resetText:_},render:function(e,t){return[t[0]]}},children:[(0,u.jsx)(i.Z,{name:"content",fieldProps:{autoSize:{minRows:5},allowClear:!1,autoFocus:!1,onChange:void 0,value:j,size:"large"}}),f]})})),f=(0,l.memo)(d)},84995:function(e,t,r){"use strict";r.r(t);var n=r(64599),a=r.n(n),s=r(19632),i=r.n(s),o=r(97857),c=r.n(o),l=r(15009),u=r.n(l),d=r(99289),f=r.n(d),p=r(5574),m=r.n(p),h=r(218),v=r(80059),x=r(40956),g=r(64119),b=r(87603),j=r(98165),S=r(25035),w=r(11774),y=r(38345),C=r(97269),k=r(64317),N=r(63434),Z=r(52688),_=r(91604),F=r(31199),P=r(5966),T=r(59530),V=r(80507),M=r(45360),E=r(15867),L=r(7134),O=r(83062),Y=r(66309),R=r(9669),z=r.n(R),H=r(27484),D=r.n(H),q=r(70178),I=r.n(q),A=r(62435),J=r(51409),U=r(86074);D().extend(I());var $=[];t.default=function(){var e=(0,T.useDispatch)(),t=M.ZP.useMessage(),r=m()(t,2),n=r[0],s=r[1],o=(0,T.useSelector)((function(e){return e.global.contractKit})),l=(0,T.useSelector)((function(e){return e.global.account})),d=(0,T.useSelector)((function(e){return e.global.session})),p=(0,T.useSelector)((function(e){return e.global.privateKey})),R=(0,T.useSelector)((function(e){return e.ppp.valueEnum})),H=(0,T.useSelector)((function(e){return e.ppp.projects})),q=(0,T.useSelector)((function(e){return e.ppp.accessAccounts})),I=(0,A.useState)([]),W=m()(I,2),K=W[0],G=W[1],Q=(0,A.useState)(0),B=m()(Q,2),X=B[0],ee=B[1],te=(0,A.useState)(0),re=m()(te,2),ne=re[0],ae=re[1],se=(0,A.useState)(0),ie=m()(se,2),oe=ie[0],ce=ie[1],le=(0,A.useState)(0),ue=m()(le,2),de=ue[0],fe=ue[1],pe=(0,A.useState)(0),me=m()(pe,2),he=me[0],ve=me[1],xe=(0,A.useState)([]),ge=m()(xe,2),be=ge[0],je=ge[1],Se=(0,A.useState)(0),we=m()(Se,2),ye=we[0],Ce=we[1],ke=(0,A.useState)(!1),Ne=m()(ke,2),Ze=Ne[0],_e=Ne[1],Fe=(0,A.useState)({}),Pe=m()(Fe,2),Te=Pe[0],Ve=Pe[1],Me=(0,A.useState)({}),Ee=m()(Me,2),Le=Ee[0],Oe=Ee[1],Ye=(0,A.useState)(!1),Re=m()(Ye,2),ze=Re[0],He=Re[1],De=(0,A.useState)(!1),qe=m()(De,2),Ie=qe[0],Ae=qe[1],Je=(0,A.useState)(!1),Ue=m()(Je,2),$e=Ue[0],We=Ue[1],Ke=(0,A.useState)(!1),Ge=m()(Ke,2),Qe=Ge[0],Be=Ge[1],Xe=(0,A.useState)([]),et=m()(Xe,2),tt=et[0],rt=et[1],nt=(0,A.useState)(0),at=m()(nt,2),st=at[0],it=at[1],ot=(0,T.useIntl)(),ct=ot.formatMessage({id:"coffee.inputException"}),lt=ot.formatMessage({id:"msig.intlSendTransaction"}),ut=ot.formatMessage({id:"msig.intlSend"}),dt=ot.formatMessage({id:"msig.intlUploadFail"}),ft=ot.formatMessage({id:"msig.intlUploadSuccess"}),pt=ot.formatMessage({id:"msig.intlTransactionEmpty"}),mt=ot.formatMessage({id:"common.intlPleaseConnectWallet"}),ht=ot.formatMessage({id:"common.intlPleaseConnectNetwork"}),vt=(0,A.useRef)({}),xt=(0,A.useRef)(),gt=(0,A.useRef)(),bt=(0,A.useRef)(),jt=(0,A.useRef)(!0),St=(0,A.useCallback)((function(){var e=0,t=0,r=0,n=0;for(var a in vt.current)"success"===vt.current[a].status?t+=1:"error"===vt.current[a].status?r+=1:"processing"===vt.current[a].status?n+=1:"default"===vt.current[a].status&&(e+=1);ee(t),ae(r),ce(n),fe(e)}),[]),wt=(0,A.useCallback)(function(){var e=f()(u()().mark((function e(t){var r,n;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],n=D()().format("YYYY-MM-DDTHH:mm:ss.SSS"),$.push({time:n}),console.log(n),t.forEach((function(e){if("success"!==vt.current[e.cid].status&&"processing"!==vt.current[e.cid].status&&("error"!==vt.current[e.cid].status||!vt.current[e.cid].message.includes("asset not found"))){var t=new Promise((function(t){vt.current[e.cid].status="processing",St(),d.client.v1.chain.push_transaction(e.signedTransaction).then((function(r){r&&r.processed&&"executed"===r.processed.receipt.status?(vt.current[e.cid].status="success",St(),t(!0)):("success"!==vt.current[e.cid].status&&(vt.current[e.cid].status="error",$.push({cid:e.cid,error:JSON.stringify(r),pos:"then"}),console.log(r),St()),t(!1))})).catch((function(r){if("success"!==vt.current[e.cid].status){if(vt.current[e.cid].status="error",St(),$.push({cid:e.cid,error:JSON.stringify(r),pos:"catch"}),r instanceof Error)if(r.message.includes("eosio_assert_message assertion failure"))r.details[0].message.includes("asset not found")&&(vt.current[e.cid].message="asset not found");console.log(r)}t(!1)}))}));r.push(t)}}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[d,St]),yt=(0,A.useCallback)(function(){var e=f()(u()().mark((function e(t){var r,a,s,o,f,h,v,x,b,j,S,w,y,C,k,N,Z,_,F,P,T,M,E,L,O,Y,R,z,q,I,A,J,U,$,W,K,G;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d&&d.broadcast){e.next=6;break}return n.error("".concat(mt)),e.abrupt("return");case 6:if(l){e.next=9;break}return n.error("".concat(ht)),e.abrupt("return");case 9:if("owner"===(r=d.permissionLevel.permission.toString())||"active"===r){e.next=13;break}return n.error("permission权限必须是owner或者active"),e.abrupt("return");case 13:if(Ae(!0),a=t.pidCreate,s=t.burnCreate,o=t.sellCreate,0!==s.length){e.next=19;break}return n.error("请选择图片"),Ae(!1),e.abrupt("return");case 19:return f=Number(a.split("-")[1]),h=d.actor.toString(),v=H.filter((function(e){return e.id.toNumber()===f}))[0],x=v.token_per_nft.toString(),b=v.token_per_nft.value,j=v.token_per_nft.symbol.name,S=v.token_per_nft.symbol,w=v.mid.toNumber(),y={account:"dfsfreecpu11",name:"freecpu",authorization:[{actor:"dfs.service",permission:"cpu"},d.permissionLevel],data:g._9.from({user:h})},C=V.aU.from(y),e.next=31,d.client.v1.chain.get_info();case 31:k=e.sent,N=k.getTransactionHeader(),Z=D()(),_=[],F="",P=0,T=u()().mark((function e(t){var r,a,l,f,v,j,S,y,k,T,M,E,L,O,Y,R,z,H;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s[t].split("-"),a=Number(r[0]),l=Number(r[1]),f=tt.filter((function(e){return e.value===s[t]}))[0].time,F=D()(Z).add(3600-t,"seconds").utc().format("YYYY-MM-DDTHH:mm:ss"),P+=b,v={account:"dfs3protocol",name:"burn",authorization:[d.permissionLevel],data:g.g_.from({assetid:a})},j=V.aU.from(v),S=x,y="swap:".concat(w,":0"),k={account:"dfsppptokens",name:"transfer",authorization:[d.permissionLevel],data:g.FE.from({from:h,to:"swapswapswap",quantity:S,memo:y})},T=V.aU.from(k),L=[],O=[],O=o?[C,j,T]:[C,j],M=V.YW.from(c()(c()({},N),{},{expiration:F,actions:O})),L[0]=p.signDigest(M.signingDigest(d.chain.id.toString())),e.next=19,(0,g.zI)(d.transact({transaction:M},{broadcast:!1,transactPlugins:[]}));case 19:if(Y=e.sent,R=m()(Y,2),z=R[0],H=R[1],!z){e.next=27;break}return n.error(z),Ae(!1),e.abrupt("return",{v:!1});case 27:E=V.uQ.from(c()(c()({},M),{},{signatures:[].concat(L,i()(H.signatures))})),_.push({signedTransaction:E,cid:l,nftid:a,amount:b,from:h,burn_time:f});case 29:case"end":return e.stop()}}),e)})),E=0;case 39:if(!(E<s.length)){e.next=47;break}return e.delegateYield(T(E),"t0",41);case 41:if(!(M=e.t0)){e.next=44;break}return e.abrupt("return",M.v);case 44:++E,e.next=39;break;case 47:return L=D()().format("YYYY-MM-DDTHH:mm:ss"),O=[],Y=[],R=_.length,_.forEach((function(e){O.push(e.cid),Y.push(e.nftid)})),z=v.nft_name,q=v.creator.toString(),I=V.xR.from(P,S).toString(),A=v.project_name,J=D().utc(v.last_round.toString()).local().format("YYYY-MM-DDTHH:mm:ss"),U=v.sec_per_round.toNumber(),$={infos:{type:"burn",pid:f,creator:q,project_name:A,nft_name:z,token_symbol:j,last_round:J,sec_per_round:U,from:h,split:1,disorder:!1,start:_[0].burn_time,end:_[R-1].burn_time,count:R,amount:I,cid_array:O,nftid_array:Y},transactions:_},W=JSON.stringify($,null,2),K="data:,".concat(W),(G=document.createElement("a")).href=K,G.download="".concat(h,"_").concat(f,"_").concat(R,"_").concat(z,"_").concat(q,"_").concat(L,"_burn.json"),G.click(),n.success("创建完成"),Ae(!1),e.abrupt("return",!0);case 70:e.prev=70,e.t1=e.catch(0),Ae(!1),(0,g.Tv)(e.t1,n,"handleFinishCreate");case 74:return e.abrupt("return",!0);case 75:case"end":return e.stop()}}),e,null,[[0,70]])})));return function(t){return e.apply(this,arguments)}}(),[o,d,l,H,tt]),Ct=(0,A.useCallback)(f()(u()().mark((function e(){return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==be.length){e.next=3;break}return n.error(pt),e.abrupt("return",!1);case 3:return e.prev=3,wt(be),e.abrupt("return",!0);case 8:e.prev=8,e.t0=e.catch(3),(0,g.Tv)(e.t0,n,"handleFinishSend");case 11:case"end":return e.stop()}}),e,null,[[3,8]])}))),[be,wt]),kt=(0,A.useCallback)((function(e){var t=D()(e).valueOf();Ce(t)}),[]),Nt=(0,A.useCallback)((function(e){var t,r,n=null===(t=gt.current)||void 0===t?void 0:t.getFieldValue("leadTimeSend");n&&e<n&&jt.current&&(jt.current=!1,null===(r=gt.current)||void 0===r||r.submit())}),[]),Zt=(0,A.useCallback)((function(){var e;if(null!==(e=gt.current)&&void 0!==e&&e.getFieldValue("auto")){if(0===be.length)return n.error(pt),!1;var t=gt.current.getFieldsValue(),r=t.repeatSend,a=t.intervalSend;try{wt(be);for(var s=1;s<r;s++)(0,J.iK)(wt,a*s,be);return!0}catch(e){(0,g.Tv)(e,n,"handleCountDownFinishSend")}}}),[be,wt]),_t=(0,A.useCallback)(function(){var e=f()(u()().mark((function e(t){var r,s,i,o,c,l,d,f,p,m,h,v,x,b,j,S,w,y,C,k,N,Z,_,F;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.length){e.next=16;break}return vt.current={},Oe({}),ae(0),ee(0),ce(0),fe(0),je([]),Ce(0),Ve({}),ve(0),null===(r=gt.current)||void 0===r||r.setFieldValue("amountSend",""),null===(s=gt.current)||void 0===s||s.setFieldValue("startTime",""),null===(i=gt.current)||void 0===i||i.setFieldValue("endTime",""),jt.current=!0,e.abrupt("return");case 16:e.prev=16,p=[],m=new Set,h=[],v={},x=0,b={infos:{},transactions:[]},j=a()(t),e.prev=24,w=u()().mark((function e(){var t,r;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=S.value,e.next=3,new Promise((function(e){var r=new FileReader;r.readAsText(t.originFileObj),r.onload=function(){return e(r.result)}}));case 3:r=e.sent,(b=JSON.parse(r)).transactions.forEach((function(e){m.has(e.cid)||(h.push(e),m.add(e.cid))}));case 6:case"end":return e.stop()}}),e)})),j.s();case 27:if((S=j.n()).done){e.next=31;break}return e.delegateYield(w(),"t0",29);case 29:e.next=27;break;case 31:e.next=36;break;case 33:e.prev=33,e.t1=e.catch(24),j.e(e.t1);case 36:return e.prev=36,j.f(),e.finish(36);case 39:y=b.infos.start,C=D()(y).valueOf(),k=b.infos.end,N=D()(k).valueOf(),Z=Math.ceil((N-C)/1e3),kt(y),_=b.infos.token_symbol,h.forEach((function(e){var t=V.uQ.from(e.signedTransaction);p.push({cid:e.cid,nftid:e.nftid,amount:e.amount,from:e.from,signedTransaction:t}),v[e.cid]={status:"default",message:""},x+=e.amount})),null===(o=gt.current)||void 0===o||o.setFieldValue("amountSend",x.toFixed(8)+" "+_),null===(c=gt.current)||void 0===c||c.setFieldValue("startTime",y),null===(l=gt.current)||void 0===l||l.setFieldValue("endTime",k),F=Z+10+Math.ceil(Z/60),null===(d=gt.current)||void 0===d||d.setFieldValue("repeatSend",F),null===(f=gt.current)||void 0===f||f.setFieldValue("intervalSend",1e3),vt.current=v,Oe({}),ae(0),ee(0),ce(0),fe(p.length),je(p),Ve(b.infos),ve(0),jt.current=!0,e.next=68;break;case 65:e.prev=65,e.t2=e.catch(16),(0,g.Tv)(e.t2,n,"handleFileList");case 68:case"end":return e.stop()}}),e,null,[[16,65],[24,33,36,39]])})));return function(t){return e.apply(this,arguments)}}(),[kt]),Ft=(0,A.useCallback)(function(){var e=f()(u()().mark((function e(t){var r;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("removed"!==t.file.status){e.next=4;break}return G(t.fileList),_t(t.fileList),e.abrupt("return");case 4:(r=new FileReader).readAsText(t.fileList[t.fileList.length-1].originFileObj),r.onload=function(){try{var e=JSON.parse(r.result);e?e.hasOwnProperty("infos")&&"burn"===e.infos.type?(G(t.fileList),_t(t.fileList),n.success("".concat(ft))):n.error("文件类型错误"):n.error("".concat(dt))}catch(e){(0,g.Tv)(e,n,"handleUpload")}};case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[_t]),Pt=(0,A.useCallback)((function(){var e;null===(e=gt.current)||void 0===e||e.resetFields(),G([]),ae(0),ee(0),ce(0),fe(0),je([]),Ce(0),vt.current={},Oe({}),Ve({}),ve(0),St(),jt.current=!0}),[St]),Tt=(0,A.useCallback)(function(){var t=f()(u()().mark((function t(r){var a,s,i,o,c,l,d,f,p,m;return u()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.load("dfs3protocol");case 3:return s=t.sent,i=s.table("projects"),o=s.table("stat"),t.next=8,i.all({scope:"dfs3protocol"});case 8:return c=t.sent,t.next=11,o.all({scope:"dfs3protocol"});case 11:return l=t.sent,t.next=14,z().get("https://api.dfs.land/dfschain/pppvolume2");case 14:200!==(d=t.sent).status&&n.error("获取pppvolume2数据失败"),f=d.data,p=[],c.forEach((function(e){f.hasOwnProperty(e.id.toString())&&p.push(e)})),p.sort((function(e,t){var r=e.id.toString(),n=t.id.toString();return f[n].volume_24h-f[r].volume_24h})),m={},p.forEach((function(e){var t=e.nft_img,r=e.id.toString(),n=e.project_name,a=e.creator.toString();m["pid-"+r]="".concat(r,"-").concat(n,"-").concat(a,"-").concat(t)})),null===(a=xt.current)||void 0===a||a.setFieldValue("pidCreate",""),e(x.N.setValueEnum(m)),e(x.N.setProjects(c)),e(x.N.setStats(l)),Be(!1),t.next=33;break;case 29:t.prev=29,t.t0=t.catch(0),Be(!1),(0,g.Tv)(t.t0,n,"handleValueEnum");case 33:case"end":return t.stop()}}),t,null,[[0,29]])})));return function(e){return t.apply(this,arguments)}}(),[]),Vt=(0,A.useCallback)((function(){return d&&d.broadcast?l?(Be(!0),void Tt(o)):(n.error("".concat(ht)),!1):(n.error("".concat(mt)),!1)}),[d,l,Tt,o]),Mt=(0,A.useCallback)(f()(u()().mark((function e(){var t,r,a,s,i;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(be.length){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,He(!0),t={},r=[],a=Te.pid,e.next=9,d.client.v1.chain.get_table_rows({code:"dfs3protocol",table:"registry",scope:"dfs3protocol",key_type:"name",index_position:"tertiary",lower_bound:l.accountName,upper_bound:l.accountName,limit:2e3});case 9:s=e.sent,s.rows.filter((function(e){return e.pid===a})).forEach((function(e){r.push(e.cid)})),i=0,be.forEach((function(e){var n=e.cid;r.includes(n)?t[n]="default":(t[n]="success",i+=1)})),ve(i),Oe(t),He(!1),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(2),He(!1),(0,g.Tv)(e.t0,n,"handleCheckOwnCountSend");case 23:case"end":return e.stop()}}),e,null,[[2,19]])}))),[o,n,Te,be,d]),Et=(0,A.useCallback)(function(){var e=f()(u()().mark((function e(t){var r,n,a,s,i,o,c;return u()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.hasOwnProperty("pidCreate")){e.next=16;break}return We(!0),n=Number(t.pidCreate.split("-")[1]),e.next=5,d.client.v1.chain.get_table_rows({code:"dfs3protocol",table:"registry",scope:"dfs3protocol",key_type:"name",index_position:"tertiary",lower_bound:l.accountName,upper_bound:l.accountName,limit:2e3});case 5:a=e.sent,(s=a.rows.filter((function(e){return e.pid===n}))).sort((function(e,t){return e.last_trade.localeCompare(t.last_trade)})),i=H.filter((function(e){return e.id.toNumber()===n}))[0],o=i.sec_to_burn_nft.toNumber(),c=[],s.forEach((function(e){var t=e.id.toString(),r=e.cid.toString(),n=D().utc(e.last_trade).add(o,"seconds").local().format("YYYY-MM-DDTHH:mm:ss");c.push({label:(0,U.jsxs)("div",{className:"flex justify-between w-[300px]",children:[(0,U.jsxs)("div",{children:["#",r]}),(0,U.jsxs)("div",{children:["销毁时间:",n]})]}),value:t+"-"+r,time:n})})),We(!1),rt(c),it(0),null===(r=xt.current)||void 0===r||r.setFieldValue("burnCreate",[]);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[l,d,H]),Lt=(0,A.useCallback)((function(){var e,t,r,n=tt.map((function(e){return e.value})),a=null===(e=xt.current)||void 0===e?void 0:e.getFieldValue("burnCreate");n.length===a.length?null===(t=xt.current)||void 0===t||t.setFieldValue("burnCreate",[]):null===(r=xt.current)||void 0===r||r.setFieldValue("burnCreate",n)}),[tt]),Ot=(0,A.useCallback)((function(){if(Ze){if(l){var e=l.accountName.toString();return!!q.includes(e)||(_e(!1),!1)}return!0}if(l){var t=l.accountName.toString();return!!q.includes(t)&&(_e(!0),!0)}return!1}),[l,Ze,q]),Yt=(0,A.useCallback)((function(){var e=D()().format("YYYY-MM-DDTHH:mm:ss"),t=JSON.stringify($,null,2),r="data:,".concat(t),n=document.createElement("a");n.href=r,n.download="log_".concat(e,".json"),n.click()}),[]);return(0,A.useEffect)((function(){!o||Object.keys(R).length||Qe||(Be(!0),Tt(o))}),[Tt,R,o,Qe]),(0,U.jsx)(w._z,{className:"",ghost:!0,children:Ot()?(0,U.jsxs)("div",{className:"flex flex-wrap justify-center gap-5",children:[(0,U.jsxs)(y.Z,{title:(0,U.jsx)("div",{className:" font-semibold text-lg hardline",children:"使用说明"}),style:{maxWidth:"400px"},children:[(0,U.jsx)("div",{children:"1. 操作步骤如下:"}),(0,U.jsxs)("div",{className:"ml-3",children:["连接钱包 ",(0,U.jsx)(b.Z,{})," 创建交易 ",(0,U.jsx)(b.Z,{})," ","发送交易"]}),(0,U.jsxs)("div",{className:"ml-3",children:["创建交易: 选择项目 ",(0,U.jsx)(b.Z,{})," 选择图片"," ",(0,U.jsx)(b.Z,{})," 点击创建按钮 ",(0,U.jsx)(b.Z,{})," ","保存交易文件"]}),(0,U.jsxs)("div",{className:"ml-3",children:["发送交易:上传交易文件 ",(0,U.jsx)(b.Z,{})," 等待倒计时结束"]}),(0,U.jsx)("div",{className:"mt-3",children:"2. 注意事项:"}),(0,U.jsx)("div",{className:"ml-3",children:"a)交易文件的有效时间是一个小时,所以要在销毁前一个小时内提前生成;"}),(0,U.jsx)("div",{className:"ml-3",children:"b)交易文件的生成过程中,需要用户重复进行多次签名,虽然繁琐,但很安全,无需用户导入私钥;"}),(0,U.jsx)("div",{className:"ml-3",children:"c)每次切换账号前,都需要先断开账号的连接。"}),(0,U.jsx)("div",{className:"mt-3",children:"3. 费用说明:"}),(0,U.jsx)("div",{className:"ml-3",children:"免费使用。"})]}),(0,U.jsx)(y.Z,{title:(0,U.jsx)("div",{className:" font-semibold text-lg hardline",children:"创建交易"}),style:{width:"400px"},children:(0,U.jsxs)(C.A,{formRef:xt,onFinish:yt,onValuesChange:Et,layout:"vertical",loading:Ie,initialValues:{burnCreate:[],sellCreate:!0},submitter:{searchConfig:{submitText:"创建"},render:function(e,t){return[t[1],(0,U.jsx)(E.ZP,{onClick:Lt,children:"全选"},"all"),t[0],(0,U.jsx)("div",{children:st||""},"sign")]}},children:[(0,U.jsx)(k.Z,{name:"pidCreate",label:(0,U.jsxs)("div",{children:["项目",(0,U.jsx)(j.Z,{spin:Qe,className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"},onClick:Vt})]}),valueEnum:R,placeholder:"",rules:[{required:!0,whitespace:!0,message:"".concat(ct),pattern:/^.+$/}],fieldProps:{size:"large",autoFocus:!1,showSearch:!0,filterOption:function(e,t){var r=t.label.split("-"),n=m()(r,3),a=n[0],s=n[1],i=n[2];return(a.padStart(3,"0")+s+i).toLowerCase().includes(e.toLowerCase())},optionItemRender:function(e){var t=e.label.split("-"),r=m()(t,4),n=r[0],a=r[1],s=r[2],i=r[3];return(0,U.jsxs)("div",{className:"flex items-center",children:[(0,U.jsx)("div",{className:"mr-2",children:n.padStart(3,"0")}),(0,U.jsx)(L.C,{className:"mr-2",size:"default",src:i}),(0,U.jsxs)("div",{children:[a," @",s]})]})}}}),(0,U.jsx)(N.Z.Group,{name:"burnCreate",label:(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"图片 "}),tt.length?"(".concat(tt.length,")"):"",(0,U.jsx)(j.Z,{spin:$e,className:"ml-[5px]",style:{color:"#1677ff"}})]}),options:tt,rules:[{required:!0,whitespace:!0,message:"".concat(ct),pattern:/.*/}]}),(0,U.jsx)(Z.Z,{name:"sellCreate",label:(0,U.jsxs)("div",{children:["销毁并卖出",(0,U.jsx)(O.Z,{placement:"topLeft",title:"销毁获得代币后,是否立即卖出",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),rules:[{required:!0,message:"".concat(ct),whitespace:!0,pattern:/^true|false$/}],fieldProps:{autoFocus:!1,defaultValue:!0}}),(0,U.jsx)("div",{className:" text-red-600 text-lg mb-3",children:"注意:交易文件只在一个小时内有效!"})]})}),(0,U.jsx)(y.Z,{title:(0,U.jsx)("div",{className:" font-semibold text-lg hardline",children:lt}),style:{width:"400px"},children:(0,U.jsxs)(C.A,{formRef:gt,onFinish:Ct,onReset:Pt,submitter:{searchConfig:{submitText:ut},render:function(e,t){return[t[1],(0,U.jsx)(E.ZP,{loading:ze,onClick:Mt,children:"校对"},"check"),(0,U.jsx)(E.ZP,{onClick:Yt,children:"日志"},"log"),t[0]]}},initialValues:{disorderSend:!0,auto:!0,repeatSend:10,intervalSend:1e3,leadTimeSend:0},children:[(0,U.jsx)(_.Z,{label:"交易文件",name:"transactionInfo",action:"upload.do",fieldProps:{accept:".json",onChange:Ft,beforeUpload:function(){return!1},listType:"picture",onPreview:function(e){return bt.current.handleOpen(e)},fileList:K,maxCount:1},rules:[{required:!0,whitespace:!0,message:"".concat(ct),pattern:/.*/}]}),(0,U.jsx)(F.Z,{label:(0,U.jsxs)("div",{children:["整体重复发送次数",(0,U.jsx)(O.Z,{placement:"topLeft",title:"整体全部发送完成算一次,这里指定重复次数。重复发送失败了,不会影响金额",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),name:"repeatSend",placeholder:"",min:1,rules:[{required:!0,message:"".concat(ct),whitespace:!0,pattern:/^\d+$/}],fieldProps:{autoFocus:!1,size:"large",defaultValue:10}}),(0,U.jsx)(F.Z,{label:(0,U.jsxs)("div",{children:["整体重复发送间隔(毫秒)",(0,U.jsx)(O.Z,{placement:"topLeft",title:"整体全部发送完成算一次,这里指定重复的间隔时间",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),name:"intervalSend",placeholder:"",min:300,rules:[{required:!0,message:"".concat(ct),whitespace:!0,pattern:/^\d+$/}],fieldProps:{autoFocus:!1,size:"large",defaultValue:1e3}}),(0,U.jsx)(F.Z,{label:(0,U.jsxs)("div",{children:["提前发送时间(毫秒)",(0,U.jsx)(O.Z,{placement:"topLeft",title:"在下一轮开始前多少毫秒发送交易",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),name:"leadTimeSend",placeholder:"",max:2e3,min:0,rules:[{required:!0,message:"".concat(ct),whitespace:!0,pattern:/^\d+$/}],fieldProps:{autoFocus:!1,size:"large",defaultValue:0}}),(0,U.jsx)(Z.Z,{name:"auto",label:(0,U.jsxs)("div",{children:["是否自动发送",(0,U.jsx)(O.Z,{placement:"topLeft",title:"倒计时结束后,是否自动发送交易。开启与否,不影响手动操作来发",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),rules:[{required:!0,message:"".concat(ct),whitespace:!0,pattern:/^true|false$/}],fieldProps:{autoFocus:!1,defaultValue:!0}}),(0,U.jsx)(P.Z,{name:"startTime",label:(0,U.jsxs)("div",{children:["开始时间",(0,U.jsx)(O.Z,{placement:"topLeft",title:"销毁程序开始时间",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),placeholder:"自动生成,无需输入",fieldProps:{size:"large",autoFocus:!1,defaultValue:"",readOnly:!0}}),(0,U.jsx)(P.Z,{name:"endTime",label:(0,U.jsxs)("div",{children:["结束时间",(0,U.jsx)(O.Z,{placement:"topLeft",title:"销毁程序结束时间",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]}),placeholder:"自动生成,无需输入",fieldProps:{size:"large",autoFocus:!1,defaultValue:"",readOnly:!0}}),(0,U.jsx)(P.Z,{name:"amountSend",label:(0,U.jsx)("div",{children:"销毁所得代币总量"}),placeholder:"自动生成,无需输入",fieldProps:{size:"large",autoFocus:!1,defaultValue:"",readOnly:!0}}),(0,U.jsx)(C.A.Item,{label:(0,U.jsxs)("div",{className:" font-semibold text-lg ",children:[(0,U.jsx)("span",{className:"hardline",children:"倒计时 "}),Te.pid?"(".concat(Te.pid,"-").concat(Te.project_name," @").concat(Te.creator,")"):""]}),children:(0,U.jsx)("div",{className:"flex items-center gap-x-5",children:(0,U.jsx)(v.Wo,{className:"text-2xl",value:ye,onFinish:Zt,onChange:Nt})})}),(0,U.jsxs)(C.A.Item,{label:(0,U.jsxs)("div",{className:" font-semibold text-lg hardline",children:[(0,U.jsx)("span",{children:"结果 "}),be.length?"(".concat(be.length,")"):""]}),children:[(0,U.jsx)("div",{children:"成功:".concat(X,",失败:").concat(ne,",处理中:").concat(oe,",待处理:").concat(de)}),!!be.length&&(0,U.jsx)("div",{className:"flex flex-wrap gap-5 mt-3",children:Object.keys(vt.current).map((function(e,t){return(0,U.jsx)(Y.Z,{color:vt.current[e].status,children:"#".concat(e)},t)}))})]}),(0,U.jsxs)(C.A.Item,{label:(0,U.jsx)("div",{className:" font-semibold text-lg hardline",children:(0,U.jsxs)("div",{children:[(0,U.jsx)("span",{children:"校对 "}),be.length?"(".concat(be.length,")"):"",(0,U.jsx)(O.Z,{placement:"topLeft",title:"交易结束后,可点击校对按钮,判断交易结果是否跟链上数据匹配",children:(0,U.jsx)(S.Z,{className:"ml-[8px] hover:cursor-pointer",style:{color:"#1677ff"}})})]})}),children:[(0,U.jsx)("div",{children:"拥有:".concat(he)}),!!be.length&&(0,U.jsx)("div",{className:"flex flex-wrap gap-5 mt-3",children:Object.keys(Le).map((function(e,t){return(0,U.jsx)(Y.Z,{color:Le[e],children:"#".concat(e)},t)}))})]})]})}),s,(0,U.jsx)(h.s,{ref:bt})]}):(0,U.jsx)("div",{children:"此工具为收费功能,有需要请联系开发者。"})})}},64599:function(e,t,r){var n=r(96263);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var a=0,s=function(){};return{s:s,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(c)throw i}}}},e.exports.__esModule=!0,e.exports.default=e.exports}}]);