efficient-shell 15.6.0 → 15.8.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 (52) hide show
  1. package/README.md +11 -5
  2. package/dist/{Browser-MBT76EKF.js → Browser-5QLDJ74Z.js} +13 -13
  3. package/dist/Calculator-6WNTZLWL.js +29 -0
  4. package/dist/{CurrencyConverter-UAZYLLHT.js → CurrencyConverter-C4KCZWUM.js} +10 -10
  5. package/dist/{Files-G5VBN3GD.js → Files-VFRXPQLV.js} +46 -46
  6. package/dist/{Notepad-23YBRLDH.js → Notepad-S5JMXH2O.js} +9 -9
  7. package/dist/PomodoroTimer-BGTCWT53.js +91 -0
  8. package/dist/{Preview-4VKAQ4TY.js → Preview-HTFTEL7K.js} +19 -19
  9. package/dist/{Stock-6YYK6VWP.js → Stock-LIOPTQG5.js} +6 -6
  10. package/dist/{Weather-2OU3LEWQ.js → Weather-K3BVAFRV.js} +18 -18
  11. package/dist/{WorldClock-PYJ4762U.js → WorldClock-RHAHXLW4.js} +6 -6
  12. package/dist/ai/index.js +8 -8
  13. package/dist/apps/ImageAnnotator.js +1 -1
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.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/chunk-3AUPCKBR.js +1 -0
  20. package/dist/chunk-6FOLK4HD.js +1 -0
  21. package/dist/{chunk-6ZNJ6JU5.js → chunk-E4WVF6AS.js} +6 -6
  22. package/dist/{chunk-OQAGCYR7.js → chunk-EA423N2F.js} +3 -3
  23. package/dist/chunk-GD5NGS6D.js +89 -0
  24. package/dist/chunk-GZ4AMXEU.js +1 -0
  25. package/dist/{chunk-N3T5BE2T.js → chunk-OHPDB4UN.js} +4 -4
  26. package/dist/{chunk-3C2VY2VF.js → chunk-RRWQBWLW.js} +1 -1
  27. package/dist/chunk-WGDVYCQX.js +69 -0
  28. package/dist/{chunk-OZNCUWYB.js → chunk-XZKVGJIB.js} +1 -1
  29. package/dist/{chunk-NICH2O4C.js → chunk-YFVQKS5U.js} +1 -1
  30. package/dist/chunk-ZLB5GRL6.js +1 -0
  31. package/dist/format/index.d.ts +15 -1
  32. package/dist/format/index.js +1 -1
  33. package/dist/forms/LinkPicker.js +1 -1
  34. package/dist/forms/MediaLibrary.js +1 -1
  35. package/dist/hooks/index.d.ts +42 -1
  36. package/dist/hooks/index.js +1 -1
  37. package/dist/icons/index.js +1 -1
  38. package/dist/index.d.ts +117 -75
  39. package/dist/index.js +662 -662
  40. package/dist/motion.css +9 -4
  41. package/dist/routine-index.json +1 -1
  42. package/dist/shell/LanguageSelect.js +1 -1
  43. package/dist/telemetry/index.js +1 -1
  44. package/dist/ui/index.js +1 -1
  45. package/dist/value-index.json +1 -1
  46. package/dist/version.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/Calculator-PAMITD4N.js +0 -29
  49. package/dist/PomodoroTimer-QFF2FTAG.js +0 -91
  50. package/dist/chunk-IN36HWJK.js +0 -1
  51. package/dist/chunk-TDUOBP55.js +0 -69
  52. package/dist/chunk-XRWUNOI3.js +0 -92
package/README.md CHANGED
@@ -205,7 +205,7 @@ draw, and a portal fills them rather than drawing its own:
205
205
 
206
206
  **No bottom bar either.** On the desktop a window draws no footer BAR. Its
207
207
  buttons stay at the bottom of the window, in the order they always had
