dorkos 0.98.0 → 0.101.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 (194) hide show
  1. package/README.md +43 -13
  2. package/dist/bin/cli.js +10649 -8676
  3. package/dist/browser/fresh-verifier.mjs +3 -2
  4. package/dist/browser/native/darwin-journal-worker.mjs +2244 -0
  5. package/dist/browser/native/darwin-process-observer +0 -0
  6. package/dist/browser/native/darwin-process-observer.c +252 -0
  7. package/dist/browser/native/darwin-process-observer.h +37 -0
  8. package/dist/browser/native/darwin-process-observer.manifest.json +1 -0
  9. package/dist/browser/native/darwin-supervisor-worker.mjs +1996 -0
  10. package/dist/browser/native/package-manifest.json +1 -0
  11. package/dist/browser/source-manifest.json +1 -1
  12. package/dist/client/assets/{AboutPage-DqTcRYx5.js → AboutPage-CwxCTicf.js} +1 -1
  13. package/dist/client/assets/ActivityRow-D0QQ0SFu.js +1 -0
  14. package/dist/client/assets/AdapterIcon-CL-MyyKy.js +1 -0
  15. package/dist/client/assets/AdapterSetupWizard-C8HOvHLF.js +2 -0
  16. package/dist/client/assets/AgentRequestCard-BLLmoAES.js +12 -0
  17. package/dist/client/assets/AppearancePage-GqrWckTQ.js +1 -0
  18. package/dist/client/assets/AttentionSignalRow-sEhnIPBB.js +1 -0
  19. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Bmlsorom.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-BXjzhT_D.js} +1 -1
  20. package/dist/client/assets/{BlintzCanvas-BBW7iNEC.js → BlintzCanvas-CXi0fvcM.js} +1 -1
  21. package/dist/client/assets/{CanvasCsvContent-D6qWSQm4.js → CanvasCsvContent-QhDSf8Pd.js} +2 -2
  22. package/dist/client/assets/CanvasFileContent-ZZhdofR4.js +2 -0
  23. package/dist/client/assets/CanvasModel3dContent-DMMMZh4o.js +2 -0
  24. package/dist/client/assets/{CodeMirrorDiff-DsOh9sIB.js → CodeMirrorDiff-BMG7DBg2.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-BxIWDXqr.js → CodeMirrorEditor-BYdz0ipX.js} +1 -1
  26. package/dist/client/assets/ConnectionAccessLists-PW1uzcGU.js +1 -0
  27. package/dist/client/assets/{ConnectionsPage-DvxSfsfG.js → ConnectionsPage-EwitZwOE.js} +3 -3
  28. package/dist/client/assets/ConventionPage-y-Zq3Klp.js +11 -0
  29. package/dist/client/assets/ExtensionPageRoute-gZKKPhaj.js +6 -0
  30. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BCrkUo51.js → FloatingTanStackRouterDevtools-CqogiFob-CbKIa11X.js} +1 -1
  31. package/dist/client/assets/HandlePage-CL3_n1CI.js +1 -0
  32. package/dist/client/assets/{LexicalField-mvJHHMqo.js → LexicalField-Ceoa9flp.js} +13 -13
  33. package/dist/client/assets/{ManagesPage-DScJn5uY.js → ManagesPage-Dcqdm6I8.js} +1 -1
  34. package/dist/client/assets/Marketplace-DsU-q1ZZ.js +36 -0
  35. package/dist/client/assets/MarketplaceSourcesView-D72YoKNR.js +1 -0
  36. package/dist/client/assets/McpAppFrame-B1ThSf2U.js +6 -0
  37. package/dist/client/assets/McpSigninBody-Btg3PnYN.js +1 -0
  38. package/dist/client/assets/{Model3dViewer-BYNxJNRV.js → Model3dViewer-DlcQ3-LS.js} +1 -1
  39. package/dist/client/assets/NamePage-Bzqj4Eob.js +1 -0
  40. package/dist/client/assets/NewDirectMessageMenu-89yeGqvy.js +1 -0
  41. package/dist/client/assets/{NotificationsPage-CU6oIOwb.js → NotificationsPage-CQQIdLtI.js} +1 -1
  42. package/dist/client/assets/OperatorIdentityForm-BhiB9tQp.js +1 -0
  43. package/dist/client/assets/{PermissionsPage-BIatOhyg.js → PermissionsPage-TX-d7aVQ.js} +1 -1
  44. package/dist/client/assets/PersonalityPicker-C_9JVOva.js +1 -0
  45. package/dist/client/assets/PersonalityPopover-BoTED73t.js +1 -0
  46. package/dist/client/assets/PhotoPage-C3fMlebQ.js +1 -0
  47. package/dist/client/assets/PreviewRefusedNotice-ChCgdKWN.js +1 -0
  48. package/dist/client/assets/PromptSuggestionChips-B_oUtFMI.js +1 -0
  49. package/dist/client/assets/RoomSurface-CgtNuYhl.js +39 -0
  50. package/dist/client/assets/RoomsPage-zOjjpHdA.js +1 -0
  51. package/dist/client/assets/RunsOnPopover-JTm1cYuw.js +1 -0
  52. package/dist/client/assets/SessionsPage-D4kyvHQf.js +6 -0
  53. package/dist/client/assets/SkillsPage-KYUVzuVa.js +1 -0
  54. package/dist/client/assets/TasksPage-BZapA_v6.js +1 -0
  55. package/dist/client/assets/{ToolsPage-BMW27c-X.js → ToolsPage-CWpHMlrR.js} +2 -2
  56. package/dist/client/assets/{TopologyGraph-u-ihEvQa.js → TopologyGraph-BMcPxZsA.js} +3 -3
  57. package/dist/client/assets/TourHost-VY1-sy1Y.js +1 -0
  58. package/dist/client/assets/UnlinkDialog-3p38G_9q.js +1 -0
  59. package/dist/client/assets/UnreadDivider-KSqqcHKN.js +1 -0
  60. package/dist/client/assets/_shell-DAjwimLg.js +93 -0
  61. package/dist/client/assets/_shell._home-Bp_p1VUv.js +1 -0
  62. package/dist/client/assets/_shell._home.activity-tk-XApvX.js +1 -0
  63. package/dist/client/assets/_shell._home.index-BNVhSN0y.js +3 -0
  64. package/dist/client/assets/_shell._home.tasks-BsBH_4tZ.js +1 -0
  65. package/dist/client/assets/_shell._home.workspaces-DuXnjQh0.js +1 -0
  66. package/dist/client/assets/_shell.channels-DWAHkDPV.js +10 -0
  67. package/dist/client/assets/_shell.connections-DIm3mUHy.js +6 -0
  68. package/dist/client/assets/_shell.feedback-requests-Hjv640j9.js +2 -0
  69. package/dist/client/assets/_shell.marketplace-DF6Y7mc0.js +1 -0
  70. package/dist/client/assets/_shell.marketplace_.sources-Do8cm7kq.js +1 -0
  71. package/dist/client/assets/_shell.session-DlN8iOl-.js +43 -0
  72. package/dist/client/assets/_shell.team-ctLQztjw.js +28 -0
  73. package/dist/client/assets/_shell.x._extensionId-0Q1rJtud.js +1 -0
  74. package/dist/client/assets/_shell.x._extensionId_._-0Q1rJtud.js +1 -0
  75. package/dist/client/assets/agent-attention-Dn__3LQE.js +5 -0
  76. package/dist/client/assets/{agent-browser-Bn5EG403.js → agent-browser-CCN16ZOz.js} +1 -1
  77. package/dist/client/assets/banner-DOm9_4l-.js +6 -0
  78. package/dist/client/assets/composer-insert-BpyATrmR.js +1 -0
  79. package/dist/client/assets/dorkbot-templates-cu4wApxb.js +1 -0
  80. package/dist/client/assets/file-drag-GDx2qhdk.js +1 -0
  81. package/dist/client/assets/file-exclamation-point-BKzL0QhY.js +6 -0
  82. package/dist/client/assets/format-duration-BCr6uzby.js +1 -0
  83. package/dist/client/assets/hand-DLUdsiuR.js +6 -0
  84. package/dist/client/assets/{highlighted-body-KPVGNVTW-CL9x-9e4.js → highlighted-body-KPVGNVTW-DTxMTVdP.js} +1 -1
  85. package/dist/client/assets/hover-card-qzuFUCaR.js +1 -0
  86. package/dist/client/assets/{index-nEOi__50.js → index-3lQkXKcq.js} +1 -1
  87. package/dist/client/assets/{index-CpJvQdyn.js → index-B-z7hA9x.js} +1 -1
  88. package/dist/client/assets/{index-C-wQjAlh.js → index-BIMClIrX.js} +1 -1
  89. package/dist/client/assets/{index-lrzDDn8S.js → index-BMOfHKE0.js} +1 -1
  90. package/dist/client/assets/{index-CK35WFBO.js → index-BPcwoJoz.js} +1 -1
  91. package/dist/client/assets/{index-CsQv_9cY.js → index-BW5ce4t8.js} +1 -1
  92. package/dist/client/assets/{index-C2L0bOg6.js → index-BaB-skF0.js} +3 -3
  93. package/dist/client/assets/{index-DAXybyxB.js → index-Bk98IpMn.js} +1 -1
  94. package/dist/client/assets/{index-62aJQhJd.js → index-C3XnoXTY.js} +1 -1
  95. package/dist/client/assets/{index-tY8nAJmx.js → index-C7B2uRgo.js} +2 -2
  96. package/dist/client/assets/index-C8ZMfyGc.js +1 -0
  97. package/dist/client/assets/{index-BSl_jWtK.js → index-CDTumWMC.js} +1 -1
  98. package/dist/client/assets/{index-DuWGfUC7.js → index-CF9fqPef.js} +5 -5
  99. package/dist/client/assets/{index-DEYZcwYZ.js → index-CIPHHziB.js} +1 -1
  100. package/dist/client/assets/{index-DOVEs6Rq.js → index-CIfwPLXd.js} +1 -1
  101. package/dist/client/assets/{index-DnjFcJhW.js → index-CLhD0Bno.js} +36 -36
  102. package/dist/client/assets/index-CQWqpw_G.js +1 -0
  103. package/dist/client/assets/index-CScfHuKF.js +1 -0
  104. package/dist/client/assets/index-CTXNRyRE.js +1 -0
  105. package/dist/client/assets/{index-C3fr7zOo.js → index-CTai_TxZ.js} +1 -1
  106. package/dist/client/assets/{index-CniKYwdp.js → index-CVl132_4.js} +1 -1
  107. package/dist/client/assets/index-CejezM4U.js +1 -0
  108. package/dist/client/assets/{index-Bc9XDEj8.js → index-CmlaXay_.js} +1 -1
  109. package/dist/client/assets/{index-KIOfBCox.js → index-CtOB9fS3.js} +1 -1
  110. package/dist/client/assets/{index-DyFf2nbN.js → index-D3DXMH4x.js} +1 -1
  111. package/dist/client/assets/index-D5uYwabS.js +1 -0
  112. package/dist/client/assets/{index-CaEda4s3.js → index-DA-i3I4q.js} +1 -1
  113. package/dist/client/assets/index-DFMDv6qR.js +1 -0
  114. package/dist/client/assets/index-DMYBI16t.js +1252 -0
  115. package/dist/client/assets/{index-DzBsotRj.js → index-DOxEmnH2.js} +1 -1
  116. package/dist/client/assets/{index-Dxkj6c9m.js → index-DR1JT9Uz.js} +12 -12
  117. package/dist/client/assets/{index-BO-CpekL.js → index-DT_v3O-B.js} +1 -1
  118. package/dist/client/assets/index-DbbZNAKk.js +5 -0
  119. package/dist/client/assets/{index-BBz-vkiB.js → index-Dcs6e-U_.js} +1 -1
  120. package/dist/client/assets/{index-BE54c4kA.js → index-DgH_dl1a.js} +2 -2
  121. package/dist/client/assets/{index-DPGgujWh.js → index-DgtF-nBt.js} +1 -1
  122. package/dist/client/assets/{index-BlbBz069.js → index-DwzSdOh3.js} +1 -1
  123. package/dist/client/assets/index-IgIVF9T_.js +1 -0
  124. package/dist/client/assets/{index-aFkVVlMJ.js → index-WjW-NUCp.js} +1 -1
  125. package/dist/client/assets/layers-CJHXSEKK.js +6 -0
  126. package/dist/client/assets/lightbulb-DWjxw7lb.js +6 -0
  127. package/dist/client/assets/mention-pill-akMU3IVs.js +1 -0
  128. package/dist/client/assets/message-square-off-DEagHpQY.js +6 -0
  129. package/dist/client/assets/owner-notice-CLsx0s7q.js +1 -0
  130. package/dist/client/assets/page-container-W7byjRmk.js +1 -0
  131. package/dist/client/assets/primer-trigger-DuM9vVnV.js +3 -0
  132. package/dist/client/assets/radio-B8Ozjv9U.js +6 -0
  133. package/dist/client/assets/{room-files-source-BXJ2jlgd.js → room-files-source-Bsc3YA91.js} +2 -2
  134. package/dist/client/assets/rotate-ccw-clock-CNcDcTvq.js +6 -0
  135. package/dist/client/assets/rotate-cw-xvfipJLN.js +6 -0
  136. package/dist/client/assets/scroll-area-C95q3ss7.js +1 -0
  137. package/dist/client/assets/search-x-C6SAxw7a.js +6 -0
  138. package/dist/client/assets/session-strategy-labels-C7Wduch3.js +1 -0
  139. package/dist/client/assets/shield-x-DxOGc0dW.js +6 -0
  140. package/dist/client/assets/{soul-file-11avkxYV.js → soul-file-pg0ShYy3.js} +1 -1
  141. package/dist/client/assets/untrusted-text-1hXdPgLA.js +1 -0
  142. package/dist/client/assets/use-delete-binding-CZVeHqn0.js +1 -0
  143. package/dist/client/assets/use-dev-links-Df2WkCic.js +1 -0
  144. package/dist/client/assets/use-external-adapter-catalog-B0gcY-k7.js +1 -0
  145. package/dist/client/assets/use-full-activity-feed-SYcgdMZu.js +1 -0
  146. package/dist/client/assets/use-is-below-desktop-C5_YenEp.js +1 -0
  147. package/dist/client/assets/use-jump-back-in-DWUPb1gi.js +11 -0
  148. package/dist/client/assets/use-mesh-topology-HLzZIgis.js +1 -0
  149. package/dist/client/assets/use-pending-read-BuJknrxG.js +1 -0
  150. package/dist/client/assets/{use-personality-commit-PCN2Kh8p.js → use-personality-commit-OH7d0xl_.js} +1 -1
  151. package/dist/client/assets/use-promo-activation-BgdGasXE.js +11 -0
  152. package/dist/client/assets/use-pulse-freshness-BlD-dM_g.js +1 -0
  153. package/dist/client/assets/use-rename-session-D3MuyK-F.js +1 -0
  154. package/dist/client/assets/use-room-follow-claim-CyjhzbRJ.js +1 -0
  155. package/dist/client/assets/use-roving-tab-list-Be60AWK3.js +1 -0
  156. package/dist/client/assets/use-session-canvas-Bqs6IQO7.js +64 -0
  157. package/dist/client/assets/use-session-diagnostics-CfKdB2iY.js +16 -0
  158. package/dist/client/assets/use-unclaimed-chats-lqMhotUB.js +1 -0
  159. package/dist/client/index.html +1 -1
  160. package/dist/client/manifest.webmanifest +1 -1
  161. package/dist/drizzle/20261005194144_connector_auth_flow_failure_code.sql +1 -0
  162. package/dist/drizzle/20261005230915_task_run_occurrence.sql +2 -0
  163. package/dist/drizzle/20261006231015_audit_events.sql +63 -0
  164. package/dist/drizzle/20261007230701_private_session_identity.sql +15 -0
  165. package/dist/drizzle/meta/20261005194144_snapshot.json +12238 -0
  166. package/dist/drizzle/meta/20261005230915_snapshot.json +12252 -0
  167. package/dist/drizzle/meta/20261006231015_snapshot.json +12519 -0
  168. package/dist/drizzle/meta/20261007230701_snapshot.json +12611 -0
  169. package/dist/drizzle/meta/_journal.json +28 -0
  170. package/dist/server/index.js +161811 -97213
  171. package/dist/server/index.js.map +2 -2
  172. package/package.json +5 -5
  173. package/dist/client/assets/AdapterIcon-CiK683Vv.js +0 -1
  174. package/dist/client/assets/AppearancePage-CBq2_KUY.js +0 -1
  175. package/dist/client/assets/CanvasFileContent-jV63reY5.js +0 -2
  176. package/dist/client/assets/CanvasModel3dContent-DzvsEWGD.js +0 -2
  177. package/dist/client/assets/ConnectionAccessLists-BWuegEtZ.js +0 -1
  178. package/dist/client/assets/ConventionPage-CYV7X_nF.js +0 -11
  179. package/dist/client/assets/HandlePage-CJpRpaLw.js +0 -1
  180. package/dist/client/assets/NamePage-KoYyo25o.js +0 -1
  181. package/dist/client/assets/PersonalityPopover-CFRYfO5E.js +0 -1
  182. package/dist/client/assets/PhotoPage-DkGyFlWQ.js +0 -1
  183. package/dist/client/assets/RoomsPage-ClT030eV.js +0 -1
  184. package/dist/client/assets/RunsOnPopover-CNCO9sZk.js +0 -1
  185. package/dist/client/assets/SessionsPage-5xEcQImi.js +0 -6
  186. package/dist/client/assets/SkillsPage-ic4TDV4I.js +0 -1
  187. package/dist/client/assets/TasksPage-C_GFpRgB.js +0 -1
  188. package/dist/client/assets/index-6COO_Ljw.js +0 -1
  189. package/dist/client/assets/index-BKl9b2dT.js +0 -1
  190. package/dist/client/assets/index-BVtk6Sb_.js +0 -1
  191. package/dist/client/assets/index-Bxrxl2HH.js +0 -1
  192. package/dist/client/assets/index-C6uVMs3w.js +0 -1
  193. package/dist/client/assets/index-DEvFAO8t.js +0 -1
  194. package/dist/client/assets/index-DpSk7iO1.js +0 -1680
