@appsys-sas/devtool 1.0.2 → 1.1.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.
Files changed (69) hide show
  1. package/dist/lib/index.js +4837 -832
  2. package/dist/schema/config.schema.json +66 -12
  3. package/dist/ui/assets/Checkbox-X08aIO0U.js +1 -0
  4. package/dist/ui/assets/Collection-Dlps0JDW.js +1 -0
  5. package/dist/ui/assets/{ConfigFileChoice-BVnnuM-Z.js → ConfigFileChoice-dZsaFuZD.js} +1 -1
  6. package/dist/ui/assets/{ConfirmDialog-BAMLkbq2.js → ConfirmDialog-DYNB5IAJ.js} +1 -1
  7. package/dist/ui/assets/DashboardView--hjjXb6t.js +1 -0
  8. package/dist/ui/assets/{DialogClose-4ujukXWU.js → DialogClose-l707gO7f.js} +1 -1
  9. package/dist/ui/assets/DirectoryCommandView-BYW3R65f.js +1 -0
  10. package/dist/ui/assets/{DirectoryFilesView-C4n4_Nb4.js → DirectoryFilesView-CZeq7dgz.js} +1 -1
  11. package/dist/ui/assets/DirectoryHomeView-BT9Te-VS.js +1 -0
  12. package/dist/ui/assets/DirectoryIndexView-BA0XNJCC.js +1 -0
  13. package/dist/ui/assets/{DirectoryStreamView-B-iN4d9Q.js → DirectoryStreamView-K9ZQAtUv.js} +1 -1
  14. package/dist/ui/assets/EnvironmentView-CFQ5A7jc.js +2 -0
  15. package/dist/ui/assets/{FieldRoot-C5XWSUlP.js → FieldRoot-riDRLSqS.js} +1 -1
  16. package/dist/ui/assets/FileSpaceView-BTgGMs7p.js +2 -0
  17. package/dist/ui/assets/{Input-Dt40QAoW.js → Input-B8rdCliw.js} +1 -1
  18. package/dist/ui/assets/{IntegrationLink-BL_aKgVr.js → IntegrationLink-BAesFgjp.js} +1 -1
  19. package/dist/ui/assets/IntegrationView-BckhyLij.js +2 -0
  20. package/dist/ui/assets/{MarkdownPreview-BFLfxZt9.js → MarkdownPreview-Cj64O3Pl.js} +3 -3
  21. package/dist/ui/assets/{McpDiff-j1wSPmeB.js → McpDiff-CnSSHMIY.js} +1 -1
  22. package/dist/ui/assets/McpView-BFgSxgUF.js +1 -0
  23. package/dist/ui/assets/{PopperContent-Bdab7g93.js → PopperContent-6euDfba3.js} +1 -1
  24. package/dist/ui/assets/ProjectHomeView-d8Aajfih.js +1 -0
  25. package/dist/ui/assets/{ProjectStreamView-kF9gRqBM.js → ProjectStreamView-CIC071M_.js} +1 -1
  26. package/dist/ui/assets/RovingFocusItem-IhehrNVW.js +1 -0
  27. package/dist/ui/assets/{StreamView-B_eLxku4.js → StreamView-BI1OiSYC.js} +2 -2
  28. package/dist/ui/assets/TabsTrigger-kwYJULDQ.js +1 -0
  29. package/dist/ui/assets/{Teleport-pr1nbO15.js → Teleport-DHeiB0Hf.js} +1 -1
  30. package/dist/ui/assets/chevron-right-Ciz9rTD0.js +1 -0
  31. package/dist/ui/assets/dist-CTEwM5Qh.js +1 -0
  32. package/dist/ui/assets/{file-text-D9djZBLH.js → file-text-C2envr-4.js} +1 -1
  33. package/dist/ui/assets/{format-Blyl-fa4.js → format-CWWug1jh.js} +1 -1
  34. package/dist/ui/assets/index-BROv5BcC.js +13 -0
  35. package/dist/ui/assets/index-BceEHJll.css +2 -0
  36. package/dist/ui/assets/{jsonMode-CmhQCl7_.js → jsonMode-DggjiWZO.js} +1 -1
  37. package/dist/ui/assets/lib-BdSNv3tE.js +8 -0
  38. package/dist/ui/assets/{message-square-BpPqt60v.js → message-square-DQar_s3z.js} +1 -1
  39. package/dist/ui/assets/{monaco-CX0SLasY.js → monaco-uxN5Nj6W.js} +3 -3
  40. package/dist/ui/assets/{play-D6zO8ZKr.js → play-BURz2wPD.js} +1 -1
  41. package/dist/ui/assets/search-Be4Qyda_.js +1 -0
  42. package/dist/ui/assets/select-Dl7jIzvQ.js +1 -0
  43. package/dist/ui/assets/{sparkles-BIux6oN0.js → sparkles-DQZgGD3J.js} +1 -1
  44. package/dist/ui/assets/{triangle-alert-BBtZmfCD.js → triangle-alert-Bi6TbWM9.js} +1 -1
  45. package/dist/ui/assets/{useNonce-D2uGurBI.js → useNonce-Dk4IgdzV.js} +1 -1
  46. package/dist/ui/assets/ws-BpxG87gL.js +2 -0
  47. package/dist/ui/index.html +16 -16
  48. package/package.json +12 -10
  49. package/dist/ui/assets/Checkbox-Cl4wmJCk.js +0 -1
  50. package/dist/ui/assets/DashboardView-Ck0N2ntG.js +0 -1
  51. package/dist/ui/assets/DirectoryHomeView-DLvjOvA3.js +0 -1
  52. package/dist/ui/assets/DirectoryIndexView-t8aAP2jN.js +0 -1
  53. package/dist/ui/assets/EnvironmentView-D69rEdhd.js +0 -2
  54. package/dist/ui/assets/FileSpaceView-M_U8j3sE.js +0 -2
  55. package/dist/ui/assets/IntegrationView-D9_KGAU-.js +0 -2
  56. package/dist/ui/assets/McpView-CeyBs86d.js +0 -1
  57. package/dist/ui/assets/ProjectHomeView-CYJD9ORc.js +0 -1
  58. package/dist/ui/assets/RovingFocusItem-1sxrYVGD.js +0 -1
  59. package/dist/ui/assets/SidebarToggle-B9cXgFfw.js +0 -1
  60. package/dist/ui/assets/TabsTrigger-DLE9zNLy.js +0 -1
  61. package/dist/ui/assets/badge-Ca2znkTN.js +0 -1
  62. package/dist/ui/assets/chevron-right-Cp1Llnp2.js +0 -1
  63. package/dist/ui/assets/dist-1J-RzTp-.js +0 -1
  64. package/dist/ui/assets/index-BcQvyHh1.js +0 -13
  65. package/dist/ui/assets/index-CmZ17R-2.css +0 -2
  66. package/dist/ui/assets/lib-DxxZQ3kp.js +0 -8
  67. package/dist/ui/assets/search-BKszmzOP.js +0 -1
  68. package/dist/ui/assets/select-C9mXzu-R.js +0 -1
  69. package/dist/ui/assets/ws-DXdsSbKc.js +0 -2
@@ -210,7 +210,8 @@
210
210
  "additionalProperties": false,
211
211
  "properties": {
212
212
  "server": { "type": "integer", "minimum": 1, "default": 6730, "description": "Port of the server and the interface, on 127.0.0.1." },
213
- "loadBalancer": { "type": "integer", "minimum": 1, "default": 6731, "description": "Port of the load balancer, on every interface." }
213
+ "loadBalancer": { "type": "integer", "minimum": 1, "default": 6731, "description": "Port of the load balancer, on every interface." },
214
+ "public": { "type": "integer", "minimum": 1, "maximum": 65535, "description": "Port browsers reach the load balancer on, such as 443 with devtool proxy; the interface opens services on it. Default: the port of the load balancer." }
214
215
  }
215
216
  },
216
217
  "shell": { "type": "string", "description": "Default shell of the commands. Default: $SHELL." },
@@ -485,7 +486,7 @@
485
486
  "detached": { "type": "boolean", "default": false, "description": "Run without a terminal; value blocks and unless are not read." },
486
487
  "prompt": { "type": "boolean", "default": false, "description": "Run in the background and show its questions in a dialog, instead of opening its terminal." },
487
488
  "startWithSection": { "type": "boolean", "default": false, "description": "Start when the section is started from its header." },
488
- "form": { "type": "string", "enum": ["dialog", "inline"], "default": "dialog", "description": "Where the inputs are asked on the project page." },
489
+ "form": { "$ref": "#/$defs/commandForm", "default": "dialog" },
489
490
  "notifications": { "type": "boolean" },
490
491
  "mcp": { "$ref": "#/$defs/mcpRules" },
491
492
  "meta": { "$ref": "#/$defs/meta" }
@@ -497,10 +498,15 @@
497
498
  "properties": {
498
499
  "prompt": { "type": "boolean" },
499
500
  "args": { "$ref": "#/$defs/args" },
500
- "form": { "type": "string", "enum": ["dialog", "inline"] },
501
+ "form": { "$ref": "#/$defs/commandForm" },
501
502
  "mcp": { "$ref": "#/$defs/mcpRules" }
502
503
  }
503
504
  },
505
+ "commandForm": {
506
+ "type": "string",
507
+ "enum": ["dialog", "inline", "inlineExpanded", "page"],
508
+ "description": "Where the inputs are asked when the command starts: in a dialog, in its row of the project page (unfolded on click, or from the start), or on the page of the command."
509
+ },
504
510
  "scriptFolder": {
505
511
  "anyOf": [
506
512
  { "type": "string", "description": "Short form of { path }." },
@@ -511,7 +517,7 @@
511
517
  "properties": {
512
518
  "path": { "type": "string", "description": "Folder of executables, relative to the project." },
513
519
  "prompt": { "type": "boolean", "default": false },
514
- "form": { "type": "string", "enum": ["dialog", "inline"], "default": "inline" },
520
+ "form": { "$ref": "#/$defs/commandForm", "default": "inline" },
515
521
  "only": { "type": "array", "items": { "type": "string" }, "description": "Glob patterns of the file names kept." },
516
522
  "mcp": { "$ref": "#/$defs/mcpRules" },
517
523
  "scripts": { "type": "object", "additionalProperties": { "$ref": "#/$defs/scriptSettings" }, "description": "Settings by file name." }
@@ -542,7 +548,8 @@
542
548
  "pathNot": { "type": "string", "description": "Requests whose path starts with it are left out." },
543
549
  "prefix": { "type": "string", "description": "Removed from the path before forwarding." },
544
550
  "preserveHost": { "type": "boolean", "description": "Keep the original Host header." },
545
- "access": { "$ref": "#/$defs/access" }
551
+ "access": { "$ref": "#/$defs/access" },
552
+ "meta": { "$ref": "#/$defs/meta" }
546
553
  }
547
554
  },
548
555
  "files": {
@@ -586,11 +593,34 @@
586
593
  ]
587
594
  },
588
595
  "backendName": { "type": "string", "description": "Name of a backend of environment.backends; the default backend when omitted." },
596
+ "transferGroup": {
597
+ "description": "Groups of the identity provider of the auth section, the developer needing one of them; false lets nobody.",
598
+ "oneOf": [
599
+ { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "examples": [["developers"]] },
600
+ { "const": false }
601
+ ]
602
+ },
603
+ "transferGroups": {
604
+ "type": "object",
605
+ "additionalProperties": false,
606
+ "description": "Who may pull and who may push; a direction left out lets everyone.",
607
+ "properties": {
608
+ "pull": { "$ref": "#/$defs/transferGroup" },
609
+ "push": { "$ref": "#/$defs/transferGroup" }
610
+ }
611
+ },
612
+ "archiveFormat": {
613
+ "type": "string",
614
+ "enum": ["devtool", "native"],
615
+ "default": "devtool",
616
+ "description": "devtool: the framed archive of the devtool. native: the archive of the engine's own tools (mongodump --archive --gzip, pg_dump -Fc, gzipped mariadb-dump), or a tar.gz of the objects for a bucket."
617
+ },
589
618
  "backendShared": {
590
619
  "type": "object",
591
620
  "properties": {
592
621
  "default": { "type": "boolean", "default": false, "description": "Items naming no backend, and the shared configuration, use this one; the first backend when none is marked." },
593
- "encryption": { "$ref": "#/$defs/encryption" }
622
+ "encryption": { "$ref": "#/$defs/encryption" },
623
+ "groups": { "$ref": "#/$defs/transferGroups", "description": "Who may pull and push the items of the backend, unless an item names its own groups." }
594
624
  }
595
625
  },
596
626
  "backend": {
@@ -614,7 +644,7 @@
614
644
  "properties": {
615
645
  "type": { "const": "s3", "description": "An S3 bucket, on AWS or any S3 compatible service." },
616
646
  "bucket": { "type": "string" },
617
- "prefix": { "type": "string", "description": "Prefix of the keys of the files." },
647
+ "prefix": { "type": "string", "description": "Folder of the files in the bucket; its root when omitted, `.` or `/`." },
618
648
  "endpoint": { "type": "string", "description": "Address of an S3 compatible service; AWS when omitted." },
619
649
  "region": { "type": "string", "default": "us-east-1" },
620
650
  "accessKeyId": { "type": "string", "description": "Value blocks are read; the default AWS credentials when omitted." },
@@ -645,23 +675,27 @@
645
675
  "required": ["type", "url"],
646
676
  "properties": {
647
677
  "type": { "const": "git", "description": "A git repository, each push a commit, read and written with the git of the machine." },
648
- "url": { "type": "string", "description": "Address of the repository, as git clone takes it." },
678
+ "url": { "type": "string", "description": "Address of the repository, as git clone takes it; a relative local path is read from the folder of the configuration file." },
649
679
  "branch": { "type": "string", "default": "main" },
650
- "path": { "type": "string", "description": "Folder of the files in the repository; its root when omitted." }
680
+ "path": { "type": "string", "description": "Folder of the files in the repository; its root when omitted, `.` or `/`." }
651
681
  }
652
682
  },
653
683
  {
654
684
  "type": "object",
655
685
  "allOf": [{ "$ref": "#/$defs/backendShared" }],
656
686
  "unevaluatedProperties": false,
657
- "required": ["type", "list", "download", "upload", "remove"],
687
+ "required": ["type", "list", "download"],
688
+ "anyOf": [
689
+ { "required": ["upload", "remove"] },
690
+ { "required": ["groups"], "properties": { "groups": { "required": ["push"], "properties": { "push": { "const": false } } } } }
691
+ ],
658
692
  "properties": {
659
693
  "type": { "const": "scripts", "description": "Your own commands, for any storage the other backends do not reach." },
660
694
  "cwd": { "type": "string", "default": ".", "description": "Folder the commands run in, relative to the configuration folder." },
661
695
  "list": { "$ref": "#/$defs/plainArgs", "description": "Prints { \"files\": [ { \"path\", \"size\", \"updatedAt\", \"version\" } ] }." },
662
696
  "download": { "$ref": "#/$defs/plainArgs", "description": "Writes %{ADT:PATH} to %{ADT:FILE}; exits 2 when the file does not exist." },
663
- "upload": { "$ref": "#/$defs/plainArgs", "description": "Stores %{ADT:FILE} as %{ADT:PATH}." },
664
- "remove": { "$ref": "#/$defs/plainArgs", "description": "Deletes %{ADT:PATH}." },
697
+ "upload": { "$ref": "#/$defs/plainArgs", "description": "Stores %{ADT:FILE} as %{ADT:PATH}; optional when groups.push is false." },
698
+ "remove": { "$ref": "#/$defs/plainArgs", "description": "Deletes %{ADT:PATH}; optional when groups.push is false." },
665
699
  "env": { "$ref": "#/$defs/stringMap", "description": "Environment variables of the commands; value blocks are read." }
666
700
  }
667
701
  }
@@ -696,6 +730,19 @@
696
730
  "items": { "$ref": "#/$defs/encryptionRule" }
697
731
  },
698
732
  "folder": { "type": "string", "description": "Local mirror of the files of the backends. Default: the parent of the configuration folder." },
733
+ "sections": {
734
+ "type": "object",
735
+ "description": "How the Environment page groups the items.",
736
+ "additionalProperties": false,
737
+ "properties": {
738
+ "by": { "enum": ["folder", "type"], "description": "Groups by the first folder of the item paths, or by type of item (file, database, bucket, redis). Default: folder." },
739
+ "names": {
740
+ "type": "object",
741
+ "description": "The name shown for a folder or a type, in place of the default one.",
742
+ "additionalProperties": { "type": "string", "pattern": "\\S" }
743
+ }
744
+ }
745
+ },
699
746
  "mcp": { "$ref": "#/$defs/mcpRules" },
700
747
  "files": {
701
748
  "type": "array",
@@ -719,6 +766,7 @@
719
766
  "examples": [["connections.*.lastUsedAt"]]
720
767
  },
721
768
  "pull": { "$ref": "#/$defs/pull" },
769
+ "groups": { "$ref": "#/$defs/transferGroups", "description": "Who may pull and push it, replacing the groups of its backend direction by direction, except a direction the backend sets to false." },
722
770
  "mcp": { "$ref": "#/$defs/mcpRules" }
723
771
  }
724
772
  }
@@ -735,9 +783,12 @@
735
783
  "path": { "type": "string", "description": "Archive of the database in the environment folder." },
736
784
  "engine": { "type": "string", "enum": ["postgres", "mariadb", "mongodb"] },
737
785
  "container": { "type": "string", "description": "Docker container running the database." },
786
+ "database": { "type": "string", "pattern": "\\S", "description": "Database of the container; the one the image creates when omitted (POSTGRES_DB, MARIADB_DATABASE, MONGO_INITDB_DATABASE)." },
787
+ "format": { "$ref": "#/$defs/archiveFormat" },
738
788
  "backend": { "$ref": "#/$defs/backendName" },
739
789
  "encryption": { "$ref": "#/$defs/encryption" },
740
790
  "pull": { "$ref": "#/$defs/pull" },
791
+ "groups": { "$ref": "#/$defs/transferGroups", "description": "Who may pull and push it, replacing the groups of its backend direction by direction, except a direction the backend sets to false." },
741
792
  "mcp": { "$ref": "#/$defs/mcpRules" }
742
793
  }
743
794
  }
@@ -751,9 +802,11 @@
751
802
  "properties": {
752
803
  "path": { "type": "string", "description": "Snapshot of the bucket in the environment folder." },
753
804
  "bucket": { "type": "string" },
805
+ "format": { "$ref": "#/$defs/archiveFormat" },
754
806
  "backend": { "$ref": "#/$defs/backendName" },
755
807
  "encryption": { "$ref": "#/$defs/encryption" },
756
808
  "pull": { "$ref": "#/$defs/pull" },
809
+ "groups": { "$ref": "#/$defs/transferGroups", "description": "Who may pull and push it, replacing the groups of its backend direction by direction, except a direction the backend sets to false." },
757
810
  "mcp": { "$ref": "#/$defs/mcpRules" }
758
811
  }
