@kubed.io/cdn 0.0.4 → 0.0.6

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 (430) hide show
  1. package/README.md +11 -0
  2. package/dist/chunks/1c-Cg7z75RR.js +94 -0
  3. package/dist/chunks/1c-Cg7z75RR.js.map +1 -0
  4. package/dist/chunks/abnf-DjOFdYyB.js +59 -0
  5. package/dist/chunks/abnf-DjOFdYyB.js.map +1 -0
  6. package/dist/chunks/accesslog-CT59MCIO.js +72 -0
  7. package/dist/chunks/accesslog-CT59MCIO.js.map +1 -0
  8. package/dist/chunks/actionscript-BF7IWfId.js +85 -0
  9. package/dist/chunks/actionscript-BF7IWfId.js.map +1 -0
  10. package/dist/chunks/ada-BW8u8CRX.js +107 -0
  11. package/dist/chunks/ada-BW8u8CRX.js.map +1 -0
  12. package/dist/chunks/angelscript-2l-XM2Vw.js +91 -0
  13. package/dist/chunks/angelscript-2l-XM2Vw.js.map +1 -0
  14. package/dist/chunks/apache-ClDRwhlj.js +87 -0
  15. package/dist/chunks/apache-ClDRwhlj.js.map +1 -0
  16. package/dist/chunks/applescript-BnCdU8ml.js +57 -0
  17. package/dist/chunks/applescript-BnCdU8ml.js.map +1 -0
  18. package/dist/chunks/arcade-BtIJZuSq.js +157 -0
  19. package/dist/chunks/arcade-BtIJZuSq.js.map +1 -0
  20. package/dist/chunks/arduino-xB3NbW4M.js +272 -0
  21. package/dist/chunks/arduino-xB3NbW4M.js.map +1 -0
  22. package/dist/chunks/armasm-Dg5wPE4N.js +66 -0
  23. package/dist/chunks/armasm-Dg5wPE4N.js.map +1 -0
  24. package/dist/chunks/asciidoc-ZAddoC6x.js +178 -0
  25. package/dist/chunks/asciidoc-ZAddoC6x.js.map +1 -0
  26. package/dist/chunks/aspectj-Dfd0IA-3.js +126 -0
  27. package/dist/chunks/aspectj-Dfd0IA-3.js.map +1 -0
  28. package/dist/chunks/autohotkey-tKEhIrY9.js +55 -0
  29. package/dist/chunks/autohotkey-tKEhIrY9.js.map +1 -0
  30. package/dist/chunks/autoit-BPoYFiDT.js +123 -0
  31. package/dist/chunks/autoit-BPoYFiDT.js.map +1 -0
  32. package/dist/chunks/avrasm-DcwC__J5.js +47 -0
  33. package/dist/chunks/avrasm-DcwC__J5.js.map +1 -0
  34. package/dist/chunks/awk-B0eiS31p.js +56 -0
  35. package/dist/chunks/awk-B0eiS31p.js.map +1 -0
  36. package/dist/chunks/axapta-BZnaEvVa.js +65 -0
  37. package/dist/chunks/axapta-BZnaEvVa.js.map +1 -0
  38. package/dist/chunks/bash-SfqkqXwO.js +171 -0
  39. package/dist/chunks/bash-SfqkqXwO.js.map +1 -0
  40. package/dist/chunks/basic-hK9i76TR.js +44 -0
  41. package/dist/chunks/basic-hK9i76TR.js.map +1 -0
  42. package/dist/chunks/bnf-CT5PE87o.js +28 -0
  43. package/dist/chunks/bnf-CT5PE87o.js.map +1 -0
  44. package/dist/chunks/brainfuck-Cix81oQc.js +41 -0
  45. package/dist/chunks/brainfuck-Cix81oQc.js.map +1 -0
  46. package/dist/chunks/c-DqpMY-rp.js +189 -0
  47. package/dist/chunks/c-DqpMY-rp.js.map +1 -0
  48. package/dist/chunks/cal-C-xic9Tn.js +91 -0
  49. package/dist/chunks/cal-C-xic9Tn.js.map +1 -0
  50. package/dist/chunks/capnproto-Bte6wB8g.js +84 -0
  51. package/dist/chunks/capnproto-Bte6wB8g.js.map +1 -0
  52. package/dist/chunks/ceylon-B5xM3rkd.js +77 -0
  53. package/dist/chunks/ceylon-B5xM3rkd.js.map +1 -0
  54. package/dist/chunks/clean-58wPfVlT.js +24 -0
  55. package/dist/chunks/clean-58wPfVlT.js.map +1 -0
  56. package/dist/chunks/clojure-DnooNAlk.js +114 -0
  57. package/dist/chunks/clojure-DnooNAlk.js.map +1 -0
  58. package/dist/chunks/clojure-repl-BOwc5f8V.js +18 -0
  59. package/dist/chunks/clojure-repl-BOwc5f8V.js.map +1 -0
  60. package/dist/chunks/cmake-CmXecy9B.js +28 -0
  61. package/dist/chunks/cmake-CmXecy9B.js.map +1 -0
  62. package/dist/chunks/coffeescript-BxFWPVxK.js +199 -0
  63. package/dist/chunks/coffeescript-BxFWPVxK.js.map +1 -0
  64. package/dist/chunks/coq-q80xvjL8.js +26 -0
  65. package/dist/chunks/coq-q80xvjL8.js.map +1 -0
  66. package/dist/chunks/core-BSQzrNYA.js +853 -0
  67. package/dist/chunks/core-BSQzrNYA.js.map +1 -0
  68. package/dist/chunks/cos-DiRYB57M.js +78 -0
  69. package/dist/chunks/cos-DiRYB57M.js.map +1 -0
  70. package/dist/chunks/cpp-BvOt3G_R.js +238 -0
  71. package/dist/chunks/cpp-BvOt3G_R.js.map +1 -0
  72. package/dist/chunks/crmsh-h8TY8H79.js +80 -0
  73. package/dist/chunks/crmsh-h8TY8H79.js.map +1 -0
  74. package/dist/chunks/crystal-Cn8iNhTZ.js +247 -0
  75. package/dist/chunks/crystal-Cn8iNhTZ.js.map +1 -0
  76. package/dist/chunks/csharp-BUAiXZio.js +262 -0
  77. package/dist/chunks/csharp-BUAiXZio.js.map +1 -0
  78. package/dist/chunks/csp-BP06y0Ba.js +25 -0
  79. package/dist/chunks/csp-BP06y0Ba.js.map +1 -0
  80. package/dist/chunks/css-CuP2L3Vg.js +147 -0
  81. package/dist/chunks/css-CuP2L3Vg.js.map +1 -0
  82. package/dist/chunks/d-C0cOEHlZ.js +87 -0
  83. package/dist/chunks/d-C0cOEHlZ.js.map +1 -0
  84. package/dist/chunks/dart-DOyn4FWh.js +136 -0
  85. package/dist/chunks/dart-DOyn4FWh.js.map +1 -0
  86. package/dist/chunks/{define-XzEniRJH.js → define-DqUpowD9.js} +3 -3
  87. package/dist/chunks/{define-XzEniRJH.js.map → define-DqUpowD9.js.map} +1 -1
  88. package/dist/chunks/delphi-BL8QbVUL.js +95 -0
  89. package/dist/chunks/delphi-BL8QbVUL.js.map +1 -0
  90. package/dist/chunks/diff-DMbO7OaS.js +41 -0
  91. package/dist/chunks/diff-DMbO7OaS.js.map +1 -0
  92. package/dist/chunks/django-CnvXUSpm.js +44 -0
  93. package/dist/chunks/django-CnvXUSpm.js.map +1 -0
  94. package/dist/chunks/dns-DpaEqlb1.js +73 -0
  95. package/dist/chunks/dns-DpaEqlb1.js.map +1 -0
  96. package/dist/chunks/dockerfile-D9WngOli.js +36 -0
  97. package/dist/chunks/dockerfile-D9WngOli.js.map +1 -0
  98. package/dist/chunks/dos-w6Vxr4_L.js +59 -0
  99. package/dist/chunks/dos-w6Vxr4_L.js.map +1 -0
  100. package/dist/chunks/dsconfig-Dq_NzMQE.js +56 -0
  101. package/dist/chunks/dsconfig-Dq_NzMQE.js.map +1 -0
  102. package/dist/chunks/dts-CpWaLhGr.js +117 -0
  103. package/dist/chunks/dts-CpWaLhGr.js.map +1 -0
  104. package/dist/chunks/dust-C4uDg2L0.js +34 -0
  105. package/dist/chunks/dust-C4uDg2L0.js.map +1 -0
  106. package/dist/chunks/ebnf-ByjV7C32.js +41 -0
  107. package/dist/chunks/ebnf-ByjV7C32.js.map +1 -0
  108. package/dist/chunks/{element-ChNBLJ5X.js → element-CaN9ZVoe.js} +60 -60
  109. package/dist/chunks/element-CaN9ZVoe.js.map +1 -0
  110. package/dist/chunks/elixir-DkdYO0Vr.js +191 -0
  111. package/dist/chunks/elixir-DkdYO0Vr.js.map +1 -0
  112. package/dist/chunks/elm-Clms-iZw.js +101 -0
  113. package/dist/chunks/elm-Clms-iZw.js.map +1 -0
  114. package/dist/chunks/erb-BC3HNNgp.js +18 -0
  115. package/dist/chunks/erb-BC3HNNgp.js.map +1 -0
  116. package/dist/chunks/erlang-Cu0IlQov.js +220 -0
  117. package/dist/chunks/erlang-Cu0IlQov.js.map +1 -0
  118. package/dist/chunks/erlang-repl-5hCt0uhz.js +42 -0
  119. package/dist/chunks/erlang-repl-5hCt0uhz.js.map +1 -0
  120. package/dist/chunks/excel-BIDJpxSu.js +49 -0
  121. package/dist/chunks/excel-BIDJpxSu.js.map +1 -0
  122. package/dist/chunks/fix-C0h50qaq.js +31 -0
  123. package/dist/chunks/fix-C0h50qaq.js.map +1 -0
  124. package/dist/chunks/flix-BCyKzKuw.js +61 -0
  125. package/dist/chunks/flix-BCyKzKuw.js.map +1 -0
  126. package/dist/chunks/fortran-DJ9If3VL.js +55 -0
  127. package/dist/chunks/fortran-DJ9If3VL.js.map +1 -0
  128. package/dist/chunks/freedesktop-DY5X71dr.js +88 -0
  129. package/dist/chunks/freedesktop-DY5X71dr.js.map +1 -0
  130. package/dist/chunks/fsharp-B-zxwYyG.js +243 -0
  131. package/dist/chunks/fsharp-B-zxwYyG.js.map +1 -0
  132. package/dist/chunks/gams-Bk-CWpk3.js +128 -0
  133. package/dist/chunks/gams-Bk-CWpk3.js.map +1 -0
  134. package/dist/chunks/gauss-DoDOans8.js +154 -0
  135. package/dist/chunks/gauss-DoDOans8.js.map +1 -0
  136. package/dist/chunks/gcode-BUHWwtTe.js +123 -0
  137. package/dist/chunks/gcode-BUHWwtTe.js.map +1 -0
  138. package/dist/chunks/gherkin-Wzf9M781.js +70 -0
  139. package/dist/chunks/gherkin-Wzf9M781.js.map +1 -0
  140. package/dist/chunks/glsl-CUb3B_sB.js +27 -0
  141. package/dist/chunks/glsl-CUb3B_sB.js.map +1 -0
  142. package/dist/chunks/gml-BS5lKjIV.js +24 -0
  143. package/dist/chunks/gml-BS5lKjIV.js.map +1 -0
  144. package/dist/chunks/go-BUD6D8kx.js +146 -0
  145. package/dist/chunks/go-BUD6D8kx.js.map +1 -0
  146. package/dist/chunks/golo-CeWwUkIr.js +27 -0
  147. package/dist/chunks/golo-CeWwUkIr.js.map +1 -0
  148. package/dist/chunks/gradle-BoqM74sD.js +20 -0
  149. package/dist/chunks/gradle-BoqM74sD.js.map +1 -0
  150. package/dist/chunks/graphql-j3kf95P9.js +69 -0
  151. package/dist/chunks/graphql-j3kf95P9.js.map +1 -0
  152. package/dist/chunks/groovy-B3DHxrmD.js +129 -0
  153. package/dist/chunks/groovy-B3DHxrmD.js.map +1 -0
  154. package/dist/chunks/haml-CgF67t0s.js +98 -0
  155. package/dist/chunks/haml-CgF67t0s.js.map +1 -0
  156. package/dist/chunks/handlebars-Bp8_IuhA.js +146 -0
  157. package/dist/chunks/handlebars-Bp8_IuhA.js.map +1 -0
  158. package/dist/chunks/haskell-2oFXwht3.js +140 -0
  159. package/dist/chunks/haskell-2oFXwht3.js.map +1 -0
  160. package/dist/chunks/haxe-BWUFK1R1.js +144 -0
  161. package/dist/chunks/haxe-BWUFK1R1.js.map +1 -0
  162. package/dist/chunks/highlight-D54M45bZ.js +328 -0
  163. package/dist/chunks/highlight-D54M45bZ.js.map +1 -0
  164. package/dist/chunks/hsp-YaLnMBmw.js +47 -0
  165. package/dist/chunks/hsp-YaLnMBmw.js.map +1 -0
  166. package/dist/chunks/http-D1Jx4NCy.js +76 -0
  167. package/dist/chunks/http-D1Jx4NCy.js.map +1 -0
  168. package/dist/chunks/hy-W6RLRSst.js +75 -0
  169. package/dist/chunks/hy-W6RLRSst.js.map +1 -0
  170. package/dist/chunks/inform7-Cqmf6Xxi.js +45 -0
  171. package/dist/chunks/inform7-Cqmf6Xxi.js.map +1 -0
  172. package/dist/chunks/ini-C_A9yUHA.js +90 -0
  173. package/dist/chunks/ini-C_A9yUHA.js.map +1 -0
  174. package/dist/chunks/irpf90-CFKe0d2G.js +49 -0
  175. package/dist/chunks/irpf90-CFKe0d2G.js.map +1 -0
  176. package/dist/chunks/isbl-DRZZfDZN.js +98 -0
  177. package/dist/chunks/isbl-DRZZfDZN.js.map +1 -0
  178. package/dist/chunks/java-DH7DXQTB.js +176 -0
  179. package/dist/chunks/java-DH7DXQTB.js.map +1 -0
  180. package/dist/chunks/javascript-D-ispHLP.js +433 -0
  181. package/dist/chunks/javascript-D-ispHLP.js.map +1 -0
  182. package/dist/chunks/jboss-cli-DwoEMfEn.js +48 -0
  183. package/dist/chunks/jboss-cli-DwoEMfEn.js.map +1 -0
  184. package/dist/chunks/json-BrJhaXJI.js +44 -0
  185. package/dist/chunks/json-BrJhaXJI.js.map +1 -0
  186. package/dist/chunks/julia-DUM4uO0n.js +82 -0
  187. package/dist/chunks/julia-DUM4uO0n.js.map +1 -0
  188. package/dist/chunks/julia-repl-DkEOqH-L.js +20 -0
  189. package/dist/chunks/julia-repl-DkEOqH-L.js.map +1 -0
  190. package/dist/chunks/kd-B0BcpOG_.js +2662 -0
  191. package/dist/chunks/kd-B0BcpOG_.js.map +1 -0
  192. package/dist/chunks/kotlin-BvSvL3hH.js +208 -0
  193. package/dist/chunks/kotlin-BvSvL3hH.js.map +1 -0
  194. package/dist/chunks/lasso-BixBtX3R.js +122 -0
  195. package/dist/chunks/lasso-BixBtX3R.js.map +1 -0
  196. package/dist/chunks/latex-BNm-5qSt.js +188 -0
  197. package/dist/chunks/latex-BNm-5qSt.js.map +1 -0
  198. package/dist/chunks/ldif-D2VChYy1.js +26 -0
  199. package/dist/chunks/ldif-D2VChYy1.js.map +1 -0
  200. package/dist/chunks/leaf-DZ17MVc2.js +67 -0
  201. package/dist/chunks/leaf-DZ17MVc2.js.map +1 -0
  202. package/dist/chunks/less-Cj7NvTiz.js +198 -0
  203. package/dist/chunks/less-Cj7NvTiz.js.map +1 -0
  204. package/dist/chunks/lisp-0CHBhNkP.js +105 -0
  205. package/dist/chunks/lisp-0CHBhNkP.js.map +1 -0
  206. package/dist/chunks/livecodeserver-f04_o5o0.js +85 -0
  207. package/dist/chunks/livecodeserver-f04_o5o0.js.map +1 -0
  208. package/dist/chunks/livescript-DnaWcjJC.js +192 -0
  209. package/dist/chunks/livescript-DnaWcjJC.js.map +1 -0
  210. package/dist/chunks/llvm-CD_EQmwW.js +71 -0
  211. package/dist/chunks/llvm-CD_EQmwW.js.map +1 -0
  212. package/dist/chunks/lsl-BjbA45DV.js +56 -0
  213. package/dist/chunks/lsl-BjbA45DV.js.map +1 -0
  214. package/dist/chunks/lua-C8cmPpDf.js +48 -0
  215. package/dist/chunks/lua-C8cmPpDf.js.map +1 -0
  216. package/dist/chunks/makefile-vKf6Crs_.js +59 -0
  217. package/dist/chunks/makefile-vKf6Crs_.js.map +1 -0
  218. package/dist/chunks/markdown-D1MbcAo6.js +180 -0
  219. package/dist/chunks/markdown-D1MbcAo6.js.map +1 -0
  220. package/dist/chunks/marked.esm-BrPimSW6.js +1494 -0
  221. package/dist/chunks/marked.esm-BrPimSW6.js.map +1 -0
  222. package/dist/chunks/mathematica-BAI0dr8P.js +71 -0
  223. package/dist/chunks/mathematica-BAI0dr8P.js.map +1 -0
  224. package/dist/chunks/matlab-tHkexNRr.js +72 -0
  225. package/dist/chunks/matlab-tHkexNRr.js.map +1 -0
  226. package/dist/chunks/maxima-DBb1On73.js +40 -0
  227. package/dist/chunks/maxima-DBb1On73.js.map +1 -0
  228. package/dist/chunks/mel-DQ2XEeJZ.js +26 -0
  229. package/dist/chunks/mel-DQ2XEeJZ.js.map +1 -0
  230. package/dist/chunks/mercury-DB7FwEBk.js +57 -0
  231. package/dist/chunks/mercury-DB7FwEBk.js.map +1 -0
  232. package/dist/chunks/mipsasm-Bnw9lQ6-.js +55 -0
  233. package/dist/chunks/mipsasm-Bnw9lQ6-.js.map +1 -0
  234. package/dist/chunks/mizar-CKEtvqV9.js +12 -0
  235. package/dist/chunks/mizar-CKEtvqV9.js.map +1 -0
  236. package/dist/chunks/mojolicious-FvfVuUnD.js +29 -0
  237. package/dist/chunks/mojolicious-FvfVuUnD.js.map +1 -0
  238. package/dist/chunks/monkey-DaGzblyK.js +73 -0
  239. package/dist/chunks/monkey-DaGzblyK.js.map +1 -0
  240. package/dist/chunks/moonscript-B9xmaKDF.js +99 -0
  241. package/dist/chunks/moonscript-B9xmaKDF.js.map +1 -0
  242. package/dist/chunks/n1ql-h7HuiOG_.js +47 -0
  243. package/dist/chunks/n1ql-h7HuiOG_.js.map +1 -0
  244. package/dist/chunks/nestedtext-z3hOUdBb.js +67 -0
  245. package/dist/chunks/nestedtext-z3hOUdBb.js.map +1 -0
  246. package/dist/chunks/nginx-Cscn9g8k.js +126 -0
  247. package/dist/chunks/nginx-Cscn9g8k.js.map +1 -0
  248. package/dist/chunks/nim-DuEHXsfI.js +57 -0
  249. package/dist/chunks/nim-DuEHXsfI.js.map +1 -0
  250. package/dist/chunks/nix-CK-JoV_w.js +176 -0
  251. package/dist/chunks/nix-CK-JoV_w.js.map +1 -0
  252. package/dist/chunks/node-repl-YPgIlFR4.js +21 -0
  253. package/dist/chunks/node-repl-YPgIlFR4.js.map +1 -0
  254. package/dist/chunks/nsis-C2knGE1f.js +103 -0
  255. package/dist/chunks/nsis-C2knGE1f.js.map +1 -0
  256. package/dist/chunks/objectivec-CUvPbZB7.js +119 -0
  257. package/dist/chunks/objectivec-CUvPbZB7.js.map +1 -0
  258. package/dist/chunks/ocaml-CJnlG7MK.js +54 -0
  259. package/dist/chunks/ocaml-CJnlG7MK.js.map +1 -0
  260. package/dist/chunks/openscad-B7xqzB_t.js +61 -0
  261. package/dist/chunks/openscad-B7xqzB_t.js.map +1 -0
  262. package/dist/chunks/oxygene-y7G7cOvu.js +55 -0
  263. package/dist/chunks/oxygene-y7G7cOvu.js.map +1 -0
  264. package/dist/chunks/parser3-BO1P2QTe.js +42 -0
  265. package/dist/chunks/parser3-BO1P2QTe.js.map +1 -0
  266. package/dist/chunks/perl-CIZiAqA2.js +194 -0
  267. package/dist/chunks/perl-CIZiAqA2.js.map +1 -0
  268. package/dist/chunks/pf-DtIBAeXH.js +32 -0
  269. package/dist/chunks/pf-DtIBAeXH.js.map +1 -0
  270. package/dist/chunks/pgsql-DhvwSgY7.js +193 -0
  271. package/dist/chunks/pgsql-DhvwSgY7.js.map +1 -0
  272. package/dist/chunks/php-Df419x2P.js +302 -0
  273. package/dist/chunks/php-Df419x2P.js.map +1 -0
  274. package/dist/chunks/php-template-NGWDJ4ZL.js +45 -0
  275. package/dist/chunks/php-template-NGWDJ4ZL.js.map +1 -0
  276. package/dist/chunks/plaintext-DI9-6uUK.js +12 -0
  277. package/dist/chunks/plaintext-DI9-6uUK.js.map +1 -0
  278. package/dist/chunks/pony-DWRlzIm6.js +52 -0
  279. package/dist/chunks/pony-DWRlzIm6.js.map +1 -0
  280. package/dist/chunks/powershell-Bi81KJvX.js +190 -0
  281. package/dist/chunks/powershell-Bi81KJvX.js.map +1 -0
  282. package/dist/chunks/processing-NRILzl6W.js +100 -0
  283. package/dist/chunks/processing-NRILzl6W.js.map +1 -0
  284. package/dist/chunks/profile-C5HdUz2O.js +40 -0
  285. package/dist/chunks/profile-C5HdUz2O.js.map +1 -0
  286. package/dist/chunks/prolog-CSxvOOUl.js +56 -0
  287. package/dist/chunks/prolog-CSxvOOUl.js.map +1 -0
  288. package/dist/chunks/properties-DVff9GiD.js +40 -0
  289. package/dist/chunks/properties-DVff9GiD.js.map +1 -0
  290. package/dist/chunks/protobuf-CwPeazJT.js +63 -0
  291. package/dist/chunks/protobuf-CwPeazJT.js.map +1 -0
  292. package/dist/chunks/puppet-wWT6-WaD.js +84 -0
  293. package/dist/chunks/puppet-wWT6-WaD.js.map +1 -0
  294. package/dist/chunks/purebasic-HWZkxa8e.js +44 -0
  295. package/dist/chunks/purebasic-HWZkxa8e.js.map +1 -0
  296. package/dist/chunks/purify.es-C_X9UTsz.js +846 -0
  297. package/dist/chunks/purify.es-C_X9UTsz.js.map +1 -0
  298. package/dist/chunks/python-B3xOtrtl.js +240 -0
  299. package/dist/chunks/python-B3xOtrtl.js.map +1 -0
  300. package/dist/chunks/python-repl-DFMVj5e5.js +21 -0
  301. package/dist/chunks/python-repl-DFMVj5e5.js.map +1 -0
  302. package/dist/chunks/q-DOHmm85f.js +23 -0
  303. package/dist/chunks/q-DOHmm85f.js.map +1 -0
  304. package/dist/chunks/qml-LsukXoE-.js +129 -0
  305. package/dist/chunks/qml-LsukXoE-.js.map +1 -0
  306. package/dist/chunks/r-qBqOPbmv.js +142 -0
  307. package/dist/chunks/r-qBqOPbmv.js.map +1 -0
  308. package/dist/chunks/reasonml-D25FoGuQ.js +80 -0
  309. package/dist/chunks/reasonml-D25FoGuQ.js.map +1 -0
  310. package/dist/chunks/rib-C3T5JisO.js +18 -0
  311. package/dist/chunks/rib-C3T5JisO.js.map +1 -0
  312. package/dist/chunks/roboconf-Ckycnnun.js +55 -0
  313. package/dist/chunks/roboconf-Ckycnnun.js.map +1 -0
  314. package/dist/chunks/routeros-DIBiqeDi.js +104 -0
  315. package/dist/chunks/routeros-DIBiqeDi.js.map +1 -0
  316. package/dist/chunks/rsl-C2V3vKIN.js +61 -0
  317. package/dist/chunks/rsl-C2V3vKIN.js.map +1 -0
  318. package/dist/chunks/ruby-C7c-uCk8.js +264 -0
  319. package/dist/chunks/ruby-C7c-uCk8.js.map +1 -0
  320. package/dist/chunks/ruleslanguage-IlptjHhp.js +28 -0
  321. package/dist/chunks/ruleslanguage-IlptjHhp.js.map +1 -0
  322. package/dist/chunks/rust-D-q21Dm6.js +184 -0
  323. package/dist/chunks/rust-D-q21Dm6.js.map +1 -0
  324. package/dist/chunks/sas-ObguUuPf.js +80 -0
  325. package/dist/chunks/sas-ObguUuPf.js.map +1 -0
  326. package/dist/chunks/scala-DVAYHay6.js +164 -0
  327. package/dist/chunks/scala-DVAYHay6.js.map +1 -0
  328. package/dist/chunks/scheme-DIcGbflN.js +106 -0
  329. package/dist/chunks/scheme-DIcGbflN.js.map +1 -0
  330. package/dist/chunks/scilab-ilneDJJS.js +47 -0
  331. package/dist/chunks/scilab-ilneDJJS.js.map +1 -0
  332. package/dist/chunks/scss-BP8UD0nN.js +157 -0
  333. package/dist/chunks/scss-BP8UD0nN.js.map +1 -0
  334. package/dist/chunks/shell-DBkgOY0Y.js +19 -0
  335. package/dist/chunks/shell-DBkgOY0Y.js.map +1 -0
  336. package/dist/chunks/smali-De20QX07.js +85 -0
  337. package/dist/chunks/smali-De20QX07.js.map +1 -0
  338. package/dist/chunks/smalltalk-DWMPo-qT.js +59 -0
  339. package/dist/chunks/smalltalk-DWMPo-qT.js.map +1 -0
  340. package/dist/chunks/sml-yOrArwoc.js +51 -0
  341. package/dist/chunks/sml-yOrArwoc.js.map +1 -0
  342. package/dist/chunks/sqf-BCN5uwk_.js +78 -0
  343. package/dist/chunks/sqf-BCN5uwk_.js.map +1 -0
  344. package/dist/chunks/sql-CmVzGP4w.js +120 -0
  345. package/dist/chunks/sql-CmVzGP4w.js.map +1 -0
  346. package/dist/chunks/stan-BSt7sG8M.js +142 -0
  347. package/dist/chunks/stan-BSt7sG8M.js.map +1 -0
  348. package/dist/chunks/stata-sbG438-7.js +35 -0
  349. package/dist/chunks/stata-sbG438-7.js.map +1 -0
  350. package/dist/chunks/step21-Cfi2MQDZ.js +55 -0
  351. package/dist/chunks/step21-Cfi2MQDZ.js.map +1 -0
  352. package/dist/chunks/stylus-CiBDFhBN.js +185 -0
  353. package/dist/chunks/stylus-CiBDFhBN.js.map +1 -0
  354. package/dist/chunks/subunit-DWjzVCiA.js +36 -0
  355. package/dist/chunks/subunit-DWjzVCiA.js.map +1 -0
  356. package/dist/chunks/swift-Qo_eIir5.js +577 -0
  357. package/dist/chunks/swift-Qo_eIir5.js.map +1 -0
  358. package/dist/chunks/taggerscript-BvuLYKHz.js +39 -0
  359. package/dist/chunks/taggerscript-BvuLYKHz.js.map +1 -0
  360. package/dist/chunks/tap-uMi8uF_X.js +32 -0
  361. package/dist/chunks/tap-uMi8uF_X.js.map +1 -0
  362. package/dist/chunks/tcl-DMPG3T59.js +46 -0
  363. package/dist/chunks/tcl-DMPG3T59.js.map +1 -0
  364. package/dist/chunks/thrift-DAA8HOe8.js +67 -0
  365. package/dist/chunks/thrift-DAA8HOe8.js.map +1 -0
  366. package/dist/chunks/tp-46SXlDZT.js +87 -0
  367. package/dist/chunks/tp-46SXlDZT.js.map +1 -0
  368. package/dist/chunks/twig-Cf_tZ_wH.js +84 -0
  369. package/dist/chunks/twig-Cf_tZ_wH.js.map +1 -0
  370. package/dist/chunks/typescript-Dc6pBLOZ.js +518 -0
  371. package/dist/chunks/typescript-Dc6pBLOZ.js.map +1 -0
  372. package/dist/chunks/vala-C2GHqzgV.js +41 -0
  373. package/dist/chunks/vala-C2GHqzgV.js.map +1 -0
  374. package/dist/chunks/vbnet-DgQ7B7yi.js +71 -0
  375. package/dist/chunks/vbnet-DgQ7B7yi.js.map +1 -0
  376. package/dist/chunks/vbscript-Bid2w6kd.js +43 -0
  377. package/dist/chunks/vbscript-Bid2w6kd.js.map +1 -0
  378. package/dist/chunks/vbscript-html-DznzJpE3.js +16 -0
  379. package/dist/chunks/vbscript-html-DznzJpE3.js.map +1 -0
  380. package/dist/chunks/verilog-Cfn8vMNy.js +58 -0
  381. package/dist/chunks/verilog-Cfn8vMNy.js.map +1 -0
  382. package/dist/chunks/vhdl-DjBWCsn1.js +48 -0
  383. package/dist/chunks/vhdl-DjBWCsn1.js.map +1 -0
  384. package/dist/chunks/vim-DtRU07HQ.js +56 -0
  385. package/dist/chunks/vim-DtRU07HQ.js.map +1 -0
  386. package/dist/chunks/wasm-CavVFuAK.js +65 -0
  387. package/dist/chunks/wasm-CavVFuAK.js.map +1 -0
  388. package/dist/chunks/wren-BKTRrWxW.js +210 -0
  389. package/dist/chunks/wren-BKTRrWxW.js.map +1 -0
  390. package/dist/chunks/x86asm-D3FT8ZrX.js +66 -0
  391. package/dist/chunks/x86asm-D3FT8ZrX.js.map +1 -0
  392. package/dist/chunks/xl-O8DviBwg.js +85 -0
  393. package/dist/chunks/xl-O8DviBwg.js.map +1 -0
  394. package/dist/chunks/xml-UTtAqziF.js +164 -0
  395. package/dist/chunks/xml-UTtAqziF.js.map +1 -0
  396. package/dist/chunks/xquery-Ybt8-gzE.js +149 -0
  397. package/dist/chunks/xquery-Ybt8-gzE.js.map +1 -0
  398. package/dist/chunks/yaml-DT7UV549.js +146 -0
  399. package/dist/chunks/yaml-DT7UV549.js.map +1 -0
  400. package/dist/chunks/zephir-Dsfqs5td.js +72 -0
  401. package/dist/chunks/zephir-Dsfqs5td.js.map +1 -0
  402. package/dist/github/activity.d.ts +49 -0
  403. package/dist/github/hash.d.ts +8 -0
  404. package/dist/github/index.d.ts +10 -0
  405. package/dist/github/tree.d.ts +26 -0
  406. package/dist/github/urls.d.ts +34 -0
  407. package/dist/github.js +253 -0
  408. package/dist/github.js.map +1 -0
  409. package/dist/k8s.js +6 -6
  410. package/dist/k8s.js.map +1 -1
  411. package/dist/kd/elements/code.d.ts +53 -0
  412. package/dist/kd/elements/markdown.d.ts +55 -0
  413. package/dist/kd/feed.d.ts +31 -0
  414. package/dist/kd/files/explorer.d.ts +88 -0
  415. package/dist/kd/files/file.d.ts +84 -0
  416. package/dist/kd/files/index.d.ts +6 -0
  417. package/dist/kd/files/static.d.ts +12 -0
  418. package/dist/kd/files/types.d.ts +51 -0
  419. package/dist/kd/highlight.d.ts +26 -0
  420. package/dist/kd/index.d.ts +8 -0
  421. package/dist/kd.js +5 -5
  422. package/dist/n8n/config.d.ts +3 -2
  423. package/dist/n8n.js +4 -4
  424. package/dist/n8n.js.map +1 -1
  425. package/dist/openapi.js +4 -4
  426. package/dist/openapi.js.map +1 -1
  427. package/package.json +18 -3
  428. package/dist/chunks/element-ChNBLJ5X.js.map +0 -1
  429. package/dist/chunks/kd-Bbw0GeQ5.js +0 -1149
  430. package/dist/chunks/kd-Bbw0GeQ5.js.map +0 -1