@@ -1,3 +1,3 @@
1
- import{j as J,r as T}from"./index-DpSk7iO1.js";import{R as lt}from"./index-DyFf2nbN.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-Dxkj6c9m.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
1
+ import{j as J,r as T}from"./index-DMYBI16t.js";import{R as lt}from"./index-D3DXMH4x.js";import{o as Q,E as B,q as ne,C as Ge,S as G,r as Ne,u as Fe,v as st,w as H,x as M,V as ot,F as Ve,y as je,R as N,W as Y,G as oe,z as at,A as ft,B as Ie,H as dt,m as ht,n as ct}from"./index-DR1JT9Uz.js";class v{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new v(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function y(t,e,n,l,i,r){if(t==l)return[];let s=fe(t,e,n,l,i,r),o=de(t,e+s,n,l,i+s,r);e+=s,n-=o,i+=s,r-=o;let f=n-e,h=r-i;if(!f||!h)return[new v(e,n,i,r)];if(f>h){let d=t.slice(e,n).indexOf(l.slice(i,r));if(d>-1)return[new v(e,e+d,i,i),new v(e+d+h,n,r,r)]}else if(h>f){let d=l.slice(i,r).indexOf(t.slice(e,n));if(d>-1)return[new v(e,e,i,i+d),new v(n,n,i+d+f,r)]}if(f==1||h==1)return[new v(e,n,i,r)];let a=He(t,e,n,l,i,r);if(a){let[d,c,u]=a;return y(t,e,d,l,i,c).concat(y(t,d+u,n,l,c+u,r))}return ut(t,e,n,l,i,r)}let I=1e9,U=0,ae=!1;function ut(t,e,n,l,i,r){let s=n-e,o=r-i;if(I<1e9&&Math.min(s,o)>I*16||U>0&&Date.now()>U)return Math.min(s,o)>I*64?[new v(e,n,i,r)]:ge(t,e,n,l,i,r);let f=Math.ceil((s+o)/2);ee.reset(f),te.reset(f);let h=(u,m)=>t.charCodeAt(e+u)==l.charCodeAt(i+m),a=(u,m)=>t.charCodeAt(n-u-1)==l.charCodeAt(r-m-1),d=(s-o)%2!=0?te:null,c=d?null:ee;for(let u=0;u<f;u++){if(u>I||U>0&&!(u&63)&&Date.now()>U)return ge(t,e,n,l,i,r);let m=ee.advance(u,s,o,f,d,!1,h)||te.advance(u,s,o,f,c,!0,a);if(m)return mt(t,e,n,e+m[0],l,i,r,i+m[1])}return[new v(e,n,i,r)]}class Ue{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,s,o){for(let f=-e+this.start;f<=e-this.end;f+=2){let h=i+f,a=f==-e||f!=e&&this.vec[h-1]<this.vec[h+1]?this.vec[h+1]:this.vec[h-1]+1,d=a-f;for(;a<n&&d<l&&o(a,d);)a++,d++;if(this.vec[h]=a,a>n)this.end+=2;else if(d>l)this.start+=2;else if(r){let c=i+(n-l)-f;if(c>=0&&c<this.len&&r.vec[c]!=-1)if(s){let u=r.vec[c];if(u>=n-a)return[u,i+u-c]}else{let u=n-r.vec[c];if(a>=u)return[a,d]}}}return null}}const ee=new Ue,te=new Ue;function mt(t,e,n,l,i,r,s,o){let f=!1;return!F(t,l)&&++l==n&&(f=!0),!F(i,o)&&++o==s&&(f=!0),f?[new v(e,n,r,s)]:y(t,e,l,i,r,o).concat(y(t,l,n,i,o,s))}function We(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function fe(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let s=We(n-e,r-i);for(let o=e,f=i;;){let h=o+s,a=f+s;if(h>n||a>r||t.slice(o,h)!=l.slice(f,a)){if(s==1)return o-e-(F(t,o)?0:1);s=s>>1}else{if(h==n||a==r)return h-e;o=h,f=a}}}function de(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let s=We(n-e,r-i);for(let o=n,f=r;;){let h=o-s,a=f-s;if(h<e||a<i||t.slice(h,o)!=l.slice(a,f)){if(s==1)return n-o-(F(t,o)?0:1);s=s>>1}else{if(h==e||a==i)return n-h;o=h,f=a}}}function re(t,e,n,l,i,r,s,o){let f=l.slice(i,r),h=null;for(;;){if(h||s<o)return h;for(let a=e+s;;){F(t,a)||a++;let d=a+s;if(F(t,d)||(d+=d==a+1?1:-1),d>=n)break;let c=t.slice(a,d),u=-1;for(;(u=f.indexOf(c,u+1))!=-1;){let m=fe(t,d,n,l,i+u+c.length,r),p=de(t,e,a,l,i,i+u),g=c.length+m+p;(!h||h[2]<g)&&(h=[a-p,i+u-p,g])}a=d}if(o<0)return h;s=s>>1}}function He(t,e,n,l,i,r){let s=n-e,o=r-i;if(s<o){let f=He(l,i,r,t,e,n);return f&&[f[1],f[0],f[2]]}return s<4||o*2<s?null:re(t,e,n,l,i,r,Math.floor(s/4),-1)}function ge(t,e,n,l,i,r){ae=!0;let s=n-e,o=r-i,f;if(s<o){let c=re(l,i,r,t,e,n,Math.floor(s/6),50);f=c&&[c[1],c[0],c[2]]}else f=re(t,e,n,l,i,r,Math.floor(o/6),50);if(!f)return[new v(e,n,i,r)];let[h,a,d]=f;return y(t,e,h,l,i,a).concat(y(t,h+d,n,l,a+d,r))}function ze(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new v(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function gt(t,e,n){for(;;){ze(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],s,o;(s=fe(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA+s,r.toA,r.fromB+s,r.toB)),(o=de(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new v(r.fromA,r.toA-o,r.fromB,r.toB-o));let f=r.toA-r.fromA,h=r.toB-r.fromB;if(f&&h)continue;let a=r.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!a||!d)continue;let c=f?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);a<=c.length&&t.slice(r.fromA-a,r.fromA)==c.slice(c.length-a)?(n[i]=new v(r.fromA-a,r.toA-a,r.fromB-a,r.toB-a),l=!0):d<=c.length&&t.slice(r.toA,r.toA+d)==c.slice(0,d)&&(n[i]=new v(r.fromA+d,r.toA+d,r.fromB+d,r.toB+d),l=!0)}if(!l)break}return n}function pt(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],s=r.toA-r.fromA,o=r.toB-r.fromB;if(s&&o||s>3||o>3){let f=i==t.length-1?e.length:t[i+1].fromA,h=r.fromA-l,a=f-r.toA,d=Ce(e,r.fromA,h),c=pe(e,r.toA,a),u=r.fromA-d,m=c-r.toA;if((!s||!o)&&u&&m){let p=Math.max(s,o),[g,C,S]=s?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>u&&e.slice(d,r.fromA)==g.slice(S-u,S)?(r=t[i]=new v(d,d+s,r.fromB-u,r.toB-u),d=r.fromA,c=pe(e,r.toA,f-r.toA)):p>m&&e.slice(r.toA,c)==g.slice(C,C+m)&&(r=t[i]=new v(c-s,c,r.fromB+m,r.toB+m),c=r.toA,d=Ce(e,r.fromA,r.fromA-l)),u=r.fromA-d,m=c-r.toA}if(u||m)r=t[i]=new v(r.fromA-u,r.toA+m,r.fromB-u,r.toB+m);else if(s){if(!o){let p=Ae(e,r.fromA,r.toA),g,C=p<0?-1:ve(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=a&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toA-C)<=h&&e.slice(r.fromA-g,r.fromA)==e.slice(C,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=Ae(n,r.fromB,r.toB),g,C=p<0?-1:ve(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=a&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):C>-1&&(g=r.toB-C)<=h&&n.slice(r.fromB-g,r.fromB)==n.slice(C,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return ze(t,3),t}let E;try{E=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pe(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qe(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?Pe(n)?1:0:E?!Je(n)||e==t.length-1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e,e+2))?2:0:0}function _e(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?Pe(n)?1:0:E?!Ke(n)||e==1?E.test(String.fromCharCode(n))?1:0:E.test(t.slice(e-2,e))?2:0:0}const $e=8;function pe(t,e,n){if(e==t.length||!_e(t,e))return e;for(let l=e,i=e+n,r=0;r<$e;r++){let s=qe(t,l);if(!s||l+s>i)return l;l+=s}return e}function Ce(t,e,n){if(!e||!qe(t,e))return e;for(let l=e,i=e-n,r=0;r<$e;r++){let s=_e(t,l);if(!s||l-s<i)return l;l-=s}return e}function ve(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function Ae(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Je=t=>t>=55296&&t<=56319,Ke=t=>t>=56320&&t<=57343;function F(t,e){return!e||e==t.length||!Je(t.charCodeAt(e-1))||!Ke(t.charCodeAt(e))}function Ct(t,e,n){var l;let i=n==null?void 0:n.override;return i?i(t,e):(I=((l=n==null?void 0:n.scanLimit)!==null&&l!==void 0?l:1e9)>>1,U=n!=null&&n.timeout?Date.now()+n.timeout:0,ae=!1,gt(t,e,y(t,0,t.length,e,0,e.length)))}function Qe(){return!ae}function Ye(t,e,n){return pt(Ct(t,e,n),t,e)}const b=Ve.define({combine:t=>t[0]}),ie=G.define(),Ze=Ve.define(),k=H.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ie)&&(t=n.value);for(let n of e.state.facet(Ze))t=n(t,e);return t}});function vt(t){let e=t.field(k,!1);if(!e)return null;let n=t.facet(b);return{chunks:e,side:n?n.side:null}}class O{constructor(e,n,l,i,r,s=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=s}offset(e,n){return e||n?new O(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Ye(e.toString(),n.toString(),l);return Xe(i,e,n,0,0,Qe())}static updateA(e,n,l,i,r){return be(Be(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return be(Be(e,i,!1,n.length),e,n,l,r)}}function xe(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function we(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Xe(t,e,n,l,i,r){let s=[];for(let o=0;o<t.length;o++){let f=t[o],[h,a]=xe(f.fromA+l,f.fromB+i,e,n),[d,c]=we(f.toA+l,f.toB+i,e,n),u=[f.offset(-h+l,-a+i)];for(;o<t.length-1;){let m=t[o+1],[p,g]=xe(m.fromA+l,m.fromB+i,e,n);if(p>d+1&&g>c+1)break;u.push(m.offset(-h+l,-a+i)),[d,c]=we(m.toA+l,m.toB+i,e,n),o++}s.push(new O(u,h,Math.max(h,d),a,Math.max(a,c),r))}return s}const z=1e3;function ke(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let a=0,d=0;i&&({toA:a,toB:d}=t[i-1]);let c=e-(n?a:d);return[a+c,d+c]}let s=i+r>>1,o=t[s],[f,h]=n?[o.fromA,o.toA]:[o.fromB,o.toB];if(f>e)r=s;else if(h<=e)i=s+1;else return l?[o.fromA,o.fromB]:[o.toA,o.toB]}}function Be(t,e,n,l){let i=[];return e.iterChangedRanges((r,s,o,f)=>{let h=0,a=n?e.length:l,d=0,c=n?l:e.length;r>z&&([h,d]=ke(t,r-z,n,!0)),s<e.length-z&&([a,c]=ke(t,s+z,n,!1));let u=f-o-(s-r),m,[p,g]=n?[u,0]:[0,u];i.length&&(m=i[i.length-1]).toA>=h?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:a,toB:c,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:h,toA:a,fromB:d,toB:c,diffA:p,diffB:g})}),i}function be(t,e,n,l,i){if(!t.length)return e;let r=[];for(let s=0,o=0,f=0,h=0;;s++){let a=s==t.length?null:t[s],d=a?a.fromA+o:n.length,c=a?a.fromB+f:l.length;for(;h<e.length;){let g=e[h];if(a&&(g.toA+o>d||g.toB+f>c))break;r.push(g.offset(o,f)),h++}if(!a)break;let u=a.toA+o+a.diffA,m=a.toB+f+a.diffB,p=Ye(n.sliceString(d,u),l.sliceString(c,m),i);for(let g of Xe(p,n,l,d,c,Qe()))r.push(g);for(o+=a.diffA,f+=a.diffB;h<e.length;){let g=e[h];if(g.fromA+o>u&&g.fromB+f>m)break;h++}}return r}const et={scanLimit:500},Z=ot.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Le(t))}update(t){(t.docChanged||t.viewportChanged||At(t.startState,t.state)||xt(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Le(t.view))}},{decorations:t=>t.deco}),P=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty}}));function At(t,e){return t.field(k,!1)!=e.field(k,!1)}function xt(t,e){return t.facet(b)!=e.facet(b)}const Me=M.line({class:"cm-changedLine"}),tt=M.mark({class:"cm-changedText"}),wt=M.mark({tagName:"ins",class:"cm-insertedLine"}),kt=M.mark({tagName:"del",class:"cm-deletedLine"}),De=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Bt(t,e,n,l,i,r){let s=n?t.fromA:t.fromB,o=n?t.toA:t.toB,f=0;if(s!=o){i.add(s,s,Me),i.add(s,o,n?kt:wt),r&&r.add(s,s,De);for(let h=e.iterRange(s,o-1),a=s;!h.next().done;){if(h.lineBreak){a++,i.add(a,a,Me),r&&r.add(a,a,De);continue}let d=a+h.value.length;if(l)for(;f<t.changes.length;){let c=t.changes[f],u=s+(n?c.fromA:c.fromB),m=s+(n?c.toA:c.toB),p=Math.max(a,u),g=Math.min(d,m);if(p<g&&i.add(p,g,tt),m<d)f++;else break}a=d}}}function Le(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(b),s=n=="a",o=new N,f=i?new N:null,{from:h,to:a}=t.viewport;for(let d of e){if((s?d.fromA:d.fromB)>=a)break;(s?d.toA:d.toB)>h&&(!r||!r(t.state,d,o,f))&&Bt(d,t.state.doc,s,l,o,f)}return{deco:o.finish(),gutter:f&&f.finish()}}class q extends Y{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const K=G.define({map:(t,e)=>t.map(e)}),W=H.define({create:()=>M.none,update:(t,e)=>{for(let n of e.effects)if(n.is(K))return n.value;return t.map(e.changes)},provide:t=>B.decorations.from(t)}),_=.01;function Se(t,e){if(t.size!=e.size)return!1;let n=t.iter(),l=e.iter();for(;n.value;){if(n.from!=l.from||Math.abs(n.value.spec.widget.height-l.value.spec.widget.height)>1)return!1;n.next(),l.next()}return!0}function bt(t,e,n){let l=new N,i=new N,r=t.state.field(W).iter(),s=e.state.field(W).iter(),o=0,f=0,h=0,a=0,d=t.viewport,c=e.viewport;for(let g=0;;g++){let C=g<n.length?n[g]:null,S=C?C.fromA:t.state.doc.length,R=C?C.fromB:e.state.doc.length;if(o<S){let x=t.lineBlockAt(o).top+h,D=e.lineBlockAt(f).top+a,w=x-D;w<-_?(h-=w,l.add(o,o,M.widget({widget:new q(-w),block:!0,side:-1}))):w>_&&(a+=w,i.add(f,f,M.widget({widget:new q(w),block:!0,side:-1})))}if(S>o+1e3&&o<d.from&&S>d.from&&f<c.from&&R>c.from){let x=Math.min(d.from-o,c.from-f);o+=x,f+=x,g--}else if(C)o=C.toA,f=C.toB;else break;for(;r.value&&r.from<o;)h-=r.value.spec.widget.height,r.next();for(;s.value&&s.from<f;)a-=s.value.spec.widget.height,s.next()}for(;r.value;)h-=r.value.spec.widget.height,r.next();for(;s.value;)a-=s.value.spec.widget.height,s.next();let u=t.contentHeight+h-(e.contentHeight+a);u<_?l.add(t.state.doc.length,t.state.doc.length,M.widget({widget:new q(-u),block:!0,side:1})):u>_&&i.add(e.state.doc.length,e.state.doc.length,M.widget({widget:new q(u),block:!0,side:1}));let m=l.finish(),p=i.finish();Se(m,t.state.field(W))||t.dispatch({effects:K.of(m)}),Se(p,e.state.field(W))||e.dispatch({effects:K.of(p)})}const le=G.define({map:(t,e)=>e.mapPos(t)});class Mt extends Y{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:le.of(i)});let{side:r,sibling:s}=e.state.facet(b);s&&s().dispatch({effects:le.of(Dt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Dt(t,e,n){let l=0,i=0;for(let r=0;;r++){let s=r<e.length?e[r]:null;if(!s||(n?s.fromA:s.fromB)>=t)return i+(t-l);[l,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const Lt=H.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(le)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(b).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>B.decorations.from(t)});function se({margin:t=3,minSize:e=4}){return Lt.init(n=>St(n,t,e))}function St(t,e,n){let l=new N,i=t.facet(b).side=="a",r=t.field(k),s=1;for(let o=0;;o++){let f=o<r.length?r[o]:null,h=o?s+e:1,a=f?t.doc.lineAt(i?f.fromA:f.fromB).number-1-e:t.doc.lines,d=a-h+1;if(d>=n&&l.add(t.doc.line(h).from,t.doc.line(a).to,M.replace({widget:new Mt(d),block:!0})),!f)break;s=t.doc.lineAt(Math.min(t.doc.length,i?f.toA:f.toB)).number}return l.finish()}const Ot=B.styleModule.of(new st({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),nt=B.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),Oe=new Ge,$=new Ge;class Et{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||et;let n=[Q.low(Z),nt,Ot,W,B.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(c=>c.effects.some(u=>u.is(K)))&&this.measure()})],l=[b.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&l.push(P);let i=ne.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],B.editorAttributes.of({class:"cm-merge-a"}),$.of(l),n]}),r=[b.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&r.push(P);let s=ne.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],B.editorAttributes.of({class:"cm-merge-b"}),$.of(r),n]});this.chunks=O.build(i.doc,s.doc,this.diffConf);let o=[k.init(()=>this.chunks),Oe.of(e.collapseUnchanged?se(e.collapseUnchanged):[])];i=i.update({effects:G.appendConfig.of(o)}).state,s=s.update({effects:G.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let f=e.orientation||"a-b",h=document.createElement("div");h.className="cm-mergeViewEditor";let a=document.createElement("div");a.className="cm-mergeViewEditor",this.editorDOM.appendChild(f=="a-b"?h:a),this.editorDOM.appendChild(f=="a-b"?a:h),this.a=new B({state:i,parent:h,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.a)}),this.b=new B({state:s,parent:a,root:e.root,dispatchTransactions:d=>this.dispatch(d,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,n){if(e.some(l=>l.docChanged)){let l=e[e.length-1],i=e.reduce((s,o)=>s.compose(o.changes),Ne.empty(e[0].startState.doc.length));this.chunks=n==this.a?O.updateA(this.chunks,l.newDoc,this.b.state.doc,i,this.diffConf):O.updateB(this.chunks,this.a.state.doc,l.newDoc,i,this.diffConf),n.update([...e,l.state.update({effects:ie.of(this.chunks)})]);let r=n==this.a?this.b:this.a;r.update([r.state.update({effects:ie.of(this.chunks)})]),this.scheduleMeasure()}else n.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let r=e.orientation!="b-a";if(r!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,o=this.b.dom.parentNode;s.remove(),o.remove(),this.editorDOM.insertBefore(r?s:o,this.editorDOM.firstChild),this.editorDOM.appendChild(r?o:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let r=!!this.revertDOM,s=this.revertToA,o=this.renderRevert;"revertControls"in e&&(r=!!e.revertControls,s=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(r,s,o)}let n="highlightChanges"in e,l="gutter"in e,i="collapseUnchanged"in e;if(n||l||i){let r=[],s=[];if(n||l){let o=this.a.state.facet(b),f=l?e.gutter!==!1:o.markGutter,h=n?e.highlightChanges!==!1:o.highlightChanges;r.push($.reconfigure([b.of({side:"a",sibling:()=>this.b,highlightChanges:h,markGutter:f}),f?P:[]])),s.push($.reconfigure([b.of({side:"b",sibling:()=>this.a,highlightChanges:h,markGutter:f}),f?P:[]]))}if(i){let o=Oe.reconfigure(e.collapseUnchanged?se(e.collapseUnchanged):[]);r.push(o),s.push(o)}this.a.dispatch({effects:r}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(e,n,l){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=l,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){bt(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,n=e.firstChild,l=this.a.viewport,i=this.b.viewport;for(let r=0;r<this.chunks.length;r++){let s=this.chunks[r];if(s.fromA>l.to||s.fromB>i.to)break;if(s.fromA<l.from||s.fromB<i.from)continue;let o=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<r;)n=Ee(n);n&&n.dataset.chunk==String(r)?(n.style.top!=o&&(n.style.top=o),n=n.nextSibling):e.insertBefore(this.renderRevertButton(o,r),n)}for(;n;)n=Ee(n)}renderRevertButton(e,n){let l;if(this.renderRevert)l=this.renderRevert();else{l=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");l.setAttribute("aria-label",i),l.setAttribute("title",i),l.textContent=this.revertToLeft?"⇜":"⇝"}return l.style.top=e,l.setAttribute("data-chunk",String(n)),l}revertClicked(e){let n=e.target,l;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(l=this.chunks[n.dataset.chunk])){let[i,r,s,o,f,h]=this.revertToA?[this.b,this.a,l.fromB,l.toB,l.fromA,l.toA]:[this.a,this.b,l.fromA,l.toA,l.fromB,l.toB],a=i.state.sliceDoc(s,Math.max(s,o-1));s!=o&&h<=r.state.doc.length&&(a+=i.state.lineBreak),r.dispatch({changes:{from:f,to:Math.min(r.state.doc.length,h),insert:a},userEvent:"revert"}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function Ee(t){let e=t.nextSibling;return t.remove(),e}const yt=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Rt=Q.low(je({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(Z))===null||e===void 0?void 0:e.gutter)||Ie.empty},widgetMarker:(t,e)=>e instanceof rt?yt:null}));function Tt(t){var e;let n=typeof t.original=="string"?Fe.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||et;return[Q.low(Z),Vt,nt,B.editorAttributes.of({class:"cm-merge-b"}),Ze.of((i,r)=>{let s=r.effects.find(o=>o.is(he));return s&&(i=O.updateA(i,s.value.doc,r.startState.doc,s.value.changes,l)),r.docChanged&&(i=O.updateB(i,r.state.field(V),r.newDoc,r.changes,l)),i}),b.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?Wt:void 0,side:"b"}),V.init(()=>n),t.gutter!==!1?Rt:[],t.collapseUnchanged?se(t.collapseUnchanged):[],k.init(i=>O.build(n,i.doc,l))]}const he=G.define(),V=H.define({create:()=>Fe.empty,update(t,e){for(let n of e.effects)n.is(he)&&(t=n.value.doc);return t}}),ye=new WeakMap;class rt extends Y{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function Gt(t,e,n){let l=ye.get(e.changes);if(l)return l;let i=s=>{let{highlightChanges:o,syntaxHighlightDeletions:f,syntaxHighlightDeletionsMaxLength:h,mergeControls:a}=t.facet(b),d=document.createElement("div");if(d.className="cm-deletedChunk",a){let x=d.appendChild(document.createElement("div"));x.className="cm-chunkButtons";let D=A=>{A.preventDefault(),Nt(s,s.posAtDOM(d))},w=A=>{A.preventDefault(),Ft(s,s.posAtDOM(d))};if(typeof a=="function")x.appendChild(a("accept",D)),x.appendChild(a("reject",w));else{let A=x.appendChild(document.createElement("button"));A.name="accept",A.textContent=t.phrase("Accept"),A.onmousedown=D;let L=x.appendChild(document.createElement("button"));L.name="reject",L.textContent=t.phrase("Reject"),L.onmousedown=w}}if(n||e.fromA>=e.toA)return d;let c=s.state.field(V).sliceString(e.fromA,e.endA),u=f&&t.facet(at),m=S(),p=e.changes,g=0,C=!1;function S(){let x=d.appendChild(document.createElement("div"));return x.className="cm-deletedLine",x.appendChild(document.createElement("del"))}function R(x,D,w){for(let A=x;A<D;){if(c.charAt(A)==`
2
2
  `){m.firstChild||m.appendChild(document.createElement("br")),m=S(),A++;continue}let L=D,ce=w+(C?" cm-deletedText":""),ue=!1,X=c.indexOf(`
3
3
  `,A);if(X>-1&&X<D&&(L=X),o&&g<p.length){let j=Math.max(0,C?p[g].toA:p[g].fromA);j<=L&&(L=j,C&&g++,ue=!0)}if(L>A){let j=document.createTextNode(c.slice(A,L));if(ce){let me=m.appendChild(document.createElement("span"));me.className=ce,me.appendChild(j)}else m.appendChild(j);A=L}ue&&(C=!C)}}if(u&&e.toA-e.fromA<=h){let x=u.parser.parse(c),D=0;ft(x,{style:w=>dt(t,w)},(w,A,L)=>{w>D&&R(D,w,""),R(w,A,L),D=A}),R(D,c.length,"")}else R(0,c.length,"");return m.firstChild||m.appendChild(document.createElement("br")),d},r=M.widget({block:!0,side:-1,widget:new rt(i)});return ye.set(e.changes,r),r}function Nt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(f=>f.fromB<=l&&f.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),s=t.state.field(V);i.fromB!=i.toB&&i.toA<=s.length&&(r+=t.state.lineBreak);let o=Ne.of({from:i.fromA,to:Math.min(s.length,i.toA),insert:r},s.length);return t.dispatch({effects:he.of({doc:o.apply(s),changes:o}),userEvent:"accept"}),!0}function Ft(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(o=>o.fromB<=l&&o.endB>=l);if(!i)return!1;let s=n.field(V).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(s+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:s},userEvent:"revert"}),!0}function Re(t){let e=new N;for(let n of t.field(k)){let l=t.facet(b).overrideChunk&&it(t,n);e.add(n.fromB,n.fromB,Gt(t,n,!!l))}return e.finish()}const Vt=H.define({create:t=>Re(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?Re(e.state):t},provide:t=>B.decorations.from(t)}),Te=new WeakMap;function it(t,e){let n=Te.get(e);if(n!==void 0)return n;n=null;let l=t.field(V),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,s=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==s&&r<10){let o=[],f=0,h=e.fromA,a=e.fromB;for(let d of e.changes){if(d.fromA<d.toA){f+=d.toA-d.fromA;let c=l.sliceString(h+d.fromA,h+d.toA);if(/\n/.test(c))break e;o.push(M.widget({widget:new jt(c),side:-1}).range(a+d.fromB))}d.fromB<d.toB&&o.push(tt.range(a+d.fromB,a+d.toB))}f<e.endA-e.fromA-r*2&&(n=o)}return Te.set(e,n),n}class jt extends Y{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const It=new class extends oe{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Ut=M.line({class:"cm-inlineChangedLine"});function Wt(t,e,n,l){let i=it(t,e),r=0;if(!i)return!1;for(let s=t.doc.lineAt(e.fromB);;){for(l&&l.add(s.from,s.from,It),n.add(s.from,s.from,Ut);r<i.length&&i[r].to<=s.to;){let o=i[r++];n.add(o.from,o.to,o.value)}if(s.to>=e.endB)break;s=t.doc.lineAt(s.to+1)}return!0}function Ht(t){const[e,n]=T.useState([]);return T.useEffect(()=>{let l=!1;const i=ht.matchFilename(ct,t);if(!i){n([]);return}return i.load().then(r=>{l||n([r])}).catch(()=>{l||n([])}),()=>{l=!0}},[t]),e}function Kt({baseline:t,current:e,theme:n,filename:l,sideBySide:i,onRejectHunk:r,onHunkCountChange:s}){const o=Ht(l);return i?J.jsx(Pt,{baseline:t,current:e,theme:n,languageExtension:o}):J.jsx(zt,{baseline:t,current:e,theme:n,languageExtension:o,onRejectHunk:r,onHunkCountChange:s})}function zt({baseline:t,current:e,theme:n,languageExtension:l,onRejectHunk:i,onHunkCountChange:r}){const s=T.useRef(-1),o=T.useMemo(()=>[B.lineWrapping,Tt({original:t,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),...l],[t,l]);return J.jsx(lt,{value:e,editable:!1,readOnly:!0,theme:n,height:"100%",className:"desktop:select-text h-full text-sm",extensions:o,basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},onChange:f=>i(f),onUpdate:f=>{var a;const h=((a=vt(f.state))==null?void 0:a.chunks.length)??null;h!==null&&h!==s.current&&(s.current=h,r(h))}})}function Pt({baseline:t,current:e,theme:n,languageExtension:l}){const i=T.useRef(null);return T.useEffect(()=>{const r=i.current;if(!r)return;const s=[B.editable.of(!1),ne.readOnly.of(!0),B.lineWrapping,...n==="dark"?[qt()]:[],...l],o=new Et({a:{doc:t,extensions:s},b:{doc:e,extensions:s},parent:r,collapseUnchanged:{margin:3,minSize:4},highlightChanges:!0,gutter:!0});return()=>o.destroy()},[t,e,n,l]),J.jsx("div",{ref:i,className:"cm-diff-split h-full overflow-auto text-sm"})}function qt(){return B.theme({"&":{backgroundColor:"transparent",color:"inherit"}},{dark:!0})}export{Kt as CodeMirrorDiff};
@@ -1 +1 @@
1
- import{r as n,j as f}from"./index-DpSk7iO1.js";import{R as l}from"./index-DyFf2nbN.js";import{m as a,n as c,E as x}from"./index-Dxkj6c9m.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
1
+ import{r as n,j as f}from"./index-DMYBI16t.js";import{R as l}from"./index-D3DXMH4x.js";import{m as a,n as c,E as x}from"./index-DR1JT9Uz.js";function j({value:u,editable:t,filename:i,languageHint:e,theme:h,onChange:m}){const[g,r]=n.useState([]);return n.useEffect(()=>{let s=!1;const o=e?a.matchLanguageName(c,e,!0):a.matchFilename(c,i);if(!o){r([]);return}return o.load().then(p=>{s||r([p])}).catch(()=>{s||r([])}),()=>{s=!0}},[i,e]),f.jsx(l,{value:u,editable:t,readOnly:!t,onChange:m,theme:h,height:"100%",className:"desktop:select-text h-full text-sm",extensions:[x.lineWrapping,...g],basicSetup:{highlightActiveLine:t,highlightActiveLineGutter:t}})}export{j as CodeMirrorEditor};
@@ -0,0 +1 @@
1
+ import{Z as u,j as s,e as x,$ as g,B as o,a0 as h,a1 as p,a2 as l,a3 as m,a4 as j,a5 as N,a6 as f}from"./index-DMYBI16t.js";const v={agent:"From the agent",this_chat:"Only in this chat"};function A({agentId:n,onManage:e}){var i;const a=u(n);if(a.isPending)return s.jsx(x,{className:"h-24 w-full rounded-lg"});if(a.isError)return s.jsx(g,{title:"Couldn’t load account access",description:"Nothing changed. Try again.",onRetry:()=>void a.refetch(),isRetrying:a.isFetching});const c=((i=a.data)==null?void 0:i.connections)??[];return s.jsxs("section",{"aria-labelledby":"agent-account-access",className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{id:"agent-account-access",className:"text-sm font-semibold",children:"Account access"}),s.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Accounts this agent can use."})]}),e&&s.jsxs(o,{variant:"ghost",size:"sm",onClick:e,children:["Manage",s.jsx(h,{className:"size-3.5","aria-hidden":!0})]})]}),c.length===0?s.jsxs("div",{className:"bg-muted/40 rounded-lg p-4 text-sm",children:[s.jsx("p",{className:"font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Give access from the Connections page."})]}):s.jsx("ul",{className:"space-y-1.5",children:c.map(t=>{const r=t.readiness.state==="ready";return s.jsxs("li",{"data-testid":`agent-connection-${t.connectionId}`,className:"bg-muted/40 flex min-h-11 items-center gap-3 rounded-lg px-3 py-2",children:[s.jsx(p,{iconKey:t.toolkit,displayName:l(t.toolkit),className:"size-7"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"truncate text-sm font-medium",children:[l(t.toolkit)," (",t.label,")"]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.operationRevisionIds.length," approved"," ",t.operationRevisionIds.length===1?"action":"actions",t.everyAgent&&" · given to every agent"]})]}),s.jsx(m,{size:"xs",variant:r?"secondary":"outline",title:r?void 0:t.readiness.copy.owner,children:r?"Available":"Unavailable"})]},t.connectionId)})})]})}const y="This only affects this chat. Turning an app back on never adds access.",C="Couldn’t change access for this chat. Try again.";function b(n){return(n==null?void 0:n.code)==="session_access_other_agent"?n.message:C}function I({sessionId:n,onManage:e,emptyAction:a,footer:c}){var r;const i=j(n);if(i.isPending)return s.jsx(x,{className:"h-16 w-full rounded-lg"});if(i.isError)return s.jsxs("section",{"data-testid":"session-connectors",className:"space-y-2",children:[s.jsx("p",{role:"alert",className:"text-destructive px-1 text-xs",children:"Couldn’t load account access."}),s.jsx(o,{variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]});const t=((r=i.data)==null?void 0:r.connections)??[];return s.jsxs("section",{"data-testid":"session-connectors","aria-labelledby":"session-account-access",className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[s.jsx("h3",{id:"session-account-access",className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Connections"}),e&&s.jsxs(o,{variant:"ghost",size:"xs",onClick:e,children:["Manage agent access",s.jsx(h,{className:"size-3","aria-hidden":!0})]})]}),t.length===0?s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md px-2.5 py-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"No account access"}),s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"Ask this agent to request the access it needs."})]}),a]}):s.jsxs(s.Fragment,{children:[t.some(d=>d.thisChat)&&s.jsx("p",{className:"text-muted-foreground px-1 pb-1 text-xs",children:y}),t.map(d=>s.jsx(S,{sessionId:n,connection:d},d.connectionId))]}),t.length>0&&c]})}function S({sessionId:n,connection:e}){const a=N(n),c=e.readiness.state==="ready",i=`${l(e.toolkit)} (${e.label})`;return s.jsxs("div",{"data-testid":`session-connection-${e.connectionId}`,"data-reason":e.readiness.reason,className:"bg-muted/40 rounded-md px-2.5 py-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-sm font-medium",children:i}),s.jsx(m,{size:"xs",variant:c?"secondary":"outline",children:c?v[e.source]:"Not available"})]}),s.jsx("p",{className:c?"text-muted-foreground mt-1 text-xs":"text-status-warning-fg mt-1 text-xs",children:c?`${e.operationRevisionIds.length} ${e.operationRevisionIds.length===1?"action":"actions"} available in this chat.`:e.readiness.copy.owner})]}),e.thisChat&&s.jsx(f,{"aria-label":`${i} in this chat`,"data-testid":`session-connection-switch-${e.connectionId}`,checked:e.thisChat==="on",disabled:a.isPending,onCheckedChange:t=>a.mutate({connectionId:e.connectionId,on:t}),className:"mt-0.5 shrink-0"})]}),a.isError&&e.thisChat&&s.jsx("p",{role:"alert",className:"text-destructive mt-1 text-xs",children:b(a.error)})]})}export{A,I as S};
@@ -1,11 +1,11 @@
1
- import{ec as U,af as J,c$ as K,r as c,et as Q,aG as X,j as e,al as I,aO as Y,W as F,ct as ee,cu as se,cv as te,eu as ae,ev as ne,B as E,ew as ie,ex as ce,ey as R,aF as re,ez as oe,eA as L,eB as de,eC as le,eD as me,eE as ue,eF as pe,eG as xe,eH as he,eI as ge,eJ as fe,eK as je,eL as ye,eM as ve,P as Ne,eN as Ce,eO as be,eP as Te,eQ as Ie,eR as we,eS as Ae,eT as Se,eU as G,cT as N,eV as ke,eW as De,eX as Re,eY as Me,eZ as $,u as Pe,a as Ee}from"./index-DpSk7iO1.js";import{A as ze}from"./ConnectionAccessLists-BWuegEtZ.js";import{A as _,a as P,b as Be}from"./AdapterIcon-CiK683Vv.js";import"./agent-browser-Bn5EG403.js";/**
1
+ import{Y as q,Q as Y,U as Z,r,fx as J,aV as K,j as e,aa as I,be as X,a3 as F,cr as ee,cs as se,ct as te,fy as ae,fz as ne,B as E,fA as ie,fB as re,fC as R,aU as ce,fD as oe,fE as L,fF as de,fG as le,fH as me,fI as ue,fJ as pe,fK as xe,fL as he,fM as ge,fN as fe,fO as je,fP as ye,fQ as ve,f as Ne,fR as Ce,fS as be,fT as Te,fU as Ie,fV as V,W as N,fW as Ae,fX as we,fY as Se,b as ke,e as De}from"./index-DMYBI16t.js";import{A as Re}from"./ConnectionAccessLists-PW1uzcGU.js";import{u as Me}from"./use-delete-binding-CZVeHqn0.js";import{u as Pe,A as Ee}from"./AdapterSetupWizard-C8HOvHLF.js";import{u as ze}from"./use-external-adapter-catalog-B0gcY-k7.js";import{A as _,a as P,b as Be}from"./AdapterIcon-CL-MyyKy.js";import{R as $}from"./radio-B8Ozjv9U.js";import"./agent-browser-CCN16ZOz.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const V={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};V.node;const Oe=U(V);/**
6
+ */const G={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};G.node;const Oe=q(G);/**
7
7
  * @license lucide-react v1.48.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const Z={name:"plug-2",size:24,node:[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0Z",key:"wtfw2c"}]]};Z.node;const _e=U(Z);function Fe(){const a=J();return K({mutationFn:i=>a.testBinding(i),meta:{errorLabel:"Couldn’t test the connection"}})}const Le={connected:P.connected,disconnected:Y.warning,error:P.error,connecting:P.starting};function $e(a){const i=[];return a.canInitiate&&i.push("Can start conversations"),a.canReply||i.push("Can’t reply"),a.canReceive||i.push("Can’t receive"),i.join(" · ")}function We({binding:a,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:g,lastMessageAt:d,onTogglePause:f,onTest:n,onEdit:m,onRemove:u}){const[t,o]=c.useState(!1),[j,v]=c.useState(!1),p=a.enabled===!1,[w,A]=c.useState(0);c.useEffect(()=>{if(!d||p)return;const C=setInterval(()=>A(s=>s+1),6e4);return()=>clearInterval(C)},[d,p]);const z=g?`${i} · ${g}`:i,S=Q({sessionStrategy:a.sessionStrategy,chatDisplayName:g,channelType:a.channelType}),k=a.canInitiate||!a.canReply||!a.canReceive,B=k?$e(a):"",D=c.useMemo(()=>p?"Paused: no messages delivered":d?`Last received ${X(d).toLowerCase()}`:"No recent activity",[p,d,w]),O=async()=>{v(!0);try{await n()}finally{v(!1)}};return e.jsxs("div",{className:I("relative rounded-xl border px-4 py-3 transition-colors",x==="error"&&!p&&"border-red-500/50 bg-red-500/[0.02]",p&&"opacity-60"),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:y,adapterType:l,size:32}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2",p?"bg-muted-foreground/40":Le[x])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:z}),p&&e.jsx(F,{variant:"secondary",children:"Paused"})]}),p?e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D}):x==="error"&&h?e.jsx("p",{className:"text-destructive text-xs",children:h}):e.jsxs(e.Fragment,{children:[S&&e.jsx("p",{className:"text-muted-foreground truncate text-xs italic",children:S}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D})]})]}),k&&e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsx(F,{variant:"outline",children:"Restricted"})}),e.jsx(te,{children:B})]}),e.jsxs(ae,{children:[e.jsx(ne,{asChild:!0,children:e.jsxs(E,{variant:"ghost",size:"icon-md",responsive:!1,className:"h-8 w-8 shrink-0",children:[e.jsx(ie,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Actions"})]})}),e.jsxs(ce,{align:"end",children:[e.jsxs(R,{onClick:O,disabled:j||p,children:[j?e.jsx(re,{className:"mr-2"}):e.jsx(oe,{className:"mr-2 size-(--size-icon-sm)"}),"Send test"]}),e.jsx(L,{}),e.jsx(R,{onClick:()=>f(!a.enabled),children:p?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"mr-2 size-4"}),"Resume"]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"mr-2 size-4"}),"Pause"]})}),e.jsx(L,{}),e.jsx(R,{onClick:m,children:"Edit"}),e.jsx(R,{onClick:()=>o(!0),className:"text-destructive focus:text-destructive",children:"Remove"})]})]})]}),e.jsx(le,{open:t,onOpenChange:o,children:e.jsxs(me,{children:[e.jsxs(ue,{children:[e.jsxs(pe,{children:["Remove the ",i," connection?"]}),e.jsx(xe,{children:"This agent stops getting messages from it."})]}),e.jsxs(he,{children:[e.jsx(ge,{children:"Cancel"}),e.jsx(fe,{onClick:()=>{u(),o(!1)},className:"bg-red-600 hover:bg-red-700",children:"Remove connection"})]})]})})]})}function qe({binding:a,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,onTogglePause:g,onTest:d,onEdit:f,onRemove:n}){const{data:m=[]}=je(a.adapterId),u=a.chatId?m.find(j=>j.chatId===a.chatId):void 0,t=(u==null?void 0:u.displayName)??(a.chatId?`#${a.chatId.slice(-4)}`:void 0),o=c.useMemo(()=>{if(u)return u.lastMessageAt;if(m.length!==0)return m.reduce((j,v)=>v.lastMessageAt>j?v.lastMessageAt:j,m[0].lastMessageAt)},[u,m]);return e.jsx(We,{binding:a,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:t,lastMessageAt:o,onTogglePause:g,onTest:d,onEdit:f,onRemove:n})}function W({catalog:a,boundAdapterIds:i,onSelectIntegration:y,onRequestSetup:l,disabled:x}){const[h,g]=c.useState(!1),d=c.useMemo(()=>a.flatMap(t=>t.instances.map(o=>({id:o.id,displayName:o.status.displayName??t.manifest.displayName,label:o.label,state:o.status.state,isDisabled:o.status.state==="error"||!o.enabled,alreadyBound:i.has(o.id),iconId:t.manifest.iconId,adapterType:t.manifest.type}))),[a,i]),f=c.useMemo(()=>a.filter(t=>!t.manifest.deprecated&&(t.instances.length===0||t.manifest.multiInstance)),[a]);function n(t){y(t),g(!1)}function m(t){g(!1),l(t)}const u=d.length===0&&f.length===0;return e.jsxs(ye,{open:h,onOpenChange:g,children:[e.jsx(ve,{asChild:!0,children:e.jsxs(E,{variant:"outline",size:"sm",disabled:x,children:[e.jsx(Ne,{className:"mr-1.5 size-3.5"}),"Add connection"]})}),e.jsx(Ce,{className:"w-72 p-0",align:"start",children:e.jsx("div",{className:"max-h-64 overflow-y-auto",children:u?e.jsx("div",{className:"px-3 py-4 text-center",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"No connections available"})}):e.jsxs(e.Fragment,{children:[d.length>0&&e.jsx("div",{className:"py-1",children:d.map(t=>e.jsxs("button",{disabled:t.isDisabled||t.alreadyBound,onClick:()=>n(t.id),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:t.iconId,adapterType:t.adapterType,size:20,className:"text-muted-foreground"}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-[1.5px]",P[t.state])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate font-medium",children:t.displayName}),t.label&&e.jsx("p",{className:"text-muted-foreground truncate text-xs",children:t.label})]}),e.jsx("span",{className:"text-muted-foreground/60 text-xs",children:t.alreadyBound?"Connected":Be[t.state]})]},t.id))}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"text-muted-foreground px-3 py-1 text-xs font-medium",children:"Available to set up"}),f.map(t=>e.jsxs("button",{onClick:()=>m(t.manifest),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent"),children:[e.jsx(_,{iconId:t.manifest.iconId,adapterType:t.manifest.type,size:14,className:"text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate font-medium",children:t.manifest.displayName})]},t.manifest.type))]})]})]})})})]})}const M={open:!1,binding:null,adapterName:""},q={open:!1};function Ue({agent:a}){const i=be(),{data:y=[]}=Te(),{data:l=[]}=Ie(i),x=we(),h=Ae(),g=Fe(),d=Se(),f=G(),[n,m]=c.useState(M),[u,t]=c.useState(q),o=y.filter(s=>s.agentId===a.id),j=c.useMemo(()=>{const s=new Map;for(const r of l)for(const b of r.instances){const T=b.status.state,H=T==="connected"||T==="error"?T:T==="starting"||T==="stopping"||T==="reconnecting"?"connecting":"disconnected";s.set(b.id,{state:H,name:b.status.displayName??r.manifest.displayName,iconId:r.manifest.iconId,adapterType:r.manifest.type,errorMessage:b.status.lastError??void 0})}return s},[l]),v=c.useCallback(s=>j.get(s)??{state:"disconnected",name:s,adapterType:s},[j]),p=c.useMemo(()=>new Set(o.map(s=>s.adapterId)),[o]),w=c.useCallback(async s=>{try{await x.mutateAsync({adapterId:s,agentId:a.id,sessionStrategy:"per-chat",label:"",canInitiate:!1,canReply:!0,canReceive:!0}),N.success("Connection added")}catch{}},[a.id,x]),A=c.useCallback(s=>{t({open:!0,manifest:s})},[]),z=c.useCallback(s=>{m({open:!0,binding:s,adapterName:v(s.adapterId).name})},[v]),S=c.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed")}catch{}},[h]),k=c.useCallback(async(s,r)=>{try{await d.mutateAsync({id:s,updates:{enabled:r}}),N.success(r?"Connection resumed":"Connection paused")}catch{}},[d]),B=c.useCallback(async s=>{const r=await g.mutateAsync(s);return r.ok?N.success(`Test message delivered in ${r.latencyMs}ms`):N.error(r.reason?`Test message didn’t arrive: ${r.reason}`:"Test message didn’t arrive. Try again."),r},[g]),D=c.useCallback(async s=>{if(n.binding)try{await d.mutateAsync({id:n.binding.id,updates:ke(s)}),N.success("Connection updated"),m(M)}catch{}},[n.binding,d]),O=c.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed"),m(M)}catch{}},[h]),C=e.jsxs(e.Fragment,{children:[n.binding&&e.jsx(De,{open:n.open,onOpenChange:s=>{s||m(M)},mode:"edit",initialValues:{adapterId:n.binding.adapterId,agentId:n.binding.agentId,sessionStrategy:n.binding.sessionStrategy,label:n.binding.label,permissionMode:n.binding.permissionMode,chatId:n.binding.chatId,channelType:n.binding.channelType,canInitiate:n.binding.canInitiate,canReply:n.binding.canReply,canReceive:n.binding.canReceive,notifyOnTaskComplete:n.binding.notifyOnTaskComplete},adapterName:n.adapterName,agentName:Re(a),bindingId:n.binding.id,onConfirm:D,onDelete:O,isPending:d.isPending||h.isPending}),u.manifest&&e.jsx(Me,{open:u.open,onOpenChange:s=>{s||t(q)},manifest:u.manifest,existingAdapterIds:l.flatMap(s=>s.instances.map(r=>r.id))})]});return i?l.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"No connections available"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Add Telegram, Slack or a webhook, then connect it here."})]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>f(),children:"Add a connection"})]}),C]}):o.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Message this agent from anywhere"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Connect a chat app to message it while you’re away."})]}),e.jsx(W,{catalog:l,boundAdapterIds:p,onSelectIntegration:w,onRequestSetup:A,disabled:x.isPending})]}),C]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"space-y-2",children:o.map(s=>{const r=v(s.adapterId);return e.jsx(qe,{binding:s,integrationName:r.name,integrationIconId:r.iconId,integrationAdapterType:r.adapterType,adapterState:r.state,errorMessage:r.errorMessage,onTogglePause:b=>k(s.id,b),onTest:()=>B(s.id),onEdit:()=>z(s),onRemove:()=>S(s.id)},s.id)})}),e.jsx(W,{catalog:l,boundAdapterIds:p,onSelectIntegration:w,onRequestSetup:A,disabled:x.isPending}),C]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx(_e,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Chat apps are off"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Turn them on in Connections to reach this agent from chat."})]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>f(),children:"Open Connections"})]}),C]})}function Je({member:a}){const{agent:i,isPending:y}=Pe(a),l=G();return y?e.jsx(Ee,{className:"h-32 w-full"}):i?e.jsxs("div",{className:"space-y-6",children:[e.jsx(ze,{agentId:i.id,onManage:()=>l()}),e.jsxs("section",{"aria-labelledby":"agent-messaging-access",className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"agent-messaging-access",className:"text-sm font-semibold",children:"Messaging"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Places where people can reach this agent."})]}),e.jsx(Ue,{agent:i})]})]}):e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s connections."})}export{Je as ConnectionsPage};
11
+ */const H={name:"plug-2",size:24,node:[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0Z",key:"wtfw2c"}]]};H.node;const _e=q(H);function Fe(){const a=Y();return Z({mutationFn:i=>a.testBinding(i),meta:{errorLabel:"Couldn’t test the connection"}})}const Le={connected:P.connected,disconnected:X.warning,error:P.error,connecting:P.starting};function $e(a){const i=[];return a.canInitiate&&i.push("Can start conversations"),a.canReply||i.push("Can’t reply"),a.canReceive||i.push("Can’t receive"),i.join(" · ")}function Ue({binding:a,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:g,lastMessageAt:d,onTogglePause:f,onTest:n,onEdit:m,onRemove:u}){const[t,o]=r.useState(!1),[j,v]=r.useState(!1),p=a.enabled===!1,[A,w]=r.useState(0);r.useEffect(()=>{if(!d||p)return;const C=setInterval(()=>w(s=>s+1),6e4);return()=>clearInterval(C)},[d,p]);const z=g?`${i} · ${g}`:i,S=J({sessionStrategy:a.sessionStrategy,chatDisplayName:g,channelType:a.channelType}),k=a.canInitiate||!a.canReply||!a.canReceive,B=k?$e(a):"",D=r.useMemo(()=>p?"Paused: no messages delivered":d?`Last received ${K(d).toLowerCase()}`:"No recent activity",[p,d,A]),O=async()=>{v(!0);try{await n()}finally{v(!1)}};return e.jsxs("div",{className:I("relative rounded-xl border px-4 py-3 transition-colors",x==="error"&&!p&&"border-red-500/50 bg-red-500/[0.02]",p&&"opacity-60"),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:y,adapterType:l,size:32}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2",p?"bg-muted-foreground/40":Le[x])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:z}),p&&e.jsx(F,{variant:"secondary",children:"Paused"})]}),p?e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D}):x==="error"&&h?e.jsx("p",{className:"text-destructive text-xs",children:h}):e.jsxs(e.Fragment,{children:[S&&e.jsx("p",{className:"text-muted-foreground truncate text-xs italic",children:S}),e.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:D})]})]}),k&&e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsx(F,{variant:"outline",children:"Restricted"})}),e.jsx(te,{children:B})]}),e.jsxs(ae,{children:[e.jsx(ne,{asChild:!0,children:e.jsxs(E,{variant:"ghost",size:"icon-md",responsive:!1,className:"h-8 w-8 shrink-0",children:[e.jsx(ie,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Actions"})]})}),e.jsxs(re,{align:"end",children:[e.jsxs(R,{onClick:O,disabled:j||p,children:[j?e.jsx(ce,{className:"mr-2"}):e.jsx(oe,{className:"mr-2 size-(--size-icon-sm)"}),"Send test"]}),e.jsx(L,{}),e.jsx(R,{onClick:()=>f(!a.enabled),children:p?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"mr-2 size-4"}),"Resume"]}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"mr-2 size-4"}),"Pause"]})}),e.jsx(L,{}),e.jsx(R,{onClick:m,children:"Edit"}),e.jsx(R,{onClick:()=>o(!0),className:"text-destructive focus:text-destructive",children:"Remove"})]})]})]}),e.jsx(le,{open:t,onOpenChange:o,children:e.jsxs(me,{children:[e.jsxs(ue,{children:[e.jsxs(pe,{children:["Remove the ",i," connection?"]}),e.jsx(xe,{children:"This agent stops getting messages from it."})]}),e.jsxs(he,{children:[e.jsx(ge,{children:"Cancel"}),e.jsx(fe,{onClick:()=>{u(),o(!1)},className:"bg-red-600 hover:bg-red-700",children:"Remove connection"})]})]})})]})}function We({binding:a,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,onTogglePause:g,onTest:d,onEdit:f,onRemove:n}){const{data:m=[]}=je(a.adapterId),u=a.chatId?m.find(j=>j.chatId===a.chatId):void 0,t=(u==null?void 0:u.displayName)??(a.chatId?`#${a.chatId.slice(-4)}`:void 0),o=r.useMemo(()=>{if(u)return u.lastMessageAt;if(m.length!==0)return m.reduce((j,v)=>v.lastMessageAt>j?v.lastMessageAt:j,m[0].lastMessageAt)},[u,m]);return e.jsx(Ue,{binding:a,integrationName:i,integrationIconId:y,integrationAdapterType:l,adapterState:x,errorMessage:h,chatDisplayName:t,lastMessageAt:o,onTogglePause:g,onTest:d,onEdit:f,onRemove:n})}function U({catalog:a,boundAdapterIds:i,onSelectIntegration:y,onRequestSetup:l,disabled:x}){const[h,g]=r.useState(!1),d=r.useMemo(()=>a.flatMap(t=>t.instances.map(o=>({id:o.id,displayName:o.status.displayName??t.manifest.displayName,label:o.label,state:o.status.state,isDisabled:o.status.state==="error"||!o.enabled,alreadyBound:i.has(o.id),iconId:t.manifest.iconId,adapterType:t.manifest.type}))),[a,i]),f=r.useMemo(()=>a.filter(t=>!t.manifest.deprecated&&(t.instances.length===0||t.manifest.multiInstance)),[a]);function n(t){y(t),g(!1)}function m(t){g(!1),l(t)}const u=d.length===0&&f.length===0;return e.jsxs(ye,{open:h,onOpenChange:g,children:[e.jsx(ve,{asChild:!0,children:e.jsxs(E,{variant:"outline",size:"sm",disabled:x,children:[e.jsx(Ne,{className:"mr-1.5 size-3.5"}),"Add connection"]})}),e.jsx(Ce,{className:"w-72 p-0",align:"start",children:e.jsx("div",{className:"max-h-64 overflow-y-auto",children:u?e.jsx("div",{className:"px-3 py-4 text-center",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"No connections available"})}):e.jsxs(e.Fragment,{children:[d.length>0&&e.jsx("div",{className:"py-1",children:d.map(t=>e.jsxs("button",{disabled:t.isDisabled||t.alreadyBound,onClick:()=>n(t.id),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"),children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx(_,{iconId:t.iconId,adapterType:t.adapterType,size:20,className:"text-muted-foreground"}),e.jsx("span",{className:I("ring-background absolute -right-0.5 -bottom-0.5 size-1.5 rounded-full ring-[1.5px]",P[t.state])})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate font-medium",children:t.displayName}),t.label&&e.jsx("p",{className:"text-muted-foreground truncate text-xs",children:t.label})]}),e.jsx("span",{className:"text-muted-foreground/60 text-xs",children:t.alreadyBound?"Connected":Be[t.state]})]},t.id))}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t"}),e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"text-muted-foreground px-3 py-1 text-xs font-medium",children:"Available to set up"}),f.map(t=>e.jsxs("button",{onClick:()=>m(t.manifest),className:I("flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors","hover:bg-accent"),children:[e.jsx(_,{iconId:t.manifest.iconId,adapterType:t.manifest.type,size:14,className:"text-muted-foreground shrink-0"}),e.jsx("span",{className:"truncate font-medium",children:t.manifest.displayName})]},t.manifest.type))]})]})]})})})]})}const M={open:!1,binding:null,adapterName:""},W={open:!1};function qe({agent:a}){const i=be(),{data:y=[]}=Te(),{data:l=[]}=ze(i),x=Ie(),h=Me(),g=Fe(),d=Pe(),f=V(),[n,m]=r.useState(M),[u,t]=r.useState(W),o=y.filter(s=>s.agentId===a.id),j=r.useMemo(()=>{const s=new Map;for(const c of l)for(const b of c.instances){const T=b.status.state,Q=T==="connected"||T==="error"?T:T==="starting"||T==="stopping"||T==="reconnecting"?"connecting":"disconnected";s.set(b.id,{state:Q,name:b.status.displayName??c.manifest.displayName,iconId:c.manifest.iconId,adapterType:c.manifest.type,errorMessage:b.status.lastError??void 0})}return s},[l]),v=r.useCallback(s=>j.get(s)??{state:"disconnected",name:s,adapterType:s},[j]),p=r.useMemo(()=>new Set(o.map(s=>s.adapterId)),[o]),A=r.useCallback(async s=>{try{await x.mutateAsync({adapterId:s,agentId:a.id,sessionStrategy:"per-chat",label:"",canInitiate:!1,canReply:!0,canReceive:!0}),N.success("Connection added")}catch{}},[a.id,x]),w=r.useCallback(s=>{t({open:!0,manifest:s})},[]),z=r.useCallback(s=>{m({open:!0,binding:s,adapterName:v(s.adapterId).name})},[v]),S=r.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed")}catch{}},[h]),k=r.useCallback(async(s,c)=>{try{await d.mutateAsync({id:s,updates:{enabled:c}}),N.success(c?"Connection resumed":"Connection paused")}catch{}},[d]),B=r.useCallback(async s=>{const c=await g.mutateAsync(s);return c.ok?N.success(`Test message delivered in ${c.latencyMs}ms`):N.error(c.reason?`Test message didn’t arrive: ${c.reason}`:"Test message didn’t arrive. Try again."),c},[g]),D=r.useCallback(async s=>{if(n.binding)try{await d.mutateAsync({id:n.binding.id,updates:Ae(s)}),N.success("Connection updated"),m(M)}catch{}},[n.binding,d]),O=r.useCallback(async s=>{try{await h.mutateAsync(s),N.success("Connection removed"),m(M)}catch{}},[h]),C=e.jsxs(e.Fragment,{children:[n.binding&&e.jsx(we,{open:n.open,onOpenChange:s=>{s||m(M)},mode:"edit",initialValues:{adapterId:n.binding.adapterId,agentId:n.binding.agentId,sessionStrategy:n.binding.sessionStrategy,label:n.binding.label,permissionMode:n.binding.permissionMode,chatId:n.binding.chatId,channelType:n.binding.channelType,canInitiate:n.binding.canInitiate,canReply:n.binding.canReply,canReceive:n.binding.canReceive,notifyOnTaskComplete:n.binding.notifyOnTaskComplete},adapterName:n.adapterName,agentName:Se(a),bindingId:n.binding.id,onConfirm:D,onDelete:O,isPending:d.isPending||h.isPending}),u.manifest&&e.jsx(Ee,{open:u.open,onOpenChange:s=>{s||t(W)},manifest:u.manifest,existingAdapterIds:l.flatMap(s=>s.instances.map(c=>c.id))})]});return i?l.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"No connections available"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Add Telegram, Slack or a webhook, then connect it here."})]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>f(),children:"Add a connection"})]}),C]}):o.length===0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx($,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Message this agent from anywhere"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Connect a chat app to message it while you’re away."})]}),e.jsx(U,{catalog:l,boundAdapterIds:p,onSelectIntegration:A,onRequestSetup:w,disabled:x.isPending})]}),C]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"space-y-2",children:o.map(s=>{const c=v(s.adapterId);return e.jsx(We,{binding:s,integrationName:c.name,integrationIconId:c.iconId,integrationAdapterType:c.adapterType,adapterState:c.state,errorMessage:c.errorMessage,onTogglePause:b=>k(s.id,b),onTest:()=>B(s.id),onEdit:()=>z(s),onRemove:()=>S(s.id)},s.id)})}),e.jsx(U,{catalog:l,boundAdapterIds:p,onSelectIntegration:A,onRequestSetup:w,disabled:x.isPending}),C]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed px-6 py-10",children:[e.jsx(_e,{className:"text-muted-foreground/40 size-8"}),e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx("p",{className:"text-sm font-medium",children:"Chat apps are off"}),e.jsx("p",{className:"text-muted-foreground max-w-xs text-xs leading-relaxed",children:"Turn them on in Connections to reach this agent from chat."})]}),e.jsx(E,{variant:"outline",size:"sm",onClick:()=>f(),children:"Open Connections"})]}),C]})}function Xe({member:a}){const{agent:i,isPending:y}=ke(a),l=V();return y?e.jsx(De,{className:"h-32 w-full"}):i?e.jsxs("div",{className:"space-y-6",children:[e.jsx(Re,{agentId:i.id,onManage:()=>l()}),e.jsxs("section",{"aria-labelledby":"agent-messaging-access",className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"agent-messaging-access",className:"text-sm font-semibold",children:"Messaging"}),e.jsx("p",{className:"text-muted-foreground mt-0.5 text-xs",children:"Places where people can reach this agent."})]}),e.jsx(qe,{agent:i})]})]}):e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s connections."})}export{Xe as ConnectionsPage};
@@ -0,0 +1,11 @@
1
+ import{r as u,j as s,cw as R,cx as k,cy as I,cz as P,a6 as $,aa as m,cA as D,cB as F,C as Y,cC as B,cD as G,L as b,cE as v,cF as W,cG as z,cH as p,cI as U,cJ as X,cK as H,cL as K,cM as V,b as J,cN as Z,e as q,cO as Q,B as ee,W as te}from"./index-DMYBI16t.js";import"./agent-browser-CCN16ZOz.js";import{d as ne,A as se}from"./untrusted-text-1hXdPgLA.js";import{s as w}from"./soul-file-pg0ShYy3.js";function oe({title:e,content:t,enabled:n,maxChars:o,charCount:a,disclaimer:d,onChange:r,onBlur:i,onToggle:x,fill:c=!1}){const h=u.useCallback(C=>{r(C.target.value)},[r]);return s.jsx(R,{className:m(!n&&"opacity-60",c&&"flex min-h-0 flex-1 flex-col"),children:s.jsxs(k,{className:m(c&&"flex min-h-0 flex-1 flex-col"),children:[s.jsxs(I,{orientation:"horizontal",className:"items-center justify-between",children:[s.jsx(P,{className:"text-sm font-medium",children:e}),s.jsx($,{checked:n,onCheckedChange:x,"aria-label":`Toggle ${e}`})]}),d&&s.jsx("p",{className:"text-muted-foreground text-xs italic",children:d}),s.jsxs("div",{className:m("space-y-2",c&&"flex min-h-0 flex-1 flex-col"),children:[s.jsx("textarea",{value:t,onChange:h,onBlur:i,rows:c?void 0:8,maxLength:o,className:m("border-border bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring w-full resize-none rounded-md border px-3 py-2 font-mono text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",c&&"min-h-40 flex-1"),placeholder:n?"Write markdown here…":"Turn this on to use it"}),s.jsxs("p",{className:"text-muted-foreground text-right text-xs",children:[a??t.length," / ",o.toLocaleString()]})]})]})})}const _="[new code each turn]",ae=[...new Set([...Object.values(H),...se,"system-reminder"])];function re(e){const t=e.length>v,n=t?e.slice(0,v):e,o=ne(n,ae);return["<agent_memory>",W,z,`--- BEGIN ${p} ${_} ---`,U,...t?[X]:[],o,`--- END ${p} ${_} ---`,"</agent_memory>"].join(`
2
+ `)}function ie(e){var o;const n=[`<agent_identity>
3
+ ${[`Name: ${e.name}`,`ID: ${e.id}`,e.description?`Description: ${e.description}`:null,(o=e.capabilities)!=null&&o.length?`Capabilities: ${e.capabilities.join(", ")}`:null].filter(a=>a!==null).join(`
4
+ `)}
5
+ </agent_identity>`];if(e.conventions.soul){const a=e.soulContent.includes(G)?w(e.traits,b(e.soulContent)):e.soulContent;a.trim()&&n.push(`<agent_persona>
6
+ ${a}
7
+ </agent_persona>`)}return e.conventions.nope&&e.nopeContent.trim()&&n.push(`<agent_safety_boundaries>
8
+ ${e.nopeContent}
9
+ </agent_safety_boundaries>`),e.conventions.memory&&e.memoryContent.trim()&&n.push(re(e.memoryContent)),n.join(`
10
+
11
+ `)}function ce(e){const[t,n]=u.useState(!1),o=u.useMemo(()=>ie(e),[e]);return s.jsxs(D,{open:t,onOpenChange:n,"data-slot":"profile-injection-preview",children:[s.jsxs(F,{className:"focus-ring text-muted-foreground hover:text-foreground flex items-center gap-1 rounded-md py-1 text-xs transition-colors",children:[s.jsx(Y,{"aria-hidden":!0,className:m("size-3.5 transition-transform",t&&"rotate-90")}),"Preview what ",e.displayName," will see"]}),s.jsx(B,{children:s.jsx("pre",{"data-testid":"injected-prompt","data-slot":"profile-injection-preview-text",className:"bg-muted text-muted-foreground mt-1 max-h-56 overflow-auto rounded-md p-3 text-xs whitespace-pre-wrap",children:s.jsx("code",{children:o})})})]})}const le="These guide your agent but aren’t enforced. Treat them as strong instructions.",ue="Anything here can come up in any chat. Never keep secrets, passwords or keys here.",de="Your agent writes notes here as it works.",me=["Each note says where it was written.","Deleting a line makes your agent forget it."];function S(e,t){return w(e.traits,t)}const N={instructions:{title:"Custom instructions (SOUL.md)",errorLabel:"Couldn’t save your instructions",key:"soul",maxChars:V,read:e=>b(e.soulContent??""),write:(e,t)=>({soulContent:S(e,t)}),count:(e,t)=>S(e,t).length},boundaries:{title:"Safety boundaries (NOPE.md)",errorLabel:"Couldn’t save your boundaries",key:"nope",maxChars:K,disclaimer:le,read:e=>e.nopeContent??"",write:(e,t)=>({nopeContent:t}),count:(e,t)=>t.length},memory:{title:"Agent memory (MEMORY.md)",errorLabel:"Couldn’t save your agent’s memory",key:"memory",maxChars:v,disclaimer:ue,note:de,details:me,read:e=>e.memoryContent??"",write:(e,t)=>({memoryContent:t}),count:(e,t)=>t.length}};function xe(e){const t=Math.max(0,Date.now()-e),n=Math.floor(t/6e4);return n<1?"Saved just now":n<60?`Saved ${n}m ago`:`Saved ${Math.floor(n/60)}h ago`}function he(e,t,n,o){if(e>0){const a=t>0?`. The personality block takes ${t.toLocaleString()} of them`:"";return`Too long by ${e.toLocaleString()} character${e===1?"":"s"}${a}`}return n?"Unsaved changes":o!==null?xe(o):""}function j({member:e,file:t}){const{agent:n,isPending:o,isSaving:a,update:d}=J(e,{errorLabel:t.errorLabel}),r=n?t.read(n):"",[i,x]=u.useState(r),[c,h]=u.useState(r),[C,M]=u.useState(r),[T,L]=u.useState(null),g=i!==c;if(C!==r&&(M(r),g||(x(r),h(r))),Z(g),o)return s.jsx(q,{className:"h-40 w-full"});if(!n)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this file."});const y=n.conventions??{soul:!0,nope:!0,memory:!0,dorkosKnowledge:!0},E=t.count(n,i),f=E-t.maxChars,A=E-i.length;function O(){if(!n||f>0)return;const l=i;d(t.write(n,l),()=>{h(l),L(Date.now()),te.success("Saved")})}return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2","data-slot":"profile-convention",children:[s.jsx(oe,{fill:!0,title:t.title,content:i,enabled:y[t.key],maxChars:t.maxChars,charCount:E,disclaimer:t.disclaimer,onChange:x,onToggle:l=>d({conventions:{...y,[t.key]:l}})}),t.note&&s.jsx("p",{className:"text-muted-foreground shrink-0 text-xs",children:t.note}),t.details&&s.jsx(Q,{className:"shrink-0",children:t.details.map(l=>s.jsx("p",{children:l},l))}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx("span",{"data-slot":"profile-convention-status",className:f>0?"text-destructive text-xs":"text-muted-foreground text-xs",children:he(f,A,g,T)}),s.jsx(ee,{size:"sm",className:"ml-auto",disabled:!g||f>0||a,onClick:O,children:"Save"})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(ce,{name:n.name,displayName:n.displayName||n.name,id:n.id,description:n.description,capabilities:n.capabilities,traits:n.traits,conventions:y,soulContent:n.soulContent??"",nopeContent:n.nopeContent??"",memoryContent:n.memoryContent??"",...t.write(n,i)})})]})}function Ee(e){return s.jsx(j,{...e,file:N.instructions})}function ve(e){return s.jsx(j,{...e,file:N.boundaries})}function Ne(e){return s.jsx(j,{...e,file:N.memory})}export{ve as BoundariesPage,Ee as InstructionsPage,Ne as MemoryPage};
@@ -0,0 +1,6 @@
1
+ import{Y as L,r as h,j as n,dT as E,B as k,dU as j,fm as N,ak as P,fn as _,ee as $,fo as I,fp as u,am as w,e as g,dR as v}from"./index-DMYBI16t.js";import{P as x}from"./page-container-W7byjRmk.js";import{a as R}from"./use-dev-links-Df2WkCic.js";import{U}from"./UnlinkDialog-3p38G_9q.js";/**
2
+ * @license lucide-react v1.48.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const y={name:"package-x",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16.5 14.5 5 5",key:"ozpm51"}],["path",{d:"m16.5 19.5 5-5",key:"syf6b9"}],["path",{d:"M21 10.5V8a2 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.729l7 4a2 2 0 0 0 2 .001l.13-.074",key:"isw6gs"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};y.node;const S=L(y),A=new Set(["invalid","incompatible","compile_error","activate_error"]);function M(e,a,i,o=!1){if(e.match!==null)return{kind:"page",at:{...e,match:e.match}};if(!i||o)return{kind:"loading"};const s=a.find(r=>r.id===e.extensionId);if(!s)return{kind:"not-installed",name:e.extensionId};const t=s.manifest.name;return A.has(s.status)?{kind:"broken",name:t}:s.status==="disabled"?{kind:"turned-off",name:t}:s.approvedToRun?{kind:"no-page",name:t}:{kind:"not-allowed",name:t}}function C(e){return Object.fromEntries(new URLSearchParams(e))}function O(e){let a=null;return async i=>{const{pathname:o,searchStr:s}=e.latestLocation,t=a!==null&&a.pathname===o?a.searchStr:s,r=new URLSearchParams(t);for(const[d,m]of Object.entries(i))m===null?r.delete(d):r.set(d,m);const l=r.toString(),p=l?`?${l}`:"",c={pathname:o,searchStr:p};a=c;try{await e.navigate({href:`${o}${p}`,replace:!0})}finally{a===c&&(a=null)}}}const z=400;function D(e){const i=e.kind!=="page"&&e.kind!=="loading"?`${e.kind}:${e.name}`:null,[o,s]=h.useState(null);return h.useEffect(()=>{if(i===null)return;const t=setTimeout(()=>s(i),z);return()=>clearTimeout(t)},[i]),i!==null&&o!==i?{kind:"loading"}:e}const K="/marketplace?view=installed";function B({extension:e}){var r;const{data:a}=R(),[i,o]=h.useState(null),s=(r=e.devLink)==null?void 0:r.path;if(!s)return null;const t=a==null?void 0:a.links.find(l=>l.path===s&&l.name===e.sourcePlugin);return n.jsxs("div",{"data-testid":"extension-page-dev-link",className:"bg-muted/40 flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b px-4 py-1.5",children:[n.jsx(E,{path:s,className:"min-w-0 flex-1"}),a?t!=null&&t.parked?n.jsx(k,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>o({name:t.name,scope:t.scope,...t.projectPath!==void 0&&{projectPath:t.projectPath},parked:!0}),children:"Use installed copy"}):n.jsx(k,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>void j(K),children:"Unlink or switch"}):null,n.jsx(U,{target:i,onClose:()=>o(null)})]})}const X={kind:"not-installed",name:"This add-on"},q="?settings=extensions";function Q(){const e=N(),a=P(),i=_(e.pathname),{extensions:o,ready:s,settling:t}=$(),r=h.useMemo(()=>C(e.searchStr),[e.searchStr]),l=h.useMemo(()=>O(a),[a]),p=h.useMemo(()=>d=>void l(d),[l]),c=D(i?M(i,o,s,t):X);if(c.kind==="page"){const{page:d,params:m}=c.at.match,f=o.find(T=>T.id===c.at.extensionId),b=d.component;return n.jsx(I,{resetKeys:[e.pathname],fallback:n.jsx(V,{name:d.title}),children:n.jsxs("div",{"data-testid":"extension-page",className:"h-full min-h-0 overflow-y-auto",children:[(f==null?void 0:f.devLink)&&n.jsx(B,{extension:f}),n.jsx(b,{params:m,search:r,setSearch:p})]})},d.id)}return c.kind==="loading"?n.jsx(F,{}):n.jsx(x,{width:"reading",children:n.jsx(Y,{state:c})})}function F(){return n.jsx(x,{width:"wide",children:n.jsxs("div",{"data-testid":"extension-page-skeleton","aria-busy":"true",className:"space-y-4",children:[n.jsx("span",{className:"sr-only",children:"Loading this page"}),n.jsx(g,{className:"h-6 w-40"}),n.jsx(g,{className:"h-4 w-full max-w-md"}),n.jsx(g,{className:"h-24 w-full"}),n.jsx(g,{className:"h-24 w-full"})]})})}function V({name:e}){return n.jsx(x,{width:"reading",children:n.jsx(u,{icon:w,tone:"destructive",headingLevel:2,headline:`${e} ran into a problem`,description:"Reloading the page may fix it.",action:{label:"Reload",variant:"outline",onClick:()=>window.location.reload()}})})}function Y({state:e}){const a={onClick:()=>void j(q)};switch(e.kind){case"not-installed":return n.jsx(u,{icon:S,headingLevel:2,headline:"This page isn’t available",description:`${e.name} isn’t installed.`});case"not-allowed":return n.jsx(u,{icon:v,headingLevel:2,headline:"This page isn’t available yet",description:`${e.name} isn’t allowed to run yet.`,action:{label:"Allow it",...a}});case"turned-off":return n.jsx(u,{icon:v,headingLevel:2,headline:"This page isn’t available",description:`${e.name} is turned off.`,action:{label:"Turn it on",...a}});case"broken":return n.jsx(u,{icon:w,tone:"destructive",headingLevel:2,headline:"This page isn’t available",description:`${e.name} couldn’t start. Settings says why.`,action:{label:"Open Settings",variant:"outline",...a}});case"no-page":return n.jsx(u,{icon:S,headingLevel:2,headline:"This page isn’t available",description:`${e.name} doesn’t have this page.`})}}export{Q as E};
@@ -1 +1 @@
1
- import{c as X,a as Z,b as j,d as C,D as Je,m as De,s as Ke,i as ze,e as Ve,f as U,g as Qe,t as je,h as We,j as t}from"./index-BE54c4kA.js";import{n as Re,t as Xe,r as Ze,BaseTanStackRouterDevtoolsPanel as et}from"./BaseTanStackRouterDevtoolsPanel-B-iktbLX-Bmlsorom.js";import{ar as Ae}from"./index-DpSk7iO1.js";var tt=je('<svg xmlns=http://www.w3.org/2000/svg enable-background="new 0 0 634 633"viewBox="0 0 634 633"><g transform=translate(1)><linearGradient x1=-641.486 x2=-641.486 y1=856.648 y2=855.931 gradientTransform="matrix(633 0 0 -633 406377 542258)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#6bdaff></stop><stop offset=0.319 stop-color=#f9ffb5></stop><stop offset=0.706 stop-color=#ffa770></stop><stop offset=1 stop-color=#ff7373></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5 fill-rule=evenodd clip-rule=evenodd></circle><defs><filter width=454 height=396.9 x=-137.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=176.9 height=129.3 x=272.2 y=308 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=176.9 height=129.3 x=272.2 y=308 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><path fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11 d="M436 403.2l-5 28.6m-140-90.3l-10.9 62m52.8-19.4l-4.3 27.1"></path><linearGradient x1=-645.656 x2=-646.499 y1=854.878 y2=854.788 gradientTransform="matrix(-184.159 -32.4722 11.4608 -64.9973 -128419.844 34938.836)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ee2700></stop><stop offset=1 stop-color=#ff008e></stop></linearGradient><path fill-rule=evenodd d="M344.1 363l97.7 17.2c5.8 2.1 8.2 6.2 7.1 12.1-1 5.9-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1.8-12.8 3.7-3.7 8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd></path><path fill=#D8D8D8 fill-rule=evenodd stroke=#FFF stroke-linecap=round stroke-linejoin=bevel stroke-width=7 d="M428.3 384.5l.9-6.5m-33.9 1.5l.9-6.5m-34 .5l.9-6.1m-38.9-16.1l4.2-3.9m-25.2-16.1l4.2-3.9"clip-rule=evenodd></path></g><defs><filter width=280.6 height=317.4 x=73.2 y=113.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=280.6 height=317.4 x=73.2 y=113.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><linearGradient x1=-646.8 x2=-646.8 y1=854.844 y2=853.844 gradientTransform="matrix(-100.1751 48.8587 -97.9753 -200.879 19124.773 203538.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#a17500></stop><stop offset=1 stop-color=#5d2100></stop></linearGradient><path fill-rule=evenodd d="M192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.2-2.9 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6-3.4-18.7-10.8-51.8-22.2-99.6l-25.3 4.6"clip-rule=evenodd></path><linearGradient x1=-635.467 x2=-635.467 y1=852.115 y2=851.115 gradientTransform="matrix(92.6873 4.8575 2.0257 -38.6535 57323.695 36176.047)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd></path><linearGradient x1=-636.573 x2=-636.573 y1=855.444 y2=854.444 gradientTransform="matrix(109.9945 5.7646 6.3597 -121.3507 64719.133 107659.336)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.3 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20 49.6-53.1 49.6-53.1z"clip-rule=evenodd></path><linearGradient x1=-632.145 x2=-632.145 y1=854.174 y2=853.174 gradientTransform="matrix(62.9558 3.2994 3.5021 -66.8246 37035.367 59284.227)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9c-.8-21.9 6-38 20.6-48.2 14.6-10.2 29.8-15.3 45.5-15.3-6.1 21.4-14.5 35.8-25.2 43.4-10.7 7.5-24.4 14.2-40.9 20.1z"clip-rule=evenodd></path><linearGradient x1=-638.224 x2=-638.224 y1=853.801 y2=852.801 gradientTransform="matrix(152.4666 7.9904 3.0934 -59.0251 94939.86 55646.855)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c31.9-30 64.1-39.7 96.7-29 32.6 10.7 50.8 30.4 54.6 59.1-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd></path><linearGradient x1=-637.723 x2=-637.723 y1=855.103 y2=854.103 gradientTransform="matrix(136.467 7.1519 5.2165 -99.5377 82830.875 89859.578)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c35.8-7.6 65.6-.2 89.2 22 23.6 22.2 37.7 49 42.3 80.3-39.8-9.7-68.3-23.8-85.5-42.4-17.2-18.5-32.5-38.5-46-59.9z"clip-rule=evenodd></path><linearGradient x1=-631.79 x2=-631.79 y1=855.872 y2=854.872 gradientTransform="matrix(60.8683 3.19 8.7771 -167.4773 31110.818 145537.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6-6.5 29.9-3.6 63.1 8.7 99.6 27.4-40.3 43.2-69.6 47.4-88 4.2-18.3 5.5-44.1 4-77.2z"clip-rule=evenodd></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4-5.7 18-9.4 33-11.1 45.1"></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M194.8 185.7c-24.4 1.7-43.8 9-58.1 21.8-14.3 12.8-24.7 25.4-31.3 37.8m99.1-68.9c29.7-6.7 52-8.4 67-5 15 3.4 26.9 8.7 35.8 15.9m-110.8-5.9c20.3 9.9 38.2 20.5 53.9 31.9 15.7 11.4 27.4 22.1 35.1 32"></path></g><defs><filter width=532 height=633 x=50.5 y=399 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=532 height=633 x=50.5 y=399 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><linearGradient x1=-641.104 x2=-641.278 y1=856.577 y2=856.183 gradientTransform="matrix(532 0 0 -633 341484.5 542657)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#fff400></stop><stop offset=1 stop-color=#3c8700></stop></linearGradient><ellipse cx=316.5 cy=715.5 fill-rule=evenodd clip-rule=evenodd rx=266 ry=316.5></ellipse><defs><filter width=288 height=283 x=391 y=-24 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=288 height=283 x=391 y=-24 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><g transform="translate(397 -24)"><linearGradient x1=-1036.672 x2=-1036.672 y1=880.018 y2=879.018 gradientTransform="matrix(227 0 0 -227 235493 199764)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffdf00></stop><stop offset=1 stop-color=#ff9d00></stop></linearGradient><circle cx=168.5 cy=113.5 r=113.5 fill-rule=evenodd clip-rule=evenodd></circle><linearGradient x1=-1017.329 x2=-1018.602 y1=658.003 y2=657.998 gradientTransform="matrix(30 0 0 -1 30558 771)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M30 113H0"></path><linearGradient x1=-1014.501 x2=-1015.774 y1=839.985 y2=839.935 gradientTransform="matrix(26.5 0 0 -5.5 26925 4696.5)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M33.5 79.5L7 74"></path><linearGradient x1=-1016.59 x2=-1017.862 y1=852.671 y2=852.595 gradientTransform="matrix(29 0 0 -8 29523 6971)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M34 146l-29 8"></path><linearGradient x1=-1011.984 x2=-1013.257 y1=863.523 y2=863.229 gradientTransform="matrix(24 0 0 -13 24339 11407)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M45 177l-24 13"></path><linearGradient x1=-1006.673 x2=-1007.946 y1=869.279 y2=868.376 gradientTransform="matrix(20 0 0 -19 20205 16720)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M67 204l-20 19"></path><linearGradient x1=-992.85 x2=-993.317 y1=871.258 y2=870.258 gradientTransform="matrix(13.8339 0 0 -22.8467 13825.796 20131.938)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M94.4 227l-13.8 22.8"></path><linearGradient x1=-953.835 x2=-953.965 y1=871.9 y2=870.9 gradientTransform="matrix(7.5 0 0 -24.5 7278 21605)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M127.5 243.5L120 268"></path><linearGradient x1=244.504 x2=244.496 y1=871.898 y2=870.898 gradientTransform="matrix(.5 0 0 -24.5 45.5 21614)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M167.5 252.5l.5 24.5">');function Pe(){const e=We();return(()=>{var w=tt(),O=w.firstChild.firstChild,F=O.nextSibling,M=F.nextSibling,L=M.firstChild,v=M.nextSibling,I=v.firstChild,G=v.nextSibling,c=G.nextSibling,x=c.firstChild,p=c.nextSibling,h=p.firstChild,u=p.nextSibling,T=u.nextSibling,H=T.firstChild,g=T.nextSibling,Y=g.firstChild,B=g.nextSibling,S=B.nextSibling,q=S.firstChild,o=S.nextSibling,N=o.firstChild,E=o.nextSibling,D=E.nextSibling,ee=D.firstChild,y=D.nextSibling,te=y.firstChild,b=y.nextSibling,z=b.nextSibling,J=z.firstChild,$=z.nextSibling,K=$.firstChild,R=$.nextSibling,A=R.nextSibling,l=A.firstChild,r=A.nextSibling,d=r.firstChild,n=r.nextSibling,a=n.firstChild.nextSibling,f=a.nextSibling,i=n.nextSibling,s=i.firstChild,m=i.nextSibling,P=m.firstChild,k=m.nextSibling,_=k.firstChild,ie=_.nextSibling,le=ie.nextSibling,re=le.nextSibling,ne=re.nextSibling,oe=ne.nextSibling,se=oe.nextSibling,ae=se.nextSibling,de=ae.nextSibling,fe=de.nextSibling,ce=fe.nextSibling,pe=ce.nextSibling,ue=pe.nextSibling,Le=ue.nextSibling,ge=k.nextSibling,Ie=ge.firstChild,V=ge.nextSibling,He=V.firstChild,xe=V.nextSibling,Q=xe.nextSibling,he=Q.nextSibling,Ye=he.firstChild,W=he.nextSibling,qe=W.firstChild,$e=W.nextSibling,me=$e.firstChild.firstChild,ke=me.nextSibling,ve=ke.nextSibling,Se=ve.nextSibling,ye=Se.nextSibling,be=ye.nextSibling,_e=be.nextSibling,Ce=_e.nextSibling,Ue=Ce.nextSibling,we=Ue.nextSibling,Oe=we.nextSibling,Fe=Oe.nextSibling,Me=Fe.nextSibling,Ge=Me.nextSibling,Te=Ge.nextSibling,Be=Te.nextSibling,Ee=Be.nextSibling,Ne=Ee.nextSibling;return t(O,"id",`a-${e}`),t(F,"fill",`url(#a-${e})`),t(L,"id",`b-${e}`),t(v,"id",`c-${e}`),t(I,"filter",`url(#b-${e})`),t(G,"mask",`url(#c-${e})`),t(x,"id",`d-${e}`),t(p,"id",`e-${e}`),t(h,"filter",`url(#d-${e})`),t(u,"mask",`url(#e-${e})`),t(H,"id",`f-${e}`),t(g,"id",`g-${e}`),t(Y,"filter",`url(#f-${e})`),t(B,"mask",`url(#g-${e})`),t(q,"id",`h-${e}`),t(o,"id",`i-${e}`),t(N,"filter",`url(#h-${e})`),t(E,"mask",`url(#i-${e})`),t(ee,"id",`j-${e}`),t(y,"id",`k-${e}`),t(te,"filter",`url(#j-${e})`),t(b,"mask",`url(#k-${e})`),t(J,"id",`l-${e}`),t($,"id",`m-${e}`),t(K,"filter",`url(#l-${e})`),t(R,"mask",`url(#m-${e})`),t(l,"id",`n-${e}`),t(r,"id",`o-${e}`),t(d,"filter",`url(#n-${e})`),t(n,"mask",`url(#o-${e})`),t(a,"id",`p-${e}`),t(f,"fill",`url(#p-${e})`),t(s,"id",`q-${e}`),t(m,"id",`r-${e}`),t(P,"filter",`url(#q-${e})`),t(k,"mask",`url(#r-${e})`),t(_,"id",`s-${e}`),t(ie,"fill",`url(#s-${e})`),t(le,"id",`t-${e}`),t(re,"fill",`url(#t-${e})`),t(ne,"id",`u-${e}`),t(oe,"fill",`url(#u-${e})`),t(se,"id",`v-${e}`),t(ae,"fill",`url(#v-${e})`),t(de,"id",`w-${e}`),t(fe,"fill",`url(#w-${e})`),t(ce,"id",`x-${e}`),t(pe,"fill",`url(#x-${e})`),t(ue,"id",`y-${e}`),t(Le,"fill",`url(#y-${e})`),t(Ie,"id",`z-${e}`),t(V,"id",`A-${e}`),t(He,"filter",`url(#z-${e})`),t(xe,"id",`B-${e}`),t(Q,"fill",`url(#B-${e})`),t(Q,"mask",`url(#A-${e})`),t(Ye,"id",`C-${e}`),t(W,"id",`D-${e}`),t(qe,"filter",`url(#C-${e})`),t($e,"mask",`url(#D-${e})`),t(me,"id",`E-${e}`),t(ke,"fill",`url(#E-${e})`),t(ve,"id",`F-${e}`),t(Se,"stroke",`url(#F-${e})`),t(ye,"id",`G-${e}`),t(be,"stroke",`url(#G-${e})`),t(_e,"id",`H-${e}`),t(Ce,"stroke",`url(#H-${e})`),t(Ue,"id",`I-${e}`),t(we,"stroke",`url(#I-${e})`),t(Oe,"id",`J-${e}`),t(Fe,"stroke",`url(#J-${e})`),t(Me,"id",`K-${e}`),t(Ge,"stroke",`url(#K-${e})`),t(Te,"id",`L-${e}`),t(Be,"stroke",`url(#L-${e})`),t(Ee,"id",`M-${e}`),t(Ne,"stroke",`url(#M-${e})`),w})()}var it=je("<button type=button><div><div></div><div></div></div><div>-</div><div>TanStack Router");function ot({initialIsOpen:e,panelProps:w={},closeButtonProps:O={},toggleButtonProps:F={},position:M="bottom-left",containerElement:L="footer",router:v,routerState:I,shadowDOMTarget:G}){const[c,x]=X();let p;const[h,u]=Re("tanstackRouterDevtoolsOpen",e),[T,H]=Re("tanstackRouterDevtoolsHeight",null),[g,Y]=X(!1),[B,S]=X(!1),q=Xe(),o=Ze(),N=(l,r)=>{if(r.button!==0)return;S(!0);const d={originalHeight:(l==null?void 0:l.getBoundingClientRect().height)??0,pageY:r.pageY},n=f=>{const i=d.pageY-f.pageY,s=d.originalHeight+i;H(s),s<70?u(!1):u(!0)},a=()=>{S(!1),document.removeEventListener("mousemove",n),document.removeEventListener("mouseUp",a)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)};h(),Z(()=>{Y(h()??!1)}),Z(()=>{var l,r,d;if(g()){const n=(r=(l=c())==null?void 0:l.parentElement)==null?void 0:r.style.paddingBottom,a=()=>{var i;const f=p.getBoundingClientRect().height;(i=c())!=null&&i.parentElement&&x(s=>(s!=null&&s.parentElement&&(s.parentElement.style.paddingBottom=`${f}px`),s))};if(a(),typeof window<"u")return window.addEventListener("resize",a),()=>{var f;window.removeEventListener("resize",a),(f=c())!=null&&f.parentElement&&typeof n=="string"&&x(i=>(i.parentElement.style.paddingBottom=n,i))}}else(d=c())!=null&&d.parentElement&&x(n=>(n!=null&&n.parentElement&&n.parentElement.removeAttribute("style"),n))}),Z(()=>{if(c()){const l=c(),r=getComputedStyle(l).fontSize;l==null||l.style.setProperty("--tsrd-font-size",r)}});const{style:E={},...D}=w,{style:ee={},onClick:y,...te}=O,{onClick:b,class:z,...J}=F;if(!q())return null;const $=j(()=>T()??500),K=j(()=>Ae(o().devtoolsPanelContainer,o().devtoolsPanelContainerVisibility(!!h()),o().devtoolsPanelContainerResizing(B),o().devtoolsPanelContainerAnimation(g(),$()+16))),R=j(()=>({height:`${$()}px`,...E||{}})),A=j(()=>Ae(o().mainCloseBtn,o().mainCloseBtnPosition(M),o().mainCloseBtnAnimation(!!h()),z));return C(Qe,{component:L,ref:x,class:"TanStackRouterDevtools",get children(){return[C(Je.Provider,{value:{onCloseClick:y??(()=>{})},get children(){return C(et,De({ref(l){var r=p;typeof r=="function"?r(l):p=l}},D,{router:v,routerState:I,className:K,style:R,get isOpen(){return g()},setIsOpen:u,handleDragStart:l=>N(p,l),shadowDOMTarget:G}))}}),(()=>{var l=it(),r=l.firstChild,d=r.firstChild,n=d.nextSibling,a=r.nextSibling,f=a.nextSibling;return Ke(l,De(J,{"aria-label":"Open TanStack Router Devtools",onClick:i=>{u(!0),b&&b(i)},get class(){return A()}}),!1,!0),ze(d,C(Pe,{})),ze(n,C(Pe,{})),Ve(i=>{var s=o().mainCloseBtnIconContainer,m=o().mainCloseBtnIconOuter,P=o().mainCloseBtnIconInner,k=o().mainCloseBtnDivider,_=o().routerLogoCloseButton;return s!==i.e&&U(r,i.e=s),m!==i.t&&U(d,i.t=m),P!==i.a&&U(n,i.a=P),k!==i.o&&U(a,i.o=k),_!==i.i&&U(f,i.i=_),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()]}})}export{ot as FloatingTanStackRouterDevtools,ot as default};
1
+ import{c as X,a as Z,b as j,d as C,D as Je,m as De,s as Ke,i as ze,e as Ve,f as U,g as Qe,t as je,h as We,j as t}from"./index-DgH_dl1a.js";import{n as Re,t as Xe,r as Ze,BaseTanStackRouterDevtoolsPanel as et}from"./BaseTanStackRouterDevtoolsPanel-B-iktbLX-BXjzhT_D.js";import{aC as Ae}from"./index-DMYBI16t.js";var tt=je('<svg xmlns=http://www.w3.org/2000/svg enable-background="new 0 0 634 633"viewBox="0 0 634 633"><g transform=translate(1)><linearGradient x1=-641.486 x2=-641.486 y1=856.648 y2=855.931 gradientTransform="matrix(633 0 0 -633 406377 542258)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#6bdaff></stop><stop offset=0.319 stop-color=#f9ffb5></stop><stop offset=0.706 stop-color=#ffa770></stop><stop offset=1 stop-color=#ff7373></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5 fill-rule=evenodd clip-rule=evenodd></circle><defs><filter width=454 height=396.9 x=-137.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=412 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=412 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=610.5 fill=#015064 fill-rule=evenodd stroke=#00CFE2 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=450 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=450 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=648.5 fill=#015064 fill-rule=evenodd stroke=#00A8B8 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=-137.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=-137.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=89.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=454 height=396.9 x=316.5 y=486 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=454 height=396.9 x=316.5 y=486 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><ellipse cx=543.5 cy=684.5 fill=#015064 fill-rule=evenodd stroke=#007782 stroke-width=25 clip-rule=evenodd rx=214.5 ry=186></ellipse><defs><filter width=176.9 height=129.3 x=272.2 y=308 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=176.9 height=129.3 x=272.2 y=308 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><path fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11 d="M436 403.2l-5 28.6m-140-90.3l-10.9 62m52.8-19.4l-4.3 27.1"></path><linearGradient x1=-645.656 x2=-646.499 y1=854.878 y2=854.788 gradientTransform="matrix(-184.159 -32.4722 11.4608 -64.9973 -128419.844 34938.836)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ee2700></stop><stop offset=1 stop-color=#ff008e></stop></linearGradient><path fill-rule=evenodd d="M344.1 363l97.7 17.2c5.8 2.1 8.2 6.2 7.1 12.1-1 5.9-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1.8-12.8 3.7-3.7 8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd></path><path fill=#D8D8D8 fill-rule=evenodd stroke=#FFF stroke-linecap=round stroke-linejoin=bevel stroke-width=7 d="M428.3 384.5l.9-6.5m-33.9 1.5l.9-6.5m-34 .5l.9-6.1m-38.9-16.1l4.2-3.9m-25.2-16.1l4.2-3.9"clip-rule=evenodd></path></g><defs><filter width=280.6 height=317.4 x=73.2 y=113.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=280.6 height=317.4 x=73.2 y=113.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><linearGradient x1=-646.8 x2=-646.8 y1=854.844 y2=853.844 gradientTransform="matrix(-100.1751 48.8587 -97.9753 -200.879 19124.773 203538.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#a17500></stop><stop offset=1 stop-color=#5d2100></stop></linearGradient><path fill-rule=evenodd d="M192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.2-2.9 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6-3.4-18.7-10.8-51.8-22.2-99.6l-25.3 4.6"clip-rule=evenodd></path><linearGradient x1=-635.467 x2=-635.467 y1=852.115 y2=851.115 gradientTransform="matrix(92.6873 4.8575 2.0257 -38.6535 57323.695 36176.047)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd></path><linearGradient x1=-636.573 x2=-636.573 y1=855.444 y2=854.444 gradientTransform="matrix(109.9945 5.7646 6.3597 -121.3507 64719.133 107659.336)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.3 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20 49.6-53.1 49.6-53.1z"clip-rule=evenodd></path><linearGradient x1=-632.145 x2=-632.145 y1=854.174 y2=853.174 gradientTransform="matrix(62.9558 3.2994 3.5021 -66.8246 37035.367 59284.227)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M195 183.9c-.8-21.9 6-38 20.6-48.2 14.6-10.2 29.8-15.3 45.5-15.3-6.1 21.4-14.5 35.8-25.2 43.4-10.7 7.5-24.4 14.2-40.9 20.1z"clip-rule=evenodd></path><linearGradient x1=-638.224 x2=-638.224 y1=853.801 y2=852.801 gradientTransform="matrix(152.4666 7.9904 3.0934 -59.0251 94939.86 55646.855)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c31.9-30 64.1-39.7 96.7-29 32.6 10.7 50.8 30.4 54.6 59.1-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd></path><linearGradient x1=-637.723 x2=-637.723 y1=855.103 y2=854.103 gradientTransform="matrix(136.467 7.1519 5.2165 -99.5377 82830.875 89859.578)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c35.8-7.6 65.6-.2 89.2 22 23.6 22.2 37.7 49 42.3 80.3-39.8-9.7-68.3-23.8-85.5-42.4-17.2-18.5-32.5-38.5-46-59.9z"clip-rule=evenodd></path><linearGradient x1=-631.79 x2=-631.79 y1=855.872 y2=854.872 gradientTransform="matrix(60.8683 3.19 8.7771 -167.4773 31110.818 145537.61)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#2f8a00></stop><stop offset=1 stop-color=#90ff57></stop></linearGradient><path fill-rule=evenodd stroke=#2F8A00 stroke-width=13 d="M194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6-6.5 29.9-3.6 63.1 8.7 99.6 27.4-40.3 43.2-69.6 47.4-88 4.2-18.3 5.5-44.1 4-77.2z"clip-rule=evenodd></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4-5.7 18-9.4 33-11.1 45.1"></path><path fill=none stroke=#2F8A00 stroke-linecap=round stroke-width=8 d="M194.8 185.7c-24.4 1.7-43.8 9-58.1 21.8-14.3 12.8-24.7 25.4-31.3 37.8m99.1-68.9c29.7-6.7 52-8.4 67-5 15 3.4 26.9 8.7 35.8 15.9m-110.8-5.9c20.3 9.9 38.2 20.5 53.9 31.9 15.7 11.4 27.4 22.1 35.1 32"></path></g><defs><filter width=532 height=633 x=50.5 y=399 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=532 height=633 x=50.5 y=399 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><linearGradient x1=-641.104 x2=-641.278 y1=856.577 y2=856.183 gradientTransform="matrix(532 0 0 -633 341484.5 542657)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#fff400></stop><stop offset=1 stop-color=#3c8700></stop></linearGradient><ellipse cx=316.5 cy=715.5 fill-rule=evenodd clip-rule=evenodd rx=266 ry=316.5></ellipse><defs><filter width=288 height=283 x=391 y=-24 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask width=288 height=283 x=391 y=-24 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#FFF fill-rule=evenodd clip-rule=evenodd></circle></g></mask><g><g transform="translate(397 -24)"><linearGradient x1=-1036.672 x2=-1036.672 y1=880.018 y2=879.018 gradientTransform="matrix(227 0 0 -227 235493 199764)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffdf00></stop><stop offset=1 stop-color=#ff9d00></stop></linearGradient><circle cx=168.5 cy=113.5 r=113.5 fill-rule=evenodd clip-rule=evenodd></circle><linearGradient x1=-1017.329 x2=-1018.602 y1=658.003 y2=657.998 gradientTransform="matrix(30 0 0 -1 30558 771)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M30 113H0"></path><linearGradient x1=-1014.501 x2=-1015.774 y1=839.985 y2=839.935 gradientTransform="matrix(26.5 0 0 -5.5 26925 4696.5)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M33.5 79.5L7 74"></path><linearGradient x1=-1016.59 x2=-1017.862 y1=852.671 y2=852.595 gradientTransform="matrix(29 0 0 -8 29523 6971)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M34 146l-29 8"></path><linearGradient x1=-1011.984 x2=-1013.257 y1=863.523 y2=863.229 gradientTransform="matrix(24 0 0 -13 24339 11407)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M45 177l-24 13"></path><linearGradient x1=-1006.673 x2=-1007.946 y1=869.279 y2=868.376 gradientTransform="matrix(20 0 0 -19 20205 16720)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M67 204l-20 19"></path><linearGradient x1=-992.85 x2=-993.317 y1=871.258 y2=870.258 gradientTransform="matrix(13.8339 0 0 -22.8467 13825.796 20131.938)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M94.4 227l-13.8 22.8"></path><linearGradient x1=-953.835 x2=-953.965 y1=871.9 y2=870.9 gradientTransform="matrix(7.5 0 0 -24.5 7278 21605)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M127.5 243.5L120 268"></path><linearGradient x1=244.504 x2=244.496 y1=871.898 y2=870.898 gradientTransform="matrix(.5 0 0 -24.5 45.5 21614)"gradientUnits=userSpaceOnUse><stop offset=0 stop-color=#ffa400></stop><stop offset=1 stop-color=#ff5e00></stop></linearGradient><path fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12 d="M167.5 252.5l.5 24.5">');function Pe(){const e=We();return(()=>{var w=tt(),O=w.firstChild.firstChild,F=O.nextSibling,M=F.nextSibling,L=M.firstChild,v=M.nextSibling,I=v.firstChild,G=v.nextSibling,c=G.nextSibling,x=c.firstChild,p=c.nextSibling,h=p.firstChild,u=p.nextSibling,T=u.nextSibling,H=T.firstChild,g=T.nextSibling,Y=g.firstChild,B=g.nextSibling,S=B.nextSibling,q=S.firstChild,o=S.nextSibling,N=o.firstChild,E=o.nextSibling,D=E.nextSibling,ee=D.firstChild,y=D.nextSibling,te=y.firstChild,b=y.nextSibling,z=b.nextSibling,J=z.firstChild,$=z.nextSibling,K=$.firstChild,R=$.nextSibling,A=R.nextSibling,l=A.firstChild,r=A.nextSibling,d=r.firstChild,n=r.nextSibling,a=n.firstChild.nextSibling,f=a.nextSibling,i=n.nextSibling,s=i.firstChild,m=i.nextSibling,P=m.firstChild,k=m.nextSibling,_=k.firstChild,ie=_.nextSibling,le=ie.nextSibling,re=le.nextSibling,ne=re.nextSibling,oe=ne.nextSibling,se=oe.nextSibling,ae=se.nextSibling,de=ae.nextSibling,fe=de.nextSibling,ce=fe.nextSibling,pe=ce.nextSibling,ue=pe.nextSibling,Le=ue.nextSibling,ge=k.nextSibling,Ie=ge.firstChild,V=ge.nextSibling,He=V.firstChild,xe=V.nextSibling,Q=xe.nextSibling,he=Q.nextSibling,Ye=he.firstChild,W=he.nextSibling,qe=W.firstChild,$e=W.nextSibling,me=$e.firstChild.firstChild,ke=me.nextSibling,ve=ke.nextSibling,Se=ve.nextSibling,ye=Se.nextSibling,be=ye.nextSibling,_e=be.nextSibling,Ce=_e.nextSibling,Ue=Ce.nextSibling,we=Ue.nextSibling,Oe=we.nextSibling,Fe=Oe.nextSibling,Me=Fe.nextSibling,Ge=Me.nextSibling,Te=Ge.nextSibling,Be=Te.nextSibling,Ee=Be.nextSibling,Ne=Ee.nextSibling;return t(O,"id",`a-${e}`),t(F,"fill",`url(#a-${e})`),t(L,"id",`b-${e}`),t(v,"id",`c-${e}`),t(I,"filter",`url(#b-${e})`),t(G,"mask",`url(#c-${e})`),t(x,"id",`d-${e}`),t(p,"id",`e-${e}`),t(h,"filter",`url(#d-${e})`),t(u,"mask",`url(#e-${e})`),t(H,"id",`f-${e}`),t(g,"id",`g-${e}`),t(Y,"filter",`url(#f-${e})`),t(B,"mask",`url(#g-${e})`),t(q,"id",`h-${e}`),t(o,"id",`i-${e}`),t(N,"filter",`url(#h-${e})`),t(E,"mask",`url(#i-${e})`),t(ee,"id",`j-${e}`),t(y,"id",`k-${e}`),t(te,"filter",`url(#j-${e})`),t(b,"mask",`url(#k-${e})`),t(J,"id",`l-${e}`),t($,"id",`m-${e}`),t(K,"filter",`url(#l-${e})`),t(R,"mask",`url(#m-${e})`),t(l,"id",`n-${e}`),t(r,"id",`o-${e}`),t(d,"filter",`url(#n-${e})`),t(n,"mask",`url(#o-${e})`),t(a,"id",`p-${e}`),t(f,"fill",`url(#p-${e})`),t(s,"id",`q-${e}`),t(m,"id",`r-${e}`),t(P,"filter",`url(#q-${e})`),t(k,"mask",`url(#r-${e})`),t(_,"id",`s-${e}`),t(ie,"fill",`url(#s-${e})`),t(le,"id",`t-${e}`),t(re,"fill",`url(#t-${e})`),t(ne,"id",`u-${e}`),t(oe,"fill",`url(#u-${e})`),t(se,"id",`v-${e}`),t(ae,"fill",`url(#v-${e})`),t(de,"id",`w-${e}`),t(fe,"fill",`url(#w-${e})`),t(ce,"id",`x-${e}`),t(pe,"fill",`url(#x-${e})`),t(ue,"id",`y-${e}`),t(Le,"fill",`url(#y-${e})`),t(Ie,"id",`z-${e}`),t(V,"id",`A-${e}`),t(He,"filter",`url(#z-${e})`),t(xe,"id",`B-${e}`),t(Q,"fill",`url(#B-${e})`),t(Q,"mask",`url(#A-${e})`),t(Ye,"id",`C-${e}`),t(W,"id",`D-${e}`),t(qe,"filter",`url(#C-${e})`),t($e,"mask",`url(#D-${e})`),t(me,"id",`E-${e}`),t(ke,"fill",`url(#E-${e})`),t(ve,"id",`F-${e}`),t(Se,"stroke",`url(#F-${e})`),t(ye,"id",`G-${e}`),t(be,"stroke",`url(#G-${e})`),t(_e,"id",`H-${e}`),t(Ce,"stroke",`url(#H-${e})`),t(Ue,"id",`I-${e}`),t(we,"stroke",`url(#I-${e})`),t(Oe,"id",`J-${e}`),t(Fe,"stroke",`url(#J-${e})`),t(Me,"id",`K-${e}`),t(Ge,"stroke",`url(#K-${e})`),t(Te,"id",`L-${e}`),t(Be,"stroke",`url(#L-${e})`),t(Ee,"id",`M-${e}`),t(Ne,"stroke",`url(#M-${e})`),w})()}var it=je("<button type=button><div><div></div><div></div></div><div>-</div><div>TanStack Router");function ot({initialIsOpen:e,panelProps:w={},closeButtonProps:O={},toggleButtonProps:F={},position:M="bottom-left",containerElement:L="footer",router:v,routerState:I,shadowDOMTarget:G}){const[c,x]=X();let p;const[h,u]=Re("tanstackRouterDevtoolsOpen",e),[T,H]=Re("tanstackRouterDevtoolsHeight",null),[g,Y]=X(!1),[B,S]=X(!1),q=Xe(),o=Ze(),N=(l,r)=>{if(r.button!==0)return;S(!0);const d={originalHeight:(l==null?void 0:l.getBoundingClientRect().height)??0,pageY:r.pageY},n=f=>{const i=d.pageY-f.pageY,s=d.originalHeight+i;H(s),s<70?u(!1):u(!0)},a=()=>{S(!1),document.removeEventListener("mousemove",n),document.removeEventListener("mouseUp",a)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",a)};h(),Z(()=>{Y(h()??!1)}),Z(()=>{var l,r,d;if(g()){const n=(r=(l=c())==null?void 0:l.parentElement)==null?void 0:r.style.paddingBottom,a=()=>{var i;const f=p.getBoundingClientRect().height;(i=c())!=null&&i.parentElement&&x(s=>(s!=null&&s.parentElement&&(s.parentElement.style.paddingBottom=`${f}px`),s))};if(a(),typeof window<"u")return window.addEventListener("resize",a),()=>{var f;window.removeEventListener("resize",a),(f=c())!=null&&f.parentElement&&typeof n=="string"&&x(i=>(i.parentElement.style.paddingBottom=n,i))}}else(d=c())!=null&&d.parentElement&&x(n=>(n!=null&&n.parentElement&&n.parentElement.removeAttribute("style"),n))}),Z(()=>{if(c()){const l=c(),r=getComputedStyle(l).fontSize;l==null||l.style.setProperty("--tsrd-font-size",r)}});const{style:E={},...D}=w,{style:ee={},onClick:y,...te}=O,{onClick:b,class:z,...J}=F;if(!q())return null;const $=j(()=>T()??500),K=j(()=>Ae(o().devtoolsPanelContainer,o().devtoolsPanelContainerVisibility(!!h()),o().devtoolsPanelContainerResizing(B),o().devtoolsPanelContainerAnimation(g(),$()+16))),R=j(()=>({height:`${$()}px`,...E||{}})),A=j(()=>Ae(o().mainCloseBtn,o().mainCloseBtnPosition(M),o().mainCloseBtnAnimation(!!h()),z));return C(Qe,{component:L,ref:x,class:"TanStackRouterDevtools",get children(){return[C(Je.Provider,{value:{onCloseClick:y??(()=>{})},get children(){return C(et,De({ref(l){var r=p;typeof r=="function"?r(l):p=l}},D,{router:v,routerState:I,className:K,style:R,get isOpen(){return g()},setIsOpen:u,handleDragStart:l=>N(p,l),shadowDOMTarget:G}))}}),(()=>{var l=it(),r=l.firstChild,d=r.firstChild,n=d.nextSibling,a=r.nextSibling,f=a.nextSibling;return Ke(l,De(J,{"aria-label":"Open TanStack Router Devtools",onClick:i=>{u(!0),b&&b(i)},get class(){return A()}}),!1,!0),ze(d,C(Pe,{})),ze(n,C(Pe,{})),Ve(i=>{var s=o().mainCloseBtnIconContainer,m=o().mainCloseBtnIconOuter,P=o().mainCloseBtnIconInner,k=o().mainCloseBtnDivider,_=o().routerLogoCloseButton;return s!==i.e&&U(r,i.e=s),m!==i.t&&U(d,i.t=m),P!==i.a&&U(n,i.a=P),k!==i.o&&U(a,i.o=k),_!==i.i&&U(f,i.i=_),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()]}})}export{ot as FloatingTanStackRouterDevtools,ot as default};
@@ -0,0 +1 @@
1
+ import{j as r,q as n}from"./index-DMYBI16t.js";function t({member:e}){return r.jsx(n,{member:e})}export{t as HandlePage};