@abtnode/blocklet-services 1.16.45 → 1.16.46-beta-20250703-024219-4029ee97

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.
Files changed (150) hide show
  1. package/api/routes/user-session.js +2 -1
  2. package/dist/assets/{AdapterDayjs-BRnJ9bMs.js → AdapterDayjs-BIQsjtiT.js} +1 -1
  3. package/dist/assets/{ArrowDropDown-DBJPIOl4.js → ArrowDropDown-C8mwBtnq.js} +1 -1
  4. package/dist/assets/{CheckCircle-DUJmWceY.js → CheckCircle-BMMes-V7.js} +1 -1
  5. package/dist/assets/{ChevronLeft-BBJJJhVi.js → ChevronLeft-B8rsCJhy.js} +1 -1
  6. package/dist/assets/{ChevronRight-BU9I7WD4.js → ChevronRight-CXhRlHKa.js} +1 -1
  7. package/dist/assets/{DeleteOutline-BKSMNwfT.js → DeleteOutline-DtbgduIM.js} +1 -1
  8. package/dist/assets/{Done-ASNftAOL.js → Done-CfxTFgBR.js} +1 -1
  9. package/dist/assets/{Download-D4X39_9V.js → Download-Cz4FAob1.js} +1 -1
  10. package/dist/assets/{Edit-CiTb-w5P.js → Edit-Dh2oBqBB.js} +1 -1
  11. package/dist/assets/{Error-BAEKW7-e.js → Error-BsnYcwiq.js} +1 -1
  12. package/dist/assets/{ExpandLess-CcLTbsdW.js → ExpandLess-B7eaaZaz.js} +1 -1
  13. package/dist/assets/{Google-C28yeMZW.js → Google-BAVYemz7.js} +1 -1
  14. package/dist/assets/{Home-Dujcj083.js → Home-SYcuMunC.js} +1 -1
  15. package/dist/assets/{InfoOutlined-BVWbftGI.js → InfoOutlined-GEKFkezP.js} +1 -1
  16. package/dist/assets/{Launch-DFS3fgjy.js → Launch-BB2NS6gw.js} +1 -1
  17. package/dist/assets/{LaunchOutlined-C1x4Og4u.js → LaunchOutlined-BEsYq9kI.js} +1 -1
  18. package/dist/assets/{MoreHoriz-ChJ3K52h.js → MoreHoriz-BDLlOCqj.js} +1 -1
  19. package/dist/assets/{PlayArrow-BqVYRyLK.js → PlayArrow-hnXK75qN.js} +1 -1
  20. package/dist/assets/{TuneOutlined-CKzi_VZZ.js → TuneOutlined-CjVMXY_7.js} +1 -1
  21. package/dist/assets/{ViewList-BOGcbymi.js → ViewList-CYMKafss.js} +1 -1
  22. package/dist/assets/{access-control-5WGT2JfR.js → access-control-C1HMwNqK.js} +1 -1
  23. package/dist/assets/{actions-DnTVXQ_Z.js → actions-D_aAU5uf.js} +1 -1
  24. package/dist/assets/{add-component-core-DehB4lvu.js → add-component-core-BEFFiTrn.js} +1 -1
  25. package/dist/assets/{add-resource-DfqBSLDk.js → add-resource-BwdFwCui.js} +1 -1
  26. package/dist/assets/{addon-DdjBFoHI.js → addon-CuKQNO-0.js} +1 -1
  27. package/dist/assets/advanced-BUnq5m4o.js +14 -0
  28. package/dist/assets/api-ZzsS0diA.js +1 -0
  29. package/dist/assets/{appearance-DsoglxbB.js → appearance-4MhpGgxL.js} +1 -1
  30. package/dist/assets/{audit-logs-DKiQkfse.js → audit-logs-Crahcw3z.js} +1 -1
  31. package/dist/assets/{authorize-IzqEi1HK.js → authorize-BdvY1Z98.js} +1 -1
  32. package/dist/assets/{base-chart-CoApVzod.js → base-chart-B81_ogPb.js} +1 -1
  33. package/dist/assets/{base32-DUSifB4M.js → base32-BTgHqgXA.js} +1 -1
  34. package/dist/assets/{branding-CwYIeBi1.js → branding-A9uxpYm2.js} +1 -1
  35. package/dist/assets/{branding-B1o_K1XB.js → branding-DPMhTm_T.js} +2 -2
  36. package/dist/assets/{bundle-avatar-UIbxwQif.js → bundle-avatar-DKZRbFJ2.js} +1 -1
  37. package/dist/assets/{button-D_ZVjN82.js → button-BxXFhZV_.js} +1 -1
  38. package/dist/assets/{click-to-copy-By4fgGR7.js → click-to-copy-nMjIOe47.js} +1 -1
  39. package/dist/assets/{cloneDeep-CDl5kZTY.js → cloneDeep-Cm_V5yFW.js} +1 -1
  40. package/dist/assets/{collapse-DAaiuAEY.js → collapse-2Uzc-qtU.js} +1 -1
  41. package/dist/assets/{complete-Bi_BaBBl.js → complete-C0GvGwhR.js} +1 -1
  42. package/dist/assets/{component-CiFJ1vhL.js → component-CI10LcFr.js} +3 -3
  43. package/dist/assets/{config-BZuiK8BP.js → config-COcQW2xB.js} +1 -1
  44. package/dist/assets/{config-JUGJKWP_.js → config-DwZ4p-2p.js} +1 -1
  45. package/dist/assets/{config-navigation-DZ54_nVv.js → config-navigation-OsN6Bi3R.js} +3 -3
  46. package/dist/assets/{config-space-D6ScnWdA.js → config-space-DD1BpqT2.js} +1 -1
  47. package/dist/assets/{confirm-RvA9mFot.js → confirm-DchYh746.js} +1 -1
  48. package/dist/assets/{connect-DGMfp8-Y.js → connect-BC_FEDb_.js} +1 -1
  49. package/dist/assets/{connect-DhuiCF4g.js → connect-DxHNQKee.js} +1 -1
  50. package/dist/assets/{connect-to-CxoBjkcK.js → connect-to-ZkYEK0m1.js} +1 -1
  51. package/dist/assets/{dashboard-t9EszOna.js → dashboard-BTYQTsrm.js} +3 -3
  52. package/dist/assets/{delete-confirm-wTMDQFnr.js → delete-confirm-bNsLJZC8.js} +1 -1
  53. package/dist/assets/{did-address-NnOD1W_A.js → did-address-BYc4cym-.js} +1 -1
  54. package/dist/assets/{domain-BaMcm6r6.js → domain-Clgo_OSc.js} +1 -1
  55. package/dist/assets/{domain-action-card-BlPWBOAu.js → domain-action-card-DLv7qvqf.js} +1 -1
  56. package/dist/assets/domains-DG0-1EGf.js +1 -0
  57. package/dist/assets/{dot-4jhL56kz.js → dot-BYJ1q_JZ.js} +1 -1
  58. package/dist/assets/{email-0b_MYxBQ.js → email-vrlxa6_L.js} +1 -1
  59. package/dist/assets/{exchange-passport-BnmyuwIs.js → exchange-passport-twE4l8Ym.js} +1 -1
  60. package/dist/assets/{fuel-DEqW116b.js → fuel-CRlIvND2.js} +1 -1
  61. package/dist/assets/{gen-access-key-CVpZSjIw.js → gen-access-key-7DQV-fiV.js} +1 -1
  62. package/dist/assets/{get-safe-url-B0-S5PGZ.js → get-safe-url-D3ggKpT1.js} +1 -1
  63. package/dist/assets/{get-safe-url-D5KSEAKZ.js → get-safe-url-DAFhlwkH.js} +1 -1
  64. package/dist/assets/{home-DfSu-4-a.js → home-A-VRaS1G.js} +1 -1
  65. package/dist/assets/{iframe-DFg8oeD0.js → iframe-GZPTHXNz.js} +1 -1
  66. package/dist/assets/{index-6I6juqjg.js → index-B9TY-Odb.js} +1 -1
  67. package/dist/assets/{index-aAlnaECr.js → index-B_LRxSf2.js} +1 -1
  68. package/dist/assets/{index-B4fH-l5R.js → index-Bm0yY2oo.js} +1 -1
  69. package/dist/assets/{index-B874LN5A.js → index-Bv2l4NRE.js} +1 -1
  70. package/dist/assets/{index-DrTNV3tX.js → index-C-YrYRw8.js} +1 -1
  71. package/dist/assets/{index-C0btiQfG.js → index-C4HCwPkf.js} +1 -1
  72. package/dist/assets/{index-ZcD1N43m.js → index-C4UNdprC.js} +1 -1
  73. package/dist/assets/{index-CkwXRCmN.js → index-C86CKPcd.js} +4 -4
  74. package/dist/assets/{index-I1i2Mc1k.js → index-CIPzQU7w.js} +1 -1
  75. package/dist/assets/{index-BxJZWVOT.js → index-CRPd6bu_.js} +1 -1
  76. package/dist/assets/{index-CD07vq9d.js → index-CneQHlZz.js} +1 -1
  77. package/dist/assets/{index-Dq1Rmjwf.js → index-CwogVjPF.js} +1 -1
  78. package/dist/assets/{index-BLfUtUpB.js → index-D1V1OV_1.js} +1 -1
  79. package/dist/assets/{index-DPIWnhb5.js → index-D3Qm_7QJ.js} +1 -1
  80. package/dist/assets/{index-CwUT0vPy.js → index-DBdN7QPA.js} +4 -4
  81. package/dist/assets/{index-IeoAQOW8.js → index-DJghIcZg.js} +1 -1
  82. package/dist/assets/{index-B70kYOfj.js → index-DYS82O-e.js} +1 -1
  83. package/dist/assets/{index-2mYUqHxe.js → index-DYlNzDk4.js} +3 -3
  84. package/dist/assets/{index-YaLWfp9D.js → index-JN3t0gnY.js} +1 -1
  85. package/dist/assets/{index-Cwq0Io0K.js → index-czMSCB_F.js} +1 -1
  86. package/dist/assets/{index-w4f-mlFt.js → index-opVatFs5.js} +1 -1
  87. package/dist/assets/{invitation-B3B-J4fG.js → invitation-DpzHBehx.js} +1 -1
  88. package/dist/assets/{invite-jaOwIvW9.js → invite-CLIKbeIQ.js} +1 -1
  89. package/dist/assets/{issue-passport-DpSBB2L8.js → issue-passport-8zXA1BKY.js} +1 -1
  90. package/dist/assets/{item-D-39k2FC.js → item-CDthQ-2V.js} +1 -1
  91. package/dist/assets/{layout-DEiEwPzB.js → layout-B9UmfNkJ.js} +1 -1
  92. package/dist/assets/{list-ZFC0mCy0.js → list-B1hvgiX4.js} +2 -2
  93. package/dist/assets/{list-DDNORnll.js → list-CeHTzwCI.js} +1 -1
  94. package/dist/assets/localization-BmadHeXm.js +1 -0
  95. package/dist/assets/{log-BBUgs8Rd.js → log-BwyobBHM.js} +1 -1
  96. package/dist/assets/{logger-Dqm1UQym.js → logger-9nL4ASn6.js} +1 -1
  97. package/dist/assets/{login-DbSs2lO2.js → login-Cgts-E2y.js} +1 -1
  98. package/dist/assets/{login-oauth-callback-Cpai1yC1.js → login-oauth-callback-D3WJu6Qx.js} +1 -1
  99. package/dist/assets/{logo-uploader-BPSmPaZd.js → logo-uploader-C2Aw-_0m.js} +3 -3
  100. package/dist/assets/{lost-passport-Ce_WXcnR.js → lost-passport-Jvpfzzix.js} +1 -1
  101. package/dist/assets/{omit-Cao4GLS7.js → omit-rJ-mc6U5.js} +1 -1
  102. package/dist/assets/{open-window-hpzKFxn5.js → open-window-CTBzFUUv.js} +1 -1
  103. package/dist/assets/{overview-C3aIT8Ro.js → overview-D2wj1UNY.js} +1 -1
  104. package/dist/assets/{page-header-DNvUdNpI.js → page-header-DqtuZOzT.js} +1 -1
  105. package/dist/assets/{passport-item-B3XIp0U4.js → passport-item-vgQO4aPM.js} +1 -1
  106. package/dist/assets/{permission-DQvXGutX.js → permission-BEqDHKfL.js} +1 -1
  107. package/dist/assets/{preferences-C3zaKjfI.js → preferences-D1eIimRF.js} +1 -1
  108. package/dist/assets/{profile-embed-BFjGm3Vt.js → profile-embed-DdACJ_zu.js} +1 -1
  109. package/dist/assets/publish-resource-BFNO0Bju.js +1 -0
  110. package/dist/assets/{react-beautiful-dnd.esm-02tdagHZ.js → react-beautiful-dnd.esm-CNuzAjru.js} +1 -1
  111. package/dist/assets/{runtime-Drmh1-cb.js → runtime-CJxB8Qqy.js} +1 -1
  112. package/dist/assets/{sanitize-e0A8A-yt.js → sanitize-BKnEhEg8.js} +1 -1
  113. package/dist/assets/sdk-Btq1iUPd.js +1 -0
  114. package/dist/assets/{security-BPd4v9z4.js → security-D5upbFtT.js} +1 -1
  115. package/dist/assets/{session-BGdAM8zS.js → session-kQ1tvY5U.js} +1 -1
  116. package/dist/assets/{setup-Bo10IVJ4.js → setup-DDRNZUzD.js} +3 -3
  117. package/dist/assets/{spaces-DUkzPTBd.js → spaces-BTlTdKAI.js} +1 -1
  118. package/dist/assets/{start-C9Hvgbcz.js → start-DcujueM1.js} +1 -1
  119. package/dist/assets/{starting-progress-CYgfPTsE.js → starting-progress-CAkASj-X.js} +1 -1
  120. package/dist/assets/{status-f3Y-NXRP.js → status-oJ1As_M0.js} +1 -1
  121. package/dist/assets/{step-actions-BNbc1l8F.js → step-actions-DrPbY3ZQ.js} +1 -1
  122. package/dist/assets/{studio-I9lo0Itp.js → studio-BWs_EnV3.js} +1 -1
  123. package/dist/assets/{switch-control-Brwb8ptk.js → switch-control-eCwDP-ME.js} +1 -1
  124. package/dist/assets/{table-tips-BzPqsKYQ.js → table-tips-CCj0tXz1.js} +1 -1
  125. package/dist/assets/{traffic-FNLLya21.js → traffic-BAsnAfLz.js} +1 -1
  126. package/dist/assets/{transfer-m6229uxg.js → transfer-C2qtHrKp.js} +1 -1
  127. package/dist/assets/{unsubscribe-BXKQU2c1.js → unsubscribe-B4aHISnG.js} +1 -1
  128. package/dist/assets/{use-blocklet-logo-4UB-MFD3.js → use-blocklet-logo-BWK1UHK5.js} +1 -1
  129. package/dist/assets/use-server-logo-UTr-CyJD.js +1 -1
  130. package/dist/assets/{useAsync-C62uE2pS.js → useAsync-BzjEtgtr.js} +1 -1
  131. package/dist/assets/{useLocalStorage-CaPDqrQ7.js → useLocalStorage-BoYGn-bQ.js} +1 -1
  132. package/dist/assets/{user-center-CNdVbQx6.js → user-center-BgJo4uqg.js} +3 -3
  133. package/dist/assets/{util-BRPRFc9p.js → util-KGB__QYA.js} +1 -1
  134. package/dist/assets/{util-BQAJqeb4.js → util-TW4lcckB.js} +1 -1
  135. package/dist/assets/{vendor-arcblock-CwufDgLV.js → vendor-arcblock-DzylOsX3.js} +3 -3
  136. package/dist/assets/{vendor-hooks-DqdmWCmo.js → vendor-hooks-B2N8eE_a.js} +1 -1
  137. package/dist/assets/vendor-utils-uPLZO5mM.js +208 -0
  138. package/dist/assets/vendor-ux-did-connect-CQtodyZB.js +2304 -0
  139. package/dist/assets/{wrap-locale-ClbCNOs0.js → wrap-locale-9hBUwROZ.js} +1 -1
  140. package/dist/index.html +5 -5
  141. package/dist/service-worker.js +1 -1
  142. package/package.json +23 -23
  143. package/dist/assets/advanced-CJz1c7Eh.js +0 -14
  144. package/dist/assets/api-C1S8LUld.js +0 -1
  145. package/dist/assets/domains-CxJF-JF_.js +0 -1
  146. package/dist/assets/localization-tyC-vHO5.js +0 -1
  147. package/dist/assets/publish-resource-CAZrBTdz.js +0 -1
  148. package/dist/assets/sdk-BmeKtHic.js +0 -1
  149. package/dist/assets/vendor-utils-BfZ4tlod.js +0 -208
  150. package/dist/assets/vendor-ux-did-connect-pzpsrvqx.js +0 -2304