208
- (Undo/Redo, `actionsLeft` and left `ModalActions` on the left; Edit or
208
+ (`actionsLeft` and left `ModalActions` on the left; Edit or
209
209
  Discard and the `actions` / `ModalActions` buttons on the right), but on the
210
210
  body's own surface, with no line above them and no fill. The `footer` facts
211
211
  are not drawn on the desktop, so nothing a user needs may live only there. A
@@ -1826,7 +1826,8 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1826
1826
  | `Pagination` | Numbered page control (pairs with tables; complements `ListFooter`). |
1827
1827
  | `Sparkline`, `ScatterChart` | Dependency-free inline-SVG charts. `Sparkline` is the decorative trend for a tile (`currentColor`-themed). For bars use `ColumnChart`, for a trend over time `TimeSeriesChart`, for a donut `PieChart variant="ring"`. `ScatterChart` takes `xDomain` / `yDomain` to override the derived axis, and `xScale` / `yScale` of `'log'` for a long tail; a point outside a supplied domain is dropped and counted in the accessible label. |
1828
1828
  | `BulkImportGrid` | Paste-or-upload bulk entry with column mapping, duplicate review and optional sum-merge. Hands resolved rows to `onImport`; owns no persistence. The whole panel takes a dropped CSV; the Upload CSV button opens the same dialog. Its words are the strings catalog's `bulkImport` section (a `description` prop wins), and its totals are written in the provider's `locale`. |
1829
- | `UndoProvider`, `UndoControls` | One undo stack per form window, covering its fields, line items and bulk imports. Register state with `useUndoable` and the shell shows the Undo/Redo pair itself, leftmost in the window footer, as soon as the form has state and the window is editing (a draft, a duplicate, Edit mode) or the form has said `useUndoCanEdit(true)` — a view that merely holds state gets nothing — it joins a footer that is there for other reasons and never creates one, and the mobile chrome (footer hidden) gets nothing. A form mounts `UndoControls` by hand only for a place the footer is not (a plain overlay, a section header); a hand mount claims the stack and the shell then mounts nothing for it, so a form shows one pair wherever it chose to put it. Binds ⌘Z / ⇧⌘Z (and Ctrl+Y) except while the caret is in a field, where the browser's own undo wins. `WindowManager` already mounts one per window, scoped with `windowId` so a keypress reaches only the frontmost window; pass `windowId` yourself for any provider you mount outside a `<Modal>`, or two open windows will step back together. Offered to anyone who may edit the record — gate with `canEdit` and/or `perms`; a reader sees no controls and records no history. The shell-level provider cannot know the record's permissions, so a read-only form nests its own `<UndoProvider canEdit={false}>` to shadow it. A provider nested inside a window puts its own pair in the footer on the same footer terms — it joins a footer that is there for other reasons, never creates one or holds it open, and shows nothing on the mobile chrome — but its `canEdit` takes the place of the editing check: the form that nested it has already said whether the record may be edited, so pass `canEdit={isEditing}` (or the lock) rather than leaving the default. |
1829
+ | `UndoProvider`, `UndoControls` | One undo stack per window, covering its fields, line items and bulk imports. **Undo is keys only, and the shell is the one owner of the keys** (Victor Mau, 2026-11-24): ⌘Z / Ctrl+Z undo, ⇧⌘Z / Ctrl+Shift+Z / Ctrl+Y redo, except while the caret is in a field, where the browser's own undo wins. There are no Undo / Redo buttons; `UndoControls` renders nothing and is deprecated (delete by 2027-01-31) — remove your calls. `WindowManager` already mounts one provider per window, scoped with `windowId` so a keypress reaches only the frontmost window; pass `windowId` yourself for any provider you mount outside a `<Modal>`, or two open windows will step back together. Gate with `canEdit` and/or `perms`; a reader records no history and the keys are left alone. The shell-level provider cannot know the record's permissions, so a read-only form nests its own `<UndoProvider canEdit={false}>` (or says `useUndoCanEdit(false)`). An editor with a history of its own hands it to the keys with `useUndoHistory`. |
1830
+ | `useUndoHistory(source, keyTargets?)` | Put a history the shell does not hold — an editor's document store (efficient-easel) — under the shell's undo keys, instead of binding ⌘Z yourself. `source` is `{ undo, redo, canUndo(), canRedo() }`, read at each press; a `false` from `canUndo`/`canRedo` leaves the key alone (an empty history, or a document that may not be written). Inside a window the window's stack answers with it while you are mounted; `keyTargets` are other documents a key can be pressed in that never reach `window` (an iframe's), positional — keep the same number on every render, `null` for an empty slot. With no `UndoProvider` above (a page with no shell windows) it binds `window` and the targets itself, with the same rule (`matchUndoHotkey`). Also exported from the React-only `efficient-shell/hooks`. |
1830
1831
  | `Calendar` | Month grid with full keyboard navigation (arrows, Home/End, PageUp/Down) and `role="grid"` semantics. Single or range. Days of the months either side are quieter than the month's own but keep AA contrast: they are dates a person can press. The shared grid behind `DatePicker` and `DateRangePicker`. `weekStartsOn` defaults to the provider locale's first day of the week (`firstDayOfWeek`), Sunday without one. |
