pixedi 1.2.1 → 1.3.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.
package/dist/lib/index.js CHANGED
@@ -1,21 +1,43 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._button_snd36_1{cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:8px;height:32px;padding:0 8px;font-family:inherit;font-size:14px;font-weight:500;transition:background-color .2s,border-color .2s,opacity .2s;display:inline-flex}._button_snd36_1:disabled{pointer-events:none;opacity:.5}._button_snd36_1 svg{flex-shrink:0;width:16px;height:16px}._default_snd36_32{background-color:var(--primary);color:var(--primary-foreground)}._default_snd36_32:hover{opacity:.9}._outline_snd36_39{border-color:var(--border);background-color:var(--background);color:var(--foreground)}._outline_snd36_39:hover{background-color:var(--secondary)}._ghost_snd36_47{color:var(--foreground);padding:0 8px}._ghost_snd36_47:hover{background-color:var(--secondary)}._rect_snd36_54{width:32px;height:32px}:host{height:100%;display:block}:host *{box-sizing:border-box}._root_kw2xl_8{width:100%;height:100%;font-size:16px;font-family:var(--font-sans);--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Helvetica, Arial, sans-serif;--color-white:#fff;--color-white-fade:color-mix(in srgb, var(--color-white) 30%, transparent);--color-black:#000;--color-transparent:transparent;--color-red:oklch(63.7% .237 25.331);--color-green:oklch(76.8% .188 151.716);--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(75.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--accent-blue:oklch(60.9% .221 251.687);--accent-blue-light:oklch(96% .02 250);--accent-blue-fade:color-mix(in srgb, var(--accent-blue) 60%, transparent);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 50%, transparent);--overlay-bg-white:color-mix(in srgb, var(--color-white) 80%, transparent);position:relative}._root_kw2xl_8[data-theme=dark]{--background:oklch(24.5% 0 0);--foreground:oklch(78.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(24.5% 0 0);--muted-foreground:oklch(50% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--accent-blue-light:oklch(25% .06 250);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 75%, transparent)}._root_kw2xl_8 h1,._root_kw2xl_8 h2,._root_kw2xl_8 h3,._root_kw2xl_8 h4,._root_kw2xl_8 h5,._root_kw2xl_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_kw2xl_73{color:var(--color-red)}._bgRed_kw2xl_76{background-color:var(--color-red)}._bgGreen_kw2xl_79{background-color:var(--color-green)}._textGreen_kw2xl_82{color:var(--color-green)}._mask_kw2xl_85{background-color:var(--overlay-bg)}._semibold_kw2xl_88{letter-spacing:.4px;font-weight:600}._bold_kw2xl_92{letter-spacing:.4px;font-weight:700}._system_kw2xl_96{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_kw2xl_105{width:100%;height:100%;min-height:480px;position:relative}._main_kw2xl_111{background-color:var(--background);grid-template-rows:auto 1fr;display:grid;position:absolute;inset:0;overflow:hidden}._grid_kw2xl_119{grid-template-columns:1fr auto;min-height:0;display:grid;position:relative;overflow:hidden}._button_gf7m5_1{border:1px solid var(--border);background-color:var(--background);color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;border-radius:4px;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:12px;font-family:inherit;font-size:12px;transition:all .2s;display:inline-flex}._button_gf7m5_1:hover:not([aria-pressed=true]){background-color:var(--secondary)}._button_gf7m5_1[aria-pressed=true]{border-color:var(--accent-blue);background-color:var(--accent-blue-light);color:var(--foreground)}._button_gf7m5_1 svg{flex-shrink:0;width:20px;height:20px}._button_gf7m5_1 span{white-space:nowrap}._separator_rqskq_1{background-color:var(--border);box-sizing:border-box;border:none;flex-shrink:0;display:block}._separator_rqskq_1[data-orientation=horizontal]{width:100%;height:1px}._separator_rqskq_1[data-orientation=vertical]{align-self:stretch;width:1px;height:100%;margin:0}._wrapper_12rgt_1{box-sizing:border-box;width:100%;position:relative}._trigger_12rgt_6{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--border);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:4px;outline:none;justify-content:space-between;align-items:center;padding:0 8px 0 10px;font-family:inherit;font-size:14px;transition:border-color .2s;display:flex}._trigger_12rgt_6:hover,._trigger_12rgt_6:focus{border-color:var(--muted-foreground)}._triggerArrow_12rgt_29{width:16px;height:16px;color:var(--muted-foreground);transition:transform .2s}._wrapper_12rgt_1[data-state=open] ._triggerArrow_12rgt_29{transform:rotate(180deg)}._content_12rgt_38{background-color:var(--background);border:1px solid var(--border);z-index:50;box-sizing:border-box;border-radius:4px;width:100%;max-height:282px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}._content_12rgt_38::-webkit-scrollbar{width:4px}._content_12rgt_38::-webkit-scrollbar-track{background:0 0}._content_12rgt_38::-webkit-scrollbar-thumb{background-color:var(--border);border-radius:10px}._wrapper_12rgt_1[data-state=closed] ._content_12rgt_38{display:none}._groupLabel_12rgt_68{color:var(--muted-foreground);-webkit-user-select:none;user-select:none;padding:8px 10px;font-size:12px;font-weight:500}._item_12rgt_75{width:100%;color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background:0 0;border-radius:4px;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}._item_12rgt_75:hover{background-color:var(--secondary)}._itemLeft_12rgt_91{font-size:14px;font-weight:400}._itemAddon_12rgt_95{align-items:center;gap:8px;display:flex}._itemAddon_12rgt_95>span{color:var(--muted-foreground);font-size:12px}._itemAddon_12rgt_95>svg{font-size:14px}._itemAddon_12rgt_95>b{flex-shrink:0;width:16px;height:16px}._itemRightContainer_12rgt_112{align-items:center;gap:8px;display:flex}._itemRight_12rgt_112{color:var(--muted-foreground);font-size:14px}._itemCheck_12rgt_121{width:16px;height:16px;color:var(--foreground);flex-shrink:0}._input_j55nq_1{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--input);box-sizing:border-box;border-radius:4px;outline:none;padding:0 8px;font-family:inherit;font-size:14px;line-height:normal;transition:border-color .2s,box-shadow .2s;display:block}._input_j55nq_1:hover:not(:disabled):not(:focus){border-color:var(--muted-foreground)}._input_j55nq_1:focus{box-shadow:0 0 0 1px var(--ring)}._input_j55nq_1:disabled{cursor:not-allowed;opacity:.5;background-color:var(--secondary)}._input_j55nq_1::placeholder{color:var(--muted-foreground);opacity:1}._numberClean_j55nq_34::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._numberClean_j55nq_34::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._numberClean_j55nq_34[type=number]{-moz-appearance:textfield}._container_14vsv_1{position:relative}._legend_14vsv_4{color:var(--muted-foreground);background:var(--background);margin-left:8px;padding:0 4px;font-size:12px;position:absolute;top:-9px}._suffix_14vsv_13{color:var(--muted-foreground);pointer-events:none;-webkit-user-select:none;user-select:none;font-size:14px;position:absolute;bottom:2px;right:8px}._group_qpue1_1{margin-left:4px;display:flex}._group_qpue1_1 ._save_qpue1_6{width:36px;color:var(--color-green);border-top-right-radius:0;border-bottom-right-radius:0}._group_qpue1_1 ._close_qpue1_13{width:36px;color:var(--color-red);border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}._sliderContainer_1ntcm_1{cursor:pointer;touch-action:none;--slider-progress:0%;align-items:center;width:100%;height:24px;display:flex;position:relative}._sliderContainer_1ntcm_1._disabled_1ntcm_12{pointer-events:none;cursor:not-allowed;opacity:.5}._sliderTrack_1ntcm_18{background-color:color-mix(in oklch, var(--muted-foreground) 65%, transparent);border-radius:2px;width:100%;height:2px;position:relative}._sliderRange_1ntcm_30{background-color:var(--primary);height:100%;width:var(--slider-progress);border-radius:2px;position:absolute}._sliderThumb_1ntcm_38{background-color:var(--background);border:2px solid var(--primary);pointer-events:none;border-radius:50%;width:12px;height:13px;transition:transform .1s,box-shadow .1s;position:absolute;top:50%;transform:translate(-50%,-50%)}._hiddenInput_1ntcm_53{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;margin:0;position:absolute;top:0;left:0}._sliderContainer_1ntcm_1:not(._disabled_1ntcm_12):hover ._sliderThumb_1ntcm_38{transform:translate(-50%,-50%)scale(1.1)}._header_msw8l_1{box-sizing:border-box;background-color:var(--background);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;height:48px;padding:0 8px;display:flex}._tools_msw8l_11{gap:8px;display:flex}._history_msw8l_15{align-items:center;gap:8px;display:flex}._historyText_msw8l_20{color:var(--muted-foreground);font-size:14px}._resize_11cwi_1{background-color:var(--background);border-radius:4px;flex-direction:column;gap:2px;padding:8px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._slider_11cwi_14{width:80%;margin:0 auto -4px}._border_11cwi_18{border-bottom:1px solid var(--border);width:60px;margin:12px auto 4px;display:inline-block}._tools_11cwi_24{align-items:center;gap:6px;margin-top:16px;display:flex}._toolsLock_11cwi_30{width:12px;height:12px;color:var(--muted-foreground)}._preview_dvanl_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._rotate_dvanl_12{box-sizing:border-box;width:100%;height:100%;transition:all .2s linear;position:absolute;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}._flip_dvanl_24{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_dvanl_32{max-width:none;max-height:none;transition:all .2s linear;display:block;position:absolute}._wrapper_13nh3_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_13nh3_9{cursor:move;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;border:1px solid var(--color-white-fade);position:absolute}._tools_13nh3_18{background-color:var(--background);box-sizing:border-box;border:1px solid var(--border);border-radius:4px;align-items:center;padding:4px 4px 4px 8px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._toolsInfo_13nh3_34{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_13nh3_41{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_13nh3_46{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_13nh3_51{pointer-events:none;position:absolute;inset:2px}._line_13nh3_51{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_13nh3_61{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_13nh3_69{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_13nh3_77{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_13nh3_83{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_13nh3_90{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_13nh3_97{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_13nh3_104{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_13nh3_111{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_13nh3_117{background-color:var(--overlay-bg-white);border:3px solid var(--accent-blue);box-sizing:border-box;border-radius:50%;width:32px;height:32px;position:absolute;bottom:-16px;right:-16px}._flip_17ic5_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_17ic5_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_17ic5_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._rotate_gkt07_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_gkt07_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_gkt07_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_xffug_1{box-sizing:border-box;width:100%;height:100%;margin:0 auto;padding:16px;position:relative}._sidebar_8qtha_1{z-index:10;width:0;transition:transform .15s ease-out;position:relative}@media (width>=768px){._sidebar_8qtha_1{width:320px;transition:none}}._settings_8qtha_11{border-radius:50%;width:40px;height:40px;position:absolute;top:8px;right:8px;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a}@media (width>=768px){._settings_8qtha_11{display:none}}._container_8qtha_25{box-sizing:border-box;border-left:1px solid var(--border);position:absolute;inset:0}._content_8qtha_31{background-color:var(--background);box-sizing:border-box;flex-direction:column;width:320px;height:100%;padding:16px;display:flex;position:absolute;top:0;left:0;overflow-y:auto}@media (width<=767px){._content_8qtha_31{padding-top:48px}}._closeBtn_8qtha_47{position:absolute;top:8px;right:8px}._separator_8qtha_52{margin-top:20px;margin-bottom:12px}._resize_8qtha_56{justify-content:space-between;align-items:center;display:flex}._resizeIcon_8qtha_61{align-items:center;gap:8px;display:flex}._resizeSize_8qtha_66{color:var(--muted-foreground);font-size:14px}._crop_8qtha_70{flex-direction:column;gap:8px;display:flex}._ratio_8qtha_75{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}._sidebarPreset_8qtha_80{flex-direction:column;gap:8px;display:flex}._flipRotate_8qtha_85{grid-template-columns:repeat(2,1fr);gap:8px;display:grid}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
- import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._button_1vpzl_1{cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:8px;height:32px;padding:0 8px;font-family:inherit;font-size:14px;font-weight:500;transition:background-color .2s,border-color .2s,opacity .2s;display:inline-flex}._button_1vpzl_1:disabled{pointer-events:none;opacity:.5}._button_1vpzl_1 svg{flex-shrink:0;width:16px;height:16px}._default_1vpzl_35{background-color:var(--primary);color:var(--primary-foreground)}._default_1vpzl_35:hover{opacity:.9}._outline_1vpzl_44{border-color:var(--border);background-color:var(--background);color:var(--foreground)}._outline_1vpzl_44:hover{background-color:var(--secondary)}._ghost_1vpzl_54{color:var(--foreground);padding:0 8px}._ghost_1vpzl_54:hover{background-color:var(--secondary)}._rect_1vpzl_63{width:32px;height:32px}._separator_gp8ff_1{background-color:var(--border);box-sizing:border-box;border:none;flex-shrink:0;display:block}._separator_gp8ff_1[data-orientation=horizontal]{width:100%;height:1px}._separator_gp8ff_1[data-orientation=vertical]{align-self:stretch;width:1px;height:100%;margin:0}._wrapper_1aw0m_1{box-sizing:border-box;width:100%;position:relative}._trigger_1aw0m_6{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--border);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:4px;outline:none;justify-content:space-between;align-items:center;padding:0 8px 0 10px;font-family:inherit;font-size:14px;transition:border-color .2s;display:flex}._trigger_1aw0m_6:hover,._trigger_1aw0m_6:focus{border-color:var(--muted-foreground)}._triggerArrow_1aw0m_31{width:16px;height:16px;color:var(--muted-foreground);transition:transform .2s}._wrapper_1aw0m_1[data-state=open] ._triggerArrow_1aw0m_31{transform:rotate(180deg)}._content_1aw0m_40{background-color:var(--background);border:1px solid var(--border);z-index:50;box-sizing:border-box;border-radius:4px;width:100%;max-height:282px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}._content_1aw0m_40::-webkit-scrollbar{width:4px}._content_1aw0m_40::-webkit-scrollbar-track{background:0 0}._content_1aw0m_40::-webkit-scrollbar-thumb{background-color:var(--border);border-radius:10px}._wrapper_1aw0m_1[data-state=closed] ._content_1aw0m_40{display:none}._groupLabel_1aw0m_74{color:var(--muted-foreground);-webkit-user-select:none;user-select:none;padding:8px 10px;font-size:12px;font-weight:500}._item_1aw0m_81{width:100%;color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background:0 0;border-radius:4px;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}._item_1aw0m_81:hover{background-color:var(--secondary)}._itemLeft_1aw0m_98{font-size:14px;font-weight:400}._itemAddon_1aw0m_102{align-items:center;gap:8px;display:flex}._itemAddon_1aw0m_102 span{color:var(--muted-foreground);font-size:12px}._itemAddon_1aw0m_102 svg{font-size:14px}._itemAddon_1aw0m_102 b{flex-shrink:0;width:16px;height:16px}._itemRightContainer_1aw0m_122{align-items:center;gap:8px;display:flex}._itemRight_1aw0m_122{color:var(--muted-foreground);font-size:14px}._itemCheck_1aw0m_131{width:16px;height:16px;color:var(--foreground);flex-shrink:0}:host{height:100%;display:block}:host *{box-sizing:border-box}._root_c6gk7_8{width:100%;height:100%;font-size:16px;font-family:var(--font-sans);--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Helvetica, Arial, sans-serif;--font-mono:"Courier New", Courier, monospace;--color-white:#fff;--color-white-fade:color-mix(in srgb, var(--color-white) 40%, transparent);--color-black:#000;--color-red:oklch(63.7% .237 25.331);--color-green:oklch(76.8% .188 151.716);--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(75.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--accent-blue:oklch(60.9% .221 251.687);--accent-blue-light:oklch(96% .02 250);--accent-blue-fade:color-mix(in srgb, var(--accent-blue) 60%, transparent);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 50%, transparent);--overlay-bg-white:color-mix(in srgb, var(--color-white) 80%, transparent);position:relative}._root_c6gk7_8[data-theme=dark]{--background:oklch(24.5% 0 0);--foreground:oklch(78.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(24.5% 0 0);--muted-foreground:oklch(50% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--accent-blue-light:oklch(25% .06 250);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 75%, transparent)}._root_c6gk7_8 h1,._root_c6gk7_8 h2,._root_c6gk7_8 h3,._root_c6gk7_8 h4,._root_c6gk7_8 h5,._root_c6gk7_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_c6gk7_73{color:var(--color-red)}._bgRed_c6gk7_76{background-color:var(--color-red)}._bgGreen_c6gk7_79{background-color:var(--color-green)}._textGreen_c6gk7_82{color:var(--color-green)}._mask_c6gk7_85{background-color:var(--overlay-bg)}._semibold_c6gk7_88{letter-spacing:.4px;font-weight:600}._bold_c6gk7_92{letter-spacing:.4px;font-weight:700}._system_c6gk7_96{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_c6gk7_106{width:100%;height:100%;min-height:480px;position:relative;overflow:hidden}._grid_c6gk7_113{grid-template:"header header"48px"sidebar frame"minmax(0,1fr)"sidebar infobar"32px/48px 1fr;height:100%;display:grid;position:relative}._grid_c6gk7_113._mobile_c6gk7_124{grid-template-columns:0 1fr}._gridNoInfobar_c6gk7_128{grid-template:"header header"48px"sidebar frame"1fr/48px 1fr;height:100%;display:grid;position:relative}._gridNoInfobar_c6gk7_128._mobile_c6gk7_124{grid-template-columns:0 1fr}._input_kyavx_1{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--input);box-sizing:border-box;border-radius:4px;outline:none;padding:0 8px;font-family:inherit;font-size:14px;line-height:normal;transition:border-color .2s,box-shadow .2s;display:block}._input_kyavx_1:hover:not(:disabled):not(:focus){border-color:var(--muted-foreground)}._input_kyavx_1:focus{box-shadow:0 0 0 1px var(--ring)}._input_kyavx_1:disabled{cursor:not-allowed;opacity:.5;background-color:var(--secondary)}._input_kyavx_1::placeholder{color:var(--muted-foreground);opacity:1}._numberClean_kyavx_39::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._numberClean_kyavx_39::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._numberClean_kyavx_39[type=number]{-moz-appearance:textfield}._container_14vsv_1{position:relative}._legend_14vsv_4{color:var(--muted-foreground);background:var(--background);margin-left:8px;padding:0 4px;font-size:12px;position:absolute;top:-9px}._suffix_14vsv_13{color:var(--muted-foreground);pointer-events:none;-webkit-user-select:none;user-select:none;font-size:14px;position:absolute;bottom:2px;right:8px}._group_1e7jm_1{margin-left:4px;display:flex}._save_1e7jm_6{width:36px;color:var(--color-green);border-top-right-radius:0;border-bottom-right-radius:0}._close_1e7jm_13{width:36px;color:var(--color-red);border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}._header_25ynx_1{box-sizing:border-box;background-color:var(--background);border-bottom:1px solid var(--border);grid-area:header;justify-content:space-between;align-items:center;height:48px;padding:0 8px;display:flex}._left_25ynx_12{align-items:center;gap:0;display:flex}._sidebarToggle_25ynx_17{border-right:solid 1px var(--border);cursor:pointer;justify-content:center;align-items:center;width:48px;height:48px;transition:all .2s;display:none;position:relative;left:-8px}._sidebarToggle_25ynx_17._mobile_25ynx_29{display:flex}._sidebarIcon_25ynx_33{stroke-width:1.6px;width:18px;height:18px}._tools_25ynx_38{gap:8px;display:flex}._history_25ynx_42{align-items:center;gap:4px;display:flex}._historyText_25ynx_47{color:var(--muted-foreground);font-size:14px;font-family:var(--font-mono)}._sidebar_16gr5_1{background:var(--background);border-right:1px solid var(--border);z-index:10;grid-area:sidebar;width:48px;position:relative;overflow:hidden}._sidebar_16gr5_1._mobile_16gr5_10{transition:transform .2s ease-out;transform:translate(-110%);box-shadow:0 4px 6px #0000001a}._sidebar_16gr5_1._mobile_16gr5_10._open_16gr5_15{transform:translate(0%)}._item_16gr5_20{cursor:pointer;justify-content:center;align-items:center;height:48px;transition:all .2s;display:flex;position:relative}._item_16gr5_20 svg{width:16px;height:16px}._item_16gr5_20:hover{background-color:var(--accent)}._item_16gr5_20._selected_16gr5_38{color:var(--accent-blue);background-color:var(--accent)}._item_16gr5_20._selected_16gr5_38:before{content:"";background-color:var(--accent-blue);width:2px;position:absolute;top:0;bottom:0;left:0}._infobar_ofe91_1{background:var(--muted);font-family:var(--font-mono);grid-area:infobar;justify-content:space-between;align-items:center;padding:0 16px;font-size:14px;display:flex}._resize_s127g_1{background-color:var(--background);border-radius:4px;align-items:center;gap:6px;padding:15px 8px 8px;display:flex;position:absolute;bottom:24px;left:50%;overflow:hidden;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._toolsLock_s127g_15{width:12px;height:12px;color:var(--muted-foreground)}._indicatorWrapper_s127g_20{justify-content:center;width:100%;height:1px;display:flex;position:absolute;top:0;left:0}._indicator_s127g_20{background:var(--accent-blue);opacity:.6;border-radius:2px;width:30%;height:100%;transition:width .2s}._preview_dvanl_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._rotate_dvanl_12{box-sizing:border-box;width:100%;height:100%;transition:all .2s linear;position:absolute;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}._flip_dvanl_24{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_dvanl_32{max-width:none;max-height:none;transition:all .2s linear;display:block;position:absolute}._wrapper_1yhyo_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_1yhyo_9{cursor:move;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;border:1px solid var(--color-white-fade);position:absolute}._tools_1yhyo_18{background-color:var(--background);box-sizing:border-box;border:1px solid var(--border);border-radius:4px;align-items:center;gap:6px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._toolsInfo_1yhyo_35{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_1yhyo_42{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_1yhyo_47{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_1yhyo_52{pointer-events:none;position:absolute;inset:1px}._line_1yhyo_52{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_1yhyo_62{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_1yhyo_70{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_1yhyo_78{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_1yhyo_84{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_1yhyo_91{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_1yhyo_98{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_1yhyo_105{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_1yhyo_112{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_1yhyo_118{background-color:var(--overlay-bg-white);border:3px solid var(--accent-blue);box-sizing:border-box;border-radius:50%;width:32px;height:32px;position:absolute;bottom:-16px;right:-16px}._info_1yhyo_129{height:16px;font-family:var(--font-mono);color:#000;background-color:var(--color-white-fade);box-sizing:border-box;align-items:center;padding:0 6px;font-size:12px;display:flex;position:absolute}._info_1yhyo_129 b{font-weight:600;transform:translateY(1px)}._infoX_1yhyo_146{border-left:solid 2px var(--accent-blue);top:-12px;left:16px}._infoY_1yhyo_151{transform-origin:100%;border-right:solid 2px var(--accent-blue);top:8px;right:calc(100% + 4px);transform:rotate(-90deg)}._infoW_1yhyo_158{border-right:solid 2px var(--accent-blue);bottom:-12px;right:16px}._infoH_1yhyo_163{transform-origin:0%;border-left:solid 2px var(--accent-blue);bottom:8px;left:calc(100% + 4px);transform:rotate(-90deg)}._group_1yhyo_170{flex-shrink:0;width:max-content;display:flex}._group_1yhyo_170 button{color:var(--foreground);border-radius:0}._group_1yhyo_170 button._active_1yhyo_179{color:var(--accent-blue);background:var(--muted)}._group_1yhyo_170 button:not(:first-child){margin-left:-1px}._group_1yhyo_170 button:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._group_1yhyo_170 button:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}._preset_1rbuc_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._select_1rbuc_14{width:210px}._flip_17ic5_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_17ic5_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_17ic5_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._rotate_gkt07_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_gkt07_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_gkt07_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_15mog_1{box-sizing:border-box;grid-area:frame;width:100%;height:100%;margin:0 auto;position:relative;overflow:hidden}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
+ import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
3
3
  //#region \0rolldown/runtime.js
4
- var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), l = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
4
+ var l = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
5
5
  if (typeof require < "u") return require.apply(this, arguments);
