@arcblock/payment-service 1.29.11 → 1.29.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cf.d.ts +11 -0
- package/dist/cf.js +41 -41
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -2
- package/package.json +3 -3
- package/web/assets/{account-DrsnH5wP.js → account-BN9x94rB.js} +1 -1
- package/web/assets/{action-C2c0yWuW.js → action-B9qBcxnd.js} +1 -1
- package/web/assets/{actions-BEUwbsq1.js → actions-BYX1WnBr.js} +1 -1
- package/web/assets/{actions-C9AfME83.js → actions-Bal42Hlw.js} +1 -1
- package/web/assets/{actions-D2-s31n3.js → actions-BmYfP6Ex.js} +1 -1
- package/web/assets/{actions-DeCPtfTK.js → actions-BvdAKBBR.js} +1 -1
- package/web/assets/{actions-DXMceTgd.js → actions-C0iB0sUH.js} +1 -1
- package/web/assets/{actions-JHsqbHpB.js → actions-C8z5APgU.js} +1 -1
- package/web/assets/{actions-DtNZGZWf.js → actions-CHC4oZpy.js} +1 -1
- package/web/assets/{actions-izdZ2Mn4.js → actions-CYXoOOED.js} +1 -1
- package/web/assets/{actions--FNKSNIs.js → actions-DTY0f0j8.js} +1 -1
- package/web/assets/{add-price-TdXAR3NW.js → add-price-BxoCZ-Tz.js} +1 -1
- package/web/assets/{admin-BpFv3eF5.js → admin--WTDrdAF.js} +1 -1
- package/web/assets/{assign-DKRfmN7W.js → assign-BOWJRdk_.js} +1 -1
- package/web/assets/{attempts-BfbYfiJa.js → attempts-D5nVVL_6.js} +1 -1
- package/web/assets/browser-QPNAlSRH.js +1 -0
- package/web/assets/{change-payment-j5UC8_h0.js → change-payment-DXontAeB.js} +1 -1
- package/web/assets/{change-plan-CtXvsIDw.js → change-plan-BsSmbAiG.js} +1 -1
- package/web/assets/{click-boundary-Bi28Y0Fq.js → click-boundary-Cozpjijr.js} +1 -1
- package/web/assets/{connect-CXek4LAE.js → connect-Wm36BWSB.js} +1 -1
- package/web/assets/{copyable-CprMHdhV.js → copyable-Dn7WoFib.js} +1 -1
- package/web/assets/{create-B-Ubepl_.js → create-4PWfxWLb.js} +1 -1
- package/web/assets/{create-IaalYGmm.js → create-7bXG85gU.js} +1 -1
- package/web/assets/{create-BWviSWbC.js → create-B5JxFhZm.js} +1 -1
- package/web/assets/{create-BVt_sQ_7.js → create-B9rgbz0l.js} +1 -1
- package/web/assets/{create-C6jihslA.js → create-DRn34vtT.js} +1 -1
- package/web/assets/{create-jzl1m8ZK.js → create-DSvEFvVu.js} +1 -1
- package/web/assets/{credit-grant-item-list-DQcvdSRs.js → credit-grant-item-list-B_vTdJGs.js} +1 -1
- package/web/assets/{credit-overview-CPId2vzk.js → credit-overview-hFT3I5RJ.js} +1 -1
- package/web/assets/{currency-restrictions-Dsupz2ce.js → currency-restrictions-DummyP0l.js} +1 -1
- package/web/assets/{currency-select-C8j7QQMP.js → currency-select-3BZ7dBe5.js} +1 -1
- package/web/assets/{dayjs-DUNWtvju.js → dayjs-t9Apc5Bb.js} +1 -1
- package/web/assets/{description-BHxdy5I3.js → description-Ci4-GOSF.js} +1 -1
- package/web/assets/{detail-BkRkrKyw.js → detail-8cEd6DEn.js} +1 -1
- package/web/assets/{detail-BdC9VIc6.js → detail-BH-Vvu0W.js} +1 -1
- package/web/assets/{detail-DUAJzKsu.js → detail-BO6Agb-b.js} +1 -1
- package/web/assets/{detail-H0dkKVyS.js → detail-BWPA3PH8.js} +1 -1
- package/web/assets/{detail-DTXDMIR9.js → detail-BgYHeC3e.js} +1 -1
- package/web/assets/{detail-CHJqYZ0W.js → detail-Bt5iQMX3.js} +1 -1
- package/web/assets/{detail-De8PyTyx.js → detail-BzlOf80w.js} +1 -1
- package/web/assets/{detail-MgdgGj5J.js → detail-C3T6qeB-.js} +1 -1
- package/web/assets/{detail-D729Bgs6.js → detail-C3_ACSpn.js} +1 -1
- package/web/assets/{detail-C--ATvwm.js → detail-CIUyjUAi.js} +1 -1
- package/web/assets/{detail-BvcI9cB_.js → detail-CPyUedtO.js} +1 -1
- package/web/assets/{detail-CmIweOLE.js → detail-CQWsMU9x.js} +1 -1
- package/web/assets/{detail-B17BN6kU.js → detail-CwTgF8q3.js} +1 -1
- package/web/assets/{detail-Dzt5tfyZ.js → detail-D1VjwguC.js} +1 -1
- package/web/assets/{detail-DQj1mbhA.js → detail-D4H6jbI1.js} +1 -1
- package/web/assets/{detail-WAmPM6yq.js → detail-D6NtqUGL.js} +1 -1
- package/web/assets/{detail-CfvKZ7IV.js → detail-D8kasVEc.js} +1 -1
- package/web/assets/{detail-DOcm4Kqg.js → detail-DMTZKNwK.js} +1 -1
- package/web/assets/{detail-DqfxOHky.js → detail-DO-7MCEH.js} +1 -1
- package/web/assets/{detail-g6el9Fxj.js → detail-DQfl09aa.js} +1 -1
- package/web/assets/{detail-DD1YBtex.js → detail-DtDNi9LO.js} +1 -1
- package/web/assets/{detail-BJEqTXDS.js → detail-VwGSacR5.js} +1 -1
- package/web/assets/{detail-BJ-hl5PK.js → detail-XRs3LPkf.js} +1 -1
- package/web/assets/{drawer-form-CQjNFFWk.js → drawer-form-CSWrmdZI.js} +1 -1
- package/web/assets/{edit-DAU8AWzT.js → edit-Cr-QHEQs.js} +1 -1
- package/web/assets/{editor-vZvxDUTl.js → editor-BzrYE3Ds.js} +1 -1
- package/web/assets/{embed-ClYNqZbf.js → embed-Dj1y7Zwp.js} +1 -1
- package/web/assets/{filter-toolbar-VvmMATj0.js → filter-toolbar-DpJmPWVP.js} +1 -1
- package/web/assets/{form-Bro99BjK.js → form-BBQXYqsx.js} +1 -1
- package/web/assets/{form-4_MzglPj.js → form-BJdpcmEf.js} +1 -1
- package/web/assets/{form-Cuvruf4H.js → form-BiiiQfiO.js} +1 -1
- package/web/assets/{form-AFzUvoFE.js → form-DPTZI-Fw.js} +1 -1
- package/web/assets/{form-CnrBCyTJ.js → form-nz7nSyN7.js} +1 -1
- package/web/assets/{gas-kw2KMH1u.js → gas-BGJEvZ8T.js} +1 -1
- package/web/assets/{generateCategoricalChart-BCpuUeC_.js → generateCategoricalChart-DJ3AfbsA.js} +1 -1
- package/web/assets/{home-ZNJREzbw.js → home-DfyGtwPb.js} +1 -1
- package/web/assets/index-B3Jk6ppU.js +1 -0
- package/web/assets/{index-BHwID_s4.js → index-B8bk0Ojf.js} +1 -1
- package/web/assets/{index-BtWfmATr.js → index-BFVHrFpT.js} +1 -1
- package/web/assets/{index-CPFlZhA2.js → index-BHIDYW0u.js} +1 -1
- package/web/assets/{index-DZkpxY-C.js → index-BNcCDKM5.js} +1 -1
- package/web/assets/{index-eDERHpkr.js → index-BPTu0yg7.js} +1 -1
- package/web/assets/index-BS70xmCD.js +1 -0
- package/web/assets/{index-BRmN8ViQ.js → index-BXCq4SkL.js} +1 -1
- package/web/assets/{index-C3AP4jq0.js → index-BXtNZIry.js} +1 -1
- package/web/assets/{index-B4yaPb7B.js → index-Bfp56O3W.js} +4 -4
- package/web/assets/{index-CKPfOW6M.js → index-BgQwjOVK.js} +1 -1
- package/web/assets/{index-DY-g0BPU.js → index-BhMKRIqj.js} +1 -1
- package/web/assets/{index-Dju8k6mq.js → index-Bo_vcdD9.js} +1 -1
- package/web/assets/{index-Dh9agU9O.js → index-BoqL8izO.js} +1 -1
- package/web/assets/{index-DAen2-cr.js → index-BuuQy4UK.js} +1 -1
- package/web/assets/{index-Dze0CpfQ.js → index-CQ7Ml281.js} +1 -1
- package/web/assets/{index-C3Rh1SaB.js → index-CcREcO7K.js} +1 -1
- package/web/assets/index-Cd-8zjpb.js +1 -0
- package/web/assets/{index-mgPU1lyd.js → index-CjPQC4mk.js} +1 -1
- package/web/assets/{index-C-5n472s.js → index-Cve8Vvzh.js} +1 -1
- package/web/assets/{index-olGOY5KB.js → index-Cvgxrbh_.js} +1 -1
- package/web/assets/{index-D7pWd60Z.js → index-D6Qc93ry.js} +1 -1
- package/web/assets/{index-ASk8vU2H.js → index-DA2h2xQ0.js} +1 -1
- package/web/assets/{index-CiWvs3j9.js → index-DAJUVYVW.js} +1 -1
- package/web/assets/{index-DwDNPqjF.js → index-DGlYR3g5.js} +1 -1
- package/web/assets/{index-BjKRyxNQ.js → index-DNwHUtwI.js} +1 -1
- package/web/assets/index-DVKKpTqA.js +1 -0
- package/web/assets/{index-DNobX-Tr.js → index-DdZRyqZe.js} +1 -1
- package/web/assets/{index-CH_k9MVv.js → index-DkHezF0C.js} +1 -1
- package/web/assets/index-DsYh3Cg8.js +1 -0
- package/web/assets/{index-x7sBb6oM.js → index-DxJqoRNV.js} +1 -1
- package/web/assets/{index-oy7LrXGT.js → index-HSIuOZNi.js} +1 -1
- package/web/assets/{index-CPyGjEd3.js → index-Z5VIg59-.js} +2 -2
- package/web/assets/index-_Owi04Rb.js +1 -0
- package/web/assets/index-bj4dA1Ad.js +1 -0
- package/web/assets/{index-B4n6PvPu.js → index-vdswLk79.js} +1 -1
- package/web/assets/{index-D6gv9jHh.js → index-vs4D4-i_.js} +1 -1
- package/web/assets/{index.es-C2Q6Owow.js → index.es-oPgScGhn.js} +1 -1
- package/web/assets/{info-card-C9dRgztS.js → info-card-Xtng8th6.js} +1 -1
- package/web/assets/{info-metric-ukWq8INi.js → info-metric-DwDA6oTc.js} +1 -1
- package/web/assets/{info-row-CaPaNF4L.js → info-row-Cr8bdDz0.js} +1 -1
- package/web/assets/{info-row-group-Cxo-4Gk5.js → info-row-group-qhfbrxfY.js} +1 -1
- package/web/assets/{libphonenumber-CTvobi0D.js → libphonenumber-DjN-XRyW.js} +1 -1
- package/web/assets/{link-DsltSF2Q.js → link-Dhj5mzaG.js} +1 -1
- package/web/assets/{list-BzgF4i3i.js → list-0fajnTAx.js} +1 -1
- package/web/assets/{list-B2b-s8wM.js → list-B6NGNObl.js} +1 -1
- package/web/assets/{list-DtEjqlED.js → list-BaGkIr9x.js} +1 -1
- package/web/assets/{list-ZaBapEXW.js → list-CMRLDBem.js} +1 -1
- package/web/assets/{list-CvM46TsP.js → list-CQ5uQIra.js} +1 -1
- package/web/assets/{list-O_uCSLFq.js → list-CZbuS490.js} +1 -1
- package/web/assets/{list-YNWVqjwW.js → list-DiFKB2Fh.js} +1 -1
- package/web/assets/{list-Cd1O-aDi.js → list-qrTTpMns.js} +1 -1
- package/web/assets/{metadata-_hV0ZaVh.js → metadata-C5loY77S.js} +1 -1
- package/web/assets/{meter-event-CPVBpekF.js → meter-event-BUamJsml.js} +1 -1
- package/web/assets/{metrics-DVPdwpyf.js → metrics-qFgjQM5V.js} +1 -1
- package/web/assets/{overview-CGdVIJrJ.js → overview-Bbyl7SwX.js} +1 -1
- package/web/assets/{overview-CN59I5Sc.js → overview-DPA4NQjh.js} +1 -1
- package/web/assets/{past-due-C3PtU8uo.js → past-due-D4jJMcjq.js} +1 -1
- package/web/assets/{pay-XVdSNq__.js → pay-s4cR1nfz.js} +1 -1
- package/web/assets/{payment-method-info-D_qR04xC.js → payment-method-info-Cto4lYu0.js} +1 -1
- package/web/assets/preview-DV7989ox.js +1 -0
- package/web/assets/{preview-F3lma170.js → preview-DrU96XLI.js} +1 -1
- package/web/assets/{pricing-table-Bt2WljzE.js → pricing-table-BstRGwem.js} +1 -1
- package/web/assets/{pricing-table-D9FGYBVa.js → pricing-table-CwzRykLm.js} +1 -1
- package/web/assets/{product-select-_72p-5lF.js → product-select-VFuyl5ev.js} +1 -1
- package/web/assets/{recharge-CSlKshbU.js → recharge-Dlg-3474.js} +1 -1
- package/web/assets/{related-credit-grants-DnKdAit6.js → related-credit-grants-BxHOJRRa.js} +3 -3
- package/web/assets/{safe-did-address-CRTPYo34.js → safe-did-address-Bj0hfqCH.js} +1 -1
- package/web/assets/{source-data-viewer-D1GShrs5.js → source-data-viewer-DQnM31KB.js} +1 -1
- package/web/assets/{status-3Swm2gK5.js → status-DlEqz2pS.js} +1 -1
- package/web/assets/{subscription-BX00k6FU.js → subscription-BJxso5rX.js} +1 -1
- package/web/assets/{subscription-Bzeblscr.js → subscription-DzHzZLOA.js} +1 -1
- package/web/assets/table-CyJj8e85.js +1 -0
- package/web/assets/{tax-code-select-j2arPbaE.js → tax-code-select-CoXANTPX.js} +1 -1
- package/web/assets/{tax-utils-B8J0Kfnz.js → tax-utils-BF4tobIJ.js} +1 -1
- package/web/assets/{uploader-BLdAbLR6.js → uploader-CV9IVKh1.js} +1 -1
- package/web/assets/{usage-records-BAwNs1y8.js → usage-records-nONbPDaL.js} +1 -1
- package/web/assets/{util-B8B3fsMa.js → util-Dp629jKU.js} +1 -1
- package/web/assets/{vendor-arcblock-D1drrE7q.js → vendor-arcblock-D34ufhta.js} +1 -1
- package/web/assets/{vendor-blocklet-B67R14so.js → vendor-blocklet-B8V2HFST.js} +2 -2
- package/web/index.html +1 -1
- package/web/assets/browser-DF2vfpBa.js +0 -1
- package/web/assets/index-BMcnd_jZ.js +0 -1
- package/web/assets/index-BdbLl6St.js +0 -1
- package/web/assets/index-BjLJQRKY.js +0 -1
- package/web/assets/index-BkNCPnTn.js +0 -1
- package/web/assets/index-BlAwTTmu.js +0 -1
- package/web/assets/index-CDyxbCzc.js +0 -1
- package/web/assets/index-ChC-jsE2.js +0 -1
- package/web/assets/preview-Bdtbh-xk.js +0 -1
- package/web/assets/table-BN3WBnr3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,B as a,q as n,x as c}from"./vendor-mui-BXZut9Pz.js";import{V as m,a6 as l,c7 as p}from"./vendor-blocklet-
|
|
1
|
+
import{j as r,B as a,q as n,x as c}from"./vendor-mui-BXZut9Pz.js";import{V as m,a6 as l,c7 as p}from"./vendor-blocklet-B8V2HFST.js";import{k as x}from"./util-Dp629jKU.js";import{I as f}from"./info-row-Cr8bdDz0.js";function b({data:e,handleEditMetadata:i=()=>{}}){const{t:s}=m();if(l(e))return r.jsxs(a,{sx:{textAlign:"center"},children:[r.jsx(n,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500},children:s("common.metadata.empty")}),r.jsx(n,{variant:"body2",sx:{color:"text.lighter"},children:s("common.metadata.emptyTip")}),r.jsx(c,{sx:{color:"text.link"},onClick:i,children:s("common.add")})]});const o=t=>x(t)?r.jsx("pre",{style:{whiteSpace:"break-spaces"},children:JSON.stringify(JSON.parse(t),null,2)}):p(t)?r.jsx("pre",{style:{whiteSpace:"break-spaces"},children:JSON.stringify(t,null,2)}):typeof t=="boolean"?String(t):t;return r.jsx(r.Fragment,{children:Object.keys(e||{}).map(t=>r.jsx(f,{label:t,value:o(e[t]),direction:"column",alignItems:"flex-start"},t))})}export{b as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as _,j as o,w as L}from"./vendor-mui-BXZut9Pz.js";import{V as C}from"./vendor-blocklet-
|
|
1
|
+
import{r as _,j as o,w as L}from"./vendor-mui-BXZut9Pz.js";import{V as C}from"./vendor-blocklet-B8V2HFST.js";import{n as S,j as R,T as z,e as $}from"./index-Bfp56O3W.js";import{b as B,L as p}from"./vendor-react-BPknnnEA.js";import{u as P}from"./table-CyJj8e85.js";import{u as T}from"./cache-state-lld4zuDg.js";import{C as k}from"./link-Dhj5mzaG.js";import{F as q}from"./filter-toolbar-DpJmPWVP.js";import{S as w}from"./index-DA2h2xQ0.js";import{S as D}from"./description-Ci4-GOSF.js";import{S as E}from"./status-DlEqz2pS.js";const v=(r={})=>{const c=new URLSearchParams;return Object.keys(r).forEach(l=>{let n=r[l];l==="q"&&(n=Object.entries(n).map(f=>f.join(":")).join(" ")),c.set(l,String(n))}),$.get(`/api/subscriptions?${c.toString()}`).then(l=>l.data)},A=r=>r.customer_id?`customer-subscriptions-${r.customer_id}`:"subscriptions";function Q({customer_id:r="",features:c={customer:!0,filter:!0},status:l=""}){const[n]=B(),f=A({customer_id:r}),{t:m}=C(),j=P(20),[s,u]=T(f,{defaultValue:{status:l||"active",customer_id:r,pageSize:j,page:1,price_id:""},getUrlParams:()=>{const t={};return n.has("status")&&(t.status=n.get("status")),n.has("customer_id")&&(t.customer_id=n.get("customer_id")),t}}),[a,x]=_.useState({}),h=()=>v(s).then(t=>{x(t)});if(_.useEffect(()=>{h()},[s]),!a.list)return o.jsx(L,{});const b=[{label:m("admin.subscription.product"),name:"id",options:{customBodyRenderLite:(t,i)=>{const e=a.list[i];return o.jsx(p,{to:`/admin/billing/${e.id}`,children:o.jsx(D,{subscription:e})})}}},{label:m("common.status"),name:"status",options:{filter:!0,customBodyRenderLite:(t,i)=>{const e=a.list[i];return o.jsx(p,{to:`/admin/billing/${e.id}`,children:o.jsx(E,{subscription:e})})}}},{label:m("admin.subscription.collectionMethod"),name:"collection_method",options:{customBodyRenderLite:(t,i)=>{const e=a.list[i];return o.jsx(p,{to:`/admin/billing/${e.id}`,children:o.jsx(S,{label:e.collection_method==="charge_automatically"?"Auto":"Manual",color:e.collection_method==="charge_automatically"?"default":"warning"})})}}},{label:m("admin.subscription.channel"),name:"channel",options:{filter:!0,customBodyRenderLite:(t,i)=>{const e=a.list[i],d=e.channel||e.paymentMethod?.type;if(!d)return null;let g="default";return d==="google_play"||d==="app_store"?g="primary":d==="stripe"&&(g="secondary"),o.jsx(p,{to:`/admin/billing/${e.id}`,children:o.jsx(S,{label:d,color:g})})}}},{label:m("common.createdAt"),name:"created_at",options:{sort:!0,customBodyRenderLite:(t,i)=>{const e=a.list[i];return o.jsx(p,{to:`/admin/billing/${e.id}`,children:R(e.created_at)})}}},{label:m("common.actions"),name:"id",width:100,align:"center",options:{sort:!1,customBodyRenderLite:(t,i)=>{const e=a.list[i];return o.jsx(w,{data:e,onChange:h})}}}];c?.customer&&b.splice(3,0,{label:m("common.customer"),name:"customer_id",options:{filter:!0,customBodyRenderLite:(t,i)=>{const e=a.list[i];return o.jsx(k,{customer:e.customer})}}});const y=({page:t,rowsPerPage:i})=>{s.pageSize!==i?u(e=>({...e,pageSize:i,page:1})):s.page!==t+1&&u(e=>({...e,page:t+1}))};return o.jsx(z,{hasRowLink:!0,data:a.list,columns:b,loading:!a.list,onChange:y,durable:`__${f}__`,durableKeys:["searchText"],options:{count:a.count,page:s.page-1,rowsPerPage:s.pageSize,onColumnSortChange(t,i){u({...s,q:s.q||{},o:i})},onSearchChange:t=>{u(t?{...s,q:{"like-metadata":t,"like-description":t,"like-id":t},pageSize:100,page:1}:{...s,pageSize:100,page:1,q:{}})}},toolbar:c?.toolbar,footer:c?.footer,title:c?.filter&&o.jsx(q,{setSearch:u,search:s,status:["active","trialing","paused","past_due","canceled","incomplete","incomplete_expired"],formatStatus:t=>t==="canceled"?"ended":t})})}export{Q as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,j as t,w as H,a3 as R,q as p,O as q,N as Q,bj as Y}from"./vendor-mui-BXZut9Pz.js";import{V as J,G as X}from"./vendor-blocklet-
|
|
1
|
+
import{r as L,j as t,w as H,a3 as R,q as p,O as q,N as Q,bj as Y}from"./vendor-mui-BXZut9Pz.js";import{V as J,G as X}from"./vendor-blocklet-B8V2HFST.js";import{j as b,aV as Z,aS as M,b6 as ee,v as te,n as U,s as ne,t as E,T as oe,e as ae,a9 as se}from"./index-Bfp56O3W.js";import{b as re,L as ie}from"./vendor-react-BPknnnEA.js";import{u as ce}from"./table-CyJj8e85.js";import{u as le}from"./cache-state-lld4zuDg.js";import{C as me}from"./link-Dhj5mzaG.js";import{F as ue}from"./filter-toolbar-DpJmPWVP.js";import{I as de}from"./action-B9qBcxnd.js";const pe=r=>{const u=r.lines||[];for(const i of u){const l=i.metadata?.quote;if(l?.exchange_rate)return l}return null},ge=(r={})=>{const u=new URLSearchParams,i={include_quote:!0,...r};return Object.keys(i).forEach(l=>{let g=i[l];g==null||g===""||(l==="q"&&(g=Object.entries(g).map(y=>y.join(":")).join(" ")),u.set(l,String(g)))}),ae.get(`/api/invoices?${u.toString()}`).then(l=>l.data)},he=r=>r.customer_id?`customer-invoices-${r.customer_id}`:r.subscription_id?`subscription-invoices-${r.subscription_id}`:r.tax_rate_id?`tax-rate-invoices-${r.tax_rate_id}`:"invoices",fe=r=>r.id.startsWith("in_")?{external:!1,url:`/admin/billing/${r.id}`}:{external:!0,connect:!1,url:se(r.paymentMethod,r.metadata?.payment_details).link};function h({invoice:r,children:u}){const i=fe(r);return i.external?t.jsx("a",{href:i.url,target:"_blank",rel:"noreferrer",children:u}):t.jsx(ie,{to:i.url,children:u})}function Re({customer_id:r="",subscription_id:u="",tax_rate_id:i="",features:l={customer:!0,filter:!0},status:g="",include_staking:y=!1,include_return_staking:C=!1,ignore_zero:w=!1,mode:N="admin"}){const[_]=re(),k=he({customer_id:r,subscription_id:u}),{t:s,locale:v}=J(),W=ce(20),[m,f]=le(k,{defaultValue:{status:g,customer_id:r,subscription_id:u,tax_rate_id:i,pageSize:W,page:1,ignore_zero:!!w,include_staking:!!y,include_return_staking:!!C},getUrlParams:()=>{const n={};return _.has("status")&&(n.status=_.get("status")),_.has("currency_id")&&(n.currency_id=_.get("currency_id")),_.has("customer_id")&&(n.customer_id=_.get("customer_id")),n}}),[c,F]=L.useState({}),I=()=>ge({...m,include_staking:!!y,ignore_zero:!!w,include_return_staking:!!C,tax_rate_id:i}).then(n=>{F(n)});if(L.useEffect(()=>{I()},[m]),L.useEffect(()=>{i&&m?.tax_rate_id!==i&&f(n=>({...n||{},tax_rate_id:i,page:1}))},[i]),!c.list)return t.jsx(H,{});const B=[{label:s("common.amount"),name:"total",width:80,align:"right",options:{customBodyRenderLite:(n,a)=>{const e=c.list[a],o=pe(e),d=o?.providers||[],T=d.map(x=>x.provider_name).filter(Boolean);let j="—";d.length>1?j=`${T[0]||d[0]?.provider_id||"data"} (${d.length} sources)`:d.length===1?j=T[0]||d[0]?.provider_id||"—":j=o?.rate_provider_name||o?.rate_provider_id||"—";const O=o?.consensus_method||(d.length>1?"median":"single"),V=o?.rate_timestamp_ms?b(o.rate_timestamp_ms):"—",z=o?.degraded?s("customer.quote.degraded"):null,A=o?.base_amount?`${o.base_amount} ${o.base_currency||"USD"}`:null,$=Z(o?.exchange_rate||null),D=$?(()=>{const P={USD:"$",CNY:"¥"}[o?.base_currency];return`1 ${e.paymentCurrency.symbol} ≈ ${P?`${P}${$}`:`${$} ${o?.base_currency||"USD"}`}`})():null;let S=null;if(o?.base_amount)S=M(o.base_amount,v);else if(o?.exchange_rate&&e.total){const x=ee(new X(e.total),e.paymentCurrency.decimal,o.exchange_rate);x&&(S=M(x,v))}const G=o?t.jsxs(R,{spacing:.5,children:[t.jsxs(p,{variant:"caption",children:[s("customer.quote.provider"),": ",j||"—"]}),A&&t.jsxs(p,{variant:"caption",children:[s("customer.quote.baseAmount"),": ",A]}),D&&t.jsxs(p,{variant:"caption",children:[s("customer.quote.exchangeRate"),": ",D]}),t.jsxs(p,{variant:"caption",children:[s("customer.quote.rateTimestamp"),": ",V]}),t.jsxs(p,{variant:"caption",children:[s("customer.quote.consensusMethod"),": ",O]}),z&&t.jsxs(p,{variant:"caption",children:[s("common.status"),": ",z,o?.degraded_reason?` (${o.degraded_reason})`:""]}),o.slippage_percent!==null&&o.slippage_percent!==void 0&&t.jsxs(p,{variant:"caption",children:[s("customer.quote.slippage"),": ",o.slippage_percent,"%"]})]}):null;return t.jsx(h,{invoice:e,children:t.jsxs(R,{spacing:.25,alignItems:"flex-end",children:[t.jsxs(p,{component:"strong",sx:{fontWeight:600,textDecoration:e.status==="void"?"line-through":"none"},children:[te(e?.total,e?.paymentCurrency.decimal)," ",e?.paymentCurrency.symbol]}),S&&t.jsx(q,{title:G,placement:"top",arrow:!0,children:t.jsxs(p,{variant:"caption",sx:{color:"text.secondary",fontSize:"0.75rem",fontWeight:400,lineHeight:1.2},children:["≈ $",S]})})]})})}}},{label:s("common.paymentMethod"),name:"paymentMethod",width:120,options:{customBodyRenderLite:(n,a)=>{const e=c?.list[a];return t.jsx(h,{invoice:e,children:t.jsxs(p,{sx:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Q,{src:e.paymentMethod.logo,sx:{width:18,height:18,mr:1}}),e.paymentMethod.name]})})}}},{label:s("common.status"),name:"status",width:120,options:{customBodyRenderLite:(n,a)=>{const e=c.list[a],o=e?.status==="uncollectible"&&e?.metadata?.slippage?.below_threshold;return t.jsx(h,{invoice:e,children:t.jsxs(R,{direction:"row",spacing:.5,alignItems:"center",children:[t.jsx(U,{label:e?.status,color:ne(e?.status)}),o&&t.jsx(q,{title:s("payment.customer.invoice.slippageExceededDetail",{currentRate:e.metadata?.slippage?.rate_at_invoice||"—",minRate:e.metadata?.slippage?.min_acceptable_rate||"—"}),arrow:!0,placement:"top",children:t.jsx(Y,{sx:{fontSize:16,color:"warning.main",cursor:"help"}})})]})})}}},{label:s("common.type"),name:"billing_reason",options:{customBodyRenderLite:(n,a)=>{const e=c.list[a];return t.jsx(h,{invoice:e,children:t.jsx(U,{label:E(e,v)?.type})})}}},{label:s("admin.invoice.number"),name:"number",options:{customBodyRenderLite:(n,a)=>{const e=c.list[a];return t.jsx(h,{invoice:e,children:e.number})}}},{label:s("common.description"),name:"description",minWidth:120,options:{customBodyRenderLite:(n,a)=>{const e=c.list[a];return t.jsx(h,{invoice:e,children:E(e,v)?.description||e?.id})}}},{label:s("common.createdAt"),name:"created_at",options:{sort:!0,customBodyRenderLite:(n,a)=>{const e=c.list[a];return t.jsx(h,{invoice:e,children:b(e.created_at)})}}},{label:s("common.updatedAt"),name:"updated_at",options:{sort:!0,customBodyRenderLite:(n,a)=>{const e=c.list[a],o=e.period_start>0&&e.period_end>0,d=t.jsx(h,{invoice:e,children:b(e.updated_at)});return o?t.jsx(q,{title:`${s("common.billingPeriod")}: ${b(e.period_start*1e3)} ~ ${b(e.period_end*1e3)}`,children:d}):d}}},{label:s("common.actions"),name:"id",width:100,align:"center",options:{sort:!1,customBodyRenderLite:(n,a)=>{const e=c.list[a];return t.jsx(de,{data:e,onChange:I,mode:N})}}}].filter(Boolean);l?.customer&&B.splice(2,0,{label:s("common.customer"),name:"customer_id",options:{customBodyRenderLite:(n,a)=>{const e=c.list[a];return t.jsx(me,{customer:e.customer,size:"small"})}}});const K=({page:n,rowsPerPage:a})=>{m.pageSize!==a?f(e=>({...e,pageSize:a,page:1})):m.page!==n+1&&f(e=>({...e,page:n+1}))};return t.jsx(oe,{hasRowLink:!0,data:c.list,durable:`__${k}__`,durableKeys:["searchText"],columns:B,loading:!c.list,onChange:K,options:{count:c.count,page:m.page-1,rowsPerPage:m.pageSize,onColumnSortChange(n,a){f({...m,q:m.q||{},o:a})},onSearchChange:n=>{f(n?{...m,q:{"like-description":n,"like-metadata":n,"like-number":n},pageSize:100,page:1}:{...m,pageSize:100,page:1,q:{}})}},toolbar:l?.toolbar,footer:l?.footer,title:l?.filter&&t.jsx(ue,{setSearch:f,search:m,status:["open","paid","uncollectible","draft","void"],currency:!0}),emptyNodeText:`${s("empty.invoices")}`})}export{Re as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as b,j as d,A as T,w as g,q as f,bf as D,B as I}from"./vendor-mui-BXZut9Pz.js";import{cv as k,V as x,P as S,F as A}from"./vendor-blocklet-
|
|
1
|
+
import{r as b,j as d,A as T,w as g,q as f,bf as D,B as I}from"./vendor-mui-BXZut9Pz.js";import{cv as k,V as x,P as S,F as A}from"./vendor-blocklet-B8V2HFST.js";import{b as P,j as R,T as z,l as E,e as L}from"./index-Bfp56O3W.js";import{u as B}from"./table-CyJj8e85.js";const C=(e={})=>{const n=new URLSearchParams;return Object.keys(e).forEach(a=>{n.set(a,String(e[a]))}),L.get(`/api/events?${n.toString()}`).then(a=>a.data)},q=e=>e.type?`events-${e.type}`:e.object_id?`events-${e.object_id}`:"events",K=e=>{switch(e.type){case"product.created":return`A new product ${e.object_id} was created`;case"product.updated":return`The product with ID ${e.object_id} was updated`;case"product.deleted":return`The product with ID ${e.object_id} was deleted`;case"price.created":return`A new price ${e.object_id} was created`;case"price.updated":return`The price with ID ${e.object_id} was updated`;case"price.deleted":return`The price with ID ${e.object_id} was deleted`;case"payment_link.created":return`A new payment link ${e.object_id} was created`;case"payment_link.updated":return`The payment link with ID ${e.object_id} was updated`;case"payment_link.deleted":return`The payment link with ID ${e.object_id} was deleted`;case"payment_intent.created":return`A new payment intent ${e.object_id} was created`;case"payment_intent.updated":return`The payment intent with ID ${e.object_id} was updated`;case"payment_intent.canceled":return`The payment intent with ID ${e.object_id} was canceled`;case"payment_intent.succeeded":return`The payment intent with ID ${e.object_id} succeeded`;case"payment_intent.processing":return`The payment intent with ID ${e.object_id} is processing`;case"payment_intent.requires_action":return`The payment intent with ID ${e.object_id} requires user action`;case"payment_intent.payment_failed":return`The payment intent with ID ${e.object_id} failed to pay`;case"payment_intent.deleted":return`The payment intent with ID ${e.object_id} was deleted`;case"customer.created":return`A new customer ${e.object_id} was created`;case"customer.updated":return`The customer with ID ${e.object_id} was updated`;case"customer.deleted":return`The customer with ID ${e.object_id} was deleted`;case"invoice.created":return`A new invoice ${e.object_id} was created`;case"invoice.finalized":return`The invoice with ID ${e.object_id} was finalized`;case"invoice.updated":return`The invoice with ID ${e.object_id} was updated`;case"invoice.voided":return`The invoice with ID ${e.object_id} was marked as void`;case"invoice.paid":return`The invoice with ID ${e.object_id} was marked as paid`;case"invoice.marked_uncollectible":return`The invoice with ID ${e.object_id} was marked as uncollectible`;case"invoice.deleted":return`The invoice with ID ${e.object_id} was deleted`;case"checkout.session.completed":return`The checkout session ${e.object_id} completed`;case"checkout.session.expired":return`The checkout session ${e.object_id} expired`;case"customer.subscription.created":return`A new subscription ${e.object_id} was created`;case"customer.subscription.updated":return`The subscription with ID ${e.object_id} was updated`;case"customer.subscription.resumed":return`The subscription with ID ${e.object_id} was resumed`;case"customer.subscription.paused":return`The subscription with ID ${e.object_id} was paused`;case"customer.subscription.deleted":return`The subscription with ID ${e.object_id} was canceled`;default:return`${e.type}: ${e.object_id}`}};function W({type:e="",object_id:n="",features:a={toolbar:!0}}){const p=q({type:e,object_id:n}),u=k(p),{t:o}=x(),_=B(u.rowsPerPage||50),[r,h]=b.useState({type:e,object_id:n,pageSize:_,page:u.page?u.page+1:1}),{startTransition:j}=P(),{loading:m,error:l,data:t,refresh:w}=S(()=>C(r));if(b.useEffect(()=>{w()},[r,w]),l)return d.jsx(T,{severity:"error",children:l.message});if(m||!t)return d.jsx(g,{});if(t&&t.list.length===0)return d.jsx(f,{sx:{color:"text.secondary"},children:o("admin.event.empty")});const y=[{label:o("common.description"),name:"type",options:{customBodyRenderLite:(s,c)=>{const i=t.list[c];return K(i)}}},{label:o("common.id"),name:"id"},{label:o("common.createdAt"),name:"created_at",minWidth:100,options:{customBodyRender:s=>R(s)}}].filter(Boolean),$=({page:s,rowsPerPage:c})=>{r.pageSize!==c?h(i=>({...i,pageSize:c,page:1})):r.page!==s+1&&h(i=>({...i,page:s+1}))};return d.jsx(U,{children:d.jsx(z,{hasRowLink:!0,durable:p,durableKeys:["page","rowsPerPage"],data:t.list,columns:y,loading:m,onChange:$,options:{count:t.count,page:r.page-1,rowsPerPage:r.pageSize,onRowClick:(s,{dataIndex:c})=>{const i=t.list[c];j(()=>{window.open(A(E(),`/admin/developers/${i.id}`),"_blank")})}},toolbar:a?.toolbar,emptyNodeText:o("empty.events")})})}const U=D(I)`
|
|
2
2
|
td {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as g,j as e,B as x,x as T,o as $,bp as B,aJ as I,ad as R,a2 as N,aG as P,aH as M,s as O,q as S,O as D}from"./vendor-mui-BXZut9Pz.js";import{V as w,cv as E,O as U,P as F,bQ as W}from"./vendor-blocklet-
|
|
1
|
+
import{r as g,j as e,B as x,x as T,o as $,bp as B,aJ as I,ad as R,a2 as N,aG as P,aH as M,s as O,q as S,O as D}from"./vendor-mui-BXZut9Pz.js";import{V as w,cv as E,O as U,P as F,bQ as W}from"./vendor-blocklet-B8V2HFST.js";import{aa as _,ab as z,ac as k,b9 as L,n as H,j as K,T as V,e as G}from"./index-Bfp56O3W.js";import{C as J}from"./copyable-Dn7WoFib.js";import{g as Q,a as Y,T as X}from"./tax-utils-BF4tobIJ.js";import{a as Z}from"./vendor-react-BPknnnEA.js";import"./click-boundary-Cozpjijr.js";import"./actions-BYX1WnBr.js";import"./drawer-form-CSWrmdZI.js";import"./index-BXtNZIry.js";import"./collapse-CSrlJ0eG.js";import"./form-nz7nSyN7.js";import"./lodash-B4Ozcv0x.js";import"./util-Dp629jKU.js";import"./tax-code-select-CoXANTPX.js";import"./collapse-BvbJGg1V.js";const ee=O(x)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,j as s,w as L,q as f,N as C}from"./vendor-mui-BXZut9Pz.js";import{V as P}from"./vendor-blocklet-
|
|
1
|
+
import{r as y,j as s,w as L,q as f,N as C}from"./vendor-mui-BXZut9Pz.js";import{V as P}from"./vendor-blocklet-B8V2HFST.js";import{i as R,n as q,o as w,j as _,T as $,e as B}from"./index-Bfp56O3W.js";import{b as z,L as d}from"./vendor-react-BPknnnEA.js";import{u as T}from"./table-CyJj8e85.js";import{d as v}from"./util-Dp629jKU.js";import{u as k}from"./cache-state-lld4zuDg.js";import{C as A}from"./link-Dhj5mzaG.js";import{F as D}from"./filter-toolbar-DpJmPWVP.js";import{P as E}from"./actions-C8z5APgU.js";const M=(r={})=>{const l=new URLSearchParams;return Object.keys(r).forEach(m=>{let o=r[m];m==="q"&&(o=Object.entries(o).map(c=>c.join(":")).join(" ")),l.set(m,String(o))}),B.get(`/api/payment-intents?${l.toString()}`).then(m=>m.data)},I=r=>r.customer_id?`customer-payments-${r.customer_id}`:r.invoice_id?`invoice-payments-${r.invoice_id}`:"payments";function Q({customer_id:r="",invoice_id:l="",features:m={customer:!0,filter:!0}}){const{t:o}=P(),[c]=z(),p=I({customer_id:r,invoice_id:l}),x=T(20),[i,u]=k(p,{defaultValue:{status:"",customer_id:r,invoice_id:l,pageSize:x,page:1},getUrlParams:()=>{const e={};return c.has("status")&&(e.status=c.get("status")),c.has("currency_id")&&(e.currency_id=c.get("currency_id")),c.has("customer_id")&&(e.customer_id=c.get("customer_id")),e}}),[n,j]=y.useState({}),h=()=>{M(i).then(e=>{j(e)})};if(y.useEffect(()=>{v(()=>{h()},300)()},[i]),!n.list)return s.jsx(L,{});const g=[{label:o("common.amount"),name:"id",align:"right",width:80,options:{customBodyRenderLite:(e,a)=>{const t=n.list[a],S=t.amount_received==="0"&&t.status!=="canceled";return s.jsx(d,{to:`/admin/payments/${t.id}`,children:s.jsxs(f,{component:"strong",sx:{fontWeight:600,color:S?"warning.main":"inherit"},children:[R(t.amount_received==="0"?t.amount:t.amount_received,t?.paymentCurrency.decimal)," ",t?.paymentCurrency.symbol]})})}}},{label:o("common.paymentMethod"),name:"paymentMethod",width:120,options:{customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(d,{to:`/admin/payments/${t.id}`,children:s.jsxs(f,{sx:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},children:[s.jsx(C,{src:t.paymentMethod.logo,sx:{width:18,height:18,mr:1}}),t.paymentMethod.name]})})}}},{label:o("common.status"),name:"status",width:80,options:{customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(d,{to:`/admin/payments/${t.id}`,children:s.jsx(q,{label:t.status,color:w(t.status)})})}}},{label:o("common.description"),name:"description",options:{customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(d,{to:`/admin/payments/${t.id}`,children:t.description||t.id})}}},{label:o("common.createdAt"),name:"created_at",options:{sort:!0,customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(d,{to:`/admin/payments/${t.id}`,children:_(t.created_at)})}}},{label:o("common.updatedAt"),name:"updated_at",options:{sort:!0,customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(d,{to:`/admin/payments/${t.id}`,children:_(t.updated_at)})}}},{label:o("common.actions"),name:"",options:{customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(E,{data:t,onChange:h})}}}];m?.customer&&g.splice(3,0,{label:o("common.customer"),name:"customer_id",options:{filter:!0,customBodyRenderLite:(e,a)=>{const t=n.list[a];return s.jsx(A,{customer:t.customer})}}});const b=({page:e,rowsPerPage:a})=>{i.pageSize!==a?u(t=>({...t,pageSize:a,page:1})):i.page!==e+1&&u(t=>({...t,page:e+1}))};return s.jsx($,{hasRowLink:!0,data:n.list||[],durable:`__${p}__`,durableKeys:["searchText"],columns:g,loading:!n.list,onChange:b,options:{count:n.count,page:i.page-1,rowsPerPage:i.pageSize,onSearchChange:e=>{u(e?{...i,q:{"like-description":e,"like-metadata":e},pageSize:100,page:1}:{...i,pageSize:100,page:1,q:{}})},onColumnSortChange(e,a){u({...i,q:i.q||{},o:a})}},toolbar:m?.toolbar,footer:m?.footer,title:m?.filter&&s.jsx(D,{setSearch:u,search:i,status:["succeeded","canceled","processing","requires_action","requires_capture","requires_payment_method","requires_confirmation"],currency:!0}),emptyNodeText:o("empty.payments")})}export{Q as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as t,a3 as P,q as w,a2 as z,B as E,x as L,w as T,N as k}from"./vendor-mui-BXZut9Pz.js";import{V as q,$ as A,Z as v,a7 as I,cx as D}from"./vendor-blocklet-
|
|
1
|
+
import{r as x,j as t,a3 as P,q as w,a2 as z,B as E,x as L,w as T,N as k}from"./vendor-mui-BXZut9Pz.js";import{V as q,$ as A,Z as v,a7 as I,cx as D}from"./vendor-blocklet-B8V2HFST.js";import{e as B,k as N,i as M,n as F,a6 as H,j as $,T as W}from"./index-Bfp56O3W.js";import{a as O,b as V,L as g}from"./vendor-react-BPknnnEA.js";import{u as K}from"./table-CyJj8e85.js";import{d as U,l as G}from"./util-Dp629jKU.js";import{u as Z}from"./cache-state-lld4zuDg.js";import{C as J}from"./link-Dhj5mzaG.js";import{F as Q}from"./filter-toolbar-DpJmPWVP.js";import{A as X}from"./actions-BYX1WnBr.js";import{C as Y}from"./click-boundary-Cozpjijr.js";import{I as ee}from"./info-card-Xtng8th6.js";function te({data:s,variant:p="compact",isCanceledSubscription:u=!1}){const{t:n}=q(),y=O(),[d,m]=x.useState(!1),[b,R]=x.useState(!1),[r,l]=x.useState(""),[i,f]=x.useState(""),h=5,j=c=>{const C=c.trim();return C?C.length<h?(f(n("admin.payout.refundReasonMinLength",{min:h})),!1):(f(""),!0):(f(n("admin.payout.refundReasonRequired")),!1)},a=c=>{l(c),i&&j(c)},o=async()=>{if(j(r)){m(!0);try{const{data:c}=await B.post(`/api/vendors/refund/${s.id}`,{reason:r.trim()});if(!c.error)v.success(n("admin.payout.refundRequested")),R(!1),l(""),f(""),window.location.reload();else throw new Error(c.error||"Failed to request refund")}catch(c){v.error(N(c))}finally{m(!1)}}},e=()=>{R(!1),l(""),f("")},_=r.trim().length>=h,S=[{label:n("admin.customer.view"),handler:()=>y(`/admin/customers/${s.customer_id}`),color:"primary",disabled:!1}];return u&&s.status==="paid"&&s.vendor_info?.vendor_id&&s.vendor_info?.order_id&&S.push({label:n("admin.payout.requestRefund"),handler:()=>R(!0),color:"warning",disabled:d||s.metadata?.refund_requested}),p==="compact"&&S.push({label:n("admin.paymentIntent.view"),handler:()=>y(`/admin/payments/${s.id}`),color:"primary",disabled:!1}),t.jsxs(Y,{children:[t.jsx(X,{variant:p,actions:S}),t.jsx(A,{open:b,onClose:e,title:n("admin.payout.requestRefund"),fullWidth:!0,actions:t.jsxs(E,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[t.jsx(L,{onClick:e,disabled:d,size:"small",variant:"outlined",children:n("common.cancel")}),t.jsx(L,{onClick:o,disabled:d||!_,variant:"contained",color:"warning",size:"small",children:n("common.confirm")})]}),children:t.jsxs(P,{spacing:2,children:[t.jsx(w,{variant:"body2",color:"text.secondary",sx:{lineHeight:1.6},children:n("admin.payout.confirmRefund")}),t.jsx(z,{value:r,onChange:c=>a(c.target.value),onBlur:()=>j(r),label:n("admin.payout.refundReason"),placeholder:n("admin.payout.refundReasonPlaceholder"),multiline:!0,minRows:4,maxRows:8,fullWidth:!0,required:!0,disabled:d,error:!!i,helperText:i||n("admin.payout.refundReasonHelper",{min:h}),slotProps:{htmlInput:{maxLength:500}}})]})})]})}const ae=(s={})=>{const p=new URLSearchParams;return Object.keys(s).forEach(u=>{let n=s[u];u==="q"&&(n=Object.entries(n).map(y=>y.join(":")).join(" ")),p.set(u,String(n))}),B.get(`/api/payouts?${p.toString()}`).then(u=>u.data)},ne=s=>s.customer_id?`customer-payouts-${s.customer_id}`:s.payment_intent_id?`intent-payouts-${s.payment_intent_id}`:"payouts";function ye({customer_id:s="",payment_intent_id:p="",status:u="",features:n={customer:!0,filter:!0},isCanceledSubscription:y=!1}){const{t:d}=q(),[m]=V(),b=ne({customer_id:s,payment_intent_id:p}),R=K(20),[r,l]=Z(b,{defaultValue:{status:u,customer_id:s,payment_intent_id:p,pageSize:R,page:1},getUrlParams:()=>{const a={};return m.has("status")&&(a.status=m.get("status")),m.has("currency_id")&&(a.currency_id=m.get("currency_id")),m.has("customer_id")&&(a.customer_id=m.get("customer_id")),a}}),[i,f]=x.useState({});if(x.useEffect(()=>{U(()=>{ae(r).then(a=>{f(a)})},300)()},[r]),!i.list)return t.jsx(T,{});const h=[{label:d("common.amount"),name:"id",align:"right",width:80,options:{customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(g,{to:`/admin/payments/${e.id}`,children:t.jsxs(w,{component:"strong",sx:{fontWeight:600},children:[M(e.amount,e?.paymentCurrency.decimal)," ",e?.paymentCurrency.symbol]})})}}},{label:d("common.paymentMethod"),name:"paymentMethod",width:120,options:{customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(g,{to:`/admin/payments/${e.id}`,children:t.jsxs(w,{sx:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(k,{src:e.paymentMethod.logo,sx:{width:18,height:18,mr:1}}),e.paymentMethod.name]})})}}},{label:d("common.status"),name:"status",width:80,options:{customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(g,{to:`/admin/payments/${e.id}`,children:t.jsx(F,{label:e.status,color:H(e.status)})})}}},{label:d("common.description"),name:"description",options:{customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(g,{to:`/admin/payments/${e.id}`,children:e.description||e.id})}}},{label:d("common.createdAt"),name:"created_at",options:{sort:!0,customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(g,{to:`/admin/payments/${e.id}`,children:$(e.created_at)})}}},{label:d("common.updatedAt"),name:"updated_at",options:{sort:!0,customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(g,{to:`/admin/payments/${e.id}`,children:$(e.updated_at)})}}},{label:d("common.actions"),name:"",options:{customBodyRenderLite:(a,o)=>{const e=i.list[o];return t.jsx(te,{data:e,isCanceledSubscription:y})}}}];n?.customer&&h.splice(3,0,{label:d("common.customer"),name:"customer_id",options:{filter:!0,customBodyRenderLite:(a,o)=>{const e=i.list[o];if(e.customer)return t.jsx(J,{customer:e.customer});const _=G(e.destination);return _?t.jsx(ee,{name:t.jsx(D,{sx:{fontWeight:500},maxLength:30,children:_.name}),description:t.jsx(I,{did:e.destination,compact:!0,responsive:!1,sx:{whiteSpace:"nowrap"}}),logo:_.avatar,size:40}):e.destination}}});const j=({page:a,rowsPerPage:o})=>{r.pageSize!==o?l(e=>({...e,pageSize:o,page:1})):r.page!==a+1&&l(e=>({...e,page:a+1}))};return t.jsx(W,{hasRowLink:!0,durable:`__${b}__`,data:i.list||[],columns:h,loading:!i.list,onChange:j,options:{count:i.count,page:r.page-1,rowsPerPage:r.pageSize,onSearchChange:a=>{l(a?{...r,q:{"like-description":a,"like-metadata":a},pageSize:100,page:1}:{...r,pageSize:100,page:1,q:{}})},onColumnSortChange(a,o){l({...r,q:r.q||{},o})}},toolbar:n?.toolbar,footer:n?.footer,title:n?.filter&&t.jsx(Q,{setSearch:l,search:r,status:["paid","pending","failed","canceled"],currency:!0}),emptyNodeText:d("empty.payouts")})}export{ye as P};
|