@cardstack/boxel-cli 0.2.0 → 0.3.0-unstable.58

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 (882) hide show
  1. package/bundled-types/base/-private.d.ts +1 -0
  2. package/bundled-types/base/address.d.ts +17 -0
  3. package/bundled-types/base/ai-app-generator.d.ts +14 -0
  4. package/bundled-types/base/amount-with-currency.d.ts +10 -0
  5. package/bundled-types/base/avif-image-def.d.ts +12 -0
  6. package/bundled-types/base/avif-meta-extractor.d.ts +4 -0
  7. package/bundled-types/base/base64-image.d.ts +25 -0
  8. package/bundled-types/base/big-integer.d.ts +12 -0
  9. package/bundled-types/base/boolean.d.ts +14 -0
  10. package/bundled-types/base/brand-functional-palette.d.ts +16 -0
  11. package/bundled-types/base/brand-guide.d.ts +26 -0
  12. package/bundled-types/base/brand-logo.d.ts +29 -0
  13. package/bundled-types/base/card-api.d.ts +513 -0
  14. package/bundled-types/base/card-serialization.d.ts +47 -0
  15. package/bundled-types/base/cards-grid.d.ts +10 -0
  16. package/bundled-types/base/code-ref.d.ts +14 -0
  17. package/bundled-types/base/codemirror-editor.d.ts +135 -0
  18. package/bundled-types/base/color-field/components/advanced-color-picker.d.ts +66 -0
  19. package/bundled-types/base/color-field/components/color-picker-field.d.ts +22 -0
  20. package/bundled-types/base/color-field/components/color-wheel-picker.d.ts +44 -0
  21. package/bundled-types/base/color-field/components/contrast-checker-addon.d.ts +14 -0
  22. package/bundled-types/base/color-field/components/recent-colors-addon.d.ts +19 -0
  23. package/bundled-types/base/color-field/components/slider-picker.d.ts +40 -0
  24. package/bundled-types/base/color-field/components/swatches-picker.d.ts +5 -0
  25. package/bundled-types/base/color-field/modifiers/setup-element-modifier.d.ts +10 -0
  26. package/bundled-types/base/color-field/util/color-field-signature.d.ts +9 -0
  27. package/bundled-types/base/color-field/util/color-utils.d.ts +96 -0
  28. package/bundled-types/base/color-field/util/css-color-parsers.d.ts +11 -0
  29. package/bundled-types/base/color.d.ts +10 -0
  30. package/bundled-types/base/command.d.ts +593 -0
  31. package/bundled-types/base/commands/search-card-result.d.ts +36 -0
  32. package/bundled-types/base/components/age.d.ts +22 -0
  33. package/bundled-types/base/components/business-days.d.ts +16 -0
  34. package/bundled-types/base/components/card-list.d.ts +25 -0
  35. package/bundled-types/base/components/cards-grid-layout.d.ts +58 -0
  36. package/bundled-types/base/components/countdown.d.ts +31 -0
  37. package/bundled-types/base/components/expiration-warning.d.ts +24 -0
  38. package/bundled-types/base/components/time-ago.d.ts +24 -0
  39. package/bundled-types/base/components/time-slots.d.ts +20 -0
  40. package/bundled-types/base/components/timeline.d.ts +22 -0
  41. package/bundled-types/base/contains-many-component.d.ts +7 -0
  42. package/bundled-types/base/coordinate.d.ts +7 -0
  43. package/bundled-types/base/country.d.ts +23 -0
  44. package/bundled-types/base/css-value.d.ts +6 -0
  45. package/bundled-types/base/csv-file-def.d.ts +29 -0
  46. package/bundled-types/base/currency.d.ts +16 -0
  47. package/bundled-types/base/date/day.d.ts +9 -0
  48. package/bundled-types/base/date/month-day.d.ts +10 -0
  49. package/bundled-types/base/date/month-year.d.ts +9 -0
  50. package/bundled-types/base/date/month.d.ts +9 -0
  51. package/bundled-types/base/date/quarter.d.ts +10 -0
  52. package/bundled-types/base/date/week.d.ts +9 -0
  53. package/bundled-types/base/date/year.d.ts +9 -0
  54. package/bundled-types/base/date-range-field.d.ts +12 -0
  55. package/bundled-types/base/date.d.ts +12 -0
  56. package/bundled-types/base/datetime-stamp.d.ts +7 -0
  57. package/bundled-types/base/datetime.d.ts +12 -0
  58. package/bundled-types/base/default-templates/atom.d.ts +10 -0
  59. package/bundled-types/base/default-templates/card-info.d.ts +32 -0
  60. package/bundled-types/base/default-templates/embedded.d.ts +11 -0
  61. package/bundled-types/base/default-templates/field-edit.d.ts +10 -0
  62. package/bundled-types/base/default-templates/file-def-edit.d.ts +8 -0
  63. package/bundled-types/base/default-templates/fitted.d.ts +12 -0
  64. package/bundled-types/base/default-templates/head.d.ts +13 -0
  65. package/bundled-types/base/default-templates/image-def-atom.d.ts +8 -0
  66. package/bundled-types/base/default-templates/image-def-embedded.d.ts +8 -0
  67. package/bundled-types/base/default-templates/image-def-fitted.d.ts +8 -0
  68. package/bundled-types/base/default-templates/image-def-isolated.d.ts +8 -0
  69. package/bundled-types/base/default-templates/isolated-and-edit.d.ts +15 -0
  70. package/bundled-types/base/default-templates/markdown-fallback.d.ts +19 -0
  71. package/bundled-types/base/default-templates/markdown.d.ts +60 -0
  72. package/bundled-types/base/default-templates/missing-template.d.ts +13 -0
  73. package/bundled-types/base/default-templates/theme-dashboard.d.ts +126 -0
  74. package/bundled-types/base/detailed-style-reference.d.ts +48 -0
  75. package/bundled-types/base/email.d.ts +10 -0
  76. package/bundled-types/base/enum.d.ts +30 -0
  77. package/bundled-types/base/ethereum-address.d.ts +13 -0
  78. package/bundled-types/base/field-component.d.ts +65 -0
  79. package/bundled-types/base/field-support.d.ts +55 -0
  80. package/bundled-types/base/file-api.d.ts +2 -0
  81. package/bundled-types/base/file-menu-items.d.ts +4 -0
  82. package/bundled-types/base/gif-image-def.d.ts +12 -0
  83. package/bundled-types/base/gif-meta-extractor.d.ts +4 -0
  84. package/bundled-types/base/gts-file-def.d.ts +7 -0
  85. package/bundled-types/base/helpers/country.d.ts +3198 -0
  86. package/bundled-types/base/helpers/sanitized-html.d.ts +2 -0
  87. package/bundled-types/base/helpers/set-background-image.d.ts +2 -0
  88. package/bundled-types/base/image-file-def.d.ts +1 -0
  89. package/bundled-types/base/image.d.ts +8 -0
  90. package/bundled-types/base/index.d.ts +1 -0
  91. package/bundled-types/base/join-the-community.d.ts +14 -0
  92. package/bundled-types/base/jpg-image-def.d.ts +12 -0
  93. package/bundled-types/base/jpg-meta-extractor.d.ts +4 -0
  94. package/bundled-types/base/json-file-def.d.ts +23 -0
  95. package/bundled-types/base/links-to-editor.d.ts +22 -0
  96. package/bundled-types/base/links-to-many-component.d.ts +7 -0
  97. package/bundled-types/base/llm-model.d.ts +6 -0
  98. package/bundled-types/base/markdown-file-def.d.ts +25 -0
  99. package/bundled-types/base/markdown-helpers.d.ts +26 -0
  100. package/bundled-types/base/markdown.d.ts +1 -0
  101. package/bundled-types/base/matrix-event.d.ts +400 -0
  102. package/bundled-types/base/menu-items.d.ts +21 -0
  103. package/bundled-types/base/number/components/badge-counter.d.ts +32 -0
  104. package/bundled-types/base/number/components/badge-metric.d.ts +34 -0
  105. package/bundled-types/base/number/components/badge-notification.d.ts +38 -0
  106. package/bundled-types/base/number/components/gauge.d.ts +45 -0
  107. package/bundled-types/base/number/components/number-input.d.ts +27 -0
  108. package/bundled-types/base/number/components/progress-bar.d.ts +44 -0
  109. package/bundled-types/base/number/components/progress-circle.d.ts +41 -0
  110. package/bundled-types/base/number/components/score.d.ts +41 -0
  111. package/bundled-types/base/number/components/stat.d.ts +38 -0
  112. package/bundled-types/base/number/util/index.d.ts +29 -0
  113. package/bundled-types/base/number.d.ts +52 -0
  114. package/bundled-types/base/percentage.d.ts +9 -0
  115. package/bundled-types/base/phone-number.d.ts +25 -0
  116. package/bundled-types/base/png-image-def.d.ts +12 -0
  117. package/bundled-types/base/png-meta-extractor.d.ts +4 -0
  118. package/bundled-types/base/positioned-card.d.ts +7 -0
  119. package/bundled-types/base/query-field-support.d.ts +6 -0
  120. package/bundled-types/base/realm-config.d.ts +16 -0
  121. package/bundled-types/base/realm.d.ts +7 -0
  122. package/bundled-types/base/resources/command-data.d.ts +43 -0
  123. package/bundled-types/base/response-field.d.ts +6 -0
  124. package/bundled-types/base/rich-markdown.d.ts +30 -0
  125. package/bundled-types/base/shared-state.d.ts +1 -0
  126. package/bundled-types/base/skill-plus.d.ts +79 -0
  127. package/bundled-types/base/skill-reference.d.ts +12 -0
  128. package/bundled-types/base/skill-set.d.ts +18 -0
  129. package/bundled-types/base/skill.d.ts +21 -0
  130. package/bundled-types/base/spec.d.ts +108 -0
  131. package/bundled-types/base/string.d.ts +2 -0
  132. package/bundled-types/base/structured-theme-variables.d.ts +85 -0
  133. package/bundled-types/base/structured-theme.d.ts +32 -0
  134. package/bundled-types/base/style-reference.d.ts +14 -0
  135. package/bundled-types/base/svg-image-def.d.ts +12 -0
  136. package/bundled-types/base/svg-meta-extractor.d.ts +12 -0
  137. package/bundled-types/base/system-card.d.ts +17 -0
  138. package/bundled-types/base/tag.d.ts +15 -0
  139. package/bundled-types/base/text-area.d.ts +2 -0
  140. package/bundled-types/base/text-file-def.d.ts +23 -0
  141. package/bundled-types/base/text-input-validator.d.ts +13 -0
  142. package/bundled-types/base/theme.d.ts +2 -0
  143. package/bundled-types/base/time/duration.d.ts +14 -0
  144. package/bundled-types/base/time/relative-time.d.ts +10 -0
  145. package/bundled-types/base/time/time-range.d.ts +11 -0
  146. package/bundled-types/base/time.d.ts +9 -0
  147. package/bundled-types/base/ts-file-def.d.ts +26 -0
  148. package/bundled-types/base/ts-highlight.d.ts +1 -0
  149. package/bundled-types/base/types/@cardstack/boxel-host/index.d.ts +5 -0
  150. package/bundled-types/base/types/ember-css-url/index.d.ts +15 -0
  151. package/bundled-types/base/typography.d.ts +14 -0
  152. package/bundled-types/base/url.d.ts +13 -0
  153. package/bundled-types/base/watched-array.d.ts +7 -0
  154. package/bundled-types/base/webp-image-def.d.ts +12 -0
  155. package/bundled-types/base/webp-meta-extractor.d.ts +4 -0
  156. package/bundled-types/base/website.d.ts +8 -0
  157. package/bundled-types/base/welcome-to-boxel.d.ts +22 -0
  158. package/bundled-types/boxel-ui/components/accordion/index.gts +50 -0
  159. package/bundled-types/boxel-ui/components/accordion/item/index.gts +156 -0
  160. package/bundled-types/boxel-ui/components/accordion/usage.gts +157 -0
  161. package/bundled-types/boxel-ui/components/add-button/index.gts +46 -0
  162. package/bundled-types/boxel-ui/components/add-button/usage.gts +54 -0
  163. package/bundled-types/boxel-ui/components/alert/index.gts +151 -0
  164. package/bundled-types/boxel-ui/components/alert/usage.gts +66 -0
  165. package/bundled-types/boxel-ui/components/avatar/index.gts +79 -0
  166. package/bundled-types/boxel-ui/components/avatar/usage.gts +96 -0
  167. package/bundled-types/boxel-ui/components/basic-fitted/index.gts +340 -0
  168. package/bundled-types/boxel-ui/components/basic-fitted/usage.gts +223 -0
  169. package/bundled-types/boxel-ui/components/button/index.gts +416 -0
  170. package/bundled-types/boxel-ui/components/button/usage.gts +334 -0
  171. package/bundled-types/boxel-ui/components/card-container/index.gts +251 -0
  172. package/bundled-types/boxel-ui/components/card-container/usage.gts +53 -0
  173. package/bundled-types/boxel-ui/components/card-header/index.gts +473 -0
  174. package/bundled-types/boxel-ui/components/card-header/usage.gts +295 -0
  175. package/bundled-types/boxel-ui/components/circle-spinner/index.gts +42 -0
  176. package/bundled-types/boxel-ui/components/circle-spinner/usage.gts +48 -0
  177. package/bundled-types/boxel-ui/components/color-palette/index.gts +134 -0
  178. package/bundled-types/boxel-ui/components/color-palette/usage.gts +69 -0
  179. package/bundled-types/boxel-ui/components/color-picker/index.gts +125 -0
  180. package/bundled-types/boxel-ui/components/color-picker/usage.gts +56 -0
  181. package/bundled-types/boxel-ui/components/container/index.gts +67 -0
  182. package/bundled-types/boxel-ui/components/container/usage.gts +59 -0
  183. package/bundled-types/boxel-ui/components/context-button/index.gts +184 -0
  184. package/bundled-types/boxel-ui/components/context-button/usage.gts +125 -0
  185. package/bundled-types/boxel-ui/components/copy-button/index.gts +79 -0
  186. package/bundled-types/boxel-ui/components/copy-button/usage.gts +25 -0
  187. package/bundled-types/boxel-ui/components/date-range-picker/index.gts +211 -0
  188. package/bundled-types/boxel-ui/components/date-range-picker/setup.gts +11 -0
  189. package/bundled-types/boxel-ui/components/date-range-picker/usage.gts +52 -0
  190. package/bundled-types/boxel-ui/components/drag-and-drop/index.gts +256 -0
  191. package/bundled-types/boxel-ui/components/drag-and-drop/usage.gts +142 -0
  192. package/bundled-types/boxel-ui/components/dropdown/index.gts +478 -0
  193. package/bundled-types/boxel-ui/components/dropdown/trigger/index.gts +70 -0
  194. package/bundled-types/boxel-ui/components/dropdown/trigger/usage.gts +54 -0
  195. package/bundled-types/boxel-ui/components/dropdown/usage.gts +119 -0
  196. package/bundled-types/boxel-ui/components/email-input/index.gts +111 -0
  197. package/bundled-types/boxel-ui/components/email-input/usage.gts +75 -0
  198. package/bundled-types/boxel-ui/components/entity-icon-display/index.gts +144 -0
  199. package/bundled-types/boxel-ui/components/entity-icon-display/usage.gts +54 -0
  200. package/bundled-types/boxel-ui/components/entity-thumbnail-display/index.gts +148 -0
  201. package/bundled-types/boxel-ui/components/entity-thumbnail-display/usage.gts +76 -0
  202. package/bundled-types/boxel-ui/components/field-container/index.gts +150 -0
  203. package/bundled-types/boxel-ui/components/field-container/usage.gts +188 -0
  204. package/bundled-types/boxel-ui/components/filter-list/index.gts +255 -0
  205. package/bundled-types/boxel-ui/components/filter-list/usage.gts +153 -0
  206. package/bundled-types/boxel-ui/components/fitted-card-container/index.gts +66 -0
  207. package/bundled-types/boxel-ui/components/fitted-card-container/usage.gts +81 -0
  208. package/bundled-types/boxel-ui/components/grid-container/grid-item-container/index.gts +37 -0
  209. package/bundled-types/boxel-ui/components/grid-container/index.gts +116 -0
  210. package/bundled-types/boxel-ui/components/grid-container/usage.gts +105 -0
  211. package/bundled-types/boxel-ui/components/header/index.gts +101 -0
  212. package/bundled-types/boxel-ui/components/header/usage.gts +116 -0
  213. package/bundled-types/boxel-ui/components/icon-button/index.gts +148 -0
  214. package/bundled-types/boxel-ui/components/icon-button/usage.gts +249 -0
  215. package/bundled-types/boxel-ui/components/input/index.gts +560 -0
  216. package/bundled-types/boxel-ui/components/input/usage.gts +449 -0
  217. package/bundled-types/boxel-ui/components/input-group/accessories/index.gts +191 -0
  218. package/bundled-types/boxel-ui/components/input-group/controls/index.gts +54 -0
  219. package/bundled-types/boxel-ui/components/input-group/index.gts +347 -0
  220. package/bundled-types/boxel-ui/components/input-group/usage.gts +437 -0
  221. package/bundled-types/boxel-ui/components/kanban/card.gts +89 -0
  222. package/bundled-types/boxel-ui/components/kanban/column-header.gts +151 -0
  223. package/bundled-types/boxel-ui/components/kanban/drag.gts +1007 -0
  224. package/bundled-types/boxel-ui/components/kanban/engine.ts +247 -0
  225. package/bundled-types/boxel-ui/components/kanban/ghost.gts +64 -0
  226. package/bundled-types/boxel-ui/components/kanban/index.gts +16 -0
  227. package/bundled-types/boxel-ui/components/kanban/modifiers.gts +42 -0
  228. package/bundled-types/boxel-ui/components/kanban/plane-inner.gts +525 -0
  229. package/bundled-types/boxel-ui/components/kanban/plane.gts +163 -0
  230. package/bundled-types/boxel-ui/components/kanban/usage.gts +392 -0
  231. package/bundled-types/boxel-ui/components/label/index.gts +64 -0
  232. package/bundled-types/boxel-ui/components/loading-indicator/index.gts +78 -0
  233. package/bundled-types/boxel-ui/components/loading-indicator/usage.gts +72 -0
  234. package/bundled-types/boxel-ui/components/menu/index.gts +267 -0
  235. package/bundled-types/boxel-ui/components/menu/usage.gts +100 -0
  236. package/bundled-types/boxel-ui/components/message/index.gts +146 -0
  237. package/bundled-types/boxel-ui/components/message/usage.gts +263 -0
  238. package/bundled-types/boxel-ui/components/modal/index.gts +159 -0
  239. package/bundled-types/boxel-ui/components/modal/usage.gts +206 -0
  240. package/bundled-types/boxel-ui/components/multi-select/after-options.gts +59 -0
  241. package/bundled-types/boxel-ui/components/multi-select/index.gts +230 -0
  242. package/bundled-types/boxel-ui/components/multi-select/selected-item.gts +91 -0
  243. package/bundled-types/boxel-ui/components/multi-select/trigger.gts +190 -0
  244. package/bundled-types/boxel-ui/components/multi-select/usage.gts +420 -0
  245. package/bundled-types/boxel-ui/components/phone-input/index.gts +149 -0
  246. package/bundled-types/boxel-ui/components/phone-input/usage.gts +73 -0
  247. package/bundled-types/boxel-ui/components/picker/before-options-with-search.gts +340 -0
  248. package/bundled-types/boxel-ui/components/picker/index.gts +427 -0
  249. package/bundled-types/boxel-ui/components/picker/option-row.gts +270 -0
  250. package/bundled-types/boxel-ui/components/picker/selected-item.gts +171 -0
  251. package/bundled-types/boxel-ui/components/picker/trigger-labeled.gts +216 -0
  252. package/bundled-types/boxel-ui/components/picker/usage.gts +179 -0
  253. package/bundled-types/boxel-ui/components/pill/index.gts +231 -0
  254. package/bundled-types/boxel-ui/components/pill/usage.gts +230 -0
  255. package/bundled-types/boxel-ui/components/progress-bar/index.gts +124 -0
  256. package/bundled-types/boxel-ui/components/progress-bar/usage.gts +131 -0
  257. package/bundled-types/boxel-ui/components/progress-radial/index.gts +95 -0
  258. package/bundled-types/boxel-ui/components/progress-radial/usage.gts +79 -0
  259. package/bundled-types/boxel-ui/components/radio-input/index.gts +143 -0
  260. package/bundled-types/boxel-ui/components/radio-input/item.gts +210 -0
  261. package/bundled-types/boxel-ui/components/radio-input/usage.gts +303 -0
  262. package/bundled-types/boxel-ui/components/realm-icon/index.gts +129 -0
  263. package/bundled-types/boxel-ui/components/realm-icon/usage.gts +62 -0
  264. package/bundled-types/boxel-ui/components/resizable-panel-group/handle.gts +180 -0
  265. package/bundled-types/boxel-ui/components/resizable-panel-group/index.gts +341 -0
  266. package/bundled-types/boxel-ui/components/resizable-panel-group/panel.gts +86 -0
  267. package/bundled-types/boxel-ui/components/resizable-panel-group/usage.gts +350 -0
  268. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/adjust-layout-by-delta.ts +231 -0
  269. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/assert.ts +10 -0
  270. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/calculate-delta-percentage.ts +41 -0
  271. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/calculate-unsafe-default-layout.ts +53 -0
  272. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/compare-layouts.ts +12 -0
  273. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/const.ts +6 -0
  274. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/determine-pivot-indices.ts +15 -0
  275. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-element.ts +10 -0
  276. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-elements-for-group.ts +8 -0
  277. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-panel-group-element.ts +21 -0
  278. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-element-index.ts +14 -0
  279. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-element.ts +12 -0
  280. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/dom/get-resize-handle-elements-for-group.ts +10 -0
  281. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/fuzzy-layouts-equal.ts +22 -0
  282. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/fuzzy-numbers.ts +21 -0
  283. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/get-resize-event-coordinates.ts +8 -0
  284. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/get-resize-event-cursor-position.ts +10 -0
  285. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/panel-resize-handle-registry.ts +446 -0
  286. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/resize-panel.ts +35 -0
  287. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/types.ts +23 -0
  288. package/bundled-types/boxel-ui/components/resizable-panel-group/utils/validate-panel-group-layout.ts +86 -0
  289. package/bundled-types/boxel-ui/components/select/index.gts +882 -0
  290. package/bundled-types/boxel-ui/components/select/trigger.gts +132 -0
  291. package/bundled-types/boxel-ui/components/select/usage.gts +353 -0
  292. package/bundled-types/boxel-ui/components/skeleton-placeholder/index.gts +89 -0
  293. package/bundled-types/boxel-ui/components/skeleton-placeholder/usage.gts +102 -0
  294. package/bundled-types/boxel-ui/components/sort-dropdown/index.gts +91 -0
  295. package/bundled-types/boxel-ui/components/sort-dropdown/usage.gts +77 -0
  296. package/bundled-types/boxel-ui/components/swatch/index.gts +81 -0
  297. package/bundled-types/boxel-ui/components/swatch/usage.gts +57 -0
  298. package/bundled-types/boxel-ui/components/switch/index.gts +95 -0
  299. package/bundled-types/boxel-ui/components/switch/usage.gts +79 -0
  300. package/bundled-types/boxel-ui/components/tabbed-header/index.gts +141 -0
  301. package/bundled-types/boxel-ui/components/tabbed-header/usage.gts +103 -0
  302. package/bundled-types/boxel-ui/components/tag/index.gts +50 -0
  303. package/bundled-types/boxel-ui/components/tag/usage.gts +89 -0
  304. package/bundled-types/boxel-ui/components/tag-list/index.gts +85 -0
  305. package/bundled-types/boxel-ui/components/tag-list/usage.gts +129 -0
  306. package/bundled-types/boxel-ui/components/tooltip/index.gts +306 -0
  307. package/bundled-types/boxel-ui/components/tooltip/usage.gts +168 -0
  308. package/bundled-types/boxel-ui/components/view-selector/index.gts +166 -0
  309. package/bundled-types/boxel-ui/components/view-selector/usage.gts +149 -0
  310. package/bundled-types/boxel-ui/components.ts +169 -0
  311. package/bundled-types/boxel-ui/helpers/add-class-to-svg.ts +8 -0
  312. package/bundled-types/boxel-ui/helpers/clipboard.ts +21 -0
  313. package/bundled-types/boxel-ui/helpers/cn.ts +12 -0
  314. package/bundled-types/boxel-ui/helpers/color-tools.ts +331 -0
  315. package/bundled-types/boxel-ui/helpers/compact.ts +3 -0
  316. package/bundled-types/boxel-ui/helpers/contrast-color.ts +32 -0
  317. package/bundled-types/boxel-ui/helpers/css-var.ts +41 -0
  318. package/bundled-types/boxel-ui/helpers/currency-format.ts +25 -0
  319. package/bundled-types/boxel-ui/helpers/dayjs-format.ts +27 -0
  320. package/bundled-types/boxel-ui/helpers/deterministic-color-from-string.ts +45 -0
  321. package/bundled-types/boxel-ui/helpers/element.ts +16 -0
  322. package/bundled-types/boxel-ui/helpers/extract-css-variables.ts +126 -0
  323. package/bundled-types/boxel-ui/helpers/format-age.ts +72 -0
  324. package/bundled-types/boxel-ui/helpers/format-countdown.ts +110 -0
  325. package/bundled-types/boxel-ui/helpers/format-currency.ts +95 -0
  326. package/bundled-types/boxel-ui/helpers/format-date-time.ts +567 -0
  327. package/bundled-types/boxel-ui/helpers/format-duration.ts +143 -0
  328. package/bundled-types/boxel-ui/helpers/format-file-size.ts +49 -0
  329. package/bundled-types/boxel-ui/helpers/format-list.ts +73 -0
  330. package/bundled-types/boxel-ui/helpers/format-names.ts +103 -0
  331. package/bundled-types/boxel-ui/helpers/format-number.ts +140 -0
  332. package/bundled-types/boxel-ui/helpers/format-ordinal.ts +115 -0
  333. package/bundled-types/boxel-ui/helpers/format-period.ts +188 -0
  334. package/bundled-types/boxel-ui/helpers/format-relative-time.ts +789 -0
  335. package/bundled-types/boxel-ui/helpers/generate-css-variables.ts +47 -0
  336. package/bundled-types/boxel-ui/helpers/markdown-escape.ts +36 -0
  337. package/bundled-types/boxel-ui/helpers/math-helpers.ts +18 -0
  338. package/bundled-types/boxel-ui/helpers/menu-divider.ts +15 -0
  339. package/bundled-types/boxel-ui/helpers/menu-item.ts +76 -0
  340. package/bundled-types/boxel-ui/helpers/optional.ts +7 -0
  341. package/bundled-types/boxel-ui/helpers/pick.ts +11 -0
  342. package/bundled-types/boxel-ui/helpers/sanitize-html.ts +45 -0
  343. package/bundled-types/boxel-ui/helpers/string.ts +15 -0
  344. package/bundled-types/boxel-ui/helpers/theme-css.ts +148 -0
  345. package/bundled-types/boxel-ui/helpers/truth-helpers.ts +48 -0
  346. package/bundled-types/boxel-ui/helpers/validate-email-format.ts +138 -0
  347. package/bundled-types/boxel-ui/helpers/validate-phone-format.ts +201 -0
  348. package/bundled-types/boxel-ui/helpers.ts +134 -0
  349. package/bundled-types/boxel-ui/icons/ai-bw.gts +22 -0
  350. package/bundled-types/boxel-ui/icons/arrow-left.gts +25 -0
  351. package/bundled-types/boxel-ui/icons/arrow-right.gts +28 -0
  352. package/bundled-types/boxel-ui/icons/arrow-top-left.gts +22 -0
  353. package/bundled-types/boxel-ui/icons/arrow-up.gts +25 -0
  354. package/bundled-types/boxel-ui/icons/atom.gts +26 -0
  355. package/bundled-types/boxel-ui/icons/boxel-icon-with-text.gts +29 -0
  356. package/bundled-types/boxel-ui/icons/boxel-icon.gts +34 -0
  357. package/bundled-types/boxel-ui/icons/card-definition.gts +26 -0
  358. package/bundled-types/boxel-ui/icons/card-instance.gts +26 -0
  359. package/bundled-types/boxel-ui/icons/card.gts +24 -0
  360. package/bundled-types/boxel-ui/icons/cardbot-lg.gts +24 -0
  361. package/bundled-types/boxel-ui/icons/caret-down.gts +23 -0
  362. package/bundled-types/boxel-ui/icons/caret-up.gts +23 -0
  363. package/bundled-types/boxel-ui/icons/check-mark.gts +23 -0
  364. package/bundled-types/boxel-ui/icons/chevron-right.gts +23 -0
  365. package/bundled-types/boxel-ui/icons/copy.gts +28 -0
  366. package/bundled-types/boxel-ui/icons/diagonal-arrow-left-up.gts +21 -0
  367. package/bundled-types/boxel-ui/icons/download.gts +19 -0
  368. package/bundled-types/boxel-ui/icons/dropdown-arrow-down.gts +20 -0
  369. package/bundled-types/boxel-ui/icons/dropdown-arrow-filled.gts +19 -0
  370. package/bundled-types/boxel-ui/icons/dropdown-arrow-up.gts +20 -0
  371. package/bundled-types/boxel-ui/icons/edit.gts +14 -0
  372. package/bundled-types/boxel-ui/icons/embedded.gts +34 -0
  373. package/bundled-types/boxel-ui/icons/exclamation-circle.gts +26 -0
  374. package/bundled-types/boxel-ui/icons/exclamation.gts +20 -0
  375. package/bundled-types/boxel-ui/icons/eye.gts +19 -0
  376. package/bundled-types/boxel-ui/icons/failure-bordered.gts +26 -0
  377. package/bundled-types/boxel-ui/icons/field.gts +26 -0
  378. package/bundled-types/boxel-ui/icons/file-alert.gts +28 -0
  379. package/bundled-types/boxel-ui/icons/file.gts +27 -0
  380. package/bundled-types/boxel-ui/icons/fitted.gts +42 -0
  381. package/bundled-types/boxel-ui/icons/folder.gts +26 -0
  382. package/bundled-types/boxel-ui/icons/form.gts +38 -0
  383. package/bundled-types/boxel-ui/icons/four-lines.gts +21 -0
  384. package/bundled-types/boxel-ui/icons/grid-3x3.gts +26 -0
  385. package/bundled-types/boxel-ui/icons/group.gts +22 -0
  386. package/bundled-types/boxel-ui/icons/head.gts +28 -0
  387. package/bundled-types/boxel-ui/icons/highlight-icon.gts +46 -0
  388. package/bundled-types/boxel-ui/icons/icon-circle-selected.gts +25 -0
  389. package/bundled-types/boxel-ui/icons/icon-circle.gts +25 -0
  390. package/bundled-types/boxel-ui/icons/icon-code.gts +22 -0
  391. package/bundled-types/boxel-ui/icons/icon-funnel.gts +23 -0
  392. package/bundled-types/boxel-ui/icons/icon-globe.gts +19 -0
  393. package/bundled-types/boxel-ui/icons/icon-grid.gts +68 -0
  394. package/bundled-types/boxel-ui/icons/icon-hexagon.gts +22 -0
  395. package/bundled-types/boxel-ui/icons/icon-inherit.gts +19 -0
  396. package/bundled-types/boxel-ui/icons/icon-link.gts +20 -0
  397. package/bundled-types/boxel-ui/icons/icon-list.gts +40 -0
  398. package/bundled-types/boxel-ui/icons/icon-minus-circle.gts +26 -0
  399. package/bundled-types/boxel-ui/icons/icon-pencil-crossed-out.gts +33 -0
  400. package/bundled-types/boxel-ui/icons/icon-pencil-not-crossed-out.gts +21 -0
  401. package/bundled-types/boxel-ui/icons/icon-pencil.gts +23 -0
  402. package/bundled-types/boxel-ui/icons/icon-plus-circle.gts +31 -0
  403. package/bundled-types/boxel-ui/icons/icon-plus-thin.gts +19 -0
  404. package/bundled-types/boxel-ui/icons/icon-plus.gts +20 -0
  405. package/bundled-types/boxel-ui/icons/icon-search-thick.gts +27 -0
  406. package/bundled-types/boxel-ui/icons/icon-search.gts +25 -0
  407. package/bundled-types/boxel-ui/icons/icon-table.gts +44 -0
  408. package/bundled-types/boxel-ui/icons/icon-trash.gts +24 -0
  409. package/bundled-types/boxel-ui/icons/icon-turn-down-right.gts +18 -0
  410. package/bundled-types/boxel-ui/icons/icon-x.gts +21 -0
  411. package/bundled-types/boxel-ui/icons/image-placeholder.gts +30 -0
  412. package/bundled-types/boxel-ui/icons/isolated.gts +20 -0
  413. package/bundled-types/boxel-ui/icons/loading-indicator.gts +26 -0
  414. package/bundled-types/boxel-ui/icons/lock.gts +23 -0
  415. package/bundled-types/boxel-ui/icons/markdown.gts +19 -0
  416. package/bundled-types/boxel-ui/icons/profile.gts +23 -0
  417. package/bundled-types/boxel-ui/icons/publish-site-icon.gts +25 -0
  418. package/bundled-types/boxel-ui/icons/rows-4.gts +26 -0
  419. package/bundled-types/boxel-ui/icons/select-all.gts +25 -0
  420. package/bundled-types/boxel-ui/icons/send.gts +21 -0
  421. package/bundled-types/boxel-ui/icons/sparkle.gts +21 -0
  422. package/bundled-types/boxel-ui/icons/star-filled.gts +25 -0
  423. package/bundled-types/boxel-ui/icons/star-half-fill.gts +27 -0
  424. package/bundled-types/boxel-ui/icons/star.gts +25 -0
  425. package/bundled-types/boxel-ui/icons/success-bordered.gts +30 -0
  426. package/bundled-types/boxel-ui/icons/three-dots-horizontal.gts +21 -0
  427. package/bundled-types/boxel-ui/icons/triangle-left.gts +23 -0
  428. package/bundled-types/boxel-ui/icons/triangle-right.gts +23 -0
  429. package/bundled-types/boxel-ui/icons/types.ts +10 -0
  430. package/bundled-types/boxel-ui/icons/upload.gts +20 -0
  431. package/bundled-types/boxel-ui/icons/warning.gts +19 -0
  432. package/bundled-types/boxel-ui/icons.gts +246 -0
  433. package/bundled-types/boxel-ui/modifiers/auto-focus.ts +7 -0
  434. package/bundled-types/boxel-ui/modifiers/set-css-var.ts +24 -0
  435. package/bundled-types/boxel-ui/modifiers.ts +14 -0
  436. package/bundled-types/boxel-ui/types/@cardstack/boxel-ui/index.d.ts +3 -0
  437. package/bundled-types/boxel-ui/types/ember-css-url/index.d.ts +15 -0
  438. package/bundled-types/boxel-ui/types/ember-draggable-modifiers/index.d.ts +109 -0
  439. package/bundled-types/boxel-ui/types/ember-draggable-modifiers/utils.d.ts +7 -0
  440. package/bundled-types/boxel-ui/types/ember-focus-trap/index.d.ts +20 -0
  441. package/bundled-types/boxel-ui/types/ember-power-calendar/components/index.d.ts +9 -0
  442. package/bundled-types/boxel-ui/types/ember-resize-modifier/index.d.ts +14 -0
  443. package/bundled-types/boxel-ui/types/ember-set-body-class/index.d.ts +12 -0
  444. package/bundled-types/boxel-ui/types/ember-sortable/index.d.ts +52 -0
  445. package/bundled-types/boxel-ui/types/global.d.ts +7 -0
  446. package/bundled-types/boxel-ui/usage.ts +112 -0
  447. package/bundled-types/boxel-ui/utils/date-utils.ts +192 -0
  448. package/bundled-types/boxel-ui/utils/fitted-formats.ts +161 -0
  449. package/bundled-types/host-app/app.ts +22 -0
  450. package/bundled-types/host-app/commands/add-field-to-card-definition.ts +74 -0
  451. package/bundled-types/host-app/commands/ai-assistant.ts +203 -0
  452. package/bundled-types/host-app/commands/apply-markdown-edit.ts +203 -0
  453. package/bundled-types/host-app/commands/apply-search-replace-block.ts +225 -0
  454. package/bundled-types/host-app/commands/ask-ai.ts +66 -0
  455. package/bundled-types/host-app/commands/authed-fetch.ts +53 -0
  456. package/bundled-types/host-app/commands/bot-requests/create-listing-pr-request.ts +77 -0
  457. package/bundled-types/host-app/commands/bot-requests/send-bot-trigger-event.ts +53 -0
  458. package/bundled-types/host-app/commands/can-read-realm.ts +34 -0
  459. package/bundled-types/host-app/commands/cancel-indexing-job.ts +29 -0
  460. package/bundled-types/host-app/commands/check-correctness.ts +309 -0
  461. package/bundled-types/host-app/commands/copy-and-edit.ts +311 -0
  462. package/bundled-types/host-app/commands/copy-card-as-markdown.ts +41 -0
  463. package/bundled-types/host-app/commands/copy-card-to-stack.ts +70 -0
  464. package/bundled-types/host-app/commands/copy-card.ts +67 -0
  465. package/bundled-types/host-app/commands/copy-file-to-realm.ts +82 -0
  466. package/bundled-types/host-app/commands/copy-source.ts +46 -0
  467. package/bundled-types/host-app/commands/create-ai-assistant-room.ts +144 -0
  468. package/bundled-types/host-app/commands/create-and-open-submission-workflow-card.ts +30 -0
  469. package/bundled-types/host-app/commands/create-specs.ts +422 -0
  470. package/bundled-types/host-app/commands/create-submission-workflow.ts +172 -0
  471. package/bundled-types/host-app/commands/evaluate-module.ts +119 -0
  472. package/bundled-types/host-app/commands/execute-atomic-operations.ts +44 -0
  473. package/bundled-types/host-app/commands/fetch-card-json.ts +33 -0
  474. package/bundled-types/host-app/commands/full-reindex-realm.ts +30 -0
  475. package/bundled-types/host-app/commands/generate-example-cards.ts +298 -0
  476. package/bundled-types/host-app/commands/generate-readme-spec.ts +116 -0
  477. package/bundled-types/host-app/commands/generate-theme-example.ts +147 -0
  478. package/bundled-types/host-app/commands/generate-thumbnail.ts +247 -0
  479. package/bundled-types/host-app/commands/get-all-realm-metas.ts +38 -0
  480. package/bundled-types/host-app/commands/get-available-realm-identifiers.ts +29 -0
  481. package/bundled-types/host-app/commands/get-card-type-schema.ts +59 -0
  482. package/bundled-types/host-app/commands/get-card.ts +34 -0
  483. package/bundled-types/host-app/commands/get-catalog-realm-identifiers.ts +29 -0
  484. package/bundled-types/host-app/commands/get-default-writable-realm.ts +28 -0
  485. package/bundled-types/host-app/commands/get-events-from-room.ts +70 -0
  486. package/bundled-types/host-app/commands/get-realm-of-resource-identifier.ts +37 -0
  487. package/bundled-types/host-app/commands/get-user-system-card.ts +38 -0
  488. package/bundled-types/host-app/commands/index.ts +590 -0
  489. package/bundled-types/host-app/commands/instantiate-card.ts +185 -0
  490. package/bundled-types/host-app/commands/invalidate-realm-identifiers.ts +33 -0
  491. package/bundled-types/host-app/commands/invite-user-to-room.ts +34 -0
  492. package/bundled-types/host-app/commands/lint-and-fix.ts +60 -0
  493. package/bundled-types/host-app/commands/listing-action-build.ts +79 -0
  494. package/bundled-types/host-app/commands/listing-action-init.ts +106 -0
  495. package/bundled-types/host-app/commands/listing-create.ts +632 -0
  496. package/bundled-types/host-app/commands/listing-generate-example.ts +83 -0
  497. package/bundled-types/host-app/commands/listing-install.ts +227 -0
  498. package/bundled-types/host-app/commands/listing-remix.ts +150 -0
  499. package/bundled-types/host-app/commands/listing-update-specs.ts +116 -0
  500. package/bundled-types/host-app/commands/listing-use.ts +97 -0
  501. package/bundled-types/host-app/commands/one-shot-llm-request.ts +209 -0
  502. package/bundled-types/host-app/commands/open-ai-assistant-room.ts +38 -0
  503. package/bundled-types/host-app/commands/open-create-listing-modal.ts +52 -0
  504. package/bundled-types/host-app/commands/open-in-interact-mode.ts +36 -0
  505. package/bundled-types/host-app/commands/open-workspace.ts +38 -0
  506. package/bundled-types/host-app/commands/patch-card-instance.ts +108 -0
  507. package/bundled-types/host-app/commands/patch-code.ts +243 -0
  508. package/bundled-types/host-app/commands/patch-fields.ts +304 -0
  509. package/bundled-types/host-app/commands/patch-theme.ts +52 -0
  510. package/bundled-types/host-app/commands/persist-module-inspector-view.ts +41 -0
  511. package/bundled-types/host-app/commands/populate-with-sample-data.ts +84 -0
  512. package/bundled-types/host-app/commands/preview-format.ts +52 -0
  513. package/bundled-types/host-app/commands/read-binary-file.ts +62 -0
  514. package/bundled-types/host-app/commands/read-card-for-ai-assistant.ts +50 -0
  515. package/bundled-types/host-app/commands/read-file-for-ai-assistant.ts +46 -0
  516. package/bundled-types/host-app/commands/read-source.ts +46 -0
  517. package/bundled-types/host-app/commands/read-text-file.ts +44 -0
  518. package/bundled-types/host-app/commands/register-bot.ts +42 -0
  519. package/bundled-types/host-app/commands/reindex-realm.ts +30 -0
  520. package/bundled-types/host-app/commands/retry-submission-workflow.ts +119 -0
  521. package/bundled-types/host-app/commands/sanitize-module-list.ts +83 -0
  522. package/bundled-types/host-app/commands/save-card.ts +44 -0
  523. package/bundled-types/host-app/commands/screenshot-card.ts +148 -0
  524. package/bundled-types/host-app/commands/search-and-choose.ts +180 -0
  525. package/bundled-types/host-app/commands/search-cards.ts +102 -0
  526. package/bundled-types/host-app/commands/search-google-images.ts +100 -0
  527. package/bundled-types/host-app/commands/send-ai-assistant-message.ts +122 -0
  528. package/bundled-types/host-app/commands/send-request-via-proxy.ts +70 -0
  529. package/bundled-types/host-app/commands/serialize-card.ts +45 -0
  530. package/bundled-types/host-app/commands/set-active-llm.ts +39 -0
  531. package/bundled-types/host-app/commands/set-user-system-card.ts +29 -0
  532. package/bundled-types/host-app/commands/show-card.ts +102 -0
  533. package/bundled-types/host-app/commands/show-file.ts +39 -0
  534. package/bundled-types/host-app/commands/store-add.ts +37 -0
  535. package/bundled-types/host-app/commands/summarize-session.ts +82 -0
  536. package/bundled-types/host-app/commands/switch-submode.ts +112 -0
  537. package/bundled-types/host-app/commands/sync-openrouter-models.ts +373 -0
  538. package/bundled-types/host-app/commands/transform-cards.ts +59 -0
  539. package/bundled-types/host-app/commands/unregister-bot.ts +29 -0
  540. package/bundled-types/host-app/commands/update-code-path-with-selection.ts +45 -0
  541. package/bundled-types/host-app/commands/update-playground-selection.ts +37 -0
  542. package/bundled-types/host-app/commands/update-room-skills.ts +231 -0
  543. package/bundled-types/host-app/commands/utils.ts +178 -0
  544. package/bundled-types/host-app/commands/validate-realm.ts +40 -0
  545. package/bundled-types/host-app/commands/write-binary-file.ts +142 -0
  546. package/bundled-types/host-app/commands/write-text-file.ts +104 -0
  547. package/bundled-types/host-app/components/.gitkeep +0 -0
  548. package/bundled-types/host-app/components/ai-assistant/action-bar.gts +188 -0
  549. package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg.webp +0 -0
  550. package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg@2x.webp +0 -0
  551. package/bundled-types/host-app/components/ai-assistant/ai-assist-button-active-bg@3x.webp +0 -0
  552. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-animated.webp +0 -0
  553. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw.png +0 -0
  554. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw@2x.png +0 -0
  555. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon-bw@3x.png +0 -0
  556. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon.webp +0 -0
  557. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon@2x.webp +0 -0
  558. package/bundled-types/host-app/components/ai-assistant/ai-assist-icon@3x.webp +0 -0
  559. package/bundled-types/host-app/components/ai-assistant/apply-button/index.gts +226 -0
  560. package/bundled-types/host-app/components/ai-assistant/apply-button/usage.gts +81 -0
  561. package/bundled-types/host-app/components/ai-assistant/attached-file-dropdown-menu.gts +179 -0
  562. package/bundled-types/host-app/components/ai-assistant/attachment-picker/attach-button.gts +176 -0
  563. package/bundled-types/host-app/components/ai-assistant/attachment-picker/attached-items.gts +271 -0
  564. package/bundled-types/host-app/components/ai-assistant/attachment-picker/index.gts +144 -0
  565. package/bundled-types/host-app/components/ai-assistant/attachment-picker/usage.gts +127 -0
  566. package/bundled-types/host-app/components/ai-assistant/button.gts +60 -0
  567. package/bundled-types/host-app/components/ai-assistant/chat-input/index.gts +203 -0
  568. package/bundled-types/host-app/components/ai-assistant/chat-input/usage.gts +68 -0
  569. package/bundled-types/host-app/components/ai-assistant/code-block/actions.gts +58 -0
  570. package/bundled-types/host-app/components/ai-assistant/code-block/apply-code-patch-button.gts +66 -0
  571. package/bundled-types/host-app/components/ai-assistant/code-block/command-header.gts +115 -0
  572. package/bundled-types/host-app/components/ai-assistant/code-block/diff-editor-header.gts +209 -0
  573. package/bundled-types/host-app/components/ai-assistant/code-block/index.gts +228 -0
  574. package/bundled-types/host-app/components/ai-assistant/code-block/patch-footer.gts +32 -0
  575. package/bundled-types/host-app/components/ai-assistant/code-block/view-code-button.gts +73 -0
  576. package/bundled-types/host-app/components/ai-assistant/focus-pill/index.gts +60 -0
  577. package/bundled-types/host-app/components/ai-assistant/focus-pill/usage.gts +45 -0
  578. package/bundled-types/host-app/components/ai-assistant/llm-mode-toggle.gts +113 -0
  579. package/bundled-types/host-app/components/ai-assistant/llm-select.gts +158 -0
  580. package/bundled-types/host-app/components/ai-assistant/message/aibot-message.gts +374 -0
  581. package/bundled-types/host-app/components/ai-assistant/message/attachments.gts +153 -0
  582. package/bundled-types/host-app/components/ai-assistant/message/index.gts +678 -0
  583. package/bundled-types/host-app/components/ai-assistant/message/meta.gts +66 -0
  584. package/bundled-types/host-app/components/ai-assistant/message/text-content.gts +32 -0
  585. package/bundled-types/host-app/components/ai-assistant/message/usage.gts +182 -0
  586. package/bundled-types/host-app/components/ai-assistant/message/user-message.gts +52 -0
  587. package/bundled-types/host-app/components/ai-assistant/new-session-button.gts +126 -0
  588. package/bundled-types/host-app/components/ai-assistant/new-session-settings.gts +180 -0
  589. package/bundled-types/host-app/components/ai-assistant/new-session.gts +83 -0
  590. package/bundled-types/host-app/components/ai-assistant/panel-popover.gts +102 -0
  591. package/bundled-types/host-app/components/ai-assistant/panel.gts +453 -0
  592. package/bundled-types/host-app/components/ai-assistant/past-session-item.gts +323 -0
  593. package/bundled-types/host-app/components/ai-assistant/past-sessions.gts +115 -0
  594. package/bundled-types/host-app/components/ai-assistant/rename-session.gts +144 -0
  595. package/bundled-types/host-app/components/ai-assistant/restore-file-modal.gts +105 -0
  596. package/bundled-types/host-app/components/ai-assistant/skill-menu/index.gts +190 -0
  597. package/bundled-types/host-app/components/ai-assistant/skill-menu/skill-toggle.gts +168 -0
  598. package/bundled-types/host-app/components/ai-assistant/skill-menu/usage.gts +48 -0
  599. package/bundled-types/host-app/components/ai-assistant/toast.gts +293 -0
  600. package/bundled-types/host-app/components/card-catalog/modal.gts +579 -0
  601. package/bundled-types/host-app/components/card-error.gts +41 -0
  602. package/bundled-types/host-app/components/card-instance-picker/index.gts +54 -0
  603. package/bundled-types/host-app/components/card-pill.gts +189 -0
  604. package/bundled-types/host-app/components/card-prerender.gts +880 -0
  605. package/bundled-types/host-app/components/card-renderer.gts +84 -0
  606. package/bundled-types/host-app/components/card-search/constants.ts +76 -0
  607. package/bundled-types/host-app/components/card-search/item-button.gts +243 -0
  608. package/bundled-types/host-app/components/card-search/panel.gts +150 -0
  609. package/bundled-types/host-app/components/card-search/search-bar.gts +218 -0
  610. package/bundled-types/host-app/components/card-search/search-content.gts +604 -0
  611. package/bundled-types/host-app/components/card-search/search-result-header.gts +165 -0
  612. package/bundled-types/host-app/components/card-search/search-result-section.gts +545 -0
  613. package/bundled-types/host-app/components/card-search/section-header.gts +117 -0
  614. package/bundled-types/host-app/components/editor/directory.gts +308 -0
  615. package/bundled-types/host-app/components/editor/file-tree.gts +69 -0
  616. package/bundled-types/host-app/components/editor/import-module.gts +27 -0
  617. package/bundled-types/host-app/components/editor/indexed-file-tree.gts +572 -0
  618. package/bundled-types/host-app/components/editor/recent-files.gts +141 -0
  619. package/bundled-types/host-app/components/file-pill.gts +206 -0
  620. package/bundled-types/host-app/components/head-format-preview.gts +781 -0
  621. package/bundled-types/host-app/components/host-mode/breadcrumb-item.gts +150 -0
  622. package/bundled-types/host-app/components/host-mode/breadcrumbs.gts +131 -0
  623. package/bundled-types/host-app/components/host-mode/card.gts +199 -0
  624. package/bundled-types/host-app/components/host-mode/content.gts +195 -0
  625. package/bundled-types/host-app/components/host-mode/stack-item.gts +310 -0
  626. package/bundled-types/host-app/components/host-mode/stack.gts +91 -0
  627. package/bundled-types/host-app/components/matrix/auth-container.gts +66 -0
  628. package/bundled-types/host-app/components/matrix/auth.gts +73 -0
  629. package/bundled-types/host-app/components/matrix/forgot-password.gts +487 -0
  630. package/bundled-types/host-app/components/matrix/login.gts +241 -0
  631. package/bundled-types/host-app/components/matrix/register-user.gts +843 -0
  632. package/bundled-types/host-app/components/matrix/room-message-command.gts +330 -0
  633. package/bundled-types/host-app/components/matrix/room-message.gts +261 -0
  634. package/bundled-types/host-app/components/matrix/room.gts +1872 -0
  635. package/bundled-types/host-app/components/matrix/user-profile.gts +99 -0
  636. package/bundled-types/host-app/components/modal-container.gts +171 -0
  637. package/bundled-types/host-app/components/operator-mode/binary-file-info.gts +77 -0
  638. package/bundled-types/host-app/components/operator-mode/card-adoption-chain.gts +99 -0
  639. package/bundled-types/host-app/components/operator-mode/card-error-detail.gts +87 -0
  640. package/bundled-types/host-app/components/operator-mode/card-error.gts +177 -0
  641. package/bundled-types/host-app/components/operator-mode/card-schema-editor.gts +616 -0
  642. package/bundled-types/host-app/components/operator-mode/card-url-bar.gts +197 -0
  643. package/bundled-types/host-app/components/operator-mode/choose-file-modal.gts +562 -0
  644. package/bundled-types/host-app/components/operator-mode/choose-subscription-plan-modal.gts +517 -0
  645. package/bundled-types/host-app/components/operator-mode/code-editor.gts +736 -0
  646. package/bundled-types/host-app/components/operator-mode/code-submode/editor-indicator.gts +128 -0
  647. package/bundled-types/host-app/components/operator-mode/code-submode/format-chooser.gts +592 -0
  648. package/bundled-types/host-app/components/operator-mode/code-submode/inner-container.gts +162 -0
  649. package/bundled-types/host-app/components/operator-mode/code-submode/left-panel-toggle.gts +267 -0
  650. package/bundled-types/host-app/components/operator-mode/code-submode/module-inspector.gts +836 -0
  651. package/bundled-types/host-app/components/operator-mode/code-submode/playground/field-chooser-modal.gts +97 -0
  652. package/bundled-types/host-app/components/operator-mode/code-submode/playground/instance-chooser-dropdown.gts +346 -0
  653. package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-background.png +0 -0
  654. package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-panel.gts +1274 -0
  655. package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground-preview.gts +155 -0
  656. package/bundled-types/host-app/components/operator-mode/code-submode/playground/playground.gts +98 -0
  657. package/bundled-types/host-app/components/operator-mode/code-submode/playground/spec-search.gts +70 -0
  658. package/bundled-types/host-app/components/operator-mode/code-submode/schema-editor.gts +205 -0
  659. package/bundled-types/host-app/components/operator-mode/code-submode/spec-preview-badge.gts +72 -0
  660. package/bundled-types/host-app/components/operator-mode/code-submode/spec-preview.gts +432 -0
  661. package/bundled-types/host-app/components/operator-mode/code-submode/toggle-button.gts +72 -0
  662. package/bundled-types/host-app/components/operator-mode/code-submode.gts +1030 -0
  663. package/bundled-types/host-app/components/operator-mode/container.gts +270 -0
  664. package/bundled-types/host-app/components/operator-mode/context-menu-button.gts +95 -0
  665. package/bundled-types/host-app/components/operator-mode/copy-button.gts +277 -0
  666. package/bundled-types/host-app/components/operator-mode/create-file-modal.gts +1087 -0
  667. package/bundled-types/host-app/components/operator-mode/create-listing-modal.gts +513 -0
  668. package/bundled-types/host-app/components/operator-mode/definition-container/base.gts +222 -0
  669. package/bundled-types/host-app/components/operator-mode/definition-container/clickable.gts +59 -0
  670. package/bundled-types/host-app/components/operator-mode/definition-container/divider.gts +48 -0
  671. package/bundled-types/host-app/components/operator-mode/definition-container/index.gts +108 -0
  672. package/bundled-types/host-app/components/operator-mode/delete-modal.gts +123 -0
  673. package/bundled-types/host-app/components/operator-mode/detail-panel-selector.gts +320 -0
  674. package/bundled-types/host-app/components/operator-mode/detail-panel.gts +834 -0
  675. package/bundled-types/host-app/components/operator-mode/edit-field-modal.gts +450 -0
  676. package/bundled-types/host-app/components/operator-mode/error-display.gts +590 -0
  677. package/bundled-types/host-app/components/operator-mode/host-submode/open-site-popover.gts +127 -0
  678. package/bundled-types/host-app/components/operator-mode/host-submode/publishing-realm-popover.gts +159 -0
  679. package/bundled-types/host-app/components/operator-mode/host-submode.gts +373 -0
  680. package/bundled-types/host-app/components/operator-mode/interact-submode/neighbor-stack-trigger.gts +116 -0
  681. package/bundled-types/host-app/components/operator-mode/interact-submode.gts +1021 -0
  682. package/bundled-types/host-app/components/operator-mode/new-file-button.gts +187 -0
  683. package/bundled-types/host-app/components/operator-mode/operator-mode-overlays.gts +511 -0
  684. package/bundled-types/host-app/components/operator-mode/overlays.gts +342 -0
  685. package/bundled-types/host-app/components/operator-mode/preview-panel/fitted-format-gallery.gts +127 -0
  686. package/bundled-types/host-app/components/operator-mode/preview-panel/index.gts +443 -0
  687. package/bundled-types/host-app/components/operator-mode/preview-panel/markdown-preview.gts +175 -0
  688. package/bundled-types/host-app/components/operator-mode/preview-panel/metadata-panel.gts +214 -0
  689. package/bundled-types/host-app/components/operator-mode/preview-panel/rendered-markdown.gts +718 -0
  690. package/bundled-types/host-app/components/operator-mode/private-dependency-violation.gts +70 -0
  691. package/bundled-types/host-app/components/operator-mode/profile/profile-email.gts +686 -0
  692. package/bundled-types/host-app/components/operator-mode/profile/profile-settings-modal.gts +454 -0
  693. package/bundled-types/host-app/components/operator-mode/profile/profile-subscription.gts +170 -0
  694. package/bundled-types/host-app/components/operator-mode/profile-info-popover.gts +263 -0
  695. package/bundled-types/host-app/components/operator-mode/publish-realm-modal.gts +1529 -0
  696. package/bundled-types/host-app/components/operator-mode/remove-field-modal.gts +135 -0
  697. package/bundled-types/host-app/components/operator-mode/send-error-to-ai-assistant.gts +195 -0
  698. package/bundled-types/host-app/components/operator-mode/stack-item.gts +1341 -0
  699. package/bundled-types/host-app/components/operator-mode/stack.gts +191 -0
  700. package/bundled-types/host-app/components/operator-mode/submode-layout.gts +781 -0
  701. package/bundled-types/host-app/components/operator-mode/syntax-error-display.gts +72 -0
  702. package/bundled-types/host-app/components/operator-mode/workspace-chooser/add-workspace.gts +282 -0
  703. package/bundled-types/host-app/components/operator-mode/workspace-chooser/index.gts +307 -0
  704. package/bundled-types/host-app/components/operator-mode/workspace-chooser/item-container.gts +50 -0
  705. package/bundled-types/host-app/components/operator-mode/workspace-chooser/workspace-loading-indicator.gts +50 -0
  706. package/bundled-types/host-app/components/operator-mode/workspace-chooser/workspace.gts +1092 -0
  707. package/bundled-types/host-app/components/pill-menu/index.gts +281 -0
  708. package/bundled-types/host-app/components/pill-menu/usage.gts +64 -0
  709. package/bundled-types/host-app/components/prerendered-card-search.gts +274 -0
  710. package/bundled-types/host-app/components/realm-dropdown.gts +209 -0
  711. package/bundled-types/host-app/components/realm-picker/index.gts +142 -0
  712. package/bundled-types/host-app/components/search-sheet/index.gts +426 -0
  713. package/bundled-types/host-app/components/search-sheet/usage.gts +99 -0
  714. package/bundled-types/host-app/components/submode-switcher.gts +260 -0
  715. package/bundled-types/host-app/components/type-picker/index.gts +111 -0
  716. package/bundled-types/host-app/components/with-known-realms-loaded.gts +47 -0
  717. package/bundled-types/host-app/components/with-loaded-realm.gts +39 -0
  718. package/bundled-types/host-app/components/with-subscription-data.gts +247 -0
  719. package/bundled-types/host-app/config/environment.ts +66 -0
  720. package/bundled-types/host-app/deprecation-workflow.js +30 -0
  721. package/bundled-types/host-app/lib/browser-queue.ts +198 -0
  722. package/bundled-types/host-app/lib/codemirror-context.ts +1081 -0
  723. package/bundled-types/host-app/lib/command-definitions.ts +41 -0
  724. package/bundled-types/host-app/lib/download-realm.ts +9 -0
  725. package/bundled-types/host-app/lib/example-card-helpers.ts +99 -0
  726. package/bundled-types/host-app/lib/externals.ts +247 -0
  727. package/bundled-types/host-app/lib/field-path-parser.ts +520 -0
  728. package/bundled-types/host-app/lib/file-def-manager.ts +712 -0
  729. package/bundled-types/host-app/lib/file-upload-state.ts +6 -0
  730. package/bundled-types/host-app/lib/formatted-message/utils.ts +272 -0
  731. package/bundled-types/host-app/lib/gc-card-store.ts +1084 -0
  732. package/bundled-types/host-app/lib/host-base-command.ts +29 -0
  733. package/bundled-types/host-app/lib/html-component.ts +144 -0
  734. package/bundled-types/host-app/lib/html-to-markdown.ts +96 -0
  735. package/bundled-types/host-app/lib/isolated-render.gts +90 -0
  736. package/bundled-types/host-app/lib/known-file-meta-urls.ts +17 -0
  737. package/bundled-types/host-app/lib/limited-set.ts +68 -0
  738. package/bundled-types/host-app/lib/matrix-classes/member.ts +28 -0
  739. package/bundled-types/host-app/lib/matrix-classes/message-builder.ts +444 -0
  740. package/bundled-types/host-app/lib/matrix-classes/message-code-patch-result.ts +44 -0
  741. package/bundled-types/host-app/lib/matrix-classes/message-command.ts +109 -0
  742. package/bundled-types/host-app/lib/matrix-classes/message.ts +239 -0
  743. package/bundled-types/host-app/lib/matrix-classes/room.ts +174 -0
  744. package/bundled-types/host-app/lib/matrix-utils.ts +114 -0
  745. package/bundled-types/host-app/lib/mutex.ts +62 -0
  746. package/bundled-types/host-app/lib/prerender-fetch-headers.ts +46 -0
  747. package/bundled-types/host-app/lib/prerender-util.ts +31 -0
  748. package/bundled-types/host-app/lib/public-path.ts +1 -0
  749. package/bundled-types/host-app/lib/random-name.ts +26 -0
  750. package/bundled-types/host-app/lib/realm-utils.ts +45 -0
  751. package/bundled-types/host-app/lib/search-cache-key.ts +33 -0
  752. package/bundled-types/host-app/lib/search-in-flight-key.ts +28 -0
  753. package/bundled-types/host-app/lib/search-replace-block-parsing.ts +101 -0
  754. package/bundled-types/host-app/lib/setup-globals.ts +15 -0
  755. package/bundled-types/host-app/lib/sqlite-adapter.ts +510 -0
  756. package/bundled-types/host-app/lib/stack-item.ts +164 -0
  757. package/bundled-types/host-app/lib/utils.ts +84 -0
  758. package/bundled-types/host-app/lib/window-error-handler.ts +132 -0
  759. package/bundled-types/host-app/router.ts +31 -0
  760. package/bundled-types/host-app/services/ai-assistant-panel-service.ts +850 -0
  761. package/bundled-types/host-app/services/billing-service.ts +208 -0
  762. package/bundled-types/host-app/services/card-service.ts +373 -0
  763. package/bundled-types/host-app/services/card-type-service.ts +226 -0
  764. package/bundled-types/host-app/services/code-semantics-service.ts +297 -0
  765. package/bundled-types/host-app/services/command-service.ts +975 -0
  766. package/bundled-types/host-app/services/environment-service.ts +26 -0
  767. package/bundled-types/host-app/services/error-display.ts +42 -0
  768. package/bundled-types/host-app/services/file-upload.ts +212 -0
  769. package/bundled-types/host-app/services/host-mode-service.ts +400 -0
  770. package/bundled-types/host-app/services/host-mode-state-service.ts +160 -0
  771. package/bundled-types/host-app/services/loader-service.ts +148 -0
  772. package/bundled-types/host-app/services/local-indexer.ts +68 -0
  773. package/bundled-types/host-app/services/local-persistence-service.ts +296 -0
  774. package/bundled-types/host-app/services/logger-service.ts +13 -0
  775. package/bundled-types/host-app/services/matrix-sdk-loader.ts +346 -0
  776. package/bundled-types/host-app/services/matrix-service.ts +2288 -0
  777. package/bundled-types/host-app/services/message-service.ts +84 -0
  778. package/bundled-types/host-app/services/module-contents-service.ts +333 -0
  779. package/bundled-types/host-app/services/monaco-service.ts +333 -0
  780. package/bundled-types/host-app/services/network.ts +101 -0
  781. package/bundled-types/host-app/services/operator-mode-state-service.ts +1593 -0
  782. package/bundled-types/host-app/services/playground-panel-service.ts +236 -0
  783. package/bundled-types/host-app/services/queue.ts +30 -0
  784. package/bundled-types/host-app/services/realm-info-service.ts +37 -0
  785. package/bundled-types/host-app/services/realm-server.ts +1211 -0
  786. package/bundled-types/host-app/services/realm.ts +1413 -0
  787. package/bundled-types/host-app/services/recent-cards-service.ts +174 -0
  788. package/bundled-types/host-app/services/recent-files-service.ts +224 -0
  789. package/bundled-types/host-app/services/render-error-state.ts +55 -0
  790. package/bundled-types/host-app/services/render-service.ts +362 -0
  791. package/bundled-types/host-app/services/render-store.ts +27 -0
  792. package/bundled-types/host-app/services/reset.ts +19 -0
  793. package/bundled-types/host-app/services/scroll-position-service.ts +81 -0
  794. package/bundled-types/host-app/services/spec-panel-service.ts +107 -0
  795. package/bundled-types/host-app/services/store.ts +2540 -0
  796. package/bundled-types/host-app/utils/assert-never.ts +3 -0
  797. package/bundled-types/host-app/utils/auth-error-guard.ts +183 -0
  798. package/bundled-types/host-app/utils/auth-service-worker-registration.ts +123 -0
  799. package/bundled-types/host-app/utils/card-search/query-builder.ts +169 -0
  800. package/bundled-types/host-app/utils/card-search/section-pagination.ts +57 -0
  801. package/bundled-types/host-app/utils/card-search/sections.ts +240 -0
  802. package/bundled-types/host-app/utils/card-search/type-filter.ts +124 -0
  803. package/bundled-types/host-app/utils/card-search/types.ts +11 -0
  804. package/bundled-types/host-app/utils/card-search/url.ts +27 -0
  805. package/bundled-types/host-app/utils/clipboard.ts +23 -0
  806. package/bundled-types/host-app/utils/editor/boxel-formatter.ts +65 -0
  807. package/bundled-types/host-app/utils/editor/editor-language.ts +88 -0
  808. package/bundled-types/host-app/utils/editor/monaco-test-waiter.ts +302 -0
  809. package/bundled-types/host-app/utils/file-def-attributes-extractor.ts +438 -0
  810. package/bundled-types/host-app/utils/file-name.ts +38 -0
  811. package/bundled-types/host-app/utils/id-from-card-or-url.ts +11 -0
  812. package/bundled-types/host-app/utils/lint-formatting.ts +57 -0
  813. package/bundled-types/host-app/utils/local-storage-keys.ts +28 -0
  814. package/bundled-types/host-app/utils/normalized-dir-path.ts +3 -0
  815. package/bundled-types/host-app/utils/prettify-messages.ts +21 -0
  816. package/bundled-types/host-app/utils/prettify-prompts.ts +21 -0
  817. package/bundled-types/host-app/utils/realm-index-boilerplate.ts +27 -0
  818. package/bundled-types/host-app/utils/register-boxel-transition.ts +17 -0
  819. package/bundled-types/host-app/utils/render-desync-detector.ts +362 -0
  820. package/bundled-types/host-app/utils/render-error.ts +455 -0
  821. package/bundled-types/host-app/utils/render-timer-stub.ts +249 -0
  822. package/bundled-types/host-app/utils/run-while-active.ts +14 -0
  823. package/bundled-types/host-app/utils/schema-editor.ts +25 -0
  824. package/bundled-types/host-app/utils/text-suggestion.ts +82 -0
  825. package/bundled-types/host-app/utils/titleize.ts +10 -0
  826. package/bundled-types/host-app/utils/uuid.ts +13 -0
  827. package/bundled-types/host-tests/helpers/adapter.ts +464 -0
  828. package/bundled-types/host-tests/helpers/base-realm.ts +464 -0
  829. package/bundled-types/host-tests/helpers/cards/view-card-demo.ts +119 -0
  830. package/bundled-types/host-tests/helpers/field-test-helpers.gts +54 -0
  831. package/bundled-types/host-tests/helpers/image-fixture.ts +3 -0
  832. package/bundled-types/host-tests/helpers/index.gts +2099 -0
  833. package/bundled-types/host-tests/helpers/indexer.ts +293 -0
  834. package/bundled-types/host-tests/helpers/interact-submode-setup.gts +551 -0
  835. package/bundled-types/host-tests/helpers/mock-matrix/_client.ts +1042 -0
  836. package/bundled-types/host-tests/helpers/mock-matrix/_sdk.ts +71 -0
  837. package/bundled-types/host-tests/helpers/mock-matrix/_server-state.ts +343 -0
  838. package/bundled-types/host-tests/helpers/mock-matrix/_sliding-sync.ts +140 -0
  839. package/bundled-types/host-tests/helpers/mock-matrix/_utils.ts +146 -0
  840. package/bundled-types/host-tests/helpers/mock-matrix.ts +200 -0
  841. package/bundled-types/host-tests/helpers/operator-mode-parameters-match.ts +71 -0
  842. package/bundled-types/host-tests/helpers/operator-mode-state.ts +18 -0
  843. package/bundled-types/host-tests/helpers/percy-snapshot.ts +228 -0
  844. package/bundled-types/host-tests/helpers/playground.ts +130 -0
  845. package/bundled-types/host-tests/helpers/realm-server-mock/index.ts +100 -0
  846. package/bundled-types/host-tests/helpers/realm-server-mock/routes.ts +617 -0
  847. package/bundled-types/host-tests/helpers/realm-server-mock/types.ts +24 -0
  848. package/bundled-types/host-tests/helpers/recent-files-cards.ts +86 -0
  849. package/bundled-types/host-tests/helpers/render-component.ts +40 -0
  850. package/bundled-types/host-tests/helpers/setup-qunit.js +164 -0
  851. package/bundled-types/host-tests/helpers/setup.ts +349 -0
  852. package/bundled-types/host-tests/helpers/shard-warmup.ts +72 -0
  853. package/bundled-types/host-tests/helpers/stream.ts +60 -0
  854. package/bundled-types/host-tests/helpers/test-auth.ts +27 -0
  855. package/bundled-types/host-tests/helpers/test-realm-registry.ts +23 -0
  856. package/bundled-types/host-tests/helpers/test-realm-service-worker.ts +92 -0
  857. package/bundled-types/host-tests/helpers/uncaught-exceptions.ts +16 -0
  858. package/bundled-types/host-tests/helpers/visit-operator-mode.ts +39 -0
  859. package/bundled-types/host-types/@cardstack/host/index.d.ts +3 -0
  860. package/bundled-types/host-types/@joplin/turndown-plugin-gfm/index.d.ts +15 -0
  861. package/bundled-types/host-types/@sqlite.org/sqlite-wasm/index.d.ts +122 -0
  862. package/bundled-types/host-types/ember-click-outside/modifiers/on-click-outside.ts +16 -0
  863. package/bundled-types/host-types/ember-concurrency/helpers/perform.d.ts +3 -0
  864. package/bundled-types/host-types/ember-css-url/index.d.ts +15 -0
  865. package/bundled-types/host-types/ember-data/types/registries/model.d.ts +6 -0
  866. package/bundled-types/host-types/ember-elsewhere/from-elsewhere.d.ts +12 -0
  867. package/bundled-types/host-types/ember-elsewhere/to-elsewhere.d.ts +16 -0
  868. package/bundled-types/host-types/ember-focus-trap/index.d.ts +4 -0
  869. package/bundled-types/host-types/ember-keyboard/modifiers/on-key.d.ts +15 -0
  870. package/bundled-types/host-types/index.d.ts +6 -0
  871. package/bundled-types/local-types/eslint-js.d.ts +5 -0
  872. package/bundled-types/local-types/index.d.ts +115 -0
  873. package/bundled-types/local-types/marked-gfm-heading-id.d.ts +12 -0
  874. package/bundled-types/local-types/matrix-js-sdk/index.d.ts +11 -0
  875. package/bundled-types/local-types/package.json +13 -0
  876. package/bundled-types/shims/boxel-cli-shims.d.ts +10 -0
  877. package/dist/index.js +100 -100
  878. package/package.json +13 -7
  879. package/src/commands/parse.ts +277 -34
  880. package/src/commands/realm/publish.ts +10 -1
  881. package/src/commands/realm/unpublish.ts +2 -3
  882. package/src/lib/describe-fetch-error.ts +25 -0
package/dist/index.js CHANGED
@@ -1,130 +1,130 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Up=Object.create;var Fn=Object.defineProperty;var Dp=Object.getOwnPropertyDescriptor;var qp=Object.getOwnPropertyNames;var Gp=Object.getPrototypeOf,Hp=Object.prototype.hasOwnProperty;var v=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Wp=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qp(e))!Hp.call(i,n)&&n!==t&&Fn(i,n,{get:()=>e[n],enumerable:!(r=Dp(e,n))||r.enumerable});return i};var T=(i,e,t)=>(t=i!=null?Up(Gp(i)):{},Wp(e||!i||!i.__esModule?Fn(t,"default",{value:i,enumerable:!0}):t,i));var Un=v((Ry,Vp)=>{Vp.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Wn=v(($y,we)=>{var Ai=require("fs"),$t=require("path"),Bp=require("os"),zp=require("crypto"),Yp=Un(),Li=Yp.version,Jp=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Xp(i){let e={},t=i.toString();t=t.replace(/\r\n?/mg,`
3
- `);let r;for(;(r=Jp.exec(t))!=null;){let n=r[1],s=r[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
4
- `),s=s.replace(/\\r/g,"\r")),e[n]=s}return e}function Kp(i){i=i||{};let e=Hn(i);i.path=e;let t=H.configDotenv(i);if(!t.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=Gn(i).split(","),n=r.length,s;for(let o=0;o<n;o++)try{let a=r[o].trim(),c=Zp(t,a);s=H.decrypt(c.ciphertext,c.key);break}catch(a){if(o+1>=n)throw a}return H.parse(s)}function Qp(i){console.log(`[dotenv@${Li}][WARN] ${i}`)}function et(i){console.log(`[dotenv@${Li}][DEBUG] ${i}`)}function qn(i){console.log(`[dotenv@${Li}] ${i}`)}function Gn(i){return i&&i.DOTENV_KEY&&i.DOTENV_KEY.length>0?i.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Zp(i,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let r=t.password;if(!r){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let n=t.searchParams.get("environment");if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${n.toUpperCase()}`,o=i.parsed[s];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:r}}function Hn(i){let e=null;if(i&&i.path&&i.path.length>0)if(Array.isArray(i.path))for(let t of i.path)Ai.existsSync(t)&&(e=t.endsWith(".vault")?t:`${t}.vault`);else e=i.path.endsWith(".vault")?i.path:`${i.path}.vault`;else e=$t.resolve(process.cwd(),".env.vault");return Ai.existsSync(e)?e:null}function Dn(i){return i[0]==="~"?$t.join(Bp.homedir(),i.slice(1)):i}function eu(i){let e=!!(i&&i.debug),t=i&&"quiet"in i?i.quiet:!0;(e||!t)&&qn("Loading env from encrypted .env.vault");let r=H._parseVault(i),n=process.env;return i&&i.processEnv!=null&&(n=i.processEnv),H.populate(n,r,i),{parsed:r}}function tu(i){let e=$t.resolve(process.cwd(),".env"),t="utf8",r=!!(i&&i.debug),n=i&&"quiet"in i?i.quiet:!0;i&&i.encoding?t=i.encoding:r&&et("No encoding is specified. UTF-8 is used by default");let s=[e];if(i&&i.path)if(!Array.isArray(i.path))s=[Dn(i.path)];else{s=[];for(let l of i.path)s.push(Dn(l))}let o,a={};for(let l of s)try{let p=H.parse(Ai.readFileSync(l,{encoding:t}));H.populate(a,p,i)}catch(p){r&&et(`Failed to load ${l} ${p.message}`),o=p}let c=process.env;if(i&&i.processEnv!=null&&(c=i.processEnv),H.populate(c,a,i),r||!n){let l=Object.keys(a).length,p=[];for(let u of s)try{let d=$t.relative(process.cwd(),u);p.push(d)}catch(d){r&&et(`Failed to load ${u} ${d.message}`),o=d}qn(`injecting env (${l}) from ${p.join(",")}`)}return o?{parsed:a,error:o}:{parsed:a}}function iu(i){if(Gn(i).length===0)return H.configDotenv(i);let e=Hn(i);return e?H._configVault(i):(Qp(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),H.configDotenv(i))}function ru(i,e){let t=Buffer.from(e.slice(-64),"hex"),r=Buffer.from(i,"base64"),n=r.subarray(0,12),s=r.subarray(-16);r=r.subarray(12,-16);try{let o=zp.createDecipheriv("aes-256-gcm",t,n);return o.setAuthTag(s),`${o.update(r)}${o.final()}`}catch(o){let a=o instanceof RangeError,c=o.message==="Invalid key length",l=o.message==="Unsupported state or unable to authenticate data";if(a||c){let p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(l){let p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw o}}function nu(i,e,t={}){let r=!!(t&&t.debug),n=!!(t&&t.override);if(typeof e!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(e))Object.prototype.hasOwnProperty.call(i,s)?(n===!0&&(i[s]=e[s]),r&&et(n===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):i[s]=e[s]}var H={configDotenv:tu,_configVault:eu,_parseVault:Kp,config:iu,decrypt:ru,parse:Xp,populate:nu};we.exports.configDotenv=H.configDotenv;we.exports._configVault=H._configVault;we.exports._parseVault=H._parseVault;we.exports.config=H.config;we.exports.decrypt=H.decrypt;we.exports.parse=H.parse;we.exports.populate=H.populate;we.exports=H});var Bn=v((ky,Vn)=>{var Ae={};process.env.DOTENV_CONFIG_ENCODING!=null&&(Ae.encoding=process.env.DOTENV_CONFIG_ENCODING);process.env.DOTENV_CONFIG_PATH!=null&&(Ae.path=process.env.DOTENV_CONFIG_PATH);process.env.DOTENV_CONFIG_QUIET!=null&&(Ae.quiet=process.env.DOTENV_CONFIG_QUIET);process.env.DOTENV_CONFIG_DEBUG!=null&&(Ae.debug=process.env.DOTENV_CONFIG_DEBUG);process.env.DOTENV_CONFIG_OVERRIDE!=null&&(Ae.override=process.env.DOTENV_CONFIG_OVERRIDE);process.env.DOTENV_CONFIG_DOTENV_KEY!=null&&(Ae.DOTENV_KEY=process.env.DOTENV_CONFIG_DOTENV_KEY);Vn.exports=Ae});var Yn=v((Sy,zn)=>{var su=/^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;zn.exports=function(e){let t=e.reduce(function(r,n){let s=n.match(su);return s&&(r[s[1]]=s[2]),r},{});return"quiet"in t||(t.quiet="true"),t}});var tt=v(Mi=>{var kt=class extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},ji=class extends kt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Mi.CommanderError=kt;Mi.InvalidArgumentError=ji});var St=v(Ni=>{var{InvalidArgumentError:ou}=tt(),Ii=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new ou(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function au(i){let e=i.name()+(i.variadic===!0?"...":"");return i.required?"<"+e+">":"["+e+"]"}Ni.Argument=Ii;Ni.humanReadableArgName=au});var Di=v(Ui=>{var{humanReadableArgName:cu}=St(),Fi=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((n,s)=>n.name().localeCompare(s.name())),t}compareOptions(e,t){let r=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!n&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!n&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter(s=>!s.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>cu(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth??80;function s(u,d){return t.formatItem(u,r,d,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(a),n),""]));let c=t.visibleArguments(e).map(u=>s(t.styleArgumentTerm(t.argumentTerm(u)),t.styleArgumentDescription(t.argumentDescription(u))));c.length>0&&(o=o.concat([t.styleTitle("Arguments:"),...c,""]));let l=t.visibleOptions(e).map(u=>s(t.styleOptionTerm(t.optionTerm(u)),t.styleOptionDescription(t.optionDescription(u))));if(l.length>0&&(o=o.concat([t.styleTitle("Options:"),...l,""])),t.showGlobalOptions){let u=t.visibleGlobalOptions(e).map(d=>s(t.styleOptionTerm(t.optionTerm(d)),t.styleOptionDescription(t.optionDescription(d))));u.length>0&&(o=o.concat([t.styleTitle("Global Options:"),...u,""]))}let p=t.visibleCommands(e).map(u=>s(t.styleSubcommandTerm(t.subcommandTerm(u)),t.styleSubcommandDescription(t.subcommandDescription(u))));return p.length>0&&(o=o.concat([t.styleTitle("Commands:"),...p,""])),o.join(`
5
- `)}displayWidth(e){return Jn(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){let o=" ".repeat(2);if(!r)return o+e;let a=e.padEnd(t+e.length-n.displayWidth(e)),c=2,p=(this.helpWidth??80)-t-c-2,u;return p<this.minWidthToWrap||n.preformatted(r)?u=r:u=n.boxWrap(r,p).replace(/\n/g,`
2
+ "use strict";var Hp=Object.create;var Dn=Object.defineProperty;var Wp=Object.getOwnPropertyDescriptor;var Gp=Object.getOwnPropertyNames;var Vp=Object.getPrototypeOf,Bp=Object.prototype.hasOwnProperty;var v=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var zp=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Gp(e))!Bp.call(i,n)&&n!==t&&Dn(i,n,{get:()=>e[n],enumerable:!(r=Wp(e,n))||r.enumerable});return i};var P=(i,e,t)=>(t=i!=null?Hp(Vp(i)):{},zp(e||!i||!i.__esModule?Dn(t,"default",{value:i,enumerable:!0}):t,i));var qn=v((jy,Yp)=>{Yp.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Bn=v((My,Ee)=>{var Ii=require("fs"),_t=require("path"),Jp=require("os"),Xp=require("crypto"),Kp=qn(),Ni=Kp.version,Qp=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Zp(i){let e={},t=i.toString();t=t.replace(/\r\n?/mg,`
3
+ `);let r;for(;(r=Qp.exec(t))!=null;){let n=r[1],s=r[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
4
+ `),s=s.replace(/\\r/g,"\r")),e[n]=s}return e}function eu(i){i=i||{};let e=Vn(i);i.path=e;let t=G.configDotenv(i);if(!t.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=Gn(i).split(","),n=r.length,s;for(let o=0;o<n;o++)try{let a=r[o].trim(),c=iu(t,a);s=G.decrypt(c.ciphertext,c.key);break}catch(a){if(o+1>=n)throw a}return G.parse(s)}function tu(i){console.log(`[dotenv@${Ni}][WARN] ${i}`)}function rt(i){console.log(`[dotenv@${Ni}][DEBUG] ${i}`)}function Wn(i){console.log(`[dotenv@${Ni}] ${i}`)}function Gn(i){return i&&i.DOTENV_KEY&&i.DOTENV_KEY.length>0?i.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function iu(i,e){let t;try{t=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let r=t.password;if(!r){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let n=t.searchParams.get("environment");if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${n.toUpperCase()}`,o=i.parsed[s];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:r}}function Vn(i){let e=null;if(i&&i.path&&i.path.length>0)if(Array.isArray(i.path))for(let t of i.path)Ii.existsSync(t)&&(e=t.endsWith(".vault")?t:`${t}.vault`);else e=i.path.endsWith(".vault")?i.path:`${i.path}.vault`;else e=_t.resolve(process.cwd(),".env.vault");return Ii.existsSync(e)?e:null}function Hn(i){return i[0]==="~"?_t.join(Jp.homedir(),i.slice(1)):i}function ru(i){let e=!!(i&&i.debug),t=i&&"quiet"in i?i.quiet:!0;(e||!t)&&Wn("Loading env from encrypted .env.vault");let r=G._parseVault(i),n=process.env;return i&&i.processEnv!=null&&(n=i.processEnv),G.populate(n,r,i),{parsed:r}}function nu(i){let e=_t.resolve(process.cwd(),".env"),t="utf8",r=!!(i&&i.debug),n=i&&"quiet"in i?i.quiet:!0;i&&i.encoding?t=i.encoding:r&&rt("No encoding is specified. UTF-8 is used by default");let s=[e];if(i&&i.path)if(!Array.isArray(i.path))s=[Hn(i.path)];else{s=[];for(let l of i.path)s.push(Hn(l))}let o,a={};for(let l of s)try{let p=G.parse(Ii.readFileSync(l,{encoding:t}));G.populate(a,p,i)}catch(p){r&&rt(`Failed to load ${l} ${p.message}`),o=p}let c=process.env;if(i&&i.processEnv!=null&&(c=i.processEnv),G.populate(c,a,i),r||!n){let l=Object.keys(a).length,p=[];for(let u of s)try{let f=_t.relative(process.cwd(),u);p.push(f)}catch(f){r&&rt(`Failed to load ${u} ${f.message}`),o=f}Wn(`injecting env (${l}) from ${p.join(",")}`)}return o?{parsed:a,error:o}:{parsed:a}}function su(i){if(Gn(i).length===0)return G.configDotenv(i);let e=Vn(i);return e?G._configVault(i):(tu(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),G.configDotenv(i))}function ou(i,e){let t=Buffer.from(e.slice(-64),"hex"),r=Buffer.from(i,"base64"),n=r.subarray(0,12),s=r.subarray(-16);r=r.subarray(12,-16);try{let o=Xp.createDecipheriv("aes-256-gcm",t,n);return o.setAuthTag(s),`${o.update(r)}${o.final()}`}catch(o){let a=o instanceof RangeError,c=o.message==="Invalid key length",l=o.message==="Unsupported state or unable to authenticate data";if(a||c){let p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(l){let p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw o}}function au(i,e,t={}){let r=!!(t&&t.debug),n=!!(t&&t.override);if(typeof e!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(e))Object.prototype.hasOwnProperty.call(i,s)?(n===!0&&(i[s]=e[s]),r&&rt(n===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):i[s]=e[s]}var G={configDotenv:nu,_configVault:ru,_parseVault:eu,config:su,decrypt:ou,parse:Zp,populate:au};Ee.exports.configDotenv=G.configDotenv;Ee.exports._configVault=G._configVault;Ee.exports._parseVault=G._parseVault;Ee.exports.config=G.config;Ee.exports.decrypt=G.decrypt;Ee.exports.parse=G.parse;Ee.exports.populate=G.populate;Ee.exports=G});var Yn=v((Iy,zn)=>{var Le={};process.env.DOTENV_CONFIG_ENCODING!=null&&(Le.encoding=process.env.DOTENV_CONFIG_ENCODING);process.env.DOTENV_CONFIG_PATH!=null&&(Le.path=process.env.DOTENV_CONFIG_PATH);process.env.DOTENV_CONFIG_QUIET!=null&&(Le.quiet=process.env.DOTENV_CONFIG_QUIET);process.env.DOTENV_CONFIG_DEBUG!=null&&(Le.debug=process.env.DOTENV_CONFIG_DEBUG);process.env.DOTENV_CONFIG_OVERRIDE!=null&&(Le.override=process.env.DOTENV_CONFIG_OVERRIDE);process.env.DOTENV_CONFIG_DOTENV_KEY!=null&&(Le.DOTENV_KEY=process.env.DOTENV_CONFIG_DOTENV_KEY);zn.exports=Le});var Xn=v((Ny,Jn)=>{var cu=/^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/;Jn.exports=function(e){let t=e.reduce(function(r,n){let s=n.match(cu);return s&&(r[s[1]]=s[2]),r},{});return"quiet"in t||(t.quiet="true"),t}});var nt=v(Ui=>{var Ct=class extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},Fi=class extends Ct{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ui.CommanderError=Ct;Ui.InvalidArgumentError=Fi});var Tt=v(qi=>{var{InvalidArgumentError:lu}=nt(),Di=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new lu(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function pu(i){let e=i.name()+(i.variadic===!0?"...":"");return i.required?"<"+e+">":"["+e+"]"}qi.Argument=Di;qi.humanReadableArgName=pu});var Gi=v(Wi=>{var{humanReadableArgName:uu}=Tt(),Hi=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((n,s)=>n.name().localeCompare(s.name())),t}compareOptions(e,t){let r=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!n&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!n&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter(s=>!s.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(r=>uu(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth??80;function s(u,f){return t.formatItem(u,r,f,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],a=t.commandDescription(e);a.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(a),n),""]));let c=t.visibleArguments(e).map(u=>s(t.styleArgumentTerm(t.argumentTerm(u)),t.styleArgumentDescription(t.argumentDescription(u))));c.length>0&&(o=o.concat([t.styleTitle("Arguments:"),...c,""]));let l=t.visibleOptions(e).map(u=>s(t.styleOptionTerm(t.optionTerm(u)),t.styleOptionDescription(t.optionDescription(u))));if(l.length>0&&(o=o.concat([t.styleTitle("Options:"),...l,""])),t.showGlobalOptions){let u=t.visibleGlobalOptions(e).map(f=>s(t.styleOptionTerm(t.optionTerm(f)),t.styleOptionDescription(t.optionDescription(f))));u.length>0&&(o=o.concat([t.styleTitle("Global Options:"),...u,""]))}let p=t.visibleCommands(e).map(u=>s(t.styleSubcommandTerm(t.subcommandTerm(u)),t.styleSubcommandDescription(t.subcommandDescription(u))));return p.length>0&&(o=o.concat([t.styleTitle("Commands:"),...p,""])),o.join(`
5
+ `)}displayWidth(e){return Kn(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){let o=" ".repeat(2);if(!r)return o+e;let a=e.padEnd(t+e.length-n.displayWidth(e)),c=2,p=(this.helpWidth??80)-t-c-2,u;return p<this.minWidthToWrap||n.preformatted(r)?u=r:u=n.boxWrap(r,p).replace(/\n/g,`
6
6
  `+" ".repeat(t+c)),o+a+" ".repeat(c)+u.replace(/\n/g,`
7
- ${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return r.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(p=>{let u=this.displayWidth(p);if(l+u<=t){c.push(p),l+=u;return}s.push(c.join(""));let d=p.trimStart();c=[d],l=this.displayWidth(d)}),s.push(c.join(""))}),s.join(`
8
- `)}};function Jn(i){let e=/\x1b\[\d*(;\d*)*m/g;return i.replace(e,"")}Ui.Help=Fi;Ui.stripColor=Jn});var Wi=v(Hi=>{var{InvalidArgumentError:lu}=tt(),qi=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=pu(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new lu(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Xn(this.name().replace(/^no-/,"")):Xn(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Gi=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,s=n!==void 0?n:!1;return t.negate===(s===e)}};function Xn(i){return i.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function pu(i){let e,t,r=/^-[^-]$/,n=/^--[^-]/,s=i.split(/[ |,]+/).concat("guard");if(r.test(s[0])&&(e=s.shift()),n.test(s[0])&&(t=s.shift()),!e&&r.test(s[0])&&(e=s.shift()),!e&&n.test(s[0])&&(e=t,t=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${i}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
7
+ ${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return r.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(p=>{let u=this.displayWidth(p);if(l+u<=t){c.push(p),l+=u;return}s.push(c.join(""));let f=p.trimStart();c=[f],l=this.displayWidth(f)}),s.push(c.join(""))}),s.join(`
8
+ `)}};function Kn(i){let e=/\x1b\[\d*(;\d*)*m/g;return i.replace(e,"")}Wi.Help=Hi;Wi.stripColor=Kn});var Yi=v(zi=>{var{InvalidArgumentError:mu}=nt(),Vi=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=du(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new mu(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Qn(this.name().replace(/^no-/,"")):Qn(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Bi=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,s=n!==void 0?n:!1;return t.negate===(s===e)}};function Qn(i){return i.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function du(i){let e,t,r=/^-[^-]$/,n=/^--[^-]/,s=i.split(/[ |,]+/).concat("guard");if(r.test(s[0])&&(e=s.shift()),n.test(s[0])&&(t=s.shift()),!e&&r.test(s[0])&&(e=s.shift()),!e&&n.test(s[0])&&(e=t,t=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${i}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
9
9
  - a short flag is a single dash and a single character
10
10
  - either use a single dash and a single character (for a short flag)
11
11
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(o)?new Error(`${a}
12
12
  - too many short flags`):n.test(o)?new Error(`${a}
13
13
  - too many long flags`):new Error(`${a}
14
- - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${i}'.`);return{shortFlag:e,longFlag:t}}Hi.Option=qi;Hi.DualOptions=Gi});var Qn=v(Kn=>{function uu(i,e){if(Math.abs(i.length-e.length)>3)return Math.max(i.length,e.length);let t=[];for(let r=0;r<=i.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=e.length;r++)for(let n=1;n<=i.length;n++){let s=1;i[n-1]===e[r-1]?s=0:s=1,t[n][r]=Math.min(t[n-1][r]+1,t[n][r-1]+1,t[n-1][r-1]+s),n>1&&r>1&&i[n-1]===e[r-2]&&i[n-2]===e[r-1]&&(t[n][r]=Math.min(t[n][r],t[n-2][r-2]+1))}return t[i.length][e.length]}function mu(i,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=i.startsWith("--");t&&(i=i.slice(2),e=e.map(o=>o.slice(2)));let r=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=uu(i,o),c=Math.max(i.length,o.length);(c-a)/c>s&&(a<n?(n=a,r=[o]):a===n&&r.push(o))}),r.sort((o,a)=>o.localeCompare(a)),t&&(r=r.map(o=>`--${o}`)),r.length>1?`
14
+ - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${i}'.`);return{shortFlag:e,longFlag:t}}zi.Option=Vi;zi.DualOptions=Bi});var es=v(Zn=>{function fu(i,e){if(Math.abs(i.length-e.length)>3)return Math.max(i.length,e.length);let t=[];for(let r=0;r<=i.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=e.length;r++)for(let n=1;n<=i.length;n++){let s=1;i[n-1]===e[r-1]?s=0:s=1,t[n][r]=Math.min(t[n-1][r]+1,t[n][r-1]+1,t[n-1][r-1]+s),n>1&&r>1&&i[n-1]===e[r-2]&&i[n-2]===e[r-1]&&(t[n][r]=Math.min(t[n][r],t[n-2][r-2]+1))}return t[i.length][e.length]}function hu(i,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=i.startsWith("--");t&&(i=i.slice(2),e=e.map(o=>o.slice(2)));let r=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=fu(i,o),c=Math.max(i.length,o.length);(c-a)/c>s&&(a<n?(n=a,r=[o]):a===n&&r.push(o))}),r.sort((o,a)=>o.localeCompare(a)),t&&(r=r.map(o=>`--${o}`)),r.length>1?`
15
15
  (Did you mean one of ${r.join(", ")}?)`:r.length===1?`
16
- (Did you mean ${r[0]}?)`:""}Kn.suggestSimilar=mu});var is=v(Ji=>{var du=require("node:events").EventEmitter,Vi=require("node:child_process"),Ee=require("node:path"),_t=require("node:fs"),L=require("node:process"),{Argument:fu,humanReadableArgName:hu}=St(),{CommanderError:Bi}=tt(),{Help:gu,stripColor:xu}=Di(),{Option:Zn,DualOptions:vu}=Wi(),{suggestSimilar:es}=Qn(),zi=class i extends du{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>L.stdout.write(t),writeErr:t=>L.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>L.stdout.isTTY?L.stdout.columns:void 0,getErrHelpWidth:()=>L.stderr.isTTY?L.stderr.columns:void 0,getOutHasColors:()=>Yi()??(L.stdout.isTTY&&L.stdout.hasColors?.()),getErrHasColors:()=>Yi()??(L.stderr.isTTY&&L.stderr.hasColors?.()),stripColor:t=>xu(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,s=r;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return n&&(c.description(n),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new i(e)}createHelp(){return Object.assign(new gu,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
17
- - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new fu(e,t)}argument(e,t,r,n){let s=this.createArgument(e,t);return typeof r=="function"?s.default(n).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,r,n]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",o=this.createCommand(r);return o.helpOption(!1),n&&o.arguments(n),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
18
- Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new Bi(e,t,r)),L.exit(e)}action(e){let t=r=>{let n=this.registeredArguments.length,s=r.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new Zn(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
19
- - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=n=>[n.name()].concat(n.aliases()),r=t(e).find(n=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let c=this.getOptionValue(r);s!==null&&e.parseArg?s=this._callParseArg(e,s,c,o):s!==null&&e.variadic&&(s=e._concatValue(s,c)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(r,s,a)};return this.on("option:"+t,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;n(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;n(s,o,"env")}),this}_optionEx(e,t,r,n,s){if(typeof t=="object"&&t instanceof Zn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(t,r);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,l)=>{let p=a.exec(c);return p?p[0]:l},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(e)!==void 0&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){L.versions?.electron&&(t.from="electron");let n=L.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(t.from="eval")}e===void 0&&(e=L.argv),this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":L.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
20
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(_t.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
16
+ (Did you mean ${r[0]}?)`:""}Zn.suggestSimilar=hu});var ns=v(Zi=>{var gu=require("node:events").EventEmitter,Ji=require("node:child_process"),Re=require("node:path"),Ot=require("node:fs"),M=require("node:process"),{Argument:xu,humanReadableArgName:vu}=Tt(),{CommanderError:Xi}=nt(),{Help:bu,stripColor:yu}=Gi(),{Option:ts,DualOptions:wu}=Yi(),{suggestSimilar:is}=es(),Ki=class i extends gu{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>M.stdout.write(t),writeErr:t=>M.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>M.stdout.isTTY?M.stdout.columns:void 0,getErrHelpWidth:()=>M.stderr.isTTY?M.stderr.columns:void 0,getOutHasColors:()=>Qi()??(M.stdout.isTTY&&M.stdout.hasColors?.()),getErrHasColors:()=>Qi()??(M.stderr.isTTY&&M.stderr.hasColors?.()),stripColor:t=>yu(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,s=r;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return n&&(c.description(n),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new i(e)}createHelp(){return Object.assign(new bu,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
17
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new xu(e,t)}argument(e,t,r,n){let s=this.createArgument(e,t);return typeof r=="function"?s.default(n).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,r,n]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",o=this.createCommand(r);return o.helpOption(!1),n&&o.arguments(n),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
18
+ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new Xi(e,t,r)),M.exit(e)}action(e){let t=r=>{let n=this.registeredArguments.length,s=r.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new ts(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
19
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=n=>[n.name()].concat(n.aliases()),r=t(e).find(n=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let c=this.getOptionValue(r);s!==null&&e.parseArg?s=this._callParseArg(e,s,c,o):s!==null&&e.variadic&&(s=e._concatValue(s,c)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(r,s,a)};return this.on("option:"+t,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;n(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;n(s,o,"env")}),this}_optionEx(e,t,r,n,s){if(typeof t=="object"&&t instanceof ts)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(t,r);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,l)=>{let p=a.exec(c);return p?p[0]:l},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(e)!==void 0&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){M.versions?.electron&&(t.from="electron");let n=M.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(t.from="eval")}e===void 0&&(e=M.argv),this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":M.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
20
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(Ot.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
21
21
  - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
22
22
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
23
- - ${n}`;throw new Error(s)}_executeSubCommand(e,t){t=t.slice();let r=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(p,u){let d=Ee.resolve(p,u);if(_t.existsSync(d))return d;if(n.includes(Ee.extname(u)))return;let f=n.find(x=>_t.existsSync(`${d}${x}`));if(f)return`${d}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=_t.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=Ee.resolve(Ee.dirname(p),a)}if(a){let p=s(a,o);if(!p&&!e._executableFile&&this._scriptPath){let u=Ee.basename(this._scriptPath,Ee.extname(this._scriptPath));u!==this._name&&(p=s(a,`${u}-${e._name}`))}o=p||o}r=n.includes(Ee.extname(o));let c;L.platform!=="win32"?r?(t.unshift(o),t=ts(L.execArgv).concat(t),c=Vi.spawn(L.argv[0],t,{stdio:"inherit"})):c=Vi.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=ts(L.execArgv).concat(t),c=Vi.spawn(L.execPath,t,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{L.on(u,()=>{c.killed===!1&&c.exitCode===null&&c.kill(u)})});let l=this._exitCallback;c.on("close",p=>{p=p??1,l?l(new Bi(p,"commander.executeSubCommandAsync","(close)")):L.exit(p)}),c.on("error",p=>{if(p.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(p.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)L.exit(1);else{let u=new Bi(1,"commander.executeSubCommandAsync","(error)");u.nestedError=p,l(u)}}),this.runningCommand=c}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),s}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,n,s)=>{let o=n;if(n!==null&&r.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;o=this._callParseArg(r,n,s,a)}return o};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let s=r.defaultValue;r.variadic?n<this.args.length?(s=this.args.slice(n),r.parseArg&&(s=s.reduce((o,a)=>e(r,a,o),r.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],r.parseArg&&(s=e(r,s,r.defaultValue))),t[n]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),t==="postAction"&&n.reverse(),n.forEach(s=>{r=this._chainOrCall(r,()=>s.callback(s.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(s=>{n=this._chainOrCall(n,()=>s(this,t))}),n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,t)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(r=>{let n=r.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(r=>r.conflictsWith.length>0).forEach(r=>{let n=e.find(s=>r.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t,s=e.slice();function o(c){return c.length>1&&c[0]==="-"}let a=null;for(;s.length;){let c=s.shift();if(c==="--"){n===r&&n.push(c),n.push(...s);break}if(a&&!o(c)){this.emit(`option:${a.name()}`,c);continue}if(a=null,o(c)){let l=this._findOption(c);if(l){if(l.required){let p=s.shift();p===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;s.length>0&&!o(s[0])&&(p=s.shift()),this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);a=l.variadic?l:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let l=this._findOption(`-${c[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,c.slice(2)):(this.emit(`option:${l.name()}`),s.unshift(`-${c.slice(2)}`));continue}}if(/^--[^=]+=/.test(c)){let l=c.indexOf("="),p=this._findOption(c.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,c.slice(l+1));continue}}if(o(c)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(c)){t.push(c),s.length>0&&r.push(...s);break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){t.push(c),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){r.push(c),s.length>0&&r.push(...s);break}}if(this._passThroughOptions){n.push(c),s.length>0&&n.push(...s);break}n.push(c)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
23
+ - ${n}`;throw new Error(s)}_executeSubCommand(e,t){t=t.slice();let r=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(p,u){let f=Re.resolve(p,u);if(Ot.existsSync(f))return f;if(n.includes(Re.extname(u)))return;let d=n.find(h=>Ot.existsSync(`${f}${h}`));if(d)return`${f}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=Ot.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=Re.resolve(Re.dirname(p),a)}if(a){let p=s(a,o);if(!p&&!e._executableFile&&this._scriptPath){let u=Re.basename(this._scriptPath,Re.extname(this._scriptPath));u!==this._name&&(p=s(a,`${u}-${e._name}`))}o=p||o}r=n.includes(Re.extname(o));let c;M.platform!=="win32"?r?(t.unshift(o),t=rs(M.execArgv).concat(t),c=Ji.spawn(M.argv[0],t,{stdio:"inherit"})):c=Ji.spawn(o,t,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),t.unshift(o),t=rs(M.execArgv).concat(t),c=Ji.spawn(M.execPath,t,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{M.on(u,()=>{c.killed===!1&&c.exitCode===null&&c.kill(u)})});let l=this._exitCallback;c.on("close",p=>{p=p??1,l?l(new Xi(p,"commander.executeSubCommandAsync","(close)")):M.exit(p)}),c.on("error",p=>{if(p.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(p.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)M.exit(1);else{let u=new Xi(1,"commander.executeSubCommandAsync","(error)");u.nestedError=p,l(u)}}),this.runningCommand=c}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),s}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,n,s)=>{let o=n;if(n!==null&&r.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;o=this._callParseArg(r,n,s,a)}return o};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let s=r.defaultValue;r.variadic?n<this.args.length?(s=this.args.slice(n),r.parseArg&&(s=s.reduce((o,a)=>e(r,a,o),r.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],r.parseArg&&(s=e(r,s,r.defaultValue))),t[n]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),t==="postAction"&&n.reverse(),n.forEach(s=>{r=this._chainOrCall(r,()=>s.callback(s.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(s=>{n=this._chainOrCall(n,()=>s(this,t))}),n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,t)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(r=>{let n=r.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(r=>r.conflictsWith.length>0).forEach(r=>{let n=e.find(s=>r.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t,s=e.slice();function o(c){return c.length>1&&c[0]==="-"}let a=null;for(;s.length;){let c=s.shift();if(c==="--"){n===r&&n.push(c),n.push(...s);break}if(a&&!o(c)){this.emit(`option:${a.name()}`,c);continue}if(a=null,o(c)){let l=this._findOption(c);if(l){if(l.required){let p=s.shift();p===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;s.length>0&&!o(s[0])&&(p=s.shift()),this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);a=l.variadic?l:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let l=this._findOption(`-${c[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,c.slice(2)):(this.emit(`option:${l.name()}`),s.unshift(`-${c.slice(2)}`));continue}}if(/^--[^=]+=/.test(c)){let l=c.indexOf("="),p=this._findOption(c.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,c.slice(l+1));continue}}if(o(c)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(c)){t.push(c),s.length>0&&r.push(...s);break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){t.push(c),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){r.push(c),s.length>0&&r.push(...s);break}}if(this._passThroughOptions){n.push(c),s.length>0&&n.push(...s);break}n.push(c)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
24
24
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
25
25
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
26
- `),this.outputHelp({error:!0}));let r=t||{},n=r.exitCode||1,s=r.code||"commander.error";this._exit(n,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in L.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,L.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new vu(this.options),t=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=o=>{let a=o.attributeName(),c=this.getOptionValue(a),l=this.options.find(u=>u.negate&&a===u.attributeName()),p=this.options.find(u=>!u.negate&&a===u.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:p||o},n=o=>{let a=r(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=es(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),t=es(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
27
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(r=>hu(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=Ee.basename(e,Ee.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);return r.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let t=!!e.error,r,n,s;return t?(r=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),r(a)),hasColors:n,helpWidth:s}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:r.error});if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=Number(L.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
26
+ `),this.outputHelp({error:!0}));let r=t||{},n=r.exitCode||1,s=r.code||"commander.error";this._exit(n,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in M.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,M.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new wu(this.options),t=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=o=>{let a=o.attributeName(),c=this.getOptionValue(a),l=this.options.find(u=>u.negate&&a===u.attributeName()),p=this.options.find(u=>!u.negate&&a===u.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:p||o},n=o=>{let a=r(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=is(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),t=is(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
27
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(r=>vu(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=Re.basename(e,Re.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);return r.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let t=!!e.error,r,n,s;return t?(r=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),r(a)),hasColors:n,helpWidth:s}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:r.error});if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=Number(M.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.
28
28
  Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,s=>{let o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
29
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ts(i){return i.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",n="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?n=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],n=s[4]),t&&n!=="0"?`${t}=${r}:${parseInt(n)+1}`:e})}function Yi(){if(L.env.NO_COLOR||L.env.FORCE_COLOR==="0"||L.env.FORCE_COLOR==="false")return!1;if(L.env.FORCE_COLOR||L.env.CLICOLOR_FORCE!==void 0)return!0}Ji.Command=zi;Ji.useColor=Yi});var Ct=v(ne=>{var{Argument:rs}=St(),{Command:Xi}=is(),{CommanderError:bu,InvalidArgumentError:ns}=tt(),{Help:yu}=Di(),{Option:ss}=Wi();ne.program=new Xi;ne.createCommand=i=>new Xi(i);ne.createOption=(i,e)=>new ss(i,e);ne.createArgument=(i,e)=>new rs(i,e);ne.Command=Xi;ne.Option=ss;ne.Argument=rs;ne.Help=yu;ne.CommanderError=bu;ne.InvalidArgumentError=ns;ne.InvalidOptionArgumentError=ns});var De=v((Ki,as)=>{var Ot=require("buffer"),he=Ot.Buffer;function os(i,e){for(var t in i)e[t]=i[t]}he.from&&he.alloc&&he.allocUnsafe&&he.allocUnsafeSlow?as.exports=Ot:(os(Ot,Ki),Ki.Buffer=Le);function Le(i,e,t){return he(i,e,t)}Le.prototype=Object.create(he.prototype);os(he,Le);Le.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return he(i,e,t)};Le.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var r=he(i);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Le.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return he(i)};Le.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return Ot.SlowBuffer(i)}});var Qi=v((jy,cs)=>{var Tt=De().Buffer,wu=require("stream"),Eu=require("util");function Pt(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=Tt.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=Tt.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}Eu.inherits(Pt,wu);Pt.prototype.write=function(e){this.buffer=Tt.concat([this.buffer,Tt.from(e)]),this.emit("data",e)};Pt.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};cs.exports=Pt});var ps=v((My,ls)=>{"use strict";function Zi(i){var e=(i/8|0)+(i%8===0?0:1);return e}var Ru={ES256:Zi(256),ES384:Zi(384),ES512:Zi(521)};function $u(i){var e=Ru[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}ls.exports=$u});var xs=v((Iy,gs)=>{"use strict";var At=De().Buffer,ms=ps(),Lt=128,ds=0,ku=32,Su=16,_u=2,fs=Su|ku|ds<<6,jt=_u|ds<<6;function Cu(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function hs(i){if(At.isBuffer(i))return i;if(typeof i=="string")return At.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Ou(i,e){i=hs(i);var t=ms(e),r=t+1,n=i.length,s=0;if(i[s++]!==fs)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(Lt|1)&&(o=i[s++]),n-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(n-s)+'" remaining');if(i[s++]!==jt)throw new Error('Could not find expected "int" for "r"');var a=i[s++];if(n-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(n-s-2)+'" available');if(r<a)throw new Error('"r" specified length of "'+a+'", max of "'+r+'" is acceptable');var c=s;if(s+=a,i[s++]!==jt)throw new Error('Could not find expected "int" for "s"');var l=i[s++];if(n-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(n-s)+'"');if(r<l)throw new Error('"s" specified length of "'+l+'", max of "'+r+'" is acceptable');var p=s;if(s+=l,s!==n)throw new Error('Expected to consume entire buffer, but "'+(n-s)+'" bytes remain');var u=t-a,d=t-l,f=At.allocUnsafe(u+a+d+l);for(s=0;s<u;++s)f[s]=0;i.copy(f,s,c+Math.max(-u,0),c+a),s=t;for(var x=s;s<x+d;++s)f[s]=0;return i.copy(f,s,p+Math.max(-d,0),p+l),f=f.toString("base64"),f=Cu(f),f}function us(i,e,t){for(var r=0;e+r<t&&i[e+r]===0;)++r;var n=i[e+r]>=Lt;return n&&--r,r}function Tu(i,e){i=hs(i);var t=ms(e),r=i.length;if(r!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+r+'"');var n=us(i,0,t),s=us(i,t,i.length),o=t-n,a=t-s,c=2+o+1+1+a,l=c<Lt,p=At.allocUnsafe((l?2:3)+c),u=0;return p[u++]=fs,l?p[u++]=c:(p[u++]=Lt|1,p[u++]=c&255),p[u++]=jt,p[u++]=o,n<0?(p[u++]=0,u+=i.copy(p,u,0,t)):u+=i.copy(p,u,n,t),p[u++]=jt,p[u++]=a,s<0?(p[u++]=0,i.copy(p,u,t)):i.copy(p,u,t+s),p}gs.exports={derToJose:Ou,joseToDer:Tu}});var bs=v((Ny,vs)=>{"use strict";var it=require("buffer").Buffer,er=require("buffer").SlowBuffer;vs.exports=Mt;function Mt(i,e){if(!it.isBuffer(i)||!it.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,r=0;r<i.length;r++)t|=i[r]^e[r];return t===0}Mt.install=function(){it.prototype.equal=er.prototype.equal=function(e){return Mt(this,e)}};var Pu=it.prototype.equal,Au=er.prototype.equal;Mt.restore=function(){it.prototype.equal=Pu,er.prototype.equal=Au}});var nr=v((Fy,Cs)=>{var Ge=De().Buffer,se=require("crypto"),ws=xs(),ys=require("util"),Lu=`"%s" is not a valid algorithm.
29
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function rs(i){return i.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",n="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?n=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],n=s[4]),t&&n!=="0"?`${t}=${r}:${parseInt(n)+1}`:e})}function Qi(){if(M.env.NO_COLOR||M.env.FORCE_COLOR==="0"||M.env.FORCE_COLOR==="false")return!1;if(M.env.FORCE_COLOR||M.env.CLICOLOR_FORCE!==void 0)return!0}Zi.Command=Ki;Zi.useColor=Qi});var Pt=v(oe=>{var{Argument:ss}=Tt(),{Command:er}=ns(),{CommanderError:Eu,InvalidArgumentError:os}=nt(),{Help:Ru}=Gi(),{Option:as}=Yi();oe.program=new er;oe.createCommand=i=>new er(i);oe.createOption=(i,e)=>new as(i,e);oe.createArgument=(i,e)=>new ss(i,e);oe.Command=er;oe.Option=as;oe.Argument=ss;oe.Help=Ru;oe.CommanderError=Eu;oe.InvalidArgumentError=os;oe.InvalidOptionArgumentError=os});var He=v((tr,ls)=>{var At=require("buffer"),ge=At.Buffer;function cs(i,e){for(var t in i)e[t]=i[t]}ge.from&&ge.alloc&&ge.allocUnsafe&&ge.allocUnsafeSlow?ls.exports=At:(cs(At,tr),tr.Buffer=je);function je(i,e,t){return ge(i,e,t)}je.prototype=Object.create(ge.prototype);cs(ge,je);je.from=function(i,e,t){if(typeof i=="number")throw new TypeError("Argument must not be a number");return ge(i,e,t)};je.alloc=function(i,e,t){if(typeof i!="number")throw new TypeError("Argument must be a number");var r=ge(i);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};je.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return ge(i)};je.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return At.SlowBuffer(i)}});var ir=v((Vy,ps)=>{var Lt=He().Buffer,$u=require("stream"),ku=require("util");function jt(i){if(this.buffer=null,this.writable=!0,this.readable=!0,!i)return this.buffer=Lt.alloc(0),this;if(typeof i.pipe=="function")return this.buffer=Lt.alloc(0),i.pipe(this),this;if(i.length||typeof i=="object")return this.buffer=i,this.writable=!1,process.nextTick(function(){this.emit("end",i),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof i+")")}ku.inherits(jt,$u);jt.prototype.write=function(e){this.buffer=Lt.concat([this.buffer,Lt.from(e)]),this.emit("data",e)};jt.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};ps.exports=jt});var ms=v((By,us)=>{"use strict";function rr(i){var e=(i/8|0)+(i%8===0?0:1);return e}var Su={ES256:rr(256),ES384:rr(384),ES512:rr(521)};function _u(i){var e=Su[i];if(e)return e;throw new Error('Unknown algorithm "'+i+'"')}us.exports=_u});var bs=v((zy,vs)=>{"use strict";var Mt=He().Buffer,fs=ms(),It=128,hs=0,Cu=32,Tu=16,Ou=2,gs=Tu|Cu|hs<<6,Nt=Ou|hs<<6;function Pu(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function xs(i){if(Mt.isBuffer(i))return i;if(typeof i=="string")return Mt.from(i,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Au(i,e){i=xs(i);var t=fs(e),r=t+1,n=i.length,s=0;if(i[s++]!==gs)throw new Error('Could not find expected "seq"');var o=i[s++];if(o===(It|1)&&(o=i[s++]),n-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(n-s)+'" remaining');if(i[s++]!==Nt)throw new Error('Could not find expected "int" for "r"');var a=i[s++];if(n-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(n-s-2)+'" available');if(r<a)throw new Error('"r" specified length of "'+a+'", max of "'+r+'" is acceptable');var c=s;if(s+=a,i[s++]!==Nt)throw new Error('Could not find expected "int" for "s"');var l=i[s++];if(n-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(n-s)+'"');if(r<l)throw new Error('"s" specified length of "'+l+'", max of "'+r+'" is acceptable');var p=s;if(s+=l,s!==n)throw new Error('Expected to consume entire buffer, but "'+(n-s)+'" bytes remain');var u=t-a,f=t-l,d=Mt.allocUnsafe(u+a+f+l);for(s=0;s<u;++s)d[s]=0;i.copy(d,s,c+Math.max(-u,0),c+a),s=t;for(var h=s;s<h+f;++s)d[s]=0;return i.copy(d,s,p+Math.max(-f,0),p+l),d=d.toString("base64"),d=Pu(d),d}function ds(i,e,t){for(var r=0;e+r<t&&i[e+r]===0;)++r;var n=i[e+r]>=It;return n&&--r,r}function Lu(i,e){i=xs(i);var t=fs(e),r=i.length;if(r!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+r+'"');var n=ds(i,0,t),s=ds(i,t,i.length),o=t-n,a=t-s,c=2+o+1+1+a,l=c<It,p=Mt.allocUnsafe((l?2:3)+c),u=0;return p[u++]=gs,l?p[u++]=c:(p[u++]=It|1,p[u++]=c&255),p[u++]=Nt,p[u++]=o,n<0?(p[u++]=0,u+=i.copy(p,u,0,t)):u+=i.copy(p,u,n,t),p[u++]=Nt,p[u++]=a,s<0?(p[u++]=0,i.copy(p,u,t)):i.copy(p,u,t+s),p}vs.exports={derToJose:Au,joseToDer:Lu}});var ws=v((Yy,ys)=>{"use strict";var st=require("buffer").Buffer,nr=require("buffer").SlowBuffer;ys.exports=Ft;function Ft(i,e){if(!st.isBuffer(i)||!st.isBuffer(e)||i.length!==e.length)return!1;for(var t=0,r=0;r<i.length;r++)t|=i[r]^e[r];return t===0}Ft.install=function(){st.prototype.equal=nr.prototype.equal=function(e){return Ft(this,e)}};var ju=st.prototype.equal,Mu=nr.prototype.equal;Ft.restore=function(){st.prototype.equal=ju,nr.prototype.equal=Mu}});var cr=v((Jy,Os)=>{var Ge=He().Buffer,ae=require("crypto"),Rs=bs(),Es=require("util"),Iu=`"%s" is not a valid algorithm.
30
30
  Supported algorithms are:
31
- "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,rt="secret must be a string or buffer",qe="key must be a string or a buffer",ju="key must be a string, a buffer or an object",ir=typeof se.createPublicKey=="function";ir&&(qe+=" or a KeyObject",rt+="or a KeyObject");function Es(i){if(!Ge.isBuffer(i)&&typeof i!="string"&&(!ir||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw pe(qe)}function Rs(i){if(!Ge.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw pe(ju)}function Mu(i){if(!Ge.isBuffer(i)){if(typeof i=="string")return i;if(!ir||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw pe(rt)}}function rr(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function $s(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function pe(i){var e=[].slice.call(arguments,1),t=ys.format.bind(ys,i).apply(null,e);return new TypeError(t)}function Iu(i){return Ge.isBuffer(i)||typeof i=="string"}function nt(i){return Iu(i)||(i=JSON.stringify(i)),i}function ks(i){return function(t,r){Mu(r),t=nt(t);var n=se.createHmac("sha"+i,r),s=(n.update(t),n.digest("base64"));return rr(s)}}var tr,Nu="timingSafeEqual"in se?function(e,t){return e.byteLength!==t.byteLength?!1:se.timingSafeEqual(e,t)}:function(e,t){return tr||(tr=bs()),tr(e,t)};function Fu(i){return function(t,r,n){var s=ks(i)(t,n);return Nu(Ge.from(r),Ge.from(s))}}function Ss(i){return function(t,r){Rs(r),t=nt(t);var n=se.createSign("RSA-SHA"+i),s=(n.update(t),n.sign(r,"base64"));return rr(s)}}function _s(i){return function(t,r,n){Es(n),t=nt(t),r=$s(r);var s=se.createVerify("RSA-SHA"+i);return s.update(t),s.verify(n,r,"base64")}}function Uu(i){return function(t,r){Rs(r),t=nt(t);var n=se.createSign("RSA-SHA"+i),s=(n.update(t),n.sign({key:r,padding:se.constants.RSA_PKCS1_PSS_PADDING,saltLength:se.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return rr(s)}}function Du(i){return function(t,r,n){Es(n),t=nt(t),r=$s(r);var s=se.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:n,padding:se.constants.RSA_PKCS1_PSS_PADDING,saltLength:se.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function qu(i){var e=Ss(i);return function(){var r=e.apply(null,arguments);return r=ws.derToJose(r,"ES"+i),r}}function Gu(i){var e=_s(i);return function(r,n,s){n=ws.joseToDer(n,"ES"+i).toString("base64");var o=e(r,n,s);return o}}function Hu(){return function(){return""}}function Wu(){return function(e,t){return t===""}}Cs.exports=function(e){var t={hs:ks,rs:Ss,ps:Uu,es:qu,none:Hu},r={hs:Fu,rs:_s,ps:Du,es:Gu,none:Wu},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw pe(Lu,e);var s=(n[1]||n[3]).toLowerCase(),o=n[2];return{sign:t[s](o),verify:r[s](o)}}});var sr=v((Uy,Os)=>{var Vu=require("buffer").Buffer;Os.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Vu.isBuffer(e)?e.toString():JSON.stringify(e)}});var Ms=v((Dy,js)=>{var Bu=De().Buffer,Ts=Qi(),zu=nr(),Yu=require("stream"),Ps=sr(),or=require("util");function As(i,e){return Bu.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ju(i,e,t){t=t||"utf8";var r=As(Ps(i),"binary"),n=As(Ps(e),t);return or.format("%s.%s",r,n)}function Ls(i){var e=i.header,t=i.payload,r=i.secret||i.privateKey,n=i.encoding,s=zu(e.alg),o=Ju(e,t,n),a=s.sign(o,r);return or.format("%s.%s",o,a)}function It(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Ts(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new Ts(i.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}or.inherits(It,Yu);It.prototype.sign=function(){try{var e=Ls({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};It.sign=Ls;js.exports=It});var Vs=v((qy,Ws)=>{var Ns=De().Buffer,Is=Qi(),Xu=nr(),Ku=require("stream"),Fs=sr(),Qu=require("util"),Zu=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function em(i){return Object.prototype.toString.call(i)==="[object Object]"}function tm(i){if(em(i))return i;try{return JSON.parse(i)}catch{return}}function Us(i){var e=i.split(".",1)[0];return tm(Ns.from(e,"base64").toString("binary"))}function im(i){return i.split(".",2).join(".")}function Ds(i){return i.split(".")[2]}function rm(i,e){e=e||"utf8";var t=i.split(".")[1];return Ns.from(t,"base64").toString(e)}function qs(i){return Zu.test(i)&&!!Us(i)}function Gs(i,e,t){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}i=Fs(i);var n=Ds(i),s=im(i),o=Xu(e);return o.verify(s,n,t)}function Hs(i,e){if(e=e||{},i=Fs(i),!qs(i))return null;var t=Us(i);if(!t)return null;var r=rm(i);return(t.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:t,payload:r,signature:Ds(i)}}function He(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Is(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Is(i.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}Qu.inherits(He,Ku);He.prototype.verify=function(){try{var e=Gs(this.signature.buffer,this.algorithm,this.key.buffer),t=Hs(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};He.decode=Hs;He.isValid=qs;He.verify=Gs;Ws.exports=He});var Ft=v(ke=>{var Bs=Ms(),Nt=Vs(),nm=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];ke.ALGORITHMS=nm;ke.sign=Bs.sign;ke.verify=Nt.verify;ke.decode=Nt.decode;ke.isValid=Nt.isValid;ke.createSign=function(e){return new Bs(e)};ke.createVerify=function(e){return new Nt(e)}});var ar=v((Hy,zs)=>{var sm=Ft();zs.exports=function(i,e){e=e||{};var t=sm.decode(i,e);if(!t)return null;var r=t.payload;if(typeof r=="string")try{var n=JSON.parse(r);n!==null&&typeof n=="object"&&(r=n)}catch{}return e.complete===!0?{header:t.header,payload:r,signature:t.signature}:r}});var st=v((Wy,Ys)=>{var Ut=function(i,e){Error.call(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=i,e&&(this.inner=e)};Ut.prototype=Object.create(Error.prototype);Ut.prototype.constructor=Ut;Ys.exports=Ut});var cr=v((Vy,Xs)=>{var Js=st(),Dt=function(i,e){Js.call(this,i),this.name="NotBeforeError",this.date=e};Dt.prototype=Object.create(Js.prototype);Dt.prototype.constructor=Dt;Xs.exports=Dt});var lr=v((By,Qs)=>{var Ks=st(),qt=function(i,e){Ks.call(this,i),this.name="TokenExpiredError",this.expiredAt=e};qt.prototype=Object.create(Ks.prototype);qt.prototype.constructor=qt;Qs.exports=qt});var eo=v((zy,Zs)=>{var We=1e3,Ve=We*60,Be=Ve*60,je=Be*24,om=je*7,am=je*365.25;Zs.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return cm(i);if(t==="number"&&isFinite(i))return e.long?pm(i):lm(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function cm(i){if(i=String(i),!(i.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*am;case"weeks":case"week":case"w":return t*om;case"days":case"day":case"d":return t*je;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Be;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ve;case"seconds":case"second":case"secs":case"sec":case"s":return t*We;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function lm(i){var e=Math.abs(i);return e>=je?Math.round(i/je)+"d":e>=Be?Math.round(i/Be)+"h":e>=Ve?Math.round(i/Ve)+"m":e>=We?Math.round(i/We)+"s":i+"ms"}function pm(i){var e=Math.abs(i);return e>=je?Gt(i,e,je,"day"):e>=Be?Gt(i,e,Be,"hour"):e>=Ve?Gt(i,e,Ve,"minute"):e>=We?Gt(i,e,We,"second"):i+" ms"}function Gt(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var pr=v((Yy,to)=>{var um=eo();to.exports=function(i,e){var t=e||Math.floor(Date.now()/1e3);if(typeof i=="string"){var r=um(i);return typeof r>"u"?void 0:Math.floor(t+r/1e3)}else return typeof i=="number"?t+i:void 0}});var ze=v((Jy,io)=>{"use strict";var mm="2.0.0",dm=Number.MAX_SAFE_INTEGER||9007199254740991,fm=16,hm=250,gm=["major","premajor","minor","preminor","patch","prepatch","prerelease"];io.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fm,MAX_SAFE_BUILD_LENGTH:hm,MAX_SAFE_INTEGER:dm,RELEASE_TYPES:gm,SEMVER_SPEC_VERSION:mm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ot=v((Xy,ro)=>{"use strict";var xm=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};ro.exports=xm});var Ye=v((ge,no)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:ur,MAX_SAFE_BUILD_LENGTH:vm,MAX_LENGTH:bm}=ze(),ym=ot();ge=no.exports={};var wm=ge.re=[],Em=ge.safeRe=[],b=ge.src=[],Rm=ge.safeSrc=[],y=ge.t={},$m=0,mr="[a-zA-Z0-9-]",km=[["\\s",1],["\\d",bm],[mr,vm]],Sm=i=>{for(let[e,t]of km)i=i.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return i},S=(i,e,t)=>{let r=Sm(e),n=$m++;ym(i,n,e),y[i]=n,b[n]=e,Rm[n]=r,wm[n]=new RegExp(e,t?"g":void 0),Em[n]=new RegExp(r,t?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*");S("NUMERICIDENTIFIERLOOSE","\\d+");S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mr}*`);S("MAINVERSION",`(${b[y.NUMERICIDENTIFIER]})\\.(${b[y.NUMERICIDENTIFIER]})\\.(${b[y.NUMERICIDENTIFIER]})`);S("MAINVERSIONLOOSE",`(${b[y.NUMERICIDENTIFIERLOOSE]})\\.(${b[y.NUMERICIDENTIFIERLOOSE]})\\.(${b[y.NUMERICIDENTIFIERLOOSE]})`);S("PRERELEASEIDENTIFIER",`(?:${b[y.NONNUMERICIDENTIFIER]}|${b[y.NUMERICIDENTIFIER]})`);S("PRERELEASEIDENTIFIERLOOSE",`(?:${b[y.NONNUMERICIDENTIFIER]}|${b[y.NUMERICIDENTIFIERLOOSE]})`);S("PRERELEASE",`(?:-(${b[y.PRERELEASEIDENTIFIER]}(?:\\.${b[y.PRERELEASEIDENTIFIER]})*))`);S("PRERELEASELOOSE",`(?:-?(${b[y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${b[y.PRERELEASEIDENTIFIERLOOSE]})*))`);S("BUILDIDENTIFIER",`${mr}+`);S("BUILD",`(?:\\+(${b[y.BUILDIDENTIFIER]}(?:\\.${b[y.BUILDIDENTIFIER]})*))`);S("FULLPLAIN",`v?${b[y.MAINVERSION]}${b[y.PRERELEASE]}?${b[y.BUILD]}?`);S("FULL",`^${b[y.FULLPLAIN]}$`);S("LOOSEPLAIN",`[v=\\s]*${b[y.MAINVERSIONLOOSE]}${b[y.PRERELEASELOOSE]}?${b[y.BUILD]}?`);S("LOOSE",`^${b[y.LOOSEPLAIN]}$`);S("GTLT","((?:<|>)?=?)");S("XRANGEIDENTIFIERLOOSE",`${b[y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);S("XRANGEIDENTIFIER",`${b[y.NUMERICIDENTIFIER]}|x|X|\\*`);S("XRANGEPLAIN",`[v=\\s]*(${b[y.XRANGEIDENTIFIER]})(?:\\.(${b[y.XRANGEIDENTIFIER]})(?:\\.(${b[y.XRANGEIDENTIFIER]})(?:${b[y.PRERELEASE]})?${b[y.BUILD]}?)?)?`);S("XRANGEPLAINLOOSE",`[v=\\s]*(${b[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${b[y.XRANGEIDENTIFIERLOOSE]})(?:${b[y.PRERELEASELOOSE]})?${b[y.BUILD]}?)?)?`);S("XRANGE",`^${b[y.GTLT]}\\s*${b[y.XRANGEPLAIN]}$`);S("XRANGELOOSE",`^${b[y.GTLT]}\\s*${b[y.XRANGEPLAINLOOSE]}$`);S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ur}})(?:\\.(\\d{1,${ur}}))?(?:\\.(\\d{1,${ur}}))?`);S("COERCE",`${b[y.COERCEPLAIN]}(?:$|[^\\d])`);S("COERCEFULL",b[y.COERCEPLAIN]+`(?:${b[y.PRERELEASE]})?(?:${b[y.BUILD]})?(?:$|[^\\d])`);S("COERCERTL",b[y.COERCE],!0);S("COERCERTLFULL",b[y.COERCEFULL],!0);S("LONETILDE","(?:~>?)");S("TILDETRIM",`(\\s*)${b[y.LONETILDE]}\\s+`,!0);ge.tildeTrimReplace="$1~";S("TILDE",`^${b[y.LONETILDE]}${b[y.XRANGEPLAIN]}$`);S("TILDELOOSE",`^${b[y.LONETILDE]}${b[y.XRANGEPLAINLOOSE]}$`);S("LONECARET","(?:\\^)");S("CARETTRIM",`(\\s*)${b[y.LONECARET]}\\s+`,!0);ge.caretTrimReplace="$1^";S("CARET",`^${b[y.LONECARET]}${b[y.XRANGEPLAIN]}$`);S("CARETLOOSE",`^${b[y.LONECARET]}${b[y.XRANGEPLAINLOOSE]}$`);S("COMPARATORLOOSE",`^${b[y.GTLT]}\\s*(${b[y.LOOSEPLAIN]})$|^$`);S("COMPARATOR",`^${b[y.GTLT]}\\s*(${b[y.FULLPLAIN]})$|^$`);S("COMPARATORTRIM",`(\\s*)${b[y.GTLT]}\\s*(${b[y.LOOSEPLAIN]}|${b[y.XRANGEPLAIN]})`,!0);ge.comparatorTrimReplace="$1$2$3";S("HYPHENRANGE",`^\\s*(${b[y.XRANGEPLAIN]})\\s+-\\s+(${b[y.XRANGEPLAIN]})\\s*$`);S("HYPHENRANGELOOSE",`^\\s*(${b[y.XRANGEPLAINLOOSE]})\\s+-\\s+(${b[y.XRANGEPLAINLOOSE]})\\s*$`);S("STAR","(<|>)?=?\\s*\\*");S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ht=v((Ky,so)=>{"use strict";var _m=Object.freeze({loose:!0}),Cm=Object.freeze({}),Om=i=>i?typeof i!="object"?_m:i:Cm;so.exports=Om});var dr=v((Qy,co)=>{"use strict";var oo=/^[0-9]+$/,ao=(i,e)=>{if(typeof i=="number"&&typeof e=="number")return i===e?0:i<e?-1:1;let t=oo.test(i),r=oo.test(e);return t&&r&&(i=+i,e=+e),i===e?0:t&&!r?-1:r&&!t?1:i<e?-1:1},Tm=(i,e)=>ao(e,i);co.exports={compareIdentifiers:ao,rcompareIdentifiers:Tm}});var z=v((Zy,po)=>{"use strict";var Wt=ot(),{MAX_LENGTH:lo,MAX_SAFE_INTEGER:Vt}=ze(),{safeRe:Bt,t:zt}=Ye(),Pm=Ht(),{compareIdentifiers:fr}=dr(),hr=class i{constructor(e,t){if(t=Pm(t),e instanceof i){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>lo)throw new TypeError(`version is longer than ${lo} characters`);Wt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Bt[zt.LOOSE]:Bt[zt.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Vt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Vt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Vt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<Vt)return s}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Wt("SemVer.compare",this.version,this.options,e),!(e instanceof i)){if(typeof e=="string"&&e===this.version)return 0;e=new i(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof i||(e=new i(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Wt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return fr(r,n)}while(++t)}compareBuild(e){e instanceof i||(e=new i(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(Wt("build compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return fr(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Bt[zt.PRERELEASELOOSE]:Bt[zt.PRERELEASE]);if(!n||n[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];r===!1&&(s=[t]),fr(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};po.exports=hr});var Se=v((ew,mo)=>{"use strict";var uo=z(),Am=(i,e,t=!1)=>{if(i instanceof uo)return i;try{return new uo(i,e)}catch(r){if(!t)return null;throw r}};mo.exports=Am});var ho=v((tw,fo)=>{"use strict";var Lm=Se(),jm=(i,e)=>{let t=Lm(i,e);return t?t.version:null};fo.exports=jm});var xo=v((iw,go)=>{"use strict";var Mm=Se(),Im=(i,e)=>{let t=Mm(i.trim().replace(/^[=v]+/,""),e);return t?t.version:null};go.exports=Im});var yo=v((rw,bo)=>{"use strict";var vo=z(),Nm=(i,e,t,r,n)=>{typeof t=="string"&&(n=r,r=t,t=void 0);try{return new vo(i instanceof vo?i.version:i,t).inc(e,r,n).version}catch{return null}};bo.exports=Nm});var Ro=v((nw,Eo)=>{"use strict";var wo=Se(),Fm=(i,e)=>{let t=wo(i,null,!0),r=wo(e,null,!0),n=t.compare(r);if(n===0)return null;let s=n>0,o=s?t:r,a=s?r:t,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let p=c?"pre":"";return t.major!==r.major?p+"major":t.minor!==r.minor?p+"minor":t.patch!==r.patch?p+"patch":"prerelease"};Eo.exports=Fm});var ko=v((sw,$o)=>{"use strict";var Um=z(),Dm=(i,e)=>new Um(i,e).major;$o.exports=Dm});var _o=v((ow,So)=>{"use strict";var qm=z(),Gm=(i,e)=>new qm(i,e).minor;So.exports=Gm});var Oo=v((aw,Co)=>{"use strict";var Hm=z(),Wm=(i,e)=>new Hm(i,e).patch;Co.exports=Wm});var Po=v((cw,To)=>{"use strict";var Vm=Se(),Bm=(i,e)=>{let t=Vm(i,e);return t&&t.prerelease.length?t.prerelease:null};To.exports=Bm});var oe=v((lw,Lo)=>{"use strict";var Ao=z(),zm=(i,e,t)=>new Ao(i,t).compare(new Ao(e,t));Lo.exports=zm});var Mo=v((pw,jo)=>{"use strict";var Ym=oe(),Jm=(i,e,t)=>Ym(e,i,t);jo.exports=Jm});var No=v((uw,Io)=>{"use strict";var Xm=oe(),Km=(i,e)=>Xm(i,e,!0);Io.exports=Km});var Yt=v((mw,Uo)=>{"use strict";var Fo=z(),Qm=(i,e,t)=>{let r=new Fo(i,t),n=new Fo(e,t);return r.compare(n)||r.compareBuild(n)};Uo.exports=Qm});var qo=v((dw,Do)=>{"use strict";var Zm=Yt(),ed=(i,e)=>i.sort((t,r)=>Zm(t,r,e));Do.exports=ed});var Ho=v((fw,Go)=>{"use strict";var td=Yt(),id=(i,e)=>i.sort((t,r)=>td(r,t,e));Go.exports=id});var at=v((hw,Wo)=>{"use strict";var rd=oe(),nd=(i,e,t)=>rd(i,e,t)>0;Wo.exports=nd});var Jt=v((gw,Vo)=>{"use strict";var sd=oe(),od=(i,e,t)=>sd(i,e,t)<0;Vo.exports=od});var gr=v((xw,Bo)=>{"use strict";var ad=oe(),cd=(i,e,t)=>ad(i,e,t)===0;Bo.exports=cd});var xr=v((vw,zo)=>{"use strict";var ld=oe(),pd=(i,e,t)=>ld(i,e,t)!==0;zo.exports=pd});var Xt=v((bw,Yo)=>{"use strict";var ud=oe(),md=(i,e,t)=>ud(i,e,t)>=0;Yo.exports=md});var Kt=v((yw,Jo)=>{"use strict";var dd=oe(),fd=(i,e,t)=>dd(i,e,t)<=0;Jo.exports=fd});var vr=v((ww,Xo)=>{"use strict";var hd=gr(),gd=xr(),xd=at(),vd=Xt(),bd=Jt(),yd=Kt(),wd=(i,e,t,r)=>{switch(e){case"===":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i===t;case"!==":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i!==t;case"":case"=":case"==":return hd(i,t,r);case"!=":return gd(i,t,r);case">":return xd(i,t,r);case">=":return vd(i,t,r);case"<":return bd(i,t,r);case"<=":return yd(i,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}};Xo.exports=wd});var Qo=v((Ew,Ko)=>{"use strict";var Ed=z(),Rd=Se(),{safeRe:Qt,t:Zt}=Ye(),$d=(i,e)=>{if(i instanceof Ed)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;e=e||{};let t=null;if(!e.rtl)t=i.match(e.includePrerelease?Qt[Zt.COERCEFULL]:Qt[Zt.COERCE]);else{let c=e.includePrerelease?Qt[Zt.COERCERTLFULL]:Qt[Zt.COERCERTL],l;for(;(l=c.exec(i))&&(!t||t.index+t[0].length!==i.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(t===null)return null;let r=t[2],n=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",a=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Rd(`${r}.${n}.${s}${o}${a}`,e)};Ko.exports=$d});var ea=v((Rw,Zo)=>{"use strict";var kd=Se(),Sd=ze(),_d=z(),Cd=(i,e,t)=>{if(!Sd.RELEASE_TYPES.includes(e))return null;let r=Od(i,t);return r&&Td(r,e)},Od=(i,e)=>{let t=i instanceof _d?i.version:i;return kd(t,e)},Td=(i,e)=>{if(Pd(e))return i.version;switch(i.prerelease=[],e){case"major":i.minor=0,i.patch=0;break;case"minor":i.patch=0;break}return i.format()},Pd=i=>i.startsWith("pre");Zo.exports=Cd});var ia=v(($w,ta)=>{"use strict";var br=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}};ta.exports=br});var ae=v((kw,oa)=>{"use strict";var Ad=/\s+/g,yr=class i{constructor(e,t){if(t=jd(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof wr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Ad," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(n=>!na(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&qd(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&Ud)|(this.options.loose&&Dd))+":"+e,n=ra.get(r);if(n)return n;let s=this.options.loose,o=s?K[J.HYPHENRANGELOOSE]:K[J.HYPHENRANGE];e=e.replace(o,Kd(this.options.includePrerelease)),N("hyphen replace",e),e=e.replace(K[J.COMPARATORTRIM],Id),N("comparator trim",e),e=e.replace(K[J.TILDETRIM],Nd),N("tilde trim",e),e=e.replace(K[J.CARETTRIM],Fd),N("caret trim",e);let a=e.split(" ").map(u=>Gd(u,this.options)).join(" ").split(/\s+/).map(u=>Xd(u,this.options));s&&(a=a.filter(u=>(N("loose invalid filter",u,this.options),!!u.match(K[J.COMPARATORLOOSE])))),N("range list",a);let c=new Map,l=a.map(u=>new wr(u,this.options));for(let u of l){if(na(u))return[u];c.set(u.value,u)}c.size>1&&c.has("")&&c.delete("");let p=[...c.values()];return ra.set(r,p),p}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>sa(r,t)&&e.set.some(n=>sa(n,t)&&r.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Md(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(Qd(this.set[t],e,this.options))return!0;return!1}};oa.exports=yr;var Ld=ia(),ra=new Ld,jd=Ht(),wr=ct(),N=ot(),Md=z(),{safeRe:K,t:J,comparatorTrimReplace:Id,tildeTrimReplace:Nd,caretTrimReplace:Fd}=Ye(),{FLAG_INCLUDE_PRERELEASE:Ud,FLAG_LOOSE:Dd}=ze(),na=i=>i.value==="<0.0.0-0",qd=i=>i.value==="",sa=(i,e)=>{let t=!0,r=i.slice(),n=r.pop();for(;t&&r.length;)t=r.every(s=>n.intersects(s,e)),n=r.pop();return t},Gd=(i,e)=>(i=i.replace(K[J.BUILD],""),N("comp",i,e),i=Vd(i,e),N("caret",i),i=Hd(i,e),N("tildes",i),i=zd(i,e),N("xrange",i),i=Jd(i,e),N("stars",i),i),Q=i=>!i||i.toLowerCase()==="x"||i==="*",Hd=(i,e)=>i.trim().split(/\s+/).map(t=>Wd(t,e)).join(" "),Wd=(i,e)=>{let t=e.loose?K[J.TILDELOOSE]:K[J.TILDE];return i.replace(t,(r,n,s,o,a)=>{N("tilde",i,r,n,s,o,a);let c;return Q(n)?c="":Q(s)?c=`>=${n}.0.0 <${+n+1}.0.0-0`:Q(o)?c=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(N("replaceTilde pr",a),c=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):c=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,N("tilde return",c),c})},Vd=(i,e)=>i.trim().split(/\s+/).map(t=>Bd(t,e)).join(" "),Bd=(i,e)=>{N("caret",i,e);let t=e.loose?K[J.CARETLOOSE]:K[J.CARET],r=e.includePrerelease?"-0":"";return i.replace(t,(n,s,o,a,c)=>{N("caret",i,n,s,o,a,c);let l;return Q(s)?l="":Q(o)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Q(a)?s==="0"?l=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:c?(N("replaceCaret pr",c),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`):(N("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${r} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),N("caret return",l),l})},zd=(i,e)=>(N("replaceXRanges",i,e),i.split(/\s+/).map(t=>Yd(t,e)).join(" ")),Yd=(i,e)=>{i=i.trim();let t=e.loose?K[J.XRANGELOOSE]:K[J.XRANGE];return i.replace(t,(r,n,s,o,a,c)=>{N("xRange",i,r,n,s,o,a,c);let l=Q(s),p=l||Q(o),u=p||Q(a),d=u;return n==="="&&d&&(n=""),c=e.includePrerelease?"-0":"",l?n===">"||n==="<"?r="<0.0.0-0":r="*":n&&d?(p&&(o=0),a=0,n===">"?(n=">=",p?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",p?s=+s+1:o=+o+1),n==="<"&&(c="-0"),r=`${n+s}.${o}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:u&&(r=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),N("xRange return",r),r})},Jd=(i,e)=>(N("replaceStars",i,e),i.trim().replace(K[J.STAR],"")),Xd=(i,e)=>(N("replaceGTE0",i,e),i.trim().replace(K[e.includePrerelease?J.GTE0PRE:J.GTE0],"")),Kd=i=>(e,t,r,n,s,o,a,c,l,p,u,d)=>(Q(r)?t="":Q(n)?t=`>=${r}.0.0${i?"-0":""}`:Q(s)?t=`>=${r}.${n}.0${i?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${i?"-0":""}`,Q(l)?c="":Q(p)?c=`<${+l+1}.0.0-0`:Q(u)?c=`<${l}.${+p+1}.0-0`:d?c=`<=${l}.${p}.${u}-${d}`:i?c=`<${l}.${p}.${+u+1}-0`:c=`<=${c}`,`${t} ${c}`.trim()),Qd=(i,e,t)=>{for(let r=0;r<i.length;r++)if(!i[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<i.length;r++)if(N(i[r].semver),i[r].semver!==wr.ANY&&i[r].semver.prerelease.length>0){let n=i[r].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var ct=v((Sw,ma)=>{"use strict";var lt=Symbol("SemVer ANY"),$r=class i{static get ANY(){return lt}constructor(e,t){if(t=aa(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Rr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===lt?this.value="":this.value=this.operator+this.semver.version,Rr("comp",this)}parse(e){let t=this.options.loose?ca[la.COMPARATORLOOSE]:ca[la.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new pa(r[2],this.options.loose):this.semver=lt}toString(){return this.value}test(e){if(Rr("Comparator.test",e,this.options.loose),this.semver===lt||e===lt)return!0;if(typeof e=="string")try{e=new pa(e,this.options)}catch{return!1}return Er(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ua(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new ua(this.value,t).test(e.semver):(t=aa(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Er(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Er(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ma.exports=$r;var aa=Ht(),{safeRe:ca,t:la}=Ye(),Er=vr(),Rr=ot(),pa=z(),ua=ae()});var pt=v((_w,da)=>{"use strict";var Zd=ae(),ef=(i,e,t)=>{try{e=new Zd(e,t)}catch{return!1}return e.test(i)};da.exports=ef});var ha=v((Cw,fa)=>{"use strict";var tf=ae(),rf=(i,e)=>new tf(i,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" "));fa.exports=rf});var xa=v((Ow,ga)=>{"use strict";var nf=z(),sf=ae(),of=(i,e,t)=>{let r=null,n=null,s=null;try{s=new sf(e,t)}catch{return null}return i.forEach(o=>{s.test(o)&&(!r||n.compare(o)===-1)&&(r=o,n=new nf(r,t))}),r};ga.exports=of});var ba=v((Tw,va)=>{"use strict";var af=z(),cf=ae(),lf=(i,e,t)=>{let r=null,n=null,s=null;try{s=new cf(e,t)}catch{return null}return i.forEach(o=>{s.test(o)&&(!r||n.compare(o)===1)&&(r=o,n=new af(r,t))}),r};va.exports=lf});var Ea=v((Pw,wa)=>{"use strict";var kr=z(),pf=ae(),ya=at(),uf=(i,e)=>{i=new pf(i,e);let t=new kr("0.0.0");if(i.test(t)||(t=new kr("0.0.0-0"),i.test(t)))return t;t=null;for(let r=0;r<i.set.length;++r){let n=i.set[r],s=null;n.forEach(o=>{let a=new kr(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||ya(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||ya(t,s))&&(t=s)}return t&&i.test(t)?t:null};wa.exports=uf});var $a=v((Aw,Ra)=>{"use strict";var mf=ae(),df=(i,e)=>{try{return new mf(i,e).range||"*"}catch{return null}};Ra.exports=df});var ei=v((Lw,Ca)=>{"use strict";var ff=z(),_a=ct(),{ANY:hf}=_a,gf=ae(),xf=pt(),ka=at(),Sa=Jt(),vf=Kt(),bf=Xt(),yf=(i,e,t,r)=>{i=new ff(i,r),e=new gf(e,r);let n,s,o,a,c;switch(t){case">":n=ka,s=vf,o=Sa,a=">",c=">=";break;case"<":n=Sa,s=bf,o=ka,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xf(i,e,r))return!1;for(let l=0;l<e.set.length;++l){let p=e.set[l],u=null,d=null;if(p.forEach(f=>{f.semver===hf&&(f=new _a(">=0.0.0")),u=u||f,d=d||f,n(f.semver,u.semver,r)?u=f:o(f.semver,d.semver,r)&&(d=f)}),u.operator===a||u.operator===c||(!d.operator||d.operator===a)&&s(i,d.semver))return!1;if(d.operator===c&&o(i,d.semver))return!1}return!0};Ca.exports=yf});var Ta=v((jw,Oa)=>{"use strict";var wf=ei(),Ef=(i,e,t)=>wf(i,e,">",t);Oa.exports=Ef});var Aa=v((Mw,Pa)=>{"use strict";var Rf=ei(),$f=(i,e,t)=>Rf(i,e,"<",t);Pa.exports=$f});var Ma=v((Iw,ja)=>{"use strict";var La=ae(),kf=(i,e,t)=>(i=new La(i,t),e=new La(e,t),i.intersects(e,t));ja.exports=kf});var Na=v((Nw,Ia)=>{"use strict";var Sf=pt(),_f=oe();Ia.exports=(i,e,t)=>{let r=[],n=null,s=null,o=i.sort((p,u)=>_f(p,u,t));for(let p of o)Sf(p,e,t)?(s=p,n||(n=p)):(s&&r.push([n,s]),s=null,n=null);n&&r.push([n,null]);let a=[];for(let[p,u]of r)p===u?a.push(p):!u&&p===o[0]?a.push("*"):u?p===o[0]?a.push(`<=${u}`):a.push(`${p} - ${u}`):a.push(`>=${p}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Ha=v((Fw,Ga)=>{"use strict";var Fa=ae(),_r=ct(),{ANY:Sr}=_r,ut=pt(),Cr=oe(),Cf=(i,e,t={})=>{if(i===e)return!0;i=new Fa(i,t),e=new Fa(e,t);let r=!1;e:for(let n of i.set){for(let s of e.set){let o=Tf(n,s,t);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},Of=[new _r(">=0.0.0-0")],Ua=[new _r(">=0.0.0")],Tf=(i,e,t)=>{if(i===e)return!0;if(i.length===1&&i[0].semver===Sr){if(e.length===1&&e[0].semver===Sr)return!0;t.includePrerelease?i=Of:i=Ua}if(e.length===1&&e[0].semver===Sr){if(t.includePrerelease)return!0;e=Ua}let r=new Set,n,s;for(let f of i)f.operator===">"||f.operator===">="?n=Da(n,f,t):f.operator==="<"||f.operator==="<="?s=qa(s,f,t):r.add(f.semver);if(r.size>1)return null;let o;if(n&&s){if(o=Cr(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let f of r){if(n&&!ut(f,String(n),t)||s&&!ut(f,String(s),t))return null;for(let x of e)if(!ut(f,String(x),t))return!1;return!0}let a,c,l,p,u=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;u&&u.prerelease.length===1&&s.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(let f of e){if(p=p||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",n){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(a=Da(n,f,t),a===f&&a!==n)return!1}else if(n.operator===">="&&!ut(n.semver,String(f),t))return!1}if(s){if(u&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===u.major&&f.semver.minor===u.minor&&f.semver.patch===u.patch&&(u=!1),f.operator==="<"||f.operator==="<="){if(c=qa(s,f,t),c===f&&c!==s)return!1}else if(s.operator==="<="&&!ut(s.semver,String(f),t))return!1}if(!f.operator&&(s||n)&&o!==0)return!1}return!(n&&l&&!s&&o!==0||s&&p&&!n&&o!==0||d||u)},Da=(i,e,t)=>{if(!i)return e;let r=Cr(i.semver,e.semver,t);return r>0?i:r<0||e.operator===">"&&i.operator===">="?e:i},qa=(i,e,t)=>{if(!i)return e;let r=Cr(i.semver,e.semver,t);return r<0?i:r>0||e.operator==="<"&&i.operator==="<="?e:i};Ga.exports=Cf});var ti=v((Uw,Ba)=>{"use strict";var Or=Ye(),Wa=ze(),Pf=z(),Va=dr(),Af=Se(),Lf=ho(),jf=xo(),Mf=yo(),If=Ro(),Nf=ko(),Ff=_o(),Uf=Oo(),Df=Po(),qf=oe(),Gf=Mo(),Hf=No(),Wf=Yt(),Vf=qo(),Bf=Ho(),zf=at(),Yf=Jt(),Jf=gr(),Xf=xr(),Kf=Xt(),Qf=Kt(),Zf=vr(),eh=Qo(),th=ea(),ih=ct(),rh=ae(),nh=pt(),sh=ha(),oh=xa(),ah=ba(),ch=Ea(),lh=$a(),ph=ei(),uh=Ta(),mh=Aa(),dh=Ma(),fh=Na(),hh=Ha();Ba.exports={parse:Af,valid:Lf,clean:jf,inc:Mf,diff:If,major:Nf,minor:Ff,patch:Uf,prerelease:Df,compare:qf,rcompare:Gf,compareLoose:Hf,compareBuild:Wf,sort:Vf,rsort:Bf,gt:zf,lt:Yf,eq:Jf,neq:Xf,gte:Kf,lte:Qf,cmp:Zf,coerce:eh,truncate:th,Comparator:ih,Range:rh,satisfies:nh,toComparators:sh,maxSatisfying:oh,minSatisfying:ah,minVersion:ch,validRange:lh,outside:ph,gtr:uh,ltr:mh,intersects:dh,simplifyRange:fh,subset:hh,SemVer:Pf,re:Or.re,src:Or.src,tokens:Or.t,SEMVER_SPEC_VERSION:Wa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Wa.RELEASE_TYPES,compareIdentifiers:Va.compareIdentifiers,rcompareIdentifiers:Va.rcompareIdentifiers}});var Ya=v((Dw,za)=>{var gh=ti();za.exports=gh.satisfies(process.version,">=15.7.0")});var Xa=v((qw,Ja)=>{var xh=ti();Ja.exports=xh.satisfies(process.version,">=16.9.0")});var Tr=v((Gw,Ka)=>{var vh=Ya(),bh=Xa(),yh={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},wh={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Ka.exports=function(i,e){if(!i||!e)return;let t=e.asymmetricKeyType;if(!t)return;let r=yh[t];if(!r)throw new Error(`Unknown key type "${t}".`);if(!r.includes(i))throw new Error(`"alg" parameter for "${t}" key type must be one of: ${r.join(", ")}.`);if(vh)switch(t){case"ec":let n=e.asymmetricKeyDetails.namedCurve,s=wh[i];if(n!==s)throw new Error(`"alg" parameter "${i}" requires curve "${s}".`);break;case"rsa-pss":if(bh){let o=parseInt(i.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:c,saltLength:l}=e.asymmetricKeyDetails;if(a!==`sha${o}`||c!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${i}.`);if(l!==void 0&&l>o>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${i}.`)}break}}});var Pr=v((Hw,Qa)=>{var Eh=ti();Qa.exports=Eh.satisfies(process.version,"^6.12.0 || >=8.0.0")});var tc=v((Ww,ec)=>{var I=st(),Rh=cr(),Za=lr(),$h=ar(),kh=pr(),Sh=Tr(),_h=Pr(),Ch=Ft(),{KeyObject:Oh,createSecretKey:Th,createPublicKey:Ph}=require("crypto"),Ar=["RS256","RS384","RS512"],Ah=["ES256","ES384","ES512"],Lr=["RS256","RS384","RS512"],Lh=["HS256","HS384","HS512"];_h&&(Ar.splice(Ar.length,0,"PS256","PS384","PS512"),Lr.splice(Lr.length,0,"PS256","PS384","PS512"));ec.exports=function(i,e,t,r){typeof t=="function"&&!r&&(r=t,t={}),t||(t={}),t=Object.assign({},t);let n;if(r?n=r:n=function(p,u){if(p)throw p;return u},t.clockTimestamp&&typeof t.clockTimestamp!="number")return n(new I("clockTimestamp must be a number"));if(t.nonce!==void 0&&(typeof t.nonce!="string"||t.nonce.trim()===""))return n(new I("nonce must be a non-empty string"));if(t.allowInvalidAsymmetricKeyTypes!==void 0&&typeof t.allowInvalidAsymmetricKeyTypes!="boolean")return n(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!i)return n(new I("jwt must be provided"));if(typeof i!="string")return n(new I("jwt must be a string"));let o=i.split(".");if(o.length!==3)return n(new I("jwt malformed"));let a;try{a=$h(i,{complete:!0})}catch(p){return n(p)}if(!a)return n(new I("invalid token"));let c=a.header,l;if(typeof e=="function"){if(!r)return n(new I("verify must be called asynchronous if secret or public key is provided as a callback"));l=e}else l=function(p,u){return u(null,e)};return l(c,function(p,u){if(p)return n(new I("error in secret or public key callback: "+p.message));let d=o[2].trim()!=="";if(!d&&u)return n(new I("jwt signature is required"));if(d&&!u)return n(new I("secret or public key must be provided"));if(!d&&!t.algorithms)return n(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(u!=null&&!(u instanceof Oh))try{u=Ph(u)}catch{try{u=Th(typeof u=="string"?Buffer.from(u):u)}catch{return n(new I("secretOrPublicKey is not valid key material"))}}if(t.algorithms||(u.type==="secret"?t.algorithms=Lh:["rsa","rsa-pss"].includes(u.asymmetricKeyType)?t.algorithms=Lr:u.asymmetricKeyType==="ec"?t.algorithms=Ah:t.algorithms=Ar),t.algorithms.indexOf(a.header.alg)===-1)return n(new I("invalid algorithm"));if(c.alg.startsWith("HS")&&u.type!=="secret")return n(new I(`secretOrPublicKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)&&u.type!=="public")return n(new I(`secretOrPublicKey must be an asymmetric key when using ${c.alg}`));if(!t.allowInvalidAsymmetricKeyTypes)try{Sh(c.alg,u)}catch(w){return n(w)}let f;try{f=Ch.verify(i,a.header.alg,u)}catch(w){return n(w)}if(!f)return n(new I("invalid signature"));let x=a.payload;if(typeof x.nbf<"u"&&!t.ignoreNotBefore){if(typeof x.nbf!="number")return n(new I("invalid nbf value"));if(x.nbf>s+(t.clockTolerance||0))return n(new Rh("jwt not active",new Date(x.nbf*1e3)))}if(typeof x.exp<"u"&&!t.ignoreExpiration){if(typeof x.exp!="number")return n(new I("invalid exp value"));if(s>=x.exp+(t.clockTolerance||0))return n(new Za("jwt expired",new Date(x.exp*1e3)))}if(t.audience){let w=Array.isArray(t.audience)?t.audience:[t.audience];if(!(Array.isArray(x.aud)?x.aud:[x.aud]).some(function(E){return w.some(function($){return $ instanceof RegExp?$.test(E):$===E})}))return n(new I("jwt audience invalid. expected: "+w.join(" or ")))}if(t.issuer&&(typeof t.issuer=="string"&&x.iss!==t.issuer||Array.isArray(t.issuer)&&t.issuer.indexOf(x.iss)===-1))return n(new I("jwt issuer invalid. expected: "+t.issuer));if(t.subject&&x.sub!==t.subject)return n(new I("jwt subject invalid. expected: "+t.subject));if(t.jwtid&&x.jti!==t.jwtid)return n(new I("jwt jwtid invalid. expected: "+t.jwtid));if(t.nonce&&x.nonce!==t.nonce)return n(new I("jwt nonce invalid. expected: "+t.nonce));if(t.maxAge){if(typeof x.iat!="number")return n(new I("iat required when maxAge is specified"));let w=kh(t.maxAge,x.iat);if(typeof w>"u")return n(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=w+(t.clockTolerance||0))return n(new Za("maxAge exceeded",new Date(w*1e3)))}if(t.complete===!0){let w=a.signature;return n(null,{header:c,payload:x,signature:w})}return n(null,x)})}});var ac=v((Vw,oc)=>{var ic=1/0,nc=9007199254740991,jh=17976931348623157e292,rc=NaN,Mh="[object Arguments]",Ih="[object Function]",Nh="[object GeneratorFunction]",Fh="[object String]",Uh="[object Symbol]",Dh=/^\s+|\s+$/g,qh=/^[-+]0x[0-9a-f]+$/i,Gh=/^0b[01]+$/i,Hh=/^0o[0-7]+$/i,Wh=/^(?:0|[1-9]\d*)$/,Vh=parseInt;function Bh(i,e){for(var t=-1,r=i?i.length:0,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n}function zh(i,e,t,r){for(var n=i.length,s=t+(r?1:-1);r?s--:++s<n;)if(e(i[s],s,i))return s;return-1}function Yh(i,e,t){if(e!==e)return zh(i,Jh,t);for(var r=t-1,n=i.length;++r<n;)if(i[r]===e)return r;return-1}function Jh(i){return i!==i}function Xh(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r}function Kh(i,e){return Bh(e,function(t){return i[t]})}function Qh(i,e){return function(t){return i(e(t))}}var ii=Object.prototype,Mr=ii.hasOwnProperty,ri=ii.toString,Zh=ii.propertyIsEnumerable,eg=Qh(Object.keys,Object),tg=Math.max;function ig(i,e){var t=sc(i)||ag(i)?Xh(i.length,String):[],r=t.length,n=!!r;for(var s in i)(e||Mr.call(i,s))&&!(n&&(s=="length"||ng(s,r)))&&t.push(s);return t}function rg(i){if(!sg(i))return eg(i);var e=[];for(var t in Object(i))Mr.call(i,t)&&t!="constructor"&&e.push(t);return e}function ng(i,e){return e=e??nc,!!e&&(typeof i=="number"||Wh.test(i))&&i>-1&&i%1==0&&i<e}function sg(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||ii;return i===t}function og(i,e,t,r){i=Ir(i)?i:xg(i),t=t&&!r?fg(t):0;var n=i.length;return t<0&&(t=tg(n+t,0)),ug(i)?t<=n&&i.indexOf(e,t)>-1:!!n&&Yh(i,e,t)>-1}function ag(i){return cg(i)&&Mr.call(i,"callee")&&(!Zh.call(i,"callee")||ri.call(i)==Mh)}var sc=Array.isArray;function Ir(i){return i!=null&&pg(i.length)&&!lg(i)}function cg(i){return Nr(i)&&Ir(i)}function lg(i){var e=jr(i)?ri.call(i):"";return e==Ih||e==Nh}function pg(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=nc}function jr(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function Nr(i){return!!i&&typeof i=="object"}function ug(i){return typeof i=="string"||!sc(i)&&Nr(i)&&ri.call(i)==Fh}function mg(i){return typeof i=="symbol"||Nr(i)&&ri.call(i)==Uh}function dg(i){if(!i)return i===0?i:0;if(i=hg(i),i===ic||i===-ic){var e=i<0?-1:1;return e*jh}return i===i?i:0}function fg(i){var e=dg(i),t=e%1;return e===e?t?e-t:e:0}function hg(i){if(typeof i=="number")return i;if(mg(i))return rc;if(jr(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=jr(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Dh,"");var t=Gh.test(i);return t||Hh.test(i)?Vh(i.slice(2),t?2:8):qh.test(i)?rc:+i}function gg(i){return Ir(i)?ig(i):rg(i)}function xg(i){return i?Kh(i,gg(i)):[]}oc.exports=og});var lc=v((Bw,cc)=>{var vg="[object Boolean]",bg=Object.prototype,yg=bg.toString;function wg(i){return i===!0||i===!1||Eg(i)&&yg.call(i)==vg}function Eg(i){return!!i&&typeof i=="object"}cc.exports=wg});var fc=v((zw,dc)=>{var pc=1/0,Rg=17976931348623157e292,uc=NaN,$g="[object Symbol]",kg=/^\s+|\s+$/g,Sg=/^[-+]0x[0-9a-f]+$/i,_g=/^0b[01]+$/i,Cg=/^0o[0-7]+$/i,Og=parseInt,Tg=Object.prototype,Pg=Tg.toString;function Ag(i){return typeof i=="number"&&i==Ig(i)}function mc(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function Lg(i){return!!i&&typeof i=="object"}function jg(i){return typeof i=="symbol"||Lg(i)&&Pg.call(i)==$g}function Mg(i){if(!i)return i===0?i:0;if(i=Ng(i),i===pc||i===-pc){var e=i<0?-1:1;return e*Rg}return i===i?i:0}function Ig(i){var e=Mg(i),t=e%1;return e===e?t?e-t:e:0}function Ng(i){if(typeof i=="number")return i;if(jg(i))return uc;if(mc(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=mc(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(kg,"");var t=_g.test(i);return t||Cg.test(i)?Og(i.slice(2),t?2:8):Sg.test(i)?uc:+i}dc.exports=Ag});var gc=v((Yw,hc)=>{var Fg="[object Number]",Ug=Object.prototype,Dg=Ug.toString;function qg(i){return!!i&&typeof i=="object"}function Gg(i){return typeof i=="number"||qg(i)&&Dg.call(i)==Fg}hc.exports=Gg});var yc=v((Jw,bc)=>{var Hg="[object Object]";function Wg(i){var e=!1;if(i!=null&&typeof i.toString!="function")try{e=!!(i+"")}catch{}return e}function Vg(i,e){return function(t){return i(e(t))}}var Bg=Function.prototype,xc=Object.prototype,vc=Bg.toString,zg=xc.hasOwnProperty,Yg=vc.call(Object),Jg=xc.toString,Xg=Vg(Object.getPrototypeOf,Object);function Kg(i){return!!i&&typeof i=="object"}function Qg(i){if(!Kg(i)||Jg.call(i)!=Hg||Wg(i))return!1;var e=Xg(i);if(e===null)return!0;var t=zg.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&vc.call(t)==Yg}bc.exports=Qg});var Ec=v((Xw,wc)=>{var Zg="[object String]",ex=Object.prototype,tx=ex.toString,ix=Array.isArray;function rx(i){return!!i&&typeof i=="object"}function nx(i){return typeof i=="string"||!ix(i)&&rx(i)&&tx.call(i)==Zg}wc.exports=nx});var _c=v((Kw,Sc)=>{var sx="Expected a function",Rc=1/0,ox=17976931348623157e292,$c=NaN,ax="[object Symbol]",cx=/^\s+|\s+$/g,lx=/^[-+]0x[0-9a-f]+$/i,px=/^0b[01]+$/i,ux=/^0o[0-7]+$/i,mx=parseInt,dx=Object.prototype,fx=dx.toString;function hx(i,e){var t;if(typeof e!="function")throw new TypeError(sx);return i=yx(i),function(){return--i>0&&(t=e.apply(this,arguments)),i<=1&&(e=void 0),t}}function gx(i){return hx(2,i)}function kc(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function xx(i){return!!i&&typeof i=="object"}function vx(i){return typeof i=="symbol"||xx(i)&&fx.call(i)==ax}function bx(i){if(!i)return i===0?i:0;if(i=wx(i),i===Rc||i===-Rc){var e=i<0?-1:1;return e*ox}return i===i?i:0}function yx(i){var e=bx(i),t=e%1;return e===e?t?e-t:e:0}function wx(i){if(typeof i=="number")return i;if(vx(i))return $c;if(kc(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=kc(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(cx,"");var t=px.test(i);return t||ux.test(i)?mx(i.slice(2),t?2:8):lx.test(i)?$c:+i}Sc.exports=gx});var Ic=v((Qw,Mc)=>{var Cc=pr(),Ex=Pr(),Rx=Tr(),Oc=Ft(),$x=ac(),ni=lc(),Tc=fc(),Fr=gc(),Ac=yc(),_e=Ec(),kx=_c(),{KeyObject:Sx,createSecretKey:_x,createPrivateKey:Cx}=require("crypto"),Lc=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Ex&&Lc.splice(3,0,"PS256","PS384","PS512");var Ox={expiresIn:{isValid:function(i){return Tc(i)||_e(i)&&i},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(i){return Tc(i)||_e(i)&&i},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(i){return _e(i)||Array.isArray(i)},message:'"audience" must be a string or array'},algorithm:{isValid:$x.bind(null,Lc),message:'"algorithm" must be a valid string enum value'},header:{isValid:Ac,message:'"header" must be an object'},encoding:{isValid:_e,message:'"encoding" must be a string'},issuer:{isValid:_e,message:'"issuer" must be a string'},subject:{isValid:_e,message:'"subject" must be a string'},jwtid:{isValid:_e,message:'"jwtid" must be a string'},noTimestamp:{isValid:ni,message:'"noTimestamp" must be a boolean'},keyid:{isValid:_e,message:'"keyid" must be a string'},mutatePayload:{isValid:ni,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:ni,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:ni,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Tx={iat:{isValid:Fr,message:'"iat" should be a number of seconds'},exp:{isValid:Fr,message:'"exp" should be a number of seconds'},nbf:{isValid:Fr,message:'"nbf" should be a number of seconds'}};function jc(i,e,t,r){if(!Ac(t))throw new Error('Expected "'+r+'" to be a plain object.');Object.keys(t).forEach(function(n){let s=i[n];if(!s){if(!e)throw new Error('"'+n+'" is not allowed in "'+r+'"');return}if(!s.isValid(t[n]))throw new Error(s.message)})}function Px(i){return jc(Ox,!1,i,"options")}function Ax(i){return jc(Tx,!0,i,"payload")}var Pc={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Lx=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Mc.exports=function(i,e,t,r){typeof t=="function"?(r=t,t={}):t=t||{};let n=typeof i=="object"&&!Buffer.isBuffer(i),s=Object.assign({alg:t.algorithm||"HS256",typ:n?"JWT":void 0,kid:t.keyid},t.header);function o(l){if(r)return r(l);throw l}if(!e&&t.algorithm!=="none")return o(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof Sx))try{e=Cx(e)}catch{try{e=_x(typeof e=="string"?Buffer.from(e):e)}catch{return o(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return o(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return o(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!t.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return o(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof i>"u")return o(new Error("payload is required"));if(n){try{Ax(i)}catch(l){return o(l)}t.mutatePayload||(i=Object.assign({},i))}else{let l=Lx.filter(function(p){return typeof t[p]<"u"});if(l.length>0)return o(new Error("invalid "+l.join(",")+" option for "+typeof i+" payload"))}if(typeof i.exp<"u"&&typeof t.expiresIn<"u")return o(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof i.nbf<"u"&&typeof t.notBefore<"u")return o(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{Px(t)}catch(l){return o(l)}if(!t.allowInvalidAsymmetricKeyTypes)try{Rx(s.alg,e)}catch(l){return o(l)}let a=i.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp?delete i.iat:n&&(i.iat=a),typeof t.notBefore<"u"){try{i.nbf=Cc(t.notBefore,a)}catch(l){return o(l)}if(typeof i.nbf>"u")return o(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof t.expiresIn<"u"&&typeof i=="object"){try{i.exp=Cc(t.expiresIn,a)}catch(l){return o(l)}if(typeof i.exp>"u")return o(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Pc).forEach(function(l){let p=Pc[l];if(typeof t[l]<"u"){if(typeof i[p]<"u")return o(new Error('Bad "options.'+l+'" option. The payload already has an "'+p+'" property.'));i[p]=t[l]}});let c=t.encoding||"utf8";if(typeof r=="function")r=r&&kx(r),Oc.createSign({header:s,privateKey:e,payload:i,encoding:c}).once("error",r).once("done",function(l){if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&l.length<256)return r(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));r(null,l)});else{let l=Oc.sign({header:s,payload:i,secret:e,encoding:c});if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&l.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return l}}});var Ur=v((Zw,Nc)=>{Nc.exports={decode:ar(),verify:tc(),sign:Ic(),JsonWebTokenError:st(),NotBeforeError:cr(),TokenExpiredError:lr()}});var Zc=v((SE,cv)=>{cv.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var tl=v((_E,el)=>{el.exports=Zc()});var nl=v(ie=>{"use strict";var mi=tl(),lv=require("path").extname,il=/^\s*([^;\s]*)(?:;|\s|$)/,pv=/^text\//i;ie.charset=rl;ie.charsets={lookup:rl};ie.contentType=uv;ie.extension=mv;ie.extensions=Object.create(null);ie.lookup=dv;ie.types=Object.create(null);fv(ie.extensions,ie.types);function rl(i){if(!i||typeof i!="string")return!1;var e=il.exec(i),t=e&&mi[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&pv.test(e[1])?"UTF-8":!1}function uv(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?ie.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=ie.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function mv(i){if(!i||typeof i!="string")return!1;var e=il.exec(i),t=e&&ie.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function dv(i){if(!i||typeof i!="string")return!1;var e=lv("x."+i).toLowerCase().substr(1);return e&&ie.types[e]||!1}function fv(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(mi).forEach(function(n){var s=mi[n],o=s.extensions;if(!(!o||!o.length)){i[n]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(mi[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(l>p||l===p&&e[c].substr(0,12)==="application/"))continue}e[c]=n}}})}});var Pl=v((IR,Tl)=>{function Rl(i){return Array.isArray(i)?i:[i]}var cn="",$l=" ",on="\\",Uv=/^\s+$/,Dv=/(?:[^\\]|^)\\$/,qv=/^\\!/,Gv=/^\\#/,Hv=/\r?\n/g,Wv=/^\.*\/|^\.+$/,an="/",_l="node-ignore";typeof Symbol<"u"&&(_l=Symbol.for("node-ignore"));var kl=_l,Vv=(i,e,t)=>Object.defineProperty(i,e,{value:t}),Bv=/([0-z])-([0-z])/g,Cl=()=>!1,zv=i=>i.replace(Bv,(e,t,r)=>t.charCodeAt(0)<=r.charCodeAt(0)?e:cn),Yv=i=>{let{length:e}=i;return i.slice(0,e-e%2)},Jv=[[/^\uFEFF/,()=>cn],[/((?:\\\\)*?)(\\?\s+)$/,(i,e,t)=>e+(t.indexOf("\\")===0?$l:cn)],[/(\\+?)\s/g,(i,e)=>{let{length:t}=e;return e.slice(0,t-t%2)+$l}],[/[\\$.|*+(){^]/g,i=>`\\${i}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(i,e,t)=>e+6<t.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(i,e,t)=>{let r=t.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>on],[/\\\\/g,()=>on],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(i,e,t,r,n)=>e===on?`\\[${t}${Yv(r)}${n}`:n==="]"&&r.length%2===0?`[${zv(t)}${r}]`:"[]"],[/(?:[^*])$/,i=>/\/$/.test(i)?`${i}$`:`${i}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(i,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],Sl=Object.create(null),Xv=(i,e)=>{let t=Sl[i];return t||(t=Jv.reduce((r,[n,s])=>r.replace(n,s.bind(i)),i),Sl[i]=t),e?new RegExp(t,"i"):new RegExp(t)},un=i=>typeof i=="string",Kv=i=>i&&un(i)&&!Uv.test(i)&&!Dv.test(i)&&i.indexOf("#")!==0,Qv=i=>i.split(Hv),ln=class{constructor(e,t,r,n){this.origin=e,this.pattern=t,this.negative=r,this.regex=n}},Zv=(i,e)=>{let t=i,r=!1;i.indexOf("!")===0&&(r=!0,i=i.substr(1)),i=i.replace(qv,"!").replace(Gv,"#");let n=Xv(i,e);return new ln(t,i,r,n)},eb=(i,e)=>{throw new e(i)},$e=(i,e,t)=>un(i)?i?$e.isNotRelative(i)?t(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:t("path must not be empty",TypeError):t(`path must be a string, but got \`${e}\``,TypeError),Ol=i=>Wv.test(i);$e.isNotRelative=Ol;$e.convert=i=>i;var pn=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:r=!1}={}){Vv(this,kl,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[kl]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(Kv(e)){let t=Zv(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,Rl(un(e)?Qv(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let r=!1,n=!1;return this._rules.forEach(s=>{let{negative:o}=s;if(n===o&&r!==n||o&&!r&&!n&&!t)return;s.regex.test(e)&&(r=!o,n=o)}),{ignored:r,unignored:n}}_test(e,t,r,n){let s=e&&$e.convert(e);return $e(s,e,this._allowRelativePaths?Cl:eb),this._t(s,t,r,n)}_t(e,t,r,n){if(e in t)return t[e];if(n||(n=e.split(an)),n.pop(),!n.length)return t[e]=this._testOne(e,r);let s=this._t(n.join(an)+an,t,r,n);return t[e]=s.ignored?s:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Rl(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},bi=i=>new pn(i),tb=i=>$e(i&&$e.convert(i),i,Cl);bi.isPathValid=tb;bi.default=bi;Tl.exports=bi;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let i=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");$e.convert=i;let e=/^[a-z]:\//i;$e.isNotRelative=t=>e.test(t)||Ol(t)}});(function(){Wn().config(Object.assign({},Bn(),Yn()(process.argv)))})();var Ip=require("fs"),Np=require("path");var jp=T(Ct());var ue=T(require("fs")),Br=T(require("path")),Hc=T(require("os")),Wc=T(Ur());var jx=process.stdout.isTTY===!0&&!process.env.NO_COLOR,Ce=i=>jx?i:"",R=Ce("\x1B[32m"),A=Ce("\x1B[33m"),_=Ce("\x1B[36m"),ce=Ce("\x1B[35m"),h=Ce("\x1B[31m"),g=Ce("\x1B[2m"),ee=Ce("\x1B[1m"),m=Ce("\x1B[0m");var Fc="app.boxel.realms";var Mx={"anthropic/claude-3.5-sonnet":"Anthropic: Claude 3.5 Sonnet","anthropic/claude-3.7-sonnet":"Anthropic: Claude 3.7 Sonnet","anthropic/claude-3.7-sonnet:thinking":"Anthropic: Claude 3.7 Sonnet (thinking)","anthropic/claude-haiku-4.5":"Anthropic: Claude Haiku 4.5","anthropic/claude-sonnet-4":"Anthropic: Claude Sonnet 4","anthropic/claude-sonnet-4.5":"Anthropic: Claude Sonnet 4.5","anthropic/claude-sonnet-4.6":"Anthropic: Claude Sonnet 4.6","anthropic/claude-opus-4.1":"Anthropic: Claude Opus 4.1","deepseek/deepseek-chat-v3-0324":"DeepSeek: DeepSeek V3 0324","google/gemini-2.5-pro":"Google: Gemini 2.5 Pro","google/gemini-2.5-flash-lite":"Google: Gemini 2.5 Flash Lite","google/gemini-2.5-flash":"Google: Gemini 2.5 Flash","meta-llama/llama-3.2-3b-instruct":"Meta: Llama 3.2 3B Instruct","openai/gpt-4.1-nano":"OpenAI: GPT-4.1 Nano","openai/gpt-4.1-mini":"OpenAI: GPT-4.1 Mini","openai/gpt-4.1":"OpenAI: GPT-4.1","openai/gpt-4o":"OpenAI: GPT-4o","openai/gpt-4o-mini":"OpenAI: GPT-4o-mini","openai/gpt-5-nano":"OpenAI: GPT-5 Nano","openai/gpt-5-mini":"OpenAI: GPT-5 Mini","openai/gpt-5":"OpenAI: GPT-5","openai/gpt-oss-20b":"OpenAI: GPT OSS 20B"},tE=Object.keys(Mx);function k(i){return i.endsWith("/")?i:`${i}/`}var Re=class extends Error{status;constructor(e,t){super(t),this.name="MatrixAuthError",this.status=e}};async function Uc(i,e,t){let r=await fetch(new URL("_matrix/client/v3/login",i).href,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:{type:"m.id.user",user:e},password:t,type:"m.login.password"})}),n=await r.json();if(!r.ok)throw new Error(`Matrix login failed: ${r.status} ${JSON.stringify(n)}`);return{accessToken:n.access_token,deviceId:n.device_id,userId:n.user_id,matrixUrl:i}}async function Ix(i){let e=await fetch(new URL(`_matrix/client/v3/user/${encodeURIComponent(i.userId)}/openid/request_token`,i.matrixUrl).href,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.accessToken}`},body:"{}"});if(!e.ok){let t=await e.text();throw e.status===401||e.status===403?new Re(e.status,`OpenID token request failed: ${e.status} ${t}`):new Error(`OpenID token request failed: ${e.status} ${t}`)}return await e.json()}async function Dr(i,e){let t=await Ix(i),r=`${e.replace(/\/$/,"")}/_server-session`,n=await fetch(r,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let o=await n.text();throw new Error(`Realm server session failed: ${n.status} ${o}`)}let s=n.headers.get("Authorization");if(!s)throw new Error("Realm server session response did not include an Authorization header");return s}async function qr(i,e){let t=`${i.replace(/\/$/,"")}/_realm-auth`,r=await fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:e}});if(!r.ok){let n=await r.text();throw new Error(`Realm auth lookup failed: ${r.status} ${n}`)}return await r.json()}function Gr(i){return new URL(`_matrix/client/v3/user/${encodeURIComponent(i.userId)}/account_data/${Fc}`,i.matrixUrl).href}async function si(i){let e;try{e=await fetch(Gr(i),{headers:{Authorization:`Bearer ${i.accessToken}`}})}catch{return[]}if(e.status===401||e.status===403){let t=await e.text();throw new Re(e.status,`Matrix account_data fetch failed: ${e.status} ${t}`)}if(!e.ok)return[];try{let t=await e.json();return Array.isArray(t.realms)?[...t.realms]:[]}catch{return[]}}async function Dc(i,e){let t=await si(i);if(!t.includes(e)){t.push(e);let r=await fetch(Gr(i),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.accessToken}`},body:JSON.stringify({realms:t})});if(!r.ok){let n=await r.text();throw r.status===401||r.status===403?new Re(r.status,`Failed to update Matrix account data: ${r.status} ${n}`):new Error(`Failed to update Matrix account data: ${r.status} ${n}`)}}}async function qc(i,e){let t=k(e),r=await si(i),n=r.filter(o=>k(o)!==t);if(n.length===r.length)return!1;let s=await fetch(Gr(i),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.accessToken}`},body:JSON.stringify({realms:n})});if(!s.ok){let o=await s.text();throw s.status===401||s.status===403?new Re(s.status,`Failed to update Matrix account data: ${s.status} ${o}`):new Error(`Failed to update Matrix account data: ${s.status} ${o}`)}return!0}var Hr=T(require("readline")),Gc=require("stream");function te(i){let e=Hr.createInterface({input:process.stdin,output:process.stdout});return new Promise(t=>{e.question(i,r=>{e.close(),t(r.trim())})})}function mt(i){let e=new Gc.Writable({write:(r,n,s)=>s()}),t=Hr.createInterface({input:process.stdin,output:e,terminal:!0});return new Promise((r,n)=>{let s=process.stdin,o=s.readableFlowing;s.isTTY&&s.setRawMode(!0);let a=()=>{s.removeListener("data",c),s.isTTY&&s.setRawMode(!1),t.close(),o||s.pause()},c=p=>{try{let u=p.toString().split("\x1B[200~").join("").split("\x1B[201~").join("");for(let d of u)if(d===`
32
- `||d==="\r"){a(),process.stdout.write(`
33
- `),r(l);return}else d===""?(a(),process.exit()):d==="\x7F"||d==="\b"?l.length>0&&(l=l.slice(0,-1),process.stdout.write("\b \b")):d>=" "&&(l+=d,process.stdout.write("*"))}catch(u){a(),n(u)}},l="";try{process.stdout.write(i),s.on("data",c),s.resume()}catch(p){a(),n(p)}})}async function xe(i){let e=process.env.BOXEL_REALM_SECRET_SEED;if(e)return e;if(i){if(!process.stdin.isTTY)throw new Error("Cannot prompt for realm secret seed: stdin is not a TTY. Set BOXEL_REALM_SECRET_SEED in the environment instead.");return mt("Realm secret seed: ")}}var Nx=Br.join(Hc.homedir(),".boxel-cli"),Fx="profiles.json",Ux=86400;function Dx(i,e=Ux){let t=i.replace(/^Bearer\s+/i,""),r=Wc.default.decode(t);if(!r?.exp)return!0;let n=Math.floor(Date.now()/1e3);return r.exp-n<e}var P="No active profile. Run `boxel profile add` to create one.";function oi(i){return i.endsWith(":stack.cards")?"staging":i.endsWith(":boxel.ai")?"production":i.endsWith(":localhost")?"local":"unknown"}function dt(i){let e=i.match(/^@([^:]+):/);return e?e[1]:i}function ai(i){let e=i.match(/:([^:]+)$/);return e?e[1]:"unknown"}function me(i){let e=dt(i),t=ai(i);return`${g}[${m}${_}${e}${m} ${g}\xB7${m} ${ce}${t}${m}${g}]${m}`}var Vr=class{config;configDir;profilesFile;matrixLoginFn;promptPasswordFn;isTtyFn;constructor(e,t){this.configDir=e||Nx,this.profilesFile=Br.join(this.configDir,Fx),this.config=this.loadConfig(),this.matrixLoginFn=t?.matrixLogin??Uc,this.promptPasswordFn=t?.promptPassword??mt,this.isTtyFn=t?.isTty??(()=>!!process.stdin.isTTY)}ensureConfigDir(){ue.existsSync(this.configDir)||ue.mkdirSync(this.configDir,{recursive:!0})}loadConfig(){let e={profiles:{},activeProfile:null};if(ue.existsSync(this.profilesFile))try{let t=ue.readFileSync(this.profilesFile,"utf-8"),r=JSON.parse(t);if(r&&typeof r=="object"&&!Array.isArray(r)){let n=r,s=n.profiles&&typeof n.profiles=="object"&&!Array.isArray(n.profiles)?n.profiles:null,o=n.activeProfile===null||typeof n.activeProfile=="string"?n.activeProfile:null;if(s)return{profiles:s,activeProfile:o}}}catch{}return e}saveConfig(){this.ensureConfigDir(),ue.writeFileSync(this.profilesFile,JSON.stringify(this.config,null,2),{mode:384});try{ue.chmodSync(this.profilesFile,384)}catch{}}listProfiles(){return Object.keys(this.config.profiles)}getProfile(e){return this.config.profiles[e]}getActiveProfileId(){return this.config.activeProfile}getActiveProfile(){let e=this.config.activeProfile;if(!e)return null;let t=this.config.profiles[e];return t?{id:e,profile:t}:null}resolveProfileSlots(e,t,r,n){let s=oi(e),o=dt(e);if(s==="unknown"&&(!r||!n))throw new Error(`Unknown domain in Matrix ID "${e}". You must provide explicit --matrix-url and --realm-server-url for non-standard domains.`);let a,c;s==="production"?(a="https://matrix.boxel.ai",c="https://app.boxel.ai/"):s==="local"?(a="http://localhost:8008",c="http://localhost:4201/"):(a="https://matrix-staging.stack.cards",c="https://realms-staging.stack.cards/");let l=ai(e);return{matrixUrl:r||a,realmServerUrl:n||c,displayName:t||`${o} \xB7 ${l}`,username:o}}async addProfileWithAuth(e,t,r,n){let s=this.resolveProfileSlots(e,r,t.matrixUrl,n),o=this.config.profiles[e],a=!!o&&(o.matrixUrl!==s.matrixUrl||o.realmServerUrl!==s.realmServerUrl),c={displayName:s.displayName,matrixUrl:s.matrixUrl,realmServerUrl:s.realmServerUrl,matrixAccessToken:t.accessToken,matrixUserId:t.userId,matrixDeviceId:t.deviceId,realmTokens:a?void 0:o?.realmTokens,realmServerToken:a?void 0:o?.realmServerToken};this.config.profiles[e]=c,this.config.activeProfile||(this.config.activeProfile=e),this.saveConfig()}async addProfile(e,t,r,n,s){let o=this.config.profiles[e],a=this.resolveProfileSlots(e,r??o?.displayName,n??o?.matrixUrl,s??o?.realmServerUrl),c=await this.matrixLoginFn(a.matrixUrl,a.username,t);if(c.userId!==e)throw new Error(`Matrix returned userId "${c.userId}" but profile was added as "${e}". Check the Matrix ID and try again.`);await this.addProfileWithAuth(e,c,a.displayName,a.realmServerUrl)}async removeProfile(e){if(!this.config.profiles[e])return!1;if(delete this.config.profiles[e],this.config.activeProfile===e){let t=Object.keys(this.config.profiles);this.config.activeProfile=t.length>0?t[0]:null}return this.saveConfig(),!0}switchProfile(e){return this.config.profiles[e]?(this.config.activeProfile=e,this.saveConfig(),!0):!1}updateDisplayName(e,t){return this.config.profiles[e]?(this.config.profiles[e].displayName=t,this.saveConfig(),!0):!1}updateUrls(e,t){let r=this.config.profiles[e];if(!r)return!1;let n=!1;return t.matrixUrl&&t.matrixUrl!==r.matrixUrl&&(r.matrixUrl=t.matrixUrl,n=!0),t.realmServerUrl&&t.realmServerUrl!==r.realmServerUrl&&(r.realmServerUrl=t.realmServerUrl,n=!0),n&&(r.realmTokens=void 0,r.realmServerToken=void 0,this.saveConfig()),n}setRealmToken(e,t){let r=this.getActiveProfile();r&&(r.profile.realmTokens||(r.profile.realmTokens={}),r.profile.realmTokens[e]=t,this.saveConfig())}getRealmToken(e){return this.getActiveProfile()?.profile.realmTokens?.[e]}setRealmServerToken(e){let t=this.getActiveProfile();t&&(t.profile.realmServerToken=e,this.saveConfig())}getRealmServerToken(){return this.getActiveProfile()?.profile.realmServerToken}getStoredMatrixAuth(e){let t=e??this.config.activeProfile??void 0,r=t?this.config.profiles[t]:void 0;if(!t||!r)throw new Error(P);if(!r.matrixAccessToken)throw new Error(`Profile "${t}" has no stored Matrix access token. Run \`boxel profile add\` to re-authenticate.`);return{accessToken:r.matrixAccessToken,userId:r.matrixUserId,deviceId:r.matrixDeviceId,matrixUrl:r.matrixUrl}}async reAuthenticate(e){let t=e??this.config.activeProfile??void 0,r=t?this.config.profiles[t]:void 0;if(!t||!r)throw new Error(P);if(!this.isTtyFn())throw new Error(`Stored Matrix token for "${t}" is no longer valid. Run \`boxel profile add -u ${t} -p <password>\` to re-authenticate.`);console.log(`
34
- ${A}Stored Matrix session for ${me(t)} has expired.${m}`);let n=await this.promptPasswordFn(`Password for ${t}: `);if(!n)throw new Error("Re-authentication cancelled: password is required.");let s=dt(t),o=await this.matrixLoginFn(r.matrixUrl,s,n);return await this.addProfileWithAuth(t,o,r.displayName,r.realmServerUrl),this.getStoredMatrixAuth(t)}async fetchRealmServerTokenWithReauth(){let e=this.getStoredMatrixAuth(),r=this.getActiveProfile().profile.realmServerUrl.replace(/\/$/,"");try{let n=await Dr(e,r);return this.setRealmServerToken(n),n}catch(n){if(!(n instanceof Re))throw n;let s=await this.reAuthenticate(),o=await Dr(s,r);return this.setRealmServerToken(o),o}}async getOrRefreshServerToken(){let e=this.getRealmServerToken();return e&&!Dx(e)?e:this.fetchRealmServerTokenWithReauth()}async refreshServerToken(){return this.fetchRealmServerTokenWithReauth()}findRealmTokenForUrl(e){let r=this.getActiveProfile()?.profile.realmTokens;if(r){for(let[n,s]of Object.entries(r))if(e.startsWith(n)&&s)return s}}async fetchAndStoreAllRealmTokens(){let e=await this.getOrRefreshServerToken(),r=this.getActiveProfile().profile.realmServerUrl.replace(/\/$/,""),n=await qr(r,e);for(let[s,o]of Object.entries(n))this.setRealmToken(s,o)}async getRealmTokenForUrl(e){let t=this.findRealmTokenForUrl(e);if(t)return t;try{await this.fetchAndStoreAllRealmTokens()}catch{return}return this.findRealmTokenForUrl(e)}buildHeaders(e,t,r){let n=e instanceof Request?new Headers(e.headers):new Headers,s=new Headers(t?.headers);for(let[o,a]of s)n.set(o,a);return n.has("Authorization")||n.set("Authorization",r),n}async authedRealmFetch(e,t){let r=e instanceof Request?e.url:e instanceof URL?e.href:e,n=await this.getRealmTokenForUrl(r);if(n){let c=this.buildHeaders(e,t,n),l=await fetch(e,{...t,headers:c});if(l.status!==401)return l}let s=this.getActiveProfile();if(s&&(s.profile.realmTokens={},s.profile.realmServerToken=void 0,this.saveConfig()),await this.fetchAndStoreAllRealmTokens(),n=this.findRealmTokenForUrl(r),!n)throw new Error(`No realm token available for ${r}. The realm may not be accessible.`);let o=this.buildHeaders(e,t,n);return await fetch(e,{...t,headers:o})}async authedRealmServerFetch(e,t){let r=await this.getOrRefreshServerToken(),n=this.buildHeaders(e,t,r),s=await fetch(e,{...t,headers:n});return s.status===401&&(r=await this.refreshServerToken(),n=this.buildHeaders(e,t,r),s=await fetch(e,{...t,headers:n})),s}async fetchAndStoreRealmToken(e,t){let n=this.getActiveProfile().profile.realmServerUrl.replace(/\/$/,""),o=(await qr(n,t))[e];return o&&this.setRealmToken(e,o),o}async withMatrixAuthRecovery(e){try{return await e(this.getStoredMatrixAuth())}catch(t){if(!(t instanceof Re))throw t;let r=await this.reAuthenticate();return e(r)}}async addToUserRealms(e){await this.withMatrixAuthRecovery(t=>Dc(t,e))}async removeFromUserRealms(e){return this.withMatrixAuthRecovery(t=>qc(t,e))}async getUserRealms(){return this.withMatrixAuthRecovery(e=>si(e))}async migrateFromEnv(){let e=process.env.MATRIX_URL,t=process.env.MATRIX_USERNAME,r=process.env.MATRIX_PASSWORD,n=process.env.REALM_SERVER_URL;if(!e||!t||!r||!n)return null;let o=e.includes("boxel.ai")?"boxel.ai":"stack.cards",a=`@${t}:${o}`,c=!this.config.profiles[a];return await this.addProfile(a,r,void 0,e,n),{profileId:a,created:c}}printStatus(){let e=this.getActiveProfile();e?(console.log(`
35
- ${ee}Active Profile:${m} ${me(e.id)}`),console.log(` ${g}Display Name:${m} ${e.profile.displayName}`),console.log(` ${g}Matrix URL:${m} ${e.profile.matrixUrl}`),console.log(` ${g}Realm Server:${m} ${e.profile.realmServerUrl}`)):(console.log(`
36
- ${A}No active profile and no environment variables set.${m}`),console.log(`Run ${_}boxel profile add${m} to create a profile.`))}},Wr=null;function C(){return Wr||(Wr=new Vr),Wr}var zr={staging:{domain:"stack.cards",matrixUrl:"https://matrix-staging.stack.cards",realmServerUrl:"https://realms-staging.stack.cards/"},production:{domain:"boxel.ai",matrixUrl:"https://matrix.boxel.ai",realmServerUrl:"https://app.boxel.ai/"},local:{domain:"localhost",matrixUrl:"http://localhost:8008",realmServerUrl:"http://localhost:4201/"}};function ci(i,e){let t=i.trim(),r;try{r=new URL(t)}catch{console.error(`${h}Error:${m} ${e} "${i}" is not a valid URL.`),process.exit(1)}return r.protocol!=="http:"&&r.protocol!=="https:"&&(console.error(`${h}Error:${m} ${e} "${i}" must use http:// or https://.`),process.exit(1)),t}function qx(i){return i.toLowerCase().replace(/\//g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Vc(){let i=process.env.BOXEL_ENVIRONMENT;if(!i||!i.trim())return null;let e=qx(i);return e||(console.error(`${h}Error:${m} BOXEL_ENVIRONMENT="${i}" contains no slug characters (expected letters, digits, or "-").`),process.exit(1)),{domain:`${e}.localhost`,matrixUrl:`http://matrix.${e}.localhost`,realmServerUrl:`http://realm-server.${e}.localhost/`}}async function zc(i,e,t){let r=C();switch(i){case"list":await Bc(r);break;case"add":{let n=t?.password||process.env.BOXEL_PASSWORD;if(t?.user&&n){let s=t.matrixUrl?ci(t.matrixUrl,"--matrix-url"):void 0,o=t.realmServerUrl?ci(t.realmServerUrl,"--realm-server-url"):void 0,p=!(oi(t.user)!=="unknown")&&(!s||!o)?Vc():null;p&&console.log(`${g}Using BOXEL_ENVIRONMENT=${process.env.BOXEL_ENVIRONMENT}${m}`),await Bx(r,t.user,n,t.name,s??p?.matrixUrl,o??p?.realmServerUrl)}else await Hx(r,Vc());break}case"switch":e||(console.error(`${h}Error:${m} Please specify a profile to switch to.`),console.log("Usage: boxel profile switch <profile-id>"),console.log(`
37
- Available profiles:`),await Bc(r),process.exit(1)),await Wx(r,e);break;case"remove":e||(console.error(`${h}Error:${m} Please specify a profile to remove.`),process.exit(1)),await Vx(r,e);break;case"migrate":await zx(r);break;default:r.printStatus(),console.log(`
38
- ${g}Commands:${m}`),console.log(` ${_}boxel profile list${m} List all profiles`),console.log(` ${_}boxel profile add${m} Add a new profile`),console.log(` ${_}boxel profile switch${m} Switch active profile`),console.log(` ${_}boxel profile remove${m} Remove a profile`),console.log(` ${_}boxel profile migrate${m} Import from .env file`)}}async function Bc(i){let e=i.listProfiles(),t=i.getActiveProfileId();if(e.length===0){console.log(`
39
- ${A}No profiles configured.${m}`),console.log(`Run ${_}boxel profile add${m} to create one.`);return}console.log(`
40
- ${ee}Saved Profiles:${m}
41
- `);for(let r of e){let n=i.getProfile(r),s=r===t,o=oi(r),a=s?`${R}\u2605${m} `:" ",c=ai(r),l=o==="production"?ce:_;console.log(`${a}${ee}${r}${m}`),console.log(` ${g}Name:${m} ${n.displayName}`),console.log(` ${g}Environment:${m} ${l}${c}${m}`),console.log(` ${g}Realm Server:${m} ${n.realmServerUrl}`),console.log("")}t&&console.log(`${g}\u2605 = active profile${m}`)}async function Gx(){console.log("Which environment?"),console.log(` ${_}1${m}) Staging (realms-staging.stack.cards)`),console.log(` ${ce}2${m}) Production (app.boxel.ai)`),console.log(` ${R}3${m}) Local (localhost:4201)`),console.log(` ${A}4${m}) Custom (enter your own URLs)`);let i=await te(`
42
- Choice [1/2/3/4]: `);if(i==="4"){let e=await te("Matrix server URL: ");e||(console.error(`${h}Error:${m} Matrix server URL is required.`),process.exit(1));let t=ci(e,"Matrix server URL"),r=await te("Realm server URL: ");r||(console.error(`${h}Error:${m} Realm server URL is required.`),process.exit(1));let n=ci(r,"Realm server URL"),s=new URL(t).hostname||"custom";return{domain:await te(`Domain for Matrix ID [${s}]: `)||s,matrixUrl:t,realmServerUrl:n}}return i==="3"?{...zr.local}:i==="2"?{...zr.production}:{...zr.staging}}async function Hx(i,e){console.log(`
43
- ${ee}Add New Profile${m}
44
- `);let t,r,n;if(e)console.log(`${g}Using BOXEL_ENVIRONMENT=${process.env.BOXEL_ENVIRONMENT}${m}`),t=e.domain,r=e.matrixUrl,n=e.realmServerUrl;else{let u=await Gx();t=u.domain,r=u.matrixUrl,n=u.realmServerUrl}console.log(`
45
- Enter your Boxel username (without @ or domain)`),console.log(`${g}Example: ctse, aallen90${m}`);let s=await te("Username: ");s||(console.error(`${h}Error:${m} Username is required.`),process.exit(1));let o=`@${s}:${t}`;if(i.getProfile(o)&&(console.log(`
46
- ${A}Profile ${o} already exists.${m}`),(await te("Overwrite? [y/N]: ")).toLowerCase()!=="y")){console.log("Cancelled.");return}let a=await mt("Password: ");a||(console.error(`${h}Error:${m} Password is required.`),process.exit(1));let c=`${s} \xB7 ${t}`,p=await te(`Display name [${c}]: `)||c;await i.addProfile(o,a,p,r,n),console.log(`
47
- ${R}\u2713${m} Profile created: ${me(o)}`),i.getActiveProfileId()===o?console.log(`${g}This profile is now active.${m}`):(await te("Switch to this profile now? [Y/n]: ")).toLowerCase()!=="n"&&(i.switchProfile(o),console.log(`${R}\u2713${m} Switched to ${me(o)}`))}async function Wx(i,e){let t=i.listProfiles(),r=e;if(!t.includes(e)){let n=t.filter(s=>{let o=dt(s);return s.includes(e)||o===e});if(n.length===0){console.error(`${h}Error:${m} Profile not found: ${e}`),console.log(`
48
- Available profiles:`);for(let s of t)console.log(` ${s}`);process.exit(1)}else if(n.length===1)r=n[0];else{console.error(`${h}Error:${m} Ambiguous profile: ${e}`),console.log(`
49
- Matching profiles:`);for(let s of n)console.log(` ${s}`);process.exit(1)}}i.switchProfile(r)?console.log(`${R}\u2713${m} Switched to ${me(r)}`):(console.error(`${h}Error:${m} Failed to switch profile.`),process.exit(1))}async function Vx(i,e){if(i.getProfile(e)||(console.error(`${h}Error:${m} Profile not found: ${e}`),process.exit(1)),(await te(`Remove profile ${e}? [y/N]: `)).toLowerCase()!=="y"){console.log("Cancelled.");return}if(await i.removeProfile(e)){console.log(`${R}\u2713${m} Profile removed.`);let n=i.getActiveProfileId();n&&console.log(`Active profile is now: ${me(n)}`)}else console.error(`${h}Error:${m} Failed to remove profile.`),process.exit(1)}async function Bx(i,e,t,r,n,s){(!e.startsWith("@")||!e.includes(":"))&&(console.error(`${h}Error:${m} Invalid Matrix ID format. Expected @user:domain`),process.exit(1));let o=!!i.getProfile(e);try{await i.addProfile(e,t,r,n,s)}catch(c){console.error(`${h}Error:${m} ${c instanceof Error?c.message:String(c)}`),process.exit(1)}if(o){(n||s)&&i.updateUrls(e,{matrixUrl:n,realmServerUrl:s})&&console.log(`${g}Updated server URLs and cleared cached realm tokens.${m}`),console.log(`${R}\u2713${m} Profile updated: ${me(e)}`);return}console.log(`${R}\u2713${m} Profile created: ${me(e)}`),i.getActiveProfileId()!==e&&console.log(`${g}Use 'boxel profile switch ${e}' to switch to this profile.${m}`)}async function zx(i){console.log(`
50
- ${ee}Migrate from .env${m}
51
- `);let e=process.env.MATRIX_URL,t=process.env.MATRIX_USERNAME,r=process.env.MATRIX_PASSWORD,n=process.env.REALM_SERVER_URL;if(!e||!t||!r||!n){console.log(`${A}No complete credentials found in environment variables.${m}`),console.log(`
52
- Required variables: MATRIX_URL, MATRIX_USERNAME, MATRIX_PASSWORD, REALM_SERVER_URL`);return}let s=await i.migrateFromEnv();s?s.created?(console.log(`${R}\u2713${m} Created profile: ${me(s.profileId)}`),console.log(`
53
- ${g}You can now remove credentials from .env if desired.${m}`)):(console.log(`${R}\u2713${m} Refreshed profile: ${me(s.profileId)}`),console.log(`
54
- ${g}Use 'boxel profile add -u ${s.profileId} -p <password>' to update other fields.${m}`)):console.log(`${A}Migration failed.${m}`)}var de=T(require("fs")),Me=T(require("path"));var Je=T(require("fs")),W=T(require("path"));var ft=!1,Yx=console.log.bind(console),Jx=console.info.bind(console),Xx=console.debug.bind(console);function pi(i){if(i!==ft)if(ft=i,ft){let e=()=>{};console.log=e,console.info=e,console.debug=e}else console.log=Yx,console.info=Jx,console.debug=Xx}function Yc(){return ft}var j={info(...i){ft||process.stderr.write(i.map(li).join(" ")+`
55
- `)},warn(...i){process.stderr.write(i.map(li).join(" ")+`
56
- `)},error(...i){process.stderr.write(i.map(li).join(" ")+`
57
- `)},output(...i){process.stdout.write(i.map(li).join(" ")+`
58
- `)}};function li(i){if(typeof i=="string")return i;if(i instanceof Error)return i.stack??i.message;try{return JSON.stringify(i)}catch{return String(i)}}var Jc=!1,Kx=new Set([".git","node_modules","dist",".boxel-history",".claude"]);function Qx(i){return Kx.has(i)}function Zx(i){return i==="stack.cards"||i.endsWith(".stack.cards")?"stack.cards":i==="boxel.ai"||i.endsWith(".boxel.ai")?"boxel.ai":i}function Yr(i){if(!i)return!1;let e;try{e=decodeURIComponent(i)}catch{return!1}return!(e==="."||e===".."||e.includes("/")||e.includes("\\")||e.includes("\0"))}function ev(i){let e;try{e=new URL(i)}catch{return null}let t=Zx(e.hostname);if(!Yr(t))return null;let r=e.pathname.replace(/^\/|\/$/g,"").split("/").filter(Boolean),n=r[0]??"unknown-owner",s=r[1]??r[0]??"workspace";return!Yr(n)||!Yr(s)?null:W.join(t,n,s)}function tv(i,e){let t=ev(i);return t===null?null:W.resolve(e,t)}function iv(i){let e;try{e=Je.readFileSync(i,"utf-8")}catch{return null}let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!="object"||t===null)return null;let r=t.realmUrl;return typeof r!="string"||r===""?null:{realmUrl:r}}function Xc(i,e){let t=W.join(i,".boxel-sync.json");Je.existsSync(t)&&e.push(t)}function ui(i){try{return Je.readdirSync(i,{withFileTypes:!0}).filter(e=>e.isDirectory()&&!Qx(e.name)).map(e=>W.join(i,e.name))}catch{return[]}}function rv(i){let e=[],t=W.resolve(i);for(let r of ui(t))Xc(r,e);for(let r of ui(t))for(let n of ui(r))for(let s of ui(n))Xc(s,e);return e}function nv(i,e){let t=W.relative(i,e);return t===""?!0:t.startsWith("..")?!1:!W.isAbsolute(t)}function Jr(i){let e=W.resolve(i),t=rv(e),r=new Set,n=[];for(let s of t){if(r.has(s))continue;r.add(s);let o=iv(s);if(!o)continue;let a=tv(o.realmUrl,e);if(a===null||!nv(e,a))continue;let c=W.dirname(s);W.resolve(c)!==W.resolve(a)&&n.push({manifestPath:s,currentDir:c,expectedDir:a,realmUrl:o.realmUrl})}return n}function Kc(i){if(Jc||process.env.BOXEL_DISABLE_PATH_WARNING==="1"||Yc())return;let e=Jr(i);if(e.length===0)return;Jc=!0,console.warn(`
59
- \u26A0\uFE0F Detected local realm directories at legacy local paths:`);let t=W.resolve(i);for(let r of e.slice(0,5)){let n=W.relative(t,r.currentDir)||".",s=W.relative(t,r.expectedDir)||".";console.warn(` - ${n} -> ${s}`)}e.length>5&&console.warn(` ...and ${e.length-5} more`),console.warn(`
31
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ot="secret must be a string or buffer",We="key must be a string or a buffer",Nu="key must be a string, a buffer or an object",or=typeof ae.createPublicKey=="function";or&&(We+=" or a KeyObject",ot+="or a KeyObject");function $s(i){if(!Ge.isBuffer(i)&&typeof i!="string"&&(!or||typeof i!="object"||typeof i.type!="string"||typeof i.asymmetricKeyType!="string"||typeof i.export!="function"))throw me(We)}function ks(i){if(!Ge.isBuffer(i)&&typeof i!="string"&&typeof i!="object")throw me(Nu)}function Fu(i){if(!Ge.isBuffer(i)){if(typeof i=="string")return i;if(!or||typeof i!="object"||i.type!=="secret"||typeof i.export!="function")throw me(ot)}}function ar(i){return i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ss(i){i=i.toString();var e=4-i.length%4;if(e!==4)for(var t=0;t<e;++t)i+="=";return i.replace(/\-/g,"+").replace(/_/g,"/")}function me(i){var e=[].slice.call(arguments,1),t=Es.format.bind(Es,i).apply(null,e);return new TypeError(t)}function Uu(i){return Ge.isBuffer(i)||typeof i=="string"}function at(i){return Uu(i)||(i=JSON.stringify(i)),i}function _s(i){return function(t,r){Fu(r),t=at(t);var n=ae.createHmac("sha"+i,r),s=(n.update(t),n.digest("base64"));return ar(s)}}var sr,Du="timingSafeEqual"in ae?function(e,t){return e.byteLength!==t.byteLength?!1:ae.timingSafeEqual(e,t)}:function(e,t){return sr||(sr=ws()),sr(e,t)};function qu(i){return function(t,r,n){var s=_s(i)(t,n);return Du(Ge.from(r),Ge.from(s))}}function Cs(i){return function(t,r){ks(r),t=at(t);var n=ae.createSign("RSA-SHA"+i),s=(n.update(t),n.sign(r,"base64"));return ar(s)}}function Ts(i){return function(t,r,n){$s(n),t=at(t),r=Ss(r);var s=ae.createVerify("RSA-SHA"+i);return s.update(t),s.verify(n,r,"base64")}}function Hu(i){return function(t,r){ks(r),t=at(t);var n=ae.createSign("RSA-SHA"+i),s=(n.update(t),n.sign({key:r,padding:ae.constants.RSA_PKCS1_PSS_PADDING,saltLength:ae.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return ar(s)}}function Wu(i){return function(t,r,n){$s(n),t=at(t),r=Ss(r);var s=ae.createVerify("RSA-SHA"+i);return s.update(t),s.verify({key:n,padding:ae.constants.RSA_PKCS1_PSS_PADDING,saltLength:ae.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function Gu(i){var e=Cs(i);return function(){var r=e.apply(null,arguments);return r=Rs.derToJose(r,"ES"+i),r}}function Vu(i){var e=Ts(i);return function(r,n,s){n=Rs.joseToDer(n,"ES"+i).toString("base64");var o=e(r,n,s);return o}}function Bu(){return function(){return""}}function zu(){return function(e,t){return t===""}}Os.exports=function(e){var t={hs:_s,rs:Cs,ps:Hu,es:Gu,none:Bu},r={hs:qu,rs:Ts,ps:Wu,es:Vu,none:zu},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw me(Iu,e);var s=(n[1]||n[3]).toLowerCase(),o=n[2];return{sign:t[s](o),verify:r[s](o)}}});var lr=v((Xy,Ps)=>{var Yu=require("buffer").Buffer;Ps.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Yu.isBuffer(e)?e.toString():JSON.stringify(e)}});var Ns=v((Ky,Is)=>{var Ju=He().Buffer,As=ir(),Xu=cr(),Ku=require("stream"),Ls=lr(),pr=require("util");function js(i,e){return Ju.from(i,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qu(i,e,t){t=t||"utf8";var r=js(Ls(i),"binary"),n=js(Ls(e),t);return pr.format("%s.%s",r,n)}function Ms(i){var e=i.header,t=i.payload,r=i.secret||i.privateKey,n=i.encoding,s=Xu(e.alg),o=Qu(e,t,n),a=s.sign(o,r);return pr.format("%s.%s",o,a)}function Ut(i){var e=i.secret;if(e=e??i.privateKey,e=e??i.key,/^hs/i.test(i.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new As(e);this.readable=!0,this.header=i.header,this.encoding=i.encoding,this.secret=this.privateKey=this.key=t,this.payload=new As(i.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}pr.inherits(Ut,Ku);Ut.prototype.sign=function(){try{var e=Ms({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};Ut.sign=Ms;Is.exports=Ut});var zs=v((Qy,Bs)=>{var Us=He().Buffer,Fs=ir(),Zu=cr(),em=require("stream"),Ds=lr(),tm=require("util"),im=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function rm(i){return Object.prototype.toString.call(i)==="[object Object]"}function nm(i){if(rm(i))return i;try{return JSON.parse(i)}catch{return}}function qs(i){var e=i.split(".",1)[0];return nm(Us.from(e,"base64").toString("binary"))}function sm(i){return i.split(".",2).join(".")}function Hs(i){return i.split(".")[2]}function om(i,e){e=e||"utf8";var t=i.split(".")[1];return Us.from(t,"base64").toString(e)}function Ws(i){return im.test(i)&&!!qs(i)}function Gs(i,e,t){if(!e){var r=new Error("Missing algorithm parameter for jws.verify");throw r.code="MISSING_ALGORITHM",r}i=Ds(i);var n=Hs(i),s=sm(i),o=Zu(e);return o.verify(s,n,t)}function Vs(i,e){if(e=e||{},i=Ds(i),!Ws(i))return null;var t=qs(i);if(!t)return null;var r=om(i);return(t.typ==="JWT"||e.json)&&(r=JSON.parse(r,e.encoding)),{header:t,payload:r,signature:Hs(i)}}function Ve(i){i=i||{};var e=i.secret;if(e=e??i.publicKey,e=e??i.key,/^hs/i.test(i.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new Fs(e);this.readable=!0,this.algorithm=i.algorithm,this.encoding=i.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Fs(i.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}tm.inherits(Ve,em);Ve.prototype.verify=function(){try{var e=Gs(this.signature.buffer,this.algorithm,this.key.buffer),t=Vs(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Ve.decode=Vs;Ve.isValid=Ws;Ve.verify=Gs;Bs.exports=Ve});var qt=v(Se=>{var Ys=Ns(),Dt=zs(),am=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Se.ALGORITHMS=am;Se.sign=Ys.sign;Se.verify=Dt.verify;Se.decode=Dt.decode;Se.isValid=Dt.isValid;Se.createSign=function(e){return new Ys(e)};Se.createVerify=function(e){return new Dt(e)}});var ur=v((ew,Js)=>{var cm=qt();Js.exports=function(i,e){e=e||{};var t=cm.decode(i,e);if(!t)return null;var r=t.payload;if(typeof r=="string")try{var n=JSON.parse(r);n!==null&&typeof n=="object"&&(r=n)}catch{}return e.complete===!0?{header:t.header,payload:r,signature:t.signature}:r}});var ct=v((tw,Xs)=>{var Ht=function(i,e){Error.call(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=i,e&&(this.inner=e)};Ht.prototype=Object.create(Error.prototype);Ht.prototype.constructor=Ht;Xs.exports=Ht});var mr=v((iw,Qs)=>{var Ks=ct(),Wt=function(i,e){Ks.call(this,i),this.name="NotBeforeError",this.date=e};Wt.prototype=Object.create(Ks.prototype);Wt.prototype.constructor=Wt;Qs.exports=Wt});var dr=v((rw,eo)=>{var Zs=ct(),Gt=function(i,e){Zs.call(this,i),this.name="TokenExpiredError",this.expiredAt=e};Gt.prototype=Object.create(Zs.prototype);Gt.prototype.constructor=Gt;eo.exports=Gt});var io=v((nw,to)=>{var Be=1e3,ze=Be*60,Ye=ze*60,Me=Ye*24,lm=Me*7,pm=Me*365.25;to.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return um(i);if(t==="number"&&isFinite(i))return e.long?dm(i):mm(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function um(i){if(i=String(i),!(i.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*pm;case"weeks":case"week":case"w":return t*lm;case"days":case"day":case"d":return t*Me;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ye;case"minutes":case"minute":case"mins":case"min":case"m":return t*ze;case"seconds":case"second":case"secs":case"sec":case"s":return t*Be;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function mm(i){var e=Math.abs(i);return e>=Me?Math.round(i/Me)+"d":e>=Ye?Math.round(i/Ye)+"h":e>=ze?Math.round(i/ze)+"m":e>=Be?Math.round(i/Be)+"s":i+"ms"}function dm(i){var e=Math.abs(i);return e>=Me?Vt(i,e,Me,"day"):e>=Ye?Vt(i,e,Ye,"hour"):e>=ze?Vt(i,e,ze,"minute"):e>=Be?Vt(i,e,Be,"second"):i+" ms"}function Vt(i,e,t,r){var n=e>=t*1.5;return Math.round(i/t)+" "+r+(n?"s":"")}});var fr=v((sw,ro)=>{var fm=io();ro.exports=function(i,e){var t=e||Math.floor(Date.now()/1e3);if(typeof i=="string"){var r=fm(i);return typeof r>"u"?void 0:Math.floor(t+r/1e3)}else return typeof i=="number"?t+i:void 0}});var Je=v((ow,no)=>{"use strict";var hm="2.0.0",gm=Number.MAX_SAFE_INTEGER||9007199254740991,xm=16,vm=250,bm=["major","premajor","minor","preminor","patch","prepatch","prerelease"];no.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:xm,MAX_SAFE_BUILD_LENGTH:vm,MAX_SAFE_INTEGER:gm,RELEASE_TYPES:bm,SEMVER_SPEC_VERSION:hm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var lt=v((aw,so)=>{"use strict";var ym=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};so.exports=ym});var Xe=v((xe,oo)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:hr,MAX_SAFE_BUILD_LENGTH:wm,MAX_LENGTH:Em}=Je(),Rm=lt();xe=oo.exports={};var $m=xe.re=[],km=xe.safeRe=[],y=xe.src=[],Sm=xe.safeSrc=[],w=xe.t={},_m=0,gr="[a-zA-Z0-9-]",Cm=[["\\s",1],["\\d",Em],[gr,wm]],Tm=i=>{for(let[e,t]of Cm)i=i.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return i},S=(i,e,t)=>{let r=Tm(e),n=_m++;Rm(i,n,e),w[i]=n,y[n]=e,Sm[n]=r,$m[n]=new RegExp(e,t?"g":void 0),km[n]=new RegExp(r,t?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*");S("NUMERICIDENTIFIERLOOSE","\\d+");S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${gr}*`);S("MAINVERSION",`(${y[w.NUMERICIDENTIFIER]})\\.(${y[w.NUMERICIDENTIFIER]})\\.(${y[w.NUMERICIDENTIFIER]})`);S("MAINVERSIONLOOSE",`(${y[w.NUMERICIDENTIFIERLOOSE]})\\.(${y[w.NUMERICIDENTIFIERLOOSE]})\\.(${y[w.NUMERICIDENTIFIERLOOSE]})`);S("PRERELEASEIDENTIFIER",`(?:${y[w.NONNUMERICIDENTIFIER]}|${y[w.NUMERICIDENTIFIER]})`);S("PRERELEASEIDENTIFIERLOOSE",`(?:${y[w.NONNUMERICIDENTIFIER]}|${y[w.NUMERICIDENTIFIERLOOSE]})`);S("PRERELEASE",`(?:-(${y[w.PRERELEASEIDENTIFIER]}(?:\\.${y[w.PRERELEASEIDENTIFIER]})*))`);S("PRERELEASELOOSE",`(?:-?(${y[w.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[w.PRERELEASEIDENTIFIERLOOSE]})*))`);S("BUILDIDENTIFIER",`${gr}+`);S("BUILD",`(?:\\+(${y[w.BUILDIDENTIFIER]}(?:\\.${y[w.BUILDIDENTIFIER]})*))`);S("FULLPLAIN",`v?${y[w.MAINVERSION]}${y[w.PRERELEASE]}?${y[w.BUILD]}?`);S("FULL",`^${y[w.FULLPLAIN]}$`);S("LOOSEPLAIN",`[v=\\s]*${y[w.MAINVERSIONLOOSE]}${y[w.PRERELEASELOOSE]}?${y[w.BUILD]}?`);S("LOOSE",`^${y[w.LOOSEPLAIN]}$`);S("GTLT","((?:<|>)?=?)");S("XRANGEIDENTIFIERLOOSE",`${y[w.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);S("XRANGEIDENTIFIER",`${y[w.NUMERICIDENTIFIER]}|x|X|\\*`);S("XRANGEPLAIN",`[v=\\s]*(${y[w.XRANGEIDENTIFIER]})(?:\\.(${y[w.XRANGEIDENTIFIER]})(?:\\.(${y[w.XRANGEIDENTIFIER]})(?:${y[w.PRERELEASE]})?${y[w.BUILD]}?)?)?`);S("XRANGEPLAINLOOSE",`[v=\\s]*(${y[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[w.XRANGEIDENTIFIERLOOSE]})(?:${y[w.PRERELEASELOOSE]})?${y[w.BUILD]}?)?)?`);S("XRANGE",`^${y[w.GTLT]}\\s*${y[w.XRANGEPLAIN]}$`);S("XRANGELOOSE",`^${y[w.GTLT]}\\s*${y[w.XRANGEPLAINLOOSE]}$`);S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${hr}})(?:\\.(\\d{1,${hr}}))?(?:\\.(\\d{1,${hr}}))?`);S("COERCE",`${y[w.COERCEPLAIN]}(?:$|[^\\d])`);S("COERCEFULL",y[w.COERCEPLAIN]+`(?:${y[w.PRERELEASE]})?(?:${y[w.BUILD]})?(?:$|[^\\d])`);S("COERCERTL",y[w.COERCE],!0);S("COERCERTLFULL",y[w.COERCEFULL],!0);S("LONETILDE","(?:~>?)");S("TILDETRIM",`(\\s*)${y[w.LONETILDE]}\\s+`,!0);xe.tildeTrimReplace="$1~";S("TILDE",`^${y[w.LONETILDE]}${y[w.XRANGEPLAIN]}$`);S("TILDELOOSE",`^${y[w.LONETILDE]}${y[w.XRANGEPLAINLOOSE]}$`);S("LONECARET","(?:\\^)");S("CARETTRIM",`(\\s*)${y[w.LONECARET]}\\s+`,!0);xe.caretTrimReplace="$1^";S("CARET",`^${y[w.LONECARET]}${y[w.XRANGEPLAIN]}$`);S("CARETLOOSE",`^${y[w.LONECARET]}${y[w.XRANGEPLAINLOOSE]}$`);S("COMPARATORLOOSE",`^${y[w.GTLT]}\\s*(${y[w.LOOSEPLAIN]})$|^$`);S("COMPARATOR",`^${y[w.GTLT]}\\s*(${y[w.FULLPLAIN]})$|^$`);S("COMPARATORTRIM",`(\\s*)${y[w.GTLT]}\\s*(${y[w.LOOSEPLAIN]}|${y[w.XRANGEPLAIN]})`,!0);xe.comparatorTrimReplace="$1$2$3";S("HYPHENRANGE",`^\\s*(${y[w.XRANGEPLAIN]})\\s+-\\s+(${y[w.XRANGEPLAIN]})\\s*$`);S("HYPHENRANGELOOSE",`^\\s*(${y[w.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[w.XRANGEPLAINLOOSE]})\\s*$`);S("STAR","(<|>)?=?\\s*\\*");S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Bt=v((cw,ao)=>{"use strict";var Om=Object.freeze({loose:!0}),Pm=Object.freeze({}),Am=i=>i?typeof i!="object"?Om:i:Pm;ao.exports=Am});var xr=v((lw,po)=>{"use strict";var co=/^[0-9]+$/,lo=(i,e)=>{if(typeof i=="number"&&typeof e=="number")return i===e?0:i<e?-1:1;let t=co.test(i),r=co.test(e);return t&&r&&(i=+i,e=+e),i===e?0:t&&!r?-1:r&&!t?1:i<e?-1:1},Lm=(i,e)=>lo(e,i);po.exports={compareIdentifiers:lo,rcompareIdentifiers:Lm}});var J=v((pw,mo)=>{"use strict";var zt=lt(),{MAX_LENGTH:uo,MAX_SAFE_INTEGER:Yt}=Je(),{safeRe:Jt,t:Xt}=Xe(),jm=Bt(),{compareIdentifiers:vr}=xr(),br=class i{constructor(e,t){if(t=jm(t),e instanceof i){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>uo)throw new TypeError(`version is longer than ${uo} characters`);zt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Jt[Xt.LOOSE]:Jt[Xt.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Yt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Yt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Yt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<Yt)return s}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(zt("SemVer.compare",this.version,this.options,e),!(e instanceof i)){if(typeof e=="string"&&e===this.version)return 0;e=new i(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof i||(e=new i(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(zt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return vr(r,n)}while(++t)}compareBuild(e){e instanceof i||(e=new i(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(zt("build compare",t,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return vr(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Jt[Xt.PRERELEASELOOSE]:Jt[Xt.PRERELEASE]);if(!n||n[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];r===!1&&(s=[t]),vr(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};mo.exports=br});var _e=v((uw,ho)=>{"use strict";var fo=J(),Mm=(i,e,t=!1)=>{if(i instanceof fo)return i;try{return new fo(i,e)}catch(r){if(!t)return null;throw r}};ho.exports=Mm});var xo=v((mw,go)=>{"use strict";var Im=_e(),Nm=(i,e)=>{let t=Im(i,e);return t?t.version:null};go.exports=Nm});var bo=v((dw,vo)=>{"use strict";var Fm=_e(),Um=(i,e)=>{let t=Fm(i.trim().replace(/^[=v]+/,""),e);return t?t.version:null};vo.exports=Um});var Eo=v((fw,wo)=>{"use strict";var yo=J(),Dm=(i,e,t,r,n)=>{typeof t=="string"&&(n=r,r=t,t=void 0);try{return new yo(i instanceof yo?i.version:i,t).inc(e,r,n).version}catch{return null}};wo.exports=Dm});var ko=v((hw,$o)=>{"use strict";var Ro=_e(),qm=(i,e)=>{let t=Ro(i,null,!0),r=Ro(e,null,!0),n=t.compare(r);if(n===0)return null;let s=n>0,o=s?t:r,a=s?r:t,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let p=c?"pre":"";return t.major!==r.major?p+"major":t.minor!==r.minor?p+"minor":t.patch!==r.patch?p+"patch":"prerelease"};$o.exports=qm});var _o=v((gw,So)=>{"use strict";var Hm=J(),Wm=(i,e)=>new Hm(i,e).major;So.exports=Wm});var To=v((xw,Co)=>{"use strict";var Gm=J(),Vm=(i,e)=>new Gm(i,e).minor;Co.exports=Vm});var Po=v((vw,Oo)=>{"use strict";var Bm=J(),zm=(i,e)=>new Bm(i,e).patch;Oo.exports=zm});var Lo=v((bw,Ao)=>{"use strict";var Ym=_e(),Jm=(i,e)=>{let t=Ym(i,e);return t&&t.prerelease.length?t.prerelease:null};Ao.exports=Jm});var ce=v((yw,Mo)=>{"use strict";var jo=J(),Xm=(i,e,t)=>new jo(i,t).compare(new jo(e,t));Mo.exports=Xm});var No=v((ww,Io)=>{"use strict";var Km=ce(),Qm=(i,e,t)=>Km(e,i,t);Io.exports=Qm});var Uo=v((Ew,Fo)=>{"use strict";var Zm=ce(),ed=(i,e)=>Zm(i,e,!0);Fo.exports=ed});var Kt=v((Rw,qo)=>{"use strict";var Do=J(),td=(i,e,t)=>{let r=new Do(i,t),n=new Do(e,t);return r.compare(n)||r.compareBuild(n)};qo.exports=td});var Wo=v(($w,Ho)=>{"use strict";var id=Kt(),rd=(i,e)=>i.sort((t,r)=>id(t,r,e));Ho.exports=rd});var Vo=v((kw,Go)=>{"use strict";var nd=Kt(),sd=(i,e)=>i.sort((t,r)=>nd(r,t,e));Go.exports=sd});var pt=v((Sw,Bo)=>{"use strict";var od=ce(),ad=(i,e,t)=>od(i,e,t)>0;Bo.exports=ad});var Qt=v((_w,zo)=>{"use strict";var cd=ce(),ld=(i,e,t)=>cd(i,e,t)<0;zo.exports=ld});var yr=v((Cw,Yo)=>{"use strict";var pd=ce(),ud=(i,e,t)=>pd(i,e,t)===0;Yo.exports=ud});var wr=v((Tw,Jo)=>{"use strict";var md=ce(),dd=(i,e,t)=>md(i,e,t)!==0;Jo.exports=dd});var Zt=v((Ow,Xo)=>{"use strict";var fd=ce(),hd=(i,e,t)=>fd(i,e,t)>=0;Xo.exports=hd});var ei=v((Pw,Ko)=>{"use strict";var gd=ce(),xd=(i,e,t)=>gd(i,e,t)<=0;Ko.exports=xd});var Er=v((Aw,Qo)=>{"use strict";var vd=yr(),bd=wr(),yd=pt(),wd=Zt(),Ed=Qt(),Rd=ei(),$d=(i,e,t,r)=>{switch(e){case"===":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i===t;case"!==":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i!==t;case"":case"=":case"==":return vd(i,t,r);case"!=":return bd(i,t,r);case">":return yd(i,t,r);case">=":return wd(i,t,r);case"<":return Ed(i,t,r);case"<=":return Rd(i,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}};Qo.exports=$d});var ea=v((Lw,Zo)=>{"use strict";var kd=J(),Sd=_e(),{safeRe:ti,t:ii}=Xe(),_d=(i,e)=>{if(i instanceof kd)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;e=e||{};let t=null;if(!e.rtl)t=i.match(e.includePrerelease?ti[ii.COERCEFULL]:ti[ii.COERCE]);else{let c=e.includePrerelease?ti[ii.COERCERTLFULL]:ti[ii.COERCERTL],l;for(;(l=c.exec(i))&&(!t||t.index+t[0].length!==i.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(t===null)return null;let r=t[2],n=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",a=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Sd(`${r}.${n}.${s}${o}${a}`,e)};Zo.exports=_d});var ia=v((jw,ta)=>{"use strict";var Cd=_e(),Td=Je(),Od=J(),Pd=(i,e,t)=>{if(!Td.RELEASE_TYPES.includes(e))return null;let r=Ad(i,t);return r&&Ld(r,e)},Ad=(i,e)=>{let t=i instanceof Od?i.version:i;return Cd(t,e)},Ld=(i,e)=>{if(jd(e))return i.version;switch(i.prerelease=[],e){case"major":i.minor=0,i.patch=0;break;case"minor":i.patch=0;break}return i.format()},jd=i=>i.startsWith("pre");ta.exports=Pd});var na=v((Mw,ra)=>{"use strict";var Rr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}};ra.exports=Rr});var le=v((Iw,ca)=>{"use strict";var Md=/\s+/g,$r=class i{constructor(e,t){if(t=Nd(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof kr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Md," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(n=>!oa(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Gd(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&Hd)|(this.options.loose&&Wd))+":"+e,n=sa.get(r);if(n)return n;let s=this.options.loose,o=s?Q[X.HYPHENRANGELOOSE]:Q[X.HYPHENRANGE];e=e.replace(o,ef(this.options.includePrerelease)),F("hyphen replace",e),e=e.replace(Q[X.COMPARATORTRIM],Ud),F("comparator trim",e),e=e.replace(Q[X.TILDETRIM],Dd),F("tilde trim",e),e=e.replace(Q[X.CARETTRIM],qd),F("caret trim",e);let a=e.split(" ").map(u=>Vd(u,this.options)).join(" ").split(/\s+/).map(u=>Zd(u,this.options));s&&(a=a.filter(u=>(F("loose invalid filter",u,this.options),!!u.match(Q[X.COMPARATORLOOSE])))),F("range list",a);let c=new Map,l=a.map(u=>new kr(u,this.options));for(let u of l){if(oa(u))return[u];c.set(u.value,u)}c.size>1&&c.has("")&&c.delete("");let p=[...c.values()];return sa.set(r,p),p}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>aa(r,t)&&e.set.some(n=>aa(n,t)&&r.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Fd(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(tf(this.set[t],e,this.options))return!0;return!1}};ca.exports=$r;var Id=na(),sa=new Id,Nd=Bt(),kr=ut(),F=lt(),Fd=J(),{safeRe:Q,t:X,comparatorTrimReplace:Ud,tildeTrimReplace:Dd,caretTrimReplace:qd}=Xe(),{FLAG_INCLUDE_PRERELEASE:Hd,FLAG_LOOSE:Wd}=Je(),oa=i=>i.value==="<0.0.0-0",Gd=i=>i.value==="",aa=(i,e)=>{let t=!0,r=i.slice(),n=r.pop();for(;t&&r.length;)t=r.every(s=>n.intersects(s,e)),n=r.pop();return t},Vd=(i,e)=>(i=i.replace(Q[X.BUILD],""),F("comp",i,e),i=Yd(i,e),F("caret",i),i=Bd(i,e),F("tildes",i),i=Xd(i,e),F("xrange",i),i=Qd(i,e),F("stars",i),i),Z=i=>!i||i.toLowerCase()==="x"||i==="*",Bd=(i,e)=>i.trim().split(/\s+/).map(t=>zd(t,e)).join(" "),zd=(i,e)=>{let t=e.loose?Q[X.TILDELOOSE]:Q[X.TILDE];return i.replace(t,(r,n,s,o,a)=>{F("tilde",i,r,n,s,o,a);let c;return Z(n)?c="":Z(s)?c=`>=${n}.0.0 <${+n+1}.0.0-0`:Z(o)?c=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(F("replaceTilde pr",a),c=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):c=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,F("tilde return",c),c})},Yd=(i,e)=>i.trim().split(/\s+/).map(t=>Jd(t,e)).join(" "),Jd=(i,e)=>{F("caret",i,e);let t=e.loose?Q[X.CARETLOOSE]:Q[X.CARET],r=e.includePrerelease?"-0":"";return i.replace(t,(n,s,o,a,c)=>{F("caret",i,n,s,o,a,c);let l;return Z(s)?l="":Z(o)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Z(a)?s==="0"?l=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:c?(F("replaceCaret pr",c),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`):(F("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${r} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),F("caret return",l),l})},Xd=(i,e)=>(F("replaceXRanges",i,e),i.split(/\s+/).map(t=>Kd(t,e)).join(" ")),Kd=(i,e)=>{i=i.trim();let t=e.loose?Q[X.XRANGELOOSE]:Q[X.XRANGE];return i.replace(t,(r,n,s,o,a,c)=>{F("xRange",i,r,n,s,o,a,c);let l=Z(s),p=l||Z(o),u=p||Z(a),f=u;return n==="="&&f&&(n=""),c=e.includePrerelease?"-0":"",l?n===">"||n==="<"?r="<0.0.0-0":r="*":n&&f?(p&&(o=0),a=0,n===">"?(n=">=",p?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",p?s=+s+1:o=+o+1),n==="<"&&(c="-0"),r=`${n+s}.${o}.${a}${c}`):p?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:u&&(r=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),F("xRange return",r),r})},Qd=(i,e)=>(F("replaceStars",i,e),i.trim().replace(Q[X.STAR],"")),Zd=(i,e)=>(F("replaceGTE0",i,e),i.trim().replace(Q[e.includePrerelease?X.GTE0PRE:X.GTE0],"")),ef=i=>(e,t,r,n,s,o,a,c,l,p,u,f)=>(Z(r)?t="":Z(n)?t=`>=${r}.0.0${i?"-0":""}`:Z(s)?t=`>=${r}.${n}.0${i?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${i?"-0":""}`,Z(l)?c="":Z(p)?c=`<${+l+1}.0.0-0`:Z(u)?c=`<${l}.${+p+1}.0-0`:f?c=`<=${l}.${p}.${u}-${f}`:i?c=`<${l}.${p}.${+u+1}-0`:c=`<=${c}`,`${t} ${c}`.trim()),tf=(i,e,t)=>{for(let r=0;r<i.length;r++)if(!i[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<i.length;r++)if(F(i[r].semver),i[r].semver!==kr.ANY&&i[r].semver.prerelease.length>0){let n=i[r].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var ut=v((Nw,fa)=>{"use strict";var mt=Symbol("SemVer ANY"),Cr=class i{static get ANY(){return mt}constructor(e,t){if(t=la(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===mt?this.value="":this.value=this.operator+this.semver.version,_r("comp",this)}parse(e){let t=this.options.loose?pa[ua.COMPARATORLOOSE]:pa[ua.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new ma(r[2],this.options.loose):this.semver=mt}toString(){return this.value}test(e){if(_r("Comparator.test",e,this.options.loose),this.semver===mt||e===mt)return!0;if(typeof e=="string")try{e=new ma(e,this.options)}catch{return!1}return Sr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new da(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new da(this.value,t).test(e.semver):(t=la(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Sr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Sr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};fa.exports=Cr;var la=Bt(),{safeRe:pa,t:ua}=Xe(),Sr=Er(),_r=lt(),ma=J(),da=le()});var dt=v((Fw,ha)=>{"use strict";var rf=le(),nf=(i,e,t)=>{try{e=new rf(e,t)}catch{return!1}return e.test(i)};ha.exports=nf});var xa=v((Uw,ga)=>{"use strict";var sf=le(),of=(i,e)=>new sf(i,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" "));ga.exports=of});var ba=v((Dw,va)=>{"use strict";var af=J(),cf=le(),lf=(i,e,t)=>{let r=null,n=null,s=null;try{s=new cf(e,t)}catch{return null}return i.forEach(o=>{s.test(o)&&(!r||n.compare(o)===-1)&&(r=o,n=new af(r,t))}),r};va.exports=lf});var wa=v((qw,ya)=>{"use strict";var pf=J(),uf=le(),mf=(i,e,t)=>{let r=null,n=null,s=null;try{s=new uf(e,t)}catch{return null}return i.forEach(o=>{s.test(o)&&(!r||n.compare(o)===1)&&(r=o,n=new pf(r,t))}),r};ya.exports=mf});var $a=v((Hw,Ra)=>{"use strict";var Tr=J(),df=le(),Ea=pt(),ff=(i,e)=>{i=new df(i,e);let t=new Tr("0.0.0");if(i.test(t)||(t=new Tr("0.0.0-0"),i.test(t)))return t;t=null;for(let r=0;r<i.set.length;++r){let n=i.set[r],s=null;n.forEach(o=>{let a=new Tr(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Ea(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Ea(t,s))&&(t=s)}return t&&i.test(t)?t:null};Ra.exports=ff});var Sa=v((Ww,ka)=>{"use strict";var hf=le(),gf=(i,e)=>{try{return new hf(i,e).range||"*"}catch{return null}};ka.exports=gf});var ri=v((Gw,Oa)=>{"use strict";var xf=J(),Ta=ut(),{ANY:vf}=Ta,bf=le(),yf=dt(),_a=pt(),Ca=Qt(),wf=ei(),Ef=Zt(),Rf=(i,e,t,r)=>{i=new xf(i,r),e=new bf(e,r);let n,s,o,a,c;switch(t){case">":n=_a,s=wf,o=Ca,a=">",c=">=";break;case"<":n=Ca,s=Ef,o=_a,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(yf(i,e,r))return!1;for(let l=0;l<e.set.length;++l){let p=e.set[l],u=null,f=null;if(p.forEach(d=>{d.semver===vf&&(d=new Ta(">=0.0.0")),u=u||d,f=f||d,n(d.semver,u.semver,r)?u=d:o(d.semver,f.semver,r)&&(f=d)}),u.operator===a||u.operator===c||(!f.operator||f.operator===a)&&s(i,f.semver))return!1;if(f.operator===c&&o(i,f.semver))return!1}return!0};Oa.exports=Rf});var Aa=v((Vw,Pa)=>{"use strict";var $f=ri(),kf=(i,e,t)=>$f(i,e,">",t);Pa.exports=kf});var ja=v((Bw,La)=>{"use strict";var Sf=ri(),_f=(i,e,t)=>Sf(i,e,"<",t);La.exports=_f});var Na=v((zw,Ia)=>{"use strict";var Ma=le(),Cf=(i,e,t)=>(i=new Ma(i,t),e=new Ma(e,t),i.intersects(e,t));Ia.exports=Cf});var Ua=v((Yw,Fa)=>{"use strict";var Tf=dt(),Of=ce();Fa.exports=(i,e,t)=>{let r=[],n=null,s=null,o=i.sort((p,u)=>Of(p,u,t));for(let p of o)Tf(p,e,t)?(s=p,n||(n=p)):(s&&r.push([n,s]),s=null,n=null);n&&r.push([n,null]);let a=[];for(let[p,u]of r)p===u?a.push(p):!u&&p===o[0]?a.push("*"):u?p===o[0]?a.push(`<=${u}`):a.push(`${p} - ${u}`):a.push(`>=${p}`);let c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Va=v((Jw,Ga)=>{"use strict";var Da=le(),Pr=ut(),{ANY:Or}=Pr,ft=dt(),Ar=ce(),Pf=(i,e,t={})=>{if(i===e)return!0;i=new Da(i,t),e=new Da(e,t);let r=!1;e:for(let n of i.set){for(let s of e.set){let o=Lf(n,s,t);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},Af=[new Pr(">=0.0.0-0")],qa=[new Pr(">=0.0.0")],Lf=(i,e,t)=>{if(i===e)return!0;if(i.length===1&&i[0].semver===Or){if(e.length===1&&e[0].semver===Or)return!0;t.includePrerelease?i=Af:i=qa}if(e.length===1&&e[0].semver===Or){if(t.includePrerelease)return!0;e=qa}let r=new Set,n,s;for(let d of i)d.operator===">"||d.operator===">="?n=Ha(n,d,t):d.operator==="<"||d.operator==="<="?s=Wa(s,d,t):r.add(d.semver);if(r.size>1)return null;let o;if(n&&s){if(o=Ar(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let d of r){if(n&&!ft(d,String(n),t)||s&&!ft(d,String(s),t))return null;for(let h of e)if(!ft(d,String(h),t))return!1;return!0}let a,c,l,p,u=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;u&&u.prerelease.length===1&&s.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(let d of e){if(p=p||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",n){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator===">"||d.operator===">="){if(a=Ha(n,d,t),a===d&&a!==n)return!1}else if(n.operator===">="&&!ft(n.semver,String(d),t))return!1}if(s){if(u&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===u.major&&d.semver.minor===u.minor&&d.semver.patch===u.patch&&(u=!1),d.operator==="<"||d.operator==="<="){if(c=Wa(s,d,t),c===d&&c!==s)return!1}else if(s.operator==="<="&&!ft(s.semver,String(d),t))return!1}if(!d.operator&&(s||n)&&o!==0)return!1}return!(n&&l&&!s&&o!==0||s&&p&&!n&&o!==0||f||u)},Ha=(i,e,t)=>{if(!i)return e;let r=Ar(i.semver,e.semver,t);return r>0?i:r<0||e.operator===">"&&i.operator===">="?e:i},Wa=(i,e,t)=>{if(!i)return e;let r=Ar(i.semver,e.semver,t);return r<0?i:r>0||e.operator==="<"&&i.operator==="<="?e:i};Ga.exports=Pf});var ni=v((Xw,Ya)=>{"use strict";var Lr=Xe(),Ba=Je(),jf=J(),za=xr(),Mf=_e(),If=xo(),Nf=bo(),Ff=Eo(),Uf=ko(),Df=_o(),qf=To(),Hf=Po(),Wf=Lo(),Gf=ce(),Vf=No(),Bf=Uo(),zf=Kt(),Yf=Wo(),Jf=Vo(),Xf=pt(),Kf=Qt(),Qf=yr(),Zf=wr(),eh=Zt(),th=ei(),ih=Er(),rh=ea(),nh=ia(),sh=ut(),oh=le(),ah=dt(),ch=xa(),lh=ba(),ph=wa(),uh=$a(),mh=Sa(),dh=ri(),fh=Aa(),hh=ja(),gh=Na(),xh=Ua(),vh=Va();Ya.exports={parse:Mf,valid:If,clean:Nf,inc:Ff,diff:Uf,major:Df,minor:qf,patch:Hf,prerelease:Wf,compare:Gf,rcompare:Vf,compareLoose:Bf,compareBuild:zf,sort:Yf,rsort:Jf,gt:Xf,lt:Kf,eq:Qf,neq:Zf,gte:eh,lte:th,cmp:ih,coerce:rh,truncate:nh,Comparator:sh,Range:oh,satisfies:ah,toComparators:ch,maxSatisfying:lh,minSatisfying:ph,minVersion:uh,validRange:mh,outside:dh,gtr:fh,ltr:hh,intersects:gh,simplifyRange:xh,subset:vh,SemVer:jf,re:Lr.re,src:Lr.src,tokens:Lr.t,SEMVER_SPEC_VERSION:Ba.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ba.RELEASE_TYPES,compareIdentifiers:za.compareIdentifiers,rcompareIdentifiers:za.rcompareIdentifiers}});var Xa=v((Kw,Ja)=>{var bh=ni();Ja.exports=bh.satisfies(process.version,">=15.7.0")});var Qa=v((Qw,Ka)=>{var yh=ni();Ka.exports=yh.satisfies(process.version,">=16.9.0")});var jr=v((Zw,Za)=>{var wh=Xa(),Eh=Qa(),Rh={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},$h={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Za.exports=function(i,e){if(!i||!e)return;let t=e.asymmetricKeyType;if(!t)return;let r=Rh[t];if(!r)throw new Error(`Unknown key type "${t}".`);if(!r.includes(i))throw new Error(`"alg" parameter for "${t}" key type must be one of: ${r.join(", ")}.`);if(wh)switch(t){case"ec":let n=e.asymmetricKeyDetails.namedCurve,s=$h[i];if(n!==s)throw new Error(`"alg" parameter "${i}" requires curve "${s}".`);break;case"rsa-pss":if(Eh){let o=parseInt(i.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:c,saltLength:l}=e.asymmetricKeyDetails;if(a!==`sha${o}`||c!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${i}.`);if(l!==void 0&&l>o>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${i}.`)}break}}});var Mr=v((eE,ec)=>{var kh=ni();ec.exports=kh.satisfies(process.version,"^6.12.0 || >=8.0.0")});var rc=v((tE,ic)=>{var N=ct(),Sh=mr(),tc=dr(),_h=ur(),Ch=fr(),Th=jr(),Oh=Mr(),Ph=qt(),{KeyObject:Ah,createSecretKey:Lh,createPublicKey:jh}=require("crypto"),Ir=["RS256","RS384","RS512"],Mh=["ES256","ES384","ES512"],Nr=["RS256","RS384","RS512"],Ih=["HS256","HS384","HS512"];Oh&&(Ir.splice(Ir.length,0,"PS256","PS384","PS512"),Nr.splice(Nr.length,0,"PS256","PS384","PS512"));ic.exports=function(i,e,t,r){typeof t=="function"&&!r&&(r=t,t={}),t||(t={}),t=Object.assign({},t);let n;if(r?n=r:n=function(p,u){if(p)throw p;return u},t.clockTimestamp&&typeof t.clockTimestamp!="number")return n(new N("clockTimestamp must be a number"));if(t.nonce!==void 0&&(typeof t.nonce!="string"||t.nonce.trim()===""))return n(new N("nonce must be a non-empty string"));if(t.allowInvalidAsymmetricKeyTypes!==void 0&&typeof t.allowInvalidAsymmetricKeyTypes!="boolean")return n(new N("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!i)return n(new N("jwt must be provided"));if(typeof i!="string")return n(new N("jwt must be a string"));let o=i.split(".");if(o.length!==3)return n(new N("jwt malformed"));let a;try{a=_h(i,{complete:!0})}catch(p){return n(p)}if(!a)return n(new N("invalid token"));let c=a.header,l;if(typeof e=="function"){if(!r)return n(new N("verify must be called asynchronous if secret or public key is provided as a callback"));l=e}else l=function(p,u){return u(null,e)};return l(c,function(p,u){if(p)return n(new N("error in secret or public key callback: "+p.message));let f=o[2].trim()!=="";if(!f&&u)return n(new N("jwt signature is required"));if(f&&!u)return n(new N("secret or public key must be provided"));if(!f&&!t.algorithms)return n(new N('please specify "none" in "algorithms" to verify unsigned tokens'));if(u!=null&&!(u instanceof Ah))try{u=jh(u)}catch{try{u=Lh(typeof u=="string"?Buffer.from(u):u)}catch{return n(new N("secretOrPublicKey is not valid key material"))}}if(t.algorithms||(u.type==="secret"?t.algorithms=Ih:["rsa","rsa-pss"].includes(u.asymmetricKeyType)?t.algorithms=Nr:u.asymmetricKeyType==="ec"?t.algorithms=Mh:t.algorithms=Ir),t.algorithms.indexOf(a.header.alg)===-1)return n(new N("invalid algorithm"));if(c.alg.startsWith("HS")&&u.type!=="secret")return n(new N(`secretOrPublicKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)&&u.type!=="public")return n(new N(`secretOrPublicKey must be an asymmetric key when using ${c.alg}`));if(!t.allowInvalidAsymmetricKeyTypes)try{Th(c.alg,u)}catch(b){return n(b)}let d;try{d=Ph.verify(i,a.header.alg,u)}catch(b){return n(b)}if(!d)return n(new N("invalid signature"));let h=a.payload;if(typeof h.nbf<"u"&&!t.ignoreNotBefore){if(typeof h.nbf!="number")return n(new N("invalid nbf value"));if(h.nbf>s+(t.clockTolerance||0))return n(new Sh("jwt not active",new Date(h.nbf*1e3)))}if(typeof h.exp<"u"&&!t.ignoreExpiration){if(typeof h.exp!="number")return n(new N("invalid exp value"));if(s>=h.exp+(t.clockTolerance||0))return n(new tc("jwt expired",new Date(h.exp*1e3)))}if(t.audience){let b=Array.isArray(t.audience)?t.audience:[t.audience];if(!(Array.isArray(h.aud)?h.aud:[h.aud]).some(function(E){return b.some(function($){return $ instanceof RegExp?$.test(E):$===E})}))return n(new N("jwt audience invalid. expected: "+b.join(" or ")))}if(t.issuer&&(typeof t.issuer=="string"&&h.iss!==t.issuer||Array.isArray(t.issuer)&&t.issuer.indexOf(h.iss)===-1))return n(new N("jwt issuer invalid. expected: "+t.issuer));if(t.subject&&h.sub!==t.subject)return n(new N("jwt subject invalid. expected: "+t.subject));if(t.jwtid&&h.jti!==t.jwtid)return n(new N("jwt jwtid invalid. expected: "+t.jwtid));if(t.nonce&&h.nonce!==t.nonce)return n(new N("jwt nonce invalid. expected: "+t.nonce));if(t.maxAge){if(typeof h.iat!="number")return n(new N("iat required when maxAge is specified"));let b=Ch(t.maxAge,h.iat);if(typeof b>"u")return n(new N('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=b+(t.clockTolerance||0))return n(new tc("maxAge exceeded",new Date(b*1e3)))}if(t.complete===!0){let b=a.signature;return n(null,{header:c,payload:h,signature:b})}return n(null,h)})}});var lc=v((iE,cc)=>{var nc=1/0,oc=9007199254740991,Nh=17976931348623157e292,sc=NaN,Fh="[object Arguments]",Uh="[object Function]",Dh="[object GeneratorFunction]",qh="[object String]",Hh="[object Symbol]",Wh=/^\s+|\s+$/g,Gh=/^[-+]0x[0-9a-f]+$/i,Vh=/^0b[01]+$/i,Bh=/^0o[0-7]+$/i,zh=/^(?:0|[1-9]\d*)$/,Yh=parseInt;function Jh(i,e){for(var t=-1,r=i?i.length:0,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n}function Xh(i,e,t,r){for(var n=i.length,s=t+(r?1:-1);r?s--:++s<n;)if(e(i[s],s,i))return s;return-1}function Kh(i,e,t){if(e!==e)return Xh(i,Qh,t);for(var r=t-1,n=i.length;++r<n;)if(i[r]===e)return r;return-1}function Qh(i){return i!==i}function Zh(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r}function eg(i,e){return Jh(e,function(t){return i[t]})}function tg(i,e){return function(t){return i(e(t))}}var si=Object.prototype,Ur=si.hasOwnProperty,oi=si.toString,ig=si.propertyIsEnumerable,rg=tg(Object.keys,Object),ng=Math.max;function sg(i,e){var t=ac(i)||pg(i)?Zh(i.length,String):[],r=t.length,n=!!r;for(var s in i)(e||Ur.call(i,s))&&!(n&&(s=="length"||ag(s,r)))&&t.push(s);return t}function og(i){if(!cg(i))return rg(i);var e=[];for(var t in Object(i))Ur.call(i,t)&&t!="constructor"&&e.push(t);return e}function ag(i,e){return e=e??oc,!!e&&(typeof i=="number"||zh.test(i))&&i>-1&&i%1==0&&i<e}function cg(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||si;return i===t}function lg(i,e,t,r){i=Dr(i)?i:yg(i),t=t&&!r?xg(t):0;var n=i.length;return t<0&&(t=ng(n+t,0)),fg(i)?t<=n&&i.indexOf(e,t)>-1:!!n&&Kh(i,e,t)>-1}function pg(i){return ug(i)&&Ur.call(i,"callee")&&(!ig.call(i,"callee")||oi.call(i)==Fh)}var ac=Array.isArray;function Dr(i){return i!=null&&dg(i.length)&&!mg(i)}function ug(i){return qr(i)&&Dr(i)}function mg(i){var e=Fr(i)?oi.call(i):"";return e==Uh||e==Dh}function dg(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=oc}function Fr(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function qr(i){return!!i&&typeof i=="object"}function fg(i){return typeof i=="string"||!ac(i)&&qr(i)&&oi.call(i)==qh}function hg(i){return typeof i=="symbol"||qr(i)&&oi.call(i)==Hh}function gg(i){if(!i)return i===0?i:0;if(i=vg(i),i===nc||i===-nc){var e=i<0?-1:1;return e*Nh}return i===i?i:0}function xg(i){var e=gg(i),t=e%1;return e===e?t?e-t:e:0}function vg(i){if(typeof i=="number")return i;if(hg(i))return sc;if(Fr(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Fr(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Wh,"");var t=Vh.test(i);return t||Bh.test(i)?Yh(i.slice(2),t?2:8):Gh.test(i)?sc:+i}function bg(i){return Dr(i)?sg(i):og(i)}function yg(i){return i?eg(i,bg(i)):[]}cc.exports=lg});var uc=v((rE,pc)=>{var wg="[object Boolean]",Eg=Object.prototype,Rg=Eg.toString;function $g(i){return i===!0||i===!1||kg(i)&&Rg.call(i)==wg}function kg(i){return!!i&&typeof i=="object"}pc.exports=$g});var gc=v((nE,hc)=>{var mc=1/0,Sg=17976931348623157e292,dc=NaN,_g="[object Symbol]",Cg=/^\s+|\s+$/g,Tg=/^[-+]0x[0-9a-f]+$/i,Og=/^0b[01]+$/i,Pg=/^0o[0-7]+$/i,Ag=parseInt,Lg=Object.prototype,jg=Lg.toString;function Mg(i){return typeof i=="number"&&i==Ug(i)}function fc(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function Ig(i){return!!i&&typeof i=="object"}function Ng(i){return typeof i=="symbol"||Ig(i)&&jg.call(i)==_g}function Fg(i){if(!i)return i===0?i:0;if(i=Dg(i),i===mc||i===-mc){var e=i<0?-1:1;return e*Sg}return i===i?i:0}function Ug(i){var e=Fg(i),t=e%1;return e===e?t?e-t:e:0}function Dg(i){if(typeof i=="number")return i;if(Ng(i))return dc;if(fc(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=fc(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Cg,"");var t=Og.test(i);return t||Pg.test(i)?Ag(i.slice(2),t?2:8):Tg.test(i)?dc:+i}hc.exports=Mg});var vc=v((sE,xc)=>{var qg="[object Number]",Hg=Object.prototype,Wg=Hg.toString;function Gg(i){return!!i&&typeof i=="object"}function Vg(i){return typeof i=="number"||Gg(i)&&Wg.call(i)==qg}xc.exports=Vg});var Ec=v((oE,wc)=>{var Bg="[object Object]";function zg(i){var e=!1;if(i!=null&&typeof i.toString!="function")try{e=!!(i+"")}catch{}return e}function Yg(i,e){return function(t){return i(e(t))}}var Jg=Function.prototype,bc=Object.prototype,yc=Jg.toString,Xg=bc.hasOwnProperty,Kg=yc.call(Object),Qg=bc.toString,Zg=Yg(Object.getPrototypeOf,Object);function ex(i){return!!i&&typeof i=="object"}function tx(i){if(!ex(i)||Qg.call(i)!=Bg||zg(i))return!1;var e=Zg(i);if(e===null)return!0;var t=Xg.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&yc.call(t)==Kg}wc.exports=tx});var $c=v((aE,Rc)=>{var ix="[object String]",rx=Object.prototype,nx=rx.toString,sx=Array.isArray;function ox(i){return!!i&&typeof i=="object"}function ax(i){return typeof i=="string"||!sx(i)&&ox(i)&&nx.call(i)==ix}Rc.exports=ax});var Tc=v((cE,Cc)=>{var cx="Expected a function",kc=1/0,lx=17976931348623157e292,Sc=NaN,px="[object Symbol]",ux=/^\s+|\s+$/g,mx=/^[-+]0x[0-9a-f]+$/i,dx=/^0b[01]+$/i,fx=/^0o[0-7]+$/i,hx=parseInt,gx=Object.prototype,xx=gx.toString;function vx(i,e){var t;if(typeof e!="function")throw new TypeError(cx);return i=Rx(i),function(){return--i>0&&(t=e.apply(this,arguments)),i<=1&&(e=void 0),t}}function bx(i){return vx(2,i)}function _c(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function yx(i){return!!i&&typeof i=="object"}function wx(i){return typeof i=="symbol"||yx(i)&&xx.call(i)==px}function Ex(i){if(!i)return i===0?i:0;if(i=$x(i),i===kc||i===-kc){var e=i<0?-1:1;return e*lx}return i===i?i:0}function Rx(i){var e=Ex(i),t=e%1;return e===e?t?e-t:e:0}function $x(i){if(typeof i=="number")return i;if(wx(i))return Sc;if(_c(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=_c(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(ux,"");var t=dx.test(i);return t||fx.test(i)?hx(i.slice(2),t?2:8):mx.test(i)?Sc:+i}Cc.exports=bx});var Fc=v((lE,Nc)=>{var Oc=fr(),kx=Mr(),Sx=jr(),Pc=qt(),_x=lc(),ai=uc(),Ac=gc(),Hr=vc(),jc=Ec(),Ce=$c(),Cx=Tc(),{KeyObject:Tx,createSecretKey:Ox,createPrivateKey:Px}=require("crypto"),Mc=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];kx&&Mc.splice(3,0,"PS256","PS384","PS512");var Ax={expiresIn:{isValid:function(i){return Ac(i)||Ce(i)&&i},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(i){return Ac(i)||Ce(i)&&i},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(i){return Ce(i)||Array.isArray(i)},message:'"audience" must be a string or array'},algorithm:{isValid:_x.bind(null,Mc),message:'"algorithm" must be a valid string enum value'},header:{isValid:jc,message:'"header" must be an object'},encoding:{isValid:Ce,message:'"encoding" must be a string'},issuer:{isValid:Ce,message:'"issuer" must be a string'},subject:{isValid:Ce,message:'"subject" must be a string'},jwtid:{isValid:Ce,message:'"jwtid" must be a string'},noTimestamp:{isValid:ai,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Ce,message:'"keyid" must be a string'},mutatePayload:{isValid:ai,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:ai,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:ai,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Lx={iat:{isValid:Hr,message:'"iat" should be a number of seconds'},exp:{isValid:Hr,message:'"exp" should be a number of seconds'},nbf:{isValid:Hr,message:'"nbf" should be a number of seconds'}};function Ic(i,e,t,r){if(!jc(t))throw new Error('Expected "'+r+'" to be a plain object.');Object.keys(t).forEach(function(n){let s=i[n];if(!s){if(!e)throw new Error('"'+n+'" is not allowed in "'+r+'"');return}if(!s.isValid(t[n]))throw new Error(s.message)})}function jx(i){return Ic(Ax,!1,i,"options")}function Mx(i){return Ic(Lx,!0,i,"payload")}var Lc={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Ix=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Nc.exports=function(i,e,t,r){typeof t=="function"?(r=t,t={}):t=t||{};let n=typeof i=="object"&&!Buffer.isBuffer(i),s=Object.assign({alg:t.algorithm||"HS256",typ:n?"JWT":void 0,kid:t.keyid},t.header);function o(l){if(r)return r(l);throw l}if(!e&&t.algorithm!=="none")return o(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof Tx))try{e=Px(e)}catch{try{e=Ox(typeof e=="string"?Buffer.from(e):e)}catch{return o(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return o(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return o(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!t.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return o(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof i>"u")return o(new Error("payload is required"));if(n){try{Mx(i)}catch(l){return o(l)}t.mutatePayload||(i=Object.assign({},i))}else{let l=Ix.filter(function(p){return typeof t[p]<"u"});if(l.length>0)return o(new Error("invalid "+l.join(",")+" option for "+typeof i+" payload"))}if(typeof i.exp<"u"&&typeof t.expiresIn<"u")return o(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof i.nbf<"u"&&typeof t.notBefore<"u")return o(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{jx(t)}catch(l){return o(l)}if(!t.allowInvalidAsymmetricKeyTypes)try{Sx(s.alg,e)}catch(l){return o(l)}let a=i.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp?delete i.iat:n&&(i.iat=a),typeof t.notBefore<"u"){try{i.nbf=Oc(t.notBefore,a)}catch(l){return o(l)}if(typeof i.nbf>"u")return o(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof t.expiresIn<"u"&&typeof i=="object"){try{i.exp=Oc(t.expiresIn,a)}catch(l){return o(l)}if(typeof i.exp>"u")return o(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Lc).forEach(function(l){let p=Lc[l];if(typeof t[l]<"u"){if(typeof i[p]<"u")return o(new Error('Bad "options.'+l+'" option. The payload already has an "'+p+'" property.'));i[p]=t[l]}});let c=t.encoding||"utf8";if(typeof r=="function")r=r&&Cx(r),Pc.createSign({header:s,privateKey:e,payload:i,encoding:c}).once("error",r).once("done",function(l){if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&l.length<256)return r(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));r(null,l)});else{let l=Pc.sign({header:s,payload:i,secret:e,encoding:c});if(!t.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&l.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return l}}});var Wr=v((pE,Uc)=>{Uc.exports={decode:ur(),verify:rc(),sign:Fc(),JsonWebTokenError:ct(),NotBeforeError:mr(),TokenExpiredError:dr()}});var tl=v((NE,uv)=>{uv.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var rl=v((FE,il)=>{il.exports=tl()});var ol=v(ne=>{"use strict";var hi=rl(),mv=require("path").extname,nl=/^\s*([^;\s]*)(?:;|\s|$)/,dv=/^text\//i;ne.charset=sl;ne.charsets={lookup:sl};ne.contentType=fv;ne.extension=hv;ne.extensions=Object.create(null);ne.lookup=gv;ne.types=Object.create(null);xv(ne.extensions,ne.types);function sl(i){if(!i||typeof i!="string")return!1;var e=nl.exec(i),t=e&&hi[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&dv.test(e[1])?"UTF-8":!1}function fv(i){if(!i||typeof i!="string")return!1;var e=i.indexOf("/")===-1?ne.lookup(i):i;if(!e)return!1;if(e.indexOf("charset")===-1){var t=ne.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function hv(i){if(!i||typeof i!="string")return!1;var e=nl.exec(i),t=e&&ne.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function gv(i){if(!i||typeof i!="string")return!1;var e=mv("x."+i).toLowerCase().substr(1);return e&&ne.types[e]||!1}function xv(i,e){var t=["nginx","apache",void 0,"iana"];Object.keys(hi).forEach(function(n){var s=hi[n],o=s.extensions;if(!(!o||!o.length)){i[n]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(hi[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(l>p||l===p&&e[c].substr(0,12)==="application/"))continue}e[c]=n}}})}});var jl=v((zR,Ll)=>{function Sl(i){return Array.isArray(i)?i:[i]}var pn="",_l=" ",cn="\\",Xv=/^\s+$/,Kv=/(?:[^\\]|^)\\$/,Qv=/^\\!/,Zv=/^\\#/,eb=/\r?\n/g,tb=/^\.*\/|^\.+$/,ln="/",Ol="node-ignore";typeof Symbol<"u"&&(Ol=Symbol.for("node-ignore"));var Cl=Ol,ib=(i,e,t)=>Object.defineProperty(i,e,{value:t}),rb=/([0-z])-([0-z])/g,Pl=()=>!1,nb=i=>i.replace(rb,(e,t,r)=>t.charCodeAt(0)<=r.charCodeAt(0)?e:pn),sb=i=>{let{length:e}=i;return i.slice(0,e-e%2)},ob=[[/^\uFEFF/,()=>pn],[/((?:\\\\)*?)(\\?\s+)$/,(i,e,t)=>e+(t.indexOf("\\")===0?_l:pn)],[/(\\+?)\s/g,(i,e)=>{let{length:t}=e;return e.slice(0,t-t%2)+_l}],[/[\\$.|*+(){^]/g,i=>`\\${i}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(i,e,t)=>e+6<t.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(i,e,t)=>{let r=t.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>cn],[/\\\\/g,()=>cn],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(i,e,t,r,n)=>e===cn?`\\[${t}${sb(r)}${n}`:n==="]"&&r.length%2===0?`[${nb(t)}${r}]`:"[]"],[/(?:[^*])$/,i=>/\/$/.test(i)?`${i}$`:`${i}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(i,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],Tl=Object.create(null),ab=(i,e)=>{let t=Tl[i];return t||(t=ob.reduce((r,[n,s])=>r.replace(n,s.bind(i)),i),Tl[i]=t),e?new RegExp(t,"i"):new RegExp(t)},dn=i=>typeof i=="string",cb=i=>i&&dn(i)&&!Xv.test(i)&&!Kv.test(i)&&i.indexOf("#")!==0,lb=i=>i.split(eb),un=class{constructor(e,t,r,n){this.origin=e,this.pattern=t,this.negative=r,this.regex=n}},pb=(i,e)=>{let t=i,r=!1;i.indexOf("!")===0&&(r=!0,i=i.substr(1)),i=i.replace(Qv,"!").replace(Zv,"#");let n=ab(i,e);return new un(t,i,r,n)},ub=(i,e)=>{throw new e(i)},ke=(i,e,t)=>dn(i)?i?ke.isNotRelative(i)?t(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:t("path must not be empty",TypeError):t(`path must be a string, but got \`${e}\``,TypeError),Al=i=>tb.test(i);ke.isNotRelative=Al;ke.convert=i=>i;var mn=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:r=!1}={}){ib(this,Cl,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[Cl]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(cb(e)){let t=pb(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,Sl(dn(e)?lb(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let r=!1,n=!1;return this._rules.forEach(s=>{let{negative:o}=s;if(n===o&&r!==n||o&&!r&&!n&&!t)return;s.regex.test(e)&&(r=!o,n=o)}),{ignored:r,unignored:n}}_test(e,t,r,n){let s=e&&ke.convert(e);return ke(s,e,this._allowRelativePaths?Pl:ub),this._t(s,t,r,n)}_t(e,t,r,n){if(e in t)return t[e];if(n||(n=e.split(ln)),n.pop(),!n.length)return t[e]=this._testOne(e,r);let s=this._t(n.join(ln)+ln,t,r,n);return t[e]=s.ignored?s:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Sl(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Ei=i=>new mn(i),mb=i=>ke(i&&ke.convert(i),i,Pl);Ei.isPathValid=mb;Ei.default=Ei;Ll.exports=Ei;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let i=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");ke.convert=i;let e=/^[a-z]:\//i;ke.isNotRelative=t=>e.test(t)||Al(t)}});(function(){Bn().config(Object.assign({},Yn(),Xn()(process.argv)))})();var Up=require("fs"),Dp=require("path");var Np=P(Pt());var de=P(require("fs")),Xr=P(require("path")),Vc=P(require("os")),Bc=P(Wr());var Nx=process.stdout.isTTY===!0&&!process.env.NO_COLOR,Te=i=>Nx?i:"",R=Te("\x1B[32m"),L=Te("\x1B[33m"),_=Te("\x1B[36m"),pe=Te("\x1B[35m"),g=Te("\x1B[31m"),x=Te("\x1B[2m"),ie=Te("\x1B[1m"),m=Te("\x1B[0m");var Dc="app.boxel.realms";var Fx={"anthropic/claude-3.5-sonnet":"Anthropic: Claude 3.5 Sonnet","anthropic/claude-3.7-sonnet":"Anthropic: Claude 3.7 Sonnet","anthropic/claude-3.7-sonnet:thinking":"Anthropic: Claude 3.7 Sonnet (thinking)","anthropic/claude-haiku-4.5":"Anthropic: Claude Haiku 4.5","anthropic/claude-sonnet-4":"Anthropic: Claude Sonnet 4","anthropic/claude-sonnet-4.5":"Anthropic: Claude Sonnet 4.5","anthropic/claude-sonnet-4.6":"Anthropic: Claude Sonnet 4.6","anthropic/claude-opus-4.1":"Anthropic: Claude Opus 4.1","deepseek/deepseek-chat-v3-0324":"DeepSeek: DeepSeek V3 0324","google/gemini-2.5-pro":"Google: Gemini 2.5 Pro","google/gemini-2.5-flash-lite":"Google: Gemini 2.5 Flash Lite","google/gemini-2.5-flash":"Google: Gemini 2.5 Flash","meta-llama/llama-3.2-3b-instruct":"Meta: Llama 3.2 3B Instruct","openai/gpt-4.1-nano":"OpenAI: GPT-4.1 Nano","openai/gpt-4.1-mini":"OpenAI: GPT-4.1 Mini","openai/gpt-4.1":"OpenAI: GPT-4.1","openai/gpt-4o":"OpenAI: GPT-4o","openai/gpt-4o-mini":"OpenAI: GPT-4o-mini","openai/gpt-5-nano":"OpenAI: GPT-5 Nano","openai/gpt-5-mini":"OpenAI: GPT-5 Mini","openai/gpt-5":"OpenAI: GPT-5","openai/gpt-oss-20b":"OpenAI: GPT OSS 20B"},mE=Object.keys(Fx);function k(i){return i.endsWith("/")?i:`${i}/`}var $e=class extends Error{status;constructor(e,t){super(t),this.name="MatrixAuthError",this.status=e}};async function qc(i,e,t){let r=await fetch(new URL("_matrix/client/v3/login",i).href,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({identifier:{type:"m.id.user",user:e},password:t,type:"m.login.password"})}),n=await r.json();if(!r.ok)throw new Error(`Matrix login failed: ${r.status} ${JSON.stringify(n)}`);return{accessToken:n.access_token,deviceId:n.device_id,userId:n.user_id,matrixUrl:i}}async function Ux(i){let e=await fetch(new URL(`_matrix/client/v3/user/${encodeURIComponent(i.userId)}/openid/request_token`,i.matrixUrl).href,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.accessToken}`},body:"{}"});if(!e.ok){let t=await e.text();throw e.status===401||e.status===403?new $e(e.status,`OpenID token request failed: ${e.status} ${t}`):new Error(`OpenID token request failed: ${e.status} ${t}`)}return await e.json()}async function Gr(i,e){let t=await Ux(i),r=`${e.replace(/\/$/,"")}/_server-session`,n=await fetch(r,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let o=await n.text();throw new Error(`Realm server session failed: ${n.status} ${o}`)}let s=n.headers.get("Authorization");if(!s)throw new Error("Realm server session response did not include an Authorization header");return s}async function Vr(i,e){let t=`${i.replace(/\/$/,"")}/_realm-auth`,r=await fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:e}});if(!r.ok){let n=await r.text();throw new Error(`Realm auth lookup failed: ${r.status} ${n}`)}return await r.json()}function Br(i){return new URL(`_matrix/client/v3/user/${encodeURIComponent(i.userId)}/account_data/${Dc}`,i.matrixUrl).href}async function ci(i){let e;try{e=await fetch(Br(i),{headers:{Authorization:`Bearer ${i.accessToken}`}})}catch{return[]}if(e.status===401||e.status===403){let t=await e.text();throw new $e(e.status,`Matrix account_data fetch failed: ${e.status} ${t}`)}if(!e.ok)return[];try{let t=await e.json();return Array.isArray(t.realms)?[...t.realms]:[]}catch{return[]}}async function Hc(i,e){let t=await ci(i);if(!t.includes(e)){t.push(e);let r=await fetch(Br(i),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.accessToken}`},body:JSON.stringify({realms:t})});if(!r.ok){let n=await r.text();throw r.status===401||r.status===403?new $e(r.status,`Failed to update Matrix account data: ${r.status} ${n}`):new Error(`Failed to update Matrix account data: ${r.status} ${n}`)}}}async function Wc(i,e){let t=k(e),r=await ci(i),n=r.filter(o=>k(o)!==t);if(n.length===r.length)return!1;let s=await fetch(Br(i),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.accessToken}`},body:JSON.stringify({realms:n})});if(!s.ok){let o=await s.text();throw s.status===401||s.status===403?new $e(s.status,`Failed to update Matrix account data: ${s.status} ${o}`):new Error(`Failed to update Matrix account data: ${s.status} ${o}`)}return!0}var zr=P(require("readline")),Gc=require("stream");function re(i){let e=zr.createInterface({input:process.stdin,output:process.stdout});return new Promise(t=>{e.question(i,r=>{e.close(),t(r.trim())})})}function ht(i){let e=new Gc.Writable({write:(r,n,s)=>s()}),t=zr.createInterface({input:process.stdin,output:e,terminal:!0});return new Promise((r,n)=>{let s=process.stdin,o=s.readableFlowing;s.isTTY&&s.setRawMode(!0);let a=()=>{s.removeListener("data",c),s.isTTY&&s.setRawMode(!1),t.close(),o||s.pause()},c=p=>{try{let u=p.toString().split("\x1B[200~").join("").split("\x1B[201~").join("");for(let f of u)if(f===`
32
+ `||f==="\r"){a(),process.stdout.write(`
33
+ `),r(l);return}else f===""?(a(),process.exit()):f==="\x7F"||f==="\b"?l.length>0&&(l=l.slice(0,-1),process.stdout.write("\b \b")):f>=" "&&(l+=f,process.stdout.write("*"))}catch(u){a(),n(u)}},l="";try{process.stdout.write(i),s.on("data",c),s.resume()}catch(p){a(),n(p)}})}async function ve(i){let e=process.env.BOXEL_REALM_SECRET_SEED;if(e)return e;if(i){if(!process.stdin.isTTY)throw new Error("Cannot prompt for realm secret seed: stdin is not a TTY. Set BOXEL_REALM_SECRET_SEED in the environment instead.");return ht("Realm secret seed: ")}}var Dx=Xr.join(Vc.homedir(),".boxel-cli"),qx="profiles.json",Hx=86400;function Wx(i,e=Hx){let t=i.replace(/^Bearer\s+/i,""),r=Bc.default.decode(t);if(!r?.exp)return!0;let n=Math.floor(Date.now()/1e3);return r.exp-n<e}var A="No active profile. Run `boxel profile add` to create one.";function li(i){return i.endsWith(":stack.cards")?"staging":i.endsWith(":boxel.ai")?"production":i.endsWith(":localhost")?"local":"unknown"}function gt(i){let e=i.match(/^@([^:]+):/);return e?e[1]:i}function pi(i){let e=i.match(/:([^:]+)$/);return e?e[1]:"unknown"}function fe(i){let e=gt(i),t=pi(i);return`${x}[${m}${_}${e}${m} ${x}\xB7${m} ${pe}${t}${m}${x}]${m}`}var Jr=class{config;configDir;profilesFile;matrixLoginFn;promptPasswordFn;isTtyFn;constructor(e,t){this.configDir=e||Dx,this.profilesFile=Xr.join(this.configDir,qx),this.config=this.loadConfig(),this.matrixLoginFn=t?.matrixLogin??qc,this.promptPasswordFn=t?.promptPassword??ht,this.isTtyFn=t?.isTty??(()=>!!process.stdin.isTTY)}ensureConfigDir(){de.existsSync(this.configDir)||de.mkdirSync(this.configDir,{recursive:!0})}loadConfig(){let e={profiles:{},activeProfile:null};if(de.existsSync(this.profilesFile))try{let t=de.readFileSync(this.profilesFile,"utf-8"),r=JSON.parse(t);if(r&&typeof r=="object"&&!Array.isArray(r)){let n=r,s=n.profiles&&typeof n.profiles=="object"&&!Array.isArray(n.profiles)?n.profiles:null,o=n.activeProfile===null||typeof n.activeProfile=="string"?n.activeProfile:null;if(s)return{profiles:s,activeProfile:o}}}catch{}return e}saveConfig(){this.ensureConfigDir(),de.writeFileSync(this.profilesFile,JSON.stringify(this.config,null,2),{mode:384});try{de.chmodSync(this.profilesFile,384)}catch{}}listProfiles(){return Object.keys(this.config.profiles)}getProfile(e){return this.config.profiles[e]}getActiveProfileId(){return this.config.activeProfile}getActiveProfile(){let e=this.config.activeProfile;if(!e)return null;let t=this.config.profiles[e];return t?{id:e,profile:t}:null}resolveProfileSlots(e,t,r,n){let s=li(e),o=gt(e);if(s==="unknown"&&(!r||!n))throw new Error(`Unknown domain in Matrix ID "${e}". You must provide explicit --matrix-url and --realm-server-url for non-standard domains.`);let a,c;s==="production"?(a="https://matrix.boxel.ai",c="https://app.boxel.ai/"):s==="local"?(a="http://localhost:8008",c="http://localhost:4201/"):(a="https://matrix-staging.stack.cards",c="https://realms-staging.stack.cards/");let l=pi(e);return{matrixUrl:r||a,realmServerUrl:n||c,displayName:t||`${o} \xB7 ${l}`,username:o}}async addProfileWithAuth(e,t,r,n){let s=this.resolveProfileSlots(e,r,t.matrixUrl,n),o=this.config.profiles[e],a=!!o&&(o.matrixUrl!==s.matrixUrl||o.realmServerUrl!==s.realmServerUrl),c={displayName:s.displayName,matrixUrl:s.matrixUrl,realmServerUrl:s.realmServerUrl,matrixAccessToken:t.accessToken,matrixUserId:t.userId,matrixDeviceId:t.deviceId,realmTokens:a?void 0:o?.realmTokens,realmServerToken:a?void 0:o?.realmServerToken};this.config.profiles[e]=c,this.config.activeProfile||(this.config.activeProfile=e),this.saveConfig()}async addProfile(e,t,r,n,s){let o=this.config.profiles[e],a=this.resolveProfileSlots(e,r??o?.displayName,n??o?.matrixUrl,s??o?.realmServerUrl),c=await this.matrixLoginFn(a.matrixUrl,a.username,t);if(c.userId!==e)throw new Error(`Matrix returned userId "${c.userId}" but profile was added as "${e}". Check the Matrix ID and try again.`);await this.addProfileWithAuth(e,c,a.displayName,a.realmServerUrl)}async removeProfile(e){if(!this.config.profiles[e])return!1;if(delete this.config.profiles[e],this.config.activeProfile===e){let t=Object.keys(this.config.profiles);this.config.activeProfile=t.length>0?t[0]:null}return this.saveConfig(),!0}switchProfile(e){return this.config.profiles[e]?(this.config.activeProfile=e,this.saveConfig(),!0):!1}updateDisplayName(e,t){return this.config.profiles[e]?(this.config.profiles[e].displayName=t,this.saveConfig(),!0):!1}updateUrls(e,t){let r=this.config.profiles[e];if(!r)return!1;let n=!1;return t.matrixUrl&&t.matrixUrl!==r.matrixUrl&&(r.matrixUrl=t.matrixUrl,n=!0),t.realmServerUrl&&t.realmServerUrl!==r.realmServerUrl&&(r.realmServerUrl=t.realmServerUrl,n=!0),n&&(r.realmTokens=void 0,r.realmServerToken=void 0,this.saveConfig()),n}setRealmToken(e,t){let r=this.getActiveProfile();r&&(r.profile.realmTokens||(r.profile.realmTokens={}),r.profile.realmTokens[e]=t,this.saveConfig())}getRealmToken(e){return this.getActiveProfile()?.profile.realmTokens?.[e]}setRealmServerToken(e){let t=this.getActiveProfile();t&&(t.profile.realmServerToken=e,this.saveConfig())}getRealmServerToken(){return this.getActiveProfile()?.profile.realmServerToken}getStoredMatrixAuth(e){let t=e??this.config.activeProfile??void 0,r=t?this.config.profiles[t]:void 0;if(!t||!r)throw new Error(A);if(!r.matrixAccessToken)throw new Error(`Profile "${t}" has no stored Matrix access token. Run \`boxel profile add\` to re-authenticate.`);return{accessToken:r.matrixAccessToken,userId:r.matrixUserId,deviceId:r.matrixDeviceId,matrixUrl:r.matrixUrl}}async reAuthenticate(e){let t=e??this.config.activeProfile??void 0,r=t?this.config.profiles[t]:void 0;if(!t||!r)throw new Error(A);if(!this.isTtyFn())throw new Error(`Stored Matrix token for "${t}" is no longer valid. Run \`boxel profile add -u ${t} -p <password>\` to re-authenticate.`);console.log(`
34
+ ${L}Stored Matrix session for ${fe(t)} has expired.${m}`);let n=await this.promptPasswordFn(`Password for ${t}: `);if(!n)throw new Error("Re-authentication cancelled: password is required.");let s=gt(t),o=await this.matrixLoginFn(r.matrixUrl,s,n);return await this.addProfileWithAuth(t,o,r.displayName,r.realmServerUrl),this.getStoredMatrixAuth(t)}async fetchRealmServerTokenWithReauth(){let e=this.getStoredMatrixAuth(),r=this.getActiveProfile().profile.realmServerUrl.replace(/\/$/,"");try{let n=await Gr(e,r);return this.setRealmServerToken(n),n}catch(n){if(!(n instanceof $e))throw n;let s=await this.reAuthenticate(),o=await Gr(s,r);return this.setRealmServerToken(o),o}}async getOrRefreshServerToken(){let e=this.getRealmServerToken();return e&&!Wx(e)?e:this.fetchRealmServerTokenWithReauth()}async refreshServerToken(){return this.fetchRealmServerTokenWithReauth()}findRealmTokenForUrl(e){let r=this.getActiveProfile()?.profile.realmTokens;if(r){for(let[n,s]of Object.entries(r))if(e.startsWith(n)&&s)return s}}async fetchAndStoreAllRealmTokens(){let e=await this.getOrRefreshServerToken(),r=this.getActiveProfile().profile.realmServerUrl.replace(/\/$/,""),n=await Vr(r,e);for(let[s,o]of Object.entries(n))this.setRealmToken(s,o)}async getRealmTokenForUrl(e){let t=this.findRealmTokenForUrl(e);if(t)return t;try{await this.fetchAndStoreAllRealmTokens()}catch{return}return this.findRealmTokenForUrl(e)}buildHeaders(e,t,r){let n=e instanceof Request?new Headers(e.headers):new Headers,s=new Headers(t?.headers);for(let[o,a]of s)n.set(o,a);return n.has("Authorization")||n.set("Authorization",r),n}async authedRealmFetch(e,t){let r=e instanceof Request?e.url:e instanceof URL?e.href:e,n=await this.getRealmTokenForUrl(r);if(n){let c=this.buildHeaders(e,t,n),l=await fetch(e,{...t,headers:c});if(l.status!==401)return l}let s=this.getActiveProfile();if(s&&(s.profile.realmTokens={},s.profile.realmServerToken=void 0,this.saveConfig()),await this.fetchAndStoreAllRealmTokens(),n=this.findRealmTokenForUrl(r),!n)throw new Error(`No realm token available for ${r}. The realm may not be accessible.`);let o=this.buildHeaders(e,t,n);return await fetch(e,{...t,headers:o})}async authedRealmServerFetch(e,t){let r=await this.getOrRefreshServerToken(),n=this.buildHeaders(e,t,r),s=await fetch(e,{...t,headers:n});return s.status===401&&(r=await this.refreshServerToken(),n=this.buildHeaders(e,t,r),s=await fetch(e,{...t,headers:n})),s}async fetchAndStoreRealmToken(e,t){let n=this.getActiveProfile().profile.realmServerUrl.replace(/\/$/,""),o=(await Vr(n,t))[e];return o&&this.setRealmToken(e,o),o}async withMatrixAuthRecovery(e){try{return await e(this.getStoredMatrixAuth())}catch(t){if(!(t instanceof $e))throw t;let r=await this.reAuthenticate();return e(r)}}async addToUserRealms(e){await this.withMatrixAuthRecovery(t=>Hc(t,e))}async removeFromUserRealms(e){return this.withMatrixAuthRecovery(t=>Wc(t,e))}async getUserRealms(){return this.withMatrixAuthRecovery(e=>ci(e))}async migrateFromEnv(){let e=process.env.MATRIX_URL,t=process.env.MATRIX_USERNAME,r=process.env.MATRIX_PASSWORD,n=process.env.REALM_SERVER_URL;if(!e||!t||!r||!n)return null;let o=e.includes("boxel.ai")?"boxel.ai":"stack.cards",a=`@${t}:${o}`,c=!this.config.profiles[a];return await this.addProfile(a,r,void 0,e,n),{profileId:a,created:c}}printStatus(){let e=this.getActiveProfile();e?(console.log(`
35
+ ${ie}Active Profile:${m} ${fe(e.id)}`),console.log(` ${x}Display Name:${m} ${e.profile.displayName}`),console.log(` ${x}Matrix URL:${m} ${e.profile.matrixUrl}`),console.log(` ${x}Realm Server:${m} ${e.profile.realmServerUrl}`)):(console.log(`
36
+ ${L}No active profile and no environment variables set.${m}`),console.log(`Run ${_}boxel profile add${m} to create a profile.`))}},Yr=null;function C(){return Yr||(Yr=new Jr),Yr}var Kr={staging:{domain:"stack.cards",matrixUrl:"https://matrix-staging.stack.cards",realmServerUrl:"https://realms-staging.stack.cards/"},production:{domain:"boxel.ai",matrixUrl:"https://matrix.boxel.ai",realmServerUrl:"https://app.boxel.ai/"},local:{domain:"localhost",matrixUrl:"http://localhost:8008",realmServerUrl:"http://localhost:4201/"}};function ui(i,e){let t=i.trim(),r;try{r=new URL(t)}catch{console.error(`${g}Error:${m} ${e} "${i}" is not a valid URL.`),process.exit(1)}return r.protocol!=="http:"&&r.protocol!=="https:"&&(console.error(`${g}Error:${m} ${e} "${i}" must use http:// or https://.`),process.exit(1)),t}function Gx(i){return i.toLowerCase().replace(/\//g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function zc(){let i=process.env.BOXEL_ENVIRONMENT;if(!i||!i.trim())return null;let e=Gx(i);return e||(console.error(`${g}Error:${m} BOXEL_ENVIRONMENT="${i}" contains no slug characters (expected letters, digits, or "-").`),process.exit(1)),{domain:`${e}.localhost`,matrixUrl:`http://matrix.${e}.localhost`,realmServerUrl:`http://realm-server.${e}.localhost/`}}async function Jc(i,e,t){let r=C();switch(i){case"list":await Yc(r);break;case"add":{let n=t?.password||process.env.BOXEL_PASSWORD;if(t?.user&&n){let s=t.matrixUrl?ui(t.matrixUrl,"--matrix-url"):void 0,o=t.realmServerUrl?ui(t.realmServerUrl,"--realm-server-url"):void 0,p=!(li(t.user)!=="unknown")&&(!s||!o)?zc():null;p&&console.log(`${x}Using BOXEL_ENVIRONMENT=${process.env.BOXEL_ENVIRONMENT}${m}`),await Jx(r,t.user,n,t.name,s??p?.matrixUrl,o??p?.realmServerUrl)}else await Bx(r,zc());break}case"switch":e||(console.error(`${g}Error:${m} Please specify a profile to switch to.`),console.log("Usage: boxel profile switch <profile-id>"),console.log(`
37
+ Available profiles:`),await Yc(r),process.exit(1)),await zx(r,e);break;case"remove":e||(console.error(`${g}Error:${m} Please specify a profile to remove.`),process.exit(1)),await Yx(r,e);break;case"migrate":await Xx(r);break;default:r.printStatus(),console.log(`
38
+ ${x}Commands:${m}`),console.log(` ${_}boxel profile list${m} List all profiles`),console.log(` ${_}boxel profile add${m} Add a new profile`),console.log(` ${_}boxel profile switch${m} Switch active profile`),console.log(` ${_}boxel profile remove${m} Remove a profile`),console.log(` ${_}boxel profile migrate${m} Import from .env file`)}}async function Yc(i){let e=i.listProfiles(),t=i.getActiveProfileId();if(e.length===0){console.log(`
39
+ ${L}No profiles configured.${m}`),console.log(`Run ${_}boxel profile add${m} to create one.`);return}console.log(`
40
+ ${ie}Saved Profiles:${m}
41
+ `);for(let r of e){let n=i.getProfile(r),s=r===t,o=li(r),a=s?`${R}\u2605${m} `:" ",c=pi(r),l=o==="production"?pe:_;console.log(`${a}${ie}${r}${m}`),console.log(` ${x}Name:${m} ${n.displayName}`),console.log(` ${x}Environment:${m} ${l}${c}${m}`),console.log(` ${x}Realm Server:${m} ${n.realmServerUrl}`),console.log("")}t&&console.log(`${x}\u2605 = active profile${m}`)}async function Vx(){console.log("Which environment?"),console.log(` ${_}1${m}) Staging (realms-staging.stack.cards)`),console.log(` ${pe}2${m}) Production (app.boxel.ai)`),console.log(` ${R}3${m}) Local (localhost:4201)`),console.log(` ${L}4${m}) Custom (enter your own URLs)`);let i=await re(`
42
+ Choice [1/2/3/4]: `);if(i==="4"){let e=await re("Matrix server URL: ");e||(console.error(`${g}Error:${m} Matrix server URL is required.`),process.exit(1));let t=ui(e,"Matrix server URL"),r=await re("Realm server URL: ");r||(console.error(`${g}Error:${m} Realm server URL is required.`),process.exit(1));let n=ui(r,"Realm server URL"),s=new URL(t).hostname||"custom";return{domain:await re(`Domain for Matrix ID [${s}]: `)||s,matrixUrl:t,realmServerUrl:n}}return i==="3"?{...Kr.local}:i==="2"?{...Kr.production}:{...Kr.staging}}async function Bx(i,e){console.log(`
43
+ ${ie}Add New Profile${m}
44
+ `);let t,r,n;if(e)console.log(`${x}Using BOXEL_ENVIRONMENT=${process.env.BOXEL_ENVIRONMENT}${m}`),t=e.domain,r=e.matrixUrl,n=e.realmServerUrl;else{let u=await Vx();t=u.domain,r=u.matrixUrl,n=u.realmServerUrl}console.log(`
45
+ Enter your Boxel username (without @ or domain)`),console.log(`${x}Example: ctse, aallen90${m}`);let s=await re("Username: ");s||(console.error(`${g}Error:${m} Username is required.`),process.exit(1));let o=`@${s}:${t}`;if(i.getProfile(o)&&(console.log(`
46
+ ${L}Profile ${o} already exists.${m}`),(await re("Overwrite? [y/N]: ")).toLowerCase()!=="y")){console.log("Cancelled.");return}let a=await ht("Password: ");a||(console.error(`${g}Error:${m} Password is required.`),process.exit(1));let c=`${s} \xB7 ${t}`,p=await re(`Display name [${c}]: `)||c;await i.addProfile(o,a,p,r,n),console.log(`
47
+ ${R}\u2713${m} Profile created: ${fe(o)}`),i.getActiveProfileId()===o?console.log(`${x}This profile is now active.${m}`):(await re("Switch to this profile now? [Y/n]: ")).toLowerCase()!=="n"&&(i.switchProfile(o),console.log(`${R}\u2713${m} Switched to ${fe(o)}`))}async function zx(i,e){let t=i.listProfiles(),r=e;if(!t.includes(e)){let n=t.filter(s=>{let o=gt(s);return s.includes(e)||o===e});if(n.length===0){console.error(`${g}Error:${m} Profile not found: ${e}`),console.log(`
48
+ Available profiles:`);for(let s of t)console.log(` ${s}`);process.exit(1)}else if(n.length===1)r=n[0];else{console.error(`${g}Error:${m} Ambiguous profile: ${e}`),console.log(`
49
+ Matching profiles:`);for(let s of n)console.log(` ${s}`);process.exit(1)}}i.switchProfile(r)?console.log(`${R}\u2713${m} Switched to ${fe(r)}`):(console.error(`${g}Error:${m} Failed to switch profile.`),process.exit(1))}async function Yx(i,e){if(i.getProfile(e)||(console.error(`${g}Error:${m} Profile not found: ${e}`),process.exit(1)),(await re(`Remove profile ${e}? [y/N]: `)).toLowerCase()!=="y"){console.log("Cancelled.");return}if(await i.removeProfile(e)){console.log(`${R}\u2713${m} Profile removed.`);let n=i.getActiveProfileId();n&&console.log(`Active profile is now: ${fe(n)}`)}else console.error(`${g}Error:${m} Failed to remove profile.`),process.exit(1)}async function Jx(i,e,t,r,n,s){(!e.startsWith("@")||!e.includes(":"))&&(console.error(`${g}Error:${m} Invalid Matrix ID format. Expected @user:domain`),process.exit(1));let o=!!i.getProfile(e);try{await i.addProfile(e,t,r,n,s)}catch(c){console.error(`${g}Error:${m} ${c instanceof Error?c.message:String(c)}`),process.exit(1)}if(o){(n||s)&&i.updateUrls(e,{matrixUrl:n,realmServerUrl:s})&&console.log(`${x}Updated server URLs and cleared cached realm tokens.${m}`),console.log(`${R}\u2713${m} Profile updated: ${fe(e)}`);return}console.log(`${R}\u2713${m} Profile created: ${fe(e)}`),i.getActiveProfileId()!==e&&console.log(`${x}Use 'boxel profile switch ${e}' to switch to this profile.${m}`)}async function Xx(i){console.log(`
50
+ ${ie}Migrate from .env${m}
51
+ `);let e=process.env.MATRIX_URL,t=process.env.MATRIX_USERNAME,r=process.env.MATRIX_PASSWORD,n=process.env.REALM_SERVER_URL;if(!e||!t||!r||!n){console.log(`${L}No complete credentials found in environment variables.${m}`),console.log(`
52
+ Required variables: MATRIX_URL, MATRIX_USERNAME, MATRIX_PASSWORD, REALM_SERVER_URL`);return}let s=await i.migrateFromEnv();s?s.created?(console.log(`${R}\u2713${m} Created profile: ${fe(s.profileId)}`),console.log(`
53
+ ${x}You can now remove credentials from .env if desired.${m}`)):(console.log(`${R}\u2713${m} Refreshed profile: ${fe(s.profileId)}`),console.log(`
54
+ ${x}Use 'boxel profile add -u ${s.profileId} -p <password>' to update other fields.${m}`)):console.log(`${L}Migration failed.${m}`)}var he=P(require("fs")),Ie=P(require("path"));var Ke=P(require("fs")),V=P(require("path"));var xt=!1,Kx=console.log.bind(console),Qx=console.info.bind(console),Zx=console.debug.bind(console);function di(i){if(i!==xt)if(xt=i,xt){let e=()=>{};console.log=e,console.info=e,console.debug=e}else console.log=Kx,console.info=Qx,console.debug=Zx}function Xc(){return xt}var I={info(...i){xt||process.stderr.write(i.map(mi).join(" ")+`
55
+ `)},warn(...i){process.stderr.write(i.map(mi).join(" ")+`
56
+ `)},error(...i){process.stderr.write(i.map(mi).join(" ")+`
57
+ `)},output(...i){process.stdout.write(i.map(mi).join(" ")+`
58
+ `)}};function mi(i){if(typeof i=="string")return i;if(i instanceof Error)return i.stack??i.message;try{return JSON.stringify(i)}catch{return String(i)}}var Kc=!1,ev=new Set([".git","node_modules","dist",".boxel-history",".claude"]);function tv(i){return ev.has(i)}function iv(i){return i==="stack.cards"||i.endsWith(".stack.cards")?"stack.cards":i==="boxel.ai"||i.endsWith(".boxel.ai")?"boxel.ai":i}function Qr(i){if(!i)return!1;let e;try{e=decodeURIComponent(i)}catch{return!1}return!(e==="."||e===".."||e.includes("/")||e.includes("\\")||e.includes("\0"))}function rv(i){let e;try{e=new URL(i)}catch{return null}let t=iv(e.hostname);if(!Qr(t))return null;let r=e.pathname.replace(/^\/|\/$/g,"").split("/").filter(Boolean),n=r[0]??"unknown-owner",s=r[1]??r[0]??"workspace";return!Qr(n)||!Qr(s)?null:V.join(t,n,s)}function nv(i,e){let t=rv(i);return t===null?null:V.resolve(e,t)}function sv(i){let e;try{e=Ke.readFileSync(i,"utf-8")}catch{return null}let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!="object"||t===null)return null;let r=t.realmUrl;return typeof r!="string"||r===""?null:{realmUrl:r}}function Qc(i,e){let t=V.join(i,".boxel-sync.json");Ke.existsSync(t)&&e.push(t)}function fi(i){try{return Ke.readdirSync(i,{withFileTypes:!0}).filter(e=>e.isDirectory()&&!tv(e.name)).map(e=>V.join(i,e.name))}catch{return[]}}function ov(i){let e=[],t=V.resolve(i);for(let r of fi(t))Qc(r,e);for(let r of fi(t))for(let n of fi(r))for(let s of fi(n))Qc(s,e);return e}function av(i,e){let t=V.relative(i,e);return t===""?!0:t.startsWith("..")?!1:!V.isAbsolute(t)}function Zr(i){let e=V.resolve(i),t=ov(e),r=new Set,n=[];for(let s of t){if(r.has(s))continue;r.add(s);let o=sv(s);if(!o)continue;let a=nv(o.realmUrl,e);if(a===null||!av(e,a))continue;let c=V.dirname(s);V.resolve(c)!==V.resolve(a)&&n.push({manifestPath:s,currentDir:c,expectedDir:a,realmUrl:o.realmUrl})}return n}function Zc(i){if(Kc||process.env.BOXEL_DISABLE_PATH_WARNING==="1"||Xc())return;let e=Zr(i);if(e.length===0)return;Kc=!0,console.warn(`
59
+ \u26A0\uFE0F Detected local realm directories at legacy local paths:`);let t=V.resolve(i);for(let r of e.slice(0,5)){let n=V.relative(t,r.currentDir)||".",s=V.relative(t,r.expectedDir)||".";console.warn(` - ${n} -> ${s}`)}e.length>5&&console.warn(` ...and ${e.length-5} more`),console.warn(`
60
60
  Run to preview:`),console.warn(" boxel consolidate-workspaces . --dry-run"),console.warn("Then apply:"),console.warn(` boxel consolidate-workspaces .
61
- `)}function sv(i){de.existsSync(i)||de.mkdirSync(i,{recursive:!0})}function ov(i,e){try{de.renameSync(i,e)}catch(t){let r=t;if(r.code!=="EXDEV")throw r;de.cpSync(i,e,{recursive:!0}),de.rmSync(i,{recursive:!0,force:!0})}}async function av(i,e){let t=Me.resolve(i||"."),r=Jr(t);if(r.length===0){console.log(`No misplaced local realm paths found under ${t}`);return}console.log(`Found ${r.length} misplaced local realm path(s):
62
- `);let n=0,s=0;for(let o of r){let a=Me.relative(t,o.currentDir)||".",c=Me.relative(t,o.expectedDir)||".";if(console.log(`- ${a} -> ${c}`),!e.dryRun){if(de.existsSync(o.expectedDir)){console.warn(" Skipping: target path already exists"),s+=1;continue}sv(Me.dirname(o.expectedDir));try{ov(o.currentDir,o.expectedDir),n+=1}catch(l){let p=l instanceof Error?l.message:String(l);console.warn(` Skipping: failed to move (${p})`),s+=1}}}if(e.dryRun){console.log(`
61
+ `)}function cv(i){he.existsSync(i)||he.mkdirSync(i,{recursive:!0})}function lv(i,e){try{he.renameSync(i,e)}catch(t){let r=t;if(r.code!=="EXDEV")throw r;he.cpSync(i,e,{recursive:!0}),he.rmSync(i,{recursive:!0,force:!0})}}async function pv(i,e){let t=Ie.resolve(i||"."),r=Zr(t);if(r.length===0){console.log(`No misplaced local realm paths found under ${t}`);return}console.log(`Found ${r.length} misplaced local realm path(s):
62
+ `);let n=0,s=0;for(let o of r){let a=Ie.relative(t,o.currentDir)||".",c=Ie.relative(t,o.expectedDir)||".";if(console.log(`- ${a} -> ${c}`),!e.dryRun){if(he.existsSync(o.expectedDir)){console.warn(" Skipping: target path already exists"),s+=1;continue}cv(Ie.dirname(o.expectedDir));try{lv(o.currentDir,o.expectedDir),n+=1}catch(l){let p=l instanceof Error?l.message:String(l);console.warn(` Skipping: failed to move (${p})`),s+=1}}}if(e.dryRun){console.log(`
63
63
  [DRY RUN] No directories moved.`);return}console.log(`
64
- Moved ${n} director${n===1?"y":"ies"}.`),s>0&&console.log(`Skipped ${s} due to existing target paths or move failures.`)}function Qc(i){i.command("consolidate-workspaces").description("Move local realm mirror directories into the canonical <root>/<domain>/<owner>/<realm> layout").argument("[root-dir]","Root directory to scan (default: current directory)").option("--dry-run","Preview without moving anything").action(async(e,t)=>{await av(e,t)})}function ht(i){if(i.trim()==="")return"Path must be a non-empty realm-relative file path.";if(/^[a-z][a-z0-9+.-]*:/i.test(i))return`Path "${i}" must be realm-relative \u2014 absolute URLs (with a scheme) are not accepted.`;if(i.startsWith("/"))return`Path "${i}" must be realm-relative \u2014 paths starting with "/" are not accepted.`;if(i.includes("\\"))return`Path "${i}" must not contain backslash characters.`;let e;try{e=decodeURIComponent(i)}catch{return`Path "${i}" contains an invalid percent-encoded escape.`}return e.split("/").some(r=>r==="..")?`Path "${i}" must not contain ".." segments \u2014 the path must stay inside the target realm.`:null}var di=require("fs");var Xr=require("fs");var ol=T(nl()),sl="application/octet-stream",hv={".gts":"text/typescript+glimmer",".ts":"text/typescript"};function gv(i){let e=i.lastIndexOf(".");if(e===-1)return sl;let t=i.slice(e).toLowerCase(),r=hv[t];if(r)return r;let n=(0,ol.lookup)(i);return n||sl}function ve(i){let e=gv(i);return e==="image/svg+xml"?!1:e.startsWith("image/")||e.startsWith("font/")||e==="application/pdf"||e==="application/vnd.ms-fontobject"}async function gt(i,e,t,r){let n=r?.profileManager??C();if(!n.getActiveProfile())return{ok:!1,error:P};let o=new URL(e,k(i)).href,a=typeof t!="string",c=ve(e);if(c!==a)return{ok:!1,error:`Path ${e} is ${c?"binary":"text"} by extension but content is ${a?"bytes":"a string"}. Refusing to write to avoid silent corruption.`};try{let l=await n.authedRealmFetch(o,{method:"POST",headers:a?{"Content-Type":"application/octet-stream"}:{Accept:"application/vnd.card+source","Content-Type":"application/vnd.card+source"},body:t});if(!l.ok){let p=await l.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${l.status}: ${p.slice(0,300)}`}}return{ok:!0}}catch(l){return{ok:!1,error:l instanceof Error?l.message:String(l)}}}function Xe(i){process.stderr.write(i+`
65
- `)}async function xv(){let i=[];for await(let e of process.stdin)i.push(e);return Buffer.concat(i).toString("utf-8")}function al(i){i.command("write").description("Write a file to a realm (reads content from STDIN or --file)").argument("<path>","Realm-relative file path (e.g., hello.gts, Cards/my-card.json)").requiredOption("--realm <realm-url>","The realm URL to write to").option("--file <filepath>","Read content from a local file instead of STDIN").option("--json","Output raw JSON response").action(async(e,t)=>{let r;if(t.file){let s=ve(t.file),o=ve(e);s!==o&&(Xe(`${h}Error:${m} source file ${t.file} is ${s?"binary":"text"} but destination path ${e} is ${o?"binary":"text"}. Refusing to write to avoid silent corruption \u2014 rename the destination to match.`),process.exit(1));try{r=s?(0,Xr.readFileSync)(t.file):(0,Xr.readFileSync)(t.file,"utf-8")}catch(a){Xe(`${h}Error:${m} Could not read file: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}}else process.stdin.isTTY&&Xe(`${g}Reading from STDIN. Type or paste content, then press Enter followed by Ctrl+D to finish.${m}`),r=await xv(),Xe(`${g}Received ${r.length} bytes. Writing to realm...${m}`);let n;try{n=await gt(t.realm,e,r)}catch(s){Xe(`${h}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}t.json?j.output(JSON.stringify(n,null,2)):n.ok?console.log(`${R}Written:${m} ${e} ${g}\u2192${m} ${t.realm}`):Xe(`${h}Error:${m} ${n.error}`),n.ok||process.exit(1)})}async function Kr(i,e,t,r){let n=r?.profileManager??C();if(!n.getActiveProfile())return{ok:!1,error:P};let o=`${k(i)}_lint`;try{let a=await n.authedRealmFetch(o,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/vnd.card+source","X-Filename":t,"X-HTTP-Method-Override":"QUERY"},body:e});if(!a.ok){let l=await a.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${a.status}: ${l.slice(0,300)}`}}let c=await a.json();return{ok:!0,fixed:c.fixed,output:c.output,messages:c.messages}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function cl(i){i.command("lint").description("Lint a file in a realm using the realm lint endpoint").argument("<path>","Realm-relative file path to lint (e.g., my-card.gts)").requiredOption("--realm <realm-url>","The realm URL to lint against").option("--file <local-filepath>","Read source from a local file instead of fetching from the realm").option("--json","Output raw JSON response").option("--fix","Write auto-fixed output back to the source").action(async(e,t)=>{let r=C();r.getActiveProfile()||(console.error(`${h}Error:${m} ${P}`),process.exit(1));let s;if(t.file)try{s=(0,di.readFileSync)(t.file,"utf-8")}catch(p){console.error(`${h}Error:${m} Could not read local file: ${p instanceof Error?p.message:String(p)}`),process.exit(1)}else{let p=new URL(e,k(t.realm)).href;try{let u=await r.authedRealmFetch(p,{method:"GET",headers:{Accept:"application/vnd.card+source"}});if(!u.ok){let d=await u.text().catch(()=>"(no body)");console.error(`${h}Error:${m} Could not read file from realm: HTTP ${u.status}: ${d.slice(0,300)}`),process.exit(1)}s=await u.text()}catch(u){console.error(`${h}Error:${m} ${u instanceof Error?u.message:String(u)}`),process.exit(1)}}let o;try{o=await Kr(t.realm,s,e,{profileManager:r})}catch(p){console.error(`${h}Error:${m} ${p instanceof Error?p.message:String(p)}`),process.exit(1)}if(t.json){j.output(JSON.stringify(o,null,2)),o.ok||process.exit(1);return}if(o.ok||(console.error(`${h}Error:${m} ${o.error}`),process.exit(1)),t.fix&&o.fixed&&o.output)if(t.file)(0,di.writeFileSync)(t.file,o.output,"utf-8"),console.log(`${R}Fixed:${m} ${t.file}`);else{let p=await gt(t.realm,e,o.output,{profileManager:r});p.ok||(console.error(`${h}Error:${m} Could not write fixed file: ${p.error}`),process.exit(1)),console.log(`${R}Fixed:${m} ${e} ${g}\u2192${m} ${t.realm}`)}let a=o.messages??[],c=a.filter(p=>p.severity===2),l=a.filter(p=>p.severity===1);if(a.length===0){console.log(`${g}No lint issues found.${m}`);return}for(let p of a){let u=p.severity===2?h:A,d=p.severity===2?"error":"warning",f=p.ruleId?` (${p.ruleId})`:"";console.log(`${u}${d}${m} ${p.line}:${p.column} ${p.message}${g}${f}${m}`)}console.log(`
66
- ${g}${c.length} error(s), ${l.length} warning(s)${m}`),c.length>0&&process.exit(1)})}async function Ne(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return{filenames:[],error:P};let n=k(i),s=`${n}_mtimes`;try{let o=await t.authedRealmFetch(s,{method:"GET",headers:{Accept:"application/vnd.api+json"}});if(!o.ok){let p=await o.text().catch(()=>"(no body)");return{filenames:[],error:`_mtimes returned HTTP ${o.status}: ${p.slice(0,300)}`}}let a=await o.json(),c=a?.data?.attributes?.mtimes??a,l=[];for(let p of Object.keys(c)){if(!p.startsWith(n))continue;let u=p.slice(n.length);!u||u.endsWith("/")||l.push(u)}return{filenames:l.sort()}}catch(o){return{filenames:[],error:o instanceof Error?o.message:String(o)}}}function ll(i){i.command("list").alias("ls").description("List all files in a realm").requiredOption("--realm <realm-url>","The realm URL to list files from").option("--json","Output raw JSON response").action(async e=>{let t;try{t=await Ne(e.realm)}catch(r){console.error(`${h}Error:${m} ${r instanceof Error?r.message:String(r)}`),process.exit(1)}if(e.json)j.output(JSON.stringify(t,null,2)),t.error&&process.exit(1);else if(t.error)console.error(`${h}Error:${m} ${t.error}`),process.exit(1);else{for(let r of t.filenames)console.log(`${g}${r}${m}`);console.log(`
67
- ${g}${t.filenames.length} file(s)${m}`)}})}var Qr=[".gts",".gjs",".ts",".js"];async function vv(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return fi(P);let n=k(i),s=Date.now(),o;if(e?.path){let u=e.path,d=ht(u);if(d)return fi(d);if(!Qr.some(f=>u.endsWith(f)))return fi(`Path "${u}" is not lintable \u2014 must end with one of ${Qr.join(", ")}`);o=[u]}else{let u=await Ne(n,{profileManager:t});if(u.error)return fi(`Failed to list realm files: ${u.error}`);o=u.filenames.filter(d=>Qr.some(f=>d.endsWith(f)))}if(o.length===0)return{status:"passed",filesChecked:0,filesWithErrors:0,errorCount:0,warningCount:0,durationMs:Date.now()-s,lintableFiles:[],violations:[]};let a=[],c=0,l=0,p=0;for(let u of o){let d;try{let w=new URL(u,n).href,M=await t.authedRealmFetch(w,{method:"GET",headers:{Accept:"application/vnd.card+source"}});if(!M.ok){let Z=await M.text().catch(()=>"(no body)");Zr(u,`HTTP ${M.status}: ${Z.slice(0,300)}`,a),c+=1,l+=1;continue}d=await M.text()}catch(w){Zr(u,w instanceof Error?w.message:String(w),a),c+=1,l+=1;continue}let f=await Kr(n,d,u,{profileManager:t});if(!f.ok){Zr(u,f.error??"lint failed",a),c+=1,l+=1;continue}let x=!1;for(let w of f.messages??[]){let M=w.severity===2?"error":"warning";a.push({rule:w.ruleId,file:u,line:w.line,column:w.column,message:w.message,severity:M}),M==="error"?(l+=1,x=!0):p+=1}x&&(c+=1)}return{status:l===0?"passed":"failed",filesChecked:o.length,filesWithErrors:c,errorCount:l,warningCount:p,durationMs:Date.now()-s,lintableFiles:o,violations:a}}function Zr(i,e,t){t.push({rule:"lint-error",file:i,line:0,column:0,message:e,severity:"error"})}function fi(i){return{status:"error",filesChecked:0,filesWithErrors:0,errorCount:0,warningCount:0,durationMs:0,lintableFiles:[],violations:[],errorMessage:i}}function pl(i){i.command("lint").description("Lint every lintable (.gts/.gjs/.ts/.js) file in a realm via the realm lint endpoint. Pass a realm-relative path to lint a single file.").argument("[path]","Optional realm-relative file path. When omitted, lints every lintable file in the realm.").requiredOption("--realm <realm-url>","The realm URL to lint against").option("--json","Output structured JSON result").action(async(e,t)=>{let r;try{r=await vv(t.realm,e?{path:e}:{})}catch(s){console.error(`${h}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}if(t.json){j.output(JSON.stringify(r,null,2)),r.status!=="passed"&&process.exit(1);return}if(r.errorMessage&&(console.error(`${h}Error:${m} ${r.errorMessage}`),process.exit(1)),r.violations.length===0){console.log(`${g}No lint issues found (${r.filesChecked} file(s) checked).${m}`);return}let n;for(let s of r.violations){s.file!==n&&(n=s.file,console.log(`
68
- ${g}${s.file}${m}`));let o=s.severity==="error"?h:A,a=s.rule?` (${s.rule})`:"";console.log(` ${o}${s.severity}${m} ${s.line}:${s.column} ${s.message}${g}${a}${m}`)}console.log(`
69
- ${g}${r.errorCount} error(s), ${r.warningCount} warning(s) across ${r.filesChecked} file(s)${m}`),r.errorCount>0&&process.exit(1)})}var dl=require("node:child_process"),fe=require("node:fs"),fl=require("node:os"),Y=require("node:path");var hi=require("node:fs"),gi=require("node:path");function xt(i){let e=i;for(;;){let t=(0,gi.join)(e,"package.json");if((0,hi.existsSync)(t))try{if(JSON.parse((0,hi.readFileSync)(t,"utf8"))?.name==="@cardstack/boxel-cli")return e}catch{}let r=(0,gi.dirname)(e);if(r===e)throw new Error("Could not locate the @cardstack/boxel-cli package root walking up from "+i);e=r}}async function en(i,e,t){let r=t?.profileManager??C(),n=r.getActiveProfile();if(!n)return{ok:!1,error:P};let o=`${n.profile.realmServerUrl.replace(/\/$/,"")}/_federated-search`,a=(Array.isArray(i)?i:[i]).map(k);try{let c=await r.authedRealmServerFetch(o,{method:"QUERY",headers:{Accept:"application/vnd.card+json","Content-Type":"application/json"},body:JSON.stringify({realms:a,...e})});if(!c.ok){let p=await c.text();return{ok:!1,status:c.status,error:`HTTP ${c.status}: ${p.slice(0,300)}`}}let l=await c.json();return{ok:!0,status:c.status,data:l.data}}catch(c){return{ok:!1,status:0,error:c instanceof Error?c.message:String(c)}}}function ul(i){i.command("search").description("Federated search across realms using a JSON query").requiredOption("--realm <realm-url>","Realm URL to search (repeatable)",(e,t)=>(t.push(e),t),[]).requiredOption("--query <json>","JSON query object (as a string)").option("--json","Output raw JSON response").action(async e=>{e.realm.length===0&&(console.error(`${h}Error:${m} At least one --realm is required`),process.exit(1));let t;try{let n=JSON.parse(e.query);(typeof n!="object"||n===null||Array.isArray(n))&&(console.error(`${h}Error:${m} --query must be a JSON object, got ${Array.isArray(n)?"array":typeof n}`),process.exit(1)),t=n}catch(n){console.error(`${h}Error:${m} Invalid JSON in --query: ${n instanceof Error?n.message:String(n)}`),process.exit(1);return}let r;try{r=await en(e.realm,t)}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1);return}e.json?j.output(JSON.stringify(r,null,2)):r.ok?j.output(JSON.stringify(r.data??[],null,2)):(console.error(`${g}Status:${m} ${r.status??"(no status)"}`),console.error(`${h}Error:${m} ${r.error}`)),r.ok||process.exit(1)})}var bv={module:"https://cardstack.com/base/spec",name:"Spec"},rn=[".gts",".gjs",".ts"],vi=".json",hl=xt(__dirname),nn=(0,Y.resolve)(hl,".."),yv=(0,Y.join)(nn,"base"),vt=(0,Y.join)(nn,"host"),wv=(0,Y.join)(nn,"boxel-ui","addon","src"),Ev=(0,Y.join)(vt,"node_modules"),tn;async function Rv(i,e,t={}){let r=t.totalWaitMs??3e4,n=t.pollMs??250,s=Date.now()+r,o=await i();for(;e(o)&&Date.now()<s;)await new Promise(a=>setTimeout(a,n)),o=await i();return o}async function $v(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return xi(P);let n=k(i),s=Date.now(),o=[],a=[];if(e?.path){let u=e.path,d=ht(u);if(d)return xi(d);if(rn.some(f=>u.endsWith(f)))o=[u];else if(u.endsWith(vi))a=[u];else return xi(`Path "${u}" is not parseable \u2014 must end with one of ${rn.join(", ")}, or ${vi}`)}else try{[o,a]=await Promise.all([kv(n,t),Sv(n,t)])}catch(u){return xi(`Failed to discover parseable files: ${u instanceof Error?u.message:String(u)}`)}let c=[...o,...a];if(c.length===0)return{status:"passed",filesChecked:0,filesWithErrors:0,errorCount:0,durationMs:Date.now()-s,parseableFiles:[],errors:[]};let l=[],p=new Set;if(o.length>0){let u=[];for(let d of o){let f=await ml(n,d,t);if(!f.ok){l.push({file:d,line:0,column:0,message:`Could not read ${d}: ${f.error}`}),p.add(d);continue}u.push({path:d,content:f.content})}if(u.length>0)try{let d=await Cv(u);for(let f of d)l.push(f),p.add(f.file)}catch(d){let f=u[0].path;l.push({file:f,line:0,column:0,message:`Glint check failed: ${d instanceof Error?d.message:String(d)}`}),p.add(f)}}for(let u of a){let d=await ml(n,u,t);if(!d.ok){l.push({file:u,line:0,column:0,message:`Could not read ${u}: ${d.error}`}),p.add(u);continue}let f=Ov(u,d.content);for(let x of f)l.push(x),p.add(x.file)}return{status:l.length===0?"passed":"failed",filesChecked:c.length,filesWithErrors:p.size,errorCount:l.length,durationMs:Date.now()-s,parseableFiles:c,errors:l}}async function kv(i,e){let t=`${i}_mtimes`,r=await e.authedRealmFetch(t,{method:"GET",headers:{Accept:"application/vnd.api+json"}});if(!r.ok){let a=await r.text().catch(()=>"(no body)");throw new Error(`_mtimes returned HTTP ${r.status}: ${a.slice(0,300)}`)}let n=await r.json(),s=n?.data?.attributes?.mtimes??n,o=[];for(let a of Object.keys(s)){if(!a.startsWith(i))continue;let c=a.slice(i.length);!c||c.endsWith("/")||rn.some(l=>c.endsWith(l))&&o.push(c)}return o.sort()}async function Sv(i,e){let t=await Rv(()=>en(i,{filter:{type:bv}},{profileManager:e}),s=>s.ok&&(s.data?.length??0)===0);if(!t.ok)return[];let r=[];for(let s of t.data??[]){let o=s.id;if(!o)continue;let a=s.attributes;if(!a||a.specType==="field")continue;let l=s.relationships,p=_v(l),u=new URL(o,i).href,d=[];for(let f of p){let x=new URL(f,u).href;x.startsWith(i)&&d.push(x.slice(i.length))}r.push({specId:o,exampleUrls:d})}let n=[];for(let s of r)for(let o of s.exampleUrls){let a=o.endsWith(vi)?o:`${o}${vi}`;n.includes(a)||n.push(a)}return n.sort()}function _v(i){if(!i)return[];let e=[];for(let t=0;;t++){let r=i[`linkedExamples.${t}`];if(!r?.links?.self)break;e.push(r.links.self)}if(e.length===0){let t=i.linkedExamples;t?.links?.self&&e.push(t.links.self)}return e}async function ml(i,e,t){try{let r=new URL(e,i).href,n=await t.authedRealmFetch(r,{method:"GET",headers:{Accept:"application/vnd.card+source"}});if(!n.ok){let s=await n.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${n.status}: ${s.slice(0,300)}`}}return{ok:!0,content:await n.text()}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async function Cv(i){let e=(0,fe.mkdtempSync)((0,Y.join)((0,fl.tmpdir)(),"boxel-parse-"));try{for(let a of i){let c=ht(a.path);if(c)throw new Error(c);let l=(0,Y.join)(e,a.path),p=(0,Y.resolve)(l);if(!p.startsWith(e+"/"))throw new Error(`Path "${a.path}" resolves outside the parse workspace and was rejected.`);(0,fe.mkdirSync)((0,Y.dirname)(p),{recursive:!0}),(0,fe.writeFileSync)(p,a.content,"utf8")}if(!tn){let a={compilerOptions:{target:"es2022",allowJs:!0,moduleResolution:"bundler",allowSyntheticDefaultImports:!0,noEmit:!0,baseUrl:".",module:"es2022",strict:!0,experimentalDecorators:!0,skipLibCheck:!0,noUnusedLocals:!1,noUnusedParameters:!1,types:["qunit-dom","@cardstack/local-types"],paths:{"https://cardstack.com/base/*":[`${yv}/*`],"@cardstack/host/tests/*":[`${vt}/tests/*`],"@cardstack/host/*":[`${vt}/app/*`],"@cardstack/boxel-host/commands/*":[`${vt}/app/commands/*`],"@cardstack/boxel-ui/*":[`${wv}/*`],"*":[`${vt}/types/*`]}},include:["**/*.ts","**/*.gts","**/*.gjs"],exclude:["node_modules"]};tn=JSON.stringify(a,null,2)}(0,fe.writeFileSync)((0,Y.join)(e,"tsconfig.json"),tn,"utf8"),(0,fe.symlinkSync)(Ev,(0,Y.join)(e,"node_modules"));let t=(0,Y.join)(hl,"node_modules",".bin","ember-tsc"),{output:r,exitedWithError:n}=await new Promise((a,c)=>{let l=(0,dl.execFile)(t,["--noEmit","--project",(0,Y.join)(e,"tsconfig.json")],{cwd:e,timeout:12e4,maxBuffer:10485760},(p,u,d)=>{if(p&&!u&&!d){c(new Error(`ember-tsc execution failed: ${p.message}`));return}if(l.killed||p?.killed){c(new Error("ember-tsc was killed (timeout or signal)"));return}a({output:u+d,exitedWithError:!!p})})}),s=[],o=0;for(let a of r.split(`
70
- `)){let c=a.match(/^(.+?)\((\d+),(\d+)\):\s*error\s+(TS\d+):\s*(.+)/);if(!c)continue;o++;let[,l,p,u,d,f]=c,x=(0,Y.resolve)(e,l);if(!x.startsWith(e)||d==="TS2353"&&f.includes("'scoped'"))continue;let w=x.slice(e.length+1),M=i.find(Z=>Z.path===w);M&&s.push({file:M.path,line:parseInt(p,10),column:parseInt(u,10),message:f})}if(n&&s.length===0&&o===0){let a=r.slice(0,500).trim();s.push({file:i[0]?.path??"unknown",line:0,column:0,message:`ember-tsc exited with errors but produced no TS diagnostics. Check the tsconfig paths and node_modules symlink. Output: ${a}`})}return s}finally{try{(0,fe.rmSync)(e,{recursive:!0,force:!0})}catch{}}}function Ov(i,e){let t;try{t=JSON.parse(e)}catch(r){let n=r instanceof Error?r.message:String(r);return[{file:i,line:0,column:0,message:`Invalid JSON: ${n}`}]}return typeof t!="object"||t===null||Array.isArray(t)?[{file:i,line:0,column:0,message:"Card document must be a JSON object"}]:Tv(i,t)}function Tv(i,e){let t=[],r=e.data;if(typeof r!="object"||r===null||Array.isArray(r))return t.push({file:i,line:0,column:0,message:'Card document must have a "data" object'}),t;let n=r;typeof n.type!="string"&&t.push({file:i,line:0,column:0,message:'Card document "data.type" must be a string'});let s=n.meta;if(typeof s!="object"||s===null)t.push({file:i,line:0,column:0,message:'Card document must have a "data.meta" object'});else{let o=s.adoptsFrom;typeof o!="object"||o===null?t.push({file:i,line:0,column:0,message:'Card document must have a "data.meta.adoptsFrom" object with "module" and "name"'}):(typeof o.module!="string"&&t.push({file:i,line:0,column:0,message:'"data.meta.adoptsFrom.module" must be a string'}),typeof o.name!="string"&&t.push({file:i,line:0,column:0,message:'"data.meta.adoptsFrom.name" must be a string'}))}return t}function xi(i){return{status:"error",filesChecked:0,filesWithErrors:0,errorCount:0,durationMs:0,parseableFiles:[],errors:[],errorMessage:i}}function gl(i){i.command("parse").description("Type-check every .gts / .gjs / .ts file in a realm with glint, plus validate the document structure of any .json files linked as Spec.linkedExamples. Pass a realm-relative path to parse a single file. Monorepo-only (relies on packages/base, packages/host, packages/boxel-ui, and @glint/ember-tsc resolvable from this CLI's location).").argument("[path]","Optional realm-relative file path. When omitted, parses every parseable file (gts/gjs/ts + Spec linkedExamples JSON) in the realm.").requiredOption("--realm <realm-url>","The realm URL to parse against").option("--json","Output structured JSON result").action(async(e,t)=>{let r;try{r=await $v(t.realm,e?{path:e}:{})}catch(s){console.error(`${h}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}if(t.json){j.output(JSON.stringify(r,null,2)),r.status!=="passed"&&process.exit(1);return}if(r.errorMessage&&(console.error(`${h}Error:${m} ${r.errorMessage}`),process.exit(1)),r.errors.length===0){console.log(`${g}No parse errors (${r.filesChecked} file(s) checked).${m}`);return}let n;for(let s of r.errors)s.file!==n&&(n=s.file,console.log(`
71
- ${g}${s.file}${m}`)),console.log(` ${h}error${m} ${s.line}:${s.column} ${s.message}`);console.log(`
72
- ${g}${r.errorCount} error(s) across ${r.filesWithErrors} of ${r.filesChecked} file(s)${m}`),r.errorCount>0&&process.exit(1)})}async function Pv(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())throw new Error("No active profile. Run `boxel profile add` to create one.");let s=new URL(e,k(i)).href,o;try{o=await r.authedRealmFetch(s,{method:"GET",headers:{Accept:"*/*"}})}catch(c){return{ok:!1,error:c instanceof Error?c.message:String(c)}}if(!o.ok){let c=await o.text().catch(()=>"(no body)");return{ok:!1,status:o.status,error:`HTTP ${o.status}: ${c.slice(0,300)}`}}let a=await o.text();return{ok:!0,status:o.status,content:a}}function xl(i){i.command("read-transpiled").description("Debugging tool ONLY for investigating runtime errors in .gts modules you've written. Use when an eval or instantiate error reports a line/column number \u2014 those line numbers refer to the transpiled output, not your .gts source, so fetching the transpiled output is how you locate the offending source construct. Never use the transpiled output as a reference for how to write code: do not copy its patterns (setComponentTemplate, precompileTemplate, wire-format templates, base64 CSS imports) into source. Always write idiomatic Ember / <template>-tag / CardDef source.").argument("<path>","Realm-relative module path. The .gts extension is optional \u2014 the realm accepts either form.").requiredOption("--realm <realm-url>","The realm URL to fetch from").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await Pv(t.realm,e)}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}t.json?j.output(JSON.stringify(r,null,2)):r.ok?j.output(r.content??""):(console.error(`${g}Status:${m} ${r.status??"(no status)"}`),console.error(`${h}Error:${m} ${r.error}`)),r.ok||process.exit(1)})}async function Av(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return{ok:!1,error:P};let n=e?.cancelPending??!1,s=`${k(i)}_cancel-indexing-job`;try{let o=await t.authedRealmFetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({cancelPending:n})});if(!o.ok){let a=await o.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${o.status}: ${a.slice(0,300)}`}}return{ok:!0}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}}function vl(i){i.command("cancel-indexing").description("Cancel running indexing jobs for a realm (use --cancel-pending to also cancel queued jobs)").requiredOption("--realm <realm-url>","URL of the realm to cancel indexing for").option("--cancel-pending","Also cancel queued/pending indexing jobs (default: cancel running only)").option("--json","Output raw JSON response").action(async e=>{let t=await Av(e.realm,{cancelPending:e.cancelPending});if(e.json)j.output(JSON.stringify(t,null,2)),t.ok||process.exit(1);else if(t.ok){let r=e.cancelPending?"running and pending":"running";console.log(`${R}Cancelled ${r} indexing jobs for ${e.realm}${m}`)}else console.error(`${h}Error:${m} ${t.error}`),process.exit(1)})}var Lv=Object.freeze({a:"https://boxel-images.boxel.ai/icons/Letter-a.png",b:"https://boxel-images.boxel.ai/icons/Letter-b.png",c:"https://boxel-images.boxel.ai/icons/Letter-c.png",d:"https://boxel-images.boxel.ai/icons/Letter-d.png",e:"https://boxel-images.boxel.ai/icons/Letter-e.png",f:"https://boxel-images.boxel.ai/icons/Letter-f.png",g:"https://boxel-images.boxel.ai/icons/Letter-g.png",h:"https://boxel-images.boxel.ai/icons/Letter-h.png",i:"https://boxel-images.boxel.ai/icons/Letter-i.png",j:"https://boxel-images.boxel.ai/icons/Letter-j.png",k:"https://boxel-images.boxel.ai/icons/Letter-k.png",l:"https://boxel-images.boxel.ai/icons/Letter-l.png",m:"https://boxel-images.boxel.ai/icons/Letter-m.png",n:"https://boxel-images.boxel.ai/icons/Letter-n.png",o:"https://boxel-images.boxel.ai/icons/Letter-o.png",p:"https://boxel-images.boxel.ai/icons/Letter-p.png",q:"https://boxel-images.boxel.ai/icons/Letter-q.png",r:"https://boxel-images.boxel.ai/icons/Letter-r.png",s:"https://boxel-images.boxel.ai/icons/Letter-s.png",t:"https://boxel-images.boxel.ai/icons/Letter-t.png",u:"https://boxel-images.boxel.ai/icons/Letter-u.png",v:"https://boxel-images.boxel.ai/icons/Letter-v.png",w:"https://boxel-images.boxel.ai/icons/Letter-w.png",x:"https://boxel-images.boxel.ai/icons/Letter-x.png",y:"https://boxel-images.boxel.ai/icons/Letter-y.png",z:"https://boxel-images.boxel.ai/icons/letter-z.png"}),bl=Object.freeze(["https://boxel-images.boxel.ai/background-images/4k-arabic-teal.jpg","https://boxel-images.boxel.ai/background-images/4k-arrow-weave.jpg","https://boxel-images.boxel.ai/background-images/4k-atmosphere-curvature.jpg","https://boxel-images.boxel.ai/background-images/4k-brushed-slabs.jpg","https://boxel-images.boxel.ai/background-images/4k-coral-reefs.jpg","https://boxel-images.boxel.ai/background-images/4k-crescent-lake.jpg","https://boxel-images.boxel.ai/background-images/4k-curvilinear-stairs.jpg","https://boxel-images.boxel.ai/background-images/4k-desert-dunes.jpg","https://boxel-images.boxel.ai/background-images/4k-doodle-board.jpg","https://boxel-images.boxel.ai/background-images/4k-fallen-leaves.jpg","https://boxel-images.boxel.ai/background-images/4k-flowing-mesh.jpg","https://boxel-images.boxel.ai/background-images/4k-glass-reflection.jpg","https://boxel-images.boxel.ai/background-images/4k-glow-cells.jpg","https://boxel-images.boxel.ai/background-images/4k-granite-peaks.jpg","https://boxel-images.boxel.ai/background-images/4k-green-wormhole.jpg","https://boxel-images.boxel.ai/background-images/4k-joshua-dawn.jpg","https://boxel-images.boxel.ai/background-images/4k-lava-river.jpg","https://boxel-images.boxel.ai/background-images/4k-leaves-moss.jpg","https://boxel-images.boxel.ai/background-images/4k-light-streaks.jpg","https://boxel-images.boxel.ai/background-images/4k-lowres-glitch.jpg","https://boxel-images.boxel.ai/background-images/4k-marble-shimmer.jpg","https://boxel-images.boxel.ai/background-images/4k-metallic-leather.jpg","https://boxel-images.boxel.ai/background-images/4k-microscopic-crystals.jpg","https://boxel-images.boxel.ai/background-images/4k-moon-face.jpg","https://boxel-images.boxel.ai/background-images/4k-mountain-runway.jpg","https://boxel-images.boxel.ai/background-images/4k-origami-flock.jpg","https://boxel-images.boxel.ai/background-images/4k-paint-swirl.jpg","https://boxel-images.boxel.ai/background-images/4k-pastel-triangles.jpg","https://boxel-images.boxel.ai/background-images/4k-perforated-sheet.jpg","https://boxel-images.boxel.ai/background-images/4k-plastic-ripples.jpg","https://boxel-images.boxel.ai/background-images/4k-powder-puff.jpg","https://boxel-images.boxel.ai/background-images/4k-radiant-crystal.jpg","https://boxel-images.boxel.ai/background-images/4k-redrock-canyon.jpg","https://boxel-images.boxel.ai/background-images/4k-rock-portal.jpg","https://boxel-images.boxel.ai/background-images/4k-rolling-hills.jpg","https://boxel-images.boxel.ai/background-images/4k-sand-stone.jpg","https://boxel-images.boxel.ai/background-images/4k-silver-fur.jpg","https://boxel-images.boxel.ai/background-images/4k-spa-pool.jpg","https://boxel-images.boxel.ai/background-images/4k-stained-glass.jpg","https://boxel-images.boxel.ai/background-images/4k-stone-veins.jpg","https://boxel-images.boxel.ai/background-images/4k-tangerine-plains.jpg","https://boxel-images.boxel.ai/background-images/4k-techno-floor.jpg","https://boxel-images.boxel.ai/background-images/4k-thick-frost.jpg","https://boxel-images.boxel.ai/background-images/4k-water-surface.jpg","https://boxel-images.boxel.ai/background-images/4k-watercolor-splashes.jpg","https://boxel-images.boxel.ai/background-images/4k-wildflower-field.jpg","https://boxel-images.boxel.ai/background-images/4k-wood-grain.jpg"]);function sn(i){if(!i)return;let e=i.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/^[0-9]+/,"");return Lv[e.charAt(0)]}function yl(){let i=Math.floor(Math.random()*bl.length);return bl[i]}var jv=/^[a-z0-9-]+$/;function El(i){i.command("create").description("Create a new realm on the realm server").argument("<realm-name>","realm name (lowercase, numbers, hyphens only)").argument("<display-name>","display name for the realm").option("--background <url>","background image URL").option("--icon <url>","icon image URL").action(async(e,t,r)=>{await Nv(e,t,r)})}async function Mv(i,e,t={}){let r=t.profileManager??C(),n=r.getActiveProfile();if(!n)throw new Error("No active profile. Run `boxel profile add` to create one.");let s=n.profile.realmServerUrl.replace(/\/$/,""),o={endpoint:i,name:e,backgroundURL:t.background??yl(),iconURL:t.icon??sn(e)??sn(i)},a=await r.authedRealmServerFetch(`${s}/_create-realm`,{method:"POST",headers:{"Content-Type":"application/vnd.api+json"},body:JSON.stringify({data:{type:"realm",attributes:o}})});if(!a.ok){let d;try{d=await a.text()}catch{d="server returned a non-serialized object body"}if(d.includes("[object Object]")&&(d="server returned a non-serialized object body"),d.includes("already exists")){let f=Fv(d,s,i),x=await wl(r,f);try{await r.addToUserRealms(f)}catch{}return{realmUrl:f,created:!1,realmToken:x}}throw new Error(`Realm server returned ${a.status}: ${d}`)}let l=(await a.json())?.data?.id;if(typeof l!="string"||l.trim()==="")throw new Error(`Realm server response did not include a realm URL (data.id) for "${i}".`);let p=k(l),u=await wl(r,p);try{await r.addToUserRealms(p)}catch{}return t.waitForReady&&u&&await Iv(p,u),{realmUrl:p,created:!0,realmToken:u}}async function wl(i,e){try{let t=await i.getOrRefreshServerToken();return await i.fetchAndStoreRealmToken(e,t)}catch{return}}async function Iv(i,e){let t=new URL("_readiness-check",i).href,r=15e3,n=250,s=Date.now(),o;for(;Date.now()-s<r;){try{let a=await fetch(t,{headers:{Accept:"application/vnd.api+json",Authorization:e}});if(a.ok)return;o=`HTTP ${a.status}`}catch(a){o=a instanceof Error?a.message:String(a)}await new Promise(a=>setTimeout(a,n))}throw new Error(`Timed out waiting for realm ${i} to become ready${o?`: ${o}`:""}`)}async function Nv(i,e,t){jv.test(i)||(console.error("Error: realm name must contain only lowercase letters, numbers, and hyphens"),process.exit(1));try{let r=await Mv(i,e,t),n=r.created?"created":"already exists";console.log(`${R}Realm ${n}:${m} ${_}${r.realmUrl}${m}`)}catch(r){console.error(`Error: ${r instanceof Error?r.message:String(r)}`),process.exit(1)}}function Fv(i,e,t){let r=i.match(/'(https?:\/\/[^']+)'/);if(r)return k(r[1]);throw new Error(`Could not determine realm URL from server error response for endpoint "${t}" on "${e}". The response did not include an explicit realm URL.`)}var yt=T(require("fs"));var Nl=require("child_process"),X=T(require("fs/promises")),B=T(require("path"));var D=T(require("fs/promises")),V=T(require("path")),hn=T(Pl());var mn=class{value;next;constructor(e){this.value=e}},bt=class{#e;#t;#i;constructor(){this.clear()}enqueue(e){let t=new mn(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#i++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#i--,this.#e||(this.#t=void 0),e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#i=0}get size(){return this.#i}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function dn(i){let e=!1;if(typeof i=="object"&&({concurrency:i,rejectOnClear:e=!1}=i),Al(i),typeof e!="boolean")throw new TypeError("Expected `rejectOnClear` to be a boolean");let t=new bt,r=0,n=()=>{r<i&&t.size>0&&(r++,t.dequeue().run())},s=()=>{r--,n()},o=async(l,p,u)=>{let d=(async()=>l(...u))();p(d);try{await d}catch{}s()},a=(l,p,u,d)=>{let f={reject:u};new Promise(x=>{f.run=x,t.enqueue(f)}).then(o.bind(void 0,l,p,d)),r<i&&n()},c=(l,...p)=>new Promise((u,d)=>{a(l,u,d,p)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value(){if(!e){t.clear();return}let l=AbortSignal.abort().reason;for(;t.size>0;)t.dequeue().reject(l)}},concurrency:{get:()=>i,set(l){Al(l),i=l,queueMicrotask(()=>{for(;r<i&&t.size>0;)n()})}},map:{async value(l,p){let u=Array.from(l,(d,f)=>this(p,d,f));return Promise.all(u)}}}),c}function Al(i){if(!((Number.isInteger(i)||i===Number.POSITIVE_INFINITY)&&i>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var ib=hn.default.default||hn.default,rb=new Set([".realm.json"]),fn=1e4,nb=3e3;function F(i){let e=i.replace(/\\/g,"/").replace(/^\/+/,"");return rb.has(e)}async function Ll(i){try{return await D.access(i),!0}catch{return!1}}function jl(i){try{return decodeURIComponent(i)}catch{return i}}async function Ml(i,e){let t=await i.text().catch(()=>""),r=`Failed to upload ${e}: ${i.status} ${i.statusText}${t?` \u2014 ${t.slice(0,200)}`:""}`,n=new Error(r);throw n.status=i.status,n.body=t,n}var Ke={CardSource:"application/vnd.card+source",DirectoryListing:"application/vnd.api+json",Mtimes:"application/vnd.api+json",OctetStream:"application/octet-stream"},sb=10,Il=new Set(["node_modules"]),le=class{constructor(e,t){this.options=e;this.authenticator=t;this.normalizedRealmUrl=this.normalizeRealmUrl(e.realmUrl)}normalizedRealmUrl;ignoreCache=new Map;remoteLimit=dn(sb);normalizeRealmUrl(e){try{let t=new URL(e),r=t.pathname;return(r.split("/").filter(Boolean).pop()||"").includes(".")?console.warn(`Warning: "${e}" looks like a file URL, not a realm URL.
64
+ Moved ${n} director${n===1?"y":"ies"}.`),s>0&&console.log(`Skipped ${s} due to existing target paths or move failures.`)}function el(i){i.command("consolidate-workspaces").description("Move local realm mirror directories into the canonical <root>/<domain>/<owner>/<realm> layout").argument("[root-dir]","Root directory to scan (default: current directory)").option("--dry-run","Preview without moving anything").action(async(e,t)=>{await pv(e,t)})}function vt(i){if(i.trim()==="")return"Path must be a non-empty realm-relative file path.";if(/^[a-z][a-z0-9+.-]*:/i.test(i))return`Path "${i}" must be realm-relative \u2014 absolute URLs (with a scheme) are not accepted.`;if(i.startsWith("/"))return`Path "${i}" must be realm-relative \u2014 paths starting with "/" are not accepted.`;if(i.includes("\\"))return`Path "${i}" must not contain backslash characters.`;let e;try{e=decodeURIComponent(i)}catch{return`Path "${i}" contains an invalid percent-encoded escape.`}return e.split("/").some(r=>r==="..")?`Path "${i}" must not contain ".." segments \u2014 the path must stay inside the target realm.`:null}var gi=require("fs");var en=require("fs");var cl=P(ol()),al="application/octet-stream",vv={".gts":"text/typescript+glimmer",".ts":"text/typescript"};function bv(i){let e=i.lastIndexOf(".");if(e===-1)return al;let t=i.slice(e).toLowerCase(),r=vv[t];if(r)return r;let n=(0,cl.lookup)(i);return n||al}function be(i){let e=bv(i);return e==="image/svg+xml"?!1:e.startsWith("image/")||e.startsWith("font/")||e==="application/pdf"||e==="application/vnd.ms-fontobject"}async function bt(i,e,t,r){let n=r?.profileManager??C();if(!n.getActiveProfile())return{ok:!1,error:A};let o=new URL(e,k(i)).href,a=typeof t!="string",c=be(e);if(c!==a)return{ok:!1,error:`Path ${e} is ${c?"binary":"text"} by extension but content is ${a?"bytes":"a string"}. Refusing to write to avoid silent corruption.`};try{let l=await n.authedRealmFetch(o,{method:"POST",headers:a?{"Content-Type":"application/octet-stream"}:{Accept:"application/vnd.card+source","Content-Type":"application/vnd.card+source"},body:t});if(!l.ok){let p=await l.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${l.status}: ${p.slice(0,300)}`}}return{ok:!0}}catch(l){return{ok:!1,error:l instanceof Error?l.message:String(l)}}}function Qe(i){process.stderr.write(i+`
65
+ `)}async function yv(){let i=[];for await(let e of process.stdin)i.push(e);return Buffer.concat(i).toString("utf-8")}function ll(i){i.command("write").description("Write a file to a realm (reads content from STDIN or --file)").argument("<path>","Realm-relative file path (e.g., hello.gts, Cards/my-card.json)").requiredOption("--realm <realm-url>","The realm URL to write to").option("--file <filepath>","Read content from a local file instead of STDIN").option("--json","Output raw JSON response").action(async(e,t)=>{let r;if(t.file){let s=be(t.file),o=be(e);s!==o&&(Qe(`${g}Error:${m} source file ${t.file} is ${s?"binary":"text"} but destination path ${e} is ${o?"binary":"text"}. Refusing to write to avoid silent corruption \u2014 rename the destination to match.`),process.exit(1));try{r=s?(0,en.readFileSync)(t.file):(0,en.readFileSync)(t.file,"utf-8")}catch(a){Qe(`${g}Error:${m} Could not read file: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}}else process.stdin.isTTY&&Qe(`${x}Reading from STDIN. Type or paste content, then press Enter followed by Ctrl+D to finish.${m}`),r=await yv(),Qe(`${x}Received ${r.length} bytes. Writing to realm...${m}`);let n;try{n=await bt(t.realm,e,r)}catch(s){Qe(`${g}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}t.json?I.output(JSON.stringify(n,null,2)):n.ok?console.log(`${R}Written:${m} ${e} ${x}\u2192${m} ${t.realm}`):Qe(`${g}Error:${m} ${n.error}`),n.ok||process.exit(1)})}async function tn(i,e,t,r){let n=r?.profileManager??C();if(!n.getActiveProfile())return{ok:!1,error:A};let o=`${k(i)}_lint`;try{let a=await n.authedRealmFetch(o,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/vnd.card+source","X-Filename":t,"X-HTTP-Method-Override":"QUERY"},body:e});if(!a.ok){let l=await a.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${a.status}: ${l.slice(0,300)}`}}let c=await a.json();return{ok:!0,fixed:c.fixed,output:c.output,messages:c.messages}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function pl(i){i.command("lint").description("Lint a file in a realm using the realm lint endpoint").argument("<path>","Realm-relative file path to lint (e.g., my-card.gts)").requiredOption("--realm <realm-url>","The realm URL to lint against").option("--file <local-filepath>","Read source from a local file instead of fetching from the realm").option("--json","Output raw JSON response").option("--fix","Write auto-fixed output back to the source").action(async(e,t)=>{let r=C();r.getActiveProfile()||(console.error(`${g}Error:${m} ${A}`),process.exit(1));let s;if(t.file)try{s=(0,gi.readFileSync)(t.file,"utf-8")}catch(p){console.error(`${g}Error:${m} Could not read local file: ${p instanceof Error?p.message:String(p)}`),process.exit(1)}else{let p=new URL(e,k(t.realm)).href;try{let u=await r.authedRealmFetch(p,{method:"GET",headers:{Accept:"application/vnd.card+source"}});if(!u.ok){let f=await u.text().catch(()=>"(no body)");console.error(`${g}Error:${m} Could not read file from realm: HTTP ${u.status}: ${f.slice(0,300)}`),process.exit(1)}s=await u.text()}catch(u){console.error(`${g}Error:${m} ${u instanceof Error?u.message:String(u)}`),process.exit(1)}}let o;try{o=await tn(t.realm,s,e,{profileManager:r})}catch(p){console.error(`${g}Error:${m} ${p instanceof Error?p.message:String(p)}`),process.exit(1)}if(t.json){I.output(JSON.stringify(o,null,2)),o.ok||process.exit(1);return}if(o.ok||(console.error(`${g}Error:${m} ${o.error}`),process.exit(1)),t.fix&&o.fixed&&o.output)if(t.file)(0,gi.writeFileSync)(t.file,o.output,"utf-8"),console.log(`${R}Fixed:${m} ${t.file}`);else{let p=await bt(t.realm,e,o.output,{profileManager:r});p.ok||(console.error(`${g}Error:${m} Could not write fixed file: ${p.error}`),process.exit(1)),console.log(`${R}Fixed:${m} ${e} ${x}\u2192${m} ${t.realm}`)}let a=o.messages??[],c=a.filter(p=>p.severity===2),l=a.filter(p=>p.severity===1);if(a.length===0){console.log(`${x}No lint issues found.${m}`);return}for(let p of a){let u=p.severity===2?g:L,f=p.severity===2?"error":"warning",d=p.ruleId?` (${p.ruleId})`:"";console.log(`${u}${f}${m} ${p.line}:${p.column} ${p.message}${x}${d}${m}`)}console.log(`
66
+ ${x}${c.length} error(s), ${l.length} warning(s)${m}`),c.length>0&&process.exit(1)})}async function Fe(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return{filenames:[],error:A};let n=k(i),s=`${n}_mtimes`;try{let o=await t.authedRealmFetch(s,{method:"GET",headers:{Accept:"application/vnd.api+json"}});if(!o.ok){let p=await o.text().catch(()=>"(no body)");return{filenames:[],error:`_mtimes returned HTTP ${o.status}: ${p.slice(0,300)}`}}let a=await o.json(),c=a?.data?.attributes?.mtimes??a,l=[];for(let p of Object.keys(c)){if(!p.startsWith(n))continue;let u=p.slice(n.length);!u||u.endsWith("/")||l.push(u)}return{filenames:l.sort()}}catch(o){return{filenames:[],error:o instanceof Error?o.message:String(o)}}}function ul(i){i.command("list").alias("ls").description("List all files in a realm").requiredOption("--realm <realm-url>","The realm URL to list files from").option("--json","Output raw JSON response").action(async e=>{let t;try{t=await Fe(e.realm)}catch(r){console.error(`${g}Error:${m} ${r instanceof Error?r.message:String(r)}`),process.exit(1)}if(e.json)I.output(JSON.stringify(t,null,2)),t.error&&process.exit(1);else if(t.error)console.error(`${g}Error:${m} ${t.error}`),process.exit(1);else{for(let r of t.filenames)console.log(`${x}${r}${m}`);console.log(`
67
+ ${x}${t.filenames.length} file(s)${m}`)}})}var rn=[".gts",".gjs",".ts",".js"];async function wv(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return xi(A);let n=k(i),s=Date.now(),o;if(e?.path){let u=e.path,f=vt(u);if(f)return xi(f);if(!rn.some(d=>u.endsWith(d)))return xi(`Path "${u}" is not lintable \u2014 must end with one of ${rn.join(", ")}`);o=[u]}else{let u=await Fe(n,{profileManager:t});if(u.error)return xi(`Failed to list realm files: ${u.error}`);o=u.filenames.filter(f=>rn.some(d=>f.endsWith(d)))}if(o.length===0)return{status:"passed",filesChecked:0,filesWithErrors:0,errorCount:0,warningCount:0,durationMs:Date.now()-s,lintableFiles:[],violations:[]};let a=[],c=0,l=0,p=0;for(let u of o){let f;try{let b=new URL(u,n).href,j=await t.authedRealmFetch(b,{method:"GET",headers:{Accept:"application/vnd.card+source"}});if(!j.ok){let te=await j.text().catch(()=>"(no body)");nn(u,`HTTP ${j.status}: ${te.slice(0,300)}`,a),c+=1,l+=1;continue}f=await j.text()}catch(b){nn(u,b instanceof Error?b.message:String(b),a),c+=1,l+=1;continue}let d=await tn(n,f,u,{profileManager:t});if(!d.ok){nn(u,d.error??"lint failed",a),c+=1,l+=1;continue}let h=!1;for(let b of d.messages??[]){let j=b.severity===2?"error":"warning";a.push({rule:b.ruleId,file:u,line:b.line,column:b.column,message:b.message,severity:j}),j==="error"?(l+=1,h=!0):p+=1}h&&(c+=1)}return{status:l===0?"passed":"failed",filesChecked:o.length,filesWithErrors:c,errorCount:l,warningCount:p,durationMs:Date.now()-s,lintableFiles:o,violations:a}}function nn(i,e,t){t.push({rule:"lint-error",file:i,line:0,column:0,message:e,severity:"error"})}function xi(i){return{status:"error",filesChecked:0,filesWithErrors:0,errorCount:0,warningCount:0,durationMs:0,lintableFiles:[],violations:[],errorMessage:i}}function ml(i){i.command("lint").description("Lint every lintable (.gts/.gjs/.ts/.js) file in a realm via the realm lint endpoint. Pass a realm-relative path to lint a single file.").argument("[path]","Optional realm-relative file path. When omitted, lints every lintable file in the realm.").requiredOption("--realm <realm-url>","The realm URL to lint against").option("--json","Output structured JSON result").action(async(e,t)=>{let r;try{r=await wv(t.realm,e?{path:e}:{})}catch(s){console.error(`${g}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}if(t.json){I.output(JSON.stringify(r,null,2)),r.status!=="passed"&&process.exit(1);return}if(r.errorMessage&&(console.error(`${g}Error:${m} ${r.errorMessage}`),process.exit(1)),r.violations.length===0){console.log(`${x}No lint issues found (${r.filesChecked} file(s) checked).${m}`);return}let n;for(let s of r.violations){s.file!==n&&(n=s.file,console.log(`
68
+ ${x}${s.file}${m}`));let o=s.severity==="error"?g:L,a=s.rule?` (${s.rule})`:"";console.log(` ${o}${s.severity}${m} ${s.line}:${s.column} ${s.message}${x}${a}${m}`)}console.log(`
69
+ ${x}${r.errorCount} error(s), ${r.warningCount} warning(s) across ${r.filesChecked} file(s)${m}`),r.errorCount>0&&process.exit(1)})}var gl=require("node:child_process"),B=require("node:fs"),xl=require("node:os"),T=require("node:path");var vi=require("node:fs"),bi=require("node:path");function yt(i){let e=i;for(;;){let t=(0,bi.join)(e,"package.json");if((0,vi.existsSync)(t))try{if(JSON.parse((0,vi.readFileSync)(t,"utf8"))?.name==="@cardstack/boxel-cli")return e}catch{}let r=(0,bi.dirname)(e);if(r===e)throw new Error("Could not locate the @cardstack/boxel-cli package root walking up from "+i);e=r}}async function sn(i,e,t){let r=t?.profileManager??C(),n=r.getActiveProfile();if(!n)return{ok:!1,error:A};let o=`${n.profile.realmServerUrl.replace(/\/$/,"")}/_federated-search`,a=(Array.isArray(i)?i:[i]).map(k);try{let c=await r.authedRealmServerFetch(o,{method:"QUERY",headers:{Accept:"application/vnd.card+json","Content-Type":"application/json"},body:JSON.stringify({realms:a,...e})});if(!c.ok){let p=await c.text();return{ok:!1,status:c.status,error:`HTTP ${c.status}: ${p.slice(0,300)}`}}let l=await c.json();return{ok:!0,status:c.status,data:l.data}}catch(c){return{ok:!1,status:0,error:c instanceof Error?c.message:String(c)}}}function dl(i){i.command("search").description("Federated search across realms using a JSON query").requiredOption("--realm <realm-url>","Realm URL to search (repeatable)",(e,t)=>(t.push(e),t),[]).requiredOption("--query <json>","JSON query object (as a string)").option("--json","Output raw JSON response").action(async e=>{e.realm.length===0&&(console.error(`${g}Error:${m} At least one --realm is required`),process.exit(1));let t;try{let n=JSON.parse(e.query);(typeof n!="object"||n===null||Array.isArray(n))&&(console.error(`${g}Error:${m} --query must be a JSON object, got ${Array.isArray(n)?"array":typeof n}`),process.exit(1)),t=n}catch(n){console.error(`${g}Error:${m} Invalid JSON in --query: ${n instanceof Error?n.message:String(n)}`),process.exit(1);return}let r;try{r=await sn(e.realm,t)}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1);return}e.json?I.output(JSON.stringify(r,null,2)):r.ok?I.output(JSON.stringify(r.data??[],null,2)):(console.error(`${x}Status:${m} ${r.status??"(no status)"}`),console.error(`${g}Error:${m} ${r.error}`)),r.ok||process.exit(1)})}var Ev={module:"https://cardstack.com/base/spec",name:"Spec"},yi=[".gts",".gjs",".ts"],wt=".json",wi=yt(__dirname),Ue=(0,T.resolve)(wi,".."),ee=(()=>{let i=(0,T.join)(wi,"bundled-types");if((0,B.existsSync)((0,T.join)(i,"base")))return i})(),Rv=ee?(0,T.join)(ee,"base"):(0,T.join)(Ue,"base"),fl=ee?(0,T.join)(ee,"host-app"):(0,T.join)(Ue,"host","app"),$v=ee?(0,T.join)(ee,"host-tests"):(0,T.join)(Ue,"host","tests"),kv=ee?(0,T.join)(ee,"host-types"):(0,T.join)(Ue,"host","types"),Sv=ee?(0,T.join)(ee,"boxel-ui"):(0,T.join)(Ue,"boxel-ui","addon","src"),_v=ee?(0,T.join)(ee,"local-types"):(0,T.join)(Ue,"local-types"),hl=ee?(0,T.join)(ee,"shims"):void 0,Cv=ee?(0,T.join)(wi,"node_modules"):(0,T.join)(Ue,"host","node_modules"),on;async function Tv(i,e,t={}){let r=t.totalWaitMs??3e4,n=t.pollMs??250,s=Date.now()+r,o=await i();for(;e(o)&&Date.now()<s;)await new Promise(a=>setTimeout(a,n)),o=await i();return o}async function Ov(i,e){let t=!i,r=e?.workspace??(t?process.cwd():void 0);if(t&&r&&!qv(r))return Ze(`workspace directory not found: ${r}`);let n=e?.profileManager??C();if(!t&&!n.getActiveProfile())return Ze(A);let s=i?k(i):"",o=Date.now(),a=[],c=[];if(e?.path){let d=e.path,h=vt(d);if(h)return Ze(h);if(yi.some(b=>d.endsWith(b)))a=[d];else if(d.endsWith(wt))c=[d];else return Ze(`Path "${d}" is not parseable \u2014 must end with one of ${yi.join(", ")}, or ${wt}`)}else if(t)try{a=Fv(r),c=Uv(r)}catch(d){return Ze(`Failed to walk workspace ${r}: ${d instanceof Error?d.message:String(d)}`)}else try{[a,c]=await Promise.all([Pv(s,n),Av(s,n)])}catch(d){return Ze(`Failed to discover parseable files: ${d instanceof Error?d.message:String(d)}`)}let l=[...a,...c];if(l.length===0)return{status:"passed",filesChecked:0,filesWithErrors:0,errorCount:0,durationMs:Date.now()-o,parseableFiles:[],errors:[]};let p=d=>t?Dv(r,d):jv(s,d,n),u=[],f=new Set;if(a.length>0){let d=[];for(let h of a){let b=await p(h);if(!b.ok){u.push({file:h,line:0,column:0,message:`Could not read ${h}: ${b.error}`}),f.add(h);continue}d.push({path:h,content:b.content})}if(d.length>0)try{let h=await Mv(d);for(let b of h)u.push(b),f.add(b.file)}catch(h){let b=d[0].path;u.push({file:b,line:0,column:0,message:`Glint check failed: ${h instanceof Error?h.message:String(h)}`}),f.add(b)}}for(let d of c){let h=await p(d);if(!h.ok){u.push({file:d,line:0,column:0,message:`Could not read ${d}: ${h.error}`}),f.add(d);continue}let b=Iv(d,h.content);for(let j of b)u.push(j),f.add(j.file)}return{status:u.length===0?"passed":"failed",filesChecked:l.length,filesWithErrors:f.size,errorCount:u.length,durationMs:Date.now()-o,parseableFiles:l,errors:u}}async function Pv(i,e){let t=`${i}_mtimes`,r=await e.authedRealmFetch(t,{method:"GET",headers:{Accept:"application/vnd.api+json"}});if(!r.ok){let a=await r.text().catch(()=>"(no body)");throw new Error(`_mtimes returned HTTP ${r.status}: ${a.slice(0,300)}`)}let n=await r.json(),s=n?.data?.attributes?.mtimes??n,o=[];for(let a of Object.keys(s)){if(!a.startsWith(i))continue;let c=a.slice(i.length);!c||c.endsWith("/")||yi.some(l=>c.endsWith(l))&&o.push(c)}return o.sort()}async function Av(i,e){let t=await Tv(()=>sn(i,{filter:{type:Ev}},{profileManager:e}),s=>s.ok&&(s.data?.length??0)===0);if(!t.ok)return[];let r=[];for(let s of t.data??[]){let o=s.id;if(!o)continue;let a=s.attributes;if(!a||a.specType==="field")continue;let l=s.relationships,p=Lv(l),u=new URL(o,i).href,f=[];for(let d of p){let h=new URL(d,u).href;h.startsWith(i)&&f.push(h.slice(i.length))}r.push({specId:o,exampleUrls:f})}let n=[];for(let s of r)for(let o of s.exampleUrls){let a=o.endsWith(wt)?o:`${o}${wt}`;n.includes(a)||n.push(a)}return n.sort()}function Lv(i){if(!i)return[];let e=[];for(let t=0;;t++){let r=i[`linkedExamples.${t}`];if(!r?.links?.self)break;e.push(r.links.self)}if(e.length===0){let t=i.linkedExamples;t?.links?.self&&e.push(t.links.self)}return e}async function jv(i,e,t){try{let r=new URL(e,i).href,n=await t.authedRealmFetch(r,{method:"GET",headers:{Accept:"application/vnd.card+source"}});if(!n.ok){let s=await n.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${n.status}: ${s.slice(0,300)}`}}return{ok:!0,content:await n.text()}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}async function Mv(i){let e=(0,B.mkdtempSync)((0,T.join)((0,xl.tmpdir)(),"boxel-parse-"));try{for(let l of i){let p=vt(l.path);if(p)throw new Error(p);let u=(0,T.join)(e,l.path),f=(0,T.resolve)(u);if(!f.startsWith(e+"/"))throw new Error(`Path "${l.path}" resolves outside the parse workspace and was rejected.`);(0,B.mkdirSync)((0,T.dirname)(f),{recursive:!0}),(0,B.writeFileSync)(f,l.content,"utf8")}if(!on){let l={compilerOptions:{target:"es2022",allowJs:!0,moduleResolution:"bundler",allowSyntheticDefaultImports:!0,noEmit:!0,baseUrl:".",module:"es2022",strict:!0,experimentalDecorators:!0,skipLibCheck:!0,noUnusedLocals:!1,noUnusedParameters:!1,types:["qunit-dom"],paths:{"https://cardstack.com/base/*":[`${Rv}/*`],"@cardstack/host/tests/*":[`${$v}/*`],"@cardstack/host/*":[`${fl}/*`],"@cardstack/boxel-host/commands/*":[`${fl}/commands/*`],"@cardstack/boxel-ui/*":[`${Sv}/*`],"*":[`${kv}/*`]}},include:["**/*.ts","**/*.gts","**/*.gjs",`${_v}/**/*.d.ts`,...hl?[`${hl}/**/*.d.ts`]:[]],exclude:["node_modules"]};on=JSON.stringify(l,null,2)}(0,B.writeFileSync)((0,T.join)(e,"tsconfig.json"),on,"utf8"),(0,B.symlinkSync)(Cv,(0,T.join)(e,"node_modules"));let t=require.resolve("@glint/ember-tsc",{paths:[wi]}),r=(0,T.resolve)((0,T.dirname)(t),".."),n=(0,T.join)(r,"bin","ember-tsc.js"),{output:s,exitedWithError:o}=await new Promise((l,p)=>{let u=(0,gl.execFile)(process.execPath,[n,"--noEmit","--project",(0,T.join)(e,"tsconfig.json")],{cwd:e,timeout:12e4,maxBuffer:10485760},(f,d,h)=>{if(f&&!d&&!h){p(new Error(`ember-tsc execution failed: ${f.message}`));return}if(u.killed||f?.killed){p(new Error("ember-tsc was killed (timeout or signal)"));return}l({output:d+h,exitedWithError:!!f})})}),a=[],c=0;for(let l of s.split(`
70
+ `)){let p=l.match(/^(.+?)\((\d+),(\d+)\):\s*error\s+(TS\d+):\s*(.+)/);if(!p)continue;c++;let[,u,f,d,h,b]=p,j=(0,T.resolve)(e,u);if(!j.startsWith(e)||h==="TS2353"&&b.includes("'scoped'"))continue;let te=j.slice(e.length+1),E=i.find($=>$.path===te);E&&a.push({file:E.path,line:parseInt(f,10),column:parseInt(d,10),message:b})}if(o&&a.length===0&&c===0){let l=s.slice(0,500).trim();a.push({file:i[0]?.path??"unknown",line:0,column:0,message:`ember-tsc exited with errors but produced no TS diagnostics. Check the tsconfig paths and node_modules symlink. Output: ${l}`})}return a}finally{try{(0,B.rmSync)(e,{recursive:!0,force:!0})}catch{}}}function Iv(i,e){let t;try{t=JSON.parse(e)}catch(r){let n=r instanceof Error?r.message:String(r);return[{file:i,line:0,column:0,message:`Invalid JSON: ${n}`}]}return typeof t!="object"||t===null||Array.isArray(t)?[{file:i,line:0,column:0,message:"Card document must be a JSON object"}]:Nv(i,t)}function Nv(i,e){let t=[],r=e.data;if(typeof r!="object"||r===null||Array.isArray(r))return t.push({file:i,line:0,column:0,message:'Card document must have a "data" object'}),t;let n=r;typeof n.type!="string"&&t.push({file:i,line:0,column:0,message:'Card document "data.type" must be a string'});let s=n.meta;if(typeof s!="object"||s===null)t.push({file:i,line:0,column:0,message:'Card document must have a "data.meta" object'});else{let o=s.adoptsFrom;typeof o!="object"||o===null?t.push({file:i,line:0,column:0,message:'Card document must have a "data.meta.adoptsFrom" object with "module" and "name"'}):(typeof o.module!="string"&&t.push({file:i,line:0,column:0,message:'"data.meta.adoptsFrom.module" must be a string'}),typeof o.name!="string"&&t.push({file:i,line:0,column:0,message:'"data.meta.adoptsFrom.name" must be a string'}))}return t}function Fv(i){let e=[];return vl(i,t=>{yi.some(r=>t.endsWith(r))&&e.push(t)}),e.sort()}function Uv(i){let e=[];return vl(i,t=>{if(!t.endsWith(wt))return;let r=t.split("/").pop();r==="tsconfig.json"||r==="package.json"||r==="realm.json"||r==="index.json"||r===".boxel-sync.json"||t.startsWith("Validations/")||e.push(t)}),e.sort()}function vl(i,e){let t=(0,T.resolve)(i),r=n=>{let s;try{s=(0,B.readdirSync)(n,{withFileTypes:!0})}catch{return}for(let o of s){let a=(0,T.join)(n,o.name);if(o.isDirectory()){if(o.name==="node_modules"||o.name===".git")continue;r(a)}else if(o.isFile()){let c=(0,T.relative)(t,a).split(T.sep).join("/");e(c)}}};r(t)}function Dv(i,e){let t=(0,T.join)(i,e),r=(0,T.resolve)(t);if(!r.startsWith((0,T.resolve)(i)+"/"))return{ok:!1,error:"path resolves outside workspace"};try{return{ok:!0,content:(0,B.readFileSync)(r,"utf8")}}catch(n){return{ok:!1,error:n instanceof Error?n.message:String(n)}}}function qv(i){try{return(0,B.statSync)(i).isDirectory()}catch{return!1}}function Ze(i){return{status:"error",filesChecked:0,filesWithErrors:0,errorCount:0,durationMs:0,parseableFiles:[],errors:[],errorMessage:i}}function bl(i){i.command("parse").description("Type-check .gts / .gjs / .ts files with glint, plus validate the document structure of any .json card instances. Defaults to reading from the current working directory \u2014 the factory's pre-push validator (write files locally, parse, fix, then push). Pass --realm <url> to fetch source from a realm over HTTP instead, or --workspace <dir> to point at a non-cwd directory.").argument("[path]","Optional workspace-relative (default) or realm-relative (with --realm) file path. When omitted, parses every parseable file in the workspace / realm.").option("--realm <realm-url>","Fetch source from this realm over HTTP instead of reading from the workspace.").option("--workspace <dir>","Read source from this directory (default: cwd). Ignored when --realm is set.").option("--json","Output structured JSON result").action(async(e,t)=>{let r;try{r=await Ov(t.realm,{...e?{path:e}:{},...t.workspace?{workspace:t.workspace}:{}})}catch(s){console.error(`${g}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}if(t.json){I.output(JSON.stringify(r,null,2)),r.status!=="passed"&&process.exit(1);return}if(r.errorMessage&&(console.error(`${g}Error:${m} ${r.errorMessage}`),process.exit(1)),r.errors.length===0){console.log(`${x}No parse errors (${r.filesChecked} file(s) checked).${m}`);return}let n;for(let s of r.errors)s.file!==n&&(n=s.file,console.log(`
71
+ ${x}${s.file}${m}`)),console.log(` ${g}error${m} ${s.line}:${s.column} ${s.message}`);console.log(`
72
+ ${x}${r.errorCount} error(s) across ${r.filesWithErrors} of ${r.filesChecked} file(s)${m}`),r.errorCount>0&&process.exit(1)})}async function Hv(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())throw new Error("No active profile. Run `boxel profile add` to create one.");let s=new URL(e,k(i)).href,o;try{o=await r.authedRealmFetch(s,{method:"GET",headers:{Accept:"*/*"}})}catch(c){return{ok:!1,error:c instanceof Error?c.message:String(c)}}if(!o.ok){let c=await o.text().catch(()=>"(no body)");return{ok:!1,status:o.status,error:`HTTP ${o.status}: ${c.slice(0,300)}`}}let a=await o.text();return{ok:!0,status:o.status,content:a}}function yl(i){i.command("read-transpiled").description("Debugging tool ONLY for investigating runtime errors in .gts modules you've written. Use when an eval or instantiate error reports a line/column number \u2014 those line numbers refer to the transpiled output, not your .gts source, so fetching the transpiled output is how you locate the offending source construct. Never use the transpiled output as a reference for how to write code: do not copy its patterns (setComponentTemplate, precompileTemplate, wire-format templates, base64 CSS imports) into source. Always write idiomatic Ember / <template>-tag / CardDef source.").argument("<path>","Realm-relative module path. The .gts extension is optional \u2014 the realm accepts either form.").requiredOption("--realm <realm-url>","The realm URL to fetch from").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await Hv(t.realm,e)}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}t.json?I.output(JSON.stringify(r,null,2)):r.ok?I.output(r.content??""):(console.error(`${x}Status:${m} ${r.status??"(no status)"}`),console.error(`${g}Error:${m} ${r.error}`)),r.ok||process.exit(1)})}async function Wv(i,e){let t=e?.profileManager??C();if(!t.getActiveProfile())return{ok:!1,error:A};let n=e?.cancelPending??!1,s=`${k(i)}_cancel-indexing-job`;try{let o=await t.authedRealmFetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({cancelPending:n})});if(!o.ok){let a=await o.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${o.status}: ${a.slice(0,300)}`}}return{ok:!0}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}}function wl(i){i.command("cancel-indexing").description("Cancel running indexing jobs for a realm (use --cancel-pending to also cancel queued jobs)").requiredOption("--realm <realm-url>","URL of the realm to cancel indexing for").option("--cancel-pending","Also cancel queued/pending indexing jobs (default: cancel running only)").option("--json","Output raw JSON response").action(async e=>{let t=await Wv(e.realm,{cancelPending:e.cancelPending});if(e.json)I.output(JSON.stringify(t,null,2)),t.ok||process.exit(1);else if(t.ok){let r=e.cancelPending?"running and pending":"running";console.log(`${R}Cancelled ${r} indexing jobs for ${e.realm}${m}`)}else console.error(`${g}Error:${m} ${t.error}`),process.exit(1)})}var Gv=Object.freeze({a:"https://boxel-images.boxel.ai/icons/Letter-a.png",b:"https://boxel-images.boxel.ai/icons/Letter-b.png",c:"https://boxel-images.boxel.ai/icons/Letter-c.png",d:"https://boxel-images.boxel.ai/icons/Letter-d.png",e:"https://boxel-images.boxel.ai/icons/Letter-e.png",f:"https://boxel-images.boxel.ai/icons/Letter-f.png",g:"https://boxel-images.boxel.ai/icons/Letter-g.png",h:"https://boxel-images.boxel.ai/icons/Letter-h.png",i:"https://boxel-images.boxel.ai/icons/Letter-i.png",j:"https://boxel-images.boxel.ai/icons/Letter-j.png",k:"https://boxel-images.boxel.ai/icons/Letter-k.png",l:"https://boxel-images.boxel.ai/icons/Letter-l.png",m:"https://boxel-images.boxel.ai/icons/Letter-m.png",n:"https://boxel-images.boxel.ai/icons/Letter-n.png",o:"https://boxel-images.boxel.ai/icons/Letter-o.png",p:"https://boxel-images.boxel.ai/icons/Letter-p.png",q:"https://boxel-images.boxel.ai/icons/Letter-q.png",r:"https://boxel-images.boxel.ai/icons/Letter-r.png",s:"https://boxel-images.boxel.ai/icons/Letter-s.png",t:"https://boxel-images.boxel.ai/icons/Letter-t.png",u:"https://boxel-images.boxel.ai/icons/Letter-u.png",v:"https://boxel-images.boxel.ai/icons/Letter-v.png",w:"https://boxel-images.boxel.ai/icons/Letter-w.png",x:"https://boxel-images.boxel.ai/icons/Letter-x.png",y:"https://boxel-images.boxel.ai/icons/Letter-y.png",z:"https://boxel-images.boxel.ai/icons/letter-z.png"}),El=Object.freeze(["https://boxel-images.boxel.ai/background-images/4k-arabic-teal.jpg","https://boxel-images.boxel.ai/background-images/4k-arrow-weave.jpg","https://boxel-images.boxel.ai/background-images/4k-atmosphere-curvature.jpg","https://boxel-images.boxel.ai/background-images/4k-brushed-slabs.jpg","https://boxel-images.boxel.ai/background-images/4k-coral-reefs.jpg","https://boxel-images.boxel.ai/background-images/4k-crescent-lake.jpg","https://boxel-images.boxel.ai/background-images/4k-curvilinear-stairs.jpg","https://boxel-images.boxel.ai/background-images/4k-desert-dunes.jpg","https://boxel-images.boxel.ai/background-images/4k-doodle-board.jpg","https://boxel-images.boxel.ai/background-images/4k-fallen-leaves.jpg","https://boxel-images.boxel.ai/background-images/4k-flowing-mesh.jpg","https://boxel-images.boxel.ai/background-images/4k-glass-reflection.jpg","https://boxel-images.boxel.ai/background-images/4k-glow-cells.jpg","https://boxel-images.boxel.ai/background-images/4k-granite-peaks.jpg","https://boxel-images.boxel.ai/background-images/4k-green-wormhole.jpg","https://boxel-images.boxel.ai/background-images/4k-joshua-dawn.jpg","https://boxel-images.boxel.ai/background-images/4k-lava-river.jpg","https://boxel-images.boxel.ai/background-images/4k-leaves-moss.jpg","https://boxel-images.boxel.ai/background-images/4k-light-streaks.jpg","https://boxel-images.boxel.ai/background-images/4k-lowres-glitch.jpg","https://boxel-images.boxel.ai/background-images/4k-marble-shimmer.jpg","https://boxel-images.boxel.ai/background-images/4k-metallic-leather.jpg","https://boxel-images.boxel.ai/background-images/4k-microscopic-crystals.jpg","https://boxel-images.boxel.ai/background-images/4k-moon-face.jpg","https://boxel-images.boxel.ai/background-images/4k-mountain-runway.jpg","https://boxel-images.boxel.ai/background-images/4k-origami-flock.jpg","https://boxel-images.boxel.ai/background-images/4k-paint-swirl.jpg","https://boxel-images.boxel.ai/background-images/4k-pastel-triangles.jpg","https://boxel-images.boxel.ai/background-images/4k-perforated-sheet.jpg","https://boxel-images.boxel.ai/background-images/4k-plastic-ripples.jpg","https://boxel-images.boxel.ai/background-images/4k-powder-puff.jpg","https://boxel-images.boxel.ai/background-images/4k-radiant-crystal.jpg","https://boxel-images.boxel.ai/background-images/4k-redrock-canyon.jpg","https://boxel-images.boxel.ai/background-images/4k-rock-portal.jpg","https://boxel-images.boxel.ai/background-images/4k-rolling-hills.jpg","https://boxel-images.boxel.ai/background-images/4k-sand-stone.jpg","https://boxel-images.boxel.ai/background-images/4k-silver-fur.jpg","https://boxel-images.boxel.ai/background-images/4k-spa-pool.jpg","https://boxel-images.boxel.ai/background-images/4k-stained-glass.jpg","https://boxel-images.boxel.ai/background-images/4k-stone-veins.jpg","https://boxel-images.boxel.ai/background-images/4k-tangerine-plains.jpg","https://boxel-images.boxel.ai/background-images/4k-techno-floor.jpg","https://boxel-images.boxel.ai/background-images/4k-thick-frost.jpg","https://boxel-images.boxel.ai/background-images/4k-water-surface.jpg","https://boxel-images.boxel.ai/background-images/4k-watercolor-splashes.jpg","https://boxel-images.boxel.ai/background-images/4k-wildflower-field.jpg","https://boxel-images.boxel.ai/background-images/4k-wood-grain.jpg"]);function an(i){if(!i)return;let e=i.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/^[0-9]+/,"");return Gv[e.charAt(0)]}function Rl(){let i=Math.floor(Math.random()*El.length);return El[i]}var Vv=/^[a-z0-9-]+$/;function kl(i){i.command("create").description("Create a new realm on the realm server").argument("<realm-name>","realm name (lowercase, numbers, hyphens only)").argument("<display-name>","display name for the realm").option("--background <url>","background image URL").option("--icon <url>","icon image URL").action(async(e,t,r)=>{await Yv(e,t,r)})}async function Bv(i,e,t={}){let r=t.profileManager??C(),n=r.getActiveProfile();if(!n)throw new Error("No active profile. Run `boxel profile add` to create one.");let s=n.profile.realmServerUrl.replace(/\/$/,""),o={endpoint:i,name:e,backgroundURL:t.background??Rl(),iconURL:t.icon??an(e)??an(i)},a=await r.authedRealmServerFetch(`${s}/_create-realm`,{method:"POST",headers:{"Content-Type":"application/vnd.api+json"},body:JSON.stringify({data:{type:"realm",attributes:o}})});if(!a.ok){let f;try{f=await a.text()}catch{f="server returned a non-serialized object body"}if(f.includes("[object Object]")&&(f="server returned a non-serialized object body"),f.includes("already exists")){let d=Jv(f,s,i),h=await $l(r,d);try{await r.addToUserRealms(d)}catch{}return{realmUrl:d,created:!1,realmToken:h}}throw new Error(`Realm server returned ${a.status}: ${f}`)}let l=(await a.json())?.data?.id;if(typeof l!="string"||l.trim()==="")throw new Error(`Realm server response did not include a realm URL (data.id) for "${i}".`);let p=k(l),u=await $l(r,p);try{await r.addToUserRealms(p)}catch{}return t.waitForReady&&u&&await zv(p,u),{realmUrl:p,created:!0,realmToken:u}}async function $l(i,e){try{let t=await i.getOrRefreshServerToken();return await i.fetchAndStoreRealmToken(e,t)}catch{return}}async function zv(i,e){let t=new URL("_readiness-check",i).href,r=15e3,n=250,s=Date.now(),o;for(;Date.now()-s<r;){try{let a=await fetch(t,{headers:{Accept:"application/vnd.api+json",Authorization:e}});if(a.ok)return;o=`HTTP ${a.status}`}catch(a){o=a instanceof Error?a.message:String(a)}await new Promise(a=>setTimeout(a,n))}throw new Error(`Timed out waiting for realm ${i} to become ready${o?`: ${o}`:""}`)}async function Yv(i,e,t){Vv.test(i)||(console.error("Error: realm name must contain only lowercase letters, numbers, and hyphens"),process.exit(1));try{let r=await Bv(i,e,t),n=r.created?"created":"already exists";console.log(`${R}Realm ${n}:${m} ${_}${r.realmUrl}${m}`)}catch(r){console.error(`Error: ${r instanceof Error?r.message:String(r)}`),process.exit(1)}}function Jv(i,e,t){let r=i.match(/'(https?:\/\/[^']+)'/);if(r)return k(r[1]);throw new Error(`Could not determine realm URL from server error response for endpoint "${t}" on "${e}". The response did not include an explicit realm URL.`)}var Rt=P(require("fs"));var Dl=require("child_process"),K=P(require("fs/promises")),Y=P(require("path"));var q=P(require("fs/promises")),z=P(require("path")),xn=P(jl());var fn=class{value;next;constructor(e){this.value=e}},Et=class{#e;#t;#i;constructor(){this.clear()}enqueue(e){let t=new fn(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#i++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#i--,this.#e||(this.#t=void 0),e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#i=0}get size(){return this.#i}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function hn(i){let e=!1;if(typeof i=="object"&&({concurrency:i,rejectOnClear:e=!1}=i),Ml(i),typeof e!="boolean")throw new TypeError("Expected `rejectOnClear` to be a boolean");let t=new Et,r=0,n=()=>{r<i&&t.size>0&&(r++,t.dequeue().run())},s=()=>{r--,n()},o=async(l,p,u)=>{let f=(async()=>l(...u))();p(f);try{await f}catch{}s()},a=(l,p,u,f)=>{let d={reject:u};new Promise(h=>{d.run=h,t.enqueue(d)}).then(o.bind(void 0,l,p,f)),r<i&&n()},c=(l,...p)=>new Promise((u,f)=>{a(l,u,f,p)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value(){if(!e){t.clear();return}let l=AbortSignal.abort().reason;for(;t.size>0;)t.dequeue().reject(l)}},concurrency:{get:()=>i,set(l){Ml(l),i=l,queueMicrotask(()=>{for(;r<i&&t.size>0;)n()})}},map:{async value(l,p){let u=Array.from(l,(f,d)=>this(p,f,d));return Promise.all(u)}}}),c}function Ml(i){if(!((Number.isInteger(i)||i===Number.POSITIVE_INFINITY)&&i>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var db=xn.default.default||xn.default,fb=new Set([".realm.json"]),gn=1e4,hb=3e3;function U(i){let e=i.replace(/\\/g,"/").replace(/^\/+/,"");return fb.has(e)}async function Il(i){try{return await q.access(i),!0}catch{return!1}}function Nl(i){try{return decodeURIComponent(i)}catch{return i}}async function Fl(i,e){let t=await i.text().catch(()=>""),r=`Failed to upload ${e}: ${i.status} ${i.statusText}${t?` \u2014 ${t.slice(0,200)}`:""}`,n=new Error(r);throw n.status=i.status,n.body=t,n}var et={CardSource:"application/vnd.card+source",DirectoryListing:"application/vnd.api+json",Mtimes:"application/vnd.api+json",OctetStream:"application/octet-stream"},gb=10,Ul=new Set(["node_modules"]),ue=class{constructor(e,t){this.options=e;this.authenticator=t;this.normalizedRealmUrl=this.normalizeRealmUrl(e.realmUrl)}normalizedRealmUrl;ignoreCache=new Map;remoteLimit=hn(gb);normalizeRealmUrl(e){try{let t=new URL(e),r=t.pathname;return(r.split("/").filter(Boolean).pop()||"").includes(".")?console.warn(`Warning: "${e}" looks like a file URL, not a realm URL.
73
73
  Realm URLs should point to a directory (e.g., ${t.origin}${r.replace(/\/[^/]*\.[^/]*$/,"/")})`):e.endsWith("/")||console.warn(`Warning: Realm URL should end with a trailing slash.
74
- Did you mean "${e}/"?`),t.href.replace(/\/+$/,"")+"/"}catch{throw new Error(`Invalid workspace URL: ${e}`)}}buildDirectoryUrl(e=""){if(!e)return this.normalizedRealmUrl;let t=e.replace(/^\/+|\/+$/g,"");return`${this.normalizedRealmUrl}${t}/`}buildFileUrl(e){let t=e.replace(/^\/+/,"");return`${this.normalizedRealmUrl}${t}`}async getRemoteFileList(e=""){let t=new Map;try{let r=this.buildDirectoryUrl(e),n=await this.remoteLimit(()=>this.authenticator.authedRealmFetch(r,{headers:{Accept:"application/vnd.api+json"}}));if(!n.ok){if(n.status===404)return t;throw n.status===401||n.status===403?new Error(`Authentication failed (${n.status}): Cannot access workspace. Check your Matrix credentials and workspace permissions.`):new Error(`Failed to get directory listing: ${n.status} ${n.statusText}`)}let s=await n.json();if(s.data&&s.data.relationships){let o=Object.entries(s.data.relationships),a=await Promise.all(o.map(([c,l])=>{let u=l.meta.kind==="file",d=e?V.posix.join(e,c):c;return u?this.shouldIgnoreRemoteFile(d)?[]:[[d,!0]]:(async()=>{let f=await this.getRemoteFileList(d);return Array.from(f.entries())})()}));for(let c of a)for(let[l,p]of c)t.set(l,p)}}catch(r){throw r instanceof Error&&(r.message.includes("Authentication failed")||r.message.includes("Cannot access workspace")||r.message.includes("401")||r.message.includes("403"))||console.error(`Error reading remote directory ${e}:`,r),r}return t}async getRemoteMtimes(){let e=new Map;try{let t=`${this.normalizedRealmUrl}_mtimes`,r=await this.authenticator.authedRealmFetch(t,{headers:{Accept:Ke.Mtimes}});if(!r.ok){if(r.status===404)return console.log("Note: _mtimes endpoint not available, will upload all files"),e;throw new Error(`Failed to get mtimes: ${r.status} ${r.statusText}`)}let n=await r.json();if(n.data?.attributes?.mtimes){let s=Object.entries(n.data.attributes.mtimes);process.env.DEBUG&&(console.log(`Remote mtimes received: ${s.length} entries`),s.length>0&&console.log(`Sample: ${s[0][0]} = ${s[0][1]}`));for(let[o,a]of s){let c=o.replace(this.normalizedRealmUrl,""),l;try{l=decodeURIComponent(c)}catch{l=c}this.shouldIgnoreRemoteFile(l)||e.set(l,a)}}else process.env.DEBUG&&console.log("No mtimes in response:",JSON.stringify(n).slice(0,200))}catch(t){console.warn("Could not fetch remote mtimes, will upload all files:",t)}return e}async getLocalFileListWithMtimes(e=""){let t=new Map,r=V.join(this.options.localDir,e),n;try{n=await D.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return t;throw o}let s=await Promise.all(n.map(async o=>{let a=V.join(r,o.name),c=e?V.posix.join(e,o.name):o.name;if(o.isDirectory()&&Il.has(o.name))return[];if(await this.shouldIgnoreFile(c,a))return[];if(o.isFile()){let l=await D.stat(a);return[[c,{path:a,mtime:l.mtimeMs}]]}else if(o.isDirectory()){let l=await this.getLocalFileListWithMtimes(c);return Array.from(l.entries())}return[]}));for(let o of s)for(let[a,c]of o)t.set(a,c);return t}async getLocalFileList(e=""){let t=new Map,r=V.join(this.options.localDir,e),n;try{n=await D.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return t;throw o}let s=await Promise.all(n.map(async o=>{let a=V.join(r,o.name),c=e?V.posix.join(e,o.name):o.name;if(o.isDirectory()&&Il.has(o.name))return[];if(await this.shouldIgnoreFile(c,a))return[];if(o.isFile())return[[c,a]];if(o.isDirectory()){let l=await this.getLocalFileList(c);return Array.from(l.entries())}return[]}));for(let o of s)for(let[a,c]of o)t.set(a,c);return t}async uploadFile(e,t){if(F(e)){console.log(` Skipped (protected): ${e}`);return}if(console.log(`Uploading: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would upload ${e}`);return}if(ve(e)){await this.uploadBinaryFile(e,t),console.log(` Uploaded: ${e}`);return}let r=await D.readFile(t,"utf8"),n=this.buildFileUrl(e),s=await this.authenticator.authedRealmFetch(n,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8",Accept:Ke.CardSource},body:r});s.ok||await Ml(s,e),console.log(` Uploaded: ${e}`)}async uploadBinaryFile(e,t){let r=await D.readFile(t),n=this.buildFileUrl(e),s=await this.authenticator.authedRealmFetch(n,{method:"POST",headers:{"Content-Type":Ke.OctetStream},body:r});s.ok||await Ml(s,e)}async uploadFilesAtomic(e,t){let r=Array.from(e.entries()).filter(([l])=>!F(l));if(r.length===0)return{succeeded:[]};if(this.options.dryRun){for(let[l]of r)console.log(`[DRY RUN] Would upload ${l}`);return{succeeded:[]}}let n=[],s=[];for(let l of r)ve(l[0])?s.push(l):n.push(l);let[o,a]=await Promise.all([this.uploadBinaryBatch(s),this.uploadTextAtomic(n,t)]),c=[...a.succeeded,...o.succeeded];return a.fatal?{succeeded:c,error:{status:a.fatal.status,perFile:[...a.failed,...o.failed],message:a.fatal.message}}:o.failed.length>0?{succeeded:c,error:{status:o.failed[0].status,perFile:o.failed,message:`Binary upload failed for ${o.failed.length} file(s)`}}:{succeeded:c}}async uploadBinaryBatch(e){if(e.length===0)return{succeeded:[],failed:[]};let t=await Promise.allSettled(e.map(([s,o])=>this.remoteLimit(async()=>{try{return await this.uploadBinaryFile(s,o),console.log(` Uploaded: ${s}`),{relativePath:s,ok:!0}}catch(a){let c=a,l=typeof c?.status=="number"?c.status:500,p=a instanceof Error?a.message:String(a);return{relativePath:s,ok:!1,status:l,title:p}}}))),r=[],n=[];for(let s=0;s<t.length;s++){let o=t[s];o.status==="fulfilled"?o.value.ok?r.push(o.value.relativePath):n.push({path:o.value.relativePath,status:o.value.status,title:o.value.title}):n.push({path:e[s][0],status:500,title:String(o.reason)})}return{succeeded:r,failed:n}}async uploadTextAtomic(e,t){if(e.length===0)return{succeeded:[],failed:[]};let r=await Promise.all(e.map(async([l,p])=>{let u=await D.readFile(p,"utf8");return{op:t.has(l)?"add":"update",href:this.buildFileUrl(l),data:{type:"source",attributes:{content:u},meta:{}}}})),n=this.options.waitForIndex?`${this.normalizedRealmUrl}_atomic?waitForIndex=true`:`${this.normalizedRealmUrl}_atomic`,s=await this.authenticator.authedRealmFetch(n,{method:"POST",headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"},body:JSON.stringify({"atomic:operations":r})}),o=new Map(e.map(([l])=>[this.buildFileUrl(l),l]));if(s.status===201){let p=((await s.json())["atomic:results"]??[]).map(u=>u.data?.id).filter(u=>typeof u=="string").map(u=>jl(u)).map(u=>o.get(u)??u);for(let u of p)console.log(` Uploaded: ${u}`);return{succeeded:p,failed:[]}}let a={};try{a=await s.json()}catch{}let c=(a.errors??[]).map(l=>{let u=(l.detail??"").match(/Resource (\S+) /),d=u?jl(u[1]):"";return{path:o.get(d)??d,status:l.status??s.status,title:l.title??"Error"}});return{succeeded:[],failed:c,fatal:{status:s.status,message:`Atomic upload failed: ${s.status} ${s.statusText}`}}}async downloadFile(e,t){if(console.log(`Downloading: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would download ${e}`);return}let r=this.buildFileUrl(e),n=await this.authenticator.authedRealmFetch(r,{headers:{Accept:Ke.CardSource}});if(!n.ok)throw new Error(`Failed to download: ${n.status} ${n.statusText}`);let s=V.dirname(t);if(await D.mkdir(s,{recursive:!0}),ve(e)){let o=Buffer.from(await n.arrayBuffer());await D.writeFile(t,o)}else{let o=await n.text();await D.writeFile(t,o,"utf8")}console.log(` Downloaded: ${e}`)}async deleteFile(e){if(F(e)){console.log(` Skipped (protected): ${e}`);return}if(console.log(`Deleting remote: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would delete ${e}`);return}let t=this.buildFileUrl(e),r=Date.now(),n;try{n=await this.authenticator.authedRealmFetch(t,{method:"DELETE",headers:{Accept:Ke.CardSource},signal:AbortSignal.timeout(fn)})}catch(o){let a=Date.now()-r;if(console.error(` Delete request failed after ${a}ms: ${e}`),o instanceof Error&&(o.name==="TimeoutError"||o.name==="AbortError")){if(await this.verifyDeleteApplied(e)===!0){console.warn(` Delete response timed out after ${fn}ms, but ${e} is already gone on the realm; continuing`);return}throw new Error(`Timed out deleting ${e} after ${fn}ms`,{cause:o})}throw o}let s=Date.now()-r;if(console.log(` Delete response for ${e}: ${n.status} ${n.statusText} (${s}ms)`),!n.ok&&n.status!==404)throw new Error(`Failed to delete: ${n.status} ${n.statusText}`);console.log(` Deleted: ${e}`)}async verifyDeleteApplied(e){let t=this.buildFileUrl(e);try{let r=await this.authenticator.authedRealmFetch(t,{headers:{Accept:Ke.CardSource},signal:AbortSignal.timeout(nb)});return console.warn(` Delete-timeout probe for ${e}: ${r.status} ${r.statusText}`),r.status===404}catch(r){return console.warn(` Delete-timeout probe failed for ${e}:`,r),"unknown"}}async deleteLocalFile(e){if(console.log(`Deleting local: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would delete local file ${e}`);return}try{await D.unlink(e),console.log(` Deleted: ${e}`)}catch(t){if(t.code!=="ENOENT")throw t}}getIgnoreInstance(e){let t=this.ignoreCache.get(e);if(t)return t;let r=(async()=>{let n=ib(),s=e,o=this.options.localDir;for(;s.startsWith(o);){let a=V.join(s,".gitignore");if(await Ll(a))try{let p=await D.readFile(a,"utf8");n.add(p)}catch(p){console.warn(`Warning: Could not read .gitignore file at ${a}:`,p)}let c=V.join(s,".boxelignore");if(await Ll(c))try{let p=await D.readFile(c,"utf8");n.add(p)}catch(p){console.warn(`Warning: Could not read .boxelignore file at ${c}:`,p)}let l=V.dirname(s);if(l===s)break;s=l}return n})();return this.ignoreCache.set(e,r),r}async shouldIgnoreFile(e,t){let r=V.basename(e);if(r===".boxel-sync.json"||r.startsWith("."))return!0;let n=V.dirname(t),s=await this.getIgnoreInstance(n),o=e.replace(/\\/g,"/");return s.ignores(o)}shouldIgnoreRemoteFile(e){return!!V.basename(e).startsWith(".")}};async function gn(i){try{return await X.access(i),!0}catch{return!1}}var q=class{workspaceDir;gitDir;constructor(e){this.workspaceDir=B.resolve(e),this.gitDir=B.join(this.workspaceDir,".boxel-history")}async init(){await gn(this.gitDir)||await X.mkdir(this.gitDir,{recursive:!0});let e=B.join(this.gitDir,".git");await gn(e)||(await this.git("init"),await this.git("config","user.email","boxel-cli@local"),await this.git("config","user.name","Boxel CLI"),await this.git("commit","--allow-empty","-m","[init] Initialize checkpoint history"))}async isInitialized(){return gn(B.join(this.gitDir,".git"))}async syncFilesToHistory(){let e=await this.getWorkspaceFiles(),t=new Set(e),r=await this.getHistoryFiles();await Promise.all(r.map(async n=>{if(!t.has(n)){let s=B.join(this.gitDir,n);try{await X.unlink(s)}catch(o){if(o.code!=="ENOENT")throw o}}})),await Promise.all(e.map(async n=>{let s=B.join(this.workspaceDir,n),o=B.join(this.gitDir,n),a=B.dirname(o);await X.mkdir(a,{recursive:!0}),await X.copyFile(s,o)}))}async getWorkspaceFiles(){let e=[],t=async(r,n="")=>{let s;try{s=await X.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;throw o}await Promise.all(s.map(async o=>{if(o.name===".boxel-history"||o.name===".boxel-sync.json"||o.name==="node_modules"||o.name.startsWith("."))return;let a=n?`${n}/${o.name}`:o.name;o.isDirectory()?await t(B.join(r,o.name),a):e.push(a)}))};return await t(this.workspaceDir),e}async getHistoryFiles(){let e=[],t=async(r,n="")=>{let s;try{s=await X.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;throw o}await Promise.all(s.map(async o=>{if(o.name===".git")return;let a=n?`${n}/${o.name}`:o.name;o.isDirectory()?await t(B.join(r,o.name),a):e.push(a)}))};return await t(this.gitDir),e}async detectCurrentChanges(){if(!await this.isInitialized())return(await this.getWorkspaceFiles()).map(n=>({file:n,status:"added"}));await this.syncFilesToHistory();let e=(await this.git("status","--porcelain")).replace(/\n+$/,"");if(!e)return[];let t=[];for(let r of e.split(`
74
+ Did you mean "${e}/"?`),t.href.replace(/\/+$/,"")+"/"}catch{throw new Error(`Invalid workspace URL: ${e}`)}}buildDirectoryUrl(e=""){if(!e)return this.normalizedRealmUrl;let t=e.replace(/^\/+|\/+$/g,"");return`${this.normalizedRealmUrl}${t}/`}buildFileUrl(e){let t=e.replace(/^\/+/,"");return`${this.normalizedRealmUrl}${t}`}async getRemoteFileList(e=""){let t=new Map;try{let r=this.buildDirectoryUrl(e),n=await this.remoteLimit(()=>this.authenticator.authedRealmFetch(r,{headers:{Accept:"application/vnd.api+json"}}));if(!n.ok){if(n.status===404)return t;throw n.status===401||n.status===403?new Error(`Authentication failed (${n.status}): Cannot access workspace. Check your Matrix credentials and workspace permissions.`):new Error(`Failed to get directory listing: ${n.status} ${n.statusText}`)}let s=await n.json();if(s.data&&s.data.relationships){let o=Object.entries(s.data.relationships),a=await Promise.all(o.map(([c,l])=>{let u=l.meta.kind==="file",f=e?z.posix.join(e,c):c;return u?this.shouldIgnoreRemoteFile(f)?[]:[[f,!0]]:(async()=>{let d=await this.getRemoteFileList(f);return Array.from(d.entries())})()}));for(let c of a)for(let[l,p]of c)t.set(l,p)}}catch(r){throw r instanceof Error&&(r.message.includes("Authentication failed")||r.message.includes("Cannot access workspace")||r.message.includes("401")||r.message.includes("403"))||console.error(`Error reading remote directory ${e}:`,r),r}return t}async getRemoteMtimes(){let e=new Map;try{let t=`${this.normalizedRealmUrl}_mtimes`,r=await this.authenticator.authedRealmFetch(t,{headers:{Accept:et.Mtimes}});if(!r.ok){if(r.status===404)return console.log("Note: _mtimes endpoint not available, will upload all files"),e;throw new Error(`Failed to get mtimes: ${r.status} ${r.statusText}`)}let n=await r.json();if(n.data?.attributes?.mtimes){let s=Object.entries(n.data.attributes.mtimes);process.env.DEBUG&&(console.log(`Remote mtimes received: ${s.length} entries`),s.length>0&&console.log(`Sample: ${s[0][0]} = ${s[0][1]}`));for(let[o,a]of s){let c=o.replace(this.normalizedRealmUrl,""),l;try{l=decodeURIComponent(c)}catch{l=c}this.shouldIgnoreRemoteFile(l)||e.set(l,a)}}else process.env.DEBUG&&console.log("No mtimes in response:",JSON.stringify(n).slice(0,200))}catch(t){console.warn("Could not fetch remote mtimes, will upload all files:",t)}return e}async getLocalFileListWithMtimes(e=""){let t=new Map,r=z.join(this.options.localDir,e),n;try{n=await q.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return t;throw o}let s=await Promise.all(n.map(async o=>{let a=z.join(r,o.name),c=e?z.posix.join(e,o.name):o.name;if(o.isDirectory()&&Ul.has(o.name))return[];if(await this.shouldIgnoreFile(c,a))return[];if(o.isFile()){let l=await q.stat(a);return[[c,{path:a,mtime:l.mtimeMs}]]}else if(o.isDirectory()){let l=await this.getLocalFileListWithMtimes(c);return Array.from(l.entries())}return[]}));for(let o of s)for(let[a,c]of o)t.set(a,c);return t}async getLocalFileList(e=""){let t=new Map,r=z.join(this.options.localDir,e),n;try{n=await q.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return t;throw o}let s=await Promise.all(n.map(async o=>{let a=z.join(r,o.name),c=e?z.posix.join(e,o.name):o.name;if(o.isDirectory()&&Ul.has(o.name))return[];if(await this.shouldIgnoreFile(c,a))return[];if(o.isFile())return[[c,a]];if(o.isDirectory()){let l=await this.getLocalFileList(c);return Array.from(l.entries())}return[]}));for(let o of s)for(let[a,c]of o)t.set(a,c);return t}async uploadFile(e,t){if(U(e)){console.log(` Skipped (protected): ${e}`);return}if(console.log(`Uploading: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would upload ${e}`);return}if(be(e)){await this.uploadBinaryFile(e,t),console.log(` Uploaded: ${e}`);return}let r=await q.readFile(t,"utf8"),n=this.buildFileUrl(e),s=await this.authenticator.authedRealmFetch(n,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8",Accept:et.CardSource},body:r});s.ok||await Fl(s,e),console.log(` Uploaded: ${e}`)}async uploadBinaryFile(e,t){let r=await q.readFile(t),n=this.buildFileUrl(e),s=await this.authenticator.authedRealmFetch(n,{method:"POST",headers:{"Content-Type":et.OctetStream},body:r});s.ok||await Fl(s,e)}async uploadFilesAtomic(e,t){let r=Array.from(e.entries()).filter(([l])=>!U(l));if(r.length===0)return{succeeded:[]};if(this.options.dryRun){for(let[l]of r)console.log(`[DRY RUN] Would upload ${l}`);return{succeeded:[]}}let n=[],s=[];for(let l of r)be(l[0])?s.push(l):n.push(l);let[o,a]=await Promise.all([this.uploadBinaryBatch(s),this.uploadTextAtomic(n,t)]),c=[...a.succeeded,...o.succeeded];return a.fatal?{succeeded:c,error:{status:a.fatal.status,perFile:[...a.failed,...o.failed],message:a.fatal.message}}:o.failed.length>0?{succeeded:c,error:{status:o.failed[0].status,perFile:o.failed,message:`Binary upload failed for ${o.failed.length} file(s)`}}:{succeeded:c}}async uploadBinaryBatch(e){if(e.length===0)return{succeeded:[],failed:[]};let t=await Promise.allSettled(e.map(([s,o])=>this.remoteLimit(async()=>{try{return await this.uploadBinaryFile(s,o),console.log(` Uploaded: ${s}`),{relativePath:s,ok:!0}}catch(a){let c=a,l=typeof c?.status=="number"?c.status:500,p=a instanceof Error?a.message:String(a);return{relativePath:s,ok:!1,status:l,title:p}}}))),r=[],n=[];for(let s=0;s<t.length;s++){let o=t[s];o.status==="fulfilled"?o.value.ok?r.push(o.value.relativePath):n.push({path:o.value.relativePath,status:o.value.status,title:o.value.title}):n.push({path:e[s][0],status:500,title:String(o.reason)})}return{succeeded:r,failed:n}}async uploadTextAtomic(e,t){if(e.length===0)return{succeeded:[],failed:[]};let r=await Promise.all(e.map(async([l,p])=>{let u=await q.readFile(p,"utf8");return{op:t.has(l)?"add":"update",href:this.buildFileUrl(l),data:{type:"source",attributes:{content:u},meta:{}}}})),n=this.options.waitForIndex?`${this.normalizedRealmUrl}_atomic?waitForIndex=true`:`${this.normalizedRealmUrl}_atomic`,s=await this.authenticator.authedRealmFetch(n,{method:"POST",headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"},body:JSON.stringify({"atomic:operations":r})}),o=new Map(e.map(([l])=>[this.buildFileUrl(l),l]));if(s.status===201){let p=((await s.json())["atomic:results"]??[]).map(u=>u.data?.id).filter(u=>typeof u=="string").map(u=>Nl(u)).map(u=>o.get(u)??u);for(let u of p)console.log(` Uploaded: ${u}`);return{succeeded:p,failed:[]}}let a={};try{a=await s.json()}catch{}let c=(a.errors??[]).map(l=>{let u=(l.detail??"").match(/Resource (\S+) /),f=u?Nl(u[1]):"";return{path:o.get(f)??f,status:l.status??s.status,title:l.title??"Error"}});return{succeeded:[],failed:c,fatal:{status:s.status,message:`Atomic upload failed: ${s.status} ${s.statusText}`}}}async downloadFile(e,t){if(console.log(`Downloading: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would download ${e}`);return}let r=this.buildFileUrl(e),n=await this.authenticator.authedRealmFetch(r,{headers:{Accept:et.CardSource}});if(!n.ok)throw new Error(`Failed to download: ${n.status} ${n.statusText}`);let s=z.dirname(t);if(await q.mkdir(s,{recursive:!0}),be(e)){let o=Buffer.from(await n.arrayBuffer());await q.writeFile(t,o)}else{let o=await n.text();await q.writeFile(t,o,"utf8")}console.log(` Downloaded: ${e}`)}async deleteFile(e){if(U(e)){console.log(` Skipped (protected): ${e}`);return}if(console.log(`Deleting remote: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would delete ${e}`);return}let t=this.buildFileUrl(e),r=Date.now(),n;try{n=await this.authenticator.authedRealmFetch(t,{method:"DELETE",headers:{Accept:et.CardSource},signal:AbortSignal.timeout(gn)})}catch(o){let a=Date.now()-r;if(console.error(` Delete request failed after ${a}ms: ${e}`),o instanceof Error&&(o.name==="TimeoutError"||o.name==="AbortError")){if(await this.verifyDeleteApplied(e)===!0){console.warn(` Delete response timed out after ${gn}ms, but ${e} is already gone on the realm; continuing`);return}throw new Error(`Timed out deleting ${e} after ${gn}ms`,{cause:o})}throw o}let s=Date.now()-r;if(console.log(` Delete response for ${e}: ${n.status} ${n.statusText} (${s}ms)`),!n.ok&&n.status!==404)throw new Error(`Failed to delete: ${n.status} ${n.statusText}`);console.log(` Deleted: ${e}`)}async verifyDeleteApplied(e){let t=this.buildFileUrl(e);try{let r=await this.authenticator.authedRealmFetch(t,{headers:{Accept:et.CardSource},signal:AbortSignal.timeout(hb)});return console.warn(` Delete-timeout probe for ${e}: ${r.status} ${r.statusText}`),r.status===404}catch(r){return console.warn(` Delete-timeout probe failed for ${e}:`,r),"unknown"}}async deleteLocalFile(e){if(console.log(`Deleting local: ${e}`),this.options.dryRun){console.log(`[DRY RUN] Would delete local file ${e}`);return}try{await q.unlink(e),console.log(` Deleted: ${e}`)}catch(t){if(t.code!=="ENOENT")throw t}}getIgnoreInstance(e){let t=this.ignoreCache.get(e);if(t)return t;let r=(async()=>{let n=db(),s=e,o=this.options.localDir;for(;s.startsWith(o);){let a=z.join(s,".gitignore");if(await Il(a))try{let p=await q.readFile(a,"utf8");n.add(p)}catch(p){console.warn(`Warning: Could not read .gitignore file at ${a}:`,p)}let c=z.join(s,".boxelignore");if(await Il(c))try{let p=await q.readFile(c,"utf8");n.add(p)}catch(p){console.warn(`Warning: Could not read .boxelignore file at ${c}:`,p)}let l=z.dirname(s);if(l===s)break;s=l}return n})();return this.ignoreCache.set(e,r),r}async shouldIgnoreFile(e,t){let r=z.basename(e);if(r===".boxel-sync.json"||r.startsWith("."))return!0;let n=z.dirname(t),s=await this.getIgnoreInstance(n),o=e.replace(/\\/g,"/");return s.ignores(o)}shouldIgnoreRemoteFile(e){return!!z.basename(e).startsWith(".")}};async function vn(i){try{return await K.access(i),!0}catch{return!1}}var H=class{workspaceDir;gitDir;constructor(e){this.workspaceDir=Y.resolve(e),this.gitDir=Y.join(this.workspaceDir,".boxel-history")}async init(){await vn(this.gitDir)||await K.mkdir(this.gitDir,{recursive:!0});let e=Y.join(this.gitDir,".git");await vn(e)||(await this.git("init"),await this.git("config","user.email","boxel-cli@local"),await this.git("config","user.name","Boxel CLI"),await this.git("commit","--allow-empty","-m","[init] Initialize checkpoint history"))}async isInitialized(){return vn(Y.join(this.gitDir,".git"))}async syncFilesToHistory(){let e=await this.getWorkspaceFiles(),t=new Set(e),r=await this.getHistoryFiles();await Promise.all(r.map(async n=>{if(!t.has(n)){let s=Y.join(this.gitDir,n);try{await K.unlink(s)}catch(o){if(o.code!=="ENOENT")throw o}}})),await Promise.all(e.map(async n=>{let s=Y.join(this.workspaceDir,n),o=Y.join(this.gitDir,n),a=Y.dirname(o);await K.mkdir(a,{recursive:!0}),await K.copyFile(s,o)}))}async getWorkspaceFiles(){let e=[],t=async(r,n="")=>{let s;try{s=await K.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;throw o}await Promise.all(s.map(async o=>{if(o.name===".boxel-history"||o.name===".boxel-sync.json"||o.name==="node_modules"||o.name.startsWith("."))return;let a=n?`${n}/${o.name}`:o.name;o.isDirectory()?await t(Y.join(r,o.name),a):e.push(a)}))};return await t(this.workspaceDir),e}async getHistoryFiles(){let e=[],t=async(r,n="")=>{let s;try{s=await K.readdir(r,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;throw o}await Promise.all(s.map(async o=>{if(o.name===".git")return;let a=n?`${n}/${o.name}`:o.name;o.isDirectory()?await t(Y.join(r,o.name),a):e.push(a)}))};return await t(this.gitDir),e}async detectCurrentChanges(){if(!await this.isInitialized())return(await this.getWorkspaceFiles()).map(n=>({file:n,status:"added"}));await this.syncFilesToHistory();let e=(await this.git("status","--porcelain")).replace(/\n+$/,"");if(!e)return[];let t=[];for(let r of e.split(`
75
75
  `)){if(!r)continue;let n=r.substring(0,2),s=r.substring(3);if(n.includes("R")){let o=s.indexOf(" -> ");if(o!==-1){let a=s.substring(0,o),c=s.substring(o+4);t.push({file:a,status:"deleted"}),t.push({file:c,status:"added"});continue}}n.includes("D")?t.push({file:s,status:"deleted"}):n.includes("A")||n.includes("C")||n==="??"?t.push({file:s,status:"added"}):(n.includes("M")||n.includes("U")||n.includes("T"))&&t.push({file:s,status:"modified"})}return t}async createCheckpoint(e,t,r){if(await this.isInitialized()||await this.init(),await this.syncFilesToHistory(),await this.git("add","-A"),!(await this.git("status","--porcelain")).trim())return null;let s=this.classifyChanges(t),{message:o,description:a}=r?{message:r,description:""}:this.generateCommitMessage(e,t,s),c=s?"[MAJOR]":"[minor]",l=`[${e}]`,p=`${c} ${l} ${o}${a?`
76
76
 
77
- `+a:""}`;await this.git("commit","-m",p);let u=(await this.git("rev-parse","HEAD")).trim(),d=u.substring(0,7);return{hash:u,shortHash:d,message:o,description:a,date:new Date,isMajor:s,filesChanged:t.length,insertions:0,deletions:0,source:e,isMilestone:!1}}classifyChanges(e){if(e.length>3)return!0;for(let t of e)if(t.status==="added"||t.status==="deleted"||t.file.endsWith(".gts"))return!0;return!1}generateCommitMessage(e,t,r){let n=e==="local"?"Push":e==="remote"?"Pull":"Manual";if(t.length===0)return{message:`${n}: No changes detected`,description:""};if(t.length===1){let u=t[0],d=u.status==="added"?"Add":u.status==="deleted"?"Delete":"Update";return{message:`${n}: ${d} ${u.file}`,description:""}}let s=t.filter(u=>u.status==="added"),o=t.filter(u=>u.status==="modified"),a=t.filter(u=>u.status==="deleted"),c=[];s.length>0&&c.push(`+${s.length}`),o.length>0&&c.push(`~${o.length}`),a.length>0&&c.push(`-${a.length}`);let l=`${n}: ${t.length} files (${c.join(", ")})`,p=[];return s.length>0&&(p.push("Added:"),s.forEach(u=>p.push(` + ${u.file}`))),o.length>0&&(p.push("Modified:"),o.forEach(u=>p.push(` ~ ${u.file}`))),a.length>0&&(p.push("Deleted:"),a.forEach(u=>p.push(` - ${u.file}`))),{message:l,description:p.join(`
77
+ `+a:""}`;await this.git("commit","-m",p);let u=(await this.git("rev-parse","HEAD")).trim(),f=u.substring(0,7);return{hash:u,shortHash:f,message:o,description:a,date:new Date,isMajor:s,filesChanged:t.length,insertions:0,deletions:0,source:e,isMilestone:!1}}classifyChanges(e){if(e.length>3)return!0;for(let t of e)if(t.status==="added"||t.status==="deleted"||t.file.endsWith(".gts"))return!0;return!1}generateCommitMessage(e,t,r){let n=e==="local"?"Push":e==="remote"?"Pull":"Manual";if(t.length===0)return{message:`${n}: No changes detected`,description:""};if(t.length===1){let u=t[0],f=u.status==="added"?"Add":u.status==="deleted"?"Delete":"Update";return{message:`${n}: ${f} ${u.file}`,description:""}}let s=t.filter(u=>u.status==="added"),o=t.filter(u=>u.status==="modified"),a=t.filter(u=>u.status==="deleted"),c=[];s.length>0&&c.push(`+${s.length}`),o.length>0&&c.push(`~${o.length}`),a.length>0&&c.push(`-${a.length}`);let l=`${n}: ${t.length} files (${c.join(", ")})`,p=[];return s.length>0&&(p.push("Added:"),s.forEach(u=>p.push(` + ${u.file}`))),o.length>0&&(p.push("Modified:"),o.forEach(u=>p.push(` ~ ${u.file}`))),a.length>0&&(p.push("Deleted:"),a.forEach(u=>p.push(` - ${u.file}`))),{message:l,description:p.join(`
78
78
  `)}}async getCheckpoints(e=50){if(!await this.isInitialized())return[];let r=await this.git("log","--format=%H|%h|%s|%aI|%an",`-${e}`);if(!r.trim())return[];let n=await this.getAllMilestones(),s=r.trim().split(`
79
- `).filter(o=>!(o.split("|")[2]??"").startsWith("[init]"));return Promise.all(s.map(o=>this.parseCheckpointLine(o,n)))}async parseCheckpointLine(e,t){let[r,n,s,o]=e.split("|"),a=s.includes("[MAJOR]"),c=s.includes("[local]")?"local":s.includes("[remote]")?"remote":"manual",l=s.replace(/\[(MAJOR|minor)\]\s*/i,"").replace(/\[(local|remote|manual)\]\s*/i,""),p=await this.getCommitStats(r),u=t.get(r),d=!!u;return{hash:r,shortHash:n,message:l,description:"",date:new Date(o),isMajor:a,source:c,isMilestone:d,milestoneName:u,...p}}async getCommitStats(e){try{let r=(await this.git("show","--stat","--format=",e)).trim().split(`
79
+ `).filter(o=>!(o.split("|")[2]??"").startsWith("[init]"));return Promise.all(s.map(o=>this.parseCheckpointLine(o,n)))}async parseCheckpointLine(e,t){let[r,n,s,o]=e.split("|"),a=s.includes("[MAJOR]"),c=s.includes("[local]")?"local":s.includes("[remote]")?"remote":"manual",l=s.replace(/\[(MAJOR|minor)\]\s*/i,"").replace(/\[(local|remote|manual)\]\s*/i,""),p=await this.getCommitStats(r),u=t.get(r),f=!!u;return{hash:r,shortHash:n,message:l,description:"",date:new Date(o),isMajor:a,source:c,isMilestone:f,milestoneName:u,...p}}async getCommitStats(e){try{let r=(await this.git("show","--stat","--format=",e)).trim().split(`
80
80
  `),n=r[r.length-1]||"",s=n.match(/(\d+) files? changed/),o=n.match(/(\d+) insertions?/),a=n.match(/(\d+) deletions?/);return{filesChanged:s?parseInt(s[1]):0,insertions:o?parseInt(o[1]):0,deletions:a?parseInt(a[1]):0}}catch{return{filesChanged:0,insertions:0,deletions:0}}}async getChangedFiles(e){return(await this.git("show","--name-only","--format=",e)).trim().split(`
81
- `).filter(Boolean)}async getDiff(e){return this.git("show","--format=",e)}async restore(e){let t=await this.getHistoryFiles();await Promise.all(t.map(async o=>{let a=B.join(this.gitDir,o);try{await X.unlink(a)}catch(c){if(c.code!=="ENOENT")throw c}})),await this.git("checkout",e,"--",".");let r=await this.getHistoryFiles(),n=new Set(r),s=await this.getWorkspaceFiles();await Promise.all(s.map(async o=>{if(!F(o)&&!n.has(o)){let a=B.join(this.workspaceDir,o);try{await X.unlink(a)}catch(c){if(c.code!=="ENOENT")throw c}}})),await Promise.all(r.map(async o=>{if(F(o))return;let a=B.join(this.gitDir,o),c=B.join(this.workspaceDir,o),l=B.dirname(c);await X.mkdir(l,{recursive:!0}),await X.copyFile(a,c)})),await this.git("checkout","HEAD","--",".")}async markMilestone(e,t){if(!await this.isInitialized())return null;let r;if(typeof e=="number"){let s=await this.getCheckpoints(e+1);if(e<1||e>s.length)return null;r=s[e-1].hash}else r=e;let n=`milestone/${t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-_.]/g,"")}`;try{return await this.git("tag","-a",n,r,"-m",`Milestone: ${t}`),{hash:r,name:t}}catch{return null}}async unmarkMilestone(e){if(!await this.isInitialized())return!1;let t;if(typeof e=="number"){let n=await this.getCheckpoints(e+1);if(e<1||e>n.length)return!1;t=n[e-1].hash}else t=e;let r=await this.getMilestoneTags(t);if(r.length===0)return!1;for(let n of r)try{await this.git("tag","-d",n)}catch{}return!0}async getMilestoneTags(e){try{return(await this.git("tag","--points-at",e)).trim().split(`
81
+ `).filter(Boolean)}async getDiff(e){return this.git("show","--format=",e)}async restore(e){let t=await this.getHistoryFiles();await Promise.all(t.map(async o=>{let a=Y.join(this.gitDir,o);try{await K.unlink(a)}catch(c){if(c.code!=="ENOENT")throw c}})),await this.git("checkout",e,"--",".");let r=await this.getHistoryFiles(),n=new Set(r),s=await this.getWorkspaceFiles();await Promise.all(s.map(async o=>{if(!U(o)&&!n.has(o)){let a=Y.join(this.workspaceDir,o);try{await K.unlink(a)}catch(c){if(c.code!=="ENOENT")throw c}}})),await Promise.all(r.map(async o=>{if(U(o))return;let a=Y.join(this.gitDir,o),c=Y.join(this.workspaceDir,o),l=Y.dirname(c);await K.mkdir(l,{recursive:!0}),await K.copyFile(a,c)})),await this.git("checkout","HEAD","--",".")}async markMilestone(e,t){if(!await this.isInitialized())return null;let r;if(typeof e=="number"){let s=await this.getCheckpoints(e+1);if(e<1||e>s.length)return null;r=s[e-1].hash}else r=e;let n=`milestone/${t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-_.]/g,"")}`;try{return await this.git("tag","-a",n,r,"-m",`Milestone: ${t}`),{hash:r,name:t}}catch{return null}}async unmarkMilestone(e){if(!await this.isInitialized())return!1;let t;if(typeof e=="number"){let n=await this.getCheckpoints(e+1);if(e<1||e>n.length)return!1;t=n[e-1].hash}else t=e;let r=await this.getMilestoneTags(t);if(r.length===0)return!1;for(let n of r)try{await this.git("tag","-d",n)}catch{}return!0}async getMilestoneTags(e){try{return(await this.git("tag","--points-at",e)).trim().split(`
82
82
  `).filter(r=>r.startsWith("milestone/")).filter(Boolean)}catch{return[]}}async getAllMilestones(){let e=new Map;try{let t=await this.git("tag","-l","milestone/*");for(let r of t.trim().split(`
83
83
  `).filter(Boolean))try{let n=(await this.git("rev-list","-1",r)).trim(),s=r.replace("milestone/","").replace(/-/g," ");e.set(n,s)}catch{}}catch{}return e}async getMilestones(){if(!await this.isInitialized())return[];let e=await this.getAllMilestones();if(e.size===0)return[];let r=await this.git("log","--no-walk","--format=%H|%h|%s|%aI|%an",...e.keys());return r.trim()?Promise.all(r.trim().split(`
84
- `).map(n=>this.parseCheckpointLine(n,e))):[]}git(...e){return new Promise((t,r)=>{let n=(0,Nl.spawn)("git",e,{cwd:this.gitDir}),s="",o="";n.stdout.on("data",a=>{s+=a.toString("utf-8")}),n.stderr.on("data",a=>{o+=a.toString("utf-8")}),n.on("error",a=>r(a)),n.on("close",a=>{if(a!==0&&!e.includes("status")){r(new Error(`git ${e.join(" ")} failed: ${o}`));return}t(s)})})}};function yi(i,e){let t=i.trim();if(t==="")return{kind:"none"};if(t.length===7){let n=e.filter(s=>s.shortHash===t);if(n.length===1)return{kind:"found",target:n[0]};if(n.length>1)return{kind:"ambiguous",matches:n}}if(/^\d+$/.test(t)){let n=parseInt(t,10);return n>=1&&n<=e.length?{kind:"found",target:e[n-1]}:{kind:"none"}}let r=e.filter(n=>n.hash.startsWith(t));return r.length===0?{kind:"none"}:r.length===1?{kind:"found",target:r[0]}:{kind:"ambiguous",matches:r}}var Fl=100;function wi(i){return i instanceof Error?i.message:String(i)}async function ob(i,e){if(!yt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let t=new q(i);if(!await t.isInitialized())return{ok:!0,checkpoints:[],truncated:!1};let r=await t.getCheckpoints(e+1),n=r.length>e;return{ok:!0,checkpoints:n?r.slice(0,e):r,truncated:n}}catch(t){return{ok:!1,error:`Failed to read checkpoint history: ${wi(t)}`}}}async function ab(i,e){if(!yt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};let t=e.trim();if(!t)return{ok:!1,error:"--message must not be empty."};try{let r=new q(i);await r.isInitialized()||await r.init();let n=await r.detectCurrentChanges(),s=await r.createCheckpoint("manual",n,t);return s?{ok:!0,created:s}:{ok:!1,error:"No changes to checkpoint."}}catch(r){return{ok:!1,error:`Failed to create checkpoint: ${wi(r)}`}}}async function cb(i,e,t){if(!yt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let r=new q(i);if(!await r.isInitialized())return{ok:!1,error:"No checkpoint history found for this workspace. Checkpoints are created automatically during sync operations."};let n=await r.getCheckpoints(t),s=yi(e,n);if(s.kind==="none")return{ok:!1,error:`Checkpoint not found: ${e}. Use a number (1-${n.length}) or a commit hash.`};if(s.kind==="ambiguous"){let o=s.matches.slice(0,5).map(c=>c.shortHash).join(", "),a=s.matches.length>5?", \u2026":"";return{ok:!1,error:`Ambiguous reference: ${e} matches ${s.matches.length} checkpoints (${o}${a}). Use a longer prefix or full hash.`}}return{ok:!0,target:s.target}}catch(r){return{ok:!1,error:`Failed to read checkpoint history: ${wi(r)}`}}}async function lb(i,e){if(!yt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let t=new q(i);return await t.isInitialized()?(await t.restore(e),{ok:!0}):{ok:!1,error:"No checkpoint history found for this workspace."}}catch(t){return{ok:!1,error:`Failed to restore checkpoint: ${wi(t)}`}}}function pb(i){return i==="local"?`${R}LOCAL${m}`:i==="remote"?`${_}SERVER${m}`:`${ce}MANUAL${m}`}function Ul(i){let e=Date.now()-i.getTime(),t=Math.floor(e/6e4),r=Math.floor(t/60),n=Math.floor(r/24);return n>7?`${i.toLocaleDateString()} ${i.toLocaleTimeString()}`:n>0?`${n} day${n===1?"":"s"} ago`:r>0?`${r} hour${r===1?"":"s"} ago`:t>0?`${t} minute${t===1?"":"s"} ago`:"just now"}function ub(i,e,t){if(i.length===0){console.log("No checkpoints found.");return}console.log(`
85
- ${ee}Checkpoint History${m}
86
- `);let r=String(i.length).length;i.forEach((n,s)=>{let o=s+1,a=`${g}${String(o).padStart(r," ")}${m}`,c=n.isMajor?`${A}[MAJOR]${m}`:`${g}[minor]${m}`,l=n.isMilestone?`${A}\u2B50${m} ${ce}[${n.milestoneName}]${m} `:"";console.log(`${a} ${A}${n.shortHash}${m} ${l}${pb(n.source)} ${c} ${n.message} ${g}(${n.filesChanged} files)${m}`),console.log(` ${g}${Ul(n.date)}${m}
87
- `)}),e&&console.log(`${g}Showing first ${t} checkpoints. Pass --limit <n> to see more.${m}`),console.log(`${g}Restore: boxel realm history <local-dir> -r <ref>${m}`)}function mb(i){if(i===void 0)return Fl;if(!/^\d+$/.test(i))return null;let e=parseInt(i,10);return e>0?e:null}function Fe(i){console.error(`${h}Error:${m} ${i}`),process.exit(1)}function Dl(i){i.command("history").alias("hist").description("View, restore, or create local checkpoints stored under .boxel-history/").argument("<local-dir>","The local workspace directory").option("-r, --restore <ref>","Restore the workspace to a checkpoint (1-based index, short hash, or full hash)").option("-m, --message <message>","Create a manual checkpoint with the given message").option("-y, --yes","Skip the interactive confirmation prompt before --restore").option("--limit <n>",`Maximum number of checkpoints to list or consider for --restore (default: ${Fl})`).action(async(e,t)=>{t.restore!==void 0&&t.message!==void 0&&Fe("Only one of --restore or --message may be specified.");let r=mb(t.limit);if(r===null&&Fe("--limit must be a positive integer."),t.message!==void 0){let s=await ab(e,t.message);s.ok||Fe(s.error),console.log(`${R}\u2713${m} Checkpoint created: ${A}${s.created.shortHash}${m} ${s.created.message}`);return}if(t.restore!==void 0){let s=await cb(e,t.restore,r);s.ok||Fe(s.error);let o=s.target;if(!t.yes){process.stdin.isTTY||Fe("--restore overwrites local files. Pass --yes to confirm in non-interactive mode."),console.log(`
88
- ${ee}Restoring to:${m} ${A}${o.shortHash}${m} - ${o.message}`),console.log(`${g}${Ul(o.date)}${m}
89
- `);let c=await te(`${A}This will overwrite current files. Continue? (y/N) ${m}`);if(!/^y/i.test(c)){console.log(`${g}Restore cancelled.${m}`);return}}let a=await lb(e,o.hash);a.ok||Fe(a.error),console.log(`${R}\u2713${m} Restored to ${A}${o.shortHash}${m} ${o.message}`),console.log(`${g}Run 'boxel realm sync <local-dir> <realm-url> --prefer-local' to push the restored state to the realm.${m}`);return}let n=await ob(e,r);n.ok||Fe(n.error),ub(n.checkpoints,n.truncated,r)})}var db="--all-accessible and --hidden are mutually exclusive";async function fb(i={}){if(i.allAccessible&&i.hidden)return{realms:[],error:db};let e=i.profileManager??C(),t=e.getActiveProfile();if(!t)return{realms:[],error:P};let r=t.profile.realmServerUrl.replace(/\/$/,""),n=await e.authedRealmServerFetch(`${r}/_realm-auth`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!n.ok){let p=await n.text();return{realms:[],error:`Realm auth lookup failed: ${n.status} ${p}`}}let s=await n.json(),o=Object.keys(s).map(k),a;try{a=await e.getUserRealms()}catch(p){return{realms:[],error:`Failed to load UI realm list: ${p instanceof Error?p.message:String(p)}`}}let c=new Set(a.map(k)),l=o.map(p=>({url:p,hidden:!c.has(p)}));return i.allAccessible||(i.hidden?l=l.filter(p=>p.hidden):l=l.filter(p=>!p.hidden)),l.sort((p,u)=>p.url.localeCompare(u.url)),{realms:l}}function ql(i){i.command("list").alias("ls").description("List realms accessible to the active profile").option("--json","Output JSON").option("--all-accessible","Show all accessible realms, including hidden ones").option("--hidden","Show only realms not in the user's UI realm list").action(async e=>{let t;try{t=await fb({allAccessible:e.allAccessible,hidden:e.hidden})}catch(r){console.error(`${h}Error:${m} ${r instanceof Error?r.message:String(r)}`),process.exit(1)}if(e.json){console.log(JSON.stringify(t,null,2)),t.error&&process.exit(1);return}if(t.error&&(console.error(`${h}Error:${m} ${t.error}`),process.exit(1)),t.realms.length===0){console.log(`${g}No realms found.${m}`);return}console.log(`${ee}${t.realms.length} realm(s):${m}`);for(let r of t.realms){let n=r.hidden?` ${g}(hidden)${m}`:"";console.log(` ${_}${r.url}${m}${n}`)}})}var Ri=T(require("fs"));var xn=100;function $i(i){return i instanceof Error?i.message:String(i)}function hb(i){let e=Date.now()-i.getTime(),t=Math.floor(e/6e4),r=Math.floor(t/60),n=Math.floor(r/24);return n>7?`${i.toLocaleDateString()} ${i.toLocaleTimeString()}`:n>0?`${n} day${n===1?"":"s"} ago`:r>0?`${r} hour${r===1?"":"s"} ago`:t>0?`${t} minute${t===1?"":"s"} ago`:"just now"}async function Gl(i,e,t){try{let r=new q(i);if(!await r.isInitialized())return{ok:!1,error:"No checkpoint history found for this workspace. Checkpoints are created automatically during sync operations."};let n=await r.getCheckpoints(t),s=yi(e,n);if(s.kind==="none")return{ok:!1,error:`Checkpoint not found: ${e}. Use a number (1-${n.length}) or a commit hash.`};if(s.kind==="ambiguous"){let o=s.matches.slice(0,5).map(c=>c.shortHash).join(", "),a=s.matches.length>5?", \u2026":"";return{ok:!1,error:`Ambiguous reference: ${e} matches ${s.matches.length} checkpoints (${o}${a}). Use a longer prefix or full hash.`}}return{ok:!0,target:s.target}}catch(r){return{ok:!1,error:`Failed to read checkpoints: ${$i(r)}`}}}async function gb(i){if(!Ri.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let e=new q(i);return await e.isInitialized()?{ok:!0,milestones:await e.getMilestones()}:{ok:!0,milestones:[]}}catch(e){return{ok:!1,error:`Failed to read milestones: ${$i(e)}`}}}async function xb(i,e,t,r){if(!Ri.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};let n=t.trim();if(!n)return{ok:!1,error:"--name must not be empty."};let s=await Gl(i,e,r);if(!s.ok)return s;try{let o=new q(i);if(!await o.markMilestone(s.target.hash,n))return{ok:!1,error:"Could not mark milestone. The checkpoint may already have one."};let l=(await o.getCheckpoints(r)).find(p=>p.hash===s.target.hash);return l?{ok:!0,marked:l}:{ok:!1,error:"Milestone created but checkpoint could not be re-read."}}catch(o){return{ok:!1,error:`Failed to mark milestone: ${$i(o)}`}}}async function vb(i,e,t){if(!Ri.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};let r=await Gl(i,e,t);if(!r.ok)return r;let n=r.target;if(!n.isMilestone)return{ok:!1,error:`Checkpoint ${n.shortHash} is not marked as a milestone.`};try{return{ok:!0,removed:await new q(i).unmarkMilestone(n.hash)}}catch(s){return{ok:!1,error:`Failed to remove milestone: ${$i(s)}`}}}async function bb(i,e={}){if(e.mark!==void 0&&e.remove!==void 0)return{ok:!1,error:"Only one of --mark or --remove may be specified."};if(e.limit!==void 0&&(!Number.isInteger(e.limit)||e.limit<=0))return{ok:!1,error:"limit must be a positive integer."};let t=e.limit??xn;if(e.mark!==void 0){if(e.name===void 0)return{ok:!1,error:"--name is required when using --mark."};let n=await xb(i,e.mark,e.name,t);return n.ok?{ok:!0,marked:n.marked}:{ok:!1,error:n.error}}if(e.remove!==void 0){let n=await vb(i,e.remove,t);return n.ok?{ok:!0,removed:n.removed}:{ok:!1,error:n.error}}let r=await gb(i);return r.ok?{ok:!0,milestones:r.milestones}:{ok:!1,error:r.error}}function yb(i,e){if(i.length===0){console.log(`
84
+ `).map(n=>this.parseCheckpointLine(n,e))):[]}git(...e){return new Promise((t,r)=>{let n=(0,Dl.spawn)("git",e,{cwd:this.gitDir}),s="",o="";n.stdout.on("data",a=>{s+=a.toString("utf-8")}),n.stderr.on("data",a=>{o+=a.toString("utf-8")}),n.on("error",a=>r(a)),n.on("close",a=>{if(a!==0&&!e.includes("status")){r(new Error(`git ${e.join(" ")} failed: ${o}`));return}t(s)})})}};function Ri(i,e){let t=i.trim();if(t==="")return{kind:"none"};if(t.length===7){let n=e.filter(s=>s.shortHash===t);if(n.length===1)return{kind:"found",target:n[0]};if(n.length>1)return{kind:"ambiguous",matches:n}}if(/^\d+$/.test(t)){let n=parseInt(t,10);return n>=1&&n<=e.length?{kind:"found",target:e[n-1]}:{kind:"none"}}let r=e.filter(n=>n.hash.startsWith(t));return r.length===0?{kind:"none"}:r.length===1?{kind:"found",target:r[0]}:{kind:"ambiguous",matches:r}}var ql=100;function $i(i){return i instanceof Error?i.message:String(i)}async function xb(i,e){if(!Rt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let t=new H(i);if(!await t.isInitialized())return{ok:!0,checkpoints:[],truncated:!1};let r=await t.getCheckpoints(e+1),n=r.length>e;return{ok:!0,checkpoints:n?r.slice(0,e):r,truncated:n}}catch(t){return{ok:!1,error:`Failed to read checkpoint history: ${$i(t)}`}}}async function vb(i,e){if(!Rt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};let t=e.trim();if(!t)return{ok:!1,error:"--message must not be empty."};try{let r=new H(i);await r.isInitialized()||await r.init();let n=await r.detectCurrentChanges(),s=await r.createCheckpoint("manual",n,t);return s?{ok:!0,created:s}:{ok:!1,error:"No changes to checkpoint."}}catch(r){return{ok:!1,error:`Failed to create checkpoint: ${$i(r)}`}}}async function bb(i,e,t){if(!Rt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let r=new H(i);if(!await r.isInitialized())return{ok:!1,error:"No checkpoint history found for this workspace. Checkpoints are created automatically during sync operations."};let n=await r.getCheckpoints(t),s=Ri(e,n);if(s.kind==="none")return{ok:!1,error:`Checkpoint not found: ${e}. Use a number (1-${n.length}) or a commit hash.`};if(s.kind==="ambiguous"){let o=s.matches.slice(0,5).map(c=>c.shortHash).join(", "),a=s.matches.length>5?", \u2026":"";return{ok:!1,error:`Ambiguous reference: ${e} matches ${s.matches.length} checkpoints (${o}${a}). Use a longer prefix or full hash.`}}return{ok:!0,target:s.target}}catch(r){return{ok:!1,error:`Failed to read checkpoint history: ${$i(r)}`}}}async function yb(i,e){if(!Rt.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let t=new H(i);return await t.isInitialized()?(await t.restore(e),{ok:!0}):{ok:!1,error:"No checkpoint history found for this workspace."}}catch(t){return{ok:!1,error:`Failed to restore checkpoint: ${$i(t)}`}}}function wb(i){return i==="local"?`${R}LOCAL${m}`:i==="remote"?`${_}SERVER${m}`:`${pe}MANUAL${m}`}function Hl(i){let e=Date.now()-i.getTime(),t=Math.floor(e/6e4),r=Math.floor(t/60),n=Math.floor(r/24);return n>7?`${i.toLocaleDateString()} ${i.toLocaleTimeString()}`:n>0?`${n} day${n===1?"":"s"} ago`:r>0?`${r} hour${r===1?"":"s"} ago`:t>0?`${t} minute${t===1?"":"s"} ago`:"just now"}function Eb(i,e,t){if(i.length===0){console.log("No checkpoints found.");return}console.log(`
85
+ ${ie}Checkpoint History${m}
86
+ `);let r=String(i.length).length;i.forEach((n,s)=>{let o=s+1,a=`${x}${String(o).padStart(r," ")}${m}`,c=n.isMajor?`${L}[MAJOR]${m}`:`${x}[minor]${m}`,l=n.isMilestone?`${L}\u2B50${m} ${pe}[${n.milestoneName}]${m} `:"";console.log(`${a} ${L}${n.shortHash}${m} ${l}${wb(n.source)} ${c} ${n.message} ${x}(${n.filesChanged} files)${m}`),console.log(` ${x}${Hl(n.date)}${m}
87
+ `)}),e&&console.log(`${x}Showing first ${t} checkpoints. Pass --limit <n> to see more.${m}`),console.log(`${x}Restore: boxel realm history <local-dir> -r <ref>${m}`)}function Rb(i){if(i===void 0)return ql;if(!/^\d+$/.test(i))return null;let e=parseInt(i,10);return e>0?e:null}function De(i){console.error(`${g}Error:${m} ${i}`),process.exit(1)}function Wl(i){i.command("history").alias("hist").description("View, restore, or create local checkpoints stored under .boxel-history/").argument("<local-dir>","The local workspace directory").option("-r, --restore <ref>","Restore the workspace to a checkpoint (1-based index, short hash, or full hash)").option("-m, --message <message>","Create a manual checkpoint with the given message").option("-y, --yes","Skip the interactive confirmation prompt before --restore").option("--limit <n>",`Maximum number of checkpoints to list or consider for --restore (default: ${ql})`).action(async(e,t)=>{t.restore!==void 0&&t.message!==void 0&&De("Only one of --restore or --message may be specified.");let r=Rb(t.limit);if(r===null&&De("--limit must be a positive integer."),t.message!==void 0){let s=await vb(e,t.message);s.ok||De(s.error),console.log(`${R}\u2713${m} Checkpoint created: ${L}${s.created.shortHash}${m} ${s.created.message}`);return}if(t.restore!==void 0){let s=await bb(e,t.restore,r);s.ok||De(s.error);let o=s.target;if(!t.yes){process.stdin.isTTY||De("--restore overwrites local files. Pass --yes to confirm in non-interactive mode."),console.log(`
88
+ ${ie}Restoring to:${m} ${L}${o.shortHash}${m} - ${o.message}`),console.log(`${x}${Hl(o.date)}${m}
89
+ `);let c=await re(`${L}This will overwrite current files. Continue? (y/N) ${m}`);if(!/^y/i.test(c)){console.log(`${x}Restore cancelled.${m}`);return}}let a=await yb(e,o.hash);a.ok||De(a.error),console.log(`${R}\u2713${m} Restored to ${L}${o.shortHash}${m} ${o.message}`),console.log(`${x}Run 'boxel realm sync <local-dir> <realm-url> --prefer-local' to push the restored state to the realm.${m}`);return}let n=await xb(e,r);n.ok||De(n.error),Eb(n.checkpoints,n.truncated,r)})}var $b="--all-accessible and --hidden are mutually exclusive";async function kb(i={}){if(i.allAccessible&&i.hidden)return{realms:[],error:$b};let e=i.profileManager??C(),t=e.getActiveProfile();if(!t)return{realms:[],error:A};let r=t.profile.realmServerUrl.replace(/\/$/,""),n=await e.authedRealmServerFetch(`${r}/_realm-auth`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!n.ok){let p=await n.text();return{realms:[],error:`Realm auth lookup failed: ${n.status} ${p}`}}let s=await n.json(),o=Object.keys(s).map(k),a;try{a=await e.getUserRealms()}catch(p){return{realms:[],error:`Failed to load UI realm list: ${p instanceof Error?p.message:String(p)}`}}let c=new Set(a.map(k)),l=o.map(p=>({url:p,hidden:!c.has(p)}));return i.allAccessible||(i.hidden?l=l.filter(p=>p.hidden):l=l.filter(p=>!p.hidden)),l.sort((p,u)=>p.url.localeCompare(u.url)),{realms:l}}function Gl(i){i.command("list").alias("ls").description("List realms accessible to the active profile").option("--json","Output JSON").option("--all-accessible","Show all accessible realms, including hidden ones").option("--hidden","Show only realms not in the user's UI realm list").action(async e=>{let t;try{t=await kb({allAccessible:e.allAccessible,hidden:e.hidden})}catch(r){console.error(`${g}Error:${m} ${r instanceof Error?r.message:String(r)}`),process.exit(1)}if(e.json){console.log(JSON.stringify(t,null,2)),t.error&&process.exit(1);return}if(t.error&&(console.error(`${g}Error:${m} ${t.error}`),process.exit(1)),t.realms.length===0){console.log(`${x}No realms found.${m}`);return}console.log(`${ie}${t.realms.length} realm(s):${m}`);for(let r of t.realms){let n=r.hidden?` ${x}(hidden)${m}`:"";console.log(` ${_}${r.url}${m}${n}`)}})}var Si=P(require("fs"));var bn=100;function _i(i){return i instanceof Error?i.message:String(i)}function Sb(i){let e=Date.now()-i.getTime(),t=Math.floor(e/6e4),r=Math.floor(t/60),n=Math.floor(r/24);return n>7?`${i.toLocaleDateString()} ${i.toLocaleTimeString()}`:n>0?`${n} day${n===1?"":"s"} ago`:r>0?`${r} hour${r===1?"":"s"} ago`:t>0?`${t} minute${t===1?"":"s"} ago`:"just now"}async function Vl(i,e,t){try{let r=new H(i);if(!await r.isInitialized())return{ok:!1,error:"No checkpoint history found for this workspace. Checkpoints are created automatically during sync operations."};let n=await r.getCheckpoints(t),s=Ri(e,n);if(s.kind==="none")return{ok:!1,error:`Checkpoint not found: ${e}. Use a number (1-${n.length}) or a commit hash.`};if(s.kind==="ambiguous"){let o=s.matches.slice(0,5).map(c=>c.shortHash).join(", "),a=s.matches.length>5?", \u2026":"";return{ok:!1,error:`Ambiguous reference: ${e} matches ${s.matches.length} checkpoints (${o}${a}). Use a longer prefix or full hash.`}}return{ok:!0,target:s.target}}catch(r){return{ok:!1,error:`Failed to read checkpoints: ${_i(r)}`}}}async function _b(i){if(!Si.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};try{let e=new H(i);return await e.isInitialized()?{ok:!0,milestones:await e.getMilestones()}:{ok:!0,milestones:[]}}catch(e){return{ok:!1,error:`Failed to read milestones: ${_i(e)}`}}}async function Cb(i,e,t,r){if(!Si.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};let n=t.trim();if(!n)return{ok:!1,error:"--name must not be empty."};let s=await Vl(i,e,r);if(!s.ok)return s;try{let o=new H(i);if(!await o.markMilestone(s.target.hash,n))return{ok:!1,error:"Could not mark milestone. The checkpoint may already have one."};let l=(await o.getCheckpoints(r)).find(p=>p.hash===s.target.hash);return l?{ok:!0,marked:l}:{ok:!1,error:"Milestone created but checkpoint could not be re-read."}}catch(o){return{ok:!1,error:`Failed to mark milestone: ${_i(o)}`}}}async function Tb(i,e,t){if(!Si.existsSync(i))return{ok:!1,error:`Directory not found: ${i}`};let r=await Vl(i,e,t);if(!r.ok)return r;let n=r.target;if(!n.isMilestone)return{ok:!1,error:`Checkpoint ${n.shortHash} is not marked as a milestone.`};try{return{ok:!0,removed:await new H(i).unmarkMilestone(n.hash)}}catch(s){return{ok:!1,error:`Failed to remove milestone: ${_i(s)}`}}}async function Ob(i,e={}){if(e.mark!==void 0&&e.remove!==void 0)return{ok:!1,error:"Only one of --mark or --remove may be specified."};if(e.limit!==void 0&&(!Number.isInteger(e.limit)||e.limit<=0))return{ok:!1,error:"limit must be a positive integer."};let t=e.limit??bn;if(e.mark!==void 0){if(e.name===void 0)return{ok:!1,error:"--name is required when using --mark."};let n=await Cb(i,e.mark,e.name,t);return n.ok?{ok:!0,marked:n.marked}:{ok:!1,error:n.error}}if(e.remove!==void 0){let n=await Tb(i,e.remove,t);return n.ok?{ok:!0,removed:n.removed}:{ok:!1,error:n.error}}let r=await _b(i);return r.ok?{ok:!0,milestones:r.milestones}:{ok:!1,error:r.error}}function Pb(i,e){if(i.length===0){console.log(`
90
90
  No milestones marked yet.
91
91
  `),console.log(`Use ${_}boxel realm milestone <local-dir> --mark <ref> --name <name>${m} to mark a checkpoint.`),console.log(`Use ${_}boxel realm history <local-dir>${m} to see available checkpoints.
92
92
  `);return}console.log(`
93
- ${ee}Milestones${m} ${g}(${e})${m}
94
- `);for(let t of i){let r=t.source==="local"?"\u2191":t.source==="remote"?"\u2193":"\u25CF",n=t.source==="local"?R:t.source==="remote"?_:ce;console.log(` ${A}\u2B50${m} ${A}${t.shortHash}${m} ${n}${r}${m} ${ce}[${t.milestoneName}]${m} ${t.message}`),console.log(` ${g}${hb(t.date)}${m}`)}console.log()}function wb(i){if(i===void 0)return xn;if(!/^\d+$/.test(i))return null;let e=parseInt(i,10);return e>0?e:null}function Ei(i){console.error(`${h}Error:${m} ${i}`),process.exit(1)}function Hl(i){i.command("milestone").description("List, mark, or remove milestones in the local .boxel-history/ checkpoint log").argument("<local-dir>","The local workspace directory").option("--mark <ref>","Mark a checkpoint as a milestone (1-based index, short hash, or full hash)").option("--name <name>","Name for the milestone (required with --mark)").option("--remove <ref>","Remove the milestone tag from a checkpoint (1-based index, short hash, or full hash)").option("--limit <n>",`Maximum number of checkpoints to consider for ref resolution (default: ${xn})`).option("--json","Output result as JSON").action(async(e,t)=>{t.mark!==void 0&&t.remove!==void 0&&Ei("Only one of --mark or --remove may be specified.");let r=wb(t.limit);r===null&&Ei("--limit must be a positive integer."),t.mark!==void 0&&t.name===void 0&&Ei("--name is required when using --mark.");let n=await bb(e,{mark:t.mark,name:t.name,remove:t.remove,limit:r});if(t.json){j.output(JSON.stringify(n,null,2)),n.ok||process.exit(1);return}if(n.ok||Ei(n.error),n.marked){let s=n.marked;console.log(`
95
- ${R}\u2713${m} ${A}\u2B50${m} Milestone created: ${ce}${s.milestoneName}${m}`),console.log(` Checkpoint: ${A}${s.shortHash}${m} ${s.message}`),console.log();return}if(n.removed!==void 0){console.log(`${R}\u2713${m} Milestone removed`);return}yb(n.milestones,e)})}async function vn(i,e={}){let t=k(i),r=e.profileManager??C(),n=r.getActiveProfile();if(!n)return{publishedRealmURL:t,unpublished:!1,error:P};let s=n.profile.realmServerUrl.replace(/\/$/,""),o;try{o=await r.authedRealmServerFetch(`${s}/_unpublish-realm`,{method:"POST",headers:{Accept:"application/vnd.api+json","Content-Type":"application/json"},body:JSON.stringify({publishedRealmURL:t})})}catch(l){return{publishedRealmURL:t,unpublished:!1,error:`Failed to reach realm server: ${l instanceof Error?l.message:String(l)}`}}if(o.ok)return{publishedRealmURL:t,unpublished:!0};let a=await Eb(o);return o.status===404||o.status===422&&/not found/i.test(a)?e.tolerateMissing?{publishedRealmURL:t,unpublished:!1,notFound:!0}:{publishedRealmURL:t,unpublished:!1,notFound:!0,error:`Published realm ${t} is not currently published`}:{publishedRealmURL:t,unpublished:!1,error:`Realm server returned ${o.status}: ${a.slice(0,500)}`}}async function Eb(i){try{return await i.text()}catch{return"<no response body>"}}function Wl(i){i.command("unpublish").description("Unpublish a published realm by its public-facing URL").argument("<published-realm-url>","URL of the published realm to remove").option("--tolerate-missing","Exit successfully when the realm is already unpublished").action(async(e,t)=>{let r=await vn(e,{tolerateMissing:t.tolerateMissing===!0});if(r.error&&(console.error(`${h}Error:${m} ${r.error}`),process.exit(1)),r.notFound){console.log(`Already unpublished: ${_}${r.publishedRealmURL}${m}`);return}console.log(`${R}Unpublished:${m} ${_}${r.publishedRealmURL}${m}`)})}var zl=3e5,Rb=1e3;async function $b(i,e,t={}){let r=t.profileManager??C(),n=r.getActiveProfile();if(!n)throw new Error(P);let s=k(i),o=k(e),a=n.profile.realmServerUrl.replace(/\/$/,""),c=await Vl(r,a,s,o);if((c.status===400||c.status===409)&&t.republish!==!1){let d=await Bl(c);console.log(`Publish returned ${c.status} (${d.slice(0,200)}). Unpublishing and retrying.`);let f=await vn(o,{profileManager:r,tolerateMissing:!0});if(!f.unpublished&&!f.notFound)throw new Error(`Conflict on publish; unpublish-then-retry also failed: ${f.error??"unknown"}`);c=await Vl(r,a,s,o)}if(c.status!==200&&c.status!==201&&c.status!==202){let d=await Bl(c);throw new Error(`Publish failed: HTTP ${c.status}: ${d.slice(0,1e3)}`)}let l=await c.json(),p=l?.data?.attributes;if(!p?.publishedRealmURL)throw new Error(`Publish response missing data.attributes.publishedRealmURL: ${JSON.stringify(l).slice(0,500)}`);let u={publishedRealmURL:k(p.publishedRealmURL),publishedRealmId:l.data.id,lastPublishedAt:p.lastPublishedAt,status:p.status};if(t.waitForReady!==!1){let d=t.timeoutMs??zl,f;try{let x=await r.getOrRefreshServerToken();f=await r.fetchAndStoreRealmToken(u.publishedRealmURL,x)}catch{}await kb(u.publishedRealmURL,f,d)}return u}async function Vl(i,e,t,r){return i.authedRealmServerFetch(`${e}/_publish-realm`,{method:"POST",headers:{Accept:"application/vnd.api+json","Content-Type":"application/json"},body:JSON.stringify({sourceRealmURL:t,publishedRealmURL:r})})}async function kb(i,e,t){let r=new URL("_readiness-check",i).href,n=Date.now(),s;for(;Date.now()-n<t;){try{let a={Accept:"application/vnd.api+json"};e&&(a.Authorization=e);let c=await fetch(r,{headers:a});if(c.ok)return;s=`HTTP ${c.status}`}catch(a){s=a instanceof Error?a.message:String(a)}let o=t-(Date.now()-n);if(o<=0)break;await new Promise(a=>setTimeout(a,Math.min(Rb,o)))}throw new Error(`Timed out after ${t}ms waiting for ${i} to pass readiness check${s?`: ${s}`:""}`)}async function Bl(i){try{return await i.text()}catch{return"<no response body>"}}function Sb(i){return{waitForReady:i.wait!==!1,timeoutMs:i.timeout,republish:i.republish!==!1}}function Yl(i){i.command("publish").description("Publish a source realm to a published-realm URL, polling readiness until ready").argument("<source-realm-url>","URL of the source realm to publish").argument("<published-realm-url>","Public-facing URL the published copy will serve at").option("--no-wait","Return as soon as the server accepts the publish").option("--timeout <ms>",`Readiness-poll timeout in milliseconds (default: ${zl})`,_b).option("--no-republish","Do not auto-unpublish + retry when the server returns 400/409").action(async(e,t,r)=>{try{let n=await $b(e,t,Sb(r));console.log(`${R}Published:${m} ${_}${n.publishedRealmURL}${m}`)}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}})}function _b(i){let e=Number.parseInt(i,10);if(!Number.isFinite(e)||e<0||String(e)!==i.trim())throw new Error("--timeout must be a non-negative integer (milliseconds).");return e}var Jl=T(Ur()),Xl="realm_server";function Cb(i){let{hostname:e}=new URL(i);if(e==="localhost"||e.endsWith(".localhost"))return"localhost";let t=e.split(".");return t.length<=2?e:t.slice(-2).join(".")}function Ob(i,e=Xl){return`@${e}:${Cb(i)}`}function Tb(i){return new URL(i).origin+"/"}function Pb(i){try{return new URL(i).href.replace(/\/+$/,"")+"/"}catch{throw new Error(`Invalid realm URL: ${i}`)}}var ki=class{#e;#t;#i;#n;#r=new Map;constructor(e){if(!e.seed)throw new Error("SeedAuthenticator requires a non-empty seed");this.#e=e.seed,this.#t=e.botUsername??Xl,this.#i=e.botUserId,this.#n=e.expiresIn??"7d"}buildClaims(e){let t=Pb(e);return{user:this.#i??Ob(t,this.#t),realm:t,sessionRoom:void 0,permissions:[],realmServerURL:Tb(t)}}mintTokenForRealm(e){let t=this.buildClaims(e),r=this.#r.get(t.realm);if(r)return r;let n=Jl.default.sign(t,this.#e,{expiresIn:this.#n});return this.#r.set(t.realm,n),n}#s(e){for(let s of this.#r.keys())if(e.startsWith(s))return s;let t=new URL(e),r=t.pathname.split("/").filter(Boolean),n=r.length>0?`/${r.slice(0,2).join("/")}/`:"/";return`${t.origin}${n}`}async authedRealmFetch(e,t){let r=e instanceof Request?e.url:e instanceof URL?e.href:e,n=this.#s(r),s=this.mintTokenForRealm(n),o=this.#o(e,t,s);return fetch(e,{...t,headers:o})}#o(e,t,r){let n=e instanceof Request?new Headers(e.headers):new Headers,s=new Headers(t?.headers);for(let[o,a]of s)n.set(o,a);return n.has("Authorization")||n.set("Authorization",r),n}registerRealmUrl(e){this.mintTokenForRealm(e)}};function be(i){if(i.realmSecretSeed)try{let t=new ki({seed:i.realmSecretSeed});return t.registerRealmUrl(i.realmUrl),{ok:!0,authenticator:t,mode:"seed"}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}let e=i.profileManager??C();return e.getActiveProfile()?{ok:!0,authenticator:e,mode:"profile"}:{ok:!1,error:P}}var Si=T(require("fs/promises")),Kl=T(require("path")),bn=class extends le{constructor(t,r){super(t,r);this.pullOptions=t}hasError=!1;downloadedFiles=[];async sync(){console.log(`Starting pull from ${this.options.realmUrl} to ${this.options.localDir}`),console.log("Testing realm access...");try{await this.getRemoteFileList("")}catch(c){throw console.error("Failed to access realm:",c),new Error("Cannot proceed with pull: Authentication or access failed. Please check your credentials and realm permissions.")}console.log("Realm access verified");let[t,r]=await Promise.all([this.getRemoteFileList(),this.getLocalFileList()]);if(console.log(`Found ${t.size} files in remote realm`),console.log(`Found ${r.size} files in local directory`),this.options.dryRun)try{await Si.access(this.options.localDir)}catch{console.log(`[DRY RUN] Would create directory: ${this.options.localDir}`)}else await Si.mkdir(this.options.localDir,{recursive:!0});let n=new Set;if(this.pullOptions.deleteLocal)for(let c of r.keys())t.has(c)||n.add(c);let s=new q(this.options.localDir);if(n.size>0&&!this.options.dryRun){let c=Array.from(n).map(p=>({file:p,status:"deleted"})),l=await s.createCheckpoint("remote",c,`Pre-delete checkpoint: ${n.size} files not on server`);l&&console.log(`
96
- Checkpoint created before deletion: ${l.shortHash}`)}let o=await Promise.all(Array.from(t.keys()).map(c=>this.remoteLimit(async()=>{try{let l=Kl.join(this.options.localDir,c);return await this.downloadFile(c,l),c}catch(l){return this.hasError=!0,console.error(`Error downloading ${c}:`,l),null}})));this.downloadedFiles=o.filter(c=>c!==null);let a=[];if(n.size>0&&(console.log(`
93
+ ${ie}Milestones${m} ${x}(${e})${m}
94
+ `);for(let t of i){let r=t.source==="local"?"\u2191":t.source==="remote"?"\u2193":"\u25CF",n=t.source==="local"?R:t.source==="remote"?_:pe;console.log(` ${L}\u2B50${m} ${L}${t.shortHash}${m} ${n}${r}${m} ${pe}[${t.milestoneName}]${m} ${t.message}`),console.log(` ${x}${Sb(t.date)}${m}`)}console.log()}function Ab(i){if(i===void 0)return bn;if(!/^\d+$/.test(i))return null;let e=parseInt(i,10);return e>0?e:null}function ki(i){console.error(`${g}Error:${m} ${i}`),process.exit(1)}function Bl(i){i.command("milestone").description("List, mark, or remove milestones in the local .boxel-history/ checkpoint log").argument("<local-dir>","The local workspace directory").option("--mark <ref>","Mark a checkpoint as a milestone (1-based index, short hash, or full hash)").option("--name <name>","Name for the milestone (required with --mark)").option("--remove <ref>","Remove the milestone tag from a checkpoint (1-based index, short hash, or full hash)").option("--limit <n>",`Maximum number of checkpoints to consider for ref resolution (default: ${bn})`).option("--json","Output result as JSON").action(async(e,t)=>{t.mark!==void 0&&t.remove!==void 0&&ki("Only one of --mark or --remove may be specified.");let r=Ab(t.limit);r===null&&ki("--limit must be a positive integer."),t.mark!==void 0&&t.name===void 0&&ki("--name is required when using --mark.");let n=await Ob(e,{mark:t.mark,name:t.name,remove:t.remove,limit:r});if(t.json){I.output(JSON.stringify(n,null,2)),n.ok||process.exit(1);return}if(n.ok||ki(n.error),n.marked){let s=n.marked;console.log(`
95
+ ${R}\u2713${m} ${L}\u2B50${m} Milestone created: ${pe}${s.milestoneName}${m}`),console.log(` Checkpoint: ${L}${s.shortHash}${m} ${s.message}`),console.log();return}if(n.removed!==void 0){console.log(`${R}\u2713${m} Milestone removed`);return}Pb(n.milestones,e)})}function Ci(i){let e=i instanceof Error?i.message:String(i);if(i instanceof Error&&i.cause!=null){let t=i.cause,r=t instanceof Error?t.message:String(t);return`${e} (caused by: ${r})`}return e}async function yn(i,e={}){let t=k(i),r=e.profileManager??C(),n=r.getActiveProfile();if(!n)return{publishedRealmURL:t,unpublished:!1,error:A};let s=n.profile.realmServerUrl.replace(/\/$/,""),o;try{o=await r.authedRealmServerFetch(`${s}/_unpublish-realm`,{method:"POST",headers:{Accept:"application/vnd.api+json","Content-Type":"application/json"},body:JSON.stringify({publishedRealmURL:t})})}catch(l){return{publishedRealmURL:t,unpublished:!1,error:`Failed to reach realm server: ${Ci(l)}`}}if(o.ok)return{publishedRealmURL:t,unpublished:!0};let a=await Lb(o);return o.status===404||o.status===422&&/not found/i.test(a)?e.tolerateMissing?{publishedRealmURL:t,unpublished:!1,notFound:!0}:{publishedRealmURL:t,unpublished:!1,notFound:!0,error:`Published realm ${t} is not currently published`}:{publishedRealmURL:t,unpublished:!1,error:`Realm server returned ${o.status}: ${a.slice(0,500)}`}}async function Lb(i){try{return await i.text()}catch{return"<no response body>"}}function zl(i){i.command("unpublish").description("Unpublish a published realm by its public-facing URL").argument("<published-realm-url>","URL of the published realm to remove").option("--tolerate-missing","Exit successfully when the realm is already unpublished").action(async(e,t)=>{let r=await yn(e,{tolerateMissing:t.tolerateMissing===!0});if(r.error&&(console.error(`${g}Error:${m} ${r.error}`),process.exit(1)),r.notFound){console.log(`Already unpublished: ${_}${r.publishedRealmURL}${m}`);return}console.log(`${R}Unpublished:${m} ${_}${r.publishedRealmURL}${m}`)})}var Xl=3e5,jb=1e3;async function Mb(i,e,t={}){let r=t.profileManager??C(),n=r.getActiveProfile();if(!n)throw new Error(A);let s=k(i),o=k(e),a=n.profile.realmServerUrl.replace(/\/$/,""),c=await Yl(r,a,s,o);if((c.status===400||c.status===409)&&t.republish!==!1){let f=await Jl(c);console.log(`Publish returned ${c.status} (${f.slice(0,200)}). Unpublishing and retrying.`);let d=await yn(o,{profileManager:r,tolerateMissing:!0});if(!d.unpublished&&!d.notFound)throw new Error(`Conflict on publish; unpublish-then-retry also failed: ${d.error??"unknown"}`);c=await Yl(r,a,s,o)}if(c.status!==200&&c.status!==201&&c.status!==202){let f=await Jl(c);throw new Error(`Publish failed: HTTP ${c.status}: ${f.slice(0,1e3)}`)}let l=await c.json(),p=l?.data?.attributes;if(!p?.publishedRealmURL)throw new Error(`Publish response missing data.attributes.publishedRealmURL: ${JSON.stringify(l).slice(0,500)}`);let u={publishedRealmURL:k(p.publishedRealmURL),publishedRealmId:l.data.id,lastPublishedAt:p.lastPublishedAt,status:p.status};if(t.waitForReady!==!1){let f=t.timeoutMs??Xl,d;try{let h=await r.getOrRefreshServerToken();d=await r.fetchAndStoreRealmToken(u.publishedRealmURL,h)}catch{}await Ib(u.publishedRealmURL,d,f)}return u}async function Yl(i,e,t,r){return i.authedRealmServerFetch(`${e}/_publish-realm`,{method:"POST",headers:{Accept:"application/vnd.api+json","Content-Type":"application/json"},body:JSON.stringify({sourceRealmURL:t,publishedRealmURL:r})})}async function Ib(i,e,t){let r=new URL("_readiness-check",i).href,n=Date.now(),s;for(;Date.now()-n<t;){try{let a={Accept:"application/vnd.api+json"};e&&(a.Authorization=e);let c=await fetch(r,{headers:a});if(c.ok)return;s=`HTTP ${c.status}`}catch(a){s=Ci(a)}let o=t-(Date.now()-n);if(o<=0)break;await new Promise(a=>setTimeout(a,Math.min(jb,o)))}throw new Error(`Timed out after ${t}ms waiting for ${i} to pass readiness check${s?`: ${s}`:""}`)}async function Jl(i){try{return await i.text()}catch{return"<no response body>"}}function Nb(i){return{waitForReady:i.wait!==!1,timeoutMs:i.timeout,republish:i.republish!==!1}}function Kl(i){i.command("publish").description("Publish a source realm to a published-realm URL, polling readiness until ready").argument("<source-realm-url>","URL of the source realm to publish").argument("<published-realm-url>","Public-facing URL the published copy will serve at").option("--no-wait","Return as soon as the server accepts the publish").option("--timeout <ms>",`Readiness-poll timeout in milliseconds (default: ${Xl})`,Fb).option("--no-republish","Do not auto-unpublish + retry when the server returns 400/409").action(async(e,t,r)=>{try{let n=await Mb(e,t,Nb(r));console.log(`${R}Published:${m} ${_}${n.publishedRealmURL}${m}`)}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),n instanceof Error&&n.cause!=null&&console.error(`${g}Caused by:${m}`,n.cause),process.exit(1)}})}function Fb(i){let e=Number.parseInt(i,10);if(!Number.isFinite(e)||e<0||String(e)!==i.trim())throw new Error("--timeout must be a non-negative integer (milliseconds).");return e}var Ql=P(Wr()),Zl="realm_server";function Ub(i){let{hostname:e}=new URL(i);if(e==="localhost"||e.endsWith(".localhost"))return"localhost";let t=e.split(".");return t.length<=2?e:t.slice(-2).join(".")}function Db(i,e=Zl){return`@${e}:${Ub(i)}`}function qb(i){return new URL(i).origin+"/"}function Hb(i){try{return new URL(i).href.replace(/\/+$/,"")+"/"}catch{throw new Error(`Invalid realm URL: ${i}`)}}var Ti=class{#e;#t;#i;#n;#r=new Map;constructor(e){if(!e.seed)throw new Error("SeedAuthenticator requires a non-empty seed");this.#e=e.seed,this.#t=e.botUsername??Zl,this.#i=e.botUserId,this.#n=e.expiresIn??"7d"}buildClaims(e){let t=Hb(e);return{user:this.#i??Db(t,this.#t),realm:t,sessionRoom:void 0,permissions:[],realmServerURL:qb(t)}}mintTokenForRealm(e){let t=this.buildClaims(e),r=this.#r.get(t.realm);if(r)return r;let n=Ql.default.sign(t,this.#e,{expiresIn:this.#n});return this.#r.set(t.realm,n),n}#s(e){for(let s of this.#r.keys())if(e.startsWith(s))return s;let t=new URL(e),r=t.pathname.split("/").filter(Boolean),n=r.length>0?`/${r.slice(0,2).join("/")}/`:"/";return`${t.origin}${n}`}async authedRealmFetch(e,t){let r=e instanceof Request?e.url:e instanceof URL?e.href:e,n=this.#s(r),s=this.mintTokenForRealm(n),o=this.#o(e,t,s);return fetch(e,{...t,headers:o})}#o(e,t,r){let n=e instanceof Request?new Headers(e.headers):new Headers,s=new Headers(t?.headers);for(let[o,a]of s)n.set(o,a);return n.has("Authorization")||n.set("Authorization",r),n}registerRealmUrl(e){this.mintTokenForRealm(e)}};function ye(i){if(i.realmSecretSeed)try{let t=new Ti({seed:i.realmSecretSeed});return t.registerRealmUrl(i.realmUrl),{ok:!0,authenticator:t,mode:"seed"}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}let e=i.profileManager??C();return e.getActiveProfile()?{ok:!0,authenticator:e,mode:"profile"}:{ok:!1,error:A}}var Oi=P(require("fs/promises")),ep=P(require("path")),wn=class extends ue{constructor(t,r){super(t,r);this.pullOptions=t}hasError=!1;downloadedFiles=[];async sync(){console.log(`Starting pull from ${this.options.realmUrl} to ${this.options.localDir}`),console.log("Testing realm access...");try{await this.getRemoteFileList("")}catch(c){throw console.error("Failed to access realm:",c),new Error("Cannot proceed with pull: Authentication or access failed. Please check your credentials and realm permissions.")}console.log("Realm access verified");let[t,r]=await Promise.all([this.getRemoteFileList(),this.getLocalFileList()]);if(console.log(`Found ${t.size} files in remote realm`),console.log(`Found ${r.size} files in local directory`),this.options.dryRun)try{await Oi.access(this.options.localDir)}catch{console.log(`[DRY RUN] Would create directory: ${this.options.localDir}`)}else await Oi.mkdir(this.options.localDir,{recursive:!0});let n=new Set;if(this.pullOptions.deleteLocal)for(let c of r.keys())t.has(c)||n.add(c);let s=new H(this.options.localDir);if(n.size>0&&!this.options.dryRun){let c=Array.from(n).map(p=>({file:p,status:"deleted"})),l=await s.createCheckpoint("remote",c,`Pre-delete checkpoint: ${n.size} files not on server`);l&&console.log(`
96
+ Checkpoint created before deletion: ${l.shortHash}`)}let o=await Promise.all(Array.from(t.keys()).map(c=>this.remoteLimit(async()=>{try{let l=ep.join(this.options.localDir,c);return await this.downloadFile(c,l),c}catch(l){return this.hasError=!0,console.error(`Error downloading ${c}:`,l),null}})));this.downloadedFiles=o.filter(c=>c!==null);let a=[];if(n.size>0&&(console.log(`
97
97
  Deleting ${n.size} local files that don't exist in realm...`),a=(await Promise.all(Array.from(n).map(async l=>{try{let p=r.get(l);return p?(await this.deleteLocalFile(p),console.log(` Deleted: ${l}`),l):null}catch(p){return this.hasError=!0,console.error(`Error deleting local file ${l}:`,p),null}}))).filter(l=>l!==null)),!this.options.dryRun&&this.downloadedFiles.length+a.length>0){let c=[...this.downloadedFiles.map(p=>({file:p,status:"modified"})),...a.map(p=>({file:p,status:"deleted"}))],l=await s.createCheckpoint("remote",c);if(l){let p=l.isMajor?"[MAJOR]":"[minor]";console.log(`
98
- Checkpoint created: ${l.shortHash} ${p} ${l.message}`)}}console.log("Pull completed")}};function Ql(i){i.command("pull").description("Pull files from a Boxel realm to a local directory").argument("<realm-url>","The URL of the source realm (e.g., https://app.boxel.ai/demo/)").argument("<local-dir>","The local directory to sync files to").option("--delete","Delete local files that do not exist in the realm").option("--dry-run","Show what would be done without making changes").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(e,t,r)=>{let n=await xe(r.realmSecretSeed===!0),s=await Ab(e,t,{delete:r.delete,dryRun:r.dryRun,realmSecretSeed:n});s.error&&(console.error(`Error: ${s.error}`),process.exit(s.files.length>0?2:1)),console.log("Pull completed successfully")})}async function Ab(i,e,t){let r;if(t.authenticator)r=t.authenticator;else{let n=be({realmUrl:i,realmSecretSeed:t.realmSecretSeed,profileManager:t.profileManager});if(!n.ok)return{files:[],error:n.error};r=n.authenticator}try{let n=new bn({realmUrl:i,localDir:e,deleteLocal:t.delete,dryRun:t.dryRun},r);return await n.sync(),n.hasError?{files:n.downloadedFiles.sort(),error:"Pull completed with errors. Some files may not have been downloaded."}:{files:n.downloadedFiles.sort()}}catch(n){return{files:[],error:`Pull failed: ${n instanceof Error?n.message:String(n)}`}}}var Ue=T(require("fs/promises")),yn=T(require("path")),Zl=T(require("crypto"));function wn(i){if(typeof i!="object"||i===null)return!1;let e=i;if(typeof e.realmUrl!="string"||typeof e.files!="object"||e.files===null)return!1;for(let t of Object.values(e.files))if(typeof t!="string")return!1;if(e.remoteMtimes!==void 0){if(typeof e.remoteMtimes!="object"||e.remoteMtimes===null)return!1;for(let t of Object.values(e.remoteMtimes))if(typeof t!="number")return!1}return!0}async function Qe(i){try{return await Ue.access(i),!0}catch{return!1}}async function re(i){let e=await Ue.readFile(i);return Zl.createHash("md5").update(e).digest("hex")}async function ye(i){let e=yn.join(i,".boxel-sync.json"),t;try{t=await Ue.readFile(e,"utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}let r;try{r=JSON.parse(t)}catch{return null}return wn(r)?r:(console.warn("Warning: .boxel-sync.json is malformed or has an unexpected shape; falling back to a full upload."),null)}async function Oe(i,e){let t=yn.join(i,".boxel-sync.json");await Ue.writeFile(t,JSON.stringify(e,null,2))}var Lb=new Set(["index.json","realm.json"]),En=class extends le{constructor(t,r){super(t,r);this.pushOptions=t}hasError=!1;async sync(){console.log(`Starting push from ${this.options.localDir} to ${this.options.realmUrl}`),console.log("Testing realm access...");let t;try{t=await this.getRemoteFileList("")}catch(p){throw console.error("Failed to access realm:",p),new Error("Cannot proceed with push: Authentication or access failed. Please check your credentials and realm permissions.")}console.log("Realm access verified");let r=await this.getLocalFileList();console.log(`Found ${r.size} files in local directory`);let n=await ye(this.options.localDir),s={realmUrl:this.normalizedRealmUrl,files:{},remoteMtimes:{}},o=new Map,a=new Set;if(!this.pushOptions.force&&n!==null&&n.realmUrl===this.normalizedRealmUrl){console.log("Checking for changed files...");let p=0,[u,d]=await Promise.all([this.getRemoteMtimes(),Promise.all(Array.from(r.entries()).map(async([f,x])=>{if(F(f))return{relativePath:f,localPath:x,currentHash:"",protected:!0};let w=await re(x);return{relativePath:f,localPath:x,currentHash:w,protected:!1}}))]);for(let f of d){if(f.protected){p++;continue}let x=n.files[f.relativePath],w=n.remoteMtimes?.[f.relativePath],M=u.get(f.relativePath),Z=x!==f.currentHash,E=x!==void 0&&!t.has(f.relativePath),$=w!==void 0&&M!==void 0&&M!==w;Z||E||$?(o.set(f.relativePath,f.localPath),!Z&&(E||$)&&a.add(f.relativePath)):(p++,s.files[f.relativePath]=f.currentHash,w!==void 0&&(s.remoteMtimes[f.relativePath]=w))}if(p>0&&console.log(`Skipping ${p} unchanged files`),a.size>0){let f=Array.from(a),x=f.slice(0,5).join(", "),w=f.length>5?", ...":"";console.warn(`Warning: ${a.size} file(s) changed on the realm since your last push; your local versions will overwrite them: ${x}${w}`)}}else{this.pushOptions.force?console.log("Force mode: uploading all files"):console.log(n?"Realm URL changed, will upload all files":"No sync manifest found, will upload all files");for(let[p,u]of r)F(p)||o.set(p,u)}let l=!1;if(o.size===0)console.log("No files to upload - everything is up to date");else{console.log(`Uploading ${o.size} file(s) via /_atomic...`);let p=new Set,u=this.pushOptions.force||!n;for(let f of o.keys())if(u)t.has(f)||p.add(f);else{let x=n.files[f]!==void 0,w=x&&!t.has(f);(!x||w)&&p.add(f)}let d=await this.uploadFilesAtomic(o,p);if(d.succeeded.length>0){let f=await Promise.all(d.succeeded.map(async x=>({rel:x,hash:await re(o.get(x))})));for(let{rel:x,hash:w}of f)s.files[x]=w}if(d.error){l=!0,this.hasError=!0,console.error(d.error.message);for(let f of d.error.perFile){let x;f.status===409?x=`${f.path} was created on the realm concurrently \u2014 run with --force to overwrite.`:f.status===404?x=`${f.path} was removed from the realm concurrently \u2014 run with --force to re-create it from your local copy.`:x=`${f.path}: ${f.title}`,console.error(` ${x}`)}}}if(this.pushOptions.deleteRemote){let p=new Set(t.keys()),u=[];for(let d of p){if(F(d)){p.delete(d);continue}Lb.has(d)&&(p.delete(d),u.push(d))}for(let d of r.keys())p.delete(d);if(u.length>0&&console.log(`Skipping ${u.length} realm-managed remote artifact(s): ${u.join(", ")}`),p.size>0){let d=Array.from(p).sort();console.log(`Deleting ${d.length} remote files that don't exist locally: ${d.join(", ")}`);for(let f of d)try{await this.deleteFile(f)}catch(x){this.hasError=!0,console.error(`Error deleting ${f}:`,x)}}}if(!this.options.dryRun&&o.size>0)try{let p=await this.getRemoteMtimes();for(let u of Object.keys(s.files)){let d=p.get(u);d!==void 0&&(s.remoteMtimes[u]=d)}}catch(p){console.warn("Could not refresh remote mtimes after upload:",p)}if(s.remoteMtimes&&Object.keys(s.remoteMtimes).length===0&&delete s.remoteMtimes,this.options.dryRun||await Oe(this.options.localDir,s),!this.options.dryRun&&o.size>0&&!l){let p=new q(this.options.localDir),u=Array.from(o.keys()).map(f=>({file:f,status:"modified"})),d=await p.createCheckpoint("local",u);if(d){let f=d.isMajor?"[MAJOR]":"[minor]";console.log(`
99
- Checkpoint created: ${d.shortHash} ${f} ${d.message}`)}}console.log("Push completed")}};function ep(i){i.command("push").description("Push local files to a Boxel realm").argument("<local-dir>","The local directory containing files to sync").argument("<realm-url>","The URL of the target realm (e.g., https://app.boxel.ai/demo/)").option("--delete","Delete remote files that do not exist locally").option("--dry-run","Show what would be done without making changes").option("--force","Upload all files, even if unchanged").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(e,t,r)=>{let n=await xe(r.realmSecretSeed===!0);await jb(e,t,{delete:r.delete,dryRun:r.dryRun,force:r.force,realmSecretSeed:n})})}async function jb(i,e,t){let r;if(t.authenticator)r=t.authenticator;else{let n=be({realmUrl:e,realmSecretSeed:t.realmSecretSeed,profileManager:t.profileManager});n.ok||(console.error(`Error: ${n.error}`),process.exit(1)),r=n.authenticator}await Qe(i)||(console.error(`Local directory does not exist: ${i}`),process.exit(1));try{let n=new En({realmUrl:e,localDir:i,deleteRemote:t.delete,dryRun:t.dryRun,force:t.force},r);await n.sync(),n.hasError?(console.log("Push did not complete successfully. View logs for details"),process.exit(2)):console.log("Push completed successfully")}catch(n){console.error("Push failed:",n),process.exit(1)}}async function tp(i){let e=k(i.realmUrl.trim()),t=i.profileManager??C(),r=t.getActiveProfile();if(!r)return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:0,nextCount:0,error:P};let n;try{n=await t.getUserRealms()}catch(d){return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:0,nextCount:0,error:`Failed to load realm list: ${d instanceof Error?d.message:String(d)}`}}let s=n.map(k),o=s.length,a=s.filter(d=>d===e).length;if(a===0)return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:o,notInList:!0,error:"Realm is not in app.boxel.realms. Nothing to remove."};let c=o-a;if(i.dryRun)return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:c};let l=r.profile.realmServerUrl.replace(/\/$/,""),p;try{p=await t.authedRealmServerFetch(`${l}/_delete-realm`,{method:"DELETE",headers:{"Content-Type":"application/vnd.api+json"},body:JSON.stringify({data:{type:"realm",id:e}})})}catch(d){return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:o,error:`Failed to reach realm server: ${d instanceof Error?d.message:String(d)}`}}if(!p.ok){let d=await Mb(p),f=p.status===403?`You do not own this realm and cannot delete it on the server. Server returned 403: ${d}`:`Realm server returned ${p.status}: ${d}`;return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:o,error:f}}let u;try{u=await t.removeFromUserRealms(e)}catch(d){return{realmUrl:e,removed:!1,serverDeleted:!0,unlinked:!1,previousCount:o,nextCount:o,error:`Server delete succeeded, but Matrix unlink failed: ${d instanceof Error?d.message:String(d)}`}}return u?{realmUrl:e,removed:!0,serverDeleted:!0,unlinked:u,previousCount:o,nextCount:c}:{realmUrl:e,removed:!1,serverDeleted:!0,unlinked:!1,previousCount:o,nextCount:o,error:"Server delete succeeded, but Matrix account_data did not contain the URL by the time we PUT (concurrent edit?). Server-side files are gone; please refresh and check your realm list."}}async function Mb(i){try{return await i.text()}catch{return"<no response body>"}}function ip(i){i.command("remove").description("Remove a realm \u2014 deletes server-side files and unlinks it from your realm list").argument("<realm-url>","realm URL to remove").option("-y, --yes","Skip the interactive confirmation prompt").option("--dry-run","Preview the change without writing to Matrix").action(async(e,t)=>{let r=k(e.trim()),n=await tp({realmUrl:r,dryRun:!0});if(n.error&&!n.notInList&&(console.error(`${h}Error:${m} ${n.error}`),process.exit(1)),n.notInList&&(console.error(`${h}Error:${m} ${n.error}`),process.exit(1)),console.log(`Remove target: ${_}${n.realmUrl}${m}`),console.log(`${g}app.boxel.realms: ${n.previousCount} -> ${n.nextCount}${m}`),t.dryRun){console.log(`${g}[DRY RUN] No server delete or Matrix changes sent.${m}`);return}if(!t.yes){process.stdin.isTTY||(console.error(`${h}Error:${m} stdin is not a TTY. Pass --yes to confirm in non-interactive mode.`),process.exit(1));let o=await te("This will permanently delete the realm files, indexer state, and registry entry on the server. Proceed? (y/N) ");if(!/^y/i.test(o)){console.log(`${g}Cancelled.${m}`);return}}let s=await tp({realmUrl:r});(s.error||!s.removed)&&(console.error(`${h}Error:${m} ${s.error??"Removal did not complete."}`),s.serverDeleted&&!s.unlinked&&console.error(`${g}The realm is gone, but your account_data still references ${s.realmUrl}.${m}`),process.exit(1)),console.log(`${R}Removed:${m} ${_}${s.realmUrl}${m}`)})}var Ze=T(require("fs/promises")),wt=T(require("path"));function _i(i,e,t){let r=e.has(i),n=t?.files[i]!==void 0;return r&&n?e.get(i)===t.files[i]?"unchanged":"changed":r&&!n?"added":!r&&n?"deleted":"unchanged"}function Ci(i,e,t){let r=e.has(i),n=t?.remoteMtimes?.[i]!==void 0,s=t?.files[i]!==void 0,o=n||s;return r&&n?e.get(i)===t.remoteMtimes[i]?"unchanged":"changed":r&&s?"changed":r&&!o?"added":!r&&o?"deleted":"unchanged"}function rp(i,e,t){return i==="unchanged"&&e==="unchanged"?"noop":i==="changed"&&e==="unchanged"?"push":i==="unchanged"&&e==="changed"?"pull":i==="added"&&e==="unchanged"?"push":i==="unchanged"&&e==="added"?"pull":i==="changed"&&e==="changed"||i==="added"&&e==="added"||i==="changed"&&e==="added"||i==="added"&&e==="changed"?"conflict":i==="deleted"&&e==="unchanged"?t.deleteSync||t.preferLocal?"push-delete":"noop":i==="unchanged"&&e==="deleted"?t.deleteSync||t.preferRemote?"pull-delete":"noop":i==="deleted"&&e==="changed"||i==="changed"&&e==="deleted"?"conflict":i==="deleted"&&e==="deleted"?"noop":i==="added"&&e==="deleted"?"push":i==="deleted"&&e==="added"?"pull":"noop"}function np(i,e,t,r){let{localStatus:n,remoteStatus:s,relativePath:o}=i;if(!r)return null;switch(r){case"prefer-local":return n==="deleted"?"push-delete":"push";case"prefer-remote":return s==="deleted"?"pull-delete":"pull";case"prefer-newest":{if(n==="deleted"&&s==="changed")return"pull";if(n==="changed"&&s==="deleted")return"push";let a=e.get(o),c=t.get(o);return a&&c!==void 0?a.mtime>c*1e3?"push":"pull":"push"}}}var Ib=new Set(["node_modules",".git",".boxel-history",".cache",".vscode","dist","build","tmp"]),Nb=6;function Fb(i,e){return i==="unchanged"&&e==="unchanged"||i==="deleted"&&e==="deleted"?null:i==="unchanged"&&e==="added"?"new-remote":i==="unchanged"&&e==="changed"?"modified-remote":i==="unchanged"&&e==="deleted"?"deleted-remote":i==="added"&&e==="unchanged"?"new-local":i==="changed"&&e==="unchanged"?"modified-local":i==="deleted"&&e==="unchanged"?"deleted-local":i==="changed"&&e==="changed"||i==="added"&&e==="added"||i==="changed"&&e==="added"||i==="added"&&e==="changed"||i==="changed"&&e==="deleted"||i==="deleted"&&e==="changed"?"conflict":i==="added"&&e==="deleted"?"new-local":i==="deleted"&&e==="added"?"new-remote":null}var Rn=class extends le{constructor(t,r,n){super(t,n);this.statusOptions=t;this.loadedManifest=r}changes=[];pulled=[];hasError=!1;error;remoteMtimes=new Map;async sync(){let t,r;try{[t,this.remoteMtimes,r]=await Promise.all([this.getLocalFileListWithMtimes(),this.getRemoteMtimes(),this.getRemoteFileList()])}catch(a){this.hasError=!0,this.error=a instanceof Error?`Failed to fetch realm state: ${a.message}`:`Failed to fetch realm state: ${String(a)}`;return}if(r&&this.remoteMtimes.size===0&&r.size>0)for(let[a]of r)this.remoteMtimes.set(a,0);let n=new Map;for(let[a,c]of t)n.set(a,c.path);let s=new Map;await Promise.all(Array.from(n.entries()).map(async([a,c])=>{F(a)||s.set(a,await re(c))}));let o=new Set;for(let a of n.keys())o.add(a);for(let a of this.remoteMtimes.keys())o.add(a);for(let a of Object.keys(this.loadedManifest.files))o.add(a);if(this.loadedManifest.remoteMtimes)for(let a of Object.keys(this.loadedManifest.remoteMtimes))o.add(a);for(let a of o){if(F(a))continue;let c=_i(a,s,this.loadedManifest),l=Ci(a,this.remoteMtimes,this.loadedManifest),p=Fb(c,l);p!==null&&this.changes.push({file:a,status:p})}this.changes.sort((a,c)=>a.file.localeCompare(c.file)),this.statusOptions.pull&&await this.performSafePull()}async performSafePull(){let t=this.changes.filter(n=>n.status==="new-remote"||n.status==="modified-remote");if(t.length===0)return;let r=[];for(let n of t){let s=wt.join(this.options.localDir,n.file);try{await this.downloadFile(n.file,s),this.pulled.push(n.file);let o=await re(s);this.loadedManifest.files[n.file]=o;let a=this.remoteMtimes.get(n.file);a!==void 0&&(this.loadedManifest.remoteMtimes=this.loadedManifest.remoteMtimes??{},this.loadedManifest.remoteMtimes[n.file]=a)}catch(o){this.hasError=!0;let a=o instanceof Error?o.message:String(o);r.push({file:n.file,message:a}),console.error(` ${h}\u2717 ${n.file}${m} (${a})`)}}r.length>0&&(this.error=`Failed to pull ${r.length} file(s): ${r.map(n=>`${n.file} (${n.message})`).join("; ")}`),this.pulled.length>0&&await Oe(this.options.localDir,this.loadedManifest)}};async function sp(i,e){let t={localDir:i,realmUrl:"",changes:[],pulled:[],inSync:!1,hasError:!1},r=wt.join(i,".boxel-sync.json");if(!await Qe(r))return{...t,hasError:!0,error:`No .boxel-sync.json found in ${i}. Run: boxel realm sync ${i} <realm-url>`};let n=await ye(i);if(!n)return{...t,hasError:!0,error:`Malformed .boxel-sync.json in ${i}`};let s;try{s=(await Ze.stat(r)).mtimeMs}catch{}let o;if(e.authenticator)o=e.authenticator;else{let c=be({realmUrl:n.realmUrl,realmSecretSeed:e.realmSecretSeed,profileManager:e.profileManager});if(!c.ok)return{...t,realmUrl:n.realmUrl,manifestMtime:s,hasError:!0,error:c.error};o=c.authenticator}let a=new Rn({realmUrl:n.realmUrl,localDir:i,pull:e.pull},n,o);return await a.sync(),{localDir:i,realmUrl:n.realmUrl,manifestMtime:s,changes:a.changes,pulled:a.pulled.slice().sort(),inSync:!a.hasError&&a.changes.length===0,hasError:a.hasError,error:a.error}}async function Ub(i,e){let t=[];async function r(n,s){if(s>e)return;let o;try{o=await Ze.readdir(n,{withFileTypes:!0})}catch{return}if(o.some(c=>c.isFile()&&c.name===".boxel-sync.json")){t.push(n);return}for(let c of o)c.isDirectory()&&(Ib.has(c.name)||await r(wt.join(n,c.name),s+1))}return await r(i,0),t.sort(),t}async function Db(i,e){if(e.pull)return{rootDir:i,workspaces:[],hasError:!0,error:"Cannot use --pull with --all"};let t=process.env.BOXEL_STATUS_ALL_MAX_DEPTH,r=t!==void 0?Number(t):NaN,n=Number.isFinite(r)&&r>=0?r:Nb,s=await Ub(i,n),o=[],a=!1;for(let c of s){let l=wt.join(c,".boxel-sync.json"),p;try{p=await Ze.readFile(l,"utf8")}catch{o.push({localDir:c,realmUrl:"",changes:[],pulled:[],inSync:!1,hasError:!0,skipped:"no-manifest"}),a=!0;continue}let u;try{u=JSON.parse(p)}catch{u=void 0}if(!wn(u)){o.push({localDir:c,realmUrl:"",changes:[],pulled:[],inSync:!1,hasError:!0,skipped:"malformed"}),a=!0;continue}let d=await sp(c,{profileManager:e.profileManager,realmSecretSeed:e.realmSecretSeed,authenticator:e.authenticator}),f={...d};d.hasError&&(f.skipped="fetch-failed",a=!0),o.push(f)}return{rootDir:i,workspaces:o,hasError:a}}function qb(i){if(i.hasError&&i.error){console.error(`${h}Error:${m} ${i.error}`);return}if(console.log(`Realm: ${i.realmUrl}`),console.log(`Local: ${i.localDir}`),i.manifestMtime&&console.log(`${g}Manifest updated:${m} ${new Date(i.manifestMtime).toISOString()}`),console.log(""),i.changes.length===0){console.log(`${R}\u2713 In sync${m}`);return}let e={"new-remote":[],"modified-remote":[],"new-local":[],"modified-local":[],conflict:[],"deleted-local":[],"deleted-remote":[]};for(let t of i.changes)e[t.status].push(t.file);if(e["new-remote"].length>0){console.log(`${_}\u2193 New on remote (${e["new-remote"].length}):${m}`);for(let t of e["new-remote"])console.log(` + ${t}`);console.log("")}if(e["modified-remote"].length>0){console.log(`${_}\u2193 Modified on remote (${e["modified-remote"].length}):${m}`);for(let t of e["modified-remote"])console.log(` ~ ${t}`);console.log("")}if(e["new-local"].length>0){console.log(`${R}\u2191 New locally (${e["new-local"].length}):${m}`);for(let t of e["new-local"])console.log(` + ${t}`);console.log("")}if(e["modified-local"].length>0){console.log(`${R}\u2191 Modified locally (${e["modified-local"].length}):${m}`);for(let t of e["modified-local"])console.log(` ~ ${t}`);console.log("")}if(e.conflict.length>0){console.log(`${A}\u26A0 Conflicts (${e.conflict.length}):${m}`);for(let t of e.conflict)console.log(` ! ${t}`);console.log("")}if(e["deleted-local"].length>0){console.log(`${h}- Deleted locally (${e["deleted-local"].length}):${m}`);for(let t of e["deleted-local"])console.log(` - ${t}`);console.log("")}if(e["deleted-remote"].length>0){console.log(`${h}- Deleted on remote (${e["deleted-remote"].length}):${m}`);for(let t of e["deleted-remote"])console.log(` - ${t}`);console.log("")}if(i.pulled.length>0){console.log(`${_}Pulled ${i.pulled.length} file(s):${m}`);for(let t of i.pulled)console.log(` \u2713 ${t}`)}}function Gb(i){if(i.error){console.error(`${h}Error:${m} ${i.error}`);return}if(i.workspaces.length===0){console.log(`No .boxel-sync.json directories found under ${i.rootDir}.`);return}for(let e of i.workspaces){if(e.skipped){console.log(`${A}${e.localDir}${m} [${e.skipped}]`),e.error&&console.log(` ${g}${e.error}${m}`),console.log("");continue}let t={newRemote:0,modRemote:0,newLocal:0,modLocal:0,conflict:0,delLocal:0,delRemote:0};for(let r of e.changes)r.status==="new-remote"?t.newRemote++:r.status==="modified-remote"?t.modRemote++:r.status==="new-local"?t.newLocal++:r.status==="modified-local"?t.modLocal++:r.status==="conflict"?t.conflict++:r.status==="deleted-local"?t.delLocal++:r.status==="deleted-remote"&&t.delRemote++;if(console.log(`${e.localDir} ${g}${e.realmUrl}${m}`),e.inSync)console.log(` ${R}\u2713 in sync${m}`);else{let r=[];t.newRemote>0&&r.push(`${_}\u2193+${t.newRemote}${m}`),t.modRemote>0&&r.push(`${_}\u2193~${t.modRemote}${m}`),t.newLocal>0&&r.push(`${R}\u2191+${t.newLocal}${m}`),t.modLocal>0&&r.push(`${R}\u2191~${t.modLocal}${m}`),t.conflict>0&&r.push(`${A}\u26A0${t.conflict}${m}`),t.delLocal>0&&r.push(`${h}-L${t.delLocal}${m}`),t.delRemote>0&&r.push(`${h}-R${t.delRemote}${m}`),console.log(` ${r.join(" ")}`)}console.log("")}}function op(i){i.command("status").aliases(["st"]).description("Show pending changes between a local sync dir and its realm").argument("[local-dir]","Local sync directory (defaults to current working directory)").option("--pull","Download safe remote changes and update manifest").option("--all","Recursively report all .boxel-sync.json dirs under the current directory").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(e,t)=>{let r=await xe(t.realmSecretSeed===!0);if(t.all){t.pull&&(console.error(`${h}Error:${m} Cannot use --pull with --all`),process.exit(1));let s=await Db(e??process.cwd(),{all:!0,realmSecretSeed:r});Gb(s),s.hasError&&process.exit(2);return}let n=await sp(e??process.cwd(),{pull:t.pull,realmSecretSeed:r});qb(n),n.hasError&&process.exit(n.pulled.length>0?2:1)})}var kn=T(require("path"));var Sn=class extends le{constructor(t,r){super(t,r);this.syncOptions=t}hasError=!1;pushedFiles=[];pulledFiles=[];remoteDeletedFiles=[];localDeletedFiles=[];skippedConflicts=[];get conflictStrategy(){return this.syncOptions.preferLocal?"prefer-local":this.syncOptions.preferRemote?"prefer-remote":this.syncOptions.preferNewest?"prefer-newest":null}async sync(){console.log(`Starting sync between ${this.options.localDir} and ${this.options.realmUrl}`),console.log("Testing realm access...");let t;try{t=await this.getRemoteFileList("")}catch(E){throw console.error("Failed to access realm:",E),new Error("Cannot proceed with sync: Authentication or access failed. Please check your credentials and realm permissions.")}console.log("Realm access verified");let[r,n,s]=await Promise.all([this.getLocalFileListWithMtimes(),this.getRemoteMtimes(),ye(this.options.localDir)]),o=new Map;for(let[E,$]of r)o.set(E,$.path);if(n.size===0&&t&&t.size>0){console.log("Remote mtimes unavailable, falling back to file listing for remote detection");for(let[E]of t)n.set(E,0)}console.log(`Found ${o.size} local files`),console.log(`Found ${n.size} remote files`),s&&s.realmUrl!==this.normalizedRealmUrl&&console.warn(`${A}Warning:${m} Manifest realm URL (${s.realmUrl}) differs from target (${this.normalizedRealmUrl}). Treating as first sync.`);let a=s&&s.realmUrl===this.normalizedRealmUrl?s:null,c=new Map;await Promise.all(Array.from(o.entries()).map(async([E,$])=>{F(E)||c.set(E,await re($))}));let l=new Set;for(let E of o.keys())l.add(E);for(let E of n.keys())l.add(E);if(a){for(let E of Object.keys(a.files))l.add(E);if(a.remoteMtimes)for(let E of Object.keys(a.remoteMtimes))l.add(E)}let p=[];for(let E of l){if(F(E))continue;let $=_i(E,c,a),O=Ci(E,n,a),U=rp($,O,this.syncOptions);p.push({relativePath:E,localStatus:$,remoteStatus:O,action:U})}let u=[],d=[],f=[],x=[],w=[],M=0;for(let E of p)switch(E.action){case"push":u.push(E.relativePath);break;case"pull":d.push(E.relativePath);break;case"push-delete":f.push(E.relativePath);break;case"pull-delete":x.push(E.relativePath);break;case"conflict":w.push(E);break;case"noop":M++;break}for(let E of w)switch(np(E,r,n,this.conflictStrategy)){case"push":u.push(E.relativePath);break;case"pull":d.push(E.relativePath);break;case"push-delete":f.push(E.relativePath);break;case"pull-delete":x.push(E.relativePath);break;case"noop":break;default:this.skippedConflicts.push(E.relativePath);break}if(console.log(`
100
- ${g}Sync plan:${m}`),u.length>0&&console.log(` ${R}\u2191 Push:${m} ${u.length} file(s)`),d.length>0&&console.log(` ${_}\u2193 Pull:${m} ${d.length} file(s)`),f.length>0&&console.log(` ${h}\u2191 Delete remote:${m} ${f.length} file(s)`),x.length>0&&console.log(` ${h}\u2193 Delete local:${m} ${x.length} file(s)`),this.skippedConflicts.length>0){console.log(` ${A}\u26A0 Conflicts skipped:${m} ${this.skippedConflicts.length} file(s)`);for(let E of this.skippedConflicts)console.log(` ${E}`);console.log(` ${g}Use --prefer-local, --prefer-remote, or --prefer-newest to resolve.${m}`)}if(M>0&&console.log(` ${g}Unchanged: ${M} file(s)${m}`),u.length+d.length+f.length+x.length===0){console.log(`
101
- Everything is up to date`),!this.options.dryRun&&!a&&this.skippedConflicts.length===0&&await this.writeManifest(c,n);return}if(d.length>0){console.log(`
102
- Pulling ${d.length} file(s)...`);let E=await Promise.all(d.map($=>this.remoteLimit(async()=>{try{let O=kn.join(this.options.localDir,$);return await this.downloadFile($,O),$}catch(O){return this.hasError=!0,console.error(`Error downloading ${$}:`,O),null}})));this.pulledFiles.push(...E.filter($=>$!==null))}if(u.length>0){console.log(`
103
- Pushing ${u.length} file(s)...`);let E=new Map;for(let U of u){let Rt=o.get(U);Rt&&E.set(U,Rt)}let $=new Set;for(let U of E.keys()){let Rt=a?.files[U]!==void 0,Fp=n.has(U);!Rt&&!Fp&&$.add(U)}let O=await this.uploadFilesAtomic(E,$);if(this.pushedFiles.push(...O.succeeded),O.error){this.hasError=!0,console.error(O.error.message);for(let U of O.error.perFile)console.error(` ${U.path}: ${U.title}`)}}if(f.length>0){console.log(`
104
- Deleting ${f.length} remote file(s)...`);let E=await Promise.all(f.map($=>this.remoteLimit(async()=>{try{return await this.deleteFile($),$}catch(O){return this.hasError=!0,console.error(`Error deleting remote ${$}:`,O),null}})));this.remoteDeletedFiles.push(...E.filter($=>$!==null))}if(x.length>0){console.log(`
105
- Deleting ${x.length} local file(s)...`);let E=await Promise.all(x.map(async $=>{try{let O=o.get($);return O?(await this.deleteLocalFile(O),$):null}catch(O){return this.hasError=!0,console.error(`Error deleting local ${$}:`,O),null}}));this.localDeletedFiles.push(...E.filter($=>$!==null))}if(!this.options.dryRun){let E=new Map;if(a)for(let[O,U]of Object.entries(a.files))E.set(O,U);for(let[O,U]of c)E.set(O,U);for(let O of this.pushedFiles){let U=o.get(O);U&&E.set(O,await re(U))}for(let O of this.pulledFiles){let U=kn.join(this.options.localDir,O);E.set(O,await re(U))}for(let O of this.remoteDeletedFiles)E.delete(O);for(let O of this.localDeletedFiles)E.delete(O);let $=n;if(this.pushedFiles.length>0||this.remoteDeletedFiles.length>0)try{$=await this.getRemoteMtimes()}catch{console.warn("Could not refresh remote mtimes after sync")}await this.writeManifest(E,$)}if(!this.options.dryRun){let E=[...this.pushedFiles.map($=>({file:$,status:"modified"})),...this.pulledFiles.map($=>({file:$,status:"modified"})),...this.remoteDeletedFiles.map($=>({file:$,status:"deleted"})),...this.localDeletedFiles.map($=>({file:$,status:"deleted"}))];if(E.length>0){let O=await new q(this.options.localDir).createCheckpoint("local",E);if(O){let U=O.isMajor?"[MAJOR]":"[minor]";console.log(`
106
- Checkpoint created: ${O.shortHash} ${U} ${O.message}`)}}}console.log(`
107
- Sync completed`)}async writeManifest(t,r){let n={realmUrl:this.normalizedRealmUrl,files:{},remoteMtimes:{}};for(let[s,o]of t){n.files[s]=o;let a=r.get(s);a!==void 0&&a!==0&&(n.remoteMtimes[s]=a)}n.remoteMtimes&&Object.keys(n.remoteMtimes).length===0&&delete n.remoteMtimes,await Oe(this.options.localDir,n)}};function ap(i){return i.command("sync").description("Bidirectional sync between a local directory and a Boxel realm").argument("<local-dir>","The local directory to sync").argument("<realm-url>","The URL of the target realm (e.g., https://app.boxel.ai/demo/)").option("--prefer-local","Resolve conflicts by keeping local version").option("--prefer-remote","Resolve conflicts by keeping remote version").option("--prefer-newest","Resolve conflicts by keeping newest version").option("--delete","Sync deletions both ways").option("--dry-run","Preview without making changes").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(t,r,n)=>{let s=await xe(n.realmSecretSeed===!0),o=await Hb(t,r,{preferLocal:n.preferLocal,preferRemote:n.preferRemote,preferNewest:n.preferNewest,delete:n.delete,dryRun:n.dryRun,realmSecretSeed:s}),a=Array.isArray(o.pushed)&&o.pushed.length>0||Array.isArray(o.pulled)&&o.pulled.length>0||Array.isArray(o.remoteDeleted)&&o.remoteDeleted.length>0||Array.isArray(o.localDeleted)&&o.localDeleted.length>0;o.error&&(console.error(`Error: ${o.error}`),process.exit(a?2:1)),console.log("Sync completed successfully")})}async function Hb(i,e,t){let r;if(t.authenticator)r=t.authenticator;else{let o=be({realmUrl:e,realmSecretSeed:t.realmSecretSeed,profileManager:t.profileManager});if(!o.ok)return $n({error:o.error});r=o.authenticator}if([t.preferLocal,t.preferRemote,t.preferNewest].filter(Boolean).length>1)return $n({error:"Only one conflict strategy can be specified (--prefer-local, --prefer-remote, or --prefer-newest)."});if(!await Qe(i))return $n({error:`Local directory does not exist: ${i}`});let s;try{s=new Sn({realmUrl:e,localDir:i,preferLocal:t.preferLocal,preferRemote:t.preferRemote,preferNewest:t.preferNewest,deleteSync:t.delete,dryRun:t.dryRun,waitForIndex:t.waitForIndex},r),await s.sync()}catch(o){return{pushed:s?.pushedFiles.slice().sort()??[],pulled:s?.pulledFiles.slice().sort()??[],remoteDeleted:s?.remoteDeletedFiles.slice().sort()??[],localDeleted:s?.localDeletedFiles.slice().sort()??[],skippedConflicts:s?.skippedConflicts.slice().sort()??[],hasError:!0,error:`Sync failed: ${o instanceof Error?o.message:String(o)}`}}return{pushed:s.pushedFiles.slice().sort(),pulled:s.pulledFiles.slice().sort(),remoteDeleted:s.remoteDeletedFiles.slice().sort(),localDeleted:s.localDeletedFiles.slice().sort(),skippedConflicts:s.skippedConflicts.slice().sort(),hasError:s.hasError,error:s.hasError?Wb(s):void 0}}function Wb(i){return`Sync completed with errors. ${[`${i.pushedFiles.length} pushed`,`${i.pulledFiles.length} pulled`,`${i.remoteDeletedFiles.length} remote deleted`,`${i.localDeletedFiles.length} local deleted`,`${i.skippedConflicts.length} conflicts skipped`].join(", ")}.`}function $n(i){return{pushed:[],pulled:[],remoteDeleted:[],localDeleted:[],skippedConflicts:[],hasError:!0,...i}}var cp=T(Ct());function Vb(i){let e=Number.parseInt(i,10);if(!Number.isFinite(e)||e<0||String(e)!==i.trim())throw new cp.InvalidArgumentError("--timeout must be a non-negative integer (milliseconds).");return e}async function Bb(i,e={}){let t=e.timeoutMs??3e4;if(!Number.isFinite(t)||t<0)return{ready:!1,error:`Invalid timeoutMs: must be a finite, non-negative number (got ${e.timeoutMs}).`};let r=e.profileManager??C();if(!r.getActiveProfile())return{ready:!1,error:P};let s=`${k(i)}_readiness-check`,o=Date.now();for(;Date.now()-o<t;){try{if((await r.authedRealmFetch(s,{method:"GET",headers:{Accept:"application/vnd.api+json"}})).ok)return{ready:!0}}catch{}let a=t-(Date.now()-o);if(a<=0)break;await new Promise(c=>setTimeout(c,Math.min(1e3,a)))}return{ready:!1,error:`Realm not ready after ${t}ms: ${s}`}}function lp(i){i.command("wait-for-ready").description("Poll a realm readiness-check endpoint until it responds OK or the timeout is reached").requiredOption("--realm <realm-url>","The realm URL to check").option("--timeout <ms>","Timeout in milliseconds (default: 30000)",Vb).action(async e=>{let t;try{t=await Bb(e.realm,{timeoutMs:e.timeout})}catch(r){console.error(`${h}Error:${m} ${r instanceof Error?r.message:String(r)}`),process.exit(1)}t.ready?console.log(`${R}Realm is ready.${m}`):(console.error(`${h}Error:${m} ${t.error??"Realm not ready"}`),process.exit(1))})}var Ln=T(Ct()),bp=T(require("fs/promises")),Ti=T(require("path"));var Te=T(require("fs/promises")),pp=T(require("path")),zb=".boxel-watch.lock";function _n(i){return pp.join(i,zb)}function Cn(i){try{return process.kill(i,0),!0}catch(e){return e?.code==="EPERM"}}async function Yb(i){try{let e=await Te.readFile(_n(i),"utf8"),t=JSON.parse(e);return typeof t.pid!="number"||typeof t.startedAt!="string"||typeof t.realmUrl!="string"?null:t}catch{return null}}async function up(i,e){await Te.mkdir(i,{recursive:!0});let t=await Yb(i),r=!1;if(t&&Cn(t.pid))return{ok:!1,existing:t};t&&(r=!0);let n={pid:process.pid,startedAt:new Date().toISOString(),realmUrl:e};return await Te.writeFile(_n(i),JSON.stringify(n,null,2)+`
108
- `),{ok:!0,staleOverwrote:r}}async function Oi(i){try{await Te.unlink(_n(i))}catch(e){if(e?.code!=="ENOENT")throw e}}var Pe=T(require("fs/promises")),mp=T(require("os")),On=T(require("path"));function dp(){return On.join(mp.homedir(),".boxel-cli")}function fp(){return On.join(dp(),"watch-processes.json")}async function hp(){try{let i=await Pe.readFile(fp(),"utf8"),e=JSON.parse(i);return Array.isArray(e?.processes)?{processes:e.processes.filter(r=>typeof r?.pid=="number"&&typeof r?.workspace=="string"&&typeof r?.startedAt=="string")}:{processes:[]}}catch{return{processes:[]}}}async function Tn(i){await Pe.mkdir(dp(),{recursive:!0});let e=fp(),t=`${e}.${process.pid}.tmp`;await Pe.writeFile(t,JSON.stringify(i,null,2)+`
109
- `),await Pe.rename(t,e)}async function gp(){let i=await hp(),e=i.processes.filter(t=>Cn(t.pid));return e.length!==i.processes.length&&await Tn({processes:e}),{processes:e}}async function xp(i){let t=(await gp()).processes.filter(r=>r.pid!==process.pid);t.push({pid:process.pid,workspace:i,startedAt:new Date().toISOString()}),await Tn({processes:t})}async function vp(){let i=await hp(),e=i.processes.filter(t=>t.pid!==process.pid);e.length!==i.processes.length&&await Tn({processes:e})}async function Pn(){return(await gp()).processes}var An=class extends le{name;debounceMs;overwriteLocal;checkpointManager;lastKnownMtimes=new Map;pendingChanges=new Map;debounceTimer=null;isShutdown=!1;constructor(e,t,r){super({realmUrl:e.realmUrl,localDir:e.localDir},t),this.debounceMs=r.debounceMs,this.overwriteLocal=r.overwriteLocal??!1,this.checkpointManager=new q(e.localDir),this.name=Qb(this.normalizedRealmUrl)}async sync(){await this.poll(),await this.flushPending()}async getRemoteMtimes(){let e=`${this.normalizedRealmUrl}_mtimes`,t=await this.authenticator.authedRealmFetch(e,{headers:{Accept:"application/vnd.api+json"}});if(!t.ok)throw new Error(`_mtimes fetch failed for ${this.normalizedRealmUrl}: ${t.status} ${t.statusText}`);let r=await t.json(),n=new Map;for(let[s,o]of Object.entries(r.data?.attributes?.mtimes??{}))n.set(s.replace(this.normalizedRealmUrl,""),o);return n}get localDir(){return this.options.localDir}get realmUrl(){return this.normalizedRealmUrl}get pendingCount(){return this.pendingChanges.size}async initialize(){await this.getRemoteMtimes(),await this.checkpointManager.isInitialized()||await this.checkpointManager.init();let e=await ye(this.options.localDir);if(e&&e.realmUrl===this.normalizedRealmUrl&&e.remoteMtimes)for(let[t,r]of Object.entries(e.remoteMtimes))this.lastKnownMtimes.set(t,r)}async poll(){let e=await this.getRemoteMtimes(),t=!1;for(let[r,n]of e){if(F(r))continue;let s=this.lastKnownMtimes.get(r);s===void 0?this.recordPending(r,{status:"added",mtime:n})&&(t=!0):n>s&&this.recordPending(r,{status:"modified",mtime:n})&&(t=!0)}for(let r of this.lastKnownMtimes.keys())F(r)||e.has(r)||this.pendingChanges.get(r)?.status!=="deleted"&&(this.pendingChanges.set(r,{status:"deleted",mtime:0}),t=!0);return t}async flushPending(){if(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.pendingChanges.size===0)return{pulled:[],deleted:[],skipped:[],checkpoint:null};let e=new Map(this.pendingChanges);this.pendingChanges.clear();let t=[],r=[],n=[],s=[],o=null;if(!this.overwriteLocal){let l=await ye(this.options.localDir);l&&l.realmUrl===this.normalizedRealmUrl&&(o=l)}for(let[l,p]of e){let u=Ti.join(this.options.localDir,l);if(!this.overwriteLocal&&await this.localDivergesFromManifest(u,l,o,p.status)){n.push(l);continue}if(p.status==="deleted"){try{await bp.unlink(u)}catch(d){if(d.code!=="ENOENT")throw d}r.push(l),s.push({file:l,status:"deleted"})}else await this.downloadFile(l,u),t.push(l),s.push({file:l,status:p.status})}let a=new Set(n);for(let[l,p]of e)a.has(l)||(p.status==="deleted"?this.lastKnownMtimes.delete(l):this.lastKnownMtimes.set(l,p.mtime));let c=null;return s.length>0&&(await this.persistManifest(t,r),c=await this.checkpointManager.createCheckpoint("remote",s)),{pulled:t,deleted:r,skipped:n,checkpoint:c}}async localDivergesFromManifest(e,t,r,n){let s;try{s=await re(e)}catch(a){if(a.code!=="ENOENT")throw a;return n==="deleted"?!1:r?.files[t]!==void 0}let o=r?.files[t];return o===void 0?!0:s!==o}scheduleFlush(e){this.isShutdown||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(async()=>{this.debounceTimer=null;try{let t=await this.flushPending();e?.(t)}catch(t){console.error(`${h}[${this.name}] Error applying changes:${m}`,t)}},this.debounceMs))}shutdown(){this.isShutdown=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}recordPending(e,t){let r=this.pendingChanges.get(e);return r&&r.mtime===t.mtime?!1:(this.pendingChanges.set(e,t),!0)}async persistManifest(e,t){let r=await ye(this.options.localDir),n=r&&r.realmUrl===this.normalizedRealmUrl?r.files:null,s=n?{...n}:{};for(let c of t)delete s[c];for(let c of e){let l=Ti.join(this.options.localDir,c);try{s[c]=await re(l)}catch(p){if(p.code!=="ENOENT")throw p}}let o={};for(let[c,l]of this.lastKnownMtimes)l!==0&&(o[c]=l);let a={realmUrl:this.normalizedRealmUrl,files:s};Object.keys(o).length>0&&(a.remoteMtimes=o),await Oe(this.options.localDir,a)}};async function Jb(i,e={}){if(i.length===0)return{watchers:[],error:"No realms provided to watch."};let t=e.intervalMs??3e4,r=e.debounceMs??5e3,n=e.quiet??!1,s=e.overwriteLocal??!1;if(!Number.isFinite(t)||t<=0)return{watchers:[],error:"`intervalMs` must be a positive number."};if(!Number.isFinite(r)||r<0)return{watchers:[],error:"`debounceMs` must be a non-negative number."};let o;if(e.authenticator)o=e.authenticator;else{let f=be({realmUrl:i[0].realmUrl,realmSecretSeed:e.realmSecretSeed,profileManager:e.profileManager});if(!f.ok)return{watchers:[],error:f.error};o=f.authenticator}let a=[];for(let f of i){let x=await up(f.localDir,f.realmUrl);if(!x.ok){for(let w of a)await Oi(w);return{watchers:[],error:Xb(f.localDir,x.existing)}}x.staleOverwrote&&!n&&console.log(`${g}[${Pi()}] overwrote stale lock at ${f.localDir}${m}`),a.push(f.localDir)}let c=[];for(let f of i){let x=new An(f,o,{debounceMs:r,overwriteLocal:s});try{await x.initialize()}catch(w){for(let M of c)M.shutdown();for(let M of a)await Oi(M);return{watchers:[],error:`Failed to initialize watch on ${f.realmUrl}: ${w instanceof Error?w.message:String(w)}`}}c.push(x)}if(!n){console.log(`${_}\u21C5 Watching ${c.length} realm${c.length>1?"s":""}:${m}`);for(let f of c)console.log(` ${f.name} ${g}\u2192${m} ${f.localDir}`);console.log(` ${g}Interval: ${t/1e3}s, Debounce: ${r/1e3}s${m}`),console.log(` ${g}Press Ctrl+C to stop${m}
110
- `)}let l=async()=>{await Promise.all(c.map(async f=>{try{await f.poll()&&(n||console.log(`${g}[${Pi()}]${m} [${f.name}] ${A}\u26A1 ${f.pendingCount} change(s) detected${m}`),f.scheduleFlush(w=>{n||Kb(f.name,w)}))}catch(x){console.error(`${h}[${f.name}] poll error:${m}`,x instanceof Error?x.message:x)}}))},p=!1,u=null,d=()=>{p||(u=setTimeout(async()=>{u=null,!p&&(await l(),d())},t))};try{await xp(i.map(f=>f.localDir).join(", "))}catch{}return await l(),d(),await new Promise(f=>{let x=null,w=null,M=async()=>{if(!p){p=!0,u!==null&&(clearTimeout(u),u=null);for(let Z of c)Z.shutdown();x&&process.off("SIGINT",x),w&&process.off("SIGTERM",w);for(let Z of a)try{await Oi(Z)}catch{}try{await vp()}catch{}f()}};if(e.signal){if(e.signal.aborted){M();return}e.signal.addEventListener("abort",()=>void M(),{once:!0})}else x=()=>{n||console.log(`
111
- ${_}\u21C5 Watch stopped${m}`),M()},w=x,process.on("SIGINT",x),process.on("SIGTERM",w)}),{watchers:c}}function Xb(i,e){return`A boxel realm watch process is already active for ${i} (pid ${e.pid}, started ${e.startedAt}). Stop it before starting a new one, or remove ${Ti.join(i,".boxel-watch.lock")} if it's stale.`}function Kb(i,e){let t=e.pulled.length+e.deleted.length;if(t>0&&(console.log(`${g}[${Pi()}]${m} [${i}] ${R}applied ${t} change(s)${m} (${e.pulled.length} pulled, ${e.deleted.length} deleted)`),e.checkpoint)){let r=e.checkpoint.isMajor?"[MAJOR]":"[minor]";console.log(` ${g}Checkpoint:${m} ${e.checkpoint.shortHash} ${r} ${e.checkpoint.message}`)}for(let r of e.skipped)console.log(`${g}[${Pi()}]${m} [${i}] ${A}\u26A0 skipped ${r}: local diverges from sync manifest (rerun with --overwrite-local to discard, or \`boxel realm sync\` to reconcile)${m}`)}function Qb(i){return i.replace(/\/$/,"").split("/").slice(-2).join("/")}function Pi(){return new Date().toLocaleTimeString()}function Zb(i){return e=>{let t=Number.parseFloat(e);if(!Number.isFinite(t)||t<=0)throw new Ln.InvalidArgumentError(`${i} must be a positive number.`);return t}}function ey(i){return e=>{let t=Number.parseFloat(e);if(!Number.isFinite(t)||t<0)throw new Ln.InvalidArgumentError(`${i} must be a non-negative number.`);return t}}function yp(i){i.command("start").description("Start watching a Boxel realm for server-side changes and pull them into a local directory").argument("<realm-url>","The URL of the realm to watch (e.g., https://app.boxel.ai/demo/)").argument("<local-dir>","The local directory to write changes into").option("-i, --interval <seconds>","Polling interval in seconds",Zb("--interval"),30).option("-d, --debounce <seconds>","Seconds to wait after a burst of changes before applying them",ey("--debounce"),5).option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").option("--overwrite-local","Overwrite local files when the remote changes. Default: skip + warn when the local copy diverges from the sync manifest.").action(async(e,t,r)=>{let n=await xe(r.realmSecretSeed===!0),s=await Jb([{realmUrl:e,localDir:t}],{intervalMs:r.interval*1e3,debounceMs:r.debounce*1e3,realmSecretSeed:n,overwriteLocal:r.overwriteLocal===!0});s.error&&(console.error(`${h}Error:${m} ${s.error}`),process.exit(1))})}var jn=require("child_process");var ty=200;function iy(i){return new Promise(e=>setTimeout(e,i))}function wp(i){try{if(process.platform==="win32")try{process.kill(i)}catch{(0,jn.execSync)(`taskkill /PID ${i} /F`,{stdio:"ignore"})}else process.kill(i,"SIGINT");return{ok:!0,alreadyGone:!1}}catch(e){return e?.code==="ESRCH"?{ok:!0,alreadyGone:!0}:{ok:!1,alreadyGone:!1}}}function ry(){if(process.platform==="win32")return[];let i;try{i=(0,jn.execSync)('ps aux | grep -E "(tsx[[:space:]].*src/index\\.ts[[:space:]]+realm[[:space:]]+watch[[:space:]]+start|[[:space:]]boxel[[:space:]]+realm[[:space:]]+watch[[:space:]]+start|node[[:space:]].*boxel[[:space:]]+realm[[:space:]]+watch[[:space:]]+start)" | grep -v grep | grep -v "[[:space:]]stop"',{encoding:"utf8"}).trim()}catch{return[]}if(!i)return[];let e=[],t=new Set;for(let r of i.split(`
112
- `)){if(!r)continue;let n=r.trim().split(/\s+/),s=Number.parseInt(n[1]??"",10);if(!Number.isFinite(s)||t.has(s))continue;t.add(s);let o=".",a=r.match(/\bstart\s+\S+\s+(\S+)/);a&&a[1]&&!a[1].startsWith("-")&&(o=a[1]),e.push({pid:s,workspace:o})}return e}async function ny(){let i=[],e=[],t=new Set,r=await Pn();for(let n of r){if(n.pid===process.pid)continue;t.add(n.pid);let s=wp(n.pid),o={pid:n.pid,workspace:n.workspace};s.ok?i.push(o):e.push(o)}for(let n of ry()){if(n.pid===process.pid||t.has(n.pid))continue;t.add(n.pid);let s=wp(n.pid),o={pid:n.pid,workspace:n.workspace};s.ok?i.push(o):e.push(o)}return i.length>0&&(await iy(ty),await Pn()),{stopped:i,failed:e}}function sy(i){if(i.stopped.length===0&&i.failed.length===0){console.log("No running watch processes found.");return}for(let e of i.stopped)console.log(` ${g}\u21C5${m} Stopped: boxel realm watch ${e.workspace} (PID ${e.pid})`);for(let e of i.failed)console.log(` ${h}\xD7${m} Failed to stop: boxel realm watch ${e.workspace} (PID ${e.pid})`);if(i.stopped.length>0){let e=i.stopped.length>1?"es":"";console.log(`
113
- ${R}\u2713 Stopped ${i.stopped.length} process${e}${m}`)}}function Ep(i){i.command("stop").description("Stop all running boxel realm watch processes").action(async()=>{let e=await ny();sy(e)})}function Rp(i){let e=i.command("watch").description("Watch a Boxel realm; subcommands manage watch processes");yp(e),Ep(e)}function $p(i){let e=i.command("realm").description("Manage realms on the realm server");vl(e),El(e),Dl(e),ql(e),Hl(e),Yl(e),Ql(e),ep(e),ip(e);let t=ap(e);op(t),Wl(e),lp(e),Rp(e)}async function oy(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())return{ok:!1,error:P};if(F(e))return{ok:!1,error:`Cannot delete protected file: ${e}`};let s=new URL(e,k(i)).href,o;try{o=await r.authedRealmFetch(s,{method:"DELETE",headers:{Accept:"application/vnd.card+source"}})}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}if(!o.ok){let a=await o.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${o.status}: ${a.slice(0,300)}`}}return{ok:!0}}function kp(i){i.command("delete").description("Delete a file from a realm").argument("<path>","Realm-relative file path to delete").requiredOption("--realm <realm-url>","The realm URL to delete from").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await oy(t.realm,e)}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}t.json?j.output(JSON.stringify(r,null,2)):r.ok?console.log(`${g}Deleted:${m} ${e}`):console.error(`${h}Error:${m} ${r.error}`),r.ok||process.exit(1)})}async function Mn(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())return{ok:!1,error:P};let s=new URL(e,k(i)).href,o;try{o=await r.authedRealmFetch(s,{method:"GET",headers:{Accept:"application/vnd.card+source"}})}catch(c){return{ok:!1,error:c instanceof Error?c.message:String(c)}}if(!o.ok){let c=await o.text().catch(()=>"(no body)");return{ok:!1,status:o.status,error:`HTTP ${o.status}: ${c.slice(0,300)}`}}if(ve(e)){let c=new Uint8Array(await o.arrayBuffer());return{ok:!0,status:o.status,bytes:c}}let a=await o.text();return{ok:!0,status:o.status,content:a}}function Sp(i){i.command("read").description("Read a file from a realm").argument("<path>","Realm-relative file path (e.g., hello-world.json, Cards/my-card.gts)").requiredOption("--realm <realm-url>","The realm URL to read from").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await Mn(t.realm,e)}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}if(t.json){let n={ok:r.ok,status:r.status,error:r.error};r.content!==void 0&&(n.content=r.content),r.bytes!==void 0&&(n.bytesBase64=Buffer.from(r.bytes.buffer,r.bytes.byteOffset,r.bytes.byteLength).toString("base64")),j.output(JSON.stringify(n,null,2))}else r.ok?r.bytes!==void 0?process.stdout.write(r.bytes):j.output(r.content??""):(console.error(`${g}Status:${m} ${r.status??"(no status)"}`),console.error(`${h}Error:${m} ${r.error}`));r.ok||process.exit(1)})}var In="// touched for re-index";async function ay(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())return{ok:!1,touched:[],skipped:[],error:P};let s;if(t?.all){if(e.length>0)return{ok:!1,touched:[],skipped:[],error:"Cannot pass file paths together with --all"};let c=await Ne(i,{profileManager:r});if(c.error)return{ok:!1,touched:[],skipped:[],error:c.error};s=c.filenames.filter(l=>(l.endsWith(".json")||l.endsWith(".gts"))&&!F(l))}else{if(e.length===0)return{ok:!1,touched:[],skipped:[],error:"No file paths provided. Pass paths or use --all."};s=e}let o=[],a=[];for(let c of s){if(!c.endsWith(".json")&&!c.endsWith(".gts")){a.push({path:c,reason:"unsupported extension"});continue}if(F(c)){a.push({path:c,reason:"protected file"});continue}let l=await Mn(i,c,{profileManager:r});if(!l.ok||l.content==null){a.push({path:c,reason:l.error??"read failed"});continue}if(t?.dryRun){o.push(c);continue}let p=c.endsWith(".json")?cy(l.content):py(l.content),u=await gt(i,c,p,{profileManager:r});if(!u.ok){a.push({path:c,reason:u.error??"write failed"});continue}o.push(c)}return{ok:a.length===0,touched:o,skipped:a}}function cy(i){try{let e=JSON.parse(i);if(e?.data)return e.data.meta={...e.data.meta??{},_touched:Date.now()},JSON.stringify(e,null,2)+`
114
- `}catch{}return ly(i)}function ly(i){return i.endsWith(`
98
+ Checkpoint created: ${l.shortHash} ${p} ${l.message}`)}}console.log("Pull completed")}};function tp(i){i.command("pull").description("Pull files from a Boxel realm to a local directory").argument("<realm-url>","The URL of the source realm (e.g., https://app.boxel.ai/demo/)").argument("<local-dir>","The local directory to sync files to").option("--delete","Delete local files that do not exist in the realm").option("--dry-run","Show what would be done without making changes").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(e,t,r)=>{let n=await ve(r.realmSecretSeed===!0),s=await Wb(e,t,{delete:r.delete,dryRun:r.dryRun,realmSecretSeed:n});s.error&&(console.error(`Error: ${s.error}`),process.exit(s.files.length>0?2:1)),console.log("Pull completed successfully")})}async function Wb(i,e,t){let r;if(t.authenticator)r=t.authenticator;else{let n=ye({realmUrl:i,realmSecretSeed:t.realmSecretSeed,profileManager:t.profileManager});if(!n.ok)return{files:[],error:n.error};r=n.authenticator}try{let n=new wn({realmUrl:i,localDir:e,deleteLocal:t.delete,dryRun:t.dryRun},r);return await n.sync(),n.hasError?{files:n.downloadedFiles.sort(),error:"Pull completed with errors. Some files may not have been downloaded."}:{files:n.downloadedFiles.sort()}}catch(n){return{files:[],error:`Pull failed: ${n instanceof Error?n.message:String(n)}`}}}var qe=P(require("fs/promises")),En=P(require("path")),ip=P(require("crypto"));function Rn(i){if(typeof i!="object"||i===null)return!1;let e=i;if(typeof e.realmUrl!="string"||typeof e.files!="object"||e.files===null)return!1;for(let t of Object.values(e.files))if(typeof t!="string")return!1;if(e.remoteMtimes!==void 0){if(typeof e.remoteMtimes!="object"||e.remoteMtimes===null)return!1;for(let t of Object.values(e.remoteMtimes))if(typeof t!="number")return!1}return!0}async function tt(i){try{return await qe.access(i),!0}catch{return!1}}async function se(i){let e=await qe.readFile(i);return ip.createHash("md5").update(e).digest("hex")}async function we(i){let e=En.join(i,".boxel-sync.json"),t;try{t=await qe.readFile(e,"utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}let r;try{r=JSON.parse(t)}catch{return null}return Rn(r)?r:(console.warn("Warning: .boxel-sync.json is malformed or has an unexpected shape; falling back to a full upload."),null)}async function Oe(i,e){let t=En.join(i,".boxel-sync.json");await qe.writeFile(t,JSON.stringify(e,null,2))}var Gb=new Set(["index.json","realm.json"]),$n=class extends ue{constructor(t,r){super(t,r);this.pushOptions=t}hasError=!1;async sync(){console.log(`Starting push from ${this.options.localDir} to ${this.options.realmUrl}`),console.log("Testing realm access...");let t;try{t=await this.getRemoteFileList("")}catch(p){throw console.error("Failed to access realm:",p),new Error("Cannot proceed with push: Authentication or access failed. Please check your credentials and realm permissions.")}console.log("Realm access verified");let r=await this.getLocalFileList();console.log(`Found ${r.size} files in local directory`);let n=await we(this.options.localDir),s={realmUrl:this.normalizedRealmUrl,files:{},remoteMtimes:{}},o=new Map,a=new Set;if(!this.pushOptions.force&&n!==null&&n.realmUrl===this.normalizedRealmUrl){console.log("Checking for changed files...");let p=0,[u,f]=await Promise.all([this.getRemoteMtimes(),Promise.all(Array.from(r.entries()).map(async([d,h])=>{if(U(d))return{relativePath:d,localPath:h,currentHash:"",protected:!0};let b=await se(h);return{relativePath:d,localPath:h,currentHash:b,protected:!1}}))]);for(let d of f){if(d.protected){p++;continue}let h=n.files[d.relativePath],b=n.remoteMtimes?.[d.relativePath],j=u.get(d.relativePath),te=h!==d.currentHash,E=h!==void 0&&!t.has(d.relativePath),$=b!==void 0&&j!==void 0&&j!==b;te||E||$?(o.set(d.relativePath,d.localPath),!te&&(E||$)&&a.add(d.relativePath)):(p++,s.files[d.relativePath]=d.currentHash,b!==void 0&&(s.remoteMtimes[d.relativePath]=b))}if(p>0&&console.log(`Skipping ${p} unchanged files`),a.size>0){let d=Array.from(a),h=d.slice(0,5).join(", "),b=d.length>5?", ...":"";console.warn(`Warning: ${a.size} file(s) changed on the realm since your last push; your local versions will overwrite them: ${h}${b}`)}}else{this.pushOptions.force?console.log("Force mode: uploading all files"):console.log(n?"Realm URL changed, will upload all files":"No sync manifest found, will upload all files");for(let[p,u]of r)U(p)||o.set(p,u)}let l=!1;if(o.size===0)console.log("No files to upload - everything is up to date");else{console.log(`Uploading ${o.size} file(s) via /_atomic...`);let p=new Set,u=this.pushOptions.force||!n;for(let d of o.keys())if(u)t.has(d)||p.add(d);else{let h=n.files[d]!==void 0,b=h&&!t.has(d);(!h||b)&&p.add(d)}let f=await this.uploadFilesAtomic(o,p);if(f.succeeded.length>0){let d=await Promise.all(f.succeeded.map(async h=>({rel:h,hash:await se(o.get(h))})));for(let{rel:h,hash:b}of d)s.files[h]=b}if(f.error){l=!0,this.hasError=!0,console.error(f.error.message);for(let d of f.error.perFile){let h;d.status===409?h=`${d.path} was created on the realm concurrently \u2014 run with --force to overwrite.`:d.status===404?h=`${d.path} was removed from the realm concurrently \u2014 run with --force to re-create it from your local copy.`:h=`${d.path}: ${d.title}`,console.error(` ${h}`)}}}if(this.pushOptions.deleteRemote){let p=new Set(t.keys()),u=[];for(let f of p){if(U(f)){p.delete(f);continue}Gb.has(f)&&(p.delete(f),u.push(f))}for(let f of r.keys())p.delete(f);if(u.length>0&&console.log(`Skipping ${u.length} realm-managed remote artifact(s): ${u.join(", ")}`),p.size>0){let f=Array.from(p).sort();console.log(`Deleting ${f.length} remote files that don't exist locally: ${f.join(", ")}`);for(let d of f)try{await this.deleteFile(d)}catch(h){this.hasError=!0,console.error(`Error deleting ${d}:`,h)}}}if(!this.options.dryRun&&o.size>0)try{let p=await this.getRemoteMtimes();for(let u of Object.keys(s.files)){let f=p.get(u);f!==void 0&&(s.remoteMtimes[u]=f)}}catch(p){console.warn("Could not refresh remote mtimes after upload:",p)}if(s.remoteMtimes&&Object.keys(s.remoteMtimes).length===0&&delete s.remoteMtimes,this.options.dryRun||await Oe(this.options.localDir,s),!this.options.dryRun&&o.size>0&&!l){let p=new H(this.options.localDir),u=Array.from(o.keys()).map(d=>({file:d,status:"modified"})),f=await p.createCheckpoint("local",u);if(f){let d=f.isMajor?"[MAJOR]":"[minor]";console.log(`
99
+ Checkpoint created: ${f.shortHash} ${d} ${f.message}`)}}console.log("Push completed")}};function rp(i){i.command("push").description("Push local files to a Boxel realm").argument("<local-dir>","The local directory containing files to sync").argument("<realm-url>","The URL of the target realm (e.g., https://app.boxel.ai/demo/)").option("--delete","Delete remote files that do not exist locally").option("--dry-run","Show what would be done without making changes").option("--force","Upload all files, even if unchanged").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(e,t,r)=>{let n=await ve(r.realmSecretSeed===!0);await Vb(e,t,{delete:r.delete,dryRun:r.dryRun,force:r.force,realmSecretSeed:n})})}async function Vb(i,e,t){let r;if(t.authenticator)r=t.authenticator;else{let n=ye({realmUrl:e,realmSecretSeed:t.realmSecretSeed,profileManager:t.profileManager});n.ok||(console.error(`Error: ${n.error}`),process.exit(1)),r=n.authenticator}await tt(i)||(console.error(`Local directory does not exist: ${i}`),process.exit(1));try{let n=new $n({realmUrl:e,localDir:i,deleteRemote:t.delete,dryRun:t.dryRun,force:t.force},r);await n.sync(),n.hasError?(console.log("Push did not complete successfully. View logs for details"),process.exit(2)):console.log("Push completed successfully")}catch(n){console.error("Push failed:",n),process.exit(1)}}async function np(i){let e=k(i.realmUrl.trim()),t=i.profileManager??C(),r=t.getActiveProfile();if(!r)return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:0,nextCount:0,error:A};let n;try{n=await t.getUserRealms()}catch(f){return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:0,nextCount:0,error:`Failed to load realm list: ${f instanceof Error?f.message:String(f)}`}}let s=n.map(k),o=s.length,a=s.filter(f=>f===e).length;if(a===0)return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:o,notInList:!0,error:"Realm is not in app.boxel.realms. Nothing to remove."};let c=o-a;if(i.dryRun)return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:c};let l=r.profile.realmServerUrl.replace(/\/$/,""),p;try{p=await t.authedRealmServerFetch(`${l}/_delete-realm`,{method:"DELETE",headers:{"Content-Type":"application/vnd.api+json"},body:JSON.stringify({data:{type:"realm",id:e}})})}catch(f){return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:o,error:`Failed to reach realm server: ${f instanceof Error?f.message:String(f)}`}}if(!p.ok){let f=await Bb(p),d=p.status===403?`You do not own this realm and cannot delete it on the server. Server returned 403: ${f}`:`Realm server returned ${p.status}: ${f}`;return{realmUrl:e,removed:!1,serverDeleted:!1,unlinked:!1,previousCount:o,nextCount:o,error:d}}let u;try{u=await t.removeFromUserRealms(e)}catch(f){return{realmUrl:e,removed:!1,serverDeleted:!0,unlinked:!1,previousCount:o,nextCount:o,error:`Server delete succeeded, but Matrix unlink failed: ${f instanceof Error?f.message:String(f)}`}}return u?{realmUrl:e,removed:!0,serverDeleted:!0,unlinked:u,previousCount:o,nextCount:c}:{realmUrl:e,removed:!1,serverDeleted:!0,unlinked:!1,previousCount:o,nextCount:o,error:"Server delete succeeded, but Matrix account_data did not contain the URL by the time we PUT (concurrent edit?). Server-side files are gone; please refresh and check your realm list."}}async function Bb(i){try{return await i.text()}catch{return"<no response body>"}}function sp(i){i.command("remove").description("Remove a realm \u2014 deletes server-side files and unlinks it from your realm list").argument("<realm-url>","realm URL to remove").option("-y, --yes","Skip the interactive confirmation prompt").option("--dry-run","Preview the change without writing to Matrix").action(async(e,t)=>{let r=k(e.trim()),n=await np({realmUrl:r,dryRun:!0});if(n.error&&!n.notInList&&(console.error(`${g}Error:${m} ${n.error}`),process.exit(1)),n.notInList&&(console.error(`${g}Error:${m} ${n.error}`),process.exit(1)),console.log(`Remove target: ${_}${n.realmUrl}${m}`),console.log(`${x}app.boxel.realms: ${n.previousCount} -> ${n.nextCount}${m}`),t.dryRun){console.log(`${x}[DRY RUN] No server delete or Matrix changes sent.${m}`);return}if(!t.yes){process.stdin.isTTY||(console.error(`${g}Error:${m} stdin is not a TTY. Pass --yes to confirm in non-interactive mode.`),process.exit(1));let o=await re("This will permanently delete the realm files, indexer state, and registry entry on the server. Proceed? (y/N) ");if(!/^y/i.test(o)){console.log(`${x}Cancelled.${m}`);return}}let s=await np({realmUrl:r});(s.error||!s.removed)&&(console.error(`${g}Error:${m} ${s.error??"Removal did not complete."}`),s.serverDeleted&&!s.unlinked&&console.error(`${x}The realm is gone, but your account_data still references ${s.realmUrl}.${m}`),process.exit(1)),console.log(`${R}Removed:${m} ${_}${s.realmUrl}${m}`)})}var it=P(require("fs/promises")),$t=P(require("path"));function Pi(i,e,t){let r=e.has(i),n=t?.files[i]!==void 0;return r&&n?e.get(i)===t.files[i]?"unchanged":"changed":r&&!n?"added":!r&&n?"deleted":"unchanged"}function Ai(i,e,t){let r=e.has(i),n=t?.remoteMtimes?.[i]!==void 0,s=t?.files[i]!==void 0,o=n||s;return r&&n?e.get(i)===t.remoteMtimes[i]?"unchanged":"changed":r&&s?"changed":r&&!o?"added":!r&&o?"deleted":"unchanged"}function op(i,e,t){return i==="unchanged"&&e==="unchanged"?"noop":i==="changed"&&e==="unchanged"?"push":i==="unchanged"&&e==="changed"?"pull":i==="added"&&e==="unchanged"?"push":i==="unchanged"&&e==="added"?"pull":i==="changed"&&e==="changed"||i==="added"&&e==="added"||i==="changed"&&e==="added"||i==="added"&&e==="changed"?"conflict":i==="deleted"&&e==="unchanged"?t.deleteSync||t.preferLocal?"push-delete":"noop":i==="unchanged"&&e==="deleted"?t.deleteSync||t.preferRemote?"pull-delete":"noop":i==="deleted"&&e==="changed"||i==="changed"&&e==="deleted"?"conflict":i==="deleted"&&e==="deleted"?"noop":i==="added"&&e==="deleted"?"push":i==="deleted"&&e==="added"?"pull":"noop"}function ap(i,e,t,r){let{localStatus:n,remoteStatus:s,relativePath:o}=i;if(!r)return null;switch(r){case"prefer-local":return n==="deleted"?"push-delete":"push";case"prefer-remote":return s==="deleted"?"pull-delete":"pull";case"prefer-newest":{if(n==="deleted"&&s==="changed")return"pull";if(n==="changed"&&s==="deleted")return"push";let a=e.get(o),c=t.get(o);return a&&c!==void 0?a.mtime>c*1e3?"push":"pull":"push"}}}var zb=new Set(["node_modules",".git",".boxel-history",".cache",".vscode","dist","build","tmp"]),Yb=6;function Jb(i,e){return i==="unchanged"&&e==="unchanged"||i==="deleted"&&e==="deleted"?null:i==="unchanged"&&e==="added"?"new-remote":i==="unchanged"&&e==="changed"?"modified-remote":i==="unchanged"&&e==="deleted"?"deleted-remote":i==="added"&&e==="unchanged"?"new-local":i==="changed"&&e==="unchanged"?"modified-local":i==="deleted"&&e==="unchanged"?"deleted-local":i==="changed"&&e==="changed"||i==="added"&&e==="added"||i==="changed"&&e==="added"||i==="added"&&e==="changed"||i==="changed"&&e==="deleted"||i==="deleted"&&e==="changed"?"conflict":i==="added"&&e==="deleted"?"new-local":i==="deleted"&&e==="added"?"new-remote":null}var kn=class extends ue{constructor(t,r,n){super(t,n);this.statusOptions=t;this.loadedManifest=r}changes=[];pulled=[];hasError=!1;error;remoteMtimes=new Map;async sync(){let t,r;try{[t,this.remoteMtimes,r]=await Promise.all([this.getLocalFileListWithMtimes(),this.getRemoteMtimes(),this.getRemoteFileList()])}catch(a){this.hasError=!0,this.error=a instanceof Error?`Failed to fetch realm state: ${a.message}`:`Failed to fetch realm state: ${String(a)}`;return}if(r&&this.remoteMtimes.size===0&&r.size>0)for(let[a]of r)this.remoteMtimes.set(a,0);let n=new Map;for(let[a,c]of t)n.set(a,c.path);let s=new Map;await Promise.all(Array.from(n.entries()).map(async([a,c])=>{U(a)||s.set(a,await se(c))}));let o=new Set;for(let a of n.keys())o.add(a);for(let a of this.remoteMtimes.keys())o.add(a);for(let a of Object.keys(this.loadedManifest.files))o.add(a);if(this.loadedManifest.remoteMtimes)for(let a of Object.keys(this.loadedManifest.remoteMtimes))o.add(a);for(let a of o){if(U(a))continue;let c=Pi(a,s,this.loadedManifest),l=Ai(a,this.remoteMtimes,this.loadedManifest),p=Jb(c,l);p!==null&&this.changes.push({file:a,status:p})}this.changes.sort((a,c)=>a.file.localeCompare(c.file)),this.statusOptions.pull&&await this.performSafePull()}async performSafePull(){let t=this.changes.filter(n=>n.status==="new-remote"||n.status==="modified-remote");if(t.length===0)return;let r=[];for(let n of t){let s=$t.join(this.options.localDir,n.file);try{await this.downloadFile(n.file,s),this.pulled.push(n.file);let o=await se(s);this.loadedManifest.files[n.file]=o;let a=this.remoteMtimes.get(n.file);a!==void 0&&(this.loadedManifest.remoteMtimes=this.loadedManifest.remoteMtimes??{},this.loadedManifest.remoteMtimes[n.file]=a)}catch(o){this.hasError=!0;let a=o instanceof Error?o.message:String(o);r.push({file:n.file,message:a}),console.error(` ${g}\u2717 ${n.file}${m} (${a})`)}}r.length>0&&(this.error=`Failed to pull ${r.length} file(s): ${r.map(n=>`${n.file} (${n.message})`).join("; ")}`),this.pulled.length>0&&await Oe(this.options.localDir,this.loadedManifest)}};async function cp(i,e){let t={localDir:i,realmUrl:"",changes:[],pulled:[],inSync:!1,hasError:!1},r=$t.join(i,".boxel-sync.json");if(!await tt(r))return{...t,hasError:!0,error:`No .boxel-sync.json found in ${i}. Run: boxel realm sync ${i} <realm-url>`};let n=await we(i);if(!n)return{...t,hasError:!0,error:`Malformed .boxel-sync.json in ${i}`};let s;try{s=(await it.stat(r)).mtimeMs}catch{}let o;if(e.authenticator)o=e.authenticator;else{let c=ye({realmUrl:n.realmUrl,realmSecretSeed:e.realmSecretSeed,profileManager:e.profileManager});if(!c.ok)return{...t,realmUrl:n.realmUrl,manifestMtime:s,hasError:!0,error:c.error};o=c.authenticator}let a=new kn({realmUrl:n.realmUrl,localDir:i,pull:e.pull},n,o);return await a.sync(),{localDir:i,realmUrl:n.realmUrl,manifestMtime:s,changes:a.changes,pulled:a.pulled.slice().sort(),inSync:!a.hasError&&a.changes.length===0,hasError:a.hasError,error:a.error}}async function Xb(i,e){let t=[];async function r(n,s){if(s>e)return;let o;try{o=await it.readdir(n,{withFileTypes:!0})}catch{return}if(o.some(c=>c.isFile()&&c.name===".boxel-sync.json")){t.push(n);return}for(let c of o)c.isDirectory()&&(zb.has(c.name)||await r($t.join(n,c.name),s+1))}return await r(i,0),t.sort(),t}async function Kb(i,e){if(e.pull)return{rootDir:i,workspaces:[],hasError:!0,error:"Cannot use --pull with --all"};let t=process.env.BOXEL_STATUS_ALL_MAX_DEPTH,r=t!==void 0?Number(t):NaN,n=Number.isFinite(r)&&r>=0?r:Yb,s=await Xb(i,n),o=[],a=!1;for(let c of s){let l=$t.join(c,".boxel-sync.json"),p;try{p=await it.readFile(l,"utf8")}catch{o.push({localDir:c,realmUrl:"",changes:[],pulled:[],inSync:!1,hasError:!0,skipped:"no-manifest"}),a=!0;continue}let u;try{u=JSON.parse(p)}catch{u=void 0}if(!Rn(u)){o.push({localDir:c,realmUrl:"",changes:[],pulled:[],inSync:!1,hasError:!0,skipped:"malformed"}),a=!0;continue}let f=await cp(c,{profileManager:e.profileManager,realmSecretSeed:e.realmSecretSeed,authenticator:e.authenticator}),d={...f};f.hasError&&(d.skipped="fetch-failed",a=!0),o.push(d)}return{rootDir:i,workspaces:o,hasError:a}}function Qb(i){if(i.hasError&&i.error){console.error(`${g}Error:${m} ${i.error}`);return}if(console.log(`Realm: ${i.realmUrl}`),console.log(`Local: ${i.localDir}`),i.manifestMtime&&console.log(`${x}Manifest updated:${m} ${new Date(i.manifestMtime).toISOString()}`),console.log(""),i.changes.length===0){console.log(`${R}\u2713 In sync${m}`);return}let e={"new-remote":[],"modified-remote":[],"new-local":[],"modified-local":[],conflict:[],"deleted-local":[],"deleted-remote":[]};for(let t of i.changes)e[t.status].push(t.file);if(e["new-remote"].length>0){console.log(`${_}\u2193 New on remote (${e["new-remote"].length}):${m}`);for(let t of e["new-remote"])console.log(` + ${t}`);console.log("")}if(e["modified-remote"].length>0){console.log(`${_}\u2193 Modified on remote (${e["modified-remote"].length}):${m}`);for(let t of e["modified-remote"])console.log(` ~ ${t}`);console.log("")}if(e["new-local"].length>0){console.log(`${R}\u2191 New locally (${e["new-local"].length}):${m}`);for(let t of e["new-local"])console.log(` + ${t}`);console.log("")}if(e["modified-local"].length>0){console.log(`${R}\u2191 Modified locally (${e["modified-local"].length}):${m}`);for(let t of e["modified-local"])console.log(` ~ ${t}`);console.log("")}if(e.conflict.length>0){console.log(`${L}\u26A0 Conflicts (${e.conflict.length}):${m}`);for(let t of e.conflict)console.log(` ! ${t}`);console.log("")}if(e["deleted-local"].length>0){console.log(`${g}- Deleted locally (${e["deleted-local"].length}):${m}`);for(let t of e["deleted-local"])console.log(` - ${t}`);console.log("")}if(e["deleted-remote"].length>0){console.log(`${g}- Deleted on remote (${e["deleted-remote"].length}):${m}`);for(let t of e["deleted-remote"])console.log(` - ${t}`);console.log("")}if(i.pulled.length>0){console.log(`${_}Pulled ${i.pulled.length} file(s):${m}`);for(let t of i.pulled)console.log(` \u2713 ${t}`)}}function Zb(i){if(i.error){console.error(`${g}Error:${m} ${i.error}`);return}if(i.workspaces.length===0){console.log(`No .boxel-sync.json directories found under ${i.rootDir}.`);return}for(let e of i.workspaces){if(e.skipped){console.log(`${L}${e.localDir}${m} [${e.skipped}]`),e.error&&console.log(` ${x}${e.error}${m}`),console.log("");continue}let t={newRemote:0,modRemote:0,newLocal:0,modLocal:0,conflict:0,delLocal:0,delRemote:0};for(let r of e.changes)r.status==="new-remote"?t.newRemote++:r.status==="modified-remote"?t.modRemote++:r.status==="new-local"?t.newLocal++:r.status==="modified-local"?t.modLocal++:r.status==="conflict"?t.conflict++:r.status==="deleted-local"?t.delLocal++:r.status==="deleted-remote"&&t.delRemote++;if(console.log(`${e.localDir} ${x}${e.realmUrl}${m}`),e.inSync)console.log(` ${R}\u2713 in sync${m}`);else{let r=[];t.newRemote>0&&r.push(`${_}\u2193+${t.newRemote}${m}`),t.modRemote>0&&r.push(`${_}\u2193~${t.modRemote}${m}`),t.newLocal>0&&r.push(`${R}\u2191+${t.newLocal}${m}`),t.modLocal>0&&r.push(`${R}\u2191~${t.modLocal}${m}`),t.conflict>0&&r.push(`${L}\u26A0${t.conflict}${m}`),t.delLocal>0&&r.push(`${g}-L${t.delLocal}${m}`),t.delRemote>0&&r.push(`${g}-R${t.delRemote}${m}`),console.log(` ${r.join(" ")}`)}console.log("")}}function lp(i){i.command("status").aliases(["st"]).description("Show pending changes between a local sync dir and its realm").argument("[local-dir]","Local sync directory (defaults to current working directory)").option("--pull","Download safe remote changes and update manifest").option("--all","Recursively report all .boxel-sync.json dirs under the current directory").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(e,t)=>{let r=await ve(t.realmSecretSeed===!0);if(t.all){t.pull&&(console.error(`${g}Error:${m} Cannot use --pull with --all`),process.exit(1));let s=await Kb(e??process.cwd(),{all:!0,realmSecretSeed:r});Zb(s),s.hasError&&process.exit(2);return}let n=await cp(e??process.cwd(),{pull:t.pull,realmSecretSeed:r});Qb(n),n.hasError&&process.exit(n.pulled.length>0?2:1)})}var _n=P(require("path"));var Cn=class extends ue{constructor(t,r){super(t,r);this.syncOptions=t}hasError=!1;pushedFiles=[];pulledFiles=[];remoteDeletedFiles=[];localDeletedFiles=[];skippedConflicts=[];get conflictStrategy(){return this.syncOptions.preferLocal?"prefer-local":this.syncOptions.preferRemote?"prefer-remote":this.syncOptions.preferNewest?"prefer-newest":null}async sync(){console.log(`Starting sync between ${this.options.localDir} and ${this.options.realmUrl}`),console.log("Testing realm access...");let t;try{t=await this.getRemoteFileList("")}catch(E){throw console.error("Failed to access realm:",E),new Error("Cannot proceed with sync: Authentication or access failed. Please check your credentials and realm permissions.")}console.log("Realm access verified");let[r,n,s]=await Promise.all([this.getLocalFileListWithMtimes(),this.getRemoteMtimes(),we(this.options.localDir)]),o=new Map;for(let[E,$]of r)o.set(E,$.path);if(n.size===0&&t&&t.size>0){console.log("Remote mtimes unavailable, falling back to file listing for remote detection");for(let[E]of t)n.set(E,0)}console.log(`Found ${o.size} local files`),console.log(`Found ${n.size} remote files`),s&&s.realmUrl!==this.normalizedRealmUrl&&console.warn(`${L}Warning:${m} Manifest realm URL (${s.realmUrl}) differs from target (${this.normalizedRealmUrl}). Treating as first sync.`);let a=s&&s.realmUrl===this.normalizedRealmUrl?s:null,c=new Map;await Promise.all(Array.from(o.entries()).map(async([E,$])=>{U(E)||c.set(E,await se($))}));let l=new Set;for(let E of o.keys())l.add(E);for(let E of n.keys())l.add(E);if(a){for(let E of Object.keys(a.files))l.add(E);if(a.remoteMtimes)for(let E of Object.keys(a.remoteMtimes))l.add(E)}let p=[];for(let E of l){if(U(E))continue;let $=Pi(E,c,a),O=Ai(E,n,a),D=op($,O,this.syncOptions);p.push({relativePath:E,localStatus:$,remoteStatus:O,action:D})}let u=[],f=[],d=[],h=[],b=[],j=0;for(let E of p)switch(E.action){case"push":u.push(E.relativePath);break;case"pull":f.push(E.relativePath);break;case"push-delete":d.push(E.relativePath);break;case"pull-delete":h.push(E.relativePath);break;case"conflict":b.push(E);break;case"noop":j++;break}for(let E of b)switch(ap(E,r,n,this.conflictStrategy)){case"push":u.push(E.relativePath);break;case"pull":f.push(E.relativePath);break;case"push-delete":d.push(E.relativePath);break;case"pull-delete":h.push(E.relativePath);break;case"noop":break;default:this.skippedConflicts.push(E.relativePath);break}if(console.log(`
100
+ ${x}Sync plan:${m}`),u.length>0&&console.log(` ${R}\u2191 Push:${m} ${u.length} file(s)`),f.length>0&&console.log(` ${_}\u2193 Pull:${m} ${f.length} file(s)`),d.length>0&&console.log(` ${g}\u2191 Delete remote:${m} ${d.length} file(s)`),h.length>0&&console.log(` ${g}\u2193 Delete local:${m} ${h.length} file(s)`),this.skippedConflicts.length>0){console.log(` ${L}\u26A0 Conflicts skipped:${m} ${this.skippedConflicts.length} file(s)`);for(let E of this.skippedConflicts)console.log(` ${E}`);console.log(` ${x}Use --prefer-local, --prefer-remote, or --prefer-newest to resolve.${m}`)}if(j>0&&console.log(` ${x}Unchanged: ${j} file(s)${m}`),u.length+f.length+d.length+h.length===0){console.log(`
101
+ Everything is up to date`),!this.options.dryRun&&!a&&this.skippedConflicts.length===0&&await this.writeManifest(c,n);return}if(f.length>0){console.log(`
102
+ Pulling ${f.length} file(s)...`);let E=await Promise.all(f.map($=>this.remoteLimit(async()=>{try{let O=_n.join(this.options.localDir,$);return await this.downloadFile($,O),$}catch(O){return this.hasError=!0,console.error(`Error downloading ${$}:`,O),null}})));this.pulledFiles.push(...E.filter($=>$!==null))}if(u.length>0){console.log(`
103
+ Pushing ${u.length} file(s)...`);let E=new Map;for(let D of u){let St=o.get(D);St&&E.set(D,St)}let $=new Set;for(let D of E.keys()){let St=a?.files[D]!==void 0,qp=n.has(D);!St&&!qp&&$.add(D)}let O=await this.uploadFilesAtomic(E,$);if(this.pushedFiles.push(...O.succeeded),O.error){this.hasError=!0,console.error(O.error.message);for(let D of O.error.perFile)console.error(` ${D.path}: ${D.title}`)}}if(d.length>0){console.log(`
104
+ Deleting ${d.length} remote file(s)...`);let E=await Promise.all(d.map($=>this.remoteLimit(async()=>{try{return await this.deleteFile($),$}catch(O){return this.hasError=!0,console.error(`Error deleting remote ${$}:`,O),null}})));this.remoteDeletedFiles.push(...E.filter($=>$!==null))}if(h.length>0){console.log(`
105
+ Deleting ${h.length} local file(s)...`);let E=await Promise.all(h.map(async $=>{try{let O=o.get($);return O?(await this.deleteLocalFile(O),$):null}catch(O){return this.hasError=!0,console.error(`Error deleting local ${$}:`,O),null}}));this.localDeletedFiles.push(...E.filter($=>$!==null))}if(!this.options.dryRun){let E=new Map;if(a)for(let[O,D]of Object.entries(a.files))E.set(O,D);for(let[O,D]of c)E.set(O,D);for(let O of this.pushedFiles){let D=o.get(O);D&&E.set(O,await se(D))}for(let O of this.pulledFiles){let D=_n.join(this.options.localDir,O);E.set(O,await se(D))}for(let O of this.remoteDeletedFiles)E.delete(O);for(let O of this.localDeletedFiles)E.delete(O);let $=n;if(this.pushedFiles.length>0||this.remoteDeletedFiles.length>0)try{$=await this.getRemoteMtimes()}catch{console.warn("Could not refresh remote mtimes after sync")}await this.writeManifest(E,$)}if(!this.options.dryRun){let E=[...this.pushedFiles.map($=>({file:$,status:"modified"})),...this.pulledFiles.map($=>({file:$,status:"modified"})),...this.remoteDeletedFiles.map($=>({file:$,status:"deleted"})),...this.localDeletedFiles.map($=>({file:$,status:"deleted"}))];if(E.length>0){let O=await new H(this.options.localDir).createCheckpoint("local",E);if(O){let D=O.isMajor?"[MAJOR]":"[minor]";console.log(`
106
+ Checkpoint created: ${O.shortHash} ${D} ${O.message}`)}}}console.log(`
107
+ Sync completed`)}async writeManifest(t,r){let n={realmUrl:this.normalizedRealmUrl,files:{},remoteMtimes:{}};for(let[s,o]of t){n.files[s]=o;let a=r.get(s);a!==void 0&&a!==0&&(n.remoteMtimes[s]=a)}n.remoteMtimes&&Object.keys(n.remoteMtimes).length===0&&delete n.remoteMtimes,await Oe(this.options.localDir,n)}};function pp(i){return i.command("sync").description("Bidirectional sync between a local directory and a Boxel realm").argument("<local-dir>","The local directory to sync").argument("<realm-url>","The URL of the target realm (e.g., https://app.boxel.ai/demo/)").option("--prefer-local","Resolve conflicts by keeping local version").option("--prefer-remote","Resolve conflicts by keeping remote version").option("--prefer-newest","Resolve conflicts by keeping newest version").option("--delete","Sync deletions both ways").option("--dry-run","Preview without making changes").option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").action(async(t,r,n)=>{let s=await ve(n.realmSecretSeed===!0),o=await ey(t,r,{preferLocal:n.preferLocal,preferRemote:n.preferRemote,preferNewest:n.preferNewest,delete:n.delete,dryRun:n.dryRun,realmSecretSeed:s}),a=Array.isArray(o.pushed)&&o.pushed.length>0||Array.isArray(o.pulled)&&o.pulled.length>0||Array.isArray(o.remoteDeleted)&&o.remoteDeleted.length>0||Array.isArray(o.localDeleted)&&o.localDeleted.length>0;o.error&&(console.error(`Error: ${o.error}`),process.exit(a?2:1)),console.log("Sync completed successfully")})}async function ey(i,e,t){let r;if(t.authenticator)r=t.authenticator;else{let o=ye({realmUrl:e,realmSecretSeed:t.realmSecretSeed,profileManager:t.profileManager});if(!o.ok)return Sn({error:o.error});r=o.authenticator}if([t.preferLocal,t.preferRemote,t.preferNewest].filter(Boolean).length>1)return Sn({error:"Only one conflict strategy can be specified (--prefer-local, --prefer-remote, or --prefer-newest)."});if(!await tt(i))return Sn({error:`Local directory does not exist: ${i}`});let s;try{s=new Cn({realmUrl:e,localDir:i,preferLocal:t.preferLocal,preferRemote:t.preferRemote,preferNewest:t.preferNewest,deleteSync:t.delete,dryRun:t.dryRun,waitForIndex:t.waitForIndex},r),await s.sync()}catch(o){return{pushed:s?.pushedFiles.slice().sort()??[],pulled:s?.pulledFiles.slice().sort()??[],remoteDeleted:s?.remoteDeletedFiles.slice().sort()??[],localDeleted:s?.localDeletedFiles.slice().sort()??[],skippedConflicts:s?.skippedConflicts.slice().sort()??[],hasError:!0,error:`Sync failed: ${o instanceof Error?o.message:String(o)}`}}return{pushed:s.pushedFiles.slice().sort(),pulled:s.pulledFiles.slice().sort(),remoteDeleted:s.remoteDeletedFiles.slice().sort(),localDeleted:s.localDeletedFiles.slice().sort(),skippedConflicts:s.skippedConflicts.slice().sort(),hasError:s.hasError,error:s.hasError?ty(s):void 0}}function ty(i){return`Sync completed with errors. ${[`${i.pushedFiles.length} pushed`,`${i.pulledFiles.length} pulled`,`${i.remoteDeletedFiles.length} remote deleted`,`${i.localDeletedFiles.length} local deleted`,`${i.skippedConflicts.length} conflicts skipped`].join(", ")}.`}function Sn(i){return{pushed:[],pulled:[],remoteDeleted:[],localDeleted:[],skippedConflicts:[],hasError:!0,...i}}var up=P(Pt());function iy(i){let e=Number.parseInt(i,10);if(!Number.isFinite(e)||e<0||String(e)!==i.trim())throw new up.InvalidArgumentError("--timeout must be a non-negative integer (milliseconds).");return e}async function ry(i,e={}){let t=e.timeoutMs??3e4;if(!Number.isFinite(t)||t<0)return{ready:!1,error:`Invalid timeoutMs: must be a finite, non-negative number (got ${e.timeoutMs}).`};let r=e.profileManager??C();if(!r.getActiveProfile())return{ready:!1,error:A};let s=`${k(i)}_readiness-check`,o=Date.now();for(;Date.now()-o<t;){try{if((await r.authedRealmFetch(s,{method:"GET",headers:{Accept:"application/vnd.api+json"}})).ok)return{ready:!0}}catch{}let a=t-(Date.now()-o);if(a<=0)break;await new Promise(c=>setTimeout(c,Math.min(1e3,a)))}return{ready:!1,error:`Realm not ready after ${t}ms: ${s}`}}function mp(i){i.command("wait-for-ready").description("Poll a realm readiness-check endpoint until it responds OK or the timeout is reached").requiredOption("--realm <realm-url>","The realm URL to check").option("--timeout <ms>","Timeout in milliseconds (default: 30000)",iy).action(async e=>{let t;try{t=await ry(e.realm,{timeoutMs:e.timeout})}catch(r){console.error(`${g}Error:${m} ${r instanceof Error?r.message:String(r)}`),process.exit(1)}t.ready?console.log(`${R}Realm is ready.${m}`):(console.error(`${g}Error:${m} ${t.error??"Realm not ready"}`),process.exit(1))})}var Mn=P(Pt()),Ep=P(require("fs/promises")),ji=P(require("path"));var Pe=P(require("fs/promises")),dp=P(require("path")),ny=".boxel-watch.lock";function Tn(i){return dp.join(i,ny)}function On(i){try{return process.kill(i,0),!0}catch(e){return e?.code==="EPERM"}}async function sy(i){try{let e=await Pe.readFile(Tn(i),"utf8"),t=JSON.parse(e);return typeof t.pid!="number"||typeof t.startedAt!="string"||typeof t.realmUrl!="string"?null:t}catch{return null}}async function fp(i,e){await Pe.mkdir(i,{recursive:!0});let t=await sy(i),r=!1;if(t&&On(t.pid))return{ok:!1,existing:t};t&&(r=!0);let n={pid:process.pid,startedAt:new Date().toISOString(),realmUrl:e};return await Pe.writeFile(Tn(i),JSON.stringify(n,null,2)+`
108
+ `),{ok:!0,staleOverwrote:r}}async function Li(i){try{await Pe.unlink(Tn(i))}catch(e){if(e?.code!=="ENOENT")throw e}}var Ae=P(require("fs/promises")),hp=P(require("os")),Pn=P(require("path"));function gp(){return Pn.join(hp.homedir(),".boxel-cli")}function xp(){return Pn.join(gp(),"watch-processes.json")}async function vp(){try{let i=await Ae.readFile(xp(),"utf8"),e=JSON.parse(i);return Array.isArray(e?.processes)?{processes:e.processes.filter(r=>typeof r?.pid=="number"&&typeof r?.workspace=="string"&&typeof r?.startedAt=="string")}:{processes:[]}}catch{return{processes:[]}}}async function An(i){await Ae.mkdir(gp(),{recursive:!0});let e=xp(),t=`${e}.${process.pid}.tmp`;await Ae.writeFile(t,JSON.stringify(i,null,2)+`
109
+ `),await Ae.rename(t,e)}async function bp(){let i=await vp(),e=i.processes.filter(t=>On(t.pid));return e.length!==i.processes.length&&await An({processes:e}),{processes:e}}async function yp(i){let t=(await bp()).processes.filter(r=>r.pid!==process.pid);t.push({pid:process.pid,workspace:i,startedAt:new Date().toISOString()}),await An({processes:t})}async function wp(){let i=await vp(),e=i.processes.filter(t=>t.pid!==process.pid);e.length!==i.processes.length&&await An({processes:e})}async function Ln(){return(await bp()).processes}var jn=class extends ue{name;debounceMs;overwriteLocal;checkpointManager;lastKnownMtimes=new Map;pendingChanges=new Map;debounceTimer=null;isShutdown=!1;constructor(e,t,r){super({realmUrl:e.realmUrl,localDir:e.localDir},t),this.debounceMs=r.debounceMs,this.overwriteLocal=r.overwriteLocal??!1,this.checkpointManager=new H(e.localDir),this.name=ly(this.normalizedRealmUrl)}async sync(){await this.poll(),await this.flushPending()}async getRemoteMtimes(){let e=`${this.normalizedRealmUrl}_mtimes`,t=await this.authenticator.authedRealmFetch(e,{headers:{Accept:"application/vnd.api+json"}});if(!t.ok)throw new Error(`_mtimes fetch failed for ${this.normalizedRealmUrl}: ${t.status} ${t.statusText}`);let r=await t.json(),n=new Map;for(let[s,o]of Object.entries(r.data?.attributes?.mtimes??{}))n.set(s.replace(this.normalizedRealmUrl,""),o);return n}get localDir(){return this.options.localDir}get realmUrl(){return this.normalizedRealmUrl}get pendingCount(){return this.pendingChanges.size}async initialize(){await this.getRemoteMtimes(),await this.checkpointManager.isInitialized()||await this.checkpointManager.init();let e=await we(this.options.localDir);if(e&&e.realmUrl===this.normalizedRealmUrl&&e.remoteMtimes)for(let[t,r]of Object.entries(e.remoteMtimes))this.lastKnownMtimes.set(t,r)}async poll(){let e=await this.getRemoteMtimes(),t=!1;for(let[r,n]of e){if(U(r))continue;let s=this.lastKnownMtimes.get(r);s===void 0?this.recordPending(r,{status:"added",mtime:n})&&(t=!0):n>s&&this.recordPending(r,{status:"modified",mtime:n})&&(t=!0)}for(let r of this.lastKnownMtimes.keys())U(r)||e.has(r)||this.pendingChanges.get(r)?.status!=="deleted"&&(this.pendingChanges.set(r,{status:"deleted",mtime:0}),t=!0);return t}async flushPending(){if(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.pendingChanges.size===0)return{pulled:[],deleted:[],skipped:[],checkpoint:null};let e=new Map(this.pendingChanges);this.pendingChanges.clear();let t=[],r=[],n=[],s=[],o=null;if(!this.overwriteLocal){let l=await we(this.options.localDir);l&&l.realmUrl===this.normalizedRealmUrl&&(o=l)}for(let[l,p]of e){let u=ji.join(this.options.localDir,l);if(!this.overwriteLocal&&await this.localDivergesFromManifest(u,l,o,p.status)){n.push(l);continue}if(p.status==="deleted"){try{await Ep.unlink(u)}catch(f){if(f.code!=="ENOENT")throw f}r.push(l),s.push({file:l,status:"deleted"})}else await this.downloadFile(l,u),t.push(l),s.push({file:l,status:p.status})}let a=new Set(n);for(let[l,p]of e)a.has(l)||(p.status==="deleted"?this.lastKnownMtimes.delete(l):this.lastKnownMtimes.set(l,p.mtime));let c=null;return s.length>0&&(await this.persistManifest(t,r),c=await this.checkpointManager.createCheckpoint("remote",s)),{pulled:t,deleted:r,skipped:n,checkpoint:c}}async localDivergesFromManifest(e,t,r,n){let s;try{s=await se(e)}catch(a){if(a.code!=="ENOENT")throw a;return n==="deleted"?!1:r?.files[t]!==void 0}let o=r?.files[t];return o===void 0?!0:s!==o}scheduleFlush(e){this.isShutdown||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(async()=>{this.debounceTimer=null;try{let t=await this.flushPending();e?.(t)}catch(t){console.error(`${g}[${this.name}] Error applying changes:${m}`,t)}},this.debounceMs))}shutdown(){this.isShutdown=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}recordPending(e,t){let r=this.pendingChanges.get(e);return r&&r.mtime===t.mtime?!1:(this.pendingChanges.set(e,t),!0)}async persistManifest(e,t){let r=await we(this.options.localDir),n=r&&r.realmUrl===this.normalizedRealmUrl?r.files:null,s=n?{...n}:{};for(let c of t)delete s[c];for(let c of e){let l=ji.join(this.options.localDir,c);try{s[c]=await se(l)}catch(p){if(p.code!=="ENOENT")throw p}}let o={};for(let[c,l]of this.lastKnownMtimes)l!==0&&(o[c]=l);let a={realmUrl:this.normalizedRealmUrl,files:s};Object.keys(o).length>0&&(a.remoteMtimes=o),await Oe(this.options.localDir,a)}};async function oy(i,e={}){if(i.length===0)return{watchers:[],error:"No realms provided to watch."};let t=e.intervalMs??3e4,r=e.debounceMs??5e3,n=e.quiet??!1,s=e.overwriteLocal??!1;if(!Number.isFinite(t)||t<=0)return{watchers:[],error:"`intervalMs` must be a positive number."};if(!Number.isFinite(r)||r<0)return{watchers:[],error:"`debounceMs` must be a non-negative number."};let o;if(e.authenticator)o=e.authenticator;else{let d=ye({realmUrl:i[0].realmUrl,realmSecretSeed:e.realmSecretSeed,profileManager:e.profileManager});if(!d.ok)return{watchers:[],error:d.error};o=d.authenticator}let a=[];for(let d of i){let h=await fp(d.localDir,d.realmUrl);if(!h.ok){for(let b of a)await Li(b);return{watchers:[],error:ay(d.localDir,h.existing)}}h.staleOverwrote&&!n&&console.log(`${x}[${Mi()}] overwrote stale lock at ${d.localDir}${m}`),a.push(d.localDir)}let c=[];for(let d of i){let h=new jn(d,o,{debounceMs:r,overwriteLocal:s});try{await h.initialize()}catch(b){for(let j of c)j.shutdown();for(let j of a)await Li(j);return{watchers:[],error:`Failed to initialize watch on ${d.realmUrl}: ${b instanceof Error?b.message:String(b)}`}}c.push(h)}if(!n){console.log(`${_}\u21C5 Watching ${c.length} realm${c.length>1?"s":""}:${m}`);for(let d of c)console.log(` ${d.name} ${x}\u2192${m} ${d.localDir}`);console.log(` ${x}Interval: ${t/1e3}s, Debounce: ${r/1e3}s${m}`),console.log(` ${x}Press Ctrl+C to stop${m}
110
+ `)}let l=async()=>{await Promise.all(c.map(async d=>{try{await d.poll()&&(n||console.log(`${x}[${Mi()}]${m} [${d.name}] ${L}\u26A1 ${d.pendingCount} change(s) detected${m}`),d.scheduleFlush(b=>{n||cy(d.name,b)}))}catch(h){console.error(`${g}[${d.name}] poll error:${m}`,h instanceof Error?h.message:h)}}))},p=!1,u=null,f=()=>{p||(u=setTimeout(async()=>{u=null,!p&&(await l(),f())},t))};try{await yp(i.map(d=>d.localDir).join(", "))}catch{}return await l(),f(),await new Promise(d=>{let h=null,b=null,j=async()=>{if(!p){p=!0,u!==null&&(clearTimeout(u),u=null);for(let te of c)te.shutdown();h&&process.off("SIGINT",h),b&&process.off("SIGTERM",b);for(let te of a)try{await Li(te)}catch{}try{await wp()}catch{}d()}};if(e.signal){if(e.signal.aborted){j();return}e.signal.addEventListener("abort",()=>void j(),{once:!0})}else h=()=>{n||console.log(`
111
+ ${_}\u21C5 Watch stopped${m}`),j()},b=h,process.on("SIGINT",h),process.on("SIGTERM",b)}),{watchers:c}}function ay(i,e){return`A boxel realm watch process is already active for ${i} (pid ${e.pid}, started ${e.startedAt}). Stop it before starting a new one, or remove ${ji.join(i,".boxel-watch.lock")} if it's stale.`}function cy(i,e){let t=e.pulled.length+e.deleted.length;if(t>0&&(console.log(`${x}[${Mi()}]${m} [${i}] ${R}applied ${t} change(s)${m} (${e.pulled.length} pulled, ${e.deleted.length} deleted)`),e.checkpoint)){let r=e.checkpoint.isMajor?"[MAJOR]":"[minor]";console.log(` ${x}Checkpoint:${m} ${e.checkpoint.shortHash} ${r} ${e.checkpoint.message}`)}for(let r of e.skipped)console.log(`${x}[${Mi()}]${m} [${i}] ${L}\u26A0 skipped ${r}: local diverges from sync manifest (rerun with --overwrite-local to discard, or \`boxel realm sync\` to reconcile)${m}`)}function ly(i){return i.replace(/\/$/,"").split("/").slice(-2).join("/")}function Mi(){return new Date().toLocaleTimeString()}function py(i){return e=>{let t=Number.parseFloat(e);if(!Number.isFinite(t)||t<=0)throw new Mn.InvalidArgumentError(`${i} must be a positive number.`);return t}}function uy(i){return e=>{let t=Number.parseFloat(e);if(!Number.isFinite(t)||t<0)throw new Mn.InvalidArgumentError(`${i} must be a non-negative number.`);return t}}function Rp(i){i.command("start").description("Start watching a Boxel realm for server-side changes and pull them into a local directory").argument("<realm-url>","The URL of the realm to watch (e.g., https://app.boxel.ai/demo/)").argument("<local-dir>","The local directory to write changes into").option("-i, --interval <seconds>","Polling interval in seconds",py("--interval"),30).option("-d, --debounce <seconds>","Seconds to wait after a burst of changes before applying them",uy("--debounce"),5).option("--realm-secret-seed","Administrative auth: prompt for a realm secret seed and mint a JWT locally instead of using a Matrix profile (env: BOXEL_REALM_SECRET_SEED)").option("--overwrite-local","Overwrite local files when the remote changes. Default: skip + warn when the local copy diverges from the sync manifest.").action(async(e,t,r)=>{let n=await ve(r.realmSecretSeed===!0),s=await oy([{realmUrl:e,localDir:t}],{intervalMs:r.interval*1e3,debounceMs:r.debounce*1e3,realmSecretSeed:n,overwriteLocal:r.overwriteLocal===!0});s.error&&(console.error(`${g}Error:${m} ${s.error}`),process.exit(1))})}var In=require("child_process");var my=200;function dy(i){return new Promise(e=>setTimeout(e,i))}function $p(i){try{if(process.platform==="win32")try{process.kill(i)}catch{(0,In.execSync)(`taskkill /PID ${i} /F`,{stdio:"ignore"})}else process.kill(i,"SIGINT");return{ok:!0,alreadyGone:!1}}catch(e){return e?.code==="ESRCH"?{ok:!0,alreadyGone:!0}:{ok:!1,alreadyGone:!1}}}function fy(){if(process.platform==="win32")return[];let i;try{i=(0,In.execSync)('ps aux | grep -E "(tsx[[:space:]].*src/index\\.ts[[:space:]]+realm[[:space:]]+watch[[:space:]]+start|[[:space:]]boxel[[:space:]]+realm[[:space:]]+watch[[:space:]]+start|node[[:space:]].*boxel[[:space:]]+realm[[:space:]]+watch[[:space:]]+start)" | grep -v grep | grep -v "[[:space:]]stop"',{encoding:"utf8"}).trim()}catch{return[]}if(!i)return[];let e=[],t=new Set;for(let r of i.split(`
112
+ `)){if(!r)continue;let n=r.trim().split(/\s+/),s=Number.parseInt(n[1]??"",10);if(!Number.isFinite(s)||t.has(s))continue;t.add(s);let o=".",a=r.match(/\bstart\s+\S+\s+(\S+)/);a&&a[1]&&!a[1].startsWith("-")&&(o=a[1]),e.push({pid:s,workspace:o})}return e}async function hy(){let i=[],e=[],t=new Set,r=await Ln();for(let n of r){if(n.pid===process.pid)continue;t.add(n.pid);let s=$p(n.pid),o={pid:n.pid,workspace:n.workspace};s.ok?i.push(o):e.push(o)}for(let n of fy()){if(n.pid===process.pid||t.has(n.pid))continue;t.add(n.pid);let s=$p(n.pid),o={pid:n.pid,workspace:n.workspace};s.ok?i.push(o):e.push(o)}return i.length>0&&(await dy(my),await Ln()),{stopped:i,failed:e}}function gy(i){if(i.stopped.length===0&&i.failed.length===0){console.log("No running watch processes found.");return}for(let e of i.stopped)console.log(` ${x}\u21C5${m} Stopped: boxel realm watch ${e.workspace} (PID ${e.pid})`);for(let e of i.failed)console.log(` ${g}\xD7${m} Failed to stop: boxel realm watch ${e.workspace} (PID ${e.pid})`);if(i.stopped.length>0){let e=i.stopped.length>1?"es":"";console.log(`
113
+ ${R}\u2713 Stopped ${i.stopped.length} process${e}${m}`)}}function kp(i){i.command("stop").description("Stop all running boxel realm watch processes").action(async()=>{let e=await hy();gy(e)})}function Sp(i){let e=i.command("watch").description("Watch a Boxel realm; subcommands manage watch processes");Rp(e),kp(e)}function _p(i){let e=i.command("realm").description("Manage realms on the realm server");wl(e),kl(e),Wl(e),Gl(e),Bl(e),Kl(e),tp(e),rp(e),sp(e);let t=pp(e);lp(t),zl(e),mp(e),Sp(e)}async function xy(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())return{ok:!1,error:A};if(U(e))return{ok:!1,error:`Cannot delete protected file: ${e}`};let s=new URL(e,k(i)).href,o;try{o=await r.authedRealmFetch(s,{method:"DELETE",headers:{Accept:"application/vnd.card+source"}})}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}if(!o.ok){let a=await o.text().catch(()=>"(no body)");return{ok:!1,error:`HTTP ${o.status}: ${a.slice(0,300)}`}}return{ok:!0}}function Cp(i){i.command("delete").description("Delete a file from a realm").argument("<path>","Realm-relative file path to delete").requiredOption("--realm <realm-url>","The realm URL to delete from").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await xy(t.realm,e)}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}t.json?I.output(JSON.stringify(r,null,2)):r.ok?console.log(`${x}Deleted:${m} ${e}`):console.error(`${g}Error:${m} ${r.error}`),r.ok||process.exit(1)})}async function Nn(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())return{ok:!1,error:A};let s=new URL(e,k(i)).href,o;try{o=await r.authedRealmFetch(s,{method:"GET",headers:{Accept:"application/vnd.card+source"}})}catch(c){return{ok:!1,error:c instanceof Error?c.message:String(c)}}if(!o.ok){let c=await o.text().catch(()=>"(no body)");return{ok:!1,status:o.status,error:`HTTP ${o.status}: ${c.slice(0,300)}`}}if(be(e)){let c=new Uint8Array(await o.arrayBuffer());return{ok:!0,status:o.status,bytes:c}}let a=await o.text();return{ok:!0,status:o.status,content:a}}function Tp(i){i.command("read").description("Read a file from a realm").argument("<path>","Realm-relative file path (e.g., hello-world.json, Cards/my-card.gts)").requiredOption("--realm <realm-url>","The realm URL to read from").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await Nn(t.realm,e)}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}if(t.json){let n={ok:r.ok,status:r.status,error:r.error};r.content!==void 0&&(n.content=r.content),r.bytes!==void 0&&(n.bytesBase64=Buffer.from(r.bytes.buffer,r.bytes.byteOffset,r.bytes.byteLength).toString("base64")),I.output(JSON.stringify(n,null,2))}else r.ok?r.bytes!==void 0?process.stdout.write(r.bytes):I.output(r.content??""):(console.error(`${x}Status:${m} ${r.status??"(no status)"}`),console.error(`${g}Error:${m} ${r.error}`));r.ok||process.exit(1)})}var Fn="// touched for re-index";async function vy(i,e,t){let r=t?.profileManager??C();if(!r.getActiveProfile())return{ok:!1,touched:[],skipped:[],error:A};let s;if(t?.all){if(e.length>0)return{ok:!1,touched:[],skipped:[],error:"Cannot pass file paths together with --all"};let c=await Fe(i,{profileManager:r});if(c.error)return{ok:!1,touched:[],skipped:[],error:c.error};s=c.filenames.filter(l=>(l.endsWith(".json")||l.endsWith(".gts"))&&!U(l))}else{if(e.length===0)return{ok:!1,touched:[],skipped:[],error:"No file paths provided. Pass paths or use --all."};s=e}let o=[],a=[];for(let c of s){if(!c.endsWith(".json")&&!c.endsWith(".gts")){a.push({path:c,reason:"unsupported extension"});continue}if(U(c)){a.push({path:c,reason:"protected file"});continue}let l=await Nn(i,c,{profileManager:r});if(!l.ok||l.content==null){a.push({path:c,reason:l.error??"read failed"});continue}if(t?.dryRun){o.push(c);continue}let p=c.endsWith(".json")?by(l.content):wy(l.content),u=await bt(i,c,p,{profileManager:r});if(!u.ok){a.push({path:c,reason:u.error??"write failed"});continue}o.push(c)}return{ok:a.length===0,touched:o,skipped:a}}function by(i){try{let e=JSON.parse(i);if(e?.data)return e.data.meta={...e.data.meta??{},_touched:Date.now()},JSON.stringify(e,null,2)+`
114
+ `}catch{}return yy(i)}function yy(i){return i.endsWith(`
115
115
 
116
116
  `)?i.slice(0,-1):i+`
117
- `}function py(i){let e=`
118
- ${In}
117
+ `}function wy(i){let e=`
118
+ ${Fn}
119
119
  `;return i.endsWith(e)?i.slice(0,-e.length)+`
120
120
  `:i.endsWith(`
121
- `)?i+In+`
121
+ `)?i+Fn+`
122
122
  `:i+`
123
- `+In+`
124
- `}function _p(i){i.command("touch").description("Force realm re-indexing of one or more files by making a semantically-neutral edit. --all touches every .json/.gts in the realm without confirmation; use with care.").argument("[paths...]","Realm-relative file path(s) to touch (omit when using --all)").requiredOption("--realm <realm-url>","The realm URL to touch files in").option("--all","Touch every .json and .gts file in the realm").option("--dry-run","Print files that would be touched without writing").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await ay(t.realm,e,{all:t.all,dryRun:t.dryRun})}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}if(t.json)console.log(JSON.stringify(r,null,2));else if(r.error)console.error(`${h}Error:${m} ${r.error}`);else{let n=t.dryRun?`${g}[dry-run]${m} `:"";for(let o of r.touched)console.log(`${n}${R}touched${m} ${o}`);for(let{path:o,reason:a}of r.skipped)console.log(`${h}skipped${m} ${o} ${g}(${a})${m}`);let s=t.dryRun?"would touch":"touched";console.log(`
125
- ${g}${s} ${r.touched.length} file(s)${r.skipped.length>0?`, skipped ${r.skipped.length}`:""}${m}`)}r.ok||process.exit(1)})}function Cp(i){let e=i.command("file").description("Read, write, and manage files in a realm");kp(e),ll(e),cl(e),Sp(e),_p(e),al(e)}async function uy(i,e,t){let r=t?.profileManager??C(),n=r.getActiveProfile();if(!n)throw new Error("No active profile. Run `boxel profile add` to create one.");let o=`${n.profile.realmServerUrl.replace(/\/$/,"")}/_run-command`,a={data:{type:"run-command",attributes:{realmURL:e,command:i,commandInput:t?.input??null}}},c;try{c=await r.authedRealmServerFetch(o,{method:"POST",headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"},body:JSON.stringify(a)})}catch(u){return{status:"error",error:`run-command fetch failed: ${u instanceof Error?u.message:String(u)}`}}if(!c.ok){let u=await c.text().catch(()=>"(no body)");return{status:"error",error:`run-command HTTP ${c.status}: ${u}`}}let l;try{l=await c.json()}catch{return{status:"error",error:`run-command response was not valid JSON (HTTP ${c.status})`}}let p=l.data?.attributes;return{status:p?.status??"error",result:p?.cardResultString??null,error:p?.error??null}}function Op(i){i.command("run-command").description("Execute a host command on the realm server via the prerenderer").argument("<command-specifier>","Command module path (e.g. @cardstack/boxel-host/commands/get-card-type-schema/default)").requiredOption("--realm <realm-url>","The realm URL context for the command").option("--input <json>","JSON string of command input").option("--json","Output raw JSON response").action(async(e,t)=>{let r;if(t.input)try{let s=JSON.parse(t.input);(typeof s!="object"||s===null||Array.isArray(s))&&(console.error(`${h}Error:${m} --input must be a JSON object, got ${Array.isArray(s)?"array":typeof s}`),process.exit(1)),r=s}catch{console.error(`${h}Error:${m} --input is not valid JSON: ${t.input}`),process.exit(1)}let n;try{n=await uy(e,t.realm,{input:r})}catch(s){console.error(`${h}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}if(t.json)j.output(JSON.stringify(n,null,2));else{if(console.log(`${g}Status:${m} ${my(n.status)}${n.status}${m}`),n.result){console.log(`${g}Result:${m}`);try{j.output(JSON.stringify(JSON.parse(n.result),null,2))}catch{j.output(n.result)}}n.error&&console.error(`${h}Error:${m} ${n.error}`)}(n.status==="error"||n.status==="unusable")&&process.exit(1)})}function my(i){switch(i){case"ready":return R;case"error":return h;default:return _}}var Tp=require("node:child_process"),Et=require("node:fs"),Pp=require("node:http"),G=require("node:path");async function dy(){try{return(await import("@playwright/test")).chromium}catch(i){let e=i instanceof Error?i.message:String(i);throw new Error(`Could not load @playwright/test (${e}). \`boxel test\` is monorepo-only \u2014 install Playwright in the boxel-cli package via \`pnpm --filter @cardstack/boxel-cli install\` and run \`npx playwright install chromium\` once.`)}}async function fy(i,e){let t=e?.profileManager??C(),r=t.getActiveProfile();if(!r)return Nn(P);let n=k(i),s=k(e?.hostAppUrl??r.profile.realmServerUrl),o;try{let a=await Ne(n,{profileManager:t});if(a.error)return Nn(`Failed to discover test files: ${a.error}`);o=a.filenames.filter(c=>c.endsWith(".test.gts"))}catch(a){return Nn(`Failed to discover test files: ${a instanceof Error?a.message:String(a)}`)}if(o.length===0)return{status:"failed",passedCount:0,failedCount:0,skippedCount:0,durationMs:0,testFiles:[],failures:[],errorMessage:"No `*.test.gts` files found in the realm. Every implementation Issue must ship with at least one test file."};try{let{qunitResults:a,durationMs:c}=await hy({pm:t,targetRealm:n,hostAppUrl:s,hostDistDir:e?.hostDistDir,debug:e?.debug});return{...yy(a),durationMs:c,testFiles:o}}catch(a){let c=a instanceof Error?a.message:String(a);return{status:"error",passedCount:0,failedCount:0,skippedCount:0,durationMs:0,testFiles:o,failures:[],errorMessage:c}}}async function hy(i){let e=Date.now(),t,r;try{let n=i.hostDistDir??(0,G.join)(vy()??(0,G.join)((0,G.resolve)(xt(__dirname),".."),"host"),"dist");if(!Ap((0,G.join)(n,"tests","index.html")))throw new Error(`Host app dist not found at ${n}. Build the host app (e.g., \`pnpm --filter @cardstack/host build\`) or set TEST_HARNESS_HOST_DIST_PACKAGE_DIR.`);let{url:s,server:o,setHtml:a}=await xy(n);r=o;let c=gy({assetServerUrl:s,hostDistDir:n,realmProxyUrl:i.hostAppUrl});a(c),t=await(await dy()).launch({headless:!0});let p=await t.newPage();i.debug&&(p.on("console",w=>{process.stderr.write(`[browser ${w.type()}] ${w.text()}
126
- `)}),p.on("pageerror",w=>{process.stderr.write(`[browser pageerror] ${w.message}
127
- `)}));let u=i.pm.getRealmToken(i.targetRealm);if(u){let w=new URL(i.targetRealm).origin;await p.route(`${w}/**`,M=>{let Z={...M.request().headers(),Authorization:u};M.continue({headers:Z})})}let d=encodeURIComponent(i.targetRealm),f=`${s}?liveTest=true&realmURL=${d}&hidepassed`;return await p.goto(f,{waitUntil:"domcontentloaded"}),await p.waitForFunction(()=>window.__qunitResults?.runEnd!==null,null,{timeout:3e5}),{qunitResults:await p.evaluate(()=>window.__qunitResults),durationMs:Date.now()-e}}finally{t&&await t.close().catch(()=>{}),r&&r.close()}}function gy(i){let e=i.assetServerUrl.replace(/\/$/,""),t=i.realmProxyUrl.replace(/\/$/,""),r=(0,G.resolve)(i.hostDistDir,"tests","index.html"),n;try{n=(0,Et.readFileSync)(r,"utf8")}catch{throw new Error(`Could not read host test page at ${r}. Build the host app with test support.`)}let s=(n.match(/<meta[^>]+>/g)??[]).filter(l=>!l.includes("charset")&&!l.includes("viewport")).map(l=>{if(!l.includes("config/environment"))return l;let p=l.match(/content="([^"]+)"/);if(!p)return l;try{let u=JSON.parse(decodeURIComponent(p[1]));u.resolvedBaseRealmURL&&(u.resolvedBaseRealmURL=`${t}/base/`),u.resolvedSkillsRealmURL&&(u.resolvedSkillsRealmURL=`${t}/skills/`),u.resolvedOpenRouterRealmURL&&(u.resolvedOpenRouterRealmURL=`${t}/openrouter/`),u.realmServerURL&&(u.realmServerURL=`${t}/`);let d=encodeURIComponent(JSON.stringify(u));return l.replace(/content="[^"]+"/,`content="${d}"`)}catch{return l}}),o=(n.match(/<script[^>]*src="[^"]*"[^>]*><\/script>/g)??[]).filter(l=>!l.includes("testem.js")&&!l.includes("ember-cli-live-reload")).map(l=>l.replace(/src="\/([^"]*)"/g,`src="${e}/$1"`)),a=(n.match(/<link[^>]*rel="stylesheet"[^>]*>/g)??[]).map(l=>l.replace(/href="\/([^"]*)"/g,`href="${e}/$1"`)),c=(n.match(/<script type="module">[^]*?<\/script>/g)??[]).map(l=>l.replace(/from '\/([^']*)'/g,`from '${e}/$1'`));return`<!DOCTYPE html>
123
+ `+Fn+`
124
+ `}function Op(i){i.command("touch").description("Force realm re-indexing of one or more files by making a semantically-neutral edit. --all touches every .json/.gts in the realm without confirmation; use with care.").argument("[paths...]","Realm-relative file path(s) to touch (omit when using --all)").requiredOption("--realm <realm-url>","The realm URL to touch files in").option("--all","Touch every .json and .gts file in the realm").option("--dry-run","Print files that would be touched without writing").option("--json","Output raw JSON response").action(async(e,t)=>{let r;try{r=await vy(t.realm,e,{all:t.all,dryRun:t.dryRun})}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}if(t.json)console.log(JSON.stringify(r,null,2));else if(r.error)console.error(`${g}Error:${m} ${r.error}`);else{let n=t.dryRun?`${x}[dry-run]${m} `:"";for(let o of r.touched)console.log(`${n}${R}touched${m} ${o}`);for(let{path:o,reason:a}of r.skipped)console.log(`${g}skipped${m} ${o} ${x}(${a})${m}`);let s=t.dryRun?"would touch":"touched";console.log(`
125
+ ${x}${s} ${r.touched.length} file(s)${r.skipped.length>0?`, skipped ${r.skipped.length}`:""}${m}`)}r.ok||process.exit(1)})}function Pp(i){let e=i.command("file").description("Read, write, and manage files in a realm");Cp(e),ul(e),pl(e),Tp(e),Op(e),ll(e)}async function Ey(i,e,t){let r=t?.profileManager??C(),n=r.getActiveProfile();if(!n)throw new Error("No active profile. Run `boxel profile add` to create one.");let o=`${n.profile.realmServerUrl.replace(/\/$/,"")}/_run-command`,a={data:{type:"run-command",attributes:{realmURL:e,command:i,commandInput:t?.input??null}}},c;try{c=await r.authedRealmServerFetch(o,{method:"POST",headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"},body:JSON.stringify(a)})}catch(u){return{status:"error",error:`run-command fetch failed: ${u instanceof Error?u.message:String(u)}`}}if(!c.ok){let u=await c.text().catch(()=>"(no body)");return{status:"error",error:`run-command HTTP ${c.status}: ${u}`}}let l;try{l=await c.json()}catch{return{status:"error",error:`run-command response was not valid JSON (HTTP ${c.status})`}}let p=l.data?.attributes;return{status:p?.status??"error",result:p?.cardResultString??null,error:p?.error??null}}function Ap(i){i.command("run-command").description("Execute a host command on the realm server via the prerenderer").argument("<command-specifier>","Command module path (e.g. @cardstack/boxel-host/commands/get-card-type-schema/default)").requiredOption("--realm <realm-url>","The realm URL context for the command").option("--input <json>","JSON string of command input").option("--json","Output raw JSON response").action(async(e,t)=>{let r;if(t.input)try{let s=JSON.parse(t.input);(typeof s!="object"||s===null||Array.isArray(s))&&(console.error(`${g}Error:${m} --input must be a JSON object, got ${Array.isArray(s)?"array":typeof s}`),process.exit(1)),r=s}catch{console.error(`${g}Error:${m} --input is not valid JSON: ${t.input}`),process.exit(1)}let n;try{n=await Ey(e,t.realm,{input:r})}catch(s){console.error(`${g}Error:${m} ${s instanceof Error?s.message:String(s)}`),process.exit(1)}if(t.json)I.output(JSON.stringify(n,null,2));else{if(console.log(`${x}Status:${m} ${Ry(n.status)}${n.status}${m}`),n.result){console.log(`${x}Result:${m}`);try{I.output(JSON.stringify(JSON.parse(n.result),null,2))}catch{I.output(n.result)}}n.error&&console.error(`${g}Error:${m} ${n.error}`)}(n.status==="error"||n.status==="unusable")&&process.exit(1)})}function Ry(i){switch(i){case"ready":return R;case"error":return g;default:return _}}var Lp=require("node:child_process"),kt=require("node:fs"),jp=require("node:http"),W=require("node:path");async function $y(){try{return(await import("@playwright/test")).chromium}catch(i){let e=i instanceof Error?i.message:String(i);throw new Error(`Could not load @playwright/test (${e}). \`boxel test\` is monorepo-only \u2014 install Playwright in the boxel-cli package via \`pnpm --filter @cardstack/boxel-cli install\` and run \`npx playwright install chromium\` once.`)}}async function ky(i,e){let t=e?.profileManager??C(),r=t.getActiveProfile();if(!r)return Un(A);let n=k(i),s=k(e?.hostAppUrl??r.profile.realmServerUrl),o;try{let a=await Fe(n,{profileManager:t});if(a.error)return Un(`Failed to discover test files: ${a.error}`);o=a.filenames.filter(c=>c.endsWith(".test.gts"))}catch(a){return Un(`Failed to discover test files: ${a instanceof Error?a.message:String(a)}`)}if(o.length===0)return{status:"failed",passedCount:0,failedCount:0,skippedCount:0,durationMs:0,testFiles:[],failures:[],errorMessage:"No `*.test.gts` files found in the realm. Every implementation Issue must ship with at least one test file."};try{let{qunitResults:a,durationMs:c}=await Sy({pm:t,targetRealm:n,hostAppUrl:s,hostDistDir:e?.hostDistDir,debug:e?.debug});return{...Py(a),durationMs:c,testFiles:o}}catch(a){let c=a instanceof Error?a.message:String(a);return{status:"error",passedCount:0,failedCount:0,skippedCount:0,durationMs:0,testFiles:o,failures:[],errorMessage:c}}}async function Sy(i){let e=Date.now(),t,r;try{let n=i.hostDistDir??(0,W.join)(Ty()??(0,W.join)((0,W.resolve)(yt(__dirname),".."),"host"),"dist");if(!Mp((0,W.join)(n,"tests","index.html")))throw new Error(`Host app dist not found at ${n}. Build the host app (e.g., \`pnpm --filter @cardstack/host build\`) or set TEST_HARNESS_HOST_DIST_PACKAGE_DIR.`);let{url:s,server:o,setHtml:a}=await Cy(n);r=o;let c=_y({assetServerUrl:s,hostDistDir:n,realmProxyUrl:i.hostAppUrl});a(c),t=await(await $y()).launch({headless:!0});let p=await t.newPage();i.debug&&(p.on("console",b=>{process.stderr.write(`[browser ${b.type()}] ${b.text()}
126
+ `)}),p.on("pageerror",b=>{process.stderr.write(`[browser pageerror] ${b.message}
127
+ `)}));let u=i.pm.getRealmToken(i.targetRealm);if(u){let b=new URL(i.targetRealm).origin;await p.route(`${b}/**`,j=>{let te={...j.request().headers(),Authorization:u};j.continue({headers:te})})}let f=encodeURIComponent(i.targetRealm),d=`${s}?liveTest=true&realmURL=${f}&hidepassed`;return await p.goto(d,{waitUntil:"domcontentloaded"}),await p.waitForFunction(()=>window.__qunitResults?.runEnd!==null,null,{timeout:3e5}),{qunitResults:await p.evaluate(()=>window.__qunitResults),durationMs:Date.now()-e}}finally{t&&await t.close().catch(()=>{}),r&&r.close()}}function _y(i){let e=i.assetServerUrl.replace(/\/$/,""),t=i.realmProxyUrl.replace(/\/$/,""),r=(0,W.resolve)(i.hostDistDir,"tests","index.html"),n;try{n=(0,kt.readFileSync)(r,"utf8")}catch{throw new Error(`Could not read host test page at ${r}. Build the host app with test support.`)}let s=(n.match(/<meta[^>]+>/g)??[]).filter(l=>!l.includes("charset")&&!l.includes("viewport")).map(l=>{if(!l.includes("config/environment"))return l;let p=l.match(/content="([^"]+)"/);if(!p)return l;try{let u=JSON.parse(decodeURIComponent(p[1]));u.resolvedBaseRealmURL&&(u.resolvedBaseRealmURL=`${t}/base/`),u.resolvedSkillsRealmURL&&(u.resolvedSkillsRealmURL=`${t}/skills/`),u.resolvedOpenRouterRealmURL&&(u.resolvedOpenRouterRealmURL=`${t}/openrouter/`),u.realmServerURL&&(u.realmServerURL=`${t}/`);let f=encodeURIComponent(JSON.stringify(u));return l.replace(/content="[^"]+"/,`content="${f}"`)}catch{return l}}),o=(n.match(/<script[^>]*src="[^"]*"[^>]*><\/script>/g)??[]).filter(l=>!l.includes("testem.js")&&!l.includes("ember-cli-live-reload")).map(l=>l.replace(/src="\/([^"]*)"/g,`src="${e}/$1"`)),a=(n.match(/<link[^>]*rel="stylesheet"[^>]*>/g)??[]).map(l=>l.replace(/href="\/([^"]*)"/g,`href="${e}/$1"`)),c=(n.match(/<script type="module">[^]*?<\/script>/g)??[]).map(l=>l.replace(/from '\/([^']*)'/g,`from '${e}/$1'`));return`<!DOCTYPE html>
128
128
  <html>
129
129
  <head>
130
130
  <meta charset="utf-8">
@@ -172,18 +172,18 @@ ${g}${s} ${r.touched.length} file(s)${r.skipped.length>0?`, skipped ${r.skipped.
172
172
  ${o.join(`
173
173
  `)}
174
174
  </body>
175
- </html>`}async function xy(i){let e={".js":"application/javascript",".css":"text/css",".map":"application/json",".html":"text/html",".wasm":"application/wasm",".svg":"image/svg+xml",".png":"image/png",".woff2":"font/woff2",".woff":"font/woff",".ttf":"font/ttf"},t="",r=n=>{t=n};return new Promise((n,s)=>{let o=(0,Pp.createServer)((a,c)=>{let l=(a.url??"/").split("?")[0];if(l!=="/"){let p=(0,G.normalize)(l.slice(1));if(p.startsWith("..")||p.startsWith("/")){c.writeHead(403),c.end("Forbidden");return}let u=(0,G.resolve)(i,p);if(!u.startsWith((0,G.resolve)(i))){c.writeHead(403),c.end("Forbidden");return}try{let d=(0,Et.readFileSync)(u),f=u.match(/\.[^.]+$/)?.[0]??"",x=e[f]??"application/octet-stream";c.writeHead(200,{"Content-Type":x,"Access-Control-Allow-Origin":"*"}),c.end(d)}catch{c.writeHead(404),c.end("Not found")}return}c.writeHead(200,{"Content-Type":"text/html","Access-Control-Allow-Origin":"*"}),c.end(t)});o.on("error",s),o.listen(0,"127.0.0.1",()=>{let a=o.address();if(!a||typeof a=="string"){s(new Error("Failed to start test page server"));return}n({url:`http://127.0.0.1:${a.port}`,server:o,setHtml:r})})})}function Ap(i){try{return(0,Et.statSync)(i).isFile()}catch{return!1}}function vy(){let i=xt(__dirname),e=(0,G.resolve)(i,".."),t=(0,G.resolve)(e,".."),r=(0,G.join)(e,"host"),n=by(t),s=n&&n!==t?(0,G.resolve)(n,"packages","host"):void 0,o=[process.env.TEST_HARNESS_HOST_DIST_PACKAGE_DIR,r,s].filter(c=>!!c).map(c=>(0,G.resolve)(c)),a=new Set;for(let c of o)if(!a.has(c)&&(a.add(c),Ap((0,G.join)(c,"dist","index.html"))))return c}function by(i){let e=(0,Tp.spawnSync)("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:i,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(e.status!==0)return;let t=e.stdout.trim();if(t.endsWith(`${(0,G.join)(".git")}`))return(0,G.dirname)(t)}function yy(i){if(!i.runEnd)return{status:"error",passedCount:0,failedCount:0,skippedCount:0,failures:[],errorMessage:"QUnit did not complete \u2014 runEnd event was not received"};let e=0,t=0,r=0,n=[];for(let o of i.tests)if(o.status==="failed"){t+=1;let a=o.errors[0];n.push({testName:o.name,module:o.module||"default",message:a?.message??"Test failed",...a?.stack?{stackTrace:a.stack.slice(0,500)}:{}})}else o.status==="skipped"||o.status==="todo"?r+=1:e+=1;let s;return i.tests.length===0?s="error":t>0||e===0&&r>0?s="failed":s="passed",{status:s,passedCount:e,failedCount:t,skippedCount:r,failures:n}}function Nn(i){return{status:"error",passedCount:0,failedCount:0,skippedCount:0,durationMs:0,testFiles:[],failures:[],errorMessage:i}}function Lp(i){i.command("test").description("Run the realm's QUnit test suite (every `*.test.gts` file) in a headless Chromium driven against the host app. Monorepo-only: relies on the host app's compiled `dist/` being reachable from this CLI's location (or via TEST_HARNESS_HOST_DIST_PACKAGE_DIR).").requiredOption("--realm <realm-url>","The realm URL to test").option("--host-app-url <url>","Host app URL (compat proxy). Defaults to the active profile's realm-server URL.").option("--host-dist-dir <path>","Override the host app dist directory used to build the test page.").option("--debug","Stream browser console output to stderr").option("--json","Output structured JSON result").action(async e=>{let t;try{t=await fy(e.realm,{...e.hostAppUrl?{hostAppUrl:e.hostAppUrl}:{},...e.hostDistDir?{hostDistDir:e.hostDistDir}:{},...e.debug?{debug:!0}:{}})}catch(n){console.error(`${h}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}if(e.json){j.output(JSON.stringify(t,null,2)),t.status!=="passed"&&process.exit(1);return}if(t.errorMessage&&console.error(`${h}Error:${m} ${t.errorMessage}`),t.testFiles.length===0){console.log(`${g}No .test.gts files found in the realm.${m}`),t.status!=="passed"&&process.exit(1);return}if(t.failures.length>0)for(let n of t.failures)console.log(`
176
- ${h}FAIL${m} ${g}${n.module}${m} \u203A ${n.testName}`),console.log(` ${n.message}`),n.stackTrace&&console.log(` ${g}${n.stackTrace.split(`
175
+ </html>`}async function Cy(i){let e={".js":"application/javascript",".css":"text/css",".map":"application/json",".html":"text/html",".wasm":"application/wasm",".svg":"image/svg+xml",".png":"image/png",".woff2":"font/woff2",".woff":"font/woff",".ttf":"font/ttf"},t="",r=n=>{t=n};return new Promise((n,s)=>{let o=(0,jp.createServer)((a,c)=>{let l=(a.url??"/").split("?")[0];if(l!=="/"){let p=(0,W.normalize)(l.slice(1));if(p.startsWith("..")||p.startsWith("/")){c.writeHead(403),c.end("Forbidden");return}let u=(0,W.resolve)(i,p);if(!u.startsWith((0,W.resolve)(i))){c.writeHead(403),c.end("Forbidden");return}try{let f=(0,kt.readFileSync)(u),d=u.match(/\.[^.]+$/)?.[0]??"",h=e[d]??"application/octet-stream";c.writeHead(200,{"Content-Type":h,"Access-Control-Allow-Origin":"*"}),c.end(f)}catch{c.writeHead(404),c.end("Not found")}return}c.writeHead(200,{"Content-Type":"text/html","Access-Control-Allow-Origin":"*"}),c.end(t)});o.on("error",s),o.listen(0,"127.0.0.1",()=>{let a=o.address();if(!a||typeof a=="string"){s(new Error("Failed to start test page server"));return}n({url:`http://127.0.0.1:${a.port}`,server:o,setHtml:r})})})}function Mp(i){try{return(0,kt.statSync)(i).isFile()}catch{return!1}}function Ty(){let i=yt(__dirname),e=(0,W.resolve)(i,".."),t=(0,W.resolve)(e,".."),r=(0,W.join)(e,"host"),n=Oy(t),s=n&&n!==t?(0,W.resolve)(n,"packages","host"):void 0,o=[process.env.TEST_HARNESS_HOST_DIST_PACKAGE_DIR,r,s].filter(c=>!!c).map(c=>(0,W.resolve)(c)),a=new Set;for(let c of o)if(!a.has(c)&&(a.add(c),Mp((0,W.join)(c,"dist","index.html"))))return c}function Oy(i){let e=(0,Lp.spawnSync)("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:i,encoding:"utf8",stdio:["ignore","pipe","ignore"]});if(e.status!==0)return;let t=e.stdout.trim();if(t.endsWith(`${(0,W.join)(".git")}`))return(0,W.dirname)(t)}function Py(i){if(!i.runEnd)return{status:"error",passedCount:0,failedCount:0,skippedCount:0,failures:[],errorMessage:"QUnit did not complete \u2014 runEnd event was not received"};let e=0,t=0,r=0,n=[];for(let o of i.tests)if(o.status==="failed"){t+=1;let a=o.errors[0];n.push({testName:o.name,module:o.module||"default",message:a?.message??"Test failed",...a?.stack?{stackTrace:a.stack.slice(0,500)}:{}})}else o.status==="skipped"||o.status==="todo"?r+=1:e+=1;let s;return i.tests.length===0?s="error":t>0||e===0&&r>0?s="failed":s="passed",{status:s,passedCount:e,failedCount:t,skippedCount:r,failures:n}}function Un(i){return{status:"error",passedCount:0,failedCount:0,skippedCount:0,durationMs:0,testFiles:[],failures:[],errorMessage:i}}function Ip(i){i.command("test").description("Run the realm's QUnit test suite (every `*.test.gts` file) in a headless Chromium driven against the host app. Monorepo-only: relies on the host app's compiled `dist/` being reachable from this CLI's location (or via TEST_HARNESS_HOST_DIST_PACKAGE_DIR).").requiredOption("--realm <realm-url>","The realm URL to test").option("--host-app-url <url>","Host app URL (compat proxy). Defaults to the active profile's realm-server URL.").option("--host-dist-dir <path>","Override the host app dist directory used to build the test page.").option("--debug","Stream browser console output to stderr").option("--json","Output structured JSON result").action(async e=>{let t;try{t=await ky(e.realm,{...e.hostAppUrl?{hostAppUrl:e.hostAppUrl}:{},...e.hostDistDir?{hostDistDir:e.hostDistDir}:{},...e.debug?{debug:!0}:{}})}catch(n){console.error(`${g}Error:${m} ${n instanceof Error?n.message:String(n)}`),process.exit(1)}if(e.json){I.output(JSON.stringify(t,null,2)),t.status!=="passed"&&process.exit(1);return}if(t.errorMessage&&console.error(`${g}Error:${m} ${t.errorMessage}`),t.testFiles.length===0){console.log(`${x}No .test.gts files found in the realm.${m}`),t.status!=="passed"&&process.exit(1);return}if(t.failures.length>0)for(let n of t.failures)console.log(`
176
+ ${g}FAIL${m} ${x}${n.module}${m} \u203A ${n.testName}`),console.log(` ${n.message}`),n.stackTrace&&console.log(` ${x}${n.stackTrace.split(`
177
177
  `).slice(0,3).join(`
178
- `)}${m}`);let r=t.status==="passed"?R:t.status==="failed"?h:h;console.log(`
179
- ${r}${t.status}${m} ${g}\u2014${m} ${t.passedCount} passed, ${t.failedCount} failed${t.skippedCount>0?`, ${t.skippedCount} skipped`:""} ${g}(${t.durationMs}ms across ${t.testFiles.length} file(s))${m}`),t.status!=="passed"&&process.exit(1)})}function Mp(i){let e=new jp.Command;return e.name("boxel").description("CLI tools for Boxel workspace management").version(i).option("-q, --quiet","Suppress informational progress logs (info/log/debug). Errors and warnings, plus command result payloads (JSON, file contents), are still emitted. Use this when invoking the CLI from automation (e.g. the software factory test harness) to keep stdout focused on the result.").hook("preAction",t=>{(t.optsWithGlobals?.()??t.opts()).quiet&&pi(!0),Kc(process.cwd())}),e.command("profile").description("Manage saved profiles for different users/environments").argument("[subcommand]","list | add | switch | remove | migrate").argument("[arg]","Profile ID (for switch/remove)").option("-u, --user <matrixId>","Matrix user ID (e.g., @user:boxel.ai)").option("-p, --password <password>","Password (for add command)").option("-n, --name <displayName>","Display name (for add command)").option("-m, --matrix-url <url>","Matrix server URL (for add command with non-standard domains)").option("-r, --realm-server-url <url>","Realm server URL (for add command with non-standard domains)").addHelpText("after",`
178
+ `)}${m}`);let r=t.status==="passed"?R:t.status==="failed"?g:g;console.log(`
179
+ ${r}${t.status}${m} ${x}\u2014${m} ${t.passedCount} passed, ${t.failedCount} failed${t.skippedCount>0?`, ${t.skippedCount} skipped`:""} ${x}(${t.durationMs}ms across ${t.testFiles.length} file(s))${m}`),t.status!=="passed"&&process.exit(1)})}function Fp(i){let e=new Np.Command;return e.name("boxel").description("CLI tools for Boxel workspace management").version(i).option("-q, --quiet","Suppress informational progress logs (info/log/debug). Errors and warnings, plus command result payloads (JSON, file contents), are still emitted. Use this when invoking the CLI from automation (e.g. the software factory test harness) to keep stdout focused on the result.").hook("preAction",t=>{(t.optsWithGlobals?.()??t.opts()).quiet&&di(!0),Zc(process.cwd())}),e.command("profile").description("Manage saved profiles for different users/environments").argument("[subcommand]","list | add | switch | remove | migrate").argument("[arg]","Profile ID (for switch/remove)").option("-u, --user <matrixId>","Matrix user ID (e.g., @user:boxel.ai)").option("-p, --password <password>","Password (for add command)").option("-n, --name <displayName>","Display name (for add command)").option("-m, --matrix-url <url>","Matrix server URL (for add command with non-standard domains)").option("-r, --realm-server-url <url>","Realm server URL (for add command with non-standard domains)").addHelpText("after",`
180
180
  Environment variables (for 'add'):
181
181
  BOXEL_PASSWORD Password; preferred over -p to avoid shell history.
182
182
  BOXEL_ENVIRONMENT An env-mode slug (e.g. a branch name), interpreted
183
183
  like scripts/env-slug.sh: URLs are derived as
184
184
  http://matrix.<slug>.localhost and
185
185
  http://realm-server.<slug>.localhost/. Overridden
186
- by --matrix-url / --realm-server-url if provided.`).action(async(t,r,n)=>{n?.password&&console.warn('Warning: Supplying a password via -p/--password may expose it in shell history and process listings. For non-interactive usage, prefer the BOXEL_PASSWORD environment variable or use "boxel profile add" interactively.'),await zc(t,r,n)}),Cp(e),pl(e),gl(e),$p(e),Op(e),ul(e),Lp(e),xl(e),Qc(e),e}var wy=JSON.parse((0,Ip.readFileSync)((0,Np.resolve)(__dirname,"../package.json"),"utf-8"));process.argv.includes("--quiet")&&pi(!0);Mp(wy.version).parse();
186
+ by --matrix-url / --realm-server-url if provided.`).action(async(t,r,n)=>{n?.password&&console.warn('Warning: Supplying a password via -p/--password may expose it in shell history and process listings. For non-interactive usage, prefer the BOXEL_PASSWORD environment variable or use "boxel profile add" interactively.'),await Jc(t,r,n)}),Pp(e),ml(e),bl(e),_p(e),Ap(e),dl(e),Ip(e),yl(e),el(e),e}var Ay=JSON.parse((0,Up.readFileSync)((0,Dp.resolve)(__dirname,"../package.json"),"utf-8"));process.argv.includes("--quiet")&&di(!0);Fp(Ay.version).parse();
187
187
  /*! Bundled license information:
188
188
 
189
189
  safe-buffer/index.js: