efficient-shell 16.6.0 → 16.7.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 (78) hide show
  1. package/README.md +17 -4
  2. package/dist/{Browser-UHT6QSUN.js → Browser-XCKNVOAU.js} +14 -14
  3. package/dist/{Calculator-ZG5RX2HX.js → Calculator-VOZDVOYE.js} +22 -22
  4. package/dist/{CurrencyConverter-AHGYTGKM.js → CurrencyConverter-AMGFHBJE.js} +5 -5
  5. package/dist/{Files-4HJWEYDE.js → Files-FACH4PUV.js} +62 -62
  6. package/dist/{Notepad-GXKGVTNG.js → Notepad-4H26PYBU.js} +7 -7
  7. package/dist/{PomodoroTimer-GN2OSLJ6.js → PomodoroTimer-77VMHGDE.js} +4 -4
  8. package/dist/{Preview-EN4YCUH5.js → Preview-RVVXOMRS.js} +14 -14
  9. package/dist/{Stock-44BSCZOL.js → Stock-PXLNR6A6.js} +3 -3
  10. package/dist/{Weather-GNGUF6A4.js → Weather-WGLPPZPX.js} +16 -16
  11. package/dist/{WorldClock-EBZJRH5F.js → WorldClock-UY4B5VKZ.js} +7 -7
  12. package/dist/ai/index.d.ts +1 -1
  13. package/dist/ai/index.js +8 -8
  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/{chunk-3C7JKJGL.js → chunk-2SOK37OP.js} +1 -1
  19. package/dist/{chunk-N7EZ2BFE.js → chunk-AG2DEQYB.js} +6 -6
  20. package/dist/{chunk-H6JJAVYL.js → chunk-EC6XKOAE.js} +1 -1
  21. package/dist/chunk-EJFJOHPZ.js +1 -0
  22. package/dist/{chunk-UQPVUPSS.js → chunk-FFCVC4ES.js} +1 -1
  23. package/dist/{chunk-MS6IZF6E.js → chunk-KTZGG242.js} +1 -1
  24. package/dist/{chunk-HOTIZZXC.js → chunk-LBXKYVM3.js} +1 -1
  25. package/dist/chunk-MHKTBQ53.js +5 -0
  26. package/dist/{chunk-EJTAPBGB.js → chunk-MIHPFJCP.js} +13 -13
  27. package/dist/chunk-MWJNMENV.js +2 -0
  28. package/dist/chunk-OYB2ZLJ3.js +1 -0
  29. package/dist/{chunk-DX24Q5OR.js → chunk-RWOBYP7Q.js} +1 -1
  30. package/dist/{chunk-ATTQTQJI.js → chunk-S24LTOBM.js} +4 -4
  31. package/dist/chunk-S3TQ3VOK.js +2 -0
  32. package/dist/chunk-XCTS44UZ.js +1 -0
  33. package/dist/{chunk-YYGA4Y6E.js → chunk-YAVIKKIQ.js} +1 -1
  34. package/dist/format/index.d.ts +24 -6
  35. package/dist/format/index.js +1 -1
  36. package/dist/forms/LinkPicker.js +1 -1
  37. package/dist/forms/MediaLibrary.js +1 -1
  38. package/dist/forms/Select.d.ts +1 -1
  39. package/dist/forms/TextToolbar.d.ts +1 -1
  40. package/dist/forms/textAlign.d.ts +1 -1
  41. package/dist/icons/efficient-glyphs.d.ts +1 -0
  42. package/dist/icons/efficient-glyphs.js +1 -1
  43. package/dist/icons/efficient-looks.d.ts +2 -0
  44. package/dist/icons/efficient-looks.js +1 -1
  45. package/dist/icons/efficient-meanings.d.ts +1 -0
  46. package/dist/icons/efficient-meanings.js +1 -1
  47. package/dist/icons/efficient.d.ts +1 -0
  48. package/dist/icons/efficient.js +1 -1
  49. package/dist/icons/glyphs/ScrollExpandIcon.d.ts +8 -0
  50. package/dist/icons/glyphs/ScrollExpandIcon.js +1 -0
  51. package/dist/icons/index.d.ts +2 -2
  52. package/dist/icons/index.js +1 -1
  53. package/dist/icons/looks/ScrollExpandMiniIcon.d.ts +8 -0
  54. package/dist/icons/looks/ScrollExpandMiniIcon.js +1 -0
  55. package/dist/icons/looks/ScrollExpandSolidIcon.d.ts +8 -0
  56. package/dist/icons/looks/ScrollExpandSolidIcon.js +1 -0
  57. package/dist/icons/looks/map.js +1 -1
  58. package/dist/icons/sets.js +1 -1
  59. package/dist/index.d.ts +1 -1
  60. package/dist/index.js +162 -162
  61. package/dist/motion/entrance.js +1 -1
  62. package/dist/motion/values.d.ts +7 -2
  63. package/dist/motion/values.js +1 -1
  64. package/dist/motion.css +28 -5
  65. package/dist/{names-CpcmfUzD.d.ts → names-Bw6ChIJl.d.ts} +1 -1
  66. package/dist/routine-index.json +1 -1
  67. package/dist/shell/LanguageSelect.js +1 -1
  68. package/dist/shell/Markdown.d.ts +1 -1
  69. package/dist/telemetry/index.js +1 -1
  70. package/dist/ui/index.d.ts +1 -1
  71. package/dist/ui/index.js +1 -1
  72. package/dist/value-index.json +1 -1
  73. package/dist/version.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/chunk-AIJ3G6BD.js +0 -1
  76. package/dist/chunk-OMOAD5LL.js +0 -1
  77. package/dist/chunk-YVXF7L66.js +0 -1
  78. /package/dist/{chunk-OQOWFHRZ.js → chunk-4B54NLXF.js} +0 -0