6
6
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
7
- }), u = {
7
+ }), d = {
8
+ sm: 480,
9
+ md: 768,
10
+ lg: 1024,
11
+ xl: 1280
12
+ }, f = {
13
+ INITIAL: "initial",
14
+ RESIZE: "resize",
15
+ CROP: "crop",
16
+ PRESET_CROP: "presetCrop",
17
+ FLIP: "flip",
18
+ ROTATE: "rotate",
19
+ FILTERS: "filters"
20
+ }, p = {
21
+ tools: [
22
+ "resize",
23
+ "crop",
24
+ "presetCrop",
25
+ "flip",
26
+ "rotate",
27
+ "filters"
28
+ ],
29
+ infobar: !0,
8
30
  quality: .85,
9
31
  saveAsWEBP: !1,
10
32
  exportAs: "blob"
11
- }, d = (e, t, n, r, i, a, o) => ({
33
+ }, m = (e, t, n, r, i, a, o) => ({
12
34
  history: {
13
35
  pointer: 0,
14
36
  items: [{
15
37
  width: t,
16
38
  height: n,
17
39
  action: {
18
- name: "initial",
40
+ name: f.INITIAL,
19
41
  args: null
20
42
  }
21
43
  }]
@@ -27,7 +49,7 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
27
49
  sidebar: !1,
28
50
  settings: o,
29
51
  isAlpha: a
30
- }), f = e(void 0), p = /* @__PURE__ */ c(((e) => {
52
+ }), h = e(void 0), g = /* @__PURE__ */ l(((e) => {
31
53
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
32
54
  function r(e, n, r) {
33
55
  var i = null;
@@ -42,19 +64,19 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
42
64
  };
43
65
  }
44
66
  e.Fragment = n, e.jsx = r, e.jsxs = r;
45
- })), m = /* @__PURE__ */ c(((e) => {
67
+ })), _ = /* @__PURE__ */ l(((e) => {
46
68
  process.env.NODE_ENV !== "production" && (function() {
47
69
  function t(e) {
48
70
  if (e == null) return null;
49
- if (typeof e == "function") return e.$$typeof === ne ? null : e.displayName || e.name || null;
71
+ if (typeof e == "function") return e.$$typeof === te ? null : e.displayName || e.name || null;
50
72
  if (typeof e == "string") return e;
51
73
  switch (e) {
52
74
  case v: return "Fragment";
53
75
  case b: return "Profiler";
54
76
  case y: return "StrictMode";
55
- case w: return "Suspense";
56
- case ee: return "SuspenseList";
57
- case te: return "Activity";
77
+ case ee: return "Suspense";
78
+ case w: return "SuspenseList";
79
+ case D: return "Activity";
58
80
  }
59
81
  if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
60
82
  case _: return "Portal";
@@ -99,14 +121,14 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
99
121
  }
100
122
  }
101
123
  function a() {
102
- var e = D.A;
124
+ var e = O.A;
103
125
  return e === null ? null : e.getOwner();
104
126
  }
105
127
  function o() {
106
128
  return Error("react-stack-top-frame");
107
129
  }
108
130
  function s(e) {
109
- if (O.call(e, "key")) {
131
+ if (k.call(e, "key")) {
110
132
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
111
133
  if (t && t.isReactWarning) return !1;
112
134
  }
@@ -114,16 +136,16 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
114
136
  }
115
137
  function c(e, t) {
116
138
  function n() {
117
- ie || (ie = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
139
+ re || (re = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
118
140
  }
119
141
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
120
142
  get: n,
121
143
  configurable: !0
122
144
  });
123
145
  }
124
- function u() {
146
+ function l() {
125
147
  var e = t(this.type);
126
- return ae[e] || (ae[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
148
+ return j[e] || (j[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
127
149
  }
128
150
  function d(e, t, n, r, i, a) {
129
151
  var o = n.ref;
@@ -138,7 +160,7 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
138
160
  value: null
139
161
  }) : Object.defineProperty(e, "ref", {
140
162
  enumerable: !1,
141
- get: u
163
+ get: l
142
164
  }), e._store = {}, Object.defineProperty(e._store, "validated", {
143
165
  configurable: !1,
144
166
  enumerable: !1,
@@ -163,17 +185,17 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
163
185
  }
164
186
  function f(e, n, i, o, l, u) {
165
187
  var f = n.children;
166
- if (f !== void 0) if (o) if (re(f)) {
188
+ if (f !== void 0) if (o) if (ne(f)) {
167
189
  for (o = 0; o < f.length; o++) p(f[o]);
168
190
  Object.freeze && Object.freeze(f);
169
191
  } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
170
192
  else p(f);
171
- if (O.call(n, "key")) {
193
+ if (k.call(n, "key")) {
172
194
  f = t(e);
173
195
  var m = Object.keys(n).filter(function(e) {
174
196
  return e !== "key";
175
197
  });
176
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ce[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), ce[f + o] = !0);
198
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", N[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), N[f + o] = !0);
177
199
  }
178
200
  if (f = null, i !== void 0 && (r(i), f = "" + i), s(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
179
201
  else i = n;
@@ -185,32 +207,32 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
185
207
  function m(e) {
186
208
  return typeof e == "object" && !!e && e.$$typeof === g;
187
209
  }
188
- var h = l("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), te = Symbol.for("react.activity"), ne = Symbol.for("react.client.reference"), D = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, re = Array.isArray, k = console.createTask ? console.createTask : function() {
210
+ var h = u("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), ee = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), te = Symbol.for("react.client.reference"), O = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, ne = Array.isArray, A = console.createTask ? console.createTask : function() {
189
211
  return null;
190
212
  };
191
213
  h = { react_stack_bottom_frame: function(e) {
192
214
  return e();
193
215
  } };
194
- var ie, ae = {}, oe = h.react_stack_bottom_frame.bind(h, o)(), se = k(i(o)), ce = {};
216
+ var re, j = {}, ie = h.react_stack_bottom_frame.bind(h, o)(), M = A(i(o)), N = {};
195
217
  e.Fragment = v, e.jsx = function(e, t, n) {
196
- var r = 1e4 > D.recentlyCreatedOwnerStacks++;
197
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : oe, r ? k(i(e)) : se);
218
+ var r = 1e4 > O.recentlyCreatedOwnerStacks++;
219
+ return f(e, t, n, !1, r ? Error("react-stack-top-frame") : ie, r ? A(i(e)) : M);
198
220
  }, e.jsxs = function(e, t, n) {
199
- var r = 1e4 > D.recentlyCreatedOwnerStacks++;
200
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : oe, r ? k(i(e)) : se);
221
+ var r = 1e4 > O.recentlyCreatedOwnerStacks++;
222
+ return f(e, t, n, !0, r ? Error("react-stack-top-frame") : ie, r ? A(i(e)) : M);
201
223
  };
202
224
  })();
203
- })), h = (/* @__PURE__ */ c(((e, t) => {
204
- process.env.NODE_ENV === "production" ? t.exports = p() : t.exports = m();
205
- })))(), g = ({ children: e, mimeType: t, width: n, height: i, originalBlob: c, previewUrl: l, isAlpha: u, settings: p }) => {
206
- let [m, g] = s(d(t, n, i, c, l, u, p)), _ = o(null);
207
- r(() => () => {
225
+ })), v = (/* @__PURE__ */ l(((e, t) => {
226
+ process.env.NODE_ENV === "production" ? t.exports = g() : t.exports = _();
227
+ })))(), y = ({ children: e, mimeType: t, width: n, height: r, originalBlob: a, previewUrl: l, isAlpha: u, settings: d }) => {
228
+ let [p, g] = c(m(t, n, r, a, l, u, d)), _ = s(null);
229
+ i(() => () => {
208
230
  _.current &&= (URL.revokeObjectURL(_.current), null);
209
231
  }, []);
210
- let v = (e) => g((t) => ({
232
+ let y = (e) => g((t) => ({
211
233
  ...t,
212
234
  currentAction: e
213
- })), y = (e) => g((t) => {
235
+ })), b = (e) => g((t) => {
214
236
  let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
215
237
  return {
216
238
  ...t,
@@ -220,28 +242,28 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
220
242
  pointer: n
221
243
  }
222
244
  };
223
- }), b = () => {
224
- let { items: e, pointer: t } = m.history;
245
+ }), x = () => {
246
+ let { items: e, pointer: t } = p.history;
225
247
  return e.at(t) ?? e.at(0) ?? {
226
248
  width: 0,
227
249
  height: 0,
228
250
  action: {
229
- name: "initial",
251
+ name: f.INITIAL,
230
252
  args: null
231
253
  }
232
254
  };
233
- }, x = () => {
234
- let { items: e, pointer: t } = m.history;
255
+ }, S = () => {
256
+ let { items: e, pointer: t } = p.history;
235
257
  if (e.length === 0 || t < 0) return 0;
236
- let n = e.slice(0, t + 1).findLast((e) => e.action.name === "rotate");
237
- return n?.action.name === "rotate" ? n.action.args.degrees : 0;
238
- }, S = () => g((e) => ({
258
+ let n = e.slice(0, t + 1).findLast((e) => e.action.name === f.ROTATE);
259
+ return n?.action.name === f.ROTATE ? n.action.args.degrees : 0;
260
+ }, C = () => g((e) => ({
239
261
  ...e,
240
262
  history: {
241
263
  items: [e.history.items[0]],
242
264
  pointer: 0
243
265
  }
244
- })), C = () => g((e) => e.history.pointer <= 0 ? e : {
266
+ })), ee = () => g((e) => e.history.pointer <= 0 ? e : {
245
267
  ...e,
246
268
  history: {
247
269
  ...e.history,
@@ -253,46 +275,46 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
253
275
  ...e.history,
254
276
  pointer: e.history.pointer + 1
255
277
  }
256
- }), ee = (e) => g((t) => ({
278
+ }), T = (e) => g((t) => ({
257
279
  ...t,
258
280
  sidebar: e
259
- })), T = a(() => new EventTarget(), []), E = (e) => {
260
- _.current && URL.revokeObjectURL(_.current), _.current = URL.createObjectURL(e.previewBlob), g(d(e.mimeType, e.width, e.height, e.newBlob, _.current, e.isAlpha, p));
281
+ })), E = o(() => new EventTarget(), []), D = (e) => {
282
+ _.current && URL.revokeObjectURL(_.current), _.current = URL.createObjectURL(e.previewBlob), g(m(e.mimeType, e.width, e.height, e.newBlob, _.current, e.isAlpha, d));
261
283
  };
262
- return /* @__PURE__ */ (0, h.jsx)(f, {
284
+ return /* @__PURE__ */ (0, v.jsx)(h, {
263
285
  value: {
264
- ...m,
265
- setImage: E,
266
- setCurrentAction: v,
267
- getLastHistoryItem: b,
268
- getLastRotation: x,
269
- addToHistory: y,
270
- resetHistory: S,
271
- undo: C,
286
+ ...p,
287
+ setImage: D,
288
+ setCurrentAction: y,
289
+ getLastHistoryItem: x,
290
+ getLastRotation: S,
291
+ addToHistory: b,
292
+ resetHistory: C,
293
+ undo: ee,
272
294
  redo: w,
273
- setSidebar: ee,
274
- eventBus: T
295
+ setSidebar: T,
296
+ eventBus: E
275
297
  },
276
298
  children: e
277
299
  });
278
- }, _ = "(function(){let e=async e=>{let{width:t,height:n}=e,r=Math.min(1,1920/Math.max(t,n)),i=Math.round(t*r),a=Math.round(n*r),o=new OffscreenCanvas(i,a),s=o.getContext(`2d`);if(!s)throw Error(`Failed to get 2D context for preview canvas`);return s.drawImage(e,0,0,i,a),o.convertToBlob({type:`image/webp`,quality:.85})};function t(e){let t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`Failed to create 2D context for canvas.`);n.drawImage(e,0,0);try{let e=n.getImageData(0,0,t.width,t.height).data;for(let t=3;t<e.length;t+=4)if(e[t]<255)return!0;return!1}catch(e){throw Error(`Error reading pixels: ${e}`,{cause:e})}}self.onmessage=async n=>{let r=``;try{let i;if(n.data instanceof Blob)i=n.data;else{let e=n.data.trim();!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`blob:`)&&!e.startsWith(`data:`)&&(r=`image/png`,e=`data:${r};base64,${e}`);let t=await fetch(e);if(!t.ok)throw Error(`HTTP error! Status: ${t.status}`);i=await t.blob()}let a=i.type||r||`image/unknown`,o=await createImageBitmap(i),{width:s,height:c}=o,l=await e(o),u=t(o);o.close(),self.postMessage({success:!0,originalBlob:i,previewBlob:l,mimeType:a,width:s,height:c,isAlpha:u})}catch(e){self.postMessage({success:!1,error:e instanceof Error?e.message:`An error occurred during image loader worker execution.`})}}})();", v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", _], { type: "text/javascript;charset=utf-8" });
279
- function y(e) {
300
+ }, b = "(function(){let e=async e=>{let{width:t,height:n}=e,r=Math.min(1,1920/Math.max(t,n)),i=Math.round(t*r),a=Math.round(n*r),o=new OffscreenCanvas(i,a),s=o.getContext(`2d`);if(!s)throw Error(`Failed to get 2D context for preview canvas`);return s.drawImage(e,0,0,i,a),o.convertToBlob({type:`image/webp`,quality:.85})};function t(e){let t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`Failed to create 2D context for canvas.`);n.drawImage(e,0,0);try{let e=n.getImageData(0,0,t.width,t.height).data;for(let t=3;t<e.length;t+=4)if(e[t]<255)return!0;return!1}catch(e){throw Error(`Error reading pixels: ${e}`,{cause:e})}}self.onmessage=async n=>{let r=``;try{let i;if(n.data instanceof Blob)i=n.data;else{let e=n.data.trim();!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`blob:`)&&!e.startsWith(`data:`)&&(r=`image/png`,e=`data:${r};base64,${e}`);let t=await fetch(e);if(!t.ok)throw Error(`HTTP error! Status: ${t.status}`);i=await t.blob()}let a=i.type||r||`image/unknown`,o=await createImageBitmap(i),{width:s,height:c}=o,l=await e(o),u=t(o);o.close(),self.postMessage({success:!0,originalBlob:i,previewBlob:l,mimeType:a,width:s,height:c,isAlpha:u})}catch(e){self.postMessage({success:!1,error:e instanceof Error?e.message:`An error occurred during image loader worker execution.`})}}})();", x = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", b], { type: "text/javascript;charset=utf-8" });
301
+ function S(e) {
280
302
  let t;
281
303
  try {
282
- if (t = v && (self.URL || self.webkitURL).createObjectURL(v), !t) throw "";
304
+ if (t = x && (self.URL || self.webkitURL).createObjectURL(x), !t) throw "";
283
305
  let n = new Worker(t, { name: e?.name });
284
306
  return n.addEventListener("error", () => {
285
307
  (self.URL || self.webkitURL).revokeObjectURL(t);
286
308
  }), n;
287
309
  } catch {
288
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(_), { name: e?.name });
310
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(b), { name: e?.name });
289
311
  }
290
312
  }
291
313
  //#endregion
292
314
  //#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
293
- var b = (e) => {
294
- let [t, n] = s({
295
- loading: !0,
315
+ var C = ({ src: e, skip: t = !1 }) => {
316
+ let [n, r] = c({
317
+ loading: !t,
296
318
  error: "",
297
319
  width: 0,
298
320
  height: 0,
@@ -300,65 +322,53 @@ var b = (e) => {
300
322
  originalBlob: null,
301
323
  previewUrl: "",
302
324
  isAlpha: !1
303
- }), i = o(null);
304
- return r(() => {
305
- if (!e) return;
306
- let t = new y();
307
- return t.postMessage(e), t.onmessage = (e) => {
325
+ }), a = s(null);
326
+ return i(() => {
327
+ if (!e || t) return;
328
+ let n = new S();
329
+ return n.postMessage(e), n.onmessage = (e) => {
308
330
  let t = e.data;
309
- t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), n({
331
+ t.success ? (a.current && URL.revokeObjectURL(a.current), a.current = URL.createObjectURL(t.previewBlob), r({
310
332
  loading: !1,
311
333
  error: "",
312
334
  mimeType: t.mimeType,
313
335
  width: t.width,
314
336
  height: t.height,
315
337
  originalBlob: t.originalBlob,
316
- previewUrl: i.current,
338
+ previewUrl: a.current,
317
339
  isAlpha: t.isAlpha
318
- })) : n((e) => ({
340
+ })) : r((e) => ({
319
341
  ...e,
320
342
  loading: !1,
321
343
  error: t.error || "Error processing image."
322
344
  }));
323
345
  }, () => {
324
- t.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
346
+ n.terminate(), a.current &&= (URL.revokeObjectURL(a.current), null);
325
347
  };
326
- }, [e]), t;
327
- }, x = () => {
348
+ }, [t, e]), n;
349
+ }, ee = () => {
328
350
  if (typeof window > "u" || !window.navigator) return null;
329
351
  let e = window.navigator.userAgent.toLowerCase();
330
352
  return /android/.test(e) ? "android" : /iphone|ipad|ipod/.test(e) ? "ios" : /windows phone/.test(e) ? "windows-phone" : /blackberry|bb10/.test(e) ? "blackberry" : /opera mini/.test(e) ? "opera-mini" : /mobile/.test(e) ? "mobile" : null;
331
- }, S = () => {
332
- let [e] = s(() => x());
353
+ }, w = () => {
354
+ let [e] = c(() => ee());
333
355
  return e;
334
- }, C = {
335
- sm: 640,
336
- md: 768,
337
- lg: 1024,
338
- xl: 1280
339
- }, w = {
340
- INITIAL: "initial",
341
- RESIZE: "resize",
342
- CROP: "crop",
343
- PRESET_CROP: "presetCrop",
344
- FLIP: "flip",
345
- ROTATE: "rotate",
346
- FILTERS: "filters"
347
356
  };
348
357
  //#endregion
349
358
  //#region src/shared/components/Pixedi/hooks/useBellow.tsx
350
- function ee(e) {
351
- let [t, n] = s(() => window.innerWidth < C[e]);
352
- return r(() => {
353
- function t() {
354
- n(window.innerWidth < C[e]);
355
- }
356
- return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
357
- }, [e]), t;
359
+ function T(e, t) {
360
+ let [n, r] = c(!0);
361
+ return i(() => {
362
+ if (!t) return;
363
+ let n = new ResizeObserver(([t]) => {
364
+ t && r(t.contentRect.width < d[e]);
365
+ });
366
+ return n.observe(t), () => n.disconnect();
367
+ }, [e, t]), n;
358
368
  }
359
369
  //#endregion
360
370
  //#region src/shared/components/Pixedi/assets/icons.tsx
361
- var T = {
371
+ var E = {
362
372
  xmlns: "http://w3.org",
363
373
  width: "24",
364
374
  height: "24",
@@ -368,58 +378,50 @@ var T = {
368
378
  strokeWidth: "2",
369
379
  strokeLinecap: "round",
370
380
  strokeLinejoin: "round"
371
- }, E = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
372
- ...T,
381
+ }, D = (e) => /* @__PURE__ */ (0, v.jsx)("svg", {
382
+ ...E,
373
383
  ...e,
374
- children: /* @__PURE__ */ (0, h.jsx)("path", { d: "M20 6 9 17l-5-5" })
375
- }), te = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
376
- ...T,
384
+ children: /* @__PURE__ */ (0, v.jsx)("path", { d: "M20 6 9 17l-5-5" })
385
+ }), te = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
386
+ ...E,
377
387
  ...e,
378
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "m6 6 12 12" })]
379
- }), ne = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
380
- ...T,
388
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "m6 6 12 12" })]
389
+ }), O = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
390
+ ...E,
381
391
  ...e,
382
- children: [/* @__PURE__ */ (0, h.jsx)("rect", {
392
+ children: [/* @__PURE__ */ (0, v.jsx)("rect", {
383
393
  width: "18",
384
394
  height: "11",
385
395
  x: "3",
386
396
  y: "11",
387
397
  rx: "2",
388
398
  ry: "2"
389
- }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
390
- }), D = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
391
- ...T,
399
+ }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
400
+ }), k = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
401
+ ...E,
392
402
  ...e,
393
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M19 12H5" })]
394
- }), O = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
395
- ...T,
403
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M19 12H5" })]
404
+ }), ne = (e) => /* @__PURE__ */ (0, v.jsx)("svg", {
405
+ ...E,
396
406
  ...e,
397
- children: /* @__PURE__ */ (0, h.jsx)("path", { d: "m6 9 6 6 6-6" })
398
- }), re = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
399
- ...T,
407
+ children: /* @__PURE__ */ (0, v.jsx)("path", { d: "m6 9 6 6 6-6" })
408
+ }), A = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
409
+ ...E,
400
410
  ...e,
