pixedi 1.2.1 → 1.4.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/CHANGELOG.md +10 -0
- package/README.md +10 -7
- package/README.npm.md +10 -7
- package/dist/lib/index.js +1378 -1044
- package/dist/lib/index.umd.js +3 -3
- package/dist/widget/pixedi-widget.js +6 -6
- package/package.json +2 -1
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 {
|
|
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}._tooltip_gohf2_1{position:relative}._container_gohf2_5{gap:0;display:flex}._container_gohf2_5[data-orientation=vertical]{flex-direction:column}._container_gohf2_5 [data-tooltip]{pointer-events:auto}._popup_gohf2_18{top:var(--tooltip-y,0px);left:var(--tooltip-x,0px);background-color:var(--foreground);color:var(--background);z-index:999;pointer-events:none;opacity:var(--tooltip-opacity,0);width:var(--tooltip-w,auto);height:var(--tooltip-h,auto);transition:opacity var(--tooltip-fade,.2s);border-radius:4px;font-size:14px;position:absolute;transform:translate(-50%,-100%);box-shadow:0 2px 8px #0000001a}._popup_gohf2_18:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_gohf2_18[data-orientation=vertical]{transform:translateY(-50%)}._popup_gohf2_18[data-orientation=vertical]:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;top:50%;left:-3px;transform:translateY(-50%)rotate(45deg)}._popup_gohf2_18._animated_gohf2_62{transition:left var(--tooltip-slide,.4s), top var(--tooltip-slide,.4s), width var(--tooltip-slide,.4s), height var(--tooltip-slide,.4s), opacity var(--tooltip-fade,.2s)}._mask_gohf2_71{border-radius:inherit;width:100%;height:100%;overflow:hidden}._track_gohf2_78{width:max-content;height:max-content;transform:translateX(calc(-1 * var(--tooltip-offset,0px)));display:flex}._track_gohf2_78[data-orientation=vertical]{transform:translateY(calc(-1 * var(--tooltip-offset,0px)));flex-direction:column}._animated_gohf2_62 ._track_gohf2_78{transition:transform var(--tooltip-slide,.4s)}._title_gohf2_94{min-width:var(--tooltip-item-w,auto);max-width:var(--tooltip-item-w,none);min-height:var(--tooltip-item-h,32px);max-height:var(--tooltip-item-h,none);white-space:nowrap;box-sizing:border-box;flex:none;justify-content:center;align-items:center;padding:0 10px;display:flex}._header_1yueu_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_1yueu_12{align-items:center;gap:0;display:flex}._sidebarToggle_1yueu_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_1yueu_17._mobile_1yueu_29{display:flex}._sidebarIcon_1yueu_33{stroke-width:1.6px;width:18px;height:18px}._tools_1yueu_38{gap:8px;display:flex}._history_1yueu_42{align-items:center;gap:6px;display:flex}._historyText_1yueu_47{color:var(--muted-foreground);font-size:14px;font-family:var(--font-mono)}._sidebar_1j9gh_1{background:var(--background);border-right:1px solid var(--border);z-index:10;grid-area:sidebar;width:48px;position:relative}._sidebar_1j9gh_1._mobile_1j9gh_9{transition:transform .2s ease-out;transform:translate(-110%);box-shadow:0 2px 8px #0000001a}._sidebar_1j9gh_1._mobile_1j9gh_9._open_1j9gh_14{transform:translate(0%)}._wrapper_1j9gh_19{flex-direction:column;display:flex}._item_1j9gh_23{cursor:pointer;justify-content:center;align-items:center;height:48px;transition:all .2s;display:flex;position:relative}._item_1j9gh_23 svg{width:16px;height:16px}._item_1j9gh_23:hover{background-color:var(--accent)}._item_1j9gh_23._selected_1j9gh_41{color:var(--accent-blue);background-color:var(--accent)}._item_1j9gh_23._selected_1j9gh_41: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 { Children as e, createContext as t, forwardRef as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
3
3
|
//#region \0rolldown/runtime.js
|
|
4
|
-
var
|
|
4
|
+
var d = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), f = /* @__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
|
-
}),
|
|
7
|
+
}), p = {
|
|
8
|
+
sm: 480,
|
|
9
|
+
md: 768,
|
|
10
|
+
lg: 1024,
|
|
11
|
+
xl: 1280
|
|
12
|
+
}, m = {
|
|
13
|
+
INITIAL: "initial",
|
|
14
|
+
RESIZE: "resize",
|
|
15
|
+
CROP: "crop",
|
|
16
|
+
PRESET_CROP: "presetCrop",
|
|
17
|
+
FLIP: "flip",
|
|
18
|
+
ROTATE: "rotate",
|
|
19
|
+
FILTERS: "filters"
|
|
20
|
+
}, h = {
|
|
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
|
-
},
|
|
33
|
+
}, g = (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:
|
|
40
|
+
name: m.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
|
-
}),
|
|
52
|
+
}), _ = t(void 0), v = /* @__PURE__ */ d(((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
|
-
})),
|
|
67
|
+
})), y = /* @__PURE__ */ d(((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 ===
|
|
71
|
+
if (typeof e == "function") return e.$$typeof === k ? 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
77
|
case w: return "Suspense";
|
|
56
|
-
case
|
|
57
|
-
case
|
|
78
|
+
case T: return "SuspenseList";
|
|
79
|
+
case O: 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";
|
|
@@ -63,8 +85,8 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
63
85
|
case C:
|
|
64
86
|
var n = e.render;
|
|
65
87
|
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
66
|
-
case
|
|
67
|
-
case
|
|
88
|
+
case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
89
|
+
case D:
|
|
68
90
|
n = e._payload, e = e._init;
|
|
69
91
|
try {
|
|
70
92
|
return t(e(n));
|
|
@@ -90,7 +112,7 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
90
112
|
}
|
|
91
113
|
function i(e) {
|
|
92
114
|
if (e === v) return "<>";
|
|
93
|
-
if (typeof e == "object" && e && e.$$typeof ===
|
|
115
|
+
if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
|
|
94
116
|
try {
|
|
95
117
|
var n = t(e);
|
|
96
118
|
return n ? "<" + n + ">" : "<...>";
|
|
@@ -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 =
|
|
124
|
+
var e = A.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 (
|
|
131
|
+
if (ee.call(e, "key")) {
|
|
110
132
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
111
133
|
if (t && t.isReactWarning) return !1;
|
|
112
134
|
}
|
|
@@ -114,18 +136,18 @@ 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
|
-
|
|
139
|
+
M || (M = !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
|
|
146
|
+
function l() {
|
|
125
147
|
var e = t(this.type);
|
|
126
|
-
return
|
|
148
|
+
return ne[e] || (ne[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
|
-
function
|
|
150
|
+
function u(e, t, n, r, i, a) {
|
|
129
151
|
var o = n.ref;
|
|
130
152
|
return e = {
|
|
131
153
|
$$typeof: g,
|
|
@@ -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:
|
|
163
|
+
get: l
|
|
142
164
|
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
143
165
|
configurable: !1,
|
|
144
166
|
enumerable: !1,
|
|
@@ -161,56 +183,56 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
161
183
|
value: a
|
|
162
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
163
185
|
}
|
|
164
|
-
function
|
|
186
|
+
function d(e, n, i, o, l, d) {
|
|
165
187
|
var f = n.children;
|
|
166
|
-
if (f !== void 0) if (o) if (
|
|
188
|
+
if (f !== void 0) if (o) if (te(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 (
|
|
193
|
+
if (ee.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}",
|
|
198
|
+
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ie[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), ie[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;
|
|
180
|
-
return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e),
|
|
202
|
+
return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, f, i, a(), l, d);
|
|
181
203
|
}
|
|
182
204
|
function p(e) {
|
|
183
|
-
m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof ===
|
|
205
|
+
m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
184
206
|
}
|
|
185
207
|
function m(e) {
|
|
186
208
|
return typeof e == "object" && !!e && e.$$typeof === g;
|
|
187
209
|
}
|
|
188
|
-
var h =
|
|
210
|
+
var h = f("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"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, te = Array.isArray, j = 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
|
|
216
|
+
var M, ne = {}, re = h.react_stack_bottom_frame.bind(h, o)(), N = j(i(o)), ie = {};
|
|
195
217
|
e.Fragment = v, e.jsx = function(e, t, n) {
|
|
196
|
-
var r = 1e4 >
|
|
197
|
-
return
|
|
218
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
219
|
+
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : re, r ? j(i(e)) : N);
|
|
198
220
|
}, e.jsxs = function(e, t, n) {
|
|
199
|
-
var r = 1e4 >
|
|
200
|
-
return
|
|
221
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
222
|
+
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : re, r ? j(i(e)) : N);
|
|
201
223
|
};
|
|
202
224
|
})();
|
|
203
|
-
})),
|
|
204
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
205
|
-
})))(),
|
|
206
|
-
let [
|
|
207
|
-
|
|
208
|
-
|
|
225
|
+
})), b = (/* @__PURE__ */ d(((e, t) => {
|
|
226
|
+
process.env.NODE_ENV === "production" ? t.exports = v() : t.exports = y();
|
|
227
|
+
})))(), x = ({ children: e, mimeType: t, width: n, height: r, originalBlob: i, previewUrl: a, isAlpha: s, settings: d }) => {
|
|
228
|
+
let [f, p] = u(g(t, n, r, i, a, s, d)), h = l(null);
|
|
229
|
+
o(() => () => {
|
|
230
|
+
h.current &&= (URL.revokeObjectURL(h.current), null);
|
|
209
231
|
}, []);
|
|
210
|
-
let v = (e) =>
|
|
232
|
+
let v = (e) => p((t) => ({
|
|
211
233
|
...t,
|
|
212
234
|
currentAction: e
|
|
213
|
-
})), y = (e) =>
|
|
235
|
+
})), y = (e) => p((t) => {
|
|
214
236
|
let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
|
|
215
237
|
return {
|
|
216
238
|
...t,
|
|
@@ -220,79 +242,79 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
220
242
|
pointer: n
|
|
221
243
|
}
|
|
222
244
|
};
|
|
223
|
-
}),
|
|
224
|
-
let { items: e, pointer: t } =
|
|
245
|
+
}), x = () => {
|
|
246
|
+
let { items: e, pointer: t } = f.history;
|
|
225
247
|
return e.at(t) ?? e.at(0) ?? {
|
|
226
248
|
width: 0,
|
|
227
249
|
height: 0,
|
|
228
250
|
action: {
|
|
229
|
-
name:
|
|
251
|
+
name: m.INITIAL,
|
|
230
252
|
args: null
|
|
231
253
|
}
|
|
232
254
|
};
|
|
233
|
-
},
|
|
234
|
-
let { items: e, pointer: t } =
|
|
255
|
+
}, S = () => {
|
|
256
|
+
let { items: e, pointer: t } = f.history;
|
|
235
257
|
if (e.length === 0 || t < 0) return 0;
|
|
236
|
-
let n = e.slice(0, t + 1).findLast((e) => e.action.name ===
|
|
237
|
-
return n?.action.name ===
|
|
238
|
-
},
|
|
258
|
+
let n = e.slice(0, t + 1).findLast((e) => e.action.name === m.ROTATE);
|
|
259
|
+
return n?.action.name === m.ROTATE ? n.action.args.degrees : 0;
|
|
260
|
+
}, C = () => p((e) => ({
|
|
239
261
|
...e,
|
|
240
262
|
history: {
|
|
241
263
|
items: [e.history.items[0]],
|
|
242
264
|
pointer: 0
|
|
243
265
|
}
|
|
244
|
-
})),
|
|
266
|
+
})), w = () => p((e) => e.history.pointer <= 0 ? e : {
|
|
245
267
|
...e,
|
|
246
268
|
history: {
|
|
247
269
|
...e.history,
|
|
248
270
|
pointer: e.history.pointer - 1
|
|
249
271
|
}
|
|
250
|
-
}),
|
|
272
|
+
}), T = () => p((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
|
|
251
273
|
...e,
|
|
252
274
|
history: {
|
|
253
275
|
...e.history,
|
|
254
276
|
pointer: e.history.pointer + 1
|
|
255
277
|
}
|
|
256
|
-
}),
|
|
278
|
+
}), E = (e) => p((t) => ({
|
|
257
279
|
...t,
|
|
258
280
|
sidebar: e
|
|
259
|
-
})),
|
|
260
|
-
|
|
281
|
+
})), D = c(() => new EventTarget(), []), O = (e) => {
|
|
282
|
+
h.current && URL.revokeObjectURL(h.current), h.current = URL.createObjectURL(e.previewBlob), p(g(e.mimeType, e.width, e.height, e.newBlob, h.current, e.isAlpha, d));
|
|
261
283
|
};
|
|
262
|
-
return /* @__PURE__ */ (0,
|
|
284
|
+
return /* @__PURE__ */ (0, b.jsx)(_, {
|
|
263
285
|
value: {
|
|
264
|
-
...
|
|
265
|
-
setImage:
|
|
286
|
+
...f,
|
|
287
|
+
setImage: O,
|
|
266
288
|
setCurrentAction: v,
|
|
267
|
-
getLastHistoryItem:
|
|
268
|
-
getLastRotation:
|
|
289
|
+
getLastHistoryItem: x,
|
|
290
|
+
getLastRotation: S,
|
|
269
291
|
addToHistory: y,
|
|
270
|
-
resetHistory:
|
|
271
|
-
undo:
|
|
272
|
-
redo:
|
|
273
|
-
setSidebar:
|
|
274
|
-
eventBus:
|
|
292
|
+
resetHistory: C,
|
|
293
|
+
undo: w,
|
|
294
|
+
redo: T,
|
|
295
|
+
setSidebar: E,
|
|
296
|
+
eventBus: D
|
|
275
297
|
},
|
|
276
298
|
children: e
|
|
277
299
|
});
|
|
278
|
-
},
|
|
279
|
-
function
|
|
300
|
+
}, S = "(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.`})}}})();", C = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", S], { type: "text/javascript;charset=utf-8" });
|
|
301
|
+
function w(e) {
|
|
280
302
|
let t;
|
|
281
303
|
try {
|
|
282
|
-
if (t =
|
|
304
|
+
if (t = C && (self.URL || self.webkitURL).createObjectURL(C), !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(
|
|
310
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(S), { name: e?.name });
|
|
289
311
|
}
|
|
290
312
|
}
|
|
291
313
|
//#endregion
|
|
292
314
|
//#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
|
|
293
|
-
var
|
|
294
|
-
let [
|
|
295
|
-
loading: !
|
|
315
|
+
var T = ({ src: e, skip: t = !1 }) => {
|
|
316
|
+
let [n, r] = u({
|
|
317
|
+
loading: !t,
|
|
296
318
|
error: "",
|
|
297
319
|
width: 0,
|
|
298
320
|
height: 0,
|
|
@@ -300,13 +322,13 @@ var b = (e) => {
|
|
|
300
322
|
originalBlob: null,
|
|
301
323
|
previewUrl: "",
|
|
302
324
|
isAlpha: !1
|
|
303
|
-
}), i =
|
|
304
|
-
return
|
|
305
|
-
if (!e) return;
|
|
306
|
-
let
|
|
307
|
-
return
|
|
325
|
+
}), i = l(null);
|
|
326
|
+
return o(() => {
|
|
327
|
+
if (!e || t) return;
|
|
328
|
+
let n = new w();
|
|
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),
|
|
331
|
+
t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), r({
|
|
310
332
|
loading: !1,
|
|
311
333
|
error: "",
|
|
312
334
|
mimeType: t.mimeType,
|
|
@@ -315,50 +337,38 @@ var b = (e) => {
|
|
|
315
337
|
originalBlob: t.originalBlob,
|
|
316
338
|
previewUrl: i.current,
|
|
317
339
|
isAlpha: t.isAlpha
|
|
318
|
-
})) :
|
|
340
|
+
})) : r((e) => ({
|
|
319
341
|
...e,
|
|
320
342
|
loading: !1,
|
|
321
343
|
error: t.error || "Error processing image."
|
|
322
344
|
}));
|
|
323
345
|
}, () => {
|
|
324
|
-
|
|
346
|
+
n.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
|
|
325
347
|
};
|
|
326
|
-
}, [e]),
|
|
327
|
-
},
|
|
348
|
+
}, [t, e]), n;
|
|
349
|
+
}, E = () => {
|
|
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
|
-
},
|
|
332
|
-
let [e] =
|
|
353
|
+
}, D = () => {
|
|
354
|
+
let [e] = u(() => E());
|
|
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
|
|
351
|
-
let [
|
|
352
|
-
return
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
359
|
+
function O(e, t) {
|
|
360
|
+
let [n, r] = u(!0);
|
|
361
|
+
return o(() => {
|
|
362
|
+
if (!t) return;
|
|
363
|
+
let n = new ResizeObserver(([t]) => {
|
|
364
|
+
t && r(t.contentRect.width < p[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
|
|
371
|
+
var k = {
|
|
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
|
-
},
|
|
372
|
-
...
|
|
381
|
+
}, A = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
|
|
382
|
+
...k,
|
|
373
383
|
...e,
|
|
374
|
-
children: /* @__PURE__ */ (0,
|
|
375
|
-
}),
|
|
376
|
-
...
|
|
384
|
+
children: /* @__PURE__ */ (0, b.jsx)("path", { d: "M20 6 9 17l-5-5" })
|
|
385
|
+
}), ee = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
386
|
+
...k,
|
|
377
387
|
...e,
|
|
378
|
-
children: [/* @__PURE__ */ (0,
|
|
379
|
-
}),
|
|
380
|
-
...
|
|
388
|
+
children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "m6 6 12 12" })]
|
|
389
|
+
}), te = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
390
|
+
...k,
|
|
381
391
|
...e,
|
|
382
|
-
children: [/* @__PURE__ */ (0,
|
|
392
|
+
children: [/* @__PURE__ */ (0, b.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,
|
|
390
|
-
}),
|
|
391
|
-
...
|
|
392
|
-
...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,
|
|
399
|
+
}), /* @__PURE__ */ (0, b.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
|
|
400
|
+
}), j = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
401
|
+
...k,
|
|
396
402
|
...e,
|
|
397
|
-
children: /* @__PURE__ */ (0,
|
|
398
|
-
}),
|
|
399
|
-
...
|
|
403
|
+
children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M19 12H5" })]
|
|
404
|
+
}), M = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
|
|
405
|
+
...k,
|
|
400
406
|
...e,
|
|
401
|
-
children:
|
|
402
|
-
}),
|
|
403
|
-
...
|
|
407
|
+
children: /* @__PURE__ */ (0, b.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
408
|
+
}), ne = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
409
|
+
...k,
|
|
404
410
|
...e,
|
|
405
|
-
children: [/* @__PURE__ */ (0,
|
|
406
|
-
}),
|
|
407
|
-
...
|
|
411
|
+
children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, b.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, b.jsxs)("svg", {
|
|
413
|
+
...k,
|
|
408
414
|
...e,
|
|
409
|
-
children: [/* @__PURE__ */ (0,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
r: "3"
|
|
413
|
-
})]
|
|
414
|
-
}), ae = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
|
|
415
|
-
...T,
|
|
415
|
+
children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
|
|
416
|
+
}), N = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
417
|
+
...k,
|
|
416
418
|
...e,
|
|
417
|
-
children: [/* @__PURE__ */ (0,
|
|
418
|
-
}),
|
|
419
|
-
...
|
|
419
|
+
children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
|
|
420
|
+
}), ie = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
421
|
+
...k,
|
|
420
422
|
...e,
|
|
421
423
|
children: [
|
|
422
|
-
/* @__PURE__ */ (0,
|
|
424
|
+
/* @__PURE__ */ (0, b.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,
|
|
432
|
+
/* @__PURE__ */ (0, b.jsx)("circle", {
|
|
431
433
|
cx: "9",
|
|
432
434
|
cy: "9",
|
|
433
435
|
r: "2"
|
|
434
436
|
}),
|
|
435
|
-
/* @__PURE__ */ (0,
|
|
437
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
436
438
|
]
|
|
437
|
-
}),
|
|
438
|
-
...
|
|
439
|
+
}), ae = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
|
|
440
|
+
...k,
|
|
439
441
|
...e,
|
|
440
|
-
children: /* @__PURE__ */ (0,
|
|
442
|
+
children: /* @__PURE__ */ (0, b.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
|
-
}),
|
|
448
|
-
...
|
|
449
|
+
}), oe = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
|
|
450
|
+
...k,
|
|
451
|
+
...e,
|
|
452
|
+
children: /* @__PURE__ */ (0, b.jsx)("rect", {
|
|
453
|
+
width: "20",
|
|
454
|
+
height: "12",
|
|
455
|
+
x: "2",
|
|
456
|
+
y: "6",
|
|
457
|
+
rx: "2"
|
|
458
|
+
})
|
|
459
|
+
}), se = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
|
|
460
|
+
...k,
|
|
461
|
+
...e,
|
|
462
|
+
children: /* @__PURE__ */ (0, b.jsx)("rect", {
|
|
463
|
+
width: "20",
|
|
464
|
+
height: "15",
|
|
465
|
+
x: "2",
|
|
466
|
+
y: "4.5",
|
|
467
|
+
rx: "2"
|
|
468
|
+
})
|
|
469
|
+
}), ce = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
470
|
+
...k,
|
|
449
471
|
...e,
|
|
450
472
|
children: [
|
|
451
|
-
/* @__PURE__ */ (0,
|
|
452
|
-
/* @__PURE__ */ (0,
|
|
453
|
-
/* @__PURE__ */ (0,
|
|
454
|
-
/* @__PURE__ */ (0,
|
|
455
|
-
/* @__PURE__ */ (0,
|
|
473
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
474
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
|
|
475
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
|
|
476
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
|
|
477
|
+
/* @__PURE__ */ (0, b.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,
|
|
464
|
-
...
|
|
485
|
+
}), le = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
486
|
+
...k,
|
|
465
487
|
...e,
|
|
466
488
|
children: [
|
|
467
|
-
/* @__PURE__ */ (0,
|
|
468
|
-
/* @__PURE__ */ (0,
|
|
469
|
-
/* @__PURE__ */ (0,
|
|
470
|
-
/* @__PURE__ */ (0,
|
|
471
|
-
/* @__PURE__ */ (0,
|
|
472
|
-
/* @__PURE__ */ (0,
|
|
489
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
|
|
490
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
|
|
491
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M12 20v2" }),
|
|
492
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M12 14v2" }),
|
|
493
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M12 8v2" }),
|
|
494
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M12 2v2" })
|
|
473
495
|
]
|
|
474
|
-
}), ue = (e) => /* @__PURE__ */ (0,
|
|
475
|
-
...
|
|
496
|
+
}), ue = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
497
|
+
...k,
|
|
476
498
|
...e,
|
|
477
499
|
children: [
|
|
478
|
-
/* @__PURE__ */ (0,
|
|
479
|
-
/* @__PURE__ */ (0,
|
|
480
|
-
/* @__PURE__ */ (0,
|
|
481
|
-
/* @__PURE__ */ (0,
|
|
482
|
-
/* @__PURE__ */ (0,
|
|
483
|
-
/* @__PURE__ */ (0,
|
|
500
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
|
|
501
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
|
|
502
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M4 12H2" }),
|
|
503
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M10 12H8" }),
|
|
504
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M16 12h-2" }),
|
|
505
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M22 12h-2" })
|
|
506
|
+
]
|
|
507
|
+
}), de = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
508
|
+
...k,
|
|
509
|
+
...e,
|
|
510
|
+
children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M21 3v5h-5" })]
|
|
511
|
+
}), fe = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
512
|
+
...k,
|
|
513
|
+
...e,
|
|
514
|
+
children: [/* @__PURE__ */ (0, b.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, b.jsx)("path", { d: "M3 3v5h5" })]
|
|
515
|
+
}), pe = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
516
|
+
...k,
|
|
517
|
+
...e,
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ (0, b.jsx)("rect", {
|
|
520
|
+
width: "7",
|
|
521
|
+
height: "7",
|
|
522
|
+
x: "3",
|
|
523
|
+
y: "3",
|
|
524
|
+
rx: "1"
|
|
525
|
+
}),
|
|
526
|
+
/* @__PURE__ */ (0, b.jsx)("rect", {
|
|
527
|
+
width: "7",
|
|
528
|
+
height: "7",
|
|
529
|
+
x: "3",
|
|
530
|
+
y: "14",
|
|
531
|
+
rx: "1"
|
|
532
|
+
}),
|
|
533
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M14 4h7" }),
|
|
534
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M14 9h7" }),
|
|
535
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M14 15h7" }),
|
|
536
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M14 20h7" })
|
|
484
537
|
]
|
|
485
|
-
}),
|
|
486
|
-
...
|
|
538
|
+
}), me = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
539
|
+
...k,
|
|
487
540
|
...e,
|
|
488
|
-
children: [
|
|
489
|
-
|
|
490
|
-
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ (0, b.jsx)("rect", {
|
|
543
|
+
width: "18",
|
|
544
|
+
height: "18",
|
|
545
|
+
x: "3",
|
|
546
|
+
y: "3",
|
|
547
|
+
rx: "2"
|
|
548
|
+
}),
|
|
549
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M9 3v18" }),
|
|
550
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "m14 9 3 3-3 3" })
|
|
551
|
+
]
|
|
552
|
+
}), he = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
|
|
553
|
+
...k,
|
|
491
554
|
...e,
|
|
492
|
-
children: [
|
|
493
|
-
|
|
494
|
-
|
|
555
|
+
children: [
|
|
556
|
+
/* @__PURE__ */ (0, b.jsx)("rect", {
|
|
557
|
+
width: "18",
|
|
558
|
+
height: "18",
|
|
559
|
+
x: "3",
|
|
560
|
+
y: "3",
|
|
561
|
+
rx: "2"
|
|
562
|
+
}),
|
|
563
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "M9 3v18" }),
|
|
564
|
+
/* @__PURE__ */ (0, b.jsx)("path", { d: "m16 15-3-3 3-3" })
|
|
565
|
+
]
|
|
566
|
+
}), ge = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
|
|
567
|
+
...k,
|
|
495
568
|
...e,
|
|
496
|
-
children: /* @__PURE__ */ (0,
|
|
569
|
+
children: /* @__PURE__ */ (0, b.jsx)("path", {
|
|
497
570
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
498
|
-
children: /* @__PURE__ */ (0,
|
|
571
|
+
children: /* @__PURE__ */ (0, b.jsx)("animateTransform", {
|
|
499
572
|
attributeType: "xml",
|
|
500
573
|
attributeName: "transform",
|
|
501
574
|
type: "rotate",
|
|
@@ -505,218 +578,300 @@ var T = {
|
|
|
505
578
|
repeatCount: "indefinite"
|
|
506
579
|
})
|
|
507
580
|
})
|
|
508
|
-
}),
|
|
509
|
-
let e =
|
|
581
|
+
}), P = () => {
|
|
582
|
+
let e = a(_);
|
|
510
583
|
if (!e) throw Error("usePixediContext must be used within an PixediProvider");
|
|
511
584
|
return e;
|
|
512
|
-
},
|
|
513
|
-
button: "
|
|
514
|
-
default: "
|
|
515
|
-
outline: "
|
|
516
|
-
ghost: "
|
|
517
|
-
rect: "
|
|
518
|
-
},
|
|
585
|
+
}, F = {
|
|
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
|
+
}, I = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, b.jsx)("button", {
|
|
519
592
|
ref: r,
|
|
520
|
-
className: `${
|
|
593
|
+
className: `${F.button} ${F[t]} ${e}`.trim(),
|
|
521
594
|
...i,
|
|
522
595
|
children: n
|
|
523
|
-
}),
|
|
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
|
+
}), _e = { separator: "_separator_gp8ff_1" }, ve = n(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, b.jsx)("hr", {
|
|
547
597
|
ref: r,
|
|
548
598
|
role: "separator",
|
|
549
599
|
"aria-orientation": t,
|
|
550
600
|
"data-orientation": t,
|
|
551
|
-
className: `${
|
|
601
|
+
className: `${_e.separator} ${e}`.trim(),
|
|
552
602
|
...n
|
|
553
603
|
}));
|
|
554
|
-
|
|
555
|
-
var
|
|
556
|
-
wrapper: "
|
|
557
|
-
trigger: "
|
|
558
|
-
triggerArrow: "
|
|
559
|
-
content: "
|
|
560
|
-
groupLabel: "
|
|
561
|
-
item: "
|
|
562
|
-
itemLeft: "
|
|
563
|
-
itemAddon: "
|
|
564
|
-
itemRightContainer: "
|
|
565
|
-
itemRight: "
|
|
566
|
-
itemCheck: "
|
|
567
|
-
},
|
|
568
|
-
|
|
604
|
+
ve.displayName = "Separator";
|
|
605
|
+
var L = {
|
|
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
|
+
}, R = {
|
|
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
|
+
}, ye = (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
|
+
}, be = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: i = "", renderOption: a }) => {
|
|
644
|
+
let [d, f] = u(!1), p = l(null), m = l(null), h = l(null), g = c(() => {
|
|
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
|
-
|
|
651
|
+
o(() => {
|
|
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
|
-
}, []),
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
656
|
+
}, []), s(() => {
|
|
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 } = ye(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
|
|
663
|
+
let _ = (e) => {
|
|
586
664
|
n(e), f(!1);
|
|
587
665
|
};
|
|
588
|
-
return /* @__PURE__ */ (0,
|
|
666
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
589
667
|
ref: p,
|
|
590
|
-
className: `${
|
|
668
|
+
className: `${L.wrapper} ${i}`.trim(),
|
|
591
669
|
"data-state": d ? "open" : "closed",
|
|
592
|
-
children: [/* @__PURE__ */ (0,
|
|
670
|
+
children: [/* @__PURE__ */ (0, b.jsxs)("button", {
|
|
593
671
|
ref: m,
|
|
594
672
|
type: "button",
|
|
595
|
-
className:
|
|
673
|
+
className: L.trigger,
|
|
596
674
|
onClick: () => f(!d),
|
|
597
|
-
children: [/* @__PURE__ */ (0,
|
|
598
|
-
}), /* @__PURE__ */ (0,
|
|
599
|
-
ref:
|
|
600
|
-
className:
|
|
601
|
-
children: e.map((e, n) => e.options ? /* @__PURE__ */ (0,
|
|
602
|
-
className: `${
|
|
675
|
+
children: [/* @__PURE__ */ (0, b.jsx)("span", { children: g ? g.fullName : r }), /* @__PURE__ */ (0, b.jsx)(M, { className: L.triggerArrow })]
|
|
676
|
+
}), /* @__PURE__ */ (0, b.jsx)("div", {
|
|
677
|
+
ref: h,
|
|
678
|
+
className: L.content,
|
|
679
|
+
children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, b.jsxs)("div", { children: [/* @__PURE__ */ (0, b.jsx)("div", {
|
|
680
|
+
className: `${L.groupLabel} ${R.semibold}`,
|
|
603
681
|
children: e.label
|
|
604
|
-
}), e.options.map((e) => /* @__PURE__ */ (0,
|
|
605
|
-
className:
|
|
606
|
-
onClick: () =>
|
|
607
|
-
children: [
|
|
608
|
-
className:
|
|
682
|
+
}), e.options.map((e) => /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
683
|
+
className: L.item,
|
|
684
|
+
onClick: () => _(e.value),
|
|
685
|
+
children: [a ? a(e) : /* @__PURE__ */ (0, b.jsx)("span", {
|
|
686
|
+
className: L.itemLeft,
|
|
609
687
|
children: e.label
|
|
610
|
-
}), /* @__PURE__ */ (0,
|
|
611
|
-
className:
|
|
688
|
+
}), /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
689
|
+
className: L.itemAddon,
|
|
612
690
|
children: [
|
|
613
|
-
e.rightLabel && /* @__PURE__ */ (0,
|
|
614
|
-
t === e.value && /* @__PURE__ */ (0,
|
|
615
|
-
t !== e.value && /* @__PURE__ */ (0,
|
|
691
|
+
e.rightLabel && /* @__PURE__ */ (0, b.jsx)("span", { children: e.rightLabel }),
|
|
692
|
+
t === e.value && /* @__PURE__ */ (0, b.jsx)(A, { className: L.itemCheck }),
|
|
693
|
+
t !== e.value && /* @__PURE__ */ (0, b.jsx)("b", {})
|
|
616
694
|
]
|
|
617
695
|
})]
|
|
618
|
-
}, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0,
|
|
619
|
-
className:
|
|
620
|
-
onClick: () =>
|
|
621
|
-
children: [
|
|
622
|
-
className:
|
|
696
|
+
}, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
697
|
+
className: L.item,
|
|
698
|
+
onClick: () => _(e.value),
|
|
699
|
+
children: [a ? a(e) : /* @__PURE__ */ (0, b.jsx)("span", {
|
|
700
|
+
className: L.itemLeft,
|
|
623
701
|
children: e.label
|
|
624
|
-
}), t === e.value && /* @__PURE__ */ (0,
|
|
702
|
+
}), t === e.value && /* @__PURE__ */ (0, b.jsx)(A, { className: L.itemCheck })]
|
|
625
703
|
}, e.value))
|
|
626
704
|
})]
|
|
627
705
|
});
|
|
628
|
-
},
|
|
629
|
-
input: "
|
|
630
|
-
numberClean: "
|
|
631
|
-
},
|
|
632
|
-
let a = t === "number" && n ?
|
|
633
|
-
return /* @__PURE__ */ (0,
|
|
706
|
+
}, xe = {
|
|
707
|
+
input: "_input_kyavx_1",
|
|
708
|
+
numberClean: "_numberClean_kyavx_39"
|
|
709
|
+
}, Se = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
|
|
710
|
+
let a = t === "number" && n ? xe.numberClean : "";
|
|
711
|
+
return /* @__PURE__ */ (0, b.jsx)("input", {
|
|
634
712
|
ref: r,
|
|
635
713
|
type: t,
|
|
636
|
-
className: `${
|
|
714
|
+
className: `${xe.input} ${a} ${e}`.trim(),
|
|
637
715
|
...i
|
|
638
716
|
});
|
|
639
|
-
},
|
|
717
|
+
}, Ce = {
|
|
640
718
|
container: "_container_14vsv_1",
|
|
641
719
|
legend: "_legend_14vsv_4",
|
|
642
720
|
suffix: "_suffix_14vsv_13"
|
|
643
|
-
},
|
|
644
|
-
className: `${
|
|
721
|
+
}, we = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
722
|
+
className: `${Ce.container} ${t}`.trim(),
|
|
645
723
|
style: n,
|
|
646
724
|
children: [
|
|
647
|
-
/* @__PURE__ */ (0,
|
|
648
|
-
className:
|
|
725
|
+
/* @__PURE__ */ (0, b.jsx)("span", {
|
|
726
|
+
className: Ce.legend,
|
|
649
727
|
children: e
|
|
650
728
|
}),
|
|
651
|
-
/* @__PURE__ */ (0,
|
|
729
|
+
/* @__PURE__ */ (0, b.jsx)(Se, {
|
|
652
730
|
ref: r,
|
|
653
731
|
type: "number",
|
|
654
732
|
...i
|
|
655
733
|
}),
|
|
656
|
-
/* @__PURE__ */ (0,
|
|
657
|
-
className:
|
|
734
|
+
/* @__PURE__ */ (0, b.jsx)("span", {
|
|
735
|
+
className: Ce.suffix,
|
|
658
736
|
children: "px"
|
|
659
737
|
})
|
|
660
738
|
]
|
|
661
|
-
}),
|
|
662
|
-
group: "
|
|
663
|
-
save: "
|
|
664
|
-
close: "
|
|
665
|
-
},
|
|
666
|
-
className:
|
|
667
|
-
children: [/* @__PURE__ */ (0,
|
|
739
|
+
}), Te = {
|
|
740
|
+
group: "_group_1e7jm_1",
|
|
741
|
+
save: "_save_1e7jm_6",
|
|
742
|
+
close: "_close_1e7jm_13"
|
|
743
|
+
}, z = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
744
|
+
className: Te.group,
|
|
745
|
+
children: [/* @__PURE__ */ (0, b.jsx)(I, {
|
|
668
746
|
variant: "outline",
|
|
669
|
-
className:
|
|
747
|
+
className: Te.save,
|
|
748
|
+
"aria-label": "Save",
|
|
670
749
|
disabled: r || n,
|
|
671
750
|
onClick: e,
|
|
672
|
-
children: n ? /* @__PURE__ */ (0,
|
|
673
|
-
}), /* @__PURE__ */ (0,
|
|
751
|
+
children: n ? /* @__PURE__ */ (0, b.jsx)(ge, {}) : /* @__PURE__ */ (0, b.jsx)(A, {})
|
|
752
|
+
}), /* @__PURE__ */ (0, b.jsx)(I, {
|
|
674
753
|
variant: "outline",
|
|
675
|
-
className:
|
|
754
|
+
className: Te.close,
|
|
755
|
+
"aria-label": "Close",
|
|
676
756
|
disabled: n,
|
|
677
757
|
onClick: t,
|
|
678
|
-
children: /* @__PURE__ */ (0,
|
|
758
|
+
children: /* @__PURE__ */ (0, b.jsx)(ee, {})
|
|
679
759
|
})]
|
|
680
|
-
}),
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
760
|
+
}), B = {
|
|
761
|
+
tooltip: "_tooltip_gohf2_1",
|
|
762
|
+
container: "_container_gohf2_5",
|
|
763
|
+
popup: "_popup_gohf2_18",
|
|
764
|
+
animated: "_animated_gohf2_62",
|
|
765
|
+
mask: "_mask_gohf2_71",
|
|
766
|
+
track: "_track_gohf2_78",
|
|
767
|
+
title: "_title_gohf2_94"
|
|
768
|
+
}, Ee = (t, n = "horizontal") => {
|
|
769
|
+
let [i, a] = u(null), [d, f] = u(null), [p, m] = u(!1), [h, g] = u(!1), [_, v] = u([]), y = l(null), b = l(null), x = l([]), S = n === "vertical", C = c(() => {
|
|
770
|
+
let n = [];
|
|
771
|
+
return e.forEach(t, (e) => {
|
|
772
|
+
if (r(e)) {
|
|
773
|
+
let { "data-tooltip": t } = e.props;
|
|
774
|
+
t && n.push(t);
|
|
775
|
+
}
|
|
776
|
+
}), n;
|
|
777
|
+
}, [t]), w = C.join("\0"), T = C.length;
|
|
778
|
+
s(() => {
|
|
779
|
+
let e = () => {
|
|
780
|
+
let e = x.current.slice(0, T).map((e) => ({
|
|
781
|
+
w: e?.offsetWidth ?? 0,
|
|
782
|
+
h: e?.offsetHeight ?? 0
|
|
783
|
+
}));
|
|
784
|
+
v((t) => t.length === e.length && t.every((t, n) => t.w === e[n].w && t.h === e[n].h) ? t : e);
|
|
785
|
+
};
|
|
786
|
+
e();
|
|
787
|
+
let t = b.current;
|
|
788
|
+
if (!t || typeof ResizeObserver > "u") return;
|
|
789
|
+
let n = new ResizeObserver(e);
|
|
790
|
+
return n.observe(t), () => n.disconnect();
|
|
791
|
+
}, [w, T]), o(() => {
|
|
792
|
+
if (!p || h) return;
|
|
793
|
+
let e = 0, t = requestAnimationFrame(() => {
|
|
794
|
+
e = requestAnimationFrame(() => g(!0));
|
|
795
|
+
});
|
|
796
|
+
return () => {
|
|
797
|
+
cancelAnimationFrame(t), cancelAnimationFrame(e);
|
|
798
|
+
};
|
|
799
|
+
}, [p, h]);
|
|
800
|
+
let E = (e) => {
|
|
801
|
+
let t = e.target.closest("[data-tooltip]");
|
|
802
|
+
if (!t) {
|
|
803
|
+
m(!1);
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
let n = t.parentElement;
|
|
807
|
+
if (!n) return;
|
|
808
|
+
let r = Array.from(n.children).indexOf(t);
|
|
809
|
+
if (r === -1 || p && r === i) return;
|
|
810
|
+
let o = y.current?.getBoundingClientRect();
|
|
811
|
+
if (!o) return;
|
|
812
|
+
let s = t.getBoundingClientRect(), c = S ? {
|
|
813
|
+
x: s.right - o.left + 4,
|
|
814
|
+
y: s.top - o.top + s.height / 2
|
|
815
|
+
} : {
|
|
816
|
+
x: s.left - o.left + s.width / 2,
|
|
817
|
+
y: s.top - o.top - 8
|
|
818
|
+
};
|
|
819
|
+
p || g(!1), f(c), a(r), m(!0);
|
|
820
|
+
}, D = () => m(!1), O = i ?? 0, k = _[O], A = _.slice(0, O).reduce((e, t) => e + (S ? t.h : t.w), 0);
|
|
821
|
+
return {
|
|
822
|
+
containerRef: y,
|
|
823
|
+
trackRef: b,
|
|
824
|
+
titleRefs: x,
|
|
825
|
+
titles: C,
|
|
826
|
+
isVertical: S,
|
|
827
|
+
isVisible: p,
|
|
828
|
+
isAnimated: h,
|
|
829
|
+
cssVars: {
|
|
830
|
+
"--tooltip-x": d ? `${d.x}px` : "0px",
|
|
831
|
+
"--tooltip-y": d ? `${d.y}px` : "0px",
|
|
832
|
+
"--tooltip-opacity": p ? "1" : "0",
|
|
833
|
+
"--tooltip-w": k?.w ? `${k.w}px` : "auto",
|
|
834
|
+
"--tooltip-h": k?.h ? `${k.h}px` : "auto",
|
|
835
|
+
"--tooltip-offset": `${A}px`
|
|
836
|
+
},
|
|
837
|
+
handleMouseMove: E,
|
|
838
|
+
handleMouseLeave: D
|
|
839
|
+
};
|
|
840
|
+
}, V = ({ children: e, orientation: t = "horizontal", className: n = "", classNameTitle: r = "" }) => {
|
|
841
|
+
let { containerRef: i, trackRef: a, titleRefs: o, titles: s, isVertical: c, isAnimated: l, cssVars: u, handleMouseMove: d, handleMouseLeave: f } = Ee(e, t);
|
|
842
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
843
|
+
ref: i,
|
|
844
|
+
onMouseMove: d,
|
|
845
|
+
onMouseLeave: f,
|
|
846
|
+
onBlur: f,
|
|
847
|
+
className: B.tooltip,
|
|
848
|
+
style: u,
|
|
849
|
+
children: [/* @__PURE__ */ (0, b.jsx)("div", {
|
|
850
|
+
"data-orientation": c ? "vertical" : "horizontal",
|
|
851
|
+
className: B.container,
|
|
852
|
+
children: e
|
|
853
|
+
}), /* @__PURE__ */ (0, b.jsx)("div", {
|
|
854
|
+
"aria-hidden": "true",
|
|
855
|
+
"data-orientation": c ? "vertical" : "horizontal",
|
|
856
|
+
className: `${B.popup} ${l ? B.animated : ""} ${n}`,
|
|
857
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
858
|
+
className: B.mask,
|
|
859
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
860
|
+
ref: a,
|
|
861
|
+
"data-orientation": c ? "vertical" : "horizontal",
|
|
862
|
+
className: B.track,
|
|
863
|
+
children: s.map((e, t) => /* @__PURE__ */ (0, b.jsx)("div", {
|
|
864
|
+
ref: (e) => {
|
|
865
|
+
o.current[t] = e;
|
|
866
|
+
},
|
|
867
|
+
className: `${B.title} ${r}`,
|
|
868
|
+
children: e
|
|
869
|
+
}, t))
|
|
870
|
+
})
|
|
871
|
+
})
|
|
717
872
|
})]
|
|
718
873
|
});
|
|
719
|
-
},
|
|
874
|
+
}, De = 1920, Oe = .85, ke = [
|
|
720
875
|
{
|
|
721
876
|
label: "Facebook",
|
|
722
877
|
value: "facebook",
|
|
@@ -819,13 +974,13 @@ var I = {
|
|
|
819
974
|
}
|
|
820
975
|
]
|
|
821
976
|
}
|
|
822
|
-
],
|
|
977
|
+
], H = 32, Ae = (e, t, n, r, i, a, o, s, c, l) => {
|
|
823
978
|
let { x: u, y: d, w: f, h: p } = c;
|
|
824
979
|
if (e) {
|
|
825
980
|
let e = o - c.w - c.x;
|
|
826
|
-
u += i - n, u < 0 && (u = 0), f = o - u - e, f <
|
|
981
|
+
u += i - n, u < 0 && (u = 0), f = o - u - e, f < H && (f = H, u = o - e - H);
|
|
827
982
|
let t = s - p - d;
|
|
828
|
-
d += a - r, d < 0 && (d = 0), p = s - d - t, p <
|
|
983
|
+
d += a - r, d < 0 && (d = 0), p = s - d - t, p < H && (p = H, d = s - t - H);
|
|
829
984
|
} else {
|
|
830
985
|
if (t >= 1) {
|
|
831
986
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -834,7 +989,7 @@ var I = {
|
|
|
834
989
|
let e = a - r, n = Math.round(e * t);
|
|
835
990
|
f -= n, p -= e, u += n, d += e;
|
|
836
991
|
}
|
|
837
|
-
if (u < 0 || d < 0 || f <
|
|
992
|
+
if (u < 0 || d < 0 || f < H || p < H) return l;
|
|
838
993
|
}
|
|
839
994
|
return {
|
|
840
995
|
x: u,
|
|
@@ -842,12 +997,12 @@ var I = {
|
|
|
842
997
|
w: f,
|
|
843
998
|
h: p
|
|
844
999
|
};
|
|
845
|
-
},
|
|
1000
|
+
}, je = (e, t, n, r, i, a, o, s, c, l) => {
|
|
846
1001
|
let { x: u } = c, { y: d, w: f, h: p } = c;
|
|
847
1002
|
if (e) {
|
|
848
|
-
f += i - n, f + u > o && (f = o - u), f <
|
|
1003
|
+
f += i - n, f + u > o && (f = o - u), f < H && (f = H);
|
|
849
1004
|
let e = s - p - d;
|
|
850
|
-
d += a - r, d < 0 && (d = 0), p = s - d - e, p <
|
|
1005
|
+
d += a - r, d < 0 && (d = 0), p = s - d - e, p < H && (p = H, d = s - e - H);
|
|
851
1006
|
} else {
|
|
852
1007
|
if (t > 1) {
|
|
853
1008
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -856,7 +1011,7 @@ var I = {
|
|
|
856
1011
|
let e = a - r, n = Math.round(e * t);
|
|
857
1012
|
f -= n, p -= e, d += e;
|
|
858
1013
|
}
|
|
859
|
-
if (f + u > o || d < 0 || f <
|
|
1014
|
+
if (f + u > o || d < 0 || f < H || p < H) return l;
|
|
860
1015
|
}
|
|
861
1016
|
return {
|
|
862
1017
|
x: u,
|
|
@@ -864,12 +1019,12 @@ var I = {
|
|
|
864
1019
|
w: f,
|
|
865
1020
|
h: p
|
|
866
1021
|
};
|
|
867
|
-
},
|
|
1022
|
+
}, Me = (e, t, n, r, i, a, o, s, c, l) => {
|
|
868
1023
|
let { y: u } = c, { x: d, w: f, h: p } = c;
|
|
869
1024
|
if (e) {
|
|
870
|
-
p += a - r, p + u > s && (p = s - u), p <
|
|
1025
|
+
p += a - r, p + u > s && (p = s - u), p < H && (p = H);
|
|
871
1026
|
let e = o - c.w - c.x;
|
|
872
|
-
d += i - n, d < 0 && (d = 0), f = o - d - e, f <
|
|
1027
|
+
d += i - n, d < 0 && (d = 0), f = o - d - e, f < H && (f = H, d = o - e - H);
|
|
873
1028
|
} else {
|
|
874
1029
|
if (t >= 1) {
|
|
875
1030
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -878,7 +1033,7 @@ var I = {
|
|
|
878
1033
|
let e = a - r, n = Math.round(e * t);
|
|
879
1034
|
f += n, p += e, d -= n;
|
|
880
1035
|
}
|
|
881
|
-
if (p + u > s || d < 0 || f <
|
|
1036
|
+
if (p + u > s || d < 0 || f < H || p < H) return l;
|
|
882
1037
|
}
|
|
883
1038
|
return {
|
|
884
1039
|
x: d,
|
|
@@ -886,9 +1041,9 @@ var I = {
|
|
|
886
1041
|
w: f,
|
|
887
1042
|
h: p
|
|
888
1043
|
};
|
|
889
|
-
},
|
|
1044
|
+
}, Ne = (e, t, n, r, i, a, o, s, c, l) => {
|
|
890
1045
|
let { x: u, y: d } = c, { w: f, h: p } = c;
|
|
891
|
-
if (e) f += i - n, f + u > o && (f = o - u), f <
|
|
1046
|
+
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
1047
|
else {
|
|
893
1048
|
if (t >= 1) {
|
|
894
1049
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -897,7 +1052,7 @@ var I = {
|
|
|
897
1052
|
let e = a - r, n = Math.round(e * t);
|
|
898
1053
|
f += n, p += e;
|
|
899
1054
|
}
|
|
900
|
-
if (p + d > s || f + u > o || f <
|
|
1055
|
+
if (p + d > s || f + u > o || f < H || p < H) return l;
|
|
901
1056
|
}
|
|
902
1057
|
return {
|
|
903
1058
|
x: u,
|
|
@@ -905,30 +1060,34 @@ var I = {
|
|
|
905
1060
|
w: f,
|
|
906
1061
|
h: p
|
|
907
1062
|
};
|
|
908
|
-
},
|
|
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(
|
|
1063
|
+
}, Pe = (e, t, n, r, i, a, o, s, c) => {
|
|
1064
|
+
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
1065
|
return {
|
|
911
1066
|
x: l ? d - b : c.x,
|
|
912
1067
|
y: u ? f - x : c.y,
|
|
913
1068
|
w: b,
|
|
914
1069
|
h: x
|
|
915
1070
|
};
|
|
916
|
-
},
|
|
1071
|
+
}, Fe = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Ae(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? je(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Me(t, n, r, i, a, o, s, c, l, u) : e === "br" ? Ne(t, n, r, i, a, o, s, c, l, u) : {
|
|
917
1072
|
x: 0,
|
|
918
1073
|
y: 0,
|
|
919
1074
|
w: 0,
|
|
920
1075
|
h: 0
|
|
921
|
-
} :
|
|
1076
|
+
} : Pe(e, n, r, i, a, o, s, c, l), U = (e, t, n) => {
|
|
922
1077
|
let r = .12, i = t / n, a = 0, o = 0;
|
|
923
1078
|
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;
|
|
1079
|
+
let s = a / t * 100, c = o / n * 100, l = (t - a) / 2 / t * 100, u = (n - o) / 2 / n * 100;
|
|
925
1080
|
return {
|
|
926
|
-
x:
|
|
927
|
-
y:
|
|
1081
|
+
x: l,
|
|
1082
|
+
y: u,
|
|
928
1083
|
w: s,
|
|
929
|
-
h: c
|
|
1084
|
+
h: c,
|
|
1085
|
+
xP: Math.round(l / 100 * t),
|
|
1086
|
+
yP: Math.round(u / 100 * n),
|
|
1087
|
+
wP: Math.round(s / 100 * t),
|
|
1088
|
+
hP: Math.round(c / 100 * n)
|
|
930
1089
|
};
|
|
931
|
-
},
|
|
1090
|
+
}, Ie = (e, t, n, r) => {
|
|
932
1091
|
let i = e.w / 100 * n, a = e.h / 100 * r;
|
|
933
1092
|
t >= 1 ? a = i / t : i = a * t;
|
|
934
1093
|
let o = i / n * 100, s = a / r * 100, c = Math.max(o / (100 - e.x), s / (100 - e.y), 1);
|
|
@@ -937,21 +1096,21 @@ var I = {
|
|
|
937
1096
|
w: o,
|
|
938
1097
|
h: s
|
|
939
1098
|
};
|
|
940
|
-
},
|
|
1099
|
+
}, W = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Le = (e, t, n, r) => W(n) === W(r) ? {
|
|
941
1100
|
width: e,
|
|
942
1101
|
height: t
|
|
943
1102
|
} : {
|
|
944
1103
|
width: t,
|
|
945
1104
|
height: e
|
|
946
|
-
},
|
|
947
|
-
let { width: t, height: n } = e, r = Math.min(1,
|
|
1105
|
+
}, Re = async (e) => {
|
|
1106
|
+
let { width: t, height: n } = e, r = Math.min(1, De / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
|
|
948
1107
|
if (!s) throw Error("Failed to get 2D context for preview canvas");
|
|
949
1108
|
return s.drawImage(e, 0, 0, i, a), o.convertToBlob({
|
|
950
1109
|
type: "image/webp",
|
|
951
|
-
quality:
|
|
1110
|
+
quality: Oe
|
|
952
1111
|
});
|
|
953
1112
|
};
|
|
954
|
-
function
|
|
1113
|
+
function ze(e) {
|
|
955
1114
|
let t = new OffscreenCanvas(e.width, e.height), n = t.getContext("2d");
|
|
956
1115
|
if (!n) throw Error("Failed to create 2D context for canvas.");
|
|
957
1116
|
n.drawImage(e, 0, 0);
|
|
@@ -965,14 +1124,14 @@ function Ie(e) {
|
|
|
965
1124
|
}
|
|
966
1125
|
//#endregion
|
|
967
1126
|
//#region src/shared/components/Pixedi/utils/imageProcessor.ts
|
|
968
|
-
var
|
|
1127
|
+
var Be = (e) => new Promise((t, n) => {
|
|
969
1128
|
let r = new FileReader();
|
|
970
1129
|
r.onloadend = () => {
|
|
971
1130
|
let e = r.result;
|
|
972
1131
|
typeof e == "string" ? t(e) : n(/* @__PURE__ */ Error("Failed to read blob as base64"));
|
|
973
1132
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("FileReader error")), r.readAsDataURL(e);
|
|
974
1133
|
});
|
|
975
|
-
async function
|
|
1134
|
+
async function Ve(e) {
|
|
976
1135
|
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
1136
|
i.width = t.width, i.height = t.height, a?.drawImage(t, 0, 0), t.close();
|
|
978
1137
|
let o = () => {
|
|
@@ -1007,7 +1166,7 @@ async function Re(e) {
|
|
|
1007
1166
|
}, a, t) : i.toBlob((t) => {
|
|
1008
1167
|
t ? e(t) : o(/* @__PURE__ */ Error("Failed to encode image as image/png"));
|
|
1009
1168
|
}, "image/png");
|
|
1010
|
-
}), s = await createImageBitmap(o), c = await
|
|
1169
|
+
}), s = await createImageBitmap(o), c = await Re(s), { width: l, height: u } = s, d = ze(s);
|
|
1011
1170
|
return s.close(), {
|
|
1012
1171
|
newBlob: o,
|
|
1013
1172
|
previewBlob: c,
|
|
@@ -1021,17 +1180,17 @@ async function Re(e) {
|
|
|
1021
1180
|
}
|
|
1022
1181
|
//#endregion
|
|
1023
1182
|
//#region src/shared/components/Pixedi/utils/preview.ts
|
|
1024
|
-
var
|
|
1025
|
-
switch (
|
|
1183
|
+
var G = (e, t, n) => Math.max(t, Math.min(n, e)), He = (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]]], Ue = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, We = (e) => {
|
|
1184
|
+
switch (Ue(e)) {
|
|
1026
1185
|
case 90: return [[0, -1], [1, 0]];
|
|
1027
1186
|
case 180: return [[-1, 0], [0, -1]];
|
|
1028
1187
|
case 270: return [[0, 1], [-1, 0]];
|
|
1029
1188
|
default: return [[1, 0], [0, 1]];
|
|
1030
1189
|
}
|
|
1031
|
-
},
|
|
1032
|
-
let r =
|
|
1190
|
+
}, Ge = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], Ke = (e, t, n) => He(Ge(t, n), We(-e)), qe = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], K = (e, t, n) => {
|
|
1191
|
+
let r = qe(e);
|
|
1033
1192
|
return [e[0][0] * t + e[0][1] * n + r[0], e[1][0] * t + e[1][1] * n + r[1]];
|
|
1034
|
-
},
|
|
1193
|
+
}, Je = (e) => {
|
|
1035
1194
|
let t = 1, n = 1, r = {
|
|
1036
1195
|
x: 0,
|
|
1037
1196
|
y: 0,
|
|
@@ -1040,18 +1199,18 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
|
|
|
1040
1199
|
}, i = 0, a = !1, o = !1;
|
|
1041
1200
|
for (let s = 0; s < e.length; s++) {
|
|
1042
1201
|
let c = e[s];
|
|
1043
|
-
if (c.action.name ===
|
|
1202
|
+
if (c.action.name === m.INITIAL) t = c.width, n = c.height, r = {
|
|
1044
1203
|
x: 0,
|
|
1045
1204
|
y: 0,
|
|
1046
1205
|
w: 1,
|
|
1047
1206
|
h: 1
|
|
1048
1207
|
}, i = 0, a = !1, o = !1;
|
|
1049
|
-
else if (c.action.name ===
|
|
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 =
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1208
|
+
else if (c.action.name === m.CROP) {
|
|
1209
|
+
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 = Ke(i, a, o), u = [
|
|
1210
|
+
K(l, e, t),
|
|
1211
|
+
K(l, e + n, t),
|
|
1212
|
+
K(l, e, t + s),
|
|
1213
|
+
K(l, e + n, t + s)
|
|
1055
1214
|
], 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
1215
|
r = {
|
|
1057
1216
|
x: r.x + d * r.w,
|
|
@@ -1060,11 +1219,11 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
|
|
|
1060
1219
|
h: r.h * (m - p)
|
|
1061
1220
|
};
|
|
1062
1221
|
} else if (c.action.name === "flip") {
|
|
1063
|
-
let e =
|
|
1222
|
+
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
1223
|
t && (a = !a), n && (o = !o);
|
|
1065
1224
|
} else c.action.name === "rotate" && (i = c.action.args.degrees);
|
|
1066
1225
|
}
|
|
1067
|
-
let s = r.w * t, c = r.h * n, l =
|
|
1226
|
+
let s = r.w * t, c = r.h * n, l = W(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0;
|
|
1068
1227
|
return {
|
|
1069
1228
|
box: r,
|
|
1070
1229
|
boxWidth: s,
|
|
@@ -1079,13 +1238,13 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
|
|
|
1079
1238
|
flipH: a,
|
|
1080
1239
|
flipV: o
|
|
1081
1240
|
};
|
|
1082
|
-
},
|
|
1083
|
-
let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } =
|
|
1241
|
+
}, Ye = (e) => {
|
|
1242
|
+
let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = Je(e), d = G(t.x, 0, 1), f = G(t.y, 0, 1), p = {
|
|
1084
1243
|
x: d,
|
|
1085
1244
|
y: f,
|
|
1086
|
-
w:
|
|
1087
|
-
h:
|
|
1088
|
-
}, m =
|
|
1245
|
+
w: G(t.w, 0, 1 - d),
|
|
1246
|
+
h: G(t.h, 0, 1 - f)
|
|
1247
|
+
}, m = Ue(i);
|
|
1089
1248
|
return {
|
|
1090
1249
|
...p.x === 0 && p.y === 0 && p.w === 1 && p.h === 1 ? {} : { crop: {
|
|
1091
1250
|
x: Math.round(s * t.x),
|
|
@@ -1103,18 +1262,18 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
|
|
|
1103
1262
|
height: o
|
|
1104
1263
|
} } : {}
|
|
1105
1264
|
};
|
|
1106
|
-
},
|
|
1107
|
-
let [t, n] =
|
|
1265
|
+
}, Xe = (e) => {
|
|
1266
|
+
let [t, n] = u(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: s, resetHistory: c } = P();
|
|
1108
1267
|
return {
|
|
1109
1268
|
save: async () => {
|
|
1110
1269
|
if (!o) return;
|
|
1111
1270
|
n(!0);
|
|
1112
|
-
let t =
|
|
1271
|
+
let t = Ye(a.items.slice(0, a.pointer + 1));
|
|
1113
1272
|
try {
|
|
1114
|
-
let n = await
|
|
1273
|
+
let n = await Ve(o);
|
|
1115
1274
|
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
1275
|
let { newBlob: a, previewBlob: s, mimeType: c, width: l, height: u, isAlpha: d } = await n.get(i), f = "";
|
|
1117
|
-
i.exportAs === "base64" && (f = await
|
|
1276
|
+
i.exportAs === "base64" && (f = await Be(a)), await e(f || a), r({
|
|
1118
1277
|
newBlob: a,
|
|
1119
1278
|
previewBlob: s,
|
|
1120
1279
|
mimeType: c,
|
|
@@ -1129,418 +1288,608 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
|
|
|
1129
1288
|
}
|
|
1130
1289
|
},
|
|
1131
1290
|
reset: () => {
|
|
1132
|
-
|
|
1291
|
+
s(null), c();
|
|
1133
1292
|
},
|
|
1134
1293
|
isSaving: t
|
|
1135
1294
|
};
|
|
1136
|
-
},
|
|
1137
|
-
header: "
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1295
|
+
}, q = {
|
|
1296
|
+
header: "_header_1yueu_1",
|
|
1297
|
+
left: "_left_1yueu_12",
|
|
1298
|
+
sidebarToggle: "_sidebarToggle_1yueu_17",
|
|
1299
|
+
mobile: "_mobile_1yueu_29",
|
|
1300
|
+
sidebarIcon: "_sidebarIcon_1yueu_33",
|
|
1301
|
+
tools: "_tools_1yueu_38",
|
|
1302
|
+
history: "_history_1yueu_42",
|
|
1303
|
+
historyText: "_historyText_1yueu_47"
|
|
1304
|
+
}, Ze = ({ onBack: e, onSave: t, isMobile: n }) => {
|
|
1305
|
+
let { save: r, reset: i, isSaving: a } = Xe(t), { sidebar: o, history: s, undo: c, redo: l, setSidebar: u, setCurrentAction: d } = P(), f = s.items.length > 1 && !a, p = s.pointer === 0, m = s.pointer === s.items.length - 1, h = s.items.length < 2 || a, g = h || s.pointer === 0;
|
|
1306
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1307
|
+
className: q.header,
|
|
1308
|
+
children: [/* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1309
|
+
className: q.left,
|
|
1310
|
+
children: [/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1311
|
+
className: `${q.sidebarToggle} ${n ? q.mobile : ""}`,
|
|
1312
|
+
onClick: () => {
|
|
1313
|
+
u(!o);
|
|
1314
|
+
},
|
|
1315
|
+
children: o ? /* @__PURE__ */ (0, b.jsx)(he, { className: q.sidebarIcon }) : /* @__PURE__ */ (0, b.jsx)(me, { className: q.sidebarIcon })
|
|
1316
|
+
}), /* @__PURE__ */ (0, b.jsx)(I, {
|
|
1317
|
+
variant: "ghost",
|
|
1318
|
+
className: F.rect,
|
|
1319
|
+
onClick: e,
|
|
1320
|
+
children: /* @__PURE__ */ (0, b.jsx)(j, {})
|
|
1321
|
+
})]
|
|
1322
|
+
}), /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1323
|
+
className: q.tools,
|
|
1152
1324
|
children: [
|
|
1153
|
-
|
|
1154
|
-
className:
|
|
1325
|
+
f && /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1326
|
+
className: q.history,
|
|
1155
1327
|
children: [
|
|
1156
|
-
/* @__PURE__ */ (0,
|
|
1328
|
+
/* @__PURE__ */ (0, b.jsx)(I, {
|
|
1157
1329
|
variant: "outline",
|
|
1158
|
-
disabled:
|
|
1159
|
-
className:
|
|
1160
|
-
onClick:
|
|
1161
|
-
|
|
1330
|
+
disabled: p,
|
|
1331
|
+
className: F.rect,
|
|
1332
|
+
onClick: () => {
|
|
1333
|
+
c(), d(null);
|
|
1334
|
+
},
|
|
1335
|
+
children: /* @__PURE__ */ (0, b.jsx)(ne, {})
|
|
1162
1336
|
}),
|
|
1163
|
-
/* @__PURE__ */ (0,
|
|
1164
|
-
className:
|
|
1337
|
+
/* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1338
|
+
className: q.historyText,
|
|
1165
1339
|
children: [
|
|
1166
|
-
|
|
1340
|
+
s.pointer + 1,
|
|
1167
1341
|
"/",
|
|
1168
|
-
|
|
1342
|
+
s.items.length
|
|
1169
1343
|
]
|
|
1170
1344
|
}),
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1345
|
+
/* @__PURE__ */ (0, b.jsx)(I, {
|
|
1172
1346
|
variant: "outline",
|
|
1173
|
-
disabled:
|
|
1174
|
-
className:
|
|
1175
|
-
onClick:
|
|
1176
|
-
|
|
1347
|
+
disabled: m,
|
|
1348
|
+
className: F.rect,
|
|
1349
|
+
onClick: () => {
|
|
1350
|
+
l(), d(null);
|
|
1351
|
+
},
|
|
1352
|
+
children: /* @__PURE__ */ (0, b.jsx)(re, {})
|
|
1177
1353
|
})
|
|
1178
1354
|
]
|
|
1179
1355
|
}),
|
|
1180
|
-
/* @__PURE__ */ (0,
|
|
1356
|
+
/* @__PURE__ */ (0, b.jsx)(I, {
|
|
1181
1357
|
variant: "outline",
|
|
1182
|
-
disabled:
|
|
1183
|
-
onClick:
|
|
1358
|
+
disabled: h,
|
|
1359
|
+
onClick: i,
|
|
1184
1360
|
children: "Reset"
|
|
1185
1361
|
}),
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1187
|
-
disabled:
|
|
1188
|
-
onClick:
|
|
1189
|
-
children: [
|
|
1362
|
+
/* @__PURE__ */ (0, b.jsxs)(I, {
|
|
1363
|
+
disabled: g,
|
|
1364
|
+
onClick: r,
|
|
1365
|
+
children: [a ? /* @__PURE__ */ (0, b.jsx)(ge, {}) : /* @__PURE__ */ (0, b.jsx)(A, {}), "Save"]
|
|
1190
1366
|
})
|
|
1191
1367
|
]
|
|
1192
1368
|
})]
|
|
1193
1369
|
});
|
|
1194
|
-
},
|
|
1370
|
+
}, Qe = {
|
|
1371
|
+
[m.RESIZE]: {
|
|
1372
|
+
icon: /* @__PURE__ */ (0, b.jsx)(ce, {}),
|
|
1373
|
+
label: "Resize"
|
|
1374
|
+
},
|
|
1375
|
+
[m.CROP]: {
|
|
1376
|
+
icon: /* @__PURE__ */ (0, b.jsx)(N, {}),
|
|
1377
|
+
label: "Crop"
|
|
1378
|
+
},
|
|
1379
|
+
[m.PRESET_CROP]: {
|
|
1380
|
+
icon: /* @__PURE__ */ (0, b.jsx)(pe, {}),
|
|
1381
|
+
label: "Presets"
|
|
1382
|
+
},
|
|
1383
|
+
[m.FLIP]: {
|
|
1384
|
+
icon: /* @__PURE__ */ (0, b.jsx)(le, {}),
|
|
1385
|
+
label: "Flip"
|
|
1386
|
+
},
|
|
1387
|
+
[m.ROTATE]: {
|
|
1388
|
+
icon: /* @__PURE__ */ (0, b.jsx)(de, {}),
|
|
1389
|
+
label: "Rotate"
|
|
1390
|
+
}
|
|
1391
|
+
}, $e = (e) => Qe[e] ?? null, et = () => {
|
|
1392
|
+
let { settings: e, currentAction: t, getLastRotation: n, getLastHistoryItem: r, setCurrentAction: i, setSidebar: a } = P(), o = e?.tools || [], s = t?.name, { width: c, height: l } = r();
|
|
1393
|
+
return { click: (e) => {
|
|
1394
|
+
if (o.includes(e) && s === e) {
|
|
1395
|
+
i(null);
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
switch (e) {
|
|
1399
|
+
case m.RESIZE:
|
|
1400
|
+
i({
|
|
1401
|
+
name: m.RESIZE,
|
|
1402
|
+
args: {
|
|
1403
|
+
width: c,
|
|
1404
|
+
height: l
|
|
1405
|
+
}
|
|
1406
|
+
});
|
|
1407
|
+
break;
|
|
1408
|
+
case m.CROP:
|
|
1409
|
+
i({
|
|
1410
|
+
name: m.CROP,
|
|
1411
|
+
args: {
|
|
1412
|
+
id: "freeform",
|
|
1413
|
+
ratio: c / l,
|
|
1414
|
+
isFree: !0
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
break;
|
|
1418
|
+
case m.PRESET_CROP:
|
|
1419
|
+
i({
|
|
1420
|
+
name: m.PRESET_CROP,
|
|
1421
|
+
args: {
|
|
1422
|
+
id: "facebook-post",
|
|
1423
|
+
ratio: 1200 / 630,
|
|
1424
|
+
isFree: !1,
|
|
1425
|
+
preset: {
|
|
1426
|
+
width: 1200,
|
|
1427
|
+
height: 630
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
break;
|
|
1432
|
+
case m.FLIP:
|
|
1433
|
+
i({
|
|
1434
|
+
name: m.FLIP,
|
|
1435
|
+
args: {
|
|
1436
|
+
horizontal: !1,
|
|
1437
|
+
vertical: !1
|
|
1438
|
+
}
|
|
1439
|
+
});
|
|
1440
|
+
break;
|
|
1441
|
+
case m.ROTATE:
|
|
1442
|
+
i({
|
|
1443
|
+
name: m.ROTATE,
|
|
1444
|
+
args: { degrees: n() }
|
|
1445
|
+
});
|
|
1446
|
+
break;
|
|
1447
|
+
}
|
|
1448
|
+
a(!1);
|
|
1449
|
+
} };
|
|
1450
|
+
}, J = {
|
|
1451
|
+
sidebar: "_sidebar_1j9gh_1",
|
|
1452
|
+
mobile: "_mobile_1j9gh_9",
|
|
1453
|
+
open: "_open_1j9gh_14",
|
|
1454
|
+
wrapper: "_wrapper_1j9gh_19",
|
|
1455
|
+
item: "_item_1j9gh_23",
|
|
1456
|
+
selected: "_selected_1j9gh_41"
|
|
1457
|
+
}, tt = ({ isMobile: e }) => {
|
|
1458
|
+
let { settings: t, sidebar: n, currentAction: r } = P(), i = t?.tools || [], a = r?.name, { click: o } = et();
|
|
1459
|
+
return /* @__PURE__ */ (0, b.jsx)("nav", {
|
|
1460
|
+
className: `${J.sidebar} ${e ? J.mobile : ""} ${e && n ? J.open : ""}`,
|
|
1461
|
+
children: /* @__PURE__ */ (0, b.jsx)(V, {
|
|
1462
|
+
orientation: "vertical",
|
|
1463
|
+
className: J.tooltip,
|
|
1464
|
+
children: i.map((e) => {
|
|
1465
|
+
let t = $e(e);
|
|
1466
|
+
if (!t) return null;
|
|
1467
|
+
let { icon: n, label: r } = t;
|
|
1468
|
+
return /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1469
|
+
className: `${J.item} ${a === e ? J.selected : ""}`,
|
|
1470
|
+
onClick: () => o(e),
|
|
1471
|
+
"data-tooltip": r,
|
|
1472
|
+
"aria-label": r,
|
|
1473
|
+
children: n
|
|
1474
|
+
}, e);
|
|
1475
|
+
})
|
|
1476
|
+
})
|
|
1477
|
+
});
|
|
1478
|
+
}, nt = { infobar: "_infobar_ofe91_1" }, rt = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`, it = () => {
|
|
1479
|
+
let { originalBlob: e, getLastHistoryItem: t } = P(), { width: n, height: r } = t();
|
|
1480
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1481
|
+
className: nt.infobar,
|
|
1482
|
+
children: [/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1483
|
+
className: nt.filesize,
|
|
1484
|
+
children: e ? rt(e.size) : "0 B"
|
|
1485
|
+
}), /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1486
|
+
className: nt.sizes,
|
|
1487
|
+
children: [
|
|
1488
|
+
n,
|
|
1489
|
+
" / ",
|
|
1490
|
+
r
|
|
1491
|
+
]
|
|
1492
|
+
})]
|
|
1493
|
+
});
|
|
1494
|
+
}, at = (e, t) => {
|
|
1195
1495
|
let n = new CustomEvent("crop-update", { detail: t });
|
|
1196
1496
|
e.dispatchEvent(n);
|
|
1197
|
-
},
|
|
1497
|
+
}, ot = (e, t) => {
|
|
1198
1498
|
let n = new CustomEvent("clip-path-update", { detail: t });
|
|
1199
1499
|
e.dispatchEvent(n);
|
|
1200
|
-
},
|
|
1500
|
+
}, st = (e, t) => {
|
|
1201
1501
|
let n = new CustomEvent("resize-update", { detail: t });
|
|
1202
1502
|
e.dispatchEvent(n);
|
|
1203
|
-
},
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
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);
|
|
1503
|
+
}, ct = 15, lt = 200, ut = 2, dt = (e, t, n) => {
|
|
1504
|
+
let r = Math.min(lt, Math.max(ct, e));
|
|
1505
|
+
return {
|
|
1506
|
+
scale: r,
|
|
1507
|
+
width: Math.round(r / 100 * t),
|
|
1508
|
+
height: Math.round(r / 100 * n)
|
|
1237
1509
|
};
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
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();
|
|
1510
|
+
}, ft = () => {
|
|
1511
|
+
let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r, eventBus: a } = P(), { width: s, height: c } = e(), [d, f] = u(s), [p, h] = u(c), [g, _] = u(100), v = l(g), y = l(0), b = l(null), x = i((e) => {
|
|
1512
|
+
let t = dt(e, s, c);
|
|
1513
|
+
f(t.width), h(t.height), _(t.scale), v.current = t.scale, st(a, t.scale);
|
|
1252
1514
|
}, [
|
|
1253
|
-
l,
|
|
1254
1515
|
c,
|
|
1255
|
-
|
|
1256
|
-
u,
|
|
1516
|
+
s,
|
|
1257
1517
|
a
|
|
1258
|
-
]),
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1518
|
+
]), S = (e, t) => {
|
|
1519
|
+
let n = Number.parseInt(e, 10);
|
|
1520
|
+
if (!Number.isFinite(n)) {
|
|
1521
|
+
x(100);
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
x(n / t * 100);
|
|
1525
|
+
};
|
|
1526
|
+
return o(() => {
|
|
1527
|
+
let e = (e) => {
|
|
1528
|
+
let t = b.current?.parentElement;
|
|
1529
|
+
return e.target instanceof Node && !!t?.contains(e.target);
|
|
1530
|
+
}, t = (t) => {
|
|
1531
|
+
e(t) && x(v.current - Math.sign(t.deltaY) * ut);
|
|
1532
|
+
}, n = (t) => {
|
|
1533
|
+
e(t) && (y.current = t.touches[0].clientY);
|
|
1534
|
+
}, r = (t) => {
|
|
1535
|
+
if (!e(t)) return;
|
|
1536
|
+
let n = t.touches[0].clientY, r = y.current - n;
|
|
1537
|
+
Math.abs(r) < 10 || (x(v.current + Math.sign(r) * ut), y.current = n);
|
|
1538
|
+
}, i = new AbortController(), { signal: a } = i;
|
|
1539
|
+
return window.addEventListener("wheel", t, { signal: a }), window.addEventListener("touchstart", n, { signal: a }), window.addEventListener("touchmove", r, { signal: a }), () => i.abort();
|
|
1540
|
+
}, [x]), {
|
|
1541
|
+
resizeRef: b,
|
|
1542
|
+
width: d,
|
|
1543
|
+
height: p,
|
|
1544
|
+
scale: g,
|
|
1545
|
+
currentWidth: s,
|
|
1546
|
+
currentHeight: c,
|
|
1547
|
+
setWidth: f,
|
|
1548
|
+
setHeight: h,
|
|
1549
|
+
handleWidthBlur: (e) => {
|
|
1550
|
+
S(e.target.value, s);
|
|
1551
|
+
},
|
|
1552
|
+
handleHeightBlur: (e) => {
|
|
1553
|
+
S(e.target.value, c);
|
|
1554
|
+
},
|
|
1555
|
+
save: () => {
|
|
1556
|
+
n({
|
|
1557
|
+
width: d,
|
|
1558
|
+
height: p,
|
|
1559
|
+
action: {
|
|
1560
|
+
name: m.RESIZE,
|
|
1561
|
+
args: {
|
|
1562
|
+
width: d,
|
|
1563
|
+
height: p
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
}), st(a, 100), r(!0);
|
|
1567
|
+
},
|
|
1568
|
+
close: () => {
|
|
1569
|
+
st(a, 100), t(null), r(!0);
|
|
1570
|
+
}
|
|
1571
|
+
};
|
|
1572
|
+
}, Y = {
|
|
1573
|
+
resize: "_resize_s127g_1",
|
|
1574
|
+
toolsLock: "_toolsLock_s127g_15",
|
|
1575
|
+
indicatorWrapper: "_indicatorWrapper_s127g_20",
|
|
1576
|
+
indicator: "_indicator_s127g_20"
|
|
1577
|
+
}, pt = () => {
|
|
1578
|
+
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 } = ft();
|
|
1579
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1580
|
+
ref: e,
|
|
1581
|
+
className: Y.resize,
|
|
1582
|
+
children: [
|
|
1583
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1584
|
+
className: Y.indicatorWrapper,
|
|
1585
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1586
|
+
className: Y.indicator,
|
|
1587
|
+
style: { width: `${r / 2}%` }
|
|
1290
1588
|
})
|
|
1291
|
-
|
|
1292
|
-
|
|
1589
|
+
}),
|
|
1590
|
+
/* @__PURE__ */ (0, b.jsx)(we, {
|
|
1591
|
+
value: t,
|
|
1592
|
+
name: "width",
|
|
1593
|
+
label: "Width",
|
|
1594
|
+
style: { width: "88px" },
|
|
1595
|
+
onChange: (e) => o(Number(e.target.value)),
|
|
1596
|
+
onBlur: c
|
|
1597
|
+
}),
|
|
1598
|
+
/* @__PURE__ */ (0, b.jsx)(te, { className: Y.toolsLock }),
|
|
1599
|
+
/* @__PURE__ */ (0, b.jsx)(we, {
|
|
1600
|
+
value: n,
|
|
1601
|
+
name: "height",
|
|
1602
|
+
label: "Height",
|
|
1603
|
+
style: { width: "88px" },
|
|
1604
|
+
onChange: (e) => s(Number(e.target.value)),
|
|
1605
|
+
onBlur: l
|
|
1606
|
+
}),
|
|
1607
|
+
/* @__PURE__ */ (0, b.jsx)(z, {
|
|
1608
|
+
onSave: u,
|
|
1609
|
+
onClose: d,
|
|
1610
|
+
disabled: t === i && n === a
|
|
1611
|
+
})
|
|
1612
|
+
]
|
|
1293
1613
|
});
|
|
1294
|
-
},
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
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) => {
|
|
1614
|
+
}, mt = ({ isClipped: e }) => {
|
|
1615
|
+
let { history: t, previewUrl: n, currentAction: r, getLastRotation: i, eventBus: a } = P(), c = l(null), u = l(r?.name), d = l(n);
|
|
1616
|
+
s(() => {
|
|
1617
|
+
let e = u.current, t = r?.name, i = d.current !== n;
|
|
1618
|
+
if (u.current = t, d.current = n, !(e && t && e !== t) && !i) return;
|
|
1619
|
+
let a = c.current;
|
|
1620
|
+
if (!a) return;
|
|
1621
|
+
let o = [a, ...a.querySelectorAll("*")];
|
|
1622
|
+
o.forEach((e) => {
|
|
1308
1623
|
e.style.transition = "none";
|
|
1309
|
-
}),
|
|
1310
|
-
let
|
|
1311
|
-
|
|
1624
|
+
}), a.getBoundingClientRect();
|
|
1625
|
+
let s = () => {
|
|
1626
|
+
o.forEach((e) => {
|
|
1312
1627
|
e.style.removeProperty("transition");
|
|
1313
1628
|
});
|
|
1314
|
-
},
|
|
1629
|
+
}, l = requestAnimationFrame(s);
|
|
1315
1630
|
return () => {
|
|
1316
|
-
cancelAnimationFrame(
|
|
1631
|
+
cancelAnimationFrame(l), s();
|
|
1317
1632
|
};
|
|
1318
|
-
}, [
|
|
1319
|
-
let
|
|
1320
|
-
if (
|
|
1321
|
-
let { width: e, height:
|
|
1322
|
-
|
|
1323
|
-
...
|
|
1633
|
+
}, [r?.name, n]);
|
|
1634
|
+
let f = t.items.slice(0, t.pointer + 1);
|
|
1635
|
+
if (r) {
|
|
1636
|
+
let { width: e, height: n } = t.items.at(t.pointer);
|
|
1637
|
+
f.push({
|
|
1638
|
+
...r.name === m.ROTATE ? Le(e, n, i(), r.args.degrees) : {
|
|
1324
1639
|
width: e,
|
|
1325
|
-
height:
|
|
1640
|
+
height: n
|
|
1326
1641
|
},
|
|
1327
|
-
action:
|
|
1642
|
+
action: r
|
|
1328
1643
|
});
|
|
1329
1644
|
}
|
|
1330
|
-
let
|
|
1331
|
-
return
|
|
1332
|
-
e &&
|
|
1645
|
+
let p = Je(f);
|
|
1646
|
+
return o(() => {
|
|
1647
|
+
e && c.current && (c.current.style.transition = "none"), r?.name !== m.RESIZE && c.current && (c.current.style.transform = "scale(1)");
|
|
1333
1648
|
let t = (e) => {
|
|
1334
1649
|
let t = e.detail;
|
|
1335
|
-
|
|
1650
|
+
c.current && (c.current.style.transform = `scale(${t / 100})`);
|
|
1336
1651
|
}, n = (t) => {
|
|
1337
1652
|
if (!e) return;
|
|
1338
1653
|
let { x: n, y: r, w: i, h: a } = t.detail;
|
|
1339
|
-
|
|
1654
|
+
c.current && (c.current.style.clipPath = `xywh(${n}% ${r}% ${i}% ${a}%)`);
|
|
1340
1655
|
};
|
|
1341
|
-
return
|
|
1342
|
-
|
|
1656
|
+
return a.addEventListener("resize-update", t), a.addEventListener("clip-path-update", n), () => {
|
|
1657
|
+
a.removeEventListener("resize-update", t), a.removeEventListener("clip-path-update", n);
|
|
1343
1658
|
};
|
|
1344
1659
|
}, [
|
|
1345
1660
|
e,
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
]),
|
|
1349
|
-
|
|
1350
|
-
|
|
1661
|
+
r?.name,
|
|
1662
|
+
a
|
|
1663
|
+
]), {
|
|
1664
|
+
previewRef: c,
|
|
1665
|
+
previewUrl: n,
|
|
1666
|
+
...p
|
|
1667
|
+
};
|
|
1668
|
+
}, X = {
|
|
1669
|
+
preview: "_preview_dvanl_1",
|
|
1670
|
+
rotate: "_rotate_dvanl_12",
|
|
1671
|
+
flip: "_flip_dvanl_24",
|
|
1672
|
+
image: "_image_dvanl_32"
|
|
1673
|
+
}, ht = ({ isClipped: e, style: t = {} }) => {
|
|
1674
|
+
let { previewRef: n, previewUrl: r, box: i, boxWidth: a, boxHeight: o, viewWidth: s, viewHeight: c, rotation: l, flipH: u, flipV: d } = mt({ isClipped: e });
|
|
1675
|
+
return /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1676
|
+
ref: n,
|
|
1677
|
+
className: X.preview,
|
|
1351
1678
|
style: {
|
|
1352
|
-
aspectRatio: `${
|
|
1679
|
+
aspectRatio: `${s} / ${c}`,
|
|
1353
1680
|
...t
|
|
1354
1681
|
},
|
|
1355
|
-
children: /* @__PURE__ */ (0,
|
|
1356
|
-
className:
|
|
1682
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1683
|
+
className: X.rotate,
|
|
1357
1684
|
style: {
|
|
1358
|
-
width: `${
|
|
1359
|
-
height: `${
|
|
1360
|
-
transform: `translate(-50%, -50%) rotate(${
|
|
1685
|
+
width: `${a / s * 100}%`,
|
|
1686
|
+
height: `${o / c * 100}%`,
|
|
1687
|
+
transform: `translate(-50%, -50%) rotate(${l}deg)`
|
|
1361
1688
|
},
|
|
1362
|
-
children: /* @__PURE__ */ (0,
|
|
1363
|
-
className:
|
|
1364
|
-
style: { transform: `scale(${
|
|
1365
|
-
children: /* @__PURE__ */ (0,
|
|
1366
|
-
className:
|
|
1367
|
-
src:
|
|
1689
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1690
|
+
className: X.flip,
|
|
1691
|
+
style: { transform: `scale(${u ? -1 : 1}, ${d ? -1 : 1})` },
|
|
1692
|
+
children: /* @__PURE__ */ (0, b.jsx)("img", {
|
|
1693
|
+
className: X.image,
|
|
1694
|
+
src: r,
|
|
1368
1695
|
alt: "Preview Image",
|
|
1369
1696
|
style: {
|
|
1370
|
-
width: `${1 /
|
|
1371
|
-
height: `${1 /
|
|
1372
|
-
left: `${-(
|
|
1373
|
-
top: `${-(
|
|
1697
|
+
width: `${1 / i.w * 100}%`,
|
|
1698
|
+
height: `${1 / i.h * 100}%`,
|
|
1699
|
+
left: `${-(i.x / i.w) * 100}%`,
|
|
1700
|
+
top: `${-(i.y / i.h) * 100}%`
|
|
1374
1701
|
}
|
|
1375
1702
|
})
|
|
1376
1703
|
})
|
|
1377
1704
|
})
|
|
1378
1705
|
});
|
|
1379
|
-
},
|
|
1380
|
-
wrapper: "
|
|
1381
|
-
box: "
|
|
1382
|
-
tools: "
|
|
1383
|
-
toolsInfo: "
|
|
1384
|
-
toolsInfoLabel: "
|
|
1385
|
-
toolsInfoValue: "
|
|
1386
|
-
linesBox: "
|
|
1387
|
-
line: "
|
|
1388
|
-
lineV: "
|
|
1389
|
-
lineH: "
|
|
1390
|
-
pointer: "
|
|
1391
|
-
pointerTopLeft: "
|
|
1392
|
-
pointerTopRight: "
|
|
1393
|
-
pointerBottomRight: "
|
|
1394
|
-
pointerBottomLeft: "
|
|
1395
|
-
mobileBorder: "
|
|
1396
|
-
mobilePointer: "
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1706
|
+
}, Z = {
|
|
1707
|
+
wrapper: "_wrapper_1yhyo_1",
|
|
1708
|
+
box: "_box_1yhyo_9",
|
|
1709
|
+
tools: "_tools_1yhyo_18",
|
|
1710
|
+
toolsInfo: "_toolsInfo_1yhyo_35",
|
|
1711
|
+
toolsInfoLabel: "_toolsInfoLabel_1yhyo_42",
|
|
1712
|
+
toolsInfoValue: "_toolsInfoValue_1yhyo_47",
|
|
1713
|
+
linesBox: "_linesBox_1yhyo_52",
|
|
1714
|
+
line: "_line_1yhyo_52",
|
|
1715
|
+
lineV: "_lineV_1yhyo_62",
|
|
1716
|
+
lineH: "_lineH_1yhyo_70",
|
|
1717
|
+
pointer: "_pointer_1yhyo_78",
|
|
1718
|
+
pointerTopLeft: "_pointerTopLeft_1yhyo_84",
|
|
1719
|
+
pointerTopRight: "_pointerTopRight_1yhyo_91",
|
|
1720
|
+
pointerBottomRight: "_pointerBottomRight_1yhyo_98",
|
|
1721
|
+
pointerBottomLeft: "_pointerBottomLeft_1yhyo_105",
|
|
1722
|
+
mobileBorder: "_mobileBorder_1yhyo_112",
|
|
1723
|
+
mobilePointer: "_mobilePointer_1yhyo_118",
|
|
1724
|
+
info: "_info_1yhyo_129",
|
|
1725
|
+
infoX: "_infoX_1yhyo_146",
|
|
1726
|
+
infoY: "_infoY_1yhyo_151",
|
|
1727
|
+
infoW: "_infoW_1yhyo_158",
|
|
1728
|
+
infoH: "_infoH_1yhyo_163",
|
|
1729
|
+
group: "_group_1yhyo_170",
|
|
1730
|
+
active: "_active_1yhyo_179"
|
|
1731
|
+
}, gt = () => {
|
|
1732
|
+
let { getLastHistoryItem: e } = P(), t = D(), n = l(null), { handleCropStart: r, initialCrop: i } = Ot({ boxRef: n }), { width: a, height: o } = e(), { x: s, y: c, w: u, h: d } = i;
|
|
1733
|
+
return /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [/* @__PURE__ */ (0, b.jsx)(ht, {
|
|
1400
1734
|
isClipped: !0,
|
|
1401
|
-
style: { clipPath: `xywh(${
|
|
1402
|
-
}), /* @__PURE__ */ (0,
|
|
1403
|
-
className:
|
|
1404
|
-
style: { aspectRatio: `${a} / ${
|
|
1405
|
-
children: /* @__PURE__ */ (0,
|
|
1735
|
+
style: { clipPath: `xywh(${s}% ${c}% ${u}% ${d}%)` }
|
|
1736
|
+
}), /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1737
|
+
className: Z.wrapper,
|
|
1738
|
+
style: { aspectRatio: `${a} / ${o}` },
|
|
1739
|
+
children: /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1406
1740
|
ref: n,
|
|
1407
|
-
className:
|
|
1741
|
+
className: Z.box,
|
|
1408
1742
|
style: {
|
|
1409
1743
|
width: `${u}%`,
|
|
1410
1744
|
height: `${d}%`,
|
|
1411
|
-
top: `${
|
|
1412
|
-
left: `${
|
|
1745
|
+
top: `${c}%`,
|
|
1746
|
+
left: `${s}%`
|
|
1413
1747
|
},
|
|
1414
|
-
children: [/* @__PURE__ */ (0,
|
|
1748
|
+
children: [/* @__PURE__ */ (0, b.jsx)(xt, {}), t ? /* @__PURE__ */ (0, b.jsx)(kt, { onMouseDown: r }) : /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [/* @__PURE__ */ (0, b.jsx)(St, { onMouseDown: r }), /* @__PURE__ */ (0, b.jsx)(At, {})] })]
|
|
1415
1749
|
})
|
|
1416
1750
|
})] });
|
|
1417
|
-
},
|
|
1418
|
-
|
|
1751
|
+
}, _t = [
|
|
1752
|
+
{
|
|
1753
|
+
id: "freeform",
|
|
1754
|
+
icon: /* @__PURE__ */ (0, b.jsx)(N, {}),
|
|
1755
|
+
label: "Freeform"
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
id: "origin",
|
|
1759
|
+
icon: /* @__PURE__ */ (0, b.jsx)(ie, {}),
|
|
1760
|
+
label: "Original"
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
id: "1:1",
|
|
1764
|
+
icon: /* @__PURE__ */ (0, b.jsx)(ae, {}),
|
|
1765
|
+
label: "1 : 1"
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
id: "4:3",
|
|
1769
|
+
icon: /* @__PURE__ */ (0, b.jsx)(se, {}),
|
|
1770
|
+
label: "4 : 3"
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
id: "16:9",
|
|
1774
|
+
icon: /* @__PURE__ */ (0, b.jsx)(oe, {}),
|
|
1775
|
+
label: "16 : 9"
|
|
1776
|
+
}
|
|
1777
|
+
], vt = ({ value: e, onChange: t }) => /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1778
|
+
className: Z.group,
|
|
1779
|
+
children: /* @__PURE__ */ (0, b.jsx)(V, {
|
|
1780
|
+
orientation: "horizontal",
|
|
1781
|
+
className: Z.tooltip,
|
|
1782
|
+
children: _t.map((n) => /* @__PURE__ */ (0, b.jsx)(I, {
|
|
1783
|
+
variant: "outline",
|
|
1784
|
+
className: `${Z.groupBtn} ${e === n.id ? Z.active : ""}`,
|
|
1785
|
+
onClick: () => t(n.id),
|
|
1786
|
+
"aria-label": n.label,
|
|
1787
|
+
"data-tooltip": n.label,
|
|
1788
|
+
children: n.icon
|
|
1789
|
+
}, n.id))
|
|
1790
|
+
})
|
|
1791
|
+
}), yt = () => {
|
|
1792
|
+
let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: r, setSidebar: i, eventBus: a } = P(), { width: s, height: c } = n(), { name: u, args: d } = t || {}, f = u === m.CROP ? d?.id : "", p = s / c, h = l({
|
|
1419
1793
|
x: 0,
|
|
1420
1794
|
y: 0,
|
|
1421
1795
|
w: 0,
|
|
1422
1796
|
h: 0
|
|
1423
1797
|
});
|
|
1424
|
-
return
|
|
1425
|
-
if (t?.name !==
|
|
1426
|
-
let e =
|
|
1427
|
-
|
|
1428
|
-
let
|
|
1429
|
-
|
|
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;
|
|
1798
|
+
return o(() => {
|
|
1799
|
+
if (t?.name !== m.CROP) return;
|
|
1800
|
+
let e = U(t.args.ratio, s, c);
|
|
1801
|
+
h.current = e;
|
|
1802
|
+
let n = (e) => {
|
|
1803
|
+
h.current = e.detail;
|
|
1433
1804
|
};
|
|
1434
|
-
return
|
|
1435
|
-
|
|
1805
|
+
return a.addEventListener("clip-path-update", n), () => {
|
|
1806
|
+
a.removeEventListener("clip-path-update", n);
|
|
1436
1807
|
};
|
|
1437
1808
|
}, [
|
|
1438
1809
|
t,
|
|
1810
|
+
s,
|
|
1439
1811
|
c,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
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);
|
|
1812
|
+
a
|
|
1813
|
+
]), {
|
|
1814
|
+
currentValue: f,
|
|
1815
|
+
handleChange: (t) => {
|
|
1816
|
+
t !== f && (e({
|
|
1817
|
+
name: m.CROP,
|
|
1818
|
+
args: {
|
|
1819
|
+
id: t,
|
|
1820
|
+
ratio: /^\d+:\d+$/.test(t) ? t.split(":").map(Number).reduce((e, t) => e / t) : p,
|
|
1821
|
+
isFree: t === "freeform"
|
|
1503
1822
|
}
|
|
1504
|
-
})
|
|
1505
|
-
|
|
1823
|
+
}), i(!0));
|
|
1824
|
+
},
|
|
1825
|
+
handleSave: () => {
|
|
1826
|
+
if (!t || t.name !== m.CROP) return;
|
|
1827
|
+
let e = t.args?.preset?.width || Math.round(s * h.current.w / 100), n = t.args?.preset?.height || Math.round(c * h.current.h / 100);
|
|
1828
|
+
r({
|
|
1829
|
+
width: e,
|
|
1830
|
+
height: n,
|
|
1831
|
+
action: {
|
|
1832
|
+
name: m.CROP,
|
|
1833
|
+
args: {
|
|
1834
|
+
...t.args,
|
|
1835
|
+
...h.current
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
}), i(!0);
|
|
1839
|
+
},
|
|
1840
|
+
handleClose: () => {
|
|
1841
|
+
e(null), i(!0);
|
|
1842
|
+
}
|
|
1843
|
+
};
|
|
1844
|
+
}, bt = () => {
|
|
1845
|
+
let { currentValue: e, handleChange: t, handleSave: n, handleClose: r } = yt();
|
|
1846
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1847
|
+
className: Z.tools,
|
|
1848
|
+
children: [/* @__PURE__ */ (0, b.jsx)(vt, {
|
|
1849
|
+
value: e,
|
|
1850
|
+
onChange: t
|
|
1851
|
+
}), /* @__PURE__ */ (0, b.jsx)(z, {
|
|
1852
|
+
onSave: n,
|
|
1853
|
+
onClose: r
|
|
1854
|
+
})]
|
|
1506
1855
|
});
|
|
1507
|
-
},
|
|
1508
|
-
className:
|
|
1509
|
-
children: [/* @__PURE__ */ (0,
|
|
1510
|
-
}),
|
|
1511
|
-
/* @__PURE__ */ (0,
|
|
1512
|
-
className: `${
|
|
1856
|
+
}, xt = () => /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
1857
|
+
className: Z.linesBox,
|
|
1858
|
+
children: [/* @__PURE__ */ (0, b.jsx)("span", { className: `${Z.line} ${Z.lineV}` }), /* @__PURE__ */ (0, b.jsx)("span", { className: `${Z.line} ${Z.lineH}` })]
|
|
1859
|
+
}), St = ({ onMouseDown: e }) => /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [
|
|
1860
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1861
|
+
className: `${Z.pointer} ${Z.pointerTopLeft}`,
|
|
1513
1862
|
onMouseDown: (t) => e(t, "tl", "nwse")
|
|
1514
1863
|
}),
|
|
1515
|
-
/* @__PURE__ */ (0,
|
|
1516
|
-
className: `${
|
|
1864
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1865
|
+
className: `${Z.pointer} ${Z.pointerTopRight}`,
|
|
1517
1866
|
onMouseDown: (t) => e(t, "tr", "nesw")
|
|
1518
1867
|
}),
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1520
|
-
className: `${
|
|
1868
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1869
|
+
className: `${Z.pointer} ${Z.pointerBottomRight}`,
|
|
1521
1870
|
onMouseDown: (t) => e(t, "br", "nwse")
|
|
1522
1871
|
}),
|
|
1523
|
-
/* @__PURE__ */ (0,
|
|
1524
|
-
className: `${
|
|
1872
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
1873
|
+
className: `${Z.pointer} ${Z.pointerBottomLeft}`,
|
|
1525
1874
|
onMouseDown: (t) => e(t, "bl", "nesw")
|
|
1526
1875
|
})
|
|
1527
1876
|
] });
|
|
1528
1877
|
//#endregion
|
|
1529
1878
|
//#region src/shared/components/Pixedi/crop/useCropInteraction.ts
|
|
1530
|
-
function
|
|
1879
|
+
function Ct(e, t, n) {
|
|
1531
1880
|
return Math.min(Math.max(e, t), n);
|
|
1532
1881
|
}
|
|
1533
|
-
function
|
|
1882
|
+
function wt(e, { x: t, y: n, w: r, h: i }) {
|
|
1534
1883
|
e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
|
|
1535
1884
|
}
|
|
1536
|
-
function
|
|
1885
|
+
function Tt(e) {
|
|
1537
1886
|
let { width: t, height: n } = e.getBoundingClientRect();
|
|
1538
1887
|
return {
|
|
1539
1888
|
frameW: t,
|
|
1540
1889
|
frameH: n
|
|
1541
1890
|
};
|
|
1542
1891
|
}
|
|
1543
|
-
function
|
|
1892
|
+
function Et({ x: e, y: t, w: n, h: r }, i, a) {
|
|
1544
1893
|
return {
|
|
1545
1894
|
x: e / 100 * i,
|
|
1546
1895
|
y: t / 100 * a,
|
|
@@ -1548,7 +1897,7 @@ function ot({ x: e, y: t, w: n, h: r }, i, a) {
|
|
|
1548
1897
|
h: r / 100 * a
|
|
1549
1898
|
};
|
|
1550
1899
|
}
|
|
1551
|
-
function
|
|
1900
|
+
function Dt({ x: e, y: t, w: n, h: r }, i, a) {
|
|
1552
1901
|
return {
|
|
1553
1902
|
x: e / i * 100,
|
|
1554
1903
|
y: t / a * 100,
|
|
@@ -1556,427 +1905,412 @@ function st({ x: e, y: t, w: n, h: r }, i, a) {
|
|
|
1556
1905
|
h: r / a * 100
|
|
1557
1906
|
};
|
|
1558
1907
|
}
|
|
1559
|
-
var
|
|
1560
|
-
let { currentAction: t, getLastHistoryItem: n, eventBus:
|
|
1908
|
+
var Ot = ({ boxRef: e }) => {
|
|
1909
|
+
let { currentAction: t, getLastHistoryItem: n, eventBus: r } = P(), i = D(), { width: a, height: s } = n(), u = t?.name === m.CROP || t?.name === m.PRESET_CROP, d = u ? t.args.ratio : 1, f = !u || t.args.isFree, p = c(() => U(d, a, s), [
|
|
1561
1910
|
d,
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
]),
|
|
1565
|
-
return
|
|
1566
|
-
|
|
1567
|
-
}, [p,
|
|
1911
|
+
a,
|
|
1912
|
+
s
|
|
1913
|
+
]), h = l(null), g = l(""), _ = l(p), v = l(p);
|
|
1914
|
+
return o(() => {
|
|
1915
|
+
_.current = p, ot(r, p);
|
|
1916
|
+
}, [p, r]), o(() => {
|
|
1568
1917
|
let t = (e, t) => {
|
|
1569
|
-
|
|
1570
|
-
x: Math.round(t.x / 100 *
|
|
1571
|
-
y: Math.round(t.y / 100 *
|
|
1572
|
-
w: Math.round(t.w / 100 *
|
|
1573
|
-
h: Math.round(t.h / 100 *
|
|
1574
|
-
}),
|
|
1918
|
+
_.current = t, wt(e, t), at(r, {
|
|
1919
|
+
x: Math.round(t.x / 100 * a),
|
|
1920
|
+
y: Math.round(t.y / 100 * s),
|
|
1921
|
+
w: Math.round(t.w / 100 * a),
|
|
1922
|
+
h: Math.round(t.h / 100 * s)
|
|
1923
|
+
}), ot(r, t);
|
|
1575
1924
|
}, n = (e) => {
|
|
1576
|
-
e.preventDefault(),
|
|
1925
|
+
e.preventDefault(), v.current = _.current;
|
|
1577
1926
|
let t = "clientX" in e ? e.clientX : e.touches[0].clientX, n = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
1578
|
-
|
|
1927
|
+
h.current = {
|
|
1579
1928
|
x: t,
|
|
1580
1929
|
y: n
|
|
1581
1930
|
}, document.body.style.cursor = "move";
|
|
1582
|
-
},
|
|
1583
|
-
if (!e.current || !
|
|
1931
|
+
}, i = (t) => {
|
|
1932
|
+
if (!e.current || !h.current) return;
|
|
1584
1933
|
t.preventDefault();
|
|
1585
1934
|
let n = e.current, r = n.parentElement;
|
|
1586
1935
|
if (!r) return;
|
|
1587
|
-
let { frameW: i, frameH:
|
|
1588
|
-
if (
|
|
1589
|
-
|
|
1936
|
+
let { frameW: i, frameH: a } = Tt(r);
|
|
1937
|
+
if (g.current) {
|
|
1938
|
+
o(t, n, i, a);
|
|
1590
1939
|
return;
|
|
1591
1940
|
}
|
|
1592
|
-
|
|
1593
|
-
}, 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));
|
|
1941
|
+
c(t, n, i, a);
|
|
1597
1942
|
}, o = (e, n, r, i) => {
|
|
1598
|
-
if (!
|
|
1599
|
-
let
|
|
1943
|
+
if (!h.current) return;
|
|
1944
|
+
let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY, l = Dt(Fe(g.current, f, d, h.current.x, h.current.y, o, c, r, i, Et(v.current, r, i), Et(_.current, r, i)), r, i);
|
|
1945
|
+
t(n, f ? l : Ie(l, d, a, s));
|
|
1946
|
+
}, c = (e, n, r, i) => {
|
|
1947
|
+
if (!h.current) return;
|
|
1948
|
+
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
1949
|
t(n, {
|
|
1601
|
-
x:
|
|
1602
|
-
y:
|
|
1950
|
+
x: Ct(a + d, 0, Math.max(0, 100 - s)),
|
|
1951
|
+
y: Ct(o + f, 0, Math.max(0, 100 - c)),
|
|
1603
1952
|
w: s,
|
|
1604
1953
|
h: c
|
|
1605
1954
|
});
|
|
1606
|
-
},
|
|
1607
|
-
e.current && (
|
|
1955
|
+
}, l = () => {
|
|
1956
|
+
e.current && (h.current = null, g.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
|
|
1608
1957
|
};
|
|
1609
1958
|
if (!e.current) return;
|
|
1610
1959
|
let u = new AbortController(), { signal: p } = u;
|
|
1611
1960
|
return e.current.addEventListener("mousedown", n, { signal: p }), e.current.addEventListener("touchstart", n, {
|
|
1612
1961
|
signal: p,
|
|
1613
1962
|
passive: !1
|
|
1614
|
-
}), document.addEventListener("mousemove",
|
|
1963
|
+
}), document.addEventListener("mousemove", i, { signal: p }), document.addEventListener("touchmove", i, {
|
|
1615
1964
|
signal: p,
|
|
1616
1965
|
passive: !1
|
|
1617
|
-
}), document.addEventListener("mouseup",
|
|
1966
|
+
}), document.addEventListener("mouseup", l, { signal: p }), document.addEventListener("touchend", l, { signal: p }), () => u.abort();
|
|
1618
1967
|
}, [
|
|
1619
1968
|
f,
|
|
1620
1969
|
d,
|
|
1621
|
-
|
|
1622
|
-
|
|
1970
|
+
a,
|
|
1971
|
+
s,
|
|
1623
1972
|
e,
|
|
1624
|
-
|
|
1973
|
+
r
|
|
1625
1974
|
]), {
|
|
1626
1975
|
handleCropStart: (t, n, r) => {
|
|
1627
1976
|
if (!e.current) return;
|
|
1628
|
-
t.stopPropagation(), t.preventDefault(),
|
|
1629
|
-
let
|
|
1630
|
-
|
|
1631
|
-
x:
|
|
1632
|
-
y:
|
|
1633
|
-
},
|
|
1977
|
+
t.stopPropagation(), t.preventDefault(), v.current = _.current;
|
|
1978
|
+
let a = "clientX" in t ? t.clientX : t.touches[0].clientX, o = "clientY" in t ? t.clientY : t.touches[0].clientY;
|
|
1979
|
+
h.current = {
|
|
1980
|
+
x: a,
|
|
1981
|
+
y: o
|
|
1982
|
+
}, g.current = n, i || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
|
|
1634
1983
|
},
|
|
1635
1984
|
initialCrop: p
|
|
1636
1985
|
};
|
|
1637
|
-
},
|
|
1638
|
-
className:
|
|
1639
|
-
children: /* @__PURE__ */ (0,
|
|
1640
|
-
className:
|
|
1986
|
+
}, kt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1987
|
+
className: Z.mobileBorder,
|
|
1988
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
1989
|
+
className: Z.mobilePointer,
|
|
1641
1990
|
onTouchStart: (t) => e(t, "br", "nwse")
|
|
1642
1991
|
})
|
|
1643
|
-
}),
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
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
|
-
}
|
|
1698
|
-
})]
|
|
1992
|
+
}), At = () => {
|
|
1993
|
+
let e = l(null), t = l(null), n = l(null), r = l(null), { currentAction: i, getLastHistoryItem: a, eventBus: s } = P(), { width: c, height: u } = a();
|
|
1994
|
+
return o(() => {
|
|
1995
|
+
if (!(i?.name === m.CROP || i?.name === m.PRESET_CROP)) return;
|
|
1996
|
+
let { xP: a, yP: o, wP: l, hP: d } = U(i.args.ratio, c, u);
|
|
1997
|
+
e.current && (e.current.textContent = a.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = l.toString()), r.current && (r.current.textContent = d.toString());
|
|
1998
|
+
let f = (i) => {
|
|
1999
|
+
let { x: a, y: o, w: s, h: c } = i.detail;
|
|
2000
|
+
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());
|
|
2001
|
+
};
|
|
2002
|
+
return s.addEventListener("crop-update", f), () => {
|
|
2003
|
+
s.removeEventListener("crop-update", f);
|
|
2004
|
+
};
|
|
2005
|
+
}, [
|
|
2006
|
+
i,
|
|
2007
|
+
u,
|
|
2008
|
+
c,
|
|
2009
|
+
s
|
|
2010
|
+
]), /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [
|
|
2011
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
2012
|
+
className: `${Z.info} ${Z.infoX}`,
|
|
2013
|
+
children: /* @__PURE__ */ (0, b.jsx)("b", { ref: e })
|
|
2014
|
+
}),
|
|
2015
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
2016
|
+
className: `${Z.info} ${Z.infoY}`,
|
|
2017
|
+
children: /* @__PURE__ */ (0, b.jsx)("b", { ref: t })
|
|
2018
|
+
}),
|
|
2019
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
2020
|
+
className: `${Z.info} ${Z.infoW}`,
|
|
2021
|
+
children: /* @__PURE__ */ (0, b.jsx)("b", { ref: n })
|
|
2022
|
+
}),
|
|
2023
|
+
/* @__PURE__ */ (0, b.jsx)("div", {
|
|
2024
|
+
className: `${Z.info} ${Z.infoH}`,
|
|
2025
|
+
children: /* @__PURE__ */ (0, b.jsx)("b", { ref: r })
|
|
2026
|
+
})
|
|
2027
|
+
] });
|
|
2028
|
+
}, jt = ke.map((e) => e.options).flat(), Mt = () => jt, Nt = () => {
|
|
2029
|
+
let { currentAction: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i, eventBus: a } = P(), { width: s, height: c } = t(), u = e?.name === m.PRESET_CROP && jt.some((t) => t.value === e.args.id) ? e.args.id : "", d = l({
|
|
2030
|
+
x: 0,
|
|
2031
|
+
y: 0,
|
|
2032
|
+
w: 0,
|
|
2033
|
+
h: 0
|
|
1699
2034
|
});
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
2035
|
+
return o(() => {
|
|
2036
|
+
if (e?.name !== m.PRESET_CROP) return;
|
|
2037
|
+
let t = U(e.args.ratio, s, c);
|
|
2038
|
+
d.current = t;
|
|
2039
|
+
let n = (e) => {
|
|
2040
|
+
d.current = e.detail;
|
|
2041
|
+
};
|
|
2042
|
+
return a.addEventListener("clip-path-update", n), () => {
|
|
2043
|
+
a.removeEventListener("clip-path-update", n);
|
|
2044
|
+
};
|
|
2045
|
+
}, [
|
|
2046
|
+
e,
|
|
2047
|
+
s,
|
|
2048
|
+
c,
|
|
2049
|
+
a
|
|
2050
|
+
]), {
|
|
2051
|
+
currentValue: u,
|
|
2052
|
+
presetsData: ke,
|
|
2053
|
+
handleChange: (e) => {
|
|
2054
|
+
if (!e) return;
|
|
2055
|
+
let t = Mt().find((t) => t.value === e);
|
|
2056
|
+
if (!t) return;
|
|
2057
|
+
let n = {
|
|
2058
|
+
id: e,
|
|
2059
|
+
ratio: t.w / t.h,
|
|
2060
|
+
isFree: !1,
|
|
2061
|
+
preset: {
|
|
2062
|
+
width: t.w,
|
|
2063
|
+
height: t.h
|
|
2064
|
+
}
|
|
2065
|
+
};
|
|
2066
|
+
i({
|
|
2067
|
+
name: m.PRESET_CROP,
|
|
2068
|
+
args: n
|
|
2069
|
+
});
|
|
2070
|
+
},
|
|
2071
|
+
handleSave: () => {
|
|
2072
|
+
!e || e.name !== m.PRESET_CROP || (n({
|
|
2073
|
+
width: e.args?.preset?.width || 0,
|
|
2074
|
+
height: e.args?.preset?.height || 0,
|
|
2075
|
+
action: {
|
|
2076
|
+
name: m.CROP,
|
|
2077
|
+
args: {
|
|
2078
|
+
...e.args,
|
|
2079
|
+
...d.current
|
|
1733
2080
|
}
|
|
1734
|
-
}), r(!0);
|
|
1735
|
-
},
|
|
1736
|
-
onClose: () => {
|
|
1737
|
-
i(null), r(!0);
|
|
1738
|
-
}
|
|
1739
|
-
})]
|
|
1740
|
-
});
|
|
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 : ""}`,
|
|
1745
|
-
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, {})
|
|
1752
|
-
]
|
|
1753
|
-
});
|
|
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
2081
|
}
|
|
1783
|
-
}),
|
|
2082
|
+
}), r(!0));
|
|
1784
2083
|
},
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
2084
|
+
handleClose: () => {
|
|
2085
|
+
i(null), r(!0);
|
|
2086
|
+
}
|
|
2087
|
+
};
|
|
2088
|
+
}, Pt = {
|
|
2089
|
+
preset: "_preset_1rbuc_1",
|
|
2090
|
+
select: "_select_1rbuc_14"
|
|
2091
|
+
}, Ft = () => {
|
|
2092
|
+
let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i } = Nt();
|
|
2093
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
2094
|
+
className: Pt.preset,
|
|
2095
|
+
children: [/* @__PURE__ */ (0, b.jsx)(be, {
|
|
2096
|
+
value: e,
|
|
2097
|
+
placeholder: "Select a preset",
|
|
2098
|
+
onChange: n,
|
|
2099
|
+
items: t,
|
|
2100
|
+
className: Pt.select
|
|
2101
|
+
}), /* @__PURE__ */ (0, b.jsx)(z, {
|
|
2102
|
+
onSave: r,
|
|
2103
|
+
onClose: i
|
|
1795
2104
|
})]
|
|
1796
2105
|
});
|
|
1797
|
-
},
|
|
1798
|
-
let {
|
|
1799
|
-
|
|
1800
|
-
name:
|
|
2106
|
+
}, It = () => {
|
|
2107
|
+
let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = P(), { width: i, height: a } = e(), [o, s] = u(!1), [c, l] = u(!1), d = (e, n) => {
|
|
2108
|
+
t({
|
|
2109
|
+
name: m.FLIP,
|
|
1801
2110
|
args: {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
isFree: e === "freeform"
|
|
2111
|
+
horizontal: e,
|
|
2112
|
+
vertical: n
|
|
1805
2113
|
}
|
|
1806
|
-
})
|
|
2114
|
+
});
|
|
1807
2115
|
};
|
|
1808
|
-
return
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
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
|
|
2116
|
+
return {
|
|
2117
|
+
flipHorizontal: o,
|
|
2118
|
+
flipVertical: c,
|
|
2119
|
+
handleFlipHorizontal: () => {
|
|
2120
|
+
let e = !o;
|
|
2121
|
+
s(e), d(e, c);
|
|
2122
|
+
},
|
|
2123
|
+
handleFlipVertical: () => {
|
|
2124
|
+
let e = !c;
|
|
2125
|
+
l(e), d(o, e);
|
|
2126
|
+
},
|
|
2127
|
+
handleSave: () => {
|
|
2128
|
+
n({
|
|
2129
|
+
width: i,
|
|
2130
|
+
height: a,
|
|
2131
|
+
action: {
|
|
2132
|
+
name: m.FLIP,
|
|
2133
|
+
args: {
|
|
2134
|
+
horizontal: o,
|
|
2135
|
+
vertical: c
|
|
1852
2136
|
}
|
|
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
2137
|
}
|
|
1874
|
-
}),
|
|
2138
|
+
}), r(!0);
|
|
1875
2139
|
},
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
2140
|
+
handleClose: () => {
|
|
2141
|
+
t(null), r(!0);
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
}, Q = {
|
|
2145
|
+
flip: "_flip_17ic5_1",
|
|
2146
|
+
btnH: "_btnH_17ic5_14",
|
|
2147
|
+
btnV: "_btnV_17ic5_20"
|
|
2148
|
+
}, Lt = () => {
|
|
2149
|
+
let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a } = It();
|
|
2150
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
2151
|
+
className: Q.flip,
|
|
2152
|
+
children: [/* @__PURE__ */ (0, b.jsx)("div", {
|
|
2153
|
+
className: Q.scGroup,
|
|
2154
|
+
children: /* @__PURE__ */ (0, b.jsxs)(V, {
|
|
2155
|
+
orientation: "horizontal",
|
|
2156
|
+
className: Q.tooltip,
|
|
2157
|
+
children: [/* @__PURE__ */ (0, b.jsx)(I, {
|
|
2158
|
+
variant: "outline",
|
|
2159
|
+
className: Q.btnH,
|
|
2160
|
+
onClick: n,
|
|
2161
|
+
"aria-label": "Horizontal",
|
|
2162
|
+
"data-tooltip": "Horizontal",
|
|
2163
|
+
children: /* @__PURE__ */ (0, b.jsx)(le, { style: { color: e ? "var(--accent-blue)" : "var(--foreground)" } })
|
|
2164
|
+
}), /* @__PURE__ */ (0, b.jsx)(I, {
|
|
2165
|
+
variant: "outline",
|
|
2166
|
+
className: Q.btnV,
|
|
2167
|
+
onClick: r,
|
|
2168
|
+
"aria-label": "Vertical",
|
|
2169
|
+
"data-tooltip": "Vertical",
|
|
2170
|
+
children: /* @__PURE__ */ (0, b.jsx)(ue, { style: { color: t ? "var(--accent-blue)" : "var(--foreground)" } })
|
|
2171
|
+
})]
|
|
2172
|
+
})
|
|
2173
|
+
}), /* @__PURE__ */ (0, b.jsx)(z, {
|
|
2174
|
+
disabled: !e && !t,
|
|
2175
|
+
onSave: i,
|
|
2176
|
+
onClose: a
|
|
2177
|
+
})]
|
|
1880
2178
|
});
|
|
1881
|
-
},
|
|
1882
|
-
let { getLastRotation: e,
|
|
1883
|
-
return
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
args: { degrees: e() }
|
|
1890
|
-
}), n(!1);
|
|
2179
|
+
}, Rt = () => {
|
|
2180
|
+
let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = P(), { width: a, height: o } = t(), s = e(), c = l(s), u = l(s);
|
|
2181
|
+
return {
|
|
2182
|
+
handleRotate: (e) => {
|
|
2183
|
+
u.current += e, i({
|
|
2184
|
+
name: m.ROTATE,
|
|
2185
|
+
args: { degrees: u.current }
|
|
2186
|
+
});
|
|
1891
2187
|
},
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
2188
|
+
handleSave: () => {
|
|
2189
|
+
n({
|
|
2190
|
+
...Le(a, o, c.current, u.current),
|
|
2191
|
+
action: {
|
|
2192
|
+
name: m.ROTATE,
|
|
2193
|
+
args: { degrees: u.current }
|
|
2194
|
+
}
|
|
2195
|
+
}), r(!0);
|
|
2196
|
+
},
|
|
2197
|
+
handleClose: () => {
|
|
2198
|
+
i(null), r(!0);
|
|
2199
|
+
}
|
|
2200
|
+
};
|
|
2201
|
+
}, $ = {
|
|
2202
|
+
rotate: "_rotate_gkt07_1",
|
|
2203
|
+
btnH: "_btnH_gkt07_14",
|
|
2204
|
+
btnV: "_btnV_gkt07_20"
|
|
2205
|
+
}, zt = () => {
|
|
2206
|
+
let { handleRotate: e, handleSave: t, handleClose: n } = Rt();
|
|
2207
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
2208
|
+
className: $.rotate,
|
|
2209
|
+
children: [/* @__PURE__ */ (0, b.jsx)("div", {
|
|
2210
|
+
className: $.scGroup,
|
|
2211
|
+
children: /* @__PURE__ */ (0, b.jsxs)(V, {
|
|
2212
|
+
orientation: "horizontal",
|
|
2213
|
+
className: $.tooltip,
|
|
2214
|
+
children: [/* @__PURE__ */ (0, b.jsx)(I, {
|
|
2215
|
+
variant: "outline",
|
|
2216
|
+
className: $.btnH,
|
|
2217
|
+
onClick: () => e(90),
|
|
2218
|
+
"aria-label": "+90°",
|
|
2219
|
+
"data-tooltip": "+90°",
|
|
2220
|
+
children: /* @__PURE__ */ (0, b.jsx)(de, {})
|
|
2221
|
+
}), /* @__PURE__ */ (0, b.jsx)(I, {
|
|
2222
|
+
variant: "outline",
|
|
2223
|
+
className: $.btnV,
|
|
2224
|
+
onClick: () => e(-90),
|
|
2225
|
+
"aria-label": "-90°",
|
|
2226
|
+
"data-tooltip": "-90°",
|
|
2227
|
+
children: /* @__PURE__ */ (0, b.jsx)(fe, {})
|
|
2228
|
+
})]
|
|
2229
|
+
})
|
|
2230
|
+
}), /* @__PURE__ */ (0, b.jsx)(z, {
|
|
2231
|
+
onSave: t,
|
|
2232
|
+
onClose: n
|
|
2233
|
+
})]
|
|
1896
2234
|
});
|
|
1897
|
-
},
|
|
1898
|
-
let {
|
|
1899
|
-
return /* @__PURE__ */ (0,
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
})
|
|
1928
|
-
]
|
|
2235
|
+
}, Bt = { frame: "_frame_15mog_1" }, Vt = () => {
|
|
2236
|
+
let { currentAction: e } = P(), t = e?.name === m.RESIZE, n = e?.name === m.CROP, r = e?.name === m.PRESET_CROP, i = e?.name === m.FLIP, a = e?.name === m.ROTATE, o = n || r;
|
|
2237
|
+
return /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
2238
|
+
className: `${Bt.frame} ${o ? R.mask : ""}`,
|
|
2239
|
+
children: [
|
|
2240
|
+
/* @__PURE__ */ (0, b.jsx)(ht, { style: o ? { opacity: .4 } : {} }),
|
|
2241
|
+
t && /* @__PURE__ */ (0, b.jsx)(pt, {}),
|
|
2242
|
+
(n || r) && /* @__PURE__ */ (0, b.jsx)(gt, {}, e?.args?.id),
|
|
2243
|
+
n && /* @__PURE__ */ (0, b.jsx)(bt, {}),
|
|
2244
|
+
r && /* @__PURE__ */ (0, b.jsx)(Ft, {}),
|
|
2245
|
+
i && /* @__PURE__ */ (0, b.jsx)(Lt, {}),
|
|
2246
|
+
a && /* @__PURE__ */ (0, b.jsx)(zt, {})
|
|
2247
|
+
]
|
|
2248
|
+
});
|
|
2249
|
+
}, Ht = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = h }) => {
|
|
2250
|
+
let [a, o] = u(null), s = O("sm", a), c = {
|
|
2251
|
+
...h,
|
|
2252
|
+
...i
|
|
2253
|
+
}, { loading: l, error: d, mimeType: f, width: p, height: m, originalBlob: g, previewUrl: _, isAlpha: v } = T({
|
|
2254
|
+
src: e,
|
|
2255
|
+
skip: c?.tools?.length === 0
|
|
2256
|
+
});
|
|
2257
|
+
return c?.tools?.length === 0 ? /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2258
|
+
className: `${R.root} ${R.wrapper}`,
|
|
2259
|
+
"data-theme": r,
|
|
2260
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2261
|
+
className: R.system,
|
|
2262
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2263
|
+
className: R.textRed,
|
|
2264
|
+
children: "No tools selected."
|
|
1929
2265
|
})
|
|
1930
2266
|
})
|
|
1931
|
-
})
|
|
1932
|
-
|
|
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}`,
|
|
2267
|
+
}) : l || d || !g || !f ? /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2268
|
+
className: `${R.root} ${R.wrapper}`,
|
|
1936
2269
|
"data-theme": r,
|
|
1937
|
-
children: /* @__PURE__ */ (0,
|
|
1938
|
-
className:
|
|
2270
|
+
children: /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
2271
|
+
className: R.system,
|
|
1939
2272
|
children: [
|
|
1940
|
-
|
|
2273
|
+
l && /* @__PURE__ */ (0, b.jsx)(ge, { style: {
|
|
1941
2274
|
width: 48,
|
|
1942
2275
|
height: 48
|
|
1943
2276
|
} }),
|
|
1944
|
-
|
|
1945
|
-
className:
|
|
1946
|
-
children:
|
|
2277
|
+
d && /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2278
|
+
className: R.textRed,
|
|
2279
|
+
children: d
|
|
1947
2280
|
}),
|
|
1948
|
-
!
|
|
1949
|
-
className:
|
|
2281
|
+
!l && !d && (!g || !f) && /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2282
|
+
className: R.textRed,
|
|
1950
2283
|
children: "Failed to load image."
|
|
1951
2284
|
})
|
|
1952
2285
|
]
|
|
1953
2286
|
})
|
|
1954
|
-
}) : /* @__PURE__ */ (0,
|
|
1955
|
-
mimeType:
|
|
1956
|
-
width:
|
|
1957
|
-
height:
|
|
1958
|
-
originalBlob:
|
|
1959
|
-
previewUrl:
|
|
1960
|
-
isAlpha:
|
|
1961
|
-
settings:
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
children: /* @__PURE__ */ (0, h.jsx)("div", {
|
|
1966
|
-
className: `${N.root} ${N.wrapper}`,
|
|
2287
|
+
}) : /* @__PURE__ */ (0, b.jsx)(x, {
|
|
2288
|
+
mimeType: f,
|
|
2289
|
+
width: p,
|
|
2290
|
+
height: m,
|
|
2291
|
+
originalBlob: g,
|
|
2292
|
+
previewUrl: _,
|
|
2293
|
+
isAlpha: v,
|
|
2294
|
+
settings: c,
|
|
2295
|
+
children: /* @__PURE__ */ (0, b.jsx)("div", {
|
|
2296
|
+
ref: o,
|
|
2297
|
+
className: `${R.root} ${R.wrapper}`,
|
|
1967
2298
|
"data-theme": r,
|
|
1968
|
-
children: /* @__PURE__ */ (0,
|
|
1969
|
-
className:
|
|
1970
|
-
children: [
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
2299
|
+
children: /* @__PURE__ */ (0, b.jsxs)("div", {
|
|
2300
|
+
className: `${c?.infobar ? R.grid : R.gridNoInfobar} ${s ? R.mobile : ""}`,
|
|
2301
|
+
children: [
|
|
2302
|
+
/* @__PURE__ */ (0, b.jsx)(Ze, {
|
|
2303
|
+
onSave: t,
|
|
2304
|
+
onBack: n,
|
|
2305
|
+
isMobile: s
|
|
2306
|
+
}),
|
|
2307
|
+
/* @__PURE__ */ (0, b.jsx)(tt, { isMobile: s }),
|
|
2308
|
+
c?.infobar && /* @__PURE__ */ (0, b.jsx)(it, {}),
|
|
2309
|
+
/* @__PURE__ */ (0, b.jsx)(Vt, {})
|
|
2310
|
+
]
|
|
1977
2311
|
})
|
|
1978
2312
|
})
|
|
1979
2313
|
});
|
|
1980
2314
|
};
|
|
1981
2315
|
//#endregion
|
|
1982
|
-
export {
|
|
2316
|
+
export { Ht as Pixedi };
|