@highstate/designer 0.21.1 → 0.26.0
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BdRuKvw2.js → -aI73seg.js} +1 -1
- package/.output/public/_nuxt/39D0VL7r.js +1 -0
- package/.output/public/_nuxt/{rscZxuQ2.js → 3T5CmBSF.js} +1 -1
- package/.output/public/_nuxt/4R6BJ3GI.js +1 -0
- package/.output/public/_nuxt/{sB5TSp0H.js → 77UvFSdd.js} +7 -7
- package/.output/public/_nuxt/{B4FDp1sn.js → B0E2rEnI.js} +1 -1
- package/.output/public/_nuxt/B1x03f8R.js +1 -0
- package/.output/public/_nuxt/B2CVdECd.js +1 -0
- package/.output/public/_nuxt/{CTRkBkra.js → B2_u9ZKl.js} +1 -1
- package/.output/public/_nuxt/{5gjbd9sK.js → B8uKU-iG.js} +1 -1
- package/.output/public/_nuxt/{CemiMtCX.js → B9BJCsIg.js} +1 -1
- package/.output/public/_nuxt/{xnReCuE4.js → BBmoak6l.js} +1 -1
- package/.output/public/_nuxt/BEOSfHJT.js +1 -0
- package/.output/public/_nuxt/{DsG1SoRB.js → BJV0IIsR.js} +1 -1
- package/.output/public/_nuxt/{CPsHsqGU.js → BKaSp7fy.js} +1 -1
- package/.output/public/_nuxt/{DKWXhhCy.js → BOujskTX.js} +1 -1
- package/.output/public/_nuxt/{Fcs-0n6A.js → BPboW4rx.js} +1 -1
- package/.output/public/_nuxt/{Djg8J2AC.js → BR4jrf3-.js} +1 -1
- package/.output/public/_nuxt/{CpGRan2R.js → BSRetNRl.js} +1 -1
- package/.output/public/_nuxt/{CqQg8Ldy.js → Ba9NwIJp.js} +1 -1
- package/.output/public/_nuxt/{CJN4g-3R.js → BbWhHw7B.js} +1 -1
- package/.output/public/_nuxt/Bcyj9glE.js +6 -0
- package/.output/public/_nuxt/{CvSiusML.js → Be4ezMZK.js} +1 -1
- package/.output/public/_nuxt/{DkkrdwgN.js → BgvYz3Nr.js} +1 -1
- package/.output/public/_nuxt/BlGDdimO.js +1 -0
- package/.output/public/_nuxt/{D_wY_uke.js → Bn5R9WlL.js} +1 -1
- package/.output/public/_nuxt/{Bs8TB6Bu.js → BqJDg8iS.js} +1 -1
- package/.output/public/_nuxt/BxD6MFcJ.js +1 -0
- package/.output/public/_nuxt/{CaehGOgh.js → BxvmPvww.js} +1 -1
- package/.output/public/_nuxt/{DEtIJe2u.js → By1Fxx6d.js} +1 -1
- package/.output/public/_nuxt/{CnhVSb6R.js → ByBXn3Vz.js} +1 -1
- package/.output/public/_nuxt/C1bzPMRu.js +14 -0
- package/.output/public/_nuxt/{BIPWeF69.js → C29gnYT3.js} +1 -1
- package/.output/public/_nuxt/{BCJKqJxW.js → C5DRPdxC.js} +1 -1
- package/.output/public/_nuxt/{Cs-GjQ8R.js → C794qwo0.js} +1 -1
- package/.output/public/_nuxt/{DSDbyhpJ.js → C9OJ0gQB.js} +1 -1
- package/.output/public/_nuxt/{EnN6XTXK.js → C9n5vGW7.js} +1 -1
- package/.output/public/_nuxt/{B2SoM2pd.js → CCBTuGSI.js} +2 -2
- package/.output/public/_nuxt/{DTPYfUid.js → CGLWlIpJ.js} +1 -1
- package/.output/public/_nuxt/CI40hKzv.js +2 -0
- package/.output/public/_nuxt/{BTd2ZN65.js → CLsyMJ1X.js} +1 -1
- package/.output/public/_nuxt/{ByE1aAlg.js → CNWyx-82.js} +1 -1
- package/.output/public/_nuxt/CRZrAKrA.js +2 -0
- package/.output/public/_nuxt/{B7RpoNQl.js → CRb2z3Pg.js} +1 -1
- package/.output/public/_nuxt/{BzhaMbyl.js → CWA5Cfde.js} +1 -1
- package/.output/public/_nuxt/{CmJE87KM.js → C_yayEmb.js} +1 -1
- package/.output/public/_nuxt/{BwKAHWnp.js → CaZj7sno.js} +1 -1
- package/.output/public/_nuxt/CiaugisX.js +1 -0
- package/.output/public/_nuxt/Cjs5trkS.js +1 -0
- package/.output/public/_nuxt/CoqwalnO.js +2 -0
- package/.output/public/_nuxt/{OuCcJFrZ.js → CscXh7Vy.js} +1 -1
- package/.output/public/_nuxt/{9OHRRPkh.js → CwWsKBf5.js} +1 -1
- package/.output/public/_nuxt/Cwefpg1x.js +1 -0
- package/.output/public/_nuxt/{DtBrxin9.js → CyFj-Mv9.js} +1 -1
- package/.output/public/_nuxt/{C973_vs5.js → D1BdWMiq.js} +1 -1
- package/.output/public/_nuxt/D1yXAE_w.js +1 -0
- package/.output/public/_nuxt/{Bl_Sz9PU.js → D2lHwbtX.js} +1 -1
- package/.output/public/_nuxt/{Dahes9VH.js → D46u9gXN.js} +1 -1
- package/.output/public/_nuxt/{D-7HtdRe.js → D4H6aUyZ.js} +7 -7
- package/.output/public/_nuxt/D9ITfHnZ.js +269 -0
- package/.output/public/_nuxt/{C2zyO9uX.js → DFwfZeyL.js} +1 -1
- package/.output/public/_nuxt/{UD_auLNX.js → DMM9kDc1.js} +1 -1
- package/.output/public/_nuxt/{wCosSBIO.js → DNVXBFXP.js} +1 -1
- package/.output/public/_nuxt/{DXyfavJr.js → DPQHj1GW.js} +1 -1
- package/.output/public/_nuxt/{CBIEPWAA.js → DRTFVhVr.js} +1 -1
- package/.output/public/_nuxt/{GXzlut8R.js → DTYY2tCY.js} +1 -1
- package/.output/public/_nuxt/{hAFXcJ2_.js → DVKmRHSk.js} +1 -1
- package/.output/public/_nuxt/{DdvHdmGh.js → DYYyOkJe.js} +1 -1
- package/.output/public/_nuxt/{DUHba1vY.js → DcV32yum.js} +1 -1
- package/.output/public/_nuxt/DdhYQ3Tv.js +1 -0
- package/.output/public/_nuxt/DmMgvbsF.js +1 -0
- package/.output/public/_nuxt/{DnpKvmH_.js → DrQCNsTo.js} +1 -1
- package/.output/public/_nuxt/{DSpiceQe.js → DvCXikgN.js} +1 -1
- package/.output/public/_nuxt/DzQULtcW.js +1 -0
- package/.output/public/_nuxt/{BArXRmKu.js → DzowYWbi.js} +1 -1
- package/.output/public/_nuxt/{CtbC3i8L.js → I4u-TRO-.js} +1 -1
- package/.output/public/_nuxt/{y0GN4iGv.js → O3nsZ-Uz.js} +1 -1
- package/.output/public/_nuxt/Qj4UhtaN.js +1 -0
- package/.output/public/_nuxt/{Bdd5S2WL.js → VF7GAmoY.js} +1 -1
- package/.output/public/_nuxt/{Lks7C8cK.js → YpnHruhZ.js} +1 -1
- package/.output/public/_nuxt/_pageId_.C5KTkEfy.css +1 -0
- package/.output/public/_nuxt/_panelId_.CKSHyLNC.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/53add2c3-4d7c-4a4f-a116-e73c3787cf98.json +1 -0
- package/.output/public/_nuxt/components.a-P9dVi2.css +1 -0
- package/.output/public/_nuxt/{entry.Bc0aTA0K.css → entry.DsBbjDm-.css} +1 -1
- package/.output/public/_nuxt/error-404.DnBTUElh.css +1 -0
- package/.output/public/_nuxt/error-500.BNyYF0qG.css +1 -0
- package/.output/public/_nuxt/{CBVcjGJL.js → fbfpKHgl.js} +1 -1
- package/.output/public/_nuxt/{BD_Kvn-W.js → fxmP1KZw.js} +1 -1
- package/.output/public/_nuxt/graph-resolver-DhjyrFRu.js +180 -0
- package/.output/public/_nuxt/{DCK6hB22.js → hunqYsQf.js} +1 -1
- package/.output/public/_nuxt/iJghVVcV.js +1 -0
- package/.output/public/_nuxt/{Bu1xs0Fv.js → m4Sxwg8n.js} +1 -1
- package/.output/public/_nuxt/{C4XpvUuq.js → rpHuDh4d.js} +1 -1
- package/.output/public/_nuxt/{vuetify.BzdWZaIq.css → vuetify.DtnS3-VQ.css} +1 -1
- package/.output/server/index.mjs +2040 -1079
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/ws/lib/constants.js +19 -0
- package/.output/server/node_modules/ws/lib/event-target.js +292 -0
- package/.output/server/node_modules/ws/lib/extension.js +203 -0
- package/.output/server/node_modules/ws/lib/limiter.js +55 -0
- package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/.output/server/node_modules/ws/lib/receiver.js +706 -0
- package/.output/server/node_modules/ws/lib/sender.js +602 -0
- package/.output/server/node_modules/ws/lib/stream.js +161 -0
- package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/ws/lib/validation.js +152 -0
- package/.output/server/node_modules/ws/lib/websocket-server.js +554 -0
- package/.output/server/node_modules/ws/lib/websocket.js +1393 -0
- package/.output/server/node_modules/ws/package.json +70 -0
- package/.output/server/node_modules/ws/wrapper.mjs +21 -0
- package/.output/server/package.json +2 -1
- package/package.json +4 -4
- package/.output/public/_nuxt/-OnKOwAh.js +0 -1
- package/.output/public/_nuxt/B-dJABhs.js +0 -1
- package/.output/public/_nuxt/BKIVPvZX.js +0 -1
- package/.output/public/_nuxt/BXphdu9w.js +0 -2
- package/.output/public/_nuxt/BYmSxWA_.js +0 -1
- package/.output/public/_nuxt/BhozkjGO.js +0 -1
- package/.output/public/_nuxt/BtrNScOx.js +0 -1
- package/.output/public/_nuxt/BupMEc6X.js +0 -6
- package/.output/public/_nuxt/Bv_vOb-Y.js +0 -14
- package/.output/public/_nuxt/CYL3VlR9.js +0 -1
- package/.output/public/_nuxt/Cz-197mS.js +0 -1
- package/.output/public/_nuxt/DHJ62FKo.js +0 -2
- package/.output/public/_nuxt/DrWe3t51.js +0 -2
- package/.output/public/_nuxt/M0WOzN-S.js +0 -269
- package/.output/public/_nuxt/ZpmLW6rw.js +0 -1
- package/.output/public/_nuxt/builds/meta/d356de5d-6230-4e66-aba2-c48f455ae207.json +0 -1
- package/.output/public/_nuxt/builds/meta/ed797280-2bf0-44e6-a601-2ff2462bfbbc.json +0 -1
- package/.output/public/_nuxt/c6k-jVO-.js +0 -1
- package/.output/public/_nuxt/components.CIe9upZ4.css +0 -1
- package/.output/public/_nuxt/error-404.iOXvqd5J.css +0 -1
- package/.output/public/_nuxt/error-500.D0BgXBui.css +0 -1
- package/.output/public/_nuxt/graph-resolver-E9RSC1Ga.js +0 -180
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ws",
|
|
3
|
+
"version": "8.20.0",
|
|
4
|
+
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"HyBi",
|
|
7
|
+
"Push",
|
|
8
|
+
"RFC-6455",
|
|
9
|
+
"WebSocket",
|
|
10
|
+
"WebSockets",
|
|
11
|
+
"real-time"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/websockets/ws",
|
|
14
|
+
"bugs": "https://github.com/websockets/ws/issues",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/websockets/ws.git"
|
|
18
|
+
},
|
|
19
|
+
"author": "Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"main": "index.js",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"browser": "./browser.js",
|
|
25
|
+
"import": "./wrapper.mjs",
|
|
26
|
+
"require": "./index.js"
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"browser": "browser.js",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=10.0.0"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"browser.js",
|
|
36
|
+
"index.js",
|
|
37
|
+
"lib/*.js",
|
|
38
|
+
"wrapper.mjs"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js",
|
|
42
|
+
"integration": "mocha --throw-deprecation test/*.integration.js",
|
|
43
|
+
"lint": "eslint . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\""
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"bufferutil": "^4.0.1",
|
|
47
|
+
"utf-8-validate": ">=5.0.2"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"bufferutil": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"utf-8-validate": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@eslint/js": "^10.0.1",
|
|
59
|
+
"benchmark": "^2.1.4",
|
|
60
|
+
"bufferutil": "^4.0.1",
|
|
61
|
+
"eslint": "^10.0.1",
|
|
62
|
+
"eslint-config-prettier": "^10.0.1",
|
|
63
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
64
|
+
"globals": "^17.0.0",
|
|
65
|
+
"mocha": "^8.4.0",
|
|
66
|
+
"nyc": "^15.0.0",
|
|
67
|
+
"prettier": "^3.0.0",
|
|
68
|
+
"utf-8-validate": "^6.0.0"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import createWebSocketStream from './lib/stream.js';
|
|
2
|
+
import extension from './lib/extension.js';
|
|
3
|
+
import PerMessageDeflate from './lib/permessage-deflate.js';
|
|
4
|
+
import Receiver from './lib/receiver.js';
|
|
5
|
+
import Sender from './lib/sender.js';
|
|
6
|
+
import subprotocol from './lib/subprotocol.js';
|
|
7
|
+
import WebSocket from './lib/websocket.js';
|
|
8
|
+
import WebSocketServer from './lib/websocket-server.js';
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
createWebSocketStream,
|
|
12
|
+
extension,
|
|
13
|
+
PerMessageDeflate,
|
|
14
|
+
Receiver,
|
|
15
|
+
Sender,
|
|
16
|
+
subprotocol,
|
|
17
|
+
WebSocket,
|
|
18
|
+
WebSocketServer
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default WebSocket;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@highstate/designer-prod",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"unhead": "2.1.13",
|
|
28
28
|
"vue": "3.5.33",
|
|
29
29
|
"vue-bundle-renderer": "2.2.0",
|
|
30
|
+
"ws": "8.20.0",
|
|
30
31
|
"zod": "4.3.6"
|
|
31
32
|
}
|
|
32
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@highstate/designer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "FORCE_COLOR=true NODE_OPTIONS=--trace-warnings nuxt dev --host | pino-pretty",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"zxcvbn-typescript": "^5.0.1"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@highstate/backend": "0.
|
|
94
|
-
"@highstate/backend-api": "0.
|
|
95
|
-
"@highstate/contract": "0.
|
|
93
|
+
"@highstate/backend": "0.25.0",
|
|
94
|
+
"@highstate/backend-api": "0.25.0",
|
|
95
|
+
"@highstate/contract": "0.25.0",
|
|
96
96
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
97
97
|
"@prisma/internals": "^6.14.0",
|
|
98
98
|
"@vue/shared": "^3.5.33",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as C,as as $}from"#entry";import{E as M,V as m,Y as f,ap as V,aX as h,_ as t,W as a,aZ as B,D as v,Z as L,$ as i,a0 as u,aq as g,ar as I,a1 as E,a5 as c,aG as S,aV as T,H as D,M as N,a$ as X,am as Y,aP as G,r as x,n as O}from"./sB5TSp0H.js";import{I as P}from"./C4XpvUuq.js";const H=M({__name:"ContextMenuItem",props:{title:{},subtitle:{},color:{},icon:{},customIcon:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(e,{emit:d}){const n=d;return(l,s)=>(m(),f(V,{disabled:e.disabled,onClick:s[0]||(s[0]=r=>n("click"))},h({append:t(()=>[c(l.$slots,"append")]),default:t(()=>[a(g,{color:e.color},{default:t(()=>[i(u(e.title),1)]),_:1},8,["color"]),e.subtitle?(m(),f(I,{key:0,color:e.color},{default:t(()=>[i(u(e.subtitle),1)]),_:1},8,["color"])):E("",!0),c(l.$slots,"default")]),_:2},[e.loading?{name:"prepend",fn:t(()=>[a(B,{indeterminate:"",color:"primary"})]),key:"0"}:e.customIcon?{name:"prepend",fn:t(()=>[a(v(C),{icon:e.customIcon,color:e.color,style:{"margin-right":"12px",width:"24px",height:"24px"}},null,8,["icon","color"])]),key:"1"}:e.icon?{name:"prepend",fn:t(()=>[a(L,{color:e.color,style:{"margin-right":"-20px"}},{default:t(()=>[i(u(e.icon),1)]),_:1},8,["color"])]),key:"2"}:void 0]),1032,["disabled"]))}}),R=M({__name:"GenericContextMenu",props:G({title:{},subtitle:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(e,{expose:d}){const n=S(e,"visible"),l=x(0),s=x(0),r=T("contextMenu"),{isOutside:k}=$(r),p=async o=>{o.preventDefault(),n.value=!1,l.value=o.clientX,s.value=o.clientY,await O(),n.value=!0},b=()=>{k.value&&(n.value=!1)};return D(()=>{window.addEventListener("mousedown",b)}),N(()=>{window.removeEventListener("mousedown",b),n.value=!1}),d({showContextMenu:p}),(o,y)=>(m(),f(X,{modelValue:n.value,"onUpdate:modelValue":y[0]||(y[0]=w=>n.value=w),target:[v(l),v(s)],location:"end","close-on-content-click":!1},{default:t(()=>[a(Y,{ref_key:"contextMenu",ref:r,density:"compact",variant:"text",style:{"padding-bottom":"0"}},{default:t(()=>[c(o.$slots,"header",{},()=>[a(V,{class:"mb-2"},{default:t(()=>[a(g,null,{default:t(()=>[i(u(e.title),1)]),_:1}),a(I,{class:"d-flex align-center",style:{"font-family":"monospace"}},{default:t(()=>[i(u(e.subtitle)+" ",1),a(P,{content:e.subtitle},null,8,["content"])]),_:1})]),_:1})]),c(o.$slots,"default")]),_:3},512)]),_:3},8,["modelValue","target"]))}});export{H as _,R as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as P,V as G,X as W,Z as _,Y,z as Z,A as q,B as J,$ as K,t as Q,_ as U,l as X}from"#entry";import{c as tt,_ as et,a as nt,b as ot}from"./BKIVPvZX.js";import{E as C,aV as st,V as l,Y as I,D as t,_ as f,W as g,j as p,u as at,aO as j,H as it,av as $,aw as F,ag as M,a1 as R,J as E,a2 as O,a0 as rt,aZ as ct}from"./sB5TSp0H.js";import{I as ut,a as dt,G as pt}from"./Bv_vOb-Y.js";import{I as lt}from"./DHJ62FKo.js";import{_ as mt}from"./DXyfavJr.js";import{P as vt}from"./DnpKvmH_.js";import"./B69Z0Xk1.js";import"./CxoCegAs.js";import"./-OnKOwAh.js";import"./C4XpvUuq.js";import"./D_wY_uke.js";import"./D-7HtdRe.js";import"./C973_vs5.js";import"./CBVcjGJL.js";import"./Lks7C8cK.js";import"./BxAss8Tj.js";import"./BXphdu9w.js";import"./BupMEc6X.js";const ft=C({__name:"CompositeInstanceInputNode",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{},instance:{}},setup(e){const o=P(),{instancesStore:n,libraryStore:r,stateStore:u,validationStore:i,operationsStore:s}=o,m=p(()=>u.instanceLocks.get(e.instance.id)),y=p(()=>r.library.components[e.instance.type]),c=p(()=>u.getInstanceState(e.instance.id)),S=st("contextMenu");return(V,d)=>(l(),I(t(ut),{instance:e.instance,component:t(y),entities:t(r).library.entities,state:t(c),editable:t(n).instances.has(e.instance.id),"input-resolver-outputs":t(n).inputResolverOutputs,"input-resolver-dependent-map":t(n).inputResolverDependentMap,"io-type":"inputs","io-mirror":!0,"hide-show-composite":!0,"onSave:args":d[0]||(d[0]=(v,w,x)=>t(n).updateInstance(v,w,x)),"onOperation:launch":d[1]||(d[1]=v=>t(s).launchQuickInstanceOperation(v,e.data.instance)),"onOperation:cancel":d[2]||(d[2]=v=>t(s).cancelInstanceOperation(t(c).lastOperationState.operationId,e.data.instance.id)),onContextmenu:d[3]||(d[3]=v=>t(S)?.showContextMenu(v))},{status:f(()=>[g(t(lt),{state:t(c),"expected-input-hash":t(u).inputHashOutputs.get(e.instance.id)?.inputHash,"validation-output":t(i).validationOutputs.get(e.instance.id)},null,8,["state","expected-input-hash","validation-output"])]),default:f(()=>[g(t(tt),{ref_key:"contextMenu",ref:S,stores:t(o),instance:e.instance,component:t(y),state:t(c),editable:!1,locked:!!t(m)},null,8,["stores","instance","component","state","locked"])]),_:1},8,["instance","component","entities","state","editable","input-resolver-outputs","input-resolver-dependent-map"]))}}),yt=C({__name:"CompositeInstanceOutputNode",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{},instance:{}},setup(e){const{projectStore:o,libraryStore:n,stateStore:r}=P(),u=p(()=>n.library.components[e.instance.type]),i=p(()=>r.getInstanceState(e.instance.id));return(s,m)=>(l(),I(t(mt),{component:t(u),subtitle:"Outputs",style:{overflow:"visible"}},{default:f(()=>[g(t(dt),{instance:e.instance,component:t(u),entities:t(n).library.entities,"project-id":t(o).projectId,"state-id":t(i)?.id,type:"outputs",mirror:!0},null,8,["instance","component","entities","project-id","state-id"])]),_:1},8,["component"]))}}),T=G({name:"instance",getStoreId:(e,o,n)=>`projects/${e}/composites/${o}/${n}`,create:({storeId:e,id:[o,n,r],logger:u})=>W(e,()=>{const{vueFlowStore:i,nodeFactory:s,onNodesMoved:m,edgeEndpointOffsets:y}=_("instance",o,n,r),{$client:c}=at(),{instancesStore:S,stateStore:V}=Y(o),d=p(()=>V.stateIdToStateMap.get(n)),v=p(()=>{const a=d.value;return a?S.instances.get(a.instanceId):void 0}),w=async()=>{u.info({projectId:o},"initializing composite instance store");const a=await c.workspace.getCompositeViewport.query({projectId:o,stateId:n});a&&(i.defaultViewport.value=a),u.info({projectId:o,stateId:n},"composite instance store initialized")},x=()=>{const a=v.value;if(!a)throw new Error(`Virtual instance not found for state: ${n}`);const H=s.createNodeFromInstance(a,{type:"inputs"}),L=S.getInstanceChildren(a.id);if(s.createNodesForModels(L,[],{readonly:!0}),a.outputs&&Object.keys(a.outputs).length>0){s.createNodeFromInstance(a,{id:"outputs",type:"outputs",readonly:!0}),s.instanceIdToNodeIdMap.set(a.id,H.id);for(const[b,A]of Object.entries(a.outputs)){const k=a.resolvedOutputs?.[b]?.length??0,z=k===0;for(const N of A){const h=S.instances.get(N.instanceId);if(!h)continue;const B=h.parentId===a.id;u.debug({currentInstanceId:a.id,sourceInstanceId:h.id,outputKey:b,sourceOutput:N.output,sourceParentId:h.parentId,projection:B,resolvedOutputCount:k,projectionUnresolved:z},"creating edge to composite output node"),s.createEdgeForInstanceOutput(h,b,N,{projection:B,projectionUnresolved:z})}}}Z(i).then(()=>q(i)).then(()=>i.fitView()).then(()=>i.updateNodeInternals(i.getNodes.value.map(b=>b.id))).then(()=>J(i,m,y))},D=K(async a=>{await c.workspace.setCompositeViewport.mutate({projectId:o,stateId:n,viewport:a})},1e3);return i.onViewportChange(D),{initialize:w,placeNodes:x,stateId:n,instanceState:d,instance:v,version:r}})}),It=C({__name:"CompositeInstanceCanvas",async setup(e){let o,n;const{projectStore:r,instancesStore:u,libraryStore:i}=P(),s=T();return r.initializing?([o,n]=j(()=>Q(()=>r.initialized).toBe(!0)),await o,n(),r.addLibraryRoot()):([o,n]=j(()=>r.initialize1()),await o,n(),[o,n]=j(()=>r.initialize2()),await o,n()),[o,n]=j(()=>s.initialize()),await o,n(),it(s.placeNodes),(m,y)=>(l(),I(t(pt),{canvasId:["instance",t(r).projectId,t(s).stateId,t(s).version],components:t(i).library.components,entities:t(i).library.entities,"input-resolver-outputs":t(u).inputResolverOutputs,editable:""},{"node-instance":f(c=>[g(t(ot),$(F(c)),null,16)]),"node-inputs":f(c=>[t(s).instance?(l(),I(ft,M({key:0},c,{instance:t(s).instance}),null,16,["instance"])):R("",!0)]),"node-outputs":f(c=>[t(s).instance?(l(),I(yt,M({key:0},c,{instance:t(s).instance,type:"outputs"}),null,16,["instance"])):R("",!0)]),"node-hub":f(c=>[g(t(nt),$(F(c)),null,16)]),"panel-bottom-left":f(()=>[g(t(et))]),_:1},8,["canvasId","components","entities","input-resolver-outputs"]))}}),gt=U(It,[["__scopeId","data-v-2e3534bb"]]),St=C({__name:"CompositeInstanceWrapper",props:{projectId:{},stateId:{},version:{}},setup(e){return _.ensureCreated("instance",e.projectId,e.stateId,e.version),T.ensureCreated(e.projectId,e.stateId,e.version),(o,n)=>(l(),I(gt,{"project-id":e.projectId,"state-id":e.stateId,version:e.version},null,8,["project-id","state-id","version"]))}}),bt={key:1,class:"d-flex justify-center align-center h-100"},ht={class:"text-center"},Ct={key:2,class:"d-flex justify-center align-center h-100"},Lt=C({__name:"index",props:{params:{}},setup(e){const{instancesStore:o,stateStore:n}=X(e.params.projectId),r=p(()=>n.stateIdToStateMap.get(e.params.stateId)),u=p(()=>{const m=r.value;return m?o.instances.get(m.instanceId):void 0}),i=p(()=>o.initializationPhase==="ready"&&n.initializationPhase==="ready"),s=p(()=>!!(r.value&&u.value));return(m,y)=>(l(),I(t(vt),{"project-id":e.params.projectId,"can-unlock":""},{default:f(()=>[t(i)&&t(s)?(l(),I(t(St),{key:t(o).evaluationVersion,"project-id":e.params.projectId,"state-id":e.params.stateId,version:t(o).evaluationVersion},null,8,["project-id","state-id","version"])):t(i)?(l(),E("div",bt,[O("div",ht,[y[0]||(y[0]=O("h3",null,"Instance state not found",-1)),O("p",null,"No instance state found for state ID: "+rt(e.params.stateId),1)])])):(l(),E("div",Ct,[g(ct,{indeterminate:"",color:"dark",size:"32"})]))]),_:1},8,["project-id"]))}});export{Lt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as K,I as ke,bb as Pe,bc as Me,_ as ge,i as xe,Z as Se,n as Ue,Q as Be,ap as ue,a1 as Ne,bd as Le,a8 as Ae}from"#entry";import{E as R,V as f,Y as T,ai as ie,_ as o,W as n,aj as de,$ as L,a0 as j,D as e,al as Ge,a1 as M,j as k,aV as ce,J as N,aR as Ce,a2 as V,a7 as $e,aG as te,aa as E,ab as le,b8 as fe,aP as ne,w as se,ah as ye,bc as De,bd as Te,be as re,ak as Re,a as J,aT as ze,as as W,aI as me,aJ as he,aK as be,at as oe,Z as ve,r as D,a$ as je,am as Ee,an as pe,bf as qe,m as He,M as We,a5 as Je}from"./sB5TSp0H.js";import{H as Qe,I as Ye}from"./Bv_vOb-Y.js";import{I as Ze}from"./DHJ62FKo.js";import{_ as G,a as Ke}from"./-OnKOwAh.js";import{C as Xe}from"./D_wY_uke.js";import{P as _e}from"./D-7HtdRe.js";const Ie=R({__name:"EditorLoader",props:{text:{},value:{}},setup(t){const{instancesStore:a}=K(),b=k(()=>t.value===-1?t.text:`${t.text} ${t.value}/${a.totalInstanceCount}...`);return(S,c)=>t.text?(f(),T(ie,{key:0,variant:"tonal"},{default:o(()=>[n(de,{class:"text-overline"},{default:o(()=>[L(j(e(b)),1)]),_:1}),n(Ge,{indeterminate:t.value===-1,"model-value":t.value,max:e(a).totalInstanceCount,height:4,color:"primary",class:"w-full"},null,8,["indeterminate","model-value","max"])]),_:1})):M("",!0)}}),Nt=R({__name:"EditorLoaderPopup",setup(t){const{instancesStore:a,stateStore:b}=K(),S=k(()=>a.initializationPhase==="resolving"||b.initializationPhase==="calculating");return(c,w)=>e(S)?(f(),T(ie,{key:0,variant:"tonal"},{default:o(()=>[e(a).initializationPhase==="resolving"?(f(),T(Ie,{key:0,text:"Resolving instance inputs",value:e(a).resolvedInstanceCount},null,8,["value"])):M("",!0),e(b).initializationPhase==="calculating"?(f(),T(Ie,{key:1,text:"Detecting instance changes",value:e(b).calculatedInputHashCount},null,8,["value"])):M("",!0)]),_:1})):M("",!0)}}),Lt=R({__name:"HubNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const{stateStore:a}=K(),b=ce("contextMenu");return(S,c)=>(f(),T(Qe,{hub:t.data.hub,onContextmenu:c[0]||(c[0]=w=>e(b)?.showContextMenu(w))},{default:o(()=>[n(e(Oe),{ref_key:"contextMenu",ref:b,title:"Hub",subtitle:t.data.hub.id,"is-deletable":w=>e(a).isNodeDeletable(w)},null,8,["subtitle","is-deletable"])]),_:1},8,["hub"]))}}),et={key:0},tt={class:"d-flex flex-column"},nt={key:0,class:"text-caption text-medium-emphasis"},at={key:1,class:"text-body-2 text-medium-emphasis pa-4"},st=R({__name:"OperationPlanTree",props:{phases:{}},setup(t){const{instancesStore:a,libraryStore:b}=K(),S=k(()=>{const m=[];for(const i of t.phases){const v={id:`phase-${i.type}`,title:`${i.type.charAt(0).toUpperCase()+i.type.slice(1)} Phase`,subtitle:`${i.instances.length} instance${i.instances.length===1?"":"s"}`,icon:u(i.type),iconColor:C(i.type),phaseType:i.type,children:[]},d=c(i.instances);v.children=d,m.push(v)}return m}),c=m=>{const i=new Map;for(const d of m)i.has(d.id)||i.set(d.id,{...d,children:[]});for(const d of m)d.parentId&&i.has(d.parentId)&&i.get(d.parentId).children.push(d);return m.filter(d=>!d.parentId||!i.has(d.parentId)).map(d=>w(d,i))},w=(m,i)=>{const v=a.instances.get(m.id),d=v?b.library.components[v.type]:null,g={id:m.id,title:d&&v?`${d.meta.title} "${v.name}"`:m.id,subtitle:m.message,icon:d?.meta.icon??"iconamoon:component",iconColor:d?.meta.iconColor,phaseType:"instance"},p=i.get(m.id);return p&&p.children.length>0&&(g.children=p.children.map(l=>w(l,i))),g},u=m=>{switch(m){case"preview":return"mdi-eye";case"destroy":return"mdi-delete";case"update":return"mdi-update";case"refresh":return"mdi-refresh";default:return"mdi-cog"}},C=m=>{switch(m){case"preview":return"secondary";case"destroy":return"error";case"update":return"primary";case"refresh":return"info";default:return"secondary"}};return(m,i)=>t.phases.length>0?(f(),N("div",et,[n(Ce,{items:e(S),"item-title":"title","item-value":"id",density:"compact","open-all":"","indent-lines":"","bg-color":"#2d2d2d"},{prepend:o(({item:v})=>[n(e(ke),{icon:v.icon,color:v.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:o(({item:v})=>[V("div",tt,[V("div",{class:$e(["text-body-2",v.phaseType==="instance"?"font-weight-regular":"font-weight-medium"])},j(v.title),3),v.subtitle?(f(),N("div",nt,j(v.subtitle),1)):M("",!0)])]),_:1},8,["items"])])):(f(),N("div",at," No changes planned for this operation. "))}}),ot={key:0},it={class:"text-caption"},lt=R({__name:"OperationOptions",props:ne({operation:{},compositeTargetsOnly:{type:Boolean,default:!1}},{options:{default:{}},optionsModifiers:{}}),emits:["update:options"],setup(t){const a=te(t,"options"),b=k(()=>Ve(t.operation,{compositeTargetsOnly:t.compositeTargetsOnly})),S=(c,w)=>{const u=w??!1;c==="forceUpdateDependencies"&&u&&(a.value.ignoreChangedDependencies=!1,a.value.ignoreDependencies=!1),c==="ignoreChangedDependencies"&&u&&(a.value.forceUpdateDependencies=!1,a.value.ignoreDependencies=!1),c==="ignoreDependencies"&&u&&(a.value.forceUpdateDependencies=!1,a.value.ignoreChangedDependencies=!1),c==="onlyDestroyGhosts"&&u&&(a.value.firstDestroyGhosts=!1,a.value.ignoreGhosts=!1),c==="firstDestroyGhosts"&&u&&(a.value.onlyDestroyGhosts=!1,a.value.ignoreGhosts=!1),c==="ignoreGhosts"&&u&&(a.value.onlyDestroyGhosts=!1,a.value.firstDestroyGhosts=!1),a.value[c]=u};return(c,w)=>a.value?(f(),N("div",ot,[(f(!0),N(E,null,le(e(b),u=>(f(),N(E,{key:u.key},[n(fe,{"model-value":a.value[u.key],"onUpdate:modelValue":C=>S(u.key,C),class:$e(u===e(b)[0]?"mt-2":""),label:u.label,density:"compact","hide-details":""},null,8,["model-value","onUpdate:modelValue","class","label"]),V("div",it,j(u.description),1)],64))),128))])):M("",!0)}}),rt={class:"metadata-section"},dt={class:"options-header"},ct={class:"text-body-2 text-medium-emphasis mb-4"},ut={class:"options-scrollable"},pt={class:"plan-header"},ft={class:"plan-scrollable"},mt={key:0,class:"plan-warnings"},vt=R({__name:"InstanceOperationDialog",props:ne({instances:{},component:{},operation:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const a=te(t,"visible"),{operationsStore:b,projectStore:S}=K(),c=k(()=>t.instances.length>1),w=k(()=>t.instances[0]),u=D({forceUpdateDependencies:!1,ignoreDependencies:!1,ignoreChangedDependencies:!1,forceUpdateChildren:!1,onlyDestroyGhosts:!1,firstDestroyGhosts:!1,ignoreGhosts:!1,destroyDependentInstances:!1,invokeDestroyTriggers:!0,deleteUnreachableResources:!1,forceDeleteState:!1,allowPartialCompositeInstanceUpdate:!1,allowPartialCompositeInstanceDestruction:!1,refresh:!1}),C=D([]),m=D(!1),i=D(null),v=D(""),d=D(""),g=k(()=>t.instances.every(y=>y.kind==="composite"));se([()=>t.operation,()=>t.instances],()=>{t.instances.length!==0&&(v.value=c.value?Pe(t.operation,t.instances):Me(t.operation,w.value),u.value={...u.value,destroyDependentInstances:t.operation==="destroy"})},{immediate:!0}),se(()=>u.value,()=>{p()},{deep:!0}),se(()=>a.value,y=>{y&&p()});const p=async()=>{if(a.value){m.value=!0,i.value=null;try{const y=await b.planOperation({projectId:S.projectId,type:t.operation,instanceIds:t.instances.map(s=>s.id),options:u.value});C.value=y}catch(y){console.error("Failed to load operation plan:",y),i.value=y instanceof Error?y.message:"Unknown error"}finally{m.value=!1}}},l=k(()=>{const y=new Set,s=new Set,U=new Set,_=new Set,I=new Set;for(const r of C.value)for(const h of r.instances){if(I.add(h.id),r.type==="update"){y.add(h.id);continue}if(r.type==="destroy"){s.add(h.id);continue}if(r.type==="refresh"){U.add(h.id);continue}r.type==="preview"&&_.add(h.id)}return{update:y.size,destroy:s.size,refresh:U.size,preview:_.size,unique:I.size}}),F=k(()=>{const y=Ve(t.operation,{compositeTargetsOnly:g.value}).filter(s=>!!s.warning&&!!u.value[s.key]).map(s=>s.warning);return[...new Set(y)]}),x=y=>`${y} instance${y===1?"":"s"}`,O=k(()=>{switch(t.operation){case"update":return"Update";case"preview":return"Preview";case"refresh":return"Refresh";case"destroy":return"Destroy";case"recreate":return"Recreate";default:return"Unknown operation"}}),q=k(()=>{const y=l.value;switch(t.operation){case"update":{const{update:s}=y;return s===0?O.value:`Update ${x(s)}`}case"recreate":return y.unique===0?O.value:`Recreate ${x(y.unique)}`;case"destroy":return y.destroy===0?O.value:`Destroy ${x(y.destroy)}`;case"refresh":return y.refresh===0?O.value:`Refresh ${x(y.refresh)}`;case"preview":return y.preview===0?O.value:`Preview ${x(y.preview)}`;default:return y.unique===0?O.value:`${O.value} ${x(y.unique)}`}}),z=k(()=>{switch(t.operation){case"update":return"primary";case"preview":return"secondary";case"refresh":return"info";case"destroy":return"error";case"recreate":return"warning";default:return"primary"}}),A=D(!1),H=async()=>{A.value=!0;try{await b.launchOperation({projectId:S.projectId,type:t.operation,instanceIds:t.instances.map(y=>y.id),options:u.value,meta:{title:v.value,description:d.value}}),a.value=!1}finally{A.value=!1}},Q=k(()=>c.value?`${O.value} ${t.instances.length} instances`:t.component?`${O.value} ${t.component.meta.title} "${w.value.name}"`:`${O.value} "${w.value.name}"`);return(y,s)=>(f(),T(ye,{modelValue:a.value,"onUpdate:modelValue":s[4]||(s[4]=U=>a.value=U),"max-width":"1200px",class:"operation-dialog"},{default:o(()=>[n(ie,{title:e(Q),color:t.component?.meta.color??"#2d2d2d",class:"operation-card"},{prepend:o(()=>[t.component&&!e(c)?(f(),T(e(Xe),{key:0,meta:t.component.meta},null,8,["meta"])):e(c)?(f(),T(ve,{key:1},{default:o(()=>[...s[5]||(s[5]=[L("mdi-format-list-bulleted",-1)])]),_:1})):(f(),T(ve,{key:2},{default:o(()=>[...s[6]||(s[6]=[L("mdi-cube-outline",-1)])]),_:1}))]),default:o(()=>[n(de,{class:"operation-card-content"},{default:o(()=>[n(De,{fluid:"",class:"pa-0 fill-height"},{default:o(()=>[n(Te,{"no-gutters":"",class:"fill-height"},{default:o(()=>[n(re,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:o(()=>[V("div",rt,[s[7]||(s[7]=V("div",{class:"text-overline mb-2"},"Metadata",-1)),n(Re,{modelValue:e(v),"onUpdate:modelValue":s[0]||(s[0]=U=>J(v)?v.value=U:null),label:"Title",variant:"outlined",density:"compact",class:"mb-3",hint:"A descriptive title for this operation (optional)","persistent-hint":""},null,8,["modelValue"]),n(ze,{modelValue:e(d),"onUpdate:modelValue":s[1]||(s[1]=U=>J(d)?d.value=U:null),label:"Description",variant:"outlined",density:"compact",rows:"2",hint:"Describe the purpose of this operation (optional)","persistent-hint":""},null,8,["modelValue"])]),n(W,{class:"my-4"}),V("div",dt,[s[10]||(s[10]=V("div",{class:"text-overline mb-2"},"Options",-1)),V("p",ct,[s[8]||(s[8]=L(" Configure how the ",-1)),V("b",null,j(t.operation),1),s[9]||(s[9]=L(" operation should be executed. These options control the behavior and scope of the operation. ",-1))])]),V("div",ut,[n(lt,{options:e(u),"onUpdate:options":s[2]||(s[2]=U=>J(u)?u.value=U:null),operation:t.operation,"composite-targets-only":e(g)},null,8,["options","operation","composite-targets-only"])])]),_:1}),n(W,{vertical:"",class:"d-none d-md-flex"}),n(re,{cols:"12",md:"7",class:"pl-md-4 column-container"},{default:o(()=>[V("div",pt,[s[11]||(s[11]=V("div",{class:"text-overline mb-2"},"Execution Plan",-1)),s[12]||(s[12]=V("p",{class:"text-body-2 text-medium-emphasis mb-4"}," Preview of instances that will be affected by this operation. The plan shows the execution phases and which instances will be processed. ",-1)),e(i)?(f(),T(me,{key:0,type:"error",variant:"outlined",density:"compact",class:"mb-3"},{default:o(()=>[L(" Failed to load operation plan: "+j(e(i)),1)]),_:1})):M("",!0)]),V("div",ft,[n(st,{phases:e(C)},null,8,["phases"])]),e(F).length>0?(f(),N("div",mt,[(f(!0),N(E,null,le(e(F),U=>(f(),T(me,{key:U,density:"compact",type:"warning",variant:"outlined"},{default:o(()=>[L(j(U),1)]),_:2},1024))),128))])):M("",!0)]),_:1})]),_:1})]),_:1})]),_:1}),n(he,null,{default:o(()=>[n(be),n(oe,{onClick:s[3]||(s[3]=U=>a.value=!1)},{default:o(()=>[...s[13]||(s[13]=[L("Cancel",-1)])]),_:1}),n(oe,{color:e(z),loading:e(A),disabled:e(m),onClick:H},{default:o(()=>[L(j(e(q)),1)]),_:1},8,["color","loading","disabled"])]),_:1})]),_:1},8,["title","color"])]),_:1},8,["modelValue"]))}}),gt=ge(vt,[["__scopeId","data-v-542509f5"]]),yt={class:"tree-scrollable"},ht={class:"d-flex flex-column"},bt={class:"text-body-2 font-weight-regular"},wt={class:"text-caption text-medium-emphasis"},It=R({__name:"ForgetInstanceStateDialog",props:ne({instances:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const a=te(t,"visible"),{stateStore:b,libraryStore:S}=K(),c=k(()=>t.instances.length>1),w=k(()=>t.instances[0]),u=D(!1),C=D(!1),m=D(!1),i=k(()=>t.instances.map(g=>{const p=S.library.components?.[g.type];return{id:g.id,title:p?`${p.meta.title} "${g.name}"`:`${g.type} "${g.name}"`,subtitle:g.id,icon:p?.meta.icon??"iconamoon:component",iconColor:p?.meta.iconColor}})),v=async()=>{u.value=!0;try{await b.forgetInstanceStates(t.instances.map(g=>g.id),C.value,m.value),a.value=!1}finally{u.value=!1}},d=k(()=>{if(t.instances.length===0)return"Forget state";if(!c.value){const g=w.value,p=S.library.components?.[g.type];return p?`Forget state of ${p.meta.title} "${g.name}"`:`Forget state of ${g.type} "${g.name}"`}return`Forget state of ${t.instances.length} instances`});return(g,p)=>(f(),T(ye,{modelValue:a.value,"onUpdate:modelValue":p[3]||(p[3]=l=>a.value=l),"max-width":"1200px",class:"forget-dialog"},{default:o(()=>[n(ie,{title:e(d),color:"#2d2d2d",class:"forget-card"},{default:o(()=>[n(de,{class:"forget-card-content"},{default:o(()=>[n(De,{fluid:"",class:"pa-0 fill-height"},{default:o(()=>[n(Te,{"no-gutters":"",class:"fill-height"},{default:o(()=>[n(re,{cols:"12",md:"5",class:"pr-md-4 column-container"},{default:o(()=>[p[5]||(p[5]=V("div",{class:"text-overline mb-2"},"Options",-1)),n(fe,{modelValue:e(C),"onUpdate:modelValue":p[0]||(p[0]=l=>J(C)?C.value=l:null),label:"Delete all secrets associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(fe,{modelValue:e(m),"onUpdate:modelValue":p[1]||(p[1]=l=>J(m)?m.value=l:null),label:"Clear all terminal data associated with this instance",density:"compact","hide-details":""},null,8,["modelValue"]),n(me,{density:"compact",type:"warning",variant:"outlined",class:"mt-4 alert-auto"},{default:o(()=>[...p[4]||(p[4]=[V("div",null," No destroy operation will be performed, so all resources will be left in place and unreachable by HighState. ",-1),V("div",null," You should only use this operation when the instance is unreachable/unrecoverable and you want to start from scratch. ",-1)])]),_:1})]),_:1}),n(W,{vertical:"",class:"d-none d-md-flex"}),n(re,{cols:"12",md:"7",class:"pl-md-4 mt-4 mt-md-0 column-container"},{default:o(()=>[p[6]||(p[6]=V("div",{class:"text-overline mb-2"},"Instances",-1)),V("div",yt,[n(Ce,{items:e(i),"item-title":"title","item-value":"id",density:"compact","bg-color":"#2d2d2d",class:"forget-instance-tree"},{prepend:o(({item:l})=>[n(e(ke),{icon:l.icon,color:l.iconColor,width:"20",class:"mr-2"},null,8,["icon","color"])]),title:o(({item:l})=>[V("div",ht,[V("div",bt,j(l.title),1),V("div",wt,j(l.subtitle),1)])]),_:1},8,["items"])])]),_:1})]),_:1})]),_:1})]),_:1}),n(he,null,{default:o(()=>[n(be),n(oe,{onClick:p[2]||(p[2]=l=>a.value=!1)},{default:o(()=>[...p[7]||(p[7]=[L("Cancel",-1)])]),_:1}),n(oe,{loading:e(u),onClick:v},{default:o(()=>[L(" Forget State"+j(e(c)?` (${t.instances.length})`:""),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),kt=ge(It,[["__scopeId","data-v-7881a32c"]]),xt={class:"session-list-cointainer"},St=R({__name:"TerminalListSubmenu",props:ne({stateId:{},terminalIds:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const{instancesStore:a,stateStore:b}=K(),{state:S,execute:c,isLoading:w}=b.getTerminalsState(k(()=>t.terminalIds)),{state:u,execute:C,isLoading:m}=a.getTerminalSessionsState(k(()=>t.stateId)),i=te(t,"visible");se(i,l=>{l&&(C(),c())});const v=l=>l.finishedAt?`Finished at ${new Date(l.finishedAt).toLocaleString()}`:`Started at ${new Date(l.startedAt).toLocaleString()}`,d=l=>{const F=qe();return l.finishedAt?"#9E9E9E":F.current.value.colors.success},g=D(null),p=async l=>{g.value=l;try{await a.openTerminal(l,!0)}finally{g.value=null}};return(l,F)=>(f(),T(e(G),{icon:"mdi-console",title:"Terminals"},{append:o(()=>[n(ve,{icon:"mdi-menu-right",size:"x-small"})]),default:o(()=>[n(je,{modelValue:i.value,"onUpdate:modelValue":F[0]||(F[0]=x=>i.value=x),"open-on-focus":!1,"open-on-hover":"","close-on-content-click":!1,submenu:"",activator:"parent"},{default:o(()=>[n(Ee,{density:"compact",variant:"text"},{default:o(()=>[n(pe,{class:"text-overline"},{default:o(()=>[...F[1]||(F[1]=[L("Available Terminals",-1)])]),_:1}),(f(!0),N(E,null,le(e(S),x=>(f(),T(e(G),{key:x.id,disabled:!!e(g),title:x.meta.title,subtitle:x.meta.description,"custom-icon":x.meta.icon,loading:e(g)===x.id,icon:"mdi-console",onClick:O=>p(x.id)},null,8,["disabled","title","subtitle","custom-icon","loading","onClick"]))),128)),n(W,{class:"mt-2 mb-2"}),n(pe,{class:"text-overline"},{default:o(()=>[...F[2]||(F[2]=[L("Sessions",-1)])]),_:1}),V("div",xt,[(f(!0),N(E,null,le(e(u),x=>(f(),T(e(G),{key:x.id,title:x.meta.title,subtitle:v(x),"custom-icon":x.meta.icon,icon:"mdi-console",color:d(x),onClick:O=>e(a).openTerminalSession(x)},null,8,["title","subtitle","custom-icon","color","onClick"]))),128))]),e(u).length===0?(f(),T(pe,{key:0,class:"text-disabled"},{default:o(()=>[...F[3]||(F[3]=[L(" No sessions found ",-1)])]),_:1})):M("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1}))}}),Ct=ge(St,[["__scopeId","data-v-7c86584d"]]),$t=R({__name:"InstanceContextMenu",props:{instance:{},component:{},state:{},terminalIds:{},stores:{},operation:{},locked:{type:Boolean},editable:{type:Boolean},ghost:{type:Boolean,default:!1}},setup(t,{expose:a}){const b=k(()=>t.terminalIds??t.state?.terminalIds??[]),{projectStore:S,stateStore:c,operationsStore:w}=t.stores,u=xe(),{selection:C}=Se(),m=D(!1),i=D(!1),v=D("update"),d=D([]),g=D(!1),p=D([]),l=k(()=>C.selectedInstances.length>1&&C.selectedInstances.some(r=>r.id===t.instance.id)?C.selectedInstances:[t.instance]),F=k(()=>l.value.length>1),x=(I,r,h)=>{if(h==="preview"&&(F.value||I.kind!=="unit"))return!1;const X=Be(r?.lastOperationState?.status);switch(h){case"update":return!X;case"refresh":return ue(r)&&!X;case"preview":return!X;case"recreate":case"destroy":return ue(r)&&!X;default:return!1}},O=I=>t.ghost&&I!=="destroy"?!1:l.value.some(r=>{const h=c.instanceStates.get(r.id);return x(r,h,I)}),q=I=>t.ghost&&I!=="destroy"?!1:l.value.every(r=>{const h=c.instanceStates.get(r.id);return x(r,h,I)}),z=k(()=>l.value.some(I=>{const r=c.instanceStates.get(I.id);return ue(r)})),A=I=>{const r=l.value.length;return r===1?I==="update"?z.value?"Update":"Create":I.charAt(0).toUpperCase()+I.slice(1):I==="update"?`${z.value?"Update":"Create"} selected (${r})`:`${I.charAt(0).toUpperCase()+I.slice(1)} selected (${r})`},H=I=>{if(F.value)return"mdi-format-list-bulleted";switch(I){case"update":return z.value?"mdi-play":"mdi-rocket-launch";case"refresh":return"mdi-reload";case"preview":return"mdi-eye";case"recreate":return"mdi-restart";case"destroy":return"mdi-stop";default:return"mdi-play"}},Q=I=>{v.value=I,d.value=l.value,i.value=!0,m.value=!1,C.clearSelection()},y=()=>{p.value=l.value,g.value=!0,m.value=!1,C.clearSelection()},s=ce("contextMenu"),U=async I=>{s.value&&await s.value.showContextMenu(I)},_=async()=>{if(l.value.length!==1||t.instance.kind!=="unit"){m.value=!1;return}const I=await w.launchInstanceOperation("preview",t.instance);m.value=!1,t.state&&await u.openLogsPanel(S.projectId,I.id,t.state.id)};return a({showContextMenu:U}),(I,r)=>(f(),N(E,null,[n(e(Oe),{ref_key:"contextMenu",ref:s,visible:e(m),"onUpdate:visible":r[6]||(r[6]=h=>J(m)?m.value=h:null),title:"Instance",subtitle:t.instance.id,"is-deletable":h=>t.stores.stateStore.isNodeDeletable(h)},{default:o(()=>[O("update")?(f(),T(e(G),{key:0,title:A("update"),icon:H("update"),color:"primary",disabled:t.locked||!q("update"),onClick:r[0]||(r[0]=h=>Q("update"))},null,8,["title","icon","disabled"])):M("",!0),O("refresh")?(f(),T(e(G),{key:1,title:A("refresh"),icon:H("refresh"),color:"primary",disabled:t.locked||!q("refresh"),onClick:r[1]||(r[1]=h=>Q("refresh"))},null,8,["title","icon","disabled"])):M("",!0),O("preview")?(f(),T(e(G),{key:2,title:A("preview"),icon:H("preview"),color:"secondary",disabled:t.locked||!q("preview"),onClick:_},null,8,["title","icon","disabled"])):M("",!0),t.state?.lastOperationState?(f(),N(E,{key:3},[n(W),n(e(G),{title:"Open Logs",icon:"mdi-text",color:"primary",onClick:r[2]||(r[2]=h=>e(c).openInstanceLogs(t.instance))})],64)):M("",!0),n(W),n(e(G),{title:"View in Settings",icon:"mdi-cog",color:"primary",onClick:r[3]||(r[3]=()=>{const h=e(c).getInstanceState(t.instance.id);h&&("navigateTo"in I?I.navigateTo:e(Ue))({name:"settings.instance-details",params:{projectId:e(S).projectId,stateId:h.id}}),m.value=!1})}),t.state?.id&&e(b).length>0?(f(),N(E,{key:4},[n(W),n(Ct,{"state-id":t.state.id,"terminal-ids":e(b)},null,8,["state-id","terminal-ids"])],64)):M("",!0),e(z)||t.ghost?(f(),N(E,{key:5},[n(W),O("recreate")?(f(),T(e(G),{key:0,title:A("recreate"),icon:H("recreate"),color:"warning",disabled:t.locked||!q("recreate"),onClick:r[4]||(r[4]=h=>Q("recreate"))},null,8,["title","icon","disabled"])):M("",!0),O("destroy")?(f(),T(e(G),{key:1,title:A("destroy"),icon:H("destroy"),color:"error",disabled:t.locked||!q("destroy"),onClick:r[5]||(r[5]=h=>Q("destroy"))},null,8,["title","icon","disabled"])):M("",!0),n(e(G),{title:e(F)?`Forget State selected (${e(l).length})`:"Forget State",icon:"mdi-delete-forever",color:"error",disabled:t.locked,onClick:y},null,8,["title","disabled"])],64)):M("",!0)]),_:1},8,["visible","subtitle","is-deletable"]),n(gt,{visible:e(i),"onUpdate:visible":r[7]||(r[7]=h=>J(i)?i.value=h:null),operation:e(v),instances:e(d),component:t.component},null,8,["visible","operation","instances","component"]),n(kt,{visible:e(g),"onUpdate:visible":r[8]||(r[8]=h=>J(g)?g.value=h:null),instances:e(p)},null,8,["visible","instances"])],64))}}),Dt=[{key:"forceUpdateDependencies",label:"Force update dependencies",description:"Force update all dependencies regardless of their current state. Bypasses hash-based change detection for dependency chains.",showForOperations:["update"]},{key:"ignoreChangedDependencies",label:"Ignore changed dependencies",description:"Skip only changed dependencies. Failed or undeployed dependencies of selected instances are still included.",showForOperations:["update"]},{key:"ignoreDependencies",label:"Ignore dependencies",description:"Skip all dependencies of selected instances, including failed and undeployed prerequisites. Operate only on explicitly selected instances.",warning:"This is manual mode. The operation may fail unless every required prerequisite instance is selected explicitly.",showForOperations:["update"]},{key:"forceUpdateChildren",label:"Force update children instances",description:"Force update all children of composite instances regardless of their state. Overrides selective child inclusion logic.",showForOperations:["update"]},{key:"onlyDestroyGhosts",label:"Only destroy ghosts",description:"Skip update phase and run only ghost cleanup destroy phase for affected composite instances.",showForOperations:["update"],requiresCompositeTargets:!0},{key:"firstDestroyGhosts",label:"Destroy ghosts before update",description:"Run ghost cleanup destroy phase before update phase for affected composite instances.",showForOperations:["update"],requiresCompositeTargets:!0},{key:"ignoreGhosts",label:"Ignore ghosts",description:"Skip ghost cleanup destroy phase for update operations.",showForOperations:["update"],requiresCompositeTargets:!0},{key:"destroyDependentInstances",label:"Destroy dependent instances",description:"Include dependent instances when destroying instances. Traverses the dependency graph in reverse to prevent orphaned instances.",defaultValue:!0,showForOperations:["destroy","recreate"]},{key:"invokeDestroyTriggers",label:"Invoke destroy triggers",description:"Execute destroy triggers when destroying instances. Controls trigger execution during the destruction phase.",defaultValue:!0},{key:"deleteUnreachableResources",label:"Delete unreachable resources",description:"Delete Pulumi resources that are no longer referenced in the state. Deletes orphaned resources within individual instances.",warning:"All resources that will not be reachable at the moment of the destroy operation will be removed from the state. Only use when you are sure that these resources do not actually exist!"},{key:"forceDeleteState",label:"Force delete state",description:"Force deletion of instance state even if the destroy operation fails. Bypasses normal destroy procedures as emergency fallback.",warning:"This will delete the stack state and all resources in it even if the destroy operation failed. Use only when the stack is unrecoverable and you want to start from scratch.",showForOperations:["destroy","recreate"]},{key:"allowPartialCompositeInstanceUpdate",label:"Allow partial update of composite instances",description:"Allow update of individual composite children without requiring all siblings. When enabled, only necessary children are included.",showForOperations:["update","recreate"]},{key:"allowPartialCompositeInstanceDestruction",label:"Allow partial destruction of composite instances",description:"Allow partial destruction of composite instances during cascade operations. When enabled, cascade destruction includes only directly dependent children.",showForOperations:["destroy","recreate"]},{key:"refresh",label:"Refresh state before operation",description:"Also refresh the state of instances during the operation. Synchronizes state with actual infrastructure."},{key:"debug",label:"Enable debug logging",description:"Enable debug logging for Pulumi engine and resource providers. Sets TF_LOG=DEBUG for Terraform providers.",warning:"Debug mode may expose sensitive information including credentials in the logs. Use only when absolutely necessary for troubleshooting."}],Ve=(t,a)=>Dt.filter(b=>b.requiresCompositeTargets&&!a?.compositeTargetsOnly?!1:b.showForOperations?b.showForOperations.includes(t):!0),Tt=R({__name:"PageDialog",props:ne({meta:{},content:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const a=te(t,"visible");return(b,S)=>(f(),T(ye,{modelValue:a.value,"onUpdate:modelValue":S[1]||(S[1]=c=>a.value=c),"max-width":"80vh","max-height":"60vh"},{default:o(()=>[n(ie,{title:t.meta.title,color:"#2d2d2d"},{default:o(()=>[n(de,{style:{"overflow-y":"scroll"}},{default:o(()=>[n(_e,{content:t.content},null,8,["content"])]),_:1}),n(he,null,{default:o(()=>[n(be),n(oe,{onClick:S[0]||(S[0]=c=>a.value=!1)},{default:o(()=>[...S[2]||(S[2]=[L("Close",-1)])]),_:1})]),_:1})]),_:1},8,["title"])]),_:1},8,["modelValue"]))}}),At=R({__name:"InstanceNodeWrapper",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(t){const a=K(),b=xe(),{projectStore:S,stateStore:c,instancesStore:w,libraryStore:u,operationsStore:C,validationStore:m}=a,i=k(()=>t.data.instance),v=k(()=>{const B=u.library.components[i.value.type];if(!B)throw new Error(`component "${i.value.type}" for instance "${i.value.id}" not found in library`);return B}),d=k(()=>c.instanceStates.get(i.value.id)),g=k(()=>d.value&&c.instanceLocks.get(d.value.id)),p=k(()=>C.getLastInstanceOperation(i.value.id)),l=k(()=>w.isGhostInstance(i.value.id)),F=D(!1),x=D(!1),O=D(),q=D([]),z=D(!1),A=D(!1),H=D({}),Q=async()=>{F.value=!0;try{if(!d.value?.pageIds)return;const B=d.value.pageIds;if(!B.length)return;const $=await c.getPage(B[0]);if(!$)return;q.value=$.content,O.value=$.meta,x.value=!0}finally{F.value=!1}},y=D(!1),s=k(()=>{const B=d.value?.terminalIds??[];if(v.value.kind!=="composite")return B;const $=new Set,P=new Set,Y=[],ee=Z=>{for(const ae of Z??[])P.has(ae)||(P.add(ae),Y.push(ae))},we=Z=>{if($.has(Z))return;$.add(Z);const ae=c.instanceStates.get(Z);ee(ae?.terminalIds);for(const Fe of w.getInstanceChildren(Z))we(Fe.id)};ee(B);for(const Z of w.getInstanceChildren(i.value.id))we(Z.id);return Y}),U=async()=>{y.value=!0;try{if(s.value.length===0)return;await w.openTerminal(s.value[0])}finally{y.value=!1}},_=async()=>{A.value=!0;try{if(!d.value)return;const B=await a.stateStore.getInstanceSecrets(d.value.id);H.value={...B},z.value=!0}finally{A.value=!1}},I=ce("contextMenu"),r=Ne(),h=D(null),X=B=>l.value?!1:Le(r,u.library,w.inputResolverOutputs,B);return se(()=>({ghost:l.value,initialized:r.areNodesInitialized.value}),({ghost:B,initialized:$})=>{if(!$)return;const P=r.findNode(t.id);if(P){if(!B){if(h.value){const{connectable:Y,draggable:ee}=h.value;r.updateNode(t.id,()=>({connectable:Y,draggable:ee})),h.value=null}return}h.value||(h.value={connectable:!!P.connectable,draggable:P.draggable??!0}),r.updateNode(t.id,()=>({connectable:!1,draggable:!0}))}},{immediate:!0}),(B,$)=>(f(),T(Ye,{"editing-secrets":e(z),"onUpdate:editingSecrets":$[2]||($[2]=P=>J(z)?z.value=P:null),"loading-secrets":e(A),"initial-secrets":e(H),"loading-page":e(F),instance:t.data.instance,component:e(v),entities:e(u).library.entities,"project-id":e(S).projectId,"input-resolver-outputs":e(w).inputResolverOutputs,"input-resolver-dependent-map":e(w).inputResolverDependentMap,"is-valid-connection":X,"instance-lock":e(g),state:e(d),"terminal-ids":e(s),editable:t.data.editable&&!e(l),ghost:e(l),stores:("markRaw"in B?B.markRaw:e(He))(e(a)),"workspace-store":e(b),"all-instances":e(w).instances,"onSave:args":$[3]||($[3]=(P,Y,ee)=>e(w).updateInstance(P,Y,ee)),"onSave:secrets":$[4]||($[4]=(P,Y)=>e(c).updateInstanceSecrets(P,Y)),"onOpen:secrets":_,"onOpen:terminal":U,"onOperation:launch":$[5]||($[5]=P=>e(C).launchQuickInstanceOperation(P,t.data.instance)),"onOperation:cancel":$[6]||($[6]=P=>e(C).cancelInstanceOperation(e(d).lastOperationState.operationId,t.data.instance.id)),onContextmenu:$[7]||($[7]=P=>e(I)?.showContextMenu(P)),"onOpen:composite":$[8]||($[8]=P=>e(b).openCompositeInstancePanel(e(S).projectId,e(d).id)),"onOpen:page":Q},{status:o(()=>[n(e(Ze),{state:e(d),operation:e(p),"expected-input-hash":e(c).inputHashOutputs.get(e(i).id)?.inputHash,"validation-output":e(m).validationOutputs.get(e(i).id)},null,8,["state","operation","expected-input-hash","validation-output"])]),default:o(()=>[n(e($t),{ref_key:"contextMenu",ref:I,stores:e(a),instance:e(i),component:e(v),state:e(d),"terminal-ids":e(s),editable:t.data.editable&&!e(l),locked:!!e(g),ghost:e(l)},null,8,["stores","instance","component","state","terminal-ids","editable","locked","ghost"]),e(O)?(f(),T(e(Tt),{key:0,visible:e(x),"onUpdate:visible":$[0]||($[0]=P=>J(x)?x.value=P:null),meta:e(O),content:e(q),onClose:$[1]||($[1]=P=>x.value=!1)},null,8,["visible","meta","content"])):M("",!0)]),_:1},8,["editing-secrets","loading-secrets","initial-secrets","loading-page","instance","component","entities","project-id","input-resolver-outputs","input-resolver-dependent-map","instance-lock","state","terminal-ids","editable","ghost","stores","workspace-store","all-instances"]))}}),Oe=R({__name:"NodeContextMenu",props:ne({title:{},subtitle:{},isDeletable:{type:Function}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t,{expose:a}){const{selection:b,vueFlowStore:S,deleteNodes:c}=Se(),w=te(t,"visible"),u=Ae(),C=ce("contextMenu"),m=async g=>{C.value&&await C.value.showContextMenu(g)},{off:i}=S.onViewportChange(()=>{w.value=!1});We(()=>{i(),w.value=!1}),a({showContextMenu:m});const v=k(()=>t.isDeletable(u.node)?b.selectedNodeIds.has(u.id)?Array.from(b.selectedNodes).filter(t.isDeletable):[u.node]:[]),d=k(()=>v.value.length===1?"Delete":`Delete selected (${v.value.length})`);return(g,p)=>(f(),T(Ke,{ref_key:"contextMenu",ref:C,visible:w.value,"onUpdate:visible":p[1]||(p[1]=l=>w.value=l),title:t.title,subtitle:t.subtitle},{default:o(()=>[g.$slots.default?(f(),N(E,{key:0},[n(W),Je(g.$slots,"default")],64)):M("",!0),e(v).length>0?(f(),N(E,{key:1},[n(W),n(G,{title:e(d),icon:"mdi-delete",color:"error",onClick:p[0]||(p[0]=l=>e(c)(e(v)))},null,8,["title"])],64)):M("",!0)]),_:3},8,["visible","title","subtitle"]))}});export{Nt as _,Lt as a,At as b,$t as c};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as f,T as v,U as b,_ as w}from"#entry";import{E,aV as p,H as g,M as c,w as h,s as x,V as A,J as T,n as d,j as y}from"./sB5TSp0H.js";const k=E({__name:"GenericTerminal",props:{columns:{},rows:{},content:{}},emits:["load"],setup(t,{emit:m}){const i=p("terminalEl"),l=!t.columns||!t.rows,u=m;let e=null,o=null;function a(){if(!l||!o||!i.value)return;const{clientWidth:s,clientHeight:n}=i.value;s<=0||n<=0||o.fit()}return g(()=>{e=new f.Terminal({fontFamily:"monospace"}),o=new v.FitAddon;const s=new b.WebglAddon;if(l?e.loadAddon(o):e.resize(t.columns,t.rows),e.loadAddon(s),e.open(i.value),l){a();const n=new ResizeObserver(()=>{a()});n.observe(i.value);const r=()=>{document.visibilityState==="visible"&&d(()=>a())};document.addEventListener("visibilitychange",r),c(()=>{n.disconnect(),document.removeEventListener("visibilitychange",r)})}u("load",e),t.content!==void 0&&h(y(()=>t.content),n=>{e&&(e.clear(),e.write(n.replace(/\n/g,`\r
|
|
2
|
-
`)))},{immediate:!0}),c(()=>{e?.dispose()})}),x(()=>{d(()=>a())}),(s,n)=>(A(),T("div",{ref_key:"terminalEl",ref:i,class:"terminal-container"},null,512))}}),G=w(k,[["__scopeId","data-v-6dbe4655"]]);export{G};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{x as G,m as H,y as q,z as N,A as W,B as T,C as K,s as $,v as D,t as S,n as Q}from"#entry";import{E,V as x,Y as F,D as e,_ as n,W as o,n as M,aO as j,at as Y,$ as O,a2 as R,a0 as J,ai as X,aL as Z,aj as _,aQ as ee,a1 as te}from"./sB5TSp0H.js";import{I as k}from"./CemiMtCX.js";import{S as ae}from"./BCJKqJxW.js";import{D as se,a as oe}from"./DCK6hB22.js";import{O as ie}from"./y0GN4iGv.js";import{_ as b}from"./CJN4g-3R.js";import{_ as ne}from"./xnReCuE4.js";import{_ as re}from"./BArXRmKu.js";import{_ as le}from"./rscZxuQ2.js";import{_ as de}from"./DdvHdmGh.js";import{_ as ue}from"./Bl_Sz9PU.js";import{_ as pe}from"./ZpmLW6rw.js";import{G as me,H as ge,I as ve}from"./Bv_vOb-Y.js";import{u as ce}from"./CYL3VlR9.js";import"./B69Z0Xk1.js";import"./CxoCegAs.js";import"./CBVcjGJL.js";import"./DkkrdwgN.js";import"./C973_vs5.js";import"./B2SoM2pd.js";import"./M3Z1JMP1.js";import"./BzhaMbyl.js";import"./DSpiceQe.js";import"./CaehGOgh.js";import"./GXzlut8R.js";import"./Bu1xs0Fv.js";import"./CBIEPWAA.js";import"./D_wY_uke.js";import"./DXyfavJr.js";import"./C4XpvUuq.js";import"./Lks7C8cK.js";import"./BxAss8Tj.js";const fe=E({__name:"PreviewCanvas",props:{instances:{},hubs:{default:()=>[]},components:{},entities:{},autoPosition:{type:Boolean,default:!0},interactive:{type:Boolean,default:!1}},emits:["ready"],setup(s,{emit:d}){const u=d,f=G.createId(),U=H.child({customCanvasId:f}),{outputs:P,dependentMap:B,set:y,dispatchInitialNodes:w}=q("InputResolver",U,K,!0),h=async i=>{i.nodeFactory.createNodesForModels(s.instances,s.hubs,{readonly:!0});for(const l of s.instances){const C=s.components[l.type];y(`instance:${l.id}`,{kind:"instance",instance:l,component:C,entities:s.entities})}for(const l of s.hubs)y(`hub:${l.id}`,{kind:"hub",hub:l,entities:s.entities});const I=[w()];s.autoPosition?I.push(N(i.vueFlowStore).then(()=>W(i.vueFlowStore)).then(()=>i.vueFlowStore.fitView()).then(()=>M()).then(()=>T(i.vueFlowStore,i.onNodesMoved,i.edgeEndpointOffsets))):I.push(N(i.vueFlowStore).then(()=>i.vueFlowStore.fitView()).then(()=>M()).then(()=>T(i.vueFlowStore,i.onNodesMoved,i.edgeEndpointOffsets))),await Promise.all(I),u("ready")};return(i,I)=>(x(),F(me,{"canvas-id":["custom",e(f)],onInit:h,"input-resolver-outputs":e(P),components:s.components,entities:s.entities,minimap:!1,interactive:s.interactive},{"node-instance":n(({data:l})=>[o(e(ve),{instance:l.instance,component:s.components[l.instance.type],entities:s.entities,"input-resolver-outputs":e(P),"input-resolver-dependent-map":e(B),editable:""},null,8,["instance","component","entities","input-resolver-outputs","input-resolver-dependent-map"])]),"node-hub":n(({data:l})=>[o(ge,{hub:l.hub},null,8,["hub"])]),_:1},8,["canvas-id","input-resolver-outputs","components","entities","interactive"]))}}),ye={class:"d-flex ga-6",style:{"min-height":"400px"}},Ie={class:"text-body-2 text-capitalize"},Ze=E({__name:"[stateId]",props:{params:{}},async setup(s){let d,u;const{settingsStore:f,instancesStore:U,stateStore:P,libraryStore:B}=$(),{projectStore:y}=$(),w=ce.ensureCreated(s.params.projectId);y.initializing?([d,u]=j(()=>S(()=>y.initialized).toBe(!0)),await d,u(),y.addLibraryRoot()):([d,u]=j(()=>y.initialize1()),await d,u(),[d,u]=j(()=>y.initialize2()),await d,u()),[d,u]=j(()=>S(()=>U.initializationPhase!=="loading").toBe(!0)),await d,u(),[d,u]=j(()=>S(()=>P.statesLoaded).toBe(!0)),await d,u();const h=P.getStateByStateId(s.params.stateId)?.instanceId;if(!h)throw D({statusCode:404,statusMessage:"Instance not found for the given state ID"});const i=U.instances.get(h);if(!i)throw D({statusCode:404,statusMessage:"Instance not found"});const I=B.library.components[i.type],l=I?.meta,C=[{key:"instanceId",label:"Instance ID"},{key:"stateId",label:"State ID"},{key:"type",label:"Component Type"},{key:"kind",label:"Kind"}],z=B.library.components,A=B.library.entities,p=f.terminalsForState(s.params.stateId),m=f.secretsForState(s.params.stateId),g=f.pagesForState(s.params.stateId),v=f.triggersForState(s.params.stateId),c=f.artifactsForState(s.params.stateId),V=P.instanceStates.get(h)?.lastOperationState?.operationId,r=V?f.entitySnapshotsForInstanceOperation(s.params.stateId,V):null;return p.load(),m.load(),g.load(),v.load(),c.load(),r&&r.load(),(L,t)=>(x(),F(e(oe),null,{default:n(()=>[o(ae,{meta:e(l),"fallback-icon":"mdi-cube-outline",title:e(I).meta.title,description:e(i).name},{actions:n(()=>[o(Y,{variant:"outlined","prepend-icon":"mdi-vector-square",onClick:t[0]||(t[0]=()=>{e(w).requestInstanceFocus(e(i).id),("navigateTo"in L?L.navigateTo:e(Q))({name:"project",params:{projectId:s.params.projectId}})})},{default:n(()=>[...t[25]||(t[25]=[O(" View in Canvas ",-1)])]),_:1})]),_:1},8,["meta","title","description"]),R("div",ye,[o(e(se),{title:"Instance Details",items:C,style:{flex:"1"}},{"item.instanceId":n(()=>[o(e(k),{truncate:!1,value:e(i).id},null,8,["value"])]),"item.stateId":n(()=>[o(e(k),{truncate:!1,value:s.params.stateId},null,8,["value"])]),"item.type":n(()=>[o(e(k),{truncate:!1,value:e(i).type},null,8,["value"])]),"item.kind":n(()=>[R("div",Ie,J(e(i).kind),1)]),_:1}),o(X,{style:{flex:"1",border:"solid 2px #2d2d2d"},elevation:0},{default:n(()=>[o(Z,{class:"d-flex align-center"},{default:n(()=>[...t[26]||(t[26]=[O("Preview",-1)])]),_:1}),o(_,{class:"pa-0",style:{height:"350px"}},{default:n(()=>[o(e(fe),{instances:[e(i)],hubs:[],components:e(z),entities:e(A),"auto-position":!1},null,8,["instances","components","entities"])]),_:1})]),_:1})]),o(ee,{elevation:0},{default:n(()=>[o(e(ie),{title:"Instance Model",data:e(i)},null,8,["data"]),o(e(b),{title:"Terminals",icon:"mdi-console",count:e(p).data.value.total},{default:n(()=>[o(e(ne),{search:e(p).search.value,"onUpdate:search":t[1]||(t[1]=a=>e(p).search.value=a),"sort-by":e(p).sortBy.value,"onUpdate:sortBy":t[2]||(t[2]=a=>e(p).sortBy.value=a),page:e(p).page.value,"onUpdate:page":t[3]||(t[3]=a=>e(p).page.value=a),"items-per-page":e(p).itemsPerPage.value,"onUpdate:itemsPerPage":t[4]||(t[4]=a=>e(p).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(p).data.value,loading:e(p).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(b),{title:"Secrets",icon:"mdi-key-variant",count:e(m).data.value.total},{default:n(()=>[o(e(re),{search:e(m).search.value,"onUpdate:search":t[5]||(t[5]=a=>e(m).search.value=a),"sort-by":e(m).sortBy.value,"onUpdate:sortBy":t[6]||(t[6]=a=>e(m).sortBy.value=a),page:e(m).page.value,"onUpdate:page":t[7]||(t[7]=a=>e(m).page.value=a),"items-per-page":e(m).itemsPerPage.value,"onUpdate:itemsPerPage":t[8]||(t[8]=a=>e(m).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(m).data.value,loading:e(m).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(b),{title:"Pages",icon:"mdi-file-document-outline",count:e(g).data.value.total},{default:n(()=>[o(e(le),{search:e(g).search.value,"onUpdate:search":t[9]||(t[9]=a=>e(g).search.value=a),"sort-by":e(g).sortBy.value,"onUpdate:sortBy":t[10]||(t[10]=a=>e(g).sortBy.value=a),page:e(g).page.value,"onUpdate:page":t[11]||(t[11]=a=>e(g).page.value=a),"items-per-page":e(g).itemsPerPage.value,"onUpdate:itemsPerPage":t[12]||(t[12]=a=>e(g).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(g).data.value,loading:e(g).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(b),{title:"Triggers",icon:"mdi-lightning-bolt",count:e(v).data.value.total},{default:n(()=>[o(e(de),{search:e(v).search.value,"onUpdate:search":t[13]||(t[13]=a=>e(v).search.value=a),"sort-by":e(v).sortBy.value,"onUpdate:sortBy":t[14]||(t[14]=a=>e(v).sortBy.value=a),page:e(v).page.value,"onUpdate:page":t[15]||(t[15]=a=>e(v).page.value=a),"items-per-page":e(v).itemsPerPage.value,"onUpdate:itemsPerPage":t[16]||(t[16]=a=>e(v).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(v).data.value,loading:e(v).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),o(e(b),{title:"Artifacts",icon:"mdi-package-variant",count:e(c).data.value.total},{default:n(()=>[o(e(ue),{search:e(c).search.value,"onUpdate:search":t[17]||(t[17]=a=>e(c).search.value=a),"sort-by":e(c).sortBy.value,"onUpdate:sortBy":t[18]||(t[18]=a=>e(c).sortBy.value=a),page:e(c).page.value,"onUpdate:page":t[19]||(t[19]=a=>e(c).page.value=a),"items-per-page":e(c).itemsPerPage.value,"onUpdate:itemsPerPage":t[20]||(t[20]=a=>e(c).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(c).data.value,loading:e(c).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),e(r)?(x(),F(e(b),{key:0,title:"Entities",icon:"mdi-database",count:e(r).data.value.total},{default:n(()=>[o(e(pe),{search:e(r).search.value,"onUpdate:search":t[21]||(t[21]=a=>e(r).search.value=a),"sort-by":e(r).sortBy.value,"onUpdate:sortBy":t[22]||(t[22]=a=>e(r).sortBy.value=a),page:e(r).page.value,"onUpdate:page":t[23]||(t[23]=a=>e(r).page.value=a),"items-per-page":e(r).itemsPerPage.value,"onUpdate:itemsPerPage":t[24]||(t[24]=a=>e(r).itemsPerPage.value=a),"project-id":s.params.projectId,data:e(r).data.value,loading:e(r).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"])):te("",!0)]),_:1})]),_:1}))}});export{Ze as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as A,v as B,t as j}from"#entry";import{_ as U,I as b}from"./CemiMtCX.js";import{S}from"./BCJKqJxW.js";import{D as k,a as w}from"./DCK6hB22.js";import{_ as y}from"./CJN4g-3R.js";import{_ as L}from"./xnReCuE4.js";import{_ as $}from"./BArXRmKu.js";import{_ as C}from"./rscZxuQ2.js";import{_ as D}from"./BTd2ZN65.js";import{_ as F}from"./OuCcJFrZ.js";import{_ as x}from"./Bl_Sz9PU.js";import{E as z,aO as f,Y as E,_ as p,D as e,V as K,W as r,aQ as V}from"./sB5TSp0H.js";import"./B69Z0Xk1.js";import"./CxoCegAs.js";import"./CBVcjGJL.js";import"./DkkrdwgN.js";import"./B2SoM2pd.js";import"./M3Z1JMP1.js";import"./BzhaMbyl.js";import"./DSpiceQe.js";import"./CaehGOgh.js";import"./GXzlut8R.js";import"./Bu1xs0Fv.js";import"./CBIEPWAA.js";const ne=z({__name:"[serviceAccountId]",props:{params:{}},async setup(o){let m,v;const{settingsStore:g}=A(),{projectStore:P}=A();P.initializing?([m,v]=f(()=>j(()=>P.initialized).toBe(!0)),await m,v(),P.addLibraryRoot()):([m,v]=f(()=>P.initialize1()),await m,v(),[m,v]=f(()=>P.initialize2()),await m,v());const c=([m,v]=f(()=>g.getServiceAccountDetails(o.params.serviceAccountId)),m=await m,v(),m);if(!c)throw B({statusCode:404,statusMessage:"Service Account not found"});const I=[{key:"serviceAccountId",label:"Service Account ID"},{key:"name",label:"Name"},{key:"createdAt",label:"Created"},{key:"updatedAt",label:"Last Updated"}],i=g.apiKeysForServiceAccount(o.params.serviceAccountId),s=g.terminalsForServiceAccount(o.params.serviceAccountId),l=g.pagesForServiceAccount(o.params.serviceAccountId),d=g.secretsForServiceAccount(o.params.serviceAccountId),n=g.workersForServiceAccount(o.params.serviceAccountId),u=g.artifactsForServiceAccount(o.params.serviceAccountId);return i.load(),s.load(),l.load(),d.load(),n.load(),u.load(),(N,a)=>(K(),E(e(w),null,{default:p(()=>[r(S,{meta:e(c).meta,"fallback-icon":"mdi-account-circle",title:e(c).meta.title,description:e(c).meta.description},null,8,["meta","title","description"]),r(e(k),{title:"Service Account Details",items:I},{"item.serviceAccountId":p(()=>[r(e(b),{value:e(c).id},null,8,["value"])]),"item.createdAt":p(()=>[r(e(U),{value:e(c).createdAt},null,8,["value"])]),"item.updatedAt":p(()=>[r(e(U),{value:e(c).updatedAt},null,8,["value"])]),_:1}),r(V,{elevation:0},{default:p(()=>[r(e(y),{title:"API Keys",icon:"mdi-key-variant",count:e(i).data.value.total},{default:p(()=>[r(e(D),{search:e(i).search.value,"onUpdate:search":a[0]||(a[0]=t=>e(i).search.value=t),"sort-by":e(i).sortBy.value,"onUpdate:sortBy":a[1]||(a[1]=t=>e(i).sortBy.value=t),page:e(i).page.value,"onUpdate:page":a[2]||(a[2]=t=>e(i).page.value=t),"items-per-page":e(i).itemsPerPage.value,"onUpdate:itemsPerPage":a[3]||(a[3]=t=>e(i).itemsPerPage.value=t),"project-id":o.params.projectId,data:e(i).data.value,loading:e(i).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),r(e(y),{title:"Terminals",icon:"mdi-console",count:e(s).data.value.total},{default:p(()=>[r(e(L),{search:e(s).search.value,"onUpdate:search":a[4]||(a[4]=t=>e(s).search.value=t),"sort-by":e(s).sortBy.value,"onUpdate:sortBy":a[5]||(a[5]=t=>e(s).sortBy.value=t),page:e(s).page.value,"onUpdate:page":a[6]||(a[6]=t=>e(s).page.value=t),"items-per-page":e(s).itemsPerPage.value,"onUpdate:itemsPerPage":a[7]||(a[7]=t=>e(s).itemsPerPage.value=t),"project-id":o.params.projectId,data:e(s).data.value,loading:e(s).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),r(e(y),{title:"Pages",icon:"mdi-file-document-outline",count:e(l).data.value.total},{default:p(()=>[r(e(C),{search:e(l).search.value,"onUpdate:search":a[8]||(a[8]=t=>e(l).search.value=t),"sort-by":e(l).sortBy.value,"onUpdate:sortBy":a[9]||(a[9]=t=>e(l).sortBy.value=t),page:e(l).page.value,"onUpdate:page":a[10]||(a[10]=t=>e(l).page.value=t),"items-per-page":e(l).itemsPerPage.value,"onUpdate:itemsPerPage":a[11]||(a[11]=t=>e(l).itemsPerPage.value=t),"project-id":o.params.projectId,data:e(l).data.value,loading:e(l).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),r(e(y),{title:"Secrets",icon:"mdi-key-variant",count:e(d).data.value.total},{default:p(()=>[r(e($),{search:e(d).search.value,"onUpdate:search":a[12]||(a[12]=t=>e(d).search.value=t),"sort-by":e(d).sortBy.value,"onUpdate:sortBy":a[13]||(a[13]=t=>e(d).sortBy.value=t),page:e(d).page.value,"onUpdate:page":a[14]||(a[14]=t=>e(d).page.value=t),"items-per-page":e(d).itemsPerPage.value,"onUpdate:itemsPerPage":a[15]||(a[15]=t=>e(d).itemsPerPage.value=t),"project-id":o.params.projectId,data:e(d).data.value,loading:e(d).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),r(e(y),{title:"Workers",icon:"mdi-progress-wrench",count:e(n).data.value.total},{default:p(()=>[r(e(F),{search:e(n).search.value,"onUpdate:search":a[16]||(a[16]=t=>e(n).search.value=t),"sort-by":e(n).sortBy.value,"onUpdate:sortBy":a[17]||(a[17]=t=>e(n).sortBy.value=t),page:e(n).page.value,"onUpdate:page":a[18]||(a[18]=t=>e(n).page.value=t),"items-per-page":e(n).itemsPerPage.value,"onUpdate:itemsPerPage":a[19]||(a[19]=t=>e(n).itemsPerPage.value=t),"project-id":o.params.projectId,data:e(n).data.value,loading:e(n).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),r(e(y),{title:"Artifacts",icon:"mdi-package-variant",count:e(u).data.value.total},{default:p(()=>[r(e(x),{search:e(u).search.value,"onUpdate:search":a[20]||(a[20]=t=>e(u).search.value=t),"sort-by":e(u).sortBy.value,"onUpdate:sortBy":a[21]||(a[21]=t=>e(u).sortBy.value=t),page:e(u).page.value,"onUpdate:page":a[22]||(a[22]=t=>e(u).page.value=t),"items-per-page":e(u).itemsPerPage.value,"onUpdate:itemsPerPage":a[23]||(a[23]=t=>e(u).itemsPerPage.value=t),"project-id":o.params.projectId,data:e(u).data.value,loading:e(u).isLoading.value,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"])]),_:1})]),_:1}))}});export{ne as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as L,a as O}from"./DfvKjH24.js";import{s as w,G as _,t as H,H as N,v as G,_ as K}from"#entry";import{_ as J,I as R}from"./CemiMtCX.js";import{S as Q}from"./BCJKqJxW.js";import{D as W,a as Y}from"./DCK6hB22.js";import{O as Z}from"./y0GN4iGv.js";import{_ as D}from"./CJN4g-3R.js";import{E as z,aG as B,V as h,Y as x,D as t,_ as l,W as r,a2 as f,a1 as P,a0 as E,J as F,aP as q,aO as j,B as C,w as X,j as U,aa as tt,aQ as et,aU as at,Z as it,$ as T}from"./sB5TSp0H.js";import{E as ot}from"./CaehGOgh.js";import{_ as nt}from"./GXzlut8R.js";import{S as st}from"./B2SoM2pd.js";import{C as $}from"./D_wY_uke.js";import{_ as rt}from"./Bu1xs0Fv.js";import{_ as lt}from"./ZpmLW6rw.js";import{_ as dt}from"./Lks7C8cK.js";import"./BxAss8Tj.js";import"./B69Z0Xk1.js";import"./CxoCegAs.js";import"./CBVcjGJL.js";import"./DkkrdwgN.js";import"./C973_vs5.js";const pt={class:"d-flex align-center ga-3"},ut={class:"d-flex flex-column"},mt={class:"text-body-2 font-weight-medium"},ct={key:0,class:"text-caption text-medium-emphasis"},yt={class:"d-flex align-center ga-3"},gt={class:"d-flex flex-column"},vt={class:"text-body-2 font-weight-medium"},ft={key:0,class:"text-caption text-medium-emphasis"},V=z({__name:"EntityReferencesTable",props:q({projectId:{},direction:{},data:{},loading:{type:Boolean},hideHeader:{type:Boolean},height:{}},{search:{},searchModifiers:{},sortBy:{},sortByModifiers:{},page:{},pageModifiers:{},itemsPerPage:{},itemsPerPageModifiers:{}}),emits:["update:search","update:sortBy","update:page","update:itemsPerPage"],setup(s){const c=B(s,"search"),y=B(s,"sortBy"),g=B(s,"page"),S=B(s,"itemsPerPage"),{libraryStore:I}=w(),b=[{key:s.direction==="outgoing"?"to":"from",title:"Entity"},{key:"group",title:"Group"},{key:"actions",title:"Actions",align:"center"}],m=u=>s.direction==="outgoing"?u.toEntityId:u.fromEntityId,d=u=>s.direction==="outgoing"?u.toEntityType:u.fromEntityType,p=u=>s.direction==="outgoing"?u.toEntityMeta:u.fromEntityMeta,i=u=>L({entities:I.library.entities,entityType:d(u),meta:p(u)});return(u,v)=>(h(),x(t(st),{search:c.value,"onUpdate:search":v[0]||(v[0]=o=>c.value=o),"sort-by":y.value,"onUpdate:sortBy":v[1]||(v[1]=o=>y.value=o),page:g.value,"onUpdate:page":v[2]||(v[2]=o=>g.value=o),"items-per-page":S.value,"onUpdate:itemsPerPage":v[3]||(v[3]=o=>S.value=o),headers:b,data:s.data,loading:s.loading,"hide-header":s.hideHeader,height:s.height},{"item.from":l(({item:o})=>[f("div",pt,[i(o).metaForIcon?(h(),x(t($),{key:0,meta:i(o).metaForIcon,size:24},null,8,["meta"])):P("",!0),f("div",ut,[f("div",mt,E(i(o).title),1),i(o).subtitle?(h(),F("div",ct,E(i(o).subtitle),1)):P("",!0)])])]),"item.to":l(({item:o})=>[f("div",yt,[i(o).metaForIcon?(h(),x(t($),{key:0,meta:i(o).metaForIcon,size:24},null,8,["meta"])):P("",!0),f("div",gt,[f("div",vt,E(i(o).title),1),i(o).subtitle?(h(),F("div",ft,E(i(o).subtitle),1)):P("",!0)])])]),"item.actions":l(({item:o})=>[r(t(rt),{"page-name":"settings.entity-details","page-params":{projectId:s.projectId,entityId:m(o)}},null,8,["page-params"])]),_:1},8,["search","sort-by","page","items-per-page","data","loading","hide-header","height"]))}}),ht={class:"text-body-2"},It={class:"d-flex align-center"},bt={class:"entity-snapshot-editor"},Pt=z({__name:"[snapshotId]",props:{params:{}},async setup(s){let c,y;const{settingsStore:g,libraryStore:S}=w(),{projectStore:I}=w(),M=_(),b=U(()=>String(M.params.snapshotId??s.params.snapshotId));I.initializing?([c,y]=j(()=>H(()=>I.initialized).toBe(!0)),await c,y(),I.addLibraryRoot()):([c,y]=j(()=>I.initialize1()),await c,y(),[c,y]=j(()=>I.initialize2()),await c,y());const m=C(),d=C(g.snapshotsForEntity("",b.value)),p=C(g.outgoingReferencesForEntitySnapshot(b.value)),i=C(g.incomingReferencesForEntitySnapshot(b.value)),u=async a=>{const e=await g.getEntitySnapshotDetails(a);if(!e){N(G({statusCode:404,statusMessage:"Entity snapshot not found"}));return}m.value=e,d.value=g.snapshotsForEntity(e.entity.id,a),p.value=g.outgoingReferencesForEntitySnapshot(a),i.value=g.incomingReferencesForEntitySnapshot(a),await d.value.load(),p.value.load(),i.value.load()};[c,y]=j(()=>u(b.value)),await c,y(),X(b,async a=>{await u(a)});const v=[{key:"entityId",label:"Entity ID"},{key:"type",label:"Type"},{key:"snapshotId",label:"Snapshot ID"},{key:"snapshotCreatedAt",label:"Snapshot Created"},{key:"operationId",label:"Operation ID"},{key:"stateId",label:"State ID"}],o=U(()=>{const a=m.value;if(a)return{snapshotId:a.snapshot.id,entityId:a.entity.id,entityType:a.entity.type,entityIdentity:a.entity.identity,content:a.snapshot.content}}),k=U(()=>{const a=m.value;return a?O({entities:S.library?.entities??{},entityType:a.entity.type,content:a.snapshot.content}):{title:"Unknown",subtitle:void 0,metaForIcon:void 0}}),A=U(()=>{const a=k.value.metaForIcon;if(a?.title)return{title:a.title,...a.icon?{icon:a.icon}:{},...a.iconColor?{iconColor:a.iconColor}:{}}});return(a,e)=>(h(),x(t(Y),null,{default:l(()=>[r(Q,{meta:t(A),"fallback-icon":"mdi-database",title:t(k).title,description:t(k).subtitle},null,8,["meta","title","description"]),t(m)?(h(),F(tt,{key:0},[r(t(W),{title:"Entity Snapshot Details",items:v},{"item.entityId":l(()=>[r(t(R),{value:t(m).entity.id},null,8,["value"])]),"item.type":l(()=>[f("div",ht,E(t(m).entity.type),1)]),"item.snapshotId":l(()=>[r(t(R),{value:t(m).snapshot.id},null,8,["value"])]),"item.snapshotCreatedAt":l(()=>[r(t(J),{value:t(m).snapshot.createdAt},null,8,["value"])]),"item.operationId":l(()=>[r(t(ot),{id:t(m).snapshot.operationId,"fallback-icon":"mdi-history","page-name":"settings.operation-details","page-params":{operationId:t(m).snapshot.operationId},"max-length":28},null,8,["id","page-params"])]),"item.stateId":l(()=>[r(t(nt),{item:{stateId:t(m).snapshot.stateId}},null,8,["item"])]),_:1}),r(et,{elevation:0},{default:l(()=>[r(t(Z),{title:"Identity",data:t(m).entity.identity,language:"yaml",icon:"mdi-identifier"},null,8,["data"]),r(at,{color:"#2d2d2d","bg-color":"#1e1e1e"},{title:l(()=>[f("div",It,[r(it,{class:"mr-2"},{default:l(()=>[...e[12]||(e[12]=[T("mdi-code-json",-1)])]),_:1}),e[13]||(e[13]=T(" Content ",-1))])]),text:l(()=>[f("div",bt,[t(o)?(h(),x(dt,{key:0,entity:t(o),"project-id":s.params.projectId,height:"400px"},null,8,["entity","project-id"])):P("",!0)])]),_:1}),r(t(D),{title:"Other snapshots",icon:"mdi-history",count:t(d).data.value.total},{default:l(()=>[r(t(lt),{search:t(d).search.value,"onUpdate:search":e[0]||(e[0]=n=>t(d).search.value=n),"sort-by":t(d).sortBy.value,"onUpdate:sortBy":e[1]||(e[1]=n=>t(d).sortBy.value=n),page:t(d).page.value,"onUpdate:page":e[2]||(e[2]=n=>t(d).page.value=n),"items-per-page":t(d).itemsPerPage.value,"onUpdate:itemsPerPage":e[3]||(e[3]=n=>t(d).itemsPerPage.value=n),"project-id":s.params.projectId,data:t(d).data.value,loading:t(d).isLoading.value,"fallback-icon-meta":t(k).metaForIcon,"hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading","fallback-icon-meta"])]),_:1},8,["count"]),r(t(D),{title:"References to other entities",icon:"mdi-call-made",count:t(p).data.value.total},{default:l(()=>[r(t(V),{search:t(p).search.value,"onUpdate:search":e[4]||(e[4]=n=>t(p).search.value=n),"sort-by":t(p).sortBy.value,"onUpdate:sortBy":e[5]||(e[5]=n=>t(p).sortBy.value=n),page:t(p).page.value,"onUpdate:page":e[6]||(e[6]=n=>t(p).page.value=n),"items-per-page":t(p).itemsPerPage.value,"onUpdate:itemsPerPage":e[7]||(e[7]=n=>t(p).itemsPerPage.value=n),"project-id":s.params.projectId,data:t(p).data.value,loading:t(p).isLoading.value,direction:"outgoing","hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"]),r(t(D),{title:"Entities referencing this entity",icon:"mdi-call-received",count:t(i).data.value.total},{default:l(()=>[r(t(V),{search:t(i).search.value,"onUpdate:search":e[8]||(e[8]=n=>t(i).search.value=n),"sort-by":t(i).sortBy.value,"onUpdate:sortBy":e[9]||(e[9]=n=>t(i).sortBy.value=n),page:t(i).page.value,"onUpdate:page":e[10]||(e[10]=n=>t(i).page.value=n),"items-per-page":t(i).itemsPerPage.value,"onUpdate:itemsPerPage":e[11]||(e[11]=n=>t(i).itemsPerPage.value=n),"project-id":s.params.projectId,data:t(i).data.value,loading:t(i).isLoading.value,direction:"incoming","hide-header":""},null,8,["search","sort-by","page","items-per-page","project-id","data","loading"])]),_:1},8,["count"])]),_:1})],64)):P("",!0)]),_:1}))}}),Ht=K(Pt,[["__scopeId","data-v-00f1ba90"]]);export{Ht as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{J,K as pt}from"#entry";import{E as on,aG as se,aV as cn,V as fn,Y as an,ak as ln,_ as oe,W as hn,Z as un,$ as dn,a0 as yn}from"./sB5TSp0H.js";const dt=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Ae(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function W(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function at(e,...t){if(!Ae(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function St(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");W(e.outputLen),W(e.blockLen)}function _t(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function gn(e,t){at(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Kt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ut(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ut(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Q(e,t){return e<<32-t|e>>>t}function T(e,t){return e<<t|e>>>32-t>>>0}const pn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function wn(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function xn(e){for(let t=0;t<e.length;t++)e[t]=wn(e[t]);return e}const ie=pn?e=>e:xn,Ie=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",bn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ue(e){if(at(e),Ie)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=bn[e[n]];return t}const rt={_0:48,_9:57,A:65,F:70,a:97,f:102};function ce(e){if(e>=rt._0&&e<=rt._9)return e-rt._0;if(e>=rt.A&&e<=rt.F)return e-(rt.A-10);if(e>=rt.a&&e<=rt.f)return e-(rt.a-10)}function _e(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Ie)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const c=ce(e.charCodeAt(s)),i=ce(e.charCodeAt(s+1));if(c===void 0||i===void 0){const f=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+f+'" at index '+s)}r[o]=c*16+i}return r}function ve(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Bt(e){return typeof e=="string"&&(e=ve(e)),at(e),e}function fe(e){return typeof e=="string"&&(e=ve(e)),at(e),e}function Le(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}class Se{}function mn(e){const t=r=>e().update(Bt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ft(e=32){if(dt&&typeof dt.getRandomValues=="function")return dt.getRandomValues(new Uint8Array(e));if(dt&&typeof dt.randomBytes=="function")return Uint8Array.from(dt.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}class Ce extends Se{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,St(t);const r=Bt(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let c=0;c<s.length;c++)s[c]^=54;this.iHash.update(s),this.oHash=t.create();for(let c=0;c<s.length;c++)s[c]^=106;this.oHash.update(s),ut(s)}update(t){return _t(this),this.iHash.update(t),this}digestInto(t){_t(this),at(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:c,outputLen:i}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=c,t.outputLen=i,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const mt=(e,t,n)=>new Ce(e,t).update(n).digest();mt.create=(e,t)=>new Ce(e,t);function ke(e,t,n){return St(e),n===void 0&&(n=new Uint8Array(e.outputLen)),mt(e,Bt(n),Bt(t))}const Ht=Uint8Array.from([0]),ae=Uint8Array.of();function En(e,t,n,r=32){St(e),W(r);const o=e.outputLen;if(r>255*o)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(r/o);n===void 0&&(n=ae);const c=new Uint8Array(s*o),i=mt.create(e,t),f=i._cloneInto(),l=new Uint8Array(i.outputLen);for(let h=0;h<s;h++)Ht[0]=h+1,f.update(h===0?ae:l).update(n).update(Ht).digestInto(l),c.set(l,o*h),i._cloneInto(f);return i.destroy(),f.destroy(),ut(l,Ht),c.slice(0,r)}const wt=(e,t,n,r,o)=>En(e,ke(e,t,n),r,o);function Bn(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),c=Number(n>>o&s),i=Number(n&s),f=r?4:0,l=r?0:4;e.setUint32(t+f,c,r),e.setUint32(t+l,i,r)}function An(e,t,n){return e&t^~e&n}function In(e,t,n){return e&t^e&n^t&n}class Un extends Se{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ut(this.buffer)}update(t){_t(this),t=Bt(t),at(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let c=0;c<s;){const i=Math.min(o-this.pos,s-c);if(i===o){const f=Ut(t);for(;o<=s-c;c+=o)this.process(f,c);continue}r.set(t.subarray(c,c+i),this.pos),this.pos+=i,c+=i,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){_t(this),gn(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:c}=this;n[c++]=128,ut(this.buffer.subarray(c)),this.padOffset>o-c&&(this.process(r,0),c=0);for(let u=c;u<o;u++)n[u]=0;Bn(r,o-8,BigInt(this.length*8),s),this.process(r,0);const i=Ut(t),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=f/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<l;u++)i.setUint32(4*u,h[u],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:c,pos:i}=this;return t.destroyed=c,t.finished=s,t.length=o,t.pos=i,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const ot=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_n=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),it=new Uint32Array(64);class vn extends Un{constructor(t=32){super(64,t,8,!1),this.A=ot[0]|0,this.B=ot[1]|0,this.C=ot[2]|0,this.D=ot[3]|0,this.E=ot[4]|0,this.F=ot[5]|0,this.G=ot[6]|0,this.H=ot[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:c,G:i,H:f}=this;return[t,n,r,o,s,c,i,f]}set(t,n,r,o,s,c,i,f){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=c|0,this.G=i|0,this.H=f|0}process(t,n){for(let u=0;u<16;u++,n+=4)it[u]=t.getUint32(n,!1);for(let u=16;u<64;u++){const a=it[u-15],d=it[u-2],w=Q(a,7)^Q(a,18)^a>>>3,g=Q(d,17)^Q(d,19)^d>>>10;it[u]=g+it[u-7]+w+it[u-16]|0}let{A:r,B:o,C:s,D:c,E:i,F:f,G:l,H:h}=this;for(let u=0;u<64;u++){const a=Q(i,6)^Q(i,11)^Q(i,25),d=h+a+An(i,f,l)+_n[u]+it[u]|0,g=(Q(r,2)^Q(r,13)^Q(r,22))+In(r,o,s)|0;h=l,l=f,f=i,i=c+d|0,c=s,s=o,o=r,r=d+g|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,c=c+this.D|0,i=i+this.E|0,f=f+this.F|0,l=l+this.G|0,h=h+this.H|0,this.set(r,o,s,c,i,f,l,h)}roundClean(){ut(it)}destroy(){this.set(0,0,0,0,0,0,0,0),ut(this.buffer)}}const Xt=mn(()=>new vn),st=Xt;function Ln(e,t,n,r){St(e);const o=Le({dkLen:32,asyncTick:10},r),{c:s,dkLen:c,asyncTick:i}=o;if(W(s),W(c),W(i),s<1)throw new Error("iterations (c) should be >= 1");const f=fe(t),l=fe(n),h=new Uint8Array(c),u=mt.create(e,f),a=u._cloneInto().update(l);return{c:s,dkLen:c,asyncTick:i,DK:h,PRF:u,PRFSalt:a}}function Sn(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),ut(o),n}function Te(e,t,n,r){const{c:o,dkLen:s,DK:c,PRF:i,PRFSalt:f}=Ln(e,t,n,r);let l;const h=new Uint8Array(4),u=Ut(h),a=new Uint8Array(i.outputLen);for(let d=1,w=0;w<s;d++,w+=i.outputLen){const g=c.subarray(w,w+i.outputLen);u.setInt32(0,d,!1),(l=f._cloneInto(l)).update(h).digestInto(a),g.set(a.subarray(0,g.length));for(let p=1;p<o;p++){i._cloneInto(l).update(a).digestInto(a);for(let E=0;E<g.length;E++)g[E]^=a[E]}}return Sn(i,f,c,l,a)}function le(e,t,n,r,o,s){let c=e[t++]^n[r++],i=e[t++]^n[r++],f=e[t++]^n[r++],l=e[t++]^n[r++],h=e[t++]^n[r++],u=e[t++]^n[r++],a=e[t++]^n[r++],d=e[t++]^n[r++],w=e[t++]^n[r++],g=e[t++]^n[r++],p=e[t++]^n[r++],E=e[t++]^n[r++],q=e[t++]^n[r++],$=e[t++]^n[r++],O=e[t++]^n[r++],z=e[t++]^n[r++],C=c,H=i,M=f,L=l,_=h,S=u,k=a,x=d,b=w,m=g,U=p,B=E,A=q,y=$,I=O,v=z;for(let N=0;N<8;N+=2)_^=T(C+A|0,7),b^=T(_+C|0,9),A^=T(b+_|0,13),C^=T(A+b|0,18),m^=T(S+H|0,7),y^=T(m+S|0,9),H^=T(y+m|0,13),S^=T(H+y|0,18),I^=T(U+k|0,7),M^=T(I+U|0,9),k^=T(M+I|0,13),U^=T(k+M|0,18),L^=T(v+B|0,7),x^=T(L+v|0,9),B^=T(x+L|0,13),v^=T(B+x|0,18),H^=T(C+L|0,7),M^=T(H+C|0,9),L^=T(M+H|0,13),C^=T(L+M|0,18),k^=T(S+_|0,7),x^=T(k+S|0,9),_^=T(x+k|0,13),S^=T(_+x|0,18),B^=T(U+m|0,7),b^=T(B+U|0,9),m^=T(b+B|0,13),U^=T(m+b|0,18),A^=T(v+I|0,7),y^=T(A+v|0,9),I^=T(y+A|0,13),v^=T(I+y|0,18);o[s++]=c+C|0,o[s++]=i+H|0,o[s++]=f+M|0,o[s++]=l+L|0,o[s++]=h+_|0,o[s++]=u+S|0,o[s++]=a+k|0,o[s++]=d+x|0,o[s++]=w+b|0,o[s++]=g+m|0,o[s++]=p+U|0,o[s++]=E+B|0,o[s++]=q+A|0,o[s++]=$+y|0,o[s++]=O+I|0,o[s++]=z+v|0}function Nt(e,t,n,r,o){let s=r+0,c=r+16*o;for(let i=0;i<16;i++)n[c+i]=e[t+(2*o-1)*16+i];for(let i=0;i<o;i++,s+=16,t+=16)le(n,c,e,t,n,s),i>0&&(c+=16),le(n,s,e,t+=16,n,c)}function Cn(e,t,n){const r=Le({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:o,r:s,p:c,dkLen:i,asyncTick:f,maxmem:l,onProgress:h}=r;if(W(o),W(s),W(c),W(i),W(f),W(l),h!==void 0&&typeof h!="function")throw new Error("progressCb should be function");const u=128*s,a=u/4,d=Math.pow(2,32);if(o<=1||(o&o-1)!==0||o>d)throw new Error("Scrypt: N must be larger than 1, a power of 2, and less than 2^32");if(c<0||c>(d-1)*32/u)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(i<0||i>(d-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");if(u*(o+c)>l)throw new Error("Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of "+l);const g=Te(Xt,e,t,{c:1,dkLen:u*c}),p=Kt(g),E=Kt(new Uint8Array(u*o)),q=Kt(new Uint8Array(u));let $=()=>{};if(h){const O=2*o*c,z=Math.max(Math.floor(O/1e4),1);let C=0;$=()=>{C++,h&&(!(C%z)||C===O)&&h(C/O)}}return{N:o,r:s,p:c,dkLen:i,blockSize32:a,V:E,B32:p,B:g,tmp:q,blockMixCb:$,asyncTick:f}}function kn(e,t,n,r,o){const s=Te(Xt,e,n,{c:1,dkLen:t});return ut(n,r,o),s}function Ke(e,t,n){const{N:r,r:o,p:s,dkLen:c,blockSize32:i,V:f,B32:l,B:h,tmp:u,blockMixCb:a}=Cn(e,t,n);ie(l);for(let d=0;d<s;d++){const w=i*d;for(let g=0;g<i;g++)f[g]=l[w+g];for(let g=0,p=0;g<r-1;g++)Nt(f,p,f,p+=i,o),a();Nt(f,(r-1)*i,l,w,o),a();for(let g=0;g<r;g++){const p=l[w+i-16]%r;for(let E=0;E<i;E++)u[E]=l[w+E]^f[p*i+E];Nt(u,0,l,w,o),a()}}return ie(l),kn(e,c,h,f,u)}function He(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ot(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function Mt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function j(e,...t){if(!He(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function he(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Tn(e,t){j(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function ct(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function xt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Kn(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const Hn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Nn(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Rt(e){if(typeof e=="string")e=Nn(e);else if(He(e))e=$t(e);else throw new Error("Uint8Array expected, got "+typeof e);return e}function Mn(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function qn(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}const On=(e,t)=>{function n(r,...o){if(j(r),!Hn)throw new Error("Non little-endian hardware is not yet supported");if(e.nonceLength!==void 0){const h=o[0];if(!h)throw new Error("nonce / iv required");e.varSizeNonce?j(h):j(h,e.nonceLength)}const s=e.tagLength;s&&o[1]!==void 0&&j(o[1]);const c=t(r,...o),i=(h,u)=>{if(u!==void 0){if(h!==2)throw new Error("cipher output not supported");j(u)}};let f=!1;return{encrypt(h,u){if(f)throw new Error("cannot encrypt() twice with same key + nonce");return f=!0,j(h),i(c.encrypt.length,u),c.encrypt(h,u)},decrypt(h,u){if(j(h),s&&h.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return i(c.decrypt.length,u),c.decrypt(h,u)}}}return Object.assign(n,e),n};function ue(e,t,n=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(n&&!$n(t))throw new Error("invalid output, must be aligned");return t}function de(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),c=Number(n>>o&s),i=Number(n&s),f=4,l=0;e.setUint32(t+f,c,r),e.setUint32(t+l,i,r)}function Rn(e,t,n){Ot(n);const r=new Uint8Array(16),o=Kn(r);return de(o,0,BigInt(t),n),de(o,8,BigInt(e),n),r}function $n(e){return e.byteOffset%4===0}function $t(e){return Uint8Array.from(e)}const Ne=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),zn=Ne("expand 16-byte k"),jn=Ne("expand 32-byte k"),Vn=ct(zn),Pn=ct(jn);function K(e,t){return e<<t|e>>>32-t}function zt(e){return e.byteOffset%4===0}const At=64,Wn=16,Me=2**32-1,ye=new Uint32Array;function Gn(e,t,n,r,o,s,c,i){const f=o.length,l=new Uint8Array(At),h=ct(l),u=zt(o)&&zt(s),a=u?ct(o):ye,d=u?ct(s):ye;for(let w=0;w<f;c++){if(e(t,n,r,h,c,i),c>=Me)throw new Error("arx: counter overflow");const g=Math.min(At,f-w);if(u&&g===At){const p=w/4;if(w%4!==0)throw new Error("arx: invalid block position");for(let E=0,q;E<Wn;E++)q=p+E,d[q]=a[q]^h[E];w+=At;continue}for(let p=0,E;p<g;p++)E=w+p,s[E]=o[E]^l[p];w+=g}}function Xn(e,t){const{allowShortKeys:n,extendNonceFn:r,counterLength:o,counterRight:s,rounds:c}=Mn({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return Mt(o),Mt(c),Ot(s),Ot(n),(i,f,l,h,u=0)=>{j(i),j(f),j(l);const a=l.length;if(h===void 0&&(h=new Uint8Array(a)),j(h),Mt(u),u<0||u>=Me)throw new Error("arx: counter overflow");if(h.length<a)throw new Error(`arx: output (${h.length}) is shorter than data (${a})`);const d=[];let w=i.length,g,p;if(w===32)d.push(g=$t(i)),p=Pn;else if(w===16&&n)g=new Uint8Array(32),g.set(i),g.set(i,16),p=Vn,d.push(g);else throw new Error(`arx: invalid 32-byte key, got length=${w}`);zt(f)||d.push(f=$t(f));const E=ct(g);if(r){if(f.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(p,E,ct(f.subarray(0,16)),E),f=f.subarray(16)}const q=16-o;if(q!==f.length)throw new Error(`arx: nonce must be ${q} or 16 bytes`);if(q!==12){const O=new Uint8Array(12);O.set(f,s?0:12-f.length),f=O,d.push(f)}const $=ct(f);return Gn(e,p,E,$,l,h,u,c),xt(...d),h}}const R=(e,t)=>e[t++]&255|(e[t++]&255)<<8;class Yn{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=Rt(t),j(t,32);const n=R(t,0),r=R(t,2),o=R(t,4),s=R(t,6),c=R(t,8),i=R(t,10),f=R(t,12),l=R(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|o<<6)&7939,this.r[3]=(o>>>7|s<<9)&8191,this.r[4]=(s>>>4|c<<12)&255,this.r[5]=c>>>1&8190,this.r[6]=(c>>>14|i<<2)&8191,this.r[7]=(i>>>11|f<<5)&8065,this.r[8]=(f>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let h=0;h<8;h++)this.pad[h]=R(t,16+2*h)}process(t,n,r=!1){const o=r?0:2048,{h:s,r:c}=this,i=c[0],f=c[1],l=c[2],h=c[3],u=c[4],a=c[5],d=c[6],w=c[7],g=c[8],p=c[9],E=R(t,n+0),q=R(t,n+2),$=R(t,n+4),O=R(t,n+6),z=R(t,n+8),C=R(t,n+10),H=R(t,n+12),M=R(t,n+14);let L=s[0]+(E&8191),_=s[1]+((E>>>13|q<<3)&8191),S=s[2]+((q>>>10|$<<6)&8191),k=s[3]+(($>>>7|O<<9)&8191),x=s[4]+((O>>>4|z<<12)&8191),b=s[5]+(z>>>1&8191),m=s[6]+((z>>>14|C<<2)&8191),U=s[7]+((C>>>11|H<<5)&8191),B=s[8]+((H>>>8|M<<8)&8191),A=s[9]+(M>>>5|o),y=0,I=y+L*i+_*(5*p)+S*(5*g)+k*(5*w)+x*(5*d);y=I>>>13,I&=8191,I+=b*(5*a)+m*(5*u)+U*(5*h)+B*(5*l)+A*(5*f),y+=I>>>13,I&=8191;let v=y+L*f+_*i+S*(5*p)+k*(5*g)+x*(5*w);y=v>>>13,v&=8191,v+=b*(5*d)+m*(5*a)+U*(5*u)+B*(5*h)+A*(5*l),y+=v>>>13,v&=8191;let N=y+L*l+_*f+S*i+k*(5*p)+x*(5*g);y=N>>>13,N&=8191,N+=b*(5*w)+m*(5*d)+U*(5*a)+B*(5*u)+A*(5*h),y+=N>>>13,N&=8191;let P=y+L*h+_*l+S*f+k*i+x*(5*p);y=P>>>13,P&=8191,P+=b*(5*g)+m*(5*w)+U*(5*d)+B*(5*a)+A*(5*u),y+=P>>>13,P&=8191;let tt=y+L*u+_*h+S*l+k*f+x*i;y=tt>>>13,tt&=8191,tt+=b*(5*p)+m*(5*g)+U*(5*w)+B*(5*d)+A*(5*a),y+=tt>>>13,tt&=8191;let D=y+L*a+_*u+S*h+k*l+x*f;y=D>>>13,D&=8191,D+=b*i+m*(5*p)+U*(5*g)+B*(5*w)+A*(5*d),y+=D>>>13,D&=8191;let Z=y+L*d+_*a+S*u+k*h+x*l;y=Z>>>13,Z&=8191,Z+=b*f+m*i+U*(5*p)+B*(5*g)+A*(5*w),y+=Z>>>13,Z&=8191;let F=y+L*w+_*d+S*a+k*u+x*h;y=F>>>13,F&=8191,F+=b*l+m*f+U*i+B*(5*p)+A*(5*g),y+=F>>>13,F&=8191;let et=y+L*g+_*w+S*d+k*a+x*u;y=et>>>13,et&=8191,et+=b*h+m*l+U*f+B*i+A*(5*p),y+=et>>>13,et&=8191;let nt=y+L*p+_*g+S*w+k*d+x*a;y=nt>>>13,nt&=8191,nt+=b*u+m*h+U*l+B*f+A*i,y+=nt>>>13,nt&=8191,y=(y<<2)+y|0,y=y+I|0,I=y&8191,y=y>>>13,v+=y,s[0]=I,s[1]=v,s[2]=N,s[3]=P,s[4]=tt,s[5]=D,s[6]=Z,s[7]=F,s[8]=et,s[9]=nt}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let o=t[1]>>>13;t[1]&=8191;for(let i=2;i<10;i++)t[i]+=o,o=t[i]>>>13,t[i]&=8191;t[0]+=o*5,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,r[0]=t[0]+5,o=r[0]>>>13,r[0]&=8191;for(let i=1;i<10;i++)r[i]=t[i]+o,o=r[i]>>>13,r[i]&=8191;r[9]-=8192;let s=(o^1)-1;for(let i=0;i<10;i++)r[i]&=s;s=~s;for(let i=0;i<10;i++)t[i]=t[i]&s|r[i];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let c=t[0]+n[0];t[0]=c&65535;for(let i=1;i<8;i++)c=(t[i]+n[i]|0)+(c>>>16)|0,t[i]=c&65535;xt(r)}update(t){he(this),t=Rt(t),j(t);const{buffer:n,blockLen:r}=this,o=t.length;for(let s=0;s<o;){const c=Math.min(r-this.pos,o-s);if(c===r){for(;r<=o-s;s+=r)this.process(t,s);continue}n.set(t.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===r&&(this.process(n,0,!1),this.pos=0)}return this}destroy(){xt(this.h,this.r,this.buffer,this.pad)}digestInto(t){he(this),Tn(t,this),this.finished=!0;const{buffer:n,h:r}=this;let{pos:o}=this;if(o){for(n[o++]=1;o<16;o++)n[o]=0;this.process(n,0,!0)}this.finalize();let s=0;for(let c=0;c<8;c++)t[s++]=r[c]>>>0,t[s++]=r[c]>>>8;return t}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}function Dn(e){const t=(r,o)=>e(o).update(Rt(r)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const Zn=Dn(e=>new Yn(e));function Fn(e,t,n,r,o,s=20){let c=e[0],i=e[1],f=e[2],l=e[3],h=t[0],u=t[1],a=t[2],d=t[3],w=t[4],g=t[5],p=t[6],E=t[7],q=o,$=n[0],O=n[1],z=n[2],C=c,H=i,M=f,L=l,_=h,S=u,k=a,x=d,b=w,m=g,U=p,B=E,A=q,y=$,I=O,v=z;for(let P=0;P<s;P+=2)C=C+_|0,A=K(A^C,16),b=b+A|0,_=K(_^b,12),C=C+_|0,A=K(A^C,8),b=b+A|0,_=K(_^b,7),H=H+S|0,y=K(y^H,16),m=m+y|0,S=K(S^m,12),H=H+S|0,y=K(y^H,8),m=m+y|0,S=K(S^m,7),M=M+k|0,I=K(I^M,16),U=U+I|0,k=K(k^U,12),M=M+k|0,I=K(I^M,8),U=U+I|0,k=K(k^U,7),L=L+x|0,v=K(v^L,16),B=B+v|0,x=K(x^B,12),L=L+x|0,v=K(v^L,8),B=B+v|0,x=K(x^B,7),C=C+S|0,v=K(v^C,16),U=U+v|0,S=K(S^U,12),C=C+S|0,v=K(v^C,8),U=U+v|0,S=K(S^U,7),H=H+k|0,A=K(A^H,16),B=B+A|0,k=K(k^B,12),H=H+k|0,A=K(A^H,8),B=B+A|0,k=K(k^B,7),M=M+x|0,y=K(y^M,16),b=b+y|0,x=K(x^b,12),M=M+x|0,y=K(y^M,8),b=b+y|0,x=K(x^b,7),L=L+_|0,I=K(I^L,16),m=m+I|0,_=K(_^m,12),L=L+_|0,I=K(I^L,8),m=m+I|0,_=K(_^m,7);let N=0;r[N++]=c+C|0,r[N++]=i+H|0,r[N++]=f+M|0,r[N++]=l+L|0,r[N++]=h+_|0,r[N++]=u+S|0,r[N++]=a+k|0,r[N++]=d+x|0,r[N++]=w+b|0,r[N++]=g+m|0,r[N++]=p+U|0,r[N++]=E+B|0,r[N++]=q+A|0,r[N++]=$+y|0,r[N++]=O+I|0,r[N++]=z+v|0}const Qn=Xn(Fn,{counterRight:!1,counterLength:4,allowShortKeys:!1}),Jn=new Uint8Array(16),ge=(e,t)=>{e.update(t);const n=t.length%16;n&&e.update(Jn.subarray(n))},tr=new Uint8Array(32);function pe(e,t,n,r,o){const s=e(t,n,tr),c=Zn.create(s);o&&ge(c,o),ge(c,r);const i=Rn(r.length,o?o.length:0,!0);c.update(i);const f=c.digest();return xt(s,i),f}const er=e=>(t,n,r)=>({encrypt(s,c){const i=s.length;c=ue(i+16,c,!1),c.set(s);const f=c.subarray(0,-16);e(t,n,f,f,1);const l=pe(e,t,n,f,r);return c.set(l,i),xt(l),c},decrypt(s,c){c=ue(s.length-16,c,!1);const i=s.subarray(0,-16),f=s.subarray(-16),l=pe(e,t,n,i,r);if(!qn(f,l))throw new Error("invalid tag");return c.set(s.subarray(0,-16)),e(t,n,c,c,1),xt(l),c}}),bt=On({blockSize:64,nonceLength:12,tagLength:16},er(Qn));const qe=BigInt(0),we=BigInt(1);function Oe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?qe:BigInt("0x"+e)}function nr(e){return Oe(Ue(e))}function jt(e){return at(e),Oe(Ue(Uint8Array.from(e).reverse()))}function Re(e,t){return _e(e.toString(16).padStart(t*2,"0"))}function $e(e,t){return Re(e,t).reverse()}function xe(e,t,n){let r;if(typeof t=="string")try{r=_e(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(Ae(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}const qt=e=>typeof e=="bigint"&&qe<=e;function rr(e,t,n){return qt(e)&&qt(t)&&qt(n)&&t<=e&&e<n}function be(e,t,n,r){if(!rr(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}const sr=e=>(we<<BigInt(e))-we;function or(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function r(o,s,c){const i=e[o];if(c&&i===void 0)return;const f=typeof i;if(f!==s||i===null)throw new Error(`param "${o}" is invalid: expected ${s}, got ${f}`)}Object.entries(t).forEach(([o,s])=>r(o,s,!1)),Object.entries(n).forEach(([o,s])=>r(o,s,!0))}const V=BigInt(0),G=BigInt(1),ht=BigInt(2),ze=BigInt(3),je=BigInt(4),Ve=BigInt(5),ir=BigInt(7),Pe=BigInt(8),cr=BigInt(9),We=BigInt(16);function X(e,t){const n=e%t;return n>=V?n:t+n}function Y(e,t,n){let r=e;for(;t-- >V;)r*=r,r%=n;return r}function me(e,t){if(e===V)throw new Error("invert: expected non-zero number");if(t<=V)throw new Error("invert: expected positive modulus, got "+t);let n=X(e,t),r=t,o=V,s=G;for(;n!==V;){const i=r/n,f=r%n,l=o-s*i;r=n,n=f,o=s,s=l}if(r!==G)throw new Error("invert: does not exist");return X(o,t)}function Yt(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function Ge(e,t){const n=(e.ORDER+G)/je,r=e.pow(t,n);return Yt(e,r,t),r}function fr(e,t){const n=(e.ORDER-Ve)/Pe,r=e.mul(t,ht),o=e.pow(r,n),s=e.mul(t,o),c=e.mul(e.mul(s,ht),o),i=e.mul(s,e.sub(c,e.ONE));return Yt(e,i,t),i}function ar(e){const t=Dt(e),n=Xe(e),r=n(t,t.neg(t.ONE)),o=n(t,r),s=n(t,t.neg(r)),c=(e+ir)/We;return(i,f)=>{let l=i.pow(f,c),h=i.mul(l,r);const u=i.mul(l,o),a=i.mul(l,s),d=i.eql(i.sqr(h),f),w=i.eql(i.sqr(u),f);l=i.cmov(l,h,d),h=i.cmov(a,u,w);const g=i.eql(i.sqr(h),f),p=i.cmov(l,h,g);return Yt(i,p,f),p}}function Xe(e){if(e<ze)throw new Error("sqrt is not defined for small field");let t=e-G,n=0;for(;t%ht===V;)t/=ht,n++;let r=ht;const o=Dt(e);for(;Ee(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return Ge;let s=o.pow(r,t);const c=(t+G)/ht;return function(f,l){if(f.is0(l))return l;if(Ee(f,l)!==1)throw new Error("Cannot find square root");let h=n,u=f.mul(f.ONE,s),a=f.pow(l,t),d=f.pow(l,c);for(;!f.eql(a,f.ONE);){if(f.is0(a))return f.ZERO;let w=1,g=f.sqr(a);for(;!f.eql(g,f.ONE);)if(w++,g=f.sqr(g),w===h)throw new Error("Cannot find square root");const p=G<<BigInt(h-w-1),E=f.pow(u,p);h=w,u=f.sqr(E),a=f.mul(a,u),d=f.mul(d,E)}return d}}function lr(e){return e%je===ze?Ge:e%Pe===Ve?fr:e%We===cr?ar(e):Xe(e)}function hr(e,t,n){if(n<V)throw new Error("invalid exponent, negatives unsupported");if(n===V)return e.ONE;if(n===G)return t;let r=e.ONE,o=t;for(;n>V;)n&G&&(r=e.mul(r,o)),o=e.sqr(o),n>>=G;return r}function ur(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((c,i,f)=>e.is0(i)?c:(r[f]=c,e.mul(c,i)),e.ONE),s=e.inv(o);return t.reduceRight((c,i,f)=>e.is0(i)?c:(r[f]=e.mul(c,r[f]),e.mul(c,i)),s),r}function Ee(e,t){const n=(e.ORDER-G)/ht,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),c=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!c)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function dr(e,t){t!==void 0&&W(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Dt(e,t,n=!1,r={}){if(e<=V)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,s,c=!1,i;if(typeof t=="object"&&t!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const a=t;a.BITS&&(o=a.BITS),a.sqrt&&(s=a.sqrt),typeof a.isLE=="boolean"&&(n=a.isLE),typeof a.modFromBytes=="boolean"&&(c=a.modFromBytes),i=a.allowedLengths}else typeof t=="number"&&(o=t),r.sqrt&&(s=r.sqrt);const{nBitLength:f,nByteLength:l}=dr(e,o);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let h;const u=Object.freeze({ORDER:e,isLE:n,BITS:f,BYTES:l,MASK:sr(f),ZERO:V,ONE:G,allowedLengths:i,create:a=>X(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return V<=a&&a<e},is0:a=>a===V,isValidNot0:a=>!u.is0(a)&&u.isValid(a),isOdd:a=>(a&G)===G,neg:a=>X(-a,e),eql:(a,d)=>a===d,sqr:a=>X(a*a,e),add:(a,d)=>X(a+d,e),sub:(a,d)=>X(a-d,e),mul:(a,d)=>X(a*d,e),pow:(a,d)=>hr(u,a,d),div:(a,d)=>X(a*me(d,e),e),sqrN:a=>a*a,addN:(a,d)=>a+d,subN:(a,d)=>a-d,mulN:(a,d)=>a*d,inv:a=>me(a,e),sqrt:s||(a=>(h||(h=lr(e)),h(u,a))),toBytes:a=>n?$e(a,l):Re(a,l),fromBytes:(a,d=!0)=>{if(i){if(!i.includes(a.length)||a.length>l)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+a.length);const g=new Uint8Array(l);g.set(a,n?0:g.length-a.length),a=g}if(a.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+a.length);let w=n?jt(a):nr(a);if(c&&(w=X(w,e)),!d&&!u.isValid(w))throw new Error("invalid field element: outside of range 0..ORDER");return w},invertBatch:a=>ur(u,a),cmov:(a,d,w)=>w?d:a});return Object.freeze(u)}const Et=BigInt(0),yt=BigInt(1),It=BigInt(2);function yr(e){return or(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}function gr(e){const t=yr(e),{P:n,type:r,adjustScalarBytes:o,powPminus2:s,randomBytes:c}=t,i=r==="x25519";if(!i&&r!=="x448")throw new Error("invalid type");const f=c||ft,l=i?255:448,h=i?32:56,u=BigInt(i?9:5),a=BigInt(i?121665:39081),d=i?It**BigInt(254):It**BigInt(447),w=i?BigInt(8)*It**BigInt(251)-yt:BigInt(4)*It**BigInt(445)-yt,g=d+w+yt,p=x=>X(x,n),E=q(u);function q(x){return $e(p(x),h)}function $(x){const b=xe("u coordinate",x,h);return i&&(b[31]&=127),p(jt(b))}function O(x){return jt(o(xe("scalar",x,h)))}function z(x,b){const m=M($(b),O(x));if(m===Et)throw new Error("invalid private or public key received");return q(m)}function C(x){return z(x,E)}function H(x,b,m){const U=p(x*(b-m));return b=p(b-U),m=p(m+U),{x_2:b,x_3:m}}function M(x,b){be("u",x,Et,n),be("scalar",b,d,g);const m=b,U=x;let B=yt,A=Et,y=x,I=yt,v=Et;for(let P=BigInt(l-1);P>=Et;P--){const tt=m>>P&yt;v^=tt,{x_2:B,x_3:y}=H(v,B,y),{x_2:A,x_3:I}=H(v,A,I),v=tt;const D=B+A,Z=p(D*D),F=B-A,et=p(F*F),nt=Z-et,rn=y+I,sn=y-I,te=p(sn*D),ee=p(rn*F),ne=te+ee,re=te-ee;y=p(ne*ne),I=p(U*p(re*re)),B=p(Z*et),A=p(nt*(Z+p(a*nt)))}({x_2:B,x_3:y}=H(v,B,y)),{x_2:A,x_3:I}=H(v,A,I);const N=s(A);return p(B*N)}const L={secretKey:h,publicKey:h,seed:h},_=(x=f(h))=>(at(x,L.seed),x);function S(x){const b=_(x);return{secretKey:b,publicKey:C(b)}}return{keygen:S,getSharedSecret:(x,b)=>z(x,b),getPublicKey:x=>C(x),scalarMult:z,scalarMultBase:C,utils:{randomSecretKey:_,randomPrivateKey:_},GuBytes:E.slice(),lengths:L}}const pr=BigInt(1),Be=BigInt(2),wr=BigInt(3),xr=BigInt(5),br=BigInt(8),Ye=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),mr={p:Ye,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:br,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Er(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),s=Ye,i=e*e%s*e%s,f=Y(i,Be,s)*i%s,l=Y(f,pr,s)*e%s,h=Y(l,xr,s)*l%s,u=Y(h,t,s)*h%s,a=Y(u,n,s)*u%s,d=Y(a,r,s)*a%s,w=Y(d,o,s)*d%s,g=Y(w,o,s)*d%s,p=Y(g,t,s)*h%s;return{pow_p_5_8:Y(p,Be,s)*e%s,b2:i}}function Br(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Ar=Dt(mr.p,{isLE:!0}),Vt=(()=>{const e=Ar.ORDER;return gr({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:n,b2:r}=Er(t);return X(Y(n,wr,e)*r,e)},adjustScalarBytes:Br})})(),De=!1;async function Ze(e,t){try{return await e()}catch(n){if(n instanceof ReferenceError||n instanceof DOMException&&n.name==="NotSupportedError")return await t();throw n}}async function Zt(e,t){return await Ze(async()=>{const n=Pt(e)?e:await Ur(e),r=await crypto.subtle.importKey("raw",t,{name:"X25519"},De,[]);return new Uint8Array(await crypto.subtle.deriveBits({name:"X25519",public:r},n,256))},()=>{if(Pt(e))throw new Error("CryptoKey provided but X25519 WebCrypto is not supported");return Vt.scalarMult(e,t)})}async function vt(e){return await Ze(async()=>Zt(e,Vt.GuBytes),()=>{if(Pt(e))throw new Error("CryptoKey provided but X25519 WebCrypto is not supported");return Vt.scalarMultBase(e)})}const Ir=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]);async function Ur(e){if(e.length!==32)throw new Error("X25519 private key must be 32 bytes");const t=new Uint8Array([...Ir,...e]);return crypto.subtle.importKey("pkcs8",t,{name:"X25519"},De,["deriveBits"])}function Pt(e){return typeof CryptoKey<"u"&&e instanceof CryptoKey}class _r{s;transcript=[];buf=new Uint8Array(0);constructor(t){this.s=t.getReader()}async readLine(){const t=[];for(;;){const n=this.buf.indexOf(10);if(n>=0)return t.push(this.buf.subarray(0,n)),this.transcript.push(this.buf.subarray(0,n+1)),this.buf=this.buf.subarray(n+1),vr(gt(t));this.buf.length>0&&(t.push(this.buf),this.transcript.push(this.buf));const r=await this.s.read();if(r.done)return this.buf=gt(t),null;this.buf=r.value}}close(){return this.s.releaseLock(),{rest:this.buf,transcript:gt(this.transcript)}}}function vr(e){return e.forEach(t=>{if(t<32||t>126)throw Error("invalid non-ASCII byte in header")}),new TextDecoder().decode(e)}function gt(e){const t=e.reduce(((o,s)=>o+s.length),0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function Lt(e,...t){return e.pipeThrough(new TransformStream({start(n){for(const r of t)n.enqueue(r)}}))}function Wt(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function Fe(e){if(!(e instanceof ReadableStream))throw new Error("readAll expects a ReadableStream<Uint8Array>");return new Uint8Array(await new Response(e).arrayBuffer())}async function Lr(e){if(!(e instanceof ReadableStream))throw new Error("readAllString expects a ReadableStream<Uint8Array>");return await new Response(e).text()}async function Sr(e,t){const n=e.getReader(),r=[];let o=0;for(;o<t;){const{done:f,value:l}=await n.read();if(f)throw Error("stream ended before reading "+t+" bytes");r.push(l),o+=l.length}n.releaseLock();const s=gt(r),c=s.subarray(0,t),i=Lt(e,s.subarray(t));return{data:c,rest:i}}class Ct{args;body;constructor(t,n){this.args=t,this.body=n}}async function Cr(e){const t=await e.readLine();if(t===null)throw Error("invalid stanza");const n=t.split(" ");if(n.length<2||n.shift()!=="->")return{next:t};for(const s of n)if(s.length===0)throw Error("invalid stanza");const r=[];for(;;){const s=await e.readLine();if(s===null)throw Error("invalid stanza");const c=J.decode(s);if(c.length>48)throw Error("invalid stanza");if(r.push(c),c.length<48)break}const o=gt(r);return{s:new Ct(n,o)}}async function kr(e){const t=new _r(e),n=await t.readLine();if(n!=="age-encryption.org/v1")throw Error("invalid version "+(n??"line"));const r=[];for(;;){const{s:o,next:s}=await Cr(t);if(o!==void 0){r.push(o);continue}if(!s.startsWith("--- "))throw Error("invalid header");const c=J.decode(s.slice(4)),{rest:i,transcript:f}=t.close(),l=f.slice(0,f.length-1-s.length+3);return{stanzas:r,headerNoMAC:l,MAC:c,headerSize:f.length,rest:Lt(e,i)}}}function Qe(e){const t=[];t.push(`age-encryption.org/v1
|
|
2
|
-
`);for(const n of e){t.push("-> "+n.args.join(" ")+`
|
|
3
|
-
`);for(let r=0;r<n.body.length;r+=48){let o=r+48;o>n.body.length&&(o=n.body.length),t.push(J.encode(n.body.subarray(r,o))+`
|
|
4
|
-
`)}n.body.length%48===0&&t.push(`
|
|
5
|
-
`)}return t.push("---"),new TextEncoder().encode(t.join(""))}function Tr(e,t){return gt([Qe(e),new TextEncoder().encode(" "+J.encode(t)+`
|
|
6
|
-
`)])}function Fr(){const e=ft(32),t=pt.encodeFromBytes("AGE-SECRET-KEY-",e).toUpperCase();return Promise.resolve(t)}async function Qr(e){let t;if(Je(e))t=e;else{const r=pt.decodeToBytes(e);if(!e.startsWith("AGE-SECRET-KEY-1")||r.prefix.toUpperCase()!=="AGE-SECRET-KEY-"||r.bytes.length!==32)throw Error("invalid identity");t=r.bytes}const n=await vt(t);return pt.encodeFromBytes("age",n)}class Kr{recipient;constructor(t){const n=pt.decodeToBytes(t);if(!t.startsWith("age1")||n.prefix.toLowerCase()!=="age"||n.bytes.length!==32)throw Error("invalid recipient");this.recipient=n.bytes}async wrapFileKey(t){const n=ft(32),r=await vt(n),o=await Zt(n,this.recipient),s=new Uint8Array(r.length+this.recipient.length);s.set(r),s.set(this.recipient,r.length);const c=wt(st,o,s,"age-encryption.org/v1/X25519",32);return[new Ct(["X25519",J.encode(r)],Ft(t,c))]}}class Hr{identity;recipient;constructor(t){if(Je(t)){this.identity=t,this.recipient=vt(t);return}const n=pt.decodeToBytes(t);if(!t.startsWith("AGE-SECRET-KEY-1")||n.prefix.toUpperCase()!=="AGE-SECRET-KEY-"||n.bytes.length!==32)throw Error("invalid identity");this.identity=n.bytes,this.recipient=vt(n.bytes)}async unwrapFileKey(t){for(const n of t){if(n.args.length<1||n.args[0]!=="X25519")continue;if(n.args.length!==2)throw Error("invalid X25519 stanza");const r=J.decode(n.args[1]);if(r.length!==32)throw Error("invalid X25519 stanza");const o=await Zt(this.identity,r),s=await this.recipient,c=new Uint8Array(r.length+s.length);c.set(r),c.set(s,r.length);const i=wt(st,o,c,"age-encryption.org/v1/X25519",32),f=Qt(n.body,i);if(f!==null)return f}return null}}class Nr{passphrase;logN;constructor(t,n){this.passphrase=t,this.logN=n}wrapFileKey(t){const n=ft(16),r="age-encryption.org/v1/scrypt",o=new Uint8Array(r.length+16);o.set(new TextEncoder().encode(r)),o.set(n,r.length);const s=Ke(this.passphrase,o,{N:2**this.logN,r:8,p:1,dkLen:32});return[new Ct(["scrypt",J.encode(n),this.logN.toString()],Ft(t,s))]}}class Mr{passphrase;constructor(t){this.passphrase=t}unwrapFileKey(t){for(const n of t){if(n.args.length<1||n.args[0]!=="scrypt")continue;if(t.length!==1)throw Error("scrypt recipient is not the only one in the header");if(n.args.length!==3||!/^[1-9][0-9]*$/.test(n.args[2]))throw Error("invalid scrypt stanza");const r=J.decode(n.args[1]);if(r.length!==16)throw Error("invalid scrypt stanza");const o=Number(n.args[2]);if(o>20)throw Error("scrypt work factor is too high");const s="age-encryption.org/v1/scrypt",c=new Uint8Array(s.length+16);c.set(new TextEncoder().encode(s)),c.set(r,s.length);const i=Ke(this.passphrase,c,{N:2**o,r:8,p:1,dkLen:32}),f=Qt(n.body,i);if(f!==null)return f}return null}}function Ft(e,t){const n=new Uint8Array(12);return bt(t,n).encrypt(e)}function Qt(e,t){if(e.length!==32)throw Error("invalid stanza");const n=new Uint8Array(12);try{return bt(t,n).decrypt(e)}catch{return null}}function Je(e){return typeof CryptoKey<"u"&&e instanceof CryptoKey}const lt=16,Jt=64*1024,Gt=Jt+lt;function qr(e){const t=new Uint8Array(12),n=()=>{for(let c=t.length-2;c>=0&&(t[c]++,t[c]===0);c--);};let r=!0;const o=new Uint8Array(Gt);let s=0;return new TransformStream({transform(c,i){for(;c.length>0;){if(s===o.length){const l=bt(e,t).decrypt(o);i.enqueue(l),n(),s=0,r=!1}const f=Math.min(o.length-s,c.length);o.set(c.subarray(0,f),s),s+=f,c=c.subarray(f)}},flush(c){t[11]=1;const i=bt(e,t).decrypt(o.subarray(0,s));if(!r&&i.length===0)throw new Error("final chunk is empty");c.enqueue(i)}})}function Or(e){if(e<lt)throw Error("ciphertext is too small");if(e===lt)return 0;const t=Math.floor(e/Gt),n=e%Gt;if(0<n&&n<=lt)throw Error("ciphertext size is invalid");let r=e;return r-=t*lt,r-=n>0?lt:0,r}function Rr(e){const t=new Uint8Array(12),n=()=>{for(let s=t.length-2;s>=0&&(t[s]++,t[s]===0);s--);},r=new Uint8Array(Jt);let o=0;return new TransformStream({transform(s,c){for(;s.length>0;){if(o===r.length){const f=bt(e,t).encrypt(r);c.enqueue(f),n(),o=0}const i=Math.min(r.length-o,s.length);r.set(s.subarray(0,i),o),o+=i,s=s.subarray(i)}},flush(s){t[11]=1;const c=bt(e,t).encrypt(r.subarray(0,o));s.enqueue(c)}})}function $r(e){const t=Math.max(1,Math.ceil(e/Jt));return e+lt*t}function kt(e){if(e.length===0)throw Error("cbor: unexpected EOF");const t=e[0]>>5,n=e[0]&31;if(n<=23)return[t,n,e.subarray(1)];if(n===24){if(e.length<2)throw Error("cbor: unexpected EOF");return[t,e[1],e.subarray(2)]}if(n===25){if(e.length<3)throw Error("cbor: unexpected EOF");return[t,e[1]<<8|e[2],e.subarray(3)]}throw Error("cbor: unsupported argument encoding")}function zr(e){const[t,n,r]=kt(e);if(t!==0)throw Error("cbor: expected unsigned integer");return[n,r]}function jr(e){const[t,n,r]=kt(e);if(t!==2)throw Error("cbor: expected byte string");if(n>r.length)throw Error("cbor: unexpected EOF");return[r.subarray(0,n),r.subarray(n)]}function tn(e){const[t,n,r]=kt(e);if(t!==3)throw Error("cbor: expected text string");if(n>r.length)throw Error("cbor: unexpected EOF");return[new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(r.subarray(0,n)),r.subarray(n)]}function Vr(e){const[t,n,r]=kt(e);if(t!==4)throw Error("cbor: expected array");let o=r;const s=[];for(let c=0;c<n;c++){let i;[i,o]=tn(o),s.push(i)}return[s,o]}const Pr="AGE-PLUGIN-FIDO2PRF-";function Wr(e){const t=pt.decodeToBytes(e);if(!e.startsWith(Pr+"1"))throw Error("invalid identity");const[n,r]=zr(t.bytes);if(n!==1)throw Error("unsupported identity version");const[o,s]=jr(r),[c,i]=tn(s),[f]=Vr(i);return[o,c,f]}const Tt="age-encryption.org/fido2prf";class en{credId;transports;rpId;constructor(t){if(t?.identity){const[n,r,o]=Wr(t.identity);this.credId=n,this.transports=o,this.rpId=r}else this.rpId=t?.rpId}async getCredential(t){const r=(await navigator.credentials.get({publicKey:{allowCredentials:this.credId?[{id:this.credId,transports:this.transports,type:"public-key"}]:[],challenge:ft(16),extensions:{prf:{eval:Gr(t)}},userVerification:"required",rpId:this.rpId}})).getClientExtensionResults().prf?.results;if(r===void 0)throw Error("PRF extension not available (need macOS 15+, Chrome 132+)");return r}}class Jr extends en{async wrapFileKey(t){const n=ft(16),r=await this.getCredential(n),o=nn(r);return[new Ct([Tt,J.encode(n)],Ft(t,o))]}}class ts extends en{async unwrapFileKey(t){for(const n of t){if(n.args.length<1||n.args[0]!==Tt)continue;if(n.args.length!==2)throw Error("invalid prf stanza");const r=J.decode(n.args[1]);if(r.length!==16)throw Error("invalid prf stanza");const o=await this.getCredential(r),s=nn(o),c=Qt(n.body,s);if(c!==null)return c}return null}}function Gr(e){const t=new TextEncoder().encode(Tt),n=new Uint8Array(t.length+e.length+1);n.set(t,0),n[t.length]=1,n.set(e,t.length+1);const r=new Uint8Array(t.length+e.length+1);return r.set(t,0),r[t.length]=2,r.set(e,t.length+1),{first:n,second:r}}function nn(e){if(e.second===void 0)throw Error("Missing second PRF result");const t=new Uint8Array(e.first.byteLength+e.second.byteLength);return t.set(new Uint8Array(e.first),0),t.set(new Uint8Array(e.second),e.first.byteLength),ke(st,t,Tt)}class es{passphrase=null;scryptWorkFactor=18;recipients=[];setPassphrase(t){if(this.passphrase!==null)throw new Error("can encrypt to at most one passphrase");if(this.recipients.length!==0)throw new Error("can't encrypt to both recipients and passphrases");this.passphrase=t}setScryptWorkFactor(t){this.scryptWorkFactor=t}addRecipient(t){if(this.passphrase!==null)throw new Error("can't encrypt to both recipients and passphrases");typeof t=="string"?this.recipients.push(new Kr(t)):this.recipients.push(t)}async encrypt(t){const n=ft(16),r=[];let o=this.recipients;this.passphrase!==null&&(o=[new Nr(this.passphrase,this.scryptWorkFactor)]);for(const u of o)r.push(...await u.wrapFileKey(n));const s=wt(st,n,void 0,"header",32),c=mt(st,s,Qe(r)),i=Tr(r,c),f=ft(16),l=wt(st,n,f,"payload",32),h=Rr(l);return t instanceof ReadableStream?Object.assign(Lt(t.pipeThrough(h),i,f),{size:u=>$r(u)+i.length+f.length}):(typeof t=="string"&&(t=new TextEncoder().encode(t)),await Fe(Lt(Wt(t).pipeThrough(h),i,f)))}}class ns{identities=[];addPassphrase(t){this.identities.push(new Mr(t))}addIdentity(t){typeof t=="string"||Yr(t)?this.identities.push(new Hr(t)):this.identities.push(t)}async decrypt(t,n){const r=t instanceof ReadableStream?t:Wt(t),{fileKey:o,headerSize:s,rest:c}=await this.decryptHeaderInternal(r),{data:i,rest:f}=await Sr(c,16),l=wt(st,o,i,"payload",32),h=qr(l),u=f.pipeThrough(h),a=Object.assign(u,{size:d=>Or(d-s-i.length)});return t instanceof ReadableStream?a:n==="text"?await Lr(u):await Fe(u)}async decryptHeader(t){return(await this.decryptHeaderInternal(Wt(t))).fileKey}async decryptHeaderInternal(t){const n=await kr(t),r=await this.unwrapFileKey(n.stanzas);if(r===null)throw Error("no identity matched any of the file's recipients");const o=wt(st,r,void 0,"header",32),s=mt(st,o,n.headerNoMAC);if(!Xr(n.MAC,s))throw Error("invalid header HMAC");return{fileKey:r,headerSize:n.headerSize,rest:n.rest}}async unwrapFileKey(t){for(const n of this.identities){const r=await n.unwrapFileKey(t);if(r!==null)return r}return null}}function Xr(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function Yr(e){return typeof CryptoKey<"u"&&e instanceof CryptoKey}const rs=on({__name:"PasswordField",props:{modelValue:{},modelModifiers:{},visible:{type:Boolean,default:!1},visibleModifiers:{}},emits:["update:modelValue","update:visible"],setup(e,{expose:t}){const n=se(e,"modelValue"),r=se(e,"visible"),o=cn("textField");return t({textField:o}),(s,c)=>(fn(),an(ln,{ref_key:"textField",ref:o,modelValue:n.value,"onUpdate:modelValue":c[1]||(c[1]=i=>n.value=i),variant:"outlined",density:"compact",type:r.value?"text":"password"},{"append-inner":oe(()=>[hn(un,{onClick:c[0]||(c[0]=i=>r.value=!r.value)},{default:oe(()=>[dn(yn(r.value?"mdi-eye-off":"mdi-eye"),1)]),_:1})]),_:1},8,["modelValue","type"]))}});export{ns as D,es as E,Jr as W,rs as _,ts as a,Fr as g,Qr as i};
|