efficient-shell 11.1.0 → 11.2.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 (237) hide show
  1. package/dist/{Browser-PTDZDMCG.js → Browser-2JOFXNUA.js} +14 -14
  2. package/dist/Calculator-V3BHUF4G.js +29 -0
  3. package/dist/{CurrencyConverter-W66ZDA6I.js → CurrencyConverter-6WJWHZUQ.js} +6 -6
  4. package/dist/{Documents-EASK3J36.js → Documents-DY2OBQNR.js} +12 -12
  5. package/dist/{Files-YT4Z4J36.js → Files-ADJB2IFU.js} +43 -43
  6. package/dist/{Notepad-T6NV4BSM.js → Notepad-HOJSMCCF.js} +9 -9
  7. package/dist/{PomodoroTimer-6B2MNLWD.js → PomodoroTimer-5GWSBJW5.js} +21 -21
  8. package/dist/{Preview-KHCQHAWG.js → Preview-JZBO2SP5.js} +29 -29
  9. package/dist/Sidebar-GQX7UM3M.js +44 -0
  10. package/dist/{Spreadsheet-IQZECLJW.js → Spreadsheet-SS5Y3DV2.js} +13 -13
  11. package/dist/{Stock-GCCTYXAG.js → Stock-3LSKLYGI.js} +3 -3
  12. package/dist/{Weather-DL4IZELD.js → Weather-26PCYFUR.js} +19 -19
  13. package/dist/{WorldClock-ZVN5O77W.js → WorldClock-KRL72Y53.js} +6 -6
  14. package/dist/ai/index.js +91 -91
  15. package/dist/apps/index.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/charts/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/CartesianPlot.js +1 -1
  22. package/dist/charts/ChartTooltip.js +1 -1
  23. package/dist/charts/ChordChart.js +1 -1
  24. package/dist/charts/ColumnChart.js +1 -1
  25. package/dist/charts/FunnelChart.js +1 -1
  26. package/dist/charts/HeatmapChart.js +1 -1
  27. package/dist/charts/HistogramChart.js +1 -1
  28. package/dist/charts/PieChart.js +1 -1
  29. package/dist/charts/RadarChart.js +1 -1
  30. package/dist/charts/RadialBarChart.js +1 -1
  31. package/dist/charts/RangeChart.js +1 -1
  32. package/dist/charts/SankeyChart.js +1 -1
  33. package/dist/charts/ScatterChart.js +1 -1
  34. package/dist/charts/SpecChart.js +1 -1
  35. package/dist/charts/SunburstChart.js +1 -1
  36. package/dist/charts/TimeSeriesChart.js +1 -1
  37. package/dist/charts/TreemapChart.js +1 -1
  38. package/dist/charts/WaterfallChart.js +1 -1
  39. package/dist/chunk-23G63EZ4.js +29 -0
  40. package/dist/{chunk-XXL5RLNM.js → chunk-34H3CK7R.js} +9 -9
  41. package/dist/{chunk-HNVSVTNC.js → chunk-355CRSFS.js} +11 -11
  42. package/dist/{chunk-DZOJQURG.js → chunk-3NRQNKVP.js} +3 -3
  43. package/dist/{chunk-BUO7XCYR.js → chunk-3TXSYEQM.js} +13 -13
  44. package/dist/{chunk-NRALUW6P.js → chunk-3XTSXZAC.js} +7 -7
  45. package/dist/{chunk-WDQEUNGE.js → chunk-47DO42IW.js} +1 -1
  46. package/dist/{chunk-FUDUQ44A.js → chunk-4LQDORA6.js} +1 -1
  47. package/dist/{chunk-OEPYQUXZ.js → chunk-4MBYFQOI.js} +8 -8
  48. package/dist/{chunk-U44DVPGB.js → chunk-4QK4WNPB.js} +1 -1
  49. package/dist/{chunk-COF33H6J.js → chunk-4TGZODSH.js} +5 -5
  50. package/dist/{chunk-LCSMBVMU.js → chunk-4XNVIKZZ.js} +3 -3
  51. package/dist/chunk-56KADF2B.js +11 -0
  52. package/dist/{chunk-T6BGS26U.js → chunk-5CXFABVD.js} +1 -1
  53. package/dist/{chunk-E3EJWNNK.js → chunk-5F2AIDPY.js} +9 -9
  54. package/dist/{chunk-G66SG6JN.js → chunk-6EIZOX6W.js} +9 -9
  55. package/dist/{chunk-ILY4DU3D.js → chunk-6TJCIS5E.js} +1 -1
  56. package/dist/chunk-6UBOLLBC.js +31 -0
  57. package/dist/chunk-7DI3VQCF.js +2 -0
  58. package/dist/{chunk-DOF56HTO.js → chunk-A3Q7X35W.js} +6 -6
  59. package/dist/{chunk-V2J2AHDW.js → chunk-ALE56KOA.js} +4 -4
  60. package/dist/{chunk-AWGJIDBR.js → chunk-BQPMZXNB.js} +1 -1
  61. package/dist/{chunk-BBXFIBXB.js → chunk-BTRV3SMB.js} +1 -1
  62. package/dist/{chunk-OKHKY3ZZ.js → chunk-BW47XJLH.js} +1 -1
  63. package/dist/{chunk-QOI4GQVH.js → chunk-CD7UWMPX.js} +1 -1
  64. package/dist/{chunk-WGLHB6WE.js → chunk-CJH2BGXY.js} +1 -1
  65. package/dist/{chunk-7FW2BQTV.js → chunk-COGSXN4D.js} +2 -2
  66. package/dist/{chunk-ZRLWE3JM.js → chunk-DANLBFBD.js} +1 -1
  67. package/dist/{chunk-TFSLPAGB.js → chunk-DGNAUGZ3.js} +4 -4
  68. package/dist/{chunk-ALTBTO3Z.js → chunk-DLWKDAYX.js} +2 -2
  69. package/dist/{chunk-MCAPJSB6.js → chunk-DU4WEVNS.js} +1 -1
  70. package/dist/{chunk-QYXZC37J.js → chunk-EB2IQNM5.js} +1 -1
  71. package/dist/{chunk-Z44JWU75.js → chunk-EKCQ7XBZ.js} +2 -2
  72. package/dist/{chunk-DIEH76MB.js → chunk-ESZHN7PV.js} +1 -1
  73. package/dist/chunk-EUAC2T5D.js +2 -0
  74. package/dist/{chunk-5PP435FL.js → chunk-EYPKBJYG.js} +1 -1
  75. package/dist/chunk-EZYRHBOP.js +13 -0
  76. package/dist/{chunk-7JVGF555.js → chunk-FA5FBNWF.js} +1 -1
  77. package/dist/chunk-FO6UPEZH.js +7 -0
  78. package/dist/{chunk-UNQ54QOF.js → chunk-FXOYA2VJ.js} +1 -1
  79. package/dist/{chunk-6KGIHI6X.js → chunk-G3KXB7SP.js} +4 -4
  80. package/dist/{chunk-IQZD6QQF.js → chunk-GAIB5FEE.js} +71 -71
  81. package/dist/{chunk-YQOVUH5W.js → chunk-GELPD7EY.js} +8 -8
  82. package/dist/chunk-GOZO6LU2.js +8 -0
  83. package/dist/{chunk-PLC656AN.js → chunk-GSF2UZTX.js} +1 -1
  84. package/dist/chunk-HCXIXV4E.js +8 -0
  85. package/dist/{chunk-HNUKXGYP.js → chunk-HEGSRTXG.js} +3 -3
  86. package/dist/{chunk-KXU4ORKE.js → chunk-IGLPL2QU.js} +1 -1
  87. package/dist/chunk-IYXNRNAF.js +8 -0
  88. package/dist/{chunk-FZM3ZPW3.js → chunk-JPNAEN53.js} +1 -1
  89. package/dist/{chunk-S4FPYCUU.js → chunk-JQBVSPF5.js} +3 -3
  90. package/dist/{chunk-O7RR2ZZ2.js → chunk-KBV2UOTG.js} +6 -6
  91. package/dist/chunk-L7XIGRIT.js +6 -0
  92. package/dist/chunk-LCMXVMF4.js +14 -0
  93. package/dist/{chunk-PSR6SXCC.js → chunk-LGDMGDSV.js} +11 -11
  94. package/dist/{chunk-3BFZVVAT.js → chunk-LJAYUDN2.js} +1 -1
  95. package/dist/{chunk-5WY5DQI7.js → chunk-LK5A2SGA.js} +1 -1
  96. package/dist/{chunk-XFH64VIG.js → chunk-M3JNILT2.js} +3 -3
  97. package/dist/{chunk-VX6TKEEK.js → chunk-M4BPHBKI.js} +1 -1
  98. package/dist/{chunk-6M5O2P64.js → chunk-MDV7UQJD.js} +9 -9
  99. package/dist/{chunk-D5HGRACW.js → chunk-MIC2F3W3.js} +1 -1
  100. package/dist/chunk-MNMOBH2O.js +1 -0
  101. package/dist/{chunk-DWAA4YZV.js → chunk-MTIP5DH2.js} +3 -3
  102. package/dist/{chunk-XCAUDTCC.js → chunk-MXGDFO6A.js} +5 -5
  103. package/dist/{chunk-6IOFNPR6.js → chunk-NEZA7V6H.js} +4 -4
  104. package/dist/{chunk-KIXTJNHQ.js → chunk-OEQ52KWJ.js} +2 -2
  105. package/dist/{chunk-WLYYC3AP.js → chunk-OFG3JZZE.js} +1 -1
  106. package/dist/{chunk-QGWKM7C3.js → chunk-OONJ43CQ.js} +5 -5
  107. package/dist/{chunk-4DDL6NXB.js → chunk-OTVK7DJM.js} +1 -1
  108. package/dist/{chunk-55AEZX6K.js → chunk-P4VKU3SL.js} +1 -1
  109. package/dist/{chunk-A6FR2D46.js → chunk-PFKXPSOM.js} +5 -5
  110. package/dist/{chunk-TDAI4J27.js → chunk-PVPMJ5G2.js} +1 -1
  111. package/dist/{chunk-7DQ3PM5Z.js → chunk-QMUIXKBQ.js} +1 -1
  112. package/dist/{chunk-NJN5IKWO.js → chunk-QQ2LDC6C.js} +1 -1
  113. package/dist/{chunk-QO5E33DH.js → chunk-RABYGQQU.js} +2 -2
  114. package/dist/chunk-RK7MN5L5.js +3 -0
  115. package/dist/chunk-RPL4H6LE.js +9 -0
  116. package/dist/{chunk-N5KO2IHG.js → chunk-RQDVAUXD.js} +4 -4
  117. package/dist/{chunk-IPO4LHSB.js → chunk-RRE2NNFS.js} +6 -6
  118. package/dist/{chunk-WL4U4MTQ.js → chunk-RWPMLUFO.js} +3 -3
  119. package/dist/{chunk-36PJGT4W.js → chunk-SHO35OPO.js} +3 -3
  120. package/dist/{chunk-AIJ6OR6X.js → chunk-SS5SQMIB.js} +2 -2
  121. package/dist/{chunk-BMXTPJ7T.js → chunk-SX5BSWTN.js} +5 -5
  122. package/dist/{chunk-AFG34RBV.js → chunk-SXQZ5GTA.js} +6 -6
  123. package/dist/{chunk-RDKIYORS.js → chunk-SYZLS2JA.js} +1 -1
  124. package/dist/{chunk-4P3324KU.js → chunk-T7PVHIXI.js} +1 -1
  125. package/dist/{chunk-DVYIBJ3S.js → chunk-TQE6O2JA.js} +3 -3
  126. package/dist/{chunk-P7H2DXJB.js → chunk-UGGHQYDN.js} +10 -10
  127. package/dist/{chunk-SX3SG522.js → chunk-VAPSWR5Q.js} +9 -9
  128. package/dist/{chunk-LE5LWALR.js → chunk-VCMHBUKI.js} +1 -1
  129. package/dist/{chunk-NZ34BQKH.js → chunk-VQBEZNHC.js} +1 -1
  130. package/dist/{chunk-KYBXJL6A.js → chunk-VUIGU2LQ.js} +15 -15
  131. package/dist/{chunk-36VIGB6J.js → chunk-WDQI3FV6.js} +6 -6
  132. package/dist/{chunk-VX4COEWP.js → chunk-WMHZA4EO.js} +3 -3
  133. package/dist/chunk-WUAKIM2B.js +7 -0
  134. package/dist/{chunk-TE6R53YD.js → chunk-XWFLIGDQ.js} +1 -1
  135. package/dist/{chunk-XBHXGBJR.js → chunk-YCWALB3A.js} +1 -1
  136. package/dist/{chunk-4EBJO7ER.js → chunk-YDMXW2Q4.js} +11 -11
  137. package/dist/{chunk-H5NIW2KS.js → chunk-ZD36QKQS.js} +1 -1
  138. package/dist/{chunk-QRU55BUS.js → chunk-ZD56IH5K.js} +2 -2
  139. package/dist/{chunk-WOAMPTZI.js → chunk-ZS3TIQQ4.js} +14 -14
  140. package/dist/{chunk-4RGMRXYH.js → chunk-ZXVJL7MS.js} +1 -1
  141. package/dist/data/DataTable.js +1 -1
  142. package/dist/data/EntityList.js +1 -1
  143. package/dist/data/ListLoadError.js +1 -1
  144. package/dist/data/ResizableTable.js +1 -1
  145. package/dist/forms/AlignmentGrid.js +1 -1
  146. package/dist/forms/BorderInput.js +1 -1
  147. package/dist/forms/BrandAssetEditor.js +1 -1
  148. package/dist/forms/Button.js +1 -1
  149. package/dist/forms/ColorPicker.js +1 -1
  150. package/dist/forms/ComposerAttachments.js +1 -1
  151. package/dist/forms/CornersInput.js +1 -1
  152. package/dist/forms/DateRangePicker.js +1 -1
  153. package/dist/forms/DisplayChips.js +1 -1
  154. package/dist/forms/FilePicker.js +1 -1
  155. package/dist/forms/IconButton.js +1 -1
  156. package/dist/forms/IconPicker.js +1 -1
  157. package/dist/forms/Input.js +1 -1
  158. package/dist/forms/InputNumber.js +1 -1
  159. package/dist/forms/LinkPicker.js +1 -1
  160. package/dist/forms/MediaLibrary.js +1 -1
  161. package/dist/forms/MediaUploadField.js +1 -1
  162. package/dist/forms/MediaUploadGrid.js +1 -1
  163. package/dist/forms/MediaUsedInList.js +1 -1
  164. package/dist/forms/NumericKeypad.js +1 -1
  165. package/dist/forms/PictureTiles.js +1 -1
  166. package/dist/forms/PositionInput.js +1 -1
  167. package/dist/forms/Segmented.js +1 -1
  168. package/dist/forms/Select.js +1 -1
  169. package/dist/forms/SidesInput.js +1 -1
  170. package/dist/forms/Slider.js +1 -1
  171. package/dist/forms/Snippet.js +1 -1
  172. package/dist/forms/SplitButton.js +1 -1
  173. package/dist/forms/TagInput.js +1 -1
  174. package/dist/forms/TextToolbar.js +1 -1
  175. package/dist/forms/WidthsBar.js +1 -1
  176. package/dist/hooks/useTheme.d.ts +1 -1
  177. package/dist/index.d.ts +3 -3
  178. package/dist/index.js +666 -666
  179. package/dist/map/index.js +3 -3
  180. package/dist/page-tabs/index.js +5 -5
  181. package/dist/shell/AppUpdateBanner.js +1 -1
  182. package/dist/shell/ColoredBadge.js +1 -1
  183. package/dist/shell/ContextMenu.js +1 -1
  184. package/dist/shell/DropdownMenu.js +1 -1
  185. package/dist/shell/EditableGrid.js +1 -1
  186. package/dist/shell/GlobalSearch.js +1 -1
  187. package/dist/shell/HelpCenter.js +1 -1
  188. package/dist/shell/IconRail.js +1 -1
  189. package/dist/shell/ImageLightbox.js +1 -1
  190. package/dist/shell/ItemCount.js +1 -1
  191. package/dist/shell/LanguageSelect.js +1 -1
  192. package/dist/shell/Markdown.js +1 -1
  193. package/dist/shell/PopupMenu.js +1 -1
  194. package/dist/shell/ResizeHandle.js +1 -1
  195. package/dist/shell/SearchableSelect.js +1 -1
  196. package/dist/shell/SettingReset.js +1 -1
  197. package/dist/shell/SidebarLayout.js +1 -1
  198. package/dist/shell/SidebarNav.js +1 -1
  199. package/dist/shell/SortableList.js +1 -1
  200. package/dist/shell/StatusBadge.js +1 -1
  201. package/dist/shell/Tabs.js +1 -1
  202. package/dist/shell/Tooltip.js +1 -1
  203. package/dist/shell/TopNav.js +1 -1
  204. package/dist/shell/TransferProgress.js +1 -1
  205. package/dist/shell/Tree.js +1 -1
  206. package/dist/telemetry/index.js +1 -1
  207. package/dist/templates/AuthScreen.js +1 -1
  208. package/dist/templates/ChatTemplate.js +1 -1
  209. package/dist/templates/CheckoutTemplate.js +1 -1
  210. package/dist/templates/DashboardTemplate.js +1 -1
  211. package/dist/templates/DataTablePage.js +1 -1
  212. package/dist/templates/EmailTemplate.js +1 -1
  213. package/dist/templates/ErrorBoundary.d.ts +1 -1
  214. package/dist/templates/ErrorBoundary.js +1 -1
  215. package/dist/templates/FormLayoutPage.js +1 -1
  216. package/dist/templates/GalleryTemplate.js +1 -1
  217. package/dist/ui/index.js +1 -1
  218. package/dist/version.js +1 -1
  219. package/package.json +1 -1
  220. package/dist/Calculator-KP57FK7Y.js +0 -29
  221. package/dist/Sidebar-BCTWRG7P.js +0 -44
  222. package/dist/chunk-3XZFWR6T.js +0 -13
  223. package/dist/chunk-4BCFBF3C.js +0 -9
  224. package/dist/chunk-4P57TIFK.js +0 -2
  225. package/dist/chunk-5PDHKH2A.js +0 -3
  226. package/dist/chunk-7LU3H72S.js +0 -7
  227. package/dist/chunk-AM6HSHT5.js +0 -29
  228. package/dist/chunk-CH3JQUDW.js +0 -8
  229. package/dist/chunk-EOVXFXVV.js +0 -2
  230. package/dist/chunk-ETJRGQNG.js +0 -1
  231. package/dist/chunk-EXLHFM3V.js +0 -6
  232. package/dist/chunk-HUU4XMWE.js +0 -28
  233. package/dist/chunk-MHPFBVDD.js +0 -8
  234. package/dist/chunk-NWC6YCIJ.js +0 -11
  235. package/dist/chunk-NZISMTQE.js +0 -7
  236. package/dist/chunk-RBZKV3ED.js +0 -14
  237. package/dist/chunk-TNJ2VCH4.js +0 -8