759
812
  }
@@ -770,6 +823,7 @@
770
823
  "backend": { "$ref": "#/$defs/backendName" },
771
824
  "encryption": { "$ref": "#/$defs/encryption" },
772
825
  "pull": { "$ref": "#/$defs/pull" },
826
+ "groups": { "$ref": "#/$defs/transferGroups", "description": "Who may pull and push it, replacing the groups of its backend direction by direction, except a direction the backend sets to false." },
773
827
  "mcp": { "$ref": "#/$defs/mcpRules" }
774
828
  }
775
829
  }
@@ -0,0 +1 @@
1
+ import{H as e,M as t,S as n,b as r,g as i}from"./Teleport-DHeiB0Hf.js";import{D as a,Ht as o,L as s,Nt as c,On as l,b as u,bt as d,ct as f,et as p,g as m,it as h,k as g,mt as _,o as v,qt as y,v as b,wt as x,xt as S,y as C}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{C as w,w as T}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{C as E,D,S as O}from"./ws-BpxG87gL.js";import{l as k}from"./dist-D9QT5EVc.js";import{a as A,i as j,n as M,r as N,s as P,t as F}from"./FieldRoot-riDRLSqS.js";import{n as I}from"./Collection-Dlps0JDW.js";import{t as L}from"./RovingFocusItem-IhehrNVW.js";var R=D({name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]});function z(e,t){return j(e)?!1:Array.isArray(e)?e.some(e=>A(e,t)):A(e,t)}function B(){let e=s()?.vnode?.scopeId;return e?{[e]:``}:{}}var V=g({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=I(),i=m(()=>t.checked??t.value);return o(i,(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(_(),b(M,p({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),H=g({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=m(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=m(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(i,a)=>(_(),u(v,null,[C(` We render single input if it's required `),n.value?(_(),b(V,p({key:e.name},{...t,...i.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(_(!0),u(v,{key:1},d(r.value,e=>(_(),b(V,p({key:e.name},{ref_for:!0},{...t,...i.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`]))),128))],2112))}}),[ee,U]=e(`CheckboxGroupRoot`);function W(e){return e===`indeterminate`}function G(e){return W(e)?`indeterminate`:e?`checked`:`unchecked`}var[K,q]=e(`CheckboxRoot`),J=g({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:r}){let i=e,a=r,{forwardRef:s,currentElement:d}=n(),g=ee(null),D=F(null),O=t(i,`modelValue`,a,{defaultValue:i.defaultValue??i.falseValue,passive:i.modelValue===void 0}),k=m(()=>{let e=g?.max.value;if(j(e))return!1;let t=g.modelValue.value??[];return!z(t,i.value)&&t.length>=e}),M=m(()=>!!(g?.disabled.value||i.disabled||D?.disabled.value)),P=m(()=>M.value||k.value),I=m(()=>!!D&&!g),R=m(()=>i.id??(I.value?D?.fieldId.value:void 0)),V=m(()=>i.name??D?.name.value),U=m(()=>D?i.required||D.required.value:i.required),K=m(()=>A(O.value,i.trueValue)),J=m(()=>j(g?.modelValue.value)?O.value===`indeterminate`?`indeterminate`:K.value:z(g.modelValue.value,i.value));function Y(){if(P.value)return;let e=J.value!==!0;if(j(g?.modelValue.value))O.value===`indeterminate`?O.value=i.trueValue:O.value=K.value?i.falseValue:i.trueValue;else{let e=[...g.modelValue.value||[]];if(z(e,i.value)){let t=e.findIndex(e=>A(e,i.value));e.splice(t,1)}else e.push(i.value);g.modelValue.value=e}I.value&&D?.handleControlInput({value:e})}o(J,e=>{I.value&&D?.reportControlState({filled:e===!0})});let X=N(d),Z=B(),Q=c(),te=m(()=>{if(!Q[`aria-label`])return R.value&&d.value?document.querySelector(`[for="${R.value}"]`)?.innerText:void 0});function ne(){let e=(e,t)=>[e,t].filter(Boolean).join(` `)||void 0;return{"aria-labelledby":e(Q[`aria-labelledby`],I.value?D?.labelId.value:void 0),"aria-describedby":e(Q[`aria-describedby`],D?.describedBy.value),"aria-invalid":Q[`aria-invalid`]??(D?.invalid.value||void 0)}}function re(){D?.handleControlFocus()}function ie(){I.value?D?.handleControlBlur():D?.reportControlState({focused:!1,touched:!0})}let $;return f(()=>{I.value&&($=D?.registerControl({id:()=>R.value,element:()=>d.value,getValue:()=>J.value,required:()=>i.required,isFilled:e=>e===!0}))}),h(()=>$?.()),q({disabled:M,state:J}),(t,n)=>(_(),u(v,null,[(_(),b(x(l(g)?.rovingFocus.value?l(L):l(E)),p({...l(D)?.dataAttributes.value,...t.$attrs,...l(Z),...ne()},{id:R.value,ref:l(s),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":l(W)(J.value)?`mixed`:J.value,"aria-required":U.value,"aria-label":t.$attrs[`aria-label`]||te.value,"data-state":l(G)(J.value),"aria-disabled":P.value?`true`:void 0,"data-disabled":M.value?``:void 0,disabled:M.value,focusable:l(g)?.rovingFocus.value?!M.value:void 0,onKeydown:w(T(()=>{},[`prevent`]),[`enter`]),onClick:Y,onFocus:re,onBlur:ie}),{default:y(()=>[S(t.$slots,`default`,{modelValue:l(O),state:J.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`aria-disabled`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),l(X)&&V.value&&!l(g)?(_(),b(l(H),p({key:0,type:`checkbox`,checked:!!J.value,name:V.value,value:e.value,disabled:M.value,required:U.value},l(Z)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):C(`v-if`,!0)],64))}}),Y=g({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=n(),r=K();return(n,o)=>(_(),b(l(i),{present:e.forceMount||l(W)(l(r).state.value)||l(r).state.value===!0},{default:y(()=>[a(l(E),p({ref:l(t),"data-state":l(G)(l(r).state.value),"data-disabled":l(r).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},n.$attrs),{default:y(()=>[S(n.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),X=g({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,i=t,o=k(n,`class`),s=r(o,i);return(e,t)=>(_(),b(l(J),p({"data-slot":`checkbox`},l(s),{class:l(O)(`peer border-input dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:data-[state=indeterminate]:bg-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,n.class)}),{default:y(({state:e})=>[a(l(Y),{"data-slot":`checkbox-indicator`,class:`flex items-center justify-center text-current transition-none`},{default:y(()=>[e===`indeterminate`?(_(),b(l(R),{key:0,class:`size-3.5`})):(_(),b(l(P),{key:1,class:`size-3.5`}))]),_:2},1024)]),_:1},16,[`class`]))}});export{X as t};
@@ -0,0 +1 @@
1
+ import{O as e}from"./Teleport-DHeiB0Hf.js";import{B as t,Ht as n,J as r,Ut as i,fn as a,g as o,gt as s,k as c,vn as l}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{w as u}from"./ws-BpxG87gL.js";function d(){let t=l();return{primitiveElement:t,currentElement:o(()=>[`#text`,`#comment`].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:e(t))}}var f=`data-reka-collection-item`;function p(e={}){let{key:p=``,isProvider:m=!1}=e,h=`${p}CollectionProvider`,g;if(m){let e=l(new Map);g={collectionRef:l(),itemMap:e},s(h,g)}else g=r(h);let _=(e,t=!1)=>{if(!g.collectionRef.value)return;let n=g.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},v=(e=!1)=>{let t=g.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${f}]`)),r=new Map(n.map((e,t)=>[e,t])),i=Array.from(g.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?i:i.filter(e=>e.ref.dataset.disabled!==``)},y=c({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:r,attrs:i}){let{primitiveElement:a,currentElement:o}=d();return n(o,()=>{g.collectionRef.value=o.value}),()=>t(u,{ref:a,...i},r)}}),b=c({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:n,attrs:r}){let{primitiveElement:o,currentElement:s}=d();return i(t=>{if(s.value){let n=a(s.value);g.itemMap.value.set(n,{ref:s.value,value:e.value}),t(()=>g.itemMap.value.delete(n))}}),()=>t(u,{...r,[f]:``,ref:o},n)}});return{getItems:v,getItem:_,reactiveItems:o(()=>Array.from(g.itemMap.value.values())),itemMapSize:o(()=>g.itemMap.value.size),CollectionSlot:y,CollectionItem:b}}export{d as n,p as t};
@@ -1 +1 @@
1
- import{$ as e,E as t,Ft as n,On as r,Zn as i,_ as a,b as o,bt as s,k as c,mt as l,o as u,tr as d}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{S as f,u as p}from"./ws-DXdsSbKc.js";var m={class:`flex flex-wrap items-center gap-3 rounded-md border bg-muted/40 px-3 py-2 text-xs`},h={class:`flex rounded-md border bg-background p-0.5`},g=[`disabled`,`title`,`onClick`],_={class:`text-muted-foreground`},v=c({__name:`ConfigFileChoice`,props:e({localFile:{},sharedHint:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let c=n(e,`modelValue`);return(n,v)=>(l(),o(`div`,m,[v[1]||=a(`span`,{class:`text-muted-foreground`},`Write changes to`,-1),a(`div`,h,[(l(!0),o(u,null,s([{file:`local`,label:`Personal`,hint:e.localFile?r(p)(e.localFile):`no personal override loaded`},{file:`declared`,label:`Shared`,hint:`the file declaring each setting`}],t=>(l(),o(`button`,{key:t.file,type:`button`,disabled:t.file===`local`&&!e.localFile,class:i(r(f)(`rounded px-2.5 py-1 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,c.value===t.file?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`)),title:t.hint,onClick:e=>c.value=t.file},d(t.label),11,g))),128))]),a(`span`,_,[c.value===`local`?(l(),o(u,{key:0},[a(`code`,null,d(e.localFile?r(p)(e.localFile):``),1),v[0]||=t(`, loaded last: it prevails over every other file, for you only. `,-1)],64)):(l(),o(u,{key:1},[t(d(e.sharedHint),1)],64))])]))}});export{v as t};
1
+ import{$ as e,E as t,Ft as n,On as r,Zn as i,_ as a,b as o,bt as s,k as c,mt as l,o as u,tr as d}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{S as f,u as p}from"./ws-BpxG87gL.js";var m={class:`flex flex-wrap items-center gap-3 rounded-md border bg-muted/40 px-3 py-2 text-xs`},h={class:`flex rounded-md border bg-background p-0.5`},g=[`disabled`,`title`,`onClick`],_={class:`text-muted-foreground`},v=c({__name:`ConfigFileChoice`,props:e({localFile:{},sharedHint:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let c=n(e,`modelValue`);return(n,v)=>(l(),o(`div`,m,[v[1]||=a(`span`,{class:`text-muted-foreground`},`Write changes to`,-1),a(`div`,h,[(l(!0),o(u,null,s([{file:`local`,label:`Personal`,hint:e.localFile?r(p)(e.localFile):`no personal override loaded`},{file:`declared`,label:`Shared`,hint:`the file declaring each setting`}],t=>(l(),o(`button`,{key:t.file,type:`button`,disabled:t.file===`local`&&!e.localFile,class:i(r(f)(`rounded px-2.5 py-1 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,c.value===t.file?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`)),title:t.hint,onClick:e=>c.value=t.file},d(t.label),11,g))),128))]),a(`span`,_,[c.value===`local`?(l(),o(u,{key:0},[a(`code`,null,d(e.localFile?r(p)(e.localFile):``),1),v[0]||=t(`, loaded last: it prevails over every other file, for you only. `,-1)],64)):(l(),o(u,{key:1},[t(d(e.sharedHint),1)],64))])]))}});export{v as t};
@@ -1 +1 @@
1
- import{C as e,H as t,S as n,b as r,t as i}from"./Teleport-pr1nbO15.js";import{$ as a,$n as o,D as s,E as c,Ft as l,On as u,Zn as d,_ as f,ct as p,et as m,k as h,mt as g,qt as _,tr as v,tt as y,v as b,vn as x,xt as S,z as C}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{w}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{b as T}from"./ws-DXdsSbKc.js";import{t as E}from"./DialogClose-4ujukXWU.js";import{M as D,N as O,P as k,j as A,k as j}from"./index-BcQvyHh1.js";var M=h({__name:`AlertDialogAction`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(E),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),[N,P]=t(`AlertDialogContent`),F=h({__name:`AlertDialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(t,{emit:r}){let i=t,a=e(r);n();let o=x();return P({onCancelElementChange:e=>{o.value=e}}),(e,t)=>(g(),b(u(O),m({...i,...u(a)},{role:`alertdialog`,onPointerDownOutside:t[0]||=w(()=>{},[`prevent`]),onInteractOutside:t[1]||=w(()=>{},[`prevent`]),onOpenAutoFocus:t[2]||=()=>{y(()=>{o.value?.focus({preventScroll:!0})})}}),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),I=h({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,r=N(),{forwardRef:i,currentElement:a}=n();return p(()=>{r.onCancelElementChange(a.value)}),(e,n)=>(g(),b(u(E),m(t,{ref:u(i)}),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),L=h({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(D),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),R=h({__name:`AlertDialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(A),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),z=h({__name:`AlertDialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(g(),b(u(i),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),B=h({__name:`AlertDialogRoot`,props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:t}){let i=r(e,t);return n(),(e,t)=>(g(),b(u(k),m(u(i),{modal:!0}),{default:_(t=>[S(e.$slots,`default`,o(C(t)))]),_:3},16))}}),V=h({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(j),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),H={class:`flex justify-end gap-2`},U=h({__name:`ConfirmDialog`,props:a({title:{},confirmLabel:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:a([`confirm`],[`update:open`]),setup(e,{emit:t}){let n=l(e,`open`),r=t;return(t,i)=>(g(),b(u(B),{open:n.value,"onUpdate:open":i[1]||=e=>n.value=e},{default:_(()=>[s(u(z),null,{default:_(()=>[s(u(R),{class:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`}),s(u(F),{class:`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg sm:max-w-lg`},{default:_(()=>[s(u(V),{class:`text-lg font-semibold`},{default:_(()=>[c(v(e.title),1)]),_:1}),s(u(L),{as:`div`,class:`text-sm text-muted-foreground`},{default:_(()=>[S(t.$slots,`default`)]),_:3}),f(`div`,H,[s(u(I),{class:d(u(T)({variant:`outline`}))},{default:_(()=>[...i[2]||=[c(` Cancel `,-1)]]),_:1},8,[`class`]),s(u(M),{class:d(u(T)({variant:`destructive`})),onClick:i[0]||=e=>r(`confirm`)},{default:_(()=>[c(v(e.confirmLabel),1)]),_:1},8,[`class`])])]),_:3})]),_:3})]),_:3},8,[`open`]))}});export{R as a,F as c,z as i,M as l,V as n,L as o,B as r,I as s,U as t};
1
+ import{C as e,H as t,S as n,b as r,t as i}from"./Teleport-DHeiB0Hf.js";import{$ as a,$n as o,D as s,E as c,Ft as l,On as u,Zn as d,_ as f,ct as p,et as m,k as h,mt as g,qt as _,tr as v,tt as y,v as b,vn as x,xt as S,z as C}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{w}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{b as T}from"./ws-BpxG87gL.js";import{t as E}from"./DialogClose-l707gO7f.js";import{B as D,F as O,L as k,R as A,z as j}from"./index-BROv5BcC.js";var M=h({__name:`AlertDialogAction`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(E),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),[N,P]=t(`AlertDialogContent`),F=h({__name:`AlertDialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(t,{emit:r}){let i=t,a=e(r);n();let o=x();return P({onCancelElementChange:e=>{o.value=e}}),(e,t)=>(g(),b(u(j),m({...i,...u(a)},{role:`alertdialog`,onPointerDownOutside:t[0]||=w(()=>{},[`prevent`]),onInteractOutside:t[1]||=w(()=>{},[`prevent`]),onOpenAutoFocus:t[2]||=()=>{y(()=>{o.value?.focus({preventScroll:!0})})}}),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),I=h({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,r=N(),{forwardRef:i,currentElement:a}=n();return p(()=>{r.onCancelElementChange(a.value)}),(e,n)=>(g(),b(u(E),m(t,{ref:u(i)}),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),L=h({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(A),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),R=h({__name:`AlertDialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(k),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),z=h({__name:`AlertDialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(g(),b(u(i),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),B=h({__name:`AlertDialogRoot`,props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:t}){let i=r(e,t);return n(),(e,t)=>(g(),b(u(D),m(u(i),{modal:!0}),{default:_(t=>[S(e.$slots,`default`,o(C(t)))]),_:3},16))}}),V=h({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e;return n(),(e,n)=>(g(),b(u(O),o(C(t)),{default:_(()=>[S(e.$slots,`default`)]),_:3},16))}}),H={class:`flex justify-end gap-2`},U=h({__name:`ConfirmDialog`,props:a({title:{},confirmLabel:{},disabled:{type:Boolean}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:a([`confirm`],[`update:open`]),setup(e,{emit:t}){let n=l(e,`open`),r=t;return(t,i)=>(g(),b(u(B),{open:n.value,"onUpdate:open":i[1]||=e=>n.value=e},{default:_(()=>[s(u(z),null,{default:_(()=>[s(u(R),{class:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`}),s(u(F),{class:`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 grid-cols-1 grid-rows-[auto_minmax(0,1fr)_auto] gap-4 rounded-lg border p-6 wrap-anywhere shadow-lg sm:max-w-lg`},{default:_(()=>[s(u(V),{class:`text-lg font-semibold`},{default:_(()=>[c(v(e.title),1)]),_:1}),s(u(L),{as:`div`,class:`min-h-0 overflow-y-auto text-sm break-words text-muted-foreground`},{default:_(()=>[S(t.$slots,`default`)]),_:3}),f(`div`,H,[s(u(I),{class:d(u(T)({variant:`outline`}))},{default:_(()=>[...i[2]||=[c(` Cancel `,-1)]]),_:1},8,[`class`]),s(u(M),{class:d(u(T)({variant:`destructive`})),disabled:e.disabled,onClick:i[0]||=e=>r(`confirm`)},{default:_(()=>[c(v(e.confirmLabel),1)]),_:1},8,[`class`,`disabled`])])]),_:3})]),_:3})]),_:3},8,[`open`]))}});export{R as a,F as c,z as i,M as l,V as n,L as o,B as r,I as s,U as t};
@@ -0,0 +1 @@
1
+ import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,g as c,k as l,mt as u,o as d,qt as f,tr as p,v as m,vn as h,xn as g,xt as _,y as v}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{w as y}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{p as b}from"./lib-BdSNv3tE.js";import{D as x,d as ee,g as S,p as C,t as w,x as T}from"./ws-BpxG87gL.js";import{o as E,s as D}from"./FieldRoot-riDRLSqS.js";import{n as O}from"./DialogClose-l707gO7f.js";import{t as k}from"./triangle-alert-Bi6TbWM9.js";import{t as A}from"./ConfirmDialog-DYNB5IAJ.js";import{t as j}from"./select-Dl7jIzvQ.js";import{E as M,K as N,P as te,a as P,i as F,n as I,q as ne,r as L,t as R,x as z}from"./index-BROv5BcC.js";import{n as B,r as V,t as H}from"./expiry-QwlCrVUd.js";import{t as U}from"./ConfigFileChoice-dZsaFuZD.js";var W=x({name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]}),G=x({name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]}),K=[`config`,`name`,`manual`];function q(e){return e.type===`service`&&e.index?`${e.type}:${e.slug}:${e.index}`:`${e.type}:${e.slug}`}function J(e,t,n){if(t===`name`)return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`,numeric:!0})).map(e=>e.key);let r=e.map(e=>e.key);if(t===`config`)return r;let i=n.filter(e=>r.includes(e));return[...i,...r.filter(e=>!i.includes(e))]}var Y={class:`min-w-0 flex-1`},X={class:`truncate font-mono text-sm`},Z={class:`truncate text-xs text-muted-foreground`},re={key:1,class:`text-destructive`},ie={key:0,class:`flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400`},ae=l({__name:`CertificatesCard`,setup(l){let h=C.items,_=g(null),y=g(null),b=c({get:()=>y.value!==null&&M.current.value===null,set:e=>{e||(y.value=null)}});n(h,e=>{let t=_.value,n=t?e.find(e=>e.name===t.name):void 0;if(!t||!n)return;if(n.renewal){_.value={...t,started:!0};return}if(!t.started)return;_.value=null;let r=S.commandStreams.value.some(e=>e.tag===t.tag);n.error?r||M.close():n.push.length&&(y.value={name:n.name,paths:n.push,revision:ee.state.value?.revision??0})});function x(e){return!e.expiresAt||e.renewal||!H(e.expiresAt,e.warnDays)?null:e.trigger===`auto`||e.trigger===`both`?`The automatic renewal has not succeeded yet.`:e.trigger===`button`?`Renew it soon.`:`Replace it soon.`}function E(e){return e.trigger===`button`||e.trigger===`both`}function D(e){let t=M.show(`Renew ${e.name}`);_.value={name:e.name,tag:t,started:!1},w.certificateRenew(e.name,t)}function O(){y.value&&w.envRun(`push`,y.value.paths.map(e=>({path:e,tables:null,keys:null})),y.value.revision)}return(n,c)=>(u(),o(d,null,[r(h).length?(u(),m(r(P),{key:0,class:`max-w-3xl`},{default:f(()=>[e(r(I),null,{default:f(()=>[e(r(R),null,{default:f(()=>[...c[1]||=[t(`Certificates`,-1)]]),_:1}),e(r(L),null,{default:f(()=>[...c[2]||=[t(`Certificates the load balancer serves.`,-1)]]),_:1})]),_:1}),e(r(F),{class:`space-y-2`},{default:f(()=>[(u(!0),o(d,null,s(r(h),n=>(u(),o(`div`,{key:n.name,class:`flex items-center gap-3 rounded-md border px-3 py-2`},[e(r(G),{class:`size-4 shrink-0 text-muted-foreground`}),a(`div`,Y,[a(`p`,X,p(n.name),1),a(`p`,Z,[n.expiresAt?(u(),o(d,{key:0},[a(`span`,{class:i(r(B)(n.expiresAt,n.warnDays))},p(r(V)(n.expiresAt)),3),n.issuer?(u(),o(d,{key:0},[t(` · `+p(n.issuer),1)],64)):v(``,!0)],64)):v(``,!0),n.error?(u(),o(`span`,re,[n.expiresAt?(u(),o(d,{key:0},[t(` · `)],64)):v(``,!0),t(p(n.error),1)])):v(``,!0)]),x(n)?(u(),o(`p`,ie,[e(r(k),{class:`size-3 shrink-0`}),t(` `+p(x(n)),1)])):v(``,!0)]),n.trigger===`auto`||n.trigger===`both`?(u(),m(r(te),{key:0,variant:`outline`},{default:f(()=>[...c[3]||=[t(` auto `,-1)]]),_:1})):v(``,!0),E(n)?(u(),m(r(T),{key:1,size:`sm`,variant:`outline`,class:`gap-1.5`,disabled:n.renewal!==null,onClick:e=>D(n)},{default:f(()=>[n.renewal?(u(),m(r(ne),{key:0,class:`size-3.5 animate-spin`})):(u(),m(r(N),{key:1,class:`size-3.5`})),t(` `+p(n.renewal===`installing`?`Installing lego…`:`Renew`),1)]),_:2},1032,[`disabled`,`onClick`])):v(``,!0)]))),128))]),_:1})]),_:1})):v(``,!0),e(A,{open:b.value,"onUpdate:open":c[0]||=e=>b.value=e,title:`Push to the environment?`,"confirm-label":`Push`,onConfirm:O},{default:f(()=>[t(p(y.value?.name)+` is renewed. Send `+p(y.value?.paths.join(` and `))+` to their environment backends, where the others pull them. `,1)]),_:1},8,[`open`])],64))}}),oe={class:`space-y-1`},se=[`draggable`,`onDragstart`,`onDrop`],ce={class:`min-w-0 flex-1 truncate`},Q=l({__name:`SidebarOrderList`,props:{items:{},draggable:{type:Boolean}},emits:[`move`],setup(t,{emit:n}){let c=t,l=n,f=h(null);function g(e,t){f.value=t,e.dataTransfer?.setData(`text/plain`,t),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}function x(e){let t=f.value;if(f.value=null,!t||t===e)return;let n=c.items.map(e=>e.key).filter(e=>e!==t);n.splice(n.indexOf(e)+ +(c.items.findIndex(e=>e.key===t)<c.items.findIndex(t=>t.key===e)),0,t),l(`move`,n)}return(n,c)=>(u(),o(`ul`,oe,[(u(!0),o(d,null,s(t.items,s=>(u(),o(`li`,{key:s.key,draggable:t.draggable,class:i([`rounded-md`,{"opacity-50":f.value===s.key}]),onDragstart:y(e=>g(e,s.key),[`stop`]),onDragend:c[0]||=y(e=>f.value=null,[`stop`]),onDragover:c[1]||=y(()=>{},[`prevent`,`stop`]),onDrop:y(e=>x(s.key),[`prevent`,`stop`])},[a(`div`,{class:i([`flex items-center gap-2 rounded-md border px-2 py-1.5 text-sm`,t.draggable?`cursor-grab bg-background active:cursor-grabbing`:`border-transparent`])},[t.draggable?(u(),m(r(W),{key:0,class:`size-3.5 shrink-0 text-muted-foreground`})):v(``,!0),e(r(b),{icon:s.icon,class:`size-3.5 shrink-0 text-muted-foreground`},null,8,[`icon`]),a(`span`,ce,p(s.name),1)],2),_(n.$slots,`default`,{item:s})],42,se))),128))]))}});function le(){let e=g(null),t=g(new Map),n=c(()=>({section:null,items:Object.values(S.projects.value??{}).map(e=>({key:e.slug,name:e.name,icon:z(e.meta,`lucide:folder-tree`)})),sort:S.sidebar.value.sort,order:S.sidebar.value.order})),r=c(()=>Object.fromEntries(Object.values(S.projects.value??{}).map(e=>[e.slug,{section:e.slug,items:[...e.lines.flatMap(t=>{let n=e.integrations.find(e=>e.slug===t.slug);return n?[{key:q(t),name:n.name,icon:n.icon}]:[]}),...Object.values(e.directories).map(e=>({key:e.slug,name:e.name,icon:z(e.meta,`lucide:folder-tree`)}))],sort:e.sort,order:e.order}])));function i(e){return t.value.get(e.section)??{sort:e.sort,order:e.order}}function a(e){let{sort:t,order:n}=i(e);return J(e.items,t,n).flatMap(t=>e.items.find(e=>e.key===t)??[])}function o(e,t){l(e,{sort:t,order:t===`manual`?a(e).map(e=>e.key):[]})}function s(e,t){l(e,{sort:`manual`,order:t})}function l(e,n){t.value=new Map(t.value).set(e.section,n)}function u(){e.value=S.mcp.value?.localFile?`local`:`declared`}function d(n){let r=e.value;n&&r&&t.value.size&&w.sidebarSetOrder([...t.value].map(([e,t])=>({section:e,sort:t.sort,order:t.sort===`manual`?t.order:null,file:r}))),t.value=new Map,e.value=null}return{file:e,staged:t,sections:n,contents:r,ordering:i,shown:a,setSort:o,move:s,start:u,end:d}}var ue={class:`space-y-1.5`},de={key:0,class:`flex shrink-0 items-center gap-2`},fe={class:`flex items-center gap-2 text-sm`},pe={key:1,class:`text-xs text-muted-foreground`},$={key:0,class:`mt-1 mb-2 ml-6 space-y-1`},me={class:`flex items-center gap-2 text-xs text-muted-foreground`},he={key:1},ge=l({__name:`SidebarOrderCard`,setup(n){let i={config:`As configured`,name:`By name`,manual:`By hand`},s=K.map(e=>({label:i[e],value:e})),c=le();function l(e,t){t&&K.includes(t)&&c.setSort(e,t)}return(n,d)=>(u(),m(r(P),{class:`max-w-3xl`},{default:f(()=>[e(r(I),{class:`flex flex-row items-start justify-between gap-3`},{default:f(()=>[a(`div`,ue,[e(r(R),null,{default:f(()=>[...d[6]||=[t(`Sidebar`,-1)]]),_:1}),e(r(L),null,{default:f(()=>[...d[7]||=[t(` The order of the sections, and of the rows and projects of each section. `,-1)]]),_:1})]),r(c).file.value?(u(),o(`div`,de,[e(r(T),{size:`sm`,variant:`ghost`,class:`gap-1.5`,onClick:d[0]||=e=>r(c).end(!1)},{default:f(()=>[e(r(E),{class:`size-3.5`}),d[8]||=t(` Cancel `,-1)]),_:1}),e(r(T),{size:`sm`,class:`gap-1.5`,onClick:d[1]||=e=>r(c).end(!0)},{default:f(()=>[e(r(D),{class:`size-3.5`}),t(` `+p(r(c).staged.value.size?`Save (${r(c).staged.value.size})`:`Save`),1)]),_:1})])):(u(),m(r(T),{key:1,size:`sm`,variant:`outline`,class:`shrink-0 gap-1.5`,onClick:d[2]||=e=>r(c).start()},{default:f(()=>[e(r(O),{class:`size-3.5`}),d[9]||=t(` Edit `,-1)]),_:1}))]),_:1}),e(r(F),{class:`space-y-3`},{default:f(()=>[r(c).file.value?(u(),m(U,{key:0,modelValue:r(c).file.value,"onUpdate:modelValue":d[3]||=e=>r(c).file.value=e,"local-file":r(S).mcp.value?.localFile??null,"shared-hint":`adt.sidebar and each section are written where they are declared, shared with the others once pushed or committed.`},null,8,[`modelValue`,`local-file`])):v(``,!0),a(`div`,fe,[d[10]||=a(`span`,{class:`font-medium`},`Sections`,-1),r(c).file.value?(u(),m(r(j),{key:0,"model-value":r(c).ordering(r(c).sections.value).sort,options:r(s),class:`h-7 w-36 text-xs`,"onUpdate:modelValue":d[4]||=e=>l(r(c).sections.value,e)},null,8,[`model-value`,`options`])):(u(),o(`span`,pe,p(i[r(c).ordering(r(c).sections.value).sort]),1))]),e(Q,{items:r(c).shown(r(c).sections.value),draggable:r(c).file.value!==null&&r(c).ordering(r(c).sections.value).sort===`manual`,onMove:d[5]||=e=>r(c).move(r(c).sections.value,e)},{default:f(({item:t})=>[r(c).contents.value[t.key]?(u(),o(`div`,$,[a(`div`,me,[d[11]||=a(`span`,null,`Content`,-1),r(c).file.value?(u(),m(r(j),{key:0,"model-value":r(c).ordering(r(c).contents.value[t.key]).sort,options:r(s),class:`h-6 w-32 text-xs`,"onUpdate:modelValue":e=>l(r(c).contents.value[t.key],e)},null,8,[`model-value`,`options`,`onUpdate:modelValue`])):(u(),o(`span`,he,p(i[r(c).ordering(r(c).contents.value[t.key]).sort]),1))]),e(Q,{items:r(c).shown(r(c).contents.value[t.key]),draggable:r(c).file.value!==null&&r(c).ordering(r(c).contents.value[t.key]).sort===`manual`,onMove:e=>r(c).move(r(c).contents.value[t.key],e)},null,8,[`items`,`draggable`,`onMove`])])):v(``,!0)]),_:1},8,[`items`,`draggable`])]),_:1})]),_:1}))}}),_e={class:`h-full space-y-6 overflow-auto p-6`},ve={key:0,class:`space-y-2`},ye={key:1,class:`text-sm text-muted-foreground`},be=l({__name:`DashboardView`,setup(n){let i=window.devtool?.version??`0.0.0`;return(n,c)=>(u(),o(`div`,_e,[e(r(P),{class:`max-w-3xl`},{default:f(()=>[e(r(I),null,{default:f(()=>[e(r(R),null,{default:f(()=>[c[1]||=t(`Server `,-1),a(`sup`,null,p(r(i)),1)]),_:1}),e(r(L),null,{default:f(()=>[...c[2]||=[t(`Configuration status and validation warnings.`,-1)]]),_:1})]),_:1}),e(r(F),{class:`space-y-4`},{default:f(()=>[e(r(T),{variant:`secondary`,onClick:c[0]||=e=>r(w).reconfigure()},{default:f(()=>[...c[3]||=[t(` Rescan Config Paths `,-1)]]),_:1}),r(S).warnings.value.length>0?(u(),o(`div`,ve,[(u(!0),o(d,null,s(r(S).warnings.value,t=>(u(),o(`div`,{key:t,class:`flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-sm text-destructive`},[e(r(k),{class:`mt-0.5 size-4 shrink-0`}),a(`span`,null,p(t),1)]))),128))])):(u(),o(`p`,ye,` No warnings detected. `))]),_:1})]),_:1}),e(ge),e(ae)]))}});export{be as default};
@@ -1 +1 @@
1
- import{S as e}from"./Teleport-pr1nbO15.js";import{On as t,et as n,k as r,mt as i,qt as a,v as o,xt as s}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{C as c,D as l}from"./ws-DXdsSbKc.js";import{F as u}from"./index-BcQvyHh1.js";var d=l({name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}),f=r({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(r){let l=r;e();let d=u();return(e,u)=>(i(),o(t(c),n(l,{type:r.as===`button`?`button`:void 0,onClick:u[0]||=e=>t(d).onOpenChange(!1)}),{default:a(()=>[s(e.$slots,`default`)]),_:3},16,[`type`]))}});export{d as n,f as t};
1
+ import{S as e}from"./Teleport-DHeiB0Hf.js";import{On as t,et as n,k as r,mt as i,qt as a,v as o,xt as s}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{C as c,D as l}from"./ws-BpxG87gL.js";import{V as u}from"./index-BROv5BcC.js";var d=l({name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}),f=r({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(r){let l=r;e();let d=u();return(e,u)=>(i(),o(t(c),n(l,{type:r.as===`button`?`button`:void 0,onClick:u[0]||=e=>t(d).onOpenChange(!1)}),{default:a(()=>[s(e.$slots,`default`)]),_:3},16,[`type`]))}});export{d as n,f as t};
@@ -0,0 +1 @@
1
+ import{D as e,E as t,Ht as n,On as r,_ as i,b as a,g as o,k as s,mt as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{p}from"./lib-BdSNv3tE.js";import{N as m,g as h,t as g}from"./ws-BpxG87gL.js";import{t as _}from"./StreamView-BI1OiSYC.js";import{S as v,T as y,a as b,f as x,i as S,n as C,r as w,t as T,v as E,x as D,y as O}from"./index-BROv5BcC.js";var k={key:1,class:`flex h-full items-center-safe justify-center overflow-y-auto p-6`},A={class:`min-w-0 break-words`},j={key:0,class:`rounded bg-muted p-2 font-mono text-xs leading-5 break-words whitespace-pre-wrap`},M=s({__name:`DirectoryCommandView`,props:{projectSlug:{},directorySlug:{},commandSlug:{}},setup(s){let M=s,N=m(),P=o(()=>h.getDirectory(M.projectSlug,M.directorySlug)?.directory??null),F=o(()=>P.value?.extras[M.commandSlug]??null),I=o(()=>F.value?.script?F.value.script.summary:F.value?E(F.value.args):null),L=o(()=>v(M.projectSlug,M.directorySlug,M.commandSlug));n([P,F],([e,t])=>{e&&!t&&N.replace({name:`directory`,params:{projectSlug:M.projectSlug,directorySlug:M.directorySlug}})},{immediate:!0});function R(e){P.value&&F.value&&y(M.projectSlug,P.value,F.value,e)}return(n,o)=>L.value?(c(),d(_,{key:L.value.slug,"project-slug":s.projectSlug,"directory-slug":s.directorySlug,"stream-slug":L.value.slug},null,8,[`project-slug`,`directory-slug`,`stream-slug`])):F.value&&r(g).ready.value?(c(),a(`div`,k,[e(r(b),{class:`w-full max-w-xl gap-4`},{default:l(()=>[e(r(C),null,{default:l(()=>[e(r(T),{class:`flex items-center gap-2`},{default:l(()=>[e(r(p),{icon:r(D)(F.value.meta,F.value.script?`lucide:scroll-text`:void 0),class:`size-4 shrink-0 text-muted-foreground`},null,8,[`icon`]),i(`span`,A,u(r(O)(F.value)),1)]),_:1}),I.value?(c(),d(r(w),{key:0,class:`break-words`},{default:l(()=>[t(u(I.value),1)]),_:1})):f(``,!0)]),_:1}),e(r(S),{class:`space-y-3`},{default:l(()=>[F.value.script?.usage?(c(),a(`pre`,j,u(F.value.script.usage),1)):f(``,!0),(c(),d(x,{key:`${s.projectSlug}/${s.directorySlug}/${F.value.slug}`,command:F.value,onRun:R},null,8,[`command`]))]),_:1})]),_:1})])):f(``,!0)}});export{M as default};
@@ -1 +1 @@
1
- import{b as e,g as t,k as n,mt as r,tr as i,v as a}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{g as o}from"./ws-DXdsSbKc.js";import{t as s}from"./FileSpaceView-M_U8j3sE.js";var c={key:1,class:`p-6 text-sm text-muted-foreground`},l=n({__name:`DirectoryFilesView`,props:{projectSlug:{},directorySlug:{},fileSpace:{}},setup(n){let l=n,u=t(()=>o.getDirectory(l.projectSlug,l.directorySlug)?.directory??null),d=t(()=>u.value?.files[l.fileSpace]??null),f=t(()=>d.value?.commands.map(e=>u.value?.extras[e]).filter(e=>e!==void 0)??[]);return(t,o)=>d.value?(r(),a(s,{key:`${n.projectSlug}/${n.directorySlug}/${n.fileSpace}`,space:`${n.projectSlug}/${n.directorySlug}/${n.fileSpace}`,name:d.value.name,commands:f.value,restore:d.value.restore?u.value?.extras[d.value.restore]??null:null,"project-slug":n.projectSlug,"directory-slug":n.directorySlug},null,8,[`space`,`name`,`commands`,`restore`,`project-slug`,`directory-slug`])):(r(),e(`p`,c,` No folder of files `+i(n.fileSpace)+` in this directory. `,1))}});export{l as default};
1
+ import{b as e,g as t,k as n,mt as r,tr as i,v as a}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{g as o}from"./ws-BpxG87gL.js";import{t as s}from"./FileSpaceView-BTgGMs7p.js";var c={key:1,class:`p-6 text-sm text-muted-foreground`},l=n({__name:`DirectoryFilesView`,props:{projectSlug:{},directorySlug:{},fileSpace:{}},setup(n){let l=n,u=t(()=>o.getDirectory(l.projectSlug,l.directorySlug)?.directory??null),d=t(()=>u.value?.files[l.fileSpace]??null),f=t(()=>d.value?.commands.map(e=>u.value?.extras[e]).filter(e=>e!==void 0)??[]);return(t,o)=>d.value?(r(),a(s,{key:`${n.projectSlug}/${n.directorySlug}/${n.fileSpace}`,space:`${n.projectSlug}/${n.directorySlug}/${n.fileSpace}`,name:d.value.name,commands:f.value,restore:d.value.restore?u.value?.extras[d.value.restore]??null:null,"project-slug":n.projectSlug,"directory-slug":n.directorySlug},null,8,[`space`,`name`,`commands`,`restore`,`project-slug`,`directory-slug`])):(r(),e(`p`,c,` No folder of files `+i(n.fileSpace)+` in this directory. `,1))}});export{l as default};
@@ -0,0 +1 @@
1
+ import{D as e,E as t,On as n,b as r,g as i,k as a,mt as o,qt as s,tr as c,v as l,y as u}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{p as d}from"./lib-BdSNv3tE.js";import{g as f,x as p}from"./ws-BpxG87gL.js";import{t as m}from"./StreamView-BI1OiSYC.js";import{a as h,i as g,m as _,n as v,t as y,v as b,w as x}from"./index-BROv5BcC.js";var S={key:1,class:`flex h-full items-center-safe justify-center overflow-y-auto p-6`},C={key:0,class:`text-sm text-muted-foreground`},w=a({__name:`DirectoryHomeView`,props:{projectSlug:{},directorySlug:{}},setup(a){let w=a,T=i(()=>f.getDirectory(w.projectSlug,w.directorySlug)),E=i(()=>T.value?.directory??null),D=i(()=>E.value?.name??w.directorySlug),O=i(()=>E.value?.description??null),k=i(()=>E.value?.args?b(E.value.args):null),A=i(()=>E.value?.shell??`N/A`),j=i(()=>E.value?_(w.projectSlug,E.value):null),M=i(()=>f.getDirectoryStreamPrimary(w.projectSlug,w.directorySlug));return(i,f)=>M.value?(o(),l(m,{key:M.value,"project-slug":a.projectSlug,"directory-slug":a.directorySlug,"stream-slug":M.value},null,8,[`project-slug`,`directory-slug`,`stream-slug`])):(o(),r(`div`,S,[e(n(h),{class:`w-full max-w-xl`},{default:s(()=>[e(n(v),null,{default:s(()=>[e(n(y),null,{default:s(()=>[t(c(D.value),1)]),_:1})]),_:1}),e(n(g),{class:`space-y-4`},{default:s(()=>[O.value?(o(),r(`p`,C,c(O.value),1)):u(``,!0),k.value===null?u(``,!0):(o(),l(n(p),{key:1,class:`h-auto w-full justify-start whitespace-normal break-all px-3 py-2 text-left font-mono text-xs leading-5`,onClick:f[0]||=e=>E.value&&n(x)(a.projectSlug,E.value)},{default:s(()=>[t(c(k.value||A.value),1)]),_:1})),j.value&&E.value?.defaultAction?.shortcut.type!==`command`?(o(),l(n(p),{key:2,variant:`outline`,class:`w-full justify-start`,onClick:f[1]||=e=>j.value.open()},{default:s(()=>[e(n(d),{icon:j.value.icon,class:`size-4`},null,8,[`icon`]),t(` `+c(j.value.name),1)]),_:1})):u(``,!0)]),_:1})]),_:1})]))}});export{w as default};
@@ -0,0 +1 @@
1
+ import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,g as s,k as c,mt as l,o as u,qt as d,tr as f,v as p,wt as m,xn as h,y as g}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{p as _,t as v}from"./lib-BdSNv3tE.js";import{N as y,O as b,S as x,g as S,k as C,x as w}from"./ws-BpxG87gL.js";import{t as T}from"./play-BURz2wPD.js";import{t as E}from"./sparkles-DQZgGD3J.js";import{$ as D,C as O,N as k,P as A,Y as j,_ as M,a as N,b as P,f as F,i as I,n as L,p as R,r as ee,s as z,t as B,u as V,v as H,x as U,y as W}from"./index-BROv5BcC.js";import{t as G}from"./IntegrationLink-BAesFgjp.js";var K={class:`flex items-start transition-colors hover:bg-accent/60`},q={class:`min-w-0 flex-1`},J={class:`block truncate`},Y={key:0,class:`space-y-2 px-3 pb-3`},X={key:0,class:`rounded bg-muted p-2 font-mono text-[11px] leading-4 break-words whitespace-pre-wrap`},Z=c({__name:`CommandItem`,props:{projectSlug:{},directory:{},command:{}},setup(t){let o=t,c=y(),u=s(()=>o.command.form===`inline`||o.command.form===`inlineExpanded`),p=h(o.command.form===`inlineExpanded`),m=s(()=>o.command.script?o.command.script.summary:H(o.command.args));function b(){u.value?p.value=!p.value:c.push(P(o.projectSlug,o.directory.slug,o.command.slug))}function S(){u.value&&v(o.command.args).length>0?p.value=!0:O(o.projectSlug,o.directory.slug,o.command)}return(o,s)=>(l(),a(`div`,{class:r(n(x)(`rounded-md border`,p.value&&`bg-accent/30`))},[i(`div`,K,[i(`button`,{type:`button`,class:`flex min-w-0 flex-1 items-start gap-2 py-2 pl-3 text-left text-sm`,onClick:b},[e(n(_),{icon:n(U)(t.command.meta,t.command.script?`lucide:scroll-text`:void 0),class:`mt-0.5 size-4 shrink-0 text-muted-foreground`},null,8,[`icon`]),i(`span`,q,[i(`strong`,J,f(n(W)(t.command)),1),m.value?(l(),a(`span`,{key:0,class:r(n(x)(`block text-xs text-muted-foreground`,t.command.script?!p.value&&`line-clamp-2`:`truncate`))},f(m.value),3)):g(``,!0)])]),e(n(w),{size:`icon`,variant:`ghost`,class:`m-1.5 size-7 shrink-0`,title:`Start`,onClick:S},{default:d(()=>[e(n(T),{class:`size-3.5`})]),_:1})]),p.value?(l(),a(`div`,Y,[t.command.script?.usage?(l(),a(`pre`,X,f(t.command.script.usage),1)):g(``,!0),e(F,{command:t.command,onRun:s[0]||=e=>n(O)(t.projectSlug,t.directory.slug,t.command,{inputs:e})},null,8,[`command`])])):g(``,!0)],2))}}),Q={class:`flex h-full min-h-0`},te={class:`mb-2 flex items-center justify-between gap-2`},ne=[`href`],re={class:`min-w-0 flex-1`},$={class:`block truncate`},ie={class:`block truncate text-xs text-muted-foreground`},ae={class:`min-w-0 flex-1`},oe={class:`block truncate`},se={class:`block truncate text-xs text-muted-foreground`},ce=c({__name:`DirectoryIndexView`,props:{projectSlug:{},directorySlug:{}},setup(c){let h=c,v=s(()=>S.getDirectory(h.projectSlug,h.directorySlug)),y=s(()=>v.value?.directory??null),x=s(()=>v.value?.project.name??h.projectSlug),T=s(()=>v.value?.directory.name??h.directorySlug),O=s(()=>v.value?.directory.description??null),P=s(()=>Object.values(y.value?.extras??{}).filter(e=>!e.script)),F=s(()=>Object.values(y.value?.extras??{}).filter(e=>e.script)),H=s(()=>y.value?M(y.value):[]),U=s(()=>`${h.projectSlug}/${h.directorySlug}`),W=s(()=>R.slugs.value.includes(U.value));function K(){R.toggleBookmark(U.value)}return(s,h)=>(l(),a(`div`,Q,[e(n(C),{class:`min-w-0 flex-1`,inert:n(V).covers(`right`)},null,8,[`inert`]),e(z,{side:`right`,tag:`aside`,class:`w-80 flex-col border-l bg-card`},{default:d(()=>[e(n(k),{class:`min-h-0 flex-1 p-3`},{default:d(()=>[e(n(N),{class:`gap-3`},{default:d(()=>[e(n(L),null,{default:d(()=>[i(`div`,te,[e(n(A),{variant:`outline`},{default:d(()=>[t(f(x.value),1)]),_:1}),e(n(w),{size:`icon`,variant:`ghost`,class:`size-8`,onClick:K},{default:d(()=>[e(n(D),{class:r([`size-4`,{"fill-current":W.value}])},null,8,[`class`])]),_:1})]),e(n(B),null,{default:d(()=>[t(f(T.value),1)]),_:1}),O.value?(l(),p(n(ee),{key:0},{default:d(()=>[t(f(O.value),1)]),_:1})):g(``,!0)]),_:1})]),_:1}),H.value.length?(l(),p(n(N),{key:0,class:`mt-3 gap-3`},{default:d(()=>[e(n(L),null,{default:d(()=>[e(n(B),{class:`text-sm`},{default:d(()=>[...h[0]||=[t(` Services `,-1)]]),_:1})]),_:1}),e(n(I),{class:`space-y-2`},{default:d(()=>[(l(!0),a(u,null,o(H.value,t=>(l(),a(`a`,{key:t.host,href:t.url,target:`_blank`,rel:`noopener`,class:`flex w-full items-start gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors hover:bg-accent/60`},[e(n(_),{icon:t.icon,class:`mt-0.5 size-4 shrink-0 text-muted-foreground`},null,8,[`icon`]),i(`span`,re,[i(`strong`,$,f(t.host),1),i(`span`,ie,f(t.url),1)])],8,ne))),128))]),_:1})]),_:1})):g(``,!0),y.value&&P.value.length?(l(),p(n(N),{key:1,class:`mt-3 gap-3`},{default:d(()=>[e(n(L),null,{default:d(()=>[e(n(B),{class:`text-sm`},{default:d(()=>[...h[1]||=[t(` Commands `,-1)]]),_:1})]),_:1}),e(n(I),{class:`space-y-2`},{default:d(()=>[(l(!0),a(u,null,o(P.value,e=>(l(),p(Z,{key:`${c.projectSlug}/${c.directorySlug}/${e.slug}`,"project-slug":c.projectSlug,directory:y.value,command:e},null,8,[`project-slug`,`directory`,`command`]))),128))]),_:1})]),_:1})):g(``,!0),y.value&&Object.keys(y.value.files).length?(l(),p(n(N),{key:2,class:`mt-3 gap-3`},{default:d(()=>[e(n(L),null,{default:d(()=>[e(n(B),{class:`text-sm`},{default:d(()=>[...h[2]||=[t(` Files `,-1)]]),_:1})]),_:1}),e(n(I),{class:`space-y-2`},{default:d(()=>[(l(!0),a(u,null,o(y.value.files,e=>(l(),p(n(b),{key:e.slug,to:{name:`directory-files`,params:{projectSlug:c.projectSlug,directorySlug:c.directorySlug,fileSpace:e.slug}},class:`flex w-full items-start gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors hover:bg-accent/60`},{default:d(()=>[(l(),p(m(e.type===`agentSkills`?n(E):n(j)),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})),i(`span`,ae,[i(`strong`,oe,f(e.name),1),i(`span`,se,f(e.path),1)])]),_:2},1032,[`to`]))),128))]),_:1})]),_:1})):g(``,!0),y.value?.integrations.length?(l(),p(n(N),{key:3,class:`mt-3 gap-3`},{default:d(()=>[e(n(L),null,{default:d(()=>[e(n(B),{class:`text-sm`},{default:d(()=>[...h[3]||=[t(` Integrations `,-1)]]),_:1})]),_:1}),e(n(I),{class:`space-y-2`},{default:d(()=>[(l(!0),a(u,null,o(y.value.integrations,e=>(l(),p(G,{key:e.slug,integration:e,"project-slug":c.projectSlug,"directory-slug":c.directorySlug},null,8,[`integration`,`project-slug`,`directory-slug`]))),128))]),_:1})]),_:1})):g(``,!0),y.value&&F.value.length?(l(),p(n(N),{key:4,class:`mt-3 gap-3`},{default:d(()=>[e(n(L),null,{default:d(()=>[e(n(B),{class:`text-sm`},{default:d(()=>[...h[4]||=[t(` Scripts `,-1)]]),_:1})]),_:1}),e(n(I),{class:`space-y-1`},{default:d(()=>[(l(!0),a(u,null,o(F.value,e=>(l(),p(Z,{key:`${c.projectSlug}/${c.directorySlug}/${e.slug}`,"project-slug":c.projectSlug,directory:y.value,command:e},null,8,[`project-slug`,`directory`,`command`]))),128))]),_:1})]),_:1})):g(``,!0)]),_:1})]),_:1})]))}});export{ce as default};
@@ -1 +1 @@
1
- import{k as e,mt as t,v as n}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{t as r}from"./StreamView-B_eLxku4.js";var i=e({__name:`DirectoryStreamView`,props:{projectSlug:{},directorySlug:{},streamSlug:{}},setup(e){return(i,a)=>(t(),n(r,{key:e.streamSlug,"project-slug":e.projectSlug,"directory-slug":e.directorySlug,"stream-slug":e.streamSlug},null,8,[`project-slug`,`directory-slug`,`stream-slug`]))}});export{i as default};
1
+ import{k as e,mt as t,v as n}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{t as r}from"./StreamView-BI1OiSYC.js";var i=e({__name:`DirectoryStreamView`,props:{projectSlug:{},directorySlug:{},streamSlug:{}},setup(e){return(i,a)=>(t(),n(r,{key:e.streamSlug,"project-slug":e.projectSlug,"directory-slug":e.directorySlug,"stream-slug":e.streamSlug},null,8,[`project-slug`,`directory-slug`,`stream-slug`]))}});export{i as default};
@@ -0,0 +1,2 @@
1
+ import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,Zn as o,_ as s,b as c,bt as l,ct as u,er as ee,g as d,it as f,k as p,mt as m,o as h,qt as g,tr as _,v,vn as y,wt as b,y as x}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{w as S}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{D as C,O as w,S as T,d as E,t as D,x as O,y as k}from"./ws-BpxG87gL.js";import{o as A,s as te}from"./FieldRoot-riDRLSqS.js";import{n as j,t as ne}from"./file-text-C2envr-4.js";import{a as M,i as re,n as N,r as ie,t as P}from"./format-CWWug1jh.js";import{t as F}from"./Checkbox-X08aIO0U.js";import{n as ae}from"./DialogClose-l707gO7f.js";import{t as oe}from"./triangle-alert-Bi6TbWM9.js";import{t as se}from"./ConfirmDialog-DYNB5IAJ.js";import{t as ce}from"./Input-B8rdCliw.js";import{G as le,H as ue,J as de,K as fe,P as pe,U as me,a as he,q as I}from"./index-BROv5BcC.js";import{n as ge,r as _e}from"./expiry-QwlCrVUd.js";var ve=C({name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]}),ye=C({name:`arrow-up-from-line`,size:24,node:[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]}),be=C({name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]}),xe=C({name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]}),Se=C({name:`file-badge`,size:24,node:[[`path`,{d:`M13 22h5a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.3`,key:`cvl1xm`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m7.69 16.479 1.29 4.88a.5.5 0 0 1-.698.591l-1.843-.849a1 1 0 0 0-.879.001l-1.846.85a.5.5 0 0 1-.692-.593l1.29-4.88`,key:`1ff7gj`}],[`circle`,{cx:`6`,cy:`14`,r:`3`,key:`a1xfv6`}]],aliases:[`file-badge-2`]}),Ce=C({name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]}),we=C({name:`memory-stick`,size:24,node:[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]}),Te=C({name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]}),Ee=C({name:`skip-forward`,size:24,node:[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]}),L={class:`space-y-2`},De={class:`flex flex-wrap items-center justify-between gap-2`},R={class:`text-xs text-muted-foreground`},z={key:0,class:`flex flex-wrap gap-1`},B={key:0,class:`overflow-hidden rounded-md border`},V={class:`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] gap-2 border-b bg-muted/40 px-3 py-1.5 text-xs font-medium text-muted-foreground`},H={class:`truncate`},U=[`title`],W=[`title`,`onClick`],G=[`title`,`onClick`],Oe=[`title`],ke={class:`truncate`},Ae=[`title`,`onClick`],je=[`title`,`onClick`],K=60,Me=p({__name:`ConfigKeyChooser`,props:e({entries:{},defaultSide:{},remoteName:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=/secret|password|passwd|token|key|private|credential/i,u=e,f=r(e,`modelValue`),p=y({});function b(e){return JSON.stringify(e)}let S=d(()=>{let e=[],t=new Map;for(let n of u.entries){for(let r=0;r<n.path.length-1;r+=1){let i=b(n.path.slice(0,r+1)),a=t.get(i);a||(a={kind:`branch`,id:i,name:n.path[r],depth:r,leaves:[]},t.set(i,a),e.push(a)),a.leaves.push(b(n.path))}e.push({kind:`leaf`,id:b(n.path),name:n.path.at(-1)??``,depth:n.path.length-1,entry:n})}return e});function C(e){return f.value[e]??u.defaultSide}function w(e,t){f.value={...f.value,...Object.fromEntries(e.map(e=>[e,t]))}}function E(e){return`min(${e}rem, ${Math.min(e*6,30)}%)`}function D(e){let t=new Set(e.leaves.map(C));return t.size===1?[...t][0]:`mixed`}function k(e){return typeof e!=`object`||!e?!1:Object.entries(e).some(([e,t])=>i.test(e)||k(t))}function A(e){return i.test(e.name)||k(e.entry.local.value)||k(e.entry.remote.value)}function te(e){if(!e.present)return{full:`absent`,short:`— absent`};let t=typeof e.value==`string`?e.value:JSON.stringify(e.value),n=t.split(`
2
+ `)[0];return{full:t,short:n.length>K||n!==t?`${n.slice(0,K)}…`:n}}function ne(e){return e.local.present?e.remote.present?`Changed`:`Only local`:`Only on ${u.remoteName}`}function re(){let e=!F.value;p.value=Object.fromEntries(P.value.map(t=>[t,e]))}let N=d(()=>u.entries.map(e=>b(e.path))),ie=d(()=>N.value.filter(e=>C(e)===`remote`).length),P=d(()=>S.value.flatMap(e=>e.kind===`leaf`&&A(e)?[e.id]:[])),F=d(()=>P.value.length>0&&P.value.every(e=>p.value[e]));return(r,i)=>(m(),c(`div`,L,[s(`div`,De,[s(`span`,R,[e.entries.length===0?(m(),c(h,{key:0},[n(`Both copies are identical.`)],64)):(m(),c(h,{key:1},[n(_(e.entries.length)+` differing `+_(e.entries.length>1?`keys`:`key`)+`: `+_(ie.value)+` from `+_(e.remoteName)+`, `+_(e.entries.length-ie.value)+` local `,1)],64))]),e.entries.length>0?(m(),c(`div`,z,[P.value.length>0?(m(),v(a(O),{key:0,size:`sm`,variant:`ghost`,class:`h-7 gap-1 px-2 text-xs`,onClick:re},{default:g(()=>[F.value?(m(),v(a(j),{key:0,class:`size-3.5`})):(m(),v(a(M),{key:1,class:`size-3.5`})),n(` `+_(F.value?`Hide secrets`:`Show secrets`),1)]),_:1})):x(``,!0),t(a(O),{size:`sm`,variant:`ghost`,class:`h-7 px-2 text-xs`,onClick:i[0]||=e=>w(N.value,`local`)},{default:g(()=>[...i[2]||=[n(` All local `,-1)]]),_:1}),t(a(O),{size:`sm`,variant:`ghost`,class:`h-7 px-2 text-xs`,onClick:i[1]||=e=>w(N.value,`remote`)},{default:g(()=>[n(` All `+_(e.remoteName),1)]),_:1})])):x(``,!0)]),e.entries.length>0?(m(),c(`div`,B,[s(`div`,V,[i[3]||=s(`span`,null,`Key`,-1),i[4]||=s(`span`,null,`Local`,-1),s(`span`,H,_(e.remoteName),1)]),(m(!0),c(h,null,l(S.value,n=>(m(),c(`div`,{key:n.id,class:`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)] items-center gap-2 border-b px-3 py-1.5 text-xs last:border-b-0`},[n.kind===`branch`?(m(),c(h,{key:0},[s(`span`,{class:`truncate font-mono font-medium`,style:ee({paddingLeft:E(n.depth)}),title:n.name},_(n.name),13,U),s(`button`,{type:`button`,class:o(a(T)(`min-w-0 truncate rounded px-2 py-0.5 text-left transition-colors`,D(n)===`local`?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-accent`)),title:D(n)===`mixed`?`Mixed`:D(n)===`local`?`All local`:`Take local`,onClick:e=>w(n.leaves,`local`)},_(D(n)===`mixed`?`Mixed`:D(n)===`local`?`All local`:`Take local`),11,W),s(`button`,{type:`button`,class:o(a(T)(`min-w-0 truncate rounded px-2 py-0.5 text-left transition-colors`,D(n)===`remote`?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-accent`)),title:D(n)===`mixed`?`Mixed`:D(n)===`remote`?`All ${e.remoteName}`:`Take ${e.remoteName}`,onClick:e=>w(n.leaves,`remote`)},_(D(n)===`mixed`?`Mixed`:D(n)===`remote`?`All ${e.remoteName}`:`Take ${e.remoteName}`),11,G)],64)):(m(),c(h,{key:1},[s(`div`,{class:`flex min-w-0 items-center gap-1.5`,style:ee({paddingLeft:E(n.depth)})},[s(`span`,{class:`truncate font-mono`,title:n.name},_(n.name),9,Oe),t(a(pe),{variant:`outline`,class:`max-w-1/2 min-w-0 shrink px-1.5 py-0 text-[10px]`,title:ne(n.entry)},{default:g(()=>[s(`span`,ke,_(ne(n.entry)),1)]),_:2},1032,[`title`]),A(n)?(m(),c(`button`,{key:0,type:`button`,class:`shrink-0 text-muted-foreground hover:text-foreground`,title:p.value[n.id]?`Hide the values`:`Show the values`,onClick:e=>p.value={...p.value,[n.id]:!p.value[n.id]}},[p.value[n.id]?(m(),v(a(j),{key:0,class:`size-3.5`})):(m(),v(a(M),{key:1,class:`size-3.5`}))],8,Ae)):x(``,!0)],4),(m(),c(h,null,l([`local`,`remote`],e=>s(`button`,{key:e,type:`button`,class:o(a(T)(`min-w-0 truncate rounded border px-2 py-0.5 text-left font-mono transition-colors`,C(n.id)===e?`border-primary bg-primary/15 text-foreground`:`border-transparent text-muted-foreground hover:bg-accent`,!n.entry[e].present&&`italic`)),title:A(n)&&!p.value[n.id]?void 0:te(n.entry[e]).full,onClick:t=>w([n.id],e)},_(A(n)&&!p.value[n.id]&&n.entry[e].present?`••••••`:te(n.entry[e]).short),11,je)),64))],64))]))),128))])):x(``,!0)]))}}),Ne=1e3;function Pe(e,t){return Math.abs(new Date(e).getTime()-new Date(t).getTime())>Ne}function Fe(e,t){return e.version!==null&&t.remoteVersion!==null?e.version!==t.remoteVersion:Pe(e.updatedAt,t.remoteUpdatedAt)}var Ie={class:`flex h-full min-h-0 flex-col`},Le={class:`min-h-0 flex-1 overflow-auto p-6`},Re={class:`mx-auto max-w-5xl space-y-4`},ze={class:`flex flex-wrap items-start justify-between gap-3`},Be={class:`text-sm text-muted-foreground`},Ve={class:`font-medium text-foreground`},He={class:`text-xs`},Ue={class:`flex flex-wrap items-center gap-2`},We={key:0,class:`flex flex-wrap items-center justify-between gap-3 rounded-lg border bg-muted/40 p-3`},Ge={class:`flex min-w-0 items-center gap-2 text-sm`},Ke={class:`truncate`},qe={key:1,class:`text-xs text-muted-foreground`},Je={key:1,class:`flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-sm text-destructive`},Ye={class:`min-w-0 break-words`},Xe={class:`space-y-1`},Ze={class:`text-sm text-muted-foreground`},Qe={class:`font-medium text-foreground`},$e={class:`flex items-center justify-between border-b bg-muted/40 px-4 py-2`},et={class:`flex min-w-0 items-center gap-3`},tt=[`title`],nt={class:`shrink-0 pl-3 text-xs text-muted-foreground`},rt=[`disabled`],it=[`onClick`],at={class:`row-span-4 flex size-8 items-center justify-center rounded-md bg-muted text-muted-foreground @md:row-span-2 @4xl:row-span-1`},ot={class:`col-start-3 col-end-6 row-start-1 min-w-0 @md:col-end-5 @4xl:col-start-auto @4xl:col-end-auto @4xl:row-start-auto`},st={class:`flex items-center gap-1.5`},ct=[`title`],lt=[`title`],ut=[`aria-label`],dt=[`aria-pressed`,`onClick`],ft={class:`col-start-3 col-end-6 row-start-2 flex min-w-0 items-baseline gap-2 text-xs @md:col-end-4 @md:block @4xl:col-start-auto @4xl:col-end-auto @4xl:row-start-auto`},pt=[`title`],mt={class:`col-start-3 col-end-6 row-start-3 flex min-w-0 items-baseline gap-2 text-xs @md:col-start-4 @md:col-end-5 @md:row-start-2 @md:block @4xl:col-start-auto @4xl:col-end-auto @4xl:row-start-auto`},ht={class:`flex max-w-1/2 min-w-0 shrink-0 items-center gap-1 text-muted-foreground @md:max-w-full`},gt=[`title`],_t={key:0,title:`Encrypted before it is sent`,class:`shrink-0`},vt=[`title`],yt={class:`col-start-3 col-end-6 row-start-4 flex min-w-0 @md:col-start-5 @md:col-end-6 @md:row-start-1 @md:row-end-3 @md:justify-end @4xl:col-start-auto @4xl:col-end-auto @4xl:row-start-auto @4xl:row-end-auto`},bt={class:`truncate`},xt={key:0,class:`px-4 pb-4 @md:pl-[5.5rem]`},St={key:0,class:`flex items-center gap-2 text-xs text-muted-foreground`},Ct={key:1,class:`text-xs break-words text-destructive`},wt={key:1,class:`space-y-2 px-4 pb-4 @md:pl-[5.5rem]`},Tt={key:0,class:`flex items-center gap-2 text-xs text-muted-foreground`},Et={key:1,class:`text-xs break-words text-destructive`},Dt={class:`flex items-center gap-2`},Ot={class:`text-xs text-muted-foreground`},kt={class:`flex max-h-40 flex-wrap gap-1.5 overflow-auto`},At=[`title`,`aria-pressed`,`onClick`],jt={key:0,class:`flex max-h-[min(16rem,35dvh)] shrink-0 flex-col gap-2 border-t bg-card px-6 py-3`},Mt={class:`mx-auto flex w-full max-w-5xl shrink-0 items-center justify-between gap-2`},Nt={class:`text-sm font-medium`},Pt={class:`flex items-center gap-2`},Ft={class:`text-xs text-muted-foreground`},It={class:`@container mx-auto min-h-0 w-full max-w-5xl space-y-2 overflow-auto`},Lt={class:`mt-0.5 size-4 shrink-0 overflow-hidden`},Rt=[`title`],zt={key:0,class:`order-last flex min-w-0 basis-full items-center gap-2 pl-6 text-xs leading-5 text-muted-foreground tabular-nums @md:order-none @md:ml-auto @md:basis-auto @md:pl-0`},Bt=[`title`],Vt={class:`h-1.5 w-24 shrink-0 overflow-hidden rounded-full bg-muted`},Ht={key:1,class:`block h-full w-1/3 animate-indeterminate rounded-full bg-sky-500`},Ut=[`title`],Wt={class:`shrink-0 border-t bg-background px-6 py-3`},Gt={class:`mx-auto flex max-w-5xl flex-wrap items-center justify-between gap-3`},Kt={class:`flex min-w-0 items-center gap-3 text-sm text-muted-foreground`},qt=[`title`],Jt={key:0,class:`ml-auto flex items-center gap-2`},Yt={key:1,class:`ml-auto flex flex-wrap items-center justify-end gap-2`},Xt={class:`mt-2 list-disc space-y-1 pl-5`},Zt=2e3,Qt=p({__name:`EnvironmentView`,setup(e){let r={pull:`Pull`,push:`Push`,restore:`Restore`,remove:`Removal of local copies`},p={remote:`border-sky-500/40 text-sky-600 dark:text-sky-400`,local:`border-amber-500/40 text-amber-600 dark:text-amber-400`,conflict:`border-destructive/40 text-destructive`,muted:`text-muted-foreground`,synced:`border-emerald-500/40 text-emerald-600 dark:text-emerald-400`},C=E.state,j=k.state,M=y({}),L=``,De=0,R=y({}),z=y(null),B=y(!1),V=y(!1),H=d(()=>C.value?.run?.finished===!1),U=y({}),W=new Map,G=y(Date.now()),Oe;i(()=>C.value?.run?.steps,()=>{tn(C.value?.run??null)}),i(H,e=>{clearInterval(Oe),Oe=e?setInterval(()=>{G.value=Date.now()},1e3):void 0},{immediate:!0}),f(()=>clearInterval(Oe)),i(()=>C.value?.items,e=>{e&&fn(e)}),i(()=>C.value?.refreshing,(e,t)=>{t&&!e&&pn()}),i(()=>E.tables.value,()=>vn(`tables`)),i(()=>E.keys.value,()=>vn(`keys`)),i(()=>B.value&&z.value?JSON.stringify(J(z.value)):null,e=>{e!==null&&e!==L&&(B.value=!1)});let ke=d(()=>j.value?.configured===!0&&!j.value.signedIn&&(C.value?.backends??[]).some(e=>e.type===`cdn`)),Ae=d(()=>C.value?.backends.find(e=>e.default)??null),je=d(()=>{let e=new Map;for(let t of C.value?.items??[])e.set(t.section,[...e.get(t.section)??[],t]);return[...e.entries()].map(([e,t])=>({section:e,items:t}))}),K=d(()=>Object.entries(M.value).map(([e,{tables:t,keys:n}])=>{let r=C.value?.items.find(t=>t.path===e),i=n?E.keys.value[e]?.entries:void 0;return{path:e,tables:t,keys:i&&n?i.map(e=>({path:e.path,side:n[JSON.stringify(e.path)]??(r?Cn(r):`remote`)})):null}})),Ne=d(()=>{let e=`${K.value.length} ${K.value.length>1?`items`:`item`} selected`;if(K.value.length===0)return`Select items to transfer.`;if(H.value)return e;for(let{path:e}of K.value){let t=M.value[e],n=E.tables.value[e];if(t.tables!==null&&!n)return`Listing the tables of the databases restricted to some…`;if(t.tables!==null&&n?.error)return`The tables of ${e} could not be listed: transfer it whole.`;if(t.tables?.length===0)return`Choose at least one table or key group for each database restricted to some.`;let r=E.keys.value[e];if(t.keys!==null&&!r)return`Comparing the keys of the files restricted to some keys…`;if(t.keys!==null&&r?.error)return`The keys of ${e} could not be compared: send it whole.`}return e}),Qt=d(()=>(C.value?.items??[]).filter(e=>M.value[e.path])),$t=d(()=>{switch(z.value){case`pull`:return{title:`Replace local data?`,confirm:`Pull and replace`,intro:`The backend copies will replace your local data:`,lines:K.value.flatMap(e=>rn(e)??[])};case`restore`:return{title:`Restore local data?`,confirm:`Restore`,intro:`The local copies will replace your local data:`,lines:J(`restore`).flatMap(e=>rn(e)??[])};case`remove`:return{title:`Remove local copies?`,confirm:`Remove`,intro:`These local copies are deleted; the data they restored stays as it is:`,lines:J(`remove`).map(e=>`${e.path} (${Pn(q(e.path)?.local?.size??null)})`)};default:return null}});function en(e,t){return`${e}/${t}`}function tn(e){let t=Date.now();G.value=t;let n={};if(!e)W.clear(),U.value=n;else{for(let[r,{progress:i}]of e.steps.entries()){let a=en(e.id,r),o=W.get(a),s=U.value[a];if(!i)W.delete(a);else if(o&&i.done===o.done)s&&(n[a]=s);else{if(o&&i.done>o.done&&t>o.at){let e=(i.done-o.done)*1e3/(t-o.at);n[a]={bytesPerSecond:s?(s.bytesPerSecond+e)/2:e,movedAt:t}}W.set(a,{done:i.done,at:t})}}U.value=n}}function nn(e,t,{progress:n}){let r=U.value[en(e,t)];return!n||!r||n.total!==null&&n.done>=n.total||G.value-r.movedAt>Zt?null:r.bytesPerSecond}function q(e){return C.value?.items.find(t=>t.path===e)}function rn(e){let t=q(e.path);if(!t)return null;switch(t.kind){case`file`:return e.keys?`${t.path}: the chosen keys replaced`:`${t.path}: replaced by the copy of ${X(t)}`;case`bucket`:return`${t.path}: bucket ${t.bucket} replaced by its snapshot`;case`redis`:return e.tables?`${t.path}: key groups ${e.tables.join(`, `)} emptied and reloaded`:`${t.path}: Redis database ${t.redis} emptied and reloaded`;default:return e.tables?`${t.path}: tables ${e.tables.join(`, `)} emptied and reloaded`:`${t.path}: database ${t.database?`${t.database} `:``}of container ${t.container} dropped and recreated`}}function J(e){return e!==`restore`&&e!==`remove`?K.value:K.value.filter(t=>{let n=q(t.path);return n!==void 0&&n.kind!==`file`&&n.local!==null&&(e===`remove`||t.tables===null||n.parts.pull)}).map(t=>e===`remove`?{...t,tables:null}:t)}function an(e){let t=M.value[e];if(!t)return!1;let n=E.tables.value[e],r=E.keys.value[e];return t.tables!==null&&(t.tables.length===0||!n||n.error!==null)||t.keys!==null&&(!r||r.error!==null)}function Y(e){let t=J(e);return!H.value&&t.length>0&&(e===`remove`||!t.some(e=>an(e.path)))}function on(e){return e===`restore`||e===`remove`?J(e).length>0:Qt.value.length>0?Qt.value.every(t=>t.allowed[e]&&(M.value[t.path].tables===null||t.parts[e])):(C.value?.items??[]).some(t=>t.allowed[e])}function sn(e){let t=C.value?.revision??0;e===`push`||e===`pull`&&!K.value.some(e=>(q(e.path)?.kind??`file`)!==`file`)?D.envRun(e,K.value,t):(z.value=e,L=JSON.stringify(J(e)),De=t,B.value=!0)}function cn(){z.value&&Y(z.value)&&JSON.stringify(J(z.value))===L&&D.envRun(z.value,J(z.value),De)}function ln(e){let t=C.value?.run;return!t||t.finished||t.action!==`pull`&&t.action!==`push`?!1:e.status===`pending`||e.status===`running`&&(t.action===`push`||!(e.progress?.total!=null&&e.progress.done>=e.progress.total))}function X(e){return e.backend??`backend`}function Z(e){if(e.remote===`unknown`)return null;if(!e.remote)return e.local?{label:`Only local`,tone:`local`}:{label:`Missing`,tone:`muted`};if(!e.local)return e.kind===`file`||!e.synced?{label:`Only on ${X(e)}`,tone:`remote`}:Fe(e.remote,e.synced)?{label:`Newer on ${X(e)}`,tone:`remote`}:{label:`Up to date`,tone:`synced`};if(e.synced){let t=Pe(e.local.updatedAt,e.synced.localUpdatedAt),n=Fe(e.remote,e.synced);return t&&n?{label:`Conflict`,tone:`conflict`}:t||n?t?{label:`Newer locally`,tone:`local`}:{label:`Newer on ${X(e)}`,tone:`remote`}:{label:`Up to date`,tone:`synced`}}let t=new Date(e.remote.updatedAt).getTime()-new Date(e.local.updatedAt).getTime();return Math.abs(t)<=1e3?{label:`Up to date`,tone:`synced`}:t>0?{label:`Newer on ${X(e)}`,tone:`remote`}:{label:`Newer locally`,tone:`local`}}function un(e){switch(e.kind){case`database`:return`${e.engine} · container ${e.container}${e.database?` · ${e.database}`:``}`;case`bucket`:return`bucket ${e.bucket}`;case`redis`:return`redis · ${e.redis}`;default:return e.pem?.kind===`certificate`?`certificate`:e.pem?.kind===`privateKey`?`private key`:`file`}}function dn(e){let t=e.filter(e=>M.value[e.path]).length;return t===0?!1:t===e.length||`indeterminate`}function fn(e){let t={};for(let[n,r]of Object.entries(M.value)){let i=e.find(e=>e.path===n);i&&(r.tables===null||i.parts.pull||i.parts.push)&&(r.keys===null||Sn(i))&&(t[n]=r)}for(let n of e)E.choices.isStale(mn(`keys`,n.path),hn(`keys`,n))&&(gn(`keys`,n.path),t[n.path]?.keys&&(t[n.path]={...t[n.path],keys:{}}));(Object.keys(t).length!==Object.keys(M.value).length||Object.entries(t).some(([e,t])=>t!==M.value[e]))&&(M.value=t),Q()}function pn(){for(let[e,t]of Object.entries(E.keys.value))t.error!==null&&gn(`keys`,e);for(let e of Object.keys(E.tables.value))gn(`tables`,e);Q()}function mn(e,t){return`${e}:${t}`}function hn(e,t){return e===`keys`?JSON.stringify([C.value?.revision,t.local,t.remote]):String(E.descriptions)}function gn(e,t){E.choices.forget(mn(e,t)),E.forget(t,e)}function _n(e,t){(e===`tables`?E.tables.value[t.path]:E.keys.value[t.path])||!E.choices.ask(mn(e,t.path),hn(e,t))||(e===`tables`?D.envTables(t.path):D.envKeys(t.path))}function Q(){for(let[e,t]of Object.entries(M.value)){let n=q(e);n&&t.tables!==null&&_n(`tables`,n),n&&t.keys!==null&&_n(`keys`,n)}}function vn(e){let t=e===`tables`?E.tables.value:E.keys.value;for(let n of Object.keys(t)){let t=q(n);E.choices.settle(mn(e,n),t?hn(e,t):null)||E.forget(n,e)}e===`tables`&&yn(),Q()}function yn(){let e=!1,t={...M.value};for(let[n,r]of Object.entries(M.value)){let i=E.tables.value[n];if(r.tables===null||!i||i.error)continue;let a=r.tables.filter(e=>i.tables.includes(e));a.length!==r.tables.length&&(t[n]={...r,tables:a},e=!0)}e&&(M.value=t)}function $(e,t){let n={...M.value};for(let r of e)t?n[r.path]??={tables:null,keys:null}:delete n[r.path];M.value=n}function bn(e){return e.kind===`redis`?`key groups`:`tables`}function xn(e,t){M.value={...M.value,[e]:{tables:t?null:[],keys:null}},Q()}function Sn(e){return e.keyed&&e.local!==null&&e.remote!==null&&e.remote!==`unknown`}function Cn(e){return Z(e)?.tone===`local`?`local`:`remote`}function wn(e,t){M.value={...M.value,[e]:{tables:null,keys:t?null:{}}},t||(gn(`keys`,e),Q())}function Tn(e){return Sn(e)?`keys`:e.parts.pull||e.parts.push?bn(e):null}function En(e){let t=M.value[e];return t!==void 0&&(t.tables??t.keys)!==null}function Dn(e,t){En(e.path)!==t&&(Sn(e)?wn(e.path,!t):xn(e.path,!t))}function On(e,t){M.value={...M.value,[e]:{tables:null,keys:t}}}function kn(e,t){let n=M.value[e]?.tables??[],r=n.includes(t)?n.filter(e=>e!==t):[...n,t];M.value={...M.value,[e]:{tables:r,keys:null}}}function An(e){let t=(R.value[e]??``).toLowerCase();return(E.tables.value[e]?.tables??[]).filter(e=>e.toLowerCase().includes(t))}function jn(){M.value=Object.fromEntries((C.value?.items??[]).filter(e=>Z(e)?.tone===`remote`).map(e=>[e.path,{tables:null,keys:null}]))}function Mn(){k.openLoginWindow(),D.authLogin()}function Nn(e){return`${ie(e.updatedAt)} · ${Pn(e.size)}`}function Pn(e){return e===null?`size unknown`:P(e)}function Fn(e){switch(e.status){case`running`:return{icon:I,class:`animate-spin text-sky-500`};case`done`:return{icon:te,class:`text-emerald-500`};case`skipped`:return{icon:Ee,class:`text-amber-500`};case`failed`:return{icon:A,class:`text-destructive`};default:return{icon:be,class:`text-muted-foreground`}}}function In(){V.value=!0,D.envPullConfig()}return i(C,()=>{V.value=!1}),u(()=>{vn(`tables`),vn(`keys`),D.envRefresh()}),(e,i)=>(m(),c(`div`,Ie,[s(`div`,Le,[s(`div`,Re,[s(`div`,ze,[s(`div`,null,[i[15]||=s(`h1`,{class:`text-xl font-semibold`},` Environment `,-1),s(`p`,Be,[i[12]||=n(` Configurations, databases, buckets and Redis databases shared by the developers: `,-1),i[13]||=s(`code`,null,`environment.folder`,-1),i[14]||=n(` ⇄ `,-1),a(C)?.backends.length?(m(!0),c(h,{key:0},l(a(C).backends,(e,t)=>(m(),c(h,{key:e.name},[n(_(t>0?`, `:``),1),s(`span`,Ve,_(e.name),1),s(`span`,He,`(`+_(e.type)+_(e.encrypted?`, encrypted`:``)+`)`,1)],64))),128)):(m(),c(h,{key:1},[n(` backends. `)],64))])]),s(`div`,Ue,[t(a(O),{size:`sm`,variant:`ghost`,disabled:H.value||!a(C)?.items.length,onClick:jn},{default:g(()=>[...i[16]||=[n(` Select newer remotely `,-1)]]),_:1},8,[`disabled`]),t(a(O),{size:`sm`,variant:`outline`,class:`gap-1.5`,disabled:H.value||a(C)?.refreshing,onClick:i[0]||=e=>a(D).envRefresh()},{default:g(()=>[t(a(fe),{class:o(a(T)(`size-3.5`,a(C)?.refreshing&&`animate-spin`))},null,8,[`class`]),n(` `+_(a(C)?.refreshing?`Refreshing…`:`Refresh`),1)]),_:1},8,[`disabled`])])]),ke.value&&a(j)?(m(),c(`div`,We,[s(`div`,Ge,[t(a(ue),{class:`size-4 shrink-0 text-muted-foreground`}),i[17]||=n(` Not signed in: the copies of the cdn backends are unknown and cannot be transferred. `,-1)]),a(j).pendingLoginUrl?(m(),c(`span`,qe,`Waiting for `+_(a(j).providerName??`the sign-in`)+`…`,1)):(m(),v(a(O),{key:0,size:`sm`,class:`max-w-full`,title:`Sign in${a(j).providerName?` with ${a(j).providerName}`:``}`,onClick:Mn},{default:g(()=>[s(`span`,Ke,`Sign in`+_(a(j).providerName?` with ${a(j).providerName}`:``),1)]),_:1},8,[`title`]))])):x(``,!0),a(C)?.error?(m(),c(`div`,Je,[t(a(oe),{class:`mt-0.5 size-4 shrink-0`}),s(`span`,Ye,_(a(C).error),1)])):x(``,!0),a(C)?.configured?a(C).items.length?x(``,!0):(m(),v(a(he),{key:3,class:`items-center gap-4 py-10 text-center`},{default:g(()=>[s(`div`,Xe,[i[21]||=s(`p`,{class:`font-medium`},` No items yet `,-1),s(`p`,Ze,[i[19]||=n(` The shared devtool configuration declares them: pull it from `,-1),s(`span`,Qe,_(Ae.value?.name??`the default backend`),1),i[20]||=n(` to list the configurations, databases, buckets and Redis databases. `,-1)])]),t(a(O),{class:`gap-1.5`,disabled:V.value,onClick:In},{default:g(()=>[V.value?(m(),v(a(I),{key:0,class:`size-4 animate-spin`})):(m(),v(a(ve),{key:1,class:`size-4`})),i[22]||=n(` Pull the devtool configuration `,-1)]),_:1},8,[`disabled`])]),_:1})):(m(),v(a(he),{key:2,class:`items-center gap-4 py-10 text-center`},{default:g(()=>[...i[18]||=[s(`div`,{class:`space-y-1`},[s(`p`,{class:`font-medium`},` No environment yet `),s(`p`,{class:`text-sm text-muted-foreground`},[n(` Declare a backend in `),s(`code`,null,`environment.backends`),n(` of `),s(`code`,null,`config.local.yml`),n(` of the configuration folder to get the shared devtool configuration. `)])],-1)]]),_:1})),(m(!0),c(h,null,l(je.value,e=>(m(),v(a(he),{key:e.section,class:`@container gap-0 overflow-hidden py-0`},{default:g(()=>[s(`div`,$e,[s(`label`,et,[t(a(F),{"model-value":dn(e.items),disabled:H.value,"onUpdate:modelValue":t=>$(e.items,t===!0)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`]),s(`span`,{class:`truncate text-xs font-semibold tracking-wide text-muted-foreground`,title:e.section},_(e.section),9,tt)]),s(`span`,nt,_(e.items.length)+` `+_(e.items.length>1?`items`:`item`),1)]),(m(!0),c(h,null,l(e.items,e=>(m(),c(`fieldset`,{key:e.path,disabled:H.value,class:o(a(T)(`min-w-0 border-b transition-colors last:border-b-0`,M.value[e.path]&&`bg-accent/30`,H.value?`pointer-events-none opacity-70`:`hover:bg-accent/40`))},[s(`div`,{class:`grid cursor-pointer grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,1fr)_fit-content(min(30%,9rem))] items-center gap-x-3 gap-y-1.5 px-4 py-3 @md:grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,1fr)_min(30%,9rem)] @4xl:grid-cols-[auto_auto_minmax(0,1fr)_11rem_11rem_9rem]`,onClick:t=>$([e],!M.value[e.path])},[t(a(F),{class:`row-span-4 @md:row-span-2 @4xl:row-span-1`,"model-value":!!M.value[e.path],onClick:i[1]||=S(()=>{},[`stop`]),"onUpdate:modelValue":t=>$([e],t===!0)},null,8,[`model-value`,`onUpdate:modelValue`]),s(`div`,at,[e.kind===`database`?(m(),v(a(xe),{key:0,class:`size-4`})):e.kind===`bucket`?(m(),v(a(Te),{key:1,class:`size-4`})):e.kind===`redis`?(m(),v(a(we),{key:2,class:`size-4`})):e.pem?.kind===`certificate`?(m(),v(a(Se),{key:3,class:`size-4`})):e.pem?.kind===`privateKey`?(m(),v(a(de),{key:4,class:`size-4`})):(m(),v(a(ne),{key:5,class:`size-4`}))]),s(`div`,ot,[s(`div`,st,[s(`span`,{class:`truncate font-mono text-sm`,title:e.path},_(e.path),9,ct),e.kind===`file`?(m(),v(a(w),{key:0,to:{name:`configs`,query:{path:e.path}},title:`Edit the local copy`,class:`shrink-0 rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:i[2]||=S(()=>{},[`stop`])},{default:g(()=>[t(a(ae),{class:`size-3.5`})]),_:1},8,[`to`])):x(``,!0)]),s(`div`,{class:`truncate text-xs text-muted-foreground`,title:un(e)},[n(_(un(e))+` `,1),e.pem?.kind===`certificate`?(m(),c(h,{key:0},[i[23]||=n(` · `,-1),s(`span`,{class:o(a(ge)(e.pem.expiresAt))},_(a(_e)(e.pem.expiresAt)),3)],64)):x(``,!0)],8,lt),M.value[e.path]&&Tn(e)?(m(),c(`div`,{key:0,role:`group`,"aria-label":`Part of ${e.path} to transfer`,class:`mt-1.5 inline-flex max-w-full flex-wrap rounded-md border p-0.5 text-xs`,onClick:i[3]||=S(()=>{},[`stop`])},[(m(),c(h,null,l([!1,!0],t=>s(`button`,{key:String(t),type:`button`,"aria-pressed":En(e.path)===t,class:o(a(T)(`rounded px-2 py-0.5 transition-colors`,En(e.path)===t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`)),onClick:n=>Dn(e,t)},_(t?`Some ${Tn(e)}`:e.kind===`file`?`Whole file`:`Whole database`),11,dt)),64))],8,ut)):x(``,!0)]),s(`div`,ft,[i[24]||=s(`div`,{class:`shrink-0 text-muted-foreground`},` Local `,-1),s(`div`,{class:`min-w-0 truncate`,title:e.local?Nn(e.local):void 0},_(e.local?Nn(e.local):`—`),9,pt)]),s(`div`,mt,[s(`div`,ht,[s(`span`,{class:`truncate`,title:X(e)},_(X(e)),9,gt),e.encrypted?(m(),c(`span`,_t,[t(a(Ce),{class:`size-3`,"aria-label":`Encrypted`})])):x(``,!0)]),s(`div`,{class:`min-w-0 truncate`,title:e.remote&&e.remote!==`unknown`?Nn(e.remote):void 0},_(e.remote===`unknown`?`Unknown`:e.remote?Nn(e.remote):`—`),9,vt)]),s(`div`,yt,[Z(e)?(m(),v(a(pe),{key:0,variant:`outline`,class:o(a(T)(`max-w-full`,p[Z(e).tone])),title:Z(e).label},{default:g(()=>[s(`span`,bt,_(Z(e).label),1)]),_:2},1032,[`class`,`title`])):x(``,!0)])],8,it),Sn(e)&&M.value[e.path]?.keys?(m(),c(`div`,xt,[a(E).keys.value[e.path]?a(E).keys.value[e.path].error?(m(),c(`div`,Ct,_(a(E).keys.value[e.path].error),1)):(m(),v(Me,{key:2,"model-value":M.value[e.path].keys,entries:a(E).keys.value[e.path].entries,"default-side":Cn(e),"remote-name":X(e),"onUpdate:modelValue":t=>On(e.path,t)},null,8,[`model-value`,`entries`,`default-side`,`remote-name`,`onUpdate:modelValue`])):(m(),c(`div`,St,[t(a(I),{class:`size-3.5 animate-spin`}),n(` Comparing the local and `+_(X(e))+` copies… `,1)]))])):x(``,!0),(e.parts.pull||e.parts.push)&&M.value[e.path]?.tables?(m(),c(`div`,wt,[a(E).tables.value[e.path]?a(E).tables.value[e.path].error?(m(),c(`div`,Et,_(a(E).tables.value[e.path].error),1)):(m(),c(h,{key:2},[s(`div`,Dt,[t(a(ce),{modelValue:R.value[e.path],"onUpdate:modelValue":t=>R.value[e.path]=t,placeholder:`Filter ${bn(e)}`,class:`h-8 max-w-64 text-xs`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),s(`span`,Ot,_(M.value[e.path].tables.length)+` of `+_(a(E).tables.value[e.path].tables.length)+` selected `,1)]),s(`div`,kt,[(m(!0),c(h,null,l(An(e.path),t=>(m(),c(`button`,{key:t,type:`button`,class:o(a(T)(`max-w-full truncate rounded-full border px-2.5 py-0.5 font-mono text-xs transition-colors`,M.value[e.path].tables.includes(t)?`border-primary bg-primary text-primary-foreground`:`hover:bg-accent`)),title:t,"aria-pressed":M.value[e.path].tables.includes(t),onClick:n=>kn(e.path,t)},_(t),11,At))),128))])],64)):(m(),c(`div`,Tt,[t(a(I),{class:`size-3.5 animate-spin`}),n(` Loading the `+_(bn(e))+` of `+_(e.container??e.redis)+`… `,1)]))])):x(``,!0)],10,rt))),128))]),_:2},1024))),128))])]),a(C)?.run?(m(),c(`div`,jt,[s(`div`,Mt,[s(`span`,Nt,_(r[a(C).run.action])+` `+_(a(C).run.finished?`finished`:`in progress`),1),s(`div`,Pt,[s(`span`,Ft,_(a(C).run.steps.filter(e=>e.status===`done`).length)+` / `+_(a(C).run.steps.length)+` done `,1),a(C).run.finished?(m(),v(a(O),{key:0,size:`icon`,variant:`ghost`,class:`size-6`,title:`Close`,onClick:i[4]||=e=>a(D).envDismissRun(a(C).run.id)},{default:g(()=>[t(a(A),{class:`size-4`})]),_:1})):x(``,!0)])]),s(`div`,It,[(m(!0),c(h,null,l(a(C).run.steps,(e,n)=>(m(),c(`div`,{key:n,class:`flex flex-wrap items-start gap-x-2 gap-y-1 text-sm`},[s(`span`,Lt,[(m(),v(b(Fn(e).icon),{class:o(a(T)(`size-4`,Fn(e).class))},null,8,[`class`]))]),s(`span`,{class:`max-w-2/3 min-w-0 shrink-0 truncate font-mono text-xs leading-5 @md:max-w-1/2`,title:e.target},_(e.target),9,Rt),e.progress?(m(),c(`span`,zt,[s(`span`,{class:`min-w-0 flex-1 truncate text-right @md:w-64 @md:flex-none`,title:a(N)(e.progress.done,e.progress.total,nn(a(C).run.id,n,e))},_(a(N)(e.progress.done,e.progress.total,nn(a(C).run.id,n,e))),9,Bt),s(`span`,Vt,[a(re)(e.progress.done,e.progress.total)===null?(m(),c(`span`,Ht)):(m(),c(`span`,{key:0,class:`block h-full rounded-full bg-sky-500 transition-[width]`,style:ee({width:`${a(re)(e.progress.done,e.progress.total)}%`})},null,4))])])):x(``,!0),e.detail?(m(),c(`span`,{key:1,class:o(a(T)(`min-w-0 flex-1 basis-0 truncate text-xs leading-5`,e.status===`failed`?`text-destructive`:`text-muted-foreground`)),title:e.detail},_(e.detail),11,Ut)):x(``,!0),ln(e)?(m(),v(a(O),{key:2,size:`icon`,variant:`ghost`,class:o(a(T)(`ml-auto size-5 shrink-0`,e.progress&&`@md:ml-0`)),title:`Cancel the transfer of this item`,"aria-label":`Cancel the transfer of ${e.target}`,onClick:e=>a(D).envCancel(a(C).run.id,n)},{default:g(()=>[t(a(A),{class:`size-3.5`})]),_:1},8,[`class`,`aria-label`,`onClick`])):x(``,!0)]))),128))])])):x(``,!0),s(`div`,Wt,[s(`div`,Gt,[s(`div`,Kt,[t(a(F),{"aria-label":`Select all items`,"model-value":dn(a(C)?.items??[]),disabled:H.value||!a(C)?.items.length,"onUpdate:modelValue":i[5]||=e=>$(a(C)?.items??[],e===!0)},null,8,[`model-value`,`disabled`]),s(`span`,{class:`min-w-0 truncate`,title:Ne.value},_(Ne.value),9,qt)]),a(C)?.run?.steps.some(ln)?(m(),c(`div`,Jt,[t(a(O),{variant:`outline`,class:`gap-1.5`,onClick:i[6]||=e=>a(D).envCancel(a(C).run.id,null)},{default:g(()=>[t(a(A),{class:`size-4`}),n(` Cancel `+_(a(C).run.action),1)]),_:1})])):(m(),c(`div`,Yt,[on(`remove`)?(m(),v(a(O),{key:0,variant:`ghost`,class:`gap-1.5`,disabled:!Y(`remove`),onClick:i[7]||=e=>sn(`remove`)},{default:g(()=>[t(a(me),{class:`size-4`}),i[25]||=n(` Remove local copy `,-1)]),_:1},8,[`disabled`])):x(``,!0),on(`restore`)?(m(),v(a(O),{key:1,variant:`outline`,class:`gap-1.5`,disabled:!Y(`restore`),onClick:i[8]||=e=>sn(`restore`)},{default:g(()=>[t(a(le),{class:`size-4`}),i[26]||=n(` Restore `,-1)]),_:1},8,[`disabled`])):x(``,!0),on(`push`)?(m(),v(a(O),{key:2,variant:`outline`,class:`gap-1.5`,disabled:!Y(`push`),onClick:i[9]||=e=>sn(`push`)},{default:g(()=>[t(a(ye),{class:`size-4`}),i[27]||=n(` Push `,-1)]),_:1},8,[`disabled`])):x(``,!0),on(`pull`)?(m(),v(a(O),{key:3,class:`gap-1.5`,disabled:!Y(`pull`),onClick:i[10]||=e=>sn(`pull`)},{default:g(()=>[t(a(ve),{class:`size-4`}),i[28]||=n(` Pull `,-1)]),_:1},8,[`disabled`])):x(``,!0)]))])]),t(se,{open:B.value,"onUpdate:open":i[11]||=e=>B.value=e,title:$t.value?.title??``,"confirm-label":$t.value?.confirm??``,disabled:z.value===null||!Y(z.value),onConfirm:cn},{default:g(()=>[s(`p`,null,_($t.value?.intro),1),s(`ul`,Xt,[(m(!0),c(h,null,l($t.value?.lines??[],e=>(m(),c(`li`,{key:e},_(e),1))),128))])]),_:1},8,[`open`,`title`,`confirm-label`,`disabled`])]))}});export{Qt as default};
@@ -1 +1 @@
1
- import{H as e,O as t}from"./Teleport-pr1nbO15.js";import{En as n,On as r,g as i,k as a,mt as o,qt as s,v as c,xt as l}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{C as u,D as d}from"./ws-DXdsSbKc.js";var f=d({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),p=d({name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]});function m(e){return typeof e==`string`?`'${e}'`:new h().serialize(e)}var h=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function g(e,t){return e===t||m(e)===m(t)}function _(e){return e==null}function v(e){return i(()=>!n(e)||!!t(e)?.closest(`form`))}var y=a({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(t,n)=>(o(),c(r(u),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:s(()=>[l(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),[b,x]=e(`FieldRoot`);export{g as a,_ as i,y as n,p as o,v as r,f as s,b as t};
1
+ import{H as e,O as t}from"./Teleport-DHeiB0Hf.js";import{En as n,On as r,g as i,k as a,mt as o,qt as s,v as c,xt as l}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{C as u,D as d}from"./ws-BpxG87gL.js";var f=d({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),p=d({name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]});function m(e){return typeof e==`string`?`'${e}'`:new h().serialize(e)}var h=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function g(e,t){return e===t||m(e)===m(t)}function _(e){return e==null}function v(e){return i(()=>!n(e)||!!t(e)?.closest(`form`))}var y=a({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(t,n)=>(o(),c(r(u),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:s(()=>[l(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),[b,x]=e(`FieldRoot`);export{g as a,_ as i,y as n,p as o,v as r,f as s,b as t};
@@ -0,0 +1,2 @@
1
+ import{U as e}from"./Teleport-DHeiB0Hf.js";import{$ as t,D as n,E as r,En as i,Ft as a,Ht as o,On as s,Rt as c,Zn as l,_ as u,b as d,bt as f,ct as p,er as m,g as h,it as g,k as _,mt as v,o as y,qt as b,tr as x,un as S,v as C,wt as w,xn as T,xt as E,y as D}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{C as O,w as k}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{c as ee,d as A,l as j,p as M,s as te,u as N}from"./lib-BdSNv3tE.js";import{A as ne,D as P,M as re,N as ie,O as F,S as I,b as L,g as ae,h as R,j as oe,m as z,t as B,x as V}from"./ws-BpxG87gL.js";import{i as H,o as se}from"./dist-CTEwM5Qh.js";import{t as U}from"./chevron-right-Ciz9rTD0.js";import{n as W,t as G}from"./file-text-C2envr-4.js";import{a as K,r as q}from"./format-CWWug1jh.js";import{n as ce}from"./DialogClose-l707gO7f.js";import{t as J}from"./sparkles-DQZgGD3J.js";import{t as Y}from"./triangle-alert-Bi6TbWM9.js";import{a as le,c as ue,i as de,l as fe,n as pe,o as me,r as he,s as ge,t as _e}from"./ConfirmDialog-DYNB5IAJ.js";import{t as X}from"./Input-B8rdCliw.js";import{C as ve,K as ye,N as be,U as xe,X as Se,o as Z,q as Ce}from"./index-BROv5BcC.js";import{f as we,i as Te,p as Q,r as Ee}from"./editor.api-CNfPuhuR.js";import"./monaco-uxN5Nj6W.js";import{t as De}from"./MarkdownPreview-Cj64O3Pl.js";var Oe=P({name:`file-key`,size:24,node:[[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M4 12v6`,key:`bg1pfk`}],[`path`,{d:`M4 14h2`,key:`1sf9f8`}],[`path`,{d:`M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4`,key:`d56i0q`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`file-key-2`]}),ke=P({name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]}),Ae=P({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),je=P({name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Me=P({name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Ne=P({name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]}),Pe=P({name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}),$=_({__name:`CodeEditor`,props:t({path:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:t([`save`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=a(e,`modelValue`),i=t,s=c(`container`),l=H({storageKey:`devtool-color-mode`}),u=h(()=>l.state.value===`dark`?`vs-dark`:`vs`),f=null;function m(e,t){return Q.createModel(t,void 0,we.file(e))}function _(e){return e.getLanguageId()===`markdown`?`on`:`off`}return p(()=>{if(!s.value)return;let e=m(n.path,r.value);f=Q.create(s.value,{model:e,theme:u.value,automaticLayout:!0,wordWrap:_(e),hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,tabSize:2}),f.onDidChangeModelContent(()=>{r.value=f?.getValue()??``}),f.addCommand(Te.CtrlCmd|Ee.KeyS,()=>i(`save`))}),o(()=>n.path,e=>{if(!f)return;let t=f.getModel(),n=m(e,r.value);f.setModel(n),f.updateOptions({wordWrap:_(n)}),t?.dispose()}),o(u,e=>Q.setTheme(e)),o(r,e=>{f&&f.getValue()!==e&&f.setValue(e)}),g(()=>{f?.getModel()?.dispose(),f?.dispose(),f=null}),(e,t)=>(v(),d(`div`,{ref_key:`container`,ref:s,class:`h-full w-full`},null,512))}}),Fe={class:`flex h-full min-h-0 flex-col`},Ie={class:`flex items-center gap-1 border-b px-4 py-1.5`},Le={key:0,class:`space-y-3 border-b p-4`},Re={class:`block space-y-1`},ze={class:`block space-y-1`},Be={class:`flex justify-between text-xs font-medium text-muted-foreground`},Ve=[`value`,`disabled`],He={key:0,class:`space-y-1 rounded-md border border-amber-500/40 bg-amber-500/10 p-2 text-xs text-amber-700 dark:text-amber-400`},Ue={class:`whitespace-pre-wrap`},We={class:`flex min-h-0 flex-1`},Ge={class:`min-w-0 flex-1`},Ke=1024,qe=_({__name:`AgentSkillEditor`,props:t({path:{},folder:{},preview:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:t([`save`],[`update:modelValue`]),setup(e,{emit:t}){let i=e,o=a(e,`modelValue`),c=t,p=T(`form`),m=h(()=>j(o.value,i.folder)),g=h({get:()=>m.value.body,set:e=>{o.value=N(o.value,e)}});function _(e,t){o.value=A(o.value,{[e]:String(t)})}return(t,i)=>(v(),d(`div`,Fe,[u(`div`,Ie,[(v(),d(y,null,f([`form`,`source`],e=>n(s(V),{key:e,size:`sm`,variant:p.value===e?`secondary`:`ghost`,class:`h-7`,onClick:t=>p.value=e},{default:b(()=>[r(x(e===`form`?`Skill`:`Source`),1)]),_:2},1032,[`variant`,`onClick`])),64))]),p.value===`form`?(v(),d(`div`,Le,[u(`label`,Re,[i[6]||=u(`span`,{class:`text-xs font-medium text-muted-foreground`},`Name`,-1),n(s(X),{"model-value":m.value.name??``,disabled:m.value.error!==null,class:`font-mono`,"onUpdate:modelValue":i[0]||=e=>_(`name`,e)},null,8,[`model-value`,`disabled`])]),u(`label`,ze,[u(`span`,Be,[i[7]||=r(` Description `,-1),u(`span`,{class:l(s(I)(`tabular-nums`,(m.value.description?.length??0)>Ke&&`text-destructive`))},x(m.value.description?.length??0)+` / `+x(Ke),3)]),u(`textarea`,{value:m.value.description??``,disabled:m.value.error!==null,rows:`3`,class:`w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30`,onInput:i[1]||=e=>_(`description`,e.target.value)},null,40,Ve)]),m.value.problems.length?(v(),d(`ul`,He,[(v(!0),d(y,null,f(m.value.problems,e=>(v(),d(`li`,{key:e,class:`flex items-start gap-2`},[n(s(Y),{class:`mt-0.5 size-3.5 shrink-0`}),u(`span`,Ue,[r(x(e),1),m.value.error?(v(),d(y,{key:0},[r(`: fix it in Source.`)],64)):D(``,!0)])]))),128))])):D(``,!0)])):D(``,!0),u(`div`,We,[u(`div`,Ge,[p.value===`form`?(v(),C($,{key:`body`,modelValue:g.value,"onUpdate:modelValue":i[2]||=e=>g.value=e,path:`${e.folder}/.body/${e.path.split(`/`).pop()}`,onSave:i[3]||=e=>c(`save`)},null,8,[`modelValue`,`path`])):(v(),C($,{key:`source`,modelValue:o.value,"onUpdate:modelValue":i[4]||=e=>o.value=e,path:e.path,onSave:i[5]||=e=>c(`save`)},null,8,[`modelValue`,`path`]))]),e.preview?(v(),C(De,{key:0,source:o.value,class:`min-w-0 flex-1 border-l`},null,8,[`source`])):D(``,!0)])]))}}),Je={class:`flex flex-col gap-0.5`},Ye=[`onClick`],Xe={class:`min-w-0 flex-1`},Ze={class:`flex items-center gap-1`},Qe={class:`truncate`},$e=[`title`],et={key:0,class:`line-clamp-2 text-xs text-muted-foreground`},tt=[`onClick`],nt={class:`truncate`},rt={class:`truncate`},it={key:0,class:`ml-auto size-2 shrink-0 rounded-full bg-amber-500`},at={key:3,class:`absolute right-1 hidden items-center rounded-md bg-card group-hover:flex`},ot=[`onClick`],st=[`onClick`],ct=[`onClick`],lt=[`onClick`],ut=_({__name:`FileTree`,props:{entries:{},current:{},dirty:{type:Boolean},editable:{type:Boolean},agentSkills:{default:null}},emits:[`create`,`rename`,`remove`],setup(e,{emit:t}){let r=e,i=ie(),a=t,c=T(new Set);function p(e){let t=e.split(`/`);return t.slice(1).map((e,n)=>t.slice(0,n+1).join(`/`))}function g(e){return/\.(key|pem|crt|pub)$/.test(e)?Oe:/\.(ya?ml|json|toml|ini|conf)$/.test(e)?Se:G}let _=h(()=>{let e=new Map([[``,{name:``,path:``,kind:`directory`,children:[]}]]),t=(n,r)=>{let i=e.get(n);if(i)return i;let a=n.lastIndexOf(`/`),o={name:n.slice(a+1),path:n,kind:r,children:[]};return e.set(n,o),t(a===-1?``:n.slice(0,a),`directory`).children.push(o),o};for(let e of r.entries)t(e.path,e.kind);for(let t of e.values())t.children.sort((e,t)=>Number(t.kind===`directory`)-Number(e.kind===`directory`));return e.get(``)}),S=h(()=>new Map(r.agentSkills?.map(e=>[e.folder,e]))),E=h(()=>{let e=[],t=(n,i)=>{for(let a of n.children)e.push({node:a,depth:i,skill:i===0?S.value.get(a.path)??null:null}),a.kind===`directory`&&(!r.editable||c.value.has(a.path))&&t(a,i+1)};return t(_.value,0),e});o(()=>r.current,e=>{e&&(c.value=new Set([...c.value,...p(e)]))},{immediate:!0});function O(e){let t=new Set(c.value);t.delete(e)||t.add(e),c.value=t}function A(e){let t=r.entries.find(t=>t.kind===`file`&&ee(t.path)===e)?.path;!t||r.current===t?O(e):i.push({query:{path:t}})}return(t,r)=>(v(),d(`div`,Je,[(v(!0),d(y,null,f(E.value,({node:t,depth:r,skill:i})=>(v(),d(`div`,{key:t.path,class:`group relative flex items-center`},[i?(v(),d(`button`,{key:0,type:`button`,class:l(s(I)(`flex min-w-0 flex-1 items-start gap-1.5 rounded-md py-1.5 pr-2 pl-2 text-left text-sm transition-colors`,e.current?.startsWith(`${t.path}/`)?`bg-accent/60 text-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`)),onClick:e=>A(t.path)},[n(s(U),{class:l(s(I)(`mt-0.5 size-3.5 shrink-0 transition-transform`,c.value.has(t.path)&&`rotate-90`)),onClick:k(e=>O(t.path),[`stop`])},null,8,[`class`,`onClick`]),n(s(J),{class:`mt-0.5 size-4 shrink-0`}),u(`span`,Xe,[u(`span`,Ze,[u(`span`,Qe,x(t.name),1),i.problems.length?(v(),d(`span`,{key:0,title:i.problems.join(`
2
+ `)},[n(s(Y),{class:`size-3.5 shrink-0 text-amber-500`})],8,$e)):D(``,!0)]),i.description?(v(),d(`span`,et,x(i.description),1)):D(``,!0)])],10,Ye)):t.kind===`directory`?(v(),d(`button`,{key:1,type:`button`,class:`flex min-w-0 flex-1 items-center gap-1.5 rounded-md py-1.5 pr-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground`,style:m({paddingLeft:`${.5+r*.875}rem`}),onClick:e=>O(t.path)},[e.editable?(v(),C(s(U),{key:0,class:l(s(I)(`size-3.5 shrink-0 transition-transform`,c.value.has(t.path)&&`rotate-90`))},null,8,[`class`])):D(``,!0),!e.editable||c.value.has(t.path)?(v(),C(s(Ae),{key:1,class:`size-4 shrink-0`})):(v(),C(s(Me),{key:2,class:`size-4 shrink-0`})),u(`span`,nt,x(t.name),1)],12,tt)):(v(),C(s(F),{key:2,to:{query:{path:t.path}},class:l(s(I)(`flex min-w-0 flex-1 items-center gap-1.5 rounded-md py-1.5 pr-2 text-sm transition-colors`,t.path===e.current?`bg-accent text-accent-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`)),style:m({paddingLeft:`${(e.editable?1.375:.5)+r*.875}rem`})},{default:b(()=>[(v(),C(w(g(t.name)),{class:`size-4 shrink-0`})),u(`span`,rt,x(t.name),1),e.dirty&&t.path===e.current?(v(),d(`span`,it)):D(``,!0)]),_:2},1032,[`to`,`class`,`style`])),e.editable?(v(),d(`div`,at,[t.kind===`directory`?(v(),d(y,{key:0},[u(`button`,{type:`button`,title:`New file`,class:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:e=>a(`create`,t.path,`file`)},[n(s(ke),{class:`size-3.5`})],8,ot),u(`button`,{type:`button`,title:`New folder`,class:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:e=>a(`create`,t.path,`directory`)},[n(s(je),{class:`size-3.5`})],8,st)],64)):D(``,!0),u(`button`,{type:`button`,title:`Rename or move`,class:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:e=>a(`rename`,t.path)},[n(s(ce),{class:`size-3.5`})],8,ct),u(`button`,{type:`button`,title:`Remove`,class:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-destructive`,onClick:e=>a(`remove`,t.path,t.kind)},[n(s(xe),{class:`size-3.5`})],8,lt)])):D(``,!0)]))),128))]))}}),dt={class:`flex h-full w-64 shrink-0 flex-col border-r`},ft={class:`flex items-center gap-1 border-b px-3 py-2`},pt={class:`min-w-0 flex-1 truncate text-xs font-semibold tracking-wide text-muted-foreground uppercase`},mt={key:0,class:`flex flex-col gap-1 border-b p-2`},ht=[`onClick`],gt={class:`truncate`},_t={key:1,class:`border-b p-2`},vt={key:2,class:`m-2 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-xs text-destructive`},yt={key:0,class:`p-3 text-sm text-muted-foreground`},bt={key:1,class:`space-y-3 p-3`},xt={class:`text-sm break-all text-muted-foreground`},St={class:`font-mono`},Ct=_({__name:`FileExplorer`,props:{name:{},tree:{},current:{},dirty:{type:Boolean},commands:{},restore:{}},emits:[`refresh`,`run`,`create`,`rename`,`remove`],setup(e,{emit:t}){let i=e,a=t,o=T(``),c=h(()=>{let e=o.value.trim().toLowerCase(),t=i.tree?.agentSkills;if(!t||!e)return i.tree?.entries??[];let n=new Set(t.filter(t=>[t.folder,t.name,t.description].some(t=>t?.toLowerCase().includes(e))).map(e=>e.folder));return i.tree?.entries.filter(e=>n.has(e.path.split(`/`)[0]??``))??[]});function l(e){let t=typeof e.meta==`object`&&e.meta!==null?e.meta.icon:null;return typeof t!=`string`||!t.trim()?`lucide:terminal`:t.includes(`:`)?t:`lucide:${t}`}return(t,i)=>(v(),d(`div`,dt,[u(`div`,ft,[n(Z,{side:`left`,class:`-ml-1.5`}),u(`span`,pt,x(e.name),1),e.tree?.agentSkills&&e.tree.editable&&e.tree.exists?(v(),C(s(V),{key:0,size:`icon`,variant:`ghost`,class:`size-7`,title:`New skill`,onClick:i[0]||=e=>a(`create`,``,`directory`)},{default:b(()=>[n(s(J),{class:`size-3.5`})]),_:1})):e.tree?.editable&&e.tree.exists?(v(),d(y,{key:1},[n(s(V),{size:`icon`,variant:`ghost`,class:`size-7`,title:`New file`,onClick:i[1]||=e=>a(`create`,``,`file`)},{default:b(()=>[n(s(ke),{class:`size-3.5`})]),_:1}),n(s(V),{size:`icon`,variant:`ghost`,class:`size-7`,title:`New folder`,onClick:i[2]||=e=>a(`create`,``,`directory`)},{default:b(()=>[n(s(je),{class:`size-3.5`})]),_:1})],64)):D(``,!0),n(s(V),{size:`icon`,variant:`ghost`,class:`size-7`,title:`Refresh`,onClick:i[3]||=e=>a(`refresh`)},{default:b(()=>[n(s(ye),{class:`size-3.5`})]),_:1})]),e.commands.length?(v(),d(`div`,mt,[(v(!0),d(y,null,f(e.commands,e=>(v(),d(`button`,{key:e.slug,type:`button`,class:`flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground`,onClick:t=>a(`run`,e)},[n(s(M),{icon:l(e),class:`size-4 shrink-0`},null,8,[`icon`]),u(`span`,gt,x(e.name),1)],8,ht))),128))])):D(``,!0),e.tree?.agentSkills?.length?(v(),d(`div`,_t,[n(s(X),{modelValue:o.value,"onUpdate:modelValue":i[4]||=e=>o.value=e,placeholder:`Search skills`,class:`h-8`},null,8,[`modelValue`])])):D(``,!0),e.tree?.error?(v(),d(`div`,vt,[n(s(Y),{class:`mt-0.5 size-3.5 shrink-0`}),u(`span`,null,x(e.tree.error),1)])):D(``,!0),n(s(be),{class:`min-h-0 flex-1`},{default:b(()=>[e.tree?e.tree.exists?(v(),C(ut,{key:2,class:`p-2`,entries:c.value,current:e.current,dirty:e.dirty,editable:e.tree.editable,"agent-skills":e.tree.agentSkills,onCreate:i[6]||=(e,t)=>a(`create`,e,t),onRename:i[7]||=e=>a(`rename`,e),onRemove:i[8]||=(e,t)=>a(`remove`,e,t)},null,8,[`entries`,`current`,`dirty`,`editable`,`agent-skills`])):(v(),d(`div`,bt,[u(`p`,xt,[u(`span`,St,x(e.tree.root),1),i[9]||=r(` does not exist. `,-1)]),e.restore?(v(),C(s(V),{key:0,size:`sm`,class:`w-full`,onClick:i[5]||=t=>a(`run`,e.restore)},{default:b(()=>[n(s(M),{icon:l(e.restore),class:`size-4`},null,8,[`icon`]),r(` `+x(e.restore.name),1)]),_:1})):D(``,!0)])):(v(),d(`p`,yt,` Loading… `))]),_:1})]))}}),wt={class:`border-b`},Tt={class:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2`},Et={class:`min-w-0 flex-1 basis-48 truncate font-mono text-sm`},Dt={class:`ml-auto flex flex-wrap items-center justify-end gap-3`},Ot={key:0,class:`mx-4 mb-2 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-sm text-destructive`},kt={class:`whitespace-pre-wrap`},At=_({__name:`FileHeader`,props:t({root:{},file:{},dirty:{type:Boolean},saving:{type:Boolean},previewable:{type:Boolean,default:!1}},{preview:{type:Boolean,default:!1},previewModifiers:{}}),emits:t([`save`,`revert`],[`update:preview`]),setup(e,{emit:t}){let i=e,o=a(e,`preview`),c=t,f=h(()=>`${i.root.replace(/^\/(Users|home)\/[^/]+/,`~`)}/${i.file.path}`),p=h(()=>i.dirty?`Unsaved changes`:i.file.error?``:i.file.binary?`Binary file, not editable`:i.file.updatedAt?`Changed ${q(i.file.updatedAt)}`:`Not created yet`);return(t,i)=>(v(),d(`div`,wt,[u(`div`,Tt,[u(`span`,Et,x(f.value),1),u(`div`,Dt,[u(`span`,{class:l(s(I)(`shrink-0 text-xs`,e.dirty?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`))},x(p.value),3),e.previewable?(v(),C(s(V),{key:0,variant:o.value?`secondary`:`outline`,size:`sm`,onClick:i[0]||=e=>o.value=!o.value},{default:b(()=>[o.value?(v(),C(s(W),{key:0,class:`size-4`})):(v(),C(s(K),{key:1,class:`size-4`})),i[3]||=r(` Preview `,-1)]),_:1},8,[`variant`])):D(``,!0),n(s(V),{variant:`outline`,size:`sm`,disabled:!e.dirty||e.saving,onClick:i[1]||=e=>c(`revert`)},{default:b(()=>[n(s(Pe),{class:`size-4`}),i[4]||=r(` Revert `,-1)]),_:1},8,[`disabled`]),n(s(V),{size:`sm`,disabled:!e.dirty||e.saving,onClick:i[2]||=e=>c(`save`)},{default:b(()=>[e.saving?(v(),C(s(Ce),{key:0,class:`size-4 animate-spin`})):(v(),C(s(Ne),{key:1,class:`size-4`})),i[5]||=r(` Save `,-1)]),_:1},8,[`disabled`]),n(Z,{side:`right`})])]),e.file.error?(v(),d(`div`,Ot,[n(s(Y),{class:`mt-0.5 size-4 shrink-0`}),u(`span`,kt,[r(x(e.file.error),1),e.file.conflict?(v(),d(y,{key:0},[r(`: save again to overwrite it, or revert to load it.`)],64)):D(``,!0)])])):D(``,!0)]))}}),jt={class:`flex justify-end gap-2`},Mt=_({__name:`PromptDialog`,props:t({title:{},confirmLabel:{}},{open:{type:Boolean,required:!0},openModifiers:{},modelValue:{required:!0},modelModifiers:{}}),emits:t([`confirm`],[`update:open`,`update:modelValue`]),setup(e,{emit:t}){let i=a(e,`open`),o=a(e,`modelValue`),c=t;function d(){c(`confirm`),i.value=!1}return(t,a)=>(v(),C(s(he),{open:i.value,"onUpdate:open":a[2]||=e=>i.value=e},{default:b(()=>[n(s(de),null,{default:b(()=>[n(s(le),{class:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`}),n(s(ue),{class:`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full grid-cols-1 wrap-anywhere max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg sm:max-w-lg`},{default:b(()=>[n(s(pe),{class:`text-lg font-semibold`},{default:b(()=>[r(x(e.title),1)]),_:1}),n(s(me),{as:`div`,class:`text-sm text-muted-foreground`},{default:b(()=>[E(t.$slots,`default`)]),_:3}),n(s(X),{modelValue:o.value,"onUpdate:modelValue":a[0]||=e=>o.value=e,class:`font-mono`,autofocus:``,onKeydown:O(k(d,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`]),u(`div`,jt,[n(s(ge),{class:l(s(L)({variant:`outline`}))},{default:b(()=>[...a[3]||=[r(` Cancel `,-1)]]),_:1},8,[`class`]),n(s(fe),{class:l(s(L)()),onClick:a[1]||=e=>c(`confirm`)},{default:b(()=>[r(x(e.confirmLabel),1)]),_:1},8,[`class`])])]),_:3})]),_:3})]),_:3},8,[`open`]))}});function Nt(e,t){let n=T(``),r=T(!1),a=h(()=>{let n=i(t);return n?R.files.value[z(i(e),n)]??null:null}),s=h(()=>a.value!==null&&!a.value.binary&&n.value!==(a.value.content??``));o([()=>i(e),()=>i(t),B.connected],([e,t,n])=>{t&&n&&B.fileRead(e,t)},{immediate:!0}),o(a,(e,t)=>{r.value=!1,(!e||e.saved||t?.space!==e.space||t.path!==e.path||n.value===(t.content??``))&&(n.value=e?.content??``)},{immediate:!0});function c(){let o=i(t);o&&s.value&&!r.value&&(r.value=!0,B.fileWrite(i(e),o,n.value,a.value?.updatedAt??null))}function l(){let r=i(t);n.value=a.value?.content??``,r&&B.fileRead(i(e),r)}return{file:a,draft:n,dirty:s,saving:r,save:c,revert:l}}var Pt={class:`flex h-full min-h-0`},Ft={key:0,class:`flex min-w-0 flex-1 flex-col`},It={key:1,class:`flex min-h-0 flex-1`},Lt={class:`min-w-0 flex-1`},Rt={key:1,class:`flex min-w-0 flex-1 items-start justify-between gap-2 p-4`},zt={class:`p-2 text-sm text-muted-foreground`},Bt={class:`font-mono`},Vt={class:`font-mono`},Ht=_({__name:`FileSpaceView`,props:{space:{},name:{},commands:{default:()=>[]},restore:{default:null},projectSlug:{default:null},directorySlug:{default:null}},setup(e){let t=e,i=/\.(md|markdown)$/i,a=re(),c=ie(),l=h(()=>R.trees.value[t.space]??null),f=h(()=>l.value?.entries.filter(e=>e.kind===`file`).map(e=>e.path)??[]),p=h(()=>{let e=a.query.path;return typeof e==`string`&&f.value.includes(e)?e:l.value&&!l.value.editable?f.value[0]??null:null}),{file:m,draft:g,dirty:_,saving:w,save:E,revert:O}=Nt(()=>t.space,p),k=h(()=>l.value?.agentSkills&&p.value?ee(p.value):null),A=h(()=>i.test(p.value??``)),j=T(!1),M=T(!1),N=null,P=T(null),F=T(!1),I=T(``),L=T(``),z=T(``),V=()=>void 0,H=T(!1),U=T(null);o([()=>t.space,B.connected,ae.projects],([e,t])=>{t&&B.filesList(e)},{immediate:!0}),o(f,e=>{P.value&&e.includes(P.value)&&(c.push({query:{path:P.value}}),P.value=null)});function W(e){return!_.value||(N=e.fullPath,M.value=!0,!1)}function G(){O(),N&&c.push(N)}function K(e,t,n,r){I.value=e,L.value=t,z.value=n,V=r,F.value=!0}function q(e,n){let r=!!l.value?.agentSkills&&!e&&n===`directory`;K(r?`New skill`:n===`file`?`New file`:`New folder`,`Create`,e?`${e}/`:``,e=>{B.fileCreate(t.space,e,n),(n===`file`||r)&&(P.value=r?`${e}/${te}`:e)})}function ce(e){K(`Rename or move`,`Rename`,e,n=>{B.fileRename(t.space,e,n);let r=p.value;(r===e||r?.startsWith(`${e}/`))&&(P.value=`${n}${r.slice(e.length)}`)})}function J(e,t){U.value={path:e,kind:t},H.value=!0}function Y(){U.value&&B.fileRemove(t.space,U.value.path)}function le(e){let n=t.space;t.projectSlug&&t.directorySlug&&ve(t.projectSlug,t.directorySlug,e,{onFinished:()=>B.filesList(n)})}return ne(W),oe(W),se(window,`beforeunload`,e=>{_.value&&e.preventDefault()}),(t,i)=>(v(),d(`div`,Pt,[n(Ct,{name:e.name,tree:l.value,current:p.value,dirty:s(_),commands:e.commands,restore:e.restore,onRefresh:i[0]||=t=>s(B).filesList(e.space),onRun:le,onCreate:q,onRename:ce,onRemove:J},null,8,[`name`,`tree`,`current`,`dirty`,`commands`,`restore`]),p.value&&s(m)?(v(),d(`div`,Ft,[n(At,{preview:j.value,"onUpdate:preview":i[1]||=e=>j.value=e,root:l.value?.root??``,file:s(m),dirty:s(_),saving:s(w),previewable:A.value&&!s(m).binary,onSave:s(E),onRevert:s(O)},null,8,[`preview`,`root`,`file`,`dirty`,`saving`,`previewable`,`onSave`,`onRevert`]),!s(m).binary&&k.value?(v(),C(qe,{key:0,modelValue:s(g),"onUpdate:modelValue":i[2]||=e=>S(g)?g.value=e:null,class:`min-h-0 flex-1`,path:p.value,folder:k.value,preview:j.value,onSave:s(E)},null,8,[`modelValue`,`path`,`folder`,`preview`,`onSave`])):s(m).binary?D(``,!0):(v(),d(`div`,It,[u(`div`,Lt,[n($,{modelValue:s(g),"onUpdate:modelValue":i[3]||=e=>S(g)?g.value=e:null,path:p.value,onSave:s(E)},null,8,[`modelValue`,`path`,`onSave`])]),A.value&&j.value?(v(),C(De,{key:0,source:s(g),class:`min-w-0 flex-1 border-l`},null,8,[`source`])):D(``,!0)]))])):(v(),d(`div`,Rt,[u(`p`,zt,x(p.value?`Loading…`:`Choose a file.`),1),n(Z,{side:`right`})])),n(_e,{open:M.value,"onUpdate:open":i[4]||=e=>M.value=e,title:`Discard unsaved changes?`,"confirm-label":`Discard`,onConfirm:G},{default:b(()=>[u(`p`,null,`The changes to `+x(p.value)+` are not saved.`,1)]),_:1},8,[`open`]),n(_e,{open:H.value,"onUpdate:open":i[5]||=e=>H.value=e,title:U.value?.kind===`directory`?`Remove the folder?`:`Remove the file?`,"confirm-label":`Remove`,onConfirm:Y},{default:b(()=>[u(`p`,null,[u(`span`,Bt,x(U.value?.path),1),U.value?.kind===`directory`?(v(),d(y,{key:0},[r(` and everything it holds `)],64)):D(``,!0),i[9]||=r(` will be deleted from the disk. `,-1)])]),_:1},8,[`open`,`title`]),n(Mt,{open:F.value,"onUpdate:open":i[6]||=e=>F.value=e,modelValue:z.value,"onUpdate:modelValue":i[7]||=e=>z.value=e,title:I.value,"confirm-label":L.value,onConfirm:i[8]||=e=>s(V)(z.value.trim())},{default:b(()=>[u(`p`,null,[i[10]||=r(`Path relative to `,-1),u(`span`,Vt,x(l.value?.root),1),i[11]||=r(`.`,-1)])]),_:1},8,[`open`,`modelValue`,`title`,`confirm-label`])]))}}),Ut=e({default:()=>Wt}),Wt=Ht;export{Ut as n,Wt as t};
@@ -1 +1 @@
1
- import{On as e,Yt as t,Zn as n,b as r,k as i,mt as a,un as o}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{x as s}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{S as c}from"./ws-DXdsSbKc.js";import{d as l}from"./dist-1J-RzTp-.js";var u=i({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(i,{emit:u}){let d=i,f=l(d,`modelValue`,u,{passive:!0,defaultValue:d.defaultValue});return(i,l)=>t((a(),r(`input`,{"onUpdate:modelValue":l[0]||=e=>o(f)?f.value=e:null,"data-slot":`input`,class:n(e(c)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,d.class))},null,2)),[[s,e(f)]])}});export{u as t};
1
+ import{On as e,Yt as t,Zn as n,b as r,k as i,mt as a,un as o}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{x as s}from"./runtime-dom.esm-bundler-Cu4lUtzf.js";import{S as c}from"./ws-BpxG87gL.js";import{p as l}from"./dist-CTEwM5Qh.js";var u=i({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(i,{emit:u}){let d=i,f=l(d,`modelValue`,u,{passive:!0,defaultValue:d.defaultValue});return(i,l)=>t((a(),r(`input`,{"onUpdate:modelValue":l[0]||=e=>o(f)?f.value=e:null,"data-slot":`input`,class:n(e(c)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,d.class))},null,2)),[[s,e(f)]])}});export{u as t};
@@ -1 +1 @@
1
- import{D as e,On as t,_ as n,et as r,k as i,mt as a,qt as o,tr as s,v as c,wt as l}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{f as u}from"./lib-DxxZQ3kp.js";import{O as d}from"./ws-DXdsSbKc.js";import{h as f,m as p}from"./index-BcQvyHh1.js";var m={class:`min-w-0 flex-1`},h={class:`block truncate`},g={class:`block truncate text-xs text-muted-foreground`},_=i({__name:`IntegrationLink`,props:{integration:{},projectSlug:{},directorySlug:{}},setup(i){return(_,v)=>(a(),c(l(t(p)(i.integration)?t(d):`a`),r(t(p)(i.integration)?{to:t(f)(i.integration,i.projectSlug,i.directorySlug)}:{href:i.integration.url,target:`_blank`,rel:`noopener`},{class:`flex w-full items-start gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors hover:bg-accent/60`}),{default:o(()=>[e(t(u),{icon:i.integration.icon,class:`mt-0.5 size-4 shrink-0`},null,8,[`icon`]),n(`span`,m,[n(`strong`,h,s(i.integration.name),1),n(`span`,g,s(i.integration.url),1)])]),_:1},16))}});export{_ as t};
1
+ import{D as e,On as t,_ as n,et as r,k as i,mt as a,qt as o,tr as s,v as c,wt as l}from"./runtime-core.esm-bundler-BqSmL5nf.js";import{p as u}from"./lib-BdSNv3tE.js";import{O as d}from"./ws-BpxG87gL.js";import{g as f,h as p}from"./index-BROv5BcC.js";var m={class:`min-w-0 flex-1`},h={class:`block truncate`},g={class:`block truncate text-xs text-muted-foreground`},_=i({__name:`IntegrationLink`,props:{integration:{},projectSlug:{},directorySlug:{}},setup(i){return(_,v)=>(a(),c(l(t(p)(i.integration)?t(d):`a`),r(t(p)(i.integration)?{to:t(f)(i.integration,i.projectSlug,i.directorySlug)}:{href:i.integration.url,target:`_blank`,rel:`noopener`},{class:`flex w-full items-start gap-2 rounded-md border px-3 py-2 text-left text-sm transition-colors hover:bg-accent/60`}),{default:o(()=>[e(t(u),{icon:i.integration.icon,class:`mt-0.5 size-4 shrink-0`},null,8,[`icon`]),n(`span`,m,[n(`strong`,h,s(i.integration.name),1),n(`span`,g,s(i.integration.url),1)])]),_:1},16))}});export{_ as t};