efficient-shell 4.160.0 → 4.162.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 (67) hide show
  1. package/README.md +22 -4
  2. package/dist/{Browser-3KOGROX7.js → Browser-TNUODLDN.js} +25 -25
  3. package/dist/Calculator-HHPPI72V.js +29 -0
  4. package/dist/ConfirmDialog-D46T6ZXW.js +1 -0
  5. package/dist/{CurrencyConverter-3GTKDKHH.js → CurrencyConverter-4XKRUO7Y.js} +6 -6
  6. package/dist/{Documents-FDGF7QBQ.js → Documents-VYDMJL37.js} +6 -6
  7. package/dist/{Files-TTSYOPVB.js → Files-D3D6JWSJ.js} +28 -28
  8. package/dist/{Notepad-ITHIATP2.js → Notepad-CBJIS3WA.js} +10 -10
  9. package/dist/PdfViewer-UEMING6A.js +1 -0
  10. package/dist/{PomodoroTimer-CRKL26PP.js → PomodoroTimer-PB6J2LMS.js} +18 -18
  11. package/dist/{Preview-GZTTEZWS.js → Preview-O2UZROZO.js} +17 -17
  12. package/dist/{Sidebar-ECJEQXFK.js → Sidebar-PPC3OK4H.js} +36 -36
  13. package/dist/Spreadsheet-AYV4CQP3.js +37 -0
  14. package/dist/{Stock-NAHSVLAJ.js → Stock-FGJ5HQ7H.js} +4 -4
  15. package/dist/{Weather-AY3QWBQT.js → Weather-FW3WWYCI.js} +21 -21
  16. package/dist/{WorldClock-AXNMA4PG.js → WorldClock-UC4CXE2N.js} +6 -6
  17. package/dist/apps/index.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/{chunk-A6FPBD7W.js → chunk-2S73NE3L.js} +1 -1
  20. package/dist/{chunk-UPI2GKKD.js → chunk-4SQNYTO3.js} +12 -12
  21. package/dist/{chunk-XN76YBX3.js → chunk-4VMA4ALC.js} +8 -8
  22. package/dist/chunk-5A7MWTXX.js +1 -0
  23. package/dist/{chunk-HQTSPK5Q.js → chunk-5UNSI4UI.js} +1 -1
  24. package/dist/{chunk-LCB4IVEL.js → chunk-6CKRJ4YK.js} +250 -250
  25. package/dist/chunk-6KO2U66R.js +3 -0
  26. package/dist/chunk-6WLGERBO.js +27 -0
  27. package/dist/{chunk-26RS37FG.js → chunk-7EACKL5V.js} +1 -1
  28. package/dist/{chunk-HF4IZFFX.js → chunk-7ESGXPKN.js} +11 -11
  29. package/dist/{chunk-FHIF6IUV.js → chunk-A2FL26TE.js} +1 -1
  30. package/dist/{chunk-KZPQW6UL.js → chunk-C2A4PIGZ.js} +2 -2
  31. package/dist/chunk-DSSLOQDW.js +2 -0
  32. package/dist/{chunk-VNEH2Y6H.js → chunk-DYVN6C2E.js} +3 -3
  33. package/dist/{chunk-XPSADW6W.js → chunk-EU3AQ4B2.js} +1 -1
  34. package/dist/{chunk-B2TBCVHH.js → chunk-EYU4IAEZ.js} +1 -1
  35. package/dist/{chunk-PDTZTADH.js → chunk-GBL5KOGP.js} +17 -17
  36. package/dist/{chunk-T6MKFQRH.js → chunk-GTQJYE6M.js} +6 -6
  37. package/dist/chunk-HQLEQIMG.js +21 -0
  38. package/dist/{chunk-JGHRZYNV.js → chunk-ILTSTULF.js} +1 -1
  39. package/dist/chunk-LQVXGB7A.js +1 -0
  40. package/dist/{chunk-KASHUEJV.js → chunk-O46U4PVN.js} +4 -4
  41. package/dist/chunk-S2PS4IOT.js +2 -0
  42. package/dist/{chunk-ZJ66QFOH.js → chunk-S6ZIQSAF.js} +1 -1
  43. package/dist/{chunk-36QR65KW.js → chunk-STJVLCQU.js} +2 -2
  44. package/dist/chunk-UZUH5PVW.js +1 -0
  45. package/dist/chunk-ZWYKMIX7.js +112 -0
  46. package/dist/file-intake/index.js +1 -1
  47. package/dist/{index-Brl0XepS.d.ts → index-DYVoKNru.d.ts} +86 -3
  48. package/dist/index.d.ts +47 -10
  49. package/dist/index.js +645 -645
  50. package/dist/map/index.js +2 -2
  51. package/dist/page-tabs/index.d.ts +9 -1
  52. package/dist/page-tabs/index.js +5 -5
  53. package/dist/pdf/index.js +1 -1
  54. package/dist/ui/index.d.ts +1 -1
  55. package/dist/ui/index.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/Calculator-QLJJ3ICT.js +0 -29
  58. package/dist/ConfirmDialog-7Q2OOU4W.js +0 -1
  59. package/dist/PdfViewer-VIT7Y55M.js +0 -1
  60. package/dist/Spreadsheet-PFKZTLSI.js +0 -37
  61. package/dist/chunk-6UXY7MPY.js +0 -2
  62. package/dist/chunk-GF2XCISN.js +0 -1
  63. package/dist/chunk-JK3IIJN5.js +0 -22
  64. package/dist/chunk-VRW5JNMR.js +0 -18
  65. package/dist/chunk-VVI77XNV.js +0 -1
  66. package/dist/chunk-X6E6UULK.js +0 -113
  67. package/dist/chunk-YKZGKYVT.js +0 -2