@@ -1,8 +1,8 @@
1
- import{getNumberingConfigs as e}from"./chunk-5WY5DQI7.js";import{SidebarLayout as t}from"./chunk-AFG34RBV.js";import"./chunk-QWK6DRSN.js";import"./chunk-Z44JWU75.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-KIXTJNHQ.js";import{useWindowManager as o,client_default as i}from"./chunk-IQZD6QQF.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-55AEZX6K.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-OKHKY3ZZ.js";import"./chunk-O3MBPAWZ.js";import{toast_default as c}from"./chunk-7ELJQL7J.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-ETJRGQNG.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as l}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var y=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=s(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[v]);const T=j.notepad_notes||[],[W,_]=d(null),[D,C]=d(""),[X,J]=d(""),[Q,E]=d("yellow"),[K,Z]=d(!1),[$,S]=d(!1),G=a(null),O=a();p(()=>{if(!W&&T.length>0){const e=T[0];_(e.id),C(e.title),J(e.content),E(e.color)}},[T.length]);const U=m(e=>{N({notepad_notes:e})},[N]),I=m(()=>{if(!W||!K)return;const e=T.map(e=>e.id===W?{...e,title:D,content:X,color:Q,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);U(e),Z(!1)},[W,K,D,X,Q,T,U]);p(()=>{if(K)return O.current&&clearTimeout(O.current),O.current=setTimeout(I,800),()=>{O.current&&clearTimeout(O.current)}},[K,I]),p(()=>()=>{K&&I()},[]);const B=e=>{K&&I(),_(e.id),C(e.title),J(e.content),E(e.color),Z(!1),S(!1)},L=e=>{const t=X.slice(0,e),r=X.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=X.slice(e+r[0].length);J(t+n+o),Z(!0)},F=async(e,t)=>{const r=w.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):c.error(`${n} not found`)}catch{c.error(`Failed to look up ${n}`)}},H="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",M=/* @__PURE__ */h(g,{children:[
2
- /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{K&&I();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];U(t),_(e.id),C(""),J(""),E("yellow"),Z(!1),S(!0),setTimeout(()=>G.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
1
+ import{getNumberingConfigs as e}from"./chunk-LK5A2SGA.js";import{SidebarLayout as t}from"./chunk-SXQZ5GTA.js";import"./chunk-QWK6DRSN.js";import"./chunk-EKCQ7XBZ.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-OEQ52KWJ.js";import{useWindowManager as o,client_default as i}from"./chunk-GAIB5FEE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-P4VKU3SL.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-BW47XJLH.js";import"./chunk-O3MBPAWZ.js";import{toast_default as c}from"./chunk-7ELJQL7J.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-MNMOBH2O.js";import"./chunk-JPNAEN53.js";import"./chunk-CDAJKLGL.js";import"./chunk-G3KXB7SP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-7DI3VQCF.js";import"./chunk-UQYNPYF4.js";import"./chunk-XWFLIGDQ.js";import{Icon as l}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useRef as a,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as g,jsx as x}from"react/jsx-runtime";var y=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:j,save:N}=s(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=a({});p(()=>{if(!v)return;const e={};for(const t of v){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[v]);const T=j.notepad_notes||[],[_,W]=d(null),[C,D]=d(""),[S,X]=d(""),[Q,J]=d("yellow"),[E,$]=d(!1),[B,G]=d(!1),K=a(null),L=a();p(()=>{if(!_&&T.length>0){const e=T[0];W(e.id),D(e.title),X(e.content),J(e.color)}},[T.length]);const O=m(e=>{N({notepad_notes:e})},[N]),U=m(()=>{if(!_||!E)return;const e=T.map(e=>e.id===_?{...e,title:C,content:S,color:Q,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);O(e),$(!1)},[_,E,C,S,Q,T,O]);p(()=>{if(E)return L.current&&clearTimeout(L.current),L.current=setTimeout(U,800),()=>{L.current&&clearTimeout(L.current)}},[E,U]),p(()=>()=>{E&&U()},[]);const A=e=>{E&&U(),W(e.id),D(e.title),X(e.content),J(e.color),$(!1),G(!1)},M=e=>{const t=S.slice(0,e),r=S.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=S.slice(e+r[0].length);X(t+n+o),$(!0)},P=async(e,t)=>{const r=w.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):c.error(`${n} not found`)}catch{c.error(`Failed to look up ${n}`)}},Z="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",F=/* @__PURE__ */h(g,{children:[
2
+ /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{E&&U();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];O(t),W(e.id),D(""),X(""),J("yellow"),$(!1),G(!0),setTimeout(()=>K.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
3
3
  /* @__PURE__ */x(l,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
4
4
  /* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===T.length?/* @__PURE__ */x("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):T.map(e=>{const t=(n=e.color,y.find(e=>e.key===n)||y[0]);var n;/* @__PURE__ */
5
- return h("button",{onClick:()=>B(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(W===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
5
+ return h("button",{onClick:()=>A(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(_===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
6
6
  /* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */x("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
8
8
  /* @__PURE__ */x("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
@@ -10,15 +10,15 @@ return h("button",{onClick:()=>B(e),className:"w-full text-left px-3 py-3 border
10
10
  /* @__PURE__ */x("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
11
  return h("div",{className:"h-full",children:[
12
12
  /* @__PURE__ */x(n,{app:"notepad"}),
13
- /* @__PURE__ */x(t,{sidebar:M,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:W?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
13
+ /* @__PURE__ */x(t,{sidebar:F,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:_?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
14
  /* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
- /* @__PURE__ */x("input",{value:D,onChange:e=>{C(e.target.value),Z(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{E(e.key),Z(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${Q===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(U(t),W===e){const e=t[0];e?B(e):(_(null),C(""),J(""))}})(W),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(l,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),$?/* @__PURE__ */x("textarea",{ref:G,value:X,onChange:e=>{J(e.target.value),Z(!0)},onBlur:()=>{S(!1),K&&I()},placeholder:H,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{S(!0),setTimeout(()=>G.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:X?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=c.exec(e));){const e=s[1],t=s[2];if(w.current[e]){const n=s.index,o=s[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>F(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=a+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>L(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(l,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
- return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(X):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:H})}),
15
+ /* @__PURE__ */x("input",{value:C,onChange:e=>{D(e.target.value),$(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
+ /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{J(e.key),$(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${Q===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
+ /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(O(t),_===e){const e=t[0];e?A(e):(W(null),D(""),X(""))}})(_),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(l,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),B?/* @__PURE__ */x("textarea",{ref:K,value:S,onChange:e=>{X(e.target.value),$(!0)},onBlur:()=>{G(!1),E&&U()},placeholder:Z,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */x("div",{onClick:()=>{G(!0),setTimeout(()=>K.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:S?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=c.exec(e));){const e=s[1],t=s[2];if(w.current[e]){const n=s.index,o=s[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>P(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=a+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>M(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */x(l,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */x("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
+ return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(S):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:Z})}),
19
19
  /* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
20
20
  /* @__PURE__ */x("span",{children:"[] checkbox"}),
21
21
  /* @__PURE__ */x("span",{children:"SO#35001 entity link"}),
22
- /* @__PURE__ */x("span",{className:"ml-auto",children:$?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
22
+ /* @__PURE__ */x("span",{className:"ml-auto",children:B?"Editing":"Click to edit"})]})]}):/* @__PURE__ */x("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
23
23
  /* @__PURE__ */x(l,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
24
24
  /* @__PURE__ */x("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
@@ -1,35 +1,35 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-7DQ3PM5Z.js";import{subscribePomo as o,getPomoSnapshot as a,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,migratePomodoroTasksOnce as u,pomoSwitchMode as d,pomoPause as m,pomoStart as h,ALARM_OPTIONS as p,playAlarm as g,FOCUS_SOUND_OPTIONS as k,previewFocusSound as f}from"./chunk-MDYJVXWD.js";import{PLACEHOLDER_INK as b}from"./chunk-AYZY3YNC.js";import{pad2 as x}from"./chunk-LF27WIN2.js";import{useWidgetSettings as v}from"./chunk-IQZD6QQF.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-55AEZX6K.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-OKHKY3ZZ.js";import"./chunk-O3MBPAWZ.js";import"./chunk-7ELJQL7J.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as y}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KGIHI6X.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as N}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useSyncExternalStore as C,useEffect as w,useMemo as j,useState as S,useRef as B,useCallback as M}from"react";import{jsxs as T,Fragment as P,jsx as I}from"react/jsx-runtime";var D="pomodoro_appearance",A="pomodoro_active_task_id",L={focus:"Pomodoro",short:"Short Break",long:"Long Break"},V={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var W=25,E=5,$=15,Z=!1,J=!1,K=4,Q=!0,R=!0,F="bell",O=100,U=1,X="none",H=50,Y=(e,t,o,a)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):a;function G(){const t=C(o,a,a),{prefs:g,save:f}=y(),b=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:Y(t.focusMinutes,1,120,W),shortBreakMinutes:Y(t.shortBreakMinutes,1,120,E),longBreakMinutes:Y(t.longBreakMinutes,1,120,$),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:Z,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:J,longBreakInterval:Y(t.longBreakInterval,1,20,K),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:Q,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:R,alarmSound:p.some(e=>e.id===t.alarmSound)?t.alarmSound:F,alarmVolume:Y(t.alarmVolume,0,100,O),alarmRepeat:Y(t.alarmRepeat,1,5,U),focusSound:k.some(e=>e.id===t.focusSound)?t.focusSound:X,focusVolume:Y(t.focusVolume,0,100,H)}}(g.pomodoro_settings);w(()=>{n({focus:60*b.focusMinutes,short:60*b.shortBreakMinutes,long:60*b.longBreakMinutes})},[b.focusMinutes,b.shortBreakMinutes,b.longBreakMinutes]),w(()=>{r(b.alarmSound),s(b.alarmVolume,b.alarmRepeat)},[b.alarmSound,b.alarmVolume,b.alarmRepeat]),w(()=>{i({autoStartBreaks:b.autoStartBreaks,autoStartPomodoros:b.autoStartPomodoros,longBreakInterval:b.longBreakInterval})},[b.autoStartBreaks,b.autoStartPomodoros,b.longBreakInterval]),w(()=>{l(b.focusSound,b.focusVolume)},[b.focusSound,b.focusVolume]),w(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const G=c(),z=G.tasks,q=j(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),ee=function(e,t){return j(()=>t?(e=>{const t=[],o=[];for(const a of e)(a.done?o:t).push(a);return[...t,...o]})(e):e,[e,t])}(j(()=>z.filter(e=>!!e.dueDate&&(e.dueDate===q||e.dueDate<q&&!e.done)),[z,q]),b.checkToBottom),[te,oe]=S(()=>localStorage.getItem(A)),[ae,ne]=S(!1),[re,se]=S(null),ie=B(!1);w(()=>{ie.current||(ie.current=!0,u(z,G.setAllTasks))},[]),w(()=>{try{te?localStorage.setItem(A,te):localStorage.removeItem(A)}catch{}},[te]),w(()=>{if(!re)return;const e=()=>se(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[re]);const le=B(t.streak);w(()=>{if(t.streak>le.current&&te){const e=z.find(e=>e.id===te);if(e){const t=(e.completed??0)+1,o=e.estimated??0,a=b.autoCheckTasks&&o>0&&t>=o;G.updateTask(te,{completed:t,done:e.done||a})}}le.current=t.streak},[t.streak,te,b.autoCheckTasks,z,G]);const ue=ee.reduce((e,t)=>e+(t.completed??0),0),de=ee.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),me=ee.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),he=t.running&&"focus"===t.mode?t.remaining:0,pe=me*b.focusMinutes*60+he,ge=new Date(Date.now()+1e3*pe).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),ke=(pe/3600).toFixed(1),fe=te?z.find(e=>e.id===te)??null:null,be=x(Math.floor(t.remaining/60)),xe=x(t.remaining%60),[ve,ye]=S(()=>e(D)),[Ne,Ce]=S(!1),[we,je]=S(ve),[Se,Be]=S(b);v(M(()=>{je({...ve}),Be({...b}),Ce(!0)},[ve,b]));const Me="focus"!==t.mode,Te=V[t.mode],Pe=Me?(Ie=Te,De=ve.activeOpacity/100,`rgba(${parseInt(Ie.slice(1,3),16)}, ${parseInt(Ie.slice(3,5),16)}, ${parseInt(Ie.slice(5,7),16)}, ${De})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${ve.activeOpacity/100})`;var Ie,De;const Ae={primary:Me?"text-white":"text-gray-900",secondary:Me?"text-white/85":"text-gray-700",muted:Me?"text-white/65":"text-gray-500",tabActive:Me?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Me?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Me?"border-white/30":"border-gray-200",softDivider:Me?"border-white/20":"border-gray-200",iconBtn:Me?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Me?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Le=Me?Te:"#0f172a";/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-QMUIXKBQ.js";import{subscribePomo as o,getPomoSnapshot as a,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as s,setPomoBehaviour as i,setPomoFocusSound as l,useTodoTasks as c,migratePomodoroTasksOnce as u,pomoSwitchMode as d,pomoPause as m,pomoStart as h,ALARM_OPTIONS as p,playAlarm as g,FOCUS_SOUND_OPTIONS as k,previewFocusSound as f}from"./chunk-MDYJVXWD.js";import{PLACEHOLDER_INK as b}from"./chunk-AYZY3YNC.js";import{pad2 as x}from"./chunk-LF27WIN2.js";import{useWidgetSettings as v}from"./chunk-GAIB5FEE.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-P4VKU3SL.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-BW47XJLH.js";import"./chunk-O3MBPAWZ.js";import"./chunk-7ELJQL7J.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as y}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-JPNAEN53.js";import"./chunk-CDAJKLGL.js";import"./chunk-G3KXB7SP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-7DI3VQCF.js";import"./chunk-UQYNPYF4.js";import"./chunk-XWFLIGDQ.js";import{Icon as N}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useSyncExternalStore as C,useEffect as w,useMemo as S,useState as j,useRef as B,useCallback as M}from"react";import{jsxs as T,Fragment as P,jsx as I}from"react/jsx-runtime";var D="pomodoro_appearance",L="pomodoro_active_task_id",A={focus:"Pomodoro",short:"Short Break",long:"Long Break"},V={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var W=25,$=5,E=15,J=!1,Q=!1,F=4,R=!0,U=!0,K="bell",X=100,G=1,H="none",O=50,Y=(e,t,o,a)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(o,Math.round(e))):a;function Z(){const t=C(o,a,a),{prefs:g,save:f}=y(),b=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:Y(t.focusMinutes,1,120,W),shortBreakMinutes:Y(t.shortBreakMinutes,1,120,$),longBreakMinutes:Y(t.longBreakMinutes,1,120,E),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:J,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:Q,longBreakInterval:Y(t.longBreakInterval,1,20,F),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:R,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:U,alarmSound:p.some(e=>e.id===t.alarmSound)?t.alarmSound:K,alarmVolume:Y(t.alarmVolume,0,100,X),alarmRepeat:Y(t.alarmRepeat,1,5,G),focusSound:k.some(e=>e.id===t.focusSound)?t.focusSound:H,focusVolume:Y(t.focusVolume,0,100,O)}}(g.pomodoro_settings);w(()=>{n({focus:60*b.focusMinutes,short:60*b.shortBreakMinutes,long:60*b.longBreakMinutes})},[b.focusMinutes,b.shortBreakMinutes,b.longBreakMinutes]),w(()=>{r(b.alarmSound),s(b.alarmVolume,b.alarmRepeat)},[b.alarmSound,b.alarmVolume,b.alarmRepeat]),w(()=>{i({autoStartBreaks:b.autoStartBreaks,autoStartPomodoros:b.autoStartPomodoros,longBreakInterval:b.longBreakInterval})},[b.autoStartBreaks,b.autoStartPomodoros,b.longBreakInterval]),w(()=>{l(b.focusSound,b.focusVolume)},[b.focusSound,b.focusVolume]),w(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const Z=c(),z=Z.tasks,q=S(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),ee=function(e,t){return S(()=>t?(e=>{const t=[],o=[];for(const a of e)(a.done?o:t).push(a);return[...t,...o]})(e):e,[e,t])}(S(()=>z.filter(e=>!!e.dueDate&&(e.dueDate===q||e.dueDate<q&&!e.done)),[z,q]),b.checkToBottom),[te,oe]=j(()=>localStorage.getItem(L)),[ae,ne]=j(!1),[re,se]=j(null),ie=B(!1);w(()=>{ie.current||(ie.current=!0,u(z,Z.setAllTasks))},[]),w(()=>{try{te?localStorage.setItem(L,te):localStorage.removeItem(L)}catch{}},[te]),w(()=>{if(!re)return;const e=()=>se(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[re]);const le=B(t.streak);w(()=>{if(t.streak>le.current&&te){const e=z.find(e=>e.id===te);if(e){const t=(e.completed??0)+1,o=e.estimated??0,a=b.autoCheckTasks&&o>0&&t>=o;Z.updateTask(te,{completed:t,done:e.done||a})}}le.current=t.streak},[t.streak,te,b.autoCheckTasks,z,Z]);const ue=ee.reduce((e,t)=>e+(t.completed??0),0),de=ee.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),me=ee.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),he=t.running&&"focus"===t.mode?t.remaining:0,pe=me*b.focusMinutes*60+he,ge=new Date(Date.now()+1e3*pe).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),ke=(pe/3600).toFixed(1),fe=te?z.find(e=>e.id===te)??null:null,be=x(Math.floor(t.remaining/60)),xe=x(t.remaining%60),[ve,ye]=j(()=>e(D)),[Ne,Ce]=j(!1),[we,Se]=j(ve),[je,Be]=j(b);v(M(()=>{Se({...ve}),Be({...b}),Ce(!0)},[ve,b]));const Me="focus"!==t.mode,Te=V[t.mode],Pe=Me?(Ie=Te,De=ve.activeOpacity/100,`rgba(${parseInt(Ie.slice(1,3),16)}, ${parseInt(Ie.slice(3,5),16)}, ${parseInt(Ie.slice(5,7),16)}, ${De})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${ve.activeOpacity/100})`;var Ie,De;const Le={primary:Me?"text-white":"text-gray-900",secondary:Me?"text-white/85":"text-gray-700",muted:Me?"text-white/65":"text-gray-500",tabActive:Me?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Me?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Me?"border-white/30":"border-gray-200",softDivider:Me?"border-white/20":"border-gray-200",iconBtn:Me?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Me?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Ae=Me?Te:"#0f172a";/* @__PURE__ */
2
2
  return T(P,{children:[
3
- /* @__PURE__ */T("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Ae.primary}`,style:{backgroundColor:Pe,backdropFilter:ve.activeBlur>0?`blur(${ve.activeBlur}px)`:void 0},children:[
4
- /* @__PURE__ */I("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */I("button",{onClick:()=>d(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Ae.tabActive:Ae.tabInactive}`,children:L[e]},e))}),
3
+ /* @__PURE__ */T("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Le.primary}`,style:{backgroundColor:Pe,backdropFilter:ve.activeBlur>0?`blur(${ve.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */I("div",{className:"px-3 pt-3 flex justify-center gap-2",children:["focus","short","long"].map(e=>/* @__PURE__ */I("button",{onClick:()=>d(e),className:`px-3 py-1 text-sm font-bold rounded transition-colors ${t.mode===e?Le.tabActive:Le.tabInactive}`,children:A[e]},e))}),
5
5
  /* @__PURE__ */T("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[be,":",xe]}),
6
- /* @__PURE__ */I("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */I("button",{onClick:()=>t.running?m():h(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:Le,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
6
+ /* @__PURE__ */I("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */I("button",{onClick:()=>t.running?m():h(),className:"bg-surface px-12 py-3 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:Ae,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
7
7
  /* @__PURE__ */I("div",{className:"px-3 py-3 text-center",children:fe?/* @__PURE__ */T(P,{children:[
8
- /* @__PURE__ */T("div",{className:`text-xs leading-tight ${Ae.muted}`,children:["#",(fe.completed??0)+1]}),
9
- /* @__PURE__ */I("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Ae.primary}`,children:fe.name})]}):/* @__PURE__ */I("div",{className:`text-xs italic ${Ae.muted}`,children:"No task selected"})}),
8
+ /* @__PURE__ */T("div",{className:`text-xs leading-tight ${Le.muted}`,children:["#",(fe.completed??0)+1]}),
9
+ /* @__PURE__ */I("div",{className:`text-base font-medium leading-tight truncate mt-0.5 ${Le.primary}`,children:fe.name})]}):/* @__PURE__ */I("div",{className:`text-xs italic ${Le.muted}`,children:"No task selected"})}),
10
10
  /* @__PURE__ */T("div",{className:"px-3 mt-1 flex items-center justify-between",children:[
11
- /* @__PURE__ */I("h3",{className:`text-base font-bold tracking-tight ${Ae.primary}`,children:"Tasks"}),
12
- /* @__PURE__ */I("button",{className:`rounded p-1 transition-colors ${Ae.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */I(N,{name:"more-vertical",look:"solid",className:"h-4 w-4"})})]}),
13
- /* @__PURE__ */I("div",{className:`border-t mx-3 mt-2 ${Ae.divider}`}),
11
+ /* @__PURE__ */I("h3",{className:`text-base font-bold tracking-tight ${Le.primary}`,children:"Tasks"}),
12
+ /* @__PURE__ */I("button",{className:`rounded p-1 transition-colors ${Le.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */I(N,{name:"more-vertical",look:"solid",className:"h-4 w-4"})})]}),
13
+ /* @__PURE__ */I("div",{className:`border-t mx-3 mt-2 ${Le.divider}`}),
14
14
  /* @__PURE__ */T("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[ee.map(e=>{const t=e.id===te;/* @__PURE__ */
15
15
  return T("div",{onClick:()=>oe(e.id),className:"bg-surface text-ink-strong rounded-md flex items-center pr-2 py-3 shadow-sm cursor-pointer transition-shadow hover:shadow-(--elevation-panel) "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
16
- /* @__PURE__ */I("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,G.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */I("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:Le},children:/* @__PURE__ */I("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */I("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */I("circle",{cx:"12",cy:"12",r:"10"})})}),
16
+ /* @__PURE__ */I("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,Z.toggleDone(o)},className:"shrink-0",children:e.done?/* @__PURE__ */I("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:Ae},children:/* @__PURE__ */I("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */I("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */I("circle",{cx:"12",cy:"12",r:"10"})})}),
17
17
  /* @__PURE__ */I("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
18
18
  /* @__PURE__ */T("span",{className:"text-sm tabular-nums mr-2 shrink-0",children:[
19
19
  /* @__PURE__ */I("span",{className:"font-bold text-gray-500",children:e.completed??0}),
20
20
  /* @__PURE__ */I("span",{className:"text-gray-400",children:" / "}),
21
21
  /* @__PURE__ */I("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
22
22
  /* @__PURE__ */T("div",{className:"relative",children:[
23
- /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),se(re===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */I(N,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),re===e.id&&/* @__PURE__ */I("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */I("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,G.removeTask(o),te===o&&oe(null),se(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),ae?/* @__PURE__ */I(ce,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const a=G.addTask({name:o,estimated:t,completed:0,dueDate:q});te||oe(a),ne(!1)},onCancel:()=>ne(!1),accentColor:Le}):/* @__PURE__ */T("button",{onClick:()=>ne(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Ae.addTaskBtn}`,children:[
23
+ /* @__PURE__ */I("button",{onClick:t=>{t.stopPropagation(),se(re===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */I(N,{name:"more-vertical",look:"solid",className:"h-4 w-4 text-ink-faint"})}),re===e.id&&/* @__PURE__ */I("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */I("button",{onClick:t=>{var o;t.stopPropagation(),o=e.id,Z.removeTask(o),te===o&&oe(null),se(null)},className:"block w-full px-3 h-8 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),ae?/* @__PURE__ */I(ce,{onSubmit:(e,t)=>{const o=e.trim();if(!o)return;const a=Z.addTask({name:o,estimated:t,completed:0,dueDate:q});te||oe(a),ne(!1)},onCancel:()=>ne(!1),accentColor:Ae}):/* @__PURE__ */T("button",{onClick:()=>ne(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Le.addTaskBtn}`,children:[
24
24
  /* @__PURE__ */I(N,{name:"add-circle",className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
25
- /* @__PURE__ */T("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Ae.softDivider}`,children:[
26
- /* @__PURE__ */T("span",{className:Ae.secondary,children:["Pomos: ",
27
- /* @__PURE__ */I("span",{className:`font-bold ${Ae.primary}`,children:ue}),
28
- /* @__PURE__ */I("span",{className:Ae.muted,children:" / "}),
29
- /* @__PURE__ */I("span",{className:`font-bold ${Ae.primary}`,children:de})]}),pe>0&&/* @__PURE__ */T("span",{className:Ae.secondary,children:["Finish At: ",
30
- /* @__PURE__ */I("span",{className:`font-bold ${Ae.primary}`,children:ge}),
31
- /* @__PURE__ */T("span",{className:Ae.muted,children:[" (",ke,"h)"]})]})]})]}),
32
- /* @__PURE__ */I(_,{open:Ne,onClose:()=>Ce(!1),onSave:()=>{ye(we),localStorage.setItem(D,JSON.stringify(we)),f({pomodoro_settings:Se}),Ce(!1)},configAppearance:we,setConfigAppearance:je,configPrefs:Se,setConfigPrefs:Be})]})}function _({open:e,onClose:o,onSave:a,configAppearance:n,setConfigAppearance:r,configPrefs:s,setConfigPrefs:i}){const l=(e,t)=>i(o=>({...o,[e]:t}));/* @__PURE__ */
25
+ /* @__PURE__ */T("div",{className:`border-t px-3 py-3 flex items-center justify-center gap-5 text-sm ${Le.softDivider}`,children:[
26
+ /* @__PURE__ */T("span",{className:Le.secondary,children:["Pomos: ",
27
+ /* @__PURE__ */I("span",{className:`font-bold ${Le.primary}`,children:ue}),
28
+ /* @__PURE__ */I("span",{className:Le.muted,children:" / "}),
29
+ /* @__PURE__ */I("span",{className:`font-bold ${Le.primary}`,children:de})]}),pe>0&&/* @__PURE__ */T("span",{className:Le.secondary,children:["Finish At: ",
30
+ /* @__PURE__ */I("span",{className:`font-bold ${Le.primary}`,children:ge}),
31
+ /* @__PURE__ */T("span",{className:Le.muted,children:[" (",ke,"h)"]})]})]})]}),
32
+ /* @__PURE__ */I(_,{open:Ne,onClose:()=>Ce(!1),onSave:()=>{ye(we),localStorage.setItem(D,JSON.stringify(we)),f({pomodoro_settings:je}),Ce(!1)},configAppearance:we,setConfigAppearance:Se,configPrefs:je,setConfigPrefs:Be})]})}function _({open:e,onClose:o,onSave:a,configAppearance:n,setConfigAppearance:r,configPrefs:s,setConfigPrefs:i}){const l=(e,t)=>i(o=>({...o,[e]:t}));/* @__PURE__ */
33
33
  return T(t,{open:e,onClose:o,title:"Pomodoro Settings",appearance:n,onAppearanceChange:r,onSave:a,children:[
34
34
  /* @__PURE__ */T(z,{icon:/* @__PURE__ */I(se,{}),label:"TIMER",children:[
35
35
  /* @__PURE__ */T("div",{children:[
@@ -80,7 +80,7 @@ return T("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"
80
80
  /* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})}function le(){/* @__PURE__ */
81
81
  return T("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
82
82
  /* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5L6 9H2v6h4l5 4V5z"}),
83
- /* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 8.5a5 5 0 010 7M19 5a9 9 0 010 14"})]})}function ce({onSubmit:e,onCancel:t,accentColor:o}){const[a,n]=S(""),[r,s]=S(1),i=()=>e(a,r);/* @__PURE__ */
83
+ /* @__PURE__ */I("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 8.5a5 5 0 010 7M19 5a9 9 0 010 14"})]})}function ce({onSubmit:e,onCancel:t,accentColor:o}){const[a,n]=j(""),[r,s]=j(1),i=()=>e(a,r);/* @__PURE__ */
84
84
  return T("div",{className:"bg-surface text-ink-strong rounded-md p-3 shadow-(--elevation-panel)",children:[
85
85
  /* @__PURE__ */I("input",{autoFocus:!0,value:a,onChange:e=>n(e.target.value),placeholder:"What are you working on?",onKeyDown:e=>{"Enter"===e.key&&i(),"Escape"===e.key&&t()},className:"w-full text-base font-medium bg-transparent border-0 outline-none placeholder-gray-400"}),
86
86
  /* @__PURE__ */T("div",{className:"flex items-center justify-between mt-2",children:[
@@ -88,4 +88,4 @@ return T("div",{className:"bg-surface text-ink-strong rounded-md p-3 shadow-(--e
88
88
  /* @__PURE__ */I("input",{type:"number",min:1,max:20,value:r,onChange:e=>s(Math.max(1,Math.min(20,parseInt(e.target.value,10)||1))),className:"w-16 bg-gray-100 rounded px-2 py-1 text-sm text-right border-0 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),
89
89
  /* @__PURE__ */T("div",{className:"flex gap-2 mt-3 justify-end",children:[
90
90
  /* @__PURE__ */I("button",{onClick:t,className:"px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded",children:"Cancel"}),
91
- /* @__PURE__ */I("button",{onClick:i,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:o},children:"Save"})]})]})}export{G as default};
91
+ /* @__PURE__ */I("button",{onClick:i,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:o},children:"Save"})]})]})}export{Z as default};