1831
1832
  | `DashboardTemplate`, `DataTablePage`, `FormLayoutPage`, `CheckoutTemplate`, `EmailTemplate`, `ChatTemplate`, `GalleryTemplate`, `AuthScreen`, `ErrorPage` | Zero-prop starter page templates composed from the primitives. |
1832
1833
  | `ErrorBoundary` | Catches a render crash and shows `ErrorPage` 500 rather than a blank screen. `showDetails` is off by default, so a visitor is never shown the stack; the fallback is `role="alert"`. Takes `onError` for reporting and `resetKeys` to recover on navigation. |
@@ -2703,12 +2704,17 @@ pair inline for a track that sticks in every view (without it, no inline
2703
2704
  value, so a host's per-view rule wins); a host with a different answer per view calls
2704
2705
  `pinStickVars` once per view and puts the result in that view's rule. The
2705
2706
  pull that lets the next section slide over the frame is the track's own
2706
- `margin-bottom`, so it reads the same view answers as the track. The custom
2707
+ `margin-bottom`, so it reads the same view answers as the track. How a track
2708
+ ends (`PIN_ENDS`, read by `readPinEnd`): `over` (the default) keeps that
2709
+ slide-over screen and its pull; `pinAttrs(value, 'track', { end: 'away' })`
2710
+ writes `--motion-pin-over: 0` (`PIN_OVER_VAR`), so the track has no slide-over
2711
+ screen and no pull: when the effect screens end, the frame goes up with the
2712
+ page and the next section follows right under it. The custom
2707
2713
  property names are exported, one each: `SCROLL_ZOOM_VAR`,
2708
2714
  `SCROLL_ORIGIN_VAR`, `SCROLL_START_VAR`, `SCROLL_END_VAR`,
2709
2715
  `SCROLL_PROGRESS_VAR`, `PIN_ON_VAR`, `PIN_TOP_VAR`, `PIN_LENGTH_VAR`,
2710
- `PIN_POSITION_VAR`, `PIN_STICK_VAR`, `PIN_TRACK_POSITION_VAR` and
2711
- `PIN_ABOVE_Z_VAR` (and, for an
2716
+ `PIN_POSITION_VAR`, `PIN_STICK_VAR`, `PIN_TRACK_POSITION_VAR`,
2717
+ `PIN_ABOVE_Z_VAR` and `PIN_OVER_VAR` (and, for an
2712
2718
  Entrance, `ENTRANCE_DURATION_VAR` and `ENTRANCE_DELAY_VAR`); a host writes
2713
2719
  a name from these, never a copied string. `pinAttrs(value, form, { above:
2714
2720
  true })` writes `PIN_ABOVE_ATTR` (`data-motion-pin-above`): a stuck box (a bar)
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-D7MRZZVV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-OQAGCYR7.js";import{WindowTitle as n}from"./chunk-XRWUNOI3.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-IN36HWJK.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var p="react-os-shell:browser-bookmarks",d="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(p);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(d)||k}function N(){const h=a(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,N]=l(k||b),[C,R]=l(w),[W,D]=l([w]),[H,P]=l(0),[T,S]=l(0),[z,U]=l(x),[Z,E]=l(!1),[A,G]=l(null),J=a(null),L=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(z))}catch{}},[z]);const M=e=>{const t=f(e);t&&(N(t),R(t),D(e=>{const o=e.slice(0,H+1);return o.push(t),o}),P(e=>e+1),E(!1))},Y=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},F=()=>{const e=A?.trim();e?(U(t=>[...t,{label:e,url:w}]),G(null)):G(null)};c(()=>{if(null===A)return;J.current?.focus(),J.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==A]);const O=e=>{U(t=>t.filter((t,o)=>o!==e))},Q=H>0,V=H<W.length-1,I=z.some(e=>e.url===w),K="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-D7MRZZVV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-EA423N2F.js";import{WindowTitle as n}from"./chunk-GD5NGS6D.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-6FOLK4HD.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var p="react-os-shell:browser-bookmarks",d="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(p);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(d)||k}function N(){const h=a(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,N]=l(k||b),[C,R]=l(w),[D,W]=l([w]),[P,H]=l(0),[S,Z]=l(0),[z,T]=l(x),[U,E]=l(!1),[G,L]=l(null),A=a(null),F=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(z))}catch{}},[z]);const M=e=>{const t=f(e);t&&(N(t),R(t),W(e=>{const o=e.slice(0,P+1);return o.push(t),o}),H(e=>e+1),E(!1))},J=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},Y=()=>{const e=G?.trim();e?(T(t=>[...t,{label:e,url:w}]),L(null)):L(null)};c(()=>{if(null===G)return;A.current?.focus(),A.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||L(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==G]);const B=e=>{T(t=>t.filter((t,o)=>o!==e))},K=P>0,O=P<D.length-1,V=z.some(e=>e.url===w),Q="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */u(n,{title:`Browser - ${j(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(H>0){const e=H-1;P(e),N(W[e]),R(W[e]),E(!1)}},disabled:!Q,className:K,title:"Back",children:/* @__PURE__ */u(i,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(H<W.length-1){const e=H+1;P(e),N(W[e]),R(W[e]),E(!1)}},disabled:!V,className:K,title:"Forward",children:/* @__PURE__ */u(i,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>S(e=>e+1),className:K,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>M(b),className:K,title:"Home",children:/* @__PURE__ */u(i,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(P>0){const e=P-1;H(e),N(D[e]),R(D[e]),E(!1)}},disabled:!K,className:Q,title:"Back",children:/* @__PURE__ */u(i,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(P<D.length-1){const e=P+1;H(e),N(D[e]),R(D[e]),E(!1)}},disabled:!O,className:Q,title:"Forward",children:/* @__PURE__ */u(i,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>Z(e=>e+1),className:Q,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>M(b),className:Q,title:"Home",children:/* @__PURE__ */u(i,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
10
  /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),M(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
13
  /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(i,{name:"close"}),onClick:()=>R(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>I?O(z.findIndex(e=>e.url===w)):void G(j(w)),className:K+" "+(I?"text-yellow-500":""),title:I?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(i,{name:"star",className:"h-4 w-4",fill:I?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:Y,className:K,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>E(e=>!e),className:K,title:"Embedding help",children:/* @__PURE__ */u(i,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==A&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>V?B(z.findIndex(e=>e.url===w)):void L(j(w)),className:Q+" "+(V?"text-yellow-500":""),title:V?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(i,{name:"star",className:"h-4 w-4",fill:V?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:J,className:Q,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>E(e=>!e),className:Q,title:"Embedding help",children:/* @__PURE__ */u(i,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==G&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:J,type:"text",value:A,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?F():"Escape"===e.key&&G(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:A,type:"text",value:G,onChange:e=>L(e.target.value),onKeyDown:e=>{"Enter"===e.key?Y():"Escape"===e.key&&L(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:F,disabled:!A.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===z.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),z.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>M(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&O(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>L(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:Y,disabled:!G.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===z.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),z.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>M(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&B(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(d,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(v,{url:w,iframeKey:T,iframeRef:L,openExternal:Y,showHelp:Z,dismissHelp:()=>E(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function v({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[a,p]=l(!1);c(()=>{p(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!a?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(v,{url:w,iframeKey:S,iframeRef:F,openExternal:J,showHelp:U,dismissHelp:()=>E(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function v({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[a,p]=l(!1);c(()=>{p(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!a?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(i,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
29
  /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[j(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-RRWQBWLW.js";import{useWidgetSettings as n}from"./chunk-GD5NGS6D.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[j,b]=c(null),[g,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,$]=c(!1),[T,P]=c(()=>t(h)),[E,R]=c(!1),[Z,A]=c(T),D=i(null);n(o(()=>{A({...T}),R(!0)},[T]));const W=o(t=>{y(""),k(e=>g||"0"===e?(N(!1),"."===t?"0.":t):"."===t&&e.includes(".")?e:e+t)},[g]),G=o(()=>{k("0"),d(null),b(null),N(!1)},[]),S=o((t,e,n)=>{switch(n){case"+":return t+e;case"-":return t-e;case"×":return t*e;case"÷":return 0===e?0:t/e;default:return e}},[]),B=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=S(p,e,j);k(String(t)),d(t),f(n=>[`${p} ${j} ${e} = ${t}`,...n].slice(0,20))}else d(e);b(t),N(!0)},[m,p,j,g,S]),F=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=S(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),y(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,S]),U=o(()=>{k(t=>String(parseFloat(t)/100))},[]),H=o(()=>{k(t=>t.startsWith("-")?t.slice(1):"0"===t?t:"-"+t)},[]);s(()=>{const t=t=>{const e=t.target.tagName;"INPUT"!==e&&"TEXTAREA"!==e&&"SELECT"!==e&&(t.key>="0"&&t.key<="9"?W(t.key):"."===t.key?W("."):"+"===t.key?B("+"):"-"===t.key?B("-"):"*"===t.key?B("×"):"/"===t.key?(t.preventDefault(),B("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&D.current?.contains(t.target)&&t.preventDefault(),F()):"Escape"===t.key?G():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&U())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[W,B,F,G,U]);const J="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",Q=`${J} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,M=`${J} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,V=`${J} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,Y=`${J} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:D,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((t,e)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:t},e))}),(C||j&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:C||`${p} ${j} ${g?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(t=>{const e=parseFloat(t);return isNaN(e)||t.endsWith(".")||t.endsWith(".0")||Math.abs(e)<1e15&&t.length<16?t:e.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:G,className:V,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:H,className:V,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:U,className:V,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>B("÷"),className:`${M} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>W("7"),className:Q,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>W("8"),className:Q,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>W("9"),className:Q,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>B("×"),className:`${M} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>W("4"),className:Q,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>W("5"),className:Q,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>W("6"),className:Q,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>B("-"),className:`${M} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>W("1"),className:Q,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>W("2"),className:Q,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>W("3"),className:Q,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>B("+"),className:`${M} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>W("0"),className:`${Q} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>W("."),className:Q,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:F,className:Y,children:"="})]})]}),
29
+ /* @__PURE__ */u(e,{open:E,onClose:()=>R(!1),title:"Calculator Settings",appearance:Z,onAppearanceChange:A,onSave:()=>{P(Z),localStorage.setItem(h,JSON.stringify(Z)),R(!1)}})]})}export{m as default};
@@ -1,7 +1,7 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-3C2VY2VF.js";import{useWidgetSettings as r}from"./chunk-XRWUNOI3.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function j(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var g={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,D]=s({}),[b,S]=s(!1),[C,v]=s(!1),[U,P]=s([]),[J,R]=s(f),[A,H]=s("USD"),[B,Y]=s("CNY");r(o(()=>{P([...u]),R({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,j(e,n.rates))}catch{}}e&&(D(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-RRWQBWLW.js";import{useWidgetSettings as r}from"./chunk-GD5NGS6D.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-YI4T5I5D.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import"./chunk-JRKD7SD3.js";import"./chunk-5RCKE4X2.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-5QHNDAZ6.js";import"./chunk-TEQ5ZPAL.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-5VJVEKVM.js";import"./chunk-YPXONNBV.js";import"./chunk-4PJFL26P.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-F3ZOO23R.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-APFDZ2HG.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-A4ROXNUF.js";import"./chunk-TSZPGDU3.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-FAPZFMS3.js";import"./chunk-CIZAUBWA.js";import"./chunk-PGN5ME7B.js";import"./chunk-5QRHQCRG.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.js";import"./chunk-3FININUU.js";import"./chunk-STKJA4PV.js";import"./chunk-GZ4AMXEU.js";import"./chunk-M6UKCZHT.js";import"./chunk-3AUPCKBR.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-NRHG4R2Q.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",k="currency_rates_cache";function d(t){try{const e=JSON.parse(localStorage.getItem(k)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function j(t,e){try{const r=JSON.parse(localStorage.getItem(k)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(k,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var g={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,k]=s(N),[f,x]=s(()=>t(h)),[D,y]=s({}),[b,S]=s(!1),[C,U]=s(!1),[v,P]=s([]),[R,J]=s(f),[A,B]=s("USD"),[G,H]=s("CNY");r(o(()=>{P([...u]),J({...f}),U(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=d(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,j(e,n.rates))}catch{}}e&&(y(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
- /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
- return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=D[t]?.[e];/* @__PURE__ */
4
+ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);k(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */m("span",{className:"text-base",children:g[t]||""}),
7
7
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */m("span",{className:"text-base",children:g[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:J,onAppearanceChange:R,onSave:()=>{if(0===U.length)return;const t=U.slice(0,4);d(t),x(J),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(J)),v(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>U(!1),title:"Currency Settings",appearance:R,onAppearanceChange:J,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);k(t),x(R),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(R)),U(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",U.length,"/",4,")"]})]}),
15
- /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:U.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:v.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */i("span",{className:"text-sm",children:[g[t]||""," ",t," → ",g[e]||""," ",e]}),
17
- /* @__PURE__ */m("button",{onClick:()=>P(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),U.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:A,onChange:t=>H(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
17
+ /* @__PURE__ */m("button",{onClick:()=>P(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */m("select",{value:A,onChange:t=>B(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:B,onChange:t=>Y(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{A!==B&&U.length<4&&P(t=>[...t,[A,B]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */m("select",{value:G,onChange:t=>H(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{A!==G&&v.length<4&&P(t=>[...t,[A,G]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};