401
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
402
- }), k = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
403
- ...T,
411
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
412
+ }), re = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
413
+ ...E,
404
414
  ...e,
405
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
406
- }), ie = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
407
- ...T,
415
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
416
+ }), j = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
417
+ ...E,
408
418
  ...e,
409
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }), /* @__PURE__ */ (0, h.jsx)("circle", {
410
- cx: "12",
411
- cy: "12",
412
- r: "3"
413
- })]
414
- }), ae = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
415
- ...T,
416
- ...e,
417
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
418
- }), oe = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
419
- ...T,
419
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
420
+ }), ie = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
421
+ ...E,
420
422
  ...e,
421
423
  children: [
422
- /* @__PURE__ */ (0, h.jsx)("rect", {
424
+ /* @__PURE__ */ (0, v.jsx)("rect", {
423
425
  width: "18",
424
426
  height: "18",
425
427
  x: "3",
@@ -427,32 +429,52 @@ var T = {
427
429
  rx: "2",
428
430
  ry: "2"
429
431
  }),
430
- /* @__PURE__ */ (0, h.jsx)("circle", {
432
+ /* @__PURE__ */ (0, v.jsx)("circle", {
431
433
  cx: "9",
432
434
  cy: "9",
433
435
  r: "2"
434
436
  }),
435
- /* @__PURE__ */ (0, h.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
437
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
436
438
  ]
437
- }), se = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
438
- ...T,
439
+ }), M = (e) => /* @__PURE__ */ (0, v.jsx)("svg", {
440
+ ...E,
439
441
  ...e,
440
- children: /* @__PURE__ */ (0, h.jsx)("rect", {
442
+ children: /* @__PURE__ */ (0, v.jsx)("rect", {
441
443
  width: "18",
442
444
  height: "18",
443
445
  x: "3",
444
446
  y: "3",
445
447
  rx: "2"
446
448
  })
447
- }), ce = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
448
- ...T,
449
+ }), N = (e) => /* @__PURE__ */ (0, v.jsx)("svg", {
450
+ ...E,
451
+ ...e,
452
+ children: /* @__PURE__ */ (0, v.jsx)("rect", {
453
+ width: "20",
454
+ height: "12",
455
+ x: "2",
456
+ y: "6",
457
+ rx: "2"
458
+ })
459
+ }), ae = (e) => /* @__PURE__ */ (0, v.jsx)("svg", {
460
+ ...E,
461
+ ...e,
462
+ children: /* @__PURE__ */ (0, v.jsx)("rect", {
463
+ width: "20",
464
+ height: "15",
465
+ x: "2",
466
+ y: "4.5",
467
+ rx: "2"
468
+ })
469
+ }), oe = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
470
+ ...E,
449
471
  ...e,
450
472
  children: [
451
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
452
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
453
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
454
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
455
- /* @__PURE__ */ (0, h.jsx)("rect", {
473
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
474
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
475
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
476
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
477
+ /* @__PURE__ */ (0, v.jsx)("rect", {
456
478
  width: "10",
457
479
  height: "8",
458
480
  x: "7",
@@ -460,42 +482,93 @@ var T = {
460
482
  rx: "1"
461
483
  })
462
484
  ]
463
- }), le = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
464
- ...T,
485
+ }), se = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
486
+ ...E,
465
487
  ...e,
466
488
  children: [
467
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
468
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
469
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 20v2" }),
470
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 14v2" }),
471
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 8v2" }),
472
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 2v2" })
489
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
490
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
491
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M12 20v2" }),
492
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M12 14v2" }),
493
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M12 8v2" }),
494
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M12 2v2" })
473
495
  ]
474
- }), ue = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
475
- ...T,
496
+ }), ce = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
497
+ ...E,
476
498
  ...e,
477
499
  children: [
478
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
479
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
480
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M4 12H2" }),
481
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M10 12H8" }),
482
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M16 12h-2" }),
483
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M22 12h-2" })
500
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
501
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
502
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M4 12H2" }),
503
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M10 12H8" }),
504
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M16 12h-2" }),
505
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M22 12h-2" })
506
+ ]
507
+ }), le = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
508
+ ...E,
509
+ ...e,
510
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M21 3v5h-5" })]
511
+ }), ue = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
512
+ ...E,
513
+ ...e,
514
+ children: [/* @__PURE__ */ (0, v.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ (0, v.jsx)("path", { d: "M3 3v5h5" })]
515
+ }), de = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
516
+ ...E,
517
+ ...e,
518
+ children: [
519
+ /* @__PURE__ */ (0, v.jsx)("rect", {
520
+ width: "7",
521
+ height: "7",
522
+ x: "3",
523
+ y: "3",
524
+ rx: "1"
525
+ }),
526
+ /* @__PURE__ */ (0, v.jsx)("rect", {
527
+ width: "7",
528
+ height: "7",
529
+ x: "3",
530
+ y: "14",
531
+ rx: "1"
532
+ }),
533
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M14 4h7" }),
534
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M14 9h7" }),
535
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M14 15h7" }),
536
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M14 20h7" })
484
537
  ]
485
- }), de = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
486
- ...T,
538
+ }), fe = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
539
+ ...E,
487
540
  ...e,