package/README.md CHANGED
@@ -2669,14 +2669,24 @@ motion nothing waits and nothing plays. The keyframes are in `motion.css`.
2669
2669
 
2670
2670
  **Scroll.** A part plays an effect as the visitor scrolls, and a section can
2671
2671
  stay pinned to the screen while its parts play. `SCROLL_EFFECTS` (None, Zoom
2672
- in, Zoom out, Fade in, Fade out, Move up, Move down, Reveal, Parallax);
2672
+ in, Zoom out, Fade in, Fade out, Move up, Move down, Reveal, Parallax,
2673
+ Expand);
2673
2674
  `SCROLL_EFFECTS_WITH_ZOOM` names the two that take a Zoom. `SCROLL_ZOOM` is the
2674
2675
  size added to the whole picture in percent (0–100, step 10, default 30 = 1.3
2675
2676
  times), toward the picture's focus point. `SCROLL_START` / `SCROLL_END` are
2676
2677
  where in the scroll the part plays (0–100 %). `PIN_LENGTH` is how long a
2677
2678
  section stays pinned, in screens (0–4, default 2; 0 = the next section slides
2678
- over at once). `readScroll(effect, zoom, start, end)` and `readPin(on, length)`
2679
- read stored values (an End before its Start swaps with it).
2679
+ over at once). `SCROLL_EASES` is the Speed of a part: the curve its effect plays on (`linear`,
2680
+ the default, `smooth` and `arrive`, named after `MOTION_EASING`).
2681
+ `readScroll(effect, zoom, start, end, ease)` and `readPin(on, length)`
2682
+ read stored values (an End before its Start swaps with it; an unknown curve
2683
+ reads as `linear`). Expand opens a part from `--motion-expand-side` on each
2684
+ side (a host's answer per view, default `0px`) to the screen edges, by
2685
+ `clip-path` only; inside a pinned track it plays on the approach (from the
2686
+ track's top at the screen bottom to the stop), so the section is full width
2687
+ when its frame sticks. A host that draws the effect tiles from
2688
+ `SCROLL_EFFECTS` draws only the values it has a glyph and word for, so a new
2689
+ value never breaks an older editor.
2680
2690
  `scrollAttrs(value, origin?)` and `pinAttrs(value)` give the element its
2681
2691
  attributes (`data-motion-scroll`, `data-motion-pin`) and, only when changed,
2682
2692
  the inline custom properties; the pinned frame carries `data-motion-pin-frame`.
@@ -2712,6 +2722,7 @@ screen and no pull: when the effect screens end, the frame goes up with the
2712
2722
  page and the next section follows right under it. The custom
2713
2723
  property names are exported, one each: `SCROLL_ZOOM_VAR`,
2714
2724
  `SCROLL_ORIGIN_VAR`, `SCROLL_START_VAR`, `SCROLL_END_VAR`,
2725
+ `SCROLL_EASE_VAR`, `EXPAND_SIDE_VAR`,
2715
2726
  `SCROLL_PROGRESS_VAR`, `PIN_ON_VAR`, `PIN_TOP_VAR`, `PIN_LENGTH_VAR`,
2716
2727
  `PIN_POSITION_VAR`, `PIN_STICK_VAR`, `PIN_TRACK_POSITION_VAR`,
2717
2728
  `PIN_ABOVE_Z_VAR` and `PIN_OVER_VAR` (and, for an
@@ -2730,7 +2741,9 @@ effect screens; outside one it is the part's own pass through the screen. Only
2730
2741
  opacity, transform and clip-path move. One element plays one animation: an
2731
2742
  element that also has an Entrance keeps it and plays no scroll effect, so a
2732
2743
  host that offers both puts the scroll attributes on a wrapper. A browser
2733
- without scroll timelines gets `armScrollProgress(root)`, which writes
2744
+ without scroll timelines draws every scroll part as it is (no hidden part
2745
+ when the script does not run) until `armScrollProgress(root)` marks the page
2746
+ (`data-motion-scrub`) and writes
2734
2747
  `--motion-p` once per frame, measured from the layout box (`layoutBox`), so the
2735
2748
  effect's own translate or scale does not move it;
2736
2749
  `scrollProgress` is the same sum, for a host that needs the number. With
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-BYTQRQ5P.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-DX24Q5OR.js";import{WindowTitle as n}from"./chunk-EJTAPBGB.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-ZLB5GRL6.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-YVXF7L66.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.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-LYGIOJ3J.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 j(){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,j]=l(k||b),[C,R]=l(w),[W,P]=l([w]),[L,H]=l(0),[T,z]=l(0),[D,S]=l(x),[U,B]=l(!1),[G,O]=l(null),Y=a(null),E=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(D))}catch{}},[D]);const J=e=>{const t=f(e);t&&(j(t),R(t),P(e=>{const o=e.slice(0,L+1);return o.push(t),o}),H(e=>e+1),B(!1))},Z=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},M=()=>{const e=G?.trim();e?(S(t=>[...t,{label:e,url:w}]),O(null)):O(null)};c(()=>{if(null===G)return;Y.current?.focus(),Y.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||O(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==G]);const Q=e=>{S(t=>t.filter((t,o)=>o!==e))},V=L>0,A=L<W.length-1,I=D.some(e=>e.url===w),F="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-BYTQRQ5P.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-RWOBYP7Q.js";import{WindowTitle as n}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.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-OYB2ZLJ3.js";import"./chunk-NJY4HPNB.js";import"./chunk-PM6HY5BH.js";import"./chunk-DWGYC7OD.js";import"./chunk-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.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-LYGIOJ3J.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 j(){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,j]=l(k||b),[C,R]=l(w),[W,P]=l([w]),[H,L]=l(0),[z,S]=l(0),[T,U]=l(x),[B,D]=l(!1),[O,Y]=l(null),J=a(null),Z=a(null);c(()=>{try{localStorage.setItem(p,JSON.stringify(T))}catch{}},[T]);const G=e=>{const t=f(e);t&&(j(t),R(t),P(e=>{const o=e.slice(0,H+1);return o.push(t),o}),L(e=>e+1),D(!1))},M=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},E=()=>{const e=O?.trim();e?(U(t=>[...t,{label:e,url:w}]),Y(null)):Y(null)};c(()=>{if(null===O)return;J.current?.focus(),J.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||Y(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==O]);const Q=e=>{U(t=>t.filter((t,o)=>o!==e))},I=H>0,V=H<W.length-1,A=T.some(e=>e.url===w),F="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 - ${N(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(L>0){const e=L-1;H(e),j(W[e]),R(W[e]),B(!1)}},disabled:!V,className:F,title:"Back",children:/* @__PURE__ */u(i,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(L<W.length-1){const e=L+1;H(e),j(W[e]),R(W[e]),B(!1)}},disabled:!A,className:F,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:F,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>J(b),className:F,title:"Home",children:/* @__PURE__ */u(i,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),J(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:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(H>0){const e=H-1;L(e),j(W[e]),R(W[e]),D(!1)}},disabled:!I,className:F,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;L(e),j(W[e]),R(W[e]),D(!1)}},disabled:!V,className:F,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:F,title:"Refresh",children:/* @__PURE__ */u(i,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>G(b),className:F,title:"Home",children:/* @__PURE__ */u(i,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),G(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?Q(D.findIndex(e=>e.url===w)):void O(N(w)),className:F+" "+(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:Z,className:F,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>B(e=>!e),className:F,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:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>A?Q(T.findIndex(e=>e.url===w)):void Y(N(w)),className:F+" "+(A?"text-yellow-500":""),title:A?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(i,{name:"star",className:"h-4 w-4",fill:A?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:M,className:F,title:"Open in new tab",children:/* @__PURE__ */u(i,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>D(e=>!e),className:F,title:"Embedding help",children:/* @__PURE__ */u(i,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==O&&/* @__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:Y,type:"text",value:G,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key?M():"Escape"===e.key&&O(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:J,type:"text",value:O,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key?E():"Escape"===e.key&&Y(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:()=>O(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:M,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===D.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),D.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>J(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"})&&Q(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:()=>Y(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:E,disabled:!O.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===T.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>G(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"})&&Q(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:E,openExternal:Z,showHelp:U,dismissHelp:()=>B(!1)})})]})}function N(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:z,iframeRef:Z,openExternal:M,showHelp:B,dismissHelp:()=>D(!1)})})]})}function N(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:[N(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -1,29 +1,29 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-HOTIZZXC.js";import{useWidgetSettings as n}from"./chunk-EJTAPBGB.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-ZLB5GRL6.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-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.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-LYGIOJ3J.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),[y,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[T,B]=c(()=>t(h)),[P,Z]=c(!1),[E,J]=c(T),W=i(null);n(o(()=>{J({...T}),Z(!0)},[T]));const A=o(t=>{C(""),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)},[]),H=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}},[]),R=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=H(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,H]),U=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=H(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),C(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,H]),V=o(()=>{k(t=>String(parseFloat(t)/100))},[]),D=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"?A(t.key):"."===t.key?A("."):"+"===t.key?R("+"):"-"===t.key?R("-"):"*"===t.key?R("×"):"/"===t.key?(t.preventDefault(),R("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&W.current?.contains(t.target)&&t.preventDefault(),U()):"Escape"===t.key?G():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&V())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[A,R,U,G,V]);const O="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",S=`${O} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,F=`${O} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,M=`${O} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,L=`${O} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-LBXKYVM3.js";import{useWidgetSettings as n}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.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-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.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-LYGIOJ3J.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),[y,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[P,T]=c(()=>t(h)),[B,E]=c(!1),[J,V]=c(P),W=i(null);n(o(()=>{V({...P}),E(!0)},[P]));const Z=o(t=>{C(""),k(e=>g||"0"===e?(N(!1),"."===t?"0.":t):"."===t&&e.includes(".")?e:e+t)},[g]),H=o(()=>{k("0"),d(null),b(null),N(!1)},[]),M=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}},[]),R=o(t=>{const e=parseFloat(m);if(null!==p&&j&&!g){const t=M(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,M]),U=o(()=>{if(null===p||!j)return;const t=parseFloat(m),e=M(p,t,j),n=`${p} ${j} ${t} =`;f(t=>[`${n} ${e}`,...t].slice(0,20)),C(n),k(String(e)),d(null),b(null),N(!0)},[m,p,j,M]),A=o(()=>{k(t=>String(parseFloat(t)/100))},[]),D=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"?Z(t.key):"."===t.key?Z("."):"+"===t.key?R("+"):"-"===t.key?R("-"):"*"===t.key?R("×"):"/"===t.key?(t.preventDefault(),R("÷")):"Enter"===t.key||"="===t.key?("Enter"===t.key&&t.target instanceof Node&&W.current?.contains(t.target)&&t.preventDefault(),U()):"Escape"===t.key?H():"Backspace"===t.key?k(t=>t.length>1?t.slice(0,-1):"0"):"%"===t.key&&A())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[Z,R,U,H,A]);const F="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",G=`${F} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,S=`${F} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,L=`${F} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,O=`${F} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
2
  return l(a,{children:[
3
- /* @__PURE__ */l("div",{ref:W,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
3
+ /* @__PURE__ */l("div",{ref:W,className:"flex flex-col h-full",style:{opacity:P.activeOpacity/100,backdropFilter:P.activeBlur>0?`blur(${P.activeBlur}px)`:void 0},children:[
4
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
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))}),(y||j&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${j} ${g?"":m}`}),
6
6
  /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
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
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
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:M,children:"AC"}),
11
- /* @__PURE__ */u("button",{onClick:D,className:M,children:"+/−"}),
12
- /* @__PURE__ */u("button",{onClick:V,className:M,children:"%"}),
13
- /* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${F} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */u("button",{onClick:()=>A("7"),className:S,children:"7"}),
15
- /* @__PURE__ */u("button",{onClick:()=>A("8"),className:S,children:"8"}),
16
- /* @__PURE__ */u("button",{onClick:()=>A("9"),className:S,children:"9"}),
17
- /* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${F} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */u("button",{onClick:()=>A("4"),className:S,children:"4"}),
19
- /* @__PURE__ */u("button",{onClick:()=>A("5"),className:S,children:"5"}),
20
- /* @__PURE__ */u("button",{onClick:()=>A("6"),className:S,children:"6"}),
21
- /* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${F} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */u("button",{onClick:()=>A("1"),className:S,children:"1"}),
23
- /* @__PURE__ */u("button",{onClick:()=>A("2"),className:S,children:"2"}),
24
- /* @__PURE__ */u("button",{onClick:()=>A("3"),className:S,children:"3"}),
25
- /* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${F} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */u("button",{onClick:()=>A("0"),className:`${S} col-span-2`,children:"0"}),
27
- /* @__PURE__ */u("button",{onClick:()=>A("."),className:S,children:"."}),
28
- /* @__PURE__ */u("button",{onClick:U,className:L,children:"="})]})]}),
29
- /* @__PURE__ */u(e,{open:P,onClose:()=>Z(!1),title:"Calculator Settings",appearance:E,onAppearanceChange:J,onSave:()=>{B(E),localStorage.setItem(h,JSON.stringify(E)),Z(!1)}})]})}export{m as default};
10
+ /* @__PURE__ */u("button",{onClick:H,className:L,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:D,className:L,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:A,className:L,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${S} ${"÷"===j?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>Z("7"),className:G,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>Z("8"),className:G,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>Z("9"),className:G,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${S} ${"×"===j?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>Z("4"),className:G,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>Z("5"),className:G,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>Z("6"),className:G,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${S} ${"-"===j?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>Z("1"),className:G,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>Z("2"),className:G,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>Z("3"),className:G,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${S} ${"+"===j?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>Z("0"),className:`${G} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>Z("."),className:G,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:U,className:O,children:"="})]})]}),
29
+ /* @__PURE__ */u(e,{open:B,onClose:()=>E(!1),title:"Calculator Settings",appearance:J,onAppearanceChange:V,onSave:()=>{T(J),localStorage.setItem(h,JSON.stringify(J)),E(!1)}})]})}export{m as default};
@@ -1,4 +1,4 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-HOTIZZXC.js";import{useWidgetSettings as r}from"./chunk-EJTAPBGB.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-L2WQOJ3T.js";import"./chunk-ZLB5GRL6.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-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.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-LYGIOJ3J.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 g(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,k]=s(g),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,U]=s(!1),[v,B]=s([]),[J,P]=s(f),[R,H]=s("USD"),[A,G]=s("CNY");r(o(()=>{B([...u]),P({...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&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-LBXKYVM3.js";import{useWidgetSettings as r}from"./chunk-MIHPFJCP.js";import"./chunk-VIPNHDD3.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PSVGB7KT.js";import"./chunk-5A7MWTXX.js";import"./chunk-YI4T5I5D.js";import"./chunk-TJ5YMXVB.js";import"./chunk-OLXUMB2V.js";import"./chunk-R7OZ2AQD.js";import"./chunk-ZLB5GRL6.js";import"./chunk-EIFNESXS.js";import"./chunk-PO2KNVCC.js";import"./chunk-CJ4OEY3T.js";import"./chunk-LLXI57MB.js";import"./chunk-NQWORKZD.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-4YH7U7WL.js";import"./chunk-ABIWAS5K.js";import"./chunk-P56YLT73.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-37FQVY2O.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-LYGIOJ3J.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 g(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,k]=s(g),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,U]=s(!1),[v,J]=s([]),[P,B]=s(f),[R,H]=s("USD"),[Y,A]=s("CNY");r(o(()=>{J([...u]),B({...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&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
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:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
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:[
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);k(t),l
9
9
  /* @__PURE__ */m("span",{className:"text-base",children:N[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:()=>U(!1),title:"Currency Settings",appearance:J,onAppearanceChange:P,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);k(t),x(J),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(J)),U(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>U(!1),title:"Currency Settings",appearance:P,onAppearanceChange:B,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);k(t),x(P),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(P)),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
14
  /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
15
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:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
17
- /* @__PURE__ */m("button",{onClick:()=>B(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:[
17
+ /* @__PURE__ */m("button",{onClick:()=>J(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
18
  /* @__PURE__ */m("select",{value:R,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))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:A,onChange:t=>G(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:()=>{R!==A&&v.length<4&&B(t=>[...t,[R,A]])},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:Y,onChange:t=>A(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:()=>{R!==Y&&v.length<4&&J(t=>[...t,[R,Y]])},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};