(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6166],{42311:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/ticket",function(){return t(87007)}])},94308:function(e,n){"use strict";n.Z={src:"/_next/static/media/success.d8a92069.svg",height:96,width:96,blurWidth:0,blurHeight:0}},87007:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return U},default:function(){return G}});var o=t(82729),i=t(85893),r=t(4281),s=t(67294),a=t(21073),l=t(29323),c=t(11163),d=t.n(c),u=t(81763),h=t(7159),p=t(90482),x=t(29787),m=t(20288),f=t(61232),g=t(73645),b=t(58199),w=t(74406),j=t(98087),y=t(37860),k=t(87536),v=t(80228),_=t(92879);t(31892);var N=t(39332),O=t(515);function I(){let e=(0,o._)(["\n grid-gap: ",";\n\n p {\n font-size: ",";\n line-height: ",";\n }\n\n img {\n width: 100%;\n cursor: pointer;\n }\n"]);return I=function(){return e},e}function S(){let e=(0,o._)(["\n height: ",";\n border-radius: ",";\n background-color: #f0f0f3;\n padding: 0 ",";\n\n &.error-box {\n outline: 1px solid #f25145;\n }\n\n &.placeholder {\n justify-content: flex-start;\n }\n"]);return S=function(){return e},e}function R(){let e=(0,o._)(["\n gap: 4px;\n font-size: 12px;\n line-height: 20px;\n margin: 0 auto 8px;\n\n a {\n color: #7a0;\n\n &:hover {\n color: #bade8b;\n text-decoration: underline;\n\n & ~ .www-icon {\n path {\n fill: #bade8b;\n }\n }\n }\n\n &:active {\n color: #527d00;\n\n & ~ .www-icon {\n path {\n fill: #527d00;\n }\n }\n }\n }\n .www-icon {\n height: 12px;\n width: 12px;\n\n path {\n fill: #7a0;\n }\n }\n span {\n color: #1c2024;\n }\n"]);return R=function(){return e},e}function L(){let e=(0,o._)(["\n gap: ",";\n .reject-tip {\n border-radius: 8px;\n background: #f2f2f5;\n font-size: 14px;\n font-weight: 500;\n padding: 8px;\n gap: 12px;\n line-height: 20px;\n .www-icon {\n width: 16px;\n height: 16px;\n flex: 0 0 16px;\n }\n .reject-info {\n color: #7e808a;\n gap: 8px;\n .www-icon {\n path {\n fill: #e5484d;\n }\n }\n }\n .reject-action {\n .view {\n color: #7a0;\n .www-icon {\n transform: rotate(-90deg);\n fill: #77aa00;\n flex: 0 0 12px;\n }\n\n margin-right: 8px;\n padding-right: 8px;\n border-right: 1px solid #dddde3;\n cursor: pointer;\n &:hover {\n opacity: 0.6;\n }\n }\n\n .close {\n height: 16px;\n flex: 0 0 16px;\n padding: 2px;\n border-radius: 99px;\n fill: #7e808a;\n background: rgba(0, 0, 0, 0.04);\n cursor: pointer;\n &:hover {\n opacity: 0.6;\n }\n }\n }\n }\n"]);return L=function(){return e},e}function z(){let e=(0,o._)(["\n width: 100%;\n cursor: pointer;\n\n .content-box {\n grid-gap: ",";\n font-weight: ",";\n\n .index {\n padding: ",";\n border: 1px solid #d9d9e0;\n padding: "," ",";\n font-size: ",";\n line-height: ",";\n color: #8b8d98;\n border-radius: ",";\n\n span {\n color: #1c2024;\n }\n }\n img {\n height: ",";\n width: ",";\n }\n > span {\n font-size: ",";\n line-height: ",";\n color: #1c2024;\n }\n }\n"]);return z=function(){return e},e}function C(){let e=(0,o._)(["\n grid-gap: ",";\n\n .header {\n grid-gap: ",";\n span {\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n }\n }\n\n .content-box {\n .info,\n .error {\n margin-top: ",";\n font-size: ",";\n line-height: ",";\n }\n .info {\n color: #65636d;\n }\n .error {\n color: #f25145;\n }\n }\n"]);return C=function(){return e},e}function T(){let e=(0,o._)(["\n max-width: 562px;\n margin: "," auto;\n border-radius: 16px;\n overflow: hidden;\n box-shadow: 0px 107px 30px 0px rgba(0, 0, 0, 0);\n\n > .header {\n padding: ",";\n background-color: #13202b;\n align-items: flex-start;\n grid-gap: ",";\n\n .title-box {\n grid-gap: ",";\n\n .title {\n font-size: ",";\n line-height: ",";\n color: #cdf160;\n }\n .desc {\n font-size: ",";\n line-height: ",";\n color: #fff;\n }\n }\n\n .link-button {\n background-color: #fff;\n padding: ",";\n border-radius: ",";\n white-space: nowrap;\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n grid-gap: ",";\n }\n }\n\n .question-btn {\n width: auto;\n height: ",";\n\n .www-icon {\n height: ",";\n width: ",";\n }\n }\n\n .form-box {\n padding: 32px;\n grid-gap: ",";\n\n .service-item {\n font-size: ",";\n line-height: ",";\n color: #65636d;\n margin-top: ",";\n\n .service-title {\n grid-gap: ",";\n .www-icon {\n height: ",";\n width: ",";\n flex-shrink: 0;\n }\n }\n }\n\n .form-select {\n background-color: #f0f0f3;\n border-radius: ",";\n height: ",";\n }\n\n .form-input {\n .input-control {\n background-color: #f0f0f3;\n height: ",";\n border-radius: ",";\n\n &.is-focus {\n background-color: #fff;\n }\n }\n }\n\n .dropdown-pop {\n .cui-scrollview {\n border-radius: ",";\n background-color: #fff;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n .option {\n &:hover {\n background-color: #f9f9f9;\n }\n }\n }\n }\n }\n\n .confirm-btn {\n height: ",";\n border-radius: ",";\n /* background-color: #00000033; */\n font-weight: ",";\n background-color: #cdf160;\n }\n "," {\n width: 100%;\n margin: 0;\n border-radius: 0;\n\n > .header {\n padding: "," ",";\n .title-box {\n grid-gap: ",";\n\n .title {\n font-size: ",";\n line-height: ",";\n }\n .desc {\n font-size: ",";\n line-height: ",";\n }\n }\n\n .link-button {\n > span {\n display: none;\n }\n }\n }\n .form-box {\n padding: "," ",";\n\n .dropdown-pop {\n .cui-scrollview {\n width: 100%;\n }\n }\n }\n }\n"]);return T=function(){return e},e}var M=(0,l.Pi)(()=>{var e;let n=(0,N.useSearchParams)(),{t}=(0,f.$G)("tools"),{upload:o,progress:l}=u.PT.useUploadFileToS3(),[c,d]=(0,s.useState)(!1),[v,_]=(0,s.useState)([]),[I,S]=(0,s.useState)([]),{control:R,handleSubmit:L,formState:{errors:z},watch:C,setError:T,setValue:M}=(0,k.cI)({defaultValues:{type:b.bR.NotReceived,tokenId:null!==(e=a.g.tokens[0].token_id)&&void 0!==e?e:"",amount:"",tx:"",orderId:"",memo:""}}),E=C("type"),A=C("tokenId"),D=C("amount"),W=C("tx");(0,s.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("token");e&&M("tokenId",e)},[]),(0,s.useEffect)(()=>{"refund"===n.get("t")?M("type",b.bR.WithdrawFail):M("type",b.bR.NotReceived)},[n]);let Q=(0,s.useMemo)(()=>{let e=[];return a.g.tokens.forEach(n=>{n.merge_tokens&&n.merge_tokens.length>0?n.merge_tokens.forEach(n=>{e.push({...n,label:"".concat(n.symbol," (").concat(n.chain_id,")"),value:n.token_id})}):n.contract&&e.push({...n,label:"".concat(n.symbol," (").concat(n.chain_id,")"),value:n.token_id})}),e},[a.g]),U=(0,s.useMemo)(()=>v.map(e=>({label:e.tx_hash,value:e})),[v]),G=(0,s.useMemo)(()=>{if(A)return Q.find(e=>e.token_id===A)},[Q,A]),$=(0,s.useMemo)(()=>{try{return(0,u.eu)(new p.Z(""===D?0:D).div(100).mul(18))}catch(e){return console.error(e),0}},[D]),J=async e=>{try{d(!0);let{list:n}=await h.nA.getTicketTransactionListApi(e);if(!(0,w.Z)(n)){_([]),M("indexData",void 0);return}_(n),M("indexData",n[0])}catch(e){(0,r.Notify)(e)}finally{d(!1)}},Y=()=>{h.nA.getMemoRecoveryList({status_list:[2],limit:3}).then(e=>{if((0,w.Z)(e)){let n=JSON.parse(localStorage.getItem("reject-tip")||"[]");S(e.filter(e=>!n.includes(e.record_id+e.updated)))}else S([])}).catch(r.Notify)};(0,s.useEffect)(()=>{(!a.account.isInited||a.account.isLogin)&&Y()},[a.account]);let K=(0,s.useCallback)((0,j.Z)(e=>J(e),1e3),[]),V=(0,s.useMemo)(()=>!!G&&((null==G?void 0:G.is_support_memo)||"SOL"===G.chain_id&&"SOL"===G.symbol),[G]);(0,s.useEffect)(()=>{G&&W&&V&&K({chain_id:G.chain_id,tx_hash:W})},[W,G]);let ee=L(async e=>{let{type:n,tx:s,amount:a,orderId:l,memo:c,file:d,indexData:u}=e;try{var p;if(!G)return;let e={question_type:n,chain_id:G.chain_id,contract:G.contract,symbol:G.symbol,tx_hash:s,quantity:V?null!==(p=null==u?void 0:u.amount)&&void 0!==p?p:"0":a,tx_order_id:void 0,tx_memo:void 0,proof_url:void 0,index:void 0};n===b.bR.WithdrawFail&&(e.tx_order_id=l),G.is_support_memo&&(e.tx_memo=c),V&&u&&(e.index=(0,y.Z)(Number(u.tx_index))?0:Number(u.tx_index));let{has_trade_tx:m,miss_reason:f}=await h.nA.checkTicketHash(e);switch(f){case"MissMemo":case"ErrMemo":(0,r.Notify)("Incorrect Memo. Please double check your Memo"),T("memo",{message:"Incorrect Memo. Please double check your Memo"});return;case"ErrTxOrderId":(0,r.Notify)("The Order ID entered does not match this transaction"),T("orderId",{message:"The Order ID entered does not match this transaction"});return;case"TxHashProcessed":(0,r.Notify)("Failed. You have already submitted a ticket for this TxID. Please check."),T("tx",{message:"Failed. You have already submitted a ticket for this TxID. Please check."});return;case"ErrTxId":(0,r.Notify)("Incorrect TXID/TXHash, Please double check your TXID/TXHash"),T("tx",{message:"Incorrect TXID/TXHash, Please double check your TXID/TXHash"});return;case"ErrAmount":(0,r.Notify)("Incorrect Amount, Please double check your Amount"),T("amount",{message:"Incorrect Amount, Please double check your Amount"});return;case"SystemMaintenance":(0,r.Notify)(f);return}if(!m){(0,r.Notify)(t("tools.select.file.notify")),T("tx",{message:"Invalid TXID/TXHash, please check"});return}let g=await h.nA.uploadPictureApi([{name:d.name,content_type:d.type,size:d.size,watermark:"CWallet"}]),w=null==g?void 0:g[0];if(!g)return T("file",{message:""}),(0,r.Notify)(t("tools.upload.notify2"));await o(d,w.upload_url,w.headers),e.proof_url=w.visit_url,await h.nA.submitMemoTicket(e),r.pop.push((0,i.jsx)(x.Z,{}))}catch(e){if(235014===e.code){(0,r.openKycApplyModal)(!0);return}if(235002===e.code)return;(0,r.Notify)(e)}});return(0,i.jsxs)(H,{children:[(0,i.jsxs)(r.Layout.RowBetween,{className:"header",children:[(0,i.jsxs)(r.Layout.Col,{className:"title-box",children:[(0,i.jsx)("h3",{className:"title",children:t("tools.coin.recovery")}),(0,i.jsx)("div",{className:"desc",children:t("tools.coin.info")})]}),(0,i.jsxs)(r.LinkButton,{className:"link-button",href:"./ticket/history",children:[(0,i.jsx)(r.Icon,{name:"history",className:"icon"}),(0,i.jsx)("span",{children:t("tools.my.tickets")})]})]}),(0,i.jsxs)(r.Layout.Col,{className:"form-box",children:[(0,i.jsx)(F,{children:I.map(e=>{let n={[b.bR.NotReceived]:t("tools.coin.tip.option1"),[b.bR.WithdrawFail]:t("tools.coin.tip.option1")},o=t("tools.coin.tip.text",["".concat(n[e.question_type]," - ").concat(e.quantity).concat(e.symbol)]);return(0,i.jsxs)(r.Layout.RowBetween,{className:"reject-tip",children:[(0,i.jsxs)(r.Layout.RowMiddle,{className:"reject-info",children:[(0,i.jsx)(r.Icon,{name:"tips",className:"tip-icon",viewBoxSize:24}),o]}),(0,i.jsxs)(r.Layout.RowMiddle,{className:"reject-action",children:[(0,i.jsxs)(r.Layout.RowMiddle,{className:"view",onClick:async()=>{await r.pop.push((0,i.jsx)(O.Z,{detail:e})),Y()},children:[t("tools.coin.tip.view")," ",(0,i.jsx)(r.Icon,{name:"Arrow"})]}),(0,i.jsx)(r.Icon,{name:"Close",className:"close",onClick:()=>{S(n=>n.filter(n=>n.record_id!==e.record_id));let n=[...JSON.parse(localStorage.getItem("reject-tip")||"[]"),e.record_id+e.updated];localStorage.setItem("reject-tip",JSON.stringify(n))}})]})]})})}),(0,i.jsx)(P,{label:t("txn.type"),children:(0,i.jsx)(k.Qr,{control:R,name:"type",rules:{required:!0},render:e=>{let{field:{value:n,onChange:o}}=e;return(0,i.jsx)(r.Select,{className:"form-select",value:n,options:[{label:t("tools.ticket.option1"),value:b.bR.NotReceived},{label:t("tools.ticket.option2"),value:b.bR.WithdrawFail}],onChange:o})}})}),(0,i.jsx)(P,{label:t("tools.ticket.token"),children:(0,i.jsx)(k.Qr,{control:R,name:"tokenId",rules:{required:!0},render:e=>{let{field:{value:n,onChange:t}}=e;return(0,i.jsx)(r.Select,{search:!0,className:"form-select",value:n,options:Q,onChange:t})}})}),!V&&(0,i.jsxs)(P,{label:t("tools.amount"),children:[(0,i.jsx)(k.Qr,{control:R,name:"amount",rules:{required:!0,validate:e=>null==G||!G.is_support_memo||!new p.Z(""===e?0:e).greaterThanOrEqualTo(0)},render:e=>{let{field:{value:n,onChange:o}}=e;return(0,i.jsx)(g.b0,{className:u.P6.classList("form-input","amount-input"),value:n,onInput:e=>{let n=e.currentTarget.value;/^(?:\d+(\.\d*)?|\.\d+)?$/.test(n)&&o(n)},placeholder:t("tools.enter.transfer.amount"),isError:!!z.amount})}}),(0,i.jsxs)(r.Layout.RowBetween,{className:"service-item",children:[(0,i.jsx)(g.u,{title:t("tools.service.tip"),align:a.B.isMobile?"left":"center",arrowX:a.B.isMobile?"24px":"",children:(0,i.jsxs)(r.Layout.RowMiddle,{className:"service-title",children:[(0,i.jsx)("span",{children:t("tools.service")}),(0,i.jsx)(r.Icon,{name:"info"})]})}),(0,i.jsx)("span",{children:"".concat($," ").concat(null==G?void 0:G.symbol)})]})]}),(0,i.jsx)(P,{label:E===b.bR.WithdrawFail?t("tools.ticket.refund.tx"):t("tools.ticket.tx"),children:(0,i.jsx)(k.Qr,{control:R,name:"tx",rules:{required:!0},render:e=>{let{field:{value:n,onChange:t}}=e;return(0,i.jsx)(g.b0,{isError:!!z.tx,className:u.P6.classList("form-input"),placeholder:"Enter here",value:n,onChange:t})}})}),E===b.bR.WithdrawFail&&(0,i.jsx)(P,{label:t("tools.tx.id"),children:(0,i.jsx)(k.Qr,{control:R,name:"orderId",rules:{required:!0},render:e=>{let{field:{value:n,onChange:o}}=e;return(0,i.jsx)(g.b0,{isError:!!z.orderId,className:"form-input",placeholder:t("tools.enter.here"),value:n,onChange:o})}})}),V&&(0,i.jsxs)(P,{label:t("tools.index.amount"),tag:(0,i.jsx)(r.Button,{className:"question-btn",onClick:()=>{r.pop.push((0,i.jsx)(Z,{}))},children:(0,i.jsx)(r.Icon,{name:"info"})}),children:[(0,i.jsx)(k.Qr,{control:R,name:"indexData",rules:{required:!0},render:e=>{let{field:{value:n,onChange:t}}=e;return(0,i.jsxs)(i.Fragment,{children:[c&&(0,i.jsx)(X,{children:(0,i.jsx)(r.Loading,{})}),!c&&0===v.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(X,{className:"placeholder ".concat(z.indexData?"error-box":""),children:"--"}),W&&G&&(0,i.jsx)("p",{className:"error",children:"Index not found, please check the TXID/TXHash."})]}),!c&&v.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Select,{className:"form-select",renderOption:e=>(0,i.jsx)(B,{token:G,data:e.value}),renderLabel:e=>(0,i.jsx)(B,{token:G,data:e.value}),value:n,onChange:t,options:U}),(0,i.jsx)("p",{className:"info",children:"Please select the index number of your transaction"})]})]})}}),(0,i.jsx)(r.Layout.RowBetween,{className:"service-item",children:(0,i.jsx)(g.u,{title:t("tools.service.tip"),align:a.B.isMobile?"left":"center",arrowX:a.B.isMobile?"24px":"",children:(0,i.jsxs)(r.Layout.RowMiddle,{className:"service-title",children:[(0,i.jsx)("span",{children:t("tools.service")}),(0,i.jsx)(r.Icon,{name:"info"})]})})})]}),G&&G.is_support_memo&&(0,i.jsx)(P,{label:t("tools.ticket.memo"),tag:(0,i.jsx)(r.Button,{className:"question-btn",onClick:()=>{r.pop.push((0,i.jsx)(q,{}))},children:(0,i.jsx)(r.Icon,{name:"info"})}),children:(0,i.jsx)(k.Qr,{control:R,name:"memo",rules:{required:!0},render:e=>{let{field:{value:n,onChange:o}}=e;return(0,i.jsx)(g.b0,{isError:!!z.memo,className:"form-input",placeholder:t("tools.enter.here"),value:n,onChange:o})}})}),(0,i.jsx)(k.Qr,{control:R,name:"file",rules:{required:!0},render:e=>{let{field:n}=e;return(0,i.jsx)(m.Z,{...n,error:!!z.file,guide:"https://www.youtube.com/watch?v=CmH17OQzqk0"})}}),(0,i.jsx)(g.xk,{onClick:ee,className:"confirm-btn",children:t("tools.enter.submit")})]})]})});let P=e=>{let{label:n,className:t="",children:o,tag:s}=e;return(0,i.jsxs)(W,{className:t,children:[(0,i.jsxs)(r.Layout.RowMiddle,{className:"header",children:[(0,i.jsx)("span",{children:n}),s]}),(0,i.jsx)("div",{className:"content-box",children:o})]})},B=e=>{let{token:n,data:t}=e;return n&&t?(0,i.jsx)(D,{children:(0,i.jsxs)(r.Layout.RowMiddle,{className:"content-box",children:[(0,i.jsxs)(r.Layout.Row,{className:"index",children:["index:",(0,i.jsx)("span",{children:null==t?void 0:t.tx_index})]}),(0,i.jsx)("img",{src:n.logo}),(0,i.jsx)("span",{children:"".concat(t.amount).concat(n.symbol)})]})}):null},Z=()=>(0,i.jsx)(g.cR,{title:"What is Index?",children:(0,i.jsxs)(A,{children:[(0,i.jsx)("p",{children:"The index refers to the position of your transaction within a complete Ton transfer, starting at 0 by default and incrementing sequentially. You can view transaction details in the Ton blockchain explorer. The image below is an example."}),(0,i.jsx)(E,{src:v.Pn.Ol.src})]})}),q=()=>(0,i.jsx)(g.cR,{title:"What is memo?",children:(0,i.jsxs)(A,{children:[(0,i.jsx)("p",{children:'In cryptocurrency, memo tokens (like TON, XRP, and XLM) will require a "memo" when you make transactions. A "memo" is a unique identifier, usually a string of numbers or letters, used alongside a wallet address to specify the intended recipient of a transaction, ensuring the funds are correctly credited to the right account. The two images below exemplify how to find your memo in Cwallet.'}),(0,i.jsx)(E,{src:v.Pn.I8.src})]})});function E(e){let{src:n}=e,[t,o]=(0,s.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("img",{src:n,alt:"",onClick:()=>o(!0),loading:"lazy"}),t&&(0,i.jsx)(_.Z,{mainSrc:n,onCloseRequest:()=>o(!1)})]})}let A=(0,u.zo)(r.Layout.Col)(I(),(0,u.hO)(24),(0,u.hO)(16),(0,u.hO)(24)),X=(0,u.zo)(r.Layout.Center)(S(),(0,u.hO)(48),(0,u.hO)(8),(0,u.hO)(12));(0,u.zo)(r.Layout.RowMiddle)(R());let F=(0,u.zo)(r.Layout.Col)(L(),(0,u.hO)(4)),D=(0,u.zo)(r.Layout.RowBetween)(z(),(0,u.hO)(8),e=>e.theme.Medium,(0,u.hO)(12),(0,u.hO)(4),(0,u.hO)(8),(0,u.hO)(12),(0,u.hO)(16),(0,u.hO)(12),(0,u.hO)(24),(0,u.hO)(24),(0,u.hO)(14),(0,u.hO)(20)),W=(0,u.zo)(r.Layout.Col)(C(),(0,u.hO)(8),(0,u.hO)(8),(0,u.hO)(14),(0,u.hO)(20),e=>e.theme.Semi,(0,u.hO)(8),(0,u.hO)(12),(0,u.hO)(16)),H=u.zo.div(T(),(0,u.hO)(32),(0,u.hO)(32),(0,u.hO)(16),(0,u.hO)(16),(0,u.hO)(28),(0,u.hO)(36),(0,u.hO)(14),(0,u.hO)(20),(0,u.hO)(8),(0,u.hO)(8),(0,u.hO)(12),(0,u.hO)(16),e=>e.theme.Semi,(0,u.hO)(6),(0,u.hO)(24),(0,u.hO)(12),(0,u.hO)(12),(0,u.hO)(24),(0,u.hO)(12),(0,u.hO)(16),(0,u.hO)(8),(0,u.hO)(4),(0,u.hO)(12),(0,u.hO)(12),(0,u.hO)(8),(0,u.hO)(48),(0,u.hO)(48),(0,u.hO)(8),(0,u.hO)(12),(0,u.hO)(48),(0,u.hO)(12),e=>e.theme.Semi,u.Uh.mobile,(0,u.hO)(24),(0,u.hO)(16),(0,u.hO)(8),(0,u.hO)(24),(0,u.hO)(32),(0,u.hO)(14),(0,u.hO)(20),(0,u.hO)(24),(0,u.hO)(16));function Q(){let e=(0,o._)(["\n height: 90vh;\n"]);return Q=function(){return e},e}var U=!0,G=(0,l.Pi)(()=>((0,s.useEffect)(()=>{if(a.account.isInited){if(a.account.isLogin)h.nA.getAccountPermissionsApi().then(e=>{e.has_sumsub_kyc||e.has_asset_whitelist||e.has_kyc_whitelist||(0,r.openKycApplyModal)(!0)}).catch();else{let e=new URLSearchParams(window.location.search).get("token"),n="https://".concat(u.OB.wwwDomain,"/tools/ticket");e&&(n+="?token=".concat(encodeURIComponent(e)));let t=encodeURIComponent(n);d().push("/login?backurl=".concat(t))}}},[a.account.isInited,a.account.isLogin]),a.g.inited)?(0,i.jsx)(M,{}):(0,i.jsx)($,{children:(0,i.jsx)(r.Loading,{})}));let $=(0,u.zo)(r.Layout.Center)(Q())},29787:function(e,n,t){"use strict";var o=t(85893),i=t(4281),r=t(41686),s=t(25675),a=t.n(s),l=t(94308),c=t(11163),d=t.n(c),u=t(61232);n.Z=()=>{let{t:e}=(0,u.$G)("tools");return(0,o.jsxs)(h,{closeable:!1,children:[(0,o.jsxs)(i.Layout.ColCenter,{className:"title-box",children:[(0,o.jsx)(a(),{src:l.Z,alt:"success-img",className:"success-img"}),(0,o.jsx)("div",{className:"text-sub",children:e("tools.submit.title")}),(0,o.jsx)("div",{className:"text-label",children:e("tools.submit.label")})]}),(0,o.jsxs)(i.Layout.RowMiddle,{className:"container",children:[(0,o.jsx)(i.Button,{className:"button view",onClick:()=>{d().pathname.includes("/tools/ticket/history")?(i.pop.close(),d().reload()):(i.pop.close(),d().push("./ticket/history"))},children:e("tools.submit.verify")}),(0,o.jsx)(i.Button,{className:"button",onClick:i.pop.back,children:e("tools.submit.got")})]})]})};let h=(0,r.ZP)(i.Pop).withConfig({componentId:"sc-f3f8e144-0"})(["width:428px;.title-box{.success-img{width:96px;height:96px;align-self:center;}.text-sub{font-size:24px;line-height:36px;font-weight:600;margin-top:24px;text-align:center;}.text-label{font-size:16px;line-height:24px;font-weight:400;margin-top:12px;text-align:center;}}.container{gap:12px;.button{margin-top:24px;flex:1;height:48px;border-radius:12px;background-color:#bdee63;font-size:16px;line-height:24px;font-weight:600;&.view{background-color:#f0f0f3;}}}"])},515:function(e,n,t){"use strict";var o=t(82729),i=t(85893),r=t(4281),s=t(67294),a=t(4115),l=t(7159),c=t(29787),d=t(61232),u=t(81763),h=t(58199),p=t(30381),x=t.n(p);function m(){let e=(0,o._)(["\n width: 428px;\n .container {\n margin-top: 16px;\n .drap-input {\n width: 0;\n height: 0;\n position: absolute;\n opacity: 0;\n }\n }\n .button {\n margin-top: 24px;\n width: 100%;\n height: 48px;\n border-radius: 12px;\n background-color: #bdee63;\n font-size: 16px;\n line-height: 24px;\n font-weight: 600;\n }\n"]);return m=function(){return e},e}function f(){let e=(0,o._)(["\n cursor: pointer;\n text-decoration: underline;\n &:hover {\n opacity: 0.7;\n }\n"]);return f=function(){return e},e}function g(){let e=(0,o._)(["\n border-radius: 12px;\n font-size: 12px;\n line-height: 16px;\n padding: 12px;\n margin: 6px 0;\n &.loading {\n background-color: rgba(0, 0, 85, 0.02);\n color: #60646c;\n }\n &.completed {\n background-color: rgba(0, 0, 85, 0.02);\n color: #60646c;\n }\n &.resubmit {\n background-color: rgba(255, 191, 1, 0.19);\n color: #ab6400;\n }\n"]);return g=function(){return e},e}function b(){let e=(0,o._)(["\n align-items: flex-start;\n padding: 6px 0;\n .title {\n font-size: 14px;\n line-height: 20px;\n color: #8b8d98;\n }\n .right-box {\n max-width: 50%;\n .value {\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n word-wrap: break-word;\n max-width: 100%;\n text-align: right;\n }\n }\n"]);return b=function(){return e},e}n.Z=e=>{var n,t;let{detail:o}=e,{t:p}=(0,d.$G)("tools"),x=(0,s.useRef)(null),[m,f]=(0,s.useState)(),{upload:g}=u.PT.useUploadFileToS3(),[b,k]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{(async()=>{if(m)try{k(!0);let e=await l.nA.uploadPictureApi([{name:m.name,content_type:m.type,size:m.size,watermark:"CWallet"}]),n=null==e?void 0:e[0];if(!n)return(0,r.Notify)(p("tools.upload.notify2"));await g(m,n.upload_url,n.headers),await l.nA.updateTicketProof({record_id:o.record_id,proof_url:n.visit_url}),r.pop.close(),r.pop.push((0,i.jsx)(c.Z,{}))}catch(e){(0,r.Notify)(e)}finally{k(!1)}})()},[m]),(0,i.jsx)(w,{title:p("tools.ticket.title"),children:(0,i.jsxs)("div",{className:"container",children:[(0,i.jsx)(j,{title:p("tools.ticket.id"),value:o.record_id}),(0,i.jsx)(j,{title:p("tools.ticket.type"),value:o.question_type===h.bR.NotReceived?p("tools.ticket.option1"):p("tools.ticket.option2")}),(0,i.jsx)(j,{title:p("tools.ticket.state"),children:(0,i.jsx)(a.m,{status:o.status})}),(0,i.jsx)(y,{status:o.status,reason:o.inject_reason,time:o.planed_pay_time}),(0,i.jsx)(j,{title:p("tools.ticket.token"),value:"".concat((0,u.eu)(o.quantity)," ").concat(o.symbol)}),(0,i.jsx)(j,{title:p("tools.service"),value:"".concat(h.ZB.SupportStatus_Success!==o.status?p("tools.coin.fee.planed"):""," ").concat((0,u.eu)(null!==(n=o.service_fee)&&void 0!==n?n:0)," ").concat(o.symbol)}),(0,i.jsx)(j,{title:"Index",value:null!==(t=o.index)&&void 0!==t?t:"-"}),(0,i.jsx)(j,{title:p("tools.ticket.tx"),value:o.tx_hash}),2===o.status?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Button,{loading:b,className:"button",onClick:()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.click()},children:p("tools.ticket.resubmit")}),(0,i.jsx)("input",{ref:x,className:"drap-input",size:52428800,type:"file",accept:".mp4",onChange:e=>{var n;let t=null===(n=e.target.files)||void 0===n?void 0:n[0];if(t){if(t.size>52428800){(0,r.Notify)(p("tools.upload.notify1"));return}f(t),x.current&&(x.current.value="")}}})]}):null]})})};let w=(0,u.zo)(r.Pop)(m()),j=e=>{let{title:n,value:t,children:o}=e;return(0,i.jsxs)(_,{children:[(0,i.jsx)("div",{className:"title",children:n}),(0,i.jsxs)(r.Layout.RowMiddle,{className:"right-box",children:[t&&(0,i.jsx)("div",{className:"value",children:t}),o]})]})},y=e=>{let{status:n,reason:t,time:o}=e,{t:a}=(0,d.$G)("tools"),l=(0,s.useMemo)(()=>({0:a("tools.ticket.key.hours"),1:a("tools.ticket.key.minutes"),2:a("tools.ticket.key.seconds")}),[]),[c]=u.PT.useCountdown(x().utc(o).valueOf()),p=(0,s.useMemo)(()=>{let[e,n,t,o]=c;return[(24*Number(e)+Number(n)).toString().padStart(2,"0"),t,o]},[c]);switch(n){case h.ZB.SupportStatus_Success:return(0,i.jsx)(v,{className:"completed",children:(0,i.jsx)("div",{children:a("tools.ticket.status1")})});case h.ZB.SupportStatus_Inject:let m={"Incomplete or unclear video proof":a("tools.coin.reason.Incomplete"),"Duplicate transaction proof":(0,i.jsxs)(i.Fragment,{children:[" ",a("tools.coin.reason.transaction1"),(0,i.jsx)(k,{onClick:()=>{r.pop.back(),(0,u.aL)()},children:a("tools.coin.reason.contactsupport")}),a("tools.coin.reason.transaction2")]})},f=t&&m[t]||a("tools.ticket.status2");return(0,i.jsx)(v,{className:"resubmit",children:(0,i.jsx)("div",{children:f})});case h.ZB.SupportStatus_Pending:case h.ZB.SupportStatus_Pass:return(0,i.jsxs)(v,{className:"loading",children:[a("tools.ticket.status.countdown"),p.map((e,n)=>"".concat(e," ").concat(l[n])).join(" ")]});default:return(0,i.jsx)(v,{className:"loading",children:(0,i.jsx)("div",{children:a("tools.ticket.status3")})})}},k=u.zo.span(f()),v=(0,u.zo)(r.Layout.RowMiddle)(g()),_=(0,u.zo)(r.Layout.RowBetween)(b())},4115:function(e,n,t){"use strict";t.d(n,{m:function(){return l}});var o=t(85893),i=t(4281),r=t(61232),s=t(41686),a=t(58199);let l=e=>{let{status:n}=e,{t}=(0,r.$G)("tools");switch(n){case a.ZB.SupportStatus_Success:return(0,o.jsx)(d,{className:"completed",children:(0,o.jsx)("div",{children:t("tools.ticket.completed")})});case a.ZB.SupportStatus_Inject:return(0,o.jsx)(d,{className:"canceled",children:(0,o.jsx)("div",{children:t("tools.ticket.reject")})});case a.ZB.SupportStatus_Pending:case a.ZB.SupportStatus_Pass:return(0,o.jsxs)(d,{className:"transfer",children:[(0,o.jsx)(i.Icon,{name:"loader2",className:"icon"}),(0,o.jsx)("div",{children:t("tools.in.transfer")})]});default:return(0,o.jsxs)(d,{className:"pending",children:[(0,o.jsx)(i.Icon,{name:"loader2",className:"icon"}),(0,o.jsx)("div",{children:t("tools.ticket.processing")})]})}},c=(0,s.F4)(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),d=(0,s.ZP)(i.Layout.RowMiddle).withConfig({componentId:"sc-1e4437a1-0"})(["display:flex;padding:2px 4px;align-items:center;gap:4px;width:min-content;justify-content:center;border-radius:4px;white-space:nowrap;font-weight:600;font-size:12px;line-height:16px;.icon{width:16px;height:16px;}&.completed{background-color:#d6f1df;color:#30a46c;}&.failed{background-color:#fff7f7;color:#e5484d;}&.pending{background-color:#ffefd6;color:#f76b15;.icon{fill:#f76b15;animation:"," 2s linear infinite;}}&.canceled{background-color:#fff7f7;color:#e5484d;}&.transfer{background-color:#edf2fe;color:#3e63dd;.icon{fill:#3e63dd;animation:"," 2s linear infinite;}}"],c,c)}},function(e){e.O(0,[4885,8445,7536,1046,3645,8325,2888,9774,179],function(){return e(e.s=42311)}),_N_E=e.O()}]);