@abtnode/webapp 1.16.28-beta-641c9f13 → 1.16.28-beta-10ca1aad
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-CazR0vZK.js → Add-NewVG93V.js} +1 -1
- package/dist/assets/{ArrowDropDown-BUrSvBpJ.js → ArrowDropDown-Bd9sR9Kj.js} +1 -1
- package/dist/assets/{Autocomplete-DtvRC-0f.js → Autocomplete-BvkSiNum.js} +1 -1
- package/dist/assets/{Breadcrumbs-D_LYBn3C.js → Breadcrumbs-AZ_8G3rf.js} +1 -1
- package/dist/assets/{ButtonGroup-DxRrpbFw.js → ButtonGroup-pLJbtCLI.js} +1 -1
- package/dist/assets/{CheckCircle-DbpNufE5.js → CheckCircle-DkW4b6y7.js} +1 -1
- package/dist/assets/{ChevronLeft-Bqynugte.js → ChevronLeft-C0YN2KhY.js} +1 -1
- package/dist/assets/{ChevronRight-C8sGT-T0.js → ChevronRight-hQNW7SHU.js} +1 -1
- package/dist/assets/{Close-uiQeu7_r.js → Close-S913aeni.js} +1 -1
- package/dist/assets/{Delete-DHiwhVmP.js → Delete-LMbP8m3y.js} +1 -1
- package/dist/assets/DeleteOutline-BlZHBiGU.js +1 -0
- package/dist/assets/DeleteOutline-D7kF8YLA.js +1 -0
- package/dist/assets/{Done-LyiBXZqg.js → Done-BJ9nFL7V.js} +1 -1
- package/dist/assets/{Edit-BgU3t9-z.js → Edit-BgzVDDnU.js} +1 -1
- package/dist/assets/{EditIcon-CeWwrlQZ.js → EditIcon-D0wQcFnY.js} +1 -1
- package/dist/assets/{FilterList-usqmRCGh.js → FilterList-YahW7b2T.js} +1 -1
- package/dist/assets/{Google-BzTTYoLn.js → Google-DU7ZCGKH.js} +1 -1
- package/dist/assets/{Https-B3r3YjjJ.js → Https-CsrqmSk1.js} +1 -1
- package/dist/assets/{InputAdornment-0DnARlEj.js → InputAdornment-CP3BhuEs.js} +1 -1
- package/dist/assets/{InputLabel-Csh1ynXt.js → InputLabel-DOxBtPfl.js} +1 -1
- package/dist/assets/{LastPage-DnsJsUIR.js → LastPage-DmVgRYiw.js} +1 -1
- package/dist/assets/{Launch-BOea_wCy.js → Launch-D-68sLeU.js} +1 -1
- package/dist/assets/{Link-ByQdtjfh.js → Link-CSeasEZI.js} +1 -1
- package/dist/assets/{LoadingButton-Cj_wXKeI.js → LoadingButton-CuJ6PUWH.js} +1 -1
- package/dist/assets/{LockIcon-C082WeKw.js → LockIcon-BlIFddg8.js} +1 -1
- package/dist/assets/{Loop-m_399M1H.js → Loop-DIds44Mh.js} +1 -1
- package/dist/assets/{MoreVert-BzXa-i1R.js → MoreVert-Cei2Rx5H.js} +1 -1
- package/dist/assets/{Pagination-DSEqJST1.js → Pagination-C2m02Dsu.js} +1 -1
- package/dist/assets/{Public-0DIMrFya.js → Public-B9WCVLI7.js} +1 -1
- package/dist/assets/{SchemaReference.es-ISuYhpDf.js → SchemaReference.es--cFrK-mF.js} +1 -1
- package/dist/assets/{Search-CQMDHt0w.js → Search-xUbipjHz.js} +1 -1
- package/dist/assets/{Select-DXPyl9dO.js → Select-DdUtkwyq.js} +1 -1
- package/dist/assets/{Skeleton-URH_1vdL.js → Skeleton-DVrY1Qbr.js} +1 -1
- package/dist/assets/{Slider-Bs8PTrpt.js → Slider-110G8tdG.js} +1 -1
- package/dist/assets/{Stepper-F9lgPB4i.js → Stepper-D1V6NqBX.js} +1 -1
- package/dist/assets/{TextField-B9TZBqQf.js → TextField-3uVNonhd.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-B4DF013K.js → ToggleButtonGroup-JLgFfvsV.js} +1 -1
- package/dist/assets/{ViewList-BsKNUMlP.js → ViewList-jxsh9SMq.js} +1 -1
- package/dist/assets/{actions-B9P9hAjw.js → actions-C2sJQ8Fo.js} +1 -1
- package/dist/assets/{actions-Dunvsfuf.js → actions-DbKUVgjV.js} +1 -1
- package/dist/assets/{agreement-C1qfhTtQ.js → agreement-DDEIcdN2.js} +1 -1
- package/dist/assets/api-3nNr_UzI.js +1 -0
- package/dist/assets/{app-avatar-DQiSEUVG.js → app-avatar-DxfZHNQ7.js} +1 -1
- package/dist/assets/{audit-logs-C18DG_HF.js → audit-logs-CteQbS8_.js} +1 -1
- package/dist/assets/{brace-fold.es-5N33ToDI.js → brace-fold.es-CGA9Przx.js} +1 -1
- package/dist/assets/{bundle-avatar-6edO3WvW.js → bundle-avatar-DrhjE4I8.js} +1 -1
- package/dist/assets/{chart-DxusdyLS.js → chart-D4E9CCIm.js} +1 -1
- package/dist/assets/{click-to-copy-DdhnSrH5.js → click-to-copy-Cd2slBnK.js} +1 -1
- package/dist/assets/{closebrackets.es-iyZsaRgi.js → closebrackets.es-n2RjIdxq.js} +1 -1
- package/dist/assets/{codemirror.es-DeO7gDXr.js → codemirror.es-DPri5EWV.js} +1 -1
- package/dist/assets/{comment.es-CfO1lV_o.js → comment.es-C5rcyFQ8.js} +1 -1
- package/dist/assets/{config-navigation-CcJGg9PY.js → config-navigation-Dhvd0Io1.js} +1 -1
- package/dist/assets/{delete-confirm-C4Bk8D3q.js → delete-confirm-ri-NT9BE.js} +1 -1
- package/dist/assets/{detail-ByJGw6CQ.js → detail-DjuS1eoq.js} +3 -3
- package/dist/assets/{dialog.es-CQHFFbgC.js → dialog.es-BwhOJ4Cq.js} +1 -1
- package/dist/assets/{download-DjWKDAKk.js → download-DChiY5q1.js} +1 -1
- package/dist/assets/{foldgutter.es-D2ybLApJ.js → foldgutter.es-BBpI4A5D.js} +1 -1
- package/dist/assets/getValidReactChildren-2v0cL06g.js +1 -0
- package/dist/assets/{hint.es-U_5yDQ-L.js → hint.es-BAS5bESO.js} +1 -1
- package/dist/assets/{hint.es2-B5AxTcUD.js → hint.es2-BHkOTzjY.js} +1 -1
- package/dist/assets/{iframe-CN6X1zkC.js → iframe-9Q6zcs_o.js} +1 -1
- package/dist/assets/{index-UfVz51n9.js → index-8O7BlyHt.js} +1 -1
- package/dist/assets/{index-CDk9gqwO.js → index-B6ebv4kj.js} +1 -1
- package/dist/assets/{index-oWv9ehU5.js → index-B7nYrN4m.js} +1 -1
- package/dist/assets/{index-oxLMT1TZ.js → index-BFpB8kh-.js} +1 -1
- package/dist/assets/{index-BiYiUZU0.js → index-BJEYtaIe.js} +1 -1
- package/dist/assets/{index-DHvVD3rl.js → index-BJy0Aykg.js} +2 -2
- package/dist/assets/{index-BysoAAKf.js → index-BQK6o51a.js} +10 -10
- package/dist/assets/{index-BUQuICIV.js → index-BQUIGxYm.js} +1 -1
- package/dist/assets/{index-DRwkxXBX.js → index-BhFjM9au.js} +1 -1
- package/dist/assets/{index-DrZqlcHr.js → index-BhpRo-lZ.js} +1 -1
- package/dist/assets/{index-CsJW-E3u.js → index-BnOCj4ky.js} +1 -1
- package/dist/assets/{index-C5VGS0or.js → index-C3dyY7Jn.js} +1 -1
- package/dist/assets/{index-ClMriVhA.js → index-C9Gucb3e.js} +1 -1
- package/dist/assets/{index-jYLpiIQq.js → index-CB6bYAXd.js} +2 -2
- package/dist/assets/{index-CBFgpWWt.js → index-CFcksbYG.js} +1 -1
- package/dist/assets/{index-CiB-ceGd.js → index-CLeW9jNa.js} +1 -1
- package/dist/assets/{index-DINuwc4O.js → index-CTxq4D6b.js} +3 -3
- package/dist/assets/index-CV9H0Z8Q.js +54 -0
- package/dist/assets/{index-Bj3d2EwJ.js → index-CWU-40xT.js} +3 -3
- package/dist/assets/{index-D3isMJCC.js → index-CXQ7qGR9.js} +1 -1
- package/dist/assets/{index-CaM460rw.js → index-CXkSaJRT.js} +1 -1
- package/dist/assets/{index-Cqf3kTsw.js → index-CcuoQAH9.js} +1 -1
- package/dist/assets/{index-DqHjW7tc.js → index-CoYxdjrw.js} +1 -1
- package/dist/assets/{index-CBQDge9H.js → index-CxfL2iNj.js} +1 -1
- package/dist/assets/{index-Ur9l5Pkv.js → index-CzzL15YH.js} +1 -1
- package/dist/assets/{index-CYqmm0Sa.js → index-D74eXDyn.js} +1 -1
- package/dist/assets/{index-BO1T0fz0.js → index-D8yUR2aq.js} +1 -1
- package/dist/assets/{index-CzxambID.js → index-DHhEgUS1.js} +5 -5
- package/dist/assets/{index-JuXoqefL.js → index-DXRZFI-i.js} +1 -1
- package/dist/assets/{index-CmUhV6b0.js → index-Dc91z-EC.js} +1 -1
- package/dist/assets/{index-CtlJtm28.js → index-DeBMBarq.js} +1 -1
- package/dist/assets/{index-CBcjH65j.js → index-DtqP33jl.js} +1 -1
- package/dist/assets/{index-9FRtImOR.js → index-Dw3AMY5z.js} +1 -1
- package/dist/assets/{index-DB54SdYK.js → index-DwmHAX9V.js} +1 -1
- package/dist/assets/{index-LuGhm-KA.js → index-Dyefferl.js} +1 -1
- package/dist/assets/{index-BXxemGex.js → index-DysPnzV7.js} +1 -1
- package/dist/assets/{index-BsRcoDUD.js → index-F32lbxl3.js} +1 -1
- package/dist/assets/index-HsX6FBQ6.js +21 -0
- package/dist/assets/{index-edI690Jp.js → index-Hv2GfUwQ.js} +1 -1
- package/dist/assets/{index-D6XxoBY_.js → index-VH-ysxX_.js} +1 -1
- package/dist/assets/{index-KnfQ44ac.js → index-_GlgH8Bo.js} +1 -1
- package/dist/assets/{index-CNEFxICJ.js → index-f9oKLglL.js} +1 -1
- package/dist/assets/{index-Bpjx7556.js → index-wR2FBwGe.js} +1 -1
- package/dist/assets/{index.es-BaoJVcS0.js → index.es-BYEd319I.js} +1 -1
- package/dist/assets/{index.esm-D5EJdopB.js → index.esm-CcmphPDr.js} +1 -1
- package/dist/assets/{info-addon.es-BF8YxAo6.js → info-addon.es-Cj5Am4W8.js} +1 -1
- package/dist/assets/{info.es-BG-sFq93.js → info.es-CO85iRU8.js} +1 -1
- package/dist/assets/{install-from-url-D_JUSXN1.js → install-from-url-DuMsEyFI.js} +1 -1
- package/dist/assets/{invitation-B9fShyCE.js → invitation-B_cHWnei.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-DTqcyXik.js → is-path-prefix-equal-CYIvKmVL.js} +1 -1
- package/dist/assets/{isEqual-BT0_AVZN.js → isEqual-GyLZxSRY.js} +1 -1
- package/dist/assets/{item-k8JU-j43.js → item-DE1w-7fx.js} +1 -1
- package/dist/assets/{javascript.es-BxU6I3W8.js → javascript.es-BW5_tRcP.js} +1 -1
- package/dist/assets/{jump-to-line.es-BJmdmPwT.js → jump-to-line.es-CHXn1yBu.js} +1 -1
- package/dist/assets/{jump.es-DdndOalg.js → jump.es-XIPua2Fi.js} +1 -1
- package/dist/assets/{line-h_bDsdkk.js → line-aqaJQGOE.js} +3 -3
- package/dist/assets/{lint.es-S1IqD8Ty.js → lint.es-DDqYT3Z3.js} +1 -1
- package/dist/assets/{lint.es2-Pg9vOGzA.js → lint.es2-UzvCZWiN.js} +1 -1
- package/dist/assets/{lint.es3-S5rsbMt9.js → lint.es3-w94C1fvi.js} +1 -1
- package/dist/assets/{list-header-sMQeptfh.js → list-header-BeAWG4F0.js} +1 -1
- package/dist/assets/{log-cMe-yCc9.js → log-C18GoSnt.js} +1 -1
- package/dist/assets/{lottie-oKugLW27.js → lottie-BbyPiNfn.js} +1 -1
- package/dist/assets/{matchbrackets.es-CedBfYiO.js → matchbrackets.es-DZ1mhuIO.js} +1 -1
- package/dist/assets/{memory-DtZsgQku.js → memory-htbPwmSg.js} +1 -1
- package/dist/assets/{mode.es-BCvVo63y.js → mode.es-7keuh6oH.js} +1 -1
- package/dist/assets/{mode.es2-ahvvTvAM.js → mode.es2-vFQEp92Z.js} +1 -1
- package/dist/assets/{mode.es3-Bhh5S718.js → mode.es3-Dn5SA7Oh.js} +1 -1
- package/dist/assets/{onlineParser.es-D5Qe3rjM.js → onlineParser.es--cELFe5v.js} +1 -1
- package/dist/assets/{overview-C8aXpNrX.js → overview-D6KKjePJ.js} +1 -1
- package/dist/assets/{react-UY6g3dsd.js → react-BhYF7sD_.js} +3 -3
- package/dist/assets/{redux-DYjmRPcE.js → redux-CIzpcDy1.js} +1 -1
- package/dist/assets/{resource-dialog-C82ZhW4T.js → resource-dialog-AGPGjRF5.js} +1 -1
- package/dist/assets/{runtime-D1eyE8B1.js → runtime-CLIPNHPm.js} +1 -1
- package/dist/assets/{search.es-0GT84-M2.js → search.es-CfOeePsS.js} +1 -1
- package/dist/assets/{searchcursor.es-CX66aj_i.js → searchcursor.es-RLZnp-2M.js} +1 -1
- package/dist/assets/service-BE130afq.js +1 -0
- package/dist/assets/{show-hint.es-vCcUyQMQ.js → show-hint.es-D6R1Oh0E.js} +1 -1
- package/dist/assets/{slicedToArray-I-ObepI-.js → slicedToArray-CkMd8cEG.js} +1 -1
- package/dist/assets/{spaces-m3k1wtEz.js → spaces-Ndl2Z_l-.js} +1 -1
- package/dist/assets/{sublime.es-wltndpKH.js → sublime.es-BWpn5oL5.js} +1 -1
- package/dist/assets/{switch-control-DSzxDtfl.js → switch-control-BL5Q92y_.js} +1 -1
- package/dist/assets/{table-icons-D70UZfU7.js → table-icons-Bjq5TgED.js} +2 -2
- package/dist/assets/{tag-BDr72C87.js → tag-Cksz2rJp.js} +1 -1
- package/dist/assets/{team-Ch-Gj2hO.js → team-iad1pbmQ.js} +1 -1
- package/dist/assets/{toUpper-Bqm-4sXI.js → toUpper-DnPhzApo.js} +1 -1
- package/dist/assets/{traffic-BS6Lfitp.js → traffic-CWlSTLTp.js} +1 -1
- package/dist/assets/{url-evaluation-ceiaoY0M.js → url-evaluation-CTHUhxLd.js} +1 -1
- package/dist/assets/{url-join-Bsj5KCM1.js → url-join-Dfl-k5vL.js} +1 -1
- package/dist/assets/{use-blocklet-info-for-connect-did-spaces-BQtm5420.js → use-blocklet-info-for-connect-did-spaces-BqhgZgq5.js} +1 -1
- package/dist/assets/{useLocalStorage-BOaGasKr.js → useLocalStorage-B9e_6vUG.js} +1 -1
- package/dist/assets/{util-CMnoIJSr.js → util-Brqqzx0p.js} +1 -1
- package/dist/assets/{wait-container-CtbhxRrL.js → wait-container-CgxLnrOt.js} +1 -1
- package/dist/assets/{withStyles-CjmLVNUl.js → withStyles-CkukjHle.js} +1 -1
- package/dist/assets/{wrap-locale-K8WYS2HB.js → wrap-locale-Bh4fVNfi.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/DeleteOutline-CnmOxEUl.js +0 -1
- package/dist/assets/api-BM9dJimB.js +0 -1
- package/dist/assets/getValidReactChildren-BhT8Dia7.js +0 -1
- package/dist/assets/index-7hmZo5yz.js +0 -54
- package/dist/assets/index-Dw6syXvl.js +0 -21
- package/dist/assets/service-DOjp5s19.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C}from"./codemirror.es-
|
|
1
|
+
import{C}from"./codemirror.es-DPri5EWV.js";import"./show-hint.es-D6R1Oh0E.js";import{R as a,C as m,g as A,i as F,T as fe,S as Te,a as ge,I as Ee,G as H,b as O,d as me,e as ve,f as Se,h as ye,j as Ie,D as E,v as De,p as Fe,k as w,l as Ne,m as P,n as z,K as Y,o as be,q as _e,r as Ae}from"./index-DHhEgUS1.js";import{P as ke,C as Q}from"./Range.es-DaV7MD2W.js";import{o as Oe}from"./onlineParser.es--cELFe5v.js";import{S as J,T as K,a as $}from"./introspection.es-CPJcz6nz.js";import"./index-BJy0Aykg.js";var Me=Object.defineProperty,T=(t,r)=>Me(t,"name",{value:r,configurable:!0});function W(t){let r;return j(t,i=>{switch(i.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":r=i;break}}),r}T(W,"getDefinitionState");function V(t,r,i){return i===J.name&&t.getQueryType()===r?J:i===K.name&&t.getQueryType()===r?K:i===$.name&&F(r)?$:"getFields"in r?r.getFields()[i]:null}T(V,"getFieldDef");function j(t,r){const i=[];let n=t;for(;n!=null&&n.kind;)i.push(n),n=n.prevState;for(let e=i.length-1;e>=0;e--)r(i[e])}T(j,"forEachState");function N(t){const r=Object.keys(t),i=r.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=t[r[e]];return n}T(N,"objectValues");function I(t,r){return X(r,G(t.string))}T(I,"hintList");function X(t,r){if(!r)return h(t,n=>!n.isDeprecated);const i=t.map(n=>({proximity:Z(G(n.label),r),entry:n}));return h(h(i,n=>n.proximity<=2),n=>!n.entry.isDeprecated).sort((n,e)=>(n.entry.isDeprecated?1:0)-(e.entry.isDeprecated?1:0)||n.proximity-e.proximity||n.entry.label.length-e.entry.label.length).map(n=>n.entry)}T(X,"filterAndSortList");function h(t,r){const i=t.filter(r);return i.length===0?t:i}T(h,"filterNonEmpty");function G(t){return t.toLowerCase().replace(/\W/g,"")}T(G,"normalizeText");function Z(t,r){let i=q(r,t);return t.length>r.length&&(i-=t.length-r.length-1,i+=t.indexOf(r)===0?0:.5),i}T(Z,"getProximity");function q(t,r){let i,n;const e=[],l=t.length,o=r.length;for(i=0;i<=l;i++)e[i]=[i];for(n=1;n<=o;n++)e[0][n]=n;for(i=1;i<=l;i++)for(n=1;n<=o;n++){const u=t[i-1]===r[n-1]?0:1;e[i][n]=Math.min(e[i-1][n]+1,e[i][n-1]+1,e[i-1][n-1]+u),i>1&&n>1&&t[i-1]===r[n-2]&&t[i-2]===r[n-1]&&(e[i][n]=Math.min(e[i][n],e[i-2][n-2]+u))}return e[l][o]}T(q,"lexicalDistance");const ee={command:"editor.action.triggerSuggest",title:"Suggestions"},Le=T(t=>{const r=[];if(t)try{De(Fe(t),{FragmentDefinition(i){r.push(i)}})}catch{return[]}return r},"collectFragmentDefs");function ne(t,r,i,n,e,l){var o;const u=Object.assign(Object.assign({},l),{schema:t}),s=n||ue(r,i),c=s.state.kind==="Invalid"?s.state.prevState:s.state;if(!c)return[];const p=c.kind,g=c.step,S=pe(t,s.state);if(p===a.DOCUMENT)return I(s,[{label:"query",kind:m.Function},{label:"mutation",kind:m.Function},{label:"subscription",kind:m.Function},{label:"fragment",kind:m.Function},{label:"{",kind:m.Constructor}]);if(p===a.IMPLEMENTS||p===a.NAMED_TYPE&&((o=c.prevState)===null||o===void 0?void 0:o.kind)===a.IMPLEMENTS)return re(s,c,t,r,S);if(p===a.SELECTION_SET||p===a.FIELD||p===a.ALIASED_FIELD)return te(s,S,u);if(p===a.ARGUMENTS||p===a.ARGUMENT&&g===0){const d=S.argDefs;if(d)return I(s,d.map(f=>{var v;return{label:f.name,insertText:f.name+": ",command:ee,detail:String(f.type),documentation:(v=f.description)!==null&&v!==void 0?v:void 0,kind:m.Variable,type:f.type}}))}if((p===a.OBJECT_VALUE||p===a.OBJECT_FIELD&&g===0)&&S.objectFieldDefs){const d=N(S.objectFieldDefs),f=p===a.OBJECT_VALUE?m.Value:m.Field;return I(s,d.map(v=>{var D;return{label:v.name,detail:String(v.type),documentation:(D=v.description)!==null&&D!==void 0?D:void 0,kind:f,type:v.type}}))}if(p===a.ENUM_VALUE||p===a.LIST_VALUE&&g===1||p===a.OBJECT_FIELD&&g===2||p===a.ARGUMENT&&g===2)return ie(s,S,r,t);if(p===a.VARIABLE&&g===1){const d=A(S.inputType),f=B(r,t,s);return I(s,f.filter(v=>v.detail===(d==null?void 0:d.name)))}return p===a.TYPE_CONDITION&&g===1||p===a.NAMED_TYPE&&c.prevState!=null&&c.prevState.kind===a.TYPE_CONDITION?ae(s,S,t):p===a.FRAGMENT_SPREAD&&g===1?oe(s,S,t,r,Array.isArray(e)?e:Le(e)):p===a.VARIABLE_DEFINITION&&g===2||p===a.LIST_TYPE&&g===1||p===a.NAMED_TYPE&&c.prevState&&(c.prevState.kind===a.VARIABLE_DEFINITION||c.prevState.kind===a.LIST_TYPE||c.prevState.kind===a.NON_NULL_TYPE)?le(s,t):p===a.DIRECTIVE?ce(s,c,t):[]}T(ne,"getAutocompleteSuggestions");const R=` {
|
|
2
2
|
$1
|
|
3
3
|
}`,Ce=T(t=>{const r=t.type;return F(r)||w(r)&&F(r.ofType)||Ne(r)&&(F(r.ofType)||w(r.ofType)&&F(r.ofType.ofType))?R:null},"getInsertText");function te(t,r,i){var n;if(r.parentType){const e=r.parentType;let l=[];return"getFields"in e&&(l=N(e.getFields())),F(e)&&l.push(fe),e===((n=i==null?void 0:i.schema)===null||n===void 0?void 0:n.getQueryType())&&l.push(Te,ge),I(t,l.map((o,u)=>{var s;const c={sortText:String(u)+o.name,label:o.name,detail:String(o.type),documentation:(s=o.description)!==null&&s!==void 0?s:void 0,deprecated:!!o.deprecationReason,isDeprecated:!!o.deprecationReason,deprecationReason:o.deprecationReason,kind:m.Field,type:o.type},p=Ce(o);return p&&(c.insertText=o.name+p,c.insertTextFormat=Ee.Snippet,c.command=ee),c}))}return[]}T(te,"getSuggestionsForFieldNames");function ie(t,r,i,n){const e=A(r.inputType),l=B(i,n,t).filter(o=>o.detail===e.name);if(e instanceof H){const o=e.getValues();return I(t,o.map(u=>{var s;return{label:u.name,detail:String(e),documentation:(s=u.description)!==null&&s!==void 0?s:void 0,deprecated:!!u.deprecationReason,isDeprecated:!!u.deprecationReason,deprecationReason:u.deprecationReason,kind:m.EnumMember,type:e}}).concat(l))}else if(e===O)return I(t,l.concat([{label:"true",detail:String(O),documentation:"Not false.",kind:m.Variable,type:O},{label:"false",detail:String(O),documentation:"Not true.",kind:m.Variable,type:O}]));return l}T(ie,"getSuggestionsForInputValues");function re(t,r,i,n,e){if(r.needsSeparator)return[];const l=i.getTypeMap(),o=N(l).filter(me),u=o.map(({name:d})=>d),s=new Set;M(n,(d,f)=>{var v,D,_,b,y;if(f.name&&(f.kind===a.INTERFACE_DEF&&!u.includes(f.name)&&s.add(f.name),f.kind===a.NAMED_TYPE&&((v=f.prevState)===null||v===void 0?void 0:v.kind)===a.IMPLEMENTS)){if(e.interfaceDef){if((D=e.interfaceDef)===null||D===void 0?void 0:D.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(_=e.interfaceDef)===null||_===void 0?void 0:_.toConfig();e.interfaceDef=new P(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}else if(e.objectTypeDef){if((b=e.objectTypeDef)===null||b===void 0?void 0:b.getInterfaces().find(({name:x})=>x===f.name))return;const U=i.getType(f.name),k=(y=e.objectTypeDef)===null||y===void 0?void 0:y.toConfig();e.objectTypeDef=new z(Object.assign(Object.assign({},k),{interfaces:[...k.interfaces,U||new P({name:f.name,fields:{}})]}))}}});const c=e.interfaceDef||e.objectTypeDef,g=((c==null?void 0:c.getInterfaces())||[]).map(({name:d})=>d),S=o.concat([...s].map(d=>({name:d}))).filter(({name:d})=>d!==(c==null?void 0:c.name)&&!g.includes(d));return I(t,S.map(d=>{const f={label:d.name,kind:m.Interface,type:d};return d!=null&&d.description&&(f.documentation=d.description),f}))}T(re,"getSuggestionsForImplements");function ae(t,r,i,n){let e;if(r.parentType)if(ve(r.parentType)){const l=Se(r.parentType),o=i.getPossibleTypes(l),u=Object.create(null);o.forEach(s=>{s.getInterfaces().forEach(c=>{u[c.name]=c})}),e=o.concat(N(u))}else e=[r.parentType];else{const l=i.getTypeMap();e=N(l).filter(F)}return I(t,e.map(l=>{const o=A(l);return{label:String(l),documentation:(o==null?void 0:o.description)||"",kind:m.Field}}))}T(ae,"getSuggestionsForFragmentTypeConditions");function oe(t,r,i,n,e){if(!n)return[];const l=i.getTypeMap(),o=W(t.state),u=se(n);e&&e.length>0&&u.push(...e);const s=u.filter(c=>l[c.typeCondition.name.value]&&!(o&&o.kind===a.FRAGMENT_DEFINITION&&o.name===c.name.value)&&F(r.parentType)&&F(l[c.typeCondition.name.value])&&ye(i,r.parentType,l[c.typeCondition.name.value]));return I(t,s.map(c=>({label:c.name.value,detail:String(l[c.typeCondition.name.value]),documentation:`fragment ${c.name.value} on ${c.typeCondition.name.value}`,kind:m.Field,type:l[c.typeCondition.name.value]})))}T(oe,"getSuggestionsForFragmentSpread");const Re=T((t,r)=>{var i,n,e,l,o,u,s,c,p,g;if(((i=t.prevState)===null||i===void 0?void 0:i.kind)===r)return t.prevState;if(((e=(n=t.prevState)===null||n===void 0?void 0:n.prevState)===null||e===void 0?void 0:e.kind)===r)return t.prevState.prevState;if(((u=(o=(l=t.prevState)===null||l===void 0?void 0:l.prevState)===null||o===void 0?void 0:o.prevState)===null||u===void 0?void 0:u.kind)===r)return t.prevState.prevState.prevState;if(((g=(p=(c=(s=t.prevState)===null||s===void 0?void 0:s.prevState)===null||c===void 0?void 0:c.prevState)===null||p===void 0?void 0:p.prevState)===null||g===void 0?void 0:g.kind)===r)return t.prevState.prevState.prevState.prevState},"getParentDefinition");function B(t,r,i){let n=null,e;const l=Object.create({});return M(t,(o,u)=>{if((u==null?void 0:u.kind)===a.VARIABLE&&u.name&&(n=u.name),(u==null?void 0:u.kind)===a.NAMED_TYPE&&n){const s=Re(u,a.TYPE);s!=null&&s.type&&(e=r.getType(s==null?void 0:s.type))}n&&e&&(l[n]||(l[n]={detail:e.toString(),insertText:i.string==="$"?n:"$"+n,label:n,type:e,kind:m.Variable},n=null,e=null))}),N(l)}T(B,"getVariableCompletions");function se(t){const r=[];return M(t,(i,n)=>{n.kind===a.FRAGMENT_DEFINITION&&n.name&&n.type&&r.push({kind:a.FRAGMENT_DEFINITION,name:{kind:Y.NAME,value:n.name},selectionSet:{kind:a.SELECTION_SET,selections:[]},typeCondition:{kind:a.NAMED_TYPE,name:{kind:Y.NAME,value:n.type}}})}),r}T(se,"getFragmentDefinitions");function le(t,r,i){const n=r.getTypeMap(),e=N(n).filter(Ie);return I(t,e.map(l=>({label:l.name,documentation:l.description,kind:m.Variable})))}T(le,"getSuggestionsForVariableDefinition");function ce(t,r,i,n){var e;if(!((e=r.prevState)===null||e===void 0)&&e.kind){const l=i.getDirectives().filter(o=>de(r.prevState,o));return I(t,l.map(o=>({label:o.name,documentation:o.description||"",kind:m.Function})))}return[]}T(ce,"getSuggestionsForDirective");function ue(t,r){let i=null,n=null,e=null;const l=M(t,(o,u,s,c)=>{if(c===r.line&&o.getCurrentPosition()>=r.character)return i=s,n=Object.assign({},u),e=o.current(),"BREAK"});return{start:l.start,end:l.end,string:e||l.string,state:n||l.state,style:i||l.style}}T(ue,"getTokenAtPosition");function M(t,r){const i=t.split(`
|
|
4
4
|
`),n=Oe();let e=n.startState(),l="",o=new Q("");for(let u=0;u<i.length;u++){for(o=new Q(i[u]);!o.eol()&&(l=n.token(o,e),r(o,e,l,u)!=="BREAK"););r(o,e,l,u),e.kind||(e=n.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:e,style:l}}T(M,"runOnlineParser");function de(t,r){var i;if(!t||!t.kind)return!1;const n=t.kind,e=r.locations;switch(n){case a.QUERY:return e.indexOf(E.QUERY)!==-1;case a.MUTATION:return e.indexOf(E.MUTATION)!==-1;case a.SUBSCRIPTION:return e.indexOf(E.SUBSCRIPTION)!==-1;case a.FIELD:case a.ALIASED_FIELD:return e.indexOf(E.FIELD)!==-1;case a.FRAGMENT_DEFINITION:return e.indexOf(E.FRAGMENT_DEFINITION)!==-1;case a.FRAGMENT_SPREAD:return e.indexOf(E.FRAGMENT_SPREAD)!==-1;case a.INLINE_FRAGMENT:return e.indexOf(E.INLINE_FRAGMENT)!==-1;case a.SCHEMA_DEF:return e.indexOf(E.SCHEMA)!==-1;case a.SCALAR_DEF:return e.indexOf(E.SCALAR)!==-1;case a.OBJECT_TYPE_DEF:return e.indexOf(E.OBJECT)!==-1;case a.FIELD_DEF:return e.indexOf(E.FIELD_DEFINITION)!==-1;case a.INTERFACE_DEF:return e.indexOf(E.INTERFACE)!==-1;case a.UNION_DEF:return e.indexOf(E.UNION)!==-1;case a.ENUM_DEF:return e.indexOf(E.ENUM)!==-1;case a.ENUM_VALUE:return e.indexOf(E.ENUM_VALUE)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_OBJECT)!==-1;case a.INPUT_VALUE_DEF:switch((i=t.prevState)===null||i===void 0?void 0:i.kind){case a.ARGUMENTS_DEF:return e.indexOf(E.ARGUMENT_DEFINITION)!==-1;case a.INPUT_DEF:return e.indexOf(E.INPUT_FIELD_DEFINITION)!==-1}}return!1}T(de,"canUseDirective");function pe(t,r){let i,n,e,l,o,u,s,c,p,g,S;return j(r,d=>{var f;switch(d.kind){case a.QUERY:case"ShortQuery":g=t.getQueryType();break;case a.MUTATION:g=t.getMutationType();break;case a.SUBSCRIPTION:g=t.getSubscriptionType();break;case a.INLINE_FRAGMENT:case a.FRAGMENT_DEFINITION:d.type&&(g=t.getType(d.type));break;case a.FIELD:case a.ALIASED_FIELD:{!g||!d.name?o=null:(o=p?V(t,p,d.name):null,g=o?o.type:null);break}case a.SELECTION_SET:p=A(g);break;case a.DIRECTIVE:e=d.name?t.getDirective(d.name):null;break;case a.INTERFACE_DEF:d.name&&(s=null,S=new P({name:d.name,interfaces:[],fields:{}}));break;case a.OBJECT_TYPE_DEF:d.name&&(S=null,s=new z({name:d.name,interfaces:[],fields:{}}));break;case a.ARGUMENTS:{if(!d.prevState)n=null;else switch(d.prevState.kind){case a.FIELD:n=o&&o.args;break;case a.DIRECTIVE:n=e&&e.args;break;case a.ALIASED_FIELD:{const y=(f=d.prevState)===null||f===void 0?void 0:f.name;if(!y){n=null;break}const L=p?V(t,p,y):null;if(!L){n=null;break}n=L.args;break}default:n=null;break}break}case a.ARGUMENT:if(n){for(let y=0;y<n.length;y++)if(n[y].name===d.name){i=n[y];break}}u=i==null?void 0:i.type;break;case a.ENUM_VALUE:const v=A(u);l=v instanceof H?v.getValues().find(y=>y.value===d.name):null;break;case a.LIST_VALUE:const D=_e(u);u=D instanceof Ae?D.ofType:null;break;case a.OBJECT_VALUE:const _=A(u);c=_ instanceof be?_.getFields():null;break;case a.OBJECT_FIELD:const b=d.name&&c?c[d.name]:null;u=b==null?void 0:b.type;break;case a.NAMED_TYPE:d.name&&(g=t.getType(d.name));break}}),{argDef:i,argDefs:n,directiveDef:e,enumValue:l,fieldDef:o,inputType:u,objectFieldDefs:c,parentType:p,type:g,interfaceDef:S,objectTypeDef:s}}T(pe,"getTypeInfo");C.registerHelper("hint","graphql",(t,r)=>{const i=r.schema;if(!i)return;const n=t.getCursor(),e=t.getTokenAt(n),l=e.type!==null&&/"|\w/.test(e.string[0])?e.start:e.end,o=new ke(n.line,l),s={list:ne(i,t.getValue(),o,e,r.externalFragments).map(c=>({text:c.label,type:c.type,description:c.documentation,isDeprecated:c.isDeprecated,deprecationReason:c.deprecationReason})),from:{line:n.line,ch:l},to:{line:n.line,ch:e.end}};return s!=null&&s.list&&s.list.length>0&&(s.from=C.Pos(s.from.line,s.from.ch),s.to=C.Pos(s.to.line,s.to.ch),C.signal(t,"hasCompletion",t,s,e)),s});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as u}from"./codemirror.es-
|
|
1
|
+
import{C as u}from"./codemirror.es-DPri5EWV.js";import{f as j}from"./forEachState.es-D8bf0zSr.js";import{g,o as b,G as O,b as d,q as N,r as D}from"./index-DHhEgUS1.js";import"./index-BJy0Aykg.js";var M=Object.defineProperty,p=(r,n)=>M(r,"name",{value:n,configurable:!0});function f(r,n,t){const i=x(t,m(n.string));if(!i)return;const e=n.type!==null&&/"|\w/.test(n.string[0])?n.start:n.end;return{list:i,from:{line:r.line,ch:e},to:{line:r.line,ch:n.end}}}p(f,"hintList");function x(r,n){if(!n)return y(r,l=>!l.isDeprecated);const t=r.map(l=>({proximity:T(m(l.text),n),entry:l}));return y(y(t,l=>l.proximity<=2),l=>!l.entry.isDeprecated).sort((l,o)=>(l.entry.isDeprecated?1:0)-(o.entry.isDeprecated?1:0)||l.proximity-o.proximity||l.entry.text.length-o.entry.text.length).map(l=>l.entry)}p(x,"filterAndSortList");function y(r,n){const t=r.filter(n);return t.length===0?r:t}p(y,"filterNonEmpty");function m(r){return r.toLowerCase().replace(/\W/g,"")}p(m,"normalizeText");function T(r,n){let t=v(n,r);return r.length>n.length&&(t-=r.length-n.length-1,t+=r.indexOf(n)===0?0:.5),t}p(T,"getProximity");function v(r,n){let t,i;const e=[],l=r.length,o=n.length;for(t=0;t<=l;t++)e[t]=[t];for(i=1;i<=o;i++)e[0][i]=i;for(t=1;t<=l;t++)for(i=1;i<=o;i++){const c=r[t-1]===n[i-1]?0:1;e[t][i]=Math.min(e[t-1][i]+1,e[t][i-1]+1,e[t-1][i-1]+c),t>1&&i>1&&r[t-1]===n[i-2]&&r[t-2]===n[i-1]&&(e[t][i]=Math.min(e[t][i],e[t-2][i-2]+c))}return e[l][o]}p(v,"lexicalDistance");u.registerHelper("hint","graphql-variables",(r,n)=>{const t=r.getCursor(),i=r.getTokenAt(t),e=L(t,i,n);return e!=null&&e.list&&e.list.length>0&&(e.from=u.Pos(e.from.line,e.from.ch),e.to=u.Pos(e.to.line,e.to.ch),u.signal(r,"hasCompletion",r,e,i)),e});function L(r,n,t){const i=n.state.kind==="Invalid"?n.state.prevState:n.state,e=i.kind,l=i.step;if(e==="Document"&&l===0)return f(r,n,[{text:"{"}]);const o=t.variableToType;if(!o)return;const c=V(o,n.state);if(e==="Document"||e==="Variable"&&l===0){const a=Object.keys(o);return f(r,n,a.map(s=>({text:`"${s}": `,type:o[s]})))}if((e==="ObjectValue"||e==="ObjectField"&&l===0)&&c.fields){const a=Object.keys(c.fields).map(s=>c.fields[s]);return f(r,n,a.map(s=>({text:`"${s.name}": `,type:s.type,description:s.description})))}if(e==="StringValue"||e==="NumberValue"||e==="BooleanValue"||e==="NullValue"||e==="ListValue"&&l===1||e==="ObjectField"&&l===2||e==="Variable"&&l===2){const a=c.type?g(c.type):void 0;if(a instanceof b)return f(r,n,[{text:"{"}]);if(a instanceof O){const s=a.getValues();return f(r,n,s.map(h=>({text:`"${h.name}"`,type:a,description:h.description})))}else if(a===d)return f(r,n,[{text:"true",type:d,description:"Not false."},{text:"false",type:d,description:"Not true."}])}}p(L,"getVariablesHint");function V(r,n){const t={type:null,fields:null};return j(n,i=>{if(i.kind==="Variable")t.type=r[i.name];else if(i.kind==="ListValue"){const e=t.type?N(t.type):void 0;t.type=e instanceof D?e.ofType:null}else if(i.kind==="ObjectValue"){const e=t.type?g(t.type):void 0;t.fields=e instanceof b?e.getFields():null}else if(i.kind==="ObjectField"){const e=i.name&&t.fields?t.fields[i.name]:null;t.type=e==null?void 0:e.type}}),t}p(V,"getTypeInfo");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{go as x,ba as E}from"./index-
|
|
1
|
+
import{go as x,ba as E}from"./index-BJy0Aykg.js";const L=({url:o,allowFullScreen:r,position:a,display:u,height:i,width:c,overflow:y,styles:f,onLoad:p,onMouseOver:b,onMouseOut:w,scrolling:d,id:m,frameBorder:n,ariaHidden:O,sandbox:s,allow:j,className:g,title:h,ariaLabel:k,ariaLabelledby:I,name:P,target:v,loading:A,importance:F,referrerpolicy:M,allowpaymentrequest:S,src:$,key:q})=>{const t=x({src:$||o,target:v||null,style:{position:a||null,display:u||"initial",overflow:y||null},scrolling:d||null,allowpaymentrequest:S||null,importance:F||null,sandbox:s&&[...s].join(" ")||null,loading:A||null,styles:f||null,name:P||null,className:g||null,allowFullScreen:"allowFullScreen",referrerpolicy:M||null,title:h||null,allow:j||null,id:m||null,"aria-labelledby":I||null,"aria-hidden":O||null,"aria-label":k||null,width:c||null,height:i||null,onLoad:p||null,onMouseOver:b||null,onMouseOut:w||null,key:q||"iframe"});let l=Object.create(null);for(let e of Object.keys(t))t[e]!=null&&(l[e]=t[e]);for(let e of Object.keys(l.style))l.style[e]==null&&delete l.style[e];if(l.styles)for(let e of Object.keys(l.styles))l.styles.hasOwnProperty(e)&&(l.style[e]=l.styles[e]),Object.keys(l.styles).pop()==e&&delete l.styles;if(r)if("allow"in l){const e=l.allow.replace("fullscreen","");l.allow=`fullscreen ${e.trim()}`.trim()}else l.allow="fullscreen";return n>=0&&(l.style.hasOwnProperty("border")||(l.style.border=n)),E.createElement("iframe",Object.assign({},l))},R=L;export{R as I};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aK as Re,aL as Oe,j as t,P as U,n as _e,dQ as pa,r as K,ba as ma,O as m,f8 as Mn,ez as ns,a2 as Le,C as en,q as be,t as ha,v as ba,F as he,gE as Ea,A as Y,M as Me,ad as _a,x as ss,fz as xa,m as Ft,gF as ya,at as Sa,aX as Te,aY as as,D as Qe,B as ie,w as va,J as Na,K as rs,b as se,bl as fe,bH as is,cd as Aa,f as xe,k as ze,bp as $t,bd as Ye,U as Ta,gG as Ca,g as et,cj as j,co as De,dv as me,a3 as Ra,gH as Ce,f9 as We,S as os,bb as tt,a9 as Oa,bI as wa,bJ as Ia,ax as Dn,b5 as La,b4 as cs,dM as Ae,d2 as rt,fP as He,gI as ja,gJ as Ma,gK as Da,aQ as ka,bu as Pa,bv as Ba,gL as Fa,gs as $a,bB as Ua,b6 as ls,a1 as Ut,bj as Kt,Q as Ka,eT as us,s as za,ff as Ie,Z as Ha,cQ as ds,E as Ga,G as vt}from"./index-
|
|
1
|
+
import{aK as Re,aL as Oe,j as t,P as U,n as _e,dQ as pa,r as K,ba as ma,O as m,f8 as Mn,ez as ns,a2 as Le,C as en,q as be,t as ha,v as ba,F as he,gE as Ea,A as Y,M as Me,ad as _a,x as ss,fz as xa,m as Ft,gF as ya,at as Sa,aX as Te,aY as as,D as Qe,B as ie,w as va,J as Na,K as rs,b as se,bl as fe,bH as is,cd as Aa,f as xe,k as ze,bp as $t,bd as Ye,U as Ta,gG as Ca,g as et,cj as j,co as De,dv as me,a3 as Ra,gH as Ce,f9 as We,S as os,bb as tt,a9 as Oa,bI as wa,bJ as Ia,ax as Dn,b5 as La,b4 as cs,dM as Ae,d2 as rt,fP as He,gI as ja,gJ as Ma,gK as Da,aQ as ka,bu as Pa,bv as Ba,gL as Fa,gs as $a,bB as Ua,b6 as ls,a1 as Ut,bj as Kt,Q as Ka,eT as us,s as za,ff as Ie,Z as Ha,cQ as ds,E as Ga,G as vt}from"./index-BJy0Aykg.js";import{I as Wa}from"./iframe-9Q6zcs_o.js";import{F as qa,R as Va,I as Ya,a as zt,L as Nt,b as Za,d as Ja}from"./line-aqaJQGOE.js";import{d as fs}from"./ChevronRight-hQNW7SHU.js";import{T as tn}from"./index-DysPnzV7.js";import{B as gs}from"./bundle-avatar-DrhjE4I8.js";import{u as Xa,B as Qa}from"./app-avatar-DxfZHNQ7.js";import{i as er}from"./isEqual-GyLZxSRY.js";import{d as tr}from"./Loop-DIds44Mh.js";import{d as nr}from"./Done-BJ9nFL7V.js";import{a as kn,A as sr}from"./Autocomplete-BvkSiNum.js";import{T as te,F as ar}from"./TextField-3uVNonhd.js";import{e as rr}from"./mode-B2dWMeTO.js";import{C as ir,d as or}from"./Public-B9WCVLI7.js";import{u as ge,b as nn}from"./team-iad1pbmQ.js";import{C as cr}from"./click-to-copy-Cd2slBnK.js";import{a as Ge}from"./index-F32lbxl3.js";import{E as sn}from"./index-Dc91z-EC.js";import{u as ke,C as X}from"./index.esm-CcmphPDr.js";import{F as re}from"./Select-DdUtkwyq.js";import{d as lr}from"./Launch-D-68sLeU.js";import{d as ur}from"./EditIcon-D0wQcFnY.js";import{d as dr}from"./Edit-BgzVDDnU.js";import{d as fr}from"./actions-DbKUVgjV.js";import{u as gr,a as pr,D as mr,H as hr}from"./index-f9oKLglL.js";import{S as mt}from"./switch-control-BL5Q92y_.js";import{S as br}from"./Slider-110G8tdG.js";import{D as Er}from"./index-CLeW9jNa.js";import{I as _r}from"./index-VH-ysxX_.js";import"./index-BFpB8kh-.js";import"./ArrowDropDown-Bd9sR9Kj.js";import"./ButtonGroup-pLJbtCLI.js";import"./getValidReactChildren-2v0cL06g.js";import"./index-_GlgH8Bo.js";import"./Delete-LMbP8m3y.js";import"./InputLabel-DOxBtPfl.js";import"./useLocalStorage-B9e_6vUG.js";import"./MoreVert-Cei2Rx5H.js";import"./url-evaluation-CTHUhxLd.js";import"./tag-Cksz2rJp.js";import"./redux-CIzpcDy1.js";import"./FilterList-YahW7b2T.js";import"./LastPage-DmVgRYiw.js";import"./Search-xUbipjHz.js";var an={},xr=Oe;Object.defineProperty(an,"__esModule",{value:!0});var ps=an.default=void 0,yr=xr(Re()),Sr=t;ps=an.default=(0,yr.default)((0,Sr.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var rn={},vr=Oe;Object.defineProperty(rn,"__esModule",{value:!0});var ms=rn.default=void 0,Nr=vr(Re()),Ar=t;ms=rn.default=(0,Nr.default)((0,Ar.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var on={},Tr=Oe;Object.defineProperty(on,"__esModule",{value:!0});var hs=on.default=void 0,Cr=Tr(Re()),Rr=t;hs=on.default=(0,Cr.default)((0,Rr.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var cn={},Or=Oe;Object.defineProperty(cn,"__esModule",{value:!0});var bs=cn.default=void 0,wr=Or(Re()),Ir=t;bs=cn.default=(0,wr.default)((0,Ir.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");function ln({label:e,disabled:n,required:s,initialValue:r,onChange:u,style:c,onSubmit:i,triggers:a,options:o,formatterBeforeSubmit:l,helperText:d,placeholder:y,renderImage:b,renderLabel:h,filterKeys:v,noEmpty:A,...C}){const[w,f]=K.useState(!1),[g,S]=K.useState(!1),[p,x]=ma.useState(""),[R,D]=K.useState(r),[O,_]=K.useState(R),L=K.useMemo(()=>{if(!o)return{};const F={};return o.forEach(E=>{F[E.code]=E}),F},[o]),T=()=>{if(!o)return[];if(!p)return o.map(E=>E.code);const F=new RegExp(p.toLowerCase());return o.filter(E=>{var N;for(let k=0;k<v.length;k++){const z=v[k];if(F.test((N=E[z])==null?void 0:N.toLowerCase()))return!0}return!1}).map(E=>E.code)},M=async()=>{S(!0);try{await i(typeof l=="function"?l(O):O)===!1?_(R):A&&!O.length?(_(r),D(r)):(_(O),D(O))}catch{_(R)}finally{S(!1),f(!1)}},$=(F,E)=>{if(!Array.isArray(E)){_([]),u([]);return}const N=E.filter(k=>L[k]);if(!N.length){_([]),u([]);return}_(N),u(N)},q=w?t.jsx(sr,{options:o,value:O,onChange:$,inputValue:p,onInputChange:(F,E)=>{x(E)},PopperComponent:jr,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:T,getOptionLabel:F=>{var E;return(E=L[F])==null?void 0:E.name},renderInput:F=>t.jsx(te,{...F,label:"",placeholder:y}),renderOption:(F,E)=>{var k;const N=O.indexOf(E)!==-1;return K.createElement(Lr,{component:"li",...F,key:E},b(L[E]||{}),t.jsx(m,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:h(E,L[E])||((k=L[E])==null?void 0:k.name)}),t.jsx(m,{component:Mn,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...C}):t.jsx(m,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:O.filter(F=>o.some(E=>E.code===F)).map(F=>t.jsx(ns,{label:o.find(E=>E.code===F).name,style:{marginRight:8},size:"small"},F))});return t.jsx(qa,{className:"form",style:c,children:t.jsxs(m,{className:"form-item",children:[t.jsxs(m,{className:"form-item-label",children:[e,s&&t.jsx(Va,{})]}),t.jsxs(m,{className:"form-item-body",children:[t.jsx(m,{className:"form-item-input",children:q}),t.jsx(m,{className:"form-item-action",children:w?t.jsxs(t.Fragment,{children:[t.jsx(Le,{"data-cy":"schema-form-item-confirm",onClick:M,disabled:n||g,size:"large",children:g?t.jsx(en,{size:24}):t.jsx(nr,{})}),t.jsx(Le,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(R),f(!1)},disabled:n||g,size:"large",children:t.jsx(Mn,{})})]}):t.jsx(Ya,{triggers:a,onEnterEdit:()=>f(!0),disabled:n})})]}),w&&d&&t.jsx(ar,{children:d})]})})}ln.propTypes={style:U.object,onSubmit:U.func,onChange:U.func,label:U.string,initialValue:U.string,required:U.bool,disabled:U.bool,triggers:U.array,options:U.array,helperText:U.string,formatterBeforeSubmit:U.func,placeholder:U.string,renderImage:U.func,filterKeys:U.arrayOf(U.string),noEmpty:U.bool,renderLabel:U.func};ln.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const Lr=_e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as d,j as o,C as f,z as h,aw as v,ci as j,cj as u,O as C,bk as I,ae as P,F as k}from"./index-
|
|
1
|
+
import{u as d,j as o,C as f,z as h,aw as v,ci as j,cj as u,O as C,bk as I,ae as P,F as k}from"./index-BJy0Aykg.js";import{I as R}from"./invitation-B_cHWnei.js";import"./index-Dyefferl.js";import"./index-BFpB8kh-.js";import"./CheckCircle-DkW4b6y7.js";import"./wrap-locale-Bh4fVNfi.js";function S(n){const{searchParams:i}=new URL(window.location.href),g=h(),{api:a,session:r}=v(),{info:l}=d(),c=i.get("redirect"),p=i.get("id"),s=j(async()=>{if(!p)return null;const{data:e}=await a.get("/api/invitation",{params:{inviteId:p,mode:"issue-passport"}});return e}),m=u(()=>{if(s.error)throw s.error;return s==null?void 0:s.data}),w=u(async(e,x=t=>t)=>{e&&(e.sessionToken&&P(x(e.sessionToken)),await r.refresh()),setTimeout(()=>{if(c){const t=decodeURIComponent(c);t.startsWith(k.WELLKNOWN_SERVICE_PATH_PREFIX)?g(t,{replace:!0}):window.location=t}else window.location=window.env.pathPrefix||"/"},50)});return s.loading?o.jsx(f,{}):o.jsx(C,{className:"page-invite",sx:{width:"100vw",height:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"#f6f8fa",overflow:"auto",padding:"20px"},children:o.jsx(R,{...n,action:"issue-passport",getDataFn:m,createPassportSvg:e=>I(e,l),checkFn:a.get,onLoginSuccess:w,passportColor:"default",onLogin:r.login})})}function W(){return d().loading?o.jsx(f,{}):o.jsx(S,{})}export{W as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as p,c as ue,u as J,e as Pe,aE as Rr,j as e,F as D,aF as ln,aG as $n,aH as Tr,aI as cn,aJ as _t,aK as ge,aL as he,P as u,n as V,q as N,ad as ne,aM as dn,m as L,U as te,ax as pe,J as Se,B as G,C as Y,aN as Mn,K as de,O as ee,A as ce,f as Dt,R as zn,aO as Er,aP as Pr,aQ as Ar,aa as Ir,aR as Lr,aS as Or,aT as kr,z as Bn,W as un,T as mn,k as Q,aU as Rt,a as xt,S as ie,b as Je,aV as Wn,aW as qn,aX as Hn,aY as Fr,a2 as Nr,aZ as Ur,a_ as $r,a$ as Mr,b0 as zr,b1 as Br,b2 as ze,a8 as Wr,d as Kn,M as qr,b3 as Hr,aD as ut,b4 as Kr,a9 as mt,a6 as ft,b5 as Gr,a7 as yt,i as Gn,N as Yr,b6 as Vr,b7 as we,b8 as _e,b9 as Xr,ba as Qr,D as Yn,w as vt,bb as Jr,h as Zr,at as fn,bc as ei,bd as pn,aj as ti,be as ni,bf as ri,bg as ii}from"./index-
|
|
1
|
+
import{r as p,c as ue,u as J,e as Pe,aE as Rr,j as e,F as D,aF as ln,aG as $n,aH as Tr,aI as cn,aJ as _t,aK as ge,aL as he,P as u,n as V,q as N,ad as ne,aM as dn,m as L,U as te,ax as pe,J as Se,B as G,C as Y,aN as Mn,K as de,O as ee,A as ce,f as Dt,R as zn,aO as Er,aP as Pr,aQ as Ar,aa as Ir,aR as Lr,aS as Or,aT as kr,z as Bn,W as un,T as mn,k as Q,aU as Rt,a as xt,S as ie,b as Je,aV as Wn,aW as qn,aX as Hn,aY as Fr,a2 as Nr,aZ as Ur,a_ as $r,a$ as Mr,b0 as zr,b1 as Br,b2 as ze,a8 as Wr,d as Kn,M as qr,b3 as Hr,aD as ut,b4 as Kr,a9 as mt,a6 as ft,b5 as Gr,a7 as yt,i as Gn,N as Yr,b6 as Vr,b7 as we,b8 as _e,b9 as Xr,ba as Qr,D as Yn,w as vt,bb as Jr,h as Zr,at as fn,bc as ei,bd as pn,aj as ti,be as ni,bf as ri,bg as ii}from"./index-BJy0Aykg.js";import{T as oi}from"./index-DysPnzV7.js";import{d as ai}from"./ArrowDropDown-Bd9sR9Kj.js";import{u as Tt,C as re,a as gn}from"./index.esm-CcmphPDr.js";import{S as je}from"./switch-control-BL5Q92y_.js";import{d as Vn,i as si}from"./is-path-prefix-equal-CYIvKmVL.js";import{T as K,F as li}from"./TextField-3uVNonhd.js";import{D as Xn,g as ci}from"./index-CLeW9jNa.js";import{d as Qn}from"./Link-CSeasEZI.js";import{d as Ae}from"./Delete-LMbP8m3y.js";import{C as Et}from"./delete-confirm-ri-NT9BE.js";import{I as Be}from"./index-VH-ysxX_.js";import{s as di}from"./logo-BKA11TRi.js";import{_ as ui}from"./useLocalStorage-B9e_6vUG.js";import{L as mi}from"./LoadingButton-CuJ6PUWH.js";import{C as fi,d as Jn}from"./Public-B9WCVLI7.js";import{d as Pt}from"./Add-NewVG93V.js";import{a as pi,B as Zn,D as hn,R as gi,b as hi}from"./url-evaluation-CTHUhxLd.js";import{d as xi}from"./CheckCircle-DkW4b6y7.js";import{d as yi}from"./ChevronRight-hQNW7SHU.js";import{d as vi}from"./MoreVert-Cei2Rx5H.js";import{d as er}from"./Edit-BgzVDDnU.js";import{d as bi,a as tr}from"./Https-CsrqmSk1.js";import{W as $e}from"./tag-Cksz2rJp.js";import{w as ji}from"./withStyles-CkukjHle.js";import{S as Ci}from"./Slider-110G8tdG.js";import"./index-F32lbxl3.js";import"./Select-DdUtkwyq.js";import"./InputLabel-DOxBtPfl.js";import"./FilterList-YahW7b2T.js";import"./LastPage-DmVgRYiw.js";import"./index-f9oKLglL.js";import"./redux-CIzpcDy1.js";import"./Search-xUbipjHz.js";import"./index-Dc91z-EC.js";import"./click-to-copy-Cd2slBnK.js";const fe="Dashboard",nr=p.createContext({}),{Provider:Si,Consumer:ns}=nr,xn=[fe,D.DOMAIN_FOR_IP_SITE,D.DOMAIN_FOR_IP_SITE_REGEXP],wi=(t,n)=>{if(t.name===D.DOMAIN_FOR_DEFAULT_SITE)return-1;if(n.name===D.DOMAIN_FOR_DEFAULT_SITE)return 1;const r=xn.includes(t.name),i=xn.includes(n.name);return r&&i?cn(t.name,n.name):r?-1:i?1:cn(t.name,n.name)},_i=({sites:t,nodePort:n})=>{const r=window.location.host,o=(t||[]).map(a=>{const{id:l,rules:c=[],corsAllowedOrigins:h=[]}=a;let{domain:d,domainAliases:m}=a;m=m||[],[D.DOMAIN_FOR_IP_SITE,D.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=fe,m.find(f=>f.value===r)||m.unshift({protected:!1,value:r}));const g={id:l,name:d,type:"domain",items:[],domainAliases:m,isProtected:a.isProtected,corsAllowedOrigins:h};return(c||[]).forEach(f=>{const{id:y,isProtected:j,from:{pathPrefix:b},to:S}=f;if(S.type===D.ROUTING_RULE_TYPES.BLOCKLET){let R="";Number.parseInt(S.port,10)===Number.parseInt(n,10)?(R="Blocklet Server Dashboard",S.type=D.ROUTING_RULE_TYPES.DAEMON):R=S.did,g.items.push({id:y,name:ln(b||"/"),title:R,type:"rule",isProtected:j,pathPrefix:b,to:S})}else g.items.push({id:y,pathPrefix:b,name:ln(b||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:j,to:S})}),g.items=$n(g.items,f=>f.name),g}).sort(wi),s=o.reduce((a,l)=>{let{name:c}=l;return c.endsWith(D.BLOCKLET_SITE_GROUP_SUFFIX)&&([c]=c.split(".")),a[c]={...l,rules:l.items},a},{});return{sites:o,siteMap:s}},Di=({did:t,domain:n,mountPoint:r,siteMap:i,params:o}={})=>{if(!i)return null;const s=i[t];if(!s)return null;const a=n||(s.domainAliases||[])[0];if(!a)return null;let l=r;if(!l){const c=s.rules.filter(h=>!h.name.startsWith(D.WELLKNOWN_PATH_PREFIX))[0];l=c?c.name:"/"}return _t(a.value,l,o)},Ri=({did:t,mountPoint:n,siteMap:r,params:i}={})=>{if(!r)return[];const o=r[t];if(!o)return[];const s=o.domainAliases||[];if(!s.length)return[];let a=n;if(!a){const l=o.rules.filter(c=>!c.name.startsWith(D.WELLKNOWN_PATH_PREFIX))[0];a=l?l.name:"/"}return s.map(l=>_t(l.value,a,i))},Ti=t=>{const n=t.map(i=>i.domain).filter(i=>![D.DOMAIN_FOR_IP_SITE_REGEXP,D.DOMAIN_FOR_DEFAULT_SITE].includes(i));let r=[];return t.forEach(i=>r.push(...i.domainAliases||[])),r=r.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:n,domainsAliases:r}};function yn({children:t}){const n=ue(),{info:r}=J(),[i,o]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState([]),h=Pe(async()=>{const{sites:P}=await n.getRoutingSites({input:{snapshotHash:""}}),T=P||[];await Promise.all(T.map(async v=>(v.domainAliases=await Rr(v.domainAliases,{getIP:Tr}),v)));const I=Ti(T);o(T),a(I.domains),c([window.location.hostname,...I.domains,...I.domainsAliases.map(v=>v.value)])},[r]),d=(P,T)=>{o(I=>I.map(v=>v.id===P?T.domain?T:{...T,domain:v.domain}:v))},m=P=>n.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),g=async P=>{const T=await n.addRoutingSite({input:P});o(i.concat(T.site))},f=async(P,T)=>{const I=await n.updateRoutingSite({input:{id:P,...T}});if(I.site&&I.site.id){const v=i.findIndex(A=>A.id===I.site.id);v!==-1&&(i.splice(v,1,I.site),o([].concat(i)))}},y=async P=>{await n.deleteRoutingSite({input:{id:P}}),o(i.filter(T=>T.id!==P))},j=async(P,T,I)=>{const v=await n.addDomainAlias({input:{id:P,domainAlias:T,force:I}});d(P,v.site)},b=async(P,T)=>{const I=await n.deleteDomainAlias({input:{id:P,domainAlias:T}});d(P,I.site)},S=async(P,T)=>{const{site:I}=await n.addRoutingRule({input:{id:P,rule:T}});d(P,I)},R=async(P,T)=>{const{site:I}=await n.updateRoutingRule({input:{id:P,rule:T}});d(P,I)},C=async(P,T)=>{const{site:I}=await n.deleteRoutingRule({input:{id:P,ruleId:T}});d(P,I)},x={loading:h.loading,error:h.error,refresh:h.retry,api:n,actions:{addSite:g,updateSite:f,deleteSite:y,addDomainAlias:j,deleteDomainAlias:b,takeSnapshot:m,addRule:S,updateRule:R,deleteRule:C}},{sites:E,siteMap:_}=_i({sites:i,nodePort:r.port});return x.sites=E,x.siteMap=_,x.domains=s,x.allDomains=l,x.getBlockletUrl=({did:P,domain:T,mountPoint:I,params:v})=>Di({did:P,domain:T,mountPoint:I,siteMap:x.siteMap,params:v}),x.getBlockletUrls=({did:P,mountPoint:T,params:I})=>Ri({did:P,mountPoint:T,siteMap:x.siteMap,params:I}),e.jsx(Si,{value:{routing:x},children:t})}function ae(){const{routing:t}=p.useContext(nr);return t}function At(t){const n=[D.DOMAIN_FOR_IP_SITE_REGEXP,D.DOMAIN_FOR_DEFAULT_SITE,D.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&n.push(window.location.hostname),n.includes(t)}var It={},Ei=he;Object.defineProperty(It,"__esModule",{value:!0});var rr=It.default=void 0,Pi=Ei(ge()),Ai=e;rr=It.default=(0,Pi.default)((0,Ai.jsx)("path",{d:"m7 14 5-5 5 5z"}),"ArrowDropUp");function Ii(){return null}function Lt({confirm:t}){const[n,r]=p.useState(null),{t:i}=N(),o=()=>{r(null)},s=async l=>{if(l){let c=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";c==="/"?dn.push(`${l.pathname}`):(c.endsWith("/")&&(c=c.substring(0,c.length-1)),dn.push(`${c}${l.pathname}`)),window.location.reload()}},a=(l,...c)=>{let h=typeof t=="function"?t(l,...c):t;return h?(typeof h=="string"&&(h={description:h}),r({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>s(l),onCancel:()=>o(),...h}),!1):!0};return e.jsxs(Li,{children:[e.jsx(Ii,{message:a}),n&&e.jsx(ne,{title:n.title,description:n.description,confirm:n.confirm,cancel:n.cancel,params:n.params,onConfirm:n.onConfirm,onCancel:n.onCancel})]})}Lt.propTypes={confirm:u.oneOfType([u.object,u.string,u.func])};Lt.defaultProps={confirm:null};const Li=V.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as s,j as t,B as i,ga as r}from"./index-
|
|
1
|
+
import{P as s,j as t,B as i,ga as r}from"./index-BJy0Aykg.js";function n({children:e,...o}){return t.jsxs(i,{color:"did",variant:"contained",...o,children:[t.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),t.jsx(r,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}n.propTypes={children:s.any};n.defaultProps={children:""};export{n as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as I,j as t,ft as hn,cj as X,fu as xn,f9 as ce,O as T,as as _t,ax as Y,m as _,ez as vn,d2 as ht,fv as yn,q as K,fw as $e,fx as bn,aG as jn,ci as wn,dM as xt,R as ve,bl as H,S as Me,fy as Ue,at as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fz as Sn,k as Be,aS as Cn,x as In,y as Rn,f8 as Pn,f as me,ad as we,U as Q,cd as te,A as ie,fA as An,aK as $t,aL as Mt,b as Z,d6 as Dn,t as Ut,F as q,a1 as vt,W as We,co as On,cf as Tn,fB as zt,aN as En,aD as kn,a9 as Ln,fa as Bn,a2 as Fn,bq as Nn,aX as _n,aY as $n,Q as Mn}from"./index-DHvVD3rl.js";import{c as Un}from"./index-KnfQ44ac.js";import{d as ye}from"./Add-CazR0vZK.js";import{d as zn}from"./Loop-m_399M1H.js";import{d as Wn}from"./ViewList-BsKNUMlP.js";import{L as qn,S as Vn,d as Wt}from"./list-header-sMQeptfh.js";import{D as qe,g as Hn}from"./index-CiB-ceGd.js";import"./index-D3isMJCC.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-C82ZhW4T.js";import{T as Kn}from"./index-BXxemGex.js";import{E as Vt}from"./index-CmUhV6b0.js";import"./index-BsRcoDUD.js";import{W as Ht}from"./tag-BDr72C87.js";import{b as G,u as Kt}from"./team-Ch-Gj2hO.js";import{C as Se}from"./click-to-copy-DdhnSrH5.js";import{F as Qt,S as Yt}from"./Select-DXPyl9dO.js";import{I as Gt}from"./InputLabel-Csh1ynXt.js";import{T as Xt}from"./TextField-B9TZBqQf.js";import{I as Fe}from"./index-D6XxoBY_.js";import{d as Qn}from"./Delete-DHiwhVmP.js";import{A as Yn}from"./actions-B9P9hAjw.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var P=m[j];e=e.replace(new RegExp(P,"g"),n[P])}return e}var rr=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var P=i[j],p=e[P];(m?n.indexOf(P)!==-1:n(P,p,e))&&(r[P]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function P(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=P(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:P}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),P),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,P)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,P(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Rt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Rt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Rt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Pt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:P}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[P,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:P}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await P.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
|
|
1
|
+
import{r as I,j as t,ft as hn,cj as X,fu as xn,f9 as ce,O as T,as as _t,ax as Y,m as _,ez as vn,d2 as ht,fv as yn,q as K,fw as $e,fx as bn,aG as jn,ci as wn,dM as xt,R as ve,bl as H,S as Me,fy as Ue,at as de,D as J,B as z,C as oe,w as ze,J as se,K as ee,P as S,n as V,fz as Sn,k as Be,aS as Cn,x as In,y as Rn,f8 as Pn,f as me,ad as we,U as Q,cd as te,A as ie,fA as An,aK as $t,aL as Mt,b as Z,d6 as Dn,t as Ut,F as q,a1 as vt,W as We,co as On,cf as Tn,fB as zt,aN as En,aD as kn,a9 as Ln,fa as Bn,a2 as Fn,bq as Nn,aX as _n,aY as $n,Q as Mn}from"./index-BJy0Aykg.js";import{c as Un}from"./index-_GlgH8Bo.js";import{d as ye}from"./Add-NewVG93V.js";import{d as zn}from"./Loop-DIds44Mh.js";import{d as Wn}from"./ViewList-jxsh9SMq.js";import{L as qn,S as Vn,d as Wt}from"./list-header-BeAWG4F0.js";import{D as qe,g as Hn}from"./index-CLeW9jNa.js";import"./index-CXQ7qGR9.js";import{c as Oe,U as Te,d as qt}from"./resource-dialog-AGPGjRF5.js";import{T as Kn}from"./index-DysPnzV7.js";import{E as Vt}from"./index-Dc91z-EC.js";import"./index-F32lbxl3.js";import{W as Ht}from"./tag-Cksz2rJp.js";import{b as G,u as Kt}from"./team-iad1pbmQ.js";import{C as Se}from"./click-to-copy-Cd2slBnK.js";import{F as Qt,S as Yt}from"./Select-DdUtkwyq.js";import{I as Gt}from"./InputLabel-DOxBtPfl.js";import{T as Xt}from"./TextField-3uVNonhd.js";import{I as Fe}from"./index-VH-ysxX_.js";import{d as Qn}from"./Delete-LMbP8m3y.js";import{A as Yn}from"./actions-C2sJQ8Fo.js";var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});var Jt=Ve.default=void 0;Gn(I);var re=t;function Gn(e){return e&&e.__esModule?e:{default:e}}function yt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),r.push.apply(r,i)}return r}function bt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?yt(Object(r),!0).forEach(function(i){Xn(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Xn(e,n,r){return n=Jn(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e){var n=Zn(e,"string");return typeof n=="symbol"?n:String(n)}function Zn(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}var He=function(n){return(0,re.jsxs)("svg",bt(bt({},n),{},{children:[(0,re.jsx)("g",{clipPath:"url(#clip0)",children:(0,re.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 1.598A4.092 4.092 0 1 0 9 9.78a4.092 4.092 0 0 0 0-8.183zM7.274 3.964a2.44 2.44 0 1 1 3.452 3.451 2.44 2.44 0 0 1-3.452-3.451zm.093 6.343A4.091 4.091 0 0 0 3.275 14.4v2.722c0 .155.126.281.281.281h1.09a.281.281 0 0 0 .28-.281v-2.722a2.44 2.44 0 0 1 2.44-2.44h3.267a2.442 2.442 0 0 1 2.44 2.44v2.722c0 .155.127.281.282.281h1.088a.281.281 0 0 0 .282-.281v-2.722a4.091 4.091 0 0 0-4.092-4.091H7.367z"})}),(0,re.jsx)("defs",{children:(0,re.jsx)("clipPath",{id:"clip0",children:(0,re.jsx)("path",{transform:"translate(0 .5)",d:"M0 0h18v18H0z"})})})]}))};He.defaultProps={width:"18",height:"19",viewBox:"0 0 18 19",xmlns:"http://www.w3.org/2000/svg"};He.displayName="person";Jt=Ve.default=He;var xe={},er=e=>encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`),Zt="%[a-f0-9]{2}",jt=new RegExp("("+Zt+")|([^%]+?)","gi"),wt=new RegExp("("+Zt+")+","gi");function Ne(e,n){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;n=n||1;var r=e.slice(0,n),i=e.slice(n);return Array.prototype.concat.call([],Ne(r),Ne(i))}function tr(e){try{return decodeURIComponent(e)}catch{for(var n=e.match(jt)||[],r=1;r<n.length;r++)e=Ne(n,r).join(""),n=e.match(jt)||[];return e}}function nr(e){for(var n={"%FE%FF":"��","%FF%FE":"��"},r=wt.exec(e);r;){try{n[r[0]]=decodeURIComponent(r[0])}catch{var i=tr(r[0]);i!==r[0]&&(n[r[0]]=i)}r=wt.exec(e)}n["%C2"]="�";for(var m=Object.keys(n),j=0;j<m.length;j++){var P=m[j];e=e.replace(new RegExp(P,"g"),n[P])}return e}var rr=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return nr(e)}},sr=(e,n)=>{if(!(typeof e=="string"&&typeof n=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(n==="")return[e];const r=e.indexOf(n);return r===-1?[e]:[e.slice(0,r),e.slice(r+n.length)]},or=function(e,n){for(var r={},i=Object.keys(e),m=Array.isArray(n),j=0;j<i.length;j++){var P=i[j],p=e[P];(m?n.indexOf(P)!==-1:n(P,p,e))&&(r[P]=p)}return r};(function(e){const n=er,r=rr,i=sr,m=or,j=o=>o==null;function P(o){switch(o.arrayFormat){case"index":return s=>(a,l)=>{const c=a.length;return l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[",c,"]"].join("")]:[...a,[h(s,o),"[",h(c,o),"]=",h(l,o)].join("")]};case"bracket":return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,[h(s,o),"[]"].join("")]:[...a,[h(s,o),"[]=",h(l,o)].join("")];case"comma":case"separator":return s=>(a,l)=>l==null||l.length===0?a:a.length===0?[[h(s,o),"=",h(l,o)].join("")]:[[a,h(l,o)].join(o.arrayFormatSeparator)];default:return s=>(a,l)=>l===void 0||o.skipNull&&l===null||o.skipEmptyString&&l===""?a:l===null?[...a,h(s,o)]:[...a,[h(s,o),"=",h(l,o)].join("")]}}function p(o){let s;switch(o.arrayFormat){case"index":return(a,l,c)=>{if(s=/\[(\d*)\]$/.exec(a),a=a.replace(/\[\d*\]$/,""),!s){c[a]=l;return}c[a]===void 0&&(c[a]={}),c[a][s[1]]=l};case"bracket":return(a,l,c)=>{if(s=/(\[\])$/.exec(a),a=a.replace(/\[\]$/,""),!s){c[a]=l;return}if(c[a]===void 0){c[a]=[l];return}c[a]=[].concat(c[a],l)};case"comma":case"separator":return(a,l,c)=>{const b=typeof l=="string"&&l.includes(o.arrayFormatSeparator),d=typeof l=="string"&&!b&&u(l,o).includes(o.arrayFormatSeparator);l=d?u(l,o):l;const v=b||d?l.split(o.arrayFormatSeparator).map(k=>u(k,o)):l===null?l:u(l,o);c[a]=v};default:return(a,l,c)=>{if(c[a]===void 0){c[a]=l;return}c[a]=[].concat(c[a],l)}}}function g(o){if(typeof o!="string"||o.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function h(o,s){return s.encode?s.strict?n(o):encodeURIComponent(o):o}function u(o,s){return s.decode?r(o):o}function w(o){return Array.isArray(o)?o.sort():typeof o=="object"?w(Object.keys(o)).sort((s,a)=>Number(s)-Number(a)).map(s=>o[s]):o}function f(o){const s=o.indexOf("#");return s!==-1&&(o=o.slice(0,s)),o}function y(o){let s="";const a=o.indexOf("#");return a!==-1&&(s=o.slice(a)),s}function A(o){o=f(o);const s=o.indexOf("?");return s===-1?"":o.slice(s+1)}function C(o,s){return s.parseNumbers&&!Number.isNaN(Number(o))&&typeof o=="string"&&o.trim()!==""?o=Number(o):s.parseBooleans&&o!==null&&(o.toLowerCase()==="true"||o.toLowerCase()==="false")&&(o=o.toLowerCase()==="true"),o}function x(o,s){s=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},s),g(s.arrayFormatSeparator);const a=p(s),l=Object.create(null);if(typeof o!="string"||(o=o.trim().replace(/^[?#&]/,""),!o))return l;for(const c of o.split("&")){if(c==="")continue;let[b,d]=i(s.decode?c.replace(/\+/g," "):c,"=");d=d===void 0?null:["comma","separator"].includes(s.arrayFormat)?d:u(d,s),a(u(b,s),d,l)}for(const c of Object.keys(l)){const b=l[c];if(typeof b=="object"&&b!==null)for(const d of Object.keys(b))b[d]=C(b[d],s);else l[c]=C(b,s)}return s.sort===!1?l:(s.sort===!0?Object.keys(l).sort():Object.keys(l).sort(s.sort)).reduce((c,b)=>{const d=l[b];return d&&typeof d=="object"&&!Array.isArray(d)?c[b]=w(d):c[b]=d,c},Object.create(null))}e.extract=A,e.parse=x,e.stringify=(o,s)=>{if(!o)return"";s=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},s),g(s.arrayFormatSeparator);const a=d=>s.skipNull&&j(o[d])||s.skipEmptyString&&o[d]==="",l=P(s),c={};for(const d of Object.keys(o))a(d)||(c[d]=o[d]);const b=Object.keys(c);return s.sort!==!1&&b.sort(s.sort),b.map(d=>{const v=o[d];return v===void 0?"":v===null?h(d,s):Array.isArray(v)?v.reduce(l(d),[]).join("&"):h(d,s)+"="+h(v,s)}).filter(d=>d.length>0).join("&")},e.parseUrl=(o,s)=>{s=Object.assign({decode:!0},s);const[a,l]=i(o,"#");return Object.assign({url:a.split("?")[0]||"",query:x(A(o),s)},s&&s.parseFragmentIdentifier&&l?{fragmentIdentifier:u(l,s)}:{})},e.stringifyUrl=(o,s)=>{s=Object.assign({encode:!0,strict:!0},s);const a=f(o.url).split("?")[0]||"",l=e.extract(o.url),c=e.parse(l,{sort:!1}),b=Object.assign(c,o.query);let d=e.stringify(b,s);d&&(d=`?${d}`);let v=y(o.url);return o.fragmentIdentifier&&(v=`#${h(o.fragmentIdentifier,s)}`),`${a}${d}${v}`},e.pick=(o,s,a)=>{a=Object.assign({parseFragmentIdentifier:!0},a);const{url:l,query:c,fragmentIdentifier:b}=e.parseUrl(o,a);return e.stringifyUrl({url:l,query:m(c,s),fragmentIdentifier:b},a)},e.exclude=(o,s,a)=>{const l=Array.isArray(s)?c=>!s.includes(c):(c,b)=>!s(c,b);return e.pick(o,l,a)}})(xe);const le=xn,ir={parseNumbers:!1,parseBooleans:!1},ar={skipNull:!1,skipEmptyString:!1},lr=(e,n)=>{var r,i;const{navigateMode:m="push",parseOptions:j,stringifyOptions:P}=n||{},p=Object.assign(Object.assign({},ir),j),g=Object.assign(Object.assign({},ar),P),h=le.useLocation(),u=(r=le.useHistory)===null||r===void 0?void 0:r.call(le),w=(i=le.useNavigate)===null||i===void 0?void 0:i.call(le),f=hn(),y=I.useRef(typeof e=="function"?e():e||{}),A=I.useMemo(()=>xe.parse(h.search,p),[h.search]),C=I.useMemo(()=>Object.assign(Object.assign({},y.current),A),[A]);return[C,X(o=>{const s=typeof o=="function"?o(C):o;f(),u&&u[m]({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},h.state),w&&w({hash:h.hash,search:xe.stringify(Object.assign(Object.assign({},A),s),g)||"?"},{replace:m==="replace",state:h.state})})]},cr=lr;let ur=class extends Error{constructor(n){super(),this.name="AbortError",this.message=n}};const St=e=>globalThis.DOMException===void 0?new ur(e):new DOMException(e),Ct=e=>{const n=e.reason===void 0?St("This operation was aborted."):e.reason;return n instanceof Error?n:St(n)};async function dr(e,n,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:m}={}){return new Promise((j,P)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);const p=[],g=[],h=new Map;let u=!1,w=!1,f=!1,y=0,A=0;const C=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),x=s=>{u=!0,w=!0,P(s)};m&&(m.aborted&&x(Ct(m)),m.addEventListener("abort",()=>{x(Ct(m))}));const o=async()=>{if(w)return;const s=await C.next(),a=A;if(A++,s.done){if(f=!0,y===0&&!w){if(!i&&g.length>0){x(new AggregateError(g));return}if(w=!0,h.size===0){j(p);return}const l=[];for(const[c,b]of p.entries())h.get(c)!==It&&l.push(b);j(l)}return}y++,(async()=>{try{const l=await s.value;if(w)return;const c=await n(l,a);c===It&&h.set(a,c),p[a]=c,y--,await o()}catch(l){if(i)x(l);else{g.push(l),y--;try{await o()}catch(c){x(c)}}}})()};(async()=>{for(let s=0;s<r;s++){try{await o()}catch(a){x(a);break}if(f||u)break}})()})}const It=Symbol("skip");async function mr(e,n){return dr(e,r=>r(),n)}function fr({user:e,sessionUser:n}){const r=ce(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(m=>m.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(_t,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),t.jsxs(T,{sx:{flex:1,overflow:"hidden"},children:[t.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[t.jsx(Y,{title:n.fullName,children:t.jsx(_,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),t.jsx(vn,{label:(r==null?void 0:r.title)||(r==null?void 0:r.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:ht.textBase,borderColor:ht.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),t.jsx(Y,{title:n.email,children:t.jsx(_,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const pr={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},en="Reserved IP",Rt="ip-region-cache";async function gr(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country_name,i.region,i.city].filter(Boolean).join("/"),m}async function hr(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let m="";return i.error?i.reserved&&(m=en):m=[i.country,i.region,i.city].filter(Boolean).join("/"),m}async function xr(e){let n="",r={};try{const i=localStorage.getItem(Rt);i&&(r=JSON.parse(i))}catch{r={}}if(r[e])n=r[e];else{try{n=await hr(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await gr(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(r);i.length>100&&delete r[i[0]],r[e]&&delete r[e],r[e]=n,localStorage.setItem(Rt,JSON.stringify(r))}return n}async function vr(e){return Promise.all(e.map(n=>xr(n)))}const Pt=e=>new Te(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[Te.BROWSER.NAME,Te.BROWSER.VERSION]]}).getResult();function yr({user:e,showAction:n=!0,showUser:r=!0}){const i=yn(),{locale:m}=K(),{confirmApi:j,confirmHolder:P}=$e(),p=X((s,a={})=>bn(pr,s,m,"en",a)),g=X(async()=>{let s=e==null?void 0:e.userSessions;s||(s=await Oe.userSession.getUserSessions({did:e.did}));try{const l=s==null?void 0:s.map((d,v)=>[v,d.lastLoginIp]).filter(d=>!!d[1]),c=l==null?void 0:l.map(d=>d[1]),b=await vr(c);for(let d=0;d<b.length;d++){const v=b[d],k=l[d],M=s[k[0]];M.ipRegion=v}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const a=new Date().getTime();return jn(s,l=>l.visitorId===i?-1:a-new Date(l.updatedAt).getTime())}),h=wn(g),u=ce(()=>h.data||[],[h.data]),w=ce(()=>u.reduce((s,a)=>(s[a.lastLoginIp]=a.ipRegion,s),{}),[u]),f=X(({visitorId:s})=>{j.open({title:p("logoutThisSession"),content:p("logoutThisSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{await Oe.user.logout({visitorId:s}),h.refresh(),j.close()}})}),y=ce(()=>u.filter(a=>a.visitorId!==i),[u]),A=X(()=>{j.open({title:p("logoutAllSession"),content:p("logoutAllSessionConfirm"),confirmButtonText:p("confirm"),cancelButtonText:p("cancel"),onConfirm:async()=>{const s=y.map(a=>()=>Oe.user.logout({visitorId:a.visitorId}));await mr(s,{concurrency:3,stopOnError:!1}),h.refresh(),j.close()}})}),C=[];n&&C.push(t.jsx(Y,{title:p("logoutAllTips"),children:t.jsx(xt,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:A,disabled:y.length===0,children:p("logoutAll")})},"logoutAll"));const x=ce(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),o=[{label:p("platform"),name:"platform",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.os)==null?void 0:c.name,(b=l.os)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("deviceType"),name:"deviceType",options:{customBodyRenderLite:s=>{var c,b;const a=u[s],l=Pt(a.ua);return t.jsx(T,{children:[(c=l.browser)==null?void 0:c.name,(b=l.browser)==null?void 0:b.version].filter(Boolean).join("/")||p("unknown")})}}},{label:p("walletOS"),name:"walletOS",options:{customBodyRenderLite:s=>{var l;const a=u[s];return t.jsx(T,{children:((l=a.extra)==null?void 0:l.walletOS)||p("unknown")})}}},r&&{label:p("user"),name:"user",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{sx:{minWidth:150,maxWidth:250},children:t.jsx(fr,{sessionUser:a.user,user:e})})}}},{label:p("createdAt"),name:"createdAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.createdAt?t.jsx(ve,{value:a.createdAt,relativeRange:3*86400*1e3,locale:m}):p("unknown")}}},{label:p("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:s=>{const a=u[s];return a.status==="expired"?p("expired"):t.jsx(ve,{value:a.updatedAt,relativeRange:3*86400*1e3,locale:m})}}},{label:p("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:w[a.lastLoginIp]?t.jsxs(t.Fragment,{children:[t.jsx(_,{variant:"body2",children:w[a.lastLoginIp]}),t.jsx(_,{variant:"body2",color:"grey",children:a.lastLoginIp||p("unknown")})]}):t.jsx(_,{children:a.lastLoginIp||p("unknown")})})}}},n&&{label:p("actions"),name:"actions",options:{customBodyRenderLite:s=>{const a=u[s];return t.jsx(T,{children:t.jsx(xt,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===a.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>f({visitorId:a.visitorId}),children:a.status==="expired"?p("remove"):i===a.visitorId?p("currentSession"):p("logout")})})}}}].filter(Boolean);return t.jsxs(T,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[P,t.jsx(qe,{locale:m,data:u,columns:o,customButtons:C,options:x,loading:h.loading})]})}function Ke({teamDid:e,roles:n,onCancel:r,onSuccess:i,onError:m,endpoint:j}){const{api:P}=H(),[p,g]=I.useState(!1),[h,u]=I.useState(""),{t:w,locale:f}=K(),[y,A]=I.useState(0),[C,x]=I.useState(""),[o,s]=I.useState(""),[a,l]=I.useState(""),c=async()=>{if(!o){u(w("team.member.error.passportEmpty"));return}const v=a.trim();u(null),g(!0);try{const{inviteInfo:k}=await P.createMemberInvitation({input:{teamDid:e,role:o,remark:v}});x(k),A(1)}catch(k){const M=ee(k);u(M),m(k)}finally{g(!1)}},d=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(Qt,{style:{width:"100%"},variant:"outlined",children:[t.jsx(Gt,{children:w("common.passport")}),t.jsx(Yt,{"data-cy":"invite-member-select-role",value:o,onChange:v=>{u(null),s(v.target.value)},fullWidth:!0,label:w("common.passport"),disabled:p,onKeyPress:v=>{v.key==="Enter"&&(v.preventDefault(),c())},children:n.filter(v=>v.name!=="owner").map(v=>t.jsx(Me,{value:v.name,"data-cy":`invite-member-select-option-${v.name}`,children:t.jsx("span",{children:v.title||v.name})},v.name))})]}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:w("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:a,onChange:v=>{u(null),l(v.target.value)},disabled:p,"data-cy":"invite-member-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:w("common.cancel"),confirm:w("team.member.inviteDialog.createInviteLink"),onCancel:r,onConfirm:c},{body:()=>{const v=Ue({inviteId:C.inviteId,endpoint:j});return t.jsxs("div",{children:[t.jsx(br,{children:w("team.member.inviteDialog.createSuccessTip",{expireDate:de(C.expireDate,f)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:v})]})},confirm:w("common.confirm"),onConfirm:i}][y];return t.jsxs(J,{title:w("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[d.cancel&&t.jsx(z,{onClick:d.onCancel,color:"inherit",children:d.cancel}),t.jsxs(z,{onClick:d.onConfirm,color:"primary",disabled:p||!o,variant:"contained",autoFocus:!0,children:[p&&t.jsx(oe,{size:16}),d.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof d.body=="function"?d.body():d.body}),!!h&&t.jsx(se,{type:"error",variant:"icon",children:h})]})}Ke.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,roles:S.array,endpoint:S.string};Ke.defaultProps={onError:()=>{},roles:[],endpoint:""};const br=V.div`
|
|
2
2
|
font-size: 16px;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
`;function Qe({teamDid:e,onCancel:n,onSuccess:r,onError:i,endpoint:m}){const{api:j,info:P}=H(),{api:p}=I.useContext(Sn),[g,h]=I.useState(!1),{t:u,locale:w}=K(),[f,y]=I.useState(""),[A,C]=I.useState(!1),[x,o]=I.useState(0),[s,a]=I.useState(""),[l,c]=I.useState(""),b=!!Be(P,"ownerNft.did"),d=Cn(async()=>{if(b){const{state:F}=await j.getDelegationState();return F}return{delegated:!0}});if(d.loading)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx("div",{style:{display:"flex",justifyContent:"center"},children:t.jsx(oe,{})})});if(d.error)return t.jsx(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:n,children:t.jsx(se,{type:"error",variant:"icon",children:ee(d.error)})});const v=async()=>{y(null),h(!0);try{const{inviteInfo:F}=await j.createTransferInvitation({input:{teamDid:e,role:"owner",remark:l.trim()}});a(F),o(W.length-1)}catch(F){const ne=ee(F);y(ne),i(F)}finally{h(!1)}},k=()=>{C(!0),o(1)},M=()=>{C(!1),o(0)},W=[{body:t.jsxs(_,{component:"div",children:[t.jsxs(se,{type:"warning",children:[t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.progress")}),t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),t.jsx(se,{type:"warning",children:t.jsx(_,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),t.jsx("div",{style:{marginTop:20,marginBottom:10}}),t.jsx(Xt,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:l,onChange:F=>{y(null),c(F.target.value)},disabled:g,"data-cy":"transfer-node-input-remark"}),t.jsx("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:n,onConfirm:b&&!Be(d,"value.delegated")?k:v},{body:()=>t.jsx(In,{action:"delegate-transfer-nft",open:A,locale:w,checkFn:p.get,onClose:M,onSuccess:v,checkTimeout:5*60*1e3,webWalletUrl:Rn(P),extraParams:{targetDID:P.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const F=Ue({inviteId:s.inviteId,endpoint:m});return t.jsxs("div",{children:[t.jsx(jr,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:de(s.expireDate,w)})}),t.jsx("div",{style:{marginTop:"40px"}}),t.jsx(Se,{children:F})]})},confirm:u("common.confirm"),onConfirm:r}],$=W[x];return t.jsxs(J,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:t.jsxs(t.Fragment,{children:[$.cancel&&t.jsx(z,{onClick:$.onCancel,color:"inherit",children:$.cancel}),t.jsxs(z,{onClick:$.onConfirm,color:"primary",disabled:g,variant:"contained",autoFocus:!0,children:[g&&t.jsx(oe,{size:16}),$.confirm]})]}),children:[t.jsx(ze,{component:"div",children:typeof $.body=="function"?$.body():$.body}),!!f&&t.jsx(se,{type:"error",variant:"icon",children:f})]})}Qe.propTypes={teamDid:S.string.isRequired,onCancel:S.func.isRequired,onSuccess:S.func.isRequired,onError:S.func,endpoint:S.string};Qe.defaultProps={onError:()=>{},endpoint:""};const jr=V.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__fileDeps=["./index-
|
|
1
|
+
const __vite__fileDeps=["./index-DXRZFI-i.js","./index-D9k2I5J1.js","./index-VH-ysxX_.js","./click-to-copy-Cd2slBnK.js","./withStyles-CkukjHle.js","./index-CFcksbYG.js","./useLocalStorage-B9e_6vUG.js","./index-CLeW9jNa.js","./FilterList-YahW7b2T.js","./Select-DdUtkwyq.js","./Delete-LMbP8m3y.js","./InputLabel-DOxBtPfl.js","./TextField-3uVNonhd.js","./LastPage-DmVgRYiw.js","./index-f9oKLglL.js","./redux-CIzpcDy1.js","./Search-xUbipjHz.js","./index-Dc91z-EC.js","./MoreVert-Cei2Rx5H.js","./url-evaluation-CTHUhxLd.js","./tag-Cksz2rJp.js","./actions-DbKUVgjV.js","./ButtonGroup-pLJbtCLI.js","./getValidReactChildren-2v0cL06g.js","./index-D74eXDyn.js","./isEqual-GyLZxSRY.js","./install-from-url-DuMsEyFI.js","./Stepper-D1V6NqBX.js","./app-avatar-DxfZHNQ7.js","./Add-NewVG93V.js","./index-DeBMBarq.js","./index-BQK6o51a.js","./index-BnOCj4ky.js","./url-join-Dfl-k5vL.js","./Skeleton-DVrY1Qbr.js","./Close-S913aeni.js","./lottie-BbyPiNfn.js","./wait-container-CgxLnrOt.js","./Launch-D-68sLeU.js","./DeleteOutline-BlZHBiGU.js","./DeleteOutline-D7kF8YLA.js","./spaces-Ndl2Z_l-.js","./api-3nNr_UzI.js","./index-HsX6FBQ6.js","./item-DE1w-7fx.js","./index-wR2FBwGe.js","./index-F32lbxl3.js","./InputAdornment-CP3BhuEs.js","./preact.module-B1z5cdvs.js","./Done-BJ9nFL7V.js","./delete-confirm-ri-NT9BE.js","./item-CxkJY_14.css","./ArrowDropDown-Bd9sR9Kj.js","./Breadcrumbs-AZ_8G3rf.js","./index-B7nYrN4m.js","./index-DysPnzV7.js","./index.esm-CcmphPDr.js","./switch-control-BL5Q92y_.js","./is-path-prefix-equal-CYIvKmVL.js","./Link-CSeasEZI.js","./logo-BKA11TRi.js","./LoadingButton-CuJ6PUWH.js","./Public-B9WCVLI7.js","./CheckCircle-DkW4b6y7.js","./ChevronRight-hQNW7SHU.js","./Edit-BgzVDDnU.js","./Https-CsrqmSk1.js","./Slider-110G8tdG.js","./index-CxfL2iNj.js","./download-DChiY5q1.js","./download-D33dFtt_.css","./index-CcuoQAH9.js","./audit-logs-CteQbS8_.js","./index-BQUIGxYm.js","./index-D4PP6P2d.css","./Pagination-C2m02Dsu.js","./index-BJEYtaIe.js","./index-_GlgH8Bo.js","./Loop-DIds44Mh.js","./ViewList-jxsh9SMq.js","./list-header-BeAWG4F0.js","./index-CXQ7qGR9.js","./resource-dialog-AGPGjRF5.js","./index-C9Gucb3e.js","./team-iad1pbmQ.js","./actions-C2sJQ8Fo.js","./index-CoYxdjrw.js","./EditIcon-D0wQcFnY.js","./LockIcon-BlIFddg8.js","./Google-DU7ZCGKH.js","./ToggleButtonGroup-JLgFfvsV.js","./detail-DjuS1eoq.js","./index-DwmHAX9V.js","./index-B6ebv4kj.js","./invitation-B_cHWnei.js","./index-Dyefferl.js","./index-BFpB8kh-.js","./wrap-locale-Bh4fVNfi.js","./index-CTxq4D6b.js","./index-BhpRo-lZ.js","./index-Hv2GfUwQ.js","./agreement-DDEIcdN2.js","./index-C3dyY7Jn.js","./index-D8yUR2aq.js","./index-DHhEgUS1.js","./index-C7igR7se.css","./index-DtqP33jl.js","./traffic-CWlSTLTp.js","./iframe-9Q6zcs_o.js","./ChevronLeft-C0YN2KhY.js","./chart-D4E9CCIm.js","./bundle-avatar-DrhjE4I8.js","./memory-htbPwmSg.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
2
|
function OW(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gi(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var IW={exports:{}},i4={},PW={exports:{}},zn={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -2518,4 +2518,4 @@ ${r}
|
|
|
2518
2518
|
${e=>e.scrollable?"":"overflow: hidden"};
|
|
2519
2519
|
}
|
|
2520
2520
|
`;function nCt(){const{t:e}=fo(),{session:t}=y0(),{info:n,refresh:r}=Sl();return Ki(ti.TeamEvents.userUpdated,({teamDid:i,user:o})=>{i===n.did&&o&&!o.approved&&t&&t.user&&t.user.did===o.did&&(ci.warning(e("session.forbidLogin"),{autoHideDuration:10*1e3}),t.logout())}),Ki(rn.EVENTS.NOTIFICATION_CREATE,i=>{i.entityType==="node"&&r({silent:!0})}),Ki(rn.EVENTS.NODE_UPDATED,()=>{r({silent:!0})}),null}var Ss={},rCt=sie;function iCt(e){return e&&e.length?rCt(e):[]}var Vle=iCt;const P_t=Kt(Vle),oCt=gi(Lze);class aCt{constructor(t){this.value=t,this.next=void 0}}let sCt=class{constructor(){this.clear()}enqueue(t){const n=new aCt(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var lCt=sCt;const uCt=lCt,cCt=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new uCt;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(s,l,...c)=>{n++;const u=(async()=>s(...c))();l(u);try{await u}catch{}r()},o=(s,l,...c)=>{t.enqueue(i.bind(null,s,l,...c)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},a=(s,...l)=>new Promise(c=>{o(s,c,...l)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),a};var fCt=cCt,zle={},Ri={};Ri.endianness=function(){return"LE"};Ri.hostname=function(){return typeof location<"u"?location.hostname:""};Ri.loadavg=function(){return[]};Ri.uptime=function(){return 0};Ri.freemem=function(){return Number.MAX_VALUE};Ri.totalmem=function(){return Number.MAX_VALUE};Ri.cpus=function(){return[]};Ri.type=function(){return"Browser"};Ri.release=function(){return typeof navigator<"u"?navigator.appVersion:""};Ri.networkInterfaces=Ri.getNetworkInterfaces=function(){return{}};Ri.arch=function(){return"javascript"};Ri.platform=function(){return"browser"};Ri.tmpdir=Ri.tmpDir=function(){return"/tmp"};Ri.EOL=`
|
|
2521
|
-
`;Ri.homedir=function(){return"/"};(function(e){var t=mt&&mt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.hasMountPoint=e.hasStartEngine=e.isPackBlocklet=e.isGatewayBlocklet=e.getBlockletEngine=void 0;const n=t(Ri),r=ti,i=c=>{if(c===void 0)throw new Error("blocklet meta param is required");const{engine:u}=c;if(!u)return{interpreter:"node",source:""};if(!Array.isArray(u))return u;const d=n.default.platform(),p=u.find(g=>g.platform===d);if(!p)throw new Error(`can not find a proper engine interpreter on ${d}`);return p};e.getBlockletEngine=i;const o=c=>(c==null?void 0:c.group)===r.BlockletGroup.gateway;e.isGatewayBlocklet=o;const a=c=>(c==null?void 0:c.group)===r.BlockletGroup.pack;e.isPackBlocklet=a;const s=c=>!!(c!=null&&c.main)||(0,e.getBlockletEngine)(c||{}).interpreter==="blocklet";e.hasStartEngine=s;const l=c=>((0,e.hasStartEngine)(c)||((c==null?void 0:c.interfaces)||[]).find(u=>u.type===r.BLOCKLET_INTERFACE_TYPE_WEB))&&(0,e.isGatewayBlocklet)(c)===!1;e.hasMountPoint=l})(zle);(function(e){var t=mt&&mt.__importDefault||function(te){return te&&te.__esModule?te:{default:te}};Object.defineProperty(e,"__esModule",{value:!0}),e.isPackBlocklet=e.isGatewayBlocklet=e.isAccessible=e.isRunning=e.isBeforeInstalled=e.isInProgress=e.getBlockletServices=e.getBlockletAppIdList=e.getRolesFromAuthConfig=e.isPreferenceKey=e.isExternalBlocklet=e.getBlockletChainInfo=e.getChainInfo=e.getConnectAppUrl=e.getParentComponentName=e.filterComponentsV2=e.findComponentByIdV2=e.findComponentV2=e.findComponentById=e.findComponent=e.getComponentBundleId=e.getComponentName=e.getComponentId=e.replaceSlotToIp=e.getComponentWhoCanAccess=e.getWhoCanAccess=e.findServiceFromMeta=e.findWebInterfacePort=e.findWebInterface=e.fixBlockletStatus=e.getAppDescription=e.getDisplayName=e.getAppName=e.hasRunnableComponent=e.wipeSensitiveData=e.isEnvShareable=e.isEnvShareableToClient=e.getComponentMissingConfigs=e.getAppMissingConfigs=e.getSharedConfigObj=e.isDeletableBlocklet=e.forEachComponentV2Sync=e.forEachComponentV2=e.forEachChildSync=e.forEachChild=e.forEachBlockletSync=e.forEachBlocklet=e.isFreeComponent=e.isFreeBlocklet=e.getAppUrl=void 0,e.hasResourceType=e.hasStartEngine=void 0;const n=t(vw),r=t(Vle),i=oCt,o=t(fCt),a=t(rn),s=ti,l=zle;Object.defineProperty(e,"hasStartEngine",{enumerable:!0,get:function(){return l.hasStartEngine}}),Object.defineProperty(e,"isGatewayBlocklet",{enumerable:!0,get:function(){return l.isGatewayBlocklet}}),Object.defineProperty(e,"isPackBlocklet",{enumerable:!0,get:function(){return l.isPackBlocklet}});const{NODE_SERVICES:c,SLOT_FOR_IP_DNS_SITE:u,WHO_CAN_ACCESS:d,WHO_CAN_ACCESS_PREFIX_ROLES:p}=a.default,g=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.did:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.did:""}`;e.getComponentId=g;const y=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.name:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.name:""}`;e.getComponentName=y;const b=te=>`${te.meta.bundleName}@${te.meta.version}`;e.getComponentBundleId=b;const A=te=>{if(!te)return"";const we=te.split("/");return we.pop(),!we.length||(we[we.length-1].startsWith("@")&&we.pop(),!we.length)?"":we.join("/")};e.getParentComponentName=A;const x=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re,params:q,_parent:W,_root:ce,_level:ke=0,_tasks:Ee,_ancestors:xe=[],_limit:Ue}={})=>{const je=ce||W||te,He=g(te,xe),lt=xe.concat(te);if(re){const Oe=we(te,{parent:W,root:je,level:ke,params:q,ancestors:xe,id:He});if(te.children)for(const Le of te.children)x(Le,we,{sync:re,params:Oe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});return null}if(!$e)return new Promise(async(Oe,Le)=>{try{const Pe=await we(te,{parent:W,root:je,level:ke,ancestors:xe,params:q,id:He});if(te.children)for(const nt of te.children)await x(nt,we,{params:Pe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});Oe(null)}catch(Pe){Le(Pe)}});const Ze=Ue||(0,o.default)(De),Ye=Ee||[];if(Ye.push(Ze(()=>we(te,{parent:W,root:je,level:ke,ancestors:xe,id:He}))),te.children)for(const Oe of te.children)x(Oe,we,{parallel:$e,_parent:te,_root:je,_level:ke+1,_tasks:Ye,_ancestors:lt,_limit:Ze});return Ee?null:Promise.all(Ye)};e.forEachBlocklet=x;const D=(te,we)=>x(te,we,{sync:!0});e.forEachBlockletSync=D;const O=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re}={})=>{if(re){if(te.children)for(const ce of te.children)we(ce);return null}if(!$e)return new Promise(async(ce,ke)=>{try{if(te.children)for(const Ee of te.children)await we(Ee);ce(null)}catch(Ee){ke(Ee)}});const q=(0,o.default)(De),W=[];if(te.children)for(const ce of te.children)W.push(q(()=>we(ce)));return Promise.all(W)};e.forEachComponentV2=O;const P=(te,we)=>O(te,we,{sync:!0});e.forEachComponentV2Sync=P;const V=(te,we,$e)=>x(te,(De,re)=>re.level===0?{}:we(De,re),$e);e.forEachChild=V;const M=(te,we)=>V(te,we,{sync:!0});e.forEachChildSync=M;const j=(te,we,{_ancestors:$e=[],returnAncestors:De=!1}={})=>{if(!we)return null;if(we(te,{ancestors:$e}))return De?{component:te,ancestors:$e}:te;for(const re of te.children||[]){const q=$e.concat(te),W=j(re,we,{_ancestors:q,returnAncestors:De});if(W)return W}return null};e.findComponent=j;const G=(te,we,{returnAncestors:$e=!1}={})=>(Array.isArray(we)&&(we=we.join("/")),j(te,(De,{ancestors:re})=>{const q=g(De,re);return we===q},{returnAncestors:$e}));e.findComponentById=G;const ie=(te,we)=>{if(!we)return null;for(const $e of te.children||[])if(we($e,te))return $e;return null};e.findComponentV2=ie;const ue=(te,we)=>we?(Array.isArray(we)&&(we=we.join("/")),ie(te,($e,De)=>{if(we.includes("/")){const re=g($e,[De]);return we===re}return we===$e.meta.did})):null;e.findComponentByIdV2=ue;const K=(te,we)=>{if(!we)return[];const $e=[];for(const De of te.children||[])we(De,te)&&$e.push(De);return $e};e.filterComponentsV2=K;const N=te=>!!te&&!!(te.key||te.name)&&!te.secure&&te.shared!==!1&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareableToClient=N;const T=te=>!!te&&!!(te.key||te.name)&&!te.secure&&!!te.shared&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareable=T;const f=(te,we)=>{const $e={};return!te||!we||(Array.isArray(te.configs)&&te.configs.forEach(({key:De,value:re,secure:q})=>{if(!T({key:De,secure:q,shared:!0}))return;const W=(te.configObj||{})[De]||re,ce=(we.configs||[]).find(ke=>ke.key===De);(!ce||T(ce)||!ce.value&&!(we.configObj||{})[ce.key])&&($e[De]=W)}),(te.configs||[]).forEach(({key:De,value:re})=>{[s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_HOST,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_ID,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_TYPE].includes(De)&&($e[s.CHAIN_PROP_MAP[De]]=re)})),$e};e.getSharedConfigObj=f;const h=te=>te.key.startsWith(s.BLOCKLET_PREFERENCE_PREFIX)===!0;e.isPreferenceKey=h;const w=(te,we)=>!!(te.required&&(!te.value&&!we[te.key]||Object.values(s.CHAIN_PROP_MAP).includes(te.key)&&Object.keys(we).includes(te.key)&&!we[te.key])),_=(te={})=>{const we=[];return P(te,$e=>{var q;if(((q=$e.meta)==null?void 0:q.group)===s.BlockletGroup.gateway)return;const De=$e.configs||[],re=f(te,$e);De.forEach(W=>{w(W,re)&&we.push({did:$e.meta.did,key:W.key,description:W.description})})}),we.filter($e=>!h($e))};e.getAppMissingConfigs=_;const R=(te={},we={})=>{const $e=[],De=te.configs||[],re=f(we,te);return De.forEach(q=>{w(q,re)&&$e.push({did:te.meta.did,key:q.key,description:q.description})}),$e};e.getComponentMissingConfigs=R;const k=te=>te.payment?(te.payment.price||[]).map($e=>$e.value||0).every($e=>$e===0):!0;e.isFreeBlocklet=k;const C=te=>!te.payment||!te.payment.componentPrice?!0:!te.payment.componentPrice.length;e.isFreeComponent=C;const E=te=>te&&(x(te,we=>{we.configs&&(we.configs=we.configs.filter($e=>!h($e)),we.configs.forEach($e=>{$e.secure&&($e.value=$e.value?"__encrypted__":"")})),(we.environments||[]).forEach($e=>{["BLOCKLET_APP_SK","BLOCKLET_APP_PSK"].includes($e.key)&&($e.value="__encrypted__")}),(we.migratedFrom||[]).forEach($e=>{$e.appSk="__encrypted__"}),delete te.configObj,delete te.environmentObj},{sync:!0}),te);e.wipeSensitiveData=E;const v=te=>{if(!te)return!1;const we=te.environments.find($e=>$e.key==="BLOCKLET_DELETABLE");return we?we.value==="yes":!0};e.isDeletableBlocklet=v;const L=te=>{let we=!1;return D(te,$e=>{$e.meta.group!==s.BlockletGroup.gateway&&(we=!0)}),we};e.hasRunnableComponent=L;const ne=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_NAME");re&&re.value&&(De=re.value)}return De||$e.title||$e.name};e.getAppName=ne,e.getDisplayName=ne;const F=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_DESCRIPTION");re&&re.value&&(De=re.value)}return De||$e.description||$e.name};e.getAppDescription=F;function J(te){var De,re,q;const we=(q=(re=(De=te==null?void 0:te.site)==null?void 0:De.domainAliases)==null?void 0:re.sort((W,ce)=>{var ke,Ee,xe,Ue;return(ke=W.accessibility)!=null&&ke.accessible&&((Ee=ce.accessibility)!=null&&Ee.accessible)?+W.isProtected-+ce.isProtected:+((xe=ce.accessibility)==null?void 0:xe.accessible)-+((Ue=W.accessibility)==null?void 0:Ue.accessible)}))==null?void 0:q.map(W=>{var Ee;const ce=(Ee=W==null?void 0:W.domainStatus)!=null&&Ee.isHttps?"https://":"http://",ke=W==null?void 0:W.value;return`${ce}${ke}`}).filter(Boolean);return we==null?void 0:we[0]}e.getAppUrl=J;const se=te=>{te&&(D(te,we=>{we.status=(0,s.fromBlockletStatus)(we.status),we.source!==void 0&&(we.source=(0,s.fromBlockletSource)(we.source))}),te.settings&&(te.settings.children||[]).forEach(we=>{D(we,$e=>{$e.status=(0,s.fromBlockletStatus)($e.status),$e.source!==void 0&&($e.source=(0,s.fromBlockletSource)($e.source))})}))};e.fixBlockletStatus=se;const pe=te=>{if(!te)return null;const we=te.meta||te||{},{interfaces:$e=[]}=we;return Array.isArray($e)?$e.find(De=>De.type===s.BLOCKLET_INTERFACE_TYPE_WEB):null};e.findWebInterface=pe;const be=te=>{if(!te)return null;const we=pe(te),{ports:$e}=te;return!we||!$e?null:$e[we.port]};e.findWebInterfacePort=be;const Re=(te,we)=>{const $e=[we];we===c.AUTH&&$e.push(c.AUTH_SERVICE);const De=pe(te);return De?(De.services||[]).find(re=>$e.includes(re.name)):null};e.findServiceFromMeta=Re;const H=te=>{if(!te)return d.ALL;if((0,n.default)(te,"settings.whoCanAccess"))return te.settings.whoCanAccess;const we=Re(te.meta,c.AUTH);return(0,n.default)(we,"config.whoCanAccess")?we.config.whoCanAccess:d.ALL};e.getWhoCanAccess=H;const $=(te,we)=>{const $e=(te.configs||[]).find(re=>re.key===s.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO);if($e)return $e.value;if(we&&(0,n.default)(we,"settings.whoCanAccess")&&(0,n.default)(we,"settings.whoCanAccess")!==d.ALL)return(0,n.default)(we,"settings.whoCanAccess");const De=Re(te.meta,c.AUTH);return(0,n.default)(De,"config.whoCanAccess")?De.config.whoCanAccess:d.ALL};e.getComponentWhoCanAccess=$;const X=({request:te,baseUrl:we})=>{const $e=te.headers["x-blocklet-did"]||"",De=te.headers["x-blocklet-real-did"]||"",re=te.headers["x-path-prefix"]||"/",q=te.headers["x-group-path-prefix"]||"/";let W=we;return $e!==De&&re!==q&&(W=(0,i.joinURL)(W,"/").replace(re,q)),W};e.getConnectAppUrl=X;const Y=(te,we)=>{const $e=(we||"").includes(":")?":":/\./;return(te||"").replace(u,(we||"").replace(new RegExp($e,"g"),"-"))};e.replaceSlotToIp=Y;const oe=te=>{const we=Object.entries(s.CHAIN_INFO_CONFIG).reduce(($e,De)=>{const[re,[q,W]]=De;return $e[q]=(0,n.default)(te,re)||W,$e},{});return we.type==="ethereum"&&we.id==="none"&&(we.id="1"),we};e.getChainInfo=oe;const Te=te=>{const we=oe({});if(!te)return we;const $e=oe(te.configObj);if($e.host!=="none")return $e;let De;return M(te,re=>{if(De&&De.host!=="none")return;const q=oe(re.configObj);q.host!=="none"&&(De=q)}),De||we};e.getBlockletChainInfo=Te;const me=te=>!!(te!=null&&te.controller);e.isExternalBlocklet=me;const le=te=>te.whoCanAccess.startsWith(p)?te.whoCanAccess.substring(p.length).split(","):[];e.getRolesFromAuthConfig=le;const ve=te=>{const we=Array.isArray(te.migratedFrom)?te.migratedFrom.map($e=>$e.appDid):[];return(0,r.default)([te.appDid,te.appPid,...we].filter(Boolean))};e.getBlockletAppIdList=ve;const _e=te=>{const we=[];return te&&D(te,$e=>{var re;(((re=$e.meta)==null?void 0:re.interfaces)||[]).filter(q=>q.type===s.BLOCKLET_INTERFACE_TYPE_SERVICE).forEach(q=>{const W=q.port||{};we.push({name:q.name,protocol:q.protocol,port:Number(W.external),upstreamPort:Number(($e.ports||{})[W.internal])})})}),we};e.getBlockletServices=_e;const Se=te=>[s.BlockletStatus.downloading,s.BlockletStatus.waiting,s.BlockletStatus.starting,s.BlockletStatus.installing,s.BlockletStatus.stopping,s.BlockletStatus.upgrading,"downloading","waiting","starting","installing","extracting","stopping","upgrading","restarting","deleting"].includes(te);e.isInProgress=Se;const ze=te=>[s.BlockletStatus.added,s.BlockletStatus.waiting,s.BlockletStatus.downloading,s.BlockletStatus.installing,"added","waiting","downloading","installing"].includes(te);e.isBeforeInstalled=ze;const Je=te=>[s.BlockletStatus.running,"running"].includes(te);e.isRunning=Je;const ge=te=>[s.BlockletStatus.running,s.BlockletStatus.waiting,s.BlockletStatus.downloading,"running","waiting","downloading"].includes(te);e.isAccessible=ge;const Ie=(te,{type:we,did:$e}={type:"",did:""})=>{var De,re,q;return te?!(0,l.hasStartEngine)(te.meta)&&((q=(re=(De=te.meta)==null?void 0:De.resource)==null?void 0:re.bundles)==null?void 0:q.length)>0&&(te.meta.resource.bundles||[]).some(W=>W.type===we&&W.did===$e):!1};e.hasResourceType=Ie,e.default={isFreeBlocklet:k,isFreeComponent:C,forEachBlocklet:x,forEachBlockletSync:D,forEachChild:V,forEachChildSync:M,forEachComponentV2:O,forEachComponentV2Sync:P,isDeletableBlocklet:v,getSharedConfigObj:f,getAppMissingConfigs:_,getComponentMissingConfigs:R,isEnvShareableToClient:N,isEnvShareable:T,wipeSensitiveData:E,hasRunnableComponent:L,getAppName:ne,getAppDescription:F,getAppUrl:J,getDisplayName:ne,fixBlockletStatus:se,findWebInterface:pe,findWebInterfacePort:be,findServiceFromMeta:Re,getWhoCanAccess:H,getComponentWhoCanAccess:$,replaceSlotToIp:Y,getComponentId:g,getComponentName:y,getComponentBundleId:b,findComponent:j,findComponentById:G,findComponentV2:ie,findComponentByIdV2:ue,filterComponentsV2:K,getParentComponentName:A,getConnectAppUrl:X,getChainInfo:oe,getBlockletChainInfo:Te,isExternalBlocklet:me,isPreferenceKey:h,getRolesFromAuthConfig:le,getBlockletServices:_e,isInProgress:Se,isBeforeInstalled:ze,isRunning:Je,isAccessible:ge,isGatewayBlocklet:l.isGatewayBlocklet,isPackBlocklet:l.isPackBlocklet,hasStartEngine:l.hasStartEngine,hasResourceType:Ie}})(Ss);const Hle=(e,t=!1)=>{const n=e.routing.adminPath;return t?encodeURIComponent(Ln(window.location.origin,n)):Ln(window.location.origin,n)},B_t=(e,t,n)=>{const r=Hle(t),i=Ln(n,`/api/blocklets/${e.did}/blocklet.json`),o=new URL(Ln(r,"/launch-blocklet/agreement"));return o.searchParams.set("blocklet_meta_url",i),o.searchParams.set("from",window.location.href),o.href},dCt=async(e,{getIP:t}={})=>{if(!e||!e.length)return[];if(!t||!e.some(r=>r.value.includes(rn.SLOT_FOR_IP_DNS_SITE)))return e;const n=await t();return n?e.map(r=>{try{return r.value=Ss.replaceSlotToIp(r.value,n),r}catch{return r}}).filter(Boolean):e},pCt=e=>{const t={didSpace:null};return Ss.forEachBlockletSync(e,n=>{var r,i;t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP||(i=(r=n==null?void 0:n.meta)==null?void 0:r.capabilities)!=null&&i.didSpace&&(t.didSpace=n.meta.capabilities.didSpace)}),t},_W=async(e,{fixRuntime:t=!0,oldBlocklet:n,getIP:r}={})=>{if(e.site||(e.site={domainAliases:[],rules:[]}),e.site.rules.forEach(i=>{i.from.pathPrefix=G9(i.from.pathPrefix||"/")}),e.site.rules=cie(e.site.rules,i=>i.from.pathPrefix),t===!0)e.site.domainAliases=await dCt(e.site.domainAliases,{getIP:r}),e.appRuntimeInfo&&(e.appRuntimeInfo.startAt=new Date-e.appRuntimeInfo.uptime),Ss.forEachBlockletSync(e,i=>{i.runtimeInfo&&(i.runtimeInfo.startAt=new Date-i.runtimeInfo.uptime)});else if(t==="merge-old"&&n){e.site.domainAliases=n.site.domainAliases,e.appRuntimeInfo=n.appRuntimeInfo;const i={};Ss.forEachBlockletSync(n,(o,{id:a})=>{i[a]=o}),Ss.forEachBlockletSync(e,(o,{id:a})=>{const s=i[a];s&&(o.runtimeInfo=s.runtimeInfo,o.diskInfo=s.diskInfo,o.engine=s.engine)})}else e.site.domainAliases=[];e.capabilities=pCt(e)},EW="arcblock",N_t=(e,t=!1)=>{let n;return t?(n=(e.configs||[]).find(r=>r.key==="BLOCKLET_APP_CHAIN_TYPE"),n&&n.value||(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.key)),n&&n.value)?n.value:EW):(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.name)),n&&n.default?n.default:EW)},$_t=e=>!Ok(e==null?void 0:e.controller);let PC=null;const hCt=async()=>{const e=window.env.apiPrefix||"/",t=Ln(e,"/api/dns-resolve?accessible=1");try{return(await Ir.get(t)).data.address}catch{return null}},RW=()=>(PC||(PC=hCt()),PC),Wle=U.createContext({}),{Provider:mCt,Consumer:F_t}=Wle,kW=(e,t,n)=>n?e.map(r=>{const i={...r},o=t.find(a=>a.meta.did===r.meta.did);return o&&n.forEach(a=>{i[a]=o[a]}),i}):t;function gCt({children:e}){const t=Sl(),n=i5(),[r,i]=U.useState(null),[o,a]=U.useState(!1),[s,l]=U.useState([]),[c,u]=U.useState([]),[d,p]=U.useState(!1),g=(P,V)=>{Ss.isExternalBlocklet(P)?u(V):l(V)},y=4,b=async({silent:P=!0,retries:V=y,updates:M,useCache:j=!0}={})=>{P||a(!0);try{i(null);const{blocklets:G}=await n.getBlocklets({input:{useCache:j}});for(const K of G)await _W(K,{getIP:RW});const ie=G.filter(K=>!Ss.isExternalBlocklet(K)),ue=G.filter(Ss.isExternalBlocklet);l(K=>kW(K,ie,M)),u(K=>kW(K,ue,M)),a(!1),p(!0)}catch(G){V>0?setTimeout(()=>b({silent:P,retries:V-1,useCache:j}),1e3):(a(!1),i(G))}},A=async P=>{try{const{blocklet:V}=await t.api.getBlocklet({input:{did:P.meta.did,attachRuntimeInfo:!0}});await _W(V,{getIP:RW}),g(V,M=>M.some(j=>j.meta.did===V.meta.did)?M.map(j=>j.meta.did===V.meta.did?V:j):[...M,V])}catch(V){i(V)}},x=P=>{t.refresh(),A(P)};U.useEffect(()=>{b({silent:!1})},[]);const D=P=>{const V={};Ss.forEachBlockletSync(P,(M,{id:j})=>{V[j]=ti.fromBlockletStatus(M.status)}),g(P,M=>M.map(j=>(j.meta.did===P.meta.did&&Ss.forEachBlockletSync(j,(G,{id:ie})=>{V[ie]&&(G.status=V[ie])}),j)))};Ki(ti.BlockletEvents.added,P=>{P.status=ti.fromBlockletStatus(P.status),g(P,V=>[...V,P])}),Ki(ti.BlockletEvents.removed,P=>{t.refresh(),g(P,V=>V.filter(M=>M.meta.did!==P.meta.did))}),Ki(ti.BlockletEvents.statusChange,D),Ki(ti.BlockletEvents.installed,x),Ki(ti.BlockletEvents.upgraded,x),Ki(ti.BlockletEvents.updated,A),Ki(ti.BlockletEvents.startFailed,A),Ki(ti.BlockletEvents.reloaded,A);const O={loading:o,error:r,data:s,externalData:c,refresh:b,initialized:d,api:n};return I.jsx(mCt,{value:{blocklets:O},children:e})}function U_t(){const{blocklets:e}=U.useContext(Wle);return e}const yCt=({user:e,launchType:t,nftId:n})=>{var r;if(!e)return!1;if(t==="serverless"){if(!n)throw new Error("nftId is required");return((r=e==null?void 0:e.controller)==null?void 0:r.nftId)===n}return(e.permissions||[]).includes("mutate_blocklets")},j_t=e=>{var t,n;return e.isGetBlocklet&&((n=(t=e.runtimeBlocklet)==null?void 0:t.controller)==null?void 0:n.consumedAt)},q_t=async e=>{const t=bdt({blocklet:e});let n="";return n=t.find(r=>{try{const{hostname:i}=new URL(r);return koe.isSlpDomain(i)}catch(i){return console.error(i),!1}}),n||(n=await Sdt(t)),n},Gle=U.createContext({}),{Provider:vCt,Consumer:V_t}=Gle;function bCt({children:e}){const{session:t}=y0(),{t:n}=fo(),{api:r,info:i}=Sl(),[o]=BJ(),a=i5(),s=o.get("launchType"),l=o.get("fromLauncher"),c=o.get("blocklet_meta_url")||"",u=o.get("nftId")||"",d=o.get("launcherSessionId")||"",p=o.get("launcherUrl")||"",g=new URL(c).origin,[y,b]=U.useState({meta:null,appDid:o.get("appDid")||null,sessionId:o.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null}),A=(ue,K)=>b(N=>({...N,appDid:ue,sessionId:K})),x=yCt({user:t.user,launchType:s,nftId:u}),[D,O]=U.useState(null),[P,V]=U.useState(!0),M=U.useMemo(()=>i?Hle(i):"",[i]),j=async ue=>{if(!ue)throw new Error("appDid should not be empty");const{blocklet:K}=await r.getBlocklet({input:{did:ue,attachConfig:!1}});if(!K)return null;const N=ti.BlockletStatus[K.status],T=!!u,f=N<ti.BlockletStatus.installed,h=N===ti.BlockletStatus.installed,w=N===ti.BlockletStatus.running;return b(_=>({..._,isInstalled:h,isRunning:w,isExternal:T,isInstalling:f})),{isInstalled:h,isRunning:w,isExternal:T,isInstalling:f}},G=async()=>{V(!0);try{if(!c)throw new Error(n("common.invalidParam"));const[{meta:ue,isFree:K},{launcherSession:N,error:T}]=await Promise.all([r.getBlockletMetaFromUrl({input:{url:c,checkPrice:!0}}),d?r.getLauncherSession({input:{launcherSessionId:d,launcherUrl:p}}):Promise.resolve({})]);if(d&&!N)throw new Error(`Launch session invalid: ${T}`);if(!ue)throw new Error(n("LaunchBlockletBlocklet.error.loadMetaFailed"));let f={};x&&y.appDid&&(f=await j(y.appDid)),b(h=>({...h,...f,meta:ue,isFree:K,launcherSession:N}))}catch(ue){console.error(ue),O(ue.message)}finally{V(!1)}};U.useEffect(()=>{var ue,K,N;((ue=t==null?void 0:t.user)==null?void 0:ue.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&((N=(K=t==null?void 0:t.user)==null?void 0:K.controller)==null?void 0:N.nftId)!==u&&t.logout(),G()},[]),U.useEffect(()=>{P||!y.meta||(x?y.appDid&&j(y.appDid).catch(ue=>{ci.error(ue.message)}):(b(ue=>({...ue,isInstalled:!1,isRunning:!1,isExternal:!1})),O(null)))},[x]);const ie={meta:y.meta,isFree:y.isFree,appDid:y.appDid,sessionId:y.sessionId,isInstalling:y.isInstalling,isInstalled:y.isInstalled,isExternal:y.isExternal,isRunning:y.isRunning,serverUrl:M,storeUrl:g,blockletMetaUrl:c,fromLauncher:l,loading:P,error:D,api:a,getBlocklet:j,setAppDid:A,launcherUrl:p,launcherSession:y.launcherSession,launcherSessionId:d};return I.jsx(vCt,{value:ie,children:e})}function z_t(){return U.useContext(Gle)}function Kle(){return new URLSearchParams(yi().search)}const Jle=U.createContext(),{Provider:wCt,Consumer:H_t}=Jle;function Yle({children:e}){const n=Kle().get("blocklet_meta_url"),r=S8t(async()=>{const{data:o}=await W9.get(n);return o});if(r.loading)return I.jsx(Qo,{children:I.jsx(ra,{})});const i={meta:r.value,error:r.error};return I.jsx(wCt,{value:i,children:e})}Yle.propTypes={children:Z.any.isRequired};function W_t(){return U.useContext(Jle)}const TCt=U.lazy(()=>gn(()=>import("./index-JuXoqefL.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),xCt=U.lazy(()=>gn(()=>import("./index-CBFgpWWt.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,2,27,28,29,30]),import.meta.url)),SCt=U.lazy(()=>gn(()=>import("./index-BysoAAKf.js"),__vite__mapDeps([31,32,33,34,35,36,37,6,38,39,40,41,12,9,11,25,18,17]),import.meta.url)),CCt=U.lazy(()=>gn(()=>import("./index-Dw6syXvl.js"),__vite__mapDeps([42,6,43,44,17,16,45,9,46,47,29,12,11,38,48,39,49,3,18,22,23,50,51,52]),import.meta.url)),ACt=U.lazy(()=>gn(()=>import("./index-oWv9ehU5.js"),__vite__mapDeps([53,54,10,51,55,56,45,57,12,9,11,7,8,13,14,15,16,17,18,58,49,3,2,59,6,60,61,29,19,20,62,63,64,65,4,66]),import.meta.url)),_Ct=U.lazy(()=>gn(()=>import("./index-CBQDge9H.js"),__vite__mapDeps([67,68,22,23,9,69]),import.meta.url)),ECt=U.lazy(()=>gn(()=>import("./index-Cqf3kTsw.js"),__vite__mapDeps([70,54,10,71,72,73,17,6,9,11,74,13,75,76,29,77,78,79,16,12,7,8,14,15,18,80,81,82,45,20,83,3,2,84,85,30,22,23,86,87,88,24,25,44,46,89,1,49,64]),import.meta.url)),RCt=U.lazy(()=>gn(()=>import("./detail-ByJGw6CQ.js").then(e=>e.d),__vite__mapDeps([90,54,10,19,20,21,6,18,22,23,28,83,40,41,52]),import.meta.url)),kCt=U.lazy(()=>gn(()=>import("./index-CaM460rw.js"),[],import.meta.url)),DCt=U.lazy(()=>gn(()=>import("./index-DB54SdYK.js"),__vite__mapDeps([91,1,74,13]),import.meta.url)),LCt=U.lazy(()=>gn(()=>import("./index-CDk9gqwO.js"),__vite__mapDeps([92,93,94,95,62,96]),import.meta.url)),OCt=U.lazy(()=>gn(()=>import("./index-DINuwc4O.js"),__vite__mapDeps([97,62,78,48,96,27]),import.meta.url)),ICt=U.lazy(()=>gn(()=>import("./index-DrZqlcHr.js"),__vite__mapDeps([98,96]),import.meta.url)),PCt=U.lazy(()=>gn(()=>import("./index-edI690Jp.js"),__vite__mapDeps([99,32,33,34,35,36,37,100,72,73,41,25,6,59]),import.meta.url)),MCt=U.lazy(()=>gn(()=>import("./index-C5VGS0or.js"),__vite__mapDeps([101,94]),import.meta.url)),BCt=U.lazy(()=>gn(()=>import("./index-BO1T0fz0.js"),__vite__mapDeps([102,93,94,95,62,96]),import.meta.url)),NCt=U.lazy(()=>gn(()=>import("./index-CzxambID.js").then(e=>e.a2),__vite__mapDeps([103,104]),import.meta.url)),$Ct=U.lazy(()=>gn(()=>import("./index-CBcjH65j.js"),__vite__mapDeps([105,54,10,106,107,108,63,9,109,12,11,46,7,8,13,14,15,16,17,18,28,110,111,4,6,89,23]),import.meta.url));function Zle(){const e=Sl(),{session:t}=y0(),{wallet:n}=Vh(),r=t.user&&t.user.did;return U.useEffect(()=>{const i=f5();return r?i.connect():i.isConnected()&&i.disconnect(),()=>{i.isConnected()&&i.disconnect()}},[r]),U.useEffect(()=>{if(n)return()=>{};const i=()=>{document.visibilityState==="visible"&&t.refresh()};return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i)}},[]),{node:e,session:t}}function FCt(){var a;const{t:e}=fo(),{node:t,session:n}=Zle(),r=yi();U.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${r.pathname}${r.search}`)},[r]),U.useEffect(()=>{var s;((s=n==null?void 0:n.user)==null?void 0:s.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&n.logout()},[(a=n==null?void 0:n.user)==null?void 0:a.role]);const i=I.jsx(ra,{});if(t.loading||n.loading)return I.jsx(Qo,{children:i});if(!t.info.initialized)return b8e.getServerAuthMethod(t.info)==="nft"?I.jsx(YL,{action:"verify-owner"}):I.jsx(Qo,{children:I.jsx(m6t,{})});if(t.info.upgradeSessionId)return I.jsx(Qo,{children:I.jsx(Nse,{})});if(!n.user)return I.jsx(XL,{loadingEle:i});const o=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(Q8t,{children:I.jsxs(gCt,{children:[I.jsx(C6t,{}),I.jsx(OTt,{}),I.jsx(nCt,{}),I.jsx(U.Suspense,{fallback:o,children:I.jsxs(A4,{children:[I.jsx(or,{path:"/dashboard",element:I.jsx(Ko,{fullWidth:!0,title:"Dashboard",children:I.jsx(TCt,{})})}),I.jsx(or,{path:"/blocklets",element:I.jsx(Ko,{fullWidth:!0,title:e("common.blocklets"),children:I.jsx(xCt,{})})}),I.jsx(or,{path:"/blocklets/:did/:tab",element:I.jsx(Ko,{fullWidth:!0,title:"Blocklets",children:I.jsx(RCt,{})})}),I.jsx(or,{path:"/settings/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.setting"),children:I.jsx(ACt,{})})}),I.jsx(or,{path:"/eula",element:I.jsx(Ko,{fullWidth:!0,title:e("setup.steps.eula"),children:I.jsx(kCt,{})})}),I.jsx(or,{path:"/store",element:I.jsx(Ko,{fullWidth:!0,title:e("common.store"),children:I.jsx(CCt,{})})}),I.jsx(or,{path:"/console",element:I.jsx(Ko,{title:`GraphQL ${e("common.console")}`,scrollable:!1,fullWidth:!0,children:I.jsx(NCt,{})})}),I.jsx(or,{path:"/notifications",element:I.jsx(Ko,{children:I.jsx(DCt,{})})}),I.jsx(or,{path:"/team/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.team"),children:I.jsx(ECt,{})})}),I.jsx(or,{path:"/logs/:name",element:I.jsx(Ko,{scrollable:!1,fullWidth:!0,title:e("common.logs"),children:I.jsx(_Ct,{})})}),I.jsx(or,{path:"/analytics/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.analytics"),children:I.jsx($Ct,{})})}),I.jsx(or,{path:"/",element:I.jsx(Gs,{to:"/dashboard",replace:!0})}),I.jsx(or,{path:"/team",element:I.jsx(Gs,{to:"/team/members",replace:!0})}),I.jsx(or,{path:"/analytics",element:I.jsx(Gs,{to:"/analytics/traffic",replace:!0})}),I.jsx(or,{path:"/logs",element:I.jsx(Gs,{to:"/logs/abtnode",replace:!0})}),I.jsx(or,{path:"/router",element:I.jsx(Gs,{to:"/router/rules",replace:!0})}),I.jsx(or,{path:"/settings",element:I.jsx(Gs,{to:"/settings/basic",replace:!0})}),I.jsx(or,{path:"/marketplace",element:I.jsx(Gs,{to:"/store",replace:!0})}),I.jsx(or,{path:"/marketplace/:did",element:I.jsx(Gs,{to:"/store/:did",replace:!0})}),I.jsx(or,{path:"*",element:I.jsx(MCt,{})})]})})]})})}function Jc({children:e}){const{node:t,session:n}=Zle();return t.loading||!n.initialized&&n.loading?I.jsx(Qo,{children:I.jsx(ra,{})}):t.info.upgradeSessionId?I.jsx(Qo,{children:I.jsx(Nse,{})}):e}function UCt(){const{changeLocale:e}=fo(),t=Kle();U.useEffect(()=>{const r=t.get("locale");r&&["zh","en"].includes(r)&&e(r)},[]);const n=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(U.Suspense,{fallback:n,children:I.jsxs(A4,{children:[I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:I.jsx(Jc,{children:I.jsx(LCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:I.jsx(Jc,{children:I.jsx(OCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:I.jsx(Jc,{children:I.jsx(ICt,{})})}),I.jsx(or,{path:"/accept-server",element:I.jsx(Jc,{children:I.jsx(YL,{action:"accept-server"})})}),I.jsx(or,{path:"/launch-blocklet/*",element:I.jsx(Jc,{children:I.jsx(bCt,{children:I.jsx(PCt,{})})})}),I.jsx(or,{path:"/blocklets/restore/*",element:I.jsx(Jc,{children:I.jsx(Yle,{children:I.jsx(SCt,{})})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:I.jsx(Jc,{children:I.jsx(BCt,{})})}),I.jsx(or,{path:"/*",element:I.jsx(FCt,{})})]})})}function jCt(){const e=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return I.jsxs(I.Fragment,{children:[I.jsx($7,{}),I.jsx(OJ,{history:X8e,basename:e,children:I.jsx(VTt,{children:I.jsx(UCt,{})})})]})}const qCt=WK(document.getElementById("root"));qCt.render(I.jsx(jCt,{}));const DW=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";wge(`${DW}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:DW},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});export{Hp as $,ci as A,ks as B,ra as C,QD as D,BJ as E,rn as F,gx as G,Ps as H,SO as I,Tat as J,Yct as K,DX as L,Ss as M,cl as N,ft as O,Z as P,Ok as Q,ND as R,B1 as S,Lle as T,y5 as U,Qo as V,oO as W,Ac as X,Ave as Y,OD as Z,Qst as _,Ki as a,wk as a$,rL as a0,Ln as a1,to as a2,_6 as a3,kTt as a4,S_t as a5,s9e as a6,bk as a7,m9e as a8,IX as a9,dle as aA,Tdt as aB,zle as aC,R9e as aD,dCt as aE,G9 as aF,cie as aG,RW as aH,XAt as aI,joe as aJ,fa as aK,co as aL,X8e as aM,vdt as aN,sk as aO,KAt as aP,Lke as aQ,l_t as aR,S8t as aS,W9 as aT,YAt as aU,g_t as aV,ydt as aW,AX as aX,yX as aY,tLe as aZ,ZAt as a_,Hle as aa,W_t as ab,b8e as ac,iO as ad,nL as ae,q_t as af,DAt as ag,j_t as ah,f5 as ai,Kle as aj,o_t as ak,GO as al,KL as am,x7 as an,A4 as ao,or as ap,Gs as aq,cu as ar,yl as as,$V as at,B_t as au,Ir as av,y0 as aw,Io as ax,c_t as ay,T6 as az,ti as b,NA as b$,NRe as b0,JRe as b1,wdt as b2,m_t as b3,xle as b4,xCe as b5,hct as b6,Iw as b7,Pw as b8,jX as b9,sie as bA,zg as bB,PXe as bC,Wre as bD,JD as bE,sle as bF,HAt as bG,L_t as bH,FAt as bI,s_t as bJ,Zte as bK,ua as bL,kt as bM,mc as bN,ye as bO,Ybe as bP,Bt as bQ,un as bR,an as bS,hn as bT,fl as bU,Pt as bV,sn as bW,fu as bX,d7e as bY,ht as bZ,Gn as b_,en as ba,Hr as bb,Wu as bc,uh as bd,a_t as be,B6 as bf,bJ as bg,Yo as bh,qX as bi,G1 as bj,T_t as bk,Cie as bl,N_t as bm,iQ as bn,gn as bo,zAt as bp,mRe as bq,IJ as br,x_t as bs,GD as bt,Uh as bu,Og as bv,pre as bw,hre as bx,KD as by,r9 as bz,i5 as c,fw as c$,B7 as c0,$r as c1,M7 as c2,sAt as c3,MAt as c4,bdt as c5,koe as c6,ile as c7,p_t as c8,D6 as c9,_f as cA,yi as cB,CD as cC,pi as cD,VAt as cE,UAt as cF,jAt as cG,rle as cH,FTt as cI,tk as cJ,gi as cK,oAt as cL,wm as cM,Np as cN,Zut as cO,mt as cP,Jne as cQ,zCt as cR,cAt as cS,_ct as cT,V6 as cU,I8t as cV,pbe as cW,b_t as cX,Ya as cY,P7 as cZ,dc as c_,_W as ca,SRe as cb,ARe as cc,Adt as cd,T9e as ce,XEe as cf,Ule as cg,eCt as ch,NOe as ci,Ct as cj,GLe as ck,Or as cl,dh as cm,nu as cn,mi as co,Vh as cp,_g as cq,Ku as cr,S6t as cs,d5 as ct,z_t as cu,hGe as cv,yCt as cw,f_t as cx,Sdt as cy,i_t as cz,U_t as d,YCt as d$,$a as d0,Ai as d1,Rt as d2,hX as d3,FEe as d4,Ba as d5,OAt as d6,IAt as d7,PD as d8,Uke as d9,yu as dA,L9 as dB,SZe as dC,Vie as dD,JAt as dE,jEe as dF,s3 as dG,K4e as dH,cc as dI,_o as dJ,zY as dK,bwe as dL,Rw as dM,rs as dN,zh as dO,Lw as dP,Hh as dQ,N7 as dR,AY as dS,L4e as dT,I4e as dU,jve as dV,tY as dW,mg as dX,ZCt as dY,QCt as dZ,XCt as d_,M1 as da,c3 as db,MX as dc,q9e as dd,J$ as de,K$ as df,N9e as dg,yAt as dh,dn as di,GCt as dj,WCt as dk,HCt as dl,KCt as dm,Rh as dn,kD as dp,L6 as dq,ad as dr,Hg as ds,cJe as dt,CZ as du,Jn as dv,aAt as dw,Wp as dx,AZ as dy,Qt as dz,_8t as e,Y4 as e$,Xbe as e0,ug as e1,Dh as e2,RN as e3,JCt as e4,$f as e5,E3e as e6,S7 as e7,XY as e8,rAt as e9,OEe as eA,wv as eB,wRe as eC,hx as eD,g7e as eE,xm as eF,Oke as eG,k9e as eH,f3 as eI,nLe as eJ,em as eK,SLe as eL,Wl as eM,Xb as eN,Zb as eO,NLe as eP,LLe as eQ,bAt as eR,Yre as eS,Ls as eT,T_ as eU,F7 as eV,xY as eW,RX as eX,LGe as eY,Lh as eZ,qY as e_,eAt as ea,l4e as eb,fc as ec,BY as ed,I3e as ee,c4e as ef,nAt as eg,BA as eh,o4e as ei,s4e as ej,vl as ek,u4e as el,Wbe as em,lw as en,Mwe as eo,tAt as ep,Dwe as eq,jc as er,SCe as es,pAt as et,eAe as eu,tAe as ev,vAe as ew,hAt as ex,tr as ey,Tp as ez,Ec as f,ay as f$,hg as f0,_7 as f1,p3 as f2,tF as f3,jf as f4,fi as f5,Bot as f6,$o as f7,a0 as f8,tn as f9,t_t as fA,PAt as fB,r_t as fC,Aie as fD,hoe as fE,t6t as fF,p9 as fG,tse as fH,Uoe as fI,vw as fJ,T2t as fK,iie as fL,Q4e as fM,QY as fN,U7 as fO,Kn as fP,Ew as fQ,n9e as fR,Y7 as fS,d8e as fT,$O as fU,uAt as fV,qO as fW,jO as fX,I6 as fY,EAt as fZ,RO as f_,Eg as fa,Hf as fb,UOe as fc,WK as fd,Kh as fe,Xn as ff,bee as fg,gee as fh,Sw as fi,Xct as fj,kY as fk,cw as fl,l3 as fm,i7 as fn,tQ as fo,VQ as fp,v6t as fq,qAt as fr,nI as fs,rQ as ft,VCt as fu,pc as fv,CYe as fw,_c as fx,QAt as fy,ud as fz,Kt as g,Sh as g$,IO as g0,UWe as g1,Gh as g2,Tle as g3,A6 as g4,lot as g5,bot as g6,qte as g7,Sk as g8,Zrt as g9,Hct as gA,ID as gB,$_t as gC,v_t as gD,GAt as gE,e_t as gF,n_t as gG,R6 as gH,Tre as gI,xre as gJ,wre as gK,Pre as gL,WY as gM,e3 as gN,cAe as gO,dbe as gP,f5t as gQ,y5t as gR,w5t as gS,C5t as gT,E5t as gU,lTt as gV,uTt as gW,Vse as gX,zse as gY,MVe as gZ,Ktt as g_,wie as ga,Kf as gb,E6 as gc,L1 as gd,kw as ge,mx as gf,Dw as gg,YAe as gh,bX as gi,hCe as gj,ZZ as gk,cve as gl,WAt as gm,d_t as gn,Lxt as go,Sg as gp,lCe as gq,Cw as gr,dre as gs,H7 as gt,mSe as gu,W7 as gv,yct as gw,K7 as gx,$At as gy,oCt as gz,rO as h,q1 as h0,jVe as h1,BAt as h2,TAt as h3,y_t as h4,sV as h5,Zm as h6,GOe as h7,aQ as h8,d3 as h9,RAt as hA,Act as hB,O_t as hC,wX as hD,mot as hE,e9 as hF,LOe as hG,E_t as hH,__t as hI,nQ as hJ,Ite as hK,P_t as hL,mX as hM,wAt as ha,N1 as hb,iAt as hc,wwe as hd,dAt as he,mCe as hf,yRe as hg,bDe as hh,hDe as hi,mAt as hj,wDe as hk,gAt as hl,z9e as hm,vAt as hn,D5t as ho,KA as hp,YA as hq,$se as hr,X4e as hs,LD as ht,hN as hu,u_t as hv,Ibt as hw,w_t as hx,h_t as hy,mH as hz,ch as i,I as j,Tf as k,NAt as l,Xt as m,Ka as n,q6 as o,jE as p,fo as q,U as r,er as s,F8t as t,Sl as u,R8t as v,ake as w,C9 as x,tL as y,xc as z};
|
|
2521
|
+
`;Ri.homedir=function(){return"/"};(function(e){var t=mt&&mt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.hasMountPoint=e.hasStartEngine=e.isPackBlocklet=e.isGatewayBlocklet=e.getBlockletEngine=void 0;const n=t(Ri),r=ti,i=c=>{if(c===void 0)throw new Error("blocklet meta param is required");const{engine:u}=c;if(!u)return{interpreter:"node",source:""};if(!Array.isArray(u))return u;const d=n.default.platform(),p=u.find(g=>g.platform===d);if(!p)throw new Error(`can not find a proper engine interpreter on ${d}`);return p};e.getBlockletEngine=i;const o=c=>(c==null?void 0:c.group)===r.BlockletGroup.gateway;e.isGatewayBlocklet=o;const a=c=>(c==null?void 0:c.group)===r.BlockletGroup.pack;e.isPackBlocklet=a;const s=c=>!!(c!=null&&c.main)||(0,e.getBlockletEngine)(c||{}).interpreter==="blocklet";e.hasStartEngine=s;const l=c=>((0,e.hasStartEngine)(c)||((c==null?void 0:c.interfaces)||[]).find(u=>u.type===r.BLOCKLET_INTERFACE_TYPE_WEB))&&(0,e.isGatewayBlocklet)(c)===!1;e.hasMountPoint=l})(zle);(function(e){var t=mt&&mt.__importDefault||function(te){return te&&te.__esModule?te:{default:te}};Object.defineProperty(e,"__esModule",{value:!0}),e.isPackBlocklet=e.isGatewayBlocklet=e.isAccessible=e.isRunning=e.isBeforeInstalled=e.isInProgress=e.getBlockletServices=e.getBlockletAppIdList=e.getRolesFromAuthConfig=e.isPreferenceKey=e.isExternalBlocklet=e.getBlockletChainInfo=e.getChainInfo=e.getConnectAppUrl=e.getParentComponentName=e.filterComponentsV2=e.findComponentByIdV2=e.findComponentV2=e.findComponentById=e.findComponent=e.getComponentBundleId=e.getComponentName=e.getComponentId=e.replaceSlotToIp=e.getComponentWhoCanAccess=e.getWhoCanAccess=e.findServiceFromMeta=e.findWebInterfacePort=e.findWebInterface=e.fixBlockletStatus=e.getAppDescription=e.getDisplayName=e.getAppName=e.hasRunnableComponent=e.wipeSensitiveData=e.isEnvShareable=e.isEnvShareableToClient=e.getComponentMissingConfigs=e.getAppMissingConfigs=e.getSharedConfigObj=e.isDeletableBlocklet=e.forEachComponentV2Sync=e.forEachComponentV2=e.forEachChildSync=e.forEachChild=e.forEachBlockletSync=e.forEachBlocklet=e.isFreeComponent=e.isFreeBlocklet=e.getAppUrl=void 0,e.hasResourceType=e.hasStartEngine=void 0;const n=t(vw),r=t(Vle),i=oCt,o=t(fCt),a=t(rn),s=ti,l=zle;Object.defineProperty(e,"hasStartEngine",{enumerable:!0,get:function(){return l.hasStartEngine}}),Object.defineProperty(e,"isGatewayBlocklet",{enumerable:!0,get:function(){return l.isGatewayBlocklet}}),Object.defineProperty(e,"isPackBlocklet",{enumerable:!0,get:function(){return l.isPackBlocklet}});const{NODE_SERVICES:c,SLOT_FOR_IP_DNS_SITE:u,WHO_CAN_ACCESS:d,WHO_CAN_ACCESS_PREFIX_ROLES:p}=a.default,g=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.did:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.did:""}`;e.getComponentId=g;const y=(te,we=[])=>`${we.map($e=>$e&&$e.meta?$e.meta.name:"").join("/")}${we.length?"/":""}${te&&te.meta?te.meta.name:""}`;e.getComponentName=y;const b=te=>`${te.meta.bundleName}@${te.meta.version}`;e.getComponentBundleId=b;const A=te=>{if(!te)return"";const we=te.split("/");return we.pop(),!we.length||(we[we.length-1].startsWith("@")&&we.pop(),!we.length)?"":we.join("/")};e.getParentComponentName=A;const x=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re,params:q,_parent:W,_root:ce,_level:ke=0,_tasks:Ee,_ancestors:xe=[],_limit:Ue}={})=>{const je=ce||W||te,He=g(te,xe),lt=xe.concat(te);if(re){const Oe=we(te,{parent:W,root:je,level:ke,params:q,ancestors:xe,id:He});if(te.children)for(const Le of te.children)x(Le,we,{sync:re,params:Oe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});return null}if(!$e)return new Promise(async(Oe,Le)=>{try{const Pe=await we(te,{parent:W,root:je,level:ke,ancestors:xe,params:q,id:He});if(te.children)for(const nt of te.children)await x(nt,we,{params:Pe,_parent:te,_root:je,_level:ke+1,_ancestors:lt});Oe(null)}catch(Pe){Le(Pe)}});const Ze=Ue||(0,o.default)(De),Ye=Ee||[];if(Ye.push(Ze(()=>we(te,{parent:W,root:je,level:ke,ancestors:xe,id:He}))),te.children)for(const Oe of te.children)x(Oe,we,{parallel:$e,_parent:te,_root:je,_level:ke+1,_tasks:Ye,_ancestors:lt,_limit:Ze});return Ee?null:Promise.all(Ye)};e.forEachBlocklet=x;const D=(te,we)=>x(te,we,{sync:!0});e.forEachBlockletSync=D;const O=(te,we,{parallel:$e=!1,concurrencyLimit:De=5,sync:re}={})=>{if(re){if(te.children)for(const ce of te.children)we(ce);return null}if(!$e)return new Promise(async(ce,ke)=>{try{if(te.children)for(const Ee of te.children)await we(Ee);ce(null)}catch(Ee){ke(Ee)}});const q=(0,o.default)(De),W=[];if(te.children)for(const ce of te.children)W.push(q(()=>we(ce)));return Promise.all(W)};e.forEachComponentV2=O;const P=(te,we)=>O(te,we,{sync:!0});e.forEachComponentV2Sync=P;const V=(te,we,$e)=>x(te,(De,re)=>re.level===0?{}:we(De,re),$e);e.forEachChild=V;const M=(te,we)=>V(te,we,{sync:!0});e.forEachChildSync=M;const j=(te,we,{_ancestors:$e=[],returnAncestors:De=!1}={})=>{if(!we)return null;if(we(te,{ancestors:$e}))return De?{component:te,ancestors:$e}:te;for(const re of te.children||[]){const q=$e.concat(te),W=j(re,we,{_ancestors:q,returnAncestors:De});if(W)return W}return null};e.findComponent=j;const G=(te,we,{returnAncestors:$e=!1}={})=>(Array.isArray(we)&&(we=we.join("/")),j(te,(De,{ancestors:re})=>{const q=g(De,re);return we===q},{returnAncestors:$e}));e.findComponentById=G;const ie=(te,we)=>{if(!we)return null;for(const $e of te.children||[])if(we($e,te))return $e;return null};e.findComponentV2=ie;const ue=(te,we)=>we?(Array.isArray(we)&&(we=we.join("/")),ie(te,($e,De)=>{if(we.includes("/")){const re=g($e,[De]);return we===re}return we===$e.meta.did})):null;e.findComponentByIdV2=ue;const K=(te,we)=>{if(!we)return[];const $e=[];for(const De of te.children||[])we(De,te)&&$e.push(De);return $e};e.filterComponentsV2=K;const N=te=>!!te&&!!(te.key||te.name)&&!te.secure&&te.shared!==!1&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareableToClient=N;const T=te=>!!te&&!!(te.key||te.name)&&!te.secure&&!!te.shared&&!s.BLOCKLET_CONFIGURABLE_KEY[te.key||te.name];e.isEnvShareable=T;const f=(te,we)=>{const $e={};return!te||!we||(Array.isArray(te.configs)&&te.configs.forEach(({key:De,value:re,secure:q})=>{if(!T({key:De,secure:q,shared:!0}))return;const W=(te.configObj||{})[De]||re,ce=(we.configs||[]).find(ke=>ke.key===De);(!ce||T(ce)||!ce.value&&!(we.configObj||{})[ce.key])&&($e[De]=W)}),(te.configs||[]).forEach(({key:De,value:re})=>{[s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_HOST,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_ID,s.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_CHAIN_TYPE].includes(De)&&($e[s.CHAIN_PROP_MAP[De]]=re)})),$e};e.getSharedConfigObj=f;const h=te=>te.key.startsWith(s.BLOCKLET_PREFERENCE_PREFIX)===!0;e.isPreferenceKey=h;const w=(te,we)=>!!(te.required&&(!te.value&&!we[te.key]||Object.values(s.CHAIN_PROP_MAP).includes(te.key)&&Object.keys(we).includes(te.key)&&!we[te.key])),_=(te={})=>{const we=[];return P(te,$e=>{var q;if(((q=$e.meta)==null?void 0:q.group)===s.BlockletGroup.gateway)return;const De=$e.configs||[],re=f(te,$e);De.forEach(W=>{w(W,re)&&we.push({did:$e.meta.did,key:W.key,description:W.description})})}),we.filter($e=>!h($e))};e.getAppMissingConfigs=_;const R=(te={},we={})=>{const $e=[],De=te.configs||[],re=f(we,te);return De.forEach(q=>{w(q,re)&&$e.push({did:te.meta.did,key:q.key,description:q.description})}),$e};e.getComponentMissingConfigs=R;const k=te=>te.payment?(te.payment.price||[]).map($e=>$e.value||0).every($e=>$e===0):!0;e.isFreeBlocklet=k;const C=te=>!te.payment||!te.payment.componentPrice?!0:!te.payment.componentPrice.length;e.isFreeComponent=C;const E=te=>te&&(x(te,we=>{we.configs&&(we.configs=we.configs.filter($e=>!h($e)),we.configs.forEach($e=>{$e.secure&&($e.value=$e.value?"__encrypted__":"")})),(we.environments||[]).forEach($e=>{["BLOCKLET_APP_SK","BLOCKLET_APP_PSK"].includes($e.key)&&($e.value="__encrypted__")}),(we.migratedFrom||[]).forEach($e=>{$e.appSk="__encrypted__"}),delete te.configObj,delete te.environmentObj},{sync:!0}),te);e.wipeSensitiveData=E;const v=te=>{if(!te)return!1;const we=te.environments.find($e=>$e.key==="BLOCKLET_DELETABLE");return we?we.value==="yes":!0};e.isDeletableBlocklet=v;const L=te=>{let we=!1;return D(te,$e=>{$e.meta.group!==s.BlockletGroup.gateway&&(we=!0)}),we};e.hasRunnableComponent=L;const ne=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_NAME");re&&re.value&&(De=re.value)}return De||$e.title||$e.name};e.getAppName=ne,e.getDisplayName=ne;const F=(te,we=!1)=>{if(!te)return"";const{meta:$e}=te;let De;if(!we&&te.environments){const re=te.environments.find(q=>q.key==="BLOCKLET_APP_DESCRIPTION");re&&re.value&&(De=re.value)}return De||$e.description||$e.name};e.getAppDescription=F;function J(te){var De,re,q;const we=(q=(re=(De=te==null?void 0:te.site)==null?void 0:De.domainAliases)==null?void 0:re.sort((W,ce)=>{var ke,Ee,xe,Ue;return(ke=W.accessibility)!=null&&ke.accessible&&((Ee=ce.accessibility)!=null&&Ee.accessible)?+W.isProtected-+ce.isProtected:+((xe=ce.accessibility)==null?void 0:xe.accessible)-+((Ue=W.accessibility)==null?void 0:Ue.accessible)}))==null?void 0:q.map(W=>{var Ee;const ce=(Ee=W==null?void 0:W.domainStatus)!=null&&Ee.isHttps?"https://":"http://",ke=W==null?void 0:W.value;return`${ce}${ke}`}).filter(Boolean);return we==null?void 0:we[0]}e.getAppUrl=J;const se=te=>{te&&(D(te,we=>{we.status=(0,s.fromBlockletStatus)(we.status),we.source!==void 0&&(we.source=(0,s.fromBlockletSource)(we.source))}),te.settings&&(te.settings.children||[]).forEach(we=>{D(we,$e=>{$e.status=(0,s.fromBlockletStatus)($e.status),$e.source!==void 0&&($e.source=(0,s.fromBlockletSource)($e.source))})}))};e.fixBlockletStatus=se;const pe=te=>{if(!te)return null;const we=te.meta||te||{},{interfaces:$e=[]}=we;return Array.isArray($e)?$e.find(De=>De.type===s.BLOCKLET_INTERFACE_TYPE_WEB):null};e.findWebInterface=pe;const be=te=>{if(!te)return null;const we=pe(te),{ports:$e}=te;return!we||!$e?null:$e[we.port]};e.findWebInterfacePort=be;const Re=(te,we)=>{const $e=[we];we===c.AUTH&&$e.push(c.AUTH_SERVICE);const De=pe(te);return De?(De.services||[]).find(re=>$e.includes(re.name)):null};e.findServiceFromMeta=Re;const H=te=>{if(!te)return d.ALL;if((0,n.default)(te,"settings.whoCanAccess"))return te.settings.whoCanAccess;const we=Re(te.meta,c.AUTH);return(0,n.default)(we,"config.whoCanAccess")?we.config.whoCanAccess:d.ALL};e.getWhoCanAccess=H;const $=(te,we)=>{const $e=(te.configs||[]).find(re=>re.key===s.BLOCKLET_CONFIGURABLE_KEY.COMPONENT_ACCESS_WHO);if($e)return $e.value;if(we&&(0,n.default)(we,"settings.whoCanAccess")&&(0,n.default)(we,"settings.whoCanAccess")!==d.ALL)return(0,n.default)(we,"settings.whoCanAccess");const De=Re(te.meta,c.AUTH);return(0,n.default)(De,"config.whoCanAccess")?De.config.whoCanAccess:d.ALL};e.getComponentWhoCanAccess=$;const X=({request:te,baseUrl:we})=>{const $e=te.headers["x-blocklet-did"]||"",De=te.headers["x-blocklet-real-did"]||"",re=te.headers["x-path-prefix"]||"/",q=te.headers["x-group-path-prefix"]||"/";let W=we;return $e!==De&&re!==q&&(W=(0,i.joinURL)(W,"/").replace(re,q)),W};e.getConnectAppUrl=X;const Y=(te,we)=>{const $e=(we||"").includes(":")?":":/\./;return(te||"").replace(u,(we||"").replace(new RegExp($e,"g"),"-"))};e.replaceSlotToIp=Y;const oe=te=>{const we=Object.entries(s.CHAIN_INFO_CONFIG).reduce(($e,De)=>{const[re,[q,W]]=De;return $e[q]=(0,n.default)(te,re)||W,$e},{});return we.type==="ethereum"&&we.id==="none"&&(we.id="1"),we};e.getChainInfo=oe;const Te=te=>{const we=oe({});if(!te)return we;const $e=oe(te.configObj);if($e.host!=="none")return $e;let De;return M(te,re=>{if(De&&De.host!=="none")return;const q=oe(re.configObj);q.host!=="none"&&(De=q)}),De||we};e.getBlockletChainInfo=Te;const me=te=>!!(te!=null&&te.controller);e.isExternalBlocklet=me;const le=te=>te.whoCanAccess.startsWith(p)?te.whoCanAccess.substring(p.length).split(","):[];e.getRolesFromAuthConfig=le;const ve=te=>{const we=Array.isArray(te.migratedFrom)?te.migratedFrom.map($e=>$e.appDid):[];return(0,r.default)([te.appDid,te.appPid,...we].filter(Boolean))};e.getBlockletAppIdList=ve;const _e=te=>{const we=[];return te&&D(te,$e=>{var re;(((re=$e.meta)==null?void 0:re.interfaces)||[]).filter(q=>q.type===s.BLOCKLET_INTERFACE_TYPE_SERVICE).forEach(q=>{const W=q.port||{};we.push({name:q.name,protocol:q.protocol,port:Number(W.external),upstreamPort:Number(($e.ports||{})[W.internal])})})}),we};e.getBlockletServices=_e;const Se=te=>[s.BlockletStatus.downloading,s.BlockletStatus.waiting,s.BlockletStatus.starting,s.BlockletStatus.installing,s.BlockletStatus.stopping,s.BlockletStatus.upgrading,"downloading","waiting","starting","installing","extracting","stopping","upgrading","restarting","deleting"].includes(te);e.isInProgress=Se;const ze=te=>[s.BlockletStatus.added,s.BlockletStatus.waiting,s.BlockletStatus.downloading,s.BlockletStatus.installing,"added","waiting","downloading","installing"].includes(te);e.isBeforeInstalled=ze;const Je=te=>[s.BlockletStatus.running,"running"].includes(te);e.isRunning=Je;const ge=te=>[s.BlockletStatus.running,s.BlockletStatus.waiting,s.BlockletStatus.downloading,"running","waiting","downloading"].includes(te);e.isAccessible=ge;const Ie=(te,{type:we,did:$e}={type:"",did:""})=>{var De,re,q;return te?!(0,l.hasStartEngine)(te.meta)&&((q=(re=(De=te.meta)==null?void 0:De.resource)==null?void 0:re.bundles)==null?void 0:q.length)>0&&(te.meta.resource.bundles||[]).some(W=>W.type===we&&W.did===$e):!1};e.hasResourceType=Ie,e.default={isFreeBlocklet:k,isFreeComponent:C,forEachBlocklet:x,forEachBlockletSync:D,forEachChild:V,forEachChildSync:M,forEachComponentV2:O,forEachComponentV2Sync:P,isDeletableBlocklet:v,getSharedConfigObj:f,getAppMissingConfigs:_,getComponentMissingConfigs:R,isEnvShareableToClient:N,isEnvShareable:T,wipeSensitiveData:E,hasRunnableComponent:L,getAppName:ne,getAppDescription:F,getAppUrl:J,getDisplayName:ne,fixBlockletStatus:se,findWebInterface:pe,findWebInterfacePort:be,findServiceFromMeta:Re,getWhoCanAccess:H,getComponentWhoCanAccess:$,replaceSlotToIp:Y,getComponentId:g,getComponentName:y,getComponentBundleId:b,findComponent:j,findComponentById:G,findComponentV2:ie,findComponentByIdV2:ue,filterComponentsV2:K,getParentComponentName:A,getConnectAppUrl:X,getChainInfo:oe,getBlockletChainInfo:Te,isExternalBlocklet:me,isPreferenceKey:h,getRolesFromAuthConfig:le,getBlockletServices:_e,isInProgress:Se,isBeforeInstalled:ze,isRunning:Je,isAccessible:ge,isGatewayBlocklet:l.isGatewayBlocklet,isPackBlocklet:l.isPackBlocklet,hasStartEngine:l.hasStartEngine,hasResourceType:Ie}})(Ss);const Hle=(e,t=!1)=>{const n=e.routing.adminPath;return t?encodeURIComponent(Ln(window.location.origin,n)):Ln(window.location.origin,n)},B_t=(e,t,n)=>{const r=Hle(t),i=Ln(n,`/api/blocklets/${e.did}/blocklet.json`),o=new URL(Ln(r,"/launch-blocklet/agreement"));return o.searchParams.set("blocklet_meta_url",i),o.searchParams.set("from",window.location.href),o.href},dCt=async(e,{getIP:t}={})=>{if(!e||!e.length)return[];if(!t||!e.some(r=>r.value.includes(rn.SLOT_FOR_IP_DNS_SITE)))return e;const n=await t();return n?e.map(r=>{try{return r.value=Ss.replaceSlotToIp(r.value,n),r}catch{return r}}).filter(Boolean):e},pCt=e=>{const t={didSpace:null};return Ss.forEachBlockletSync(e,n=>{var r,i;t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||t.didSpace===ti.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP||(i=(r=n==null?void 0:n.meta)==null?void 0:r.capabilities)!=null&&i.didSpace&&(t.didSpace=n.meta.capabilities.didSpace)}),t},_W=async(e,{fixRuntime:t=!0,oldBlocklet:n,getIP:r}={})=>{if(e.site||(e.site={domainAliases:[],rules:[]}),e.site.rules.forEach(i=>{i.from.pathPrefix=G9(i.from.pathPrefix||"/")}),e.site.rules=cie(e.site.rules,i=>i.from.pathPrefix),t===!0)e.site.domainAliases=await dCt(e.site.domainAliases,{getIP:r}),e.appRuntimeInfo&&(e.appRuntimeInfo.startAt=new Date-e.appRuntimeInfo.uptime),Ss.forEachBlockletSync(e,i=>{i.runtimeInfo&&(i.runtimeInfo.startAt=new Date-i.runtimeInfo.uptime)});else if(t==="merge-old"&&n){e.site.domainAliases=n.site.domainAliases,e.appRuntimeInfo=n.appRuntimeInfo;const i={};Ss.forEachBlockletSync(n,(o,{id:a})=>{i[a]=o}),Ss.forEachBlockletSync(e,(o,{id:a})=>{const s=i[a];s&&(o.runtimeInfo=s.runtimeInfo,o.diskInfo=s.diskInfo,o.engine=s.engine)})}else e.site.domainAliases=[];e.capabilities=pCt(e)},EW="arcblock",N_t=(e,t=!1)=>{let n;return t?(n=(e.configs||[]).find(r=>r.key==="BLOCKLET_APP_CHAIN_TYPE"),n&&n.value||(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.key)),n&&n.value)?n.value:EW):(n=(e.environments||[]).find(r=>["CHAIN_TYPE","BLOCKLET_APP_CHAIN_TYPE"].includes(r.name)),n&&n.default?n.default:EW)},$_t=e=>!Ok(e==null?void 0:e.controller);let PC=null;const hCt=async()=>{const e=window.env.apiPrefix||"/",t=Ln(e,"/api/dns-resolve?accessible=1");try{return(await Ir.get(t)).data.address}catch{return null}},RW=()=>(PC||(PC=hCt()),PC),Wle=U.createContext({}),{Provider:mCt,Consumer:F_t}=Wle,kW=(e,t,n)=>n?e.map(r=>{const i={...r},o=t.find(a=>a.meta.did===r.meta.did);return o&&n.forEach(a=>{i[a]=o[a]}),i}):t;function gCt({children:e}){const t=Sl(),n=i5(),[r,i]=U.useState(null),[o,a]=U.useState(!1),[s,l]=U.useState([]),[c,u]=U.useState([]),[d,p]=U.useState(!1),g=(P,V)=>{Ss.isExternalBlocklet(P)?u(V):l(V)},y=4,b=async({silent:P=!0,retries:V=y,updates:M,useCache:j=!0}={})=>{P||a(!0);try{i(null);const{blocklets:G}=await n.getBlocklets({input:{useCache:j}});for(const K of G)await _W(K,{getIP:RW});const ie=G.filter(K=>!Ss.isExternalBlocklet(K)),ue=G.filter(Ss.isExternalBlocklet);l(K=>kW(K,ie,M)),u(K=>kW(K,ue,M)),a(!1),p(!0)}catch(G){V>0?setTimeout(()=>b({silent:P,retries:V-1,useCache:j}),1e3):(a(!1),i(G))}},A=async P=>{try{const{blocklet:V}=await t.api.getBlocklet({input:{did:P.meta.did,attachRuntimeInfo:!0}});await _W(V,{getIP:RW}),g(V,M=>M.some(j=>j.meta.did===V.meta.did)?M.map(j=>j.meta.did===V.meta.did?V:j):[...M,V])}catch(V){i(V)}},x=P=>{t.refresh(),A(P)};U.useEffect(()=>{b({silent:!1})},[]);const D=P=>{const V={};Ss.forEachBlockletSync(P,(M,{id:j})=>{V[j]=ti.fromBlockletStatus(M.status)}),g(P,M=>M.map(j=>(j.meta.did===P.meta.did&&Ss.forEachBlockletSync(j,(G,{id:ie})=>{V[ie]&&(G.status=V[ie])}),j)))};Ki(ti.BlockletEvents.added,P=>{P.status=ti.fromBlockletStatus(P.status),g(P,V=>[...V,P])}),Ki(ti.BlockletEvents.removed,P=>{t.refresh(),g(P,V=>V.filter(M=>M.meta.did!==P.meta.did))}),Ki(ti.BlockletEvents.statusChange,D),Ki(ti.BlockletEvents.installed,x),Ki(ti.BlockletEvents.upgraded,x),Ki(ti.BlockletEvents.updated,A),Ki(ti.BlockletEvents.startFailed,A),Ki(ti.BlockletEvents.reloaded,A);const O={loading:o,error:r,data:s,externalData:c,refresh:b,initialized:d,api:n};return I.jsx(mCt,{value:{blocklets:O},children:e})}function U_t(){const{blocklets:e}=U.useContext(Wle);return e}const yCt=({user:e,launchType:t,nftId:n})=>{var r;if(!e)return!1;if(t==="serverless"){if(!n)throw new Error("nftId is required");return((r=e==null?void 0:e.controller)==null?void 0:r.nftId)===n}return(e.permissions||[]).includes("mutate_blocklets")},j_t=e=>{var t,n;return e.isGetBlocklet&&((n=(t=e.runtimeBlocklet)==null?void 0:t.controller)==null?void 0:n.consumedAt)},q_t=async e=>{const t=bdt({blocklet:e});let n="";return n=t.find(r=>{try{const{hostname:i}=new URL(r);return koe.isSlpDomain(i)}catch(i){return console.error(i),!1}}),n||(n=await Sdt(t)),n},Gle=U.createContext({}),{Provider:vCt,Consumer:V_t}=Gle;function bCt({children:e}){const{session:t}=y0(),{t:n}=fo(),{api:r,info:i}=Sl(),[o]=BJ(),a=i5(),s=o.get("launchType"),l=o.get("fromLauncher"),c=o.get("blocklet_meta_url")||"",u=o.get("nftId")||"",d=o.get("launcherSessionId")||"",p=o.get("launcherUrl")||"",g=new URL(c).origin,[y,b]=U.useState({meta:null,appDid:o.get("appDid")||null,sessionId:o.get("sessionId")||null,isFree:!0,isExternal:!1,isInstalling:!1,isInstalled:!1,isRunning:!1,launcherSession:null}),A=(ue,K)=>b(N=>({...N,appDid:ue,sessionId:K})),x=yCt({user:t.user,launchType:s,nftId:u}),[D,O]=U.useState(null),[P,V]=U.useState(!0),M=U.useMemo(()=>i?Hle(i):"",[i]),j=async ue=>{if(!ue)throw new Error("appDid should not be empty");const{blocklet:K}=await r.getBlocklet({input:{did:ue,attachConfig:!1}});if(!K)return null;const N=ti.BlockletStatus[K.status],T=!!u,f=N<ti.BlockletStatus.installed,h=N===ti.BlockletStatus.installed,w=N===ti.BlockletStatus.running;return b(_=>({..._,isInstalled:h,isRunning:w,isExternal:T,isInstalling:f})),{isInstalled:h,isRunning:w,isExternal:T,isInstalling:f}},G=async()=>{V(!0);try{if(!c)throw new Error(n("common.invalidParam"));const[{meta:ue,isFree:K},{launcherSession:N,error:T}]=await Promise.all([r.getBlockletMetaFromUrl({input:{url:c,checkPrice:!0}}),d?r.getLauncherSession({input:{launcherSessionId:d,launcherUrl:p}}):Promise.resolve({})]);if(d&&!N)throw new Error(`Launch session invalid: ${T}`);if(!ue)throw new Error(n("LaunchBlockletBlocklet.error.loadMetaFailed"));let f={};x&&y.appDid&&(f=await j(y.appDid)),b(h=>({...h,...f,meta:ue,isFree:K,launcherSession:N}))}catch(ue){console.error(ue),O(ue.message)}finally{V(!1)}};U.useEffect(()=>{var ue,K,N;((ue=t==null?void 0:t.user)==null?void 0:ue.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&((N=(K=t==null?void 0:t.user)==null?void 0:K.controller)==null?void 0:N.nftId)!==u&&t.logout(),G()},[]),U.useEffect(()=>{P||!y.meta||(x?y.appDid&&j(y.appDid).catch(ue=>{ci.error(ue.message)}):(b(ue=>({...ue,isInstalled:!1,isRunning:!1,isExternal:!1})),O(null)))},[x]);const ie={meta:y.meta,isFree:y.isFree,appDid:y.appDid,sessionId:y.sessionId,isInstalling:y.isInstalling,isInstalled:y.isInstalled,isExternal:y.isExternal,isRunning:y.isRunning,serverUrl:M,storeUrl:g,blockletMetaUrl:c,fromLauncher:l,loading:P,error:D,api:a,getBlocklet:j,setAppDid:A,launcherUrl:p,launcherSession:y.launcherSession,launcherSessionId:d};return I.jsx(vCt,{value:ie,children:e})}function z_t(){return U.useContext(Gle)}function Kle(){return new URLSearchParams(yi().search)}const Jle=U.createContext(),{Provider:wCt,Consumer:H_t}=Jle;function Yle({children:e}){const n=Kle().get("blocklet_meta_url"),r=S8t(async()=>{const{data:o}=await W9.get(n);return o});if(r.loading)return I.jsx(Qo,{children:I.jsx(ra,{})});const i={meta:r.value,error:r.error};return I.jsx(wCt,{value:i,children:e})}Yle.propTypes={children:Z.any.isRequired};function W_t(){return U.useContext(Jle)}const TCt=U.lazy(()=>gn(()=>import("./index-DXRZFI-i.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),xCt=U.lazy(()=>gn(()=>import("./index-CFcksbYG.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,2,27,28,29,30]),import.meta.url)),SCt=U.lazy(()=>gn(()=>import("./index-BQK6o51a.js"),__vite__mapDeps([31,32,33,34,35,36,37,6,38,39,40,41,42,12,9,11,25,18,17]),import.meta.url)),CCt=U.lazy(()=>gn(()=>import("./index-HsX6FBQ6.js"),__vite__mapDeps([43,6,44,45,17,16,46,9,47,48,29,12,11,38,49,39,40,50,3,18,22,23,51,52,53]),import.meta.url)),ACt=U.lazy(()=>gn(()=>import("./index-B7nYrN4m.js"),__vite__mapDeps([54,55,10,52,56,57,46,58,12,9,11,7,8,13,14,15,16,17,18,59,50,3,2,60,6,61,62,29,19,20,63,64,65,66,4,67]),import.meta.url)),_Ct=U.lazy(()=>gn(()=>import("./index-CxfL2iNj.js"),__vite__mapDeps([68,69,22,23,9,70]),import.meta.url)),ECt=U.lazy(()=>gn(()=>import("./index-CcuoQAH9.js"),__vite__mapDeps([71,55,10,72,73,74,17,6,9,11,75,13,76,77,29,78,79,80,16,12,7,8,14,15,18,81,82,83,46,20,84,3,2,85,86,30,22,23,87,88,89,24,25,45,47,90,1,50,65]),import.meta.url)),RCt=U.lazy(()=>gn(()=>import("./detail-DjuS1eoq.js").then(e=>e.d),__vite__mapDeps([91,55,10,19,20,21,6,18,22,23,28,84,41,42,53]),import.meta.url)),kCt=U.lazy(()=>gn(()=>import("./index-CXkSaJRT.js"),[],import.meta.url)),DCt=U.lazy(()=>gn(()=>import("./index-DwmHAX9V.js"),__vite__mapDeps([92,1,75,13]),import.meta.url)),LCt=U.lazy(()=>gn(()=>import("./index-B6ebv4kj.js"),__vite__mapDeps([93,94,95,96,63,97]),import.meta.url)),OCt=U.lazy(()=>gn(()=>import("./index-CTxq4D6b.js"),__vite__mapDeps([98,63,79,49,97,27]),import.meta.url)),ICt=U.lazy(()=>gn(()=>import("./index-BhpRo-lZ.js"),__vite__mapDeps([99,97]),import.meta.url)),PCt=U.lazy(()=>gn(()=>import("./index-Hv2GfUwQ.js"),__vite__mapDeps([100,32,33,34,35,36,37,101,73,74,42,25,6,60]),import.meta.url)),MCt=U.lazy(()=>gn(()=>import("./index-C3dyY7Jn.js"),__vite__mapDeps([102,95]),import.meta.url)),BCt=U.lazy(()=>gn(()=>import("./index-D8yUR2aq.js"),__vite__mapDeps([103,94,95,96,63,97]),import.meta.url)),NCt=U.lazy(()=>gn(()=>import("./index-DHhEgUS1.js").then(e=>e.a2),__vite__mapDeps([104,105]),import.meta.url)),$Ct=U.lazy(()=>gn(()=>import("./index-DtqP33jl.js"),__vite__mapDeps([106,55,10,107,108,109,64,9,110,12,11,47,7,8,13,14,15,16,17,18,28,111,112,4,6,90,23]),import.meta.url));function Zle(){const e=Sl(),{session:t}=y0(),{wallet:n}=Vh(),r=t.user&&t.user.did;return U.useEffect(()=>{const i=f5();return r?i.connect():i.isConnected()&&i.disconnect(),()=>{i.isConnected()&&i.disconnect()}},[r]),U.useEffect(()=>{if(n)return()=>{};const i=()=>{document.visibilityState==="visible"&&t.refresh()};return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i)}},[]),{node:e,session:t}}function FCt(){var a;const{t:e}=fo(),{node:t,session:n}=Zle(),r=yi();U.useEffect(()=>{window.tracker&&typeof window.tracker.pageView=="function"&&window.tracker.pageView(`${r.pathname}${r.search}`)},[r]),U.useEffect(()=>{var s;((s=n==null?void 0:n.user)==null?void 0:s.role)===rn.SERVER_ROLES.EXTERNAL_BLOCKLET_CONTROLLER&&n.logout()},[(a=n==null?void 0:n.user)==null?void 0:a.role]);const i=I.jsx(ra,{});if(t.loading||n.loading)return I.jsx(Qo,{children:i});if(!t.info.initialized)return b8e.getServerAuthMethod(t.info)==="nft"?I.jsx(YL,{action:"verify-owner"}):I.jsx(Qo,{children:I.jsx(m6t,{})});if(t.info.upgradeSessionId)return I.jsx(Qo,{children:I.jsx(Nse,{})});if(!n.user)return I.jsx(XL,{loadingEle:i});const o=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(Q8t,{children:I.jsxs(gCt,{children:[I.jsx(C6t,{}),I.jsx(OTt,{}),I.jsx(nCt,{}),I.jsx(U.Suspense,{fallback:o,children:I.jsxs(A4,{children:[I.jsx(or,{path:"/dashboard",element:I.jsx(Ko,{fullWidth:!0,title:"Dashboard",children:I.jsx(TCt,{})})}),I.jsx(or,{path:"/blocklets",element:I.jsx(Ko,{fullWidth:!0,title:e("common.blocklets"),children:I.jsx(xCt,{})})}),I.jsx(or,{path:"/blocklets/:did/:tab",element:I.jsx(Ko,{fullWidth:!0,title:"Blocklets",children:I.jsx(RCt,{})})}),I.jsx(or,{path:"/settings/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.setting"),children:I.jsx(ACt,{})})}),I.jsx(or,{path:"/eula",element:I.jsx(Ko,{fullWidth:!0,title:e("setup.steps.eula"),children:I.jsx(kCt,{})})}),I.jsx(or,{path:"/store",element:I.jsx(Ko,{fullWidth:!0,title:e("common.store"),children:I.jsx(CCt,{})})}),I.jsx(or,{path:"/console",element:I.jsx(Ko,{title:`GraphQL ${e("common.console")}`,scrollable:!1,fullWidth:!0,children:I.jsx(NCt,{})})}),I.jsx(or,{path:"/notifications",element:I.jsx(Ko,{children:I.jsx(DCt,{})})}),I.jsx(or,{path:"/team/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.team"),children:I.jsx(ECt,{})})}),I.jsx(or,{path:"/logs/:name",element:I.jsx(Ko,{scrollable:!1,fullWidth:!0,title:e("common.logs"),children:I.jsx(_Ct,{})})}),I.jsx(or,{path:"/analytics/:tab",element:I.jsx(Ko,{fullWidth:!0,title:e("common.analytics"),children:I.jsx($Ct,{})})}),I.jsx(or,{path:"/",element:I.jsx(Gs,{to:"/dashboard",replace:!0})}),I.jsx(or,{path:"/team",element:I.jsx(Gs,{to:"/team/members",replace:!0})}),I.jsx(or,{path:"/analytics",element:I.jsx(Gs,{to:"/analytics/traffic",replace:!0})}),I.jsx(or,{path:"/logs",element:I.jsx(Gs,{to:"/logs/abtnode",replace:!0})}),I.jsx(or,{path:"/router",element:I.jsx(Gs,{to:"/router/rules",replace:!0})}),I.jsx(or,{path:"/settings",element:I.jsx(Gs,{to:"/settings/basic",replace:!0})}),I.jsx(or,{path:"/marketplace",element:I.jsx(Gs,{to:"/store",replace:!0})}),I.jsx(or,{path:"/marketplace/:did",element:I.jsx(Gs,{to:"/store/:did",replace:!0})}),I.jsx(or,{path:"*",element:I.jsx(MCt,{})})]})})]})})}function Jc({children:e}){const{node:t,session:n}=Zle();return t.loading||!n.initialized&&n.loading?I.jsx(Qo,{children:I.jsx(ra,{})}):t.info.upgradeSessionId?I.jsx(Qo,{children:I.jsx(Nse,{})}):e}function UCt(){const{changeLocale:e}=fo(),t=Kle();U.useEffect(()=>{const r=t.get("locale");r&&["zh","en"].includes(r)&&e(r)},[]);const n=I.jsx(Qo,{children:I.jsx(ra,{})});return I.jsx(U.Suspense,{fallback:n,children:I.jsxs(A4,{children:[I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/issue-passport`,element:I.jsx(Jc,{children:I.jsx(LCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/lost-passport`,element:I.jsx(Jc,{children:I.jsx(OCt,{})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/exchange-passport`,element:I.jsx(Jc,{children:I.jsx(ICt,{})})}),I.jsx(or,{path:"/accept-server",element:I.jsx(Jc,{children:I.jsx(YL,{action:"accept-server"})})}),I.jsx(or,{path:"/launch-blocklet/*",element:I.jsx(Jc,{children:I.jsx(bCt,{children:I.jsx(PCt,{})})})}),I.jsx(or,{path:"/blocklets/restore/*",element:I.jsx(Jc,{children:I.jsx(Yle,{children:I.jsx(SCt,{})})})}),I.jsx(or,{path:`${rn.WELLKNOWN_SERVICE_PATH_PREFIX}/invite`,element:I.jsx(Jc,{children:I.jsx(BCt,{})})}),I.jsx(or,{path:"/*",element:I.jsx(FCt,{})})]})})}function jCt(){const e=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";return I.jsxs(I.Fragment,{children:[I.jsx($7,{}),I.jsx(OJ,{history:X8e,basename:e,children:I.jsx(VTt,{children:I.jsx(UCt,{})})})]})}const qCt=WK(document.getElementById("root"));qCt.render(I.jsx(jCt,{}));const DW=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";wge(`${DW}/service-worker.js`.replace(/\/+/g,"/"),{registrationOptions:{scope:DW},registered(){console.info("Service worker has been registered.")},ready(){console.info("Service worker is active.")},cached(){console.info("Content has been cached for offline use.")},updatefound(){console.info("New content is downloading.")},updated(){console.info("New content is available; please refresh.")},offline(){console.info("No internet connection found. App is running in offline mode.")},error(e){console.error("Error during service worker registration:",e)}});export{Hp as $,ci as A,ks as B,ra as C,QD as D,BJ as E,rn as F,gx as G,Ps as H,SO as I,Tat as J,Yct as K,DX as L,Ss as M,cl as N,ft as O,Z as P,Ok as Q,ND as R,B1 as S,Lle as T,y5 as U,Qo as V,oO as W,Ac as X,Ave as Y,OD as Z,Qst as _,Ki as a,wk as a$,rL as a0,Ln as a1,to as a2,_6 as a3,kTt as a4,S_t as a5,s9e as a6,bk as a7,m9e as a8,IX as a9,dle as aA,Tdt as aB,zle as aC,R9e as aD,dCt as aE,G9 as aF,cie as aG,RW as aH,XAt as aI,joe as aJ,fa as aK,co as aL,X8e as aM,vdt as aN,sk as aO,KAt as aP,Lke as aQ,l_t as aR,S8t as aS,W9 as aT,YAt as aU,g_t as aV,ydt as aW,AX as aX,yX as aY,tLe as aZ,ZAt as a_,Hle as aa,W_t as ab,b8e as ac,iO as ad,nL as ae,q_t as af,DAt as ag,j_t as ah,f5 as ai,Kle as aj,o_t as ak,GO as al,KL as am,x7 as an,A4 as ao,or as ap,Gs as aq,cu as ar,yl as as,$V as at,B_t as au,Ir as av,y0 as aw,Io as ax,c_t as ay,T6 as az,ti as b,NA as b$,NRe as b0,JRe as b1,wdt as b2,m_t as b3,xle as b4,xCe as b5,hct as b6,Iw as b7,Pw as b8,jX as b9,sie as bA,zg as bB,PXe as bC,Wre as bD,JD as bE,sle as bF,HAt as bG,L_t as bH,FAt as bI,s_t as bJ,Zte as bK,ua as bL,kt as bM,mc as bN,ye as bO,Ybe as bP,Bt as bQ,un as bR,an as bS,hn as bT,fl as bU,Pt as bV,sn as bW,fu as bX,d7e as bY,ht as bZ,Gn as b_,en as ba,Hr as bb,Wu as bc,uh as bd,a_t as be,B6 as bf,bJ as bg,Yo as bh,qX as bi,G1 as bj,T_t as bk,Cie as bl,N_t as bm,iQ as bn,gn as bo,zAt as bp,mRe as bq,IJ as br,x_t as bs,GD as bt,Uh as bu,Og as bv,pre as bw,hre as bx,KD as by,r9 as bz,i5 as c,fw as c$,B7 as c0,$r as c1,M7 as c2,sAt as c3,MAt as c4,bdt as c5,koe as c6,ile as c7,p_t as c8,D6 as c9,_f as cA,yi as cB,CD as cC,pi as cD,VAt as cE,UAt as cF,jAt as cG,rle as cH,FTt as cI,tk as cJ,gi as cK,oAt as cL,wm as cM,Np as cN,Zut as cO,mt as cP,Jne as cQ,zCt as cR,cAt as cS,_ct as cT,V6 as cU,I8t as cV,pbe as cW,b_t as cX,Ya as cY,P7 as cZ,dc as c_,_W as ca,SRe as cb,ARe as cc,Adt as cd,T9e as ce,XEe as cf,Ule as cg,eCt as ch,NOe as ci,Ct as cj,GLe as ck,Or as cl,dh as cm,nu as cn,mi as co,Vh as cp,_g as cq,Ku as cr,S6t as cs,d5 as ct,z_t as cu,hGe as cv,yCt as cw,f_t as cx,Sdt as cy,i_t as cz,U_t as d,YCt as d$,$a as d0,Ai as d1,Rt as d2,hX as d3,FEe as d4,Ba as d5,OAt as d6,IAt as d7,PD as d8,Uke as d9,yu as dA,L9 as dB,SZe as dC,Vie as dD,JAt as dE,jEe as dF,s3 as dG,K4e as dH,cc as dI,_o as dJ,zY as dK,bwe as dL,Rw as dM,rs as dN,zh as dO,Lw as dP,Hh as dQ,N7 as dR,AY as dS,L4e as dT,I4e as dU,jve as dV,tY as dW,mg as dX,ZCt as dY,QCt as dZ,XCt as d_,M1 as da,c3 as db,MX as dc,q9e as dd,J$ as de,K$ as df,N9e as dg,yAt as dh,dn as di,GCt as dj,WCt as dk,HCt as dl,KCt as dm,Rh as dn,kD as dp,L6 as dq,ad as dr,Hg as ds,cJe as dt,CZ as du,Jn as dv,aAt as dw,Wp as dx,AZ as dy,Qt as dz,_8t as e,Y4 as e$,Xbe as e0,ug as e1,Dh as e2,RN as e3,JCt as e4,$f as e5,E3e as e6,S7 as e7,XY as e8,rAt as e9,OEe as eA,wv as eB,wRe as eC,hx as eD,g7e as eE,xm as eF,Oke as eG,k9e as eH,f3 as eI,nLe as eJ,em as eK,SLe as eL,Wl as eM,Xb as eN,Zb as eO,NLe as eP,LLe as eQ,bAt as eR,Yre as eS,Ls as eT,T_ as eU,F7 as eV,xY as eW,RX as eX,LGe as eY,Lh as eZ,qY as e_,eAt as ea,l4e as eb,fc as ec,BY as ed,I3e as ee,c4e as ef,nAt as eg,BA as eh,o4e as ei,s4e as ej,vl as ek,u4e as el,Wbe as em,lw as en,Mwe as eo,tAt as ep,Dwe as eq,jc as er,SCe as es,pAt as et,eAe as eu,tAe as ev,vAe as ew,hAt as ex,tr as ey,Tp as ez,Ec as f,ay as f$,hg as f0,_7 as f1,p3 as f2,tF as f3,jf as f4,fi as f5,Bot as f6,$o as f7,a0 as f8,tn as f9,t_t as fA,PAt as fB,r_t as fC,Aie as fD,hoe as fE,t6t as fF,p9 as fG,tse as fH,Uoe as fI,vw as fJ,T2t as fK,iie as fL,Q4e as fM,QY as fN,U7 as fO,Kn as fP,Ew as fQ,n9e as fR,Y7 as fS,d8e as fT,$O as fU,uAt as fV,qO as fW,jO as fX,I6 as fY,EAt as fZ,RO as f_,Eg as fa,Hf as fb,UOe as fc,WK as fd,Kh as fe,Xn as ff,bee as fg,gee as fh,Sw as fi,Xct as fj,kY as fk,cw as fl,l3 as fm,i7 as fn,tQ as fo,VQ as fp,v6t as fq,qAt as fr,nI as fs,rQ as ft,VCt as fu,pc as fv,CYe as fw,_c as fx,QAt as fy,ud as fz,Kt as g,Sh as g$,IO as g0,UWe as g1,Gh as g2,Tle as g3,A6 as g4,lot as g5,bot as g6,qte as g7,Sk as g8,Zrt as g9,Hct as gA,ID as gB,$_t as gC,v_t as gD,GAt as gE,e_t as gF,n_t as gG,R6 as gH,Tre as gI,xre as gJ,wre as gK,Pre as gL,WY as gM,e3 as gN,cAe as gO,dbe as gP,f5t as gQ,y5t as gR,w5t as gS,C5t as gT,E5t as gU,lTt as gV,uTt as gW,Vse as gX,zse as gY,MVe as gZ,Ktt as g_,wie as ga,Kf as gb,E6 as gc,L1 as gd,kw as ge,mx as gf,Dw as gg,YAe as gh,bX as gi,hCe as gj,ZZ as gk,cve as gl,WAt as gm,d_t as gn,Lxt as go,Sg as gp,lCe as gq,Cw as gr,dre as gs,H7 as gt,mSe as gu,W7 as gv,yct as gw,K7 as gx,$At as gy,oCt as gz,rO as h,q1 as h0,jVe as h1,BAt as h2,TAt as h3,y_t as h4,sV as h5,Zm as h6,GOe as h7,aQ as h8,d3 as h9,RAt as hA,Act as hB,O_t as hC,wX as hD,mot as hE,e9 as hF,LOe as hG,E_t as hH,__t as hI,nQ as hJ,Ite as hK,P_t as hL,mX as hM,wAt as ha,N1 as hb,iAt as hc,wwe as hd,dAt as he,mCe as hf,yRe as hg,bDe as hh,hDe as hi,mAt as hj,wDe as hk,gAt as hl,z9e as hm,vAt as hn,D5t as ho,KA as hp,YA as hq,$se as hr,X4e as hs,LD as ht,hN as hu,u_t as hv,Ibt as hw,w_t as hx,h_t as hy,mH as hz,ch as i,I as j,Tf as k,NAt as l,Xt as m,Ka as n,q6 as o,jE as p,fo as q,U as r,er as s,F8t as t,Sl as u,R8t as v,ake as w,C9 as x,tL as y,xc as z};
|