@abtnode/blocklet-services 1.16.44-beta-20250513-030435-c2d99062 → 1.16.44-beta-20250518-020443-77ba168f
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/api/index.js +3 -1
- package/api/libs/connect/session.js +22 -9
- package/api/libs/image.js +1 -2
- package/api/libs/open-graph/index.js +1 -2
- package/api/libs/push-kit/index.js +1 -0
- package/api/middlewares/check-federated-cors-call.js +2 -2
- package/api/middlewares/check-permission.js +10 -3
- package/api/routes/blocklet.js +1 -1
- package/api/routes/csp-proxy.js +67 -0
- package/api/routes/federated.js +30 -25
- package/api/routes/oauth/client.js +2 -2
- package/api/routes/openembed.js +1 -1
- package/api/routes/user-session.js +1 -2
- package/api/routes/user.js +9 -6
- package/api/services/auth/connect/connect-to-did-spaces-for-user.js +1 -1
- package/api/services/auth/connect/pre-setup.js +2 -1
- package/api/services/auth/connect/setup.js +31 -4
- package/api/services/image/index.js +1 -1
- package/api/services/notification/queue.js +27 -4
- package/api/socket/channel/did.js +14 -7
- package/api/util/federated.js +5 -1
- package/api/util/index.js +6 -0
- package/api/util/user-util.js +1 -1
- package/dist/assets/{AdapterDayjs-BD9H1lZ-.js → AdapterDayjs-YbaNvT9I.js} +1 -1
- package/dist/assets/{ArrowDropDown-BrO-zDlb.js → ArrowDropDown-xgs4N3Rf.js} +1 -1
- package/dist/assets/{CheckCircle-Ds4QI0ey.js → CheckCircle-JXD6tKIa.js} +1 -1
- package/dist/assets/{ChevronLeft-CnQaQ-rc.js → ChevronLeft-D0eko_T8.js} +1 -1
- package/dist/assets/{ChevronRight-a_2_x6Ew.js → ChevronRight-CQY9Ni7X.js} +1 -1
- package/dist/assets/{Community-DW6DJTIs.js → Community-BCL2L7ib.js} +1 -1
- package/dist/assets/{DeleteOutline-CFN4r-OG.js → DeleteOutline-BEGOj_wq.js} +1 -1
- package/dist/assets/{Done-DqSE6KPe.js → Done-BUJJNjlP.js} +1 -1
- package/dist/assets/{Download-C_LRKzbG.js → Download-DdZEsxmZ.js} +1 -1
- package/dist/assets/{Edit-CbR4eoK8.js → Edit-vxeVwrqO.js} +1 -1
- package/dist/assets/{EditIcon-DxUWMw59.js → EditIcon-Dffk7mPL.js} +1 -1
- package/dist/assets/{Email-DWueGk7t.js → Email-CdSNK0eA.js} +1 -1
- package/dist/assets/{Error-jEHdDLNk.js → Error-C-RD4e9g.js} +1 -1
- package/dist/assets/{ExpandLess-CkoEHpgk.js → ExpandLess-CmqG9SE7.js} +1 -1
- package/dist/assets/{Google-DHEolkW-.js → Google-B7PA4qF8.js} +1 -1
- package/dist/assets/{Holiday-Dwvo6QkZ.js → Holiday-enHMZqEf.js} +1 -1
- package/dist/assets/{InfoOutlined-DkG0jjos.js → InfoOutlined-BIr5nkjV.js} +1 -1
- package/dist/assets/{Launch-B-2Jomi6.js → Launch-KvZQI_SA.js} +1 -1
- package/dist/assets/{LaunchOutlined-CXNijfqX.js → LaunchOutlined-ClxZU_tj.js} +1 -1
- package/dist/assets/{Location-DUEOr9J2.js → Location-By12Z3Te.js} +1 -1
- package/dist/assets/{LockIcon-Cjg8jV1E.js → LockIcon-98CKEIBe.js} +1 -1
- package/dist/assets/{Meeting-CJaI_cKm.js → Meeting-CLeFWDkY.js} +1 -1
- package/dist/assets/{MoreHoriz-B6KdR0Y8.js → MoreHoriz-H8rabTmY.js} +1 -1
- package/dist/assets/{OffSick-C9VqqjrN.js → OffSick-dUm363rs.js} +1 -1
- package/dist/assets/{Phone-DcHUzCa-.js → Phone--BSu-btI.js} +1 -1
- package/dist/assets/{PlayArrow-BToG9L6q.js → PlayArrow-CmxnItFZ.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-BPVDAm8U.js → QuestionMarkCircle-DTf-Tya5.js} +1 -1
- package/dist/assets/{ServerLogo-s6cfhx92.js → ServerLogo-CEsILJl5.js} +1 -1
- package/dist/assets/{Timezone-B-Ho_Uno.js → Timezone-YZ0dMUEr.js} +1 -1
- package/dist/assets/{TuneOutlined-BR2H7Mxj.js → TuneOutlined-DmhFMgM-.js} +1 -1
- package/dist/assets/{ViewList-D8vtMKQz.js → ViewList-DXk3qGFU.js} +1 -1
- package/dist/assets/{WorkingRemotely-lJ6DUMCR.js → WorkingRemotely-BX7rgbEY.js} +1 -1
- package/dist/assets/{access-control-Din7doVd.js → access-control-DupKwlXi.js} +1 -1
- package/dist/assets/{actions-BjTeIzgS.js → actions-V9hjjowb.js} +1 -1
- package/dist/assets/{add-component-core-5x4gTem5.js → add-component-core-hWyA0oyr.js} +16 -16
- package/dist/assets/add-resource-BE6wXeqY.js +1 -0
- package/dist/assets/addon-DtaZ0TB3.js +14 -0
- package/dist/assets/{advanced-CN6mCSES.js → advanced-EG10mbK7.js} +1 -1
- package/dist/assets/appearance-Czknho-C.js +1 -0
- package/dist/assets/ar-2yn9i2dw.js +7 -0
- package/dist/assets/audit-logs-WqpwTrlM.js +35 -0
- package/dist/assets/{authorize-D2LCmekq.js → authorize-DEmcifx9.js} +1 -1
- package/dist/assets/{base32-_zEVBJUg.js → base32-BPfgmw66.js} +1 -1
- package/dist/assets/blocklet-default-logo-Bspnu_ws.png +0 -0
- package/dist/assets/{branding-CwhhJRKu.js → branding-CJx0esf8.js} +2 -2
- package/dist/assets/{branding-B6AmOMI6.js → branding-DFhJVvNX.js} +2 -2
- package/dist/assets/{bundle-avatar-CDJRatFg.js → bundle-avatar-BbIyJr7P.js} +1 -1
- package/dist/assets/button-m03GMAJs.js +1 -0
- package/dist/assets/click-to-copy-DmYkL7Ui.js +1 -0
- package/dist/assets/{collapse-QV_2gdtM.js → collapse-FsvH0gRe.js} +1 -1
- package/dist/assets/complete-C834qh46.js +39 -0
- package/dist/assets/{component-Cb3m5qUw.js → component-BK7TQ5JB.js} +8 -8
- package/dist/assets/{config-kGXJEkFJ.js → config-Cc-40NNR.js} +2 -2
- package/dist/assets/{config-LE_EJolF.js → config-Dl_53WnU.js} +1 -1
- package/dist/assets/{config-navigation-CKVyFhfH.js → config-navigation-DH93rn-r.js} +3 -3
- package/dist/assets/config-space-CxEu1ku3.js +1 -0
- package/dist/assets/confirm-DFwkkng7.js +7 -0
- package/dist/assets/{connect-HAC-YfHh.js → connect-CX2tLgwf.js} +1 -1
- package/dist/assets/{connect-BMn4CxDk.js → connect-tnlrEGOa.js} +1 -1
- package/dist/assets/connect-to-jqzhxL2-.js +1 -0
- package/dist/assets/{content-layout-BzF-fNQz.js → content-layout--sy9JlYZ.js} +1 -1
- package/dist/assets/dashboard-Dc5xtJBc.js +239 -0
- package/dist/assets/de-CEKbJD3-.js +7 -0
- package/dist/assets/delete-confirm-cVLum8Er.js +1 -0
- package/dist/assets/{did-address-DjwPl1uy.js → did-address-BI9LYTx-.js} +1 -1
- package/dist/assets/domain-7fDuc1TD.js +9 -0
- package/dist/assets/domain-action-card-CoP_GfSR.js +28 -0
- package/dist/assets/domains-CGg1il1q.js +1 -0
- package/dist/assets/{dot-BA3EvSrh.js → dot-BB5occkV.js} +2 -2
- package/dist/assets/{email-CHR0EOis.js → email-9P_7A90f.js} +2 -2
- package/dist/assets/{empty-spinner-n0_Ehns5.js → empty-spinner-BZw_ShnT.js} +1 -1
- package/dist/assets/{es-BuUaHPig.js → es-dvMygD-W.js} +3 -3
- package/dist/assets/{exchange-passport-D0iIXJxD.js → exchange-passport-CfsGf2j7.js} +1 -1
- package/dist/assets/fr-BvFd5xp9.js +7 -0
- package/dist/assets/{fuel-nMTHNcy-.js → fuel-DOrn9jKI.js} +1 -1
- package/dist/assets/{gen-access-key-DH4wNzRm.js → gen-access-key-Ddbn2A92.js} +1 -1
- package/dist/assets/get-safe-url-BcH2iukm.js +1 -0
- package/dist/assets/get-safe-url-OaLLn0UN.js +1 -0
- package/dist/assets/hi-C51yBXa5.js +5 -0
- package/dist/assets/{home-DzCwBE8F.js → home-CJ28zTIJ.js} +1 -1
- package/dist/assets/id-B1Mq_eQI.js +7 -0
- package/dist/assets/{iframe-DW7zzzTG.js → iframe-D0kv9-rE.js} +1 -1
- package/dist/assets/index-8eXqqyHQ.js +5 -0
- package/dist/assets/{index-BuXc3Oag.js → index-BBKe69-Z.js} +2 -2
- package/dist/assets/index-BEVde8cE.js +1 -0
- package/dist/assets/index-BQ8PIDUu.js +99 -0
- package/dist/assets/index-BXdw6keY.js +1 -0
- package/dist/assets/{index-BDYaw77z.js → index-BdH_4Yfe.js} +1 -1
- package/dist/assets/{index-B_-kynzD.js → index-Bi8r1T8R.js} +17 -17
- package/dist/assets/{index-CIkPfxzG.js → index-BiIZw9KG.js} +58 -58
- package/dist/assets/index-BmR2oN4p.js +113 -0
- package/dist/assets/{index-BCtmnJeV.js → index-BoYbZj00.js} +18 -14
- package/dist/assets/index-C26jJx3Z.js +55 -0
- package/dist/assets/index-C2sWzOOC.js +4 -0
- package/dist/assets/{index-BYCeMwoO.js → index-C849wD9b.js} +1 -1
- package/dist/assets/{index-BLGGjT7N.js → index-CeU2W9XY.js} +8 -8
- package/dist/assets/{index-DcUhenm6.js → index-CmQOzzP8.js} +1 -1
- package/dist/assets/{index-CPfvVvHv.js → index-D-mbJPLJ.js} +12 -12
- package/dist/assets/{index-enM9Y412.js → index-D3iGbfL9.js} +1 -1
- package/dist/assets/index-DK8EXxrQ.js +6 -0
- package/dist/assets/index-DPmpjBeE.js +241 -0
- package/dist/assets/{index-B8r-LrrM.js → index-DbsXFWms.js} +1 -1
- package/dist/assets/{index-CxwBhS0_.js → index-DfO-sKO8.js} +1 -1
- package/dist/assets/{index-BIPRCLBG.js → index-DoCu_ga_.js} +2 -2
- package/dist/assets/{index-ftkgQlGr.js → index-DwswX2WL.js} +1 -1
- package/dist/assets/{index-BA8C83iz.js → index-DxVAvQEw.js} +4 -4
- package/dist/assets/index-d-GNQQ24.js +1 -0
- package/dist/assets/{invitation-DzT9Qa0A.js → invitation-DmNSx8lT.js} +4 -4
- package/dist/assets/invite-BRV4-5NB.js +1 -0
- package/dist/assets/issue-passport-DVYjG5SL.js +1 -0
- package/dist/assets/item-F_qGx0RW.js +2 -0
- package/dist/assets/ja-CCKVmbEX.js +7 -0
- package/dist/assets/ko-A_w8tIEg.js +7 -0
- package/dist/assets/{landing-page-Due4o1uF.js → landing-page-CUrvCtHZ.js} +1 -1
- package/dist/assets/{launch-result-message-DIYoykBK.js → launch-result-message-Eea5FZDm.js} +1 -1
- package/dist/assets/{layout-BcLfVSqs.js → layout-Dkaou_pj.js} +2 -2
- package/dist/assets/list-CUP3NH6M.js +236 -0
- package/dist/assets/list-Dq129hfR.js +2 -0
- package/dist/assets/list-header-DNFbdM3a.js +1 -0
- package/dist/assets/localization-Cl5vfs2R.js +1 -0
- package/dist/assets/{log-Iko0jLNA.js → log-C_uY3dq9.js} +2 -3
- package/dist/assets/logger-BYg6vYBA.js +1 -0
- package/dist/assets/{login-4Yq_pPSw.js → login-D8Wk5up1.js} +1 -1
- package/dist/assets/login-oauth-callback-DMou-vp-.js +1 -0
- package/dist/assets/{logo-uploader-Cnkdgyfv.js → logo-uploader-CHTXjHOW.js} +3 -3
- package/dist/assets/{lost-passport-D5jMtgH_.js → lost-passport-DlnOD9y-.js} +2 -2
- package/dist/assets/{open-window--2G6Qjbq.js → open-window-CuyFfntO.js} +1 -1
- package/dist/assets/overview-B451HiB6.js +85 -0
- package/dist/assets/{page-header-xyZktwBS.js → page-header-DpNvpd52.js} +4 -4
- package/dist/assets/{passport-item-DH3_49G1.js → passport-item-BWCHjFYy.js} +1 -1
- package/dist/assets/{permission-BH1TY_tz.js → permission-Cnn9EYOW.js} +1 -1
- package/dist/assets/preferences-Cqm2olsT.js +1 -0
- package/dist/assets/profile-embed-CcuuyEXm.js +1 -0
- package/dist/assets/pt-7HHecjdA.js +5 -0
- package/dist/assets/publish-resource-BdSfAE92.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-7PS2VwOi.js → react-beautiful-dnd.esm-cfY5JZV6.js} +1 -1
- package/dist/assets/ru-Bw8FVC4M.js +5 -0
- package/dist/assets/runtime-BKK1_RAt.js +1 -0
- package/dist/assets/sdk-CXaHNlMH.js +1 -0
- package/dist/assets/{section-Cv4udilp.js → section-C1TPQFRq.js} +1 -1
- package/dist/assets/{security-CX01lhxW.js → security-C8vye2TA.js} +4 -4
- package/dist/assets/{session-CHdTc1We.js → session-B2z_IWIe.js} +1 -1
- package/dist/assets/setup-CS2QWFMb.js +30 -0
- package/dist/assets/{shorten-label-Cng55547.js → shorten-label-Bf7YQUd6.js} +1 -1
- package/dist/assets/{simple-select-CP_Svi_D.js → simple-select-DwWEI_ZU.js} +1 -1
- package/dist/assets/{slicedToArray-C7EPqaHf.js → slicedToArray-BSaY8ui4.js} +1 -1
- package/dist/assets/{spaces-BVG-t3ND.js → spaces-DMMN97uo.js} +1 -1
- package/dist/assets/{start-CMRQU8Px.js → start-6o3_Gxa0.js} +3 -3
- package/dist/assets/{starting-progress-CiLZpNpg.js → starting-progress-DeFtXRb_.js} +1 -1
- package/dist/assets/status-C73nIKwK.js +1 -0
- package/dist/assets/{step-actions-BfGTFkaB.js → step-actions-CqbOBcvS.js} +1 -1
- package/dist/assets/{studio-DikseKRr.js → studio-CiFHrC57.js} +1 -1
- package/dist/assets/{switch-control-C5i52ixk.js → switch-control-DnNP5DPe.js} +1 -1
- package/dist/assets/table-tips-hNIkakER.js +1 -0
- package/dist/assets/th-DyW-mYrC.js +5 -0
- package/dist/assets/traffic-B7XP49Y5.js +35 -0
- package/dist/assets/{transfer-BnR8fjLW.js → transfer-BfUTfR-d.js} +1 -1
- package/dist/assets/{unsubscribe-rUE2LcLN.js → unsubscribe-Bf4dBSoS.js} +1 -1
- package/dist/assets/{use-blocklet-logo-Phq7jasP.js → use-blocklet-logo-Bv56-gH-.js} +1 -1
- package/dist/assets/{use-mobile-Boa_xu9A.js → use-mobile-JEGQfLZ2.js} +1 -1
- package/dist/assets/{use-mobile-DyX6Fl8Z.js → use-mobile-ZAS6Si4t.js} +1 -1
- package/dist/assets/{useAsync-DV3NyLhI.js → useAsync-DnXpD472.js} +1 -1
- package/dist/assets/{useLocalStorage-DVnkpneF.js → useLocalStorage-BRd3tKN9.js} +1 -1
- package/dist/assets/user-center-Ck0gNc-m.js +76 -0
- package/dist/assets/{util-CEAObyfj.js → util-CVjZG67N.js} +1 -1
- package/dist/assets/{util-Btd7aQEC.js → util-DWicJSOi.js} +1 -1
- package/dist/assets/{vendor-arcblock-uz9DVywv.js → vendor-arcblock-DPRICUXM.js} +109 -109
- package/dist/assets/{vendor-hooks-rDgu5KV9.js → vendor-hooks-Zkb4Ilbj.js} +1 -1
- package/dist/assets/{vendor-mui-core-D_bnq77o.js → vendor-mui-core-Bh-qMRq3.js} +1 -1
- package/dist/assets/{vendor-mui-x-R-0SFz4c.js → vendor-mui-x-CQTjfcpn.js} +1 -1
- package/dist/assets/{vendor-ux-did-connect-DHrruicZ.js → vendor-ux-did-connect-Ck9lzrbN.js} +73 -73
- package/dist/assets/vi-bzer6J4H.js +5 -0
- package/dist/assets/wrap-locale-HcPVeI43.js +1 -0
- package/dist/assets/zh-Cti0XXui.js +8 -0
- package/dist/assets/zh-tw-BLcDG99i.js +7 -0
- package/dist/images/all-done-dark.svg +68 -0
- package/dist/images/all-done-light.svg +60 -0
- package/dist/index.html +5 -5
- package/dist/service-worker.js +1 -1
- package/package.json +48 -47
- package/dist/assets/add-resource-BrZnm53f.js +0 -1
- package/dist/assets/addon--u4EErgw.js +0 -14
- package/dist/assets/appearance-Bowm1Shj.js +0 -1
- package/dist/assets/ar-Blzb8h2o.js +0 -7
- package/dist/assets/audit-logs-DczjqamJ.js +0 -35
- package/dist/assets/button-D8hoY4xw.js +0 -1
- package/dist/assets/click-to-copy-CFiGx48J.js +0 -1
- package/dist/assets/complete-CKhw9u_z.js +0 -45
- package/dist/assets/config-space-CogRdhoQ.js +0 -1
- package/dist/assets/confirm-SdqBW-ti.js +0 -7
- package/dist/assets/connect-to-eNQDY2rc.js +0 -1
- package/dist/assets/dashboard-BYxl5V9e.js +0 -239
- package/dist/assets/de-BxI5dM9K.js +0 -7
- package/dist/assets/delete-confirm-CKF_eljP.js +0 -1
- package/dist/assets/domain-DotN6lCb.js +0 -9
- package/dist/assets/domain-action-card-DHH9PLRG.js +0 -24
- package/dist/assets/domains-BV2pykxi.js +0 -1
- package/dist/assets/format-error-BrmqJs5a.js +0 -2
- package/dist/assets/fr-DezMACmP.js +0 -7
- package/dist/assets/get-safe-url-B5RJTMjC.js +0 -1
- package/dist/assets/get-safe-url-Bk6PlU7n.js +0 -1
- package/dist/assets/hi-ClbEozhq.js +0 -5
- package/dist/assets/id-CXYm-1K3.js +0 -7
- package/dist/assets/index-8CHxrfFP.js +0 -1
- package/dist/assets/index-B54lTbup.js +0 -99
- package/dist/assets/index-BCNchyGN.js +0 -141
- package/dist/assets/index-BJxv6GA4.js +0 -4
- package/dist/assets/index-CYeNo51G.js +0 -113
- package/dist/assets/index-CfxcUIhC.js +0 -1
- package/dist/assets/index-Ctzl9JDw.js +0 -55
- package/dist/assets/index-D7eC9ptO.js +0 -6
- package/dist/assets/index-D9KfgDPN.js +0 -241
- package/dist/assets/invite-CQPeUOT4.js +0 -1
- package/dist/assets/issue-passport-BYhvmLsl.js +0 -1
- package/dist/assets/item-D942q-4T.js +0 -2
- package/dist/assets/ja-B5V7b8Cm.js +0 -7
- package/dist/assets/ko-DP9up1nF.js +0 -7
- package/dist/assets/list-BiJWMg_P.js +0 -236
- package/dist/assets/list-DKUSPdB6.js +0 -2
- package/dist/assets/list-header-HqBQs1yn.js +0 -1
- package/dist/assets/localization-BUDtnbyU.js +0 -1
- package/dist/assets/logger-BLZgTs_U.js +0 -1
- package/dist/assets/login-oauth-callback-DZaPZfnA.js +0 -1
- package/dist/assets/overview-CaQ-tV1t.js +0 -85
- package/dist/assets/preferences-CfmnTXfl.js +0 -1
- package/dist/assets/profile-embed-ZtzRYgXv.js +0 -1
- package/dist/assets/pt-CG45pWr4.js +0 -5
- package/dist/assets/publish-resource-BtFRgv4P.js +0 -1
- package/dist/assets/ru-0VhRQc7t.js +0 -5
- package/dist/assets/runtime-B0207zk1.js +0 -1
- package/dist/assets/sdk-9eXJSWHG.js +0 -1
- package/dist/assets/setup-DIAgbS7c.js +0 -30
- package/dist/assets/status-DSQPLYSp.js +0 -1
- package/dist/assets/th-DwH8cjcw.js +0 -5
- package/dist/assets/traffic-ClE631in.js +0 -35
- package/dist/assets/user-center-D25Vw-wP.js +0 -76
- package/dist/assets/vi-CcmTJggB.js +0 -5
- package/dist/assets/wrap-locale-CPW6a0PM.js +0 -1
- package/dist/assets/zh-C2MKZFZw.js +0 -8
- package/dist/assets/zh-tw-mW-UVEHx.js +0 -7
- package/dist/images/all-done.png +0 -0
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B_-kynzD.js","assets/vendor-ux-did-connect-DHrruicZ.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-mui-core-D_bnq77o.js","assets/vendor-hooks-rDgu5KV9.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-uz9DVywv.js","assets/index-Bs1kxR8_.js","assets/index-CIkPfxzG.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as x,f as Tt,l as ct,L as ye,g as Mn,u as Un,i as Vn,j as jt}from"./vendor-react-DEoibe3W.js";import{a9 as Se,j as e,v as Be,aa as c,bd as $t,H as s,ad as ke,I as ae,T as L,s as Fn,c7 as Oo,D as at,ah as ve,au as Hn,bS as Ke,ak as dt,bt as et,bx as tt,y as K,ab as we,P as Wo,G as Bo,w as Pt,a7 as Mo,M as Uo,q as be,X as Gn,aj as Vo,t as Fo,bV as Jn,N as Je,z as Ho,O as ne,al as Re,at as Go,L as Jo,A as _t,b6 as Xo,bK as Yo,by as Xn,e as Qo,aq as Yn,b$ as Qn,af as Zn,U as Zo,W as ot,bF as Kn,bG as es,c8 as ts,c9 as os,bo as wt,bp as ns,br as ss,bv as rs,bw as kt}from"./vendor-mui-core-D_bnq77o.js";import{z as je,C as De,ad as ls,a5 as is,f as yo,ae as vo,a9 as cs}from"./index-CIkPfxzG.js";import{r as Ie,j as Y,u as Q,bu as Ko,h as as,B as qe,b7 as en,X as tn,b4 as on,ao as ds,bv as us,a7 as qt,_ as M,a3 as ps,I as de,bw as hs,ba as fs,a as We,am as ut,b5 as bs,as as nn}from"./vendor-ux-did-connect-DHrruicZ.js";import{M as pt,c as fe,j as ms,Q as xs,_ as sn,T as _e,p as gs}from"./vendor-arcblock-uz9DVywv.js";import{d as js}from"./Error-jEHdDLNk.js";import{C as ht}from"./confirm-SdqBW-ti.js";import{u as Ue}from"./session-CHdTc1We.js";import{W as Ct}from"./did-address-DjwPl1uy.js";import{E as Xe}from"./empty-spinner-n0_Ehns5.js";import{B as Et}from"./bundle-avatar-CDJRatFg.js";import{S as Ce}from"./shorten-label-Cng55547.js";import{L as Lt}from"./list-header-HqBQs1yn.js";import{$ as ks,A as ue,J as Nt,E as rn}from"./vendor-utils-rHXShPKm.js";import{d as ys}from"./Download-C_LRKzbG.js";import{C as ln}from"./click-to-copy-CFiGx48J.js";import{Q as vs}from"./QuestionMarkCircle-BPVDAm8U.js";import{u as Rs}from"./vendor-hooks-rDgu5KV9.js";import{_ as Pe}from"./useSetState-CWq0AVWn.js";import{c as At}from"./index-DVQCgvFb.js";import{E as zt}from"./index-BYCeMwoO.js";import"./api-BjteVZFg.js";import{d as ws}from"./ChevronRight-a_2_x6Ew.js";import{T as Cs,a as Ss}from"./vendor-mui-x-R-0SFz4c.js";import{d as nt}from"./DeleteOutline-CFN4r-OG.js";import{D as Ro,C as wo,P as Co}from"./react-beautiful-dnd.esm-7PS2VwOi.js";import{c as Ds,A as cn,u as an,S as Is,a as Ts,b as $s,e as Ps,U as _s,f as yt,g as dn,n as qs,h as Es,i as So,k as Ls,l as Ns}from"./item-D942q-4T.js";import{d as As}from"./ArrowDropDown-BrO-zDlb.js";import{f as ge}from"./format-error-BrmqJs5a.js";import{d as un}from"./Launch-B-2Jomi6.js";import{d as pn}from"./Done-DqSE6KPe.js";import{D as zs}from"./delete-confirm-CKF_eljP.js";import{g as hn}from"./get-safe-url-B5RJTMjC.js";import{M as Os}from"./index-B8r-LrrM.js";import{r as Ws}from"./index-BDYaw77z.js";import"./lottie-web-jYmAQWuC.js";import"./raf-schd.esm-B3j6BePR.js";var Ot={},Bs=Se;Object.defineProperty(Ot,"__esModule",{value:!0});var fn=Ot.default=void 0,Ms=Bs(Ie()),Us=e;fn=Ot.default=(0,Ms.default)((0,Us.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var Wt={},Vs=Se;Object.defineProperty(Wt,"__esModule",{value:!0});var bn=Wt.default=void 0,Fs=Vs(Ie()),Hs=e;bn=Wt.default=(0,Fs.default)((0,Hs.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var Bt={},Gs=Se;Object.defineProperty(Bt,"__esModule",{value:!0});var mn=Bt.default=void 0,Js=Gs(Ie()),Xs=e;mn=Bt.default=(0,Js.default)((0,Xs.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Mt({did:t,projectId:o,title:n,logo:l,describe:i}){const r=`${`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${l}`,[u,a]=x.useState(!1),f=Be(m=>m.breakpoints.down("md"));return e.jsxs(c,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[e.jsx($t,{sx:{borderRadius:1},src:r}),e.jsxs(c,{children:[e.jsx(Ce,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:n||"/"}),e.jsx(Ce,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:i||"/"})]})]})}Mt.propTypes={projectId:s.string.isRequired,did:s.string.isRequired,title:s.string.isRequired,logo:s.string.isRequired,describe:s.string.isRequired};function Ut({initUrl:t}){const o=Tt(),n=(t==null?void 0:t.searchParams.get("tenantScope"))||"",{t:l,locale:i}=Q(),{api:d}=je(),{api:r}=Ue(),[u,a]=x.useState(!0),{blocklet:f}=De(),[m,j]=x.useState(null),[y,h]=x.useState(!1),p=Be(T=>T.breakpoints.down("xl")),v=Be(T=>T.breakpoints.down("md")),{componentDid:w=""}=ct(),[b,k]=x.useState(null),C=`publish-${f.meta.did}`,I=Ko(C),[$,D]=x.useState({searchText:I.searchText||"",pageSize:I.rowsPerPage||10,page:1}),N=()=>{d.getProjects({input:{did:f.meta.did,componentDid:w,tenantScope:n}}).then(T=>{const P=(T==null?void 0:T.projects)||[];a(!1),k(P)}).catch(T=>{a(!1),M.error(T.message)})},z=()=>{o(`${Y.UNOWNED_DID}/create/none`,{replace:!0})},E=T=>{j(T)},Z=()=>{a(!1),h(!0)},U=()=>{h(!1),j(null)},R=T=>{M.error(T.message),h(!1),j(null)},g=T=>{if(!(T!=null&&T.deleted)){M.error("Delete project failed");return}N(),h(!1),j(null)};x.useEffect(()=>{N()},[]);const S=x.useMemo(()=>{var P;if(!$.searchText)return b;let T=(P=$.searchText)==null?void 0:P.trim();return T?(T=as.toAddress(T).toLocaleLowerCase(),b.filter(H=>H.blockletTitle.toLowerCase().includes(T)||H.blockletDid.toLowerCase().includes(T))):b},[b,$.searchText]);if(!b&&u)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Xe,{})});if(!b)return null;if(!b.length)return e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:l("blocklet.publish.blockletEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:l("blocklet.publish.createBlockletTip")}),e.jsx(qe,{onClick:z,variant:"contained",children:l("blocklet.publish.createBlocklet")})]});const W=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:T=>{const P=b[T];return e.jsx(ye,{to:`${P.id}`,children:e.jsx(Mt,{did:f.meta.did,projectId:P.id,logo:P.blockletLogo,title:P.blockletTitle,describe:P.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:T=>T?e.jsx(en,{type:"success",children:T}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:T=>T?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:T}):null}},p||w?null:{label:l("common.createdBy"),name:"createdBy",options:{customBodyRender:T=>T?e.jsx(Ct,{onClick:()=>{o(`/.well-known/service/admin/members?did=${T}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:T}):null}},p||w?null:{label:l("common.scope"),name:"componentDid",options:{customBodyRender:T=>{const P=(f.children||[]).find(H=>H.meta.did===T);return P?e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Et,{size:14,blocklet:P,ancestors:[f]}),e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:P.meta.title})]},T):""}}},p||n?null:{label:l("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:T=>e.jsx(c,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Ce,{children:T})})}},{label:l("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:T=>e.jsx(tn,{value:Number(T),locale:i})}},{label:l("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:T=>{const P=b[T];return e.jsxs(c,{display:"flex",children:[e.jsx(ye,{to:`${P.id}/new-release/${P.lastReleaseId}`,children:e.jsx(ke,{title:l("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ae,{color:"primary","aria-label":"create",children:e.jsx(fn,{style:{fontSize:18}})})})}),!!P.lastReleaseId&&e.jsx(ke,{title:l("blocklet.publish.viewLastRelease",{name:P.blockletTitle}),placement:"top",children:e.jsx(ae,{color:"secondary","aria-label":"create",children:e.jsx(ye,{style:{display:"flex"},to:`${P.id}/view/${P.lastReleaseId}`,children:e.jsx(bn,{sx:{fontSize:18}})})})}),e.jsx(ke,{title:l("blocklet.publish.delete",{name:P.blockletTitle}),placement:"top",children:e.jsx(ae,{color:"primary","aria-label":"delete",onClick:()=>E(P),children:e.jsx(on,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),B=({page:T,rowsPerPage:P,searchText:H})=>{$.pageSize!==P?D(V=>({...V,searchText:"",pageSize:P,page:1})):$.page!==T+1?D(V=>({...V,searchText:"",page:T+1})):$.searchText!==H&&D(V=>({...V,searchText:H,page:1}))},J=y?e.jsx(ds,{open:!0,popup:!0,onClose:U,action:"check-has-project-id",locale:i,checkFn:r.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:g,onError:R,extraParams:{projectId:m.id,did:f.meta.did,name:m.blockletTitle},messages:{title:l("blocklet.publish.deleteProject.title",{name:m.blockletTitle}),scan:l("blocklet.publish.deleteProject.scan",{name:m.blockletTitle}),confirm:l("blocklet.publish.deleteProject.confirm"),success:l("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Ys,{children:[e.jsx(Lt,{sx:{mb:2},left:e.jsxs(c,{display:"flex",flexDirection:"row",alignItems:"center",children:[e.jsx(c,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:l("common.blockletStudio")}),e.jsx(ke,{title:l("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(mn,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(us,{options:{searchPlaceholder:l("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:v},search:$.searchText,searchText:$.searchText,searchTextUpdate:T=>D(P=>({...P,searchText:T})),searchClose:()=>D(T=>({...T,searchText:""})),onSearchOpen:()=>{}}),e.jsxs(qe,{onClick:z,variant:"contained",children:[e.jsx(pt,{style:{fontSize:"1.3em",marginRight:4}}),l("blocklet.publish.createBlocklet")]})]})}),e.jsx(qt,{className:"main-table",locale:i,data:S,columns:W,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:C,onChange:B}),m&&e.jsx(ht,{title:`${l("common.delete")} ${m.blockletTitle}`,description:l("blocklet.publish.deleteProject.description"),confirm:l("common.confirm"),onConfirm:Z,onCancel:()=>j(null),children:e.jsx(c,{sx:{marginTop:2},children:[l("blocklet.publish.deleteProject.tip1"),l("blocklet.publish.deleteProject.tip2"),l("blocklet.publish.deleteProject.tip3")].map(T=>e.jsxs(c,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(js,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(L,{component:"span",variant:"inherit",color:"text.secondary",children:T})]}))})}),J]})}const Ys=Fn(c)`
|
|
3
|
-
${({theme:t})=>t.breakpoints.down("md")} {
|
|
4
|
-
.MuiTableRow-root {
|
|
5
|
-
border-color: ${({theme:t})=>t.palette.divider};
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
`;Ut.propTypes={initUrl:s.object};Ut.defaultProps={initUrl:null};var Vt={},Qs=Se;Object.defineProperty(Vt,"__esModule",{value:!0});var xn=Vt.default=void 0,Zs=Qs(Ie()),Do=e;xn=Vt.default=(0,Zs.default)([(0,Do.jsx)("path",{d:"M20 17H4V5h8V3H4c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h4v2h8v-2h4c1.1 0 2-.9 2-2v-3h-2z"},"0"),(0,Do.jsx)("path",{d:"m17 14 5-5-1.41-1.41L18 10.17V3h-2v7.17l-2.59-2.58L12 9z"},"1")],"InstallDesktop");const Ks=(t,o)=>{if(!t)return"";try{return o?JSON.parse(t)[o]:JSON.parse(t)}catch{}return t},gn=Ks;function er(){var R;const{t,locale:o}=Q(),{projectId:n}=ct(),{api:l}=je(),[i,d]=x.useState(!0),{blocklet:r}=De(),u=Be(g=>g.breakpoints.down("md")),[a,f]=x.useState(null),[m,j]=x.useState(null),[y,h]=x.useState(null),p=(R=window.env)==null?void 0:R.serverEndpoint,v=`releases-${r.meta.did}-${n}`,w=Ko(v),[b,k]=x.useState({searchText:w.searchText||"",pageSize:w.rowsPerPage||10,page:1}),C=()=>{l.getReleases({input:{did:r.meta.did,projectId:n}}).then(g=>{const S=(g==null?void 0:g.releases)||[];d(!1),f(S)}).catch(g=>{d(!1),M.error(g.message)})},I=()=>{l.doBatchQuery({getProject:{input:{did:r.meta.did,projectId:n}},getReleases:{input:{did:r.meta.did,projectId:n}}}).then(g=>{j(g.getProject.project||{}),f(g.getReleases.releases||[]),d(!1)}).catch(g=>{d(!1),M.error(g.message)})};x.useEffect(()=>{I()},[]);const[$,D]=x.useState(""),N=()=>{d(!1);const g=y.id;l.deleteRelease({input:{did:r.meta.did,projectId:n,releaseId:g}}).then(()=>{d(!1),C(),M.success(t("common.removeSuccess")),h(null)}).catch(S=>{d(!1),M.error(S.message)})},z=g=>{h(g)};if(!a&&i)return e.jsx(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Xe,{})});if(!a)return null;const E=e.jsxs(Oo,{className:"breadcrumbs","aria-label":"breadcrumb",children:[e.jsx(ye,{to:"..",children:t("common.blockletStudio")}),e.jsx(L,{color:"text.primary",children:e.jsx(Ce,{maxLength:u?6:30,children:m.blockletTitle})})]});if(!a.length)return e.jsxs(e.Fragment,{children:[E,e.jsxs(c,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[e.jsx(c,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:t("blocklet.publish.releaseEmptyTip")}),e.jsx(c,{sx:{fontSize:14,color:"text.secondary",mb:3},children:t("blocklet.publish.createReleaseTip")}),e.jsx(ye,{to:"create/none",children:e.jsx(qe,{variant:"contained",children:t("blocklet.publish.createRelease")})})]})]});const Z=[{label:t("common.version"),name:"blockletVersion",minWidth:160,options:{customBodyRenderLite:g=>{const S=a[g];return e.jsx(ye,{to:`view/${S.id}`,children:e.jsx(Mt,{did:r.meta.did,projectId:m.id,logo:S.blockletLogo,title:S.blockletVersion,describe:S.blockletTitle})})}}},{label:t("blocklet.publish.releaseNote"),name:"note",options:{customBodyRenderLite:g=>{const S=a[g];return e.jsx(L,{className:"note",children:gn(S.note,"note")})}}},{label:t("common.status"),name:"status",options:{customBodyRender:g=>e.jsx(en,{type:g==="published"?"success":"warning",children:g==="published"?"Released":ks(g)})}},{label:t("common.lastPublishedAt"),name:"updatedAt",options:{customBodyRenderLite:g=>{const S=a[g];return S.status!==fe.PROJECT.RELEASE_STATUS.published?"":e.jsx(tn,{value:Number(S.updatedAt),locale:o})}}},{label:t("common.actions"),name:"actions",options:{customBodyRenderLite:g=>{var P;const S=a[g];let W="",B="";const J=S.status==="published";if(J){const H=ue(p,`/api/project/${r.meta.did}/${m.id}/${m.lastReleaseId}/release/blocklet.json`),V=new URL(p);V.pathname=ue(V.pathname,"/launch-blocklet/agreement"),V.searchParams.set("blocklet_meta_url",H),W=V.href,B=ue(`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${r.meta.did}/${m.id}/${m.lastReleaseId}/download/${(m.lastReleaseFiles||[])[0]}`)}const T=(P=m.blockletComponents)!=null&&P.some(H=>H.included)||S.uploadedResource?"pack":"resource";return e.jsxs(c,{display:"flex",alignItems:"center",children:[J&&T==="pack"&&e.jsx(ke,{title:t("blocklet.publish.install",{name:m.blockletTitle}),placement:"top",children:e.jsx(ae,{color:"secondary","aria-label":"create",children:e.jsx("a",{style:{display:"flex"},href:W,target:"_blank",rel:"noreferrer",children:e.jsx(xn,{sx:{fontSize:18}})})})}),J&&e.jsx(ke,{title:t("blocklet.publish.download",{name:m.blockletTitle}),placement:"top",children:e.jsx(ae,{color:"primary","aria-label":"download",children:e.jsx("a",{style:{display:"flex"},href:B,children:e.jsx(ys,{sx:{fontSize:18}})})})}),e.jsx(ke,{title:t("blocklet.publish.delete",{name:m.blockletTitle}),placement:"top",children:e.jsx(ae,{color:"primary","aria-label":"delete",onClick:()=>z(S),children:e.jsx(on,{sx:{fontSize:18}})})})]})}}}],U=({page:g,rowsPerPage:S,searchText:W})=>{b.pageSize!==S?k(B=>({...B,searchText:"",pageSize:S,page:1})):b.page!==g+1?k(B=>({...B,searchText:"",page:g+1})):b.searchText!==W&&k(B=>({...B,searchText:W,page:1}))};return e.jsxs(tr,{children:[e.jsx(Lt,{sx:{mb:2},left:E,actions:e.jsxs(e.Fragment,{children:[e.jsx(qe,{variant:"outlined",onClick:()=>{const g=ue(p,`/api/project/${r.meta.did}/${n}/blocklet.json`);D(g)},children:t("blocklet.publish.copyInstallUrl")}),e.jsx(ye,{to:"new-release/none",children:e.jsxs(qe,{variant:"contained",children:[e.jsx(pt,{style:{fontSize:"1.3em",marginRight:4}}),t("blocklet.publish.createRelease")]})})]})}),e.jsx(at,{fullWidth:!0,maxWidth:"sm",open:$,onClose:()=>D(""),children:e.jsxs(c,{sx:{py:5,px:4,wordBreak:"break-all"},children:[e.jsx(L,{variant:"h6",sx:{mb:2},children:t("blocklet.publish.installResourceTip")}),e.jsx(ln,{children:$}),e.jsxs(L,{sx:{mt:2},children:[t("blocklet.publish.installResourceTip2"),e.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:t("blocklet.publish.installResourceHelp")})]})]})}),e.jsx(qt,{className:"main-table",verticalKeyWidth:100,locale:o,data:a,columns:Z,durable:v,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1},onChange:U}),y&&e.jsx(ht,{title:t(`${t("common.delete")} ${y.blockletVersion}`),description:t("blocklet.publish.deleteReleaseTip"),confirm:t("common.confirm"),onConfirm:N,onCancel:()=>h(null)})]})}const tr=ve(c)`
|
|
9
|
-
.main-table > div:first-child {
|
|
10
|
-
display: none;
|
|
11
|
-
}
|
|
12
|
-
.note {
|
|
13
|
-
word-break: break-all;
|
|
14
|
-
white-space: pre-line;
|
|
15
|
-
}
|
|
16
|
-
${({theme:t})=>t.breakpoints.down("md")} {
|
|
17
|
-
.MuiTableRow-root {
|
|
18
|
-
border-color: ${({theme:t})=>t.palette.divider};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`;var Ft={},or=Se;Object.defineProperty(Ft,"__esModule",{value:!0});var jn=Ft.default=void 0,nr=or(Ie()),sr=e;jn=Ft.default=(0,nr.default)((0,sr.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"DoDisturbAlt");function Me({children:t,Icon:o}){return e.jsxs(Hn,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingTop:"10px",margin:"10px 0px"},children:[e.jsx(c,{sx:{opacity:.3,fontSize:32},children:e.jsx(o,{})}),e.jsx(c,{sx:{mb:2,opacity:.7,fontSize:"small",color:"action"},children:t})]})}Me.propTypes={children:s.node.isRequired,Icon:s.elementType};Me.defaultProps={Icon:jn};function Ht({value:t,app:o,onChange:n,onChangeBlockletResourceType:l,disabled:i,resourceRelateComponents:d,projectType:r,dependentComponentsMode:u,blockletResourceType:a}){const{t:f,locale:m}=Q(),j=u==="readonly",y=x.useMemo(()=>{const C=t.reduce((I,$)=>(I[$.did]=$.included,I),{});return(o.children||[]).filter(I=>j?d[I.meta.did]||C[I.meta.did]:!0)},[o.children,t,d,j]),h=x.useMemo(()=>y.map(C=>t.find($=>$.did===C.meta.did)||{did:C.meta.did}),[y,t]),p=h.reduce((C,I)=>(C[I.did]=Nt(I,["required","included"]),C),{}),v=C=>{const I=h.map($=>{if($.did===C){const D=!$.included;return{...$,included:D,required:D}}return $});n(I)},w=C=>{const I=h.map($=>$.did===C?{...$,required:!$.required}:$);n(I)},b=C=>{l(C.target.checked?"resource":"")},k=[{label:f("common.name"),name:"meta.title",width:200,options:{customBodyRenderLite:C=>{var D;const I=y[C],$=(D=p[I.meta.did])==null?void 0:D.included;return e.jsxs(c,{display:"flex",alignItems:"center",children:[e.jsx(Et,{size:24,blocklet:I,ancestors:[o]}),e.jsx(c,{ml:"4px",className:At("text",{excluded:!$}),children:e.jsx(c,{children:I.meta.title})})]})}}},{label:f("blocklet.publish.componentIncluded"),width:100,options:{customBodyRenderLite:C=>{var N;const I=y[C],$=d[I.meta.did],D=!!((N=p[I.meta.did])!=null&&N.included);return e.jsx(Ke,{size:"small",checked:$||D,onClick:()=>v(I.meta.did),disabled:j||$||i})}}},{label:f("blocklet.publish.componentForceRequired"),width:100,options:{customBodyRenderLite:C=>{var z,E;const I=y[C],$=d[I.meta.did],D=!!((z=p[I.meta.did])!=null&&z.included),N=!!((E=p[I.meta.did])!=null&&E.required);return e.jsx(Ke,{size:"small",checked:$||N&&D,onClick:()=>w(I.meta.did),disabled:j||$||i||!D})}}}];return e.jsx(rr,{children:y!=null&&y.length?e.jsxs(e.Fragment,{children:[e.jsxs(dt,{severity:"info",style:{width:"100%"},children:[e.jsx(c,{display:"flex",alignItems:"center",rel:"noreferrer",ml:"13px",children:f(r==="pack"?"blocklet.publish.packTip":"blocklet.publish.resourceTip")}),e.jsxs(c,{component:"label",style:{cursor:"pointer"},children:[e.jsx(Ke,{size:"small",style:{marginLeft:"0px"},disabled:i,checked:a==="resource",onChange:b}),f("blocklet.publish.forceResourceBlocklet")]})]}),e.jsx(qt,{className:"main-table",verticalKeyWidth:100,locale:m,data:y,columns:k,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1,rowsPerPage:50}})]}):e.jsx(Me,{Icon:zt,children:f("blocklet.publish.blockletEmptyTip")})})}Ht.propTypes={app:s.object.isRequired,value:s.arrayOf(s.shape({did:s.string.isRequired,required:s.bool,included:s.bool})),onChange:s.func,onChangeBlockletResourceType:s.func,disabled:s.bool,dependentComponentsMode:s.string,resourceRelateComponents:s.object,blockletResourceType:s.string,projectType:s.string.isRequired};Ht.defaultProps={value:[],onChange:()=>{},onChangeBlockletResourceType:()=>{},disabled:!1,dependentComponentsMode:"auto",blockletResourceType:"",resourceRelateComponents:{}};const rr=ve(c)`
|
|
22
|
-
.main-table {
|
|
23
|
-
.text.excluded {
|
|
24
|
-
color: #999;
|
|
25
|
-
}
|
|
26
|
-
width: 400px;
|
|
27
|
-
${({theme:t})=>t.breakpoints.down("md")} {
|
|
28
|
-
width: 100%;
|
|
29
|
-
}
|
|
30
|
-
> div:first-child {
|
|
31
|
-
display: none;
|
|
32
|
-
}
|
|
33
|
-
.MuiTableCell-head {
|
|
34
|
-
padding-top: 0;
|
|
35
|
-
padding-bottom: 0;
|
|
36
|
-
}
|
|
37
|
-
.MuiTableCell-body {
|
|
38
|
-
padding-top: 6px;
|
|
39
|
-
padding-bottom: 6px;
|
|
40
|
-
}
|
|
41
|
-
.datatable-footer {
|
|
42
|
-
display: none;
|
|
43
|
-
}
|
|
44
|
-
${({theme:t})=>t.breakpoints.down("md")} {
|
|
45
|
-
.MuiTableRow-root {
|
|
46
|
-
border-color: ${({theme:t})=>t.palette.divider};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
`;var lr=(t,o=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof o!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof o}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(o===0)return t;const l=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(l,n.indent.repeat(o))};const Io=ls,To=/\s+at.*(?:\(|\s)(.*)\)?/,ir=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,cr=typeof Io.homedir>"u"?"":Io.homedir();var ar=(t,o)=>(o=Object.assign({pretty:!1},o),t.replace(/\\/g,"/").split(`
|
|
51
|
-
`).filter(n=>{const l=n.match(To);if(l===null||!l[1])return!0;const i=l[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!ir.test(i)}).filter(n=>n.trim()!=="").map(n=>o.pretty?n.replace(To,(l,i)=>l.replace(i,i.replace(cr,"~"))):n).join(`
|
|
52
|
-
`));const dr=lr,ur=ar,pr=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let hr=class extends Error{constructor(o){if(!Array.isArray(o))throw new TypeError(`Expected input to be an Array, got ${typeof o}`);o=[...o].map(l=>l instanceof Error?l:l!==null&&typeof l=="object"?Object.assign(new Error(l.message),l):new Error(l));let n=o.map(l=>typeof l.stack=="string"?pr(ur(l.stack)):String(l)).join(`
|
|
53
|
-
`);n=`
|
|
54
|
-
`+dr(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:o})}*[Symbol.iterator](){for(const o of this._errors)yield o}};var fr=hr;const br=fr;var mr=async(t,o,{concurrency:n=1/0,stopOnError:l=!0}={})=>new Promise((i,d)=>{if(typeof o!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const r=[],u=[],a=t[Symbol.iterator]();let f=!1,m=!1,j=0,y=0;const h=()=>{if(f)return;const p=a.next(),v=y;if(y++,p.done){m=!0,j===0&&(!l&&u.length!==0?d(new br(u)):i(r));return}j++,(async()=>{try{const w=await p.value;r[v]=await o(w,v),j--,h()}catch(w){l?(f=!0,d(w)):(u.push(w),j--,h())}})()};for(let p=0;p<n&&(h(),!m);p++);});const xr=mr;var gr=(t,o)=>xr(t,n=>n(),o);const st=Mn(gr);function jr(t,o){const n=new Set(o||[]),l=[];function i(d){n.has(d==null?void 0:d.id)&&l.push(d==null?void 0:d.id),d!=null&&d.children&&d.children.forEach(i)}return(t||[]).forEach(i),l}function Gt({src:t,alt:o,...n}){const[l,i]=x.useState(!1),d=x.useRef(null);return x.useEffect(()=>{if(!("IntersectionObserver"in window))return i(!0),()=>{};const r=new IntersectionObserver(u=>{u.forEach(a=>{a.isIntersecting&&(i(!0),r.disconnect())})},{threshold:.1});return d.current&&r.observe(d.current),()=>{r.disconnect()}},[]),e.jsx("img",{ref:d,src:l?t:void 0,alt:o,...n})}Gt.propTypes={src:s.string.isRequired,alt:s.string};Gt.defaultProps={alt:""};function Jt({data:t,lazy:o,...n}){return!t||!t.length?null:e.jsx(kr,{...n,children:t.map(l=>e.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",children:o?e.jsx(Gt,{src:l.url,alt:l.alt||""}):e.jsx("img",{src:l.url,alt:l.alt||""})},l.url))})}Jt.propTypes={data:s.arrayOf(s.shape({url:s.string,alt:s.string})),lazy:s.bool};Jt.defaultProps={data:[],lazy:!1};const kr=ve(c)`
|
|
55
|
-
display: flex;
|
|
56
|
-
justify-content: flex-start;
|
|
57
|
-
flex-wrap: wrap;
|
|
58
|
-
margin-bottom: -12px;
|
|
59
|
-
a {
|
|
60
|
-
display: flex;
|
|
61
|
-
}
|
|
62
|
-
img {
|
|
63
|
-
height: 128px;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
margin-right: 12px;
|
|
66
|
-
margin-bottom: 12px;
|
|
67
|
-
}
|
|
68
|
-
`,vt=(t,o)=>{const n=[...t];for(;n.length>0;){const l=n.shift();if(l.id===o)return l;l.children&&n.push(...l.children)}return[]};function Xt({icon:t}){return t?ps(t)?e.jsx("img",{className:"resource-icon",src:t,alt:"icon"}):e.jsx(de,{className:"resource-icon",icon:t}):null}Xt.propTypes={icon:s.string};Xt.defaultProps={icon:""};function Yt({disabled:t,data:o,onChange:n,value:l}){const i=l;function d(h,p=[]){return p.push(h.id),h.children&&h.children.forEach(v=>d(v,p)),p}const r=h=>d(vt(o,h)),u=(h,p=[])=>{const v=vt(o,h);return v.parent?(p.push(v.parent),u(v.parent,p)):p};function a(h,p){const v=r(h.id),w=v.indexOf(h.id);return v.splice(w,1),v.every(b=>i.concat(p).includes(b))}const f=(h,p)=>{h.stopPropagation();const v=r(p),w=u(p);if(i.includes(p)){const b=i.filter(k=>!v.concat(w).includes(k));n(b)}else{const b=v;for(let k=0;k<w.length;++k)a(vt(o,w[k]),b)&&b.push(w[k]);n([...i].concat(b))}},m=h=>{h.stopPropagation()},j=o.some(h=>{var p;return((p=h.children)==null?void 0:p.length)>0}),y=h=>{var k;const p=i.indexOf(h.id)!==-1,v=Array.isArray(h.children),w=r(h.id),b=v&&!p&&i.some(C=>w.includes(C));return e.jsx(Cs,{nodeId:h.id,label:e.jsx(et,{onClick:m,control:e.jsx(Ke,{size:"small",checked:p,indeterminate:b,tabIndex:-1,disableRipple:!0,onClick:C=>f(C,h.id),disabled:h.disabled||t}),label:e.jsxs(c,{className:"content",children:[e.jsxs(c,{display:"flex",alignItems:"center",children:[h.icon&&e.jsx(Xt,{icon:h.icon}),e.jsx(c,{className:"name",children:h.name}),h.url&&e.jsx("a",{href:h.url,target:"_blank",rel:"noreferrer",className:"link",children:e.jsx(xs,{className:"link-icon"})})]}),!!h.description&&e.jsx(c,{className:"description",children:h.description}),!!((k=h.images)!=null&&k.length)&&e.jsx(Jt,{className:"images",data:h.images,lazy:!0})]})}),children:v?h.children.map(y):null},h.id)};return e.jsx(yr,{className:At(!j&&"no-children"),multiSelect:!0,defaultCollapseIcon:e.jsx(ms,{}),defaultExpandIcon:e.jsx(ws,{}),selected:i,children:o.map(h=>y(h))})}Yt.propTypes={data:s.array,value:s.array,onChange:s.func,disabled:s.bool};Yt.defaultProps={data:[],value:[],onChange:()=>{},disabled:!1};const yr=ve(Ss)`
|
|
69
|
-
&.no-children {
|
|
70
|
-
.MuiTreeItem-content {
|
|
71
|
-
padding: 0;
|
|
72
|
-
.MuiTreeItem-iconContainer {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
.MuiTreeItem-label {
|
|
76
|
-
padding-left: 0;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
.MuiTreeItem-content {
|
|
81
|
-
align-items: flex-start;
|
|
82
|
-
.MuiTreeItem-iconContainer {
|
|
83
|
-
transform: translateY(10px);
|
|
84
|
-
}
|
|
85
|
-
&.Mui-selected {
|
|
86
|
-
background-color: transparent;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
.MuiTreeItem-label {
|
|
90
|
-
cursor: default;
|
|
91
|
-
}
|
|
92
|
-
.MuiFormControlLabel-root {
|
|
93
|
-
align-items: flex-start;
|
|
94
|
-
}
|
|
95
|
-
.content {
|
|
96
|
-
padding-top: 6px;
|
|
97
|
-
}
|
|
98
|
-
.name {
|
|
99
|
-
font-size: 16px;
|
|
100
|
-
font-weight: 700;
|
|
101
|
-
}
|
|
102
|
-
.resource-icon {
|
|
103
|
-
margin-right: 2px;
|
|
104
|
-
font-size: 16px;
|
|
105
|
-
}
|
|
106
|
-
img.resource-icon {
|
|
107
|
-
width: 1rem;
|
|
108
|
-
height: 1rem;
|
|
109
|
-
}
|
|
110
|
-
.link {
|
|
111
|
-
margin-left: 8px;
|
|
112
|
-
font-size: 16px;
|
|
113
|
-
color: ${({theme:t})=>t.palette.primary.main};
|
|
114
|
-
display: flex;
|
|
115
|
-
}
|
|
116
|
-
.link-icon {
|
|
117
|
-
font-size: inherit;
|
|
118
|
-
}
|
|
119
|
-
.description {
|
|
120
|
-
font-size: 14px;
|
|
121
|
-
color: ${({theme:t})=>t.palette.text.secondary};
|
|
122
|
-
}
|
|
123
|
-
`,$o={},vr=(t,o,{key:n,cacheTime:l=1e3*3}={})=>{const i=n+JSON.stringify({params:o}),d=$o[i];if(d&&d.timestamp>Date.now()-l)return d.promise;const r=t(...o);return $o[i]={promise:r,timestamp:Date.now()},r},kn=vr,yn=(t,o)=>(t.forEach(n=>{o&&(n.parent=o),(n.children||[]).forEach(l=>{l.parent=n.id,yn(l.children||[],l.id)})}),t),vn=(t,o,n,l,i)=>{const{exportApi:d="/"}=(t==null?void 0:t.meta.resource)||{},r=new URL(ue("http://127.0.0.1",t==null?void 0:t.mountPoint,d||"/").replace(/\/+/g,"/"));return r.searchParams.set("projectId",o),r.searchParams.set("releaseId",n),r.searchParams.set("local",l),i&&r.searchParams.set("resourcesParams",i.searchParams.get("resourcesParams")),`${r.pathname}${r.search}`},Rr=async({api:t,appDid:o,component:n,projectId:l,releaseId:i,locale:d,initUrl:r,resources:u})=>{let a;if(r&&r.searchParams.get("resourcesParams"))try{a=JSON.parse(r.searchParams.get("resourcesParams"))}catch(f){M.error(f.message);return}await rn.post(vn(n,l,i,d,r),{resources:u,projectId:l,releaseId:i,locale:d,...a?{resourcesParams:a}:{}},{headers:{"x-csrf-token":hs()},timeout:10*60*1e3}),await t.updateSelectedResources({input:{did:o,projectId:l,releaseId:i,componentDid:n.meta.did,resources:u}})},wr=(t,o)=>{if(!t)return{};const n=o.reduce((i,d)=>(i[d]=!0,i),{}),l=(i,d)=>(i.forEach(r=>{var u;n[r.id]&&((u=r.dependentComponents)!=null&&u.length)&&r.dependentComponents.forEach(a=>{d[a]=!0}),r.children&&l(r.children,d)}),d);return l(t,{})};function Qt({app:t,component:o,projectId:n,release:l,loading:i,error:d,saveSelectedEventsRef:r,readOnly:u,componentDid:a,initialResources:f={},setResourceComponentsMap:m,selectedResourceIds:j,setSelectedResourceIds:y,showTree:h,initUrl:p}){var U;const{t:v,locale:w}=Q(),{api:b}=je(),[k,C]=Pe({}),I=x.useRef({}),$=x.useRef(!1),D=l.id;I.current.projectId=n,I.current.releaseId=D;const N=(R,g,S)=>{if(!g)return;const W=wr(g,S);m==null||m({[R]:Object.keys(W)})},z=R=>{r.current[o.meta.did]={resources:R,component:o},y({[o.meta.did]:R}),N(o.meta.did,k[o.meta.did],R)},E=x.useCallback(async R=>{var g;try{const S=await kn(rn.get,[vn(R,n,D,w,p),{timeout:6e4}],{key:"getResources"});return yn(((g=S==null?void 0:S.data)==null?void 0:g.resources)||[])}catch{return[]}},[n,D,w,p]);x.useEffect(()=>{k[o==null?void 0:o.meta.did]||E(o).then(R=>{C({[o==null?void 0:o.meta.did]:R})}).catch(R=>{M.error(R.message)})},[o,C,k,E]),x.useEffect(()=>{D&&n&&!$.current&&st(t.children.map(R=>async()=>{var g,S;if(!(a&&a!==R.meta.did)&&!(!(R!=null&&R.mountPoint)||!is.hasStartEngine(R==null?void 0:R.meta)||!((S=(g=R==null?void 0:R.meta)==null?void 0:g.resource)!=null&&S.exportApi)))try{const W=await E(R);C({[R==null?void 0:R.meta.did]:W});const B=await b.getSelectedResources({input:{did:t.meta.did,projectId:n,releaseId:D,componentDid:R.meta.did}}),J=(B==null?void 0:B.resources)||[];J!=null&&J.length&&(y({[R.meta.did]:jr(W,J)}),N(R.meta.did,W,J),u||(r.current[R==null?void 0:R.meta.did]={resources:J,component:R}))}catch(W){M.error(W.message)}}),{concurrency:2}).then(()=>{$.current=!0})},[D,n,u,w,p,C]),x.useEffect(()=>{f&&Object.keys(f).length&&st(t.children.map(async R=>{const g=f[R.meta.did];if(g!=null&&g.length){const S=await E(R);y({[R.meta.did]:g}),N(R.meta.did,S,g),u||(r.current[R==null?void 0:R.meta.did]={resources:g,component:R})}}))},[t,f,u]);let Z=null;return(!o||!((U=k[o.meta.did])!=null&&U.length))&&(Z=e.jsx(Me,{Icon:zt,children:v("blocklet.publish.resourceEmptyTip",{name:yo.getDisplayName(o)})})),(o==null?void 0:o.status)!=="running"&&(Z=e.jsx(Me,{children:v("blocklet.publish.componentNotRunning",{name:yo.getDisplayName(o)})})),e.jsxs(e.Fragment,{children:[e.jsx(Cr,{className:At(d&&"error"),children:h&&e.jsx(c,{pb:2,width:"100%",children:Z||e.jsx(Yt,{data:k[o.meta.did]||[],value:j[o.meta.did]||[],onChange:z,disabled:i||u})})}),!!d&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:d})]})}Qt.propTypes={component:s.object.isRequired,app:s.object.isRequired,projectId:s.string.isRequired,error:s.string,saveSelectedEventsRef:s.object.isRequired,readOnly:s.bool.isRequired,loading:s.bool.isRequired,release:s.shape({id:s.string.isRequired,status:s.string}),initialResources:s.object,initUrl:s.object,setResourceComponentsMap:s.func,componentDid:s.string,selectedResourceIds:s.array.isRequired,setSelectedResourceIds:s.func.isRequired,showTree:s.bool.isRequired};Qt.defaultProps={error:"",release:{id:""},initUrl:null,initialResources:{},setResourceComponentsMap:()=>{},componentDid:""};const Cr=ve(c)`
|
|
124
|
-
border: 1px solid;
|
|
125
|
-
border-color: ${({theme:t})=>t.palette.divider};
|
|
126
|
-
max-height: 600px;
|
|
127
|
-
width: 100%;
|
|
128
|
-
&.error {
|
|
129
|
-
border-color: ${({theme:t})=>t.palette.error.main};
|
|
130
|
-
}
|
|
131
|
-
border-radius: 4px;
|
|
132
|
-
padding: 16px;
|
|
133
|
-
padding-bottom: 0px;
|
|
134
|
-
overflow-y: auto;
|
|
135
|
-
.footer {
|
|
136
|
-
border-top: 1px solid #ddd;
|
|
137
|
-
display: flex;
|
|
138
|
-
padding: 12px 0;
|
|
139
|
-
margin-top: 12px;
|
|
140
|
-
position: sticky;
|
|
141
|
-
bottom: 0;
|
|
142
|
-
background: #fff;
|
|
143
|
-
z-index: 10;
|
|
144
|
-
}
|
|
145
|
-
`;var Zt={},Sr=Se;Object.defineProperty(Zt,"__esModule",{value:!0});var St=Zt.default=void 0,Dr=Sr(Ie()),Ir=e;St=Zt.default=(0,Dr.default)((0,Ir.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");const Po="lastWantToConnectStoreId";function Tr(t){var u,a;const[o,n]=x.useState(null),{session:l}=Ue(),i=x.useCallback(f=>{n(f),localStorage.setItem(Po,f==null?void 0:f.id)},[n]),d=x.useMemo(()=>{var y,h,p,v;const f=localStorage.getItem(Po),m=f?(((y=t==null?void 0:t.settings)==null?void 0:y.storeList)||[]).find(w=>w.id===f):null;if(m)return m;let j=(((h=t==null?void 0:t.settings)==null?void 0:h.storeList)||[]).find(w=>{var b;return!(w.id!==Y.BLOCKLET_STORE.id||w.scope&&w.scope!=="studio"&&w.scope!==((b=l==null?void 0:l.user)==null?void 0:b.did))});return j||(j=(v=(p=t==null?void 0:t.settings)==null?void 0:p.storeList)==null?void 0:v[0]),j},[(u=t==null?void 0:t.settings)==null?void 0:u.storeList,(a=l==null?void 0:l.user)==null?void 0:a.did]);return[o||d||{},i]}const Rt={};async function Kt(t,{interval:o=1e3,maxDuration:n=120*1e3,intervalFirst:l=4e3,timerKey:i=""}){Rt[i]&&clearTimeout(Rt[i]),await new Promise(u=>setTimeout(u,l));const d=Date.now(),r=async(u,a)=>{try{const f=await t();u(f)}catch(f){Date.now()-d>n?a(f):i?Rt[i]=setTimeout(()=>r(u,a),o):setTimeout(()=>r(u,a),o)}};return new Promise(r)}function $r(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Pr(t,{did:o,projectId:n,messageId:l}){return Kt(async()=>{var d;const i=await t.getProject({input:{did:o,projectId:n,messageId:l}});if(!((d=i==null?void 0:i.project)!=null&&d.blockletDid))throw new Error("Connected store not found");return i.project.blockletDid},{timerKey:"connect-studio"})}function _r(t,{did:o,projectId:n,storeId:l}){return Kt(async()=>{var r,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(r=i==null?void 0:i.project)==null?void 0:r.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!i.project.connectedStores.find(a=>a.storeId===l))throw new Error("Connected store not found")},{timerKey:`connect-store-${l}`})}function qr(t,{did:o,projectId:n,endpointId:l}){return Kt(async()=>{var r,u;const i=await t.getProject({input:{did:o,projectId:n,messageId:""}});if(!((u=(r=i==null?void 0:i.project)==null?void 0:r.connectedEndpoints)!=null&&u.length))throw new Error("Connected endpoint not found");if(!i.project.connectedEndpoints.find(a=>a.endpointId===l))throw new Error("Connected endpoint not found")},{timerKey:`connect-store-${l}`})}const Er=({fromBlocklet:t,nodeInfo:o,blocklet:n,userDid:l})=>{var r,u;const i=t?(r=n==null?void 0:n.meta)==null?void 0:r.did:o==null?void 0:o.did;let d=t?((u=n==null?void 0:n.settings)==null?void 0:u.storeList)||[]:(o==null?void 0:o.blockletRegistryList)||[];return Array.isArray(d)||(d=[]),d=d.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===l),{teamDid:i,storeList:d}},eo=Er;function to({blocklet:t,store:o={},onChangeStore:n,onClick:l,disabled:i,loading:d,componentDid:r}){var R,g,S;const{t:u}=Q(),{session:a}=Ue(),{api:f,info:m,inService:j}=je(),y=De(),[h,p]=x.useState(!1),v=x.useRef(null),[w,b]=x.useState(!1),[k,C]=x.useState(null),I=W=>{n(W),p(!1)},$=()=>{p(!h)},D=W=>{v.current&&v.current.contains(W.target)||p(!1)},N=()=>{b(!0)},z=()=>{b(!1)},E=async()=>{var W;if(k)try{await f.deleteBlockletStore({input:{teamDid:t.meta.did,url:k.url,projectId:"",scope:k.scope||"studio"}}),await((W=y==null?void 0:y.actions)==null?void 0:W.refreshBlocklet())}catch(B){M.error(`Remove Blocklet Store Error: ${ge(B)}`)}finally{C(null)}},{storeList:Z}=eo({fromBlocklet:j,blocklet:t,nodeInfo:m,componentDid:r,userDid:(R=a==null?void 0:a.user)==null?void 0:R.did}),U=(g=t==null?void 0:t.meta)==null?void 0:g.did;return e.jsxs(e.Fragment,{children:[e.jsxs(tt,{disabled:i,ref:v,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(K,{onClick:l,children:[d&&e.jsx(we,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${o.name||""}`]}),e.jsx(K,{size:"small","aria-controls":h?"split-button-menu":void 0,"aria-expanded":h?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:$,children:e.jsx(As,{})})]}),e.jsx(Wo,{sx:{zIndex:10},open:h,anchorEl:v.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:W})=>e.jsx(Bo,{...W,style:{transformOrigin:"center top"},children:e.jsx(Pt,{children:e.jsx(Mo,{onClickAway:D,children:e.jsxs(Uo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[Z==null?void 0:Z.map(B=>{var J;return e.jsxs(be,{selected:B.id===(o==null?void 0:o.id),sx:{height:56},onClick:()=>I(B),children:[e.jsxs(c,{children:[e.jsx(Ce,{sx:{fontSize:"16px"},maxLength:24,children:B.name}),e.jsx(Ce,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:B.url})]}),Ds({store:B,userDid:(J=a==null?void 0:a.user)==null?void 0:J.did})&&e.jsx(ae,{sx:{ml:1},onClick:T=>{T.preventDefault(),T.stopPropagation(),C(B)},children:e.jsx(de,{icon:"ic:outline-delete"})})]},B.url)}),e.jsx(Gn,{}),e.jsxs(be,{onClick:N,children:[e.jsx(pt,{font:!0}),e.jsx(L,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),w&&e.jsx(cn,{hiddenChildren:!0,open:!0,onClose:z,teamDid:U,storeList:Z,scope:"studio",onAdd:(S=y==null?void 0:y.actions)==null?void 0:S.refreshBlocklet}),k&&e.jsx(ht,{displayError:!0,title:`${u("common.delete")} ${k.name}`,description:u("blocklet.publish.deleteStoreTip",{name:k.name}),confirm:u("common.confirm"),onConfirm:E,onCancel:()=>C(null)})]})}to.propTypes={store:s.object,blocklet:s.object,onChangeStore:s.func.isRequired,onClick:s.func.isRequired,loading:s.bool.isRequired,disabled:s.bool.isRequired,componentDid:s.string.isRequired,projectType:s.string.isRequired,getData:s.func.isRequired};to.defaultProps={store:null,blocklet:null};const Lr=(t,o,n)=>{const l=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/logo/upload`,i=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${n}/screenshot/upload`,d=t!=null&&t.blockletLogo?`${l}/${t.blockletLogo}`:`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,r=((t==null?void 0:t.blockletScreenshots)||[]).filter(Boolean).map(u=>`${i}/${u}`);return{logoUrl:d,screenshotUrls:r,uploadLogoPrefix:l,uploadScreenshotPrefix:i}},Rn=Lr,Nr=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),n=t.includes("vimeo.com");return o||n};function ft({url:t,style:o,controls:n,modestbranding:l}){var u;const{t:i}=Q(),d=t.includes("youtube.com")||t.includes("youtu.be"),r=t.includes("vimeo.com");if(d){const a=((u=t.split("v=")[1])==null?void 0:u.split("&")[0])||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:(o==null?void 0:o.pointerEvents)||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${a}?modestbranding=${l}&controls=${n}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(r){const a=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${a}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(c,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(c,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(de,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(L,{variant:"body1",sx:{opacity:.5},children:i("studio.videoDialogNoSrc")})]})})}ft.propTypes={url:s.string.isRequired,style:s.object,controls:s.number,modestbranding:s.number};ft.defaultProps={style:{},controls:1,modestbranding:1};function wn({setParams:t,onClose:o,params:n}){const{t:l}=Q(),[i,d]=x.useState(""),r=i&&n.blockletVideos.includes(i),u=Nr(i),a=()=>{t(f=>{const m=[...f.blockletVideos];return m.push(i),{...f,blockletVideos:m}}),o()};return e.jsxs(at,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Vo,{children:l("studio.videoDialogTitle")}),e.jsxs(Fo,{children:[e.jsx(Jn,{fullWidth:!0,value:i,onChange:f=>d(f.target.value),placeholder:l("studio.videoInputLabel"),endAdornment:i?e.jsx(Je,{position:"end",children:e.jsx(ae,{onClick:()=>d(""),children:e.jsx(fs,{})})}):null,error:r}),r&&e.jsx(L,{variant:"body2",color:"error",children:l("studio.duplicateVideo")}),e.jsx(ft,{url:i,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(Ho,{children:[e.jsx(K,{onClick:()=>o(),children:l("studio.cancel")}),e.jsx(K,{disabled:!u||r,onClick:a,children:l("studio.confirm")})]})]})}wn.propTypes={onClose:s.func.isRequired,params:s.object.isRequired,setParams:s.func.isRequired};function Dt({errors:t,storeList:o,...n}){const{t:l}=Q();return e.jsxs(c,{...n,color:"warning.main",fontSize:"14px",sx:{border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},children:[e.jsx(L,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:l("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([i,d])=>{const r=Object.values(d),u=o.find(a=>a.url===i);return r.length>0&&e.jsxs(c,{children:[e.jsx(ke,{title:i,children:e.jsx(c,{component:"span",sx:{cursor:"pointer"},children:u.name})}),r.map(a=>e.jsx(c,{component:"li",ml:2,breakWords:!0,children:a},a))]},i)})]})}Dt.propTypes={errors:s.object.isRequired,storeList:s.array.isRequired};const _o=x.lazy(()=>sn(()=>import("./index-B_-kynzD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function Cn({projectId:t,readOnly:o,loading:n,blocklet:l,params:i,setParams:d,paramsErrTip:r,setParamsErrTip:u,warning:a,setLoading:f,initUrl:m,initLogoUrl:j,setInitLogoUrl:y,componentDid:h}){const{t:p,locale:v}=Q(),{api:w}=je(),b=Tt(),k=x.useRef(null),C=x.useRef(null),[I,$]=Tr(l),[D,N]=x.useState(!1),z=an({messageType:"connect-store-message",onOpen:()=>f(!0),onClose:()=>f(!1)}),E=async q=>{const F=setTimeout(()=>{f(!1)},2e4),X=await Pr(w,q);f(!1),clearTimeout(F),window.parent.postMessage({event:"studioDialog.connected",componentDid:h},"*"),b(window.location.pathname.replace(`${Y.UNOWNED_DID}/create`,`${X}/create`),{replace:!0})},Z=()=>{if(!i.blockletTitle){M.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(I!=null&&I.url)){M.error(p("blocklet.publish.noStoreSelected"));return}const q=$r();z(async(F,X)=>{var te,oe,ce;try{const ee=await w.connectByStudio({input:{did:(te=l==null?void 0:l.meta)==null?void 0:te.did,blockletTitle:i==null?void 0:i.blockletTitle,storeUrl:I.url,storeId:I.id,storeName:I.name,type:((oe=i==null?void 0:i.blockletComponents)==null?void 0:oe.length)>0?"pack":"resource",componentDid:h,messageId:q,tenantScope:(m==null?void 0:m.searchParams.get("tenantScope"))||""}});if(!(ee!=null&&ee.url)){M.error("failed to connect to store");return}X(ee.url),E({did:(ce=l==null?void 0:l.meta)==null?void 0:ce.did,projectId:"",messageId:q})}catch(ee){const pe=ge(ee);M.error(pe),f(!1)}})},{logoUrl:U,screenshotUrls:R,uploadLogoPrefix:g,uploadScreenshotPrefix:S}=Rn(i,l,t),{logoErrors:W,screenshotErrors:B,storeList:J,hasLogoWarning:T,hasScreenshotWarning:P}=a,H=()=>o?!1:!t||t===Y.UNOWNED_DID?(M.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,V=q=>{if(!q.destination)return;const F=Array.from(i.blockletScreenshots),[X]=F.splice(q.source.index,1);F.splice(q.destination.index,0,X),d(te=>({...te,blockletScreenshots:F}))},le=q=>{if(!q.destination)return;const F=Array.from(i.blockletVideos),[X]=F.splice(q.source.index,1);F.splice(q.destination.index,0,X),d(te=>({...te,blockletVideos:F}))};return e.jsxs(Ar,{children:[e.jsx(c,{display:"flex",className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:i.blockletTitle||"",onChange:q=>{u({blockletTitle:""}),d({blockletTitle:q.target.value})},error:!!r.blockletTitle,helperText:r.blockletTitle||""}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:t===Y.UNOWNED_DID&&e.jsx(Je,{position:"end",children:e.jsx(to,{blocklet:l,store:I,componentDid:h,onChangeStore:$,disabled:!i.blockletTitle||o||n,loading:n,onClick:Z})})},error:!!r.projectId,helperText:r.projectId||"",value:t===Y.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:o},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletDescription||"",onChange:q=>{u({blockletDescription:""}),d({blockletDescription:q.target.value})},error:!!r.blockletDescription,helperText:r.blockletDescription||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.homepageTip")}`,placeholder:`Blocklet ${p("common.homepageTip")}`,InputProps:{"data-cy":"blocklet-homepage",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?u({blockletHomepage:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletHomepage:""}),d({blockletHomepage:q.target.value})},error:!!r.blockletHomepage,helperText:r.blockletHomepage||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.community")}`,placeholder:`Blocklet ${p("common.community")}`,InputProps:{"data-cy":"blocklet-community",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?u({blockletCommunity:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletCommunity:""}),d({blockletCommunity:q.target.value})},error:!!r.blockletCommunity,helperText:r.blockletCommunity||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.support")}`,placeholder:`Blocklet ${p("common.support")}`,InputProps:{"data-cy":"blocklet-support",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?u({blockletSupport:p("blocklet.publish.errorTip.invalidUrlOrEmail")}):u({blockletSupport:""}),d({blockletSupport:q.target.value})},error:!!r.blockletSupport,helperText:r.blockletSupport||"",sx:{mt:3}}),e.jsx(ne,{disabled:n||o,label:`Blocklet ${p("common.repository")}`,placeholder:`Blocklet ${p("common.repository")}`,InputProps:{"data-cy":"blocklet-repository",readOnly:o},autoComplete:"off",variant:"outlined",fullWidth:!0,value:i.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?u({blockletRepository:p("blocklet.publish.errorTip.invalidUrl")}):u({blockletRepository:""}),d({blockletRepository:q.target.value})},error:!!r.blockletRepository,helperText:r.blockletRepository||"",sx:{mt:3}})]})}),e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{flex:1,overflow:"hidden",children:[e.jsxs(c,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),e.jsxs(Re,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.type"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(c,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx($t,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:j||U,onClick:()=>{var q;H()&&((q=k.current)==null||q.open())}})})]}),T&&e.jsx(Dt,{errors:W,storeList:J,mt:3}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),e.jsxs(Re,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.ratio"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.size"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:p("studio.orderTip")})]})})]})]}),e.jsx(Ro,{onDragEnd:o?void 0:V,children:e.jsx(wo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,F)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:F.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:F.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:q.innerRef,...q.droppableProps,children:[R.map((X,te)=>e.jsx(Co,{draggableId:X,index:te,isDragDisabled:o,children:(oe,ce)=>e.jsxs(c,{ref:oe.innerRef,...oe.draggableProps,className:"screenshot",sx:{transform:ce.isDragging?"scale(1.05)":"none",boxShadow:ce.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:X}),!o&&e.jsx(ae,{...oe.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(St,{})}),!o&&e.jsx(ae,{className:"action",onClick:()=>{d(ee=>{const pe=[...ee.blockletScreenshots];return pe.splice(te,1),{...ee,blockletScreenshots:pe}})},children:e.jsx(nt,{})})]})},X)),q.placeholder,R.length<5&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var X;H()&&((X=C.current)==null||X.open())},children:"+"})]})})})]}),P&&e.jsx(Dt,{errors:B,storeList:J}),e.jsxs(c,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(L,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("studio.video")}),e.jsxs(Re,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.videoType"),":"," "]}),e.jsxs(c,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.count"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(c,{children:e.jsxs(c,{component:"span",children:[e.jsxs(c,{component:"span",sx:{color:"text.secondary"},children:[p("studio.order"),":"," "]}),e.jsx(c,{component:"span",sx:{color:"secondary.main"},children:p("studio.orderTip")})]})})]})]}),e.jsx(Ro,{onDragEnd:o?void 0:le,children:e.jsx(wo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,F)=>e.jsxs(c,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:F.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:F.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:q.innerRef,...q.droppableProps,children:[i.blockletVideos.map((X,te)=>e.jsx(Co,{draggableId:X,index:te,isDragDisabled:o,children:(oe,ce)=>e.jsxs(c,{ref:oe.innerRef,...oe.draggableProps,className:"screenshot",sx:{transform:ce.isDragging?"scale(1.05)":"none",boxShadow:ce.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(ft,{url:X,style:{pointerEvents:ce.isDragging?"none":"auto"}}),!o&&e.jsx(ae,{...oe.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(St,{})}),!o&&e.jsx(ae,{className:"action",onClick:()=>{d(ee=>{const pe=[...ee.blockletVideos];return pe.splice(te,1),{...ee,blockletVideos:pe}})},children:e.jsx(nt,{})})]})},X)),q.placeholder,i.blockletVideos.length<3&&e.jsx(c,{sx:{width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{H()&&N(!0)},children:"+"})]})})})]})]})}),e.jsxs(x.Suspense,{fallback:e.jsx(Xe,{}),children:[e.jsx(_o,{ref:k,locale:v,popup:!0,onUploadFinish:q=>{var F;d({blockletLogo:q.data.filename}),y(""),(F=k.current)==null||F.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:g,disableMediaKitPrefix:!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"),D&&e.jsx(wn,{onClose:()=>N(!1),params:i,setParams:d}),e.jsx(_o,{ref:C,locale:v,popup:!0,onUploadFinish:q=>{var F;d(X=>{var oe;const te=X.blockletScreenshots||[];return te.push((oe=q.data)==null?void 0:oe.filename),{...X,blockletScreenshots:te}}),(F=C.current)==null||F.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-R.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}Cn.propTypes={projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,warning:s.object.isRequired,loading:s.bool.isRequired,blocklet:s.object.isRequired,setLoading:s.func.isRequired,initUrl:s.object.isRequired,componentDid:s.isRequired,initLogoUrl:s.string.isRequired,setInitLogoUrl:s.func.isRequired};const Ar=ve.div`
|
|
146
|
-
margin-top: 24px;
|
|
147
|
-
.screenshot {
|
|
148
|
-
margin-bottom: 16px;
|
|
149
|
-
max-width: 240px;
|
|
150
|
-
max-height: 135px;
|
|
151
|
-
width: 240px;
|
|
152
|
-
height: 135px;
|
|
153
|
-
overflow: hidden;
|
|
154
|
-
display: flex;
|
|
155
|
-
align-items: center;
|
|
156
|
-
justify-content: center;
|
|
157
|
-
background-color: #eee;
|
|
158
|
-
margin-right: 16px;
|
|
159
|
-
position: relative;
|
|
160
|
-
.action {
|
|
161
|
-
visibility: hidden;
|
|
162
|
-
position: absolute;
|
|
163
|
-
width: 42px;
|
|
164
|
-
height: 42px;
|
|
165
|
-
right: 6px;
|
|
166
|
-
top: 6px;
|
|
167
|
-
border-radius: 4px;
|
|
168
|
-
background-color: rgba(0, 0, 0, 1);
|
|
169
|
-
color: rgba(255, 255, 255, 1);
|
|
170
|
-
}
|
|
171
|
-
&:hover .action {
|
|
172
|
-
visibility: visible;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
.screenshot img {
|
|
176
|
-
width: 100%; /* 图像宽度填充容器 */
|
|
177
|
-
height: auto; /* 图像高度自适应 */
|
|
178
|
-
}
|
|
179
|
-
`;var oo={},zr=Se;Object.defineProperty(oo,"__esModule",{value:!0});var Sn=oo.default=void 0,Or=zr(Ie()),Wr=e;Sn=oo.default=(0,Or.default)((0,Wr.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l4.65-4.65c.2-.2.51-.2.71 0L17 13z"}),"CloudUploadRounded");const Br=(t,o,n,l)=>{const i=t?[...t]:[],d=((o==null?void 0:o.children)||[]).reduce((r,u)=>(r[u.meta.did]=!0,r),{});return Object.keys(n).forEach(r=>{if(!d[r])return;let u=!1;l||i.forEach(a=>{a.did===r&&(a.included=!0,a.required=!0,u=!0)}),u||i.push({did:r,included:!0,required:!0})}),i},Mr=async t=>{if(typeof t!="string")throw new Error("URL must be a string");try{const o=t.split("/").pop().split("?")[0],l=await(await fetch(t)).blob();return new File([l],o,{type:l.type})}catch{throw new Error("Failed to convert Logo URL to file")}};function*Ur(t,o){let n=0;for(;n<t.size;)yield t.slice(n,n+o),n+=o}const Vr=async({did:t,projectId:o,uploadType:n="logo",imageUrl:l})=>{const i=await Mr(l);new FormData().append("file",i);const r={uploaderId:"Uploader",relativePath:encodeURIComponent(i.name),name:encodeURIComponent(i.name),type:i.type},a=(await vo.post(ue(Y.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/project",t,o,n,"upload"),null,{headers:{"Tus-Resumable":"1.0.0","Upload-Length":i.size,"X-Uploader-File-Ext":i.name.split(".").pop(),"Upload-Metadata":Object.keys(r).map(y=>`${y} ${btoa(r[y])}`).join(",")}})).headers.location,f=2*1024*1024;let m=0,j="";for(const y of Ur(i,f)){const h=await vo.patch(ue(Y.WELLKNOWN_SERVICE_PATH_PREFIX,a),y,{headers:{"Tus-Resumable":"1.0.0","Upload-Offset":m,"Content-Type":"application/offset+octet-stream"}});m+=y.size,j=h.data.filename}return j},Dn=({params:t,projectId:o,status:n,t:l})=>{const i=[];return t.blockletTitle||i.push({param:"blockletTitle",message:l("blocklet.publish.errorTip.noTitle")}),(!o||o===Y.UNOWNED_DID)&&i.push({param:"projectId",message:l("blocklet.publish.errorTip.noDid")}),t.blockletVersion?We.valid(t.blockletVersion)||i.push({param:"blockletVersion",message:l("blocklet.publish.errorTip.inValidVersion")}):i.push({param:"blockletVersion",message:l("blocklet.publish.errorTip.noVersion")}),n===fe.PROJECT.RELEASE_STATUS.published&&(t.blockletDescription||i.push({param:"blockletDescription",message:l("blocklet.publish.errorTip.noDescription")}),t.note||i.push({param:"note",message:l("blocklet.publish.errorTip.noNote")})),i.length?i:null},Fr=({params:t,step:o,t:n,projectId:l})=>{if(o===0){if(!t.blockletTitle)return n("blocklet.publish.errorTip.noTitle");if(!l||l===Y.UNOWNED_DID)return n("blocklet.publish.errorTip.noDid");if(!t.blockletDescription)return n("blocklet.publish.errorTip.noDescription")}if(o>=4){if(!t.blockletVersion)return n("blocklet.publish.errorTip.noVersion");if(!We.valid(t.blockletVersion))return n("blocklet.publish.errorTip.inValidVersion");if(!t.note)return n("blocklet.publish.errorTip.noNote")}return""};function no({blocklet:t,releaseId:o,connectedStores:n,projectId:l,releaseType:i,publishedStoreIds:d,onPublish:r,onDelete:u,warning:a,projectType:f,componentDid:m,onOpenConnectStore:j,behavior:y,onSelectConnectStore:h}){var $,D;const{t:p}=Q(),{actions:{refreshBlocklet:v}}=De(),{session:w}=Ue(),{storeList:b}=eo({fromBlocklet:!0,blocklet:t,componentDid:m,userDid:($=w==null?void 0:w.user)==null?void 0:$.did}),k=x.useMemo(()=>n!=null&&n.length?n==null?void 0:n.reduce((N,z)=>(N[z.storeId]=z,N),{}):{},[n]),C=(D=t==null?void 0:t.meta)==null?void 0:D.did,I={};return Object.entries((a==null?void 0:a.logoErrors)||{}).forEach(([N,z])=>{const E=Object.values(z);E.length>0&&(I[N]=E)}),Object.entries((a==null?void 0:a.screenshotErrors)||{}).forEach(([N,z])=>{const E=Object.values(z);E.length>0&&(I[N]=I[N]?[...I[N],...E]:E)}),e.jsxs(e.Fragment,{children:[y==="connect"&&!!(b!=null&&b.length)&&e.jsx(dt,{severity:"info",style:{width:"100%"},children:e.jsxs(c,{color:Go[400],component:"a",href:f==="pack"?"https://www.arcblock.io/docs/blocklet-developer/en/5PXToZve-5IXAN1bc8rkpxAc":"https://www.arcblock.io/docs/blocklet-developer/en/hB5VWLfg9VnbWsL1JGLuLUfW",target:"_blank",display:"flex",alignItems:"center",rel:"noreferrer",children:[p(f==="pack"?"blocklet.publish.whyCantSeeInStore":"blocklet.publish.whyCantSeeResourceBlockletInStore"),e.jsx(un,{sx:{marginLeft:1}})]})}),e.jsx(Jo,{children:b==null?void 0:b.map(N=>e.jsx(_t,{"data-cy":"store-switch",children:e.jsx(Xo,{children:e.jsx(Is,{behavior:y,onSelectConnectStore:h,releaseId:o,projectId:l,releaseType:i,kind:"publish",teamDid:C,warningList:I[N.url],store:N,published:(d==null?void 0:d.indexOf(N.id))>-1,connectedStore:k[N.id],onPublish:r,onDelete:u,scope:N.scope||"studio",onOpenConnectStore:j})})},N.url))}),e.jsx(cn,{teamDid:C,storeList:b,scope:"studio",onAdd:v})]})}no.propTypes={blocklet:s.object.isRequired,projectId:s.string.isRequired,releaseId:s.string.isRequired,releaseType:s.string.isRequired,onPublish:s.func,onDelete:s.func,publishedStoreIds:s.arrayOf(s.string),connectedStores:s.arrayOf(s.object).isRequired,projectType:s.string,componentDid:s.string,warning:s.object,onOpenConnectStore:s.func,onSelectConnectStore:s.func,behavior:s.string};no.defaultProps={projectType:"",componentDid:"",publishedStoreIds:[],onPublish:()=>{},onDelete:()=>{},warning:{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{},behavior:"connect"};const Hr=Yo(t=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:t.palette.primary.main,lineHeight:"3.2"}}));function so({disabled:t,endpointList:o,teamDid:n,onAdd:l,hiddenChildren:i,open:d,onClose:r}){const{api:u}=je(),[a,f]=x.useState(!1),[m,j]=x.useState(!0),[y,h]=x.useState(!1),[p,v]=x.useState(""),[w,b]=x.useState(""),{t:k}=Q(),C=Hr(),I=()=>{v(""),h(!1),r()},$=async()=>{f(!0);try{const{decoded:D}=cs(p,o);await u.addUploadEndpoint({input:{teamDid:n,url:D}}),l(D),I()}catch(D){const N=`${k("blocklet.publish.endpoint.addFailed")} ${ge(D)}`;b(N)}finally{f(!1)}};return e.jsxs(e.Fragment,{children:[!i&&e.jsxs(_t,{button:!0,disabled:t,className:C.addMenuItemRoot,onClick:()=>{h(!0)},children:[e.jsx(pt,{font:!0}),e.jsx(L,{variant:"inherit",children:k("blocklet.publish.endpoint.addEndpoint")})]}),e.jsxs(ut,{title:k("blocklet.publish.endpoint.addEndpoint"),fullWidth:!0,maxWidth:"md",open:d||y,onClose:I,PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(qe,{onClick:D=>{D.stopPropagation(),I()},color:"inherit",children:k("common.cancel")}),e.jsxs(qe,{onClick:D=>{D.stopPropagation(),$()},color:"primary","data-cy":"install-blocklet-next-step",disabled:a||!p||m,variant:"contained",autoFocus:!0,children:[a&&e.jsx(we,{size:16}),k("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(Xn,{component:"div",children:e.jsx(L,{component:"div",children:e.jsx(ne,{label:k("blocklet.publish.endpoint.addEndpoint"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"add-blocklet-endpoint-url",fullWidth:!0,value:p,onChange:D=>{b(null);let N=!1;D.target.value.trim()||(N=!0),D.target.value.trim()||b(k("blocklet.publish.endpoint.urlEmpty")),v(D.target.value),j(N)},disabled:a,onKeyPress:D=>{D.key==="Enter"&&(D.preventDefault(),D.target.value.trim()?$():b(k("blocklet.publish.endpoint.urlEmpty")))}})})})}),!!w&&e.jsx(dt,{severity:"error",style:{width:"100%"},children:w})]})]})}so.propTypes={teamDid:s.string.isRequired,disabled:s.bool,endpointList:s.array,onAdd:s.func,hiddenChildren:s.bool,open:s.bool,onClose:s.func};so.defaultProps={disabled:!1,endpointList:[],onAdd:()=>{},hiddenChildren:!1,open:!1,onClose:()=>{}};function ro({endpoint:t,teamDid:o,onDelete:n,projectId:l="",children:i}){const{api:d}=je(),{t:r}=Q(),u=Qo(),a=De(),[f,m]=x.useState(!1),[j,y]=x.useState(null),h=()=>{m(!1),y(null)},p=async()=>{var b;try{m(!0),await d.deleteUploadEndpoint({input:{teamDid:o,did:t.id,projectId:l}}),await((b=a==null?void 0:a.actions)==null?void 0:b.refreshBlocklet()),n==null||n()}catch(k){M.error(`${r("blocklet.publish.endpoint.deleteFailed")}: ${ge(k)}`)}finally{m(!1),y(null)}},v={keyName:t.url,title:r("blocklet.publish.endpoint.deleteEndpoint"),description:r("blocklet.publish.endpoint.deleteDesc",{name:`<b>${t.url}</b>`,color:u.palette.error.main}),confirmPlaceholder:r("blocklet.publish.endpoint.confirmDesc",{name:t.url}),confirm:r("common.delConfirm"),cancel:r("common.cancel"),onConfirm:p,onCancel:h},w=b=>{t.protected||(b.stopPropagation(),y(v))};return e.jsxs(e.Fragment,{children:[i?e.jsx(c,{component:"span",onClick:w,children:i}):e.jsx(K,{"data-cy":"endpoint-action-delete",color:"primary",disabled:f,onClick:w,size:"small",children:e.jsx(nt,{sx:{zoom:.95}})}),j?e.jsx(zs,{keyName:j.keyName,title:j.title,description:j.description,confirmPlaceholder:j.confirmPlaceholder,confirm:j.confirm,cancel:j.cancel,params:j.params,onConfirm:j.onConfirm,onCancel:j.onCancel}):null]})}ro.propTypes={endpoint:s.object.isRequired,teamDid:s.string.isRequired,onDelete:s.func,projectId:s.string,children:s.node};ro.defaultProps={onDelete:"",projectId:"",children:null};function lo({connectedEndpoint:t,onDisconnect:o,onDelete:n,endpoint:l,teamDid:i,projectId:d}){const[r,u]=x.useState(null),a=!!r,{t:f}=Q(),[m,j]=x.useState(!1),y=b=>{b.stopPropagation(),window.open(hn(`${ue(l.url)}`,{allowDomains:null}))},h=b=>{u(b.currentTarget)},p=()=>{u(null)},v=()=>{j(!1),o()},w=[{label:f("blocklet.publish.endpoint.visitEndpoint"),action:y,icon:un},{label:f("common.disconnect"),action:()=>{p(),j(!0)},icon:Ts,hidden:!t}];return e.jsxs(e.Fragment,{children:[e.jsx(K,{ref:r,color:"primary",onClick:h,size:"small",children:e.jsx(bs,{sx:{zoom:.95}})}),e.jsxs(Yn,{anchorEl:r,open:a,onClose:p,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[w.map(b=>b.hidden?null:e.jsxs(be,{dense:!0,onClick:b.action,disabled:b.disabled,children:[b.icon&&e.jsx(b.icon,{color:"action",sx:{marginRight:1}}),e.jsx(c,{color:"action",children:b.label})]},b.label)),e.jsx(ro,{endpoint:l,teamDid:i,onDelete:n,projectId:d,children:e.jsxs(be,{dense:!0,disabled:l.protected,children:[e.jsx(nt,{sx:{color:l.protected?"action":"error.main",marginRight:1}}),e.jsx(c,{color:l.protected?"action":"error.main",children:f("common.delete")})]})})]}),m&&e.jsx(ht,{displayError:!0,title:`${f("common.disconnect")} ${l.appName}`,description:f("blocklet.publish.endpoint.disconnectEndpointTip",{url:l.url}),confirm:f("common.confirm"),onConfirm:v,onCancel:()=>j(!1)})]})}lo.propTypes={connectedEndpoint:s.object.isRequired,onDisconnect:s.func,onDelete:s.func,endpoint:s.object.isRequired,teamDid:s.string.isRequired,projectId:s.string};lo.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function rt({developerUrl:t,developerDid:o,sx:n,...l}){return e.jsx($t,{sx:{width:24,height:24,...n},src:ue(new URL(t).origin,`/.well-known/service/user/avatar/${o}?imageFilter=resize&w=120&h=120`),...l})}rt.propTypes={developerDid:s.string.isRequired,developerUrl:s.string.isRequired,sx:s.object};rt.defaultProps={sx:{}};function io({endpoint:t,published:o}){const{t:n}=Q(),l=()=>{window.open(hn(`${ue(t.url)}`,{allowDomains:null}))};return e.jsxs(c,{children:[e.jsx(L,{variant:"subtitle2",children:n(o?"blocklet.publish.endpoint.publishToEndpointSuccess":"blocklet.publish.endpoint.uploadToEndpointSuccess",{name:t.appName})}),e.jsx(K,{size:"small",sx:{mt:1},onClick:l,variant:"contained",color:"success",children:n("common.visitTarget",{name:t.appName})})]})}io.propTypes={endpoint:s.object.isRequired,published:s.bool.isRequired};io.defaultProps={};const Gr=Yo(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),qo=Qn(({className:t,...o})=>e.jsx(ke,{...o,classes:{popper:t}}))(({theme:t})=>({[`& .${Zn.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:t.spacing(2),fontSize:t.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function co({teamDid:t,projectId:o,releaseId:n,endpoint:l,warningList:i,onDelete:d,published:r,onPublish:u,connectedEndpoint:a,onOpenConnectEndpoint:f}){const m=Gr(),{t:j}=Q(),{api:y}=je(),[h,p]=x.useState(!1),v=an({messageType:"connect-endpoint-message",onOpen:()=>p(!0),onClose:()=>p(!1)}),w=!!a,b=()=>{v(async(D,N)=>{try{const z=await y.connectToEndpoint({input:{did:t,endpointId:l.id,projectId:o}});if(!(z!=null&&z.url)){M.error("failed to connect to endpoint");return}N(z.url),await f({did:t,projectId:o,endpointId:l.id}),p(!1)}catch(z){const E=ge(z);M.error(E),p(!1)}})},k=async()=>{try{await y.disconnectFromEndpoint({input:{did:t,endpointId:l.id,projectId:o}}),d()}catch(D){M.error(ge(D))}},C=()=>{p(!0),y.publishToEndpoint({input:{did:t,endpointId:l.id,projectId:o,releaseId:n}}).then(()=>{M.success(e.jsx(io,{endpoint:l,published:!0}),{duration:1e4}),u==null||u(null)}).catch(D=>{M.error(ge(D)),u==null||u(D)}).finally(()=>{p(!1)})};x.useEffect(()=>{w&&p(!1)},[w]);const I=i.length>0,$=e.jsxs(K,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130,height:"100%"},disabled:I,onClick:C,children:[h?e.jsx(we,{sx:{marginRight:1},size:16}):e.jsx($s,{sx:{marginRight:1,fontSize:20}}),j("common.upload")]});return e.jsxs(c,{className:m.box,children:[e.jsxs(c,{className:m.menuName,children:[e.jsx(c,{sx:{display:"flex",flexDirection:"row"},children:e.jsx(L,{component:"span",className:m.title,variant:"subtitle1",children:l.appName})}),e.jsx(L,{className:m.url,component:"span",variant:"inherit",children:`${l.url}`})]}),e.jsxs(c,{className:m.actions,children:[a&&e.jsx(qo,{placement:"top",title:e.jsxs(c,{children:[e.jsx(L,{component:"span",variant:"caption",sx:{opacity:.7},children:j("blocklet.publish.developerInfo")}),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[e.jsx(rt,{developerUrl:l.url,developerDid:a.developerDid,sx:{width:42,height:42}}),e.jsxs(c,{sx:{flex:1},children:[e.jsx(L,{component:"span",variant:"subtitle1",children:a.developerName}),e.jsx(Ct,{size:14,copyable:!0,compact:!0,responsive:!1,did:a.developerDid})]})]})]}),children:e.jsx(c,{children:e.jsx(rt,{developerUrl:l.url,developerDid:a.developerDid,sx:{marginRight:1,cursor:"help"}})})}),e.jsxs(tt,{disabled:h,variant:"outlined",sx:{height:38},size:"small",children:[!w&&e.jsxs(K,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:b,children:[h?e.jsx(we,{sx:{marginRight:1},size:16}):e.jsx(Ps,{sx:{marginRight:1}}),j("common.connect")]}),w&&r&&e.jsxs(K,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[h?e.jsx(we,{sx:{marginRight:1},size:16}):e.jsx(pn,{sx:{marginRight:1}}),j("common.uploaded")]}),w&&!r&&(I?e.jsx(qo,{title:e.jsxs(c,{children:[e.jsx(c,{sx:{color:"error.main",mb:.5},children:j("blocklet.publish.storeRule.warning")}),i.map((D,N)=>e.jsxs(c,{sx:{color:"error.main"},children:[N+1,". ",D]},D))]}),children:e.jsx("div",{children:$})}):$),e.jsx(lo,{projectId:o,endpoint:l,teamDid:t,connectedEndpoint:a,onDisconnect:k,onDelete:d})]})]})]})}co.propTypes={teamDid:s.string.isRequired,published:s.bool,connectedEndpoint:s.shape({endpointId:s.string,accessKeyId:s.string,accessKeySecret:s.string,createdBy:s.string,developerDid:s.string,developerName:s.string,developerEmail:s.string}),warningList:s.array,projectId:s.string,releaseId:s.string,endpoint:s.shape({id:s.string.isRequired,appName:s.string,url:s.string.isRequired,endpoint:s.string.isRequired,protected:s.bool,connected:s.bool}).isRequired,onDelete:s.func,onOpenConnectEndpoint:s.func,onPublish:s.func};co.defaultProps={published:!1,connectedEndpoint:null,projectId:"",warningList:[],releaseId:"",onDelete:()=>{},onOpenConnectEndpoint:()=>{},onPublish:()=>{}};function ao({releaseId:t,blocklet:o,connectedEndpoints:n,projectId:l,publishedEndpointIds:i,onPublish:d,onDelete:r,warning:u,onOpenConnectEndpoint:a}){var w,b;const{actions:{refreshBlocklet:f}}=De(),{session:m}=Ue(),{t:j}=Q(),y=(((w=o==null?void 0:o.settings)==null?void 0:w.endpointList)||[]).filter(k=>{var C;return k.scope===((C=m==null?void 0:m.user)==null?void 0:C.did)}),h=x.useMemo(()=>n!=null&&n.length?n==null?void 0:n.reduce((k,C)=>(k[C.endpointId]=C,k),{}):{},[n]),p=(b=o==null?void 0:o.meta)==null?void 0:b.did,v={};return Object.entries((u==null?void 0:u.logoErrors)||{}).forEach(([k,C])=>{const I=Object.values(C);I.length>0&&(v[k]=I)}),Object.entries((u==null?void 0:u.screenshotErrors)||{}).forEach(([k,C])=>{const I=Object.values(C);I.length>0&&(v[k]=v[k]?[...v[k],...I]:I)}),e.jsxs(e.Fragment,{children:[!!(y!=null&&y.length)&&e.jsx(dt,{severity:"info",style:{width:"100%"},children:e.jsx(c,{color:Go[400],children:j("blocklet.publish.endpoint.uploadToEndpoint")})}),e.jsx(Jo,{sx:{flex:1},children:y==null?void 0:y.map(k=>e.jsx(_t,{"data-cy":"endpoint-switch",children:e.jsx(Xo,{children:e.jsx(co,{releaseId:t,projectId:l,teamDid:p,warningList:v[k.url],endpoint:k,published:(i==null?void 0:i.indexOf(k.id))>-1,connectedEndpoint:h[k.id],onPublish:d,onDelete:r,onOpenConnectEndpoint:a})})},k.url))}),e.jsx(so,{teamDid:p,endpointList:y,onAdd:f})]})}ao.propTypes={releaseId:s.string.isRequired,blocklet:s.object.isRequired,projectId:s.string.isRequired,warning:s.object,onPublish:s.func,onOpenConnectEndpoint:s.func,onDelete:s.func,connectedEndpoints:s.arrayOf(s.object).isRequired,publishedEndpointIds:s.arrayOf(s.string)};ao.defaultProps={publishedEndpointIds:[],onPublish:()=>{},onDelete:()=>{},warning:{},onOpenConnectEndpoint:()=>{}};function In({did:t,params:o,setParams:n,projectId:l,open:i,onClose:d}){const{t:r}=Q(),[u,a]=x.useState(!1),{api:f}=je(),[m,j]=x.useState(!1),[y,h]=x.useState(!1),p=()=>{j(o.autoUpload),h(o.possibleSameStore),a(!1),d(!1)},v=async()=>{a(!0);try{await f.updateProject({input:{did:t,projectId:l,blockletTitle:o.blockletTitle||"",blockletDescription:o.blockletDescription||"",blockletIntroduction:o.blockletIntroduction||"",autoUpload:!!m,possibleSameStore:!!y}}),n({autoUpload:m,possibleSameStore:y}),d(!1)}catch(b){M.error(b.message)}a(!1)};x.useEffect(()=>{j(o.autoUpload),h(o.possibleSameStore)},[o]);const w=!!(l&&l!==Y.UNOWNED_DID);return e.jsx(ut,{title:r("blocklet.publish.projectSettings"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:i,onClose:p,actions:e.jsxs(e.Fragment,{children:[e.jsx(K,{onClick:b=>{b.stopPropagation(),d()},color:"inherit",children:r("common.cancel")}),w&&e.jsxs(K,{onClick:b=>{b.stopPropagation(),v()},color:"primary","data-cy":"install-blocklet-next-step",disabled:u,variant:"contained",autoFocus:!0,children:[u&&e.jsx(we,{size:16}),r("common.confirm")]})]}),children:w?e.jsxs(c,{component:"label",sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(c,{component:de,icon:"ph:upload",sx:{fontSize:24,mr:2}}),e.jsx(L,{variant:"body1",sx:{flex:1},children:r("blocklet.publish.autoUploadTip")}),e.jsx(_e,{checked:m,onChange:(b,k)=>j(k)})]}),e.jsxs(c,{component:"label",sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(c,{component:de,icon:"fluent-mdl2:merge-duplicate",sx:{fontSize:24,mr:2}}),e.jsx(L,{variant:"body1",sx:{flex:1},children:r("blocklet.publish.possibleSameStoreTip")}),e.jsx(_e,{checked:y,onChange:(b,k)=>h(k)})]})]}):e.jsxs(c,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx(c,{component:de,icon:"ph:empty",sx:{fontSize:40,mb:3,opacity:.6}}),e.jsx(L,{variant:"body1",sx:{flex:1},children:r("blocklet.publish.needProjectId")})]})})}In.propTypes={did:s.string.isRequired,params:s.object.isRequired,open:s.bool.isRequired,onClose:s.func.isRequired,setParams:s.func.isRequired,projectId:s.string.isRequired};function Tn({downloadUrl:t,installUrl:o,handleSetTip:n,isPack:l,disabled:i}){const{t:d}=Q(),[r,u]=x.useState(!1),a=x.useRef(null),f=()=>{u(!r)},m=j=>{a.current&&a.current.contains(j.target)||u(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(K,{disabled:i,ref:a,onClick:f,children:e.jsx(c,{component:de,sx:{fontSize:18},icon:"bxs:download"})}),e.jsx(Wo,{sx:{zIndex:10},open:r,anchorEl:a.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:j})=>e.jsx(Bo,{...j,style:{transformOrigin:"center top"},children:e.jsx(Pt,{children:e.jsx(Mo,{onClickAway:m,children:e.jsxs(Uo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[l&&e.jsx(c,{component:"a",href:o,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:e.jsxs(be,{sx:{color:"#333"},children:[e.jsx(c,{component:de,sx:{mr:1},icon:"ic:round-install-desktop"}),e.jsx(L,{variant:"inherit",children:d("blocklet.publish.installToThisServer")})]})}),e.jsxs(be,{onClick:n,children:[e.jsx(c,{component:de,sx:{mr:1},icon:"iconamoon:copy"}),e.jsx(L,{variant:"inherit",children:d("blocklet.publish.copyInstallUrl")})]}),e.jsx(c,{component:"a",href:t,target:"_blank",rel:"noreferrer",sx:{textDecoration:"none"},children:e.jsxs(be,{sx:{color:"#333"},children:[e.jsx(c,{component:de,sx:{mr:1},icon:"ph:download"}),e.jsx(L,{variant:"inherit",children:d("common.download")})]})})]})})})})})]})}Tn.propTypes={disabled:s.bool.isRequired,isPack:s.bool.isRequired,downloadUrl:s.string.isRequired,installUrl:s.string.isRequired,handleSetTip:s.func.isRequired};var zo;const Eo=(zo=window.env)==null?void 0:zo.serverEndpoint;function $n({projectId:t,params:o,setParamsErrTip:n,initUrl:l,setParams:i,mode:d,loading:r,blocklet:u,release:a,isPublished:f,releaseId:m,getData:j,getRelease:y,paramsErrTip:h,warning:p,componentDid:v,resourceRelateComponents:w,disabledSelectComponents:b,saveSelectedEventsRef:k,hasSelectedResources:C,initLogoUrl:I,setLoading:$,releaseUsedLast:D,setReleaseUsedLast:N,projectType:z}){var Ee;const{t:E,locale:Z}=Q(),U=[{label:e.jsx(c,{textAlign:"center",width:"100%",children:E("blocklet.publish.store")}),value:"store"},{label:e.jsx(c,{textAlign:"center",width:"100%",children:E("blocklet.publish.endpoint.tab")}),value:"endpoint"}],[R,g]=x.useState(U[0].value),{api:S}=je(),W=Tt(),[B,J]=x.useState(!1),[T,P]=x.useState(!1),[H,V]=x.useState(),le=Be(se=>se.breakpoints.down("md")),q=x.useMemo(()=>{var se;return o!=null&&o.blockletResourceType?o==null?void 0:o.blockletResourceType:((se=o==null?void 0:o.blockletComponents)==null?void 0:se.length)>0?(o==null?void 0:o.blockletComponents.find(O=>O.included))?"resource":"pack":"resource"},[o==null?void 0:o.blockletComponents,o==null?void 0:o.blockletResourceType]),F=()=>{window.parent.postMessage({event:"studioDialog.uploaded",componentDid:v},"*"),y()},X=async se=>{var Ae,Fe,ze,Qe;if(h!=null&&h.blockletHomepage||h!=null&&h.blockletSupport||h!=null&&h.blockletCommunity){M.error((h==null?void 0:h.blockletHomepage)||(h==null?void 0:h.blockletSupport)||(h==null?void 0:h.blockletCommunity));return}const Le=Dn({params:o,hasSelectedResources:C,projectId:t,status:se,t:E});if(Le){M.error(Le.map(G=>G.message).join("; ")),n(Le.reduce((G,re)=>({...G,[re.param]:re.message}),{}));return}const O={...o};if(O.blockletComponents=Br(O.blockletComponents,u,w,b),O.blockletVersion=We.valid(O.blockletVersion),!O.blockletVersion){M.error("Invalid Blocklet Version"),n({blockletVersion:"Invalid Blocklet Version"});return}if(I)try{const G=await Vr({did:u.meta.did,projectId:t,imageUrl:I});O.blockletLogo=G,i({blockletLogo:G})}catch(G){M.error(G.message);return}if(o.resourceFromSelect){O.uploadedResource="";try{const G=Object.keys(k.current);await st(G.map(re=>()=>{const He=k.current[re];return Rr({api:S,locale:Z,projectId:t,releaseId:D?"":m,appDid:u.meta.did,component:He.component,resources:He.resources,initUrl:l})}),{concurrency:2})}catch(G){M.error(((ze=(Fe=(Ae=G==null?void 0:G.response)==null?void 0:Ae.data)==null?void 0:Fe.error)==null?void 0:ze.message)||G.message),n({blockletResource:"Invalid save the resource"});return}}else(Qe=o.blockletDocker)!=null&&Qe.dockerImage||(O.blockletComponents=[]);O.blockletTitle=(O.blockletTitle||"").trim(),O.blockletDescription=(O.blockletDescription||"").trim(),O.blockletSupport=(O.blockletSupport||"").trim(),O.blockletHomepage=(O.blockletHomepage||"").trim(),O.blockletCommunity=(O.blockletCommunity||"").trim(),O.blockletRepository=(O.blockletRepository||"").trim(),O.blockletIntroduction=(O.blockletIntroduction||"").trim(),O.note=(O.note||"").trim(),O.blockletComponents=((O==null?void 0:O.blockletComponents)||[]).filter(G=>G.included).map(G=>Nt(G,["did","required"])).map(JSON.stringify),O.contentType!=="docker"&&(O.blockletDocker={dockerImage:"",dockerCommand:"",dockerArgs:[],dockerEnvs:[]}),O.blockletDocker.dockerImage=O.blockletDocker.dockerImage||"",O.blockletDocker.dockerArgs.length>0&&O.blockletDocker.dockerArgs.forEach(G=>{G.proxyBehavior=G.proxyBehavior||"service"});try{await S.createRelease({input:{...O,note:JSON.stringify({note:O.note}),did:u.meta.did,projectId:t,releaseId:D?"":m,status:se}}),se==="draft"?M.success(E("blocklet.publish.saveDraftSuccess")):(N(!1),M.success(E("blocklet.publish.createReleaseSuccess")),window.parent.postMessage({event:"studioDialog.released",componentDid:v},"*")),n({blockletResource:"",blockletTitle:"",blockletDescription:"",blockletVersion:"",blockletLogo:"",projectId:"",blockletIntroduction:"",note:""})}catch(G){const re=ge(G);M.error(re),(/resource/.test(re)||/zip/.test(re))&&n({blockletResource:re});return}const ie=await S.getProject({input:{did:u.meta.did,projectId:t}}),Ne=ie.project.lastReleaseId;o.autoUpload&&await st(ie.project.connectedStores.map(G=>async()=>{try{const re=await S.publishToStore({input:{did:u.meta.did,storeId:G.storeId,storeName:G.storeName,projectId:t,releaseId:Ne,type:q}});M.success(e.jsx(_s,{storeName:G.storeName,storeUrl:G.storeUrl,developerDid:G.developerDid,did:u.meta.did,published:re.url==="published"}),{duration:1e4})}catch(re){M.error(ge(re))}}),{concurrency:4}),F==null||F(),W(`../${t}/view/${Ne}`,{replace:!0})},te=se=>($(!0),X(se).finally(()=>{$(!1)})),oe=async se=>{await _r(S,se),j()},ce=async se=>{await qr(S,se),j()},ee=()=>{P(!0)},pe=ue(Eo,`/api/project/${u.meta.did}/${t}/${m}/release/blocklet.json`),he=new URL(Eo);he.pathname=ue(he.pathname,"/launch-blocklet/agreement"),he.searchParams.set("blocklet_meta_url",pe);const Ye=he.href,Ve=()=>V(pe);return e.jsxs(e.Fragment,{children:[e.jsx(Jr,{className:"sticky-header",children:e.jsx(Lt,{left:e.jsxs(Oo,{className:"breadcrumbs","aria-label":"breadcrumb",children:[e.jsx(ye,{to:"../",children:E("common.blockletStudio")}),t===Y.UNOWNED_DID?e.jsx(L,{color:"text.primary",children:e.jsx(Ce,{maxLength:le?6:30,children:(o==null?void 0:o.blockletTitle)||"Blocklet"})}):e.jsx(ye,{to:`../${t}`,children:e.jsx(Ce,{maxLength:le?6:30,children:(o==null?void 0:o.blockletTitle)||"Blocklet"})}),e.jsx(L,{color:"text.primary",children:d==="create"?E("common.create"):(o==null?void 0:o.blockletVersion)||E("common.edit")})]}),actions:e.jsxs(e.Fragment,{children:[!f&&e.jsxs(tt,{disabled:r,variant:"contained",children:[e.jsxs(K,{variant:"contained",onClick:()=>te(fe.PROJECT.RELEASE_STATUS.published),children:[r&&e.jsx(we,{size:14,sx:{mr:.5},color:"inherit"}),E("blocklet.publish.createRelease")]}),e.jsx(K,{variant:"contained",onClick:ee,children:e.jsx(de,{icon:"mage:settings-fill",fontSize:"16px"})})]}),f&&e.jsxs(e.Fragment,{children:[e.jsx(at,{fullWidth:!0,maxWidth:"sm",open:H,onClose:()=>V(""),children:e.jsxs(c,{sx:{py:5,px:4,wordBreak:"break-all"},children:[e.jsx(L,{variant:"h6",sx:{mb:2},children:E("blocklet.publish.installResourceTip")}),e.jsx(ln,{children:H}),e.jsxs(L,{sx:{mt:2},children:[E("blocklet.publish.installResourceTip2"),e.jsx("a",{style:{marginLeft:4},href:"https://www.arcblock.io/docs/blocklet-developer/how-to-use-install-url",target:"_blank",rel:"noreferrer",children:E("blocklet.publish.installResourceHelp")})]})]})}),e.jsxs(tt,{disabled:r,variant:"contained",children:[e.jsxs(K,{onClick:()=>J(!0),children:[r?e.jsx(we,{size:14,sx:{mr:1},color:"inherit"}):e.jsx(Sn,{sx:{fontSize:"1.3em",mr:1}}),E(le?"common.upload":"blocklet.publish.connectOrUpload")]}),e.jsx(Tn,{isPack:q==="pack",downloadUrl:ue(`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${u.meta.did}/${t}/${m}/download/${(a.files||[])[0]}`),installUrl:Ye,handleSetTip:Ve}),e.jsx(K,{onClick:ee,children:e.jsx(de,{icon:"mage:settings-fill",fontSize:"16px"})})]})]})]})})}),e.jsx(ut,{title:E("blocklet.publish.connectOrUpload"),disableEscapeKeyDown:!0,disablePortal:!1,fullWidth:!0,open:B,onClose:()=>J(!1),children:e.jsxs(c,{children:[e.jsx(c,{mt:-2,mb:2,children:e.jsx(nn,{tabs:U,current:R,onChange:g})}),R==="store"&&e.jsx(no,{projectType:z,blocklet:u,releaseType:q,projectId:t,releaseId:m,componentDid:v,warning:p,onPublish:F,onOpenConnectStore:oe,onDelete:j,connectedStores:o.connectedStores||[],publishedStoreIds:a==null?void 0:a.publishedStoreIds}),R==="endpoint"&&e.jsx(Re,{minHeight:400,children:e.jsx(ao,{blocklet:u,releaseType:q,projectId:t,releaseId:m,warning:p,publishedEndpointIds:[],connectedEndpoints:o.connectedEndpoints||[],onPublish:F,onOpenConnectEndpoint:ce,onDelete:j})})]})}),e.jsx(In,{did:(Ee=u==null?void 0:u.meta)==null?void 0:Ee.did,params:o,projectId:t,open:T,setParams:i,onClose:()=>P(!1)})]})}$n.propTypes={projectId:s.string.isRequired,params:s.object.isRequired,mode:s.string.isRequired,loading:s.bool.isRequired,blocklet:s.object.isRequired,release:s.object.isRequired,isPublished:s.bool.isRequired,releaseId:s.string.isRequired,getData:s.func.isRequired,getRelease:s.func.isRequired,componentDid:s.string.isRequired,resourceRelateComponents:s.object.isRequired,disabledSelectComponents:s.bool.isRequired,saveSelectedEventsRef:s.object.isRequired,hasSelectedResources:s.bool.isRequired,initLogoUrl:s.string.isRequired,setLoading:s.func.isRequired,releaseUsedLast:s.bool.isRequired,setReleaseUsedLast:s.func.isRequired,projectType:s.string.isRequired,setParamsErrTip:s.func.isRequired,warning:s.object.isRequired,setParams:s.func.isRequired,initUrl:s.object.isRequired,paramsErrTip:s.object.isRequired};const Jr=ve.div`
|
|
180
|
-
.sticky-header {
|
|
181
|
-
margin-top: -12px;
|
|
182
|
-
padding: 12px 0;
|
|
183
|
-
position: sticky;
|
|
184
|
-
top: 0;
|
|
185
|
-
z-index: 99;
|
|
186
|
-
display: flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
justify-content: space-between;
|
|
189
|
-
background-color: #fff;
|
|
190
|
-
padding-bottom: 12px;
|
|
191
|
-
border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
|
|
192
|
-
}
|
|
193
|
-
`;function Pn({text:t}){const{palette:o}=Qo();return t?e.jsx(Os,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:gs.sanitize(t),rehypePlugins:[[Ws,{target:"_blank"}]]}):e.jsx(Me,{Icon:zt})}Pn.propTypes={text:s.string.isRequired};function _n({params:t,setParams:o,paramsErrTip:n,loading:l,setParamsErrTip:i,readOnly:d}){var m;const{t:r}=Q(),[u,a]=x.useState(d?"preview":"write"),f=(j,y)=>{a(y)};return e.jsxs(c,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(c,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(L,{variant:"h6",fontWeight:"bold",sx:{},children:r("common.introduction")}),e.jsxs(Zo,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(c,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:e.jsx(ne,{disabled:l||d,sx:{border:"none"},placeholder:`Blocklet ${r("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:d,endAdornment:e.jsxs(Je,{position:"end",children:[((m=t==null?void 0:t.blockletIntroduction)==null?void 0:m.length)||0," / ",fe.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:j=>{i({blockletIntroduction:""}),o({blockletIntroduction:j.target.value.slice(0,fe.PROJECT.MAX_INTRO_LENGTH)})},error:!!n.blockletIntroduction,helperText:n.blockletIntroduction||""})}),e.jsx(c,{display:u==="preview"?"block":"none",mt:3,children:e.jsx(Pn,{text:t.blockletIntroduction||""})})]})}_n.propTypes={params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,readOnly:s.bool.isRequired,loading:s.bool.isRequired};var uo={},Xr=Se;Object.defineProperty(uo,"__esModule",{value:!0});var It=uo.default=void 0,Yr=Xr(Ie()),Lo=e;It=uo.default=(0,Yr.default)([(0,Lo.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,Lo.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function po({step:t,ok:o,active:n,error:l,warning:i}){let d="grey.500",r=t+1;return o&&(r=e.jsx(pn,{sx:{fontSize:18,margin:0},color:"white"})),l||!o&&n>t?(d="error.main",r=e.jsx(It,{sx:{fontSize:18,margin:0},color:"white"})):i?(d="warning.main",r=e.jsx(It,{sx:{fontSize:18,margin:0},color:"white"})):n>=t&&(d="primary.main"),e.jsx(c,{width:24,height:24,bgcolor:d,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:r})}po.propTypes={step:s.number,ok:s.bool,active:s.number,error:s.string,warning:s.bool};po.defaultProps={step:0,ok:!1,active:0,error:"",warning:!1};function qn({steps:t,activeStep:o,setActiveStep:n,hasSelectedResources:l,params:i,loading:d,paramsErrTip:r,warning:u,viewMode:a,projectId:f}){const{t:m}=Q(),j=()=>{n(v=>v+1)},y=()=>{n(v=>v-1)},h=v=>v===0?(r==null?void 0:r.blockletTitle)||(r==null?void 0:r.projectId)||(r==null?void 0:r.blockletDescription)||(r==null?void 0:r.blockletHomepage)||(r==null?void 0:r.blockletSupport)||(r==null?void 0:r.blockletCommunity)||(r==null?void 0:r.blockletRepository):v===2?(r==null?void 0:r.blockletResource)||(r==null?void 0:r.blockletDocker)||(r==null?void 0:r.dockerImageName):v>=4?(r==null?void 0:r.blockletVersion)||(r==null?void 0:r.note):"",p=a||Dn({hasSelectedResources:l,params:i,projectId:f,t:m})===null;return e.jsxs(c,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(Kn,{activeStep:o,orientation:"vertical",children:t.map((v,w)=>{const b={},k=d||!Fr({hasSelectedResources:l,params:i,projectId:f,step:w,t:m}),C=d?"":h(w);return C&&(b.optional=e.jsx(L,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:C}),b.error=!0),e.jsxs(es,{children:[e.jsx(ts,{icon:e.jsx(po,{error:C,warning:w===0?u.hasWarning:!1,active:p?99:o,step:w,ok:k}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>n(w),...b,children:e.jsx(L,{fontSize:"14px",fontWeight:"500",color:C||!k&&o>w?"error.main":"inherit",children:v.label})}),e.jsxs(os,{children:[e.jsx(L,{fontSize:12,children:v.description}),!p&&e.jsx(c,{sx:{mb:2},children:e.jsxs("div",{children:[w<t.length-1&&e.jsx(K,{variant:"contained",onClick:j,sx:{mt:1,mr:1},disabled:C||!k,children:m("common.continue")}),w>0&&e.jsx(K,{disabled:w===0,onClick:y,sx:{mt:1,mr:1},children:m("common.back")})]})})]})]},v.label)})}),o>=t.length-1&&e.jsx(Pt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(L,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}qn.propTypes={steps:s.array.isRequired,activeStep:s.number.isRequired,setActiveStep:s.func.isRequired,params:s.object.isRequired,viewMode:s.string.isRequired,loading:s.bool.isRequired,projectId:s.string.isRequired,hasSelectedResources:s.bool.isRequired,warning:s.object.isRequired,paramsErrTip:s.shape({projectId:s.string,blockletVersion:s.string,blockletTitle:s.string,blockletDescription:s.string,note:s.string,blockletResource:s.string,blockletHomepage:s.string,blockletSupport:s.string,blockletCommunity:s.string,blockletRepository:s.string,blockletDocker:s.object,dockerImageName:s.string}).isRequired};const Qr=[".zip",".gz"],Zr=1024*1024*100,Kr=x.lazy(()=>sn(()=>import("./index-B_-kynzD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ho({app:t,projectId:o,readOnly:n,params:l,setParams:i,setParamsErrTip:d,error:r}){const{t:u,locale:a}=Q(),f=x.useRef(null),m=()=>n?!1:!o||o===Y.UNOWNED_DID?(M.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,j=`${Y.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(c,{sx:{mt:3},children:[e.jsx(L,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:n?"default":"pointer"},children:[!!l.uploadedResource&&e.jsx(L,{component:"a",href:`${j}/params.uploadedResource`,children:l.uploadedResource}),!n&&e.jsx(K,{variant:"outlined",size:"small",onClick:()=>{var y;m()&&((y=f.current)==null||y.open())},children:l.uploadedResource?u("common.change"):u("common.upload")})]}),e.jsx(x.Suspense,{fallback:e.jsx(Xe,{}),children:e.jsx(Kr,{ref:f,locale:a,popup:!0,onUploadFinish:y=>{var h;i({uploadedResource:y.data.filename}),d({blockletResource:""}),(h=f.current)==null||h.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:j,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:Qr,maxFileSize:Zr,maxNumberOfFiles:1}}},"uploader-resource")}),!!r&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:r})]})}ho.propTypes={app:s.object.isRequired,projectId:s.string.isRequired,readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,error:s.string.isRequired,setParamsErrTip:s.func.isRequired};ho.defaultProps={};function lt({readOnly:t,params:o,setParams:n,paramsErrTip:l,setParamsErrTip:i,loading:d}){var u;const{t:r}=Q();return e.jsx(c,{display:"flex",mt:3,className:"section",children:e.jsxs(c,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:d||t,label:`Blocklet ${r("common.version")}`,placeholder:`Blocklet ${r("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:a=>{i({blockletVersion:""}),n({blockletVersion:a.target.value})},error:!!l.blockletVersion,helperText:l.blockletVersion||""}),e.jsx(ne,{label:r("blocklet.publish.releaseNote"),autoComplete:"off",disabled:d||t,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Je,{position:"end",children:[((u=o==null?void 0:o.note)==null?void 0:u.length)||0," / ",fe.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:a=>{i({note:""}),n({note:a.target.value.slice(0,fe.PROJECT.MAX_NOTE_LENGTH)})},error:!!l.note,helperText:l.note||"",sx:{mt:3}})]})})}lt.propTypes={readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,paramsErrTip:s.object.isRequired,setParamsErrTip:s.func.isRequired,loading:s.bool.isRequired};lt.defaultProps={};function En(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&En(t[o]);return t}function it({index:t,item:o,dockerParams:n,setDockerParams:l,dataKey:i,t:d,readOnly:r}){const u=(o==null?void 0:o.value)||"",[a,f]=x.useState(!1),m=()=>{var U;(U=n[i])==null||U.splice(t,1),l({...n,[i]:[...n[i]]})},j=(U,R)=>{var g;(g=n[i])!=null&&g[t]&&(R?(n[i][t].custom=n[i][t].value,n[i][t].value=`$${yt(o.key)}`):(n[i][t].value=n[i][t].custom||"",n[i][t].custom="")),l({...n,[i]:[...n[i]]})},y=(U,R)=>{var S;const g=((S=n[i][t])==null?void 0:S.value)||"";n[i][t]={...n[i][t],secure:R,value:R&&g===fe.BLOCKLET_AUTOMATIC_ENV_VALUE?"":g},l({...n,[i]:[...n[i]]})},h=(U,R)=>{n[i][t]={...n[i][t],shared:R},l({...n,[i]:[...n[i]]})},p=(U,R)=>{var S;const g=((S=n[i][t])==null?void 0:S.value)||"";n[i][t]={...n[i][t],required:R,value:R&&g===fe.BLOCKLET_AUTOMATIC_ENV_VALUE?"":g},l({...n,[i]:[...n[i]]})},v=(U,R)=>{n[i][t]={...n[i][t],value:R?fe.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},l({...n,[i]:[...n[i]]})},w=U=>{n[i][t]={...n[i][t],description:U.target.value},l({...n,[i]:[...n[i]]})},b=U=>{const R=U.target.value==="web"?"web":"docker";R==="web"&&n.dockerArgs.forEach(W=>{W.type="docker"});const S=`/${n.dockerImage.replace(/\W/g,"-")}-${t}`;n.dockerArgs[t]={...n.dockerArgs[t],type:R,path:R==="docker"?S:"/",protocol:"http",prefix:R==="docker"?S:"/",name:"publicUrl",port:"BLOCKLET_PORT"},l({...n,dockerArgs:[...n.dockerArgs]})},k=U=>{n.dockerArgs[t]={...n.dockerArgs[t],proxyBehavior:U.target.value==="direct"?"direct":"service"},l({...n,dockerArgs:[...n.dockerArgs]})},C=U=>{const R=U.target.value;n[i][t]={...n[i][t],prefix:R,path:R==="*"?"/":R},l({...n,[i]:[...n[i]]})},I=U=>{var R;(R=n[i])!=null&&R[t]&&(n[i][t].value=U.target.value),l({...n,[i]:[...n[i]]})},$=u===`$${yt(o.key)}`||o.custom,D=i==="dockerArgs"&&!dn[o.key],N=qs[o.key],z=i==="dockerEnvs",E=o.key==="--publish";let Z=o.key;return E&&o.type==="web"?Z="--publish (Web)":z&&(Z=`--env ${o.key}`),e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{width:250},children:e.jsx(L,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:Z})}),e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(ne,{disabled:r||$||D||o.value===fe.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:$?`$${yt(o.key)}`:u,sx:{flex:1},InputProps:{endAdornment:e.jsxs(Je,{position:"end",sx:{zoom:.9},children:[(!(N||D)||z||E)&&e.jsx(ae,{onClick:()=>f(!0),children:e.jsx(de,{icon:"icon-park-outline:setting-config"})}),!r&&e.jsx(ae,{onClick:m,color:D?"error":"default",children:e.jsx(de,{icon:"ic:round-delete"})})]})},error:D,onChange:I}),D&&e.jsx(L,{variant:"caption",color:"error",children:d("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(L,{variant:"caption",color:"text.secondary",children:d("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&Es[o.key](u)&&e.jsx(L,{variant:"caption",color:"error",children:d("blocklet.publish.docker.volumeTips")})]}),a&&e.jsx(ut,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:d(z?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>f(!1),children:e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[N||D||z?null:e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:d("blocklet.publish.docker.needCustomInput")}),e.jsx(_e,{disabled:r,checked:$,onChange:j,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:d("blocklet.publish.docker.shared")}),e.jsx(_e,{disabled:r,checked:o.shared,onChange:h,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:d("blocklet.publish.docker.required")}),e.jsx(_e,{disabled:r,checked:o.required,onChange:p,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:d("blocklet.publish.docker.secure")}),e.jsx(_e,{disabled:r,checked:o.secure,onChange:y,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{children:d("blocklet.publish.docker.autoGenerated")}),e.jsx(_e,{disabled:r,checked:o.value===fe.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:v,sx:{zoom:.9}})]}),z&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:d("blocklet.publish.docker.description")}),e.jsx(ne,{disabled:r,value:o.description,onChange:w,sx:{flex:1},label:d("blocklet.publish.docker.description")})]}),E&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:d("blocklet.publish.docker.portType")}),e.jsxs(wt,{value:o.type||"docker",onChange:b,children:[e.jsx(be,{value:"docker",children:"Docker"}),e.jsx(be,{value:"web",children:"Web"})]})]}),E&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:d("blocklet.publish.docker.proxyBehavior")}),e.jsxs(wt,{value:o.proxyBehavior||"service",onChange:k,children:[e.jsx(be,{value:"service",children:d("blocklet.publish.docker.serviceProxy")}),e.jsx(be,{value:"direct",children:d("blocklet.publish.docker.directProxy")})]})]}),E&&o.type==="web"&&e.jsxs(c,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(L,{sx:{flex:1},children:d("blocklet.publish.docker.prefix")}),e.jsx(ne,{disabled:r,value:o.prefix,onChange:C,sx:{flex:1},label:d("blocklet.publish.docker.prefix")})]})]})})]})}it.propTypes={dockerParams:s.object.isRequired,setDockerParams:s.func.isRequired,dataKey:s.string.isRequired,item:s.object.isRequired,t:s.func.isRequired,readOnly:s.bool.isRequired,index:s.number.isRequired};it.defaultProps={};const el=`
|
|
194
|
-
docker run --name postgrest
|
|
195
|
-
-p 3000:3000
|
|
196
|
-
-e PGRST_DB_URI="postgres://username:password@host:port/database"
|
|
197
|
-
-e PGRST_DB_SCHEMA="public"
|
|
198
|
-
-e PGRST_DB_ANON_ROLE="anon"
|
|
199
|
-
postgrest/postgrest
|
|
200
|
-
`.trim();function fo({readOnly:t,paramsErrTip:o,setParamsErrTip:n,error:l,params:i,setParams:d}){const{t:r}=Q(),[u,a]=x.useState("dockerParams"),[f,m]=x.useState(""),[j,y]=x.useState(!1),[h,p]=x.useState("--volume"),[v,w]=x.useState(""),[b,k]=x.useState(So(f)),C=b.dockerArgs||[],I=b.dockerEnvs||[],$=b.dockerImage||"",D=b.dockerCommand||"",N=g=>{const{value:S}=g.target;m(S)};x.useEffect(()=>{i.blockletDocker&&i.blockletDocker.dockerImage&&!$&&k(i.blockletDocker)},[i,$,k]);const z=g=>{const S=So(g.target.value);k(W=>{const B=W.dockerArgs.find(P=>P.key==="--publish"&&P.type==="web");let J=!1;const T=P=>{P.type="web",P.path=B.path||"/",P.protocol=B.protocol||"http",P.prefix=B.prefix||"/",P.name=B.name||"publicUrl",P.port=B.port||"BLOCKLET_PORT"};if(S.dockerArgs.forEach(P=>{const H=W.dockerArgs.find(V=>V.key===P.key);H&&(Object.entries(H).forEach(([V,le])=>{le!=null&&V!=="value"&&(P[V]=le)}),P.proxyBehavior=P.proxyBehavior||"server",P.key==="--publish"&&P.type==="web"&&(J?P.type="docker":(T(P),J=!0)))}),B&&!S.dockerArgs.find(H=>H.key==="--publish"&&H.type==="web")){const H=S.dockerArgs.find(V=>V.key==="--publish"&&V.value===B.value);H?T(H):(J=!1,S.dockerArgs.forEach(V=>{V.key==="--publish"&&!J&&(T(V),J=!0)}))}return S.dockerEnvs.forEach(P=>{const H=W.dockerEnvs.find(V=>V.key===P.key);H&&Object.entries(H).forEach(([V,le])=>{le!=null&&V!=="value"&&(P[V]=le)})}),S})},E=()=>{if(y(!1),h==="--env"){k({...b,dockerEnvs:[...I,{key:v,value:"",custom:"",secure:!1,shared:!1,required:!1,description:v}]}),w("");return}k({...b,dockerArgs:[...C,{key:h,value:"",type:"docker",name:"",path:"",prefix:"",protocol:""}]})},Z=()=>{y(!1),w("")},U=g=>{const{value:S}=g.target;k({...b,dockerImage:S}),S.indexOf(" ")>-1?n({...o,dockerImageName:r("blocklet.publish.docker.dockerImageNameError")}):n({...o,dockerImageName:""})},R=g=>{const{value:S}=g.target;k({...b,dockerCommand:S});try{Ns(S),n({...o,dockerCMD:""})}catch{n({...o,dockerCMD:r("blocklet.publish.docker.dockerCMDError")})}};return x.useEffect(()=>{u==="dockerCommand"&&m(Ls(b))},[b,u]),x.useEffect(()=>{d(g=>({...g,blockletDocker:{dockerImage:b.dockerImage,dockerCommand:b.dockerCommand,dockerArgs:b.dockerArgs,dockerEnvs:b.dockerEnvs}}))},[b,d]),e.jsxs(c,{sx:{mt:3},children:[e.jsxs(c,{sx:{width:"100%",display:"flex",flexDirection:"column",gap:2},children:[e.jsx(c,{sx:{borderBottom:1,borderColor:"divider",mb:2},children:e.jsxs(Zo,{value:u,onChange:(g,S)=>a(S),children:[e.jsx(ot,{value:"dockerParams",label:r("blocklet.publish.docker.dockerParams")}),e.jsx(ot,{value:"dockerCommand",label:r("blocklet.publish.docker.dockerCommand")})]})}),u==="dockerCommand"&&e.jsx(ne,{disabled:t,label:r("blocklet.publish.docker.pleaseInputDockerCommand"),placeholder:el,InputProps:{"data-cy":"blocklet-docker-command",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,spellCheck:!1,minRows:10,value:f,onChange:N,onBlur:z}),u==="dockerParams"&&e.jsxs(c,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(ne,{disabled:t,label:r("blocklet.publish.docker.dockerImageName"),placeholder:"Example: docker.io/postgrest/postgrest:latest",value:$,sx:{flex:1},color:o.dockerImageName?"error":"primary",error:!!o.dockerImageName,helperText:o.dockerImageName||"",onChange:U}),e.jsx(ne,{disabled:t,label:`Docker CMD (${r("common.optional")})`,placeholder:"Docker CMD",value:D,sx:{flex:1},color:o.dockerCMD?"error":"primary",error:!!o.dockerCMD,helperText:o.dockerCMD||"",onChange:R}),e.jsx(c,{sx:{height:4}}),C.map((g,S)=>e.jsx(it,{index:S,item:g,dockerParams:b,setDockerParams:k,dataKey:"dockerArgs",t:r,readOnly:t},`${g.key}-${S}`)),I.map((g,S)=>e.jsx(it,{index:S,item:g,dockerParams:b,setDockerParams:k,dataKey:"dockerEnvs",t:r,readOnly:t},`${g.key}-${S}`)),!t&&e.jsxs(c,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(c,{sx:{flex:1}}),e.jsx(K,{onClick:()=>y(!0),children:r("blocklet.publish.docker.addItem")})]})]})]}),!!l&&e.jsx(c,{color:"error.main",mt:1,fontSize:14,children:l}),j&&e.jsxs(at,{fullWidth:!0,open:!0,children:[e.jsx(Vo,{children:r("blocklet.publish.docker.addItem")}),e.jsx(Fo,{children:e.jsxs(ns,{sx:{mt:1,width:"100%",minWidth:480,maxWidth:"100%"},children:[e.jsx(wt,{labelId:"demo-simple-select-helper-label",id:"demo-simple-select-helper",value:h,sx:{width:"100%"},onChange:g=>p(g.target.value),children:Object.keys(dn).map(g=>e.jsx(be,{value:g,children:g}))}),h==="--publish"&&e.jsx(L,{variant:"caption",color:"text.secondary",children:r("blocklet.publish.docker.publishTips")}),h==="--volume"&&e.jsx(L,{variant:"caption",color:"text.secondary",children:r("blocklet.publish.docker.volumeTips")}),h==="--env"&&e.jsxs(c,{sx:{mt:3,width:"100%"},children:[e.jsx(ne,{value:v,onChange:g=>w(g.target.value),sx:{width:"100%"},label:r("blocklet.publish.docker.envKey")}),e.jsx(ss,{children:r("blocklet.publish.docker.dockerArgValue")})]})]})}),e.jsxs(Ho,{children:[e.jsx(K,{onClick:Z,children:r("common.cancel")}),e.jsx(K,{onClick:E,children:r("common.confirm")})]})]})]})}fo.propTypes={readOnly:s.bool.isRequired,params:s.object.isRequired,setParams:s.func.isRequired,error:s.string.isRequired,setParamsErrTip:s.func.isRequired,paramsErrTip:s.func.isRequired};fo.defaultProps={};const tl=({tabs:t,blocklet:o,ancestors:n=[]})=>{const l=o.meta.did;t.push({label:e.jsxs(c,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[e.jsx(Et,{size:24,blocklet:o,ancestors:n}),e.jsx(c,{ml:"4px",className:"text",children:e.jsx(c,{children:o.meta.title})})]},l),value:l})},No=(t,o)=>{const n=Nt(t,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletVideos","blockletScreenshots","blockletResourceType","blockletSupport","blockletHomepage","blockletCommunity","blockletRepository","blockletDocker","contentType","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note","connectedEndpoints"]);return n.blockletComponents?n.blockletComponents=n.blockletComponents.map(l=>({...l,included:!0})):n.blockletComponents=(o.children||[]).map(l=>({did:l.meta.did,included:!1,required:!1})),n},ol={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},Ao={branding:0,introduction:1,resources:2,blocklets:3,version:4};function bo({initUrl:t,...o}){var mo,xo;const{projectId:n,mode:l,releaseId:i,componentDid:d=""}=ct(),{t:r}=Q(),{blocklet:u}=De(),[a,f]=Pe({blockletScreenshots:[],blockletVideos:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",contentType:"blocklet",blockletResourceType:"",blockletSupport:"",blockletCommunity:"",blockletHomepage:"",blockletRepository:"",blockletDocker:{dockerImage:"",dockerArgs:[],dockerEnvs:[]}}),[m,j]=Pe({}),[y,h]=Pe({}),[p,v]=x.useState(!1),[w,b]=Pe(null),{api:k}=je(),C=Be(_=>_.breakpoints.down("md")),[I,$]=x.useState({}),[D,N]=x.useState(!1),z=x.useRef({}),[E,Z]=Pe({}),[U,R]=x.useState(""),[g,S]=Pe({}),W=t==null?void 0:t.searchParams.get("dependentComponentsMode"),B=W==="readonly",{session:J}=Ue(),{storeList:T}=eo({fromBlocklet:!0,blocklet:u,componentDid:d,userDid:(mo=J==null?void 0:J.user)==null?void 0:mo.did}),[P,H]=x.useState([]);x.useEffect(()=>{Array.isArray(T)&&T.length>0&&Promise.all(T.map(async _=>({...(await(await fetch(`${_.url}/__blocklet__.js?type=json`)).json()).preferences,storeInfo:_}))).then(_=>{H(_)})},[T.length]),x.useEffect(()=>{const _={},A={},{logoUrl:me,screenshotUrls:Te}=Rn(a,u,n);Promise.all(P.map(async xe=>{const{maxImageCount:Oe,minImageCount:bt,logoImageType:$e,imageMinHeight:go,imageMinWidth:jo}=xe,Ze=Array.isArray($e)?$e:$e.split(",");_[xe.storeInfo.url]||(_[xe.storeInfo.url]={}),A[xe.storeInfo.url]||(A[xe.storeInfo.url]={});const mt=A[xe.storeInfo.url],An=_[xe.storeInfo.url];Number(Oe)<=Te.length&&(mt.maxImageCount=r("blocklet.publish.storeRule.maxImageCount",{max:Oe,count:Te.length,unit:Oe>1?r("blocklet.publish.storeRule.screenshots"):r("blocklet.publish.storeRule.screenshot")})),Number(xe.minImageCount)>Te.length&&(mt.minImageCount=r("blocklet.publish.storeRule.minImageCount",{min:bt,count:Te.length,unit:bt>1?r("blocklet.publish.storeRule.screenshots"):r("blocklet.publish.storeRule.screenshot")}));const ko=me?me.split(".").pop():"";ko&&!(Ze.includes("jpg")?[...Ze,"jpeg"]:Ze).includes(ko)&&(An.logoFormat=r("blocklet.publish.storeRule.logoFormat",{format:Ze.join(",")})),await Promise.all(Te.map((zn,xt)=>{const gt=new Image;return gt.src=zn,new Promise(On=>{gt.onload=()=>{const{width:Wn,height:Bn}=gt;if(Wn<Number(jo)||Bn<Number(go)){let Ge="";switch(xt+1){case 1:Ge=r("blocklet.publish.storeRule.first");break;case 2:Ge=r("blocklet.publish.storeRule.second");break;case 3:Ge=r("blocklet.publish.storeRule.third");break;default:Ge=`${xt+1}`;break}mt[`imageSize-${xt+1}`]=r("blocklet.publish.storeRule.minImageSize",{width:jo,height:go,name:Ge})}On()}})}))})).then(()=>{const xe=Object.values(_).some($e=>Object.values($e).length>0),Oe=Object.values(A).some($e=>Object.values($e).length>0);h({logoErrors:_,screenshotErrors:A,storeList:T,hasWarning:xe||Oe,hasLogoWarning:xe,hasScreenshotWarning:Oe})})},[a,u.did,n,P,r]);const V=x.useMemo(()=>{const _={};return Object.keys(g).forEach(A=>{const me=g[A];me&&me.forEach(Te=>{_[Te]=!0})}),_},[g]),le=x.useCallback(_=>{B&&f({blockletComponents:[]}),S(_)},[B,S,f]),q=x.useCallback((..._)=>{Z(..._),j({blockletResource:"",blockletDocker:""})},[]),F=i==="none"?(a==null?void 0:a.lastReleaseId)||"":i,[X,te]=x.useState(l==="new-release"?4:0),oe=t==null?void 0:t.searchParams.get("resourcesTitle"),ce=t==null?void 0:t.searchParams.get("componentsTitle"),ee=[{label:r("blocklet.publish.branding"),description:r("blocklet.publish.steps.branding")},{label:r("common.introduction"),description:r("blocklet.publish.steps.introduction")},{label:oe||r("blocklet.publish.resourceTitle"),description:r("blocklet.publish.steps.resources")},{label:ce||r("common.components"),description:r("blocklet.publish.steps.blocklets")},{label:r("blocklet.publish.versionTitle"),description:r("blocklet.publish.steps.version")}],pe=ee[X]||ee[ee.length-1],he=ol[X];x.useEffect(()=>{n&&j({projectId:""})},[n,j]);const Ye=x.useMemo(()=>{var _;return(a==null?void 0:a.blockletResourceType)==="resource"?"resource":(_=a==null?void 0:a.blockletComponents)!=null&&_.some(A=>A.included)||Object.keys(V).length||a!=null&&a.uploadedResource?"pack":"resource"},[a==null?void 0:a.blockletComponents,a==null?void 0:a.uploadedResource,V,a==null?void 0:a.blockletResourceType]),Ve=[],Ee=((u==null?void 0:u.children)||[]).filter(_=>{var A;return(A=_.meta.resource)==null?void 0:A.exportApi}).filter(_=>!d||_.meta.did===d);Ee.forEach(_=>{tl({tabs:Ve,blocklet:_,t:r,ancestors:[u]})});const[se,Le]=x.useState((xo=Ve[0])==null?void 0:xo.value),O=!D&&(w==null?void 0:w.status)==="published",ie=O,Ne=Rs(()=>{if(!t)return;R(t.searchParams.get("logo")),f(A=>{var me;return{...A,blockletTitle:(A==null?void 0:A.blockletTitle)||t.searchParams.get("title"),blockletDescription:(A==null?void 0:A.blockletDescription)||t.searchParams.get("description"),blockletIntroduction:(A==null?void 0:A.blockletIntroduction)||t.searchParams.get("introduction")||t.searchParams.get("description"),blockletComponents:(me=A==null?void 0:A.blockletComponents)!=null&&me.length?A==null?void 0:A.blockletComponents:JSON.parse(t.searchParams.get("components")||"[]"),note:(A==null?void 0:A.note)||t.searchParams.get("note")||"No note"}});const _=t.searchParams.get("resources");try{const A=JSON.parse(_);$(A)}catch{}}),Ae=async()=>{if(F)try{const _=await k.getRelease({input:{did:u.meta.did,projectId:n,releaseId:F}});if(v(!1),!_.release){M.error("Release not found");return}_.release.note=gn(_.release.note,"note"),_.release=En(_.release),l!=="view"&&(_.release.note=""),f(A=>No({...A,..._.release,blockletVersion:l==="create"||l==="new-release"?We.inc(_.release.blockletVersion,"patch"):_.release.blockletVersion},u)),b(_.release)}catch(_){v(!1),M.error(ge(_))}},Fe=async()=>{if(n===Y.UNOWNED_DID){f({blockletVersion:"0.0.1",blockletTitle:""});return}if(!n){M.error(r("blocklet.publish.errorTip.noDid"));return}try{const A=(await kn(k.getProject,[{input:{did:u.meta.did,projectId:n}}],{key:"getProject"})).project||{};A.blockletVersion?(l==="create"||l==="new-release")&&We.valid(A.blockletVersion)&&(A.blockletVersion=We.inc(A.blockletVersion,"patch")):A.blockletVersion="0.0.1";const me=No(A,u);f(me),A.lastReleaseId||Ne()}catch(_){M.error(ge(_))}},ze=x.useCallback(async()=>{v(!0);try{if(l==="view"){if(!F){M.error("Empty release id");return}await Fe(),await Ae();return}await Fe(),F&&(N(!0),await Ae())}finally{v(!1)}},[l,F]),Qe=_=>{f({blockletComponents:_})},G=_=>{f({blockletResourceType:_})};x.useEffect(()=>{ze()},[ze]),x.useEffect(()=>{n===Y.UNOWNED_DID&&(l==="create"||l==="new-release")&&t&&Ne()},[n,t,l,Ne]),x.useEffect(()=>{a.contentType==="docker"?f({resourceFromSelect:!1}):a.contentType==="blocklet"?f({resourceFromSelect:!0}):a.contentType==="upload"&&f({resourceFromSelect:!1})},[a.contentType,f]);const re=x.useMemo(()=>!!Object.keys(E).find(_=>!!E[_].length),[E]);if(!a&&p)return e.jsx(Xe,{});if(!a)return null;const He=Ee.find(_=>_.meta.did===se),Nn=_=>{Le(_)};return e.jsxs(nl,{...o,children:[e.jsx($n,{blocklet:u,release:w,getData:ze,getRelease:Ae,mode:l,params:a,setParams:f,setParamsErrTip:j,warning:y,readOnly:ie,isPublished:O,loading:p,setLoading:v,initLogoUrl:U,releaseId:F,projectId:n,projectType:Ye,resourceComponents:Ee,resourceComponentsMap:g,resourceRelateComponents:V,resourceItem:He,saveSelectedEventsRef:z,hasSelectedResources:re,releaseUsedLast:D,setReleaseUsedLast:N,setRelease:b,paramsErrTip:m}),e.jsxs(c,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[e.jsx(c,{pt:3}),e.jsxs(c,{sx:{gap:3},display:"flex",flexDirection:C?"column":"row",children:[!C&&e.jsx(qn,{steps:ee,loading:p,viewMode:l==="view",params:a,hasSelectedResources:re||a.uploadedResource,paramsErrTip:m,warning:y,activeStep:X,setActiveStep:te,projectId:n,resourcesUrlTitle:oe,componentsUrlTitle:ce}),e.jsxs(c,{flex:"1",maxWidth:"720px",children:[!C&&he!=="introduction"&&e.jsxs(L,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[pe.label,he==="branding"&&e.jsx(ke,{title:r("blocklet.publish.brandingHelp"),placement:"right",children:e.jsx(c,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:e.jsx(vs,{})})})]}),(C||he==="branding")&&e.jsx(c,{flexDirection:"column",children:e.jsx(Cn,{projectId:n,setParams:f,setParamsErrTip:j,warning:y,params:a,componentDid:d,blocklet:u,initUrl:t,loading:p,setLoading:v,paramsErrTip:m,readOnly:ie,initLogoUrl:U,setInitLogoUrl:R})}),C&&e.jsx(c,{flexDirection:"column",children:e.jsx(lt,{loading:p,params:a,paramsErrTip:m,setParams:f,setParamsErrTip:j,readOnly:ie})}),(C||he==="introduction")&&e.jsx(c,{display:"flex",flexDirection:"column",sx:{mt:C?5:0,width:"100%"},children:e.jsx(_n,{loading:p,readOnly:ie,params:a,setParams:f,paramsErrTip:m,setParamsErrTip:j})}),C&&e.jsx(L,{variant:"h6",fontWeight:"bold",mt:5,children:ee[Ao.resources].label}),e.jsx(c,{sx:{maxWidth:720},display:C||he==="resources"?"flex":"none",flexDirection:"column",children:e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsxs(c,{sx:{flex:1},children:[e.jsxs(rs,{onChange:_=>f({contentType:_.target.value}),children:[e.jsx(et,{value:"blocklet",disabled:ie,control:e.jsx(kt,{size:"small",checked:a.contentType==="blocklet"}),label:r("blocklet.publish.resourceSelect")}),e.jsx(et,{value:"upload",disabled:ie,control:e.jsx(kt,{size:"small",checked:a.contentType==="upload"}),label:r("blocklet.publish.resourceUpload")}),e.jsx(et,{value:"docker",disabled:ie,control:e.jsx(kt,{size:"small",checked:a.contentType==="docker"}),label:r("blocklet.publish.resourceDocker")})]}),e.jsxs(c,{display:a.contentType==="blocklet"?"block":"none",children:[!d&&e.jsx(nn,{tabs:Ve,current:se,onChange:Nn,sx:{ml:-2,mt:2,maxWidth:C?window.innerWidth-24:"100%"}}),e.jsx(Qt,{loading:p,initialResources:I,saveSelectedEventsRef:z,selectedResourceIds:E,setSelectedResourceIds:q,setResourceComponentsMap:le,error:m.blockletResource,app:u,readOnly:ie,component:He,componentDid:d,initUrl:t,params:a,showTree:a.contentType==="blocklet",setParams:f,projectId:n===Y.UNOWNED_DID?"":n,releaseUsedLast:D,release:{...w,id:F}})]}),a.contentType==="upload"&&e.jsx(ho,{app:u,readOnly:ie,projectId:n===Y.UNOWNED_DID?"":n,params:a,error:m.blockletResource,setParams:f,setParamsErrTip:j}),a.contentType==="docker"&&e.jsx(fo,{app:u,readOnly:ie,projectId:n===Y.UNOWNED_DID?"":n,params:a,error:m.blockletResource,setParams:f,setParamsErrTip:j,paramsErrTip:m})]})})}),C&&e.jsx(L,{variant:"h6",fontWeight:"bold",mt:5,children:ee[Ao.blocklets].label}),(C||he==="blocklets")&&e.jsx(c,{flexDirection:"column",children:e.jsx(c,{display:"flex",mt:3,className:"section full-width",children:e.jsx(c,{sx:{flex:1},children:e.jsx(Ht,{projectType:Ye,disabled:p||ie,app:u,value:(a==null?void 0:a.blockletComponents)||[],blockletResourceType:(a==null?void 0:a.blockletResourceType)||"",onChange:Qe,onChangeBlockletResourceType:G,resourceRelateComponents:V,dependentComponentsMode:W})})})}),!C&&he==="version"&&e.jsx(c,{flexDirection:"column",children:e.jsx(lt,{loading:p,params:a,paramsErrTip:m,setParams:f,setParamsErrTip:j,readOnly:ie})})]})]})]})]})}bo.propTypes={initUrl:s.object};bo.defaultProps={initUrl:null};const nl=ve.div`
|
|
201
|
-
.section {
|
|
202
|
-
&.full-width {
|
|
203
|
-
max-width: 100%;
|
|
204
|
-
}
|
|
205
|
-
.MuiTypography-h3 {
|
|
206
|
-
font-size: 1.1rem;
|
|
207
|
-
font-weight: 700;
|
|
208
|
-
}
|
|
209
|
-
.left {
|
|
210
|
-
flex-shrink: 0;
|
|
211
|
-
width: 140px;
|
|
212
|
-
}
|
|
213
|
-
.MuiTabs-indicator {
|
|
214
|
-
display: none;
|
|
215
|
-
}
|
|
216
|
-
.MuiTypography-subtitle1 {
|
|
217
|
-
width: 120px;
|
|
218
|
-
font-weight: 700;
|
|
219
|
-
font-size: 1rem;
|
|
220
|
-
${({theme:t})=>t.breakpoints.down("sm")} {
|
|
221
|
-
width: 80px;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
.MuiButtonBase-root {
|
|
226
|
-
a {
|
|
227
|
-
color: inherit;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
.MuiInputBase-multiline .MuiInputAdornment-positionEnd {
|
|
231
|
-
align-self: flex-end;
|
|
232
|
-
.MuiTypography-root {
|
|
233
|
-
font-size: 0.8rem;
|
|
234
|
-
}
|
|
235
|
-
font-size: 0.8rem;
|
|
236
|
-
}
|
|
237
|
-
`;function Ln({padding:t,initUrl:o}){const{blocklet:n}=De(),l=Un(),{componentDid:i}=ct();if(x.useEffect(()=>{if(i&&window.parent){const r=`${l.pathname}${l.search}`;window.parent.postMessage({event:"popstate",page:"publish",componentDid:i,path:r},"*")}},[i,l]),!n)return null;const d={};return t&&(d.padding=t),e.jsx(sl,{style:d,children:e.jsxs(Vn,{children:[e.jsx(jt,{path:"/",element:e.jsx(Ut,{initUrl:o})}),e.jsx(jt,{path:"/:projectId",element:e.jsx(er,{})}),e.jsx(jt,{path:"/:projectId/:mode/:releaseId",element:e.jsx(bo,{initUrl:o})})]})})}Ln.propTypes={padding:s.oneOfType([s.string,s.number]),initUrl:s.object};Ln.defaultProps={padding:"",initUrl:null};const sl=ve(c)`
|
|
238
|
-
a {
|
|
239
|
-
color: ${({theme:t})=>t.palette.primary.main};
|
|
240
|
-
}
|
|
241
|
-
`;export{Ln as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i,aa as g}from"./vendor-mui-core-D_bnq77o.js";import{f as x,r as u}from"./vendor-react-DEoibe3W.js";import{u as v}from"./vendor-hooks-rDgu5KV9.js";import{I as w}from"./invitation-DzT9Qa0A.js";import{L as I}from"./landing-page-Due4o1uF.js";import{u as S,aT as T,j}from"./vendor-ux-did-connect-DHrruicZ.js";import{H as P}from"./vendor-arcblock-uz9DVywv.js";import{g as k}from"./get-safe-url-Bk6PlU7n.js";import{u as E,d as L,c as R,s as W,a as C}from"./index-CIkPfxzG.js";import"./vendor-utils-rHXShPKm.js";import"./use-passport-id-B-b-_oYF.js";import"./session-CHdTc1We.js";import"./sdk-9eXJSWHG.js";import"./CheckCircle-Ds4QI0ey.js";import"./wrap-locale-CPW6a0PM.js";import"./lottie-web-jYmAQWuC.js";function y(c){var r;const m=x(),{searchParams:s}=new URL(window.location.href),{api:p,session:d}=E(),{t:f}=S(),a=s.get("inviteId"),n=s.get("redirect"),h=u.useCallback(async()=>{const{data:t}=await L.get("invitation",{params:{inviteId:a}});return t},[a]),l=v(async(t,o=e=>e)=>{t&&(W(o(t.sessionToken)),C(o(t.refreshToken)),t.visitorId&&T(o(t.visitorId))),await d.refresh(),setTimeout(()=>{if(n){const e=decodeURIComponent(n);e.startsWith(j.WELLKNOWN_SERVICE_PATH_PREFIX)?m(e,{replace:!0}):window.location.href=k(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(I,{did:(r=window.blocklet)==null?void 0:r.appPid,children:[i.jsx(P,{children:i.jsx("title",{children:f("pageTitle.invite")})}),i.jsx(g,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(w,{...c,getDataFn:h,checkFn:p.get,createPassportSvg:t=>R({...t}),onLoginSuccess:l,inService:!0})})]})}export{y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,ab as w,aa as v}from"./vendor-mui-core-D_bnq77o.js";import{a as T,m as I,u as p}from"./vendor-hooks-rDgu5KV9.js";import{I as P}from"./invitation-DzT9Qa0A.js";import{L as j}from"./landing-page-Due4o1uF.js";import{u as k,aT as R,j as S}from"./vendor-ux-did-connect-DHrruicZ.js";import{H as L}from"./vendor-arcblock-uz9DVywv.js";import{g as E}from"./get-safe-url-Bk6PlU7n.js";import{u as C,c as W,s as F,a as N}from"./index-CIkPfxzG.js";import{f as H}from"./vendor-react-DEoibe3W.js";import"./vendor-utils-rHXShPKm.js";import"./use-passport-id-B-b-_oYF.js";import"./session-CHdTc1We.js";import"./sdk-9eXJSWHG.js";import"./CheckCircle-Ds4QI0ey.js";import"./wrap-locale-CPW6a0PM.js";import"./lottie-web-jYmAQWuC.js";function Q(f){var m;const{searchParams:a}=new URL(window.location.href),{api:r,session:d}=C(),u=H(),{t:h}=k(),n=a.get("id"),c=a.get("redirect"),g=T({state:""}),s=I(async()=>{if(!n)return null;const{data:t}=await r.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),x=p(async(t,i=o=>o)=>{t&&(t.sessionToken&&F(i(t.sessionToken)),t.refreshToken&&N(i(t.refreshToken)),t.visitorId&&R(i(t.visitorId)),await d.refresh()),setTimeout(()=>{if(c){const o=decodeURIComponent(c);o.startsWith(S.WELLKNOWN_SERVICE_PATH_PREFIX)?u(o,{replace:!0}):window.location.href=E(o)}else window.location.href=window.env.pathPrefix||"/"},50)});return s.loading?e.jsx(w,{}):e.jsxs(j,{did:(m=window.blocklet)==null?void 0:m.appPid,children:[e.jsx(L,{children:e.jsx("title",{children:h("pageTitle.issuePassport")})}),e.jsx(v,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(P,{...f,action:"issue-passport",getDataFn:l,checkFn:r.get,createPassportSvg:W,onLoginSuccess:x,inService:!0,status:g.state})})]})}export{Q as default};
|