488
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 3v5h-5" })]
489
- }), fe = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
490
- ...T,
541
+ children: [
542
+ /* @__PURE__ */ (0, v.jsx)("rect", {
543
+ width: "18",
544
+ height: "18",
545
+ x: "3",
546
+ y: "3",
547
+ rx: "2"
548
+ }),
549
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M9 3v18" }),
550
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "m14 9 3 3-3 3" })
551
+ ]
552
+ }), pe = (e) => /* @__PURE__ */ (0, v.jsxs)("svg", {
553
+ ...E,
491
554
  ...e,
492
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 3v5h5" })]
493
- }), pe = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
494
- ...T,
555
+ children: [
556
+ /* @__PURE__ */ (0, v.jsx)("rect", {
557
+ width: "18",
558
+ height: "18",
559
+ x: "3",
560
+ y: "3",
561
+ rx: "2"
562
+ }),
563
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "M9 3v18" }),
564
+ /* @__PURE__ */ (0, v.jsx)("path", { d: "m16 15-3-3 3-3" })
565
+ ]
566
+ }), P = (e) => /* @__PURE__ */ (0, v.jsx)("svg", {
567
+ ...E,
495
568
  ...e,
496
- children: /* @__PURE__ */ (0, h.jsx)("path", {
569
+ children: /* @__PURE__ */ (0, v.jsx)("path", {
497
570
  d: "M21 12a9 9 0 1 1-6.219-8.56",
498
- children: /* @__PURE__ */ (0, h.jsx)("animateTransform", {
571
+ children: /* @__PURE__ */ (0, v.jsx)("animateTransform", {
499
572
  attributeType: "xml",
500
573
  attributeName: "transform",
501
574
  type: "rotate",
@@ -505,218 +578,186 @@ var T = {
505
578
  repeatCount: "indefinite"
506
579
  })
507
580
  })
508
- }), A = () => {
509
- let e = n(f);
581
+ }), F = () => {
582
+ let e = r(h);
510
583
  if (!e) throw Error("usePixediContext must be used within an PixediProvider");
511
584
  return e;
512
- }, j = {
513
- button: "_button_snd36_1",
514
- default: "_default_snd36_32",
515
- outline: "_outline_snd36_39",
516
- ghost: "_ghost_snd36_47",
517
- rect: "_rect_snd36_54"
518
- }, M = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, h.jsx)("button", {
585
+ }, I = {
586
+ button: "_button_1vpzl_1",
587
+ default: "_default_1vpzl_35",
588
+ outline: "_outline_1vpzl_44",
589
+ ghost: "_ghost_1vpzl_54",
590
+ rect: "_rect_1vpzl_63"
591
+ }, L = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, v.jsx)("button", {
519
592
  ref: r,
520
- className: `${j.button} ${j[t]} ${e}`.trim(),
593
+ className: `${I.button} ${I[t]} ${e}`.trim(),
521
594
  ...i,
522
595
  children: n
523
- }), N = {
524
- root: "_root_kw2xl_8",
525
- textRed: "_textRed_kw2xl_73",
526
- bgRed: "_bgRed_kw2xl_76",
527
- bgGreen: "_bgGreen_kw2xl_79",
528
- textGreen: "_textGreen_kw2xl_82",
529
- mask: "_mask_kw2xl_85",
530
- semibold: "_semibold_kw2xl_88",
531
- bold: "_bold_kw2xl_92",
532
- system: "_system_kw2xl_96",
533
- wrapper: "_wrapper_kw2xl_105",
534
- main: "_main_kw2xl_111",
535
- grid: "_grid_kw2xl_119"
536
- }, me = { button: "_button_gf7m5_1" }, P = ({ className: e = "", active: t = !1, icon: n, label: r, ref: i, ...a }) => /* @__PURE__ */ (0, h.jsxs)("button", {
537
- ref: i,
538
- type: "button",
539
- "aria-pressed": t,
540
- className: `${me.button} ${e}`.trim(),
541
- ...a,
542
- children: [n, /* @__PURE__ */ (0, h.jsx)("span", {
543
- className: N.semibold,
544
- children: r
545
- })]
546
- }), he = { separator: "_separator_rqskq_1" }, F = t(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, h.jsx)("hr", {
596
+ }), me = { separator: "_separator_gp8ff_1" }, he = t(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, v.jsx)("hr", {
547
597
  ref: r,
548
598
  role: "separator",
549
599
  "aria-orientation": t,
550
600
  "data-orientation": t,
551
- className: `${he.separator} ${e}`.trim(),
601
+ className: `${me.separator} ${e}`.trim(),
552
602
  ...n
553
603
  }));
554
- F.displayName = "Separator";
555
- var I = {
556
- wrapper: "_wrapper_12rgt_1",
557
- trigger: "_trigger_12rgt_6",
558
- triggerArrow: "_triggerArrow_12rgt_29",
559
- content: "_content_12rgt_38",
560
- groupLabel: "_groupLabel_12rgt_68",
561
- item: "_item_12rgt_75",
562
- itemLeft: "_itemLeft_12rgt_91",
563
- itemAddon: "_itemAddon_12rgt_95",
564
- itemRightContainer: "_itemRightContainer_12rgt_112",
565
- itemRight: "_itemRight_12rgt_112",
566
- itemCheck: "_itemCheck_12rgt_121"
567
- }, ge = ({ items: e, value: t, onChange: n, placeholder: c = "Select an option", className: l = "", renderOption: u }) => {
568
- let [d, f] = s(!1), p = o(null), m = o(null), g = o(null), _ = a(() => {
604
+ he.displayName = "Separator";
605
+ var R = {
606
+ wrapper: "_wrapper_1aw0m_1",
607
+ trigger: "_trigger_1aw0m_6",
608
+ triggerArrow: "_triggerArrow_1aw0m_31",
609
+ content: "_content_1aw0m_40",
610
+ groupLabel: "_groupLabel_1aw0m_74",
611
+ item: "_item_1aw0m_81",
612
+ itemLeft: "_itemLeft_1aw0m_98",
613
+ itemAddon: "_itemAddon_1aw0m_102",
614
+ itemRightContainer: "_itemRightContainer_1aw0m_122",
615
+ itemRight: "_itemRight_1aw0m_122",
616
+ itemCheck: "_itemCheck_1aw0m_131"
617
+ }, z = {
618
+ root: "_root_c6gk7_8",
619
+ textRed: "_textRed_c6gk7_73",
620
+ bgRed: "_bgRed_c6gk7_76",
621
+ bgGreen: "_bgGreen_c6gk7_79",
622
+ textGreen: "_textGreen_c6gk7_82",
623
+ mask: "_mask_c6gk7_85",
624
+ semibold: "_semibold_c6gk7_88",
625
+ bold: "_bold_c6gk7_92",
626
+ system: "_system_c6gk7_96",
627
+ wrapper: "_wrapper_c6gk7_106",
628
+ grid: "_grid_c6gk7_113",
629
+ mobile: "_mobile_c6gk7_124",
630
+ gridNoInfobar: "_gridNoInfobar_c6gk7_128"
631
+ }, ge = (e) => {
632
+ let t = 0, n = window.innerHeight;
633
+ for (let r = e.parentElement; r; r = r.parentElement) {
634
+ let { overflow: e, overflowY: i } = getComputedStyle(r);
635
+ if (e === "visible" && i === "visible") continue;
636
+ let a = r.getBoundingClientRect();
637
+ t = Math.max(t, a.top), n = Math.min(n, a.bottom);
638
+ }
639
+ return {
640
+ top: t,
641
+ bottom: n
642
+ };
643
+ }, _e = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: l = "", renderOption: u }) => {
644
+ let [d, f] = c(!1), p = s(null), m = s(null), h = s(null), g = o(() => {
569
645
  let t = (e) => e.reduce((e, n) => n.options ? [...e, ...t(n.options.map((e) => ({
570
646
  ...e,
571
647
  fullName: `${n.label} ${e.label}`
572
648
  })))] : [...e, n], []);
573
649
  return t(e);
574
650
  }, [e]).find((e) => e.value === t);
575
- r(() => {
651
+ i(() => {
576
652
  let e = (e) => {
577
653
  p.current && !e.composedPath().includes(p.current) && f(!1);
578
654
  };
579
655
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
580
- }, []), i(() => {
581
- if (!d || !m.current || !g.current) return;
582
- let e = p.current?.closest(`.${N.main}`)?.getBoundingClientRect(), t = m.current.getBoundingClientRect(), n = g.current.getBoundingClientRect(), r = (e?.bottom ?? window.innerHeight) - 16, i = t.bottom + n.height + 4, a = "calc(100% + 4px)";
583
- i > r && (a = `calc(100% + 4px - ${i - r}px)`), g.current.style.top = a;
656
+ }, []), a(() => {
657
+ let e = p.current, t = m.current, n = h.current;
658
+ if (!d || !e || !t || !n) return;
659
+ n.style.removeProperty("top"), n.style.removeProperty("max-height");
660
+ let { top: r, bottom: i } = ge(e), a = e.getBoundingClientRect().top, o = t.getBoundingClientRect(), s = n.offsetHeight, c = i - 8 - o.bottom - 4, l = o.top - 4 - r - 8, u = o.bottom + 4, f = 0;
661
+ s > c && (s <= l ? u = o.top - 4 - s : l > c ? (f = Math.max(l, 0), u = o.top - 4 - f) : f = Math.max(c, 0)), f && (n.style.maxHeight = `${f}px`), n.style.top = `${u - a}px`;
584
662
  }, [d, e]);
585
- let v = (e) => {
663
+ let _ = (e) => {
586
664
  n(e), f(!1);
587
665
  };
588
- return /* @__PURE__ */ (0, h.jsxs)("div", {
666
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
589
667
  ref: p,
590
- className: `${I.wrapper} ${l}`.trim(),
668
+ className: `${R.wrapper} ${l}`.trim(),
591
669
  "data-state": d ? "open" : "closed",
592
- children: [/* @__PURE__ */ (0, h.jsxs)("button", {
670
+ children: [/* @__PURE__ */ (0, v.jsxs)("button", {
593
671
  ref: m,
594
672
  type: "button",
595
- className: I.trigger,
673
+ className: R.trigger,
596
674
  onClick: () => f(!d),
597
- children: [/* @__PURE__ */ (0, h.jsx)("span", { children: _ ? _.fullName : c }), /* @__PURE__ */ (0, h.jsx)(O, { className: I.triggerArrow })]
598
- }), /* @__PURE__ */ (0, h.jsx)("div", {
599
- ref: g,
600
- className: I.content,
601
- children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, h.jsxs)("div", { children: [/* @__PURE__ */ (0, h.jsx)("div", {
602
- className: `${I.groupLabel} ${N.semibold}`,
675
+ children: [/* @__PURE__ */ (0, v.jsx)("span", { children: g ? g.fullName : r }), /* @__PURE__ */ (0, v.jsx)(ne, { className: R.triggerArrow })]
676
+ }), /* @__PURE__ */ (0, v.jsx)("div", {
677
+ ref: h,
678
+ className: R.content,
679
+ children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, v.jsxs)("div", { children: [/* @__PURE__ */ (0, v.jsx)("div", {
680
+ className: `${R.groupLabel} ${z.semibold}`,
603
681
  children: e.label
604
- }), e.options.map((e) => /* @__PURE__ */ (0, h.jsxs)("div", {
605
- className: I.item,
606
- onClick: () => v(e.value),
607
- children: [u ? u(e) : /* @__PURE__ */ (0, h.jsx)("span", {
608
- className: I.itemLeft,
682
+ }), e.options.map((e) => /* @__PURE__ */ (0, v.jsxs)("div", {
683
+ className: R.item,
684
+ onClick: () => _(e.value),
685
+ children: [u ? u(e) : /* @__PURE__ */ (0, v.jsx)("span", {
686
+ className: R.itemLeft,
609
687
  children: e.label
610
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
611
- className: I.itemAddon,
688
+ }), /* @__PURE__ */ (0, v.jsxs)("div", {
689
+ className: R.itemAddon,
612
690
  children: [
613
- e.rightLabel && /* @__PURE__ */ (0, h.jsx)("span", { children: e.rightLabel }),
614
- t === e.value && /* @__PURE__ */ (0, h.jsx)(E, { className: I.itemCheck }),
615
- t !== e.value && /* @__PURE__ */ (0, h.jsx)("b", {})
691
+ e.rightLabel && /* @__PURE__ */ (0, v.jsx)("span", { children: e.rightLabel }),
692
+ t === e.value && /* @__PURE__ */ (0, v.jsx)(D, { className: R.itemCheck }),
693
+ t !== e.value && /* @__PURE__ */ (0, v.jsx)("b", {})
616
694
  ]
617
695
  })]
618
- }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, h.jsxs)("div", {
619
- className: I.item,
620
- onClick: () => v(e.value),
621
- children: [u ? u(e) : /* @__PURE__ */ (0, h.jsx)("span", {
622
- className: I.itemLeft,
696
+ }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, v.jsxs)("div", {
697
+ className: R.item,
698
+ onClick: () => _(e.value),
699
+ children: [u ? u(e) : /* @__PURE__ */ (0, v.jsx)("span", {
700
+ className: R.itemLeft,
623
701
  children: e.label
624
- }), t === e.value && /* @__PURE__ */ (0, h.jsx)(E, { className: I.itemCheck })]
702
+ }), t === e.value && /* @__PURE__ */ (0, v.jsx)(D, { className: R.itemCheck })]
625
703
  }, e.value))
626
704
  })]
627
705
  });
628
- }, _e = {
629
- input: "_input_j55nq_1",
630
- numberClean: "_numberClean_j55nq_34"
631
- }, ve = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
632
- let a = t === "number" && n ? _e.numberClean : "";
633
- return /* @__PURE__ */ (0, h.jsx)("input", {
706
+ }, ve = {
707
+ input: "_input_kyavx_1",
708
+ numberClean: "_numberClean_kyavx_39"
709
+ }, ye = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
710
+ let a = t === "number" && n ? ve.numberClean : "";
711
+ return /* @__PURE__ */ (0, v.jsx)("input", {
634
712
  ref: r,
635
713
  type: t,
636
- className: `${_e.input} ${a} ${e}`.trim(),
714
+ className: `${ve.input} ${a} ${e}`.trim(),
637
715
  ...i
638
716
  });
639
- }, ye = {
717
+ }, be = {
640
718
  container: "_container_14vsv_1",
641
719
  legend: "_legend_14vsv_4",
642
720
  suffix: "_suffix_14vsv_13"
643
- }, be = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, h.jsxs)("div", {
644
- className: `${ye.container} ${t}`.trim(),
721
+ }, xe = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, v.jsxs)("div", {
722
+ className: `${be.container} ${t}`.trim(),
645
723
  style: n,
646
724
  children: [
647
- /* @__PURE__ */ (0, h.jsx)("span", {
648
- className: ye.legend,
725
+ /* @__PURE__ */ (0, v.jsx)("span", {
726
+ className: be.legend,
649
727
  children: e
650
728
  }),
651
- /* @__PURE__ */ (0, h.jsx)(ve, {
729
+ /* @__PURE__ */ (0, v.jsx)(ye, {
652
730
  ref: r,
653
731
  type: "number",
654
732
  ...i
655
733
  }),
656
- /* @__PURE__ */ (0, h.jsx)("span", {
657
- className: ye.suffix,
734
+ /* @__PURE__ */ (0, v.jsx)("span", {
735
+ className: be.suffix,
658
736
  children: "px"
659
737
  })
660
738
  ]
661
- }), xe = {
662
- group: "_group_qpue1_1",
663
- save: "_save_qpue1_6",
664
- close: "_close_qpue1_13"
665
- }, L = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, h.jsxs)("div", {
666
- className: xe.group,
667
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
739
+ }), B = {
740
+ group: "_group_1e7jm_1",
741
+ save: "_save_1e7jm_6",
742
+ close: "_close_1e7jm_13"
743
+ }, V = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, v.jsxs)("div", {
744
+ className: B.group,
745
+ children: [/* @__PURE__ */ (0, v.jsx)(L, {
668
746
  variant: "outline",
669
- className: xe.save,
747
+ className: B.save,
748
+ "aria-label": "Save",
670
749
  disabled: r || n,
671
750
  onClick: e,
672
- children: n ? /* @__PURE__ */ (0, h.jsx)(pe, {}) : /* @__PURE__ */ (0, h.jsx)(E, {})
673
- }), /* @__PURE__ */ (0, h.jsx)(M, {
751
+ children: n ? /* @__PURE__ */ (0, v.jsx)(P, {}) : /* @__PURE__ */ (0, v.jsx)(D, {})
752
+ }), /* @__PURE__ */ (0, v.jsx)(L, {
674
753
  variant: "outline",
675
- className: xe.close,
754
+ className: B.close,
755
+ "aria-label": "Close",
676
756
  disabled: n,
677
757
  onClick: t,
678
- children: /* @__PURE__ */ (0, h.jsx)(te, {})
758
+ children: /* @__PURE__ */ (0, v.jsx)(te, {})
679
759
  })]
680
- }), R = {
681
- sliderContainer: "_sliderContainer_1ntcm_1",
682
- disabled: "_disabled_1ntcm_12",
683
- sliderTrack: "_sliderTrack_1ntcm_18",
684
- sliderRange: "_sliderRange_1ntcm_30",
685
- sliderThumb: "_sliderThumb_1ntcm_38",
686
- hiddenInput: "_hiddenInput_1ntcm_53"
687
- }, Se = ({ min: e, max: t, value: n, step: r = 1, disabled: i = !1, onChange: o, className: s, ...c }) => {
688
- let l = a(() => {
689
- let r = t - e;
690
- return r <= 0 ? 0 : (n - e) / r * 100;
691
- }, [
692
- n,
693
- e,
694
- t
695
- ]);
696
- return /* @__PURE__ */ (0, h.jsxs)("div", {
697
- className: `${R.sliderContainer} ${i ? R.disabled : ""} ${s || ""}`,
698
- style: { "--slider-progress": `${l}%` },
699
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
700
- className: R.sliderTrack,
701
- children: [/* @__PURE__ */ (0, h.jsx)("div", { className: R.sliderRange }), /* @__PURE__ */ (0, h.jsx)("div", {
702
- className: R.sliderThumb,
703
- style: { left: `${l}%` }
704
- })]
705
- }), /* @__PURE__ */ (0, h.jsx)("input", {
706
- type: "range",
707
- min: e,
708
- max: t,
709
- step: r,
710
- value: n,
711
- disabled: i,
712
- onChange: (e) => {
713
- i || o(Number(e.target.value));
714
- },
715
- className: R.hiddenInput,
716
- ...c
717
- })]
718
- });
719
- }, Ce = 1920, we = .85, Te = [
760
+ }), Se = 1920, Ce = .85, we = [
720
761
  {
721
762
  label: "Facebook",
722
763
  value: "facebook",
@@ -819,13 +860,13 @@ var I = {
819
860
  }
820
861
  ]
821
862
  }
822
- ], z = 32, Ee = (e, t, n, r, i, a, o, s, c, l) => {
863
+ ], H = 32, Te = (e, t, n, r, i, a, o, s, c, l) => {
823
864
  let { x: u, y: d, w: f, h: p } = c;
824
865
  if (e) {
825
866
  let e = o - c.w - c.x;
826
- u += i - n, u < 0 && (u = 0), f = o - u - e, f < z && (f = z, u = o - e - z);
867
+ u += i - n, u < 0 && (u = 0), f = o - u - e, f < H && (f = H, u = o - e - H);
827
868
  let t = s - p - d;
828
- d += a - r, d < 0 && (d = 0), p = s - d - t, p < z && (p = z, d = s - t - z);
869
+ d += a - r, d < 0 && (d = 0), p = s - d - t, p < H && (p = H, d = s - t - H);
829
870
  } else {
830
871
  if (t >= 1) {
831
872
  let e = i - n, r = Math.round(e / t);
@@ -834,7 +875,7 @@ var I = {
834
875
  let e = a - r, n = Math.round(e * t);
835
876
  f -= n, p -= e, u += n, d += e;
836
877
  }
837
- if (u < 0 || d < 0 || f < z || p < z) return l;
878
+ if (u < 0 || d < 0 || f < H || p < H) return l;
838
879
  }
839
880
  return {
840
881
  x: u,
@@ -842,12 +883,12 @@ var I = {
842
883
  w: f,
843
884
  h: p
844
885
  };
845
- }, De = (e, t, n, r, i, a, o, s, c, l) => {
886
+ }, Ee = (e, t, n, r, i, a, o, s, c, l) => {
846
887
  let { x: u } = c, { y: d, w: f, h: p } = c;
847
888
  if (e) {
848
- f += i - n, f + u > o && (f = o - u), f < z && (f = z);
889
+ f += i - n, f + u > o && (f = o - u), f < H && (f = H);
849
890
  let e = s - p - d;
850
- d += a - r, d < 0 && (d = 0), p = s - d - e, p < z && (p = z, d = s - e - z);
891
+ d += a - r, d < 0 && (d = 0), p = s - d - e, p < H && (p = H, d = s - e - H);
851
892
  } else {
852
893
  if (t > 1) {
853
894
  let e = i - n, r = Math.round(e / t);
@@ -856,7 +897,7 @@ var I = {
856
897
  let e = a - r, n = Math.round(e * t);
857
898
  f -= n, p -= e, d += e;
858
899
  }
859
- if (f + u > o || d < 0 || f < z || p < z) return l;
900
+ if (f + u > o || d < 0 || f < H || p < H) return l;
860
901
  }
861
902
  return {
862
903
  x: u,
@@ -864,12 +905,12 @@ var I = {
864
905
  w: f,
865
906
  h: p
866
907
  };
867
- }, Oe = (e, t, n, r, i, a, o, s, c, l) => {
908
+ }, De = (e, t, n, r, i, a, o, s, c, l) => {
868
909
  let { y: u } = c, { x: d, w: f, h: p } = c;
869
910
  if (e) {
870
- p += a - r, p + u > s && (p = s - u), p < z && (p = z);
911
+ p += a - r, p + u > s && (p = s - u), p < H && (p = H);
871
912
  let e = o - c.w - c.x;
872
- d += i - n, d < 0 && (d = 0), f = o - d - e, f < z && (f = z, d = o - e - z);
913
+ d += i - n, d < 0 && (d = 0), f = o - d - e, f < H && (f = H, d = o - e - H);
873
914
  } else {
874
915
  if (t >= 1) {
875
916
  let e = i - n, r = Math.round(e / t);
@@ -878,7 +919,7 @@ var I = {
878
919
  let e = a - r, n = Math.round(e * t);
879
920
  f += n, p += e, d -= n;
880
921
  }
881
- if (p + u > s || d < 0 || f < z || p < z) return l;
922
+ if (p + u > s || d < 0 || f < H || p < H) return l;
882
923
  }
883
924
  return {
884
925
  x: d,
@@ -886,9 +927,9 @@ var I = {
886
927
  w: f,
887
928
  h: p
888
929
  };
889
- }, ke = (e, t, n, r, i, a, o, s, c, l) => {
930
+ }, Oe = (e, t, n, r, i, a, o, s, c, l) => {
890
931
  let { x: u, y: d } = c, { w: f, h: p } = c;
891
- if (e) f += i - n, f + u > o && (f = o - u), f < z && (f = z), p += a - r, p + d > s && (p = s - d), p < z && (p = z);
932
+ if (e) f += i - n, f + u > o && (f = o - u), f < H && (f = H), p += a - r, p + d > s && (p = s - d), p < H && (p = H);
892
933
  else {
893
934
  if (t >= 1) {
894
935
  let e = i - n, r = Math.round(e / t);
@@ -897,7 +938,7 @@ var I = {
897
938
  let e = a - r, n = Math.round(e * t);
898
939
  f += n, p += e;
899
940
  }
900
- if (p + d > s || f + u > o || f < z || p < z) return l;
941
+ if (p + d > s || f + u > o || f < H || p < H) return l;
901
942
  }
902
943
  return {
903
944
  x: u,
@@ -905,30 +946,34 @@ var I = {
905
946
  w: f,
906
947
  h: p
907
948
  };
908
- }, Ae = (e, t, n, r, i, a, o, s, c) => {
909
- let l = e === "tl" || e === "bl", u = e === "tl" || e === "tr", d = c.x + c.w, f = c.y + c.h, p = i - n, m = a - r, h = t >= 1 ? c.w + (l ? -p : p) : (c.h + (u ? -m : m)) * t, g = l ? d : o - c.x, _ = u ? f : s - c.y, v = Math.min(g, _ * t), y = Math.max(z, z * t), b = Math.min(Math.max(h, y), v), x = b / t;
949
+ }, ke = (e, t, n, r, i, a, o, s, c) => {
950
+ let l = e === "tl" || e === "bl", u = e === "tl" || e === "tr", d = c.x + c.w, f = c.y + c.h, p = i - n, m = a - r, h = t >= 1 ? c.w + (l ? -p : p) : (c.h + (u ? -m : m)) * t, g = l ? d : o - c.x, _ = u ? f : s - c.y, v = Math.min(g, _ * t), y = Math.max(H, H * t), b = Math.min(Math.max(h, y), v), x = b / t;
910
951
  return {
911
952
  x: l ? d - b : c.x,
912
953
  y: u ? f - x : c.y,
913
954
  w: b,
914
955
  h: x
915
956
  };
916
- }, je = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Ee(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? De(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Oe(t, n, r, i, a, o, s, c, l, u) : e === "br" ? ke(t, n, r, i, a, o, s, c, l, u) : {
957
+ }, Ae = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Te(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? Ee(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? De(t, n, r, i, a, o, s, c, l, u) : e === "br" ? Oe(t, n, r, i, a, o, s, c, l, u) : {
917
958
  x: 0,
918
959
  y: 0,
919
960
  w: 0,
920
961
  h: 0
921
- } : Ae(e, n, r, i, a, o, s, c, l), Me = (e, t, n) => {
962
+ } : ke(e, n, r, i, a, o, s, c, l), U = (e, t, n) => {
922
963
  let r = .12, i = t / n, a = 0, o = 0;
923
964
  e === 1 && (a = (i > 1 ? n : t) * (1 - r * 2), o = a), e > 1 && (i > e ? (o = n * (1 - r * 2), a = o * e) : (a = t * (1 - r * 2), o = a / e)), e < 1 && (i > e ? (o = n * (1 - r * 2), a = o * e) : (a = t * (1 - r * 2), o = a / e));
924
- let s = a / t * 100, c = o / n * 100;
965
+ let s = a / t * 100, c = o / n * 100, l = (t - a) / 2 / t * 100, u = (n - o) / 2 / n * 100;
925
966
  return {
926
- x: (t - a) / 2 / t * 100,
927
- y: (n - o) / 2 / n * 100,
967
+ x: l,
968
+ y: u,
928
969
  w: s,
929
- h: c
970
+ h: c,
971
+ xP: Math.round(l / 100 * t),
972
+ yP: Math.round(u / 100 * n),
973
+ wP: Math.round(s / 100 * t),
974
+ hP: Math.round(c / 100 * n)
930
975
  };
931
- }, Ne = (e, t, n, r) => {
976
+ }, je = (e, t, n, r) => {
932
977
  let i = e.w / 100 * n, a = e.h / 100 * r;
933
978
  t >= 1 ? a = i / t : i = a * t;
934
979
  let o = i / n * 100, s = a / r * 100, c = Math.max(o / (100 - e.x), s / (100 - e.y), 1);
@@ -937,21 +982,21 @@ var I = {
937
982
  w: o,
938
983
  h: s
939
984
  };
940
- }, B = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Pe = (e, t, n, r) => B(n) === B(r) ? {
985
+ }, W = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Me = (e, t, n, r) => W(n) === W(r) ? {
941
986
  width: e,
942
987
  height: t
943
988
  } : {
944
989
  width: t,
945
990
  height: e
946
- }, Fe = async (e) => {
947
- let { width: t, height: n } = e, r = Math.min(1, Ce / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
991
+ }, Ne = async (e) => {
992
+ let { width: t, height: n } = e, r = Math.min(1, Se / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
948
993
  if (!s) throw Error("Failed to get 2D context for preview canvas");
949
994
  return s.drawImage(e, 0, 0, i, a), o.convertToBlob({
950
995
  type: "image/webp",
951
- quality: we
996
+ quality: Ce
952
997
  });
953
998
  };
954
- function Ie(e) {
999
+ function Pe(e) {
955
1000
  let t = new OffscreenCanvas(e.width, e.height), n = t.getContext("2d");
956
1001
  if (!n) throw Error("Failed to create 2D context for canvas.");
957
1002
  n.drawImage(e, 0, 0);
@@ -965,14 +1010,14 @@ function Ie(e) {
965
1010
  }
966
1011
  //#endregion
967
1012
  //#region src/shared/components/Pixedi/utils/imageProcessor.ts
968
- var Le = (e) => new Promise((t, n) => {
1013
+ var Fe = (e) => new Promise((t, n) => {
969
1014
  let r = new FileReader();
970
1015
  r.onloadend = () => {
971
1016
  let e = r.result;
972
1017
  typeof e == "string" ? t(e) : n(/* @__PURE__ */ Error("Failed to read blob as base64"));
973
1018
  }, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("FileReader error")), r.readAsDataURL(e);
974
1019
  });
975
- async function Re(e) {
1020
+ async function Ie(e) {
976
1021
  let t = await createImageBitmap(e), n = e.type || "image/png", r = n === "image/gif" ? "image/png" : n, i = document.createElement("canvas"), a = i.getContext("2d", { alpha: !0 });
977
1022
  i.width = t.width, i.height = t.height, a?.drawImage(t, 0, 0), t.close();
978
1023
  let o = () => {
@@ -1007,7 +1052,7 @@ async function Re(e) {
1007
1052
  }, a, t) : i.toBlob((t) => {
1008
1053
  t ? e(t) : o(/* @__PURE__ */ Error("Failed to encode image as image/png"));
1009
1054
  }, "image/png");
1010
- }), s = await createImageBitmap(o), c = await Fe(s), { width: l, height: u } = s, d = Ie(s);
1055
+ }), s = await createImageBitmap(o), c = await Ne(s), { width: l, height: u } = s, d = Pe(s);
1011
1056
  return s.close(), {
1012
1057
  newBlob: o,
1013
1058
  previewBlob: c,
@@ -1021,17 +1066,17 @@ async function Re(e) {
1021
1066
  }
1022
1067
  //#endregion
1023
1068
  //#region src/shared/components/Pixedi/utils/preview.ts
1024
- var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0][0] + e[0][1] * t[1][0], e[0][0] * t[0][1] + e[0][1] * t[1][1]], [e[1][0] * t[0][0] + e[1][1] * t[1][0], e[1][0] * t[0][1] + e[1][1] * t[1][1]]], Be = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, Ve = (e) => {
1025
- switch (Be(e)) {
1069
+ var G = (e, t, n) => Math.max(t, Math.min(n, e)), Le = (e, t) => [[e[0][0] * t[0][0] + e[0][1] * t[1][0], e[0][0] * t[0][1] + e[0][1] * t[1][1]], [e[1][0] * t[0][0] + e[1][1] * t[1][0], e[1][0] * t[0][1] + e[1][1] * t[1][1]]], Re = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, ze = (e) => {
1070
+ switch (Re(e)) {
1026
1071
  case 90: return [[0, -1], [1, 0]];
1027
1072
  case 180: return [[-1, 0], [0, -1]];
1028
1073
  case 270: return [[0, 1], [-1, 0]];
1029
1074
  default: return [[1, 0], [0, 1]];
1030
1075
  }
1031
- }, He = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], Ue = (e, t, n) => ze(He(t, n), Ve(-e)), We = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], H = (e, t, n) => {
1032
- let r = We(e);
1076
+ }, Be = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], Ve = (e, t, n) => Le(Be(t, n), ze(-e)), He = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], K = (e, t, n) => {
1077
+ let r = He(e);
1033
1078
  return [e[0][0] * t + e[0][1] * n + r[0], e[1][0] * t + e[1][1] * n + r[1]];
1034
- }, Ge = (e) => {
1079
+ }, Ue = (e) => {
1035
1080
  let t = 1, n = 1, r = {
1036
1081
  x: 0,
1037
1082
  y: 0,
@@ -1040,18 +1085,18 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1040
1085
  }, i = 0, a = !1, o = !1;
1041
1086
  for (let s = 0; s < e.length; s++) {
1042
1087
  let c = e[s];
1043
- if (c.action.name === "initial") t = c.width, n = c.height, r = {
1088
+ if (c.action.name === f.INITIAL) t = c.width, n = c.height, r = {
1044
1089
  x: 0,
1045
1090
  y: 0,
1046
1091
  w: 1,
1047
1092
  h: 1
1048
1093
  }, i = 0, a = !1, o = !1;
1049
- else if (c.action.name === "crop") {
1050
- let e = (c.action.args.x ?? 0) / 100, t = (c.action.args.y ?? 0) / 100, n = (c.action.args.w ?? 100) / 100, s = (c.action.args.h ?? 100) / 100, l = Ue(i, a, o), u = [
1051
- H(l, e, t),
1052
- H(l, e + n, t),
1053
- H(l, e, t + s),
1054
- H(l, e + n, t + s)
1094
+ else if (c.action.name === f.CROP) {
1095
+ let e = (c.action.args.x ?? 0) / 100, t = (c.action.args.y ?? 0) / 100, n = (c.action.args.w ?? 100) / 100, s = (c.action.args.h ?? 100) / 100, l = Ve(i, a, o), u = [
1096
+ K(l, e, t),
1097
+ K(l, e + n, t),
1098
+ K(l, e, t + s),
1099
+ K(l, e + n, t + s)
1055
1100
  ], d = Math.min(...u.map((e) => e[0])), f = Math.max(...u.map((e) => e[0])), p = Math.min(...u.map((e) => e[1])), m = Math.max(...u.map((e) => e[1]));
1056
1101
  r = {
1057
1102
  x: r.x + d * r.w,
@@ -1060,17 +1105,17 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1060
1105
  h: r.h * (m - p)
1061
1106
  };
1062
1107
  } else if (c.action.name === "flip") {
1063
- let e = B(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1108
+ let e = W(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1064
1109
  t && (a = !a), n && (o = !o);
1065
1110
  } else c.action.name === "rotate" && (i = c.action.args.degrees);
1066
1111
  }
1067
- let s = r.w * t, c = r.h * n, l = B(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0;
1112
+ let s = r.w * t, c = r.h * n, l = W(i), u = l ? c : s, d = l ? s : c, p = e.at(-1)?.width || 0, m = e.at(-1)?.height || 0;
1068
1113
  return {
1069
1114
  box: r,
1070
1115
  boxWidth: s,
1071
1116
  boxHeight: c,
1072
- newWidth: f,
1073
- newHeight: p,
1117
+ newWidth: p,
1118
+ newHeight: m,
1074
1119
  initWidth: t,
1075
1120
  initHeight: n,
1076
1121
  viewWidth: u,
@@ -1079,13 +1124,13 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1079
1124
  flipH: a,
1080
1125
  flipV: o
1081
1126
  };
1082
- }, Ke = (e) => {
1083
- let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = Ge(e), d = V(t.x, 0, 1), f = V(t.y, 0, 1), p = {
1127
+ }, We = (e) => {
1128
+ let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = Ue(e), d = G(t.x, 0, 1), f = G(t.y, 0, 1), p = {
1084
1129
  x: d,
1085
1130
  y: f,
1086
- w: V(t.w, 0, 1 - d),
1087
- h: V(t.h, 0, 1 - f)
1088
- }, m = Be(i);
1131
+ w: G(t.w, 0, 1 - d),
1132
+ h: G(t.h, 0, 1 - f)
1133
+ }, m = Re(i);
1089
1134
  return {
1090
1135
  ...p.x === 0 && p.y === 0 && p.w === 1 && p.h === 1 ? {} : { crop: {
1091
1136
  x: Math.round(s * t.x),
@@ -1103,18 +1148,18 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1103
1148
  height: o
1104
1149
  } } : {}
1105
1150
  };
1106
- }, qe = (e) => {
1107
- let [t, n] = s(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: c, resetHistory: l } = A();
1151
+ }, Ge = (e) => {
1152
+ let [t, n] = c(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: s, resetHistory: l } = F();
1108
1153
  return {
1109
1154
  save: async () => {
1110
1155
  if (!o) return;
1111
1156
  n(!0);
1112
- let t = Ke(a.items.slice(0, a.pointer + 1));
1157
+ let t = We(a.items.slice(0, a.pointer + 1));
1113
1158
  try {
1114
- let n = await Re(o);
1159
+ let n = await Ie(o);
1115
1160
  t.crop && n.crop(t.crop.x, t.crop.y, t.crop.w, t.crop.h), t.flip && n.flip(t.flip.horizontal, t.flip.vertical), t.rotate && n.rotate(t.rotate.degrees), t.resize && n.resize(t.resize.width, t.resize.height);
1116
1161
  let { newBlob: a, previewBlob: s, mimeType: c, width: l, height: u, isAlpha: d } = await n.get(i), f = "";
1117
- i.exportAs === "base64" && (f = await Le(a)), await e(f || a), r({
1162
+ i.exportAs === "base64" && (f = await Fe(a)), await e(f || a), r({
1118
1163
  newBlob: a,
1119
1164
  previewBlob: s,
1120
1165
  mimeType: c,
@@ -1129,418 +1174,592 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1129
1174
  }
1130
1175
  },
1131
1176
  reset: () => {
1132
- c(null), l();
1177
+ s(null), l();
1133
1178
  },
1134
1179
  isSaving: t
1135
1180
  };
1136
- }, U = {
1137
- header: "_header_msw8l_1",
1138
- tools: "_tools_msw8l_11",
1139
- history: "_history_msw8l_15",
1140
- historyText: "_historyText_msw8l_20"
1141
- }, Je = ({ onBack: e, onSave: t }) => {
1142
- let { save: n, reset: r, isSaving: i } = qe(t), { history: a, undo: o, redo: s } = A(), c = a.items.length > 1 && !i, l = a.pointer === 0, u = a.pointer === a.items.length - 1, d = a.items.length < 2 || i, f = d || a.pointer === 0;
1143
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1144
- className: U.header,
1145
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
1146
- variant: "ghost",
1147
- className: j.rect,
1148
- onClick: e,
1149
- children: /* @__PURE__ */ (0, h.jsx)(D, {})
1150
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1151
- className: U.tools,
1181
+ }, q = {
1182
+ header: "_header_25ynx_1",
1183
+ left: "_left_25ynx_12",
1184
+ sidebarToggle: "_sidebarToggle_25ynx_17",
1185
+ mobile: "_mobile_25ynx_29",
1186
+ sidebarIcon: "_sidebarIcon_25ynx_33",
1187
+ tools: "_tools_25ynx_38",
1188
+ history: "_history_25ynx_42",
1189
+ historyText: "_historyText_25ynx_47"
1190
+ }, Ke = ({ onBack: e, onSave: t, isMobile: n }) => {
1191
+ let { save: r, reset: i, isSaving: a } = Ge(t), { sidebar: o, history: s, undo: c, redo: l, setSidebar: u } = F(), d = s.items.length > 1 && !a, f = s.pointer === 0, p = s.pointer === s.items.length - 1, m = s.items.length < 2 || a, h = m || s.pointer === 0;
1192
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
1193
+ className: q.header,
1194
+ children: [/* @__PURE__ */ (0, v.jsxs)("div", {
1195
+ className: q.left,
1196
+ children: [/* @__PURE__ */ (0, v.jsx)("div", {
1197
+ className: `${q.sidebarToggle} ${n ? q.mobile : ""}`,
1198
+ onClick: () => {
1199
+ u(!o);
1200
+ },
1201
+ children: o ? /* @__PURE__ */ (0, v.jsx)(pe, { className: q.sidebarIcon }) : /* @__PURE__ */ (0, v.jsx)(fe, { className: q.sidebarIcon })
1202
+ }), /* @__PURE__ */ (0, v.jsx)(L, {
1203
+ variant: "ghost",
1204
+ className: I.rect,
1205
+ onClick: e,
1206
+ children: /* @__PURE__ */ (0, v.jsx)(k, {})
1207
+ })]
1208
+ }), /* @__PURE__ */ (0, v.jsxs)("div", {
1209
+ className: q.tools,
1152
1210
  children: [
1153
- c && /* @__PURE__ */ (0, h.jsxs)("div", {
1154
- className: U.history,
1211
+ d && /* @__PURE__ */ (0, v.jsxs)("div", {
1212
+ className: q.history,
1155
1213
  children: [
1156
- /* @__PURE__ */ (0, h.jsx)(M, {
1214
+ /* @__PURE__ */ (0, v.jsx)(L, {
1157
1215
  variant: "outline",
1158
- disabled: l,
1159
- className: j.rect,
1160
- onClick: o,
1161
- children: /* @__PURE__ */ (0, h.jsx)(re, {})
1216
+ disabled: f,
1217
+ className: I.rect,
1218
+ onClick: c,
1219
+ children: /* @__PURE__ */ (0, v.jsx)(A, {})
1162
1220
  }),
1163
- /* @__PURE__ */ (0, h.jsxs)("div", {
1164
- className: U.historyText,
1221
+ /* @__PURE__ */ (0, v.jsxs)("div", {
1222
+ className: q.historyText,
1165
1223
  children: [
1166
- a.pointer + 1,
1224
+ s.pointer + 1,
1167
1225
  "/",
1168
- a.items.length
1226
+ s.items.length
1169
1227
  ]
1170
1228
  }),
1171
- /* @__PURE__ */ (0, h.jsx)(M, {
1229
+ /* @__PURE__ */ (0, v.jsx)(L, {
1172
1230
  variant: "outline",
1173
- disabled: u,
1174
- className: j.rect,
1175
- onClick: s,
1176
- children: /* @__PURE__ */ (0, h.jsx)(k, {})
1231
+ disabled: p,
1232
+ className: I.rect,
1233
+ onClick: l,
1234
+ children: /* @__PURE__ */ (0, v.jsx)(re, {})
1177
1235
  })
1178
1236
  ]
1179
1237
  }),
1180
- /* @__PURE__ */ (0, h.jsx)(M, {
1238
+ /* @__PURE__ */ (0, v.jsx)(L, {
1181
1239
  variant: "outline",
1182
- disabled: d,
1183
- onClick: r,
1240
+ disabled: m,
1241
+ onClick: i,
1184
1242
  children: "Reset"
1185
1243
  }),
1186
- /* @__PURE__ */ (0, h.jsxs)(M, {
1187
- disabled: f,
1188
- onClick: n,
1189
- children: [i ? /* @__PURE__ */ (0, h.jsx)(pe, {}) : /* @__PURE__ */ (0, h.jsx)(E, {}), "Save"]
1244
+ /* @__PURE__ */ (0, v.jsxs)(L, {
1245
+ disabled: h,
1246
+ onClick: r,
1247
+ children: [a ? /* @__PURE__ */ (0, v.jsx)(P, {}) : /* @__PURE__ */ (0, v.jsx)(D, {}), "Save"]
1190
1248
  })
1191
1249
  ]
1192
1250
  })]
1193
1251
  });
1194
- }, Ye = (e, t) => {
1252
+ }, J = {
1253
+ sidebar: "_sidebar_16gr5_1",
1254
+ mobile: "_mobile_16gr5_10",
1255
+ open: "_open_16gr5_15",
1256
+ item: "_item_16gr5_20",
1257
+ selected: "_selected_16gr5_38"
1258
+ }, qe = (e) => {
1259
+ switch (e) {
1260
+ case f.RESIZE: return {
1261
+ icon: /* @__PURE__ */ (0, v.jsx)(oe, {}),
1262
+ label: "Resize"
1263
+ };
1264
+ case f.CROP: return {
1265
+ icon: /* @__PURE__ */ (0, v.jsx)(j, {}),
1266
+ label: "Crop"
1267
+ };
1268
+ case f.PRESET_CROP: return {
1269
+ icon: /* @__PURE__ */ (0, v.jsx)(de, {}),
1270
+ label: "Presets"
1271
+ };
1272
+ case f.FLIP: return {
1273
+ icon: /* @__PURE__ */ (0, v.jsx)(se, {}),
1274
+ label: "Flip"
1275
+ };
1276
+ case f.ROTATE: return {
1277
+ icon: /* @__PURE__ */ (0, v.jsx)(le, {}),
1278
+ label: "Rotate"
1279
+ };
1280
+ default: return null;
1281
+ }
1282
+ }, Je = ({ isMobile: e }) => {
1283
+ let { settings: t, sidebar: n, currentAction: r, getLastRotation: i, getLastHistoryItem: a, setCurrentAction: o, setSidebar: s } = F(), c = t?.tools || [], l = r?.name, { width: u, height: d } = a(), p = (e) => {
1284
+ if (c.includes(e) && l === e) {
1285
+ o(null);
1286
+ return;
1287
+ }
1288
+ switch (e) {
1289
+ case f.RESIZE:
1290
+ o({
1291
+ name: f.RESIZE,
1292
+ args: {
1293
+ width: u,
1294
+ height: d
1295
+ }
1296
+ });
1297
+ break;
1298
+ case f.CROP:
1299
+ o({
1300
+ name: f.CROP,
1301
+ args: {
1302
+ id: "freeform",
1303
+ ratio: u / d,
1304
+ isFree: !0
1305
+ }
1306
+ });
1307
+ break;
1308
+ case f.PRESET_CROP:
1309
+ o({
1310
+ name: f.PRESET_CROP,
1311
+ args: {
1312
+ id: "facebook-post",
1313
+ ratio: 1200 / 630,
1314
+ isFree: !1,
1315
+ preset: {
1316
+ width: 1200,
1317
+ height: 630
1318
+ }
1319
+ }
1320
+ });
1321
+ break;
1322
+ case f.FLIP:
1323
+ o({
1324
+ name: f.FLIP,
1325
+ args: {
1326
+ horizontal: !1,
1327
+ vertical: !1
1328
+ }
1329
+ });
1330
+ break;
1331
+ case f.ROTATE:
1332
+ o({
1333
+ name: f.ROTATE,
1334
+ args: { degrees: i() }
1335
+ });
1336
+ break;
1337
+ }
1338
+ s(!1);
1339
+ };
1340
+ return /* @__PURE__ */ (0, v.jsx)("nav", {
1341
+ className: `${J.sidebar} ${e ? J.mobile : ""} ${e && n ? J.open : ""}`,
1342
+ children: c.map((e) => {
1343
+ let t = qe(e);
1344
+ if (!t) return null;
1345
+ let { icon: n, label: r } = t;
1346
+ return /* @__PURE__ */ (0, v.jsx)("div", {
1347
+ className: `${J.item} ${l === e ? J.selected : ""}`,
1348
+ onClick: () => p(e),
1349
+ title: r,
1350
+ children: n
1351
+ }, e);
1352
+ })
1353
+ });
1354
+ }, Ye = { infobar: "_infobar_ofe91_1" }, Xe = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`, Ze = () => {
1355
+ let { originalBlob: e, getLastHistoryItem: t } = F(), { width: n, height: r } = t();
1356
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
1357
+ className: Ye.infobar,
1358
+ children: [/* @__PURE__ */ (0, v.jsx)("div", {
1359
+ className: Ye.filesize,
1360
+ children: e ? Xe(e.size) : "0 B"
1361
+ }), /* @__PURE__ */ (0, v.jsxs)("div", {
1362
+ className: Ye.sizes,
1363
+ children: [
1364
+ n,
1365
+ " / ",
1366
+ r
1367
+ ]
1368
+ })]
1369
+ });
1370
+ }, Qe = (e, t) => {
1195
1371
  let n = new CustomEvent("crop-update", { detail: t });
1196
1372
  e.dispatchEvent(n);
1197
- }, Xe = (e, t) => {
1373
+ }, $e = (e, t) => {
1198
1374
  let n = new CustomEvent("clip-path-update", { detail: t });
1199
1375
  e.dispatchEvent(n);
1200
- }, W = (e, t) => {
1376
+ }, et = (e, t) => {
1201
1377
  let n = new CustomEvent("resize-update", { detail: t });
1202
1378
  e.dispatchEvent(n);
1203
- }, G = {
1204
- resize: "_resize_11cwi_1",
1205
- slider: "_slider_11cwi_14",
1206
- border: "_border_11cwi_18",
1207
- tools: "_tools_11cwi_24",
1208
- toolsLock: "_toolsLock_11cwi_30"
1209
- }, K = 10, q = 200, J = (e, t, n) => (e < K && (e = K), e > q && (e = q), {
1210
- updatedScale: e,
1211
- updatedWidth: Math.round(e / 100 * t),
1212
- updatedHeight: Math.round(e / 100 * n)
1213
- }), Ze = () => {
1214
- let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: i, eventBus: a } = A(), { width: c, height: l } = e(), [u, d] = s(c), [f, p] = s(l), [m, g] = s(100), _ = o(0), v = S(), y = (e) => {
1215
- let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(e, c, l);
1216
- d(n), p(r), g(t), W(a, t);
1217
- }, b = (e) => {
1218
- let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(parseInt(e.target?.value ?? "1") / c * 100, c, l);
1219
- d(n), p(r), g(t), W(a, t);
1220
- }, x = (e) => {
1221
- let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(parseInt(e.target.value) / l * 100, c, l);
1222
- p(r), d(n), g(t), W(a, t);
1223
- }, C = () => {
1224
- W(a, 100), t(null), i(!0);
1225
- }, w = () => {
1226
- n({
1227
- width: u,
1228
- height: f,
1229
- action: {
1230
- name: "resize",
1231
- args: {
1232
- width: u,
1233
- height: f
1234
- }
1235
- }
1236
- }), W(a, 100), i(!0);
1379
+ }, tt = 15, nt = 200, rt = 2, it = (e, t, n) => {
1380
+ let r = Math.min(nt, Math.max(tt, e));
1381
+ return {
1382
+ scale: r,
1383
+ width: Math.round(r / 100 * t),
1384
+ height: Math.round(r / 100 * n)
1237
1385
  };
1238
- return r(() => {
1239
- let e = Math.round(u / c * 100), t = (e) => {
1240
- let { updatedHeight: t, updatedWidth: n } = J(e, c, l);
1241
- p(t), d(n), g(e), W(a, e);
1242
- }, n = (n) => {
1243
- let r = Math.sign(n.deltaY);
1244
- e -= r * 2, e <= K && (e = K), e >= q && (e = q), t(e);
1245
- }, r = (e) => {
1246
- _.current = e.touches[0].clientY;
1247
- }, i = (n) => {
1248
- let r = n.touches[0].clientY, i = _.current - r;
1249
- Math.abs(i) < 10 || (e += Math.sign(i) * 2, e <= K && (e = K), e >= q && (e = q), t(e), _.current = r);
1250
- }, o = new AbortController(), { signal: s } = o;
1251
- return window.addEventListener("wheel", n, { signal: s }), window.addEventListener("touchstart", r, { signal: s }), window.addEventListener("touchmove", i, { signal: s }), () => o.abort();
1386
+ }, at = () => {
1387
+ let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: r, setSidebar: a, eventBus: o } = F(), { width: l, height: u } = e(), [d, p] = c(l), [m, h] = c(u), [g, _] = c(100), v = s(g), y = s(0), b = s(null), x = n((e) => {
1388
+ let t = it(e, l, u);
1389
+ p(t.width), h(t.height), _(t.scale), v.current = t.scale, et(o, t.scale);
1252
1390
  }, [
1253
- l,
1254
- c,
1255
- v,
1256
1391
  u,
1257
- a
1258
- ]), /* @__PURE__ */ (0, h.jsxs)("div", {
1259
- className: G.resize,
1260
- children: [/* @__PURE__ */ (0, h.jsx)(Se, {
1261
- min: K,
1262
- max: q,
1263
- value: m,
1264
- className: G.slider,
1265
- onChange: y
1266
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1267
- className: G.tools,
1268
- children: [
1269
- /* @__PURE__ */ (0, h.jsx)(be, {
1270
- value: u,
1271
- name: "width",
1272
- label: "Width",
1273
- style: { width: "88px" },
1274
- onChange: (e) => d(Number(e.target.value)),
1275
- onBlur: b
1276
- }),
1277
- /* @__PURE__ */ (0, h.jsx)(ne, { className: G.toolsLock }),
1278
- /* @__PURE__ */ (0, h.jsx)(be, {
1279
- value: f,
1280
- name: "height",
1281
- label: "Height",
1282
- style: { width: "88px" },
1283
- onChange: (e) => p(Number(e.target.value)),
1284
- onBlur: x
1285
- }),
1286
- /* @__PURE__ */ (0, h.jsx)(L, {
1287
- onSave: () => w(),
1288
- onClose: C,
1289
- disabled: u === c
1392
+ l,
1393
+ o
1394
+ ]), S = (e, t) => {
1395
+ let n = Number.parseInt(e, 10);
1396
+ if (!Number.isFinite(n)) {
1397
+ x(100);
1398
+ return;
1399
+ }
1400
+ x(n / t * 100);
1401
+ };
1402
+ return i(() => {
1403
+ let e = (e) => {
1404
+ let t = b.current?.parentElement;
1405
+ return e.target instanceof Node && !!t?.contains(e.target);
1406
+ }, t = (t) => {
1407
+ e(t) && x(v.current - Math.sign(t.deltaY) * rt);
1408
+ }, n = (t) => {
1409
+ e(t) && (y.current = t.touches[0].clientY);
1410
+ }, r = (t) => {
1411
+ if (!e(t)) return;
1412
+ let n = t.touches[0].clientY, r = y.current - n;
1413
+ Math.abs(r) < 10 || (x(v.current + Math.sign(r) * rt), y.current = n);
1414
+ }, i = new AbortController(), { signal: a } = i;
1415
+ return window.addEventListener("wheel", t, { signal: a }), window.addEventListener("touchstart", n, { signal: a }), window.addEventListener("touchmove", r, { signal: a }), () => i.abort();
1416
+ }, [x]), {
1417
+ resizeRef: b,
1418
+ width: d,
1419
+ height: m,
1420
+ scale: g,
1421
+ currentWidth: l,
1422
+ currentHeight: u,
1423
+ setWidth: p,
1424
+ setHeight: h,
1425
+ handleWidthBlur: (e) => {
1426
+ S(e.target.value, l);
1427
+ },
1428
+ handleHeightBlur: (e) => {
1429
+ S(e.target.value, u);
1430
+ },
1431
+ save: () => {
1432
+ r({
1433
+ width: d,
1434
+ height: m,
1435
+ action: {
1436
+ name: f.RESIZE,
1437
+ args: {
1438
+ width: d,
1439
+ height: m
1440
+ }
1441
+ }
1442
+ }), et(o, 100), a(!0);
1443
+ },
1444
+ close: () => {
1445
+ et(o, 100), t(null), a(!0);
1446
+ }
1447
+ };
1448
+ }, Y = {
1449
+ resize: "_resize_s127g_1",
1450
+ toolsLock: "_toolsLock_s127g_15",
1451
+ indicatorWrapper: "_indicatorWrapper_s127g_20",
1452
+ indicator: "_indicator_s127g_20"
1453
+ }, ot = () => {
1454
+ let { resizeRef: e, width: t, height: n, scale: r, currentWidth: i, currentHeight: a, setWidth: o, setHeight: s, handleWidthBlur: c, handleHeightBlur: l, save: u, close: d } = at();
1455
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
1456
+ ref: e,
1457
+ className: Y.resize,
1458
+ children: [
1459
+ /* @__PURE__ */ (0, v.jsx)("div", {
1460
+ className: Y.indicatorWrapper,
1461
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
1462
+ className: Y.indicator,
1463
+ style: { width: `${r / 2}%` }
1290
1464
  })
1291
- ]
1292
- })]
1465
+ }),
1466
+ /* @__PURE__ */ (0, v.jsx)(xe, {
1467
+ value: t,
1468
+ name: "width",
1469
+ label: "Width",
1470
+ style: { width: "88px" },
1471
+ onChange: (e) => o(Number(e.target.value)),
1472
+ onBlur: c
1473
+ }),
1474
+ /* @__PURE__ */ (0, v.jsx)(O, { className: Y.toolsLock }),
1475
+ /* @__PURE__ */ (0, v.jsx)(xe, {
1476
+ value: n,
1477
+ name: "height",
1478
+ label: "Height",
1479
+ style: { width: "88px" },
1480
+ onChange: (e) => s(Number(e.target.value)),
1481
+ onBlur: l
1482
+ }),
1483
+ /* @__PURE__ */ (0, v.jsx)(V, {
1484
+ onSave: u,
1485
+ onClose: d,
1486
+ disabled: t === i && n === a
1487
+ })
1488
+ ]
1293
1489
  });
1294
- }, Y = {
1295
- preview: "_preview_dvanl_1",
1296
- rotate: "_rotate_dvanl_12",
1297
- flip: "_flip_dvanl_24",
1298
- image: "_image_dvanl_32"
1299
- }, Qe = ({ isClipped: e, style: t = {} }) => {
1300
- let { history: n, previewUrl: a, currentAction: s, getLastRotation: c, eventBus: l } = A(), u = o(null), d = o(s?.name), f = o(a);
1301
- i(() => {
1302
- let e = d.current, t = s?.name, n = f.current !== a;
1303
- if (d.current = t, f.current = a, !(e && t && e !== t) && !n) return;
1304
- let r = u.current;
1305
- if (!r) return;
1306
- let i = [r, ...r.querySelectorAll("*")];
1307
- i.forEach((e) => {
1490
+ }, st = ({ isClipped: e }) => {
1491
+ let { history: t, previewUrl: n, currentAction: r, getLastRotation: o, eventBus: c } = F(), l = s(null), u = s(r?.name), d = s(n);
1492
+ a(() => {
1493
+ let e = u.current, t = r?.name, i = d.current !== n;
1494
+ if (u.current = t, d.current = n, !(e && t && e !== t) && !i) return;
1495
+ let a = l.current;
1496
+ if (!a) return;
1497
+ let o = [a, ...a.querySelectorAll("*")];
1498
+ o.forEach((e) => {
1308
1499
  e.style.transition = "none";
1309
- }), r.getBoundingClientRect();
1310
- let o = () => {
1311
- i.forEach((e) => {
1500
+ }), a.getBoundingClientRect();
1501
+ let s = () => {
1502
+ o.forEach((e) => {
1312
1503
  e.style.removeProperty("transition");
1313
1504
  });
1314
- }, c = requestAnimationFrame(o);
1505
+ }, c = requestAnimationFrame(s);
1315
1506
  return () => {
1316
- cancelAnimationFrame(c), o();
1507
+ cancelAnimationFrame(c), s();
1317
1508
  };
1318
- }, [s?.name, a]);
1319
- let p = [];
1320
- if (s) {
1321
- let { width: e, height: t } = n.items.at(n.pointer);
1509
+ }, [r?.name, n]);
1510
+ let p = t.items.slice(0, t.pointer + 1);
1511
+ if (r) {
1512
+ let { width: e, height: n } = t.items.at(t.pointer);
1322
1513
  p.push({
1323
- ...s.name === w.ROTATE ? Pe(e, t, c(), s.args.degrees) : {
1514
+ ...r.name === f.ROTATE ? Me(e, n, o(), r.args.degrees) : {
1324
1515
  width: e,
1325
- height: t
1516
+ height: n
1326
1517
  },
1327
- action: s
1518
+ action: r
1328
1519
  });
1329
1520
  }
1330
- let { box: m, boxWidth: g, boxHeight: _, viewWidth: v, viewHeight: y, rotation: b, flipH: x, flipV: S } = Ge([...n.items.slice(0, n.pointer + 1), ...p]);
1331
- return r(() => {
1332
- e && u.current && (u.current.style.transition = "none"), s?.name !== w.RESIZE && u.current && (u.current.style.transform = "scale(1)");
1521
+ let m = Ue(p);
1522
+ return i(() => {
1523
+ e && l.current && (l.current.style.transition = "none"), r?.name !== f.RESIZE && l.current && (l.current.style.transform = "scale(1)");
1333
1524
  let t = (e) => {
1334
1525
  let t = e.detail;
1335
- u.current && (u.current.style.transform = `scale(${t / 100})`);
1526
+ l.current && (l.current.style.transform = `scale(${t / 100})`);
1336
1527
  }, n = (t) => {
1337
1528
  if (!e) return;
1338
1529
  let { x: n, y: r, w: i, h: a } = t.detail;
1339
- u.current && (u.current.style.clipPath = `xywh(${n}% ${r}% ${i}% ${a}%)`);
1530
+ l.current && (l.current.style.clipPath = `xywh(${n}% ${r}% ${i}% ${a}%)`);
1340
1531
  };
1341
- return l.addEventListener("resize-update", t), l.addEventListener("clip-path-update", n), () => {
1342
- l.removeEventListener("resize-update", t), l.removeEventListener("clip-path-update", n);
1532
+ return c.addEventListener("resize-update", t), c.addEventListener("clip-path-update", n), () => {
1533
+ c.removeEventListener("resize-update", t), c.removeEventListener("clip-path-update", n);
1343
1534
  };
1344
1535
  }, [
1345
1536
  e,
1346
- s?.name,
1347
- l
1348
- ]), /* @__PURE__ */ (0, h.jsx)("div", {
1349
- ref: u,
1350
- className: Y.preview,
1537
+ r?.name,
1538
+ c
1539
+ ]), {
1540
+ previewRef: l,
1541
+ previewUrl: n,
1542
+ ...m
1543
+ };
1544
+ }, X = {
1545
+ preview: "_preview_dvanl_1",
1546
+ rotate: "_rotate_dvanl_12",
1547
+ flip: "_flip_dvanl_24",
1548
+ image: "_image_dvanl_32"
1549
+ }, ct = ({ isClipped: e, style: t = {} }) => {
1550
+ let { previewRef: n, previewUrl: r, box: i, boxWidth: a, boxHeight: o, viewWidth: s, viewHeight: c, rotation: l, flipH: u, flipV: d } = st({ isClipped: e });
1551
+ return /* @__PURE__ */ (0, v.jsx)("div", {
1552
+ ref: n,
1553
+ className: X.preview,
1351
1554
  style: {
1352
- aspectRatio: `${v} / ${y}`,
1555
+ aspectRatio: `${s} / ${c}`,
1353
1556
  ...t
1354
1557
  },
1355
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1356
- className: Y.rotate,
1558
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
1559
+ className: X.rotate,
1357
1560
  style: {
1358
- width: `${g / v * 100}%`,
1359
- height: `${_ / y * 100}%`,
1360
- transform: `translate(-50%, -50%) rotate(${b}deg)`
1561
+ width: `${a / s * 100}%`,
1562
+ height: `${o / c * 100}%`,
1563
+ transform: `translate(-50%, -50%) rotate(${l}deg)`
1361
1564
  },
1362
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1363
- className: Y.flip,
1364
- style: { transform: `scale(${x ? -1 : 1}, ${S ? -1 : 1})` },
1365
- children: /* @__PURE__ */ (0, h.jsx)("img", {
1366
- className: Y.image,
1367
- src: a,
1565
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
1566
+ className: X.flip,
1567
+ style: { transform: `scale(${u ? -1 : 1}, ${d ? -1 : 1})` },
1568
+ children: /* @__PURE__ */ (0, v.jsx)("img", {
1569
+ className: X.image,
1570
+ src: r,
1368
1571
  alt: "Preview Image",
1369
1572
  style: {
1370
- width: `${1 / m.w * 100}%`,
1371
- height: `${1 / m.h * 100}%`,
1372
- left: `${-(m.x / m.w) * 100}%`,
1373
- top: `${-(m.y / m.h) * 100}%`
1573
+ width: `${1 / i.w * 100}%`,
1574
+ height: `${1 / i.h * 100}%`,
1575
+ left: `${-(i.x / i.w) * 100}%`,
1576
+ top: `${-(i.y / i.h) * 100}%`
1374
1577
  }
1375
1578
  })
1376
1579
  })
1377
1580
  })
1378
1581
  });
1379
- }, X = {
1380
- wrapper: "_wrapper_13nh3_1",
1381
- box: "_box_13nh3_9",
1382
- tools: "_tools_13nh3_18",
1383
- toolsInfo: "_toolsInfo_13nh3_34",
1384
- toolsInfoLabel: "_toolsInfoLabel_13nh3_41",
1385
- toolsInfoValue: "_toolsInfoValue_13nh3_46",
1386
- linesBox: "_linesBox_13nh3_51",
1387
- line: "_line_13nh3_51",
1388
- lineV: "_lineV_13nh3_61",
1389
- lineH: "_lineH_13nh3_69",
1390
- pointer: "_pointer_13nh3_77",
1391
- pointerTopLeft: "_pointerTopLeft_13nh3_83",
1392
- pointerTopRight: "_pointerTopRight_13nh3_90",
1393
- pointerBottomRight: "_pointerBottomRight_13nh3_97",
1394
- pointerBottomLeft: "_pointerBottomLeft_13nh3_104",
1395
- mobileBorder: "_mobileBorder_13nh3_111",
1396
- mobilePointer: "_mobilePointer_13nh3_117"
1397
- }, $e = () => {
1398
- let { getLastHistoryItem: e } = A(), t = S(), n = o(null), { handleCropStart: r, initialCrop: i } = ct({ boxRef: n }), { width: a, height: s } = e(), { x: c, y: l, w: u, h: d } = i;
1399
- return /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(Qe, {
1582
+ }, Z = {
1583
+ wrapper: "_wrapper_1yhyo_1",
1584
+ box: "_box_1yhyo_9",
1585
+ tools: "_tools_1yhyo_18",
1586
+ toolsInfo: "_toolsInfo_1yhyo_35",
1587
+ toolsInfoLabel: "_toolsInfoLabel_1yhyo_42",
1588
+ toolsInfoValue: "_toolsInfoValue_1yhyo_47",
1589
+ linesBox: "_linesBox_1yhyo_52",
1590
+ line: "_line_1yhyo_52",
1591
+ lineV: "_lineV_1yhyo_62",
1592
+ lineH: "_lineH_1yhyo_70",
1593
+ pointer: "_pointer_1yhyo_78",
1594
+ pointerTopLeft: "_pointerTopLeft_1yhyo_84",
1595
+ pointerTopRight: "_pointerTopRight_1yhyo_91",
1596
+ pointerBottomRight: "_pointerBottomRight_1yhyo_98",
1597
+ pointerBottomLeft: "_pointerBottomLeft_1yhyo_105",
1598
+ mobileBorder: "_mobileBorder_1yhyo_112",
1599
+ mobilePointer: "_mobilePointer_1yhyo_118",
1600
+ info: "_info_1yhyo_129",
1601
+ infoX: "_infoX_1yhyo_146",
1602
+ infoY: "_infoY_1yhyo_151",
1603
+ infoW: "_infoW_1yhyo_158",
1604
+ infoH: "_infoH_1yhyo_163",
1605
+ group: "_group_1yhyo_170",
1606
+ active: "_active_1yhyo_179"
1607
+ }, lt = () => {
1608
+ let { getLastHistoryItem: e } = F(), t = w(), n = s(null), { handleCropStart: r, initialCrop: i } = bt({ boxRef: n }), { width: a, height: o } = e(), { x: c, y: l, w: u, h: d } = i;
1609
+ return /* @__PURE__ */ (0, v.jsxs)(v.Fragment, { children: [/* @__PURE__ */ (0, v.jsx)(ct, {
1400
1610
  isClipped: !0,
1401
1611
  style: { clipPath: `xywh(${c}% ${l}% ${u}% ${d}%)` }
1402
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1403
- className: X.wrapper,
1404
- style: { aspectRatio: `${a} / ${s}` },
1405
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1612
+ }), /* @__PURE__ */ (0, v.jsx)("div", {
1613
+ className: Z.wrapper,
1614
+ style: { aspectRatio: `${a} / ${o}` },
1615
+ children: /* @__PURE__ */ (0, v.jsxs)("div", {
1406
1616
  ref: n,
1407
- className: X.box,
1617
+ className: Z.box,
1408
1618
  style: {
1409
1619
  width: `${u}%`,
1410
1620
  height: `${d}%`,
1411
1621
  top: `${l}%`,
1412
1622
  left: `${c}%`
1413
1623
  },
1414
- children: [/* @__PURE__ */ (0, h.jsx)(tt, {}), t ? /* @__PURE__ */ (0, h.jsx)(lt, { onMouseDown: r }) : /* @__PURE__ */ (0, h.jsx)(nt, { onMouseDown: r })]
1624
+ children: [/* @__PURE__ */ (0, v.jsx)(pt, {}), t ? /* @__PURE__ */ (0, v.jsx)(xt, { onMouseDown: r }) : /* @__PURE__ */ (0, v.jsxs)(v.Fragment, { children: [/* @__PURE__ */ (0, v.jsx)(mt, { onMouseDown: r }), /* @__PURE__ */ (0, v.jsx)(St, {})] })]
1415
1625
  })
1416
1626
  })] });
1417
- }, et = () => {
1418
- let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: i, setSidebar: a, eventBus: s } = A(), { width: c, height: l } = n(), u = o(null), d = o(null), f = o(null), p = o(null), m = o({
1627
+ }, ut = ({ value: e, onChange: t }) => /* @__PURE__ */ (0, v.jsxs)("div", {
1628
+ className: Z.group,
1629
+ children: [
1630
+ /* @__PURE__ */ (0, v.jsx)(L, {
1631
+ variant: "outline",
1632
+ className: `${Z.groupBtn} ${e === "freeform" ? Z.active : ""}`,
1633
+ onClick: () => t("freeform"),
1634
+ children: /* @__PURE__ */ (0, v.jsx)(j, {})
1635
+ }),
1636
+ /* @__PURE__ */ (0, v.jsx)(L, {
1637
+ variant: "outline",
1638
+ className: `${Z.groupBtn} ${e === "origin" ? Z.active : ""}`,
1639
+ onClick: () => t("origin"),
1640
+ children: /* @__PURE__ */ (0, v.jsx)(ie, {})
1641
+ }),
1642
+ /* @__PURE__ */ (0, v.jsx)(L, {
1643
+ variant: "outline",
1644
+ className: `${Z.groupBtn} ${e === "1:1" ? Z.active : ""}`,
1645
+ onClick: () => t("1:1"),
1646
+ children: /* @__PURE__ */ (0, v.jsx)(M, {})
1647
+ }),
1648
+ /* @__PURE__ */ (0, v.jsx)(L, {
1649
+ variant: "outline",
1650
+ className: `${Z.groupBtn} ${e === "4:3" ? Z.active : ""}`,
1651
+ onClick: () => t("4:3"),
1652
+ children: /* @__PURE__ */ (0, v.jsx)(ae, {})
1653
+ }),
1654
+ /* @__PURE__ */ (0, v.jsx)(L, {
1655
+ variant: "outline",
1656
+ className: `${Z.groupBtn} ${e === "16:9" ? Z.active : ""}`,
1657
+ onClick: () => t("16:9"),
1658
+ children: /* @__PURE__ */ (0, v.jsx)(N, {})
1659
+ })
1660
+ ]
1661
+ }), dt = () => {
1662
+ let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: r, setSidebar: a, eventBus: o } = F(), { width: c, height: l } = n(), { name: u, args: d } = t || {}, p = u === f.CROP ? d?.id : "", m = c / l, h = s({
1419
1663
  x: 0,
1420
1664
  y: 0,
1421
1665
  w: 0,
1422
1666
  h: 0
1423
1667
  });
1424
- return r(() => {
1425
- if (t?.name !== "crop") return;
1426
- let e = Me(t.args.ratio, c, l), { x: n, y: r, w: i, h: a } = e, o = Math.round(n / 100 * c), h = Math.round(r / 100 * l), g = Math.round(i / 100 * c), _ = Math.round(a / 100 * l);
1427
- m.current = e, u.current && (u.current.textContent = o.toString()), d.current && (d.current.textContent = h.toString()), f.current && (f.current.textContent = g.toString()), p.current && (p.current.textContent = _.toString());
1428
- let v = (e) => {
1429
- let { x: t, y: n, w: r, h: i } = e.detail;
1430
- u.current && (u.current.textContent = t.toString()), d.current && (d.current.textContent = n.toString()), f.current && (f.current.textContent = r.toString()), p.current && (p.current.textContent = i.toString());
1431
- }, y = (e) => {
1432
- m.current = e.detail;
1668
+ return i(() => {
1669
+ if (t?.name !== f.CROP) return;
1670
+ let e = U(t.args.ratio, c, l);
1671
+ h.current = e;
1672
+ let n = (e) => {
1673
+ h.current = e.detail;
1433
1674
  };
1434
- return s.addEventListener("crop-update", v), s.addEventListener("clip-path-update", y), () => {
1435
- s.removeEventListener("crop-update", v), s.removeEventListener("clip-path-update", y);
1675
+ return o.addEventListener("clip-path-update", n), () => {
1676
+ o.removeEventListener("clip-path-update", n);
1436
1677
  };
1437
1678
  }, [
1438
1679
  t,
1439
1680
  c,
1440
1681
  l,
1441
- s
1442
- ]), /* @__PURE__ */ (0, h.jsxs)("div", {
1443
- className: X.tools,
1444
- children: [
1445
- /* @__PURE__ */ (0, h.jsxs)("div", {
1446
- className: X.toolsInfo,
1447
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1448
- className: X.toolsInfoLabel,
1449
- children: "left"
1450
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1451
- className: `${X.toolsInfoValue} ${N.semibold}`,
1452
- ref: u
1453
- })]
1454
- }),
1455
- /* @__PURE__ */ (0, h.jsxs)("div", {
1456
- className: X.toolsInfo,
1457
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1458
- className: X.toolsInfoLabel,
1459
- children: "top"
1460
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1461
- className: `${X.toolsInfoValue} ${N.semibold}`,
1462
- ref: d
1463
- })]
1464
- }),
1465
- /* @__PURE__ */ (0, h.jsxs)("div", {
1466
- className: X.toolsInfo,
1467
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1468
- className: X.toolsInfoLabel,
1469
- children: "width"
1470
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1471
- className: `${X.toolsInfoValue} ${N.semibold}`,
1472
- ref: f
1473
- })]
1474
- }),
1475
- /* @__PURE__ */ (0, h.jsxs)("div", {
1476
- className: X.toolsInfo,
1477
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1478
- className: X.toolsInfoLabel,
1479
- children: "height"
1480
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1481
- className: `${X.toolsInfoValue} ${N.semibold}`,
1482
- ref: p
1483
- })]
1484
- }),
1485
- /* @__PURE__ */ (0, h.jsx)(L, {
1486
- onSave: async () => {
1487
- if (!t || t.name !== w.CROP) return;
1488
- let e = t.args?.preset?.width || Math.round(c * m.current.w / 100), n = t.args?.preset?.height || Math.round(l * m.current.h / 100);
1489
- i({
1490
- width: e,
1491
- height: n,
1492
- action: {
1493
- name: "crop",
1494
- args: {
1495
- ...t.args,
1496
- ...m.current
1497
- }
1498
- }
1499
- }), a(!0);
1500
- },
1501
- onClose: () => {
1502
- e(null), a(!0);
1682
+ o
1683
+ ]), {
1684
+ currentValue: p,
1685
+ handleChange: (t) => {
1686
+ t !== p && (e({
1687
+ name: f.CROP,
1688
+ args: {
1689
+ id: t,
1690
+ ratio: /^\d+:\d+$/.test(t) ? t.split(":").map(Number).reduce((e, t) => e / t) : m,
1691
+ isFree: t === "freeform"
1503
1692
  }
1504
- })
1505
- ]
1693
+ }), a(!0));
1694
+ },
1695
+ handleSave: () => {
1696
+ if (!t || t.name !== f.CROP) return;
1697
+ let e = t.args?.preset?.width || Math.round(c * h.current.w / 100), n = t.args?.preset?.height || Math.round(l * h.current.h / 100);
1698
+ r({
1699
+ width: e,
1700
+ height: n,
1701
+ action: {
1702
+ name: f.CROP,
1703
+ args: {
1704
+ ...t.args,
1705
+ ...h.current
1706
+ }
1707
+ }
1708
+ }), a(!0);
1709
+ },
1710
+ handleClose: () => {
1711
+ e(null), a(!0);
1712
+ }
1713
+ };
1714
+ }, ft = () => {
1715
+ let { currentValue: e, handleChange: t, handleSave: n, handleClose: r } = dt();
1716
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
1717
+ className: Z.tools,
1718
+ children: [/* @__PURE__ */ (0, v.jsx)(ut, {
1719
+ value: e,
1720
+ onChange: t
1721
+ }), /* @__PURE__ */ (0, v.jsx)(V, {
1722
+ onSave: n,
1723
+ onClose: r
1724
+ })]
1506
1725
  });
1507
- }, tt = () => /* @__PURE__ */ (0, h.jsxs)("div", {
1508
- className: X.linesBox,
1509
- children: [/* @__PURE__ */ (0, h.jsx)("span", { className: `${X.line} ${X.lineV}` }), /* @__PURE__ */ (0, h.jsx)("span", { className: `${X.line} ${X.lineH}` })]
1510
- }), nt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [
1511
- /* @__PURE__ */ (0, h.jsx)("div", {
1512
- className: `${X.pointer} ${X.pointerTopLeft}`,
1726
+ }, pt = () => /* @__PURE__ */ (0, v.jsxs)("div", {
1727
+ className: Z.linesBox,
1728
+ children: [/* @__PURE__ */ (0, v.jsx)("span", { className: `${Z.line} ${Z.lineV}` }), /* @__PURE__ */ (0, v.jsx)("span", { className: `${Z.line} ${Z.lineH}` })]
1729
+ }), mt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, v.jsxs)(v.Fragment, { children: [
1730
+ /* @__PURE__ */ (0, v.jsx)("div", {
1731
+ className: `${Z.pointer} ${Z.pointerTopLeft}`,
1513
1732
  onMouseDown: (t) => e(t, "tl", "nwse")
1514
1733
  }),
1515
- /* @__PURE__ */ (0, h.jsx)("div", {
1516
- className: `${X.pointer} ${X.pointerTopRight}`,
1734
+ /* @__PURE__ */ (0, v.jsx)("div", {
1735
+ className: `${Z.pointer} ${Z.pointerTopRight}`,
1517
1736
  onMouseDown: (t) => e(t, "tr", "nesw")
1518
1737
  }),
1519
- /* @__PURE__ */ (0, h.jsx)("div", {
1520
- className: `${X.pointer} ${X.pointerBottomRight}`,
1738
+ /* @__PURE__ */ (0, v.jsx)("div", {
1739
+ className: `${Z.pointer} ${Z.pointerBottomRight}`,
1521
1740
  onMouseDown: (t) => e(t, "br", "nwse")
1522
1741
  }),
1523
- /* @__PURE__ */ (0, h.jsx)("div", {
1524
- className: `${X.pointer} ${X.pointerBottomLeft}`,
1742
+ /* @__PURE__ */ (0, v.jsx)("div", {
1743
+ className: `${Z.pointer} ${Z.pointerBottomLeft}`,
1525
1744
  onMouseDown: (t) => e(t, "bl", "nesw")
1526
1745
  })
1527
1746
  ] });
1528
1747
  //#endregion
1529
1748
  //#region src/shared/components/Pixedi/crop/useCropInteraction.ts
1530
- function rt(e, t, n) {
1749
+ function ht(e, t, n) {
1531
1750
  return Math.min(Math.max(e, t), n);
1532
1751
  }
1533
- function it(e, { x: t, y: n, w: r, h: i }) {
1752
+ function gt(e, { x: t, y: n, w: r, h: i }) {
1534
1753
  e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
1535
1754
  }
1536
- function at(e) {
1755
+ function _t(e) {
1537
1756
  let { width: t, height: n } = e.getBoundingClientRect();
1538
1757
  return {
1539
1758
  frameW: t,
1540
1759
  frameH: n
1541
1760
  };
1542
1761
  }
1543
- function ot({ x: e, y: t, w: n, h: r }, i, a) {
1762
+ function vt({ x: e, y: t, w: n, h: r }, i, a) {
1544
1763
  return {
1545
1764
  x: e / 100 * i,
1546
1765
  y: t / 100 * a,
@@ -1548,7 +1767,7 @@ function ot({ x: e, y: t, w: n, h: r }, i, a) {
1548
1767
  h: r / 100 * a
1549
1768
  };
1550
1769
  }
1551
- function st({ x: e, y: t, w: n, h: r }, i, a) {
1770
+ function yt({ x: e, y: t, w: n, h: r }, i, a) {
1552
1771
  return {
1553
1772
  x: e / i * 100,
1554
1773
  y: t / a * 100,
@@ -1556,427 +1775,396 @@ function st({ x: e, y: t, w: n, h: r }, i, a) {
1556
1775
  h: r / a * 100
1557
1776
  };
1558
1777
  }
1559
- var ct = ({ boxRef: e }) => {
1560
- let { currentAction: t, getLastHistoryItem: n, eventBus: i } = A(), s = S(), { width: c, height: l } = n(), u = t?.name === w.CROP, d = u ? t.args.ratio : 1, f = !u || t.args.isFree, p = a(() => Me(d, c, l), [
1778
+ var bt = ({ boxRef: e }) => {
1779
+ let { currentAction: t, getLastHistoryItem: n, eventBus: r } = F(), a = w(), { width: c, height: l } = n(), u = t?.name === f.CROP || t?.name === f.PRESET_CROP, d = u ? t.args.ratio : 1, p = !u || t.args.isFree, m = o(() => U(d, c, l), [
1561
1780
  d,
1562
1781
  c,
1563
1782
  l
1564
- ]), m = o(null), h = o(""), g = o(p), _ = o(p);
1565
- return r(() => {
1566
- g.current = p, Xe(i, p);
1567
- }, [p, i]), r(() => {
1783
+ ]), h = s(null), g = s(""), _ = s(m), v = s(m);
1784
+ return i(() => {
1785
+ _.current = m, $e(r, m);
1786
+ }, [m, r]), i(() => {
1568
1787
  let t = (e, t) => {
1569
- g.current = t, it(e, t), Ye(i, {
1788
+ _.current = t, gt(e, t), Qe(r, {
1570
1789
  x: Math.round(t.x / 100 * c),
1571
1790
  y: Math.round(t.y / 100 * l),
1572
1791
  w: Math.round(t.w / 100 * c),
1573
1792
  h: Math.round(t.h / 100 * l)
1574
- }), Xe(i, t);
1793
+ }), $e(r, t);
1575
1794
  }, n = (e) => {
1576
- e.preventDefault(), _.current = g.current;
1795
+ e.preventDefault(), v.current = _.current;
1577
1796
  let t = "clientX" in e ? e.clientX : e.touches[0].clientX, n = "clientY" in e ? e.clientY : e.touches[0].clientY;
1578
- m.current = {
1797
+ h.current = {
1579
1798
  x: t,
1580
1799
  y: n
1581
1800
  }, document.body.style.cursor = "move";
1582
- }, r = (t) => {
1583
- if (!e.current || !m.current) return;
1801
+ }, i = (t) => {
1802
+ if (!e.current || !h.current) return;
1584
1803
  t.preventDefault();
1585
1804
  let n = e.current, r = n.parentElement;
1586
1805
  if (!r) return;
1587
- let { frameW: i, frameH: s } = at(r);
1588
- if (h.current) {
1806
+ let { frameW: i, frameH: s } = _t(r);
1807
+ if (g.current) {
1589
1808
  a(t, n, i, s);
1590
1809
  return;
1591
1810
  }
1592
1811
  o(t, n, i, s);
1593
1812
  }, a = (e, n, r, i) => {
1594
- if (!m.current) return;
1595
- let a = "clientX" in e ? e.clientX : e.touches[0].clientX, o = "clientY" in e ? e.clientY : e.touches[0].clientY, s = st(je(h.current, f, d, m.current.x, m.current.y, a, o, r, i, ot(_.current, r, i), ot(g.current, r, i)), r, i);
1596
- t(n, f ? s : Ne(s, d, c, l));
1813
+ if (!h.current) return;
1814
+ let a = "clientX" in e ? e.clientX : e.touches[0].clientX, o = "clientY" in e ? e.clientY : e.touches[0].clientY, s = yt(Ae(g.current, p, d, h.current.x, h.current.y, a, o, r, i, vt(v.current, r, i), vt(_.current, r, i)), r, i);
1815
+ t(n, p ? s : je(s, d, c, l));
1597
1816
  }, o = (e, n, r, i) => {
1598
- if (!m.current) return;
1599
- let { x: a, y: o, w: s, h: c } = _.current, l = "clientX" in e ? e.clientX : e.touches[0].clientX, u = "clientY" in e ? e.clientY : e.touches[0].clientY, d = (l - m.current.x) / r * 100, f = (u - m.current.y) / i * 100;
1817
+ if (!h.current) return;
1818
+ let { x: a, y: o, w: s, h: c } = v.current, l = "clientX" in e ? e.clientX : e.touches[0].clientX, u = "clientY" in e ? e.clientY : e.touches[0].clientY, d = (l - h.current.x) / r * 100, f = (u - h.current.y) / i * 100;
1600
1819
  t(n, {
1601
- x: rt(a + d, 0, Math.max(0, 100 - s)),
1602
- y: rt(o + f, 0, Math.max(0, 100 - c)),
1820
+ x: ht(a + d, 0, Math.max(0, 100 - s)),
1821
+ y: ht(o + f, 0, Math.max(0, 100 - c)),
1603
1822
  w: s,
1604
1823
  h: c
1605
1824
  });
1606
1825
  }, s = () => {
1607
- e.current && (m.current = null, h.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
1826
+ e.current && (h.current = null, g.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
1608
1827
  };
1609
1828
  if (!e.current) return;
1610
- let u = new AbortController(), { signal: p } = u;
1611
- return e.current.addEventListener("mousedown", n, { signal: p }), e.current.addEventListener("touchstart", n, {
1612
- signal: p,
1829
+ let u = new AbortController(), { signal: f } = u;
1830
+ return e.current.addEventListener("mousedown", n, { signal: f }), e.current.addEventListener("touchstart", n, {
1831
+ signal: f,
1613
1832
  passive: !1
1614
- }), document.addEventListener("mousemove", r, { signal: p }), document.addEventListener("touchmove", r, {
1615
- signal: p,
1833
+ }), document.addEventListener("mousemove", i, { signal: f }), document.addEventListener("touchmove", i, {
1834
+ signal: f,
1616
1835
  passive: !1
1617
- }), document.addEventListener("mouseup", s, { signal: p }), document.addEventListener("touchend", s, { signal: p }), () => u.abort();
1836
+ }), document.addEventListener("mouseup", s, { signal: f }), document.addEventListener("touchend", s, { signal: f }), () => u.abort();
1618
1837
  }, [
1619
- f,
1838
+ p,
1620
1839
  d,
1621
1840
  c,
1622
1841
  l,
1623
1842
  e,
1624
- i
1843
+ r
1625
1844
  ]), {
1626
1845
  handleCropStart: (t, n, r) => {
1627
1846
  if (!e.current) return;
1628
- t.stopPropagation(), t.preventDefault(), _.current = g.current;
1629
- let i = "clientX" in t ? t.clientX : t.touches[0].clientX, a = "clientY" in t ? t.clientY : t.touches[0].clientY;
1630
- m.current = {
1847
+ t.stopPropagation(), t.preventDefault(), v.current = _.current;
1848
+ let i = "clientX" in t ? t.clientX : t.touches[0].clientX, o = "clientY" in t ? t.clientY : t.touches[0].clientY;
1849
+ h.current = {
1631
1850
  x: i,
1632
- y: a
1633
- }, h.current = n, s || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1851
+ y: o
1852
+ }, g.current = n, a || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1634
1853
  },
1635
- initialCrop: p
1854
+ initialCrop: m
1636
1855
  };
1637
- }, lt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, h.jsx)("div", {
1638
- className: X.mobileBorder,
1639
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1640
- className: X.mobilePointer,
1856
+ }, xt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, v.jsx)("div", {
1857
+ className: Z.mobileBorder,
1858
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
1859
+ className: Z.mobilePointer,
1641
1860
  onTouchStart: (t) => e(t, "br", "nwse")
1642
1861
  })
1643
- }), Z = {
1862
+ }), St = () => {
1863
+ let e = s(null), t = s(null), n = s(null), r = s(null), { currentAction: a, getLastHistoryItem: o, eventBus: c } = F(), { width: l, height: u } = o();
1864
+ return i(() => {
1865
+ if (!(a?.name === f.CROP || a?.name === f.PRESET_CROP)) return;
1866
+ let { xP: i, yP: o, wP: s, hP: d } = U(a.args.ratio, l, u);
1867
+ e.current && (e.current.textContent = i.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = s.toString()), r.current && (r.current.textContent = d.toString());
1868
+ let p = (i) => {
1869
+ let { x: a, y: o, w: s, h: c } = i.detail;
1870
+ e.current && (e.current.textContent = a.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = s.toString()), r.current && (r.current.textContent = c.toString());
1871
+ };
1872
+ return c.addEventListener("crop-update", p), () => {
1873
+ c.removeEventListener("crop-update", p);
1874
+ };
1875
+ }, [
1876
+ a,
1877
+ u,
1878
+ l,
1879
+ c
1880
+ ]), /* @__PURE__ */ (0, v.jsxs)(v.Fragment, { children: [
1881
+ /* @__PURE__ */ (0, v.jsx)("div", {
1882
+ className: `${Z.info} ${Z.infoX}`,
1883
+ children: /* @__PURE__ */ (0, v.jsx)("b", { ref: e })
1884
+ }),
1885
+ /* @__PURE__ */ (0, v.jsx)("div", {
1886
+ className: `${Z.info} ${Z.infoY}`,
1887
+ children: /* @__PURE__ */ (0, v.jsx)("b", { ref: t })
1888
+ }),
1889
+ /* @__PURE__ */ (0, v.jsx)("div", {
1890
+ className: `${Z.info} ${Z.infoW}`,
1891
+ children: /* @__PURE__ */ (0, v.jsx)("b", { ref: n })
1892
+ }),
1893
+ /* @__PURE__ */ (0, v.jsx)("div", {
1894
+ className: `${Z.info} ${Z.infoH}`,
1895
+ children: /* @__PURE__ */ (0, v.jsx)("b", { ref: r })
1896
+ })
1897
+ ] });
1898
+ }, Ct = we.map((e) => e.options).flat(), wt = () => Ct, Tt = () => {
1899
+ let { currentAction: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: a, eventBus: o } = F(), { width: c, height: l } = t(), u = e?.name === f.PRESET_CROP && Ct.some((t) => t.value === e.args.id) ? e.args.id : "", d = s({
1900
+ x: 0,
1901
+ y: 0,
1902
+ w: 0,
1903
+ h: 0
1904
+ });
1905
+ return i(() => {
1906
+ if (e?.name !== f.PRESET_CROP) return;
1907
+ let t = U(e.args.ratio, c, l);
1908
+ d.current = t;
1909
+ let n = (e) => {
1910
+ d.current = e.detail;
1911
+ };
1912
+ return o.addEventListener("clip-path-update", n), () => {
1913
+ o.removeEventListener("clip-path-update", n);
1914
+ };
1915
+ }, [
1916
+ e,
1917
+ c,
1918
+ l,
1919
+ o
1920
+ ]), {
1921
+ currentValue: u,
1922
+ presetsData: we,
1923
+ handleChange: (e) => {
1924
+ if (!e) return;
1925
+ let t = wt().find((t) => t.value === e);
1926
+ if (!t) return;
1927
+ let n = {
1928
+ id: e,
1929
+ ratio: t.w / t.h,
1930
+ isFree: !1,
1931
+ preset: {
1932
+ width: t.w,
1933
+ height: t.h
1934
+ }
1935
+ };
1936
+ a({
1937
+ name: f.PRESET_CROP,
1938
+ args: n
1939
+ });
1940
+ },
1941
+ handleSave: () => {
1942
+ !e || e.name !== f.PRESET_CROP || (n({
1943
+ width: e.args?.preset?.width || 0,
1944
+ height: e.args?.preset?.height || 0,
1945
+ action: {
1946
+ name: f.CROP,
1947
+ args: {
1948
+ ...e.args,
1949
+ ...d.current
1950
+ }
1951
+ }
1952
+ }), r(!0));
1953
+ },
1954
+ handleClose: () => {
1955
+ a(null), r(!0);
1956
+ }
1957
+ };
1958
+ }, Et = {
1959
+ preset: "_preset_1rbuc_1",
1960
+ select: "_select_1rbuc_14"
1961
+ }, Dt = () => {
1962
+ let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i } = Tt();
1963
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
1964
+ className: Et.preset,
1965
+ children: [/* @__PURE__ */ (0, v.jsx)(_e, {
1966
+ value: e,
1967
+ placeholder: "Select a preset",
1968
+ onChange: n,
1969
+ items: t,
1970
+ className: Et.select
1971
+ }), /* @__PURE__ */ (0, v.jsx)(V, {
1972
+ onSave: r,
1973
+ onClose: i
1974
+ })]
1975
+ });
1976
+ }, Ot = () => {
1977
+ let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = F(), { width: i, height: a } = e(), [o, s] = c(!1), [l, u] = c(!1), d = (e, n) => {
1978
+ t({
1979
+ name: f.FLIP,
1980
+ args: {
1981
+ horizontal: e,
1982
+ vertical: n
1983
+ }
1984
+ });
1985
+ };
1986
+ return {
1987
+ flipHorizontal: o,
1988
+ flipVertical: l,
1989
+ handleFlipHorizontal: () => {
1990
+ let e = !o;
1991
+ s(e), d(e, l);
1992
+ },
1993
+ handleFlipVertical: () => {
1994
+ let e = !l;
1995
+ u(e), d(o, e);
1996
+ },
1997
+ handleSave: () => {
1998
+ n({
1999
+ width: i,
2000
+ height: a,
2001
+ action: {
2002
+ name: f.FLIP,
2003
+ args: {
2004
+ horizontal: o,
2005
+ vertical: l
2006
+ }
2007
+ }
2008
+ }), r(!0);
2009
+ },
2010
+ handleClose: () => {
2011
+ t(null), r(!0);
2012
+ }
2013
+ };
2014
+ }, Q = {
1644
2015
  flip: "_flip_17ic5_1",
1645
2016
  btnH: "_btnH_17ic5_14",
1646
2017
  btnV: "_btnV_17ic5_20"
1647
- }, ut = () => {
1648
- let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = A(), [i, a] = s(!1), [o, c] = s(!1), { width: l, height: u } = e();
1649
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1650
- className: Z.flip,
1651
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1652
- className: Z.scGroup,
1653
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
2018
+ }, kt = () => {
2019
+ let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a } = Ot();
2020
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
2021
+ className: Q.flip,
2022
+ children: [/* @__PURE__ */ (0, v.jsxs)("div", {
2023
+ className: Q.scGroup,
2024
+ children: [/* @__PURE__ */ (0, v.jsx)(L, {
1654
2025
  variant: "outline",
1655
- className: `${Z.btnH}`,
1656
- onClick: () => {
1657
- a((e) => !e), t({
1658
- name: w.FLIP,
1659
- args: {
1660
- horizontal: !i,
1661
- vertical: o
1662
- }
1663
- });
1664
- },
1665
- children: /* @__PURE__ */ (0, h.jsx)(le, { style: { color: i ? "var(--accent-blue)" : "var(--foreground)" } })
1666
- }), /* @__PURE__ */ (0, h.jsx)(M, {
2026
+ className: Q.btnH,
2027
+ onClick: n,
2028
+ children: /* @__PURE__ */ (0, v.jsx)(se, { style: { color: e ? "var(--accent-blue)" : "var(--foreground)" } })
2029
+ }), /* @__PURE__ */ (0, v.jsx)(L, {
1667
2030
  variant: "outline",
1668
- className: `${Z.btnV} `,
1669
- onClick: () => {
1670
- c((e) => !e), t({
1671
- name: w.FLIP,
1672
- args: {
1673
- horizontal: i,
1674
- vertical: !o
1675
- }
1676
- });
1677
- },
1678
- children: /* @__PURE__ */ (0, h.jsx)(ue, { style: { color: o ? "var(--accent-blue)" : "var(--foreground)" } })
2031
+ className: Q.btnV,
2032
+ onClick: r,
2033
+ children: /* @__PURE__ */ (0, v.jsx)(ce, { style: { color: t ? "var(--accent-blue)" : "var(--foreground)" } })
1679
2034
  })]
1680
- }), /* @__PURE__ */ (0, h.jsx)(L, {
1681
- disabled: !i && !o,
1682
- onSave: () => {
1683
- n({
1684
- width: l,
1685
- height: u,
1686
- action: {
1687
- name: w.FLIP,
1688
- args: {
1689
- horizontal: i,
1690
- vertical: o
1691
- }
1692
- }
1693
- }), r(!0);
1694
- },
1695
- onClose: () => {
1696
- t(null), r(!0);
1697
- }
2035
+ }), /* @__PURE__ */ (0, v.jsx)(V, {
2036
+ disabled: !e && !t,
2037
+ onSave: i,
2038
+ onClose: a
1698
2039
  })]
1699
2040
  });
1700
- }, Q = {
2041
+ }, At = () => {
2042
+ let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = F(), { width: a, height: o } = t(), c = e(), l = s(c), u = s(c);
2043
+ return {
2044
+ handleRotate: (e) => {
2045
+ u.current += e, i({
2046
+ name: f.ROTATE,
2047
+ args: { degrees: u.current }
2048
+ });
2049
+ },
2050
+ handleSave: () => {
2051
+ n({
2052
+ ...Me(a, o, l.current, u.current),
2053
+ action: {
2054
+ name: f.ROTATE,
2055
+ args: { degrees: u.current }
2056
+ }
2057
+ }), r(!0);
2058
+ },
2059
+ handleClose: () => {
2060
+ i(null), r(!0);
2061
+ }
2062
+ };
2063
+ }, $ = {
1701
2064
  rotate: "_rotate_gkt07_1",
1702
2065
  btnH: "_btnH_gkt07_14",
1703
2066
  btnV: "_btnV_gkt07_20"
1704
- }, dt = () => {
1705
- let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = A(), { width: a, height: s } = t(), c = e(), l = o(c), u = o(c), d = (e) => {
1706
- u.current += e, i({
1707
- name: "rotate",
1708
- args: { degrees: u.current }
1709
- });
1710
- };
1711
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1712
- className: Q.rotate,
1713
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1714
- className: Q.scGroup,
1715
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
2067
+ }, jt = () => {
2068
+ let { handleRotate: e, handleSave: t, handleClose: n } = At();
2069
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
2070
+ className: $.rotate,
2071
+ children: [/* @__PURE__ */ (0, v.jsxs)("div", {
2072
+ className: $.scGroup,
2073
+ children: [/* @__PURE__ */ (0, v.jsx)(L, {
1716
2074
  variant: "outline",
1717
- className: `${Q.btnH}`,
1718
- onClick: () => d(90),
1719
- children: /* @__PURE__ */ (0, h.jsx)(de, {})
1720
- }), /* @__PURE__ */ (0, h.jsx)(M, {
2075
+ className: $.btnH,
2076
+ onClick: () => e(90),
2077
+ children: /* @__PURE__ */ (0, v.jsx)(le, {})
2078
+ }), /* @__PURE__ */ (0, v.jsx)(L, {
1721
2079
  variant: "outline",
1722
- className: `${Q.btnV} `,
1723
- onClick: () => d(-90),
1724
- children: /* @__PURE__ */ (0, h.jsx)(fe, {})
2080
+ className: $.btnV,
2081
+ onClick: () => e(-90),
2082
+ children: /* @__PURE__ */ (0, v.jsx)(ue, {})
1725
2083
  })]
1726
- }), /* @__PURE__ */ (0, h.jsx)(L, {
1727
- onSave: async () => {
1728
- n({
1729
- ...Pe(a, s, l.current, u.current),
1730
- action: {
1731
- name: "rotate",
1732
- args: { degrees: u.current }
1733
- }
1734
- }), r(!0);
1735
- },
1736
- onClose: () => {
1737
- i(null), r(!0);
1738
- }
2084
+ }), /* @__PURE__ */ (0, v.jsx)(V, {
2085
+ onSave: t,
2086
+ onClose: n
1739
2087
  })]
1740
2088
  });
1741
- }, ft = { frame: "_frame_xffug_1" }, pt = () => {
1742
- let { currentAction: e } = A(), t = e?.name === w.CROP, n = e?.name === w.RESIZE, r = e?.name === w.FLIP, i = e?.name === w.ROTATE, a = t;
1743
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1744
- className: `${ft.frame} ${a ? N.mask : ""}`,
2089
+ }, Mt = { frame: "_frame_15mog_1" }, Nt = () => {
2090
+ let { currentAction: e } = F(), t = e?.name === f.RESIZE, n = e?.name === f.CROP, r = e?.name === f.PRESET_CROP, i = e?.name === f.FLIP, a = e?.name === f.ROTATE, o = n || r;
2091
+ return /* @__PURE__ */ (0, v.jsxs)("div", {
2092
+ className: `${Mt.frame} ${o ? z.mask : ""}`,
1745
2093
  children: [
1746
- /* @__PURE__ */ (0, h.jsx)(Qe, { style: t ? { opacity: .4 } : {} }),
1747
- t && /* @__PURE__ */ (0, h.jsx)($e, {}, e?.args?.id),
1748
- n && /* @__PURE__ */ (0, h.jsx)(Ze, {}),
1749
- t && /* @__PURE__ */ (0, h.jsx)(et, {}),
1750
- r && /* @__PURE__ */ (0, h.jsx)(ut, {}),
1751
- i && /* @__PURE__ */ (0, h.jsx)(dt, {})
2094
+ /* @__PURE__ */ (0, v.jsx)(ct, { style: o ? { opacity: .4 } : {} }),
2095
+ t && /* @__PURE__ */ (0, v.jsx)(ot, {}),
2096
+ (n || r) && /* @__PURE__ */ (0, v.jsx)(lt, {}, e?.args?.id),
2097
+ n && /* @__PURE__ */ (0, v.jsx)(ft, {}),
2098
+ r && /* @__PURE__ */ (0, v.jsx)(Dt, {}),
2099
+ i && /* @__PURE__ */ (0, v.jsx)(kt, {}),
2100
+ a && /* @__PURE__ */ (0, v.jsx)(jt, {})
1752
2101
  ]
1753
2102
  });
1754
- }, $ = {
1755
- sidebar: "_sidebar_8qtha_1",
1756
- settings: "_settings_8qtha_11",
1757
- container: "_container_8qtha_25",
1758
- content: "_content_8qtha_31",
1759
- closeBtn: "_closeBtn_8qtha_47",
1760
- separator: "_separator_8qtha_52",
1761
- resize: "_resize_8qtha_56",
1762
- resizeIcon: "_resizeIcon_8qtha_61",
1763
- resizeSize: "_resizeSize_8qtha_66",
1764
- crop: "_crop_8qtha_70",
1765
- ratio: "_ratio_8qtha_75",
1766
- sidebarPreset: "_sidebarPreset_8qtha_80",
1767
- flipRotate: "_flipRotate_8qtha_85"
1768
- }, mt = () => {
1769
- let { getLastHistoryItem: e, setCurrentAction: t, setSidebar: n } = A(), { width: r, height: i } = e() ?? {
1770
- width: 0,
1771
- height: 0
1772
- };
1773
- return /* @__PURE__ */ (0, h.jsxs)(M, {
1774
- variant: "outline",
1775
- className: $.resize,
1776
- onClick: () => {
1777
- t({
1778
- name: w.RESIZE,
1779
- args: {
1780
- width: r,
1781
- height: i
1782
- }
1783
- }), n(!1);
1784
- },
1785
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1786
- className: $.resizeIcon,
1787
- children: [/* @__PURE__ */ (0, h.jsx)(ce, {}), "Resize"]
1788
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1789
- className: $.resizeSize,
1790
- children: [
1791
- r,
1792
- " x ",
1793
- i
1794
- ]
1795
- })]
1796
- });
1797
- }, ht = () => {
1798
- let { currentAction: e, setCurrentAction: t, getLastHistoryItem: n, setSidebar: r } = A(), { name: i, args: a } = e || {}, o = i === "crop" ? a?.id : "", { width: s, height: c } = n(), l = s / c, u = (e) => {
1799
- e !== o && (t({
1800
- name: "crop",
1801
- args: {
1802
- id: e,
1803
- ratio: e === "1:1" ? 1 : l,
1804
- isFree: e === "freeform"
1805
- }
1806
- }), r(!1));
1807
- };
1808
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1809
- className: $.crop,
1810
- children: [/* @__PURE__ */ (0, h.jsx)("h4", { children: "Crop" }), /* @__PURE__ */ (0, h.jsxs)("div", {
1811
- className: $.ratio,
1812
- children: [
1813
- /* @__PURE__ */ (0, h.jsx)(P, {
1814
- label: "Freeform",
1815
- icon: /* @__PURE__ */ (0, h.jsx)(ae, {}),
1816
- active: o === "freeform",
1817
- onClick: () => u("freeform")
1818
- }),
1819
- /* @__PURE__ */ (0, h.jsx)(P, {
1820
- label: "Original",
1821
- icon: /* @__PURE__ */ (0, h.jsx)(oe, {}),
1822
- active: o === "original",
1823
- onClick: () => u("original")
1824
- }),
1825
- /* @__PURE__ */ (0, h.jsx)(P, {
1826
- label: "1:1",
1827
- icon: /* @__PURE__ */ (0, h.jsx)(se, {}),
1828
- active: o === "1:1",
1829
- onClick: () => u("1:1")
1830
- })
1831
- ]
1832
- })]
1833
- });
1834
- }, gt = Te.map((e) => e.options).flat(), _t = () => {
1835
- let { setCurrentAction: e, currentAction: t, setSidebar: n } = A(), r = t?.name === "crop" && gt.some((e) => e.value === t.args.id) ? t.args.id : "";
1836
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1837
- className: $.sidebarPreset,
1838
- children: [/* @__PURE__ */ (0, h.jsx)("h4", { children: "Presets" }), /* @__PURE__ */ (0, h.jsx)("div", { children: /* @__PURE__ */ (0, h.jsx)(ge, {
1839
- value: r,
1840
- placeholder: "Select a preset",
1841
- onChange: (t) => {
1842
- if (!t) return;
1843
- let r = Te.map((e) => e.options).flat().find((e) => e.value === t);
1844
- if (!r) return;
1845
- let i = {
1846
- id: t,
1847
- ratio: r.w / r.h,
1848
- isFree: !1,
1849
- preset: {
1850
- width: r.w,
1851
- height: r.h
1852
- }
1853
- };
1854
- e({
1855
- name: "crop",
1856
- args: i
1857
- }), n(!1);
1858
- },
1859
- items: Te
1860
- }) })]
1861
- });
1862
- }, vt = () => {
1863
- let { setCurrentAction: e, setSidebar: t } = A();
1864
- return /* @__PURE__ */ (0, h.jsx)(M, {
1865
- variant: "outline",
1866
- className: $.resize,
1867
- onClick: () => {
1868
- e({
1869
- name: w.FLIP,
1870
- args: {
1871
- horizontal: !1,
1872
- vertical: !1
1873
- }
1874
- }), t(!1);
1875
- },
1876
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1877
- className: $.resizeIcon,
1878
- children: [/* @__PURE__ */ (0, h.jsx)(le, {}), "Flip"]
1879
- })
1880
- });
1881
- }, yt = () => {
1882
- let { getLastRotation: e, setCurrentAction: t, setSidebar: n } = A();
1883
- return /* @__PURE__ */ (0, h.jsx)(M, {
1884
- variant: "outline",
1885
- className: $.resize,
1886
- onClick: () => {
1887
- t({
1888
- name: "rotate",
1889
- args: { degrees: e() }
1890
- }), n(!1);
1891
- },
1892
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1893
- className: $.resizeIcon,
1894
- children: [/* @__PURE__ */ (0, h.jsx)(de, {}), "Rotate"]
1895
- })
2103
+ }, Pt = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = p }) => {
2104
+ let [a, o] = c(null), s = T("sm", a), l = {
2105
+ ...p,
2106
+ ...i
2107
+ }, { loading: u, error: d, mimeType: f, width: m, height: h, originalBlob: g, previewUrl: _, isAlpha: b } = C({
2108
+ src: e,
2109
+ skip: l?.tools?.length === 0
1896
2110
  });
1897
- }, bt = () => {
1898
- let { sidebar: e, setSidebar: t } = A(), n = ee("md");
1899
- return /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(M, {
1900
- variant: "outline",
1901
- className: $.settings,
1902
- onClick: () => t(!0),
1903
- children: /* @__PURE__ */ (0, h.jsx)(ie, {})
1904
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1905
- className: $.sidebar,
1906
- style: { transform: n && e ? "translateX(-320px)" : "translateX(0%)" },
1907
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1908
- className: $.container,
1909
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1910
- className: $.content,
1911
- children: [
1912
- n && /* @__PURE__ */ (0, h.jsx)(M, {
1913
- variant: "ghost",
1914
- className: `${$.closeBtn} ${j.rect}`,
1915
- onClick: () => t(!1),
1916
- children: /* @__PURE__ */ (0, h.jsx)(te, {})
1917
- }),
1918
- /* @__PURE__ */ (0, h.jsx)(mt, {}),
1919
- /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1920
- /* @__PURE__ */ (0, h.jsx)(ht, {}),
1921
- /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1922
- /* @__PURE__ */ (0, h.jsx)(_t, {}),
1923
- /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1924
- /* @__PURE__ */ (0, h.jsxs)("div", {
1925
- className: $.flipRotate,
1926
- children: [/* @__PURE__ */ (0, h.jsx)(vt, {}), /* @__PURE__ */ (0, h.jsx)(yt, {})]
1927
- })
1928
- ]
2111
+ return l?.tools?.length === 0 ? /* @__PURE__ */ (0, v.jsx)("div", {
2112
+ className: `${z.root} ${z.wrapper}`,
2113
+ "data-theme": r,
2114
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
2115
+ className: z.system,
2116
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
2117
+ className: z.textRed,
2118
+ children: "No tools selected."
1929
2119
  })
1930
2120
  })
1931
- })] });
1932
- }, xt = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = u }) => {
1933
- let { loading: a, error: o, mimeType: s, width: c, height: l, originalBlob: d, previewUrl: f, isAlpha: p } = b(e);
1934
- return a || o || !d || !s ? /* @__PURE__ */ (0, h.jsx)("div", {
1935
- className: `${N.root} ${N.wrapper}`,
2121
+ }) : u || d || !g || !f ? /* @__PURE__ */ (0, v.jsx)("div", {
2122
+ className: `${z.root} ${z.wrapper}`,
1936
2123
  "data-theme": r,
1937
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1938
- className: N.system,
2124
+ children: /* @__PURE__ */ (0, v.jsxs)("div", {
2125
+ className: z.system,
1939
2126
  children: [
1940
- a && /* @__PURE__ */ (0, h.jsx)(pe, { style: {
2127
+ u && /* @__PURE__ */ (0, v.jsx)(P, { style: {
1941
2128
  width: 48,
1942
2129
  height: 48
1943
2130
  } }),
1944
- o && /* @__PURE__ */ (0, h.jsx)("div", {
1945
- className: N.textRed,
1946
- children: o
2131
+ d && /* @__PURE__ */ (0, v.jsx)("div", {
2132
+ className: z.textRed,
2133
+ children: d
1947
2134
  }),
1948
- !a && !o && (!d || !s) && /* @__PURE__ */ (0, h.jsx)("div", {
1949
- className: N.textRed,
2135
+ !u && !d && (!g || !f) && /* @__PURE__ */ (0, v.jsx)("div", {
2136
+ className: z.textRed,
1950
2137
  children: "Failed to load image."
1951
2138
  })
1952
2139
  ]
1953
2140
  })
1954
- }) : /* @__PURE__ */ (0, h.jsx)(g, {
1955
- mimeType: s,
1956
- width: c,
1957
- height: l,
1958
- originalBlob: d,
1959
- previewUrl: f,
1960
- isAlpha: p,
1961
- settings: {
1962
- ...u,
1963
- ...i
1964
- },
1965
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1966
- className: `${N.root} ${N.wrapper}`,
2141
+ }) : /* @__PURE__ */ (0, v.jsx)(y, {
2142
+ mimeType: f,
2143
+ width: m,
2144
+ height: h,
2145
+ originalBlob: g,
2146
+ previewUrl: _,
2147
+ isAlpha: b,
2148
+ settings: l,
2149
+ children: /* @__PURE__ */ (0, v.jsx)("div", {
2150
+ ref: o,
2151
+ className: `${z.root} ${z.wrapper}`,
1967
2152
  "data-theme": r,
1968
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1969
- className: N.main,
1970
- children: [/* @__PURE__ */ (0, h.jsx)(Je, {
1971
- onSave: t,
1972
- onBack: n
1973
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1974
- className: N.grid,
1975
- children: [/* @__PURE__ */ (0, h.jsx)(pt, {}), /* @__PURE__ */ (0, h.jsx)(bt, {})]
1976
- })]
2153
+ children: /* @__PURE__ */ (0, v.jsxs)("div", {
2154
+ className: `${l?.infobar ? z.grid : z.gridNoInfobar} ${s ? z.mobile : ""}`,
2155
+ children: [
2156
+ /* @__PURE__ */ (0, v.jsx)(Ke, {
2157
+ onSave: t,
2158
+ onBack: n,
2159
+ isMobile: s
2160
+ }),
2161
+ /* @__PURE__ */ (0, v.jsx)(Je, { isMobile: s }),
2162
+ l?.infobar && /* @__PURE__ */ (0, v.jsx)(Ze, {}),
2163
+ /* @__PURE__ */ (0, v.jsx)(Nt, {})
2164
+ ]
1977
2165
  })
1978
2166
  })
1979
2167
  });
1980
2168
  };
1981
2169
  //#endregion
1982
- export { xt as Pixedi };
2170
+ export { Pt as Pixedi };