@@ -1,8 +1,8 @@
1
- import{getNumberingConfigs as e}from"./chunk-HQTSPK5Q.js";import{SidebarLayout as t}from"./chunk-KASHUEJV.js";import{AboutApp as r}from"./chunk-A6FPBD7W.js";import{toast_default as n}from"./chunk-B2TBCVHH.js";import"./chunk-GF2XCISN.js";import{useWindowManager as o,client_default as i}from"./chunk-X6E6UULK.js";import{useShellPrefs as l}from"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import{timeAgo as s}from"./chunk-S2AZZGFF.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useRef as c,useEffect as a,useState as d,useCallback as p}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as m,Fragment as h,jsx as g}from"react/jsx-runtime";var x=[{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 y={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:k,save:v}=l(),{data:N}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=c({});a(()=>{if(!N)return;const e={};for(const t of N){const r=y[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},[N]);const _=k.notepad_notes||[],[T,j]=d(null),[C,$]=d(""),[L,S]=d(""),[H,B]=d("yellow"),[P,W]=d(!1),[X,M]=d(!1),V=c(null),D=c(),F=_.find(e=>e.id===T);a(()=>{if(!T&&_.length>0){const e=_[0];j(e.id),$(e.title),S(e.content),B(e.color)}},[_.length]);const I=p(e=>{v({notepad_notes:e})},[v]),A=p(()=>{if(!T||!P)return;const e=_.map(e=>e.id===T?{...e,title:C,content:L,color:H,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);I(e),W(!1)},[T,P,C,L,H,_,I]);a(()=>{if(P)return D.current&&clearTimeout(D.current),D.current=setTimeout(A,800),()=>{D.current&&clearTimeout(D.current)}},[P,A]),a(()=>()=>{P&&A()},[]);const O=e=>{P&&A(),j(e.id),$(e.title),S(e.content),B(e.color),W(!1),M(!1)},U=e=>{const t=L.slice(0,e),r=L.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=L.slice(e+r[0].length);S(t+n+o),W(!0)},q=async(e,t)=>{const r=w.current[e];if(!r)return;const o=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:o,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,o):n.error(`${o} not found`)}catch{n.error(`Failed to look up ${o}`)}},E="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.)",K=/* @__PURE__ */m(h,{children:[
2
- /* @__PURE__ */g("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */m("button",{onClick:()=>{P&&A();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",sticky:!1,updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,..._];I(t),j(e.id),$(""),S(""),B("yellow"),W(!1),M(!0),setTimeout(()=>V.current?.focus(),50)},className:"w-full flex items-center justify-center gap-1.5 rounded-lg bg-blue-600 text-white px-3 py-1.5 text-sm font-medium hover:bg-blue-700 transition-colors",children:[
1
+ import{getNumberingConfigs as e}from"./chunk-5UNSI4UI.js";import{SidebarLayout as t}from"./chunk-O46U4PVN.js";import{AboutApp as r}from"./chunk-2S73NE3L.js";import{toast_default as n}from"./chunk-EYU4IAEZ.js";import"./chunk-LQVXGB7A.js";import{useWindowManager as o,client_default as i}from"./chunk-ZWYKMIX7.js";import{useShellPrefs as l}from"./chunk-GTQJYE6M.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import{timeAgo as s}from"./chunk-S2AZZGFF.js";import"./chunk-PH3PRIFP.js";import"./chunk-6KO2U66R.js";import"./chunk-GBL5KOGP.js";import"./chunk-DYVN6C2E.js";import"./chunk-D65T4H6J.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-UZUH5PVW.js";import{useRef as c,useEffect as a,useState as d,useCallback as p}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as m,Fragment as h,jsx as g}from"react/jsx-runtime";var x=[{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 y={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:k,save:v}=l(),{data:N}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=c({});a(()=>{if(!N)return;const e={};for(const t of N){const r=y[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},[N]);const _=k.notepad_notes||[],[j,T]=d(null),[C,L]=d(""),[$,S]=d(""),[W,B]=d("yellow"),[I,M]=d(!1),[O,X]=d(!1),P=c(null),U=c(),D=_.find(e=>e.id===j);a(()=>{if(!j&&_.length>0){const e=_[0];T(e.id),L(e.title),S(e.content),B(e.color)}},[_.length]);const A=p(e=>{v({notepad_notes:e})},[v]),E=p(()=>{if(!j||!I)return;const e=_.map(e=>e.id===j?{...e,title:C,content:$,color:W,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);A(e),M(!1)},[j,I,C,$,W,_,A]);a(()=>{if(I)return U.current&&clearTimeout(U.current),U.current=setTimeout(E,800),()=>{U.current&&clearTimeout(U.current)}},[I,E]),a(()=>()=>{I&&E()},[]);const V=e=>{I&&E(),T(e.id),L(e.title),S(e.content),B(e.color),M(!1),X(!1)},H=e=>{const t=$.slice(0,e),r=$.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=$.slice(e+r[0].length);S(t+n+o),M(!0)},q=async(e,t)=>{const r=w.current[e];if(!r)return;const o=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:o,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,o):n.error(`${o} not found`)}catch{n.error(`Failed to look up ${o}`)}},F="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.)",Z=/* @__PURE__ */m(h,{children:[
2
+ /* @__PURE__ */g("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */m("button",{onClick:()=>{I&&E();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",sticky:!1,updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,..._];A(t),T(e.id),L(""),S(""),B("yellow"),M(!1),X(!0),setTimeout(()=>P.current?.focus(),50)},className:"w-full flex items-center justify-center gap-1.5 rounded-lg bg-blue-600 text-white px-3 py-1.5 text-sm font-medium hover:bg-blue-700 transition-colors",children:[
3
3
  /* @__PURE__ */g("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),"New Note"]})}),
4
4
  /* @__PURE__ */g("div",{className:"flex-1 overflow-y-auto",children:0===_.length?/* @__PURE__ */g("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):_.map(e=>{const t=(r=e.color,x.find(e=>e.key===r)||x[0]);var r;/* @__PURE__ */
5
- return m("button",{onClick:()=>O(e),className:"w-full text-left px-3 py-2.5 border-b border-gray-100 transition-colors "+(T===e.id?"bg-blue-50":"hover:bg-gray-50"),children:[
5
+ return m("button",{onClick:()=>V(e),className:"w-full text-left px-3 py-2.5 border-b border-gray-100 transition-colors "+(j===e.id?"bg-blue-50":"hover:bg-gray-50"),children:[
6
6
  /* @__PURE__ */m("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */g("div",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${t.dot}`}),
8
8
  /* @__PURE__ */g("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"}),e.sticky&&/* @__PURE__ */g("svg",{className:"h-3 w-3 text-amber-500 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */g("path",{d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})]}),
@@ -10,16 +10,16 @@ return m("button",{onClick:()=>O(e),className:"w-full text-left px-3 py-2.5 bord
10
10
  /* @__PURE__ */g("p",{className:"text-[10px] text-gray-300 mt-0.5 ml-4.5",children:s(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
11
  return m("div",{className:"h-full",children:[
12
12
  /* @__PURE__ */g(r,{app:"notepad"}),
13
- /* @__PURE__ */g(t,{sidebar:K,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:T?/* @__PURE__ */m("div",{className:"flex-1 flex flex-col min-w-0",children:[
13
+ /* @__PURE__ */g(t,{sidebar:Z,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:j?/* @__PURE__ */m("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
14
  /* @__PURE__ */m("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
- /* @__PURE__ */g("input",{value:C,onChange:e=>{$(e.target.value),W(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */g("div",{className:"flex gap-1",children:x.map(e=>/* @__PURE__ */g("button",{onClick:()=>{B(e.key),W(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${H===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=_.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);I(t);const r=t.find(t=>t.id===e);n.success(r?.sticky?"Pinned to desktop":"Removed from desktop")})(T),title:F?.sticky?"Remove from desktop":"Pin to desktop",className:"p-1 rounded transition-colors "+(F?.sticky?"text-amber-500 hover:text-amber-600":"text-gray-300 hover:text-amber-400"),children:/* @__PURE__ */g("svg",{className:"h-4 w-4",fill:F?.sticky?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})}),
18
- /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=_.filter(t=>t.id!==e);if(I(t),T===e){const e=t[0];e?O(e):(j(null),$(""),S(""))}})(T),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */g("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})})})]}),X?/* @__PURE__ */g("textarea",{ref:V,value:L,onChange:e=>{S(e.target.value),W(!0)},onBlur:()=>{M(!1),P&&A()},placeholder:E,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__ */g("div",{onClick:()=>{M(!0),setTimeout(()=>V.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:L?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],l=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=l.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__ */g("button",{onClick:()=>q(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 c=0;for(let e=0;e<r;e++)c+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=c+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */g("button",{onClick:()=>U(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__ */g("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */g("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__ */g("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */g("span",{children:"​"},`empty-${r}`));const a=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
19
- return g("div",{className:a?"line-through text-gray-400":"",children:n},r)})})(L):/* @__PURE__ */g("p",{className:"text-gray-300 whitespace-pre-line",children:E})}),
15
+ /* @__PURE__ */g("input",{value:C,onChange:e=>{L(e.target.value),M(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
+ /* @__PURE__ */g("div",{className:"flex gap-1",children:x.map(e=>/* @__PURE__ */g("button",{onClick:()=>{B(e.key),M(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${W===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
+ /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=_.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);A(t);const r=t.find(t=>t.id===e);n.success(r?.sticky?"Pinned to desktop":"Removed from desktop")})(j),title:D?.sticky?"Remove from desktop":"Pin to desktop",className:"p-1 rounded transition-colors "+(D?.sticky?"text-amber-500 hover:text-amber-600":"text-gray-300 hover:text-amber-400"),children:/* @__PURE__ */g("svg",{className:"h-4 w-4",fill:D?.sticky?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})})}),
18
+ /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=_.filter(t=>t.id!==e);if(A(t),j===e){const e=t[0];e?V(e):(T(null),L(""),S(""))}})(j),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */g("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})})})]}),O?/* @__PURE__ */g("textarea",{ref:P,value:$,onChange:e=>{S(e.target.value),M(!0)},onBlur:()=>{X(!1),I&&E()},placeholder:F,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__ */g("div",{onClick:()=>{X(!0),setTimeout(()=>P.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:$?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],l=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=l.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__ */g("button",{onClick:()=>q(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 c=0;for(let e=0;e<r;e++)c+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=c+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */g("button",{onClick:()=>H(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__ */g("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */g("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__ */g("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */g("span",{children:"​"},`empty-${r}`));const a=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
19
+ return g("div",{className:a?"line-through text-gray-400":"",children:n},r)})})($):/* @__PURE__ */g("p",{className:"text-gray-300 whitespace-pre-line",children:F})}),
20
20
  /* @__PURE__ */m("div",{className:"px-4 py-1.5 border-t border-gray-100 flex items-center gap-4 text-[10px] text-gray-400",children:[
21
21
  /* @__PURE__ */g("span",{children:"[] checkbox"}),
22
22
  /* @__PURE__ */g("span",{children:"SO#35001 entity link"}),
23
- /* @__PURE__ */g("span",{className:"ml-auto",children:X?"Editing":"Click to edit"})]})]}):/* @__PURE__ */g("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */m("div",{className:"text-center text-gray-400",children:[
23
+ /* @__PURE__ */g("span",{className:"ml-auto",children:O?"Editing":"Click to edit"})]})]}):/* @__PURE__ */g("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */m("div",{className:"text-center text-gray-400",children:[
24
24
  /* @__PURE__ */g("svg",{className:"h-12 w-12 mx-auto mb-3 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),
25
25
  /* @__PURE__ */g("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
@@ -0,0 +1 @@
1
+ export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-7ESGXPKN.js";import"./chunk-EYU4IAEZ.js";import"./chunk-UZUH5PVW.js";
@@ -1,4 +1,4 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-XPSADW6W.js";import{subscribePomo as a,getPomoSnapshot as o,setPomoDurations as r,setPomoAlarm as n,setPomoAlarmConfig as l,setPomoBehaviour as s,setPomoFocusSound as i,useTodoTasks as c,migratePomodoroTasksOnce as d,pomoSwitchMode as u,pomoPause as m,pomoStart as h,ALARM_OPTIONS as g,playAlarm as p,FOCUS_SOUND_OPTIONS as f,previewFocusSound as b}from"./chunk-36QR65KW.js";import"./chunk-B2TBCVHH.js";import{useWidgetSettings as x}from"./chunk-X6E6UULK.js";import{useShellPrefs as k}from"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useSyncExternalStore as v,useEffect as y,useMemo as N,useState as w,useRef as C,useCallback as S}from"react";import{jsxs as B,Fragment as M,jsx as T}from"react/jsx-runtime";var P="pomodoro_appearance",j="pomodoro_active_task_id",I={focus:"Pomodoro",short:"Short Break",long:"Long Break"},A={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var V=25,$=5,L=15,D=!1,_=!1,R=4,W=!0,H=!0,E="bell",F=100,O=1,z="none",K=50,U=(e,t,a,o)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(a,Math.round(e))):o;function X(){const t=v(a,o,o),{prefs:p,save:b}=k(),X=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:U(t.focusMinutes,1,120,V),shortBreakMinutes:U(t.shortBreakMinutes,1,120,$),longBreakMinutes:U(t.longBreakMinutes,1,120,L),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:D,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:_,longBreakInterval:U(t.longBreakInterval,1,20,R),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:W,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:H,alarmSound:g.some(e=>e.id===t.alarmSound)?t.alarmSound:E,alarmVolume:U(t.alarmVolume,0,100,F),alarmRepeat:U(t.alarmRepeat,1,5,O),focusSound:f.some(e=>e.id===t.focusSound)?t.focusSound:z,focusVolume:U(t.focusVolume,0,100,K)}}(p.pomodoro_settings);y(()=>{r({focus:60*X.focusMinutes,short:60*X.shortBreakMinutes,long:60*X.longBreakMinutes})},[X.focusMinutes,X.shortBreakMinutes,X.longBreakMinutes]),y(()=>{n(X.alarmSound),l(X.alarmVolume,X.alarmRepeat)},[X.alarmSound,X.alarmVolume,X.alarmRepeat]),y(()=>{s({autoStartBreaks:X.autoStartBreaks,autoStartPomodoros:X.autoStartPomodoros,longBreakInterval:X.longBreakInterval})},[X.autoStartBreaks,X.autoStartPomodoros,X.longBreakInterval]),y(()=>{i(X.focusSound,X.focusVolume)},[X.focusSound,X.focusVolume]),y(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const Y=c(),Q=Y.tasks,q=N(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),Z=function(e,t){return N(()=>t?(e=>{const t=[],a=[];for(const o of e)(o.done?a:t).push(o);return[...t,...a]})(e):e,[e,t])}(N(()=>Q.filter(e=>!!e.dueDate&&(e.dueDate===q||e.dueDate<q&&!e.done)),[Q,q]),X.checkToBottom),[G,ee]=w(()=>localStorage.getItem(j)),[te,ae]=w(!1),[oe,re]=w(null),ne=C(!1);y(()=>{ne.current||(ne.current=!0,d(Q,Y.setAllTasks))},[]),y(()=>{try{G?localStorage.setItem(j,G):localStorage.removeItem(j)}catch{}},[G]),y(()=>{if(!oe)return;const e=()=>re(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[oe]);const se=C(t.streak);y(()=>{if(t.streak>se.current&&G){const e=Q.find(e=>e.id===G);if(e){const t=(e.completed??0)+1,a=e.estimated??0,o=X.autoCheckTasks&&a>0&&t>=a;Y.updateTask(G,{completed:t,done:e.done||o})}}se.current=t.streak},[t.streak,G,X.autoCheckTasks,Q,Y]);const ie=Z.reduce((e,t)=>e+(t.completed??0),0),ce=Z.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),de=Z.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),ue=t.running&&"focus"===t.mode?t.remaining:0,me=de*X.focusMinutes*60+ue,he=new Date(Date.now()+1e3*me).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),ge=(me/3600).toFixed(1),pe=G?Q.find(e=>e.id===G)??null:null,fe=String(Math.floor(t.remaining/60)).padStart(2,"0"),be=String(t.remaining%60).padStart(2,"0"),[xe,ke]=w(()=>e(P)),[ve,ye]=w(!1),[Ne,we]=w(xe),[Ce,Se]=w(X);x(S(()=>{we({...xe}),Se({...X}),ye(!0)},[xe,X]));const Be="focus"!==t.mode,Me=A[t.mode],Te=Be?(Pe=Me,je=xe.activeOpacity/100,`rgba(${parseInt(Pe.slice(1,3),16)}, ${parseInt(Pe.slice(3,5),16)}, ${parseInt(Pe.slice(5,7),16)}, ${je})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${xe.activeOpacity/100})`;var Pe,je;const Ie={primary:Be?"text-white":"text-gray-900",secondary:Be?"text-white/85":"text-gray-700",muted:Be?"text-white/65":"text-gray-500",tabActive:Be?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Be?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Be?"border-white/30":"border-gray-200",softDivider:Be?"border-white/20":"border-gray-200",iconBtn:Be?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Be?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Ae=Be?Me:"#0f172a";/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-EU3AQ4B2.js";import{subscribePomo as a,getPomoSnapshot as o,setPomoDurations as r,setPomoAlarm as n,setPomoAlarmConfig as l,setPomoBehaviour as s,setPomoFocusSound as i,useTodoTasks as c,migratePomodoroTasksOnce as d,pomoSwitchMode as u,pomoPause as m,pomoStart as h,ALARM_OPTIONS as g,playAlarm as p,FOCUS_SOUND_OPTIONS as f,previewFocusSound as b}from"./chunk-STJVLCQU.js";import"./chunk-EYU4IAEZ.js";import{useWidgetSettings as x}from"./chunk-ZWYKMIX7.js";import{useShellPrefs as k}from"./chunk-GTQJYE6M.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-PH3PRIFP.js";import"./chunk-6KO2U66R.js";import"./chunk-GBL5KOGP.js";import"./chunk-DYVN6C2E.js";import"./chunk-D65T4H6J.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-UZUH5PVW.js";import{useSyncExternalStore as v,useEffect as y,useMemo as N,useState as w,useRef as C,useCallback as S}from"react";import{jsxs as B,Fragment as M,jsx as T}from"react/jsx-runtime";var j="pomodoro_appearance",P="pomodoro_active_task_id",I={focus:"Pomodoro",short:"Short Break",long:"Long Break"},A={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var L=25,$=5,D=15,V=!1,E=!1,W=4,_=!0,R=!0,O="bell",F=100,U=1,z="none",H=50,J=(e,t,a,o)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(a,Math.round(e))):o;function K(){const t=v(a,o,o),{prefs:p,save:b}=k(),K=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:J(t.focusMinutes,1,120,L),shortBreakMinutes:J(t.shortBreakMinutes,1,120,$),longBreakMinutes:J(t.longBreakMinutes,1,120,D),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:V,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:E,longBreakInterval:J(t.longBreakInterval,1,20,W),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:_,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:R,alarmSound:g.some(e=>e.id===t.alarmSound)?t.alarmSound:O,alarmVolume:J(t.alarmVolume,0,100,F),alarmRepeat:J(t.alarmRepeat,1,5,U),focusSound:f.some(e=>e.id===t.focusSound)?t.focusSound:z,focusVolume:J(t.focusVolume,0,100,H)}}(p.pomodoro_settings);y(()=>{r({focus:60*K.focusMinutes,short:60*K.shortBreakMinutes,long:60*K.longBreakMinutes})},[K.focusMinutes,K.shortBreakMinutes,K.longBreakMinutes]),y(()=>{n(K.alarmSound),l(K.alarmVolume,K.alarmRepeat)},[K.alarmSound,K.alarmVolume,K.alarmRepeat]),y(()=>{s({autoStartBreaks:K.autoStartBreaks,autoStartPomodoros:K.autoStartPomodoros,longBreakInterval:K.longBreakInterval})},[K.autoStartBreaks,K.autoStartPomodoros,K.longBreakInterval]),y(()=>{i(K.focusSound,K.focusVolume)},[K.focusSound,K.focusVolume]),y(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const Y=c(),G=Y.tasks,X=N(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),Z=function(e,t){return N(()=>t?(e=>{const t=[],a=[];for(const o of e)(o.done?a:t).push(o);return[...t,...a]})(e):e,[e,t])}(N(()=>G.filter(e=>!!e.dueDate&&(e.dueDate===X||e.dueDate<X&&!e.done)),[G,X]),K.checkToBottom),[q,ee]=w(()=>localStorage.getItem(P)),[te,ae]=w(!1),[oe,re]=w(null),ne=C(!1);y(()=>{ne.current||(ne.current=!0,d(G,Y.setAllTasks))},[]),y(()=>{try{q?localStorage.setItem(P,q):localStorage.removeItem(P)}catch{}},[q]),y(()=>{if(!oe)return;const e=()=>re(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[oe]);const se=C(t.streak);y(()=>{if(t.streak>se.current&&q){const e=G.find(e=>e.id===q);if(e){const t=(e.completed??0)+1,a=e.estimated??0,o=K.autoCheckTasks&&a>0&&t>=a;Y.updateTask(q,{completed:t,done:e.done||o})}}se.current=t.streak},[t.streak,q,K.autoCheckTasks,G,Y]);const ie=Z.reduce((e,t)=>e+(t.completed??0),0),ce=Z.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),de=Z.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),ue=t.running&&"focus"===t.mode?t.remaining:0,me=de*K.focusMinutes*60+ue,he=new Date(Date.now()+1e3*me).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),ge=(me/3600).toFixed(1),pe=q?G.find(e=>e.id===q)??null:null,fe=String(Math.floor(t.remaining/60)).padStart(2,"0"),be=String(t.remaining%60).padStart(2,"0"),[xe,ke]=w(()=>e(j)),[ve,ye]=w(!1),[Ne,we]=w(xe),[Ce,Se]=w(K);x(S(()=>{we({...xe}),Se({...K}),ye(!0)},[xe,K]));const Be="focus"!==t.mode,Me=A[t.mode],Te=Be?(je=Me,Pe=xe.activeOpacity/100,`rgba(${parseInt(je.slice(1,3),16)}, ${parseInt(je.slice(3,5),16)}, ${parseInt(je.slice(5,7),16)}, ${Pe})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${xe.activeOpacity/100})`;var je,Pe;const Ie={primary:Be?"text-white":"text-gray-900",secondary:Be?"text-white/85":"text-gray-700",muted:Be?"text-white/65":"text-gray-500",tabActive:Be?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:Be?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:Be?"border-white/30":"border-gray-200",softDivider:Be?"border-white/20":"border-gray-200",iconBtn:Be?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:Be?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Ae=Be?Me:"#0f172a";/* @__PURE__ */
2
2
  return B(M,{children:[
3
3
  /* @__PURE__ */B("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${Ie.primary}`,style:{backgroundColor:Te,backdropFilter:xe.activeBlur>0?`blur(${xe.activeBlur}px)`:void 0},children:[
4
4
  /* @__PURE__ */T("div",{className:"px-3 pt-3 flex justify-center gap-1.5",children:["focus","short","long"].map(e=>/* @__PURE__ */T("button",{onClick:()=>u(e),className:`px-2.5 py-1 text-[13px] font-bold rounded transition-colors ${t.mode===e?Ie.tabActive:Ie.tabInactive}`,children:I[e]},e))}),
@@ -14,7 +14,7 @@ return B(M,{children:[
14
14
  /* @__PURE__ */T("circle",{cx:"12",cy:"12",r:"1.4"}),
15
15
  /* @__PURE__ */T("circle",{cx:"12",cy:"19",r:"1.4"})]})})]}),
16
16
  /* @__PURE__ */T("div",{className:`border-t mx-3 mt-2 ${Ie.divider}`}),
17
- /* @__PURE__ */B("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[Z.map(e=>{const t=e.id===G;/* @__PURE__ */
17
+ /* @__PURE__ */B("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[Z.map(e=>{const t=e.id===q;/* @__PURE__ */
18
18
  return B("div",{onClick:()=>ee(e.id),className:"bg-white text-gray-800 rounded-md flex items-center pr-2 py-2.5 shadow-sm cursor-pointer transition-shadow hover:shadow-md "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
19
19
  /* @__PURE__ */T("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.toggleDone(a)},className:"shrink-0",children:e.done?/* @__PURE__ */T("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:Ae},children:/* @__PURE__ */T("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__ */T("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */T("circle",{cx:"12",cy:"12",r:"10"})})}),
20
20
  /* @__PURE__ */T("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
@@ -26,7 +26,7 @@ return B("div",{onClick:()=>ee(e.id),className:"bg-white text-gray-800 rounded-m
26
26
  /* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),re(oe===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */B("svg",{className:"h-4 w-4 text-gray-500",viewBox:"0 0 24 24",fill:"currentColor",children:[
27
27
  /* @__PURE__ */T("circle",{cx:"12",cy:"5",r:"1.4"}),
28
28
  /* @__PURE__ */T("circle",{cx:"12",cy:"12",r:"1.4"}),
29
- /* @__PURE__ */T("circle",{cx:"12",cy:"19",r:"1.4"})]})}),oe===e.id&&/* @__PURE__ */T("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__ */T("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.removeTask(a),G===a&&ee(null),re(null)},className:"block w-full px-3 py-1.5 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),te?/* @__PURE__ */T(le,{onSubmit:(e,t)=>{const a=e.trim();if(!a)return;const o=Y.addTask({name:a,estimated:t,completed:0,dueDate:q});G||ee(o),ae(!1)},onCancel:()=>ae(!1),accentColor:Ae}):/* @__PURE__ */B("button",{onClick:()=>ae(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Ie.addTaskBtn}`,children:[
29
+ /* @__PURE__ */T("circle",{cx:"12",cy:"19",r:"1.4"})]})}),oe===e.id&&/* @__PURE__ */T("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__ */T("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.removeTask(a),q===a&&ee(null),re(null)},className:"block w-full px-3 py-1.5 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),te?/* @__PURE__ */T(le,{onSubmit:(e,t)=>{const a=e.trim();if(!a)return;const o=Y.addTask({name:a,estimated:t,completed:0,dueDate:X});q||ee(o),ae(!1)},onCancel:()=>ae(!1),accentColor:Ae}):/* @__PURE__ */B("button",{onClick:()=>ae(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${Ie.addTaskBtn}`,children:[
30
30
  /* @__PURE__ */B("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[
31
31
  /* @__PURE__ */T("circle",{cx:"12",cy:"12",r:"10"}),
32
32
  /* @__PURE__ */T("path",{strokeLinecap:"round",d:"M8 12h8M12 8v8"})]}),"Add Task"]})]}),
@@ -37,7 +37,7 @@ return B("div",{onClick:()=>ee(e.id),className:"bg-white text-gray-800 rounded-m
37
37
  /* @__PURE__ */T("span",{className:`font-bold ${Ie.primary}`,children:ce})]}),me>0&&/* @__PURE__ */B("span",{className:Ie.secondary,children:["Finish At: ",
38
38
  /* @__PURE__ */T("span",{className:`font-bold ${Ie.primary}`,children:he}),
39
39
  /* @__PURE__ */B("span",{className:Ie.muted,children:[" (",ge,"h)"]})]})]})]}),
40
- /* @__PURE__ */T(J,{open:ve,onClose:()=>ye(!1),onSave:()=>{ke(Ne),localStorage.setItem(P,JSON.stringify(Ne)),b({pomodoro_settings:Ce}),ye(!1)},configAppearance:Ne,setConfigAppearance:we,configPrefs:Ce,setConfigPrefs:Se})]})}function J({open:e,onClose:a,onSave:o,configAppearance:r,setConfigAppearance:n,configPrefs:l,setConfigPrefs:s}){const i=(e,t)=>s(a=>({...a,[e]:t}));/* @__PURE__ */
40
+ /* @__PURE__ */T(Q,{open:ve,onClose:()=>ye(!1),onSave:()=>{ke(Ne),localStorage.setItem(j,JSON.stringify(Ne)),b({pomodoro_settings:Ce}),ye(!1)},configAppearance:Ne,setConfigAppearance:we,configPrefs:Ce,setConfigPrefs:Se})]})}function Q({open:e,onClose:a,onSave:o,configAppearance:r,setConfigAppearance:n,configPrefs:l,setConfigPrefs:s}){const i=(e,t)=>s(a=>({...a,[e]:t}));/* @__PURE__ */
41
41
  return B(t,{open:e,onClose:a,title:"Pomodoro Settings",appearance:r,onAppearanceChange:n,onSave:o,children:[
42
42
  /* @__PURE__ */B(Y,{icon:/* @__PURE__ */T(oe,{}),label:"TIMER",children:[
43
43
  /* @__PURE__ */B("div",{children:[
@@ -46,34 +46,34 @@ return B(t,{open:e,onClose:a,title:"Pomodoro Settings",appearance:r,onAppearance
46
46
  /* @__PURE__ */T(Z,{label:"Pomodoro",value:l.focusMinutes,onChange:e=>i("focusMinutes",e),max:120}),
47
47
  /* @__PURE__ */T(Z,{label:"Short Break",value:l.shortBreakMinutes,onChange:e=>i("shortBreakMinutes",e),max:120}),
48
48
  /* @__PURE__ */T(Z,{label:"Long Break",value:l.longBreakMinutes,onChange:e=>i("longBreakMinutes",e),max:120})]})]}),
49
- /* @__PURE__ */T(Q,{label:"Auto Start Breaks",children:/* @__PURE__ */T(te,{checked:l.autoStartBreaks,onChange:e=>i("autoStartBreaks",e)})}),
50
- /* @__PURE__ */T(Q,{label:"Auto Start Pomodoros",children:/* @__PURE__ */T(te,{checked:l.autoStartPomodoros,onChange:e=>i("autoStartPomodoros",e)})}),
51
- /* @__PURE__ */T(Q,{label:"Long Break interval",children:/* @__PURE__ */T(G,{value:l.longBreakInterval,onChange:e=>i("longBreakInterval",e),min:1,max:20,className:"w-14 text-center"})})]}),
49
+ /* @__PURE__ */T(G,{label:"Auto Start Breaks",children:/* @__PURE__ */T(te,{checked:l.autoStartBreaks,onChange:e=>i("autoStartBreaks",e)})}),
50
+ /* @__PURE__ */T(G,{label:"Auto Start Pomodoros",children:/* @__PURE__ */T(te,{checked:l.autoStartPomodoros,onChange:e=>i("autoStartPomodoros",e)})}),
51
+ /* @__PURE__ */T(G,{label:"Long Break interval",children:/* @__PURE__ */T(q,{value:l.longBreakInterval,onChange:e=>i("longBreakInterval",e),min:1,max:20,className:"w-14 text-center"})})]}),
52
52
  /* @__PURE__ */B(Y,{icon:/* @__PURE__ */T(re,{}),label:"TASK",children:[
53
- /* @__PURE__ */T(Q,{label:"Auto Check Tasks",info:'If you enable "Auto Check Tasks", the active task will be automatically checked when the actual pomodoro count reaches the estimated count.',children:/* @__PURE__ */T(te,{checked:l.autoCheckTasks,onChange:e=>i("autoCheckTasks",e)})}),
54
- /* @__PURE__ */T(Q,{label:"Check to Bottom",info:'If you enable "Check to Bottom", the checked task will be automatically moved to the bottom of the task list.',children:/* @__PURE__ */T(te,{checked:l.checkToBottom,onChange:e=>i("checkToBottom",e)})})]}),
53
+ /* @__PURE__ */T(G,{label:"Auto Check Tasks",info:'If you enable "Auto Check Tasks", the active task will be automatically checked when the actual pomodoro count reaches the estimated count.',children:/* @__PURE__ */T(te,{checked:l.autoCheckTasks,onChange:e=>i("autoCheckTasks",e)})}),
54
+ /* @__PURE__ */T(G,{label:"Check to Bottom",info:'If you enable "Check to Bottom", the checked task will be automatically moved to the bottom of the task list.',children:/* @__PURE__ */T(te,{checked:l.checkToBottom,onChange:e=>i("checkToBottom",e)})})]}),
55
55
  /* @__PURE__ */B(Y,{icon:/* @__PURE__ */T(ne,{}),label:"SOUND",children:[
56
- /* @__PURE__ */T(Q,{label:"Alarm Sound",children:/* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
56
+ /* @__PURE__ */T(G,{label:"Alarm Sound",children:/* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
57
57
  /* @__PURE__ */T(ee,{value:l.alarmSound,onChange:e=>i("alarmSound",e),options:g.map(e=>({id:e.id,label:e.label}))}),"off"!==l.alarmSound&&/* @__PURE__ */T("button",{type:"button",onClick:()=>p(l.alarmSound,{volume:l.alarmVolume,repeat:1}),className:"px-2 py-1 text-[11px] rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
58
- /* @__PURE__ */T(q,{value:l.alarmVolume,onChange:e=>i("alarmVolume",e)}),
59
- /* @__PURE__ */T(Q,{label:"repeat",children:/* @__PURE__ */T(G,{value:l.alarmRepeat,onChange:e=>i("alarmRepeat",e),min:1,max:5,className:"w-14 text-center"})}),
60
- /* @__PURE__ */T(Q,{label:"Focus Sound",children:/* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
58
+ /* @__PURE__ */T(X,{value:l.alarmVolume,onChange:e=>i("alarmVolume",e)}),
59
+ /* @__PURE__ */T(G,{label:"repeat",children:/* @__PURE__ */T(q,{value:l.alarmRepeat,onChange:e=>i("alarmRepeat",e),min:1,max:5,className:"w-14 text-center"})}),
60
+ /* @__PURE__ */T(G,{label:"Focus Sound",children:/* @__PURE__ */B("div",{className:"flex items-center gap-2",children:[
61
61
  /* @__PURE__ */T(ee,{value:l.focusSound,onChange:e=>i("focusSound",e),options:f}),"none"!==l.focusSound&&/* @__PURE__ */T("button",{type:"button",onClick:()=>b(l.focusSound,l.focusVolume),className:"px-2 py-1 text-[11px] rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Play"})]})}),
62
- /* @__PURE__ */T(q,{value:l.focusVolume,onChange:e=>i("focusVolume",e)})]})]})}function Y({icon:e,label:t,children:a}){/* @__PURE__ */
62
+ /* @__PURE__ */T(X,{value:l.focusVolume,onChange:e=>i("focusVolume",e)})]})]})}function Y({icon:e,label:t,children:a}){/* @__PURE__ */
63
63
  return B("div",{className:"border-t border-gray-200 pt-3 first:border-0 first:pt-0",children:[
64
64
  /* @__PURE__ */B("div",{className:"flex items-center gap-1.5 mb-3 text-gray-400",children:[e,
65
65
  /* @__PURE__ */T("span",{className:"text-xs font-bold tracking-[0.15em]",children:t})]}),
66
- /* @__PURE__ */T("div",{className:"space-y-3",children:a})]})}function Q({label:e,info:t,children:a}){/* @__PURE__ */
66
+ /* @__PURE__ */T("div",{className:"space-y-3",children:a})]})}function G({label:e,info:t,children:a}){/* @__PURE__ */
67
67
  return B("div",{className:"flex items-center justify-between gap-3",children:[
68
68
  /* @__PURE__ */B("div",{className:"flex items-center gap-1.5 min-w-0",children:[
69
69
  /* @__PURE__ */T("span",{className:"text-sm font-semibold text-gray-800",children:e}),t&&/* @__PURE__ */T(ae,{title:t})]}),
70
- /* @__PURE__ */T("div",{className:"shrink-0",children:a})]})}function q({value:e,onChange:t}){/* @__PURE__ */
70
+ /* @__PURE__ */T("div",{className:"shrink-0",children:a})]})}function X({value:e,onChange:t}){/* @__PURE__ */
71
71
  return B("div",{className:"flex items-center justify-end gap-3",children:[
72
72
  /* @__PURE__ */T("span",{className:"text-xs text-gray-400 w-7 text-right tabular-nums",children:e}),
73
73
  /* @__PURE__ */T("input",{type:"range",min:0,max:100,value:e,onChange:e=>t(parseInt(e.target.value,10)),className:"w-40 accent-blue-500"})]})}function Z({label:e,value:t,onChange:a,min:o=1,max:r=99}){/* @__PURE__ */
74
74
  return B("label",{className:"flex flex-col",children:[
75
75
  /* @__PURE__ */T("span",{className:"text-xs font-semibold text-gray-500 mb-1",children:e}),
76
- /* @__PURE__ */T(G,{value:t,onChange:a,min:o,max:r})]})}function G({value:e,onChange:t,min:a=1,max:o=99,className:r=""}){/* @__PURE__ */
76
+ /* @__PURE__ */T(q,{value:t,onChange:a,min:o,max:r})]})}function q({value:e,onChange:t,min:a=1,max:o=99,className:r=""}){/* @__PURE__ */
77
77
  return T("input",{type:"number",min:a,max:o,value:e,onChange:e=>t(Math.max(a,Math.min(o,parseInt(e.target.value,10)||a))),className:`bg-gray-100 border-0 rounded-md px-2 py-1.5 text-sm font-medium text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full ${r}`})}function ee({value:e,onChange:t,options:a}){/* @__PURE__ */
78
78
  return B("div",{className:"relative",children:[
79
79
  /* @__PURE__ */T("select",{value:e,onChange:e=>t(e.target.value),className:"appearance-none bg-gray-100 border-0 rounded-md pl-3 pr-8 py-1.5 text-sm font-medium text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer",children:a.map(e=>/* @__PURE__ */T("option",{value:e.id,children:e.label},e.id))}),
@@ -96,4 +96,4 @@ return B("div",{className:"bg-white text-gray-800 rounded-md p-3 shadow-md",chil
96
96
  /* @__PURE__ */T("input",{type:"number",min:1,max:20,value:n,onChange:e=>l(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"})]}),
97
97
  /* @__PURE__ */B("div",{className:"flex gap-2 mt-3 justify-end",children:[
98
98
  /* @__PURE__ */T("button",{onClick:t,className:"px-3 py-1 text-sm text-gray-500 hover:bg-gray-100 rounded",children:"Cancel"}),
99
- /* @__PURE__ */T("button",{onClick:s,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:a},children:"Save"})]})]})}export{X as default};
99
+ /* @__PURE__ */T("button",{onClick:s,className:"px-4 py-1 text-sm font-semibold text-white rounded shadow-sm",style:{backgroundColor:a},children:"Save"})]})]})}export{K as default};