@@ -0,0 +1,2662 @@
1
+ import { a as e, c as t, d as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./element-CaN9ZVoe.js";
2
+ import { n as u } from "./define-DqUpowD9.js";
3
+ import { f as d } from "./scene-CUr0fSXC.js";
4
+ //#region src/kd/helpers.ts
5
+ function ee(e) {
6
+ return JSON.stringify(e ?? null);
7
+ }
8
+ function te(e) {
9
+ e.registerHelper("kdjson", (e) => ee(e));
10
+ }
11
+ //#endregion
12
+ //#region node_modules/lit-html/directives/if-defined.js
13
+ var f = (e) => e ?? a, ne = /^(~|null|true|false|yes|no|on|off|y|n)$/i, re = /^([-+]?(\.\d+|\d[\d_]*(\.\d*)?)([eE][-+]?\d+)?|0x[0-9a-f]+|0o[0-7]+|[-+]?\.(inf|nan)|[-+]?\d+(:[0-5]?\d)+(\.\d*)?)$/i, ie = /^\d{4}-\d\d?-\d\d?([Tt ]|$)/, ae = /^([,[\]{}#&*!|>'"%@`]|[-?:](\s|$))/, oe = /[\u0000-\u0008\u000b-\u001f\u007f]/;
14
+ function se(e) {
15
+ return e === "" || ne.test(e) || re.test(e) || ie.test(e) || ae.test(e) || /^\s|\s$/.test(e) || e.includes(": ") || e.includes(" #") || e.endsWith(":") || e.includes("\n") || e.includes(" ") || oe.test(e);
16
+ }
17
+ function p(e) {
18
+ return se(e) ? JSON.stringify(e) : e;
19
+ }
20
+ var m = (e, t) => ({
21
+ kind: e,
22
+ text: t
23
+ });
24
+ function h(e) {
25
+ return Array.isArray(e) ? e.length > 0 : typeof e == "object" && !!e && Object.values(e).some((e) => e !== void 0);
26
+ }
27
+ function ce(e) {
28
+ return typeof e == "string" && e.includes("\n") && !oe.test(e);
29
+ }
30
+ function le(e) {
31
+ return e == null ? m("null", "null") : typeof e == "boolean" ? m("bool", String(e)) : typeof e == "number" || typeof e == "bigint" ? m("num", String(e)) : Array.isArray(e) ? m("plain", "[]") : typeof e == "object" ? m("plain", "{}") : m("str", p(String(e)));
32
+ }
33
+ function ue(e) {
34
+ let t = e.endsWith("\n") ? e.endsWith("\n\n") ? "+" : "" : "-", n = (t === "-" ? e : e.slice(0, -1)).split("\n");
35
+ return {
36
+ header: `|${n.find((e) => e !== "")?.startsWith(" ") ? "2" : ""}${t}`,
37
+ lines: n
38
+ };
39
+ }
40
+ function g(e, t, n, r) {
41
+ let i = t.length ? [m("plain", " ")] : [];
42
+ if (ce(n)) {
43
+ let { header: a, lines: o } = ue(n);
44
+ return [{
45
+ prefix: e,
46
+ tokens: [
47
+ ...t,
48
+ ...i,
49
+ m("plain", a)
50
+ ]
51
+ }, ...o.map((e) => ({
52
+ prefix: e ? r : "",
53
+ tokens: [m("str", e)]
54
+ }))];
55
+ }
56
+ return [{
57
+ prefix: e,
58
+ tokens: [
59
+ ...t,
60
+ ...i,
61
+ le(n)
62
+ ]
63
+ }];
64
+ }
65
+ function _(e, t, n) {
66
+ if (Array.isArray(e)) for (let r of e) if (h(r)) {
67
+ let e = [];
68
+ _(r, `${t} `, e), e[0].prefix = `${t}- ${e[0].prefix.slice(t.length + 2)}`, n.push(...e);
69
+ } else n.push(...g(`${t}- `, [], r, `${t} `));
70
+ else for (let [r, i] of Object.entries(e)) {
71
+ if (i === void 0) continue;
72
+ let e = [m("key", p(r)), m("plain", ":")];
73
+ h(i) ? (n.push({
74
+ prefix: t,
75
+ tokens: e
76
+ }), _(i, Array.isArray(i) ? t : `${t} `, n)) : n.push(...g(t, e, i, `${t} `));
77
+ }
78
+ }
79
+ function v(e) {
80
+ let t = [];
81
+ return h(e) ? _(e, "", t) : t.push(...g("", [], e, " ")), t;
82
+ }
83
+ function de(e) {
84
+ return v(e).map((e) => e.prefix + e.tokens.map((e) => e.text).join("")).join("\n");
85
+ }
86
+ //#endregion
87
+ //#region src/kd/elements/data.ts
88
+ var fe = class extends c {
89
+ static properties = {
90
+ data: {
91
+ attribute: "data",
92
+ converter: o
93
+ },
94
+ fold: { type: Number }
95
+ };
96
+ static styles = [i, l`
97
+ pre {
98
+ margin: 0;
99
+ font-family: var(--kd-font-mono, monospace);
100
+ font-size: 12px;
101
+ line-height: 1.5;
102
+ white-space: pre-wrap;
103
+ overflow-wrap: anywhere;
104
+ }
105
+ .key {
106
+ color: color-mix(in srgb, var(--kd-info, currentColor) 75%, var(--kd-text, currentColor));
107
+ }
108
+ .str {
109
+ color: color-mix(in srgb, var(--kd-success, currentColor) 70%, var(--kd-text, currentColor));
110
+ }
111
+ .num {
112
+ color: color-mix(in srgb, var(--kd-warning, currentColor) 55%, var(--kd-text, currentColor));
113
+ }
114
+ .bool,
115
+ .null {
116
+ color: color-mix(in srgb, var(--kd-primary, currentColor) 70%, var(--kd-text, currentColor));
117
+ }
118
+ summary {
119
+ width: max-content;
120
+ color: var(--kd-text-2, inherit);
121
+ font-family: var(--kd-font-mono, monospace);
122
+ font-size: 12px;
123
+ cursor: pointer;
124
+ list-style: none;
125
+ }
126
+ summary::-webkit-details-marker {
127
+ display: none;
128
+ }
129
+ summary::before {
130
+ content: '▸ ';
131
+ }
132
+ details[open] > summary::before {
133
+ content: '▾ ';
134
+ }
135
+ details > pre {
136
+ margin-top: 2px;
137
+ }
138
+ `];
139
+ constructor() {
140
+ super(), this.fold = 10;
141
+ }
142
+ render() {
143
+ let e = this.data;
144
+ if (e === void 0) return a;
145
+ let n = v(e), r = t`<pre>${n.map((e, n) => t`${n ? "\n" : ""}${e.prefix}${e.tokens.map((e) => e.kind === "plain" ? e.text : t`<span class=${e.kind}>${e.text}</span>`)}`)}</pre>`;
146
+ if (!(this.fold > 0 && n.length > this.fold && typeof e == "object" && e)) return r;
147
+ let i = Object.keys(e).length, o = Array.isArray(e) ? `[ ] ${i} item${i === 1 ? "" : "s"}` : `{ } ${i} key${i === 1 ? "" : "s"}`;
148
+ return t`<details><summary>${o}</summary>${r}</details>`;
149
+ }
150
+ };
151
+ u("kd-data", fe);
152
+ //#endregion
153
+ //#region src/kd/parts.ts
154
+ var pe = /* @__PURE__ */ new Set([
155
+ "primary",
156
+ "success",
157
+ "warning",
158
+ "error",
159
+ "info",
160
+ "neutral"
161
+ ]);
162
+ function y(e, t = "neutral") {
163
+ return typeof e == "string" && pe.has(e) ? e : t;
164
+ }
165
+ var b = l`
166
+ .primary {
167
+ --tone: var(--kd-primary, currentColor);
168
+ }
169
+ .success {
170
+ --tone: var(--kd-success, currentColor);
171
+ }
172
+ .warning {
173
+ --tone: var(--kd-warning, currentColor);
174
+ }
175
+ .error {
176
+ --tone: var(--kd-error, currentColor);
177
+ }
178
+ .info {
179
+ --tone: var(--kd-info, currentColor);
180
+ }
181
+ .primary,
182
+ .success,
183
+ .warning,
184
+ .error,
185
+ .info {
186
+ --tone-ink: color-mix(in srgb, var(--tone) 75%, var(--kd-text, currentColor));
187
+ --tone-line: color-mix(in srgb, var(--tone) 50%, transparent);
188
+ }
189
+ .neutral {
190
+ --tone: var(--kd-text-2, currentColor);
191
+ --tone-ink: var(--kd-text-2, currentColor);
192
+ --tone-line: var(--kd-border-strong, currentColor);
193
+ }
194
+ `, me = /^(https?:|data:image\/|\/|\.\.?\/)/i;
195
+ function x(e, n = "icon") {
196
+ return e ? me.test(e) ? t`<img class=${n} src=${e} alt="" />` : t`<span class=${n}>${e}</span>` : a;
197
+ }
198
+ function S(e) {
199
+ if (e != null && e !== "") return /^\s*(javascript|vbscript|data):/i.test(e) ? void 0 : e;
200
+ }
201
+ //#endregion
202
+ //#region src/kd/elements/link.ts
203
+ function he(e) {
204
+ try {
205
+ let t = e?.location, n = /^(.*?)\/d\/([^/?#]+)/.exec(t?.pathname ?? "");
206
+ return {
207
+ prefix: n?.[1] ?? "",
208
+ uid: n ? decodeURIComponent(n[2]) : void 0,
209
+ params: new URLSearchParams(t?.search ?? "")
210
+ };
211
+ } catch {
212
+ return {
213
+ prefix: "",
214
+ params: new URLSearchParams()
215
+ };
216
+ }
217
+ }
218
+ function C(e, t) {
219
+ if (!e.dashboard) return S(e.href);
220
+ let n = he(t), r = e.dashboard.indexOf("?"), i = r < 0 ? e.dashboard : e.dashboard.slice(0, r), a = new URLSearchParams(r < 0 ? "" : e.dashboard.slice(r + 1));
221
+ for (let [t, n] of Object.entries(e.vars ?? {})) {
222
+ if (n == null) continue;
223
+ let e = t.startsWith("var-") ? t : `var-${t}`;
224
+ a.delete(e);
225
+ for (let t of Array.isArray(n) ? n : [n]) a.append(e, String(t));
226
+ }
227
+ for (let e of ["from", "to"]) {
228
+ let t = n.params.get(e);
229
+ t !== null && !a.has(e) && a.set(e, t);
230
+ }
231
+ if (e.back && n.uid) {
232
+ let e = new URLSearchParams([...n.params].filter(([e]) => e.startsWith("var-"))).toString();
233
+ a.set("var-back", e ? `${n.uid}?${e}` : n.uid);
234
+ }
235
+ let o = a.toString();
236
+ return `${n.prefix}/d/${i}${o ? `?${o}` : ""}`;
237
+ }
238
+ var w = /* @__PURE__ */ new WeakMap();
239
+ function ge(e) {
240
+ e && !w.has(e) && e.System?.import && (w.set(e, null), e.System.import("@grafana/runtime").then((t) => w.set(e, t), () => {}));
241
+ }
242
+ function _e(e, t, n) {
243
+ if (!e || n.defaultPrevented || n.button !== 0 || n.metaKey || n.ctrlKey || n.shiftKey || n.altKey) return;
244
+ let r = w.get(e)?.locationService;
245
+ if (!r) return;
246
+ let i = new URL(t, e.location.href);
247
+ if (i.origin !== e.location.origin) return;
248
+ let { prefix: a } = he(e), o = a && i.pathname.startsWith(a) ? i.pathname.slice(a.length) : i.pathname;
249
+ n.preventDefault(), r.push(o + i.search + i.hash);
250
+ }
251
+ var T = class extends c {
252
+ static properties = {
253
+ data: {
254
+ attribute: "data",
255
+ converter: o
256
+ },
257
+ dashboard: {},
258
+ href: {},
259
+ vars: { converter: o },
260
+ text: {},
261
+ icon: {},
262
+ back: { type: Boolean }
263
+ };
264
+ static styles = [i, l`
265
+ :host {
266
+ display: inline;
267
+ }
268
+ /* One line: a long name ends in an ellipsis with the full text on hover.
269
+ A table caps links with --kd-link-max, since 100% means nothing to an
270
+ auto-layout column. */
271
+ a,
272
+ span.link {
273
+ display: inline-flex;
274
+ align-items: baseline;
275
+ max-width: var(--kd-link-max, 100%);
276
+ min-width: 0;
277
+ vertical-align: bottom;
278
+ }
279
+ .text {
280
+ min-width: 0;
281
+ overflow: hidden;
282
+ text-overflow: ellipsis;
283
+ white-space: nowrap;
284
+ }
285
+ a {
286
+ color: var(--kd-link, inherit);
287
+ text-decoration: none;
288
+ }
289
+ a:hover {
290
+ text-decoration: underline;
291
+ }
292
+ .icon {
293
+ width: 16px;
294
+ height: 16px;
295
+ margin-right: 4px;
296
+ vertical-align: -3px;
297
+ }
298
+ `];
299
+ get link() {
300
+ let e = this.data ?? {};
301
+ return {
302
+ dashboard: e.dashboard ?? this.dashboard,
303
+ href: e.href ?? this.href,
304
+ vars: e.vars ?? this.vars,
305
+ text: e.text ?? this.text,
306
+ icon: e.icon ?? this.icon,
307
+ title: e.title,
308
+ back: e.back ?? this.back
309
+ };
310
+ }
311
+ connectedCallback() {
312
+ super.connectedCallback(), ge(this.ownerDocument?.defaultView);
313
+ }
314
+ #e = () => this.requestUpdate();
315
+ #t = (e) => {
316
+ let t = this.ownerDocument?.defaultView, n = C(this.link, t);
317
+ n !== void 0 && (e.currentTarget.setAttribute("href", n), _e(t, n, e));
318
+ };
319
+ render() {
320
+ let e = this.link, n = C(e, this.ownerDocument?.defaultView), r = t`${x(e.icon)}<span class="text" title=${f(e.text)}
321
+ ><slot>${e.text ?? ""}</slot></span
322
+ >`, i = e.title ?? e.text;
323
+ return n === void 0 ? t`<span class="link" title=${f(i)}>${r}</span>` : t`<a
324
+ href=${n}
325
+ title=${f(i)}
326
+ @click=${this.#t}
327
+ @mouseenter=${this.#e}
328
+ @focus=${this.#e}
329
+ >${r}</a
330
+ >`;
331
+ }
332
+ };
333
+ u("kd-link", T);
334
+ //#endregion
335
+ //#region src/kd/elements/pill.ts
336
+ var E = class extends c {
337
+ static properties = { tone: {} };
338
+ static styles = [
339
+ i,
340
+ b,
341
+ l`
342
+ :host {
343
+ display: inline-block;
344
+ margin: 1px 4px 1px 0;
345
+ vertical-align: baseline;
346
+ }
347
+ span {
348
+ display: inline-block;
349
+ padding: 0 8px;
350
+ border: 1px solid var(--tone-line);
351
+ border-radius: 10px;
352
+ background: color-mix(in srgb, var(--tone) 14%, transparent);
353
+ color: var(--tone-ink);
354
+ font-size: 11px;
355
+ line-height: 18px;
356
+ white-space: nowrap;
357
+ }
358
+ `
359
+ ];
360
+ render() {
361
+ return t`<span class=${y(this.tone)}><slot></slot></span>`;
362
+ }
363
+ };
364
+ u("kd-pill", E);
365
+ //#endregion
366
+ //#region src/kd/cell.ts
367
+ function D(e) {
368
+ return e == null || e === "" || Array.isArray(e) && e.every(D);
369
+ }
370
+ function O(e) {
371
+ return e == null ? a : Array.isArray(e) ? t`<span class="cells">${e.filter((e) => !D(e)).map((e) => t`<span>${O(e)}</span>`)}</span>` : typeof e == "object" ? "dashboard" in e || "href" in e ? t`<kd-link .data=${e}></kd-link>` : "data" in e ? t`<kd-data .data=${e.data}></kd-data>` : "code" in e ? t`<code>${String(e.code)}</code>` : "text" in e ? t`<kd-pill tone=${f(e.tone)} title=${f(e.title)}>${String(e.text)}</kd-pill>` : t`<kd-data .data=${e}></kd-data>` : String(e);
372
+ }
373
+ var k = l`
374
+ .cells {
375
+ display: inline-flex;
376
+ flex-wrap: wrap;
377
+ align-items: baseline;
378
+ gap: 2px 6px;
379
+ }
380
+ code {
381
+ font-family: var(--kd-font-mono, monospace);
382
+ font-size: 12px;
383
+ overflow-wrap: anywhere;
384
+ }
385
+ `, A = class extends c {
386
+ static properties = { data: {
387
+ attribute: "data",
388
+ converter: o
389
+ } };
390
+ static styles = [
391
+ i,
392
+ k,
393
+ l`
394
+ .bar {
395
+ display: flex;
396
+ flex-wrap: wrap;
397
+ align-items: center;
398
+ gap: 8px 16px;
399
+ padding: 0 4px;
400
+ }
401
+ img.icon {
402
+ width: 42px;
403
+ height: 42px;
404
+ }
405
+ span.icon {
406
+ font-size: 34px;
407
+ line-height: 1;
408
+ }
409
+ .eyebrow {
410
+ color: var(--kd-text-2, inherit);
411
+ font-size: 11px;
412
+ letter-spacing: 0.1em;
413
+ text-transform: uppercase;
414
+ }
415
+ .title {
416
+ font-size: 22px;
417
+ font-weight: 500;
418
+ line-height: 1.2;
419
+ overflow-wrap: anywhere;
420
+ }
421
+ .grow {
422
+ flex: 1;
423
+ }
424
+ .chain {
425
+ font-size: 13px;
426
+ }
427
+ .sep {
428
+ margin: 0 6px;
429
+ color: var(--kd-text-dim, inherit);
430
+ }
431
+ `
432
+ ];
433
+ render() {
434
+ let e = this.data;
435
+ if (!e) return a;
436
+ let n = (e.chips ?? []).filter((e) => !D(e)), r = (e.chain ?? []).filter((e) => !D(e));
437
+ return t`<div class="bar">
438
+ ${x(e.icon)}
439
+ <div class="id">
440
+ ${D(e.eyebrow) ? a : t`<div class="eyebrow">${O(e.eyebrow)}</div>`}
441
+ <div class="title">${e.title ?? ""}</div>
442
+ </div>
443
+ ${n.length ? t`<div class="chips">${n.map((e) => O(e))}</div>` : a}
444
+ <div class="grow"></div>
445
+ ${r.length ? t`<nav class="chain">
446
+ ${r.map((e, n) => t`${n ? t`<span class="sep">›</span>` : a}${O(e)}`)}
447
+ </nav>` : a}
448
+ </div>`;
449
+ }
450
+ };
451
+ u("kd-bar", A);
452
+ //#endregion
453
+ //#region node_modules/lit-html/directive.js
454
+ var j = {
455
+ ATTRIBUTE: 1,
456
+ CHILD: 2,
457
+ PROPERTY: 3,
458
+ BOOLEAN_ATTRIBUTE: 4,
459
+ EVENT: 5,
460
+ ELEMENT: 6
461
+ }, M = (e) => (...t) => ({
462
+ _$litDirective$: e,
463
+ values: t
464
+ }), N = class {
465
+ constructor(e) {}
466
+ get _$AU() {
467
+ return this._$AM._$AU;
468
+ }
469
+ _$AT(e, t, n) {
470
+ this._$Ct = e, this._$AM = t, this._$Ci = n;
471
+ }
472
+ _$AS(e, t) {
473
+ return this.update(e, t);
474
+ }
475
+ update(e, t) {
476
+ return this.render(...t);
477
+ }
478
+ }, P = class extends N {
479
+ constructor(e) {
480
+ if (super(e), this.it = a, e.type !== j.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
481
+ }
482
+ render(e) {
483
+ if (e === a || e == null) return this._t = void 0, this.it = e;
484
+ if (e === s) return e;
485
+ if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
486
+ if (e === this.it) return this._t;
487
+ this.it = e;
488
+ let t = [e];
489
+ return t.raw = t, this._t = {
490
+ _$litType$: this.constructor.resultType,
491
+ strings: t,
492
+ values: []
493
+ };
494
+ }
495
+ };
496
+ P.directiveName = "unsafeHTML", P.resultType = 1;
497
+ var ve = M(P), F = () => import("./highlight-D54M45bZ.js"), ye = 262144, I = 1e4, L = {
498
+ fromAttribute: (e) => e !== null && e !== "false" && e !== "0",
499
+ toAttribute: (e) => e ? "" : "false"
500
+ };
501
+ function R(e) {
502
+ let t = /* @__PURE__ */ new Set();
503
+ if (Array.isArray(e) || typeof e == "number") {
504
+ for (let n of [e].flat()) Number.isInteger(n) && t.add(n);
505
+ return t;
506
+ }
507
+ for (let n of String(e ?? "").split(",")) {
508
+ let e = /^\s*L?(\d+)\s*(?:-\s*L?(\d+)\s*)?$/i.exec(n);
509
+ if (!e) continue;
510
+ let r = Number(e[1]), i = e[2] ? Number(e[2]) : r;
511
+ for (let e = Math.min(r, i); e <= Math.max(r, i) && t.size < I; e++) t.add(e);
512
+ }
513
+ return t;
514
+ }
515
+ var z = (e) => e.replace(/\r\n?/g, "\n").replace(/\n$/, ""), B = class extends c {
516
+ static properties = {
517
+ text: {},
518
+ language: {},
519
+ filename: {},
520
+ lines: { converter: L },
521
+ wrap: { converter: L },
522
+ highlight: {},
523
+ start: { type: Number }
524
+ };
525
+ static styles = [i, l`
526
+ :host {
527
+ position: relative;
528
+ }
529
+ pre {
530
+ margin: 0;
531
+ padding: 8px 0;
532
+ border: 1px solid var(--kd-border, transparent);
533
+ border-radius: var(--kd-radius, 4px);
534
+ background: var(--kd-canvas, transparent);
535
+ font-family: var(--kd-font-mono, monospace);
536
+ font-size: 12.5px;
537
+ line-height: 1.5;
538
+ tab-size: 4;
539
+ overflow: auto;
540
+ }
541
+ code {
542
+ display: block;
543
+ min-width: max-content;
544
+ font: inherit;
545
+ }
546
+ .wrap code {
547
+ min-width: 0;
548
+ }
549
+ .line {
550
+ display: block;
551
+ min-height: 1.5em;
552
+ padding: 0 12px;
553
+ white-space: pre;
554
+ }
555
+ .wrap .line {
556
+ white-space: pre-wrap;
557
+ overflow-wrap: anywhere;
558
+ }
559
+ .numbered .line {
560
+ position: relative;
561
+ padding-left: calc(var(--gutter) + 28px);
562
+ }
563
+ .numbered .line::before {
564
+ position: absolute;
565
+ left: 0;
566
+ width: calc(var(--gutter) + 12px);
567
+ color: var(--kd-text-dim, inherit);
568
+ text-align: right;
569
+ counter-increment: line;
570
+ content: counter(line);
571
+ user-select: none;
572
+ }
573
+ .hl {
574
+ background: color-mix(in srgb, var(--kd-warning, transparent) 16%, transparent);
575
+ box-shadow: inset 2px 0 var(--kd-warning, currentColor);
576
+ }
577
+ /* Above the numbered lines, which are positioned too and come later. */
578
+ .tools {
579
+ position: absolute;
580
+ z-index: 1;
581
+ top: 5px;
582
+ right: 5px;
583
+ display: flex;
584
+ align-items: center;
585
+ gap: 4px;
586
+ padding: 2px;
587
+ border-radius: var(--kd-radius, 4px);
588
+ background: color-mix(in srgb, var(--kd-bg-2, transparent) 85%, var(--kd-bg, transparent));
589
+ opacity: 0;
590
+ transition: opacity 0.15s;
591
+ }
592
+ :host(:hover) .tools,
593
+ .tools:focus-within {
594
+ opacity: 1;
595
+ }
596
+ .lang {
597
+ margin-right: 2px;
598
+ color: var(--kd-text-dim, inherit);
599
+ font-size: 11px;
600
+ }
601
+ button {
602
+ padding: 1px 7px;
603
+ border: 1px solid var(--kd-border, transparent);
604
+ border-radius: var(--kd-radius, 4px);
605
+ background: var(--kd-bg-2, transparent);
606
+ color: var(--kd-text-2, inherit);
607
+ font: inherit;
608
+ font-size: 11px;
609
+ cursor: pointer;
610
+ }
611
+ button:hover,
612
+ button[aria-pressed='true'] {
613
+ border-color: var(--kd-border-strong, currentColor);
614
+ color: var(--kd-text, inherit);
615
+ }
616
+
617
+ /* highlight.js scopes, onto the theme's tones as kd-data colours YAML */
618
+ .hljs-keyword,
619
+ .hljs-literal,
620
+ .hljs-selector-tag,
621
+ .hljs-name,
622
+ .hljs-doctag {
623
+ color: color-mix(in srgb, var(--kd-primary, currentColor) 75%, var(--kd-text, currentColor));
624
+ }
625
+ .hljs-string,
626
+ .hljs-regexp,
627
+ .hljs-char,
628
+ .hljs-meta .hljs-string {
629
+ color: color-mix(in srgb, var(--kd-success, currentColor) 70%, var(--kd-text, currentColor));
630
+ }
631
+ .hljs-number,
632
+ .hljs-symbol,
633
+ .hljs-bullet,
634
+ .hljs-built_in,
635
+ .hljs-type,
636
+ .hljs-title.class_ {
637
+ color: color-mix(in srgb, var(--kd-warning, currentColor) 60%, var(--kd-text, currentColor));
638
+ }
639
+ .hljs-title,
640
+ .hljs-title.function_,
641
+ .hljs-section {
642
+ color: color-mix(in srgb, var(--kd-error, currentColor) 60%, var(--kd-text, currentColor));
643
+ }
644
+ .hljs-attr,
645
+ .hljs-attribute,
646
+ .hljs-property,
647
+ .hljs-variable,
648
+ .hljs-template-variable,
649
+ .hljs-selector-attr,
650
+ .hljs-selector-class,
651
+ .hljs-selector-id,
652
+ .hljs-selector-pseudo,
653
+ .hljs-link {
654
+ color: color-mix(in srgb, var(--kd-info, currentColor) 75%, var(--kd-text, currentColor));
655
+ }
656
+ .hljs-comment,
657
+ .hljs-quote,
658
+ .hljs-meta {
659
+ color: var(--kd-text-dim, inherit);
660
+ }
661
+ .hljs-comment,
662
+ .hljs-quote,
663
+ .hljs-emphasis {
664
+ font-style: italic;
665
+ }
666
+ .hljs-section,
667
+ .hljs-strong {
668
+ font-weight: 600;
669
+ }
670
+ .hljs-addition {
671
+ background: color-mix(in srgb, var(--kd-success, transparent) 15%, transparent);
672
+ color: color-mix(in srgb, var(--kd-success, currentColor) 70%, var(--kd-text, currentColor));
673
+ }
674
+ .hljs-deletion {
675
+ background: color-mix(in srgb, var(--kd-error, transparent) 15%, transparent);
676
+ color: color-mix(in srgb, var(--kd-error, currentColor) 70%, var(--kd-text, currentColor));
677
+ }
678
+ .hljs-subst,
679
+ .hljs-params {
680
+ color: inherit;
681
+ }
682
+ `];
683
+ #e;
684
+ #t = null;
685
+ #n;
686
+ #r;
687
+ constructor() {
688
+ super(), this.lines = !0, this.wrap = !1, this.start = 1;
689
+ }
690
+ async getUpdateComplete() {
691
+ let e = await super.getUpdateComplete();
692
+ for (; this.#n;) await this.#n, e = await super.getUpdateComplete();
693
+ return e;
694
+ }
695
+ willUpdate(e) {
696
+ if (!e.has("text") && !e.has("language") && !e.has("filename")) return;
697
+ let t = typeof this.text == "string" ? z(this.text) : "", { language: n, filename: r } = this, i = JSON.stringify([
698
+ t,
699
+ n,
700
+ r
701
+ ]);
702
+ i !== this.#e && (this.#e = i, this.#t = null, this.#n = void 0, !(!t || !n && !r || t.length > ye || t.split("\n").length > I) && (this.#n = F().then((e) => {
703
+ let i = e.languageOf(n) ?? e.languageOfFile(r);
704
+ return i ? e.highlight(t, i) : null;
705
+ }).catch(() => null).then((e) => {
706
+ i === this.#e && (this.#t = e, this.#n = void 0, this.requestUpdate());
707
+ })));
708
+ }
709
+ async #i() {
710
+ let e = this.ownerDocument.defaultView?.navigator?.clipboard;
711
+ if (e && typeof this.text == "string") {
712
+ try {
713
+ await e.writeText(this.text);
714
+ } catch {
715
+ return;
716
+ }
717
+ clearTimeout(this.#r), this.#r = setTimeout(() => {
718
+ this.#r = void 0, this.requestUpdate();
719
+ }, 1500), this.requestUpdate();
720
+ }
721
+ }
722
+ render() {
723
+ if (typeof this.text != "string") return a;
724
+ let e = this.#t, n = e ? e.lines : z(this.text).split("\n"), r = Number.isFinite(this.start) ? Math.trunc(this.start) : 1, i = R(this.highlight), o = (e) => i.has(r + e) ? "line hl" : "line", s = e ? ve(n.map((e, t) => `<span class="${o(t)}">${e}</span>`).join("")) : n.map((e, n) => t`<span class=${o(n)}>${e}</span>`), c = String(r + n.length - 1).length, l = [this.lines ? "numbered" : "", this.wrap ? "wrap" : ""].join(" ");
725
+ return t`<div class="tools">
726
+ ${e ? t`<span class="lang">${e.name}</span>` : a}
727
+ <button type="button" aria-pressed=${this.wrap ? "true" : "false"} @click=${() => this.wrap = !this.wrap}>
728
+ Wrap
729
+ </button>
730
+ <button type="button" @click=${() => this.#i()}>${this.#r ? "Copied" : "Copy"}</button>
731
+ </div>
732
+ <pre class=${l} style="counter-reset: line ${r - 1}; --gutter: ${c}ch"><code>${s}</code></pre>`;
733
+ }
734
+ disconnectedCallback() {
735
+ super.disconnectedCallback(), clearTimeout(this.#r), this.#r = void 0;
736
+ }
737
+ };
738
+ u("kd-code", B);
739
+ //#endregion
740
+ //#region src/kd/elements/groups.ts
741
+ function be(e) {
742
+ let t = /* @__PURE__ */ new Map();
743
+ for (let [n, r] of Object.entries(e)) {
744
+ let e = n.indexOf("/"), i = e < 0 ? "" : n.slice(0, e), a = r == null ? "" : typeof r == "string" ? r : JSON.stringify(r), o = t.get(i);
745
+ o || t.set(i, o = {
746
+ prefix: i,
747
+ entries: []
748
+ }), o.entries.push({
749
+ key: n,
750
+ name: n.slice(e + 1),
751
+ value: a
752
+ });
753
+ }
754
+ return [...t.values()].sort((e, t) => e.prefix < t.prefix ? -1 : +(e.prefix > t.prefix));
755
+ }
756
+ function xe(e) {
757
+ if (/^\s*[[{]/.test(e)) try {
758
+ let t = JSON.parse(e);
759
+ return typeof t == "object" && t ? t : void 0;
760
+ } catch {
761
+ return;
762
+ }
763
+ }
764
+ var Se = 600, Ce = class extends c {
765
+ static properties = {
766
+ data: {
767
+ attribute: "data",
768
+ converter: o
769
+ },
770
+ mode: {}
771
+ };
772
+ static styles = [i, l`
773
+ .group + .group {
774
+ margin-top: 12px;
775
+ }
776
+ div.head,
777
+ tr.head td {
778
+ padding-bottom: 3px;
779
+ border-bottom: 1px solid var(--kd-border, transparent);
780
+ color: var(--kd-text-2, inherit);
781
+ font-family: var(--kd-font-mono, monospace);
782
+ font-size: 11px;
783
+ }
784
+ div.head {
785
+ margin-bottom: 6px;
786
+ }
787
+ table {
788
+ width: 100%;
789
+ border-collapse: collapse;
790
+ font-size: 13px;
791
+ }
792
+ td {
793
+ padding: 2px 12px 2px 0;
794
+ vertical-align: top;
795
+ }
796
+ tr.head td {
797
+ padding-top: 12px;
798
+ }
799
+ tr.head:first-child td {
800
+ padding-top: 0;
801
+ }
802
+ tr.head + tr td {
803
+ padding-top: 6px;
804
+ }
805
+ .k {
806
+ white-space: nowrap;
807
+ }
808
+ code {
809
+ font-family: var(--kd-font-mono, monospace);
810
+ font-size: 12px;
811
+ }
812
+ .twig {
813
+ margin: 0 8px 0 4px;
814
+ color: var(--kd-text-dim, inherit);
815
+ font-family: var(--kd-font-mono, monospace);
816
+ }
817
+ .v {
818
+ width: 100%;
819
+ color: color-mix(in srgb, var(--kd-success, currentColor) 70%, var(--kd-text, currentColor));
820
+ font-family: var(--kd-font-mono, monospace);
821
+ font-size: 12px;
822
+ overflow-wrap: anywhere;
823
+ word-break: break-word;
824
+ }
825
+ .none {
826
+ padding: 8px 0;
827
+ color: var(--kd-text-dim, inherit);
828
+ }
829
+ `];
830
+ render() {
831
+ let e = this.data;
832
+ if (!e || typeof e != "object") return a;
833
+ let n = be(e);
834
+ return n.length ? this.mode === "tree" ? this.#t(n) : this.#e(n) : t`<div class="none">none</div>`;
835
+ }
836
+ #e(e) {
837
+ return e.map((e) => t`<div class="group">
838
+ ${e.prefix ? t`<div class="head">${e.prefix}</div>` : a}
839
+ <div>
840
+ ${e.entries.map((e) => t`<kd-pill tone="info" title=${e.key}>${e.value === "" ? e.name : `${e.name}=${e.value}`}</kd-pill>`)}
841
+ </div>
842
+ </div>`);
843
+ }
844
+ #t(e) {
845
+ return t`<table>
846
+ <tbody>
847
+ ${e.map((e) => t`${e.prefix ? t`<tr class="head"><td colspan="2">${e.prefix}</td></tr>` : a}
848
+ ${e.entries.map((n, r) => {
849
+ let i = xe(n.value);
850
+ return t`<tr>
851
+ <td class="k">
852
+ ${e.prefix ? t`<span class="twig">${r === e.entries.length - 1 ? "└" : "├"}</span>` : a}<code
853
+ >${n.name}</code
854
+ >
855
+ </td>
856
+ <td class="v">
857
+ ${i ? t`<kd-data .data=${i}></kd-data>` : n.value.length > Se ? `${n.value.slice(0, Se)} …` : n.value}
858
+ </td>
859
+ </tr>`;
860
+ })}`)}
861
+ </tbody>
862
+ </table>`;
863
+ }
864
+ };
865
+ u("kd-groups", Ce);
866
+ //#endregion
867
+ //#region src/kd/elements/markdown.ts
868
+ var we, Te = /* @__PURE__ */ new WeakMap();
869
+ function Ee() {
870
+ return we ??= import("./marked.esm-BrPimSW6.js").then((e) => new e.Marked({ gfm: !0 })), we;
871
+ }
872
+ function De(e) {
873
+ let t = Te.get(e);
874
+ return t || (t = import("./purify.es-C_X9UTsz.js").then((t) => t.default(e)), Te.set(e, t)), t;
875
+ }
876
+ var Oe = {
877
+ USE_PROFILES: { html: !0 },
878
+ FORBID_TAGS: [
879
+ "style",
880
+ "form",
881
+ "button",
882
+ "textarea",
883
+ "select",
884
+ "option",
885
+ "dialog",
886
+ "iframe",
887
+ "frame",
888
+ "object",
889
+ "embed"
890
+ ],
891
+ FORBID_ATTR: [
892
+ "style",
893
+ "action",
894
+ "formaction"
895
+ ],
896
+ RETURN_DOM_FRAGMENT: !0
897
+ }, ke = /* @__PURE__ */ new Set([
898
+ ...Oe.FORBID_TAGS,
899
+ "script",
900
+ "noscript",
901
+ "template",
902
+ "svg",
903
+ "math",
904
+ "link",
905
+ "meta",
906
+ "base",
907
+ "frameset",
908
+ "applet",
909
+ "portal"
910
+ ]), Ae = /* @__PURE__ */ new Set([
911
+ "href",
912
+ "src",
913
+ "srcset",
914
+ "action",
915
+ "formaction",
916
+ "poster",
917
+ "background",
918
+ "cite",
919
+ "data",
920
+ "xlink:href"
921
+ ]);
922
+ function je(e) {
923
+ for (let t of [...e.querySelectorAll("*")]) if (ke.has(t.localName)) t.remove();
924
+ else for (let { name: e, value: n } of [...t.attributes]) {
925
+ let r = e.toLowerCase();
926
+ r.startsWith("on") || r === "style" || r === "srcdoc" ? t.removeAttribute(e) : Ae.has(r) && /(^|,)\s*(javascript|vbscript|data):/i.test(n.replace(/[\0-\x20]/g, "")) && (r === "src" && t.localName === "img" && /^\s*data:image\/(png|gif|jpe?g|webp);/i.test(n) || t.removeAttribute(e));
927
+ }
928
+ }
929
+ var Me = /^([a-z][a-z\d+.-]*:|\/\/|#)/i;
930
+ function V(e, t, n) {
931
+ if (!t && !n || Me.test(e.trim())) return e;
932
+ try {
933
+ return t ? new URL(e.replace(/^\/+/, ""), t.endsWith("/") ? t : `${t}/`).href : new URL(e, n).href;
934
+ } catch {
935
+ return e;
936
+ }
937
+ }
938
+ function Ne(e) {
939
+ return e.trim().toLowerCase().replace(/[^\p{L}\p{M}\p{N}\s_-]/gu, "").replace(/\s/g, "-");
940
+ }
941
+ var Pe = class extends c {
942
+ static properties = {
943
+ markdown: {},
944
+ src: {},
945
+ base: { converter: o }
946
+ };
947
+ static styles = [i, l`
948
+ .doc {
949
+ font-size: 14px;
950
+ line-height: 1.65;
951
+ overflow-wrap: break-word;
952
+ }
953
+ .doc > :first-child {
954
+ margin-top: 0;
955
+ }
956
+ .doc > :last-child {
957
+ margin-bottom: 0;
958
+ }
959
+ h1,
960
+ h2,
961
+ h3,
962
+ h4,
963
+ h5,
964
+ h6 {
965
+ margin: 1.4em 0 0.6em;
966
+ font-weight: 600;
967
+ line-height: 1.25;
968
+ }
969
+ h1,
970
+ h2 {
971
+ padding-bottom: 0.3em;
972
+ border-bottom: 1px solid var(--kd-border, transparent);
973
+ }
974
+ h1 {
975
+ font-size: 1.9em;
976
+ }
977
+ h2 {
978
+ font-size: 1.5em;
979
+ }
980
+ h3 {
981
+ font-size: 1.2em;
982
+ }
983
+ h4 {
984
+ font-size: 1em;
985
+ }
986
+ h5,
987
+ h6 {
988
+ font-size: 0.9em;
989
+ }
990
+ h6 {
991
+ color: var(--kd-text-2, inherit);
992
+ }
993
+ p,
994
+ ul,
995
+ ol,
996
+ dl,
997
+ table,
998
+ blockquote,
999
+ details,
1000
+ kd-code {
1001
+ margin: 0 0 1em;
1002
+ }
1003
+ ul,
1004
+ ol {
1005
+ padding-left: 2em;
1006
+ }
1007
+ li + li,
1008
+ li > ul,
1009
+ li > ol {
1010
+ margin-top: 0.25em;
1011
+ }
1012
+ li > ul,
1013
+ li > ol {
1014
+ margin-bottom: 0;
1015
+ }
1016
+ li:has(> input[type='checkbox']) {
1017
+ list-style: none;
1018
+ }
1019
+ li > input[type='checkbox'] {
1020
+ margin: 0 0.4em 0.2em -1.5em;
1021
+ vertical-align: middle;
1022
+ }
1023
+ a {
1024
+ color: var(--kd-link, inherit);
1025
+ text-decoration: none;
1026
+ }
1027
+ a:hover {
1028
+ text-decoration: underline;
1029
+ }
1030
+ code {
1031
+ padding: 0.15em 0.35em;
1032
+ border-radius: var(--kd-radius, 4px);
1033
+ background: var(--kd-bg-2, transparent);
1034
+ font-family: var(--kd-font-mono, monospace);
1035
+ font-size: 85%;
1036
+ }
1037
+ pre {
1038
+ padding: 12px 14px;
1039
+ border: 1px solid var(--kd-border, transparent);
1040
+ border-radius: var(--kd-radius, 4px);
1041
+ background: var(--kd-canvas, transparent);
1042
+ overflow: auto;
1043
+ }
1044
+ pre code {
1045
+ padding: 0;
1046
+ background: none;
1047
+ font-size: 100%;
1048
+ }
1049
+ table {
1050
+ display: block;
1051
+ width: max-content;
1052
+ max-width: 100%;
1053
+ border-collapse: collapse;
1054
+ overflow: auto;
1055
+ }
1056
+ th,
1057
+ td {
1058
+ padding: 6px 13px;
1059
+ border: 1px solid var(--kd-border, transparent);
1060
+ }
1061
+ th {
1062
+ background: var(--kd-bg-2, transparent);
1063
+ font-weight: 600;
1064
+ }
1065
+ blockquote {
1066
+ padding: 0 1em;
1067
+ border-left: 4px solid var(--kd-border-strong, currentColor);
1068
+ color: var(--kd-text-2, inherit);
1069
+ }
1070
+ hr {
1071
+ height: 0;
1072
+ margin: 1.5em 0;
1073
+ border: 0;
1074
+ border-top: 1px solid var(--kd-border, transparent);
1075
+ }
1076
+ img {
1077
+ max-width: 100%;
1078
+ box-sizing: content-box;
1079
+ }
1080
+ summary {
1081
+ cursor: pointer;
1082
+ }
1083
+ .none {
1084
+ color: var(--kd-text-dim, inherit);
1085
+ }
1086
+ .raw {
1087
+ margin: 0;
1088
+ font-family: var(--kd-font-mono, monospace);
1089
+ font-size: 12.5px;
1090
+ white-space: pre-wrap;
1091
+ }
1092
+ `];
1093
+ #e = 0;
1094
+ #t;
1095
+ #n;
1096
+ async getUpdateComplete() {
1097
+ let e = await super.getUpdateComplete();
1098
+ for (; this.#t;) await this.#t, e = await super.getUpdateComplete();
1099
+ return await Promise.all([...this.renderRoot.querySelectorAll("kd-code")].map((e) => e.updateComplete)), e;
1100
+ }
1101
+ willUpdate(e) {
1102
+ if (!e.has("markdown") && !e.has("src") && !e.has("base")) return;
1103
+ let t = ++this.#e, { markdown: n, src: r } = this, i = this.base?.links, a = this.base?.images, o = async () => {
1104
+ if (typeof n == "string") return this.#i(n, i, a);
1105
+ if (!r) return;
1106
+ let e = this.ownerDocument.defaultView, o = new URL(r, this.ownerDocument.baseURI).href;
1107
+ try {
1108
+ let n = await (e?.fetch ?? fetch)(o);
1109
+ if (!n.ok) return this.#r(`${n.status} ${r}`);
1110
+ let s = await n.text();
1111
+ return t === this.#e ? this.#i(s, i, a, o) : void 0;
1112
+ } catch {
1113
+ return this.#r(r);
1114
+ }
1115
+ };
1116
+ this.#t = o().then((e) => {
1117
+ t === this.#e && (this.#n = e, this.#t = void 0, this.requestUpdate());
1118
+ });
1119
+ }
1120
+ #r(e) {
1121
+ let t = this.ownerDocument.createElement("p");
1122
+ return t.className = "none", t.textContent = e, t;
1123
+ }
1124
+ async #i(e, t, n, r) {
1125
+ let i = this.ownerDocument, a = i.defaultView;
1126
+ try {
1127
+ if (!a) throw Error("no window");
1128
+ let [o, s] = await Promise.all([Ee(), De(a)]);
1129
+ if (!s.isSupported) throw Error("DOMPurify is not supported here");
1130
+ let c = s.sanitize(`\n${o.parse(e, { async: !1 })}`, Oe), l = i.createElement("div");
1131
+ return l.className = "doc", l.append(c), je(l), this.#a(l, t, n, r), l;
1132
+ } catch {
1133
+ let t = i.createElement("pre");
1134
+ return t.className = "raw", t.textContent = e, t;
1135
+ }
1136
+ }
1137
+ #a(e, t, n, r) {
1138
+ let i = this.ownerDocument, a = /* @__PURE__ */ new Map();
1139
+ for (let t of e.querySelectorAll("h1, h2, h3, h4, h5, h6")) {
1140
+ if (t.id) continue;
1141
+ let e = Ne(t.textContent ?? "") || "section", n = a.get(e) ?? 0;
1142
+ a.set(e, n + 1), t.id = n ? `${e}-${n}` : e;
1143
+ }
1144
+ let o = (e, t, n) => {
1145
+ let i = V(e.getAttribute(t) ?? "", n, r);
1146
+ S(i) ? e.setAttribute(t, i) : e.removeAttribute(t);
1147
+ };
1148
+ for (let n of e.querySelectorAll("a[href]")) n.getAttribute("href")?.startsWith("#") || (o(n, "href", t), n.setAttribute("target", "_blank"), n.setAttribute("rel", "noopener"));
1149
+ for (let t of e.querySelectorAll("img[src]")) o(t, "src", n);
1150
+ for (let t of e.querySelectorAll("img[srcset], source[srcset]")) {
1151
+ let e = (t.getAttribute("srcset") ?? "").split(",").map((e) => {
1152
+ let [t, ...i] = e.trim().split(/\s+/);
1153
+ return [V(t, n, r), ...i].join(" ");
1154
+ }).filter((e) => S(e));
1155
+ t.setAttribute("srcset", e.join(", "));
1156
+ }
1157
+ for (let t of e.querySelectorAll("input")) t.type === "checkbox" ? t.disabled = !0 : t.remove();
1158
+ for (let t of e.querySelectorAll("pre > code")) {
1159
+ let e = t.parentElement, n = i.createElement("kd-code");
1160
+ n.text = (t.textContent ?? "").replace(/\n$/, ""), n.language = /(?:^|\s)language-(\S+)/.exec(t.className)?.[1], n.lines = !1, e.replaceWith(n);
1161
+ }
1162
+ }
1163
+ #o(e) {
1164
+ let t = e.target?.closest?.("a[href^=\"#\"]");
1165
+ if (!t) return;
1166
+ let n = t.getAttribute("href").slice(1);
1167
+ try {
1168
+ n = decodeURIComponent(n);
1169
+ } catch {}
1170
+ let r = this.renderRoot.getElementById(n);
1171
+ r && (e.preventDefault(), r.scrollIntoView({ block: "start" }));
1172
+ }
1173
+ render() {
1174
+ return this.#n ? t`<div @click=${(e) => this.#o(e)}>${this.#n}</div>` : a;
1175
+ }
1176
+ };
1177
+ u("kd-markdown", Pe);
1178
+ //#endregion
1179
+ //#region src/kd/elements/mask.ts
1180
+ var Fe = class extends c {
1181
+ static properties = {
1182
+ value: {},
1183
+ shown: { state: !0 }
1184
+ };
1185
+ static styles = [i, l`
1186
+ :host {
1187
+ display: inline-block;
1188
+ }
1189
+ button {
1190
+ padding: 0;
1191
+ border: none;
1192
+ background: none;
1193
+ color: inherit;
1194
+ font: inherit;
1195
+ cursor: pointer;
1196
+ }
1197
+ .dots {
1198
+ color: var(--kd-text-2, inherit);
1199
+ letter-spacing: 0.1em;
1200
+ }
1201
+ code {
1202
+ font-family: var(--kd-font-mono, monospace);
1203
+ font-size: 12px;
1204
+ overflow-wrap: anywhere;
1205
+ white-space: pre-wrap;
1206
+ user-select: all;
1207
+ }
1208
+ .hide {
1209
+ margin-left: 6px;
1210
+ color: var(--kd-text-dim, inherit);
1211
+ }
1212
+ `];
1213
+ constructor() {
1214
+ super(), this.shown = !1;
1215
+ }
1216
+ willUpdate(e) {
1217
+ e.has("value") && e.get("value") !== void 0 && (this.shown = !1);
1218
+ }
1219
+ render() {
1220
+ return this.shown ? t`<code>${this.value ?? ""}</code
1221
+ ><button type="button" class="hide" aria-label="hide" @click=${() => this.shown = !1}>×</button>` : t`<button type="button" aria-label="show" @click=${() => this.shown = !0}>
1222
+ <span class="dots">••••••••</span>
1223
+ </button>`;
1224
+ }
1225
+ };
1226
+ u("kd-mask", Fe);
1227
+ //#endregion
1228
+ //#region node_modules/lit-html/directives/style-map.js
1229
+ var Ie = "important", Le = " !" + Ie, Re = M(class extends N {
1230
+ constructor(e) {
1231
+ if (super(e), e.type !== j.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
1232
+ }
1233
+ render(e) {
1234
+ return Object.keys(e).reduce((t, n) => {
1235
+ let r = e[n];
1236
+ return r == null ? t : t + `${n = n.includes("-") ? n : n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${r};`;
1237
+ }, "");
1238
+ }
1239
+ update(e, [t]) {
1240
+ let { style: n } = e.element;
1241
+ if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
1242
+ for (let e of this.ft) t[e] ?? (this.ft.delete(e), e.includes("-") ? n.removeProperty(e) : n[e] = null);
1243
+ for (let e in t) {
1244
+ let r = t[e];
1245
+ if (r != null) {
1246
+ this.ft.add(e);
1247
+ let t = typeof r == "string" && r.endsWith(Le);
1248
+ e.includes("-") || t ? n.setProperty(e, t ? r.slice(0, -11) : r, t ? Ie : "") : n[e] = r;
1249
+ }
1250
+ }
1251
+ return s;
1252
+ }
1253
+ }), H = (e) => new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(e), ze = class extends c {
1254
+ static properties = { data: {
1255
+ attribute: "data",
1256
+ converter: o
1257
+ } };
1258
+ static styles = [
1259
+ i,
1260
+ b,
1261
+ l`
1262
+ .track {
1263
+ position: relative;
1264
+ height: 8px;
1265
+ margin: 6px 0;
1266
+ border-radius: 4px;
1267
+ background: color-mix(in srgb, var(--kd-border-strong, currentColor) 35%, transparent);
1268
+ }
1269
+ .fill {
1270
+ height: 100%;
1271
+ border-radius: 4px;
1272
+ background: var(--tone);
1273
+ }
1274
+ .mark {
1275
+ position: absolute;
1276
+ top: -3px;
1277
+ bottom: -3px;
1278
+ width: 2px;
1279
+ background: var(--tone);
1280
+ box-shadow: 0 0 0 1px var(--kd-bg, transparent);
1281
+ }
1282
+ .legend {
1283
+ display: flex;
1284
+ flex-wrap: wrap;
1285
+ gap: 2px 20px;
1286
+ font-size: 12px;
1287
+ }
1288
+ .value {
1289
+ font-family: var(--kd-font-mono, monospace);
1290
+ font-size: 14px;
1291
+ }
1292
+ .legend .mark-label {
1293
+ color: var(--kd-text-2, inherit);
1294
+ }
1295
+ .legend .num {
1296
+ color: var(--tone-ink);
1297
+ font-family: var(--kd-font-mono, monospace);
1298
+ }
1299
+ .none {
1300
+ color: var(--kd-text-dim, inherit);
1301
+ }
1302
+ `
1303
+ ];
1304
+ render() {
1305
+ let e = this.data;
1306
+ if (!e || typeof e != "object") return a;
1307
+ let n = typeof e.value == "number" && Number.isFinite(e.value) ? e.value : void 0, r = (e.marks ?? []).filter((e) => e && Number.isFinite(e.value)), i = e.unit ?? "", o = Math.max(n ?? 0, ...r.map((e) => e.value)), s = typeof e.max == "number" && e.max > 0 ? e.max : o > 0 ? o : 1, c = (e) => Math.min(1, Math.max(0, e)), l = (e) => `${Math.min(100, Math.max(0, e / s * 100))}%`, u = y((n === void 0 ? [] : r.filter((e) => e.tone && n >= e.value)).sort((e, t) => t.value - e.value)[0]?.tone, "primary");
1308
+ return t`<div
1309
+ role="meter"
1310
+ aria-valuemin="0"
1311
+ aria-valuemax=${s}
1312
+ aria-valuenow=${n ?? a}
1313
+ >
1314
+ <div class="track">
1315
+ ${n === void 0 ? a : t`<div class="fill ${u}" style=${Re({ width: l(n) })}></div>`}
1316
+ ${r.map((e) => t`<div
1317
+ class="mark ${y(e.tone)}"
1318
+ style=${Re({ left: `calc(${l(e.value)} - ${c(e.value / s) * 2}px)` })}
1319
+ title="${e.label} ${H(e.value)}${i}"
1320
+ ></div>`)}
1321
+ </div>
1322
+ <div class="legend">
1323
+ <span class="value ${n === void 0 ? "none" : ""}">${n === void 0 ? "–" : `${H(n)}${i}`}</span>
1324
+ ${r.map((e) => t`<span class=${y(e.tone)}
1325
+ ><span class="mark-label">${e.label}</span> <span class="num">${H(e.value)}${i}</span></span
1326
+ >`)}
1327
+ </div>
1328
+ </div>`;
1329
+ }
1330
+ };
1331
+ u("kd-meter", ze);
1332
+ //#endregion
1333
+ //#region src/kd/elements/sheet.ts
1334
+ var Be = class extends c {
1335
+ static properties = { data: {
1336
+ attribute: "data",
1337
+ converter: o
1338
+ } };
1339
+ static styles = [
1340
+ i,
1341
+ k,
1342
+ l`
1343
+ dl {
1344
+ display: grid;
1345
+ grid-template-columns: max-content minmax(0, 1fr);
1346
+ margin: 0;
1347
+ font-size: 13px;
1348
+ }
1349
+ dt,
1350
+ dd {
1351
+ margin: 0;
1352
+ padding: 5px 12px 5px 0;
1353
+ border-bottom: 1px solid var(--kd-border, transparent);
1354
+ }
1355
+ dt {
1356
+ color: var(--kd-text-2, inherit);
1357
+ }
1358
+ dd {
1359
+ overflow-wrap: anywhere;
1360
+ }
1361
+ `
1362
+ ];
1363
+ render() {
1364
+ let e = this.data;
1365
+ if (!e || typeof e != "object") return a;
1366
+ let n = Array.isArray(e) ? e : Object.entries(e).map(([e, t]) => ({
1367
+ key: e,
1368
+ value: t
1369
+ }));
1370
+ return t`<dl>
1371
+ ${n.filter((e) => e && !D(e.value)).map((e) => t`<dt>${e.key}</dt><dd>${O(e.value)}</dd>`)}
1372
+ </dl>`;
1373
+ }
1374
+ };
1375
+ u("kd-sheet", Be);
1376
+ //#endregion
1377
+ //#region src/kd/elements/steps.ts
1378
+ var Ve = {
1379
+ done: "success",
1380
+ active: "primary",
1381
+ failed: "error",
1382
+ pending: "neutral"
1383
+ };
1384
+ function He(e, t) {
1385
+ return e === "success" ? "✓" : e === "error" ? "✗" : e === "warning" ? "!" : String(t);
1386
+ }
1387
+ var Ue = class extends c {
1388
+ static properties = { data: {
1389
+ attribute: "data",
1390
+ converter: o
1391
+ } };
1392
+ static styles = [
1393
+ i,
1394
+ b,
1395
+ l`
1396
+ ol {
1397
+ display: flex;
1398
+ margin: 0;
1399
+ padding: 0;
1400
+ list-style: none;
1401
+ }
1402
+ li {
1403
+ position: relative;
1404
+ flex: 1;
1405
+ min-width: 0;
1406
+ text-align: center;
1407
+ }
1408
+ li + li::before {
1409
+ content: '';
1410
+ position: absolute;
1411
+ top: 12px;
1412
+ right: 50%;
1413
+ width: 100%;
1414
+ height: 2px;
1415
+ background: var(--kd-border-strong, currentColor);
1416
+ opacity: 0.6;
1417
+ }
1418
+ li.reached::before {
1419
+ background: var(--tone);
1420
+ opacity: 1;
1421
+ }
1422
+ .dot {
1423
+ position: relative;
1424
+ z-index: 1;
1425
+ width: 26px;
1426
+ height: 26px;
1427
+ margin: 0 auto;
1428
+ border-radius: 50%;
1429
+ background: var(--tone);
1430
+ color: var(--kd-bg, inherit);
1431
+ font-size: 13px;
1432
+ font-weight: 700;
1433
+ line-height: 26px;
1434
+ }
1435
+ .neutral .dot {
1436
+ border: 2px solid var(--tone-line);
1437
+ background: var(--kd-bg, transparent);
1438
+ color: var(--kd-text-2, inherit);
1439
+ line-height: 22px;
1440
+ }
1441
+ .active .dot {
1442
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 30%, transparent);
1443
+ }
1444
+ .label {
1445
+ margin-top: 4px;
1446
+ font-size: 12px;
1447
+ }
1448
+ .time,
1449
+ .detail {
1450
+ color: var(--kd-text-2, inherit);
1451
+ font-size: 11px;
1452
+ }
1453
+ .detail {
1454
+ display: -webkit-box;
1455
+ overflow: hidden;
1456
+ -webkit-box-orient: vertical;
1457
+ -webkit-line-clamp: 2;
1458
+ overflow-wrap: anywhere;
1459
+ }
1460
+ `
1461
+ ];
1462
+ render() {
1463
+ let e = Array.isArray(this.data) ? this.data : [];
1464
+ return e.length ? t`<ol>
1465
+ ${e.map((e, n) => {
1466
+ let r = y(Ve[e.status] ?? e.status), i = `${r}${e.status === "done" || e.status === "success" ? " reached" : ""}${e.status === "active" ? " active" : ""}`;
1467
+ return t`<li class=${i} title=${f(e.detail)}>
1468
+ <div class="dot">${He(r, n + 1)}</div>
1469
+ <div class="label">${e.label}</div>
1470
+ ${e.time ? t`<div class="time">${e.time}</div>` : a}
1471
+ ${e.detail ? t`<div class="detail">${e.detail}</div>` : a}
1472
+ </li>`;
1473
+ })}
1474
+ </ol>` : a;
1475
+ }
1476
+ };
1477
+ u("kd-steps", Ue);
1478
+ //#endregion
1479
+ //#region src/kd/elements/table.ts
1480
+ var We = class extends c {
1481
+ static properties = {
1482
+ data: {
1483
+ attribute: "data",
1484
+ converter: o
1485
+ },
1486
+ empty: {}
1487
+ };
1488
+ static styles = [
1489
+ i,
1490
+ k,
1491
+ l`
1492
+ table {
1493
+ width: 100%;
1494
+ border-collapse: collapse;
1495
+ font-size: 13px;
1496
+ }
1497
+ th,
1498
+ td {
1499
+ padding: 6px 12px 6px 0;
1500
+ border-bottom: 1px solid var(--kd-border, transparent);
1501
+ text-align: left;
1502
+ vertical-align: top;
1503
+ }
1504
+ th {
1505
+ color: var(--kd-text-2, inherit);
1506
+ font-size: 10px;
1507
+ font-weight: 500;
1508
+ letter-spacing: 0.08em;
1509
+ text-transform: uppercase;
1510
+ }
1511
+ .center {
1512
+ text-align: center;
1513
+ }
1514
+ .right {
1515
+ text-align: right;
1516
+ }
1517
+ /* Prose breaks anywhere so one hash in a message cannot widen the table;
1518
+ links keep whole words and stop at 40ch with an ellipsis instead. */
1519
+ td {
1520
+ --kd-link-max: 40ch;
1521
+ overflow-wrap: anywhere;
1522
+ }
1523
+ .nowrap {
1524
+ white-space: nowrap;
1525
+ }
1526
+ .nowrap .cells {
1527
+ flex-wrap: nowrap;
1528
+ }
1529
+ .none {
1530
+ padding: 8px 0;
1531
+ color: var(--kd-text-dim, inherit);
1532
+ }
1533
+ `
1534
+ ];
1535
+ render() {
1536
+ let e = this.data;
1537
+ if (!e || typeof e != "object") return a;
1538
+ let { columns: n, rows: r = [] } = Array.isArray(e) ? {
1539
+ columns: void 0,
1540
+ rows: e
1541
+ } : e;
1542
+ if (!r.length) return t`<div class="none">${this.empty ?? "none"}</div>`;
1543
+ let i = n ?? [...new Set(r.flatMap((e) => Object.keys(e ?? {})))].map((e) => ({ key: e })), o = (e) => e.align === "right" || e.align === "center" ? e.align : "", s = (e) => [o(e), e.nowrap ? "nowrap" : ""].filter(Boolean).join(" ");
1544
+ return t`<table>
1545
+ <thead>
1546
+ <tr>
1547
+ ${i.map((e) => t`<th class=${o(e)}>${e.label ?? e.key}</th>`)}
1548
+ </tr>
1549
+ </thead>
1550
+ <tbody>
1551
+ ${r.map((e) => t`<tr>
1552
+ ${i.map((n) => t`<td class=${s(n)}>${O(e?.[n.key])}</td>`)}
1553
+ </tr>`)}
1554
+ </tbody>
1555
+ </table>`;
1556
+ }
1557
+ };
1558
+ u("kd-table", We);
1559
+ //#endregion
1560
+ //#region src/kd/elements/tabs.ts
1561
+ var U = (e, t) => e.getAttribute("label") || `Tab ${t + 1}`, Ge = class extends c {
1562
+ static properties = {
1563
+ selected: {},
1564
+ key: {}
1565
+ };
1566
+ static shadowRootOptions = {
1567
+ ...e.shadowRootOptions,
1568
+ slotAssignment: "manual"
1569
+ };
1570
+ static styles = [i, l`
1571
+ [role='tablist'] {
1572
+ display: flex;
1573
+ flex-wrap: wrap;
1574
+ gap: 0 22px;
1575
+ margin-bottom: 10px;
1576
+ border-bottom: 1px solid var(--kd-border, transparent);
1577
+ }
1578
+ button {
1579
+ margin: 0 0 -1px;
1580
+ padding: 6px 1px;
1581
+ border: none;
1582
+ border-bottom: 2px solid transparent;
1583
+ background: none;
1584
+ color: var(--kd-text-2, inherit);
1585
+ font: inherit;
1586
+ font-size: 13px;
1587
+ cursor: pointer;
1588
+ }
1589
+ button:hover {
1590
+ color: var(--kd-text, inherit);
1591
+ }
1592
+ /* Grafana's own active tab is underlined in this orange. */
1593
+ button[aria-selected='true'] {
1594
+ border-bottom-color: var(--kd-warning, currentColor);
1595
+ color: var(--kd-text, inherit);
1596
+ }
1597
+ .count {
1598
+ margin-left: 2px;
1599
+ color: var(--kd-text-dim, inherit);
1600
+ font-size: 11px;
1601
+ }
1602
+ `];
1603
+ #e;
1604
+ connectedCallback() {
1605
+ super.connectedCallback(), this.#e ??= new MutationObserver(() => this.requestUpdate()), this.#e.observe(this, {
1606
+ childList: !0,
1607
+ subtree: !0,
1608
+ attributes: !0,
1609
+ attributeFilter: ["label", "count"]
1610
+ });
1611
+ }
1612
+ disconnectedCallback() {
1613
+ super.disconnectedCallback(), this.#e?.disconnect();
1614
+ }
1615
+ get #t() {
1616
+ try {
1617
+ return this.ownerDocument?.defaultView?.sessionStorage ?? void 0;
1618
+ } catch {
1619
+ return;
1620
+ }
1621
+ }
1622
+ willUpdate(e) {
1623
+ if (e.has("key") && this.key) try {
1624
+ let e = this.#t?.getItem(`kd-tabs:${this.key}`);
1625
+ e != null && (this.selected = e);
1626
+ } catch {}
1627
+ }
1628
+ #n() {
1629
+ return [...this.children];
1630
+ }
1631
+ #r(e) {
1632
+ let t = this.selected;
1633
+ if (t == null || t === "") return 0;
1634
+ let n = e.findIndex((e, n) => U(e, n) === t);
1635
+ if (n >= 0) return n;
1636
+ let r = Number(t);
1637
+ return Number.isInteger(r) && r >= 0 && r < e.length ? r : 0;
1638
+ }
1639
+ #i(e, t) {
1640
+ let n = U(e[t], t);
1641
+ if (this.key) try {
1642
+ this.#t?.setItem(`kd-tabs:${this.key}`, n);
1643
+ } catch {}
1644
+ n !== this.selected && (this.selected = n, this.dispatchEvent(new CustomEvent("change", {
1645
+ detail: {
1646
+ label: n,
1647
+ index: t
1648
+ },
1649
+ bubbles: !0,
1650
+ composed: !0
1651
+ })));
1652
+ }
1653
+ render() {
1654
+ let e = this.#n();
1655
+ if (!e.length) return a;
1656
+ let n = this.#r(e);
1657
+ return t`<div role="tablist">
1658
+ ${e.map((r, i) => {
1659
+ let o = r.getAttribute("count");
1660
+ return t`<button
1661
+ type="button"
1662
+ role="tab"
1663
+ aria-selected=${i === n ? "true" : "false"}
1664
+ @click=${() => this.#i(e, i)}
1665
+ >
1666
+ ${U(r, i)}${o ? t`<span class="count">${o}</span>` : a}
1667
+ </button>`;
1668
+ })}
1669
+ </div>
1670
+ ${e.map((e, r) => t`<div role="tabpanel" ?hidden=${r !== n}><slot></slot></div>`)}`;
1671
+ }
1672
+ updated() {
1673
+ let e = this.renderRoot.querySelectorAll("slot");
1674
+ this.#n().forEach((t, n) => e[n]?.assign(t));
1675
+ }
1676
+ };
1677
+ u("kd-tabs", Ge);
1678
+ //#endregion
1679
+ //#region src/kd/elements/tile.ts
1680
+ var Ke = class extends c {
1681
+ static properties = {
1682
+ icon: {},
1683
+ label: {},
1684
+ href: {}
1685
+ };
1686
+ static styles = [i, l`
1687
+ a,
1688
+ div {
1689
+ display: block;
1690
+ padding-top: 6px;
1691
+ color: inherit;
1692
+ text-align: center;
1693
+ text-decoration: none;
1694
+ }
1695
+ .icon {
1696
+ display: block;
1697
+ height: 30px;
1698
+ margin: 0 auto;
1699
+ font-size: 30px;
1700
+ line-height: 1;
1701
+ }
1702
+ .label {
1703
+ display: block;
1704
+ margin-top: 6px;
1705
+ color: var(--kd-text-2, inherit);
1706
+ font-size: 12px;
1707
+ }
1708
+ `];
1709
+ render() {
1710
+ let e = t`${x(this.icon)}<span class="label">${this.label ?? ""}</span>`, n = S(this.href);
1711
+ if (!n) return t`<div>${e}</div>`;
1712
+ let r = /^https?:/i.test(n);
1713
+ return t`<a
1714
+ href=${n}
1715
+ target=${f(r ? "_blank" : void 0)}
1716
+ rel=${f(r ? "noopener" : void 0)}
1717
+ >${e}</a
1718
+ >`;
1719
+ }
1720
+ };
1721
+ u("kd-tile", Ke);
1722
+ //#endregion
1723
+ //#region src/kd/feed.ts
1724
+ function qe(e, t = {}) {
1725
+ let r = e?.element;
1726
+ if (!r) return [];
1727
+ n(r, e.grafana?.theme);
1728
+ let i = [];
1729
+ for (let [e, n] of Object.entries(t)) {
1730
+ let t;
1731
+ try {
1732
+ t = r.querySelectorAll(e);
1733
+ } catch {
1734
+ console.warn(`[kd] feed: not a selector: ${e}`);
1735
+ continue;
1736
+ }
1737
+ for (let e of t) Object.assign(e, n), i.push(e);
1738
+ }
1739
+ return i;
1740
+ }
1741
+ function Je(e, t) {
1742
+ let n = "${" + t + "}", r;
1743
+ try {
1744
+ r = e?.grafana?.replaceVariables?.(n);
1745
+ } catch {
1746
+ return "";
1747
+ }
1748
+ return typeof r == "string" && r !== n ? r : "";
1749
+ }
1750
+ //#endregion
1751
+ //#region src/kd/files/types.ts
1752
+ function W(e) {
1753
+ return String(e ?? "").split("/").filter((e) => e !== "" && e !== ".").join("/");
1754
+ }
1755
+ function G(e) {
1756
+ let t = W(e), n = t.lastIndexOf("/");
1757
+ return n < 0 ? "" : t.slice(0, n);
1758
+ }
1759
+ function K(e) {
1760
+ let t = W(e);
1761
+ return t.slice(t.lastIndexOf("/") + 1);
1762
+ }
1763
+ function q(e) {
1764
+ return e.name ?? K(e.path);
1765
+ }
1766
+ function J(e) {
1767
+ let t = Number(e) || 0;
1768
+ return t >= 1073741824 ? `${(t / 1073741824).toFixed(1)} GiB` : t >= 1048576 ? `${(t / 1048576).toFixed(1)} MiB` : t >= 1024 ? `${(t / 1024).toFixed(1)} KiB` : `${t} B`;
1769
+ }
1770
+ function Y(e) {
1771
+ return e == null || e === "" ? NaN : typeof e == "number" ? e : Date.parse(e);
1772
+ }
1773
+ //#endregion
1774
+ //#region src/kd/files/static.ts
1775
+ var X = (e) => "children" in e;
1776
+ function Ye(e, t = {}) {
1777
+ let n = {
1778
+ entry: {
1779
+ path: "",
1780
+ type: "dir"
1781
+ },
1782
+ children: /* @__PURE__ */ new Map()
1783
+ }, r = /* @__PURE__ */ new Map([["", n]]), i = (e) => {
1784
+ let t = r.get(e);
1785
+ if (t) return t;
1786
+ let n = i(e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "");
1787
+ return t = {
1788
+ entry: {
1789
+ path: e,
1790
+ type: "dir"
1791
+ },
1792
+ children: /* @__PURE__ */ new Map()
1793
+ }, r.set(e, t), n.children.set(K(e), t), t;
1794
+ };
1795
+ for (let t of e ?? []) {
1796
+ if (!t || typeof t != "object") continue;
1797
+ let e = W(t.path);
1798
+ if (e) {
1799
+ if (t.type === "dir") {
1800
+ let n = i(e);
1801
+ n.entry = {
1802
+ ...t,
1803
+ path: e
1804
+ };
1805
+ } else {
1806
+ let n = i(e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : ""), r = K(e), a = n.children.get(r);
1807
+ if (a && X(a)) continue;
1808
+ n.children.set(r, {
1809
+ ...t,
1810
+ path: e,
1811
+ type: "file"
1812
+ });
1813
+ }
1814
+ }
1815
+ }
1816
+ let a = (e) => {
1817
+ if (!e.children.size) return e.entry;
1818
+ let t = 0, n, r = -Infinity, i = {};
1819
+ for (let o of e.children.values()) {
1820
+ let e = X(o) ? a(o) : o;
1821
+ t += Number(e.size) || 0;
1822
+ let s = Y(e.modified);
1823
+ s > r && (n = e.modified, r = s);
1824
+ for (let [t, n] of Object.entries(e.stats ?? {})) typeof n == "number" && Number.isFinite(n) && (i[t] = (i[t] ?? 0) + n);
1825
+ }
1826
+ return e.entry = {
1827
+ ...e.entry,
1828
+ size: t,
1829
+ stats: i,
1830
+ ...n === void 0 ? {} : { modified: n }
1831
+ }, e.entry;
1832
+ };
1833
+ return a(n), {
1834
+ list(e) {
1835
+ let t = r.get(W(e));
1836
+ return t ? Promise.resolve([...t.children.values()].map((e) => X(e) ? e.entry : e)) : Promise.reject(/* @__PURE__ */ Error(`no folder ${W(e) || "/"}`));
1837
+ },
1838
+ ...t.read ? { read: t.read } : {},
1839
+ capabilities: {
1840
+ read: !!t.read,
1841
+ write: !1,
1842
+ rename: !1
1843
+ }
1844
+ };
1845
+ }
1846
+ //#endregion
1847
+ //#region src/kd/files/explorer.ts
1848
+ var Xe = [{
1849
+ key: "size",
1850
+ kind: "size"
1851
+ }], Ze = 2e4, Z = (e) => e.kind ?? (e.key === "size" ? "size" : e.key === "modified" ? "modified" : "stat"), Qe = (e, t) => q(e).localeCompare(q(t), void 0, {
1852
+ sensitivity: "base",
1853
+ numeric: !0
1854
+ });
1855
+ function Q(e) {
1856
+ return e == null ? "" : Array.isArray(e) ? e.map(Q).join(" ") : typeof e == "object" ? "text" in e ? String(e.text) : "code" in e ? String(e.code) : "" : String(e);
1857
+ }
1858
+ function $e(e, t, n) {
1859
+ switch (n) {
1860
+ case "name": return q(e);
1861
+ case "size": return Number(e.size) || 0;
1862
+ case "modified": {
1863
+ let t = Y(e.modified);
1864
+ return Number.isNaN(t) ? -Infinity : t;
1865
+ }
1866
+ case "cell": return Q(e.cells?.[t]);
1867
+ default: return Number(e.stats?.[t]) || 0;
1868
+ }
1869
+ }
1870
+ var et = (e, t, n) => `${e} ${e === 1 ? t : n}`, tt = r`<path d="M1.5 3.5h4.5l1.5 1.5h7v8.5h-13z" />`, nt = r`<path d="M3.5 1.5h6l3 3v10h-9z" /><path d="M9.5 1.5v3h3" />`, rt = (e) => t`<svg class="ico" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true">
1871
+ ${e ? tt : nt}
1872
+ </svg>`;
1873
+ function it(e) {
1874
+ let t = Y(e);
1875
+ return Number.isNaN(t) ? "" : new Date(t).toISOString().slice(0, 10);
1876
+ }
1877
+ var at = class extends c {
1878
+ static properties = {
1879
+ provider: { attribute: !1 },
1880
+ entries: {
1881
+ attribute: "entries",
1882
+ converter: o
1883
+ },
1884
+ columns: {
1885
+ attribute: "columns",
1886
+ converter: o
1887
+ },
1888
+ selected: {},
1889
+ variable: {},
1890
+ key: {},
1891
+ valuePrefix: { attribute: "value-prefix" },
1892
+ label: {},
1893
+ filter: { type: Boolean },
1894
+ empty: {}
1895
+ };
1896
+ static styles = [
1897
+ i,
1898
+ b,
1899
+ k,
1900
+ l`
1901
+ :host {
1902
+ font-size: 13px;
1903
+ }
1904
+ .bar {
1905
+ display: flex;
1906
+ flex-wrap: wrap;
1907
+ align-items: center;
1908
+ gap: 6px 10px;
1909
+ padding: 2px 0 8px;
1910
+ }
1911
+ .crumbs {
1912
+ display: flex;
1913
+ flex-wrap: wrap;
1914
+ align-items: center;
1915
+ gap: 4px;
1916
+ min-width: 0;
1917
+ font-size: 14px;
1918
+ }
1919
+ .sep,
1920
+ .dim,
1921
+ .tot {
1922
+ color: var(--kd-text-dim, inherit);
1923
+ }
1924
+ .tot {
1925
+ margin-left: auto;
1926
+ font-size: 12px;
1927
+ }
1928
+ button.crumb {
1929
+ padding: 0;
1930
+ border: none;
1931
+ background: none;
1932
+ color: var(--kd-link, inherit);
1933
+ font: inherit;
1934
+ font-weight: 500;
1935
+ cursor: pointer;
1936
+ }
1937
+ button.crumb:hover {
1938
+ text-decoration: underline;
1939
+ }
1940
+ button.crumb[aria-current='page'] {
1941
+ color: var(--kd-text, inherit);
1942
+ cursor: default;
1943
+ text-decoration: none;
1944
+ }
1945
+ input {
1946
+ flex: 1 1 160px;
1947
+ max-width: 280px;
1948
+ padding: 3px 8px;
1949
+ border: 1px solid var(--kd-border-strong, currentColor);
1950
+ border-radius: var(--kd-radius, 4px);
1951
+ background: transparent;
1952
+ color: inherit;
1953
+ font: inherit;
1954
+ }
1955
+ .rows {
1956
+ outline: none;
1957
+ }
1958
+ .rows:focus-visible {
1959
+ box-shadow: inset 0 0 0 1px var(--kd-primary, currentColor);
1960
+ }
1961
+ table {
1962
+ width: 100%;
1963
+ border-collapse: collapse;
1964
+ }
1965
+ th {
1966
+ padding: 4px 6px;
1967
+ text-align: left;
1968
+ white-space: nowrap;
1969
+ }
1970
+ th:first-child,
1971
+ td:first-child {
1972
+ padding-left: 10px;
1973
+ }
1974
+ button.sort {
1975
+ padding: 2px 0;
1976
+ border: none;
1977
+ background: none;
1978
+ color: var(--kd-text-2, inherit);
1979
+ font: inherit;
1980
+ font-size: 10px;
1981
+ font-weight: 500;
1982
+ letter-spacing: 0.08em;
1983
+ text-transform: uppercase;
1984
+ white-space: nowrap;
1985
+ cursor: pointer;
1986
+ user-select: none;
1987
+ }
1988
+ button.sort:hover,
1989
+ button.sort:focus-visible {
1990
+ color: var(--kd-text, inherit);
1991
+ }
1992
+ button.sort:focus-visible {
1993
+ outline: 1px solid var(--kd-primary, currentColor);
1994
+ outline-offset: 1px;
1995
+ }
1996
+ .glyph {
1997
+ font-size: 12px;
1998
+ letter-spacing: 0;
1999
+ }
2000
+ th[aria-sort='ascending'] button.sort::after {
2001
+ content: ' ▲';
2002
+ }
2003
+ th[aria-sort='descending'] button.sort::after {
2004
+ content: ' ▼';
2005
+ }
2006
+ td {
2007
+ padding: 4px 6px;
2008
+ border-top: 1px solid var(--kd-border, transparent);
2009
+ vertical-align: middle;
2010
+ }
2011
+ .num {
2012
+ width: 1%;
2013
+ text-align: right;
2014
+ white-space: nowrap;
2015
+ }
2016
+ /* The name takes what the numbers leave, down to the .name min-width, and ellipsises. */
2017
+ td.cell-name {
2018
+ width: 100%;
2019
+ max-width: 0;
2020
+ }
2021
+ tbody tr {
2022
+ cursor: pointer;
2023
+ }
2024
+ tbody tr:hover td {
2025
+ background: color-mix(in srgb, var(--kd-text, currentColor) 5%, transparent);
2026
+ }
2027
+ tr.cursor td {
2028
+ background: color-mix(in srgb, var(--kd-text, currentColor) 8%, transparent);
2029
+ }
2030
+ tr[aria-selected='true'] td {
2031
+ background: color-mix(in srgb, var(--kd-primary, currentColor) 16%, transparent);
2032
+ }
2033
+ .name {
2034
+ display: flex;
2035
+ align-items: center;
2036
+ gap: 6px;
2037
+ min-width: 6em;
2038
+ white-space: nowrap;
2039
+ }
2040
+ .ico {
2041
+ flex: none;
2042
+ width: 14px;
2043
+ height: 14px;
2044
+ color: var(--kd-text-2, inherit);
2045
+ }
2046
+ .dir .ico {
2047
+ color: var(--kd-link, inherit);
2048
+ }
2049
+ .label,
2050
+ .under {
2051
+ min-width: 0;
2052
+ overflow: hidden;
2053
+ text-overflow: ellipsis;
2054
+ }
2055
+ .under {
2056
+ flex: 0 1000 auto;
2057
+ }
2058
+ .partial,
2059
+ a.ext {
2060
+ flex: none;
2061
+ }
2062
+ .dir .label {
2063
+ color: var(--kd-link, inherit);
2064
+ font-weight: 500;
2065
+ }
2066
+ .partial {
2067
+ font-size: 11px;
2068
+ font-style: italic;
2069
+ }
2070
+ a.ext {
2071
+ color: var(--kd-text-dim, inherit);
2072
+ text-decoration: none;
2073
+ }
2074
+ a.ext:hover {
2075
+ color: var(--kd-link, inherit);
2076
+ }
2077
+ .stat {
2078
+ font-weight: 600;
2079
+ }
2080
+ .stat.primary,
2081
+ .stat.success,
2082
+ .stat.warning,
2083
+ .stat.error,
2084
+ .stat.info {
2085
+ color: var(--tone-ink);
2086
+ }
2087
+ .none {
2088
+ padding: 8px 10px;
2089
+ color: var(--kd-text-dim, inherit);
2090
+ }
2091
+ `
2092
+ ];
2093
+ #e;
2094
+ #t;
2095
+ #n = !1;
2096
+ #r = null;
2097
+ #i = !1;
2098
+ #a;
2099
+ #o;
2100
+ #s = [];
2101
+ #c;
2102
+ #l = "";
2103
+ #u = 0;
2104
+ #d = "";
2105
+ #f;
2106
+ #p;
2107
+ #m = 0;
2108
+ #h = {
2109
+ key: "name",
2110
+ dir: 1
2111
+ };
2112
+ #g = -1;
2113
+ #_ = !1;
2114
+ get folder() {
2115
+ return this.#t ?? "";
2116
+ }
2117
+ get selectedPath() {
2118
+ let e = String(this.selected ?? ""), t = this.valuePrefix ?? "";
2119
+ return t ? e.startsWith(t) ? W(e.slice(t.length)) : "" : W(e);
2120
+ }
2121
+ get #v() {
2122
+ try {
2123
+ return this.ownerDocument?.defaultView?.sessionStorage ?? void 0;
2124
+ } catch {
2125
+ return;
2126
+ }
2127
+ }
2128
+ #y(e) {
2129
+ if (!this.key) return null;
2130
+ try {
2131
+ return this.#v?.getItem(`kd-files:${this.key}${e}`) ?? null;
2132
+ } catch {
2133
+ return null;
2134
+ }
2135
+ }
2136
+ #b(e, t) {
2137
+ if (this.key) try {
2138
+ this.#v?.setItem(`kd-files:${this.key}${e}`, t);
2139
+ } catch {}
2140
+ }
2141
+ willUpdate(e) {
2142
+ let t = !1;
2143
+ if (e.has("provider") || e.has("entries")) {
2144
+ let e = this.#e;
2145
+ this.#e = this.provider ?? (this.entries ? Ye(this.entries) : void 0), e || (this.#c = void 0), t = !0;
2146
+ }
2147
+ if (e.has("key")) {
2148
+ let e = /^(.*):(1|-1)$/.exec(this.#y(":sort") ?? "");
2149
+ e && (this.#h = {
2150
+ key: e[1],
2151
+ dir: Number(e[2])
2152
+ });
2153
+ }
2154
+ let n = this.selectedPath;
2155
+ if (this.#t === void 0) {
2156
+ let e = this.#y("");
2157
+ this.#n = e !== null, this.#r = this.#y(":selected"), this.#t = e !== null && (!n || this.#x()) ? W(e) : n ? G(n) : "", this.#a = n || void 0, t = !0;
2158
+ } else if (n && n !== this.#a) {
2159
+ let e = this.#a === void 0;
2160
+ this.#a = n;
2161
+ let r = e && this.#n && this.#x();
2162
+ n !== this.#o && !r && G(n) !== this.#t && (this.#t = G(n), this.#i = !1, this.#d = "", this.#p = void 0, t = !0);
2163
+ }
2164
+ t && this.#C();
2165
+ }
2166
+ #x() {
2167
+ return this.#r === String(this.selected ?? "");
2168
+ }
2169
+ #S(e) {
2170
+ this.#b("", e), this.#b(":selected", String(this.selected ?? ""));
2171
+ }
2172
+ #C() {
2173
+ let e = this.#e, t = this.#t ?? "", n = ++this.#u;
2174
+ if (!e) {
2175
+ this.#s = [], this.#c = t;
2176
+ return;
2177
+ }
2178
+ let r;
2179
+ try {
2180
+ r = Promise.resolve(e.list(t));
2181
+ } catch (e) {
2182
+ r = Promise.reject(e);
2183
+ }
2184
+ r.then((e) => {
2185
+ if (n !== this.#u) return;
2186
+ this.#s = Array.isArray(e) ? e.filter((e) => e && typeof e.path == "string") : [];
2187
+ let r = this.#c !== t;
2188
+ this.#c = t, this.#l = "", r && (this.#g = -1), this.#d.trim() && this.#w(), this.requestUpdate();
2189
+ }, (e) => {
2190
+ if (n === this.#u) {
2191
+ if (t !== "" && !this.#i) {
2192
+ let e = G(this.selectedPath);
2193
+ this.#t = e && e !== t ? e : "", this.#C();
2194
+ } else this.#s = [], this.#c = t, this.#l = e instanceof Error ? e.message : String(e), this.requestUpdate();
2195
+ }
2196
+ });
2197
+ }
2198
+ #w() {
2199
+ let e = this.#e, t = this.#d.trim().toLowerCase(), n = ++this.#m;
2200
+ if (!e || !t) {
2201
+ this.#p = void 0;
2202
+ return;
2203
+ }
2204
+ let r = this.#t ?? "", i = [];
2205
+ (async () => {
2206
+ let a = 0, o = [r];
2207
+ for (; o.length && a < Ze;) {
2208
+ let s = o.shift(), c;
2209
+ try {
2210
+ c = s === this.#c ? this.#s : await e.list(s);
2211
+ } catch {
2212
+ continue;
2213
+ }
2214
+ if (n !== this.#m) return;
2215
+ for (let e of c) {
2216
+ if (a += 1, e.type === "dir" && !e.partial && o.push(W(e.path)), !q(e).toLowerCase().includes(t)) continue;
2217
+ let n = s === r ? void 0 : s.slice(r ? r.length + 1 : 0);
2218
+ i.push({
2219
+ entry: e,
2220
+ under: n
2221
+ });
2222
+ }
2223
+ }
2224
+ n === this.#m && (this.#p = i, this.requestUpdate());
2225
+ })();
2226
+ }
2227
+ #T(e, t) {
2228
+ let n = W(e);
2229
+ this.#t = n, this.#i = !0, this.#f = t, this.#d = "", this.#p = void 0, this.#m++, this.#g = -1, this.#S(n), this.dispatchEvent(new CustomEvent("navigate", {
2230
+ detail: {
2231
+ path: n,
2232
+ entry: t
2233
+ },
2234
+ bubbles: !0,
2235
+ composed: !0
2236
+ })), this.#C(), this.requestUpdate();
2237
+ }
2238
+ #E(e) {
2239
+ let t = W(e.path), n = new CustomEvent("select", {
2240
+ detail: {
2241
+ path: t,
2242
+ entry: e
2243
+ },
2244
+ bubbles: !0,
2245
+ composed: !0,
2246
+ cancelable: !0
2247
+ });
2248
+ if (!this.dispatchEvent(n)) return;
2249
+ let r = `${this.valuePrefix ?? ""}${t}`;
2250
+ this.#o = t, this.#a = t, this.selected = r, this.#S(this.#t ?? ""), this.variable && d(this, this.variable, r);
2251
+ }
2252
+ #D(e) {
2253
+ e.up ? this.#T(G(this.#t ?? "")) : e.entry.type === "dir" ? this.#T(e.entry.path, e.entry) : this.#E(e.entry);
2254
+ }
2255
+ #O(e) {
2256
+ let t = this.#h.key === e ? this.#h.dir === 1 ? -1 : 1 : e === "name" ? 1 : -1;
2257
+ this.#h = {
2258
+ key: e,
2259
+ dir: t
2260
+ }, this.#b(":sort", `${e}:${t}`), this.requestUpdate();
2261
+ }
2262
+ get #k() {
2263
+ return Array.isArray(this.columns) ? this.columns.filter((e) => e && typeof e.key == "string") : Xe;
2264
+ }
2265
+ #A() {
2266
+ let e = this.#t ?? "";
2267
+ if (this.#c !== e) return [];
2268
+ let t = this.#d.trim().toLowerCase(), n = this.#p ?? this.#s.filter((e) => !t || q(e).toLowerCase().includes(t)).map((e) => ({ entry: e })), { key: r, dir: i } = this.#h, a = this.#k.find((e) => e.key === r), o = r === "name" || !a ? "name" : Z(a), s = [...n].sort((e, t) => {
2269
+ let n = (e.under === void 0 ? 0 : 1) - (t.under === void 0 ? 0 : 1);
2270
+ if (n) return n;
2271
+ let a = (e.entry.type === "dir" ? 0 : 1) - (t.entry.type === "dir" ? 0 : 1);
2272
+ if (a) return a;
2273
+ let s = $e(e.entry, r, o), c = $e(t.entry, r, o);
2274
+ return (typeof s == "string" || typeof c == "string" ? String(s).localeCompare(String(c), void 0, {
2275
+ sensitivity: "base",
2276
+ numeric: !0
2277
+ }) : s - c) * i || (e.under ?? "").localeCompare(t.under ?? "") || Qe(e.entry, t.entry);
2278
+ });
2279
+ return e ? [{
2280
+ entry: {
2281
+ path: G(e),
2282
+ type: "dir",
2283
+ name: ".."
2284
+ },
2285
+ up: !0
2286
+ }, ...s] : s;
2287
+ }
2288
+ #j(e, t) {
2289
+ if (e.target !== e.currentTarget) return;
2290
+ let n = (n) => {
2291
+ e.preventDefault(), this.#g = Math.max(0, Math.min(t.length - 1, n)), this.#_ = !0, this.requestUpdate();
2292
+ }, r = this.#g;
2293
+ switch (e.key) {
2294
+ case "ArrowDown": return n(r + 1);
2295
+ case "ArrowUp": return n(r - 1);
2296
+ case "Home": return n(0);
2297
+ case "End": return n(t.length - 1);
2298
+ case "Enter":
2299
+ case "ArrowRight":
2300
+ t[r] && (e.key === "Enter" || t[r].entry.type === "dir") && (e.preventDefault(), this.#D(t[r]));
2301
+ return;
2302
+ case "Backspace":
2303
+ case "ArrowLeft":
2304
+ this.#t && (e.preventDefault(), this.#T(G(this.#t)));
2305
+ return;
2306
+ }
2307
+ }
2308
+ #M(e) {
2309
+ e.key === "Escape" ? this.#N("") : e.key === "ArrowDown" && (e.preventDefault(), this.#g = 0, this.renderRoot.querySelector(".rows")?.focus(), this.requestUpdate());
2310
+ }
2311
+ #N(e) {
2312
+ this.#d = e, this.#p = void 0, this.#g = -1, this.#w(), this.requestUpdate();
2313
+ }
2314
+ updated() {
2315
+ this.#_ && (this.#_ = !1, this.renderRoot.querySelector("tr.cursor")?.scrollIntoView?.({ block: "nearest" }));
2316
+ }
2317
+ #P(e) {
2318
+ let n = e ? e.split("/") : [], r = (e, n, r) => t`<button
2319
+ type="button"
2320
+ class="crumb"
2321
+ aria-current=${f(r ? "page" : void 0)}
2322
+ @click=${() => !r && this.#T(n)}
2323
+ >
2324
+ ${e}
2325
+ </button>`;
2326
+ return t`<nav class="crumbs" aria-label="Folder">
2327
+ ${r(this.label || "/", "", !n.length)}
2328
+ ${n.map((e, i) => t`${i || this.label ? t`<span class="sep">/</span>` : a}${r(e, n.slice(0, i + 1).join("/"), i === n.length - 1)}`)}
2329
+ </nav>`;
2330
+ }
2331
+ #F(e, n) {
2332
+ switch (Z(n)) {
2333
+ case "size": return e.size === void 0 && e.type === "dir" ? "" : J(e.size);
2334
+ case "modified": return t`<span title=${f(e.modified === void 0 ? void 0 : String(e.modified))}
2335
+ >${it(e.modified)}</span
2336
+ >`;
2337
+ case "cell": return O(e.cells?.[n.key]);
2338
+ default: {
2339
+ let r = Number(e.stats?.[n.key]) || 0;
2340
+ if (!r) return "";
2341
+ let i = `stat ${n.tone ? y(n.tone) : ""}`;
2342
+ return t`<span class=${i} title=${`${n.label ?? n.key}: ${r}`}>${n.icon ?? ""}${r.toLocaleString("en")}</span>`;
2343
+ }
2344
+ }
2345
+ }
2346
+ #I(e, n, r, i) {
2347
+ let { entry: o } = e, s = o.type === "dir", c = e.up ? void 0 : S(o.href), l = !s && !!r && W(o.path) === r;
2348
+ return t`<tr
2349
+ class=${[s ? "dir" : "file", n === this.#g ? "cursor" : ""].join(" ")}
2350
+ aria-selected=${l ? "true" : "false"}
2351
+ @click=${() => {
2352
+ this.#g = n, this.#D(e);
2353
+ }}
2354
+ >
2355
+ <td class="cell-name">
2356
+ <span class="name">
2357
+ ${rt(s)}
2358
+ ${e.under ? t`<span class="under dim" title=${`${e.under}/`}>${e.under}/</span>` : a}
2359
+ <span class="label" title=${q(o)}>${q(o)}</span>
2360
+ ${o.partial ? t`<span class="partial dim" title="The provider could not list this folder">not listed</span>` : a}
2361
+ ${c ? t`<a class="ext" href=${c} target="_blank" rel="noopener" title="Open" @click=${(e) => e.stopPropagation()}
2362
+ >↗</a
2363
+ >` : a}
2364
+ </span>
2365
+ </td>
2366
+ ${i.map((n) => t`<td class=${Z(n) === "cell" ? "" : "num"}>${e.up ? "" : this.#F(o, n)}</td>`)}
2367
+ </tr>`;
2368
+ }
2369
+ render() {
2370
+ let e = this.#t ?? "", n = this.#k, r = this.#A(), i = this.#c === e, o = r.filter((e) => !e.up && e.under === void 0), s = o.filter((e) => e.entry.type === "dir").length, c = this.#s.reduce((e, t) => e + (Number(t.size) || 0), 0), l = this.selectedPath, u = (e, n, r, i, a) => {
2371
+ let o = this.#h.key === e ? this.#h.dir === 1 ? "ascending" : "descending" : void 0, s = i ? a ? `${n}: ${a}` : n : a;
2372
+ return t`<th class=${r ? "num" : ""} aria-sort=${f(o)}>
2373
+ <button
2374
+ type="button"
2375
+ class="sort"
2376
+ title=${f(s)}
2377
+ aria-label=${f(i ? n : void 0)}
2378
+ @click=${() => this.#O(e)}
2379
+ >
2380
+ ${i ? t`<span class="glyph" aria-hidden="true">${i}</span>` : n}
2381
+ </button>
2382
+ </th>`;
2383
+ }, d;
2384
+ if (!i) d = t`<div class="none">Loading…</div>`;
2385
+ else if (this.#l) d = t`<div class="none">${this.#l}</div>`;
2386
+ else {
2387
+ let i = this.#s.length ? void 0 : this.#L(e), o = this.#d.trim() && r.every((e) => e.up);
2388
+ d = t`<div class="rows" tabindex="0" @keydown=${(e) => this.#j(e, r)}>
2389
+ <table>
2390
+ <thead>
2391
+ <tr>
2392
+ ${u("name", "Name", !1)}
2393
+ ${n.map((e) => u(e.key, e.label ?? e.key, Z(e) !== "cell", e.icon?.trim() || void 0, e.title))}
2394
+ </tr>
2395
+ </thead>
2396
+ <tbody>
2397
+ ${r.map((e, t) => this.#I(e, t, l, n))}
2398
+ </tbody>
2399
+ </table>
2400
+ ${i ?? (o ? t`<div class="none">No matches.</div>` : a)}
2401
+ </div>`;
2402
+ }
2403
+ return t`<div class="bar">
2404
+ ${this.#P(e)}
2405
+ ${this.filter ? t`<input
2406
+ type="search"
2407
+ placeholder="Filter"
2408
+ aria-label="Filter"
2409
+ .value=${this.#d}
2410
+ @input=${(e) => this.#N(e.target.value)}
2411
+ @keydown=${(e) => this.#M(e)}
2412
+ />` : a}
2413
+ ${i && !this.#l ? t`<span class="tot"
2414
+ >${[
2415
+ s ? et(s, "folder", "folders") : "",
2416
+ o.length - s || !s ? et(o.length - s, "file", "files") : "",
2417
+ J(c)
2418
+ ].filter(Boolean).join(" · ")}</span
2419
+ >` : a}
2420
+ </div>
2421
+ ${d}`;
2422
+ }
2423
+ #L(e) {
2424
+ let n = this.#f;
2425
+ if (n?.partial && W(n.path) === e) {
2426
+ let e = S(n.href);
2427
+ return t`<div class="none">
2428
+ This folder was not listed.
2429
+ ${e ? t`<a class="ext" href=${e} target="_blank" rel="noopener">Open it ↗</a>` : a}
2430
+ </div>`;
2431
+ }
2432
+ return t`<div class="none">${this.empty ?? (e ? "This folder is empty." : "No files.")}</div>`;
2433
+ }
2434
+ };
2435
+ u("kd-files", at);
2436
+ //#endregion
2437
+ //#region src/kd/files/file.ts
2438
+ var ot = /* @__PURE__ */ new Set([
2439
+ "md",
2440
+ "markdown",
2441
+ "mdown",
2442
+ "mkd",
2443
+ "mdx"
2444
+ ]), st = /* @__PURE__ */ new Set([
2445
+ "png",
2446
+ "jpg",
2447
+ "jpeg",
2448
+ "gif",
2449
+ "webp",
2450
+ "svg",
2451
+ "avif",
2452
+ "ico",
2453
+ "bmp",
2454
+ "apng"
2455
+ ]), ct = new Set("zip gz tgz bz2 xz zst 7z rar tar jar war class pdf woff woff2 ttf otf eot exe dll so dylib a o wasm mp3 mp4 m4a mov avi mkv webm ogg wav flac psd sqlite db bin dat iso dmg pyc".split(" ")), lt = /^application\/(json|xml|javascript|ecmascript|x-javascript|yaml|x-yaml|toml|x-toml|sql|graphql|x-sh|x-shellscript|x-httpd-php|ld\+json)$|[+](json|xml|yaml)$/, ut = 8e3, dt = (e) => {
2456
+ let t = K(e).toLowerCase(), n = t.lastIndexOf(".");
2457
+ return n > 0 ? t.slice(n + 1) : "";
2458
+ };
2459
+ function ft(e, t) {
2460
+ let n = dt(e), r = String(t ?? "").split(";")[0].trim().toLowerCase();
2461
+ if (r === "markdown" || r === "text/markdown" || r === "text/x-markdown") return "markdown";
2462
+ if (r === "image" || r.startsWith("image/")) return "image";
2463
+ if (r === "binary") return "binary";
2464
+ if (r === "code" || r === "text" || r.startsWith("text/") || lt.test(r)) return ot.has(n) && (r === "text" || r === "text/plain") ? "markdown" : "code";
2465
+ if (r && r !== "application/octet-stream") return "binary";
2466
+ if (ot.has(n)) return "markdown";
2467
+ if (st.has(n)) return "image";
2468
+ if (ct.has(n)) return "binary";
2469
+ }
2470
+ function $(e) {
2471
+ let t = e.slice(0, ut);
2472
+ if (!t) return !1;
2473
+ if (t.includes("\0")) return !0;
2474
+ let n = 0;
2475
+ for (let e = 0; e < t.length; e += 1) {
2476
+ let r = t.charCodeAt(e);
2477
+ (r < 32 && r !== 9 && r !== 10 && r !== 12 && r !== 13 || r === 65533) && (n += 1);
2478
+ }
2479
+ return n / t.length > .1;
2480
+ }
2481
+ async function pt(e) {
2482
+ let t = new Uint8Array(await e.arrayBuffer());
2483
+ if (t.subarray(0, ut).includes(0)) return null;
2484
+ let n = new TextDecoder("utf-8").decode(t);
2485
+ return $(n) ? null : n;
2486
+ }
2487
+ var mt = (e) => e && /^(https?:|blob:|data:image\/|\/|\.{0,2}\/|[^:]*$)/i.test(e.trim()) ? e : void 0, ht = class extends c {
2488
+ static properties = {
2489
+ path: {},
2490
+ text: {},
2491
+ blob: { attribute: !1 },
2492
+ src: {},
2493
+ type: {},
2494
+ size: { type: Number },
2495
+ links: {
2496
+ attribute: "links",
2497
+ converter: o
2498
+ },
2499
+ provider: { attribute: !1 },
2500
+ base: { attribute: !1 },
2501
+ truncated: { type: Boolean },
2502
+ empty: {}
2503
+ };
2504
+ static styles = [i, l`
2505
+ :host {
2506
+ font-size: 13px;
2507
+ }
2508
+ .head {
2509
+ display: flex;
2510
+ flex-wrap: wrap;
2511
+ align-items: baseline;
2512
+ gap: 4px 10px;
2513
+ padding: 2px 0 8px;
2514
+ border-bottom: 1px solid var(--kd-border, transparent);
2515
+ margin-bottom: 8px;
2516
+ }
2517
+ .path {
2518
+ min-width: 0;
2519
+ font-family: var(--kd-font-mono, monospace);
2520
+ overflow-wrap: anywhere;
2521
+ }
2522
+ .dirs,
2523
+ .meta,
2524
+ .none {
2525
+ color: var(--kd-text-dim, inherit);
2526
+ }
2527
+ .name {
2528
+ font-weight: 600;
2529
+ }
2530
+ .meta {
2531
+ font-size: 12px;
2532
+ }
2533
+ .links {
2534
+ display: inline-flex;
2535
+ gap: 10px;
2536
+ margin-left: auto;
2537
+ }
2538
+ .links a {
2539
+ display: inline-flex;
2540
+ align-items: center;
2541
+ gap: 4px;
2542
+ color: var(--kd-link, inherit);
2543
+ text-decoration: none;
2544
+ }
2545
+ .links a:hover {
2546
+ text-decoration: underline;
2547
+ }
2548
+ .icon {
2549
+ width: 16px;
2550
+ height: 16px;
2551
+ }
2552
+ img.image {
2553
+ display: block;
2554
+ max-width: 100%;
2555
+ height: auto;
2556
+ }
2557
+ .none {
2558
+ padding: 8px 0;
2559
+ }
2560
+ `];
2561
+ #e;
2562
+ #t = !1;
2563
+ #n = "";
2564
+ #r = 0;
2565
+ #i;
2566
+ #a;
2567
+ #o;
2568
+ get #s() {
2569
+ return this.text !== void 0 || this.blob !== void 0 || !!this.src;
2570
+ }
2571
+ willUpdate(e) {
2572
+ if (!e.has("provider") && !e.has("path") && !e.has("text") && !e.has("blob") && !e.has("src")) return;
2573
+ let t = ++this.#r;
2574
+ this.#e = void 0, this.#n = "", this.#t = !1;
2575
+ let n = W(this.path), r = this.provider;
2576
+ if (this.#s || !n || typeof r?.read != "function") return;
2577
+ this.#t = !0;
2578
+ let i;
2579
+ try {
2580
+ i = Promise.resolve(r.read(n));
2581
+ } catch (e) {
2582
+ i = Promise.reject(e);
2583
+ }
2584
+ i.then((e) => {
2585
+ t === this.#r && (this.#e = e ?? {}, this.#t = !1, this.requestUpdate());
2586
+ }, (e) => {
2587
+ t === this.#r && (this.#n = e instanceof Error ? e.message : String(e), this.#t = !1, this.requestUpdate());
2588
+ });
2589
+ }
2590
+ disconnectedCallback() {
2591
+ super.disconnectedCallback(), this.#c();
2592
+ }
2593
+ #c() {
2594
+ this.#a && URL.revokeObjectURL(this.#a.url), this.#a = void 0;
2595
+ }
2596
+ #l(e) {
2597
+ return this.#a?.blob !== e && (this.#c(), this.#a = {
2598
+ blob: e,
2599
+ url: URL.createObjectURL(e)
2600
+ }), this.#a.url;
2601
+ }
2602
+ #u(e) {
2603
+ return this.#o?.text !== e && (this.#o = {
2604
+ text: e,
2605
+ blob: new Blob([e], { type: "image/svg+xml" })
2606
+ }), this.#o.blob;
2607
+ }
2608
+ #d(e) {
2609
+ if (this.#i?.blob === e) return this.#i.text;
2610
+ pt(e).then((t) => {
2611
+ this.#i = {
2612
+ blob: e,
2613
+ text: t
2614
+ }, this.requestUpdate();
2615
+ }, () => {
2616
+ this.#i = {
2617
+ blob: e,
2618
+ text: null
2619
+ }, this.requestUpdate();
2620
+ });
2621
+ }
2622
+ #f(e, n, r) {
2623
+ let i = e.lastIndexOf("/"), o = (Array.isArray(this.links) ? this.links : []).filter((e) => e && S(e.href));
2624
+ return t`<div class="head">
2625
+ <span class="path"
2626
+ >${i >= 0 ? t`<span class="dirs">${e.slice(0, i + 1)}</span>` : a}<span class="name"
2627
+ >${e.slice(i + 1)}</span
2628
+ ></span
2629
+ >
2630
+ ${n !== void 0 || r ? t`<span class="meta">${[n === void 0 ? "" : J(n), r].filter(Boolean).join(" · ")}</span>` : a}
2631
+ ${o.length ? t`<span class="links">
2632
+ ${o.map((e) => t`<a href=${S(e.href) ?? ""} target="_blank" rel="noopener" title=${f(e.title ?? e.text)}
2633
+ >${x(e.icon)}${e.text ?? ""}</a
2634
+ >`)}
2635
+ </span>` : a}
2636
+ </div>`;
2637
+ }
2638
+ render() {
2639
+ let e = W(this.path), n = this.#e ?? {}, r = this.text ?? n.text, i = this.blob ?? n.blob, o = this.type ?? n.type ?? (i?.type || void 0), s = this.size ?? n.size ?? i?.size ?? (r === void 0 ? void 0 : new TextEncoder().encode(r).length);
2640
+ if (!e && !r && !i && !this.src) return t`<div class="none">${this.empty ?? "No file selected."}</div>`;
2641
+ let c = ft(e, o), l = a, u = r;
2642
+ if (this.#t) l = t`<div class="none">Loading…</div>`;
2643
+ else if (this.#n) l = t`<div class="none">Could not read this file: ${this.#n}</div>`;
2644
+ else if (c === "image") {
2645
+ let n = i ?? (u !== void 0 && /^\s*</.test(u) ? this.#u(u) : void 0), r = n ? this.#l(n) : mt(this.src);
2646
+ l = r ? t`<img class="image" src=${r} alt=${K(e)} />` : t`<div class="none">An image with nothing to show.</div>`;
2647
+ } else if (u === void 0 && i && c !== "binary") {
2648
+ let e = this.#d(i);
2649
+ e === void 0 ? l = t`<div class="none">Loading…</div>` : e === null ? c = "binary" : u = e;
2650
+ } else u !== void 0 && c === void 0 && $(u) && (c = "binary");
2651
+ l === a && (l = c === "binary" || u === void 0 ? t`<div class="none">
2652
+ ${c === "binary" ? "A binary file" : "A file"} with no text to show${s === void 0 ? "" : `, ${J(s)}`}${o ? ` (${o})` : ""}.
2653
+ </div>` : c === "markdown" ? t`<kd-markdown .markdown=${u} .base=${this.base}></kd-markdown>` : t`<kd-code .text=${u} .filename=${K(e)}></kd-code>`);
2654
+ let d = c === "binary" ? "binary" : "";
2655
+ return t`${e ? this.#f(e, s, d) : a}${l}${this.truncated ? t`<div class="none">Only the start of this file was loaded.</div>` : a}`;
2656
+ }
2657
+ };
2658
+ u("kd-file", ht);
2659
+ //#endregion
2660
+ export { A, b as B, V as C, B as D, xe as E, T as F, ee as G, p as H, C as I, te as K, x as L, D as M, O as N, F as O, E as P, S as R, Pe as S, Ce as T, de as U, fe as V, v as W, We as _, at as a, ze as b, G as c, Y as d, W as f, Ge as g, Ke as h, $ as i, k as j, R as k, q as l, Je as m, pt as n, Ye as o, qe as p, ft as r, K as s, ht as t, J as u, Ue as v, Ne as w, Fe as x, Be as y, y as z };
2661
+
2662
+ //# sourceMappingURL=kd-B0BcpOG_.js.map