efficient-shell 13.20.0 → 13.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/README.md +23 -10
  2. package/dist/{Browser-XFEOOL5J.js → Browser-342OHRA2.js} +14 -14
  3. package/dist/Calculator-HJK5JN54.js +29 -0
  4. package/dist/CurrencyConverter-MPAZ6QJ3.js +21 -0
  5. package/dist/{Files-LRSNSZ5Y.js → Files-IPM7TRMJ.js} +74 -74
  6. package/dist/Notepad-R7MUSPRC.js +24 -0
  7. package/dist/{PdfViewer-EELX35ZI.js → PdfViewer-FWGHFO4N.js} +1 -1
  8. package/dist/{PomodoroTimer-XLPBKMWS.js → PomodoroTimer-VREYC3ML.js} +49 -49
  9. package/dist/{Preview-CWGCGKR5.js → Preview-X64AVAUP.js} +27 -27
  10. package/dist/Sidebar-MY66ILZY.js +44 -0
  11. package/dist/{Stock-PRUMXULJ.js → Stock-GQSNYWV2.js} +3 -3
  12. package/dist/{Weather-FO5DVYQ4.js → Weather-XNMLNV7N.js} +22 -22
  13. package/dist/{WorldClock-BYZ5BNLZ.js → WorldClock-AZLGM2T5.js} +6 -6
  14. package/dist/ai/index.js +118 -118
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/browser-check.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/SpecChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/chunk-23YQNCZ4.js +23 -0
  47. package/dist/chunk-2AEYVQ2R.js +2 -0
  48. package/dist/{chunk-MVOYVN3S.js → chunk-2YHS5E27.js} +1 -1
  49. package/dist/{chunk-X4E4RPFE.js → chunk-2YUAR2EH.js} +5 -5
  50. package/dist/{chunk-PPLPDP6D.js → chunk-3AUN7JSM.js} +1 -1
  51. package/dist/{chunk-FDDM7VMQ.js → chunk-3BQMICGG.js} +1 -1
  52. package/dist/{chunk-NILGK2KJ.js → chunk-3EYJ4G7L.js} +1 -1
  53. package/dist/{chunk-FXSGIT53.js → chunk-3GJVTK4H.js} +8 -8
  54. package/dist/chunk-3SKXWFGG.js +15 -0
  55. package/dist/{chunk-XD3M5ZXM.js → chunk-3TD3GH53.js} +6 -6
  56. package/dist/{chunk-4U5M37SF.js → chunk-4PJFL26P.js} +1 -1
  57. package/dist/{chunk-NA4XPE7S.js → chunk-53HHYEN4.js} +3 -3
  58. package/dist/{chunk-IUQJGFEO.js → chunk-5CHJA4RL.js} +8 -8
  59. package/dist/{chunk-OF5X4HKC.js → chunk-5JUXMNUC.js} +1 -1
  60. package/dist/{chunk-TB2ARUE2.js → chunk-5OHFBS2B.js} +1 -1
  61. package/dist/chunk-5ZOYYL46.js +4 -0
  62. package/dist/{chunk-TPKNHQIE.js → chunk-66NJCU4W.js} +8 -8
  63. package/dist/{chunk-BCQSNK2Z.js → chunk-6CFI4YGI.js} +4 -4
  64. package/dist/{chunk-LKAGXURQ.js → chunk-6MFKKTCE.js} +17 -17
  65. package/dist/{chunk-QNWC3RWK.js → chunk-6NXPOZ6X.js} +1 -1
  66. package/dist/{chunk-F4VILY3O.js → chunk-72UHB4JU.js} +1 -1
  67. package/dist/{chunk-7I5RJPY7.js → chunk-7AVPMO4F.js} +1 -1
  68. package/dist/{chunk-KYQKMBSY.js → chunk-7B6JPNOD.js} +5 -5
  69. package/dist/{chunk-JB4WXBJB.js → chunk-7G5HKAGV.js} +5 -5
  70. package/dist/{chunk-SUSJFGXN.js → chunk-7N42VDGT.js} +9 -9
  71. package/dist/{chunk-YCXQDUTW.js → chunk-7PAZO65L.js} +6 -6
  72. package/dist/{chunk-4G7PJ325.js → chunk-A5FC4LR7.js} +1 -1
  73. package/dist/{chunk-G5UGCAWN.js → chunk-A6TOHNJY.js} +1 -1
  74. package/dist/{chunk-HPZLV3KD.js → chunk-AFYLMXOJ.js} +5 -5
  75. package/dist/{chunk-XAT2MKNU.js → chunk-AH2NEKEN.js} +4 -4
  76. package/dist/{chunk-G7SILKUY.js → chunk-AQVPWUJ3.js} +5 -5
  77. package/dist/{chunk-63E4ZZYI.js → chunk-BEXFMSNK.js} +2 -2
  78. package/dist/{chunk-HOROMBJB.js → chunk-BL347U3N.js} +6 -6
  79. package/dist/chunk-BT636U6W.js +92 -0
  80. package/dist/{chunk-OUYGLDQN.js → chunk-BUUAALHH.js} +7 -7
  81. package/dist/{chunk-7CBWSLCW.js → chunk-C7Z3ZMJH.js} +12 -12
  82. package/dist/{chunk-SF4IIV5Z.js → chunk-CJQPC2P3.js} +2 -2
  83. package/dist/{chunk-5POQCJL6.js → chunk-CUJ537IY.js} +4 -4
  84. package/dist/{chunk-E7BQZL7X.js → chunk-D4432YRW.js} +1 -1
  85. package/dist/{chunk-RDVC32EV.js → chunk-D5HFWOW7.js} +16 -16
  86. package/dist/{chunk-GEITUFYK.js → chunk-D5PXRJHA.js} +19 -19
  87. package/dist/{chunk-VRJKV44O.js → chunk-DAUE6ULT.js} +1 -1
  88. package/dist/{chunk-YWMCW5BN.js → chunk-DTRJLQWO.js} +1 -1
  89. package/dist/{chunk-WJMPTW3G.js → chunk-DV6TUXCZ.js} +1 -1
  90. package/dist/{chunk-23LK4PLJ.js → chunk-E4GF7M4S.js} +8 -8
  91. package/dist/chunk-EJJTDUN3.js +22 -0
  92. package/dist/{chunk-RA2UNNJC.js → chunk-F3EBYHIE.js} +10 -10
  93. package/dist/chunk-FBI3XJWH.js +11 -0
  94. package/dist/{chunk-WJTNQ7YD.js → chunk-FE7H6RXE.js} +2 -2
  95. package/dist/{chunk-YQ5JHHLE.js → chunk-FMBUR4EU.js} +1 -1
  96. package/dist/{chunk-IOLUF3UL.js → chunk-GKYGPCGL.js} +1 -1
  97. package/dist/{chunk-Q4MOT7TY.js → chunk-GPU7LLTJ.js} +1 -1
  98. package/dist/{chunk-ZCGT5YNR.js → chunk-GRAFJD3L.js} +1 -1
  99. package/dist/{chunk-L4ZQY4ZG.js → chunk-GZRNOIEE.js} +3 -3
  100. package/dist/{chunk-VQ35LXDC.js → chunk-I2NVBDKH.js} +1 -1
  101. package/dist/{chunk-EZYXY67W.js → chunk-IJG4UEKF.js} +8 -8
  102. package/dist/{chunk-JGKUENPD.js → chunk-IM23VMBR.js} +1 -1
  103. package/dist/{chunk-5EC62E65.js → chunk-IM2PF6VQ.js} +2 -2
  104. package/dist/{chunk-BVX7LUAW.js → chunk-IMH5H47S.js} +3 -3
  105. package/dist/{chunk-3SIRRK3F.js → chunk-J5OAQAAD.js} +4 -4
  106. package/dist/{chunk-SZFULV7I.js → chunk-J5W63XNR.js} +6 -6
  107. package/dist/{chunk-GNRH43N3.js → chunk-JJYTN72U.js} +2 -2
  108. package/dist/{chunk-HMOKKMIV.js → chunk-JLSXDYS4.js} +2 -2
  109. package/dist/{chunk-UC5IC3AM.js → chunk-JVENCUUG.js} +9 -9
  110. package/dist/{chunk-EFVQQF6F.js → chunk-JXJNQHPY.js} +19 -19
  111. package/dist/{chunk-HPHDLN6E.js → chunk-JYR4V4AG.js} +2 -2
  112. package/dist/{chunk-EG5MU7XL.js → chunk-JZ43635V.js} +1 -1
  113. package/dist/{chunk-KQCJWK55.js → chunk-KC2EQCBE.js} +6 -6
  114. package/dist/{chunk-P52LXNUU.js → chunk-L744YF4X.js} +1 -1
  115. package/dist/{chunk-SXHV5OLA.js → chunk-LC2UF3AA.js} +1 -1
  116. package/dist/{chunk-GUSENWAH.js → chunk-LLDGRPLF.js} +1 -1
  117. package/dist/{chunk-KNZ7YTFH.js → chunk-LLSGIMLG.js} +1 -1
  118. package/dist/{chunk-JPSWWIBW.js → chunk-LQIHBIXG.js} +6 -6
  119. package/dist/chunk-M36B3M2H.js +8 -0
  120. package/dist/{chunk-2J3C2RR4.js → chunk-M3HTP2N6.js} +6 -6
  121. package/dist/{chunk-BZRFD4DK.js → chunk-M4REKOGO.js} +1 -1
  122. package/dist/{chunk-ZNV75GAG.js → chunk-MEFB2KGF.js} +1 -1
  123. package/dist/{chunk-U2ZTHOQL.js → chunk-MMA3WTF2.js} +4 -4
  124. package/dist/chunk-MRZLFZNJ.js +6 -0
  125. package/dist/chunk-N64YAF5N.js +2 -0
  126. package/dist/chunk-N6PMH6DU.js +6 -0
  127. package/dist/chunk-NRHG4R2Q.js +1 -0
  128. package/dist/chunk-ODOWFVUE.js +28 -0
  129. package/dist/{chunk-G2JPTPRS.js → chunk-OFMZ6JM6.js} +13 -13
  130. package/dist/chunk-ONWFKCMB.js +14 -0
  131. package/dist/{chunk-XWJT6TFU.js → chunk-OSMRYND3.js} +1 -1
  132. package/dist/{chunk-6OCA7RKQ.js → chunk-P234FPKJ.js} +1 -1
  133. package/dist/{chunk-ZVDYRXNP.js → chunk-P4VOUPRF.js} +6 -6
  134. package/dist/{chunk-J4CVYOY3.js → chunk-P6H2B635.js} +10 -10
  135. package/dist/{chunk-ENDYHUUR.js → chunk-P73ZJ6QR.js} +1 -1
  136. package/dist/{chunk-5HFKVEWW.js → chunk-PFOTEDSQ.js} +1 -1
  137. package/dist/{chunk-FBS55WOX.js → chunk-PLESHI3E.js} +7 -7
  138. package/dist/{chunk-42DF7CDB.js → chunk-PPI4WJ3V.js} +7 -7
  139. package/dist/{chunk-M2TQOJ3G.js → chunk-PSVGB7KT.js} +1 -1
  140. package/dist/{chunk-223XYIIH.js → chunk-Q2RNFBYS.js} +1 -1
  141. package/dist/{chunk-6OGX7V7L.js → chunk-Q36KB5RQ.js} +7 -7
  142. package/dist/{chunk-WPGSU4QG.js → chunk-Q7CM4UDG.js} +2 -2
  143. package/dist/{chunk-XOCRRCCP.js → chunk-QNQNOTTS.js} +1 -1
  144. package/dist/{chunk-25T4YQO7.js → chunk-QPVYBN4J.js} +2 -2
  145. package/dist/{chunk-FUPU7Z2G.js → chunk-QRPPWLKU.js} +7 -7
  146. package/dist/{chunk-7SVSHJOO.js → chunk-QZ2XRFDP.js} +6 -6
  147. package/dist/{chunk-IE6TRMIW.js → chunk-R3BSWWGB.js} +1 -1
  148. package/dist/{chunk-CCLK2RPQ.js → chunk-R7CYBBJY.js} +13 -13
  149. package/dist/{chunk-FFRJ6QZK.js → chunk-RB3BMRNA.js} +1 -1
  150. package/dist/{chunk-FZYUTZEV.js → chunk-RFWBNKKB.js} +10 -10
  151. package/dist/{chunk-S25KELFW.js → chunk-RKSCB5BJ.js} +5 -5
  152. package/dist/{chunk-F3E3CEZM.js → chunk-RM2I6DIF.js} +1 -1
  153. package/dist/{chunk-QBMMORYP.js → chunk-ROYHU3E5.js} +1 -1
  154. package/dist/chunk-S4RD6UJU.js +8 -0
  155. package/dist/{chunk-RDETBXMP.js → chunk-SAHRIE35.js} +1 -1
  156. package/dist/{chunk-MOKABQCY.js → chunk-SAMPXZF3.js} +3 -3
  157. package/dist/{chunk-W2TPXKCV.js → chunk-SCNQK5NF.js} +1 -1
  158. package/dist/{chunk-SM3N5UJ2.js → chunk-TDUOBP55.js} +9 -9
  159. package/dist/{chunk-BG3C4ALM.js → chunk-TJ5YMXVB.js} +1 -1
  160. package/dist/{chunk-SHHRC5XK.js → chunk-TJG76Y7I.js} +9 -9
  161. package/dist/{chunk-VFSAJMNX.js → chunk-TNGIXSTM.js} +1 -1
  162. package/dist/{chunk-BNPWUCZX.js → chunk-TSCJG6UM.js} +1 -1
  163. package/dist/{chunk-ETQ45TBW.js → chunk-TTYTOLVV.js} +1 -1
  164. package/dist/{chunk-DO3DSSAW.js → chunk-U73K3ICC.js} +1 -1
  165. package/dist/{chunk-FRCTA5FS.js → chunk-UAXL44HH.js} +1 -1
  166. package/dist/{chunk-CWVQH2SP.js → chunk-UDJPSHVI.js} +1 -1
  167. package/dist/{chunk-L2WBCXG7.js → chunk-UFJR63AO.js} +1 -1
  168. package/dist/{chunk-YT5HMLC7.js → chunk-UJY5RUZ5.js} +1 -1
  169. package/dist/{chunk-R6GXVLY7.js → chunk-UMIRPFQJ.js} +1 -1
  170. package/dist/chunk-UUY66GLZ.js +1 -0
  171. package/dist/{chunk-WRV6QKJN.js → chunk-UVPDEGIA.js} +1 -1
  172. package/dist/{chunk-YE2YU526.js → chunk-VB3UHY2J.js} +1 -1
  173. package/dist/{chunk-KEVJBI5Q.js → chunk-VTCMO3K7.js} +1 -1
  174. package/dist/{chunk-2TXQCA4C.js → chunk-W24THMLI.js} +8 -8
  175. package/dist/{chunk-VXSYHTBP.js → chunk-W3454ZES.js} +1 -1
  176. package/dist/{chunk-EFO72DEI.js → chunk-WCAABJEV.js} +1 -1
  177. package/dist/{chunk-OZ4R6U2M.js → chunk-WREUA43Q.js} +1 -1
  178. package/dist/{chunk-ELPW25CA.js → chunk-XX34ZFYB.js} +4 -4
  179. package/dist/chunk-XYQFTFI7.js +24 -0
  180. package/dist/{chunk-UFX7F3KG.js → chunk-XYVFJLAU.js} +1 -1
  181. package/dist/{chunk-A7VNKVZO.js → chunk-XYXCZIJY.js} +4 -4
  182. package/dist/{chunk-ZCN5BU4U.js → chunk-YBE66FBR.js} +1 -1
  183. package/dist/{chunk-6QH7I2V5.js → chunk-Z6J4KXY3.js} +2 -2
  184. package/dist/{chunk-NY6MLFBX.js → chunk-ZBGPAUOH.js} +5 -5
  185. package/dist/{chunk-LADP6AJY.js → chunk-ZFWCTHR4.js} +7 -7
  186. package/dist/{chunk-ORV2AVIJ.js → chunk-ZRWZHWKI.js} +2 -2
  187. package/dist/data/DataTable.js +1 -1
  188. package/dist/data/EntityList.js +1 -1
  189. package/dist/data/Gantt.js +1 -1
  190. package/dist/data/Kanban.js +1 -1
  191. package/dist/data/ListFooter.js +1 -1
  192. package/dist/data/ListLoadError.js +1 -1
  193. package/dist/data/Pagination.js +1 -1
  194. package/dist/data/ResizableTable.js +1 -1
  195. package/dist/file-intake/index.js +1 -1
  196. package/dist/forms/BorderInput.js +1 -1
  197. package/dist/forms/BrandAssetEditor.js +1 -1
  198. package/dist/forms/Calendar.js +1 -1
  199. package/dist/forms/ColorPicker.js +1 -1
  200. package/dist/forms/ComposerAttachments.js +1 -1
  201. package/dist/forms/CornersInput.js +1 -1
  202. package/dist/forms/DatePicker.js +1 -1
  203. package/dist/forms/DateRangePicker.js +1 -1
  204. package/dist/forms/DateTimePicker.js +1 -1
  205. package/dist/forms/DisplayChips.js +1 -1
  206. package/dist/forms/FilePicker.js +1 -1
  207. package/dist/forms/FormErrorSummary.js +1 -1
  208. package/dist/forms/IconPicker.js +1 -1
  209. package/dist/forms/ImageFocusPoint.js +1 -1
  210. package/dist/forms/Input.js +1 -1
  211. package/dist/forms/InputNumber.js +1 -1
  212. package/dist/forms/LinkPicker.js +1 -1
  213. package/dist/forms/MediaLibrary.js +1 -1
  214. package/dist/forms/MediaUploadField.js +1 -1
  215. package/dist/forms/MediaUploadGrid.js +1 -1
  216. package/dist/forms/MediaUsedInList.js +1 -1
  217. package/dist/forms/NumericKeypad.js +1 -1
  218. package/dist/forms/PositionInput.js +1 -1
  219. package/dist/forms/RenameField.js +1 -1
  220. package/dist/forms/Select.js +1 -1
  221. package/dist/forms/SidesInput.js +1 -1
  222. package/dist/forms/Slider.js +1 -1
  223. package/dist/forms/Snippet.js +1 -1
  224. package/dist/forms/TagInput.js +1 -1
  225. package/dist/forms/TextToolbar.js +1 -1
  226. package/dist/forms/TimePicker.js +1 -1
  227. package/dist/forms/WidthsBar.js +1 -1
  228. package/dist/forms/mediaLibraryMenu.js +1 -1
  229. package/dist/forms/mediaMoveItems.js +1 -1
  230. package/dist/forms/textAlign.js +1 -1
  231. package/dist/forms/useFileIntake.js +1 -1
  232. package/dist/hooks/index.d.ts +2 -2
  233. package/dist/hooks/useTheme.d.ts +1 -1
  234. package/dist/index.d.ts +24 -2
  235. package/dist/index.js +504 -504
  236. package/dist/locales/zh-Hans.js +1 -1
  237. package/dist/map/index.js +3 -3
  238. package/dist/model-viewer/index.js +3 -3
  239. package/dist/page-tabs/index.js +5 -5
  240. package/dist/pdf/index.js +1 -1
  241. package/dist/shell/Accordion.js +1 -1
  242. package/dist/shell/AppUpdateBanner.js +1 -1
  243. package/dist/shell/Avatar.js +1 -1
  244. package/dist/shell/Banner.js +1 -1
  245. package/dist/shell/Breadcrumbs.js +1 -1
  246. package/dist/shell/BudgetBar.js +1 -1
  247. package/dist/shell/Card.js +1 -1
  248. package/dist/shell/ColoredBadge.js +1 -1
  249. package/dist/shell/ConfirmDialog.js +1 -1
  250. package/dist/shell/ContainerFillChart.js +1 -1
  251. package/dist/shell/CountBadge.js +1 -1
  252. package/dist/shell/Dialog.js +1 -1
  253. package/dist/shell/Drawer.js +1 -1
  254. package/dist/shell/EditableGrid.js +1 -1
  255. package/dist/shell/EmptyState.js +1 -1
  256. package/dist/shell/GlobalSearch.js +1 -1
  257. package/dist/shell/HelpCenter.js +1 -1
  258. package/dist/shell/IconRail.js +1 -1
  259. package/dist/shell/ImageLightbox.js +1 -1
  260. package/dist/shell/ItemCount.js +1 -1
  261. package/dist/shell/LanguageSelect.js +1 -1
  262. package/dist/shell/Markdown.js +1 -1
  263. package/dist/shell/MetricBar.js +1 -1
  264. package/dist/shell/MetricBarLegend.js +1 -1
  265. package/dist/shell/MilestoneTimeline.js +1 -1
  266. package/dist/shell/PageHeader.js +1 -1
  267. package/dist/shell/ProductionTimeline.js +1 -1
  268. package/dist/shell/ResizeHandle.js +1 -1
  269. package/dist/shell/Result.js +1 -1
  270. package/dist/shell/SearchableSelect.js +1 -1
  271. package/dist/shell/SettingReset.js +1 -1
  272. package/dist/shell/SettingRow.js +1 -1
  273. package/dist/shell/SidebarLayout.js +1 -1
  274. package/dist/shell/SidebarNav.js +1 -1
  275. package/dist/shell/SortableList.js +1 -1
  276. package/dist/shell/Statistic.js +1 -1
  277. package/dist/shell/TimeAgo.js +1 -1
  278. package/dist/shell/TimelineTrack.js +1 -1
  279. package/dist/shell/TransferProgress.js +1 -1
  280. package/dist/shell/Tree.js +1 -1
  281. package/dist/shell/discardGuard.js +1 -1
  282. package/dist/shell/language.js +1 -1
  283. package/dist/shell/strings.d.ts +3 -0
  284. package/dist/shell/strings.js +1 -1
  285. package/dist/shell/toast.js +1 -1
  286. package/dist/telemetry/index.js +1 -1
  287. package/dist/templates/AuthScreen.js +1 -1
  288. package/dist/templates/ChatTemplate.js +1 -1
  289. package/dist/templates/CheckoutTemplate.js +1 -1
  290. package/dist/templates/DashboardTemplate.js +1 -1
  291. package/dist/templates/DataTablePage.js +1 -1
  292. package/dist/templates/EmailTemplate.js +1 -1
  293. package/dist/templates/ErrorBoundary.js +1 -1
  294. package/dist/templates/ErrorPage.js +1 -1
  295. package/dist/templates/FormLayoutPage.js +1 -1
  296. package/dist/templates/GalleryTemplate.js +1 -1
  297. package/dist/tokens/colour.d.ts +2 -2
  298. package/dist/ui/index.js +1 -1
  299. package/dist/version.js +1 -1
  300. package/package.json +1 -1
  301. package/dist/Calculator-V5SACDGQ.js +0 -29
  302. package/dist/CurrencyConverter-B3NWE6LM.js +0 -21
  303. package/dist/Notepad-GGBFJNRE.js +0 -24
  304. package/dist/Sidebar-UCCVJFSY.js +0 -44
  305. package/dist/chunk-ABPVCVCT.js +0 -22
  306. package/dist/chunk-BWQHABH7.js +0 -4
  307. package/dist/chunk-CILE3ZCC.js +0 -2
  308. package/dist/chunk-FMLUQCFB.js +0 -2
  309. package/dist/chunk-GMLOMLCS.js +0 -24
  310. package/dist/chunk-HC5KQZFG.js +0 -8
  311. package/dist/chunk-IUVGHHR3.js +0 -1
  312. package/dist/chunk-IXJIHTUI.js +0 -91
  313. package/dist/chunk-JPE4TYRQ.js +0 -14
  314. package/dist/chunk-KGAYYSFE.js +0 -6
  315. package/dist/chunk-LQCNIQ3I.js +0 -8
  316. package/dist/chunk-OXWBSZL2.js +0 -23
  317. package/dist/chunk-PBSCF2ML.js +0 -15
  318. package/dist/chunk-QNXTVDIC.js +0 -11
  319. package/dist/chunk-UTQN5AIO.js +0 -6
  320. package/dist/chunk-VGUYAVDG.js +0 -1
  321. package/dist/chunk-XXTAMF3O.js +0 -28
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{ImageAnnotator_default as default}from"../chunk-SM3N5UJ2.js";import"../chunk-M6UKCZHT.js";import"../chunk-VQ35LXDC.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-MAFUXCPZ.js";import"../chunk-IUVGHHR3.js";import"../chunk-C3QOHMR6.js";
2
+ export{ImageAnnotator_default as default}from"../chunk-TDUOBP55.js";import"../chunk-M6UKCZHT.js";import"../chunk-I2NVBDKH.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-CUNYWXUT.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-5EC62E65.js";import{setSpreadsheetPreview as e}from"../chunk-KGRJSTPM.js";export{FILES_OFFICE_EXTENSIONS,FILES_ROLE_LABELS,FilesQuotaError,SPREADSHEET_PREVIEW_UPDATE_EVENT,claimSpreadsheetPreviewStage,createFileServerStore,filesRoleWrites,peekSpreadsheetPreviewStage,setFilesStore,setSpreadsheetPreview}from"../chunk-KGRJSTPM.js";import{setPdfPreview as t}from"../chunk-I4RJAMLJ.js";export{setPdfPreview}from"../chunk-I4RJAMLJ.js";import"../chunk-IXJIHTUI.js";import"../chunk-4LXCCZDM.js";import"../chunk-KNUR2UEG.js";import"../chunk-JDCM2VHG.js";import"../chunk-YI4T5I5D.js";import"../chunk-M2TQOJ3G.js";import"../chunk-FBZUEZK7.js";import"../chunk-5A7MWTXX.js";import"../chunk-BG3C4ALM.js";import"../chunk-GMLOMLCS.js";import"../chunk-UTQN5AIO.js";import"../chunk-EIFNESXS.js";import"../chunk-SXHV5OLA.js";import"../chunk-SF4IIV5Z.js";import"../chunk-FRCTA5FS.js";import"../chunk-VWGWZY7A.js";import"../chunk-UVHXVSB2.js";import"../chunk-WRV6QKJN.js";import"../chunk-AW7TOB6N.js";import"../chunk-4U5M37SF.js";import"../chunk-F3ZOO23R.js";import"../chunk-2QY5BJLA.js";import"../chunk-UGTRSRIW.js";import"../chunk-DPFEQQQU.js";import"../chunk-VGUYAVDG.js";import"../chunk-DWGYC7OD.js";import"../chunk-YDJ5IZOU.js";import"../chunk-THAPVKEJ.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-UTISUEO4.js";import"../chunk-BUFAJJDZ.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-STKJA4PV.js";import"../chunk-M6UKCZHT.js";import{toast_default as o}from"../chunk-VQ35LXDC.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{currentShellStrings as n}from"../chunk-IUVGHHR3.js";import"../chunk-C3QOHMR6.js";import{lazy as i}from"react";function r(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var s=/* @__PURE__ */new Set(["csv","tsv"]),c=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),a=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),m=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function l(e){const t=r(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":s.has(t)?"csv":a.has(t)?"image":m.has(t)?"3d":null}function u(e){window.open(e,"_blank","noopener,noreferrer")}async function p(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const n=await fetch(e);if(!n.ok)throw new Error(`fetch failed: ${n.status}`);return n.text()}function h(e,t){return(e instanceof Error?e.message:"")||t}async function k(i,s,a={}){const m=n().attachment,k=i?.url||"",j=i?.filename||m.fallbackName;if(!k&&!a.fetchBlob)return void o.error(m.noLink);const f=l(j)??l(k);if("csv"===f){try{e({csv:await p(k,a,i),filename:j}),s("/spreadsheet")}catch{o.error(m.spreadsheetFailed),k&&u(k)}return}if(c.has(r(j)||r(k)))return o.error(m.workbookUnavailable),void(k&&u(k));if(!f)return k?(o.info(m.noViewer),void u(k)):void o.error(m.noLink);if(!a.fetchBlob)return t({url:k,filename:j,kind:f}),void s("/preview");const d=t({filename:j,kind:f,converting:!0,convertingMessage:a.loadingMessage||m.loading});s("/preview");try{const e=await a.fetchBlob(i);d.update({url:URL.createObjectURL(e),filename:j,kind:f})}catch(e){d.update({filename:j,kind:f,converting:!1,convertingMessage:h(e,m.loadFailed)})}}function j(e,t,o={}){const i=n().attachment,s=[];let a=-1;return e.forEach((e,n)=>{const m=e?.url||"";if(!m&&!o.fetchBlob)return;const u=e?.filename||i.fallbackName;if(c.has(r(u)||r(m)))return;const p=l(u)??l(m);p&&"csv"!==p&&(n===t&&(a=s.length),s.push({att:e,sourceIndex:n,filename:u,url:m,kind:p}))}),{items:s,start:a}}async function f(e,o,i,r={}){const{items:s,start:c}=j(e,o,r);if(c<0||s.length<2){const t=e[o];return void(t&&await k(t,i,r))}const a=n().attachment,m=s.length;let l=null,u=-1;const p=e=>({position:{index:e,count:m},onPrevious:e>0?()=>{d(e-1)}:void 0,onNext:e<m-1?()=>{d(e+1)}:void 0}),f=e=>{l?l.update(e):(l=t(e),i("/preview"))};async function d(e){u=e;const{att:t,filename:o,url:n,kind:i}=s[e];if(r.fetchBlob){f({filename:o,kind:i,converting:!0,convertingMessage:r.loadingMessage||a.loading,...p(e)});try{const n=await r.fetchBlob(t),s=URL.createObjectURL(n);if(u!==e)return void URL.revokeObjectURL(s);f({url:s,filename:o,kind:i,...p(e)})}catch(t){if(u!==e)return;f({filename:o,kind:i,converting:!1,convertingMessage:h(t,a.loadFailed),...p(e)})}}else f({url:n,filename:o,kind:i,...p(e)})}await d(c)}var d=i(()=>import("../Calculator-V5SACDGQ.js")),S=i(()=>import("../Weather-FO5DVYQ4.js")),w=i(()=>import("../CurrencyConverter-B3NWE6LM.js")),g=i(()=>import("../PomodoroTimer-XLPBKMWS.js")),v=i(()=>import("../Notepad-GGBFJNRE.js")),E=i(()=>import("../WorldClock-BYZ5BNLZ.js")),U=i(()=>import("../Stock-PRUMXULJ.js")),F=i(()=>import("../Preview-CWGCGKR5.js")),L=i(()=>import("../PdfViewer-EELX35ZI.js")),R=i(()=>import("../Files-LRSNSZ5Y.js")),T=i(()=>import("../Browser-XFEOOL5J.js")),I={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/notepad":{component:v,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:S,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:w,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:g,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:E,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:U,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},b={"/preview":{component:F,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/files":{component:R,label:"Files",size:"xl",appStyle:!0}},C={"/browser":{component:T,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},P={...I,...b,...C};export{T as Browser,d as Calculator,w as CurrencyConverter,R as Files,v as Notepad,L as PdfViewer,g as PomodoroTimer,F as Preview,U as Stock,S as Weather,E as WorldClock,l as attachmentKind,P as bundledApps,b as documentApps,k as openAttachment,f as openAttachments,I as utilityApps,j as viewableAttachments,C as webApps};
2
+ export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-CUNYWXUT.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-IM2PF6VQ.js";import{setSpreadsheetPreview as e}from"../chunk-KGRJSTPM.js";export{FILES_OFFICE_EXTENSIONS,FILES_ROLE_LABELS,FilesQuotaError,SPREADSHEET_PREVIEW_UPDATE_EVENT,claimSpreadsheetPreviewStage,createFileServerStore,filesRoleWrites,peekSpreadsheetPreviewStage,setFilesStore,setSpreadsheetPreview}from"../chunk-KGRJSTPM.js";import{setPdfPreview as t}from"../chunk-I4RJAMLJ.js";export{setPdfPreview}from"../chunk-I4RJAMLJ.js";import"../chunk-BT636U6W.js";import"../chunk-4LXCCZDM.js";import"../chunk-KNUR2UEG.js";import"../chunk-JDCM2VHG.js";import"../chunk-YI4T5I5D.js";import"../chunk-PSVGB7KT.js";import"../chunk-FBZUEZK7.js";import"../chunk-5A7MWTXX.js";import"../chunk-TJ5YMXVB.js";import"../chunk-XYQFTFI7.js";import"../chunk-MRZLFZNJ.js";import"../chunk-EIFNESXS.js";import"../chunk-LC2UF3AA.js";import"../chunk-CJQPC2P3.js";import"../chunk-UAXL44HH.js";import"../chunk-VWGWZY7A.js";import"../chunk-UVHXVSB2.js";import"../chunk-UVPDEGIA.js";import"../chunk-AW7TOB6N.js";import"../chunk-4PJFL26P.js";import"../chunk-F3ZOO23R.js";import"../chunk-2QY5BJLA.js";import"../chunk-UGTRSRIW.js";import"../chunk-DPFEQQQU.js";import"../chunk-UUY66GLZ.js";import"../chunk-EX3DARI3.js";import"../chunk-VQBKRBBR.js";import"../chunk-DWGYC7OD.js";import"../chunk-YDJ5IZOU.js";import"../chunk-THAPVKEJ.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-UTISUEO4.js";import"../chunk-BUFAJJDZ.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-STKJA4PV.js";import"../chunk-M6UKCZHT.js";import{toast_default as o}from"../chunk-I2NVBDKH.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{currentShellStrings as n}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{lazy as i}from"react";function r(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var s=/* @__PURE__ */new Set(["csv","tsv"]),c=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),a=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),m=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function l(e){const t=r(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":s.has(t)?"csv":a.has(t)?"image":m.has(t)?"3d":null}function u(e){window.open(e,"_blank","noopener,noreferrer")}async function p(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const n=await fetch(e);if(!n.ok)throw new Error(`fetch failed: ${n.status}`);return n.text()}function h(e,t){return(e instanceof Error?e.message:"")||t}async function k(i,s,a={}){const m=n().attachment,k=i?.url||"",j=i?.filename||m.fallbackName;if(!k&&!a.fetchBlob)return void o.error(m.noLink);const f=l(j)??l(k);if("csv"===f){try{e({csv:await p(k,a,i),filename:j}),s("/spreadsheet")}catch{o.error(m.spreadsheetFailed),k&&u(k)}return}if(c.has(r(j)||r(k)))return o.error(m.workbookUnavailable),void(k&&u(k));if(!f)return k?(o.info(m.noViewer),void u(k)):void o.error(m.noLink);if(!a.fetchBlob)return t({url:k,filename:j,kind:f}),void s("/preview");const d=t({filename:j,kind:f,converting:!0,convertingMessage:a.loadingMessage||m.loading});s("/preview");try{const e=await a.fetchBlob(i);d.update({url:URL.createObjectURL(e),filename:j,kind:f})}catch(e){d.update({filename:j,kind:f,converting:!1,convertingMessage:h(e,m.loadFailed)})}}function j(e,t,o={}){const i=n().attachment,s=[];let a=-1;return e.forEach((e,n)=>{const m=e?.url||"";if(!m&&!o.fetchBlob)return;const u=e?.filename||i.fallbackName;if(c.has(r(u)||r(m)))return;const p=l(u)??l(m);p&&"csv"!==p&&(n===t&&(a=s.length),s.push({att:e,sourceIndex:n,filename:u,url:m,kind:p}))}),{items:s,start:a}}async function f(e,o,i,r={}){const{items:s,start:c}=j(e,o,r);if(c<0||s.length<2){const t=e[o];return void(t&&await k(t,i,r))}const a=n().attachment,m=s.length;let l=null,u=-1;const p=e=>({position:{index:e,count:m},onPrevious:e>0?()=>{d(e-1)}:void 0,onNext:e<m-1?()=>{d(e+1)}:void 0}),f=e=>{l?l.update(e):(l=t(e),i("/preview"))};async function d(e){u=e;const{att:t,filename:o,url:n,kind:i}=s[e];if(r.fetchBlob){f({filename:o,kind:i,converting:!0,convertingMessage:r.loadingMessage||a.loading,...p(e)});try{const n=await r.fetchBlob(t),s=URL.createObjectURL(n);if(u!==e)return void URL.revokeObjectURL(s);f({url:s,filename:o,kind:i,...p(e)})}catch(t){if(u!==e)return;f({filename:o,kind:i,converting:!1,convertingMessage:h(t,a.loadFailed),...p(e)})}}else f({url:n,filename:o,kind:i,...p(e)})}await d(c)}var d=i(()=>import("../Calculator-HJK5JN54.js")),w=i(()=>import("../Weather-XNMLNV7N.js")),g=i(()=>import("../CurrencyConverter-MPAZ6QJ3.js")),v=i(()=>import("../PomodoroTimer-VREYC3ML.js")),S=i(()=>import("../Notepad-R7MUSPRC.js")),P=i(()=>import("../WorldClock-AZLGM2T5.js")),R=i(()=>import("../Stock-GQSNYWV2.js")),U=i(()=>import("../Preview-X64AVAUP.js")),F=i(()=>import("../PdfViewer-FWGHFO4N.js")),T=i(()=>import("../Files-IPM7TRMJ.js")),E=i(()=>import("../Browser-342OHRA2.js")),L={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/notepad":{component:S,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:g,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:v,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:P,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:R,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},b={"/preview":{component:U,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/files":{component:T,label:"Files",size:"xl",appStyle:!0}},I={"/browser":{component:E,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},M={...L,...b,...I};export{E as Browser,d as Calculator,g as CurrencyConverter,T as Files,S as Notepad,F as PdfViewer,v as PomodoroTimer,U as Preview,R as Stock,w as Weather,P as WorldClock,l as attachmentKind,M as bundledApps,b as documentApps,k as openAttachment,f as openAttachments,L as utilityApps,j as viewableAttachments,I as webApps};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e}from"module";import{extname as t,isAbsolute as r,join as s,resolve as n}from"path";import{readFileSync as i,existsSync as o,statSync as c,readdirSync as a,mkdtempSync as l,rmSync as d}from"fs";import{execFileSync as h}from"child_process";import{tmpdir as f}from"os";import u from"assert/strict";import{createServer as w}from"http";import{pathToFileURL as p}from"url";function m(t,r){for(const n of[s(process.cwd(),"package.json"),r])try{return e(n)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}var g=class extends Error{};var y="efficient-shell-browser-check",v=`${y}: run real-browser checks, one <name>.entry.tsx page and one <name>.check.mjs check per scenario.\n\n ${y} [--dir tests/browser] [--css <file>]... [--tailwind <entry.css>]... [--serve <urlPath>=<file>]... [--define KEY=JSON]...\n\n --dir <folder> the scenario folder (default tests/browser)\n --css <file> a stylesheet every page links, in the order given\n --tailwind <entry.css> a Tailwind entry, compiled with this repository's @tailwindcss/cli,\n linked like a --css sheet, in the order given\n --serve <urlPath>=<file> a file the page can fetch at urlPath (starts with /)\n --define KEY=JSON replace KEY in the bundle with the JSON value\n --version, --help\n\nesbuild and playwright come from this repository's devDependencies.\nBROWSER_SHARD=<i>/<n> runs one shard. Exits 1 when a check fails.`,b={".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".html":"text/html; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".pdf":"application/pdf",".wasm":"application/wasm",".woff2":"font/woff2",".glb":"model/gltf-binary"},$=class extends Error{};function x(e,t,n){const i=r(t)?t:s(e,t);if(!o(i)||!c(i).isFile())throw new $(`${n} ${t}: no such file`);return i}function E(e,t,r){return i(x(e,t,r))}async function j(e){const{dir:t,root:r=process.cwd(),esbuild:i,chromium:o,stylesheets:c=[],serve:l={},define:d={},shard:h,reactDir:f,out:m=e=>console.log(e),err:g=(...e)=>console.error(...e)}=e,y=a(t).filter(e=>e.endsWith(".entry.tsx")).map(e=>e.replace(/\.entry\.tsx$/,"")).sort();if(0===y.length)throw new Error(`no *.entry.tsx found in ${t}`);const v=function(e,t){if(!t)return e;const r=/^(\d+)\/(\d+)$/.exec(t);if(!r)throw new Error(`BROWSER_SHARD must look like 1/3, got ${JSON.stringify(t)}`);const[s,n]=[Number(r[1]),Number(r[2])];if(!(n>=1&&s>=1&&s<=n))throw new Error(`BROWSER_SHARD ${t} is out of range`);return e.filter((e,t)=>t%n===s-1)}(y,h);h&&m(`shard ${h}: ${v.length} of ${y.length} scenarios`);const b=c.map((e,t)=>`/styles-${t+1}.css`),$=new Map(Object.entries(l));c.forEach((e,t)=>$.set(b[t],{contentType:"text/css; charset=utf-8",body:e}));const x=await o.launch({headless:!0});let E=!1;try{for(const e of v){const{default:o,describe:c,viewport:a}=await(import(p(s(t,`${e}.check.mjs`)).href)),l=await i.build({entryPoints:[s(t,`${e}.entry.tsx`)],bundle:!0,write:!1,outdir:s(r,"node_modules",".cache","efficient-shell-browser"),entryNames:"bundle",format:"esm",platform:"browser",target:"chrome120",jsx:"automatic",define:d,logLevel:"warning",...f&&{alias:{react:s(n(f),"react"),"react-dom":s(n(f),"react-dom")}}}),h=l.outputFiles.find(e=>e.path.endsWith(".js")).text,y=l.outputFiles.find(e=>e.path.endsWith(".css"))?.text??null,v=w((e,t)=>{const r=e.url??"/";if("/bundle.js"===r)return t.writeHead(200,{"content-type":"text/javascript; charset=utf-8"}),void t.end(h);if("/bundle.css"===r&&null!==y)return t.writeHead(200,{"content-type":"text/css; charset=utf-8"}),void t.end(y);const s=$.get(r);if(s)return t.writeHead(200,{"content-type":s.contentType}),void t.end(s.body);t.writeHead(200,{"content-type":"text/html; charset=utf-8"}),t.end("<!doctype html><html><head>"+b.map(e=>`<link rel="stylesheet" href="${e}">`).join("")+(null!==y?'<link rel="stylesheet" href="/bundle.css">':"")+'</head><body><div id="root"></div><script type="module" src="/bundle.js"><\/script></body></html>')});await new Promise((e,t)=>{v.once("error",t),v.listen(0,"127.0.0.1",e)});const j=v.address();u.ok(j&&"object"==typeof j);const R=`http://127.0.0.1:${j.port}`,S=await x.newPage({viewport:a??{width:1280,height:720}}),k=(e="")=>S.goto(`${R}/${e}`,{waitUntil:"networkidle"});S.setDefaultTimeout(15e3);const O=[];S.on("pageerror",e=>O.push(e));try{await k(),await o(S,{pageErrors:O,baseUrl:R,open:k}),m(`✔ ${c??e}`)}catch(t){E=!0,g(`✖ ${c??e}`),g(t);for(const e of O)g(" page error:",e.message)}finally{await S.close(),await new Promise(e=>v.close(e))}}}finally{await x.close()}return!E}var R=import.meta.url;process.exitCode=await async function(e,n){let i;try{i=function(e,n,i){let o="tests/browser";const c=[],a={},l={};for(let r=0;r<e.length;r++){const s=e[r];if("--help"===s||"-h"===s)return"help";if("--version"===s||"-v"===s)return"version";const d=s.indexOf("="),h=s.startsWith("--")&&d>0?s.slice(0,d):s;if(!["--dir","--css","--tailwind","--serve","--define"].includes(h))throw new $(`unknown argument "${s}"`);let f;if(h!==s)f=s.slice(d+1);else{if(r+1>=e.length)throw new $(`${h} needs a value`);f=e[++r]}if("--dir"===h)o=f;else if("--css"===h)c.push(E(n,f,h).toString("utf8"));else if("--tailwind"===h){const e=x(n,f,h);try{c.push(i(e))}catch(e){if(e instanceof g)throw new $(e.message);throw e}}else if("--serve"===h){const e=f.indexOf("=");if(e<=0)throw new $(`--serve ${f}: expected <urlPath>=<file>`);const r=f.slice(0,e);if(!r.startsWith("/"))throw new $(`--serve ${f}: the URL path must start with /`);const s=f.slice(e+1);a[r]={contentType:b[t(s).toLowerCase()]??"application/octet-stream",body:E(n,s,h)}}else{const e=f.indexOf("=");if(e<=0)throw new $(`--define ${f}: expected KEY=JSON`);const t=f.slice(0,e),r=f.slice(e+1);try{JSON.parse(r)}catch{throw new $(`--define ${t}: ${JSON.stringify(r)} is not JSON (a string needs its quotes: KEY='"text"')`)}l[t]=r}}return{dir:r(o)?o:s(n,o),stylesheets:c,serve:a,define:l}}(e,n.cwd,n.compileTailwind)}catch(e){if(!(e instanceof $))throw e;return n.err(`${y}: ${e.message}\n\n${v}`),1}if("help"===i)return n.out(v),0;if("version"===i)return n.out(n.version),0;n.env.BROWSER_SHARD&&(i.shard=n.env.BROWSER_SHARD),n.env.REACT_DIR&&(i.reactDir=n.env.REACT_DIR),i.root=n.cwd;try{return await n.runLane(i)?0:1}catch(e){return n.err(`${y}: ${e instanceof Error?e.message:String(e)}`),1}}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),version:"13.20.0",compileTailwind:e=>function(e,t){if(!o(e)||!c(e).isFile())throw new g(`--tailwind ${e}: no such file`);const r=s(t,"node_modules",".bin","tailwindcss");if(!o(r))throw new g("--tailwind needs the Tailwind CLI: add @tailwindcss/cli to this repository's devDependencies");const n=l(s(f(),"browser-check-css-"));try{const o=s(n,"styles.css");return h(r,["-i",e,"-o",o],{cwd:t,stdio:["ignore","ignore","inherit"]}),i(o,"utf8")}finally{d(n,{recursive:!0,force:!0})}}(e,process.cwd()),runLane:e=>j({...e,esbuild:m("esbuild",R),chromium:m("playwright",R).chromium})});
2
+ import{createRequire as e}from"module";import{extname as t,isAbsolute as r,join as s,resolve as n}from"path";import{readFileSync as i,existsSync as o,statSync as c,readdirSync as a,mkdtempSync as l,rmSync as d}from"fs";import{execFileSync as h}from"child_process";import{tmpdir as f}from"os";import u from"assert/strict";import{createServer as w}from"http";import{pathToFileURL as p}from"url";function m(t,r){for(const n of[s(process.cwd(),"package.json"),r])try{return e(n)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}var g=class extends Error{};var y="efficient-shell-browser-check",v=`${y}: run real-browser checks, one <name>.entry.tsx page and one <name>.check.mjs check per scenario.\n\n ${y} [--dir tests/browser] [--css <file>]... [--tailwind <entry.css>]... [--serve <urlPath>=<file>]... [--define KEY=JSON]...\n\n --dir <folder> the scenario folder (default tests/browser)\n --css <file> a stylesheet every page links, in the order given\n --tailwind <entry.css> a Tailwind entry, compiled with this repository's @tailwindcss/cli,\n linked like a --css sheet, in the order given\n --serve <urlPath>=<file> a file the page can fetch at urlPath (starts with /)\n --define KEY=JSON replace KEY in the bundle with the JSON value\n --version, --help\n\nesbuild and playwright come from this repository's devDependencies.\nBROWSER_SHARD=<i>/<n> runs one shard. Exits 1 when a check fails.`,b={".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".html":"text/html; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".pdf":"application/pdf",".wasm":"application/wasm",".woff2":"font/woff2",".glb":"model/gltf-binary"},$=class extends Error{};function x(e,t,n){const i=r(t)?t:s(e,t);if(!o(i)||!c(i).isFile())throw new $(`${n} ${t}: no such file`);return i}function E(e,t,r){return i(x(e,t,r))}async function j(e){const{dir:t,root:r=process.cwd(),esbuild:i,chromium:o,stylesheets:c=[],serve:l={},define:d={},shard:h,reactDir:f,out:m=e=>console.log(e),err:g=(...e)=>console.error(...e)}=e,y=a(t).filter(e=>e.endsWith(".entry.tsx")).map(e=>e.replace(/\.entry\.tsx$/,"")).sort();if(0===y.length)throw new Error(`no *.entry.tsx found in ${t}`);const v=function(e,t){if(!t)return e;const r=/^(\d+)\/(\d+)$/.exec(t);if(!r)throw new Error(`BROWSER_SHARD must look like 1/3, got ${JSON.stringify(t)}`);const[s,n]=[Number(r[1]),Number(r[2])];if(!(n>=1&&s>=1&&s<=n))throw new Error(`BROWSER_SHARD ${t} is out of range`);return e.filter((e,t)=>t%n===s-1)}(y,h);h&&m(`shard ${h}: ${v.length} of ${y.length} scenarios`);const b=c.map((e,t)=>`/styles-${t+1}.css`),$=new Map(Object.entries(l));c.forEach((e,t)=>$.set(b[t],{contentType:"text/css; charset=utf-8",body:e}));const x=await o.launch({headless:!0});let E=!1;try{for(const e of v){const{default:o,describe:c,viewport:a}=await(import(p(s(t,`${e}.check.mjs`)).href)),l=await i.build({entryPoints:[s(t,`${e}.entry.tsx`)],bundle:!0,write:!1,outdir:s(r,"node_modules",".cache","efficient-shell-browser"),entryNames:"bundle",format:"esm",platform:"browser",target:"chrome120",jsx:"automatic",define:d,logLevel:"warning",...f&&{alias:{react:s(n(f),"react"),"react-dom":s(n(f),"react-dom")}}}),h=l.outputFiles.find(e=>e.path.endsWith(".js")).text,y=l.outputFiles.find(e=>e.path.endsWith(".css"))?.text??null,v=w((e,t)=>{const r=e.url??"/";if("/bundle.js"===r)return t.writeHead(200,{"content-type":"text/javascript; charset=utf-8"}),void t.end(h);if("/bundle.css"===r&&null!==y)return t.writeHead(200,{"content-type":"text/css; charset=utf-8"}),void t.end(y);const s=$.get(r);if(s)return t.writeHead(200,{"content-type":s.contentType}),void t.end(s.body);t.writeHead(200,{"content-type":"text/html; charset=utf-8"}),t.end("<!doctype html><html><head>"+b.map(e=>`<link rel="stylesheet" href="${e}">`).join("")+(null!==y?'<link rel="stylesheet" href="/bundle.css">':"")+'</head><body><div id="root"></div><script type="module" src="/bundle.js"><\/script></body></html>')});await new Promise((e,t)=>{v.once("error",t),v.listen(0,"127.0.0.1",e)});const j=v.address();u.ok(j&&"object"==typeof j);const R=`http://127.0.0.1:${j.port}`,S=await x.newPage({viewport:a??{width:1280,height:720}}),k=(e="")=>S.goto(`${R}/${e}`,{waitUntil:"networkidle"});S.setDefaultTimeout(15e3);const O=[];S.on("pageerror",e=>O.push(e));try{await k(),await o(S,{pageErrors:O,baseUrl:R,open:k}),m(`✔ ${c??e}`)}catch(t){E=!0,g(`✖ ${c??e}`),g(t);for(const e of O)g(" page error:",e.message)}finally{await S.close(),await new Promise(e=>v.close(e))}}}finally{await x.close()}return!E}var R=import.meta.url;process.exitCode=await async function(e,n){let i;try{i=function(e,n,i){let o="tests/browser";const c=[],a={},l={};for(let r=0;r<e.length;r++){const s=e[r];if("--help"===s||"-h"===s)return"help";if("--version"===s||"-v"===s)return"version";const d=s.indexOf("="),h=s.startsWith("--")&&d>0?s.slice(0,d):s;if(!["--dir","--css","--tailwind","--serve","--define"].includes(h))throw new $(`unknown argument "${s}"`);let f;if(h!==s)f=s.slice(d+1);else{if(r+1>=e.length)throw new $(`${h} needs a value`);f=e[++r]}if("--dir"===h)o=f;else if("--css"===h)c.push(E(n,f,h).toString("utf8"));else if("--tailwind"===h){const e=x(n,f,h);try{c.push(i(e))}catch(e){if(e instanceof g)throw new $(e.message);throw e}}else if("--serve"===h){const e=f.indexOf("=");if(e<=0)throw new $(`--serve ${f}: expected <urlPath>=<file>`);const r=f.slice(0,e);if(!r.startsWith("/"))throw new $(`--serve ${f}: the URL path must start with /`);const s=f.slice(e+1);a[r]={contentType:b[t(s).toLowerCase()]??"application/octet-stream",body:E(n,s,h)}}else{const e=f.indexOf("=");if(e<=0)throw new $(`--define ${f}: expected KEY=JSON`);const t=f.slice(0,e),r=f.slice(e+1);try{JSON.parse(r)}catch{throw new $(`--define ${t}: ${JSON.stringify(r)} is not JSON (a string needs its quotes: KEY='"text"')`)}l[t]=r}}return{dir:r(o)?o:s(n,o),stylesheets:c,serve:a,define:l}}(e,n.cwd,n.compileTailwind)}catch(e){if(!(e instanceof $))throw e;return n.err(`${y}: ${e.message}\n\n${v}`),1}if("help"===i)return n.out(v),0;if("version"===i)return n.out(n.version),0;n.env.BROWSER_SHARD&&(i.shard=n.env.BROWSER_SHARD),n.env.REACT_DIR&&(i.reactDir=n.env.REACT_DIR),i.root=n.cwd;try{return await n.runLane(i)?0:1}catch(e){return n.err(`${y}: ${e instanceof Error?e.message:String(e)}`),1}}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),version:"13.22.0",compileTailwind:e=>function(e,t){if(!o(e)||!c(e).isFile())throw new g(`--tailwind ${e}: no such file`);const r=s(t,"node_modules",".bin","tailwindcss");if(!o(r))throw new g("--tailwind needs the Tailwind CLI: add @tailwindcss/cli to this repository's devDependencies");const n=l(s(f(),"browser-check-css-"));try{const o=s(n,"styles.css");return h(r,["-i",e,"-o",o],{cwd:t,stdio:["ignore","ignore","inherit"]}),i(o,"utf8")}finally{d(n,{recursive:!0,force:!0})}}(e,process.cwd()),runLane:e=>j({...e,esbuild:m("esbuild",R),chromium:m("playwright",R).chromium})});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function c(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var g=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function u(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=c(t),o=[...new Set(t.map(u))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?g.has(e.name)||""===t&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(d)}var d=(e,n)=>e<n?-1:e>n?1:0,f=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${f("top","left")}(?![\\w-])`,`(?<![\\w-])!?${f("\\[0_0\\]")}`].join("|"));var p={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set((p.busy?.words??[]).map(e=>e.toLowerCase()));var m=(...e)=>e.join("-");m("p[xytrblse]?",""),m("max","[wh]",""),m("h",""),m("w",""),m("[wh]",""),m("min","h","");var w=class extends Error{},y=new Set(["$schema","schema","include","exclude","allow"]),$=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var R="d3as2htf4hwbtr.cloudfront.net",b={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},v=Object.values(b),k=Object.freeze([...new Set([...v.flatMap(e=>e.hosts),R,...v.map(e=>e.bucket)])].sort()),x=new RegExp([...k.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function C(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(x)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var A="media-host-check.config.json",j="efficient-shell-media-host-check",T=`${j}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${j} check this repository; exits 1 on a finding\n ${j} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${A} in the current directory.`;function P(e,t,r){const o=[],s=c(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),g=[];for(const r of a)for(const o of C(e,r,i(n(t,r),"utf8")))g.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)g.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:a.length,findings:g.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(T),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${j}: unknown argument "${n}"\n\n${T}`),2;o=!0}const s=n(r.cwd,A);if(!t(s))return r.err(`${j}: no ${A} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!$(e))throw new w(`${n}: expected an object`);for(const n of Object.keys(e))y.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(S)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!($(i)&&S(i.file)&&S(i.match)&&S(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new w(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),A);a=P(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${j}: ${e instanceof w||e instanceof SyntaxError?e.message:String(e)}`),2}const c=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!c,...a},null,2)),c?1:0;if(!c)return r.out(`${j}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${A}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${A}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"13.20.0"});
2
+ import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function c(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var g=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function u(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=c(t),o=[...new Set(t.map(u))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?g.has(e.name)||""===t&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(d)}var d=(e,n)=>e<n?-1:e>n?1:0,f=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${f("top","left")}(?![\\w-])`,`(?<![\\w-])!?${f("\\[0_0\\]")}`].join("|"));var p={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set((p.busy?.words??[]).map(e=>e.toLowerCase()));var m=(...e)=>e.join("-");m("p[xytrblse]?",""),m("max","[wh]",""),m("h",""),m("w",""),m("[wh]",""),m("min","h","");var w=class extends Error{},y=new Set(["$schema","schema","include","exclude","allow"]),$=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var R="d3as2htf4hwbtr.cloudfront.net",b={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},v=Object.values(b),k=Object.freeze([...new Set([...v.flatMap(e=>e.hosts),R,...v.map(e=>e.bucket)])].sort()),x=new RegExp([...k.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function C(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(x)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var A="media-host-check.config.json",j="efficient-shell-media-host-check",T=`${j}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${j} check this repository; exits 1 on a finding\n ${j} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${A} in the current directory.`;function P(e,t,r){const o=[],s=c(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),g=[];for(const r of a)for(const o of C(e,r,i(n(t,r),"utf8")))g.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)g.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:a.length,findings:g.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(T),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${j}: unknown argument "${n}"\n\n${T}`),2;o=!0}const s=n(r.cwd,A);if(!t(s))return r.err(`${j}: no ${A} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!$(e))throw new w(`${n}: expected an object`);for(const n of Object.keys(e))y.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(S)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!($(i)&&S(i.file)&&S(i.match)&&S(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new w(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),A);a=P(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${j}: ${e instanceof w||e instanceof SyntaxError?e.message:String(e)}`),2}const c=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!c,...a},null,2)),c?1:0;if(!c)return r.out(`${j}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${A}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${A}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"13.22.0"});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{execFileSync as e}from"child_process";import{createRequire as t}from"module";import{join as n}from"path";import{existsSync as i,readFileSync as o,writeFileSync as s,lstatSync as r,readdirSync as a}from"fs";function l(e){return function(e,i){for(const o of[n(process.cwd(),"package.json"),i])try{return t(o)(e)}catch{}throw new Error(`${e} is not installed; add it to this repository's devDependencies`)}("typescript",e)}var c=["button","input","range","textarea","select","dialog","title","portal","native","dark","hex","radius","spacing","font-size","z-index","shadow","kit","icon","svg","kit-dep","chart","chart-dep","ellipsis-label","colour","gutter-literal","view-line-literal","route-literal","root-zone-literal","phone-query","sizes-literal","money-cents","local-helper","deprecated-undated","dialog-frame","scaled-frame"],d=e=>"string"==typeof e&&c.includes(e),u=["kit-dep","chart-dep"],h=e=>u.includes(e),f=c.filter(e=>!h(e)),p=["gutter-literal","view-line-literal","route-literal","root-zone-literal","phone-query","sizes-literal","money-cents","local-helper","deprecated-undated"],m=e=>p.includes(e),g={button:{counts:"a raw <button>",instead:"Button or IconButton from efficient-shell/ui"},input:{counts:"a raw <input> (not hidden, not a range)",instead:"Input, InputNumber, Checkbox, Radio or Switch from efficient-shell/ui"},range:{counts:'a raw <input type="range">',instead:"Slider from efficient-shell/ui"},textarea:{counts:"a raw <textarea>",instead:"Textarea from efficient-shell/ui"},select:{counts:"a raw <select>",instead:"Select or SearchableSelect from efficient-shell/ui"},dialog:{counts:'a raw <dialog>, or role="dialog" / role="alertdialog" on a raw element',instead:"Dialog or Modal from efficient-shell"},title:{counts:"a title= on a raw element (the browser's own tooltip)",instead:"Tooltip from efficient-shell/ui (harness UI-17)"},portal:{counts:"a createPortal(…) call (a layer the file floats itself)",instead:"Popover, PopupMenu, DropdownMenu, Tooltip or Dialog from efficient-shell/ui"},native:{counts:"window.confirm / alert / prompt, or a bare call that resolves to one",instead:"confirm, confirmDestructive, prompt or toast from efficient-shell (harness UI-20)"},dark:{counts:"a dark: variant in a class string",instead:"the light Tailwind class alone; the shell remaps it in dark mode (harness UI-7)"},hex:{counts:"a hex colour literal in a .tsx string",instead:"a colour role from efficient-shell: its utility or var(--role), COLOUR_ROLES lists them (harness FT-1; the colour kind counts palette classes too)"},radius:{counts:"a literal corner radius (an arbitrary-value radius class, or an inline borderRadius)",instead:"a radius utility from the scale or a role token such as rounded-(--radius-control); the theme sets how round they are (harness UI-7)"},spacing:{counts:"a padding, margin or gap off the scale (6px, 10px, 14px …) or written as a literal length (an arbitrary-value class, an inline style)",instead:"a step of the scale 2/4/8/12/16/20/24/32/40/48 — a Tailwind step, or a role such as var(--space-control-x) (owner ruling 2026-10-12)"},"font-size":{counts:"a literal font size (an arbitrary-value text class, an inline fontSize)",instead:"a type step 9/11/12/14/16/18/20/24/30 — Tailwind's 3xs … 3xl text steps (owner ruling 2026-10-12)"},"z-index":{counts:"a stack order above 30 written as a number (a z utility, an arbitrary value, an inline zIndex)",instead:"a named layer: Z_LAYERS (efficient-shell/ui) in code, its --z-* custom property in markup"},shadow:{counts:"a literal shadow, or a shadow size that is not an elevation level (md, 2xl, xs)",instead:"an elevation: the sm / lg / xl utilities, or var(--elevation-panel) and its siblings (owner ruling 2026-10-12)"},kit:{counts:"an import of a second UI kit",instead:"the component from efficient-shell/ui, or fold it into the shell (harness FT-3)"},icon:{counts:"an import of an icon package",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24)"},svg:{counts:"an <svg> element written in JSX: an icon drawn in place",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24). A chart, an illustration or a mark a host supplies stays on the baseline"},"kit-dep":{counts:"a UI kit or icon package declared in package.json (not one the shell entries imported here need)",instead:"remove the dependency once nothing imports it (harness FT-3)"},chart:{counts:"an import of a second chart library",instead:"a chart from efficient-shell/ui (ChartFrame, TimeSeriesChart, ColumnChart, RankedBars, PieChart, FunnelChart, ScatterChart, …), or add the chart there: one chart system (harness FT-3)"},"chart-dep":{counts:"a chart library declared in package.json",instead:"remove the dependency once nothing imports it (harness FT-3)"},"ellipsis-label":{counts:'a button, link or menu label that ends in "…" or "..."',instead:'the label without the dots, saying what it does ("Extend trial"): "…" means only "the words are cut" (owner ruling 2026-10-14)'},colour:{counts:"a literal colour, in a script string or a stylesheet: a hex, an rgb() / hsl() / oklch() value, a Tailwind palette class (a hue and a step, or white / black), a --color-<hue>-<step> variable, or a named colour in a colour property — a var() fallback included",instead:"a colour role from efficient-shell: its utility (the text, background or border utility of ink, ink-faint, surface, line, accent-fill, accent-text, danger-text, status-danger-line …) or var(--role); COLOUR_ROLES lists them. A merchant site reads the site theme (owner ruling 2026-10-23)"},"gutter-literal":{counts:"the site gutter typed with its own fallback, var(--sf-site-gutter, 40px), in script source (stylesheets are not read)",instead:"SITE_GUTTER_CLASS from efficient-web-builder (lib/content/page-width): the whole class, because Tailwind reads only whole literals; SITE_GUTTER_CAP for the number"},"view-line-literal":{counts:"the 960px written as a length in script source (a max-/min- variant, a media query; a sizes string counts here too)",instead:"the view-lines table in efficient-web-builder (lib/content/view-lines, lib/content/box-stack-line)"},"route-literal":{counts:"a page path typed by hand before a slug: /wheels/, /journal/, /tyres/",instead:"pagePath, postPath or wheelPath from efficient-web-builder (lib/links/page-link-rules), tyrePagePath from efficient-storefront-blocks (render/lib/tyres/tyre-page-path)"},"root-zone-literal":{counts:'the easel root zone key typed as a string ("root:default-zone")',instead:"ROOT_ZONE from efficient-easel (screen/lib/document/content-tree)"},"phone-query":{counts:"the app phone line typed as a media query in script source: (max-width: 767px)",instead:"useIsMobile from efficient-shell: ask the hook, do not write the query"},"sizes-literal":{counts:"a hand-written responsive sizes string (a sizes attribute or sizes: entry with a media condition)",instead:"a named sizes shape from efficient-web-builder (lib/sized-image), built from the view lines"},"money-cents":{counts:"a money amount (amount, price, total, cents, fee, cost, balance) multiplied or divided by 100 by hand",instead:"createMoneyFormatter / useCurrency from efficient-storefront-blocks (render/components/CurrencyContext) for a shopper; formatMoney / currencyDecimals from efficient-shell for the ERP"},"local-helper":{counts:"a local definition (function or const) of a helper a package exports, by name: escapeHtml, deepEqual, timeAgo, formatBytes, hexToRgb and the rest of LOCAL_HELPERS",instead:"import the helper from its home (LOCAL_HELPERS in efficient-shell src/ui-check/kinds.ts names each one)"},"dialog-frame":{counts:"a className on a shell Dialog, PopupForm or ConfirmDialog that redraws its frame: a zero padding, no width or height cap, or a screen-sized or calc() width or height",instead:'a Dialog size: size="full" for a chooser laid out like a window (head bar, body that fills and scrolls), with headerActions for buttons beside the cross'},"scaled-frame":{counts:"a drawing scaled from the top left by hand: a top-left transform origin as a style key or a DOM write (transformOrigin = top left, left top, 0 0, 0% 0%, 0px 0px), in CSS text inside a string, or as the Tailwind origin class for the top left (named or an arbitrary zero)",instead:"FitFrame (a preview drawn at a logical size), or fitScale / fitBoxScale / fitFrameStyle, from efficient-shell/ui: the one home of the fit (harness ARCH-3)"},"deprecated-undated":{counts:'a @deprecated note (a block comment, or a run of whole-line comments) that does not say "delete by YYYY-MM-DD" with a real day from today to 6 months out, or that still says "next major"',instead:'write the day the thing goes ("Delete by 2026-12-15, after <the move>") and a backlog line that owns the move; on that day delete it, or set a new day with the reason'}},w={escapeHtml:"efficient-shell (utils/escapeHtml)",deepEqual:"efficient-easel (data)",draftsEqual:"efficient-easel deepEqual (data)",timeAgo:"efficient-shell (format)",formatBytes:"efficient-shell (format)",formatFileSize:"efficient-shell formatBytes (format)",fileSize:"efficient-shell formatBytes (format)",humanSize:"efficient-shell formatBytes (format)",hexToRgb:"efficient-shell (forms/color)",parseHex:"efficient-shell parseHexColor (forms/color)",parseHexColor:"efficient-shell (forms/color)",hexOf:"efficient-shell parseHexColor (forms/color)",withAlpha:"efficient-shell hexWithAlpha (forms/colorMix)",isDarkInk:"efficient-shell readableInk (forms/color)",relativeLuminance:"efficient-shell (forms/color)",contrastRatio:"efficient-shell (forms/color)"},$=["@headlessui/","@radix-ui/","@mui/","@chakra-ui/","@mantine/","@floating-ui/","antd","react-aria","react-aria-","react-bootstrap","react-select","react-colorful","react-tooltip","react-hot-toast","react-toastify","sonner","efficient-shell-checker"],x=["@heroicons/","@tabler/icons","@tabler/icons-","@phosphor-icons/","@fortawesome/","@iconify/","@radix-ui/react-icons","@mui/icons-material","lucide","lucide-react","simple-icons","react-icons","react-feather"],k=["recharts","chart.js","react-chartjs-2","d3","d3-","@nivo/","victory","victory-","echarts","echarts-for-react","apexcharts","react-apexcharts","@visx/","highcharts","highcharts-react-official","plotly.js","plotly.js-dist","react-plotly.js","lightweight-charts","@antv/g2","@antv/g2plot","chartist","billboard.js","c3","uplot"],b={"efficient-shell":["@headlessui/react"]};function y(e,t){return t.some(t=>t.endsWith("/")||t.endsWith("-")?e.startsWith(t):e===t||e.startsWith(`${t}/`))}function v(e){return y(e,x)?"icon":y(e,$)?"kit":y(e,k)?"chart":null}function S(e){const t=v(e);return"kit"===t||"icon"===t?"kit-dep":"chart"===t?"chart-dep":null}var E=/[.+^$()|[\]\\]/g;function j(e){let t="",n=0;for(let i=0;i<e.length;i++){const o=e[i];"*"===o?"*"===e[i+1]?"/"===e[i+2]?(t+="(?:[^/]+/)*",i+=2):(t+=".*",i+=1):t+="[^/]*":"?"===o?t+="[^/]":"{"===o?(t+="(?:",n+=1):"}"===o&&n>0?(t+=")",n-=1):t+=","===o&&n>0?"|":o.replace(E,"\\$&")}if(0!==n)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${t}$`)}function z(e){const t=e.map(j);return e=>t.some(t=>t.test(e))}var I=new Set(["node_modules",".git"]),T=new Set(["dist","coverage",".next",".turbo"]);function A(e){const t=e.search(/[*?{]/),n=-1===t?e:e.slice(0,t),i=n.lastIndexOf("/");return-1===i?"":n.slice(0,i)}function C(e,t){const i=z(t),o=[...new Set(t.map(A))].sort(),s=o.filter(e=>!o.some(t=>t!==e&&(""===t||e.startsWith(`${t}/`)))),r=new Set,l=t=>{let o;try{o=a(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?I.has(e.name)||""===t&&T.has(e.name)||l(n):e.isFile()&&i(n)&&r.add(n)}};for(const e of s)l(e);return[...r].sort(R)}var R=(e,t)=>e<t?-1:e>t?1:0,M=class extends Error{},N=(e,t)=>`${e}:${t}`;function L(e){const t=e.lastIndexOf(":");return{file:e.slice(0,t),kind:e.slice(t+1)}}var D=e=>c.indexOf(e);function B(e,t){const n=L(e),i=L(t);return R(n.file,i.file)||D(n.kind)-D(i.kind)}function O(e,t="ui-kit.baseline.json"){let n;try{n=JSON.parse(e)}catch(e){throw new M(`${t} is not valid JSON: ${e.message}`)}const i=e=>{throw new M(`${t}: ${e}. The tool writes this file; do not edit it by hand.`)};if("object"!=typeof n||null===n||Array.isArray(n))return i("must be a JSON object");const o=n;if(1!==o.schema)return i("number"==typeof o.schema&&o.schema>1?`"schema": ${o.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');if(!Array.isArray(o.kinds)||o.kinds.some(e=>"string"!=typeof e))return i('"kinds" must be a list');const s=o.kinds.filter(d);if("object"!=typeof o.counts||null===o.counts||Array.isArray(o.counts))return i('"counts" must be an object');const r=new Map;for(const[e,t]of Object.entries(o.counts)){const{file:n,kind:o}=L(e);if(!n||!o)return i(`"${e}" is not "<file>:<kind>"`);if("number"!=typeof t||!Number.isInteger(t)||t<1)return i(`"${e}" must be a whole number, 1 or more (a line that reaches 0 is deleted)`);d(o)&&r.set(e,t)}return{kinds:s,counts:r}}function P(e){const t=c.filter(t=>e.kinds.includes(t)),n=[...e.counts.keys()].filter(t=>(e.counts.get(t)??0)>0).sort(B).map(t=>` ${JSON.stringify(t)}: ${e.counts.get(t)}`);return["{",' "schema": 1,',` "kinds": [${t.map(e=>JSON.stringify(e)).join(", ")}],`,n.length?` "counts": {\n${n.join(",\n")}\n }`:' "counts": {}',"}",""].join("\n")}function F(e){const t={};for(const[n,i]of e){const{kind:e}=L(n);d(e)&&(t[e]=(t[e]??0)+i)}return t}var U=class extends Error{},_=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),J=new Set(["$schema","schema","kinds","include","exclude","includeImporting","output","includeCopies","allow"]);function q(e,t="ui-kit.config.json"){const n=[],i=e=>{n.push(e)},o=(e,t,{required:n=!1}={})=>{if(void 0===e&&!n)return[];if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||""===e))return i(`${t} must be a list of non-empty strings`),[];n&&0===e.length&&i(`${t} must name at least one entry`);for(const n of e)(n.startsWith("/")||n.startsWith("./")||n.includes("\\")||n.split("/").includes(".."))&&i(`${t}: "${n}" must be a path from the repository root, written with / (no ./, .. or \\)`);return e},s=(e,t)=>"string"!=typeof e||e.trim().length<10?(i(`${t} needs a "reason" a reviewer can read (a sentence, not a word)`),""):e,r=(e,t)=>void 0===e?[]:!Array.isArray(e)||e.some(e=>!_(e))?(i(`${t} must be a list of objects`),[]):e;if(!_(e))throw new U(`${t}: must be a JSON object`);for(const t of Object.keys(e))J.has(t)||i(`unknown key "${t}"`);1!==e.schema&&i("number"==typeof e.schema&&e.schema>1?`"schema": ${e.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');const a=[];if(Array.isArray(e.kinds)&&0!==e.kinds.length)for(const t of e.kinds)d(t)?a.includes(t)?i(`"kinds": "${t}" is listed twice`):a.push(t):i(`"kinds": unknown kind ${JSON.stringify(t)} (this efficient-shell knows: ${c.join(", ")})`);else i(`"kinds" must list the kinds this repository checks, from: ${c.join(", ")}`);const l=o(e.include,'"include"'),u=o(e.exclude,'"exclude"'),h=r(e.includeImporting,'"includeImporting"').map((e,t)=>({files:o(e.files,`"includeImporting"[${t}].files`,{required:!0}),modules:o(e.modules,`"includeImporting"[${t}].modules`,{required:!0}),reason:s(e.reason,`"includeImporting"[${t}]`)}));0===l.length&&0===h.length&&i('"include" must name the files that are operator UI (for example ["src/**/*.tsx"])');const f=r(e.output,'"output"').map((e,t)=>({files:o(e.files,`"output"[${t}].files`,{required:!0}),reason:s(e.reason,`"output"[${t}]`)})),g=o(e.includeCopies,'"includeCopies"');g.length&&!a.some(m)&&i(`"includeCopies" is read only by the copied-value kinds (${p.join(", ")}), and "kinds" names none of them`);const w=[],$=new Set;if(r(e.allow,'"allow"').forEach((e,t)=>{const n=`"allow"[${t}]`,[r]=o([e.file],`${n}.file`),l=s(e.reason,n);if(!d(e.kind))return void i(`${n}.kind must be one of: ${c.join(", ")}`);if(a.includes(e.kind)||i(`${n}: kind "${e.kind}" is not in "kinds"`),"number"!=typeof e.count||!Number.isInteger(e.count)||e.count<1)return void i(`${n}.count must be a whole number, 1 or more`);if(!r)return;const u=`${r}:${e.kind}`;$.has(u)&&i(`${n}: ${r} already has an allow entry for "${e.kind}"`),$.add(u),w.push({file:r,kind:e.kind,count:e.count,reason:l})}),n.length)throw new U(`${t}:\n - ${n.join("\n - ")}`);return{schema:1,kinds:c.filter(e=>a.includes(e)),include:l,exclude:u,includeImporting:h,output:f,includeCopies:g,allow:w}}var W="package.json",H=[2,4,8,12,16,20,24,32,40,48];function G(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&H.includes(4*t)}var Y=e=>String(e).padStart(2,"0"),K=/^(\d{4})-(\d{2})-(\d{2})$/;function V(e){return`${function(e){return`${e.getFullYear()}-${Y(e.getMonth()+1)}`}(e)}-${Y(e.getDate())}`}function Z(e){const t="string"==typeof e?K.exec(e):null;if(!t)return null;const n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return V(n)===e?n:null}var Q=new Set(["iframe","frame","object","embed"]),X=new Set(["href","xlinkHref","to","id","key","htmlFor"]),ee=/(?<![&\w])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,te=/(?<![\w-])rounded(?:-(?:[trblse]|tl|tr|br|bl|ss|se|ee|es))?-\[([^\]]*)\]/g,ne=/^border(?:(?:Top|Bottom)(?:Left|Right)|(?:Start|End)(?:Start|End))?Radius$/,ie=/^(?:inherit|initial|unset|revert)$|var\(|^(?:50|100)%$|^(?:999|9999)(?:px)?$/,oe=/(?<![\w-])-?(?:p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|space-x|space-y)-(\d+(?:\.\d+)?|px|\[[^\]]*\])(?![\w.[/-])/g,se=/(?<![\w-])text-\[(?:length:)?(\d*\.?\d+(?:px|rem|em|%))\]/g,re=/(?<![\w-])z-(\d+|\[[^\]]*\])(?![\w.[/-])/g,ae=/(?<![\w-])shadow-(xs|2xs|md|2xl|\[[^\]]*\])(?![\w.[/-])/g,le=/var\(|^(?:inherit|initial|unset|revert|revert-layer|none|auto)$/,ce=/^(?:(?:padding|margin)(?:Top|Right|Bottom|Left|Inline|Block|InlineStart|InlineEnd|BlockStart|BlockEnd)?|gap|rowGap|columnGap)$/,de=new Set([0,...H]),ue=/var\(\s*--sf-site-gutter\s*,\s*-?\d/g,he=/(?<![\w.-])960px(?![\w-])/g,fe=/(?:^|[^\w-])\/(?:wheels|journal|tyres)\/$/,pe=/root:default-zone/g,me="top left|left top|0 0|0% 0%|0px 0px",ge=new RegExp(`^\\s*(?:${me})\\s*$`),we=(...e)=>["origin",...e].join("-"),$e=new RegExp([`(?:transformOrigin|transform-origin)\\s*[:=]\\s*["'\`]?\\s*(?:${me})(?![\\w%-])`,`(?<![\\w-])!?${we("top","left")}(?![\\w-])`,`(?<![\\w-])!?${we("\\[0_0\\]")}`].join("|")),xe=/max-width:\s*767px(?![\w-])/g,ke=/\((?:max|min)-width/,be=/(?:^|[a-z0-9_])(?:amount|price|total|subtotal|cents|fee|fees|cost|balance)$|(?:Amount|Price|Total|Subtotal|Cents|Fee|Fees|Cost|Balance)$/,ye=/(?<![\w-])dark:(?=[\w[\-!@*(])/g,ve="slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose",Se="(?:50|[1-9]00|950)",Ee=new RegExp(`(?<![\\w-])(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|inset-ring|outline|divide|fill|stroke|from|via|to|shadow|inset-shadow|drop-shadow|accent|caret|decoration|placeholder)-(?:(?:${ve})-${Se}|white|black)(?:\\/[\\w.]+)?(?![\\w-])`,"g"),je=new RegExp(`--color-(?:(?:${ve})-${Se}|white|black)(?![\\w-])`,"g"),ze=/(?<![\w-])(?:rgba?|hsla?|hwb|oklch|oklab|lab|lch)\(\s*[\d.]/g,Ie=/(?<![\w-])(?:white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|maroon|navy|teal|olive|lime|aqua|fuchsia|brown|gold|beige|ivory|tan|crimson|coral|salmon|indigo|violet)(?![\w-])/gi,Te=/^(?:color|background(?:Color)?|border(?:Top|Right|Bottom|Left|Inline|Block)?(?:Color)?|outline(?:Color)?|fill|stroke|caretColor|accentColor|textDecorationColor|boxShadow|textShadow)$/,Ae=/(?<![&a-zA-Z0-9])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,Ce=e=>[...e.matchAll(Ae)].length+[...e.matchAll(ze)].length+[...e.matchAll(Ee)].length+[...e.matchAll(je)].length,Re=new Set(["button","a","option","Button","IconButton","SplitButton","Link","NavLink","PopupMenuItem","PopupMenuLabel","DropdownMenuItem","MenuItem","ContextMenuItem"]),Me=/(?:…|\.\.\.|&hellip;)\s*$/,Ne=new RegExp("\\p{L}","u"),Le=new RegExp("\\p{L}[\\p{L}-]*","u"),De={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"],zhStarts:["正在"],zhEnds:["中"]},placeholder:{},prompt:{}},Be=new Set((De.busy?.words??[]).map(e=>e.toLowerCase())),Oe=new Set(["label","aria-label",...De.placeholder?[]:["placeholder","searchPlaceholder","emptyOptionLabel","blankLabel"]]),Pe=(e,t)=>{if(!Me.test(t)||!Ne.test(e))return!1;const n=e.match(Le)?.[0]?.toLowerCase();if(n&&Be.has(n))return!1;const i=e.replace(Me,"").trim(),o=De.busy;return!(o&&(o.zhStarts.some(e=>i.startsWith(e))||o.zhEnds.some(e=>i.endsWith(e))))},Fe=new Set(["confirm","alert","prompt"]),Ue=new Set(["window","globalThis","self"]),_e=/^(?:\w+\.)?(?:Dialog|PopupForm|ConfirmDialog)$/,Je=(...e)=>e.join("-"),qe="vw|vh|dvw|dvh|svw|svh|lvw|lvh",We=[`${Je("p[xytrblse]?","")}(?:0|\\[0(?:px)?\\])`,`${Je("max","[wh]","")}(?:none|screen|full|\\[[^\\]]+\\])`,`${Je("h","")}(?:full|screen|${qe})`,`${Je("w","")}(?:screen|${qe})`,`${Je("[wh]","")}\\[[^\\]]*(?:\\d(?:${qe}|%)|calc\\()[^\\]]*\\]`,`${Je("min","h","")}(?:screen|${qe}|\\[[^\\]]+\\])`],He=new RegExp(`(?<![\\w-])!?(?:${We.join("|")})(?![\\w.-])`);var Ge=e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"),Ye=e=>/\.(?:css|scss)$/.test(e),Ke=/^(?:color|background(?:-color)?|border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?(?:-color)?|outline(?:-color)?|fill|stroke|caret-color|accent-color|text-decoration(?:-color)?|box-shadow|text-shadow|column-rule(?:-color)?)$/;function Ve(e,t){if(!t.includes("colour"))return{};const n=e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g," ")),i=[],o=e=>n.slice(0,e).split("\n").length;let s=0,r=0;for(let e=0;e<n.length;e++){const t=n[e];if("{"===t||"}"===t||";"===t){const a=n.slice(r,e);if("{"!==t&&s>0){const e=r+(a.length-a.trimStart().length),t=a.trim(),n=t.indexOf(":");if(t.startsWith("@apply"))for(let n=[...t.matchAll(Ee)].length;n>0;n--)i.push(o(e));else if(n>0){const s=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1);if(!/^(?:-webkit-)?mask/.test(s)){const t=Ce(r)+(Ke.test(s)?[...r.matchAll(Ie)].length:0);for(let n=0;n<t;n++)i.push(o(e))}}}"{"===t?s++:"}"===t&&(s=Math.max(0,s-1)),r=e+1}}return i.length?{colour:i}:{}}function Ze(e,t,n,i,o){const s=new Set(i),r=e.createSourceFile(t,n,e.ScriptTarget.Latest,!0,function(e,t){return t.endsWith(".tsx")?e.ScriptKind.TSX:t.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(t)?e.ScriptKind.JS:e.ScriptKind.TS}(e,t)),a={},l=/\.[jt]sx$/.test(t),c=e=>r.getLineAndCharacterOfPosition(e).line+1,d=(e,t)=>{s.has(e)&&(a[e]??=[]).push(c(t.getStart(r)))},u=(t,n)=>t.attributes.properties.find(t=>e.isJsxAttribute(t)&&t.name.getText(r)===n),h=t=>{const n=t?.initializer;if(n)return e.isStringLiteral(n)?n.text:e.isJsxExpression(n)&&n.expression&&e.isStringLiteralLike(n.expression)?n.expression.text:void 0},f=new Set;if(s.has("native")){const t=n=>{if(n)if(e.isIdentifier(n))Fe.has(n.text)&&f.add(n.text);else if(e.isObjectBindingPattern(n)||e.isArrayBindingPattern(n))for(const i of n.elements)e.isBindingElement(i)&&t(i.name)},n=i=>{(e.isImportClause(i)||e.isImportSpecifier(i)||e.isNamespaceImport(i)||e.isVariableDeclaration(i)||e.isParameter(i)||e.isFunctionDeclaration(i))&&t(i.name),e.forEachChild(i,n)};n(r)}const p=t=>t&&e.isStringLiteralLike(t)?t.text:void 0,m=(e,t)=>{e&&("efficient-shell"===e||e.startsWith("efficient-shell/"))&&o?.add(e);const n=e?v(e):null;n&&d(n,t)},g=(e,t,n)=>{if(s.has("dark"))for(const n of e.matchAll(ye))d("dark",t);if(s.has("radius"))for(const n of e.matchAll(te))ie.test(n[1].trim())||d("radius",t);if(n&&l&&s.has("hex"))for(const n of e.matchAll(ee))d("hex",t);if(n&&s.has("colour"))for(let n=Ce(e);n>0;n--)d("colour",t);if(s.has("spacing"))for(const n of e.matchAll(oe)){const e=n[1];(e.startsWith("[")?le.test(e.slice(1,-1).trim()):G(e))||d("spacing",t)}if(s.has("font-size"))for(const n of e.matchAll(se))d("font-size",t);if(s.has("z-index"))for(const n of e.matchAll(re)){const e=n[1].startsWith("[")?n[1].slice(1,-1).trim():n[1];/^\d+$/.test(e)&&Number(e)>30&&d("z-index",t)}if(s.has("shadow"))for(const n of e.matchAll(ae))n[1].startsWith("[")&&le.test(n[1].slice(1,-1).trim())||d("shadow",t);if(s.has("gutter-literal"))for(const n of e.matchAll(ue))d("gutter-literal",t);if(s.has("view-line-literal"))for(const n of e.matchAll(he))d("view-line-literal",t);if(s.has("route-literal")&&fe.test(e)&&d("route-literal",t),s.has("root-zone-literal"))for(const n of e.matchAll(pe))d("root-zone-literal",t);if(s.has("phone-query"))for(const n of e.matchAll(xe))d("phone-query",t);s.has("scaled-frame")&&$e.test(e)&&d("scaled-frame",t)},$=t=>{if(t)return e.isJsxExpression(t)?$(t.expression):e.isStringLiteralLike(t)?t.text:e.isTemplateExpression(t)?[t.head.text,...t.templateSpans.map(e=>e.literal.text)].join(" "):void 0},x=t=>e.isNumericLiteral(t)&&100===Number(t.text),k=(t,n,i)=>{const o=e.isStringLiteralLike(n)?n.text.trim():void 0;if(s.has("colour")&&void 0!==o&&Te.test(t))for(const e of o.matchAll(Ie))d("colour",i);if(s.has("spacing")&&ce.test(t))e.isNumericLiteral(n)?de.has(Number(n.text))||d("spacing",i):void 0!==o&&!le.test(o)&&(e=>[...e.matchAll(/(-?\d*\.?\d+)(px|rem|em)\b/g)].map(e=>Math.abs(Number(e[1]))*("px"===e[2]?1:16)))(o).some(e=>!de.has(e))&&d("spacing",i);else if(s.has("font-size")&&"fontSize"===t)(e.isNumericLiteral(n)||void 0!==o&&!le.test(o)&&!/^(?:smaller|larger)$/.test(o))&&d("font-size",i);else if(s.has("z-index")&&"zIndex"===t){const t=[],o=n=>{e.isNumericLiteral(n)||e.isStringLiteralLike(n)&&/^\d+$/.test(n.text.trim())?t.push(Number(n.text)):e.forEachChild(n,o)};o(n);for(const e of t)e>30&&d("z-index",i)}else s.has("shadow")&&"boxShadow"===t&&(void 0===o||""===o||le.test(o)||d("shadow",i))},b=(t,n)=>{if(e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)){const e=t.tagName.getText(r);if(s.has("sizes-literal")){const e=$(u(t,"sizes")?.initializer);void 0!==e&&ke.test(e)&&d("sizes-literal",t)}if(s.has("dialog-frame")&&_e.test(e)){const e=u(t,"className")?.initializer?.getText(r);void 0!==e&&He.test(e)&&d("dialog-frame",t)}if(/^[a-z]/.test(e)){const n=h(u(t,"type"));"svg"===e&&d("svg",t),"button"===e?d("button",t):"select"===e?d("select",t):"textarea"===e?d("textarea",t):"input"===e&&("range"===n?d("range",t):"hidden"!==n&&d("input",t));const i=h(u(t,"role"));"dialog"!==e&&"dialog"!==i&&"alertdialog"!==i||d("dialog",t),!Q.has(e)&&u(t,"title")&&d("title",t)}}else if(e.isCallExpression(t)){const n=t.expression;e.isIdentifier(n)?"createPortal"===n.text?d("portal",t):Fe.has(n.text)&&!f.has(n.text)?d("native",t):"require"===n.text&&m(p(t.arguments[0]),t):e.isPropertyAccessExpression(n)?"createPortal"===n.name.text?d("portal",t):Fe.has(n.name.text)&&e.isIdentifier(n.expression)&&Ue.has(n.expression.text)&&d("native",t):n.kind===e.SyntaxKind.ImportKeyword&&m(p(t.arguments[0]),t)}else{if(e.isImportDeclaration(t)||e.isExportDeclaration(t))return void m(p(t.moduleSpecifier),t);if(e.isPropertyAssignment(t)){const n=e.isIdentifier(t.name)||e.isStringLiteralLike(t.name)?t.name.text:"",i=t.initializer;if(k(n,i,t),s.has("scaled-frame")&&"transformOrigin"===n){const e=$(i);void 0!==e&&ge.test(e)&&d("scaled-frame",t)}if(s.has("sizes-literal")&&"sizes"===n){const e=$(i);void 0!==e&&ke.test(e)&&d("sizes-literal",t)}s.has("radius")&&ne.test(n)&&(e.isNumericLiteral(i)?ie.test(i.text)||d("radius",t):e.isStringLiteralLike(i)&&!ie.test(i.text.trim())&&d("radius",t))}else if(e.isBinaryExpression(t)){const n=t.operatorToken.kind;if(s.has("scaled-frame")&&n===e.SyntaxKind.EqualsToken&&e.isPropertyAccessExpression(t.left)&&"transformOrigin"===t.left.name.text){const e=$(t.right);void 0!==e&&ge.test(e)&&d("scaled-frame",t)}if(s.has("money-cents")&&(n===e.SyntaxKind.AsteriskToken||n===e.SyntaxKind.SlashToken)){const i=x(t.right)?t.left:x(t.left)&&n===e.SyntaxKind.AsteriskToken?t.right:void 0,o=i&&(t=>{let n=t;for(;e.isParenthesizedExpression(n)||e.isNonNullExpression(n)||e.isAsExpression(n);)n=n.expression;return e.isCallExpression(n)&&(n=n.expression),e.isIdentifier(n)?n.text:e.isPropertyAccessExpression(n)?n.name.text:e.isElementAccessExpression(n)&&e.isStringLiteralLike(n.argumentExpression)?n.argumentExpression.text:void 0})(i);o&&be.test(o)&&d("money-cents",t)}}else if(s.has("local-helper")&&(e.isFunctionDeclaration(t)||e.isVariableDeclaration(t))&&t.name&&e.isIdentifier(t.name)&&Object.prototype.hasOwnProperty.call(w,t.name.text)&&(e.isFunctionDeclaration(t)?void 0!==t.body:void 0!==t.initializer&&(e.isArrowFunction(t.initializer)||e.isFunctionExpression(t.initializer))))d("local-helper",t);else if(e.isStringLiteralLike(t))g(t.text,t,n);else if(e.isTemplateExpression(t)){g(t.head.text,t.head,n);for(const e of t.templateSpans)g(e.literal.text,e.literal,n)}}e.isJsxAttribute(t)&&X.has(t.name.getText(r))?e.forEachChild(t,e=>b(e,!1)):e.forEachChild(t,e=>b(e,n))};if(b(r,!0),s.has("ellipsis-label")&&function(e,t,n){const i=new Set,o=(e,t)=>{i.has(e)||(i.add(e),n(t))},s=n=>{if(n)if(e.isStringLiteralLike(n))Pe(n.text,n.text)&&o(n,n.getStart(t));else if(e.isTemplateExpression(n)){const e=[n.head.text,...n.templateSpans.map(e=>e.literal.text)];Pe(e.join(" "),e[e.length-1])&&o(n,n.getStart(t))}else e.isConditionalExpression(n)?(s(n.whenTrue),s(n.whenFalse)):e.isBinaryExpression(n)?(s(n.left),s(n.right)):e.isParenthesizedExpression(n)||e.isAsExpression(n)||e.isJsxExpression(n)?s(n.expression):e.isCallExpression(n)&&nt.has(it(n.expression))&&n.arguments[0]&&s(n.arguments[0])},r=n=>{for(const i of n)if(e.isJsxText(i)){const e=i.getText(t);Pe(e,e)&&o(i,i.getStart(t)+(e.length-e.trimStart().length))}else e.isJsxExpression(i)?s(i.expression):(e.isJsxElement(i)||e.isJsxFragment(i))&&r(i.children)},a=(n,i)=>{const o=n.attributes.properties.find(n=>e.isJsxAttribute(n)&&n.name.getText(t)===i),s=o?.initializer;return s&&e.isStringLiteral(s)?s.text:s&&e.isJsxExpression(s)&&s.expression&&e.isStringLiteralLike(s.expression)?s.expression.text:void 0},l=t=>t.properties.some(t=>e.isPropertyAssignment(t)&&(e.isIdentifier(t.name)||e.isStringLiteralLike(t.name))&&"value"===t.name.text&&e.isStringLiteralLike(t.initializer)&&""===t.initializer.text),c=n=>{if(e.isJsxElement(n)){const e=n.openingElement,i=e.tagName.getText(t),o="option"===i&&De.prompt&&""===a(e,"value");Re.has(i)&&!o&&r(n.children)}else if(e.isJsxAttribute(n))Oe.has(n.name.getText(t))&&s(n.initializer);else if(e.isPropertyAssignment(n)){const t=e.isIdentifier(n.name)||e.isStringLiteralLike(n.name)?n.name.text:"",i=De.prompt&&e.isObjectLiteralExpression(n.parent)&&l(n.parent);Oe.has(t)&&!i&&s(n.initializer)}e.forEachChild(n,c)};c(t)}(e,r,e=>(a["ellipsis-label"]??=[]).push(c(e))),s.has("deprecated-undated")){const t=V(new Date);for(const n of function(e,t){const n=t.text,i=new Map,o=e=>e?.forEach(e=>i.set(e.pos,e)),s=t=>{o(e.getLeadingCommentRanges(n,t.pos)),o(e.getTrailingCommentRanges(n,t.end)),e.forEachChild(t,s)};s(t),o(e.getLeadingCommentRanges(n,t.endOfFileToken.pos));const r=[],a=e=>/^[ \t]*$/.test(n.slice(n.lastIndexOf("\n",e-1)+1,e));for(const t of[...i.values()].sort((e,t)=>e.pos-t.pos)){const i=n.slice(t.pos,t.end);if(t.kind===e.SyntaxKind.MultiLineCommentTrivia){r.push({pos:t.pos,text:i,end:t.end,run:!1});continue}const o=a(t.pos),s=r[r.length-1];o&&s?.run&&/^[ \t]*\r?\n[ \t]*$/.test(n.slice(s.end,t.pos))?(s.text+="\n"+i,s.end=t.end):r.push({pos:t.pos,text:i,end:t.end,run:o})}return r}(e,r)){const e=n.text.indexOf("@deprecated");e>=0&&tt(n.text,t)&&(a["deprecated-undated"]??=[]).push(c(n.pos+e))}}return a}var Qe=/\b(?:delete|deleted|remove|removed|goes|go)\s+(?:[\w`'.-]+\s+){0,2}?by\s+(\d{4}-\d{2}-\d{2})\b/i,Xe=/next\s+major|major\s+after/i,et=6;function tt(e,t){const n=e.replace(/^\s*(?:\/\*\*?|\*\/|\*|\/\/)\s?/gm,"");if(Xe.test(n))return'it still says "next major": the delete day is the only promise';const i=Qe.exec(n);if(!i)return'no delete day ("delete by YYYY-MM-DD")';const o=Z(i[1]);if(!o)return`${i[1]} is not a day`;const s=Z(t);if(!s)throw new Error(`today must be YYYY-MM-DD, got ${t}`);if(o<s)return`its delete day ${i[1]} is past`;const r=function(e,t){const n=new Date(e.getFullYear(),e.getMonth()+t,1),i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),i))}(s,et);return o>r?`its delete day ${i[1]} is more than ${et} months out (last ${V(r)})`:void 0}var nt=new Set(["say","t"]),it=e=>{const t=e.getText();return t.slice(t.lastIndexOf(".")+1)};function ot(e){const t={};for(const[n,i]of Object.entries(e))i.length&&(t[n]=i.length);return t}var st=(e,t,n,i)=>function(e,t,n){const i=e.createSourceFile(t,n,e.ScriptTarget.Latest,!1),o=[];for(const t of i.statements)(e.isImportDeclaration(t)||e.isExportDeclaration(t))&&t.moduleSpecifier&&e.isStringLiteralLike(t.moduleSpecifier)&&o.push(t.moduleSpecifier.text);return o}(e,t,n).some(e=>i.some(t=>t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t));var rt=e=>new Map(e.allow.map(e=>[N(e.file,e.kind),e.count]));function at(e,t){return e.kinds.filter(e=>t.kinds.includes(e))}var lt=(e,t,n)=>{if("kit-dep"===n)return` (${e.kitDeps.join(", ")})`;if("chart-dep"===n)return` (${e.chartDeps.join(", ")})`;const i=e.hits.get(t)?.[n]??[];if(0===i.length)return"";const o=i.slice(0,12).join(", ");return` (line${1===i.length?"":"s"} ${o}${i.length>12?", …":""})`};function ct(e,t,n){const i=rt(e),o=new Map;for(const[e,s]of t.counts){const{kind:t}=L(e);if(!d(t)||!n.includes(t))continue;const r=s-(i.get(e)??0);r>0&&o.set(e,r)}return{kinds:c.filter(e=>n.includes(e)),counts:o}}function dt(e,t){let n=0;for(const i of new Set([...e.keys(),...t.keys()]))(e.get(i)??0)!==(t.get(i)??0)&&(n+=1);return n}var ut="\n// <button> in a comment is not a button, and <svg> in one is not a drawing\n/* nor is <input title=\"x\"> in this one, or dark:bg-black, or #fff */\nimport { createPortal } from 'react-dom';\nimport { Dialog } from '@headlessui/react';\nimport { TrashIcon } from '@heroicons/react/24/outline';\nimport type { Icon } from 'lucide-react';\nimport { Button, confirm } from 'efficient-shell';\nexport { Slot } from '@radix-ui/react-slot';\nexport { CheckIcon } from '@radix-ui/react-icons';\nimport { LineChart } from 'recharts';\nimport 'd3-scale';\nexport { VictoryPie } from 'victory';\nimport { BarChart } from '@mui/x-charts';\nimport Tree from 'react-d3-tree';\nimport { TimeSeriesChart } from 'efficient-shell/ui';\n// import 'chart.js' in a comment is not an import, and 'echarts' in a string is not one either\nconst chartLabel = 'd3-array';\n\nconst a = <button title=\"Says what it does\">x</button>;\nconst b = <input type=\"range\" />;\nconst c = <input type=\"text\" />;\nconst c2 = <input type={\"hidden\"} name=\"csrf\" />;\nconst c3 = <input type=\"hidden\" />;\nconst c4 = <input type={kind} />;\nconst d = <select />;\nconst d2 = <textarea />;\nconst e = <div role=\"dialog\" />;\nconst e2 = <dialog open />;\nconst e3 = <section role={'alertdialog'} />;\nconst f = <iframe title=\"Preview\" />;\nconst f2 = <object title=\"Chart\" />;\nconst g = <Button title=\"a prop, not a tooltip\" role=\"dialog\" />;\nconst g2 = (\n <button\n type=\"button\"\n title={hint}\n >\n y\n </button>\n);\nconst h = ReactDOM.createPortal(a, document.body);\nconst i = createPortal(a, document.body);\n\nasync function leave() {\n if (window.confirm('Sure?')) return;\n globalThis.alert('No');\n alert('native: nothing binds the name');\n prompt('native too');\n await confirm('the shell: the import binds it');\n record.confirm('a method, not the popup');\n}\n\nconst j = <div className=\"bg-white dark:bg-black dark:hover:text-white is-dark:no\" />;\nconst k = clsx('text-gray-900', on && 'dark:text-gray-100');\nconst l = <span style={{ color: '#fff', background: \"#12ab34\" }} className={`border-[#0a0b0c80] ${x}`} />;\nconst m = <a href=\"#faded\" id=\"#bad\" key=\"#abc\" to=\"#face\">skip</a>;\nconst n = <label htmlFor={'#dead'}>skip</label>;\nconst o = <span>&#1234; and BG#00340 and #12345 and #added are not colours</span>;\nconst p = 'entity &#x1f; ref BG#00340';\nconst q = <use xlinkHref=\"#abc\" fill=\"url(#fed)\" />;\nconst t = <div className=\"rounded-[4px] rounded-t-[0.5rem] hover:rounded-[2px] rounded-lg rounded-(--radius-card) rounded-[inherit] rounded-[var(--r)]\" />;\nconst u = <div style={{ borderRadius: 6, borderTopLeftRadius: '3px', borderBottomRightRadius: '50%', borderEndEndRadius: 'var(--radius-card)' }} />;\nconst v = <i style={{ borderRadius: 9999 }} />;\nconst w = <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 4h16\" /></svg>;\nconst w2 = <Svg viewBox=\"0 0 24 24\" />;\nconst w3 = '<svg viewBox=\"0 0 1 1\"></svg> in a string is not an element';\nconst r = lazy(() => import('@mui/material'));\nconst s = require('react-select');\nconst s2 = require('chart.js/auto');\nconst s3 = import('@nivo/line');\n",ht={button:2,input:2,range:1,textarea:1,select:1,dialog:3,title:2,portal:2,native:4,dark:3,hex:3,radius:5,kit:5,icon:3,svg:1,chart:5,colour:8},ft={kit:1,dark:1,portal:1,radius:2,chart:1,colour:2},pt=(...e)=>e.join("-"),mt=`\nconst s1 = <i className="${[pt("px","2.5"),pt("py","1.5"),"md:"+pt("gap","1.5"),"-"+pt("mt","1.5"),pt("p","[10px]")].join(" ")}" />;\nconst s2 = <i className="${[pt("p","0"),pt("px","px"),pt("p","0.5"),pt("p","3"),pt("gap-x","4"),pt("p","12"),pt("p","(--space-12)"),pt("p","[var(--space-12)]"),pt("space-x","reverse"),pt("top","1.5")].join(" ")}" />;\nconst s3 = <i style={{ padding: 6, marginTop: '10px', gap: 8, margin: '0 auto', paddingInline: 'var(--space-12)' }} />;\nconst f1 = <i className="${[pt("text","[11px]"),pt("text","[0.8rem]"),pt("text","xs"),pt("text","[#fff]"),pt("text","(--text-2xs)")].join(" ")}" />;\nconst f2 = <i style={{ fontSize: 12 }} />;\nconst f3 = { fontSize: 'var(--x)', font: 'inherit' };\nconst z1 = <i className="${[pt("z","[9999]"),pt("z","50"),pt("z","10"),pt("z","30"),"-"+pt("z","10"),pt("z","auto"),pt("z","(--z-popup)"),pt("z","[var(--z-popup)]")].join(" ")}" />;\nconst z2 = { zIndex: on ? 2020 : 2010 };\nconst z3 = { zIndex: Z_LAYERS.popup, top: 9999 };\nconst h1 = <i className="${[pt("shadow","[0_1px_2px_#000]"),pt("shadow","md"),"shadow",pt("shadow","lg"),pt("shadow","(--elevation-panel)"),pt("shadow","black/20"),pt("drop-shadow","md")].join(" ")}" />;\nconst h2 = { boxShadow: '0 1px 2px rgba(0,0,0,.1)' };\nconst h3 = { boxShadow: 'none', outline: 'var(--elevation-raised)' };\n`,gt={spacing:7,"font-size":3,"z-index":4,shadow:3,hex:1,colour:4},wt={colour:4},$t={"ellipsis-label":9},xt=`\nconst d1 = <Dialog open size="2xl" className="${[pt("p","0"),pt("max-w","none")].join(" ")}" />;\nconst d2 = <PopupForm open className={\`${pt("w","[calc(100vw")}-2rem)] \${x}\`} />;\nconst d3 = <ui.Dialog open className="${pt("h","screen")}" />;\nconst d4 = <ConfirmDialog open className="${"!"+pt("max-h","none")}" />;\nconst d5 = <Dialog open className="${pt("w","[100vw]")}" />;\nconst d6 = <Dialog open className="${pt("h","[90vh]")}" />;\nconst d7 = <Dialog open className="${pt("max-w","[95vw]")}" />;\nconst d8 = <Dialog open className="${pt("h","dvh")}" />;\nconst d9 = <Dialog open className="${[pt("px","0"),pt("py","0")].join(" ")}" />;\nconst d10 = <Dialog open className="${pt("p","[0px]")}" />;\nconst k1 = <Dialog open size="full" headerActions={<Help />} />;\nconst k5 = <Dialog open className="${[pt("w","full"),pt("px","4")].join(" ")}" />;\nconst k2 = <Dialog open className="${[pt("p","0.5"),pt("max-w","md"),pt("p","0-x")].join(" ")}" />;\nconst k3 = <Panel className="${pt("p","0")}" />;\nconst k4 = <div className="${pt("max-w","none")}" />;\n`,kt={"dialog-frame":10,spacing:1},bt=`\n// "root:default-zone" and \`/wheels/\${slug}\` in a comment are not copies\nimport { escapeHtml } from 'efficient-shell/format';\nconst c1 = "${pt("pl","[var(--sf-site-gutter,40px)]")}";\nconst c2 = "var(--sf-site-gutter)";\nconst c3 = <i className="${pt("max","[960px]")}:hidden" />;\nconst c4 = "1960px";\nconst c5 = \`/wheels/\${slug}\`;\nconst c6 = "/tyres/" + slug;\nconst c7 = wheelPath(slug);\nconst c8 = { zone: "root:default-zone" };\nconst c9 = "(max-width: 767px)";\nconst c10 = <img sizes="(max-width: 800px) 100vw, 50vw" />;\nconst c11 = <img sizes={CONTENT_SIZES} />;\nconst c12 = Math.round(price * 100) / 100;\nconst c13 = ratio * 100;\nfunction escapeHtml(s: string) { return s; }\nconst c14 = timeAgo(when);\n/** @deprecated Remove at the next major. */\nconst c15 = 1;\nconst c16 = "@deprecated in a string";\n`,yt={"gutter-literal":1,"view-line-literal":1,"route-literal":2,"root-zone-literal":1,"phone-query":1,"sizes-literal":1,"money-cents":1,"local-helper":1,"deprecated-undated":1},vt=["transform","Origin"].join(""),St=`\nconst s1 = { ${vt}: 'top left' };\nel.style.${vt} = "0 0";\nconst s3 = { ${vt}: \`0% 0%\` };\nconst s4 = \`.frame { ${["transform","origin"].join("-")}: left top; }\`;\nconst s5 = <div className="${[pt("origin","top","left"),pt("scale","50")].join(" ")}" />;\nconst s6 = <div className="${pt("origin","[0_0]")}" />;\nconst n1 = { ${vt}: 'center' };\nconst n2 = { ${vt}: origin };\nconst n3 = <div className="${pt("origin","top")}" />;\nconst n4 = "top left";\n`,Et={"scaled-frame":6},jt=e=>c.filter(t=>e[t]).map(t=>`${t} ${e[t]}`).join(", ")||"nothing";var zt="ui-kit.config.json",It="ui-kit.baseline.json",Tt="efficient-shell-ui-check",At=`${Tt}: every surface a person operates takes its UI from efficient-shell (harness UI-24).\n\n ${Tt} check this repository against ${It}\n ${Tt} --print print today's counts as a baseline, and change nothing\n ${Tt} --summary print totals per kind and per folder, as Markdown\n ${Tt} --json print the result as JSON\n ${Tt} --update lower the lines whose counts fell, and delete the ones at zero\n ${Tt} --update --allow-move also follow a renamed or split file (no total may rise)\n ${Tt} --init write the first ${It}\n ${Tt} --init --kind <kind> take the baseline for a kind just added to "kinds"\n ${Tt} --no-base do not compare with the base branch (refused on a pull request)\n ${Tt} --base-lock run only on a release with the base-branch lock (an older one fails on the flag)\n\nKinds: ${c.join(", ")}\nReads ${zt} in the current directory.`;var Ct=(e,t)=>`${e} ${t}${1===e?"":"s"}`,Rt=(e,t)=>{const n=F(e);return t.map(e=>`${e} ${n[e]??0}`).join(" · ")};var Mt=[5e3,15e3];function Nt(e,t,n,i){const o=[];for(let s=0;s<n;s++){s>0&&e.sleep?.(Mt[Math.min(s-1,Mt.length-1)]);const n=e.gitDetail?e.gitDetail(t,12e4):{out:e.git(t),error:"git failed (no reason given)"};if(i())return o;o.push(`try ${s+1}: ${null===n.out?n.error:"git ran, and the commit is still not there"}`)}return o}function Lt(e,t){const n=t.env.RUNNER_NAME?`runner ${t.env.RUNNER_NAME}`:"a runner with no RUNNER_NAME";return`git fetch was tried ${e.length} times on ${n}: ${e.join("; ")}.`}function Dt(e,t,s,a,l){const c=e.env.GITHUB_BASE_REF,u=!c&&"push"===e.env.GITHUB_EVENT_NAME;if(!c&&!u)return{problems:[],note:"",warnings:[]};const h=c?`GITHUB_BASE_REF is "${c}"`:'GITHUB_EVENT_NAME is "push"',f=(e,t)=>({problems:[e],note:t,warnings:[]}),p=e.git(["rev-parse","--show-prefix"]);if(null===p)return f(`${h}, and git could not read this checkout, so the base branch could not be compared. The comparison is the lock: run the check in the git checkout, with git installed and the folder trusted (git config --global --add safe.directory <path>).`,"git could not read this checkout");let w=c?`origin/${c}`:"HEAD^1";const $=t=>null!==e.git(["rev-parse","--verify","--quiet",`${t}^{commit}`]);if(!$(w)){const t=Nt(e,c?["fetch","--no-tags","--depth=1","origin",`+refs/heads/${c}:refs/remotes/origin/${c}`]:["fetch","--no-tags","--deepen=1"],3,()=>$(w));if(!$(w)&&c)return f(`${h}, and ${w} could not be fetched, so the base branch could not be compared. On a pull request the comparison is the lock: give the job the base branch (git fetch origin ${c}). `+Lt(t,e),`${w} could not be fetched`);if(!$(w)){const n=function(e){const t=e.env.GITHUB_EVENT_PATH;if(!t)return null;try{const e=JSON.parse(o(t,"utf8")).before;return"string"!=typeof e||!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(e)||/^0+$/.test(e)?null:e}catch{return null}}(e);let i=[];if(null!==n&&(i=Nt(e,["fetch","--no-tags","--depth=1","origin",n],2,()=>$(n))),null===n||!$(n))return f(`${h}, and ${w} (the commit before this one) could not be read, so it could not be compared. On a push the comparison is the lock: give the job that commit (fetch-depth: 2). `+Lt(t,e)+(null===n?" The push event names no commit before this push (GITHUB_EVENT_PATH), so none was fetched in its place.":` The push's before commit ${n} could not be fetched either: ${i.join("; ")}.`),`${w} could not be fetched`);w=n}}const x=p.trim(),k=n(e.cwd,...x.split("/").filter(Boolean).map(()=>"..")),b=[],y=e.git(["show",`${w}:${x}${It}`]);if(null===y){const t=e.git(["ls-tree","-r","--full-tree","--name-only","-z",w]);if(null===t)return f(`${w} has no ${It} in this folder, and git could not list ${w}'s files, so a check that moved here cannot be told from an adoption.`,"adoption not confirmed");const o=t.split("\0").filter(e=>(e===It||e.endsWith(`/${It}`))&&!i(n(k,e)));return o.length?f(`${o.join(", ")} ${1===o.length?"is":"are"} on ${w} and gone here, and ${w} has no ${It} in this folder (${x||"the repository root"}): the check moved. Its lines would be taken as an adoption and never compared: keep the config and the baseline in the folder they were in.`,"the check moved"):{problems:[],note:`${w} has no ${It} yet (adoption)`,warnings:b}}const v=e=>`${w}'s ${e} could not be parsed, and this change replaces it with one that parses, so ${e===It?"the base branch was not compared":"no scope was checked for shrinking"}. The next change is compared against it as usual.`;let S;try{S=O(y,`${w}:${It}`)}catch{return{problems:[],note:`${w}'s ${It} could not be read; the base branch was not compared`,warnings:[v(It)]}}const E=new Map,j=t=>(E.has(t)||E.set(t,e.git(["show",`${w}:${x}${t}`])),E.get(t)??null);let I=null;try{const e=j(zt);null!==e&&(I=q(JSON.parse(e),`${w}:${zt}`))}catch{I=null}null===I&&b.push(v(zt));const T=[],A=new Set(a.kinds.filter(e=>s.kinds.includes(e)));for(const e of S.kinds)A.has(e)||T.push(`"${e}" is checked on ${w}, and not here ("kinds" in ${zt}, or ${It}). Its lines would never be counted again: keep the kind.`);const R=t=>{const i=t.split("/");for(let t=1;t<=i.length;t++)try{if(r(n(e.cwd,...i.slice(0,t))).isSymbolicLink())return!0}catch{return!1}return!1},M=new Set(l.copyOnly),D=new Set(l.files.filter(e=>!M.has(e))),B=(e,t)=>D.has(e)||M.has(e)&&d(t)&&m(t),P=new Set([...S.counts.keys()].map(e=>L(e)).filter(({file:e,kind:t})=>e!==W&&!B(e,t)).map(({file:e})=>e));for(const e of P)R(e)&&T.push(`${e} is under a symbolic link now (the file or a folder above it), and ${w} counted it. The walk does not follow it for every kind counted there, so those lines would never be counted again: keep the real file here.`);const U=rt(a),_=I?rt(I):U,J=e=>(S.counts.get(e)??0)+(_.get(e)??0),H=new Map;for(const e of new Set([...S.counts.keys(),..._.keys()])){const{file:t,kind:n}=L(e);t!==W&&0!==J(e)&&((H.get(t)??[]).includes(n)||H.set(t,[...H.get(t)??[],n]))}const G=e=>(H.get(e)??[]).filter(t=>{return n=`${e}:${t}`,(s.counts.get(n)??0)+(U.get(n)??0)<J(`${e}:${t}`);var n}),Y=[...H.keys()].filter(t=>!i(n(e.cwd,t))&&!R(t)),K=[...H.keys()].filter(e=>!Y.includes(e)&&!R(e)&&G(e).length>0),V=[...Y,...K];if(V.length){const i=e.git(["diff","-M30%","-C30%","--find-copies-harder","-l0","--no-relative","--name-status","-z",w]);if(null===i)T.push(`${Ct(V.length,"file")} that ${w} counted ${1===V.length?"is":"are"} gone or count less (${V.slice(0,3).join(", ")}${V.length>3?", …":""}), and git could not list the renames, so a move out of the check cannot be told from a delete.`);else{const e=new Map,s=i.split("\0");for(let t=0;t<s.length;){const n=s[t]??"";if(n.startsWith("R")||n.startsWith("C")){const[n,i]=[s[t+1],s[t+2]];n&&i&&e.set(n,[...e.get(n)??[],i]),t+=3}else t+=n?2:1}const r=(e,i,s)=>{const r=s.filter(d),a=Ye(e)&&Ye(i);if(!Ge(e)&&!a)return r;let l;try{l=o(n(k,e),"utf8")}catch{return r}if(a){const e=Ve(l,r);return r.filter(t=>(e[t]?.length??0)>0)}const c=Ze(t,e,l,r),u=Ze(t,i,l,r);return r.filter(e=>(c[e]?.length??0)+(u[e]?.length??0)>0)};for(const t of V){const n=Y.includes(t)?"moved to":"counts less, and git lists a copy of it at";for(const i of e.get(`${x}${t}`)??[]){const e=r(i,t,Y.includes(t)?H.get(t)??[]:G(t));if(!e.length)continue;if(!i.startsWith(x)){T.push(`${t} ${n} ${i}, outside the folder the check runs in, and it holds ${e.map(e=>`"${e}"`).join(", ")} that ${w} counted. Those lines would never be counted again: keep it in this folder, in a scope.`);continue}const o=i.slice(x.length),s=e.filter(e=>!B(o,e));s.length&&T.push(`${t} ${n} ${o}, and no scope reads it there for ${s.map(e=>`"${e}"`).join(", ")}. ${w} counted it, so those lines would never be counted again: move it into a scope, or widen one to it.`)}}}}if(I){const n=z(I.exclude),i=I.kinds.includes("colour"),o=e=>(Ge(e)||i&&Ye(e))&&!n(e),s=t=>C(e.cwd,[t]).some(o),r="keep the line; delete it only when the files it matches are gone.",c=(e,t,n)=>t.filter(e=>!n.includes(e)&&s(e)).map(t=>`"${e}" drops "${t}", which ${w} reads. Those files would never be counted again: ${r}`),d=(e,t,n)=>n.filter(e=>!t.includes(e)&&s(e)).map(t=>`"${e}" adds "${t}", which takes files ${w} reads out of the check. Those files would never be counted again.`),u=e=>e.flatMap(e=>e.files.flatMap(t=>e.modules.map(e=>({glob:t,module:e})))),h=new Set(u(a.includeImporting).map(({glob:e,module:t})=>`${e}\n${t}`));T.push(...c("include",I.include,a.include),...u(I.includeImporting).filter(({glob:e,module:t})=>!h.has(`${e}\n${t}`)&&s(e)).map(({glob:e,module:t})=>`"includeImporting" drops "${e}" (${t}), which ${w} reads. Those files would never be counted again: ${r}`),...c("includeCopies",I.includeCopies,a.includeCopies),...d("exclude",I.exclude,a.exclude),...d("output",I.output.flatMap(e=>e.files),a.output.flatMap(e=>e.files)));const f=new Set(l.copyOnly),p=new Set(l.files.filter(e=>!f.has(e))),m=z(I.include),g=z(I.output.flatMap(e=>e.files)),$=new Set;for(const i of I.includeImporting)for(const o of C(e.cwd,i.files)){if(!Ge(o)||n(o)||g(o)||m(o))continue;if(p.has(o)||$.has(o))continue;const e=j(o);null!==e&&st(t,o,e,i.modules)&&($.add(o),T.push(`${o} no longer imports ${i.modules.join(", ")}, so "includeImporting" stops reading it, and ${w} reads it. Keep the import, or read the file with "include".`))}}const Z=a.kinds.filter(m),Q=[],X=new Set,ee={};if(I){const e=z(I.exclude),n=z(I.include),i=z(I.output.flatMap(e=>e.files)),o=z(I.includeCopies),s=I.includeImporting.map(e=>({files:z(e.files),modules:e.modules})),r=o=>{if(e(o))return!1;if(n(o)&&!i(o))return!0;const r=s.filter(e=>e.files(o));if(!r.length||!Ge(o))return!1;const a=j(o);return null!==a&&r.some(e=>st(t,o,a,e.modules))};for(const n of l.files){if(r(n))continue;const i=M.has(n)?Z:a.kinds,s=!e(n)&&o(n),c=i.filter(e=>!(s&&m(e)));if(!c.length)continue;Q.push(n);for(const e of c)X.add(e);if(!Ge(n))continue;const d=j(n);if(null===d)continue;const u=Ze(t,n,d,c);for(const e of c){const t=Math.min(u[e]?.length??0,l.counts.get(`${n}:${e}`)??0);t>0&&(ee[e]=(ee[e]??0)+t)}}}const te=F(S.counts),ne=F(s.counts),ie=F(U),oe=F(_),se=(e,t,n)=>(e[n]??0)+(t[n]??0);if(T.push(...a.kinds.filter(e=>S.kinds.includes(e)&&se(ne,ie,e)>se(te,oe,e)+(ee[e]??0)).map(e=>{const t=(ie[e]??0)||(oe[e]??0),n=n=>t?` (and ${n[e]??0} in "allow")`:"";return`${It} holds ${ne[e]??0} of "${e}"${n(ie)}, and ${w} holds ${te[e]??0}${n(oe)}${Q.length?` (and ${ee[e]??0} in the files new to a scope)`:""}. The baseline only goes down, and "allow" with it: use ${g[e].instead}. A count that must stay goes in "allow" in ${zt}, with its reason, and the same count of that kind is burned down in this change.`})),I)for(const e of a.allow){const t=_.get(N(e.file,e.kind));void 0!==t&&e.count<=t||b.push(`"allow" in ${zt} ${void 0===t?"adds":`raises from ${t}`} ${e.file} (${e.kind}) at ${e.count}: ${e.reason}`)}const re=[`compared with ${w}`];return null===I&&re.push(`${w}'s ${zt} could not be read, so every line was compared and no scope was checked for shrinking`),Q.length&&re.push(`${[...X].every(m)?'"includeCopies" changed: ':""}${Q.length} file${1===Q.length?"":"s"} new to a scope, so ${1===Q.length?"its":"their"} ${a.kinds.filter(e=>X.has(e)).join(", ")} lines may hold what ${1===Q.length?"it":"they"} held on ${w}`),{problems:T,note:re.join("; "),warnings:b}}process.exitCode=function(e,t){const r=function(e){const t={print:!1,summary:!1,json:!1,update:!1,allowMove:!1,init:!1,noBase:!1,help:!1,version:!1,kinds:[]};for(let n=0;n<e.length;n++){const i=e[n];if("--print"===i)t.print=!0;else if("--summary"===i)t.summary=!0;else if("--json"===i)t.json=!0;else if("--update"===i)t.update=!0;else if("--allow-move"===i)t.allowMove=!0;else if("--init"===i)t.init=!0;else if("--no-base"===i)t.noBase=!0;else{if("--base-lock"===i)continue;if("--help"===i||"-h"===i)t.help=!0;else if("--version"===i||"-v"===i)t.version=!0;else if("--kind"===i){const i=e[++n];if(!i)return"--kind needs a kind after it";t.kinds.push(...i.split(","))}else{if(!i.startsWith("--kind="))return`unknown argument "${i}"`;t.kinds.push(...i.slice(7).split(","))}}}return t.allowMove&&!t.update?"--allow-move goes with --update":t.kinds.length&&!t.init?"--kind goes with --init":[t.print,t.summary,t.update,t.init].filter(Boolean).length>1?"choose one of --print, --summary, --update and --init":t}(e);if("string"==typeof r)return t.err(`${Tt}: ${r}\n\n${At}`),2;if(r.help)return t.out(At),0;if(r.version)return t.out(t.version),0;const a=e=>(r.json?t.out(JSON.stringify({tool:Tt,version:t.version,ok:!1,failures:[e]},null,2)):t.err(`${Tt}: ${e}`),1);if(r.noBase&&t.env.GITHUB_BASE_REF)return a("--no-base is refused on a pull request (GITHUB_BASE_REF is set): the base-branch comparison is what stops a pull request lowering its own baseline.");const l=n(t.cwd,zt);if(!i(l))return a(`no ${zt} in ${t.cwd}. Run it from the repository root; the harness has the template.`);let c,u;try{c=q(JSON.parse(o(l,"utf8")),zt)}catch(e){return a(e instanceof U?e.message:`${zt} is not valid JSON: ${e.message}`)}try{u=t.loadTypeScript()}catch{return a('this check reads the TypeScript AST and found no "typescript" package here. Install it as a devDependency.')}const p=function(e){const t=[],n=f,i=[["fixture.tsx",ut,ht],["fixture.ts","\nimport { toast } from 'sonner';\nimport { extent } from 'd3-array';\nexport const tone = { warn: '#f59e0b' };\nexport const cls = 'ring-1 dark:ring-white rounded-[3px]';\nexport const box = { borderRadius: '0.25rem', radius: 4 };\nexport function ask(confirm: (message: string) => boolean) {\n return confirm('a parameter binds the name');\n}\nexport const mount = (node: unknown) => ReactDOM.createPortal(node, document.body);\n",ft],["tokens.tsx",mt,gt],["labels.tsx","\n// <Button>Save…</Button> in a comment is not a label\nconst l1 = <Button>Extend trial…</Button>;\nconst l2 = <PopupMenuItem onClick={go}><span>Read from a PDF...</span></PopupMenuItem>;\nconst l3 = <Button>{busy ? 'Saving…' : 'Duplicate site…'}</Button>;\nconst l4 = <Item label=\"Translate…\" aria-label={'More…'} />;\nconst l5 = [{ label: 'Reject…' }, { value: CUSTOM, label: 'Custom…' }];\nconst l6 = <option value={CUSTOM}>Different address…</option>;\nconst l7 = <PopupMenuLabel>{say(\"Duplicate to page…\")}</PopupMenuLabel>;\nconst n7 = <Button>{t('team:menu.remove')}</Button>;\nconst n1 = <Button>{`${name.slice(0, 9)}…`}</Button>;\nconst n2 = <p>Loading weather…</p>;\nconst n3 = <Input placeholder=\"Search…\" />;\nconst n4 = <option value=\"\">Pick a carrier…</option>;\nconst n5 = [{ value: '', label: 'Select…' }];\nconst n6 = <Button>Extend trial</Button>;\n",$t],["copies.tsx",bt,yt],["frames.tsx",xt,kt],["scaled.tsx",St,Et]];for(const[o,s,r]of i){const i=ot(Ze(e,o,s,n));n.some(e=>(i[e]??0)!==(r[e]??0))&&t.push(`${o}: read ${jt(i)}; it holds ${jt(r)}`)}const o=ot(Ve('\n/* #fff in a comment */\n.a:hover { color: #111; border: 1px solid white; }\n[data-x="#fff"] { mask-image: linear-gradient(#000, transparent); color: var(--ink); }\n.b { --mine: rgb(0 0 0 / .5); background: var(--surface, #fff); }\n',n));n.some(e=>(o[e]??0)!==(wt[e]??0))&&t.push(`style.css: read ${jt(o)}; it holds ${jt(wt)}`);const s=ot(Ze(e,"fixture.tsx",ut,["button"]));return"button"!==Object.keys(s).join()&&t.push(`asked for button alone, the reader reported ${jt(s)}`),t}(u);if(p.length)return a(`the reader misread its own fixtures with typescript ${u.version}, so nothing it says about this repository can be trusted:\n - `+p.join("\n - "));const w=function(e,t,s){const r=[],a=z(s.exclude),l=z(s.output.flatMap(e=>e.files)),c=new Map,d=e=>{let i=c.get(e);return void 0===i&&c.set(e,i=o(n(t,e),"utf8")),i},u=(e,n)=>{for(const i of e)0===C(t,[i]).length&&r.push(`${n}: "${i}" matches no file. Delete the line, or fix the path.`)};u(s.include,'"include"'),s.output.forEach((e,t)=>u(e.files,`"output"[${t}]`)),s.includeImporting.forEach((e,t)=>u(e.files,`"includeImporting"[${t}]`)),u(s.includeCopies,'"includeCopies"');const f=new Set,p=s.kinds.includes("colour"),g=e=>(Ge(e)||p&&Ye(e))&&!a(e)&&!l(e);for(const e of C(t,s.include))g(e)&&f.add(e);for(const n of s.includeImporting)for(const i of C(t,n.files))g(i)&&Ge(i)&&!f.has(i)&&st(e,i,d(i),n.modules)&&f.add(i);const w=s.kinds.filter(m),$=new Set;if(w.length)for(const e of C(t,s.includeCopies))!Ge(e)||a(e)||f.has(e)||$.add(e);const x=[...f,...$].sort(),k=s.kinds.filter(e=>!h(e)),y=new Map,v=new Map,E=new Set;for(const t of x){const n=$.has(t),i=n?w:k,o=Ye(t)?Ve(d(t),i):Ze(e,t,d(t),i,n?void 0:E);let s=!1;for(const e of i){const n=o[e]?.length??0;n&&(v.set(N(t,e),n),s=!0)}s&&y.set(t,o)}let j=[],I=[],T=[];const A=s.kinds.filter(h);if(A.length){const e=n(t,W);if(i(e)){const t=JSON.parse(o(e,"utf8")),n=["dependencies","peerDependencies","optionalDependencies"].flatMap(e=>Object.keys(t[e]??{})),i=new Set([...E].flatMap(e=>b[e]??[])),r=[...new Set(n)].sort();if(s.kinds.includes("kit-dep")){const e=r.filter(e=>"kit-dep"===S(e));j=e.filter(e=>!i.has(e)),I=e.filter(e=>i.has(e)),j.length&&v.set(N(W,"kit-dep"),j.length)}s.kinds.includes("chart-dep")&&(T=r.filter(e=>"chart-dep"===S(e)),T.length&&v.set(N(W,"chart-dep"),T.length))}else for(const e of A)r.push(`"kinds" includes "${e}", and there is no ${W} here to read.`)}for(const e of s.allow)(h(e.kind)?e.file===W:f.has(e.file)||m(e.kind)&&$.has(e.file))||r.push(`"allow": ${e.file} (${e.kind}) is not a file this check reads. Delete the entry, or fix the path.`);return{files:x,copyOnly:[...$].sort(),hits:y,counts:v,kitDeps:j,shellPeers:I,chartDeps:T,problems:r}}(u,t.cwd,c);if(0===w.files.length)return a(`read no files. "include" in ${zt} matches nothing, so a pass would mean nothing.`);const $=n(t.cwd,It),x=r.json,k=e=>{x||t.out(e)};if(r.print)return t.out(P(ct(c,w,c.kinds)).trimEnd()),0;if(r.summary){for(const e of function(e,t){const n=new Map,i=new Map;for(const[e,o]of t.counts){const{file:t,kind:s}=L(e);if(!d(s))continue;const r=n.get(s)??{count:0,files:new Set};r.count+=o,r.files.add(t),n.set(s,r);const a=t.split("/"),l=a.length>2?a.slice(0,2).join("/"):2===a.length?a[0]:".",c=i.get(l)??{};c[s]=(c[s]??0)+o,i.set(l,c)}const o=e.kinds.filter(e=>n.has(e)),s=[`**UI kit check (harness UI-24):** ${new Set([...t.counts.keys()].map(e=>L(e).file)).size} of ${Ct(t.files.length,"file")} still draw UI of their own.`,"","| Kind | Count | Files | The shell has |","|---|---:|---:|---|",...e.kinds.map(e=>{const t=n.get(e);return`| \`${e}\` | ${t?.count??0} | ${t?.files.size??0} | ${g[e].instead} |`})];if(o.length&&i.size){const e=e=>o.reduce((t,n)=>t+(e[n]??0),0),t=[...i].sort((t,n)=>e(n[1])-e(t[1])||(t[0]<n[0]?-1:1));s.push("",`| Folder | ${o.map(e=>`\`${e}\``).join(" | ")} | Total |`,`|---|${o.map(()=>"---:").join("|")}|---:|`,...t.map(([t,n])=>`| \`${t}\` | ${o.map(e=>n[e]??0).join(" | ")} | ${e(n)} |`))}return s}(c,w))t.out(e);return 0}let y=null;if(i($))try{y=O(o($,"utf8"),It)}catch(e){return a(e instanceof M?e.message:String(e))}if(r.init){const e=r.kinds.filter(e=>!d(e)||!c.kinds.includes(e));if(e.length)return a(`--kind ${e.join(", ")}: not in "kinds" in ${zt}. Add it there first.`);const t=r.kinds;if(y){if(0===t.length)return a(`${It} already exists, and --init would overwrite what it holds. It is for the adoption pull request only. To start checking a kind, add it to "kinds" and run --init --kind <kind>.`);const e=t.filter(e=>y.kinds.includes(e));if(e.length)return a(`the baseline was already taken for ${e.join(", ")}. Its lines only go down; use --update.`);const n=ct(c,w,t);y={kinds:[...y.kinds,...t],counts:new Map([...y.counts,...n.counts])}}else{if(t.length)return a(`there is no ${It} yet. Run --init on its own first.`);y=ct(c,w,c.kinds)}s($,P(y)),k(`${Tt}: wrote ${It} (${Ct(y.counts.size,"line")}: ${Rt(y.counts,y.kinds)})`)}if(!y)return a(`no ${It}. This repository has not adopted the check yet: run ${Tt} --init, and commit the file.`);if(r.update){const e=function(e,t,n,{allowMove:i=!1}={}){const o=at(e,t),s=ct(e,n,o),r=new Map([...t.counts].filter(([e])=>o.includes(L(e).kind)));if(i){const e=F(r),n=F(s.counts),i=o.filter(t=>(n[t]??0)>(e[t]??0)).map(t=>`${t}: ${n[t]??0} across the repository, and the baseline holds ${e[t]??0}`);return i.length?{baseline:t,lowered:0,refused:i}:{baseline:s,lowered:dt(r,s.counts),refused:[]}}const a=new Map;for(const[e,t]of r){const n=Math.min(t,s.counts.get(e)??0);n>0&&a.set(e,n)}return{baseline:{kinds:o,counts:a},lowered:dt(r,a),refused:[]}}(c,y,w,{allowMove:r.allowMove});if(e.refused.length)return a(`--allow-move follows code that moved, and this is more of it than before:\n - ${e.refused.join("\n - ")}\nNothing was written.`);y=e.baseline,s($,P(y)),k(`${Tt}: ${e.lowered?`changed ${Ct(e.lowered,"line")} in`:"nothing to change in"} ${It}`)}const v=function(e,t,n){const i=[],o=[],s=[...n.problems],r=rt(e),a=new Set(at(e,t)),l=e.kinds.filter(e=>!t.kinds.includes(e));l.length&&s.push(`"kinds" names ${l.map(e=>`"${e}"`).join(", ")}, and the baseline was never taken for ${1===l.length?"it":"them"}. Run: efficient-shell-ui-check --init ${l.map(e=>`--kind ${e}`).join(" ")}`);const c=t.kinds.filter(t=>!e.kinds.includes(t));c.length&&o.push(`the baseline still carries ${c.map(e=>`"${e}"`).join(", ")}, which "kinds" no longer names`);const u=new Set([...n.counts.keys(),...t.counts.keys(),...r.keys()]);for(const e of[...u].sort(B)){const{file:l,kind:c}=L(e);if(!d(c)||!a.has(c))continue;const u=n.counts.get(e)??0,h=r.get(e)??0,f=t.counts.get(e)??0;u>h+f?i.push(`${l}: ${c} ${u}, and its line allows ${h+f}${lt(n,l,c)}. ${g[c].counts} is counted; use ${g[c].instead}.`):u<h?s.push(`${l}: ${c} ${u}, and "allow" in ui-kit.config.json says ${h}. ${0===u?"Delete the entry":`Lower its count to ${u}`}: an exception does not outlive what it excused.`):u<h+f&&o.push(`${l}: ${c} ${u}, and its line says ${h+f}`)}return{grown:i,shrunk:o,other:s,updateFixes:0===i.length&&0===s.length&&o.length>0}}(c,y,w),E=r.noBase?{problems:[],note:"",warnings:[]}:Dt(t,u,y,c,w),j=c.kinds.filter(e=>y.kinds.includes(e)),I=`${Tt} --update`,T=[...v.other,...v.grown,...v.shrunk.map(e=>`${e}. Run: ${I}`),...E.problems],A=0===T.length;if(r.json){const e=rt(c);return t.out(JSON.stringify({tool:Tt,version:t.version,ok:A,schema:c.schema,kinds:c.kinds,files:w.files.length,counts:F(w.counts),baseline:F(y.counts),allowed:F(e),kitDeps:w.kitDeps,shellPeers:w.shellPeers,chartDeps:w.chartDeps,failures:T,warnings:E.warnings},null,2)),A?0:1}t.out(`UI kit check (harness UI-24), efficient-shell ${t.version}\n`);const R=(e,n,i="")=>{if(0===n.length)return t.out(` ok ${e}`);t.err(` FAIL ${e}`);for(const e of n)t.err(` ${e}`);i&&t.err(` ${i}`)};t.out(` ok the reader reads its own fixtures (typescript ${u.version})`),t.out(` ok read ${Ct(w.files.length,"file")}`),R(`${zt} and ${It} describe this repository`,v.other),R("no file draws more of its own UI than its line allows",v.grown),R("every line is exact: a count that fell is a line to lower",v.shrunk,`Run: ${I}${v.updateFixes?"":" (after the failures above are fixed)"}`),E.note&&R(`the baseline is no higher than the base branch (${E.note})`,E.problems);for(const e of E.warnings)t.err(`::warning title=${Tt}::${e}`);const D=new Set([...w.counts.keys()].map(e=>L(e).file));return t.out(` ok PROGRESS: ${D.size} of ${Ct(w.files.length,"file")} still draw UI of their own: `+Rt(w.counts,j)),t.out(""),A?t.out("UI kit check: ok"):t.err(`UI kit check: FAILED (${Ct(T.length,"problem")})`),A?0:1}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>l(import.meta.url),git:function(t){try{return e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:6e4,maxBuffer:67108864})}catch{return null}},gitDetail:function(t,n){try{return{out:e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:n,maxBuffer:67108864}),error:""}}catch(e){const t=e;if("ETIMEDOUT"===t.code||"SIGTERM"===t.signal)return{out:null,error:`timed out after ${Math.round(n/1e3)} s`};return{out:null,error:(String(t.stderr??"").trim().replace(/\s+/g," ")||t.message||"git failed").slice(-500)}}},sleep:function(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},version:"13.20.0"});
2
+ import{execFileSync as e}from"child_process";import{createRequire as t}from"module";import{join as n}from"path";import{existsSync as i,readFileSync as o,writeFileSync as s,lstatSync as r,readdirSync as a}from"fs";function l(e){return function(e,i){for(const o of[n(process.cwd(),"package.json"),i])try{return t(o)(e)}catch{}throw new Error(`${e} is not installed; add it to this repository's devDependencies`)}("typescript",e)}var c=["button","input","range","textarea","select","dialog","title","portal","native","dark","hex","radius","spacing","font-size","z-index","shadow","kit","icon","svg","kit-dep","chart","chart-dep","ellipsis-label","colour","gutter-literal","view-line-literal","route-literal","root-zone-literal","phone-query","sizes-literal","money-cents","local-helper","deprecated-undated","dialog-frame","scaled-frame"],d=e=>"string"==typeof e&&c.includes(e),u=["kit-dep","chart-dep"],h=e=>u.includes(e),f=c.filter(e=>!h(e)),p=["gutter-literal","view-line-literal","route-literal","root-zone-literal","phone-query","sizes-literal","money-cents","local-helper","deprecated-undated"],m=e=>p.includes(e),g={button:{counts:"a raw <button>",instead:"Button or IconButton from efficient-shell/ui"},input:{counts:"a raw <input> (not hidden, not a range)",instead:"Input, InputNumber, Checkbox, Radio or Switch from efficient-shell/ui"},range:{counts:'a raw <input type="range">',instead:"Slider from efficient-shell/ui"},textarea:{counts:"a raw <textarea>",instead:"Textarea from efficient-shell/ui"},select:{counts:"a raw <select>",instead:"Select or SearchableSelect from efficient-shell/ui"},dialog:{counts:'a raw <dialog>, or role="dialog" / role="alertdialog" on a raw element',instead:"Dialog or Modal from efficient-shell"},title:{counts:"a title= on a raw element (the browser's own tooltip)",instead:"Tooltip from efficient-shell/ui (harness UI-17)"},portal:{counts:"a createPortal(…) call (a layer the file floats itself)",instead:"Popover, PopupMenu, DropdownMenu, Tooltip or Dialog from efficient-shell/ui"},native:{counts:"window.confirm / alert / prompt, or a bare call that resolves to one",instead:"confirm, confirmDestructive, prompt or toast from efficient-shell (harness UI-20)"},dark:{counts:"a dark: variant in a class string",instead:"the light Tailwind class alone; the shell remaps it in dark mode (harness UI-7)"},hex:{counts:"a hex colour literal in a .tsx string",instead:"a colour role from efficient-shell: its utility or var(--role), COLOUR_ROLES lists them (harness FT-1; the colour kind counts palette classes too)"},radius:{counts:"a literal corner radius (an arbitrary-value radius class, or an inline borderRadius)",instead:"a radius utility from the scale or a role token such as rounded-(--radius-control); the theme sets how round they are (harness UI-7)"},spacing:{counts:"a padding, margin or gap off the scale (6px, 10px, 14px …) or written as a literal length (an arbitrary-value class, an inline style)",instead:"a step of the scale 2/4/8/12/16/20/24/32/40/48 — a Tailwind step, or a role such as var(--space-control-x) (owner ruling 2026-10-12)"},"font-size":{counts:"a literal font size (an arbitrary-value text class, an inline fontSize)",instead:"a type step 9/11/12/14/16/18/20/24/30 — Tailwind's 3xs … 3xl text steps (owner ruling 2026-10-12)"},"z-index":{counts:"a stack order above 30 written as a number (a z utility, an arbitrary value, an inline zIndex)",instead:"a named layer: Z_LAYERS (efficient-shell/ui) in code, its --z-* custom property in markup"},shadow:{counts:"a literal shadow, or a shadow size that is not an elevation level (md, 2xl, xs)",instead:"an elevation: the sm / lg / xl utilities, or var(--elevation-panel) and its siblings (owner ruling 2026-10-12)"},kit:{counts:"an import of a second UI kit",instead:"the component from efficient-shell/ui, or fold it into the shell (harness FT-3)"},icon:{counts:"an import of an icon package",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24)"},svg:{counts:"an <svg> element written in JSX: an icon drawn in place",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24). A chart, an illustration or a mark a host supplies stays on the baseline"},"kit-dep":{counts:"a UI kit or icon package declared in package.json (not one the shell entries imported here need)",instead:"remove the dependency once nothing imports it (harness FT-3)"},chart:{counts:"an import of a second chart library",instead:"a chart from efficient-shell/ui (ChartFrame, TimeSeriesChart, ColumnChart, RankedBars, PieChart, FunnelChart, ScatterChart, …), or add the chart there: one chart system (harness FT-3)"},"chart-dep":{counts:"a chart library declared in package.json",instead:"remove the dependency once nothing imports it (harness FT-3)"},"ellipsis-label":{counts:'a button, link or menu label that ends in "…" or "..."',instead:'the label without the dots, saying what it does ("Extend trial"): "…" means only "the words are cut" (owner ruling 2026-10-14)'},colour:{counts:"a literal colour, in a script string or a stylesheet: a hex, an rgb() / hsl() / oklch() value, a Tailwind palette class (a hue and a step, or white / black), a --color-<hue>-<step> variable, or a named colour in a colour property — a var() fallback included",instead:"a colour role from efficient-shell: its utility (the text, background or border utility of ink, ink-faint, surface, line, accent-fill, accent-text, danger-text, status-danger-line …) or var(--role); COLOUR_ROLES lists them. A merchant site reads the site theme (owner ruling 2026-10-23)"},"gutter-literal":{counts:"the site gutter typed with its own fallback, var(--sf-site-gutter, 40px), in script source (stylesheets are not read)",instead:"SITE_GUTTER_CLASS from efficient-web-builder (lib/content/page-width): the whole class, because Tailwind reads only whole literals; SITE_GUTTER_CAP for the number"},"view-line-literal":{counts:"the 960px written as a length in script source (a max-/min- variant, a media query; a sizes string counts here too)",instead:"the view-lines table in efficient-web-builder (lib/content/view-lines, lib/content/box-stack-line)"},"route-literal":{counts:"a page path typed by hand before a slug: /wheels/, /journal/, /tyres/",instead:"pagePath, postPath or wheelPath from efficient-web-builder (lib/links/page-link-rules), tyrePagePath from efficient-storefront-blocks (render/lib/tyres/tyre-page-path)"},"root-zone-literal":{counts:'the easel root zone key typed as a string ("root:default-zone")',instead:"ROOT_ZONE from efficient-easel (screen/lib/document/content-tree)"},"phone-query":{counts:"the app phone line typed as a media query in script source: (max-width: 767px)",instead:"useIsMobile from efficient-shell: ask the hook, do not write the query"},"sizes-literal":{counts:"a hand-written responsive sizes string (a sizes attribute or sizes: entry with a media condition)",instead:"a named sizes shape from efficient-web-builder (lib/sized-image), built from the view lines"},"money-cents":{counts:"a money amount (amount, price, total, cents, fee, cost, balance) multiplied or divided by 100 by hand",instead:"createMoneyFormatter / useCurrency from efficient-storefront-blocks (render/components/CurrencyContext) for a shopper; formatMoney / currencyDecimals from efficient-shell for the ERP"},"local-helper":{counts:"a local definition (function or const) of a helper a package exports, by name: escapeHtml, deepEqual, timeAgo, formatBytes, hexToRgb and the rest of LOCAL_HELPERS",instead:"import the helper from its home (LOCAL_HELPERS in efficient-shell src/ui-check/kinds.ts names each one)"},"dialog-frame":{counts:"a className on a shell Dialog, PopupForm or ConfirmDialog that redraws its frame: a zero padding, no width or height cap, or a screen-sized or calc() width or height",instead:'a Dialog size: size="full" for a chooser laid out like a window (head bar, body that fills and scrolls), with headerActions for buttons beside the cross'},"scaled-frame":{counts:"a drawing scaled from the top left by hand: a top-left transform origin as a style key or a DOM write (transformOrigin = top left, left top, 0 0, 0% 0%, 0px 0px), in CSS text inside a string, or as the Tailwind origin class for the top left (named or an arbitrary zero)",instead:"FitFrame (a preview drawn at a logical size), or fitScale / fitBoxScale / fitFrameStyle, from efficient-shell/ui: the one home of the fit (harness ARCH-3)"},"deprecated-undated":{counts:'a @deprecated note (a block comment, or a run of whole-line comments) that does not say "delete by YYYY-MM-DD" with a real day from today to 6 months out, or that still says "next major"',instead:'write the day the thing goes ("Delete by 2026-12-15, after <the move>") and a backlog line that owns the move; on that day delete it, or set a new day with the reason'}},w={escapeHtml:"efficient-shell (utils/escapeHtml)",deepEqual:"efficient-easel (data)",draftsEqual:"efficient-easel deepEqual (data)",timeAgo:"efficient-shell (format)",formatBytes:"efficient-shell (format)",formatFileSize:"efficient-shell formatBytes (format)",fileSize:"efficient-shell formatBytes (format)",humanSize:"efficient-shell formatBytes (format)",hexToRgb:"efficient-shell (forms/color)",parseHex:"efficient-shell parseHexColor (forms/color)",parseHexColor:"efficient-shell (forms/color)",hexOf:"efficient-shell parseHexColor (forms/color)",withAlpha:"efficient-shell hexWithAlpha (forms/colorMix)",isDarkInk:"efficient-shell readableInk (forms/color)",relativeLuminance:"efficient-shell (forms/color)",contrastRatio:"efficient-shell (forms/color)"},$=["@headlessui/","@radix-ui/","@mui/","@chakra-ui/","@mantine/","@floating-ui/","antd","react-aria","react-aria-","react-bootstrap","react-select","react-colorful","react-tooltip","react-hot-toast","react-toastify","sonner","efficient-shell-checker"],x=["@heroicons/","@tabler/icons","@tabler/icons-","@phosphor-icons/","@fortawesome/","@iconify/","@radix-ui/react-icons","@mui/icons-material","lucide","lucide-react","simple-icons","react-icons","react-feather"],k=["recharts","chart.js","react-chartjs-2","d3","d3-","@nivo/","victory","victory-","echarts","echarts-for-react","apexcharts","react-apexcharts","@visx/","highcharts","highcharts-react-official","plotly.js","plotly.js-dist","react-plotly.js","lightweight-charts","@antv/g2","@antv/g2plot","chartist","billboard.js","c3","uplot"],b={"efficient-shell":["@headlessui/react"]};function y(e,t){return t.some(t=>t.endsWith("/")||t.endsWith("-")?e.startsWith(t):e===t||e.startsWith(`${t}/`))}function v(e){return y(e,x)?"icon":y(e,$)?"kit":y(e,k)?"chart":null}function S(e){const t=v(e);return"kit"===t||"icon"===t?"kit-dep":"chart"===t?"chart-dep":null}var E=/[.+^$()|[\]\\]/g;function j(e){let t="",n=0;for(let i=0;i<e.length;i++){const o=e[i];"*"===o?"*"===e[i+1]?"/"===e[i+2]?(t+="(?:[^/]+/)*",i+=2):(t+=".*",i+=1):t+="[^/]*":"?"===o?t+="[^/]":"{"===o?(t+="(?:",n+=1):"}"===o&&n>0?(t+=")",n-=1):t+=","===o&&n>0?"|":o.replace(E,"\\$&")}if(0!==n)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${t}$`)}function z(e){const t=e.map(j);return e=>t.some(t=>t.test(e))}var I=new Set(["node_modules",".git"]),T=new Set(["dist","coverage",".next",".turbo"]);function A(e){const t=e.search(/[*?{]/),n=-1===t?e:e.slice(0,t),i=n.lastIndexOf("/");return-1===i?"":n.slice(0,i)}function C(e,t){const i=z(t),o=[...new Set(t.map(A))].sort(),s=o.filter(e=>!o.some(t=>t!==e&&(""===t||e.startsWith(`${t}/`)))),r=new Set,l=t=>{let o;try{o=a(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?I.has(e.name)||""===t&&T.has(e.name)||l(n):e.isFile()&&i(n)&&r.add(n)}};for(const e of s)l(e);return[...r].sort(R)}var R=(e,t)=>e<t?-1:e>t?1:0,M=class extends Error{},N=(e,t)=>`${e}:${t}`;function L(e){const t=e.lastIndexOf(":");return{file:e.slice(0,t),kind:e.slice(t+1)}}var D=e=>c.indexOf(e);function B(e,t){const n=L(e),i=L(t);return R(n.file,i.file)||D(n.kind)-D(i.kind)}function O(e,t="ui-kit.baseline.json"){let n;try{n=JSON.parse(e)}catch(e){throw new M(`${t} is not valid JSON: ${e.message}`)}const i=e=>{throw new M(`${t}: ${e}. The tool writes this file; do not edit it by hand.`)};if("object"!=typeof n||null===n||Array.isArray(n))return i("must be a JSON object");const o=n;if(1!==o.schema)return i("number"==typeof o.schema&&o.schema>1?`"schema": ${o.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');if(!Array.isArray(o.kinds)||o.kinds.some(e=>"string"!=typeof e))return i('"kinds" must be a list');const s=o.kinds.filter(d);if("object"!=typeof o.counts||null===o.counts||Array.isArray(o.counts))return i('"counts" must be an object');const r=new Map;for(const[e,t]of Object.entries(o.counts)){const{file:n,kind:o}=L(e);if(!n||!o)return i(`"${e}" is not "<file>:<kind>"`);if("number"!=typeof t||!Number.isInteger(t)||t<1)return i(`"${e}" must be a whole number, 1 or more (a line that reaches 0 is deleted)`);d(o)&&r.set(e,t)}return{kinds:s,counts:r}}function P(e){const t=c.filter(t=>e.kinds.includes(t)),n=[...e.counts.keys()].filter(t=>(e.counts.get(t)??0)>0).sort(B).map(t=>` ${JSON.stringify(t)}: ${e.counts.get(t)}`);return["{",' "schema": 1,',` "kinds": [${t.map(e=>JSON.stringify(e)).join(", ")}],`,n.length?` "counts": {\n${n.join(",\n")}\n }`:' "counts": {}',"}",""].join("\n")}function F(e){const t={};for(const[n,i]of e){const{kind:e}=L(n);d(e)&&(t[e]=(t[e]??0)+i)}return t}var U=class extends Error{},_=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),J=new Set(["$schema","schema","kinds","include","exclude","includeImporting","output","includeCopies","allow"]);function q(e,t="ui-kit.config.json"){const n=[],i=e=>{n.push(e)},o=(e,t,{required:n=!1}={})=>{if(void 0===e&&!n)return[];if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||""===e))return i(`${t} must be a list of non-empty strings`),[];n&&0===e.length&&i(`${t} must name at least one entry`);for(const n of e)(n.startsWith("/")||n.startsWith("./")||n.includes("\\")||n.split("/").includes(".."))&&i(`${t}: "${n}" must be a path from the repository root, written with / (no ./, .. or \\)`);return e},s=(e,t)=>"string"!=typeof e||e.trim().length<10?(i(`${t} needs a "reason" a reviewer can read (a sentence, not a word)`),""):e,r=(e,t)=>void 0===e?[]:!Array.isArray(e)||e.some(e=>!_(e))?(i(`${t} must be a list of objects`),[]):e;if(!_(e))throw new U(`${t}: must be a JSON object`);for(const t of Object.keys(e))J.has(t)||i(`unknown key "${t}"`);1!==e.schema&&i("number"==typeof e.schema&&e.schema>1?`"schema": ${e.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');const a=[];if(Array.isArray(e.kinds)&&0!==e.kinds.length)for(const t of e.kinds)d(t)?a.includes(t)?i(`"kinds": "${t}" is listed twice`):a.push(t):i(`"kinds": unknown kind ${JSON.stringify(t)} (this efficient-shell knows: ${c.join(", ")})`);else i(`"kinds" must list the kinds this repository checks, from: ${c.join(", ")}`);const l=o(e.include,'"include"'),u=o(e.exclude,'"exclude"'),h=r(e.includeImporting,'"includeImporting"').map((e,t)=>({files:o(e.files,`"includeImporting"[${t}].files`,{required:!0}),modules:o(e.modules,`"includeImporting"[${t}].modules`,{required:!0}),reason:s(e.reason,`"includeImporting"[${t}]`)}));0===l.length&&0===h.length&&i('"include" must name the files that are operator UI (for example ["src/**/*.tsx"])');const f=r(e.output,'"output"').map((e,t)=>({files:o(e.files,`"output"[${t}].files`,{required:!0}),reason:s(e.reason,`"output"[${t}]`)})),g=o(e.includeCopies,'"includeCopies"');g.length&&!a.some(m)&&i(`"includeCopies" is read only by the copied-value kinds (${p.join(", ")}), and "kinds" names none of them`);const w=[],$=new Set;if(r(e.allow,'"allow"').forEach((e,t)=>{const n=`"allow"[${t}]`,[r]=o([e.file],`${n}.file`),l=s(e.reason,n);if(!d(e.kind))return void i(`${n}.kind must be one of: ${c.join(", ")}`);if(a.includes(e.kind)||i(`${n}: kind "${e.kind}" is not in "kinds"`),"number"!=typeof e.count||!Number.isInteger(e.count)||e.count<1)return void i(`${n}.count must be a whole number, 1 or more`);if(!r)return;const u=`${r}:${e.kind}`;$.has(u)&&i(`${n}: ${r} already has an allow entry for "${e.kind}"`),$.add(u),w.push({file:r,kind:e.kind,count:e.count,reason:l})}),n.length)throw new U(`${t}:\n - ${n.join("\n - ")}`);return{schema:1,kinds:c.filter(e=>a.includes(e)),include:l,exclude:u,includeImporting:h,output:f,includeCopies:g,allow:w}}var W="package.json",H=[2,4,8,12,16,20,24,32,40,48];function G(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&H.includes(4*t)}var Y=e=>String(e).padStart(2,"0"),K=/^(\d{4})-(\d{2})-(\d{2})$/;function V(e){return`${function(e){return`${e.getFullYear()}-${Y(e.getMonth()+1)}`}(e)}-${Y(e.getDate())}`}function Z(e){const t="string"==typeof e?K.exec(e):null;if(!t)return null;const n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return V(n)===e?n:null}var Q=new Set(["iframe","frame","object","embed"]),X=new Set(["href","xlinkHref","to","id","key","htmlFor"]),ee=/(?<![&\w])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,te=/(?<![\w-])rounded(?:-(?:[trblse]|tl|tr|br|bl|ss|se|ee|es))?-\[([^\]]*)\]/g,ne=/^border(?:(?:Top|Bottom)(?:Left|Right)|(?:Start|End)(?:Start|End))?Radius$/,ie=/^(?:inherit|initial|unset|revert)$|var\(|^(?:50|100)%$|^(?:999|9999)(?:px)?$/,oe=/(?<![\w-])-?(?:p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|space-x|space-y)-(\d+(?:\.\d+)?|px|\[[^\]]*\])(?![\w.[/-])/g,se=/(?<![\w-])text-\[(?:length:)?(\d*\.?\d+(?:px|rem|em|%))\]/g,re=/(?<![\w-])z-(\d+|\[[^\]]*\])(?![\w.[/-])/g,ae=/(?<![\w-])shadow-(xs|2xs|md|2xl|\[[^\]]*\])(?![\w.[/-])/g,le=/var\(|^(?:inherit|initial|unset|revert|revert-layer|none|auto)$/,ce=/^(?:(?:padding|margin)(?:Top|Right|Bottom|Left|Inline|Block|InlineStart|InlineEnd|BlockStart|BlockEnd)?|gap|rowGap|columnGap)$/,de=new Set([0,...H]),ue=/var\(\s*--sf-site-gutter\s*,\s*-?\d/g,he=/(?<![\w.-])960px(?![\w-])/g,fe=/(?:^|[^\w-])\/(?:wheels|journal|tyres)\/$/,pe=/root:default-zone/g,me="top left|left top|0 0|0% 0%|0px 0px",ge=new RegExp(`^\\s*(?:${me})\\s*$`),we=(...e)=>["origin",...e].join("-"),$e=new RegExp([`(?:transformOrigin|transform-origin)\\s*[:=]\\s*["'\`]?\\s*(?:${me})(?![\\w%-])`,`(?<![\\w-])!?${we("top","left")}(?![\\w-])`,`(?<![\\w-])!?${we("\\[0_0\\]")}`].join("|")),xe=/max-width:\s*767px(?![\w-])/g,ke=/\((?:max|min)-width/,be=/(?:^|[a-z0-9_])(?:amount|price|total|subtotal|cents|fee|fees|cost|balance)$|(?:Amount|Price|Total|Subtotal|Cents|Fee|Fees|Cost|Balance)$/,ye=/(?<![\w-])dark:(?=[\w[\-!@*(])/g,ve="slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose",Se="(?:50|[1-9]00|950)",Ee=new RegExp(`(?<![\\w-])(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|inset-ring|outline|divide|fill|stroke|from|via|to|shadow|inset-shadow|drop-shadow|accent|caret|decoration|placeholder)-(?:(?:${ve})-${Se}|white|black)(?:\\/[\\w.]+)?(?![\\w-])`,"g"),je=new RegExp(`--color-(?:(?:${ve})-${Se}|white|black)(?![\\w-])`,"g"),ze=/(?<![\w-])(?:rgba?|hsla?|hwb|oklch|oklab|lab|lch)\(\s*[\d.]/g,Ie=/(?<![\w-])(?:white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|maroon|navy|teal|olive|lime|aqua|fuchsia|brown|gold|beige|ivory|tan|crimson|coral|salmon|indigo|violet)(?![\w-])/gi,Te=/^(?:color|background(?:Color)?|border(?:Top|Right|Bottom|Left|Inline|Block)?(?:Color)?|outline(?:Color)?|fill|stroke|caretColor|accentColor|textDecorationColor|boxShadow|textShadow)$/,Ae=/(?<![&a-zA-Z0-9])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,Ce=e=>[...e.matchAll(Ae)].length+[...e.matchAll(ze)].length+[...e.matchAll(Ee)].length+[...e.matchAll(je)].length,Re=new Set(["button","a","option","Button","IconButton","SplitButton","Link","NavLink","PopupMenuItem","PopupMenuLabel","DropdownMenuItem","MenuItem","ContextMenuItem"]),Me=/(?:…|\.\.\.|&hellip;)\s*$/,Ne=new RegExp("\\p{L}","u"),Le=new RegExp("\\p{L}[\\p{L}-]*","u"),De={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"],zhStarts:["正在"],zhEnds:["中"]},placeholder:{},prompt:{}},Be=new Set((De.busy?.words??[]).map(e=>e.toLowerCase())),Oe=new Set(["label","aria-label",...De.placeholder?[]:["placeholder","searchPlaceholder","emptyOptionLabel","blankLabel"]]),Pe=(e,t)=>{if(!Me.test(t)||!Ne.test(e))return!1;const n=e.match(Le)?.[0]?.toLowerCase();if(n&&Be.has(n))return!1;const i=e.replace(Me,"").trim(),o=De.busy;return!(o&&(o.zhStarts.some(e=>i.startsWith(e))||o.zhEnds.some(e=>i.endsWith(e))))},Fe=new Set(["confirm","alert","prompt"]),Ue=new Set(["window","globalThis","self"]),_e=/^(?:\w+\.)?(?:Dialog|PopupForm|ConfirmDialog)$/,Je=(...e)=>e.join("-"),qe="vw|vh|dvw|dvh|svw|svh|lvw|lvh",We=[`${Je("p[xytrblse]?","")}(?:0|\\[0(?:px)?\\])`,`${Je("max","[wh]","")}(?:none|screen|full|\\[[^\\]]+\\])`,`${Je("h","")}(?:full|screen|${qe})`,`${Je("w","")}(?:screen|${qe})`,`${Je("[wh]","")}\\[[^\\]]*(?:\\d(?:${qe}|%)|calc\\()[^\\]]*\\]`,`${Je("min","h","")}(?:screen|${qe}|\\[[^\\]]+\\])`],He=new RegExp(`(?<![\\w-])!?(?:${We.join("|")})(?![\\w.-])`);var Ge=e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"),Ye=e=>/\.(?:css|scss)$/.test(e),Ke=/^(?:color|background(?:-color)?|border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?(?:-color)?|outline(?:-color)?|fill|stroke|caret-color|accent-color|text-decoration(?:-color)?|box-shadow|text-shadow|column-rule(?:-color)?)$/;function Ve(e,t){if(!t.includes("colour"))return{};const n=e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g," ")),i=[],o=e=>n.slice(0,e).split("\n").length;let s=0,r=0;for(let e=0;e<n.length;e++){const t=n[e];if("{"===t||"}"===t||";"===t){const a=n.slice(r,e);if("{"!==t&&s>0){const e=r+(a.length-a.trimStart().length),t=a.trim(),n=t.indexOf(":");if(t.startsWith("@apply"))for(let n=[...t.matchAll(Ee)].length;n>0;n--)i.push(o(e));else if(n>0){const s=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1);if(!/^(?:-webkit-)?mask/.test(s)){const t=Ce(r)+(Ke.test(s)?[...r.matchAll(Ie)].length:0);for(let n=0;n<t;n++)i.push(o(e))}}}"{"===t?s++:"}"===t&&(s=Math.max(0,s-1)),r=e+1}}return i.length?{colour:i}:{}}function Ze(e,t,n,i,o){const s=new Set(i),r=e.createSourceFile(t,n,e.ScriptTarget.Latest,!0,function(e,t){return t.endsWith(".tsx")?e.ScriptKind.TSX:t.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(t)?e.ScriptKind.JS:e.ScriptKind.TS}(e,t)),a={},l=/\.[jt]sx$/.test(t),c=e=>r.getLineAndCharacterOfPosition(e).line+1,d=(e,t)=>{s.has(e)&&(a[e]??=[]).push(c(t.getStart(r)))},u=(t,n)=>t.attributes.properties.find(t=>e.isJsxAttribute(t)&&t.name.getText(r)===n),h=t=>{const n=t?.initializer;if(n)return e.isStringLiteral(n)?n.text:e.isJsxExpression(n)&&n.expression&&e.isStringLiteralLike(n.expression)?n.expression.text:void 0},f=new Set;if(s.has("native")){const t=n=>{if(n)if(e.isIdentifier(n))Fe.has(n.text)&&f.add(n.text);else if(e.isObjectBindingPattern(n)||e.isArrayBindingPattern(n))for(const i of n.elements)e.isBindingElement(i)&&t(i.name)},n=i=>{(e.isImportClause(i)||e.isImportSpecifier(i)||e.isNamespaceImport(i)||e.isVariableDeclaration(i)||e.isParameter(i)||e.isFunctionDeclaration(i))&&t(i.name),e.forEachChild(i,n)};n(r)}const p=t=>t&&e.isStringLiteralLike(t)?t.text:void 0,m=(e,t)=>{e&&("efficient-shell"===e||e.startsWith("efficient-shell/"))&&o?.add(e);const n=e?v(e):null;n&&d(n,t)},g=(e,t,n)=>{if(s.has("dark"))for(const n of e.matchAll(ye))d("dark",t);if(s.has("radius"))for(const n of e.matchAll(te))ie.test(n[1].trim())||d("radius",t);if(n&&l&&s.has("hex"))for(const n of e.matchAll(ee))d("hex",t);if(n&&s.has("colour"))for(let n=Ce(e);n>0;n--)d("colour",t);if(s.has("spacing"))for(const n of e.matchAll(oe)){const e=n[1];(e.startsWith("[")?le.test(e.slice(1,-1).trim()):G(e))||d("spacing",t)}if(s.has("font-size"))for(const n of e.matchAll(se))d("font-size",t);if(s.has("z-index"))for(const n of e.matchAll(re)){const e=n[1].startsWith("[")?n[1].slice(1,-1).trim():n[1];/^\d+$/.test(e)&&Number(e)>30&&d("z-index",t)}if(s.has("shadow"))for(const n of e.matchAll(ae))n[1].startsWith("[")&&le.test(n[1].slice(1,-1).trim())||d("shadow",t);if(s.has("gutter-literal"))for(const n of e.matchAll(ue))d("gutter-literal",t);if(s.has("view-line-literal"))for(const n of e.matchAll(he))d("view-line-literal",t);if(s.has("route-literal")&&fe.test(e)&&d("route-literal",t),s.has("root-zone-literal"))for(const n of e.matchAll(pe))d("root-zone-literal",t);if(s.has("phone-query"))for(const n of e.matchAll(xe))d("phone-query",t);s.has("scaled-frame")&&$e.test(e)&&d("scaled-frame",t)},$=t=>{if(t)return e.isJsxExpression(t)?$(t.expression):e.isStringLiteralLike(t)?t.text:e.isTemplateExpression(t)?[t.head.text,...t.templateSpans.map(e=>e.literal.text)].join(" "):void 0},x=t=>e.isNumericLiteral(t)&&100===Number(t.text),k=(t,n,i)=>{const o=e.isStringLiteralLike(n)?n.text.trim():void 0;if(s.has("colour")&&void 0!==o&&Te.test(t))for(const e of o.matchAll(Ie))d("colour",i);if(s.has("spacing")&&ce.test(t))e.isNumericLiteral(n)?de.has(Number(n.text))||d("spacing",i):void 0!==o&&!le.test(o)&&(e=>[...e.matchAll(/(-?\d*\.?\d+)(px|rem|em)\b/g)].map(e=>Math.abs(Number(e[1]))*("px"===e[2]?1:16)))(o).some(e=>!de.has(e))&&d("spacing",i);else if(s.has("font-size")&&"fontSize"===t)(e.isNumericLiteral(n)||void 0!==o&&!le.test(o)&&!/^(?:smaller|larger)$/.test(o))&&d("font-size",i);else if(s.has("z-index")&&"zIndex"===t){const t=[],o=n=>{e.isNumericLiteral(n)||e.isStringLiteralLike(n)&&/^\d+$/.test(n.text.trim())?t.push(Number(n.text)):e.forEachChild(n,o)};o(n);for(const e of t)e>30&&d("z-index",i)}else s.has("shadow")&&"boxShadow"===t&&(void 0===o||""===o||le.test(o)||d("shadow",i))},b=(t,n)=>{if(e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)){const e=t.tagName.getText(r);if(s.has("sizes-literal")){const e=$(u(t,"sizes")?.initializer);void 0!==e&&ke.test(e)&&d("sizes-literal",t)}if(s.has("dialog-frame")&&_e.test(e)){const e=u(t,"className")?.initializer?.getText(r);void 0!==e&&He.test(e)&&d("dialog-frame",t)}if(/^[a-z]/.test(e)){const n=h(u(t,"type"));"svg"===e&&d("svg",t),"button"===e?d("button",t):"select"===e?d("select",t):"textarea"===e?d("textarea",t):"input"===e&&("range"===n?d("range",t):"hidden"!==n&&d("input",t));const i=h(u(t,"role"));"dialog"!==e&&"dialog"!==i&&"alertdialog"!==i||d("dialog",t),!Q.has(e)&&u(t,"title")&&d("title",t)}}else if(e.isCallExpression(t)){const n=t.expression;e.isIdentifier(n)?"createPortal"===n.text?d("portal",t):Fe.has(n.text)&&!f.has(n.text)?d("native",t):"require"===n.text&&m(p(t.arguments[0]),t):e.isPropertyAccessExpression(n)?"createPortal"===n.name.text?d("portal",t):Fe.has(n.name.text)&&e.isIdentifier(n.expression)&&Ue.has(n.expression.text)&&d("native",t):n.kind===e.SyntaxKind.ImportKeyword&&m(p(t.arguments[0]),t)}else{if(e.isImportDeclaration(t)||e.isExportDeclaration(t))return void m(p(t.moduleSpecifier),t);if(e.isPropertyAssignment(t)){const n=e.isIdentifier(t.name)||e.isStringLiteralLike(t.name)?t.name.text:"",i=t.initializer;if(k(n,i,t),s.has("scaled-frame")&&"transformOrigin"===n){const e=$(i);void 0!==e&&ge.test(e)&&d("scaled-frame",t)}if(s.has("sizes-literal")&&"sizes"===n){const e=$(i);void 0!==e&&ke.test(e)&&d("sizes-literal",t)}s.has("radius")&&ne.test(n)&&(e.isNumericLiteral(i)?ie.test(i.text)||d("radius",t):e.isStringLiteralLike(i)&&!ie.test(i.text.trim())&&d("radius",t))}else if(e.isBinaryExpression(t)){const n=t.operatorToken.kind;if(s.has("scaled-frame")&&n===e.SyntaxKind.EqualsToken&&e.isPropertyAccessExpression(t.left)&&"transformOrigin"===t.left.name.text){const e=$(t.right);void 0!==e&&ge.test(e)&&d("scaled-frame",t)}if(s.has("money-cents")&&(n===e.SyntaxKind.AsteriskToken||n===e.SyntaxKind.SlashToken)){const i=x(t.right)?t.left:x(t.left)&&n===e.SyntaxKind.AsteriskToken?t.right:void 0,o=i&&(t=>{let n=t;for(;e.isParenthesizedExpression(n)||e.isNonNullExpression(n)||e.isAsExpression(n);)n=n.expression;return e.isCallExpression(n)&&(n=n.expression),e.isIdentifier(n)?n.text:e.isPropertyAccessExpression(n)?n.name.text:e.isElementAccessExpression(n)&&e.isStringLiteralLike(n.argumentExpression)?n.argumentExpression.text:void 0})(i);o&&be.test(o)&&d("money-cents",t)}}else if(s.has("local-helper")&&(e.isFunctionDeclaration(t)||e.isVariableDeclaration(t))&&t.name&&e.isIdentifier(t.name)&&Object.prototype.hasOwnProperty.call(w,t.name.text)&&(e.isFunctionDeclaration(t)?void 0!==t.body:void 0!==t.initializer&&(e.isArrowFunction(t.initializer)||e.isFunctionExpression(t.initializer))))d("local-helper",t);else if(e.isStringLiteralLike(t))g(t.text,t,n);else if(e.isTemplateExpression(t)){g(t.head.text,t.head,n);for(const e of t.templateSpans)g(e.literal.text,e.literal,n)}}e.isJsxAttribute(t)&&X.has(t.name.getText(r))?e.forEachChild(t,e=>b(e,!1)):e.forEachChild(t,e=>b(e,n))};if(b(r,!0),s.has("ellipsis-label")&&function(e,t,n){const i=new Set,o=(e,t)=>{i.has(e)||(i.add(e),n(t))},s=n=>{if(n)if(e.isStringLiteralLike(n))Pe(n.text,n.text)&&o(n,n.getStart(t));else if(e.isTemplateExpression(n)){const e=[n.head.text,...n.templateSpans.map(e=>e.literal.text)];Pe(e.join(" "),e[e.length-1])&&o(n,n.getStart(t))}else e.isConditionalExpression(n)?(s(n.whenTrue),s(n.whenFalse)):e.isBinaryExpression(n)?(s(n.left),s(n.right)):e.isParenthesizedExpression(n)||e.isAsExpression(n)||e.isJsxExpression(n)?s(n.expression):e.isCallExpression(n)&&nt.has(it(n.expression))&&n.arguments[0]&&s(n.arguments[0])},r=n=>{for(const i of n)if(e.isJsxText(i)){const e=i.getText(t);Pe(e,e)&&o(i,i.getStart(t)+(e.length-e.trimStart().length))}else e.isJsxExpression(i)?s(i.expression):(e.isJsxElement(i)||e.isJsxFragment(i))&&r(i.children)},a=(n,i)=>{const o=n.attributes.properties.find(n=>e.isJsxAttribute(n)&&n.name.getText(t)===i),s=o?.initializer;return s&&e.isStringLiteral(s)?s.text:s&&e.isJsxExpression(s)&&s.expression&&e.isStringLiteralLike(s.expression)?s.expression.text:void 0},l=t=>t.properties.some(t=>e.isPropertyAssignment(t)&&(e.isIdentifier(t.name)||e.isStringLiteralLike(t.name))&&"value"===t.name.text&&e.isStringLiteralLike(t.initializer)&&""===t.initializer.text),c=n=>{if(e.isJsxElement(n)){const e=n.openingElement,i=e.tagName.getText(t),o="option"===i&&De.prompt&&""===a(e,"value");Re.has(i)&&!o&&r(n.children)}else if(e.isJsxAttribute(n))Oe.has(n.name.getText(t))&&s(n.initializer);else if(e.isPropertyAssignment(n)){const t=e.isIdentifier(n.name)||e.isStringLiteralLike(n.name)?n.name.text:"",i=De.prompt&&e.isObjectLiteralExpression(n.parent)&&l(n.parent);Oe.has(t)&&!i&&s(n.initializer)}e.forEachChild(n,c)};c(t)}(e,r,e=>(a["ellipsis-label"]??=[]).push(c(e))),s.has("deprecated-undated")){const t=V(new Date);for(const n of function(e,t){const n=t.text,i=new Map,o=e=>e?.forEach(e=>i.set(e.pos,e)),s=t=>{o(e.getLeadingCommentRanges(n,t.pos)),o(e.getTrailingCommentRanges(n,t.end)),e.forEachChild(t,s)};s(t),o(e.getLeadingCommentRanges(n,t.endOfFileToken.pos));const r=[],a=e=>/^[ \t]*$/.test(n.slice(n.lastIndexOf("\n",e-1)+1,e));for(const t of[...i.values()].sort((e,t)=>e.pos-t.pos)){const i=n.slice(t.pos,t.end);if(t.kind===e.SyntaxKind.MultiLineCommentTrivia){r.push({pos:t.pos,text:i,end:t.end,run:!1});continue}const o=a(t.pos),s=r[r.length-1];o&&s?.run&&/^[ \t]*\r?\n[ \t]*$/.test(n.slice(s.end,t.pos))?(s.text+="\n"+i,s.end=t.end):r.push({pos:t.pos,text:i,end:t.end,run:o})}return r}(e,r)){const e=n.text.indexOf("@deprecated");e>=0&&tt(n.text,t)&&(a["deprecated-undated"]??=[]).push(c(n.pos+e))}}return a}var Qe=/\b(?:delete|deleted|remove|removed|goes|go)\s+(?:[\w`'.-]+\s+){0,2}?by\s+(\d{4}-\d{2}-\d{2})\b/i,Xe=/next\s+major|major\s+after/i,et=6;function tt(e,t){const n=e.replace(/^\s*(?:\/\*\*?|\*\/|\*|\/\/)\s?/gm,"");if(Xe.test(n))return'it still says "next major": the delete day is the only promise';const i=Qe.exec(n);if(!i)return'no delete day ("delete by YYYY-MM-DD")';const o=Z(i[1]);if(!o)return`${i[1]} is not a day`;const s=Z(t);if(!s)throw new Error(`today must be YYYY-MM-DD, got ${t}`);if(o<s)return`its delete day ${i[1]} is past`;const r=function(e,t){const n=new Date(e.getFullYear(),e.getMonth()+t,1),i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),i))}(s,et);return o>r?`its delete day ${i[1]} is more than ${et} months out (last ${V(r)})`:void 0}var nt=new Set(["say","t"]),it=e=>{const t=e.getText();return t.slice(t.lastIndexOf(".")+1)};function ot(e){const t={};for(const[n,i]of Object.entries(e))i.length&&(t[n]=i.length);return t}var st=(e,t,n,i)=>function(e,t,n){const i=e.createSourceFile(t,n,e.ScriptTarget.Latest,!1),o=[];for(const t of i.statements)(e.isImportDeclaration(t)||e.isExportDeclaration(t))&&t.moduleSpecifier&&e.isStringLiteralLike(t.moduleSpecifier)&&o.push(t.moduleSpecifier.text);return o}(e,t,n).some(e=>i.some(t=>t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t));var rt=e=>new Map(e.allow.map(e=>[N(e.file,e.kind),e.count]));function at(e,t){return e.kinds.filter(e=>t.kinds.includes(e))}var lt=(e,t,n)=>{if("kit-dep"===n)return` (${e.kitDeps.join(", ")})`;if("chart-dep"===n)return` (${e.chartDeps.join(", ")})`;const i=e.hits.get(t)?.[n]??[];if(0===i.length)return"";const o=i.slice(0,12).join(", ");return` (line${1===i.length?"":"s"} ${o}${i.length>12?", …":""})`};function ct(e,t,n){const i=rt(e),o=new Map;for(const[e,s]of t.counts){const{kind:t}=L(e);if(!d(t)||!n.includes(t))continue;const r=s-(i.get(e)??0);r>0&&o.set(e,r)}return{kinds:c.filter(e=>n.includes(e)),counts:o}}function dt(e,t){let n=0;for(const i of new Set([...e.keys(),...t.keys()]))(e.get(i)??0)!==(t.get(i)??0)&&(n+=1);return n}var ut="\n// <button> in a comment is not a button, and <svg> in one is not a drawing\n/* nor is <input title=\"x\"> in this one, or dark:bg-black, or #fff */\nimport { createPortal } from 'react-dom';\nimport { Dialog } from '@headlessui/react';\nimport { TrashIcon } from '@heroicons/react/24/outline';\nimport type { Icon } from 'lucide-react';\nimport { Button, confirm } from 'efficient-shell';\nexport { Slot } from '@radix-ui/react-slot';\nexport { CheckIcon } from '@radix-ui/react-icons';\nimport { LineChart } from 'recharts';\nimport 'd3-scale';\nexport { VictoryPie } from 'victory';\nimport { BarChart } from '@mui/x-charts';\nimport Tree from 'react-d3-tree';\nimport { TimeSeriesChart } from 'efficient-shell/ui';\n// import 'chart.js' in a comment is not an import, and 'echarts' in a string is not one either\nconst chartLabel = 'd3-array';\n\nconst a = <button title=\"Says what it does\">x</button>;\nconst b = <input type=\"range\" />;\nconst c = <input type=\"text\" />;\nconst c2 = <input type={\"hidden\"} name=\"csrf\" />;\nconst c3 = <input type=\"hidden\" />;\nconst c4 = <input type={kind} />;\nconst d = <select />;\nconst d2 = <textarea />;\nconst e = <div role=\"dialog\" />;\nconst e2 = <dialog open />;\nconst e3 = <section role={'alertdialog'} />;\nconst f = <iframe title=\"Preview\" />;\nconst f2 = <object title=\"Chart\" />;\nconst g = <Button title=\"a prop, not a tooltip\" role=\"dialog\" />;\nconst g2 = (\n <button\n type=\"button\"\n title={hint}\n >\n y\n </button>\n);\nconst h = ReactDOM.createPortal(a, document.body);\nconst i = createPortal(a, document.body);\n\nasync function leave() {\n if (window.confirm('Sure?')) return;\n globalThis.alert('No');\n alert('native: nothing binds the name');\n prompt('native too');\n await confirm('the shell: the import binds it');\n record.confirm('a method, not the popup');\n}\n\nconst j = <div className=\"bg-white dark:bg-black dark:hover:text-white is-dark:no\" />;\nconst k = clsx('text-gray-900', on && 'dark:text-gray-100');\nconst l = <span style={{ color: '#fff', background: \"#12ab34\" }} className={`border-[#0a0b0c80] ${x}`} />;\nconst m = <a href=\"#faded\" id=\"#bad\" key=\"#abc\" to=\"#face\">skip</a>;\nconst n = <label htmlFor={'#dead'}>skip</label>;\nconst o = <span>&#1234; and BG#00340 and #12345 and #added are not colours</span>;\nconst p = 'entity &#x1f; ref BG#00340';\nconst q = <use xlinkHref=\"#abc\" fill=\"url(#fed)\" />;\nconst t = <div className=\"rounded-[4px] rounded-t-[0.5rem] hover:rounded-[2px] rounded-lg rounded-(--radius-card) rounded-[inherit] rounded-[var(--r)]\" />;\nconst u = <div style={{ borderRadius: 6, borderTopLeftRadius: '3px', borderBottomRightRadius: '50%', borderEndEndRadius: 'var(--radius-card)' }} />;\nconst v = <i style={{ borderRadius: 9999 }} />;\nconst w = <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 4h16\" /></svg>;\nconst w2 = <Svg viewBox=\"0 0 24 24\" />;\nconst w3 = '<svg viewBox=\"0 0 1 1\"></svg> in a string is not an element';\nconst r = lazy(() => import('@mui/material'));\nconst s = require('react-select');\nconst s2 = require('chart.js/auto');\nconst s3 = import('@nivo/line');\n",ht={button:2,input:2,range:1,textarea:1,select:1,dialog:3,title:2,portal:2,native:4,dark:3,hex:3,radius:5,kit:5,icon:3,svg:1,chart:5,colour:8},ft={kit:1,dark:1,portal:1,radius:2,chart:1,colour:2},pt=(...e)=>e.join("-"),mt=`\nconst s1 = <i className="${[pt("px","2.5"),pt("py","1.5"),"md:"+pt("gap","1.5"),"-"+pt("mt","1.5"),pt("p","[10px]")].join(" ")}" />;\nconst s2 = <i className="${[pt("p","0"),pt("px","px"),pt("p","0.5"),pt("p","3"),pt("gap-x","4"),pt("p","12"),pt("p","(--space-12)"),pt("p","[var(--space-12)]"),pt("space-x","reverse"),pt("top","1.5")].join(" ")}" />;\nconst s3 = <i style={{ padding: 6, marginTop: '10px', gap: 8, margin: '0 auto', paddingInline: 'var(--space-12)' }} />;\nconst f1 = <i className="${[pt("text","[11px]"),pt("text","[0.8rem]"),pt("text","xs"),pt("text","[#fff]"),pt("text","(--text-2xs)")].join(" ")}" />;\nconst f2 = <i style={{ fontSize: 12 }} />;\nconst f3 = { fontSize: 'var(--x)', font: 'inherit' };\nconst z1 = <i className="${[pt("z","[9999]"),pt("z","50"),pt("z","10"),pt("z","30"),"-"+pt("z","10"),pt("z","auto"),pt("z","(--z-popup)"),pt("z","[var(--z-popup)]")].join(" ")}" />;\nconst z2 = { zIndex: on ? 2020 : 2010 };\nconst z3 = { zIndex: Z_LAYERS.popup, top: 9999 };\nconst h1 = <i className="${[pt("shadow","[0_1px_2px_#000]"),pt("shadow","md"),"shadow",pt("shadow","lg"),pt("shadow","(--elevation-panel)"),pt("shadow","black/20"),pt("drop-shadow","md")].join(" ")}" />;\nconst h2 = { boxShadow: '0 1px 2px rgba(0,0,0,.1)' };\nconst h3 = { boxShadow: 'none', outline: 'var(--elevation-raised)' };\n`,gt={spacing:7,"font-size":3,"z-index":4,shadow:3,hex:1,colour:4},wt={colour:4},$t={"ellipsis-label":9},xt=`\nconst d1 = <Dialog open size="2xl" className="${[pt("p","0"),pt("max-w","none")].join(" ")}" />;\nconst d2 = <PopupForm open className={\`${pt("w","[calc(100vw")}-2rem)] \${x}\`} />;\nconst d3 = <ui.Dialog open className="${pt("h","screen")}" />;\nconst d4 = <ConfirmDialog open className="${"!"+pt("max-h","none")}" />;\nconst d5 = <Dialog open className="${pt("w","[100vw]")}" />;\nconst d6 = <Dialog open className="${pt("h","[90vh]")}" />;\nconst d7 = <Dialog open className="${pt("max-w","[95vw]")}" />;\nconst d8 = <Dialog open className="${pt("h","dvh")}" />;\nconst d9 = <Dialog open className="${[pt("px","0"),pt("py","0")].join(" ")}" />;\nconst d10 = <Dialog open className="${pt("p","[0px]")}" />;\nconst k1 = <Dialog open size="full" headerActions={<Help />} />;\nconst k5 = <Dialog open className="${[pt("w","full"),pt("px","4")].join(" ")}" />;\nconst k2 = <Dialog open className="${[pt("p","0.5"),pt("max-w","md"),pt("p","0-x")].join(" ")}" />;\nconst k3 = <Panel className="${pt("p","0")}" />;\nconst k4 = <div className="${pt("max-w","none")}" />;\n`,kt={"dialog-frame":10,spacing:1},bt=`\n// "root:default-zone" and \`/wheels/\${slug}\` in a comment are not copies\nimport { escapeHtml } from 'efficient-shell/format';\nconst c1 = "${pt("pl","[var(--sf-site-gutter,40px)]")}";\nconst c2 = "var(--sf-site-gutter)";\nconst c3 = <i className="${pt("max","[960px]")}:hidden" />;\nconst c4 = "1960px";\nconst c5 = \`/wheels/\${slug}\`;\nconst c6 = "/tyres/" + slug;\nconst c7 = wheelPath(slug);\nconst c8 = { zone: "root:default-zone" };\nconst c9 = "(max-width: 767px)";\nconst c10 = <img sizes="(max-width: 800px) 100vw, 50vw" />;\nconst c11 = <img sizes={CONTENT_SIZES} />;\nconst c12 = Math.round(price * 100) / 100;\nconst c13 = ratio * 100;\nfunction escapeHtml(s: string) { return s; }\nconst c14 = timeAgo(when);\n/** @deprecated Remove at the next major. */\nconst c15 = 1;\nconst c16 = "@deprecated in a string";\n`,yt={"gutter-literal":1,"view-line-literal":1,"route-literal":2,"root-zone-literal":1,"phone-query":1,"sizes-literal":1,"money-cents":1,"local-helper":1,"deprecated-undated":1},vt=["transform","Origin"].join(""),St=`\nconst s1 = { ${vt}: 'top left' };\nel.style.${vt} = "0 0";\nconst s3 = { ${vt}: \`0% 0%\` };\nconst s4 = \`.frame { ${["transform","origin"].join("-")}: left top; }\`;\nconst s5 = <div className="${[pt("origin","top","left"),pt("scale","50")].join(" ")}" />;\nconst s6 = <div className="${pt("origin","[0_0]")}" />;\nconst n1 = { ${vt}: 'center' };\nconst n2 = { ${vt}: origin };\nconst n3 = <div className="${pt("origin","top")}" />;\nconst n4 = "top left";\n`,Et={"scaled-frame":6},jt=e=>c.filter(t=>e[t]).map(t=>`${t} ${e[t]}`).join(", ")||"nothing";var zt="ui-kit.config.json",It="ui-kit.baseline.json",Tt="efficient-shell-ui-check",At=`${Tt}: every surface a person operates takes its UI from efficient-shell (harness UI-24).\n\n ${Tt} check this repository against ${It}\n ${Tt} --print print today's counts as a baseline, and change nothing\n ${Tt} --summary print totals per kind and per folder, as Markdown\n ${Tt} --json print the result as JSON\n ${Tt} --update lower the lines whose counts fell, and delete the ones at zero\n ${Tt} --update --allow-move also follow a renamed or split file (no total may rise)\n ${Tt} --init write the first ${It}\n ${Tt} --init --kind <kind> take the baseline for a kind just added to "kinds"\n ${Tt} --no-base do not compare with the base branch (refused on a pull request)\n ${Tt} --base-lock run only on a release with the base-branch lock (an older one fails on the flag)\n\nKinds: ${c.join(", ")}\nReads ${zt} in the current directory.`;var Ct=(e,t)=>`${e} ${t}${1===e?"":"s"}`,Rt=(e,t)=>{const n=F(e);return t.map(e=>`${e} ${n[e]??0}`).join(" · ")};var Mt=[5e3,15e3];function Nt(e,t,n,i){const o=[];for(let s=0;s<n;s++){s>0&&e.sleep?.(Mt[Math.min(s-1,Mt.length-1)]);const n=e.gitDetail?e.gitDetail(t,12e4):{out:e.git(t),error:"git failed (no reason given)"};if(i())return o;o.push(`try ${s+1}: ${null===n.out?n.error:"git ran, and the commit is still not there"}`)}return o}function Lt(e,t){const n=t.env.RUNNER_NAME?`runner ${t.env.RUNNER_NAME}`:"a runner with no RUNNER_NAME";return`git fetch was tried ${e.length} times on ${n}: ${e.join("; ")}.`}function Dt(e,t,s,a,l){const c=e.env.GITHUB_BASE_REF,u=!c&&"push"===e.env.GITHUB_EVENT_NAME;if(!c&&!u)return{problems:[],note:"",warnings:[]};const h=c?`GITHUB_BASE_REF is "${c}"`:'GITHUB_EVENT_NAME is "push"',f=(e,t)=>({problems:[e],note:t,warnings:[]}),p=e.git(["rev-parse","--show-prefix"]);if(null===p)return f(`${h}, and git could not read this checkout, so the base branch could not be compared. The comparison is the lock: run the check in the git checkout, with git installed and the folder trusted (git config --global --add safe.directory <path>).`,"git could not read this checkout");let w=c?`origin/${c}`:"HEAD^1";const $=t=>null!==e.git(["rev-parse","--verify","--quiet",`${t}^{commit}`]);if(!$(w)){const t=Nt(e,c?["fetch","--no-tags","--depth=1","origin",`+refs/heads/${c}:refs/remotes/origin/${c}`]:["fetch","--no-tags","--deepen=1"],3,()=>$(w));if(!$(w)&&c)return f(`${h}, and ${w} could not be fetched, so the base branch could not be compared. On a pull request the comparison is the lock: give the job the base branch (git fetch origin ${c}). `+Lt(t,e),`${w} could not be fetched`);if(!$(w)){const n=function(e){const t=e.env.GITHUB_EVENT_PATH;if(!t)return null;try{const e=JSON.parse(o(t,"utf8")).before;return"string"!=typeof e||!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(e)||/^0+$/.test(e)?null:e}catch{return null}}(e);let i=[];if(null!==n&&(i=Nt(e,["fetch","--no-tags","--depth=1","origin",n],2,()=>$(n))),null===n||!$(n))return f(`${h}, and ${w} (the commit before this one) could not be read, so it could not be compared. On a push the comparison is the lock: give the job that commit (fetch-depth: 2). `+Lt(t,e)+(null===n?" The push event names no commit before this push (GITHUB_EVENT_PATH), so none was fetched in its place.":` The push's before commit ${n} could not be fetched either: ${i.join("; ")}.`),`${w} could not be fetched`);w=n}}const x=p.trim(),k=n(e.cwd,...x.split("/").filter(Boolean).map(()=>"..")),b=[],y=e.git(["show",`${w}:${x}${It}`]);if(null===y){const t=e.git(["ls-tree","-r","--full-tree","--name-only","-z",w]);if(null===t)return f(`${w} has no ${It} in this folder, and git could not list ${w}'s files, so a check that moved here cannot be told from an adoption.`,"adoption not confirmed");const o=t.split("\0").filter(e=>(e===It||e.endsWith(`/${It}`))&&!i(n(k,e)));return o.length?f(`${o.join(", ")} ${1===o.length?"is":"are"} on ${w} and gone here, and ${w} has no ${It} in this folder (${x||"the repository root"}): the check moved. Its lines would be taken as an adoption and never compared: keep the config and the baseline in the folder they were in.`,"the check moved"):{problems:[],note:`${w} has no ${It} yet (adoption)`,warnings:b}}const v=e=>`${w}'s ${e} could not be parsed, and this change replaces it with one that parses, so ${e===It?"the base branch was not compared":"no scope was checked for shrinking"}. The next change is compared against it as usual.`;let S;try{S=O(y,`${w}:${It}`)}catch{return{problems:[],note:`${w}'s ${It} could not be read; the base branch was not compared`,warnings:[v(It)]}}const E=new Map,j=t=>(E.has(t)||E.set(t,e.git(["show",`${w}:${x}${t}`])),E.get(t)??null);let I=null;try{const e=j(zt);null!==e&&(I=q(JSON.parse(e),`${w}:${zt}`))}catch{I=null}null===I&&b.push(v(zt));const T=[],A=new Set(a.kinds.filter(e=>s.kinds.includes(e)));for(const e of S.kinds)A.has(e)||T.push(`"${e}" is checked on ${w}, and not here ("kinds" in ${zt}, or ${It}). Its lines would never be counted again: keep the kind.`);const R=t=>{const i=t.split("/");for(let t=1;t<=i.length;t++)try{if(r(n(e.cwd,...i.slice(0,t))).isSymbolicLink())return!0}catch{return!1}return!1},M=new Set(l.copyOnly),D=new Set(l.files.filter(e=>!M.has(e))),B=(e,t)=>D.has(e)||M.has(e)&&d(t)&&m(t),P=new Set([...S.counts.keys()].map(e=>L(e)).filter(({file:e,kind:t})=>e!==W&&!B(e,t)).map(({file:e})=>e));for(const e of P)R(e)&&T.push(`${e} is under a symbolic link now (the file or a folder above it), and ${w} counted it. The walk does not follow it for every kind counted there, so those lines would never be counted again: keep the real file here.`);const U=rt(a),_=I?rt(I):U,J=e=>(S.counts.get(e)??0)+(_.get(e)??0),H=new Map;for(const e of new Set([...S.counts.keys(),..._.keys()])){const{file:t,kind:n}=L(e);t!==W&&0!==J(e)&&((H.get(t)??[]).includes(n)||H.set(t,[...H.get(t)??[],n]))}const G=e=>(H.get(e)??[]).filter(t=>{return n=`${e}:${t}`,(s.counts.get(n)??0)+(U.get(n)??0)<J(`${e}:${t}`);var n}),Y=[...H.keys()].filter(t=>!i(n(e.cwd,t))&&!R(t)),K=[...H.keys()].filter(e=>!Y.includes(e)&&!R(e)&&G(e).length>0),V=[...Y,...K];if(V.length){const i=e.git(["diff","-M30%","-C30%","--find-copies-harder","-l0","--no-relative","--name-status","-z",w]);if(null===i)T.push(`${Ct(V.length,"file")} that ${w} counted ${1===V.length?"is":"are"} gone or count less (${V.slice(0,3).join(", ")}${V.length>3?", …":""}), and git could not list the renames, so a move out of the check cannot be told from a delete.`);else{const e=new Map,s=i.split("\0");for(let t=0;t<s.length;){const n=s[t]??"";if(n.startsWith("R")||n.startsWith("C")){const[n,i]=[s[t+1],s[t+2]];n&&i&&e.set(n,[...e.get(n)??[],i]),t+=3}else t+=n?2:1}const r=(e,i,s)=>{const r=s.filter(d),a=Ye(e)&&Ye(i);if(!Ge(e)&&!a)return r;let l;try{l=o(n(k,e),"utf8")}catch{return r}if(a){const e=Ve(l,r);return r.filter(t=>(e[t]?.length??0)>0)}const c=Ze(t,e,l,r),u=Ze(t,i,l,r);return r.filter(e=>(c[e]?.length??0)+(u[e]?.length??0)>0)};for(const t of V){const n=Y.includes(t)?"moved to":"counts less, and git lists a copy of it at";for(const i of e.get(`${x}${t}`)??[]){const e=r(i,t,Y.includes(t)?H.get(t)??[]:G(t));if(!e.length)continue;if(!i.startsWith(x)){T.push(`${t} ${n} ${i}, outside the folder the check runs in, and it holds ${e.map(e=>`"${e}"`).join(", ")} that ${w} counted. Those lines would never be counted again: keep it in this folder, in a scope.`);continue}const o=i.slice(x.length),s=e.filter(e=>!B(o,e));s.length&&T.push(`${t} ${n} ${o}, and no scope reads it there for ${s.map(e=>`"${e}"`).join(", ")}. ${w} counted it, so those lines would never be counted again: move it into a scope, or widen one to it.`)}}}}if(I){const n=z(I.exclude),i=I.kinds.includes("colour"),o=e=>(Ge(e)||i&&Ye(e))&&!n(e),s=t=>C(e.cwd,[t]).some(o),r="keep the line; delete it only when the files it matches are gone.",c=(e,t,n)=>t.filter(e=>!n.includes(e)&&s(e)).map(t=>`"${e}" drops "${t}", which ${w} reads. Those files would never be counted again: ${r}`),d=(e,t,n)=>n.filter(e=>!t.includes(e)&&s(e)).map(t=>`"${e}" adds "${t}", which takes files ${w} reads out of the check. Those files would never be counted again.`),u=e=>e.flatMap(e=>e.files.flatMap(t=>e.modules.map(e=>({glob:t,module:e})))),h=new Set(u(a.includeImporting).map(({glob:e,module:t})=>`${e}\n${t}`));T.push(...c("include",I.include,a.include),...u(I.includeImporting).filter(({glob:e,module:t})=>!h.has(`${e}\n${t}`)&&s(e)).map(({glob:e,module:t})=>`"includeImporting" drops "${e}" (${t}), which ${w} reads. Those files would never be counted again: ${r}`),...c("includeCopies",I.includeCopies,a.includeCopies),...d("exclude",I.exclude,a.exclude),...d("output",I.output.flatMap(e=>e.files),a.output.flatMap(e=>e.files)));const f=new Set(l.copyOnly),p=new Set(l.files.filter(e=>!f.has(e))),m=z(I.include),g=z(I.output.flatMap(e=>e.files)),$=new Set;for(const i of I.includeImporting)for(const o of C(e.cwd,i.files)){if(!Ge(o)||n(o)||g(o)||m(o))continue;if(p.has(o)||$.has(o))continue;const e=j(o);null!==e&&st(t,o,e,i.modules)&&($.add(o),T.push(`${o} no longer imports ${i.modules.join(", ")}, so "includeImporting" stops reading it, and ${w} reads it. Keep the import, or read the file with "include".`))}}const Z=a.kinds.filter(m),Q=[],X=new Set,ee={};if(I){const e=z(I.exclude),n=z(I.include),i=z(I.output.flatMap(e=>e.files)),o=z(I.includeCopies),s=I.includeImporting.map(e=>({files:z(e.files),modules:e.modules})),r=o=>{if(e(o))return!1;if(n(o)&&!i(o))return!0;const r=s.filter(e=>e.files(o));if(!r.length||!Ge(o))return!1;const a=j(o);return null!==a&&r.some(e=>st(t,o,a,e.modules))};for(const n of l.files){if(r(n))continue;const i=M.has(n)?Z:a.kinds,s=!e(n)&&o(n),c=i.filter(e=>!(s&&m(e)));if(!c.length)continue;Q.push(n);for(const e of c)X.add(e);if(!Ge(n))continue;const d=j(n);if(null===d)continue;const u=Ze(t,n,d,c);for(const e of c){const t=Math.min(u[e]?.length??0,l.counts.get(`${n}:${e}`)??0);t>0&&(ee[e]=(ee[e]??0)+t)}}}const te=F(S.counts),ne=F(s.counts),ie=F(U),oe=F(_),se=(e,t,n)=>(e[n]??0)+(t[n]??0);if(T.push(...a.kinds.filter(e=>S.kinds.includes(e)&&se(ne,ie,e)>se(te,oe,e)+(ee[e]??0)).map(e=>{const t=(ie[e]??0)||(oe[e]??0),n=n=>t?` (and ${n[e]??0} in "allow")`:"";return`${It} holds ${ne[e]??0} of "${e}"${n(ie)}, and ${w} holds ${te[e]??0}${n(oe)}${Q.length?` (and ${ee[e]??0} in the files new to a scope)`:""}. The baseline only goes down, and "allow" with it: use ${g[e].instead}. A count that must stay goes in "allow" in ${zt}, with its reason, and the same count of that kind is burned down in this change.`})),I)for(const e of a.allow){const t=_.get(N(e.file,e.kind));void 0!==t&&e.count<=t||b.push(`"allow" in ${zt} ${void 0===t?"adds":`raises from ${t}`} ${e.file} (${e.kind}) at ${e.count}: ${e.reason}`)}const re=[`compared with ${w}`];return null===I&&re.push(`${w}'s ${zt} could not be read, so every line was compared and no scope was checked for shrinking`),Q.length&&re.push(`${[...X].every(m)?'"includeCopies" changed: ':""}${Q.length} file${1===Q.length?"":"s"} new to a scope, so ${1===Q.length?"its":"their"} ${a.kinds.filter(e=>X.has(e)).join(", ")} lines may hold what ${1===Q.length?"it":"they"} held on ${w}`),{problems:T,note:re.join("; "),warnings:b}}process.exitCode=function(e,t){const r=function(e){const t={print:!1,summary:!1,json:!1,update:!1,allowMove:!1,init:!1,noBase:!1,help:!1,version:!1,kinds:[]};for(let n=0;n<e.length;n++){const i=e[n];if("--print"===i)t.print=!0;else if("--summary"===i)t.summary=!0;else if("--json"===i)t.json=!0;else if("--update"===i)t.update=!0;else if("--allow-move"===i)t.allowMove=!0;else if("--init"===i)t.init=!0;else if("--no-base"===i)t.noBase=!0;else{if("--base-lock"===i)continue;if("--help"===i||"-h"===i)t.help=!0;else if("--version"===i||"-v"===i)t.version=!0;else if("--kind"===i){const i=e[++n];if(!i)return"--kind needs a kind after it";t.kinds.push(...i.split(","))}else{if(!i.startsWith("--kind="))return`unknown argument "${i}"`;t.kinds.push(...i.slice(7).split(","))}}}return t.allowMove&&!t.update?"--allow-move goes with --update":t.kinds.length&&!t.init?"--kind goes with --init":[t.print,t.summary,t.update,t.init].filter(Boolean).length>1?"choose one of --print, --summary, --update and --init":t}(e);if("string"==typeof r)return t.err(`${Tt}: ${r}\n\n${At}`),2;if(r.help)return t.out(At),0;if(r.version)return t.out(t.version),0;const a=e=>(r.json?t.out(JSON.stringify({tool:Tt,version:t.version,ok:!1,failures:[e]},null,2)):t.err(`${Tt}: ${e}`),1);if(r.noBase&&t.env.GITHUB_BASE_REF)return a("--no-base is refused on a pull request (GITHUB_BASE_REF is set): the base-branch comparison is what stops a pull request lowering its own baseline.");const l=n(t.cwd,zt);if(!i(l))return a(`no ${zt} in ${t.cwd}. Run it from the repository root; the harness has the template.`);let c,u;try{c=q(JSON.parse(o(l,"utf8")),zt)}catch(e){return a(e instanceof U?e.message:`${zt} is not valid JSON: ${e.message}`)}try{u=t.loadTypeScript()}catch{return a('this check reads the TypeScript AST and found no "typescript" package here. Install it as a devDependency.')}const p=function(e){const t=[],n=f,i=[["fixture.tsx",ut,ht],["fixture.ts","\nimport { toast } from 'sonner';\nimport { extent } from 'd3-array';\nexport const tone = { warn: '#f59e0b' };\nexport const cls = 'ring-1 dark:ring-white rounded-[3px]';\nexport const box = { borderRadius: '0.25rem', radius: 4 };\nexport function ask(confirm: (message: string) => boolean) {\n return confirm('a parameter binds the name');\n}\nexport const mount = (node: unknown) => ReactDOM.createPortal(node, document.body);\n",ft],["tokens.tsx",mt,gt],["labels.tsx","\n// <Button>Save…</Button> in a comment is not a label\nconst l1 = <Button>Extend trial…</Button>;\nconst l2 = <PopupMenuItem onClick={go}><span>Read from a PDF...</span></PopupMenuItem>;\nconst l3 = <Button>{busy ? 'Saving…' : 'Duplicate site…'}</Button>;\nconst l4 = <Item label=\"Translate…\" aria-label={'More…'} />;\nconst l5 = [{ label: 'Reject…' }, { value: CUSTOM, label: 'Custom…' }];\nconst l6 = <option value={CUSTOM}>Different address…</option>;\nconst l7 = <PopupMenuLabel>{say(\"Duplicate to page…\")}</PopupMenuLabel>;\nconst n7 = <Button>{t('team:menu.remove')}</Button>;\nconst n1 = <Button>{`${name.slice(0, 9)}…`}</Button>;\nconst n2 = <p>Loading weather…</p>;\nconst n3 = <Input placeholder=\"Search…\" />;\nconst n4 = <option value=\"\">Pick a carrier…</option>;\nconst n5 = [{ value: '', label: 'Select…' }];\nconst n6 = <Button>Extend trial</Button>;\n",$t],["copies.tsx",bt,yt],["frames.tsx",xt,kt],["scaled.tsx",St,Et]];for(const[o,s,r]of i){const i=ot(Ze(e,o,s,n));n.some(e=>(i[e]??0)!==(r[e]??0))&&t.push(`${o}: read ${jt(i)}; it holds ${jt(r)}`)}const o=ot(Ve('\n/* #fff in a comment */\n.a:hover { color: #111; border: 1px solid white; }\n[data-x="#fff"] { mask-image: linear-gradient(#000, transparent); color: var(--ink); }\n.b { --mine: rgb(0 0 0 / .5); background: var(--surface, #fff); }\n',n));n.some(e=>(o[e]??0)!==(wt[e]??0))&&t.push(`style.css: read ${jt(o)}; it holds ${jt(wt)}`);const s=ot(Ze(e,"fixture.tsx",ut,["button"]));return"button"!==Object.keys(s).join()&&t.push(`asked for button alone, the reader reported ${jt(s)}`),t}(u);if(p.length)return a(`the reader misread its own fixtures with typescript ${u.version}, so nothing it says about this repository can be trusted:\n - `+p.join("\n - "));const w=function(e,t,s){const r=[],a=z(s.exclude),l=z(s.output.flatMap(e=>e.files)),c=new Map,d=e=>{let i=c.get(e);return void 0===i&&c.set(e,i=o(n(t,e),"utf8")),i},u=(e,n)=>{for(const i of e)0===C(t,[i]).length&&r.push(`${n}: "${i}" matches no file. Delete the line, or fix the path.`)};u(s.include,'"include"'),s.output.forEach((e,t)=>u(e.files,`"output"[${t}]`)),s.includeImporting.forEach((e,t)=>u(e.files,`"includeImporting"[${t}]`)),u(s.includeCopies,'"includeCopies"');const f=new Set,p=s.kinds.includes("colour"),g=e=>(Ge(e)||p&&Ye(e))&&!a(e)&&!l(e);for(const e of C(t,s.include))g(e)&&f.add(e);for(const n of s.includeImporting)for(const i of C(t,n.files))g(i)&&Ge(i)&&!f.has(i)&&st(e,i,d(i),n.modules)&&f.add(i);const w=s.kinds.filter(m),$=new Set;if(w.length)for(const e of C(t,s.includeCopies))!Ge(e)||a(e)||f.has(e)||$.add(e);const x=[...f,...$].sort(),k=s.kinds.filter(e=>!h(e)),y=new Map,v=new Map,E=new Set;for(const t of x){const n=$.has(t),i=n?w:k,o=Ye(t)?Ve(d(t),i):Ze(e,t,d(t),i,n?void 0:E);let s=!1;for(const e of i){const n=o[e]?.length??0;n&&(v.set(N(t,e),n),s=!0)}s&&y.set(t,o)}let j=[],I=[],T=[];const A=s.kinds.filter(h);if(A.length){const e=n(t,W);if(i(e)){const t=JSON.parse(o(e,"utf8")),n=["dependencies","peerDependencies","optionalDependencies"].flatMap(e=>Object.keys(t[e]??{})),i=new Set([...E].flatMap(e=>b[e]??[])),r=[...new Set(n)].sort();if(s.kinds.includes("kit-dep")){const e=r.filter(e=>"kit-dep"===S(e));j=e.filter(e=>!i.has(e)),I=e.filter(e=>i.has(e)),j.length&&v.set(N(W,"kit-dep"),j.length)}s.kinds.includes("chart-dep")&&(T=r.filter(e=>"chart-dep"===S(e)),T.length&&v.set(N(W,"chart-dep"),T.length))}else for(const e of A)r.push(`"kinds" includes "${e}", and there is no ${W} here to read.`)}for(const e of s.allow)(h(e.kind)?e.file===W:f.has(e.file)||m(e.kind)&&$.has(e.file))||r.push(`"allow": ${e.file} (${e.kind}) is not a file this check reads. Delete the entry, or fix the path.`);return{files:x,copyOnly:[...$].sort(),hits:y,counts:v,kitDeps:j,shellPeers:I,chartDeps:T,problems:r}}(u,t.cwd,c);if(0===w.files.length)return a(`read no files. "include" in ${zt} matches nothing, so a pass would mean nothing.`);const $=n(t.cwd,It),x=r.json,k=e=>{x||t.out(e)};if(r.print)return t.out(P(ct(c,w,c.kinds)).trimEnd()),0;if(r.summary){for(const e of function(e,t){const n=new Map,i=new Map;for(const[e,o]of t.counts){const{file:t,kind:s}=L(e);if(!d(s))continue;const r=n.get(s)??{count:0,files:new Set};r.count+=o,r.files.add(t),n.set(s,r);const a=t.split("/"),l=a.length>2?a.slice(0,2).join("/"):2===a.length?a[0]:".",c=i.get(l)??{};c[s]=(c[s]??0)+o,i.set(l,c)}const o=e.kinds.filter(e=>n.has(e)),s=[`**UI kit check (harness UI-24):** ${new Set([...t.counts.keys()].map(e=>L(e).file)).size} of ${Ct(t.files.length,"file")} still draw UI of their own.`,"","| Kind | Count | Files | The shell has |","|---|---:|---:|---|",...e.kinds.map(e=>{const t=n.get(e);return`| \`${e}\` | ${t?.count??0} | ${t?.files.size??0} | ${g[e].instead} |`})];if(o.length&&i.size){const e=e=>o.reduce((t,n)=>t+(e[n]??0),0),t=[...i].sort((t,n)=>e(n[1])-e(t[1])||(t[0]<n[0]?-1:1));s.push("",`| Folder | ${o.map(e=>`\`${e}\``).join(" | ")} | Total |`,`|---|${o.map(()=>"---:").join("|")}|---:|`,...t.map(([t,n])=>`| \`${t}\` | ${o.map(e=>n[e]??0).join(" | ")} | ${e(n)} |`))}return s}(c,w))t.out(e);return 0}let y=null;if(i($))try{y=O(o($,"utf8"),It)}catch(e){return a(e instanceof M?e.message:String(e))}if(r.init){const e=r.kinds.filter(e=>!d(e)||!c.kinds.includes(e));if(e.length)return a(`--kind ${e.join(", ")}: not in "kinds" in ${zt}. Add it there first.`);const t=r.kinds;if(y){if(0===t.length)return a(`${It} already exists, and --init would overwrite what it holds. It is for the adoption pull request only. To start checking a kind, add it to "kinds" and run --init --kind <kind>.`);const e=t.filter(e=>y.kinds.includes(e));if(e.length)return a(`the baseline was already taken for ${e.join(", ")}. Its lines only go down; use --update.`);const n=ct(c,w,t);y={kinds:[...y.kinds,...t],counts:new Map([...y.counts,...n.counts])}}else{if(t.length)return a(`there is no ${It} yet. Run --init on its own first.`);y=ct(c,w,c.kinds)}s($,P(y)),k(`${Tt}: wrote ${It} (${Ct(y.counts.size,"line")}: ${Rt(y.counts,y.kinds)})`)}if(!y)return a(`no ${It}. This repository has not adopted the check yet: run ${Tt} --init, and commit the file.`);if(r.update){const e=function(e,t,n,{allowMove:i=!1}={}){const o=at(e,t),s=ct(e,n,o),r=new Map([...t.counts].filter(([e])=>o.includes(L(e).kind)));if(i){const e=F(r),n=F(s.counts),i=o.filter(t=>(n[t]??0)>(e[t]??0)).map(t=>`${t}: ${n[t]??0} across the repository, and the baseline holds ${e[t]??0}`);return i.length?{baseline:t,lowered:0,refused:i}:{baseline:s,lowered:dt(r,s.counts),refused:[]}}const a=new Map;for(const[e,t]of r){const n=Math.min(t,s.counts.get(e)??0);n>0&&a.set(e,n)}return{baseline:{kinds:o,counts:a},lowered:dt(r,a),refused:[]}}(c,y,w,{allowMove:r.allowMove});if(e.refused.length)return a(`--allow-move follows code that moved, and this is more of it than before:\n - ${e.refused.join("\n - ")}\nNothing was written.`);y=e.baseline,s($,P(y)),k(`${Tt}: ${e.lowered?`changed ${Ct(e.lowered,"line")} in`:"nothing to change in"} ${It}`)}const v=function(e,t,n){const i=[],o=[],s=[...n.problems],r=rt(e),a=new Set(at(e,t)),l=e.kinds.filter(e=>!t.kinds.includes(e));l.length&&s.push(`"kinds" names ${l.map(e=>`"${e}"`).join(", ")}, and the baseline was never taken for ${1===l.length?"it":"them"}. Run: efficient-shell-ui-check --init ${l.map(e=>`--kind ${e}`).join(" ")}`);const c=t.kinds.filter(t=>!e.kinds.includes(t));c.length&&o.push(`the baseline still carries ${c.map(e=>`"${e}"`).join(", ")}, which "kinds" no longer names`);const u=new Set([...n.counts.keys(),...t.counts.keys(),...r.keys()]);for(const e of[...u].sort(B)){const{file:l,kind:c}=L(e);if(!d(c)||!a.has(c))continue;const u=n.counts.get(e)??0,h=r.get(e)??0,f=t.counts.get(e)??0;u>h+f?i.push(`${l}: ${c} ${u}, and its line allows ${h+f}${lt(n,l,c)}. ${g[c].counts} is counted; use ${g[c].instead}.`):u<h?s.push(`${l}: ${c} ${u}, and "allow" in ui-kit.config.json says ${h}. ${0===u?"Delete the entry":`Lower its count to ${u}`}: an exception does not outlive what it excused.`):u<h+f&&o.push(`${l}: ${c} ${u}, and its line says ${h+f}`)}return{grown:i,shrunk:o,other:s,updateFixes:0===i.length&&0===s.length&&o.length>0}}(c,y,w),E=r.noBase?{problems:[],note:"",warnings:[]}:Dt(t,u,y,c,w),j=c.kinds.filter(e=>y.kinds.includes(e)),I=`${Tt} --update`,T=[...v.other,...v.grown,...v.shrunk.map(e=>`${e}. Run: ${I}`),...E.problems],A=0===T.length;if(r.json){const e=rt(c);return t.out(JSON.stringify({tool:Tt,version:t.version,ok:A,schema:c.schema,kinds:c.kinds,files:w.files.length,counts:F(w.counts),baseline:F(y.counts),allowed:F(e),kitDeps:w.kitDeps,shellPeers:w.shellPeers,chartDeps:w.chartDeps,failures:T,warnings:E.warnings},null,2)),A?0:1}t.out(`UI kit check (harness UI-24), efficient-shell ${t.version}\n`);const R=(e,n,i="")=>{if(0===n.length)return t.out(` ok ${e}`);t.err(` FAIL ${e}`);for(const e of n)t.err(` ${e}`);i&&t.err(` ${i}`)};t.out(` ok the reader reads its own fixtures (typescript ${u.version})`),t.out(` ok read ${Ct(w.files.length,"file")}`),R(`${zt} and ${It} describe this repository`,v.other),R("no file draws more of its own UI than its line allows",v.grown),R("every line is exact: a count that fell is a line to lower",v.shrunk,`Run: ${I}${v.updateFixes?"":" (after the failures above are fixed)"}`),E.note&&R(`the baseline is no higher than the base branch (${E.note})`,E.problems);for(const e of E.warnings)t.err(`::warning title=${Tt}::${e}`);const D=new Set([...w.counts.keys()].map(e=>L(e).file));return t.out(` ok PROGRESS: ${D.size} of ${Ct(w.files.length,"file")} still draw UI of their own: `+Rt(w.counts,j)),t.out(""),A?t.out("UI kit check: ok"):t.err(`UI kit check: FAILED (${Ct(T.length,"problem")})`),A?0:1}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>l(import.meta.url),git:function(t){try{return e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:6e4,maxBuffer:67108864})}catch{return null}},gitDetail:function(t,n){try{return{out:e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:n,maxBuffer:67108864}),error:""}}catch(e){const t=e;if("ETIMEDOUT"===t.code||"SIGTERM"===t.signal)return{out:null,error:`timed out after ${Math.round(n/1e3)} s`};return{out:null,error:(String(t.stderr??"").trim().replace(/\s+/g," ")||t.message||"git failed").slice(-500)}}},sleep:function(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},version:"13.22.0"});