@@ -1,4 +1,4 @@
1
- import{j as r,ah as m}from"./vendor-mui-core-Bq8gXTan.js";import{C as c}from"./content-layout-BC2QkTYi.js";import{a as p,a3 as s}from"./vendor-ux-did-connect-pzpsrvqx.js";import{c as i}from"./vendor-arcblock-CwufDgLV.js";import{L as u}from"./index-CwUT0vPy.js";const d=m(c)`
1
+ import{j as r,ah as m}from"./vendor-mui-core-Bq8gXTan.js";import{C as c}from"./content-layout-BC2QkTYi.js";import{a as p,a3 as s}from"./vendor-ux-did-connect-CQtodyZB.js";import{c as i}from"./vendor-arcblock-DzylOsX3.js";import{L as u}from"./index-DBdN7QPA.js";const d=m(c)`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-2mYUqHxe.js","assets/vendor-ux-did-connect-pzpsrvqx.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-BfZ4tlod.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-hooks-DqdmWCmo.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-CwufDgLV.js","assets/index-BxJZWVOT.js","assets/index-CwUT0vPy.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as b,b as Ue}from"./vendor-react-DEoibe3W.js";import{a as F,d as K,k as W,a3 as H,_ as ye,a2 as ne,$ as V,br as ve,bs as Ce,bt as Te,bd as we,ac as Se,a5 as Ie}from"./vendor-ux-did-connect-pzpsrvqx.js";import{H as o,j as e,D as X,aj as G,I as Q,t as J,al as L,T as R,aa as p,O as w,bq as v,bK as Re,bQ as oe,bs as se,bR as ae,X as Y,ak as ce,z as de,y as z,ab as Z,ad as Ee}from"./vendor-mui-core-Bq8gXTan.js";import{v as ue}from"./vendor-arcblock-CwufDgLV.js";import{d as Ae}from"./Edit-CiTb-w5P.js";import{_ as ke}from"./dot-4jhL56kz.js";import{l as pe}from"./index-BLfUtUpB.js";import{D as $,aC as he,aD as S,G as Pe}from"./index-CwUT0vPy.js";import{u as B}from"./dashboard-t9EszOna.js";import{o as Ne,c as We,A as re}from"./vendor-utils-BfZ4tlod.js";import{T as qe}from"./index-DrTNV3tX.js";import{E as Oe}from"./empty-spinner-BHwHZpq-.js";import{C as y}from"./click-to-copy-By4fgGR7.js";import{D as Le}from"./delete-confirm-wTMDQFnr.js";import{b as _e}from"./passport-item-B3XIp0U4.js";import{A as De}from"./actions-DnTVXQ_Z.js";import{T as le}from"./table-tips-BzPqsKYQ.js";import{u as ze}from"./use-mobile-CtTQsfXN.js";import"./vendor-hooks-DqdmWCmo.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-C62uE2pS.js";import"./useLocalStorage-CaPDqrQ7.js";import"./index-8eXqqyHQ.js";import"./confirm-RvA9mFot.js";import"./PlayArrow-BqVYRyLK.js";import"./get-safe-url-D5KSEAKZ.js";import"./session-BGdAM8zS.js";import"./use-blocklet-logo-4UB-MFD3.js";import"./InfoOutlined-BVWbftGI.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-DwzRjjku.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BRnJ9bMs.js";import"./did-address-NnOD1W_A.js";import"./util-BQAJqeb4.js";import"./base32-DUSifB4M.js";import"./MoreHoriz-ChJ3K52h.js";const Fe={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function me({onCreated:r,onClose:u}){const[i,m]=b.useState(!1),{t:n,locale:s}=F(),{api:g}=$(),{teamDid:h}=B(),{control:f,handleSubmit:k,formState:{errors:a},watch:I,setValue:x}=he({defaultValues:Fe,mode:"onChange"}),T=I("scope"),E=c=>{c!=="profile:read"&&x("scope",T.includes(c)?T.filter(d=>d!==c):[...T,c])},q=async c=>{m(!0);try{const d={...c,redirectUris:c.redirectUris,contacts:c.contacts?c.contacts.split(",").map(P=>P.trim()):[],scope:c.scope.join(" ")};await g.createOAuthClient({input:{teamDid:h,input:Ne(d,We)}}),r(d)}catch(d){H.error(d.message||"Failed to create OAuth App")}finally{m(!1)}};return e.jsxs(X,{open:!0,onClose:u,maxWidth:"md",fullWidth:!0,children:[e.jsxs(G,{children:[n("oauth.client.register")," ",e.jsx(Q,{onClick:u,sx:{position:"absolute",right:8,top:8},children:e.jsx(K,{})})]}),e.jsx(J,{children:e.jsxs(L,{spacing:4,sx:{mt:2},children:[e.jsx(R,{variant:"h6",gutterBottom:!0,children:n("oauth.client.requiredInformation")}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:f,rules:{required:n("oauth.client.validate.clientName"),minLength:{value:3,message:n("oauth.client.validate.clientNameMinLength")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.name"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.clientNamePlaceholder"),error:!!a.clientName,helperText:(d=a.clientName)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:f,rules:{required:n("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:n("oauth.client.validate.clientUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.clientUriPlaceholder"),error:!!a.clientUri,helperText:(d=a.clientUri)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:f,rules:{required:n("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:n("oauth.client.validate.redirectUrisInvalid")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.redirectUrisPlaceholder"),error:!!a.redirectUris,helperText:(d=a.redirectUris)==null?void 0:d.message}),e.jsxs(p,{sx:{display:"flex",gap:"2px"},children:[e.jsx(v,{children:n("oauth.client.helperText.redirectUris")}),e.jsx(v,{children:n("oauth.client.helperText.read")}),e.jsx(v,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:n("oauth.client.helperText.document")}),e.jsx(v,{children:n("oauth.client.helperText.more")})]})]})}})}),e.jsxs(Re,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(R,{variant:"subtitle2",gutterBottom:!0,children:n("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(W.OAUTH_SCOPES).map(([c,d])=>e.jsx(se,{control:e.jsx(ae,{checked:T.includes(c),onChange:()=>E(c),disabled:c==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(R,{variant:"body2",sx:{fontWeight:500},children:d})})},c))})})]}),e.jsx(Y,{}),e.jsx(R,{variant:"h6",gutterBottom:!0,children:n("oauth.client.optionalInformation")}),e.jsx(L,{children:e.jsx(S,{name:"contacts",control:f,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:n("oauth.client.validate.contacts")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.contacts"),fullWidth:!0,placeholder:n("oauth.client.input.contactsPlaceholder"),error:!!a.contacts,helperText:(d=a.contacts)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.contacts")})]})}})}),e.jsxs(L,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:n("oauth.client.validate.tosUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.tosUri"),fullWidth:!0,placeholder:n("oauth.client.input.tosUriPlaceholder"),error:!!a.tosUri,helperText:(d=a.tosUri)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:n("oauth.client.validate.policyUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.policyUri"),fullWidth:!0,placeholder:n("oauth.client.input.policyUriPlaceholder"),error:!!a.policyUri,helperText:(d=a.policyUri)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.policyUri")})]})}})]}),a.error&&e.jsx(ce,{severity:"error",children:a.error.message})]})}),e.jsxs(de,{children:[e.jsx(z,{onClick:u,children:n("common.cancel")}),e.jsxs(z,{onClick:k(q),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Z,{size:20,sx:{mr:1}}):null,n("oauth.client.registerButton")]})]})]})}me.propTypes={onCreated:o.func.isRequired,onClose:o.func.isRequired};function M({scope:r,...u}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(L,{direction:"row",flexWrap:"wrap",gap:1,...u,children:i.map(m=>e.jsx(Ue.Fragment,{children:e.jsx(Ee,{title:W.OAUTH_SCOPES[m],children:e.jsx(y,{children:m})})},m))})}M.propTypes={scope:o.string};M.defaultProps={scope:""};const ee=r=>{const{prefix:u}=$(),{blocklet:i}=Pe(),m=re(u,"/api/media/upload",i.appPid),n=b.useCallback(g=>g?g.startsWith("http")?g:`${re(u,"/api/media/upload",i.appPid)}/${g}`:"",[u,i.appPid]);return{clientLogoUrl:b.useMemo(()=>n(r),[r,n]),apiPath:m,getClientLogoUrl:n}},$e=b.lazy(()=>ye(()=>import("./index-2mYUqHxe.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function xe({client:r,onUpdate:u,onClose:i}){const[m,n]=b.useState(!1),{t:s,locale:g}=F(),h=b.useRef(null),{api:f}=$(),{teamDid:k}=B(),{control:a,handleSubmit:I,formState:{errors:x},watch:T,setValue:E,getValues:q}=he({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),c=T("scope"),d=T("logoUri"),{clientLogoUrl:P,apiPath:O}=ee(d),A=l=>{l!=="profile:read"&&E("scope",c.includes(l)?c.filter(t=>t!==l):[...c,l])},_=async l=>{const t={clientId:r.clientId,clientName:l.clientName.trim(),clientUri:l.clientUri,redirectUris:l.redirectUris.split(",").map(C=>C.trim()).filter(Boolean),contacts:l.contacts?l.contacts.split(",").map(C=>C.trim()):[],scope:l.scope.join(" "),tosUri:l.tosUri,policyUri:l.policyUri,logoUri:l.logoUri,clientSecretExpiresAt:l.clientSecretExpiresAt?parseInt(l.clientSecretExpiresAt/1e3,10):null};await f.updateOAuthClient({input:{teamDid:k,input:t}})},D=async l=>{n(!0);try{await _(l),u(),i()}catch(t){H.error(t.message||s("oauth.client.updateFailed"))}finally{n(!1)}};return e.jsxs(X,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(G,{children:[s("oauth.client.update")," ",e.jsx(Q,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(K,{})})]}),e.jsx(J,{children:e.jsxs(L,{spacing:3,sx:{mt:2},children:[e.jsxs(p,{sx:{mb:3},children:[e.jsx(R,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(p,{children:[e.jsx(p,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:P?e.jsx(p,{children:e.jsx("img",{src:P,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(p,{onClick:()=>{var l;(l=h.current)==null||l.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ue,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{var l;(l=h.current)==null||l.open()},children:s(P?"common.change":"common.upload")})]}),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Oe,{}),children:e.jsx($e,{ref:h,locale:g,popup:!0,onUploadFinish:l=>{E("logoUri",l.data.filename),_(q()).then(()=>{u()}).catch(t=>{H.error(t.message||s("oauth.client.updateFailed"))}).finally(()=>{var t;(t=h.current)==null||t.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:O,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(R,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:a,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!x.clientName,helperText:(t=x.clientName)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:a,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!x.clientUri,helperText:(t=x.clientUri)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:a,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!x.redirectUris,helperText:(t=x.redirectUris)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.redirectUris")})]})}})}),e.jsx(S,{name:"clientSecretExpiresAt",control:a,render:({field:l})=>e.jsx(qe,{placeholder:s("oauth.client.input.expireTime"),value:l.value*1e3,onChange:t=>{l.onChange(t)}})}),e.jsxs(p,{sx:{display:"none"},children:[e.jsx(R,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(W.OAUTH_SCOPES).map(([l,t])=>e.jsx(se,{control:e.jsx(ae,{checked:c.includes(l),onChange:()=>A(l),disabled:l==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(R,{variant:"body2",sx:{fontWeight:500},children:t})})},l))})})]}),e.jsx(Y,{}),e.jsx(R,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(p,{children:e.jsx(S,{name:"contacts",control:a,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!x.contacts,helperText:(t=x.contacts)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.contacts")})]})}})}),e.jsxs(L,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{...l,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!x.tosUri,helperText:(t=x.tosUri)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{...l,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!x.policyUri,helperText:(t=x.policyUri)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.policyUri")})]})}})]}),x.error&&e.jsx(ce,{severity:"error",children:x.error.message})]})}),e.jsxs(de,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:I(D),disabled:m,variant:"contained",color:"primary",children:m?e.jsx(Z,{size:16}):s("common.update")})]})]})}xe.propTypes={client:o.shape({clientId:o.string.isRequired,clientName:o.string.isRequired,clientUri:o.string,redirectUris:o.arrayOf(o.string),scope:o.string,contacts:o.arrayOf(o.string),tosUri:o.string,policyUri:o.string,logoUri:o.string,clientSecretExpiresAt:o.number}).isRequired,onUpdate:o.func.isRequired,onClose:o.func.isRequired};function je({client:r,onUpdate:u,onClose:i}){return e.jsx(xe,{client:r,onUpdate:m=>u(m),onClose:i})}je.propTypes={client:o.shape({clientId:o.string.isRequired,clientName:o.string.isRequired,clientUri:o.string,redirectUris:o.arrayOf(o.string),scope:o.string,contacts:o.arrayOf(o.string),tosUri:o.string,policyUri:o.string,logoUri:o.string,clientSecretExpiresAt:o.number}).isRequired,onUpdate:o.func.isRequired,onClose:o.func.isRequired};function te(r){const{t:u}=F(),{api:i}=$(),{teamDid:m}=B(),{clientId:n,clientName:s,onDelete:g=()=>{},onClose:h=()=>{}}=r,f=()=>{h()},k=async()=>{try{await i.deleteOAuthClient({input:{teamDid:m,clientId:n}}),g()}catch(I){H.error(I==null?void 0:I.message)}finally{f()}},a={keyName:s,title:u("oauth.client.delete.title"),description:u("oauth.client.delete.description",{name:`<b>${s}</b>`}),confirmPlaceholder:u("oauth.client.delete.description",{name:s}),confirm:u("common.delConfirm"),cancel:u("common.cancel"),onConfirm:k,onCancel:f};return e.jsx(Le,{keyName:a.keyName,title:a.title,description:a.description,confirmPlaceholder:a.confirmPlaceholder,confirm:a.confirm,cancel:a.cancel,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})}te.propTypes={clientId:o.string.isRequired,clientName:o.string.isRequired,onDelete:o.func,onClose:o.func};te.defaultProps={onDelete:()=>{},onClose:()=>{}};function ge({title:r,items:u}){return e.jsxs(p,{mb:3,children:[e.jsx(R,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(L,{spacing:1.5,children:u.map(({label:i,value:m})=>e.jsxs(p,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(R,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(R,{sx:{wordBreak:"break-all"},children:m||"-"})]},i))})]})}ge.propTypes={title:o.string.isRequired,items:o.arrayOf(o.shape({label:o.string.isRequired,value:o.any})).isRequired};function fe({client:r,onClose:u}){const{t:i,locale:m}=F(),{teamDid:n}=B(),{clientName:s,clientId:g,clientSecret:h,redirectUris:f,scope:k,clientUri:a,logoUri:I,contacts:x,tosUri:T,policyUri:E,jwksUri:q,jwks:c,softwareId:d,softwareVersion:P,clientIdIssuedAt:O,clientSecretExpiresAt:A,updatedAt:_,createUser:D}=r,{clientLogoUrl:l}=ee(I),t=j=>{try{const N=new URL(window.blocklet.appUrl);return N.pathname=j,N.toString()}catch{return"-"}},C=pe.fromAppDid(g,n),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(ne,{variant:"rounded",shape:"square",src:l,did:C.address,size:64})},{label:i("oauth.client.clientUri"),value:a?e.jsx(y,{children:a}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(y,{children:g})},{label:i("oauth.client.clientSecret"),value:e.jsx(y,{children:h})},{label:i("oauth.client.redirectUris"),value:e.jsx(y,{children:(f||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(M,{scope:k})},{label:i("oauth.client.createUser"),value:D?_e(D,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(y,{children:t("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:x.length?e.jsx(y,{children:(x||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(y,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:E?e.jsx(y,{children:E}):"-"},{label:i("oauth.client.jwksUri"),value:q},{label:i("oauth.client.jwks"),value:c},{label:i("oauth.client.softwareId"),value:d},{label:i("oauth.client.softwareVersion"),value:P}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:O?e.jsx(V,{value:O*1e3,type:"all",locale:m}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:A?e.jsx(V,{value:A*1e3,type:"all",locale:m}):"-"},{label:i("common.updatedAt"),value:_?e.jsx(V,{value:_,type:"all",locale:m}):"-"}]}].filter(Boolean);return e.jsxs(X,{open:!0,onClose:u,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(G,{children:[i("oauth.client.oauthAppDetails"),e.jsx(Q,{onClick:u,sx:{position:"absolute",right:8,top:8},children:e.jsx(K,{})})]}),e.jsx(J,{children:e.jsx(p,{mt:1,children:U.map((j,N)=>e.jsxs(p,{children:[e.jsx(ge,{title:j.title,items:j.items}),N!==U.length-1&&e.jsx(Y,{sx:{my:2}})]},j.title))})})]})}fe.propTypes={client:o.object.isRequired,onClose:o.func.isRequired};function Be(r){return e.jsx(V,{value:r*1e3})}function ie({selected:r,onClose:u}){return r?e.jsx(fe,{client:r,onClose:u}):null}ie.propTypes={selected:o.object,onClose:o.func.isRequired};ie.defaultProps={selected:null};function be({open:r,onCreated:u,onClose:i}){return r?e.jsx(me,{onCreated:u,onClose:i}):null}be.propTypes={open:o.bool.isRequired,onCreated:o.func.isRequired,onClose:o.func.isRequired};function It(){var l;const[r,u]=b.useState({searchText:"",pageSize:10,page:1}),[i,m]=b.useState(null),[n,s]=b.useState(!1),g=b.useRef(null),{t:h,locale:f}=F(),{api:k}=$(),{teamDid:a}=B(),[I,x]=b.useState(null),[T,E]=b.useState(null),q=ze(),{getClientLogoUrl:c}=ee(),d=ke(async()=>await k.getOAuthClients({input:{teamDid:a,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:P}=d,O=b.useMemo(()=>{var t;return((t=d.value)==null?void 0:t.list)||[]},[(l=d.value)==null?void 0:l.list]),A=b.useMemo(()=>r.searchText?O.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):O,[r.searchText,O]),_=b.useMemo(()=>[{label:h("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:C})=>{const U=A[C],j=c(U.logoUri),N=pe.fromAppDid(U.clientId,a);return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(p,{display:"flex",alignItems:"center",gap:2,sx:{cursor:"pointer"},children:[e.jsx(ne,{variant:"rounded",shape:"square",did:N.address,src:j,size:48}),e.jsxs(L,{gap:.5,children:[e.jsx(p,{sx:{color:"text.primary"},children:U.clientName}),e.jsx(p,{sx:{color:"text.secondary"},children:U.clientUri})]})]})})}}},{label:h("oauth.client.clientId"),name:"clientId"},{label:h("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(M,{scope:t})}},{label:h("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Be}},{label:h("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(ve,{showDid:!0,did:t,cardType:Ce.Detailed,infoType:Te.Minimal,sx:{border:0,padding:0}}):h("oauth.client.openRegistration")}},{label:h("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:C})=>{const U=A[C];return e.jsx(De,{actions:[{icon:e.jsx(Ae,{}),text:h("common.edit"),onClick:j=>{j.stopPropagation(),x(U)}},{icon:e.jsx(we,{}),text:h("common.delete"),onClick:j=>{j.stopPropagation(),E(U)}}]})}}}],[A,h,c,a,x,E]),D=({page:t,rowsPerPage:C,searchText:U})=>{r.pageSize!==C?u(j=>({...j,searchText:"",pageSize:C,page:1})):r.page!==t+1?u(j=>({...j,searchText:"",page:t+1})):r.searchText!==U&&u(j=>({...j,searchText:U,page:1}))};return e.jsxs(p,{ref:g,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[q?e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}):null,e.jsx(Se,{data:A,columns:_,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:A.length,searchDebounceTime:400,onRowClick(t,{dataIndex:C},U){var j;if((j=g.current)!=null&&j.contains(U.target)){const N=A[C];m(N)}}},onChange:D,title:q?null:e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[P?e.jsx(Z,{size:16}):e.jsx(ue,{style:{fontSize:16}}),h("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ie,{children:h("oauth.client.empty")})}),e.jsx(ie,{selected:i,onClose:()=>m(null)}),e.jsx(be,{open:n,onCreated:()=>{s(!1),d.retry()},onClose:()=>s(!1)}),I&&e.jsx(je,{client:I,onUpdate:d.retry,onClose:()=>x(null)}),T&&e.jsx(te,{...T,onDelete:d.retry,onClose:()=>E(null)})]})}export{It as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DYlNzDk4.js","assets/vendor-ux-did-connect-CQtodyZB.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-uPLZO5mM.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-hooks-B2N8eE_a.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-DzylOsX3.js","assets/index-CRPd6bu_.js","assets/index-DBdN7QPA.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
+ import{r as b,b as Ue}from"./vendor-react-DEoibe3W.js";import{a as F,d as K,k as W,a3 as H,_ as ye,a2 as ne,$ as V,br as ve,bs as Ce,bt as Te,bd as we,ac as Se,a5 as Ie}from"./vendor-ux-did-connect-CQtodyZB.js";import{H as o,j as e,D as X,aj as G,I as Q,t as J,al as L,T as R,aa as p,O as w,bq as v,bK as Re,bQ as oe,bs as se,bR as ae,X as Y,ak as ce,z as de,y as z,ab as Z,ad as Ee}from"./vendor-mui-core-Bq8gXTan.js";import{v as ue}from"./vendor-arcblock-DzylOsX3.js";import{d as Ae}from"./Edit-Dh2oBqBB.js";import{_ as ke}from"./dot-BYJ1q_JZ.js";import{l as pe}from"./index-D1V1OV_1.js";import{D as $,aC as he,aD as S,G as Pe}from"./index-DBdN7QPA.js";import{u as B}from"./dashboard-BTYQTsrm.js";import{o as Ne,c as We,A as re}from"./vendor-utils-uPLZO5mM.js";import{T as qe}from"./index-C-YrYRw8.js";import{E as Oe}from"./empty-spinner-BHwHZpq-.js";import{C as y}from"./click-to-copy-nMjIOe47.js";import{D as Le}from"./delete-confirm-bNsLJZC8.js";import{b as _e}from"./passport-item-vgQO4aPM.js";import{A as De}from"./actions-D_aAU5uf.js";import{T as le}from"./table-tips-CCj0tXz1.js";import{u as ze}from"./use-mobile-DwzRjjku.js";import"./vendor-hooks-B2N8eE_a.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-BzjEtgtr.js";import"./useLocalStorage-BoYGn-bQ.js";import"./index-8eXqqyHQ.js";import"./confirm-DchYh746.js";import"./PlayArrow-hnXK75qN.js";import"./get-safe-url-D3ggKpT1.js";import"./session-kQ1tvY5U.js";import"./use-blocklet-logo-BWK1UHK5.js";import"./InfoOutlined-GEKFkezP.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-CtTQsfXN.js";import"./vendor-mui-x-1nqAyytV.js";import"./AdapterDayjs-BIQsjtiT.js";import"./did-address-BYc4cym-.js";import"./util-TW4lcckB.js";import"./base32-BTgHqgXA.js";import"./MoreHoriz-BDLlOCqj.js";const Fe={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function me({onCreated:r,onClose:u}){const[i,m]=b.useState(!1),{t:n,locale:s}=F(),{api:g}=$(),{teamDid:h}=B(),{control:f,handleSubmit:k,formState:{errors:a},watch:I,setValue:x}=he({defaultValues:Fe,mode:"onChange"}),T=I("scope"),E=c=>{c!=="profile:read"&&x("scope",T.includes(c)?T.filter(d=>d!==c):[...T,c])},q=async c=>{m(!0);try{const d={...c,redirectUris:c.redirectUris,contacts:c.contacts?c.contacts.split(",").map(P=>P.trim()):[],scope:c.scope.join(" ")};await g.createOAuthClient({input:{teamDid:h,input:Ne(d,We)}}),r(d)}catch(d){H.error(d.message||"Failed to create OAuth App")}finally{m(!1)}};return e.jsxs(X,{open:!0,onClose:u,maxWidth:"md",fullWidth:!0,children:[e.jsxs(G,{children:[n("oauth.client.register")," ",e.jsx(Q,{onClick:u,sx:{position:"absolute",right:8,top:8},children:e.jsx(K,{})})]}),e.jsx(J,{children:e.jsxs(L,{spacing:4,sx:{mt:2},children:[e.jsx(R,{variant:"h6",gutterBottom:!0,children:n("oauth.client.requiredInformation")}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:f,rules:{required:n("oauth.client.validate.clientName"),minLength:{value:3,message:n("oauth.client.validate.clientNameMinLength")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.name"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.clientNamePlaceholder"),error:!!a.clientName,helperText:(d=a.clientName)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:f,rules:{required:n("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:n("oauth.client.validate.clientUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.clientUriPlaceholder"),error:!!a.clientUri,helperText:(d=a.clientUri)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:f,rules:{required:n("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:n("oauth.client.validate.redirectUrisInvalid")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:n("oauth.client.input.redirectUrisPlaceholder"),error:!!a.redirectUris,helperText:(d=a.redirectUris)==null?void 0:d.message}),e.jsxs(p,{sx:{display:"flex",gap:"2px"},children:[e.jsx(v,{children:n("oauth.client.helperText.redirectUris")}),e.jsx(v,{children:n("oauth.client.helperText.read")}),e.jsx(v,{sx:{color:"info.main"},component:"a",href:`https://www.arcblock.io/docs/blocklet-developer/${s}/oauth-service`,target:"_blank",rel:"noopener noreferrer",children:n("oauth.client.helperText.document")}),e.jsx(v,{children:n("oauth.client.helperText.more")})]})]})}})}),e.jsxs(Re,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(R,{variant:"subtitle2",gutterBottom:!0,children:n("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(W.OAUTH_SCOPES).map(([c,d])=>e.jsx(se,{control:e.jsx(ae,{checked:T.includes(c),onChange:()=>E(c),disabled:c==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(R,{variant:"body2",sx:{fontWeight:500},children:d})})},c))})})]}),e.jsx(Y,{}),e.jsx(R,{variant:"h6",gutterBottom:!0,children:n("oauth.client.optionalInformation")}),e.jsx(L,{children:e.jsx(S,{name:"contacts",control:f,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:n("oauth.client.validate.contacts")}},render:({field:c})=>{var d;return e.jsxs(e.Fragment,{children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.contacts"),fullWidth:!0,placeholder:n("oauth.client.input.contactsPlaceholder"),error:!!a.contacts,helperText:(d=a.contacts)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.contacts")})]})}})}),e.jsxs(L,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:n("oauth.client.validate.tosUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.tosUri"),fullWidth:!0,placeholder:n("oauth.client.input.tosUriPlaceholder"),error:!!a.tosUri,helperText:(d=a.tosUri)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:f,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:n("oauth.client.validate.policyUriInvalid")}},render:({field:c})=>{var d;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{size:"small",...c,label:n("oauth.client.input.policyUri"),fullWidth:!0,placeholder:n("oauth.client.input.policyUriPlaceholder"),error:!!a.policyUri,helperText:(d=a.policyUri)==null?void 0:d.message}),e.jsx(v,{children:n("oauth.client.helperText.policyUri")})]})}})]}),a.error&&e.jsx(ce,{severity:"error",children:a.error.message})]})}),e.jsxs(de,{children:[e.jsx(z,{onClick:u,children:n("common.cancel")}),e.jsxs(z,{onClick:k(q),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Z,{size:20,sx:{mr:1}}):null,n("oauth.client.registerButton")]})]})]})}me.propTypes={onCreated:o.func.isRequired,onClose:o.func.isRequired};function M({scope:r,...u}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(L,{direction:"row",flexWrap:"wrap",gap:1,...u,children:i.map(m=>e.jsx(Ue.Fragment,{children:e.jsx(Ee,{title:W.OAUTH_SCOPES[m],children:e.jsx(y,{children:m})})},m))})}M.propTypes={scope:o.string};M.defaultProps={scope:""};const ee=r=>{const{prefix:u}=$(),{blocklet:i}=Pe(),m=re(u,"/api/media/upload",i.appPid),n=b.useCallback(g=>g?g.startsWith("http")?g:`${re(u,"/api/media/upload",i.appPid)}/${g}`:"",[u,i.appPid]);return{clientLogoUrl:b.useMemo(()=>n(r),[r,n]),apiPath:m,getClientLogoUrl:n}},$e=b.lazy(()=>ye(()=>import("./index-DYlNzDk4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function xe({client:r,onUpdate:u,onClose:i}){const[m,n]=b.useState(!1),{t:s,locale:g}=F(),h=b.useRef(null),{api:f}=$(),{teamDid:k}=B(),{control:a,handleSubmit:I,formState:{errors:x},watch:T,setValue:E,getValues:q}=he({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||"",clientSecretExpiresAt:r.clientSecretExpiresAt||null},mode:"onChange"}),c=T("scope"),d=T("logoUri"),{clientLogoUrl:P,apiPath:O}=ee(d),A=l=>{l!=="profile:read"&&E("scope",c.includes(l)?c.filter(t=>t!==l):[...c,l])},_=async l=>{const t={clientId:r.clientId,clientName:l.clientName.trim(),clientUri:l.clientUri,redirectUris:l.redirectUris.split(",").map(C=>C.trim()).filter(Boolean),contacts:l.contacts?l.contacts.split(",").map(C=>C.trim()):[],scope:l.scope.join(" "),tosUri:l.tosUri,policyUri:l.policyUri,logoUri:l.logoUri,clientSecretExpiresAt:l.clientSecretExpiresAt?parseInt(l.clientSecretExpiresAt/1e3,10):null};await f.updateOAuthClient({input:{teamDid:k,input:t}})},D=async l=>{n(!0);try{await _(l),u(),i()}catch(t){H.error(t.message||s("oauth.client.updateFailed"))}finally{n(!1)}};return e.jsxs(X,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(G,{children:[s("oauth.client.update")," ",e.jsx(Q,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(K,{})})]}),e.jsx(J,{children:e.jsxs(L,{spacing:3,sx:{mt:2},children:[e.jsxs(p,{sx:{mb:3},children:[e.jsx(R,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(p,{children:[e.jsx(p,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:P?e.jsx(p,{children:e.jsx("img",{src:P,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(p,{onClick:()=>{var l;(l=h.current)==null||l.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ue,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(z,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{var l;(l=h.current)==null||l.open()},children:s(P?"common.change":"common.upload")})]}),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(b.Suspense,{fallback:e.jsx(Oe,{}),children:e.jsx($e,{ref:h,locale:g,popup:!0,onUploadFinish:l=>{E("logoUri",l.data.filename),_(q()).then(()=>{u()}).catch(t=>{H.error(t.message||s("oauth.client.updateFailed"))}).finally(()=>{var t;(t=h.current)==null||t.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:O,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(R,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(w,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(p,{children:e.jsx(S,{name:"clientName",control:a,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!x.clientName,helperText:(t=x.clientName)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.clientName")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"clientUri",control:a,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!x.clientUri,helperText:(t=x.clientUri)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.clientUri")})]})}})}),e.jsx(p,{children:e.jsx(S,{name:"redirectUris",control:a,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!x.redirectUris,helperText:(t=x.redirectUris)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.redirectUris")})]})}})}),e.jsx(S,{name:"clientSecretExpiresAt",control:a,render:({field:l})=>e.jsx(qe,{placeholder:s("oauth.client.input.expireTime"),value:l.value*1e3,onChange:t=>{l.onChange(t)}})}),e.jsxs(p,{sx:{display:"none"},children:[e.jsx(R,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(p,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(oe,{children:Object.entries(W.OAUTH_SCOPES).map(([l,t])=>e.jsx(se,{control:e.jsx(ae,{checked:c.includes(l),onChange:()=>A(l),disabled:l==="profile:read",color:"primary"}),label:e.jsx(p,{children:e.jsx(R,{variant:"body2",sx:{fontWeight:500},children:t})})},l))})})]}),e.jsx(Y,{}),e.jsx(R,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(p,{children:e.jsx(S,{name:"contacts",control:a,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:l})=>{var t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{...l,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!x.contacts,helperText:(t=x.contacts)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.contacts")})]})}})}),e.jsxs(L,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{...l,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!x.tosUri,helperText:(t=x.tosUri)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:a,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:l})=>{var t;return e.jsxs(p,{sx:{width:"50%"},children:[e.jsx(w,{...l,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!x.policyUri,helperText:(t=x.policyUri)==null?void 0:t.message}),e.jsx(v,{children:s("oauth.client.helperText.policyUri")})]})}})]}),x.error&&e.jsx(ce,{severity:"error",children:x.error.message})]})}),e.jsxs(de,{children:[e.jsx(z,{onClick:i,children:s("common.cancel")}),e.jsx(z,{onClick:I(D),disabled:m,variant:"contained",color:"primary",children:m?e.jsx(Z,{size:16}):s("common.update")})]})]})}xe.propTypes={client:o.shape({clientId:o.string.isRequired,clientName:o.string.isRequired,clientUri:o.string,redirectUris:o.arrayOf(o.string),scope:o.string,contacts:o.arrayOf(o.string),tosUri:o.string,policyUri:o.string,logoUri:o.string,clientSecretExpiresAt:o.number}).isRequired,onUpdate:o.func.isRequired,onClose:o.func.isRequired};function je({client:r,onUpdate:u,onClose:i}){return e.jsx(xe,{client:r,onUpdate:m=>u(m),onClose:i})}je.propTypes={client:o.shape({clientId:o.string.isRequired,clientName:o.string.isRequired,clientUri:o.string,redirectUris:o.arrayOf(o.string),scope:o.string,contacts:o.arrayOf(o.string),tosUri:o.string,policyUri:o.string,logoUri:o.string,clientSecretExpiresAt:o.number}).isRequired,onUpdate:o.func.isRequired,onClose:o.func.isRequired};function te(r){const{t:u}=F(),{api:i}=$(),{teamDid:m}=B(),{clientId:n,clientName:s,onDelete:g=()=>{},onClose:h=()=>{}}=r,f=()=>{h()},k=async()=>{try{await i.deleteOAuthClient({input:{teamDid:m,clientId:n}}),g()}catch(I){H.error(I==null?void 0:I.message)}finally{f()}},a={keyName:s,title:u("oauth.client.delete.title"),description:u("oauth.client.delete.description",{name:`<b>${s}</b>`}),confirmPlaceholder:u("oauth.client.delete.description",{name:s}),confirm:u("common.delConfirm"),cancel:u("common.cancel"),onConfirm:k,onCancel:f};return e.jsx(Le,{keyName:a.keyName,title:a.title,description:a.description,confirmPlaceholder:a.confirmPlaceholder,confirm:a.confirm,cancel:a.cancel,params:a.params,onConfirm:a.onConfirm,onCancel:a.onCancel})}te.propTypes={clientId:o.string.isRequired,clientName:o.string.isRequired,onDelete:o.func,onClose:o.func};te.defaultProps={onDelete:()=>{},onClose:()=>{}};function ge({title:r,items:u}){return e.jsxs(p,{mb:3,children:[e.jsx(R,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(L,{spacing:1.5,children:u.map(({label:i,value:m})=>e.jsxs(p,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(R,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(R,{sx:{wordBreak:"break-all"},children:m||"-"})]},i))})]})}ge.propTypes={title:o.string.isRequired,items:o.arrayOf(o.shape({label:o.string.isRequired,value:o.any})).isRequired};function fe({client:r,onClose:u}){const{t:i,locale:m}=F(),{teamDid:n}=B(),{clientName:s,clientId:g,clientSecret:h,redirectUris:f,scope:k,clientUri:a,logoUri:I,contacts:x,tosUri:T,policyUri:E,jwksUri:q,jwks:c,softwareId:d,softwareVersion:P,clientIdIssuedAt:O,clientSecretExpiresAt:A,updatedAt:_,createUser:D}=r,{clientLogoUrl:l}=ee(I),t=j=>{try{const N=new URL(window.blocklet.appUrl);return N.pathname=j,N.toString()}catch{return"-"}},C=pe.fromAppDid(g,n),U=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:s},{label:i("oauth.client.logoUri"),value:e.jsx(ne,{variant:"rounded",shape:"square",src:l,did:C.address,size:64})},{label:i("oauth.client.clientUri"),value:a?e.jsx(y,{children:a}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(y,{children:g})},{label:i("oauth.client.clientSecret"),value:e.jsx(y,{children:h})},{label:i("oauth.client.redirectUris"),value:e.jsx(y,{children:(f||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(M,{scope:k})},{label:i("oauth.client.createUser"),value:D?_e(D,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(y,{children:t("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/authorize`)})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/token`)})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/userinfo`)})},{label:i("oauth.client.jwksUri"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/jwks`)})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/register`)})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(y,{children:t(`${W.WELLKNOWN_SERVICE_PATH_PREFIX}/oauth/logout`)})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:x.length?e.jsx(y,{children:(x||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:T?e.jsx(y,{children:T}):"-"},{label:i("oauth.client.policyUri"),value:E?e.jsx(y,{children:E}):"-"},{label:i("oauth.client.jwksUri"),value:q},{label:i("oauth.client.jwks"),value:c},{label:i("oauth.client.softwareId"),value:d},{label:i("oauth.client.softwareVersion"),value:P}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:O?e.jsx(V,{value:O*1e3,type:"all",locale:m}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:A?e.jsx(V,{value:A*1e3,type:"all",locale:m}):"-"},{label:i("common.updatedAt"),value:_?e.jsx(V,{value:_,type:"all",locale:m}):"-"}]}].filter(Boolean);return e.jsxs(X,{open:!0,onClose:u,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(G,{children:[i("oauth.client.oauthAppDetails"),e.jsx(Q,{onClick:u,sx:{position:"absolute",right:8,top:8},children:e.jsx(K,{})})]}),e.jsx(J,{children:e.jsx(p,{mt:1,children:U.map((j,N)=>e.jsxs(p,{children:[e.jsx(ge,{title:j.title,items:j.items}),N!==U.length-1&&e.jsx(Y,{sx:{my:2}})]},j.title))})})]})}fe.propTypes={client:o.object.isRequired,onClose:o.func.isRequired};function Be(r){return e.jsx(V,{value:r*1e3})}function ie({selected:r,onClose:u}){return r?e.jsx(fe,{client:r,onClose:u}):null}ie.propTypes={selected:o.object,onClose:o.func.isRequired};ie.defaultProps={selected:null};function be({open:r,onCreated:u,onClose:i}){return r?e.jsx(me,{onCreated:u,onClose:i}):null}be.propTypes={open:o.bool.isRequired,onCreated:o.func.isRequired,onClose:o.func.isRequired};function It(){var l;const[r,u]=b.useState({searchText:"",pageSize:10,page:1}),[i,m]=b.useState(null),[n,s]=b.useState(!1),g=b.useRef(null),{t:h,locale:f}=F(),{api:k}=$(),{teamDid:a}=B(),[I,x]=b.useState(null),[T,E]=b.useState(null),q=ze(),{getClientLogoUrl:c}=ee(),d=ke(async()=>await k.getOAuthClients({input:{teamDid:a,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:P}=d,O=b.useMemo(()=>{var t;return((t=d.value)==null?void 0:t.list)||[]},[(l=d.value)==null?void 0:l.list]),A=b.useMemo(()=>r.searchText?O.filter(t=>t.clientName.toLowerCase().includes(r.searchText.toLowerCase())||t.clientId.toLowerCase().includes(r.searchText.toLowerCase())||t.scope.toLowerCase().includes(r.searchText.toLowerCase())):O,[r.searchText,O]),_=b.useMemo(()=>[{label:h("oauth.client.name"),name:"clientName",options:{customBodyRender:(t,{rowIndex:C})=>{const U=A[C],j=c(U.logoUri),N=pe.fromAppDid(U.clientId,a);return e.jsx(p,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(p,{display:"flex",alignItems:"center",gap:2,sx:{cursor:"pointer"},children:[e.jsx(ne,{variant:"rounded",shape:"square",did:N.address,src:j,size:48}),e.jsxs(L,{gap:.5,children:[e.jsx(p,{sx:{color:"text.primary"},children:U.clientName}),e.jsx(p,{sx:{color:"text.secondary"},children:U.clientUri})]})]})})}}},{label:h("oauth.client.clientId"),name:"clientId"},{label:h("oauth.client.scope"),name:"scope",options:{customBodyRender:t=>e.jsx(M,{scope:t})}},{label:h("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:Be}},{label:h("common.createdBy"),name:"createdBy",width:100,options:{customBodyRender:t=>t?e.jsx(ve,{showDid:!0,did:t,cardType:Ce.Detailed,infoType:Te.Minimal,sx:{border:0,padding:0}}):h("oauth.client.openRegistration")}},{label:h("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(t,{rowIndex:C})=>{const U=A[C];return e.jsx(De,{actions:[{icon:e.jsx(Ae,{}),text:h("common.edit"),onClick:j=>{j.stopPropagation(),x(U)}},{icon:e.jsx(we,{}),text:h("common.delete"),onClick:j=>{j.stopPropagation(),E(U)}}]})}}}],[A,h,c,a,x,E]),D=({page:t,rowsPerPage:C,searchText:U})=>{r.pageSize!==C?u(j=>({...j,searchText:"",pageSize:C,page:1})):r.page!==t+1?u(j=>({...j,searchText:"",page:t+1})):r.searchText!==U&&u(j=>({...j,searchText:U,page:1}))};return e.jsxs(p,{ref:g,sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[q?e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}):null,e.jsx(Se,{data:A,columns:_,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:A.length,searchDebounceTime:400,onRowClick(t,{dataIndex:C},U){var j;if((j=g.current)!=null&&j.contains(U.target)){const N=A[C];m(N)}}},onChange:D,title:q?null:e.jsx(le,{title:h("oauth.client.listTitle"),tooltipTitle:h("oauth.client.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${f}/oauth-service`}),customButtons:[e.jsxs(z,{variant:"contained",size:"small",onClick:()=>s(!0),children:[P?e.jsx(Z,{size:16}):e.jsx(ue,{style:{fontSize:16}}),h("common.create")]},"add")],loading:!1,emptyNode:e.jsx(Ie,{children:h("oauth.client.empty")})}),e.jsx(ie,{selected:i,onClose:()=>m(null)}),e.jsx(be,{open:n,onCreated:()=>{s(!1),d.retry()},onClose:()=>s(!1)}),I&&e.jsx(je,{client:I,onUpdate:d.retry,onClose:()=>x(null)}),T&&e.jsx(te,{...T,onDelete:d.retry,onClose:()=>E(null)})]})}export{It as default};
@@ -1,4 +1,4 @@
1
- import{r as h}from"./vendor-react-DEoibe3W.js";import{H as o,j as r,aq as ee,e as $,ap as le,aa as f,ah as L,T as S,v as W,X as ce,bK as Me,ad as tt,bL as rt,au as nt,ai as st,a9 as Pe,m as it,bX as ot,y as at,s as lt,I as ct}from"./vendor-mui-core-Bq8gXTan.js";import{b as z,u as ie,m as dt}from"./vendor-hooks-DqdmWCmo.js";import{a as te,$ as ut,i as pt,aR as ht,k as de,D as U,a1 as ue,bb as pe,bf as ft,r as Ne,I as Ae,br as mt,bs as gt,bt as xt,bu as yt}from"./vendor-ux-did-connect-pzpsrvqx.js";import{S as vt}from"./index-DEZojGsm.js";import{B as bt}from"./bundle-avatar-UIbxwQif.js";import{a as jt,g as he,b as fe,c as B,s as X,H as wt,u as ze,M as Le,d as Q,e as kt,m as Rt,i as Tt}from"./use-blocklet-logo-4UB-MFD3.js";import{A as O,ah as It,z as De,b as D,a1 as Ct}from"./vendor-utils-BfZ4tlod.js";import{u as Y,p as St,h as J,f as Ee,l as $t}from"./vendor-arcblock-CwufDgLV.js";import{d as Mt}from"./InfoOutlined-BVWbftGI.js";import{d as Pt}from"./CheckCircle-DUJmWceY.js";import{p as Nt}from"./util-BQAJqeb4.js";import{D as At}from"./index-CwUT0vPy.js";function me({blocklet:e,style:t,size:s,...n}){const a=jt({blocklet:e,square:!0}),{variant:c}=n;return r.jsx(ee,{variant:c||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:r.jsx("img",{src:a,alt:"",style:{width:s}})})}me.propTypes={blocklet:o.object.isRequired,style:o.object,size:o.oneOfType([o.number,o.string])};me.defaultProps={style:{},size:40};function zt(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function re({value:e,shouldUpdate:t=!1,...s}){const{locale:n}=te(),[a,c]=h.useState(0);if(h.useEffect(()=>{let l;if(t){const u=new Date(e).getTime(),y=Date.now(),m=Math.abs(Math.floor((u-y)/1e3)),v=()=>{c(b=>{const w=Math.random()*1e3;return parseFloat((b+w).toFixed(4))})};m<60?l=setInterval(v,1e3):m<60*60?l=setInterval(v,6e4):l=setInterval(v,36e5)}return()=>{clearInterval(l)}},[e,a,t]),!e)return"-";const i=zt(e);return r.jsx(ut,{value:i,locale:n,...s})}re.propTypes={value:o.any,shouldUpdate:o.bool};re.defaultProps={value:"",shouldUpdate:!1};const Lt=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Dt=e=>e.every(t=>t.type==="text"),Et=e=>e.every(t=>t.type==="image"),_t=e=>It(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(s=>{var n,a,c;return(c=(a=(n=s==null?void 0:s.data)==null?void 0:n.text)==null?void 0:a.trim)==null?void 0:c.call(a)})),Ht=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(s=>s.type===t)},qt=(e,t)=>{try{const s=pt.toTypeInfo(e);if(!(s.role!==void 0&&s.role!==ht.types.RoleType.ACCOUNT))return;const a=O(de.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return De(a,{did:e,locale:t})}catch(s){console.error(s);return}},Wt=(e,t)=>{var n;const s=(n=t==null?void 0:t.componentMountPoints)==null?void 0:n.find(a=>a.did===e);return s==null?void 0:s.mountPoint},Bt=(e,t)=>{var a,c,i;if(!e)return null;if(((a=e.actions)==null?void 0:a.length)===1)return e.actions[0].link||null;const s=he(e.activity),n=(s==null?void 0:s.metaLink)||(s==null?void 0:s.targetLink);if(n)return fe(n)?n:O(t,n);if(((c=e.attachments)==null?void 0:c.length)===1){const l=e.attachments[0];if(l.type==="link")return((i=l.data)==null?void 0:i.url)||null}return null},oe=e=>{const{receivers:t=[]}=e;return t.length?t.every(s=>s.read):!0};function Ut(e){const t=e.getBoundingClientRect(),s=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,a=t.height,c=t.width;let i=0;t.top>=0&&t.bottom<=n?i=a:t.top<0&&t.bottom>0&&t.bottom<=n?i=t.bottom:t.top>=0&&t.top<n&&t.bottom>n?i=n-t.top:t.top<0&&t.bottom>n&&(i=n);let l=0;return t.left>=0&&t.right<=s?l=c:t.left<0&&t.right>0&&t.right<=s?l=t.right:t.left>=0&&t.left<s&&t.right>s?l=s-t.left:t.left<0&&t.right>s&&(l=s),i*l/(a*c)>=.5}const Ot=e=>{if(!e)return[];const t=[],s=5,n=Array.from(e.querySelectorAll(".notification-row")),a=n.length;for(let c=0;c<a;c+=s){const i=n.slice(c,c+s);let l=!0;for(const u of i){const y=u.id;if(Ut(u))t.push(y);else{l=!1;break}}if(!l)break}return t},_e=e=>{var s;const t=[];return e&&((s=e.items)!=null&&s.length?e.items.forEach(n=>{oe(n)||t.push(n)}):oe(e)||t.push(e)),t},Ft=(e,t)=>{let s=[];return t.length&&t.forEach(n=>{const a=e.get(n);a&&(s=s.concat(_e(a)))}),s},E=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),F=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`${de.WELLKNOWN_SERVICE_PATH_PREFIX}/proxy?url=${e}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function He({attachment:e}){const{data:t}=e,s=$();let n="";try{n=new URL(t.url).host}catch{n=t.url}return r.jsxs(le,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:a=>{a.customPreventRedirect=!0},children:[!!n&&r.jsx("span",{className:"url",children:n}),!!t.title&&r.jsx(f,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&r.jsx(f,{className:"description",style:{whiteSpace:"unset",color:s.palette.text.secondary},children:t.description}),!!t.image&&r.jsx(U,{src:Y.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.image))})]})}He.propTypes={attachment:o.object.isRequired};function qe({attachment:e}){const{data:t}=e;return r.jsx(U,{src:Y.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.url))})}qe.propTypes={attachment:o.object.isRequired};function We({attachment:e,...t}){var l;const{data:s}=e,n=((l=s.color)==null?void 0:l.toLowerCase())||t.color,a=s.size||t.size,c=s.fontWeight||t.fontWeight||400;let i="14px";return a==="small"?i="12px":a==="normal"?i="14px":a==="big"?i="16px":a==="large"&&(i="18px"),r.jsx(Vt,{className:"title",style:{fontSize:i,color:n,whiteSpace:"unset",fontWeight:c},children:s.text})}We.propTypes={attachment:o.object.isRequired};const Vt=L.span`
1
+ import{r as h}from"./vendor-react-DEoibe3W.js";import{H as o,j as r,aq as ee,e as $,ap as le,aa as f,ah as L,T as S,v as W,X as ce,bK as Me,ad as tt,bL as rt,au as nt,ai as st,a9 as Pe,m as it,bX as ot,y as at,s as lt,I as ct}from"./vendor-mui-core-Bq8gXTan.js";import{b as z,u as ie,m as dt}from"./vendor-hooks-B2N8eE_a.js";import{a as te,$ as ut,i as pt,aR as ht,k as de,D as U,a1 as ue,bb as pe,bf as ft,r as Ne,I as Ae,br as mt,bs as gt,bt as xt,bu as yt}from"./vendor-ux-did-connect-CQtodyZB.js";import{S as vt}from"./index-DEZojGsm.js";import{B as bt}from"./bundle-avatar-DKZRbFJ2.js";import{a as jt,g as he,b as fe,c as B,s as X,H as wt,u as ze,M as Le,d as Q,e as kt,m as Rt,i as Tt}from"./use-blocklet-logo-BWK1UHK5.js";import{A as O,ah as It,z as De,b as D,a1 as Ct}from"./vendor-utils-uPLZO5mM.js";import{u as Y,p as St,h as J,f as Ee,l as $t}from"./vendor-arcblock-DzylOsX3.js";import{d as Mt}from"./InfoOutlined-GEKFkezP.js";import{d as Pt}from"./CheckCircle-BMMes-V7.js";import{p as Nt}from"./util-TW4lcckB.js";import{D as At}from"./index-DBdN7QPA.js";function me({blocklet:e,style:t,size:s,...n}){const a=jt({blocklet:e,square:!0}),{variant:c}=n;return r.jsx(ee,{variant:c||"square",style:Object.assign({backgroundColor:"transparent",width:s,height:s,borderRadius:10},t),...n,children:r.jsx("img",{src:a,alt:"",style:{width:s}})})}me.propTypes={blocklet:o.object.isRequired,style:o.object,size:o.oneOfType([o.number,o.string])};me.defaultProps={style:{},size:40};function zt(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function re({value:e,shouldUpdate:t=!1,...s}){const{locale:n}=te(),[a,c]=h.useState(0);if(h.useEffect(()=>{let l;if(t){const u=new Date(e).getTime(),y=Date.now(),m=Math.abs(Math.floor((u-y)/1e3)),v=()=>{c(b=>{const w=Math.random()*1e3;return parseFloat((b+w).toFixed(4))})};m<60?l=setInterval(v,1e3):m<60*60?l=setInterval(v,6e4):l=setInterval(v,36e5)}return()=>{clearInterval(l)}},[e,a,t]),!e)return"-";const i=zt(e);return r.jsx(ut,{value:i,locale:n,...s})}re.propTypes={value:o.any,shouldUpdate:o.bool};re.defaultProps={value:"",shouldUpdate:!1};const Lt=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Dt=e=>e.every(t=>t.type==="text"),Et=e=>e.every(t=>t.type==="image"),_t=e=>It(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(s=>{var n,a,c;return(c=(a=(n=s==null?void 0:s.data)==null?void 0:n.text)==null?void 0:a.trim)==null?void 0:c.call(a)})),Ht=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(s=>s.type===t)},qt=(e,t)=>{try{const s=pt.toTypeInfo(e);if(!(s.role!==void 0&&s.role!==ht.types.RoleType.ACCOUNT))return;const a=O(de.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return De(a,{did:e,locale:t})}catch(s){console.error(s);return}},Wt=(e,t)=>{var n;const s=(n=t==null?void 0:t.componentMountPoints)==null?void 0:n.find(a=>a.did===e);return s==null?void 0:s.mountPoint},Bt=(e,t)=>{var a,c,i;if(!e)return null;if(((a=e.actions)==null?void 0:a.length)===1)return e.actions[0].link||null;const s=he(e.activity),n=(s==null?void 0:s.metaLink)||(s==null?void 0:s.targetLink);if(n)return fe(n)?n:O(t,n);if(((c=e.attachments)==null?void 0:c.length)===1){const l=e.attachments[0];if(l.type==="link")return((i=l.data)==null?void 0:i.url)||null}return null},oe=e=>{const{receivers:t=[]}=e;return t.length?t.every(s=>s.read):!0};function Ut(e){const t=e.getBoundingClientRect(),s=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,a=t.height,c=t.width;let i=0;t.top>=0&&t.bottom<=n?i=a:t.top<0&&t.bottom>0&&t.bottom<=n?i=t.bottom:t.top>=0&&t.top<n&&t.bottom>n?i=n-t.top:t.top<0&&t.bottom>n&&(i=n);let l=0;return t.left>=0&&t.right<=s?l=c:t.left<0&&t.right>0&&t.right<=s?l=t.right:t.left>=0&&t.left<s&&t.right>s?l=s-t.left:t.left<0&&t.right>s&&(l=s),i*l/(a*c)>=.5}const Ot=e=>{if(!e)return[];const t=[],s=5,n=Array.from(e.querySelectorAll(".notification-row")),a=n.length;for(let c=0;c<a;c+=s){const i=n.slice(c,c+s);let l=!0;for(const u of i){const y=u.id;if(Ut(u))t.push(y);else{l=!1;break}}if(!l)break}return t},_e=e=>{var s;const t=[];return e&&((s=e.items)!=null&&s.length?e.items.forEach(n=>{oe(n)||t.push(n)}):oe(e)||t.push(e)),t},Ft=(e,t)=>{let s=[];return t.length&&t.forEach(n=>{const a=e.get(n);a&&(s=s.concat(_e(a)))}),s},E=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),F=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`${de.WELLKNOWN_SERVICE_PATH_PREFIX}/proxy?url=${e}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function He({attachment:e}){const{data:t}=e,s=$();let n="";try{n=new URL(t.url).host}catch{n=t.url}return r.jsxs(le,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:a=>{a.customPreventRedirect=!0},children:[!!n&&r.jsx("span",{className:"url",children:n}),!!t.title&&r.jsx(f,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&r.jsx(f,{className:"description",style:{whiteSpace:"unset",color:s.palette.text.secondary},children:t.description}),!!t.image&&r.jsx(U,{src:Y.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.image))})]})}He.propTypes={attachment:o.object.isRequired};function qe({attachment:e}){const{data:t}=e;return r.jsx(U,{src:Y.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:F(Y.getImagePath(t.url))})}qe.propTypes={attachment:o.object.isRequired};function We({attachment:e,...t}){var l;const{data:s}=e,n=((l=s.color)==null?void 0:l.toLowerCase())||t.color,a=s.size||t.size,c=s.fontWeight||t.fontWeight||400;let i="14px";return a==="small"?i="12px":a==="normal"?i="14px":a==="big"?i="16px":a==="large"&&(i="18px"),r.jsx(Vt,{className:"title",style:{fontSize:i,color:n,whiteSpace:"unset",fontWeight:c},children:s.text})}We.propTypes={attachment:o.object.isRequired};const Vt=L.span`
2
2
  width: 100%;
3
3
  display: -webkit-box;
4
4
  -webkit-box-orient: vertical;
@@ -0,0 +1 @@
1
+ import{j as o}from"./vendor-mui-core-Bq8gXTan.js";import"./vendor-react-DEoibe3W.js";import{S as t}from"./studio-BWs_EnV3.js";import"./vendor-ux-did-connect-CQtodyZB.js";import"./vendor-utils-uPLZO5mM.js";import"./vendor-hooks-B2N8eE_a.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DzylOsX3.js";import"./TuneOutlined-CjVMXY_7.js";function d(){return o.jsx(t,{children:"Coming soon..."})}export{d as default};