pixedi 1.10.0 → 1.10.2
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 +9 -0
- package/dist/lib/Pixedi.d.ts +10 -0
- package/dist/lib/assets/icons.d.ts +27 -0
- package/dist/lib/constants.d.ts +6 -0
- package/dist/lib/crop/CropButtonGroup.d.ts +6 -0
- package/dist/lib/crop/CropInfo.d.ts +1 -0
- package/dist/lib/crop/CropInteractBox.d.ts +1 -0
- package/dist/lib/crop/CropLines.d.ts +1 -0
- package/dist/lib/crop/CropPointer.d.ts +7 -0
- package/dist/lib/crop/CropPointers.d.ts +6 -0
- package/dist/lib/crop/CropTools.d.ts +1 -0
- package/dist/lib/crop/index.d.ts +7 -0
- package/dist/lib/crop/useCrop.d.ts +7 -0
- package/dist/lib/crop/useCropInteraction.d.ts +9 -0
- package/dist/lib/eventBus.d.ts +6 -0
- package/dist/lib/filters/DefaultFilterValues.d.ts +2 -0
- package/dist/lib/filters/FilterInteractBox.d.ts +1 -0
- package/dist/lib/filters/FilterTools.d.ts +1 -0
- package/dist/lib/filters/UrlFilters.d.ts +1 -0
- package/dist/lib/filters/index.d.ts +3 -0
- package/dist/lib/filters/useFilterInteraction.d.ts +7 -0
- package/dist/lib/filters/useFilters.d.ts +20 -0
- package/dist/lib/flip/FlipTools.d.ts +1 -0
- package/dist/lib/flip/index.d.ts +1 -0
- package/dist/lib/flip/useFlip.d.ts +9 -0
- package/dist/lib/frame/Frame.d.ts +1 -0
- package/dist/lib/frame/index.d.ts +1 -0
- package/dist/lib/header/Header.d.ts +5 -0
- package/dist/lib/header/index.d.ts +1 -0
- package/dist/lib/hooks/index.d.ts +6 -0
- package/dist/lib/hooks/useAbove.d.ts +2 -0
- package/dist/lib/hooks/useBellow.d.ts +2 -0
- package/dist/lib/hooks/useImageLoader.d.ts +16 -0
- package/dist/lib/hooks/useImageSaving.d.ts +6 -0
- package/dist/lib/hooks/useMobile.d.ts +3 -0
- package/dist/lib/hooks/useToolCommit.d.ts +7 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +715 -892
- package/dist/lib/index.umd.cjs +33 -0
- package/dist/lib/infobar/Infobar.d.ts +1 -0
- package/dist/lib/infobar/index.d.ts +1 -0
- package/dist/lib/preset/PresetTools.d.ts +1 -0
- package/dist/lib/preset/index.d.ts +1 -0
- package/dist/lib/preset/usePreset.d.ts +8 -0
- package/dist/lib/preview/Preview.d.ts +8 -0
- package/dist/lib/preview/index.d.ts +1 -0
- package/dist/lib/preview/usePreview.d.ts +28 -0
- package/dist/lib/provider/PixediProvider.d.ts +15 -0
- package/dist/lib/provider/StoreContext.d.ts +20 -0
- package/dist/lib/provider/initialState.d.ts +16 -0
- package/dist/lib/provider/usePixediContext.d.ts +16 -0
- package/dist/lib/resize/ResizeTools.d.ts +1 -0
- package/dist/lib/resize/index.d.ts +1 -0
- package/dist/lib/resize/useResize.d.ts +15 -0
- package/dist/lib/rotate/RotateTools.d.ts +1 -0
- package/dist/lib/rotate/index.d.ts +1 -0
- package/dist/lib/rotate/useRotate.d.ts +6 -0
- package/dist/lib/sidebar/Sidebar.d.ts +5 -0
- package/dist/lib/sidebar/index.d.ts +1 -0
- package/dist/lib/sidebar/useSidebar.d.ts +11 -0
- package/dist/lib/types.d.ts +129 -0
- package/dist/lib/ui/button/Button.d.ts +7 -0
- package/dist/lib/ui/index.d.ts +10 -0
- package/dist/lib/ui/input/Input.d.ts +4 -0
- package/dist/lib/ui/input-pixel/InputPixel.d.ts +6 -0
- package/dist/lib/ui/save-close-group/SaveCloseGroup.d.ts +8 -0
- package/dist/lib/ui/select/Select.d.ts +11 -0
- package/dist/lib/ui/select/useSelect.d.ts +22 -0
- package/dist/lib/ui/separator/Separator.d.ts +4 -0
- package/dist/lib/ui/slider/Slider.d.ts +19 -0
- package/dist/lib/ui/surface-tool/SurfaceTool.d.ts +8 -0
- package/dist/lib/ui/surface-tool/SurfaceToolContext.d.ts +6 -0
- package/dist/lib/ui/surface-tool/SurfaceToolOffsetProvider.d.ts +5 -0
- package/dist/lib/ui/surface-tool/useSurfaceTool.d.ts +7 -0
- package/dist/lib/ui/tooltip/Tooltip.d.ts +11 -0
- package/dist/lib/ui/tooltip/useTooltip.d.ts +14 -0
- package/dist/lib/utils/canvas.d.ts +7 -0
- package/dist/lib/utils/crop.d.ts +10 -0
- package/dist/lib/utils/imageProcessor.d.ts +10 -0
- package/dist/lib/utils/preview.d.ts +42 -0
- package/dist/lib/workers/imageLoad.d.ts +1 -0
- package/package.json +12 -9
- package/dist/lib/index.umd.js +0 -38
package/dist/lib/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
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_c6inw_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) 65%, 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);--background-fade:color-mix(in srgb, var(--background) 65%, transparent);--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(95% 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);--surface-border:solid 1px transparent;position:relative}._root_c6inw_8[data-theme=dark]{--color-white-fade:color-mix(in srgb, var(--color-white) 45%, transparent);--background:oklch(24.5% 0 0);--background-fade:color-mix(in srgb, var(--background) 70%, transparent);--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(29.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);--surface-border:solid 1px var(--border)}._root_c6inw_8 h1,._root_c6inw_8 h2,._root_c6inw_8 h3,._root_c6inw_8 h4,._root_c6inw_8 h5,._root_c6inw_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_c6inw_78{color:var(--color-red)}._bgRed_c6inw_81{background-color:var(--color-red)}._bgGreen_c6inw_84{background-color:var(--color-green)}._textGreen_c6inw_87{color:var(--color-green)}._mask_c6inw_90{background-color:var(--overlay-bg)}._semibold_c6inw_93{letter-spacing:.4px;font-weight:600}._bold_c6inw_97{letter-spacing:.4px;font-weight:700}._system_c6inw_101{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_c6inw_111{width:100%;height:100%;min-height:480px;position:relative;overflow:hidden}._grid_c6inw_118{background:var(--background);grid-template:"header header"48px"sidebar frame"1fr"sidebar infobar"32px/48px 1fr;height:100%;display:grid;position:relative}._grid_c6inw_118._mobile_c6inw_130{grid-template-columns:0 1fr}._gridNoInfobar_c6inw_134{grid-template:"header header"48px"sidebar frame"1fr/48px 1fr;height:100%;display:grid;position:relative}._gridNoInfobar_c6inw_134._mobile_c6inw_130{grid-template-columns:0 1fr}._gridSingleTool_c6inw_149{grid-template:"frame"1fr/1fr;height:100%;display:grid;position:relative}._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}._sliderContainer_1unyb_1{cursor:pointer;touch-action:none;--slider-progress:0%;align-items:center;width:100%;height:24px;display:flex;position:relative}._sliderContainer_1unyb_1._disabled_1unyb_11{pointer-events:none;cursor:not-allowed;opacity:.5}._sliderContainer_1unyb_1:not(._disabled_1unyb_11):hover ._sliderThumb_1unyb_17{transform:translate(-50%,-50%)scale(1.1)}._sliderTrack_1unyb_22{background-color:color-mix(in oklch, var(--muted-foreground) 65%, transparent);border-radius:2px;width:100%;height:2px;position:relative}._sliderRange_1unyb_34{background-color:var(--primary);height:100%;width:var(--slider-progress);border-radius:2px;position:absolute}._sliderThumb_1unyb_17{top:50%;left:var(--slider-progress);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;transform:translate(-50%,-50%)}._sliderTooltip_1unyb_58{top:-40px;left:var(--slider-progress);background-color:var(--foreground);color:var(--background,#000);white-space:nowrap;pointer-events:none;z-index:2;border-radius:4px;padding:7px 10px 8px;font-size:12px;line-height:1;position:absolute;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._sliderTooltip_1unyb_58:after{content:"";background-color:var(--foreground);width:6px;height:6px;position:absolute;bottom:-2px;left:50%;transform:translate(-50%)rotate(45deg)}._hiddenInput_1unyb_86{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;margin:0;position:absolute;top:0;left:0}._tooltip_1rdl9_1{position:relative}._container_1rdl9_5{gap:0;display:flex}._container_1rdl9_5[data-position=left],._container_1rdl9_5[data-position=right]{flex-direction:column}._container_1rdl9_5 [data-tooltip]{pointer-events:auto}._popup_1rdl9_19{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_1rdl9_19:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=top]{transform:translate(-50%,-100%)}._popup_1rdl9_19[data-position=top]:before{top:auto;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=bottom]{transform:translate(-50%)}._popup_1rdl9_19[data-position=bottom]:before{top:-3px;bottom:auto;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=left]{transform:translate(-100%,-50%)}._popup_1rdl9_19[data-position=left]:before{top:50%;left:auto;right:-3px;transform:translateY(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=right]{transform:translateY(-50%)}._popup_1rdl9_19[data-position=right]:before{top:50%;left:-3px;right:auto;transform:translateY(-50%)rotate(45deg)}._popup_1rdl9_19._animated_1rdl9_92{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_1rdl9_101{border-radius:inherit;width:100%;height:100%;overflow:hidden}._track_1rdl9_108{width:max-content;height:max-content;transform:translateX(calc(-1 * var(--tooltip-offset,0px)));display:flex}._track_1rdl9_108[data-position=left],._track_1rdl9_108[data-position=right]{transform:translateY(calc(-1 * var(--tooltip-offset,0px)));flex-direction:column}._animated_1rdl9_92 ._track_1rdl9_108{transition:transform var(--tooltip-slide,.4s)}._title_1rdl9_125{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}._surfaceTool_1skmt_1{background-color:var(--background);border:var(--surface-border);color:var(--foreground);z-index:9;border-radius:4px;align-items:center;gap:4px;padding:4px;display:flex;position:absolute;bottom:16px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._content_1skmt_18{display:flex}._drag_1skmt_22{cursor:move;touch-action:none;-webkit-user-select:none;user-select:none;width:16px;height:16px;padding:0 2px}._tools_4u8qe_1{flex-direction:column}._row1_4u8qe_5{flex-direction:row;align-items:center;gap:4px;padding:4px;display:flex}._min_4u8qe_13{text-align:left;width:30px;font-size:14px}._slider_4u8qe_19{flex:1}._max_4u8qe_23{text-align:right;width:45px;font-size:14px}._row2_4u8qe_29{flex-direction:row;gap:4px;display:flex}._select_4u8qe_35{width:160px}._option_4u8qe_39{width:120px;height:32px}._option_4u8qe_39 img{object-fit:cover;width:100%;height:100%}._active_4u8qe_50{color:var(--accent-blue);background:var(--muted)}._filterInteract_4u8qe_55{max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._filterInteract_4u8qe_55>div:first-child{width:100%;max-width:100%;height:100%;max-height:100%}._compare_4u8qe_70{width:0;height:100%;position:absolute;top:0;transform:translate(-50%)}._compare_4u8qe_70:before{content:"";background:var(--accent-blue);width:1px;height:100%;position:absolute;top:0;left:-.5px}._compareThumb_4u8qe_88{background:var(--color-white);border:solid 1px var(--accent-blue);width:32px;height:32px;color:var(--accent-blue);cursor:pointer;border-radius:50%;justify-content:center;align-items:center;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._compareThumb_4u8qe_88 svg{width:20px;height:20px}._preview_t77n1_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear,clip-path;position:absolute;inset:0;overflow:hidden}._preview_t77n1_1._faded_t77n1_13{opacity:.5;filter:blur(2px)}._rotate_t77n1_19{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_t77n1_31{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_t77n1_39{max-width:none;max-height:none;transition:all .2s linear,filter;display:block;position:absolute}._label_t77n1_49{background:var(--color-white-fade);box-sizing:border-box;text-transform:uppercase;letter-spacing:1px;width:80px;height:28px;color:var(--color-black);z-index:3;justify-content:center;align-items:center;font-size:12px;font-weight:600;display:flex;position:absolute;top:8px}._before_t77n1_67{left:8px}._after_t77n1_71{right:8px}._header_m05h6_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_m05h6_12{align-items:center;gap:0;display:flex}._sidebarToggle_m05h6_17{border-right:solid 1px var(--border);width:48px;height:48px;color:var(--foreground);cursor:pointer;justify-content:center;align-items:center;transition:all .2s;display:none;position:relative;left:-8px}._sidebarToggle_m05h6_17._mobile_m05h6_30{display:flex}._sidebarIcon_m05h6_34{stroke-width:1.6px;width:18px;height:18px}._tools_m05h6_39{gap:8px;display:flex}._history_m05h6_43{align-items:center;gap:6px;display:flex}._historyText_m05h6_48{color:var(--muted-foreground);font-size:14px;font-family:var(--font-mono)}._sidebar_1lx29_1{background:var(--background-fade);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);border-right:1px solid var(--border);z-index:10;grid-area:sidebar;width:48px;position:relative}._sidebar_1lx29_1._mobile_1lx29_10{transition:transform .2s ease-out;transform:translate(-110%);box-shadow:0 2px 8px #0000001a}._sidebar_1lx29_1._mobile_1lx29_10._open_1lx29_15{transform:translate(0%)}._wrapper_1lx29_20{flex-direction:column;display:flex}._item_1lx29_24{cursor:pointer;height:48px;color:var(--foreground);justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative}._item_1lx29_24 svg{width:16px;height:16px}._item_1lx29_24:hover{background-color:var(--accent)}._item_1lx29_24._selected_1lx29_43{color:var(--accent-blue);background-color:var(--accent)}._item_1lx29_24._selected_1lx29_43:before{content:"";background-color:var(--accent-blue);width:2px;position:absolute;top:0;bottom:0;left:0}._infobar_1kq0f_1{background:var(--muted);border-top:solid 1px var(--border);font-family:var(--font-mono);color:var(--foreground);grid-area:infobar;justify-content:space-between;align-items:center;padding:0 16px;font-size:14px;display:flex}._resize_1sbig_1{align-items:center;padding-top:16px}._toolsLock_1sbig_5{width:12px;height:12px;color:var(--muted-foreground)}._indicatorWrapper_1sbig_10{justify-content:center;width:100%;height:2px;display:flex;position:absolute;top:0;left:0}._indicator_1sbig_10{background:var(--accent-blue);opacity:.6;border-radius:2px;width:30%;height:100%;transition:width .2s}._wrapper_1co2u_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_1co2u_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}._toolsInfo_1co2u_18{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_1co2u_25{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_1co2u_30{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_1co2u_35{pointer-events:none;position:absolute;inset:1px}._line_1co2u_35{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_1co2u_45{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_1co2u_53{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_1co2u_61{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_1co2u_67{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_1co2u_74{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_1co2u_81{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_1co2u_88{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_1co2u_95{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_1co2u_101{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_1co2u_112{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_1co2u_112 b{font-weight:600;transform:translateY(1px)}._infoX_1co2u_129{border-left:solid 2px var(--accent-blue);top:-12px;left:16px}._infoY_1co2u_134{transform-origin:100%;border-right:solid 2px var(--accent-blue);top:8px;right:calc(100% + 4px);transform:rotate(-90deg)}._infoW_1co2u_141{border-right:solid 2px var(--accent-blue);bottom:-12px;right:16px}._infoH_1co2u_146{transform-origin:0%;border-left:solid 2px var(--accent-blue);bottom:8px;left:calc(100% + 4px);transform:rotate(-90deg)}._group_1co2u_153{flex-shrink:0;width:max-content;display:flex}._group_1co2u_153 button{color:var(--foreground);border-radius:0}._group_1co2u_153 button._active_1co2u_162{color:var(--accent-blue);background:var(--muted)}._group_1co2u_153 button:not(:first-child){margin-left:-1px}._group_1co2u_153 button:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._group_1co2u_153 button:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}._select_1ieak_1{width:220px}._btnH_15adi_1{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_15adi_7{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_17rae_1{box-sizing:border-box;background:var(--background);grid-area:frame;width:100%;height:100%;margin:0 auto;position:relative;overflow:hidden}._bg-circled_17rae_12{background:radial-gradient(50% 50% at 100% 0, var(--background) 0% 5%, var(--muted) 6% 15%, var(--background) 16% 25%, var(--muted) 26% 35%, var(--background) 36% 45%, var(--muted) 46% 55%, var(--background) 56% 65%, var(--muted) 66% 75%, var(--background) 76% 85%, var(--muted) 86% 95%, #0000 96%), radial-gradient(50% 50% at 0 100%, var(--background) 0% 5%, var(--muted) 6% 15%, var(--background) 16% 25%, var(--muted) 26% 35%, var(--background) 36% 45%, var(--muted) 46% 55%, var(--background) 56% 65%, var(--muted) 66% 75%, var(--background) 76% 85%, var(--muted) 86% 95%, #0000 96%), radial-gradient(50% 50%, var(--background) 0% 5%, var(--muted) 6% 15%, var(--background) 16% 25%, var(--muted) 26% 35%, var(--background) 36% 45%, var(--muted) 46% 55%, var(--background) 56% 65%, var(--muted) 66% 75%, var(--background) 76% 85%, var(--muted) 86% 95%, #0000 96%), radial-gradient(50% 50%, var(--background) 0% 5%, var(--muted) 6% 15%, var(--background) 16% 25%, var(--muted) 26% 35%, var(--background) 36% 45%, var(--muted) 46% 55%, var(--background) 56% 65%, var(--muted) 66% 75%, var(--background) 76% 85%, var(--muted) 86% 95%, #0000 96%) calc(48px / 2) calc(48px / 2) var(--background);background-size:48px 48px}._bg-diagonals_17rae_74{background:linear-gradient(45deg, var(--muted) 12.5%, var(--background) 0 25%, #0000 0 75%, var(--background) 0 87.5%, var(--muted) 0) calc(55px / 2) calc(55px / 2), linear-gradient(45deg, var(--background) 12.5%, var(--muted) 0 25%, #0000 0 75%, var(--muted) 0 87.5%, var(--background) 0), repeating-linear-gradient(-45deg, var(--muted) 0 12.5%, var(--background) 0 25%, var(--muted) 0 37.5%, var(--background) 0 62.5%);background-size:55px 55px}._bg-rhombus_17rae_103{background:repeating-linear-gradient(45deg, #0000 calc(-650% / 13) calc(50% / 13), var(--muted) 0 calc(100% / 13), #0000 0 calc(150% / 13), var(--muted) 0 calc(200% / 13), #0000 0 calc(250% / 13), var(--muted) 0 calc(300% / 13)), repeating-linear-gradient(45deg, #0000 calc(-650% / 13) calc(50% / 13), var(--muted) 0 calc(100% / 13), #0000 0 calc(150% / 13), var(--muted) 0 calc(200% / 13), #0000 0 calc(250% / 13), var(--muted) 0 calc(300% / 13)) 36px 36px, repeating-linear-gradient(-45deg, #0000 calc(-650% / 13) calc(50% / 13), var(--muted) 0 calc(100% / 13), #0000 0 calc(150% / 13), var(--muted) 0 calc(200% / 13), #0000 0 calc(250% / 13), var(--muted) 0 calc(300% / 13)), repeating-linear-gradient(-45deg, #0000 calc(-650% / 13) calc(50% / 13), var(--muted) 0 calc(100% / 13), #0000 0 calc(150% / 13), var(--muted) 0 calc(200% / 13), #0000 0 calc(250% / 13), var(--muted) 0 calc(300% / 13)) 36px 36px var(--background);background-size:72px 72px}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
import { Children as e, createContext as t, forwardRef as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
}), m = 1920, h = .85, g = [
|
|
3
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
+
//#region src/shared/components/Pixedi/constants.ts
|
|
5
|
+
var h = 1920, g = .85, _ = [
|
|
8
6
|
{
|
|
9
7
|
label: "Facebook",
|
|
10
8
|
value: "facebook",
|
|
@@ -107,7 +105,7 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
107
105
|
}
|
|
108
106
|
]
|
|
109
107
|
}
|
|
110
|
-
],
|
|
108
|
+
], v = [
|
|
111
109
|
{
|
|
112
110
|
value: "saturate",
|
|
113
111
|
label: "Saturate",
|
|
@@ -178,7 +176,7 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
178
176
|
sliderValue: 100,
|
|
179
177
|
rightLabel: "100%"
|
|
180
178
|
}
|
|
181
|
-
],
|
|
179
|
+
], y = [
|
|
182
180
|
{
|
|
183
181
|
value: "vintage",
|
|
184
182
|
label: "Vintage"
|
|
@@ -219,182 +217,7 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
219
217
|
value: "x-ray",
|
|
220
218
|
label: "X-Ray"
|
|
221
219
|
}
|
|
222
|
-
],
|
|
223
|
-
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
224
|
-
function r(e, n, r) {
|
|
225
|
-
var i = null;
|
|
226
|
-
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
227
|
-
else r = n;
|
|
228
|
-
return n = r.ref, {
|
|
229
|
-
$$typeof: t,
|
|
230
|
-
type: e,
|
|
231
|
-
key: i,
|
|
232
|
-
ref: n === void 0 ? null : n,
|
|
233
|
-
props: r
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
237
|
-
})), b = /* @__PURE__ */ f(((e) => {
|
|
238
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
239
|
-
function t(e) {
|
|
240
|
-
if (e == null) return null;
|
|
241
|
-
if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
|
|
242
|
-
if (typeof e == "string") return e;
|
|
243
|
-
switch (e) {
|
|
244
|
-
case v: return "Fragment";
|
|
245
|
-
case b: return "Profiler";
|
|
246
|
-
case y: return "StrictMode";
|
|
247
|
-
case w: return "Suspense";
|
|
248
|
-
case T: return "SuspenseList";
|
|
249
|
-
case O: return "Activity";
|
|
250
|
-
}
|
|
251
|
-
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) {
|
|
252
|
-
case _: return "Portal";
|
|
253
|
-
case S: return e.displayName || "Context";
|
|
254
|
-
case x: return (e._context.displayName || "Context") + ".Consumer";
|
|
255
|
-
case C:
|
|
256
|
-
var n = e.render;
|
|
257
|
-
return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
258
|
-
case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
|
|
259
|
-
case D:
|
|
260
|
-
n = e._payload, e = e._init;
|
|
261
|
-
try {
|
|
262
|
-
return t(e(n));
|
|
263
|
-
} catch {}
|
|
264
|
-
}
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
function n(e) {
|
|
268
|
-
return "" + e;
|
|
269
|
-
}
|
|
270
|
-
function r(e) {
|
|
271
|
-
try {
|
|
272
|
-
n(e);
|
|
273
|
-
var t = !1;
|
|
274
|
-
} catch {
|
|
275
|
-
t = !0;
|
|
276
|
-
}
|
|
277
|
-
if (t) {
|
|
278
|
-
t = console;
|
|
279
|
-
var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
280
|
-
return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
function i(e) {
|
|
284
|
-
if (e === v) return "<>";
|
|
285
|
-
if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
|
|
286
|
-
try {
|
|
287
|
-
var n = t(e);
|
|
288
|
-
return n ? "<" + n + ">" : "<...>";
|
|
289
|
-
} catch {
|
|
290
|
-
return "<...>";
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function a() {
|
|
294
|
-
var e = A.A;
|
|
295
|
-
return e === null ? null : e.getOwner();
|
|
296
|
-
}
|
|
297
|
-
function o() {
|
|
298
|
-
return Error("react-stack-top-frame");
|
|
299
|
-
}
|
|
300
|
-
function s(e) {
|
|
301
|
-
if (ee.call(e, "key")) {
|
|
302
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
303
|
-
if (t && t.isReactWarning) return !1;
|
|
304
|
-
}
|
|
305
|
-
return e.key !== void 0;
|
|
306
|
-
}
|
|
307
|
-
function c(e, t) {
|
|
308
|
-
function n() {
|
|
309
|
-
ne || (ne = !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));
|
|
310
|
-
}
|
|
311
|
-
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
312
|
-
get: n,
|
|
313
|
-
configurable: !0
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
function l() {
|
|
317
|
-
var e = t(this.type);
|
|
318
|
-
return re[e] || (re[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;
|
|
319
|
-
}
|
|
320
|
-
function u(e, t, n, r, i, a) {
|
|
321
|
-
var o = n.ref;
|
|
322
|
-
return e = {
|
|
323
|
-
$$typeof: g,
|
|
324
|
-
type: e,
|
|
325
|
-
key: t,
|
|
326
|
-
props: n,
|
|
327
|
-
_owner: r
|
|
328
|
-
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
329
|
-
enumerable: !1,
|
|
330
|
-
value: null
|
|
331
|
-
}) : Object.defineProperty(e, "ref", {
|
|
332
|
-
enumerable: !1,
|
|
333
|
-
get: l
|
|
334
|
-
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
335
|
-
configurable: !1,
|
|
336
|
-
enumerable: !1,
|
|
337
|
-
writable: !0,
|
|
338
|
-
value: 0
|
|
339
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
340
|
-
configurable: !1,
|
|
341
|
-
enumerable: !1,
|
|
342
|
-
writable: !0,
|
|
343
|
-
value: null
|
|
344
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
345
|
-
configurable: !1,
|
|
346
|
-
enumerable: !1,
|
|
347
|
-
writable: !0,
|
|
348
|
-
value: i
|
|
349
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
350
|
-
configurable: !1,
|
|
351
|
-
enumerable: !1,
|
|
352
|
-
writable: !0,
|
|
353
|
-
value: a
|
|
354
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
355
|
-
}
|
|
356
|
-
function d(e, n, i, o, l, d) {
|
|
357
|
-
var p = n.children;
|
|
358
|
-
if (p !== void 0) if (o) if (te(p)) {
|
|
359
|
-
for (o = 0; o < p.length; o++) f(p[o]);
|
|
360
|
-
Object.freeze && Object.freeze(p);
|
|
361
|
-
} 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.");
|
|
362
|
-
else f(p);
|
|
363
|
-
if (ee.call(n, "key")) {
|
|
364
|
-
p = t(e);
|
|
365
|
-
var m = Object.keys(n).filter(function(e) {
|
|
366
|
-
return e !== "key";
|
|
367
|
-
});
|
|
368
|
-
o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", N[p + 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, p, m, p), N[p + o] = !0);
|
|
369
|
-
}
|
|
370
|
-
if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
|
|
371
|
-
else i = n;
|
|
372
|
-
return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
|
|
373
|
-
}
|
|
374
|
-
function f(e) {
|
|
375
|
-
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));
|
|
376
|
-
}
|
|
377
|
-
function m(e) {
|
|
378
|
-
return typeof e == "object" && !!e && e.$$typeof === g;
|
|
379
|
-
}
|
|
380
|
-
var h = p("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() {
|
|
381
|
-
return null;
|
|
382
|
-
};
|
|
383
|
-
h = { react_stack_bottom_frame: function(e) {
|
|
384
|
-
return e();
|
|
385
|
-
} };
|
|
386
|
-
var ne, re = {}, M = h.react_stack_bottom_frame.bind(h, o)(), ie = j(i(o)), N = {};
|
|
387
|
-
e.Fragment = v, e.jsx = function(e, t, n) {
|
|
388
|
-
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
389
|
-
return d(e, t, n, !1, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : ie);
|
|
390
|
-
}, e.jsxs = function(e, t, n) {
|
|
391
|
-
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
392
|
-
return d(e, t, n, !0, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : ie);
|
|
393
|
-
};
|
|
394
|
-
})();
|
|
395
|
-
})), x = (/* @__PURE__ */ f(((e, t) => {
|
|
396
|
-
process.env.NODE_ENV === "production" ? t.exports = y() : t.exports = b();
|
|
397
|
-
})))(), S = {
|
|
220
|
+
], b = {
|
|
398
221
|
xmlns: "http://w3.org",
|
|
399
222
|
width: "24",
|
|
400
223
|
height: "24",
|
|
@@ -404,50 +227,50 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
404
227
|
strokeWidth: "2",
|
|
405
228
|
strokeLinecap: "round",
|
|
406
229
|
strokeLinejoin: "round"
|
|
407
|
-
},
|
|
408
|
-
...
|
|
230
|
+
}, x = (e) => /* @__PURE__ */ p("svg", {
|
|
231
|
+
...b,
|
|
409
232
|
...e,
|
|
410
|
-
children: /* @__PURE__ */ (
|
|
411
|
-
}),
|
|
412
|
-
...
|
|
233
|
+
children: /* @__PURE__ */ p("path", { d: "M20 6 9 17l-5-5" })
|
|
234
|
+
}), S = (e) => /* @__PURE__ */ m("svg", {
|
|
235
|
+
...b,
|
|
413
236
|
...e,
|
|
414
|
-
children: [/* @__PURE__ */ (
|
|
415
|
-
}),
|
|
416
|
-
...
|
|
237
|
+
children: [/* @__PURE__ */ p("path", { d: "M18 6 6 18" }), /* @__PURE__ */ p("path", { d: "m6 6 12 12" })]
|
|
238
|
+
}), C = (e) => /* @__PURE__ */ m("svg", {
|
|
239
|
+
...b,
|
|
417
240
|
...e,
|
|
418
|
-
children: [/* @__PURE__ */ (
|
|
241
|
+
children: [/* @__PURE__ */ p("rect", {
|
|
419
242
|
width: "18",
|
|
420
243
|
height: "11",
|
|
421
244
|
x: "3",
|
|
422
245
|
y: "11",
|
|
423
246
|
rx: "2",
|
|
424
247
|
ry: "2"
|
|
425
|
-
}), /* @__PURE__ */ (
|
|
426
|
-
}),
|
|
427
|
-
...
|
|
248
|
+
}), /* @__PURE__ */ p("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
|
|
249
|
+
}), w = (e) => /* @__PURE__ */ m("svg", {
|
|
250
|
+
...b,
|
|
428
251
|
...e,
|
|
429
|
-
children: [/* @__PURE__ */ (
|
|
430
|
-
}),
|
|
431
|
-
...
|
|
252
|
+
children: [/* @__PURE__ */ p("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ p("path", { d: "M19 12H5" })]
|
|
253
|
+
}), T = (e) => /* @__PURE__ */ p("svg", {
|
|
254
|
+
...b,
|
|
432
255
|
...e,
|
|
433
|
-
children: /* @__PURE__ */ (
|
|
434
|
-
}),
|
|
435
|
-
...
|
|
256
|
+
children: /* @__PURE__ */ p("path", { d: "m6 9 6 6 6-6" })
|
|
257
|
+
}), E = (e) => /* @__PURE__ */ m("svg", {
|
|
258
|
+
...b,
|
|
436
259
|
...e,
|
|
437
|
-
children: [/* @__PURE__ */ (
|
|
438
|
-
}),
|
|
439
|
-
...
|
|
260
|
+
children: [/* @__PURE__ */ p("path", { d: "M3 7v6h6" }), /* @__PURE__ */ p("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
|
|
261
|
+
}), D = (e) => /* @__PURE__ */ m("svg", {
|
|
262
|
+
...b,
|
|
440
263
|
...e,
|
|
441
|
-
children: [/* @__PURE__ */ (
|
|
442
|
-
}),
|
|
443
|
-
...
|
|
264
|
+
children: [/* @__PURE__ */ p("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ p("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
|
|
265
|
+
}), O = (e) => /* @__PURE__ */ m("svg", {
|
|
266
|
+
...b,
|
|
444
267
|
...e,
|
|
445
|
-
children: [/* @__PURE__ */ (
|
|
446
|
-
}),
|
|
447
|
-
...
|
|
268
|
+
children: [/* @__PURE__ */ p("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ p("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
|
|
269
|
+
}), k = (e) => /* @__PURE__ */ m("svg", {
|
|
270
|
+
...b,
|
|
448
271
|
...e,
|
|
449
272
|
children: [
|
|
450
|
-
/* @__PURE__ */ (
|
|
273
|
+
/* @__PURE__ */ p("rect", {
|
|
451
274
|
width: "18",
|
|
452
275
|
height: "18",
|
|
453
276
|
x: "3",
|
|
@@ -455,52 +278,52 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
455
278
|
rx: "2",
|
|
456
279
|
ry: "2"
|
|
457
280
|
}),
|
|
458
|
-
/* @__PURE__ */ (
|
|
281
|
+
/* @__PURE__ */ p("circle", {
|
|
459
282
|
cx: "9",
|
|
460
283
|
cy: "9",
|
|
461
284
|
r: "2"
|
|
462
285
|
}),
|
|
463
|
-
/* @__PURE__ */ (
|
|
286
|
+
/* @__PURE__ */ p("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
464
287
|
]
|
|
465
|
-
}),
|
|
466
|
-
...
|
|
288
|
+
}), A = (e) => /* @__PURE__ */ p("svg", {
|
|
289
|
+
...b,
|
|
467
290
|
...e,
|
|
468
|
-
children: /* @__PURE__ */ (
|
|
291
|
+
children: /* @__PURE__ */ p("rect", {
|
|
469
292
|
width: "18",
|
|
470
293
|
height: "18",
|
|
471
294
|
x: "3",
|
|
472
295
|
y: "3",
|
|
473
296
|
rx: "2"
|
|
474
297
|
})
|
|
475
|
-
}),
|
|
476
|
-
...
|
|
298
|
+
}), ee = (e) => /* @__PURE__ */ p("svg", {
|
|
299
|
+
...b,
|
|
477
300
|
...e,
|
|
478
|
-
children: /* @__PURE__ */ (
|
|
301
|
+
children: /* @__PURE__ */ p("rect", {
|
|
479
302
|
width: "20",
|
|
480
303
|
height: "12",
|
|
481
304
|
x: "2",
|
|
482
305
|
y: "6",
|
|
483
306
|
rx: "2"
|
|
484
307
|
})
|
|
485
|
-
}),
|
|
486
|
-
...
|
|
308
|
+
}), te = (e) => /* @__PURE__ */ p("svg", {
|
|
309
|
+
...b,
|
|
487
310
|
...e,
|
|
488
|
-
children: /* @__PURE__ */ (
|
|
311
|
+
children: /* @__PURE__ */ p("rect", {
|
|
489
312
|
width: "20",
|
|
490
313
|
height: "15",
|
|
491
314
|
x: "2",
|
|
492
315
|
y: "4.5",
|
|
493
316
|
rx: "2"
|
|
494
317
|
})
|
|
495
|
-
}),
|
|
496
|
-
...
|
|
318
|
+
}), ne = (e) => /* @__PURE__ */ m("svg", {
|
|
319
|
+
...b,
|
|
497
320
|
...e,
|
|
498
321
|
children: [
|
|
499
|
-
/* @__PURE__ */ (
|
|
500
|
-
/* @__PURE__ */ (
|
|
501
|
-
/* @__PURE__ */ (
|
|
502
|
-
/* @__PURE__ */ (
|
|
503
|
-
/* @__PURE__ */ (
|
|
322
|
+
/* @__PURE__ */ p("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
|
|
323
|
+
/* @__PURE__ */ p("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
|
|
324
|
+
/* @__PURE__ */ p("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
|
|
325
|
+
/* @__PURE__ */ p("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
|
|
326
|
+
/* @__PURE__ */ p("rect", {
|
|
504
327
|
width: "10",
|
|
505
328
|
height: "8",
|
|
506
329
|
x: "7",
|
|
@@ -508,164 +331,164 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
508
331
|
rx: "1"
|
|
509
332
|
})
|
|
510
333
|
]
|
|
511
|
-
}),
|
|
512
|
-
...
|
|
334
|
+
}), re = (e) => /* @__PURE__ */ m("svg", {
|
|
335
|
+
...b,
|
|
513
336
|
...e,
|
|
514
337
|
children: [
|
|
515
|
-
/* @__PURE__ */ (
|
|
516
|
-
/* @__PURE__ */ (
|
|
517
|
-
/* @__PURE__ */ (
|
|
518
|
-
/* @__PURE__ */ (
|
|
519
|
-
/* @__PURE__ */ (
|
|
520
|
-
/* @__PURE__ */ (
|
|
338
|
+
/* @__PURE__ */ p("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
|
|
339
|
+
/* @__PURE__ */ p("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
|
|
340
|
+
/* @__PURE__ */ p("path", { d: "M12 20v2" }),
|
|
341
|
+
/* @__PURE__ */ p("path", { d: "M12 14v2" }),
|
|
342
|
+
/* @__PURE__ */ p("path", { d: "M12 8v2" }),
|
|
343
|
+
/* @__PURE__ */ p("path", { d: "M12 2v2" })
|
|
521
344
|
]
|
|
522
|
-
}), ie = (e) => /* @__PURE__ */ (
|
|
523
|
-
...
|
|
345
|
+
}), ie = (e) => /* @__PURE__ */ m("svg", {
|
|
346
|
+
...b,
|
|
524
347
|
...e,
|
|
525
348
|
children: [
|
|
526
|
-
/* @__PURE__ */ (
|
|
527
|
-
/* @__PURE__ */ (
|
|
528
|
-
/* @__PURE__ */ (
|
|
529
|
-
/* @__PURE__ */ (
|
|
530
|
-
/* @__PURE__ */ (
|
|
531
|
-
/* @__PURE__ */ (
|
|
349
|
+
/* @__PURE__ */ p("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
|
|
350
|
+
/* @__PURE__ */ p("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
|
|
351
|
+
/* @__PURE__ */ p("path", { d: "M4 12H2" }),
|
|
352
|
+
/* @__PURE__ */ p("path", { d: "M10 12H8" }),
|
|
353
|
+
/* @__PURE__ */ p("path", { d: "M16 12h-2" }),
|
|
354
|
+
/* @__PURE__ */ p("path", { d: "M22 12h-2" })
|
|
532
355
|
]
|
|
533
|
-
}),
|
|
534
|
-
...
|
|
356
|
+
}), ae = (e) => /* @__PURE__ */ m("svg", {
|
|
357
|
+
...b,
|
|
535
358
|
...e,
|
|
536
|
-
children: [/* @__PURE__ */ (
|
|
537
|
-
}),
|
|
538
|
-
...
|
|
359
|
+
children: [/* @__PURE__ */ p("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ p("path", { d: "M21 3v5h-5" })]
|
|
360
|
+
}), oe = (e) => /* @__PURE__ */ m("svg", {
|
|
361
|
+
...b,
|
|
539
362
|
...e,
|
|
540
|
-
children: [/* @__PURE__ */ (
|
|
541
|
-
}),
|
|
542
|
-
...
|
|
363
|
+
children: [/* @__PURE__ */ p("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ p("path", { d: "M3 3v5h5" })]
|
|
364
|
+
}), se = (e) => /* @__PURE__ */ m("svg", {
|
|
365
|
+
...b,
|
|
543
366
|
...e,
|
|
544
367
|
children: [
|
|
545
|
-
/* @__PURE__ */ (
|
|
368
|
+
/* @__PURE__ */ p("rect", {
|
|
546
369
|
width: "7",
|
|
547
370
|
height: "7",
|
|
548
371
|
x: "3",
|
|
549
372
|
y: "3",
|
|
550
373
|
rx: "1"
|
|
551
374
|
}),
|
|
552
|
-
/* @__PURE__ */ (
|
|
375
|
+
/* @__PURE__ */ p("rect", {
|
|
553
376
|
width: "7",
|
|
554
377
|
height: "7",
|
|
555
378
|
x: "3",
|
|
556
379
|
y: "14",
|
|
557
380
|
rx: "1"
|
|
558
381
|
}),
|
|
559
|
-
/* @__PURE__ */ (
|
|
560
|
-
/* @__PURE__ */ (
|
|
561
|
-
/* @__PURE__ */ (
|
|
562
|
-
/* @__PURE__ */ (
|
|
382
|
+
/* @__PURE__ */ p("path", { d: "M14 4h7" }),
|
|
383
|
+
/* @__PURE__ */ p("path", { d: "M14 9h7" }),
|
|
384
|
+
/* @__PURE__ */ p("path", { d: "M14 15h7" }),
|
|
385
|
+
/* @__PURE__ */ p("path", { d: "M14 20h7" })
|
|
563
386
|
]
|
|
564
|
-
}),
|
|
565
|
-
...
|
|
387
|
+
}), ce = (e) => /* @__PURE__ */ m("svg", {
|
|
388
|
+
...b,
|
|
566
389
|
...e,
|
|
567
390
|
children: [
|
|
568
|
-
/* @__PURE__ */ (
|
|
569
|
-
/* @__PURE__ */ (
|
|
570
|
-
/* @__PURE__ */ (
|
|
571
|
-
/* @__PURE__ */ (
|
|
572
|
-
/* @__PURE__ */ (
|
|
573
|
-
/* @__PURE__ */ (
|
|
574
|
-
/* @__PURE__ */ (
|
|
575
|
-
/* @__PURE__ */ (
|
|
576
|
-
/* @__PURE__ */ (
|
|
391
|
+
/* @__PURE__ */ p("path", { d: "M10 5H3" }),
|
|
392
|
+
/* @__PURE__ */ p("path", { d: "M12 19H3" }),
|
|
393
|
+
/* @__PURE__ */ p("path", { d: "M14 3v4" }),
|
|
394
|
+
/* @__PURE__ */ p("path", { d: "M16 17v4" }),
|
|
395
|
+
/* @__PURE__ */ p("path", { d: "M21 12h-9" }),
|
|
396
|
+
/* @__PURE__ */ p("path", { d: "M21 19h-5" }),
|
|
397
|
+
/* @__PURE__ */ p("path", { d: "M21 5h-7" }),
|
|
398
|
+
/* @__PURE__ */ p("path", { d: "M8 10v4" }),
|
|
399
|
+
/* @__PURE__ */ p("path", { d: "M8 12H3" })
|
|
577
400
|
]
|
|
578
|
-
}),
|
|
579
|
-
...
|
|
401
|
+
}), le = (e) => /* @__PURE__ */ m("svg", {
|
|
402
|
+
...b,
|
|
580
403
|
...e,
|
|
581
404
|
children: [
|
|
582
|
-
/* @__PURE__ */ (
|
|
405
|
+
/* @__PURE__ */ p("rect", {
|
|
583
406
|
width: "18",
|
|
584
407
|
height: "18",
|
|
585
408
|
x: "3",
|
|
586
409
|
y: "3",
|
|
587
410
|
rx: "2"
|
|
588
411
|
}),
|
|
589
|
-
/* @__PURE__ */ (
|
|
590
|
-
/* @__PURE__ */ (
|
|
412
|
+
/* @__PURE__ */ p("path", { d: "M9 3v18" }),
|
|
413
|
+
/* @__PURE__ */ p("path", { d: "m14 9 3 3-3 3" })
|
|
591
414
|
]
|
|
592
|
-
}),
|
|
593
|
-
...
|
|
415
|
+
}), ue = (e) => /* @__PURE__ */ m("svg", {
|
|
416
|
+
...b,
|
|
594
417
|
...e,
|
|
595
418
|
children: [
|
|
596
|
-
/* @__PURE__ */ (
|
|
419
|
+
/* @__PURE__ */ p("rect", {
|
|
597
420
|
width: "18",
|
|
598
421
|
height: "18",
|
|
599
422
|
x: "3",
|
|
600
423
|
y: "3",
|
|
601
424
|
rx: "2"
|
|
602
425
|
}),
|
|
603
|
-
/* @__PURE__ */ (
|
|
604
|
-
/* @__PURE__ */ (
|
|
426
|
+
/* @__PURE__ */ p("path", { d: "M9 3v18" }),
|
|
427
|
+
/* @__PURE__ */ p("path", { d: "m16 15-3-3 3-3" })
|
|
605
428
|
]
|
|
606
|
-
}),
|
|
607
|
-
...
|
|
429
|
+
}), de = (e) => /* @__PURE__ */ m("svg", {
|
|
430
|
+
...b,
|
|
608
431
|
...e,
|
|
609
432
|
children: [
|
|
610
|
-
/* @__PURE__ */ (
|
|
611
|
-
/* @__PURE__ */ (
|
|
612
|
-
/* @__PURE__ */ (
|
|
613
|
-
/* @__PURE__ */ (
|
|
614
|
-
/* @__PURE__ */ (
|
|
615
|
-
/* @__PURE__ */ (
|
|
616
|
-
/* @__PURE__ */ (
|
|
617
|
-
/* @__PURE__ */ (
|
|
618
|
-
/* @__PURE__ */ (
|
|
433
|
+
/* @__PURE__ */ p("path", { d: "M15 4V2" }),
|
|
434
|
+
/* @__PURE__ */ p("path", { d: "M15 16v-2" }),
|
|
435
|
+
/* @__PURE__ */ p("path", { d: "M8 9h2" }),
|
|
436
|
+
/* @__PURE__ */ p("path", { d: "M20 9h2" }),
|
|
437
|
+
/* @__PURE__ */ p("path", { d: "M17.8 11.8 19 13" }),
|
|
438
|
+
/* @__PURE__ */ p("path", { d: "M15 9h.01" }),
|
|
439
|
+
/* @__PURE__ */ p("path", { d: "M17.8 6.2 19 5" }),
|
|
440
|
+
/* @__PURE__ */ p("path", { d: "m3 21 9-9" }),
|
|
441
|
+
/* @__PURE__ */ p("path", { d: "M12.2 6.2 11 5" })
|
|
619
442
|
]
|
|
620
|
-
}),
|
|
621
|
-
...
|
|
443
|
+
}), fe = (e) => /* @__PURE__ */ m("svg", {
|
|
444
|
+
...b,
|
|
622
445
|
...e,
|
|
623
446
|
children: [
|
|
624
|
-
/* @__PURE__ */ (
|
|
625
|
-
/* @__PURE__ */ (
|
|
626
|
-
/* @__PURE__ */ (
|
|
447
|
+
/* @__PURE__ */ p("path", { d: "M12 3v18" }),
|
|
448
|
+
/* @__PURE__ */ p("path", { d: "m16 16 4-4-4-4" }),
|
|
449
|
+
/* @__PURE__ */ p("path", { d: "m8 8-4 4 4 4" })
|
|
627
450
|
]
|
|
628
|
-
}),
|
|
629
|
-
...
|
|
451
|
+
}), pe = (e) => /* @__PURE__ */ m("svg", {
|
|
452
|
+
...b,
|
|
630
453
|
...e,
|
|
631
454
|
children: [
|
|
632
|
-
/* @__PURE__ */ (
|
|
455
|
+
/* @__PURE__ */ p("circle", {
|
|
633
456
|
cx: "9",
|
|
634
457
|
cy: "12",
|
|
635
458
|
r: "1"
|
|
636
459
|
}),
|
|
637
|
-
/* @__PURE__ */ (
|
|
460
|
+
/* @__PURE__ */ p("circle", {
|
|
638
461
|
cx: "9",
|
|
639
462
|
cy: "5",
|
|
640
463
|
r: "1"
|
|
641
464
|
}),
|
|
642
|
-
/* @__PURE__ */ (
|
|
465
|
+
/* @__PURE__ */ p("circle", {
|
|
643
466
|
cx: "9",
|
|
644
467
|
cy: "19",
|
|
645
468
|
r: "1"
|
|
646
469
|
}),
|
|
647
|
-
/* @__PURE__ */ (
|
|
470
|
+
/* @__PURE__ */ p("circle", {
|
|
648
471
|
cx: "15",
|
|
649
472
|
cy: "12",
|
|
650
473
|
r: "1"
|
|
651
474
|
}),
|
|
652
|
-
/* @__PURE__ */ (
|
|
475
|
+
/* @__PURE__ */ p("circle", {
|
|
653
476
|
cx: "15",
|
|
654
477
|
cy: "5",
|
|
655
478
|
r: "1"
|
|
656
479
|
}),
|
|
657
|
-
/* @__PURE__ */ (
|
|
480
|
+
/* @__PURE__ */ p("circle", {
|
|
658
481
|
cx: "15",
|
|
659
482
|
cy: "19",
|
|
660
483
|
r: "1"
|
|
661
484
|
})
|
|
662
485
|
]
|
|
663
|
-
}),
|
|
664
|
-
...
|
|
486
|
+
}), me = (e) => /* @__PURE__ */ p("svg", {
|
|
487
|
+
...b,
|
|
665
488
|
...e,
|
|
666
|
-
children: /* @__PURE__ */ (
|
|
489
|
+
children: /* @__PURE__ */ p("path", {
|
|
667
490
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
668
|
-
children: /* @__PURE__ */ (
|
|
491
|
+
children: /* @__PURE__ */ p("animateTransform", {
|
|
669
492
|
attributeType: "xml",
|
|
670
493
|
attributeName: "transform",
|
|
671
494
|
type: "rotate",
|
|
@@ -675,27 +498,27 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
|
|
|
675
498
|
repeatCount: "indefinite"
|
|
676
499
|
})
|
|
677
500
|
})
|
|
678
|
-
}),
|
|
501
|
+
}), j = {
|
|
679
502
|
button: "_button_1vpzl_1",
|
|
680
503
|
default: "_default_1vpzl_35",
|
|
681
504
|
outline: "_outline_1vpzl_44",
|
|
682
505
|
ghost: "_ghost_1vpzl_54",
|
|
683
506
|
rect: "_rect_1vpzl_63"
|
|
684
|
-
},
|
|
507
|
+
}, M = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ p("button", {
|
|
685
508
|
ref: r,
|
|
686
|
-
className: `${
|
|
509
|
+
className: `${j.button} ${j[t]} ${e}`.trim(),
|
|
687
510
|
...i,
|
|
688
511
|
children: n
|
|
689
|
-
}),
|
|
512
|
+
}), he = { separator: "_separator_gp8ff_1" }, ge = n(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ p("hr", {
|
|
690
513
|
ref: r,
|
|
691
514
|
role: "separator",
|
|
692
515
|
"aria-orientation": t,
|
|
693
516
|
"data-orientation": t,
|
|
694
|
-
className: `${
|
|
517
|
+
className: `${he.separator} ${e}`.trim(),
|
|
695
518
|
...n
|
|
696
519
|
}));
|
|
697
|
-
|
|
698
|
-
var
|
|
520
|
+
ge.displayName = "Separator";
|
|
521
|
+
var N = {
|
|
699
522
|
wrapper: "_wrapper_1aw0m_1",
|
|
700
523
|
trigger: "_trigger_1aw0m_6",
|
|
701
524
|
triggerArrow: "_triggerArrow_1aw0m_31",
|
|
@@ -707,7 +530,7 @@ var I = {
|
|
|
707
530
|
itemRightContainer: "_itemRightContainer_1aw0m_122",
|
|
708
531
|
itemRight: "_itemRight_1aw0m_122",
|
|
709
532
|
itemCheck: "_itemCheck_1aw0m_131"
|
|
710
|
-
},
|
|
533
|
+
}, P = {
|
|
711
534
|
root: "_root_c6inw_8",
|
|
712
535
|
textRed: "_textRed_c6inw_78",
|
|
713
536
|
bgRed: "_bgRed_c6inw_81",
|
|
@@ -722,7 +545,7 @@ var I = {
|
|
|
722
545
|
mobile: "_mobile_c6inw_130",
|
|
723
546
|
gridNoInfobar: "_gridNoInfobar_c6inw_134",
|
|
724
547
|
gridSingleTool: "_gridSingleTool_c6inw_149"
|
|
725
|
-
},
|
|
548
|
+
}, _e = (e) => {
|
|
726
549
|
let t = 0, n = window.innerHeight;
|
|
727
550
|
for (let r = e.parentElement; r; r = r.parentElement) {
|
|
728
551
|
let { overflow: e, overflowY: i } = getComputedStyle(r);
|
|
@@ -734,7 +557,7 @@ var I = {
|
|
|
734
557
|
top: t,
|
|
735
558
|
bottom: n
|
|
736
559
|
};
|
|
737
|
-
},
|
|
560
|
+
}, ve = ({ items: e, value: t, onChange: n }) => {
|
|
738
561
|
let [r, i] = d(!1), a = u(null), s = u(null), f = u(null), p = l(() => {
|
|
739
562
|
let t = (e) => e.reduce((e, n) => n.options ? [...e, ...t(n.options.map((e) => ({
|
|
740
563
|
...e,
|
|
@@ -751,7 +574,7 @@ var I = {
|
|
|
751
574
|
let e = a.current, t = s.current, n = f.current;
|
|
752
575
|
if (!r || !e || !t || !n) return;
|
|
753
576
|
n.style.removeProperty("top"), n.style.removeProperty("max-height");
|
|
754
|
-
let { top: i, bottom: o } =
|
|
577
|
+
let { top: i, bottom: o } = _e(e), c = e.getBoundingClientRect().top, l = t.getBoundingClientRect(), u = n.offsetHeight, d = o - 8 - l.bottom - 4, p = l.top - 4 - i - 8, m = l.bottom + 4, h = 0;
|
|
755
578
|
u > d && (u <= p ? m = l.top - 4 - u : p > d ? (h = Math.max(p, 0), m = l.top - 4 - h) : h = Math.max(d, 0)), h && (n.style.maxHeight = `${h}px`), n.style.top = `${m - c}px`;
|
|
756
579
|
}, [r, e]), {
|
|
757
580
|
isOpen: r,
|
|
@@ -764,114 +587,114 @@ var I = {
|
|
|
764
587
|
},
|
|
765
588
|
toggleOpen: () => i((e) => !e)
|
|
766
589
|
};
|
|
767
|
-
},
|
|
768
|
-
let { isOpen: o, selectedLabel: s, containerRef: c, triggerRef: l, contentRef: u, handleSelectItem: d, toggleOpen: f } =
|
|
590
|
+
}, ye = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: i = "", renderOption: a }) => {
|
|
591
|
+
let { isOpen: o, selectedLabel: s, containerRef: c, triggerRef: l, contentRef: u, handleSelectItem: d, toggleOpen: f } = ve({
|
|
769
592
|
items: e,
|
|
770
593
|
value: t,
|
|
771
594
|
onChange: n
|
|
772
595
|
});
|
|
773
|
-
return /* @__PURE__ */ (
|
|
596
|
+
return /* @__PURE__ */ m("div", {
|
|
774
597
|
ref: c,
|
|
775
|
-
className: `${
|
|
598
|
+
className: `${N.wrapper} ${i}`.trim(),
|
|
776
599
|
"data-state": o ? "open" : "closed",
|
|
777
|
-
children: [/* @__PURE__ */ (
|
|
600
|
+
children: [/* @__PURE__ */ m("button", {
|
|
778
601
|
ref: l,
|
|
779
602
|
type: "button",
|
|
780
|
-
className:
|
|
603
|
+
className: N.trigger,
|
|
781
604
|
onClick: f,
|
|
782
|
-
children: [/* @__PURE__ */ (
|
|
783
|
-
}), /* @__PURE__ */ (
|
|
605
|
+
children: [/* @__PURE__ */ p("span", { children: s ?? r }), /* @__PURE__ */ p(T, { className: N.triggerArrow })]
|
|
606
|
+
}), /* @__PURE__ */ p("div", {
|
|
784
607
|
ref: u,
|
|
785
|
-
className:
|
|
786
|
-
children: e.map((e, n) => e.options ? /* @__PURE__ */ (
|
|
787
|
-
className: `${
|
|
608
|
+
className: N.content,
|
|
609
|
+
children: e.map((e, n) => e.options ? /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
|
|
610
|
+
className: `${N.groupLabel} ${P.semibold}`,
|
|
788
611
|
children: e.label
|
|
789
|
-
}), e.options.map((e) => /* @__PURE__ */ (
|
|
790
|
-
className:
|
|
612
|
+
}), e.options.map((e) => /* @__PURE__ */ m("div", {
|
|
613
|
+
className: N.item,
|
|
791
614
|
onClick: () => d(e.value),
|
|
792
|
-
children: [a ? a(e) : /* @__PURE__ */ (
|
|
793
|
-
className:
|
|
615
|
+
children: [a ? a(e) : /* @__PURE__ */ p("span", {
|
|
616
|
+
className: N.itemLeft,
|
|
794
617
|
children: e.label
|
|
795
|
-
}), /* @__PURE__ */ (
|
|
796
|
-
className:
|
|
618
|
+
}), /* @__PURE__ */ m("div", {
|
|
619
|
+
className: N.itemAddon,
|
|
797
620
|
children: [
|
|
798
|
-
e.rightLabel && /* @__PURE__ */ (
|
|
799
|
-
t === e.value && /* @__PURE__ */ (
|
|
800
|
-
t !== e.value && /* @__PURE__ */ (
|
|
621
|
+
e.rightLabel && /* @__PURE__ */ p("span", { children: e.rightLabel }),
|
|
622
|
+
t === e.value && /* @__PURE__ */ p(x, { className: N.itemCheck }),
|
|
623
|
+
t !== e.value && /* @__PURE__ */ p("b", {})
|
|
801
624
|
]
|
|
802
625
|
})]
|
|
803
|
-
}, e.value))] }, `group-${n}`) : /* @__PURE__ */ (
|
|
804
|
-
className:
|
|
626
|
+
}, e.value))] }, `group-${n}`) : /* @__PURE__ */ m("div", {
|
|
627
|
+
className: N.item,
|
|
805
628
|
onClick: () => d(e.value),
|
|
806
|
-
children: [a ? a(e) : /* @__PURE__ */ (
|
|
807
|
-
className:
|
|
629
|
+
children: [a ? a(e) : /* @__PURE__ */ p("span", {
|
|
630
|
+
className: N.itemLeft,
|
|
808
631
|
children: e.label
|
|
809
|
-
}), /* @__PURE__ */ (
|
|
810
|
-
className:
|
|
632
|
+
}), /* @__PURE__ */ m("div", {
|
|
633
|
+
className: N.itemAddon,
|
|
811
634
|
children: [
|
|
812
|
-
e.rightLabel && /* @__PURE__ */ (
|
|
813
|
-
t === e.value && /* @__PURE__ */ (
|
|
814
|
-
t !== e.value && /* @__PURE__ */ (
|
|
635
|
+
e.rightLabel && /* @__PURE__ */ p("span", { children: e.rightLabel }),
|
|
636
|
+
t === e.value && /* @__PURE__ */ p(x, { className: N.itemCheck }),
|
|
637
|
+
t !== e.value && /* @__PURE__ */ p("b", {})
|
|
815
638
|
]
|
|
816
639
|
})]
|
|
817
640
|
}, e.value))
|
|
818
641
|
})]
|
|
819
642
|
});
|
|
820
|
-
},
|
|
643
|
+
}, be = {
|
|
821
644
|
input: "_input_kyavx_1",
|
|
822
645
|
numberClean: "_numberClean_kyavx_39"
|
|
823
|
-
},
|
|
824
|
-
let a = t === "number" && n ?
|
|
825
|
-
return /* @__PURE__ */ (
|
|
646
|
+
}, xe = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
|
|
647
|
+
let a = t === "number" && n ? be.numberClean : "";
|
|
648
|
+
return /* @__PURE__ */ p("input", {
|
|
826
649
|
ref: r,
|
|
827
650
|
type: t,
|
|
828
|
-
className: `${
|
|
651
|
+
className: `${be.input} ${a} ${e}`.trim(),
|
|
829
652
|
...i
|
|
830
653
|
});
|
|
831
|
-
},
|
|
654
|
+
}, Se = {
|
|
832
655
|
container: "_container_14vsv_1",
|
|
833
656
|
legend: "_legend_14vsv_4",
|
|
834
657
|
suffix: "_suffix_14vsv_13"
|
|
835
|
-
},
|
|
836
|
-
className: `${
|
|
658
|
+
}, Ce = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ m("div", {
|
|
659
|
+
className: `${Se.container} ${t}`.trim(),
|
|
837
660
|
style: n,
|
|
838
661
|
children: [
|
|
839
|
-
/* @__PURE__ */ (
|
|
840
|
-
className:
|
|
662
|
+
/* @__PURE__ */ p("span", {
|
|
663
|
+
className: Se.legend,
|
|
841
664
|
children: e
|
|
842
665
|
}),
|
|
843
|
-
/* @__PURE__ */ (
|
|
666
|
+
/* @__PURE__ */ p(xe, {
|
|
844
667
|
ref: r,
|
|
845
668
|
type: "number",
|
|
846
669
|
...i
|
|
847
670
|
}),
|
|
848
|
-
/* @__PURE__ */ (
|
|
849
|
-
className:
|
|
671
|
+
/* @__PURE__ */ p("span", {
|
|
672
|
+
className: Se.suffix,
|
|
850
673
|
children: "px"
|
|
851
674
|
})
|
|
852
675
|
]
|
|
853
|
-
}),
|
|
676
|
+
}), we = {
|
|
854
677
|
group: "_group_1e7jm_1",
|
|
855
678
|
save: "_save_1e7jm_6",
|
|
856
679
|
close: "_close_1e7jm_13"
|
|
857
|
-
},
|
|
858
|
-
className:
|
|
859
|
-
children: [/* @__PURE__ */ (
|
|
680
|
+
}, F = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ m("div", {
|
|
681
|
+
className: we.group,
|
|
682
|
+
children: [/* @__PURE__ */ p(M, {
|
|
860
683
|
variant: "outline",
|
|
861
|
-
className:
|
|
684
|
+
className: we.save,
|
|
862
685
|
"aria-label": "Save",
|
|
863
686
|
disabled: r || n,
|
|
864
687
|
onClick: e,
|
|
865
|
-
children: n ?
|
|
866
|
-
}), /* @__PURE__ */ (
|
|
688
|
+
children: p(n ? me : x, {})
|
|
689
|
+
}), /* @__PURE__ */ p(M, {
|
|
867
690
|
variant: "outline",
|
|
868
|
-
className:
|
|
691
|
+
className: we.close,
|
|
869
692
|
"aria-label": "Close",
|
|
870
693
|
disabled: n,
|
|
871
694
|
onClick: t,
|
|
872
|
-
children: /* @__PURE__ */ (
|
|
695
|
+
children: /* @__PURE__ */ p(S, {})
|
|
873
696
|
})]
|
|
874
|
-
}),
|
|
697
|
+
}), I = {
|
|
875
698
|
sliderContainer: "_sliderContainer_1unyb_1",
|
|
876
699
|
disabled: "_disabled_1unyb_11",
|
|
877
700
|
sliderThumb: "_sliderThumb_1unyb_17",
|
|
@@ -879,10 +702,10 @@ var I = {
|
|
|
879
702
|
sliderRange: "_sliderRange_1unyb_34",
|
|
880
703
|
sliderTooltip: "_sliderTooltip_1unyb_58",
|
|
881
704
|
hiddenInput: "_hiddenInput_1unyb_86"
|
|
882
|
-
},
|
|
705
|
+
}, Te = (e, t, n) => {
|
|
883
706
|
let r = n - t;
|
|
884
707
|
return r <= 0 ? 0 : (e - t) / r * 100;
|
|
885
|
-
},
|
|
708
|
+
}, Ee = /* @__PURE__ */ new Set([
|
|
886
709
|
"ArrowDown",
|
|
887
710
|
"ArrowLeft",
|
|
888
711
|
"ArrowRight",
|
|
@@ -891,63 +714,63 @@ var I = {
|
|
|
891
714
|
"Home",
|
|
892
715
|
"PageDown",
|
|
893
716
|
"PageUp"
|
|
894
|
-
]),
|
|
895
|
-
let
|
|
896
|
-
s(
|
|
897
|
-
let
|
|
898
|
-
|
|
899
|
-
let r =
|
|
900
|
-
|
|
901
|
-
},
|
|
902
|
-
!i &&
|
|
717
|
+
]), De = ({ min: e, max: t, value: n, step: r = 1, disabled: i = !1, isTooltip: a = !1, unit: o = "", className: l, onChange: f, onInput: h, ref: g }) => {
|
|
718
|
+
let _ = u(null), v = u(null), y = n ?? e, [b, x] = d(y);
|
|
719
|
+
s(g, () => ({ getValue: () => b }), [b]);
|
|
720
|
+
let S = (n) => {
|
|
721
|
+
x(n);
|
|
722
|
+
let r = Te(n, e, t);
|
|
723
|
+
_.current?.style.setProperty("--slider-progress", `${r}%`);
|
|
724
|
+
}, C = () => {
|
|
725
|
+
!i && v.current && f?.(Number(v.current.value));
|
|
903
726
|
};
|
|
904
727
|
return c(() => {
|
|
905
|
-
if (!
|
|
906
|
-
n !== void 0 && (
|
|
907
|
-
let r = Number(
|
|
908
|
-
|
|
909
|
-
let i =
|
|
910
|
-
|
|
728
|
+
if (!v.current) return;
|
|
729
|
+
n !== void 0 && (v.current.value = String(n));
|
|
730
|
+
let r = Number(v.current.value);
|
|
731
|
+
x(r);
|
|
732
|
+
let i = Te(r, e, t);
|
|
733
|
+
_.current?.style.setProperty("--slider-progress", `${i}%`);
|
|
911
734
|
}, [
|
|
912
735
|
n,
|
|
913
736
|
e,
|
|
914
737
|
t
|
|
915
|
-
]), /* @__PURE__ */ (
|
|
916
|
-
ref:
|
|
917
|
-
className: `${
|
|
918
|
-
style: { "--slider-progress": `${
|
|
919
|
-
children: [/* @__PURE__ */ (
|
|
920
|
-
className:
|
|
738
|
+
]), /* @__PURE__ */ m("div", {
|
|
739
|
+
ref: _,
|
|
740
|
+
className: `${I.sliderContainer} ${i ? I.disabled : ""} ${l || ""}`,
|
|
741
|
+
style: { "--slider-progress": `${Te(y, e, t)}%` },
|
|
742
|
+
children: [/* @__PURE__ */ m("div", {
|
|
743
|
+
className: I.sliderTrack,
|
|
921
744
|
children: [
|
|
922
|
-
/* @__PURE__ */ (
|
|
923
|
-
/* @__PURE__ */ (
|
|
924
|
-
a && /* @__PURE__ */ (
|
|
925
|
-
className:
|
|
926
|
-
children: `${
|
|
745
|
+
/* @__PURE__ */ p("div", { className: I.sliderRange }),
|
|
746
|
+
/* @__PURE__ */ p("div", { className: I.sliderThumb }),
|
|
747
|
+
a && /* @__PURE__ */ p("div", {
|
|
748
|
+
className: I.sliderTooltip,
|
|
749
|
+
children: `${b}${o}`
|
|
927
750
|
})
|
|
928
751
|
]
|
|
929
|
-
}), /* @__PURE__ */ (
|
|
930
|
-
ref:
|
|
752
|
+
}), /* @__PURE__ */ p("input", {
|
|
753
|
+
ref: v,
|
|
931
754
|
type: "range",
|
|
932
755
|
min: e,
|
|
933
756
|
max: t,
|
|
934
757
|
step: r,
|
|
935
|
-
defaultValue:
|
|
758
|
+
defaultValue: y,
|
|
936
759
|
disabled: i,
|
|
937
760
|
onInput: (e) => {
|
|
938
761
|
let t = Number(e.currentTarget.value);
|
|
939
|
-
|
|
762
|
+
S(t), h?.(t);
|
|
940
763
|
},
|
|
941
764
|
onPointerUp: () => {
|
|
942
|
-
|
|
765
|
+
C();
|
|
943
766
|
},
|
|
944
767
|
onKeyUp: (e) => {
|
|
945
|
-
|
|
768
|
+
Ee.has(e.key) && C();
|
|
946
769
|
},
|
|
947
|
-
className:
|
|
770
|
+
className: I.hiddenInput
|
|
948
771
|
})]
|
|
949
772
|
});
|
|
950
|
-
},
|
|
773
|
+
}, L = {
|
|
951
774
|
tooltip: "_tooltip_1rdl9_1",
|
|
952
775
|
container: "_container_1rdl9_5",
|
|
953
776
|
popup: "_popup_1rdl9_19",
|
|
@@ -955,7 +778,7 @@ var I = {
|
|
|
955
778
|
mask: "_mask_1rdl9_101",
|
|
956
779
|
track: "_track_1rdl9_108",
|
|
957
780
|
title: "_title_1rdl9_125"
|
|
958
|
-
},
|
|
781
|
+
}, Oe = (t, n = "top") => {
|
|
959
782
|
let [i, a] = d(null), [s, f] = d(null), [p, m] = d(!1), [h, g] = d(!1), [_, v] = d([]), y = u(null), b = u(null), x = u([]), S = n === "left" || n === "right", C = l(() => {
|
|
960
783
|
let n = [];
|
|
961
784
|
return e.forEach(t, (e) => {
|
|
@@ -1027,59 +850,59 @@ var I = {
|
|
|
1027
850
|
handleMouseMove: E,
|
|
1028
851
|
handleMouseLeave: D
|
|
1029
852
|
};
|
|
1030
|
-
},
|
|
1031
|
-
let { containerRef: a, trackRef: o, titleRefs: s, titles: c, isAnimated: l, cssVars: u, handleMouseMove: d, handleMouseLeave: f } =
|
|
1032
|
-
return /* @__PURE__ */ (
|
|
853
|
+
}, R = ({ children: e, position: t = "top", className: n = "", classNameTitle: r = "", style: i }) => {
|
|
854
|
+
let { containerRef: a, trackRef: o, titleRefs: s, titles: c, isAnimated: l, cssVars: u, handleMouseMove: d, handleMouseLeave: f } = Oe(e, t);
|
|
855
|
+
return /* @__PURE__ */ m("div", {
|
|
1033
856
|
ref: a,
|
|
1034
857
|
onMouseMove: d,
|
|
1035
858
|
onMouseLeave: f,
|
|
1036
859
|
onBlur: f,
|
|
1037
|
-
className:
|
|
860
|
+
className: L.tooltip,
|
|
1038
861
|
style: {
|
|
1039
862
|
...u,
|
|
1040
863
|
...i
|
|
1041
864
|
},
|
|
1042
|
-
children: [/* @__PURE__ */ (
|
|
865
|
+
children: [/* @__PURE__ */ p("div", {
|
|
1043
866
|
"data-position": t,
|
|
1044
|
-
className: `${
|
|
867
|
+
className: `${L.container} ${n}`,
|
|
1045
868
|
children: e
|
|
1046
|
-
}), /* @__PURE__ */ (
|
|
869
|
+
}), /* @__PURE__ */ p("div", {
|
|
1047
870
|
"aria-hidden": "true",
|
|
1048
871
|
"data-position": t,
|
|
1049
|
-
className: `${
|
|
1050
|
-
children: /* @__PURE__ */ (
|
|
1051
|
-
className:
|
|
1052
|
-
children: /* @__PURE__ */ (
|
|
872
|
+
className: `${L.popup} ${l ? L.animated : ""}`,
|
|
873
|
+
children: /* @__PURE__ */ p("div", {
|
|
874
|
+
className: L.mask,
|
|
875
|
+
children: /* @__PURE__ */ p("div", {
|
|
1053
876
|
ref: o,
|
|
1054
877
|
"data-position": t,
|
|
1055
|
-
className:
|
|
1056
|
-
children: c.map((e, t) => /* @__PURE__ */ (
|
|
878
|
+
className: L.track,
|
|
879
|
+
children: c.map((e, t) => /* @__PURE__ */ p("div", {
|
|
1057
880
|
ref: (e) => {
|
|
1058
881
|
s.current[t] = e;
|
|
1059
882
|
},
|
|
1060
|
-
className: `${
|
|
883
|
+
className: `${L.title} ${r}`,
|
|
1061
884
|
children: e
|
|
1062
885
|
}, t))
|
|
1063
886
|
})
|
|
1064
887
|
})
|
|
1065
888
|
})]
|
|
1066
889
|
});
|
|
1067
|
-
},
|
|
1068
|
-
function
|
|
890
|
+
}, ke = "(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.`})}}})();", Ae = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", ke], { type: "text/javascript;charset=utf-8" });
|
|
891
|
+
function je(e) {
|
|
1069
892
|
let t;
|
|
1070
893
|
try {
|
|
1071
|
-
if (t =
|
|
894
|
+
if (t = Ae && (self.URL || self.webkitURL).createObjectURL(Ae), !t) throw "";
|
|
1072
895
|
let n = new Worker(t, { name: e?.name });
|
|
1073
896
|
return n.addEventListener("error", () => {
|
|
1074
897
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
1075
898
|
}), n;
|
|
1076
899
|
} catch {
|
|
1077
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
900
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(ke), { name: e?.name });
|
|
1078
901
|
}
|
|
1079
902
|
}
|
|
1080
903
|
//#endregion
|
|
1081
904
|
//#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
|
|
1082
|
-
var
|
|
905
|
+
var Me = ({ src: e, skip: t = !1 }) => {
|
|
1083
906
|
let [n, r] = d({
|
|
1084
907
|
loading: !t,
|
|
1085
908
|
error: "",
|
|
@@ -1092,7 +915,7 @@ var je = ({ src: e, skip: t = !1 }) => {
|
|
|
1092
915
|
}), i = u(null);
|
|
1093
916
|
return o(() => {
|
|
1094
917
|
if (!e || t) return;
|
|
1095
|
-
let n = new
|
|
918
|
+
let n = new je();
|
|
1096
919
|
return n.postMessage(e), n.onmessage = (e) => {
|
|
1097
920
|
let t = e.data;
|
|
1098
921
|
t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), r({
|
|
@@ -1113,19 +936,19 @@ var je = ({ src: e, skip: t = !1 }) => {
|
|
|
1113
936
|
n.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
|
|
1114
937
|
};
|
|
1115
938
|
}, [t, e]), n;
|
|
1116
|
-
},
|
|
939
|
+
}, Ne = () => {
|
|
1117
940
|
if (typeof window > "u" || !window.navigator) return null;
|
|
1118
941
|
let e = window.navigator.userAgent.toLowerCase();
|
|
1119
942
|
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;
|
|
1120
|
-
},
|
|
1121
|
-
let [e] = d(() =>
|
|
943
|
+
}, Pe = () => {
|
|
944
|
+
let [e] = d(() => Ne());
|
|
1122
945
|
return e;
|
|
1123
|
-
},
|
|
946
|
+
}, Fe = {
|
|
1124
947
|
sm: 480,
|
|
1125
948
|
md: 768,
|
|
1126
949
|
lg: 1024,
|
|
1127
950
|
xl: 1280
|
|
1128
|
-
},
|
|
951
|
+
}, z = {
|
|
1129
952
|
INITIAL: "initial",
|
|
1130
953
|
RESIZE: "resize",
|
|
1131
954
|
CROP: "crop",
|
|
@@ -1136,29 +959,29 @@ var je = ({ src: e, skip: t = !1 }) => {
|
|
|
1136
959
|
};
|
|
1137
960
|
//#endregion
|
|
1138
961
|
//#region src/shared/components/Pixedi/hooks/useBellow.tsx
|
|
1139
|
-
function
|
|
962
|
+
function Ie(e, t) {
|
|
1140
963
|
let [n, r] = d(!0);
|
|
1141
964
|
return o(() => {
|
|
1142
965
|
if (!t) return;
|
|
1143
966
|
let n = new ResizeObserver(([t]) => {
|
|
1144
|
-
t && r(t.contentRect.width <
|
|
967
|
+
t && r(t.contentRect.width < Fe[e]);
|
|
1145
968
|
});
|
|
1146
969
|
return n.observe(t), () => n.disconnect();
|
|
1147
970
|
}, [e, t]), n;
|
|
1148
971
|
}
|
|
1149
972
|
//#endregion
|
|
1150
973
|
//#region src/shared/components/Pixedi/provider/StoreContext.tsx
|
|
1151
|
-
var
|
|
1152
|
-
let e = a(
|
|
974
|
+
var Le = t(void 0), B = () => {
|
|
975
|
+
let e = a(Le);
|
|
1153
976
|
if (!e) throw Error("usePixediContext must be used within an PixediProvider");
|
|
1154
977
|
return e;
|
|
1155
|
-
},
|
|
978
|
+
}, V = 32, Re = (e, t, n, r, i, a, o, s, c, l) => {
|
|
1156
979
|
let { x: u, y: d, w: f, h: p } = c;
|
|
1157
980
|
if (e) {
|
|
1158
981
|
let e = o - c.w - c.x;
|
|
1159
|
-
u += i - n, u < 0 && (u = 0), f = o - u - e, f <
|
|
982
|
+
u += i - n, u < 0 && (u = 0), f = o - u - e, f < V && (f = V, u = o - e - V);
|
|
1160
983
|
let t = s - p - d;
|
|
1161
|
-
d += a - r, d < 0 && (d = 0), p = s - d - t, p <
|
|
984
|
+
d += a - r, d < 0 && (d = 0), p = s - d - t, p < V && (p = V, d = s - t - V);
|
|
1162
985
|
} else {
|
|
1163
986
|
if (t >= 1) {
|
|
1164
987
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -1167,7 +990,7 @@ var Fe = t(void 0), W = () => {
|
|
|
1167
990
|
let e = a - r, n = Math.round(e * t);
|
|
1168
991
|
f -= n, p -= e, u += n, d += e;
|
|
1169
992
|
}
|
|
1170
|
-
if (u < 0 || d < 0 || f <
|
|
993
|
+
if (u < 0 || d < 0 || f < V || p < V) return l;
|
|
1171
994
|
}
|
|
1172
995
|
return {
|
|
1173
996
|
x: u,
|
|
@@ -1175,12 +998,12 @@ var Fe = t(void 0), W = () => {
|
|
|
1175
998
|
w: f,
|
|
1176
999
|
h: p
|
|
1177
1000
|
};
|
|
1178
|
-
},
|
|
1001
|
+
}, ze = (e, t, n, r, i, a, o, s, c, l) => {
|
|
1179
1002
|
let { x: u } = c, { y: d, w: f, h: p } = c;
|
|
1180
1003
|
if (e) {
|
|
1181
|
-
f += i - n, f + u > o && (f = o - u), f <
|
|
1004
|
+
f += i - n, f + u > o && (f = o - u), f < V && (f = V);
|
|
1182
1005
|
let e = s - p - d;
|
|
1183
|
-
d += a - r, d < 0 && (d = 0), p = s - d - e, p <
|
|
1006
|
+
d += a - r, d < 0 && (d = 0), p = s - d - e, p < V && (p = V, d = s - e - V);
|
|
1184
1007
|
} else {
|
|
1185
1008
|
if (t > 1) {
|
|
1186
1009
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -1189,7 +1012,7 @@ var Fe = t(void 0), W = () => {
|
|
|
1189
1012
|
let e = a - r, n = Math.round(e * t);
|
|
1190
1013
|
f -= n, p -= e, d += e;
|
|
1191
1014
|
}
|
|
1192
|
-
if (f + u > o || d < 0 || f <
|
|
1015
|
+
if (f + u > o || d < 0 || f < V || p < V) return l;
|
|
1193
1016
|
}
|
|
1194
1017
|
return {
|
|
1195
1018
|
x: u,
|
|
@@ -1197,12 +1020,12 @@ var Fe = t(void 0), W = () => {
|
|
|
1197
1020
|
w: f,
|
|
1198
1021
|
h: p
|
|
1199
1022
|
};
|
|
1200
|
-
},
|
|
1023
|
+
}, Be = (e, t, n, r, i, a, o, s, c, l) => {
|
|
1201
1024
|
let { y: u } = c, { x: d, w: f, h: p } = c;
|
|
1202
1025
|
if (e) {
|
|
1203
|
-
p += a - r, p + u > s && (p = s - u), p <
|
|
1026
|
+
p += a - r, p + u > s && (p = s - u), p < V && (p = V);
|
|
1204
1027
|
let e = o - c.w - c.x;
|
|
1205
|
-
d += i - n, d < 0 && (d = 0), f = o - d - e, f <
|
|
1028
|
+
d += i - n, d < 0 && (d = 0), f = o - d - e, f < V && (f = V, d = o - e - V);
|
|
1206
1029
|
} else {
|
|
1207
1030
|
if (t >= 1) {
|
|
1208
1031
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -1211,7 +1034,7 @@ var Fe = t(void 0), W = () => {
|
|
|
1211
1034
|
let e = a - r, n = Math.round(e * t);
|
|
1212
1035
|
f += n, p += e, d -= n;
|
|
1213
1036
|
}
|
|
1214
|
-
if (p + u > s || d < 0 || f <
|
|
1037
|
+
if (p + u > s || d < 0 || f < V || p < V) return l;
|
|
1215
1038
|
}
|
|
1216
1039
|
return {
|
|
1217
1040
|
x: d,
|
|
@@ -1219,9 +1042,9 @@ var Fe = t(void 0), W = () => {
|
|
|
1219
1042
|
w: f,
|
|
1220
1043
|
h: p
|
|
1221
1044
|
};
|
|
1222
|
-
},
|
|
1045
|
+
}, Ve = (e, t, n, r, i, a, o, s, c, l) => {
|
|
1223
1046
|
let { x: u, y: d } = c, { w: f, h: p } = c;
|
|
1224
|
-
if (e) f += i - n, f + u > o && (f = o - u), f <
|
|
1047
|
+
if (e) f += i - n, f + u > o && (f = o - u), f < V && (f = V), p += a - r, p + d > s && (p = s - d), p < V && (p = V);
|
|
1225
1048
|
else {
|
|
1226
1049
|
if (t >= 1) {
|
|
1227
1050
|
let e = i - n, r = Math.round(e / t);
|
|
@@ -1230,7 +1053,7 @@ var Fe = t(void 0), W = () => {
|
|
|
1230
1053
|
let e = a - r, n = Math.round(e * t);
|
|
1231
1054
|
f += n, p += e;
|
|
1232
1055
|
}
|
|
1233
|
-
if (p + d > s || f + u > o || f <
|
|
1056
|
+
if (p + d > s || f + u > o || f < V || p < V) return l;
|
|
1234
1057
|
}
|
|
1235
1058
|
return {
|
|
1236
1059
|
x: u,
|
|
@@ -1238,20 +1061,20 @@ var Fe = t(void 0), W = () => {
|
|
|
1238
1061
|
w: f,
|
|
1239
1062
|
h: p
|
|
1240
1063
|
};
|
|
1241
|
-
},
|
|
1242
|
-
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(
|
|
1064
|
+
}, He = (e, t, n, r, i, a, o, s, c) => {
|
|
1065
|
+
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(V, V * t), b = Math.min(Math.max(h, y), v), x = b / t;
|
|
1243
1066
|
return {
|
|
1244
1067
|
x: l ? d - b : c.x,
|
|
1245
1068
|
y: u ? f - x : c.y,
|
|
1246
1069
|
w: b,
|
|
1247
1070
|
h: x
|
|
1248
1071
|
};
|
|
1249
|
-
},
|
|
1072
|
+
}, Ue = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Re(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? ze(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Be(t, n, r, i, a, o, s, c, l, u) : e === "br" ? Ve(t, n, r, i, a, o, s, c, l, u) : {
|
|
1250
1073
|
x: 0,
|
|
1251
1074
|
y: 0,
|
|
1252
1075
|
w: 0,
|
|
1253
1076
|
h: 0
|
|
1254
|
-
} :
|
|
1077
|
+
} : He(e, n, r, i, a, o, s, c, l), H = (e, t, n) => {
|
|
1255
1078
|
let r = .12, i = t / n, a = 0, o = 0;
|
|
1256
1079
|
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));
|
|
1257
1080
|
let s = a / t * 100, c = o / n * 100, l = (t - a) / 2 / t * 100, u = (n - o) / 2 / n * 100;
|
|
@@ -1265,7 +1088,7 @@ var Fe = t(void 0), W = () => {
|
|
|
1265
1088
|
wP: Math.round(s / 100 * t),
|
|
1266
1089
|
hP: Math.round(c / 100 * n)
|
|
1267
1090
|
};
|
|
1268
|
-
},
|
|
1091
|
+
}, We = (e, t, n, r) => {
|
|
1269
1092
|
let i = e.w / 100 * n, a = e.h / 100 * r;
|
|
1270
1093
|
t >= 1 ? a = i / t : i = a * t;
|
|
1271
1094
|
let o = i / n * 100, s = a / r * 100, c = Math.max(o / (100 - e.x), s / (100 - e.y), 1);
|
|
@@ -1274,21 +1097,21 @@ var Fe = t(void 0), W = () => {
|
|
|
1274
1097
|
w: o,
|
|
1275
1098
|
h: s
|
|
1276
1099
|
};
|
|
1277
|
-
},
|
|
1100
|
+
}, U = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Ge = (e, t, n, r) => U(n) === U(r) ? {
|
|
1278
1101
|
width: e,
|
|
1279
1102
|
height: t
|
|
1280
1103
|
} : {
|
|
1281
1104
|
width: t,
|
|
1282
1105
|
height: e
|
|
1283
|
-
},
|
|
1284
|
-
let { width: t, height: n } = e, r = Math.min(1,
|
|
1106
|
+
}, Ke = async (e) => {
|
|
1107
|
+
let { width: t, height: n } = e, r = Math.min(1, h / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
|
|
1285
1108
|
if (!s) throw Error("Failed to get 2D context for preview canvas");
|
|
1286
1109
|
return s.drawImage(e, 0, 0, i, a), o.convertToBlob({
|
|
1287
1110
|
type: "image/webp",
|
|
1288
|
-
quality:
|
|
1111
|
+
quality: g
|
|
1289
1112
|
});
|
|
1290
1113
|
};
|
|
1291
|
-
function
|
|
1114
|
+
function qe(e) {
|
|
1292
1115
|
let t = new OffscreenCanvas(e.width, e.height), n = t.getContext("2d");
|
|
1293
1116
|
if (!n) throw Error("Failed to create 2D context for canvas.");
|
|
1294
1117
|
n.drawImage(e, 0, 0);
|
|
@@ -1302,14 +1125,14 @@ function Ke(e) {
|
|
|
1302
1125
|
}
|
|
1303
1126
|
//#endregion
|
|
1304
1127
|
//#region src/shared/components/Pixedi/utils/imageProcessor.ts
|
|
1305
|
-
var
|
|
1128
|
+
var Je = (e) => new Promise((t, n) => {
|
|
1306
1129
|
let r = new FileReader();
|
|
1307
1130
|
r.onloadend = () => {
|
|
1308
1131
|
let e = r.result;
|
|
1309
1132
|
typeof e == "string" ? t(e) : n(/* @__PURE__ */ Error("Failed to read blob as base64"));
|
|
1310
1133
|
}, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("FileReader error")), r.readAsDataURL(e);
|
|
1311
1134
|
});
|
|
1312
|
-
async function
|
|
1135
|
+
async function Ye(e) {
|
|
1313
1136
|
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 });
|
|
1314
1137
|
i.width = t.width, i.height = t.height, a?.drawImage(t, 0, 0), t.close();
|
|
1315
1138
|
let o = () => {
|
|
@@ -1349,7 +1172,7 @@ async function Je(e) {
|
|
|
1349
1172
|
}, a, t) : i.toBlob((t) => {
|
|
1350
1173
|
t ? e(t) : o(/* @__PURE__ */ Error("Failed to encode image as image/png"));
|
|
1351
1174
|
}, "image/png");
|
|
1352
|
-
}), s = await createImageBitmap(o), c = await
|
|
1175
|
+
}), s = await createImageBitmap(o), c = await Ke(s), { width: l, height: u } = s, d = qe(s);
|
|
1353
1176
|
return s.close(), {
|
|
1354
1177
|
newBlob: o,
|
|
1355
1178
|
previewBlob: c,
|
|
@@ -1363,7 +1186,7 @@ async function Je(e) {
|
|
|
1363
1186
|
}
|
|
1364
1187
|
//#endregion
|
|
1365
1188
|
//#region src/shared/components/Pixedi/utils/preview.ts
|
|
1366
|
-
var
|
|
1189
|
+
var W = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (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]]], Ze = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, Qe = (e) => {
|
|
1367
1190
|
switch (Ze(e)) {
|
|
1368
1191
|
case 90: return [[0, -1], [1, 0]];
|
|
1369
1192
|
case 180: return [[-1, 0], [0, -1]];
|
|
@@ -1382,13 +1205,13 @@ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (e, t) => [[e[0][0] * t[
|
|
|
1382
1205
|
}, i = 0, a = !1, o = !1;
|
|
1383
1206
|
for (let s = 0; s < e.length; s++) {
|
|
1384
1207
|
let c = e[s];
|
|
1385
|
-
if (c.action.name ===
|
|
1208
|
+
if (c.action.name === z.INITIAL) t = c.width, n = c.height, r = {
|
|
1386
1209
|
x: 0,
|
|
1387
1210
|
y: 0,
|
|
1388
1211
|
w: 1,
|
|
1389
1212
|
h: 1
|
|
1390
1213
|
}, i = 0, a = !1, o = !1;
|
|
1391
|
-
else if (c.action.name ===
|
|
1214
|
+
else if (c.action.name === z.CROP) {
|
|
1392
1215
|
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 = et(i, a, o), u = [
|
|
1393
1216
|
nt(l, e, t),
|
|
1394
1217
|
nt(l, e + n, t),
|
|
@@ -1401,12 +1224,12 @@ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (e, t) => [[e[0][0] * t[
|
|
|
1401
1224
|
w: r.w * (f - d),
|
|
1402
1225
|
h: r.h * (m - p)
|
|
1403
1226
|
};
|
|
1404
|
-
} else if (c.action.name ===
|
|
1405
|
-
let e =
|
|
1227
|
+
} else if (c.action.name === z.FLIP) {
|
|
1228
|
+
let e = U(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
|
|
1406
1229
|
t && (a = !a), n && (o = !o);
|
|
1407
|
-
} else c.action.name ===
|
|
1230
|
+
} else c.action.name === z.ROTATE && (i = c.action.args.degrees);
|
|
1408
1231
|
}
|
|
1409
|
-
let s = r.w * t, c = r.h * n, l =
|
|
1232
|
+
let s = r.w * t, c = r.h * n, l = U(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0, m = e.filter((e) => e.action.name === z.FILTERS).at(-1), h = Object.entries(m?.action.args || {}).map(([e, t]) => e === "url" ? `url(#${t})` : e === "hueRotate" ? `hue-rotate(${t}deg)` : `${e}(${t}%)`);
|
|
1410
1233
|
return {
|
|
1411
1234
|
box: r,
|
|
1412
1235
|
boxWidth: s,
|
|
@@ -1423,11 +1246,11 @@ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (e, t) => [[e[0][0] * t[
|
|
|
1423
1246
|
filters: h
|
|
1424
1247
|
};
|
|
1425
1248
|
}, it = (e) => {
|
|
1426
|
-
let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = rt(e), d = e.filter((e) => e.action.name ===
|
|
1249
|
+
let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = rt(e), d = e.filter((e) => e.action.name === z.FILTERS).at(-1)?.action.args, f = W(t.x, 0, 1), p = W(t.y, 0, 1), m = {
|
|
1427
1250
|
x: f,
|
|
1428
1251
|
y: p,
|
|
1429
|
-
w:
|
|
1430
|
-
h:
|
|
1252
|
+
w: W(t.w, 0, 1 - f),
|
|
1253
|
+
h: W(t.h, 0, 1 - p)
|
|
1431
1254
|
}, h = Ze(i);
|
|
1432
1255
|
return {
|
|
1433
1256
|
...m.x === 0 && m.y === 0 && m.w === 1 && m.h === 1 ? {} : { crop: {
|
|
@@ -1448,17 +1271,17 @@ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (e, t) => [[e[0][0] * t[
|
|
|
1448
1271
|
...d ? { filters: d } : {}
|
|
1449
1272
|
};
|
|
1450
1273
|
}, at = () => {
|
|
1451
|
-
let [e, t] = d(!1), { setImage: n, settings: r, history: i, originalBlob: a, setCurrentAction: o, resetHistory: s, onSave: c } =
|
|
1274
|
+
let [e, t] = d(!1), { setImage: n, settings: r, history: i, originalBlob: a, setCurrentAction: o, resetHistory: s, onSave: c } = B();
|
|
1452
1275
|
return {
|
|
1453
1276
|
save: async (o) => {
|
|
1454
1277
|
if (!a || e) return;
|
|
1455
1278
|
t(!0);
|
|
1456
1279
|
let s = it([...i.items.slice(0, i.pointer + 1), ...o ? [o] : []]);
|
|
1457
1280
|
try {
|
|
1458
|
-
let e = await
|
|
1281
|
+
let e = await Ye(a);
|
|
1459
1282
|
s.crop && e.crop(s.crop.x, s.crop.y, s.crop.w, s.crop.h), s.flip && e.flip(s.flip.horizontal, s.flip.vertical), s.rotate && e.rotate(s.rotate.degrees), s.resize && e.resize(s.resize.width, s.resize.height), s.filters && e.filters(s.filters);
|
|
1460
1283
|
let { newBlob: t, previewBlob: i, mimeType: o, width: l, height: u, isAlpha: d } = await e.get(r), f = "";
|
|
1461
|
-
r.exportAs === "base64" && (f = await
|
|
1284
|
+
r.exportAs === "base64" && (f = await Je(t)), await c(f || t), n({
|
|
1462
1285
|
newBlob: t,
|
|
1463
1286
|
previewBlob: i,
|
|
1464
1287
|
mimeType: o,
|
|
@@ -1477,8 +1300,8 @@ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (e, t) => [[e[0][0] * t[
|
|
|
1477
1300
|
},
|
|
1478
1301
|
isSaving: e
|
|
1479
1302
|
};
|
|
1480
|
-
},
|
|
1481
|
-
let { singleToolUI: e, addToHistory: t, setCurrentAction: n, setSidebar: r, onBack: i } =
|
|
1303
|
+
}, G = () => {
|
|
1304
|
+
let { singleToolUI: e, addToHistory: t, setCurrentAction: n, setSidebar: r, onBack: i } = B(), { save: a, isSaving: o } = at();
|
|
1482
1305
|
return {
|
|
1483
1306
|
commit: (n) => {
|
|
1484
1307
|
if (e) return a(n);
|
|
@@ -1503,13 +1326,13 @@ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (e, t) => [[e[0][0] * t[
|
|
|
1503
1326
|
};
|
|
1504
1327
|
//#endregion
|
|
1505
1328
|
//#region src/shared/components/Pixedi/ui/surface-tool/useSurfaceTool.tsx
|
|
1506
|
-
function
|
|
1329
|
+
function K(e, t, n) {
|
|
1507
1330
|
return Math.min(Math.max(e, t), n);
|
|
1508
1331
|
}
|
|
1509
|
-
function
|
|
1332
|
+
function ct(e, { dx: t, dy: n }) {
|
|
1510
1333
|
e.style.transform = `translate(calc(-50% + ${t}px), ${n}px)`;
|
|
1511
1334
|
}
|
|
1512
|
-
function
|
|
1335
|
+
function lt(e, t) {
|
|
1513
1336
|
let n = e.parentElement;
|
|
1514
1337
|
if (!n) return null;
|
|
1515
1338
|
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), a = r.left - i.left - t.dx, o = r.top - i.top - t.dy;
|
|
@@ -1520,8 +1343,8 @@ function ut(e, t) {
|
|
|
1520
1343
|
maxDy: Math.max(-o, i.height - r.height - o)
|
|
1521
1344
|
};
|
|
1522
1345
|
}
|
|
1523
|
-
var
|
|
1524
|
-
let t =
|
|
1346
|
+
var ut = ({ surfaceRef: e }) => {
|
|
1347
|
+
let t = Pe(), n = st(), r = u(null), i = u({
|
|
1525
1348
|
dx: 0,
|
|
1526
1349
|
dy: 0
|
|
1527
1350
|
}), a = u(null);
|
|
@@ -1529,14 +1352,14 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1529
1352
|
let o = e.current;
|
|
1530
1353
|
if (!o) return;
|
|
1531
1354
|
let s = (e) => {
|
|
1532
|
-
n.current = e,
|
|
1355
|
+
n.current = e, ct(o, e);
|
|
1533
1356
|
}, c = () => {
|
|
1534
|
-
let e =
|
|
1357
|
+
let e = lt(o, n.current);
|
|
1535
1358
|
if (!e) return;
|
|
1536
1359
|
let { dx: t, dy: r } = n.current;
|
|
1537
1360
|
s({
|
|
1538
|
-
dx:
|
|
1539
|
-
dy:
|
|
1361
|
+
dx: K(t, e.minDx, e.maxDx),
|
|
1362
|
+
dy: K(r, e.minDy, e.maxDy)
|
|
1540
1363
|
});
|
|
1541
1364
|
}, l = (e) => {
|
|
1542
1365
|
let t = r.current, n = a.current;
|
|
@@ -1544,8 +1367,8 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1544
1367
|
e.preventDefault();
|
|
1545
1368
|
let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
1546
1369
|
s({
|
|
1547
|
-
dx:
|
|
1548
|
-
dy:
|
|
1370
|
+
dx: K(i.current.dx + (o - t.x), n.minDx, n.maxDx),
|
|
1371
|
+
dy: K(i.current.dy + (c - t.y), n.minDy, n.maxDy)
|
|
1549
1372
|
});
|
|
1550
1373
|
}, u = () => {
|
|
1551
1374
|
r.current && (r.current = null, a.current = null, t || (document.body.style.cursor = ""));
|
|
@@ -1568,7 +1391,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1568
1391
|
let s = e.current;
|
|
1569
1392
|
if (!s) return;
|
|
1570
1393
|
o.stopPropagation();
|
|
1571
|
-
let c =
|
|
1394
|
+
let c = lt(s, n.current);
|
|
1572
1395
|
if (!c) return;
|
|
1573
1396
|
let l = "clientX" in o ? o.clientX : o.touches[0].clientX, u = "clientY" in o ? o.clientY : o.touches[0].clientY;
|
|
1574
1397
|
r.current = {
|
|
@@ -1576,56 +1399,56 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1576
1399
|
y: u
|
|
1577
1400
|
}, i.current = { ...n.current }, a.current = c, t || (document.body.style.cursor = "move");
|
|
1578
1401
|
} };
|
|
1579
|
-
},
|
|
1402
|
+
}, dt = {
|
|
1580
1403
|
surfaceTool: "_surfaceTool_1skmt_1",
|
|
1581
1404
|
content: "_content_1skmt_18",
|
|
1582
1405
|
drag: "_drag_1skmt_22"
|
|
1583
|
-
},
|
|
1584
|
-
let r = u(null), { handleDragStart: i } =
|
|
1585
|
-
return /* @__PURE__ */ (
|
|
1406
|
+
}, q = ({ children: e, className: t = "", ref: n }) => {
|
|
1407
|
+
let r = u(null), { handleDragStart: i } = ut({ surfaceRef: r });
|
|
1408
|
+
return /* @__PURE__ */ m("div", {
|
|
1586
1409
|
ref: (e) => {
|
|
1587
1410
|
r.current = e, n && (n.current = e);
|
|
1588
1411
|
},
|
|
1589
|
-
className:
|
|
1590
|
-
children: [/* @__PURE__ */ (
|
|
1591
|
-
className:
|
|
1412
|
+
className: dt.surfaceTool,
|
|
1413
|
+
children: [/* @__PURE__ */ p(pe, {
|
|
1414
|
+
className: dt.drag,
|
|
1592
1415
|
onMouseDown: i,
|
|
1593
1416
|
onTouchStart: i
|
|
1594
|
-
}), /* @__PURE__ */ (
|
|
1595
|
-
className: `${
|
|
1417
|
+
}), /* @__PURE__ */ p("div", {
|
|
1418
|
+
className: `${dt.content} ${t}`,
|
|
1596
1419
|
children: e
|
|
1597
1420
|
})]
|
|
1598
1421
|
});
|
|
1599
|
-
},
|
|
1422
|
+
}, ft = (e, t) => {
|
|
1600
1423
|
let n = new CustomEvent("crop-update", { detail: t });
|
|
1601
1424
|
e.dispatchEvent(n);
|
|
1602
|
-
},
|
|
1425
|
+
}, pt = (e, t) => {
|
|
1603
1426
|
let n = new CustomEvent("clip-path-update", { detail: t });
|
|
1604
1427
|
e.dispatchEvent(n);
|
|
1605
|
-
},
|
|
1428
|
+
}, mt = (e, t) => {
|
|
1606
1429
|
let n = new CustomEvent("resize-update", { detail: t });
|
|
1607
1430
|
e.dispatchEvent(n);
|
|
1608
|
-
},
|
|
1431
|
+
}, J = (e, t) => {
|
|
1609
1432
|
let n = new CustomEvent("filter-update", { detail: t });
|
|
1610
1433
|
e.dispatchEvent(n);
|
|
1611
|
-
},
|
|
1434
|
+
}, ht = (e, t) => {
|
|
1612
1435
|
let n = new CustomEvent("compare-update", { detail: t });
|
|
1613
1436
|
e.dispatchEvent(n);
|
|
1614
|
-
},
|
|
1615
|
-
let { showCompare: e, previewUrl: t, getLastFilter: n, getLastHistoryItem: r, toggleCompare: i, eventBus: a } =
|
|
1437
|
+
}, gt = () => {
|
|
1438
|
+
let { showCompare: e, previewUrl: t, getLastFilter: n, getLastHistoryItem: r, toggleCompare: i, eventBus: a } = B(), { commit: s, close: c, isSaving: u } = G(), { width: f, height: p } = r(), { action: m } = n() || {}, h = m?.args || {}, g = h?.url, _ = v.map((e) => ({
|
|
1616
1439
|
...e,
|
|
1617
1440
|
sliderValue: h[e.value] ?? e.sliderValue,
|
|
1618
1441
|
rightLabel: `${h[e.value] ?? e.sliderValue}${e.unit}`
|
|
1619
|
-
})), y =
|
|
1620
|
-
i(),
|
|
1442
|
+
})), y = _.find((e) => e.value === "saturate")?.sliderValue, [b, x] = d("saturate"), [S, C] = d(g ?? "vintage"), [w, T] = d(_), [E, D] = d(y ?? 0), [O, k] = d(!!g), A = l(() => Object.fromEntries(w.map((e) => [e.value, e.sliderValue])), [w]), ee = () => {
|
|
1443
|
+
i(), ht(a, 50);
|
|
1621
1444
|
}, te = (e) => {
|
|
1622
|
-
|
|
1445
|
+
J(a, {
|
|
1623
1446
|
...A,
|
|
1624
1447
|
[b]: e
|
|
1625
1448
|
});
|
|
1626
|
-
},
|
|
1449
|
+
}, ne = w.find((e) => e.value === b);
|
|
1627
1450
|
return o(() => {
|
|
1628
|
-
O ?
|
|
1451
|
+
O ? J(a, { url: S }) : J(a, {
|
|
1629
1452
|
...A,
|
|
1630
1453
|
[b]: E
|
|
1631
1454
|
});
|
|
@@ -1643,7 +1466,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1643
1466
|
toggleIsUrl: () => k(!O),
|
|
1644
1467
|
filters: w,
|
|
1645
1468
|
selectedFilter: b,
|
|
1646
|
-
selectedFilterItem:
|
|
1469
|
+
selectedFilterItem: ne,
|
|
1647
1470
|
selectedUrl: S,
|
|
1648
1471
|
sliderValue: E,
|
|
1649
1472
|
handleToggleCompare: ee,
|
|
@@ -1659,14 +1482,14 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1659
1482
|
x(e), D(w.find((t) => t.value === e)?.sliderValue || 0);
|
|
1660
1483
|
},
|
|
1661
1484
|
handleChangeWhenUrl: (e) => {
|
|
1662
|
-
C(e),
|
|
1485
|
+
C(e), J(a, { url: e });
|
|
1663
1486
|
},
|
|
1664
1487
|
handleSave: () => {
|
|
1665
1488
|
e && i(), s({
|
|
1666
1489
|
width: f,
|
|
1667
1490
|
height: p,
|
|
1668
1491
|
action: {
|
|
1669
|
-
name:
|
|
1492
|
+
name: z.FILTERS,
|
|
1670
1493
|
args: { ...O ? { url: S } : Object.fromEntries(w.map((e) => [e.value, e.sliderValue])) }
|
|
1671
1494
|
}
|
|
1672
1495
|
});
|
|
@@ -1689,18 +1512,18 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1689
1512
|
filterInteract: "_filterInteract_4u8qe_55",
|
|
1690
1513
|
compare: "_compare_4u8qe_70",
|
|
1691
1514
|
compareThumb: "_compareThumb_4u8qe_88"
|
|
1692
|
-
},
|
|
1693
|
-
let { showCompare: e, previewUrl: t, isUrl: n, toggleIsUrl: r, filters: i, selectedFilter: a, selectedFilterItem: o, selectedUrl: s, sliderValue: c, handleToggleCompare: l, handleSliderInput: u, handleSliderChange: d, handleChange: f, handleChangeWhenUrl:
|
|
1694
|
-
return /* @__PURE__ */ (
|
|
1515
|
+
}, _t = () => {
|
|
1516
|
+
let { showCompare: e, previewUrl: t, isUrl: n, toggleIsUrl: r, filters: i, selectedFilter: a, selectedFilterItem: o, selectedUrl: s, sliderValue: c, handleToggleCompare: l, handleSliderInput: u, handleSliderChange: d, handleChange: f, handleChangeWhenUrl: h, handleSave: g, handleClose: _, isSaving: v } = gt();
|
|
1517
|
+
return /* @__PURE__ */ m(q, {
|
|
1695
1518
|
className: Y.tools,
|
|
1696
|
-
children: [!n && o && /* @__PURE__ */ (
|
|
1519
|
+
children: [!n && o && /* @__PURE__ */ m("div", {
|
|
1697
1520
|
className: Y.row1,
|
|
1698
1521
|
children: [
|
|
1699
|
-
/* @__PURE__ */ (
|
|
1522
|
+
/* @__PURE__ */ m("div", {
|
|
1700
1523
|
className: Y.min,
|
|
1701
1524
|
children: [o.min, o.unit]
|
|
1702
1525
|
}),
|
|
1703
|
-
/* @__PURE__ */ (
|
|
1526
|
+
/* @__PURE__ */ p(De, {
|
|
1704
1527
|
className: Y.slider,
|
|
1705
1528
|
min: o.min,
|
|
1706
1529
|
max: o.max,
|
|
@@ -1711,60 +1534,60 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1711
1534
|
onInput: u,
|
|
1712
1535
|
onChange: d
|
|
1713
1536
|
}),
|
|
1714
|
-
/* @__PURE__ */ (
|
|
1537
|
+
/* @__PURE__ */ m("div", {
|
|
1715
1538
|
className: Y.max,
|
|
1716
1539
|
children: [o.max, o.unit]
|
|
1717
1540
|
})
|
|
1718
1541
|
]
|
|
1719
|
-
}), /* @__PURE__ */ (
|
|
1542
|
+
}), /* @__PURE__ */ m("div", {
|
|
1720
1543
|
className: Y.row2,
|
|
1721
1544
|
children: [
|
|
1722
|
-
/* @__PURE__ */ (
|
|
1545
|
+
/* @__PURE__ */ p(R, {
|
|
1723
1546
|
position: "top",
|
|
1724
|
-
children: /* @__PURE__ */ (
|
|
1547
|
+
children: /* @__PURE__ */ p(M, {
|
|
1725
1548
|
variant: "outline",
|
|
1726
1549
|
"aria-label": "Compare",
|
|
1727
1550
|
"data-tooltip": "Compare",
|
|
1728
1551
|
onClick: l,
|
|
1729
1552
|
className: e ? Y.active : "",
|
|
1730
|
-
children: /* @__PURE__ */ (
|
|
1553
|
+
children: /* @__PURE__ */ p(fe, {})
|
|
1731
1554
|
})
|
|
1732
1555
|
}),
|
|
1733
|
-
/* @__PURE__ */ (
|
|
1556
|
+
/* @__PURE__ */ p(R, {
|
|
1734
1557
|
position: "top",
|
|
1735
|
-
children: /* @__PURE__ */ (
|
|
1558
|
+
children: /* @__PURE__ */ p(M, {
|
|
1736
1559
|
variant: "outline",
|
|
1737
1560
|
"aria-label": n ? "Filters" : "Predefined Filters",
|
|
1738
1561
|
"data-tooltip": n ? "Filters" : "Predefined Filters",
|
|
1739
1562
|
onClick: r,
|
|
1740
|
-
children: n ?
|
|
1563
|
+
children: p(n ? ce : de, {})
|
|
1741
1564
|
})
|
|
1742
1565
|
}),
|
|
1743
|
-
/* @__PURE__ */ (
|
|
1744
|
-
items: n ?
|
|
1566
|
+
/* @__PURE__ */ p(ye, {
|
|
1567
|
+
items: n ? y : i,
|
|
1745
1568
|
value: n ? s : a,
|
|
1746
1569
|
placeholder: "Select filter",
|
|
1747
1570
|
className: Y.select,
|
|
1748
|
-
renderOption: n ? (e) => /* @__PURE__ */ (
|
|
1571
|
+
renderOption: n ? (e) => /* @__PURE__ */ p("div", {
|
|
1749
1572
|
className: Y.option,
|
|
1750
|
-
children: /* @__PURE__ */ (
|
|
1573
|
+
children: /* @__PURE__ */ p("img", {
|
|
1751
1574
|
src: t,
|
|
1752
1575
|
alt: e.label,
|
|
1753
1576
|
style: { filter: `url(#${e.value})` }
|
|
1754
1577
|
})
|
|
1755
1578
|
}) : void 0,
|
|
1756
|
-
onChange: n ?
|
|
1579
|
+
onChange: n ? h : f
|
|
1757
1580
|
}),
|
|
1758
|
-
/* @__PURE__ */ (
|
|
1759
|
-
onSave:
|
|
1760
|
-
onClose:
|
|
1761
|
-
saving:
|
|
1581
|
+
/* @__PURE__ */ p(F, {
|
|
1582
|
+
onSave: g,
|
|
1583
|
+
onClose: _,
|
|
1584
|
+
saving: v
|
|
1762
1585
|
})
|
|
1763
1586
|
]
|
|
1764
1587
|
})]
|
|
1765
1588
|
});
|
|
1766
|
-
},
|
|
1767
|
-
let { history: n, previewUrl: r, currentAction: i, getLastRotation: a, eventBus: s } =
|
|
1589
|
+
}, vt = ({ isClipped: e, isFilter: t }) => {
|
|
1590
|
+
let { history: n, previewUrl: r, currentAction: i, getLastRotation: a, eventBus: s } = B(), l = u(null), d = u(null), f = u(i?.name), p = u(r);
|
|
1768
1591
|
c(() => {
|
|
1769
1592
|
let e = f.current, t = i?.name, n = p.current !== r;
|
|
1770
1593
|
if (f.current = t, p.current = r, !(e && t && e !== t) && !n) return;
|
|
@@ -1787,7 +1610,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1787
1610
|
if (i) {
|
|
1788
1611
|
let { width: e, height: t } = n.items.at(n.pointer);
|
|
1789
1612
|
m.push({
|
|
1790
|
-
...i.name ===
|
|
1613
|
+
...i.name === z.ROTATE ? Ge(e, t, a(), i.args.degrees) : {
|
|
1791
1614
|
width: e,
|
|
1792
1615
|
height: t
|
|
1793
1616
|
},
|
|
@@ -1796,7 +1619,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1796
1619
|
}
|
|
1797
1620
|
let h = rt(m);
|
|
1798
1621
|
return o(() => {
|
|
1799
|
-
e && l.current && (l.current.style.transition = "none"), i?.name !==
|
|
1622
|
+
e && l.current && (l.current.style.transition = "none"), i?.name !== z.RESIZE && l.current && (l.current.style.transform = "scale(1)");
|
|
1800
1623
|
let n = (e) => {
|
|
1801
1624
|
let t = e.detail;
|
|
1802
1625
|
l.current && (l.current.style.transform = `scale(${t / 100})`);
|
|
@@ -1838,12 +1661,12 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1838
1661
|
label: "_label_t77n1_49",
|
|
1839
1662
|
before: "_before_t77n1_67",
|
|
1840
1663
|
after: "_after_t77n1_71"
|
|
1841
|
-
},
|
|
1842
|
-
let { showCompare: i } =
|
|
1664
|
+
}, yt = ({ isClipped: e, isFilter: t, faded: n, style: r = {} }) => {
|
|
1665
|
+
let { showCompare: i } = B(), { previewRef: a, imageRef: o, previewUrl: s, box: c, boxWidth: l, boxHeight: u, viewWidth: d, viewHeight: f, rotation: h, flipH: g, flipV: _, filters: v } = vt({
|
|
1843
1666
|
isClipped: e,
|
|
1844
1667
|
isFilter: t
|
|
1845
1668
|
});
|
|
1846
|
-
return /* @__PURE__ */ (
|
|
1669
|
+
return /* @__PURE__ */ m("div", {
|
|
1847
1670
|
ref: a,
|
|
1848
1671
|
className: `${X.preview} ${n ? X.faded : ""}`,
|
|
1849
1672
|
style: {
|
|
@@ -1851,25 +1674,25 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1851
1674
|
...r
|
|
1852
1675
|
},
|
|
1853
1676
|
children: [
|
|
1854
|
-
i && !t && /* @__PURE__ */ (
|
|
1677
|
+
i && !t && /* @__PURE__ */ p("div", {
|
|
1855
1678
|
className: `${X.label} ${X.before}`,
|
|
1856
1679
|
children: "Before"
|
|
1857
1680
|
}),
|
|
1858
|
-
i && t && /* @__PURE__ */ (
|
|
1681
|
+
i && t && /* @__PURE__ */ p("div", {
|
|
1859
1682
|
className: `${X.label} ${X.after}`,
|
|
1860
1683
|
children: "After"
|
|
1861
1684
|
}),
|
|
1862
|
-
/* @__PURE__ */ (
|
|
1685
|
+
/* @__PURE__ */ p("div", {
|
|
1863
1686
|
className: X.rotate,
|
|
1864
1687
|
style: {
|
|
1865
1688
|
width: `${l / d * 100}%`,
|
|
1866
1689
|
height: `${u / f * 100}%`,
|
|
1867
|
-
transform: `translate(-50%, -50%) rotate(${
|
|
1690
|
+
transform: `translate(-50%, -50%) rotate(${h}deg)`
|
|
1868
1691
|
},
|
|
1869
|
-
children: /* @__PURE__ */ (
|
|
1692
|
+
children: /* @__PURE__ */ p("div", {
|
|
1870
1693
|
className: X.flip,
|
|
1871
|
-
style: { transform: `scale(${
|
|
1872
|
-
children: /* @__PURE__ */ (
|
|
1694
|
+
style: { transform: `scale(${g ? -1 : 1}, ${_ ? -1 : 1})` },
|
|
1695
|
+
children: /* @__PURE__ */ p("img", {
|
|
1873
1696
|
ref: o,
|
|
1874
1697
|
className: X.image,
|
|
1875
1698
|
src: s,
|
|
@@ -1879,17 +1702,17 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1879
1702
|
height: `${1 / c.h * 100}%`,
|
|
1880
1703
|
left: `${-(c.x / c.w) * 100}%`,
|
|
1881
1704
|
top: `${-(c.y / c.h) * 100}%`,
|
|
1882
|
-
filter:
|
|
1705
|
+
filter: v.join(" ")
|
|
1883
1706
|
}
|
|
1884
1707
|
})
|
|
1885
1708
|
})
|
|
1886
1709
|
})
|
|
1887
1710
|
]
|
|
1888
1711
|
});
|
|
1889
|
-
},
|
|
1890
|
-
let { eventBus: t } =
|
|
1712
|
+
}, bt = ({ compareRef: e }) => {
|
|
1713
|
+
let { eventBus: t } = B(), n = Pe(), r = u(null), i = u(null);
|
|
1891
1714
|
return o(() => {
|
|
1892
|
-
i.current = 0,
|
|
1715
|
+
i.current = 0, ht(t, 0);
|
|
1893
1716
|
}, [t]), o(() => {
|
|
1894
1717
|
let n = (n) => {
|
|
1895
1718
|
if (!e.current || !r.current) return;
|
|
@@ -1897,7 +1720,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1897
1720
|
let a = e.current.parentElement;
|
|
1898
1721
|
if (!a) return;
|
|
1899
1722
|
let o = "clientX" in n ? n.clientX : n.touches[0].clientX, { width: s, left: c } = a.getBoundingClientRect(), l = Math.min(Math.max(o - c, 0), s) / s * 100;
|
|
1900
|
-
i.current = l, e.current.style.left = `${l}%`,
|
|
1723
|
+
i.current = l, e.current.style.left = `${l}%`, ht(t, l);
|
|
1901
1724
|
}, a = () => {
|
|
1902
1725
|
e.current && (r.current = null, document.body.style.cursor = "auto");
|
|
1903
1726
|
}, o = new AbortController(), { signal: s } = o;
|
|
@@ -1911,24 +1734,24 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1911
1734
|
let a = "clientX" in t ? t.clientX : t.touches[0].clientX;
|
|
1912
1735
|
r.current = a, n || (document.body.style.cursor = "pointer");
|
|
1913
1736
|
} };
|
|
1914
|
-
},
|
|
1915
|
-
let { showCompare: e, getLastHistoryItem: t } =
|
|
1916
|
-
return /* @__PURE__ */ (
|
|
1737
|
+
}, xt = () => {
|
|
1738
|
+
let { showCompare: e, getLastHistoryItem: t } = B(), { width: n, height: r } = t(), i = u(null), { handleDragStart: a } = bt({ compareRef: i });
|
|
1739
|
+
return /* @__PURE__ */ m("div", {
|
|
1917
1740
|
className: Y.filterInteract,
|
|
1918
1741
|
style: { aspectRatio: `${n} / ${r}` },
|
|
1919
|
-
children: [/* @__PURE__ */ (
|
|
1742
|
+
children: [/* @__PURE__ */ p(yt, { isFilter: !0 }), e && /* @__PURE__ */ p(f, { children: /* @__PURE__ */ p("div", {
|
|
1920
1743
|
ref: i,
|
|
1921
1744
|
className: Y.compare,
|
|
1922
1745
|
style: { left: "50%" },
|
|
1923
|
-
children: /* @__PURE__ */ (
|
|
1746
|
+
children: /* @__PURE__ */ p("div", {
|
|
1924
1747
|
className: Y.compareThumb,
|
|
1925
1748
|
onMouseDown: a,
|
|
1926
1749
|
onTouchStart: a,
|
|
1927
|
-
children: /* @__PURE__ */ (
|
|
1750
|
+
children: /* @__PURE__ */ p(fe, {})
|
|
1928
1751
|
})
|
|
1929
1752
|
}) })]
|
|
1930
1753
|
});
|
|
1931
|
-
},
|
|
1754
|
+
}, St = () => ({
|
|
1932
1755
|
saturate: 100,
|
|
1933
1756
|
grayscale: 0,
|
|
1934
1757
|
sepia: 0,
|
|
@@ -1936,17 +1759,17 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1936
1759
|
hueRotate: 0,
|
|
1937
1760
|
brightness: 100,
|
|
1938
1761
|
contrast: 100
|
|
1939
|
-
}),
|
|
1762
|
+
}), Ct = (e, t, n) => {
|
|
1940
1763
|
if (e.length === 1) switch (e[0]) {
|
|
1941
1764
|
case "resize": return {
|
|
1942
|
-
name:
|
|
1765
|
+
name: z.RESIZE,
|
|
1943
1766
|
args: {
|
|
1944
1767
|
width: t,
|
|
1945
1768
|
height: n
|
|
1946
1769
|
}
|
|
1947
1770
|
};
|
|
1948
1771
|
case "crop": return {
|
|
1949
|
-
name:
|
|
1772
|
+
name: z.CROP,
|
|
1950
1773
|
args: {
|
|
1951
1774
|
id: "freeform",
|
|
1952
1775
|
ratio: t / n,
|
|
@@ -1954,7 +1777,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1954
1777
|
}
|
|
1955
1778
|
};
|
|
1956
1779
|
case "presetCrop": return {
|
|
1957
|
-
name:
|
|
1780
|
+
name: z.PRESET_CROP,
|
|
1958
1781
|
args: {
|
|
1959
1782
|
id: "facebook-post",
|
|
1960
1783
|
ratio: 1200 / 630,
|
|
@@ -1966,24 +1789,24 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1966
1789
|
}
|
|
1967
1790
|
};
|
|
1968
1791
|
case "flip": return {
|
|
1969
|
-
name:
|
|
1792
|
+
name: z.FLIP,
|
|
1970
1793
|
args: {
|
|
1971
1794
|
horizontal: !1,
|
|
1972
1795
|
vertical: !1
|
|
1973
1796
|
}
|
|
1974
1797
|
};
|
|
1975
1798
|
case "rotate": return {
|
|
1976
|
-
name:
|
|
1799
|
+
name: z.ROTATE,
|
|
1977
1800
|
args: { degrees: 0 }
|
|
1978
1801
|
};
|
|
1979
1802
|
case "filters": return {
|
|
1980
|
-
name:
|
|
1981
|
-
args:
|
|
1803
|
+
name: z.FILTERS,
|
|
1804
|
+
args: St()
|
|
1982
1805
|
};
|
|
1983
1806
|
default: return null;
|
|
1984
1807
|
}
|
|
1985
1808
|
return null;
|
|
1986
|
-
},
|
|
1809
|
+
}, wt = {
|
|
1987
1810
|
tools: [
|
|
1988
1811
|
"resize",
|
|
1989
1812
|
"crop",
|
|
@@ -1996,19 +1819,19 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
1996
1819
|
quality: .85,
|
|
1997
1820
|
saveAsWEBP: !1,
|
|
1998
1821
|
exportAs: "blob"
|
|
1999
|
-
},
|
|
1822
|
+
}, Tt = (e, t, n, r, i, a, o) => ({
|
|
2000
1823
|
history: {
|
|
2001
1824
|
pointer: 0,
|
|
2002
1825
|
items: [{
|
|
2003
1826
|
width: t,
|
|
2004
1827
|
height: n,
|
|
2005
1828
|
action: {
|
|
2006
|
-
name:
|
|
1829
|
+
name: z.INITIAL,
|
|
2007
1830
|
args: null
|
|
2008
1831
|
}
|
|
2009
1832
|
}]
|
|
2010
1833
|
},
|
|
2011
|
-
currentAction:
|
|
1834
|
+
currentAction: Ct(o?.tools || [], t, n),
|
|
2012
1835
|
previewUrl: i,
|
|
2013
1836
|
originalBlob: r,
|
|
2014
1837
|
mimeType: e,
|
|
@@ -2017,15 +1840,15 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2017
1840
|
isAlpha: a,
|
|
2018
1841
|
showCompare: !1,
|
|
2019
1842
|
singleToolUI: o?.tools?.length === 1
|
|
2020
|
-
}),
|
|
2021
|
-
let [
|
|
1843
|
+
}), Et = () => {}, Dt = ({ children: e, mimeType: t, width: n, height: r, originalBlob: i, previewUrl: a, isAlpha: s, settings: c, onSave: f = Et, onBack: m = Et }) => {
|
|
1844
|
+
let [h, g] = d(Tt(t, n, r, i, a, s, c)), _ = u(null);
|
|
2022
1845
|
o(() => () => {
|
|
2023
|
-
|
|
1846
|
+
_.current &&= (URL.revokeObjectURL(_.current), null);
|
|
2024
1847
|
}, []);
|
|
2025
|
-
let
|
|
1848
|
+
let v = (e) => g((t) => ({
|
|
2026
1849
|
...t,
|
|
2027
1850
|
currentAction: e
|
|
2028
|
-
})),
|
|
1851
|
+
})), y = (e) => g((t) => {
|
|
2029
1852
|
let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
|
|
2030
1853
|
return {
|
|
2031
1854
|
...t,
|
|
@@ -2035,68 +1858,68 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2035
1858
|
pointer: n
|
|
2036
1859
|
}
|
|
2037
1860
|
};
|
|
2038
|
-
}),
|
|
1861
|
+
}), b = () => g((e) => ({
|
|
2039
1862
|
...e,
|
|
2040
1863
|
showCompare: !e.showCompare
|
|
2041
|
-
})),
|
|
2042
|
-
let { items: e, pointer: t } =
|
|
1864
|
+
})), x = () => {
|
|
1865
|
+
let { items: e, pointer: t } = h.history;
|
|
2043
1866
|
return e.at(t) ?? e.at(0) ?? {
|
|
2044
1867
|
width: 0,
|
|
2045
1868
|
height: 0,
|
|
2046
1869
|
action: {
|
|
2047
|
-
name:
|
|
1870
|
+
name: z.INITIAL,
|
|
2048
1871
|
args: null
|
|
2049
1872
|
}
|
|
2050
1873
|
};
|
|
2051
1874
|
}, S = () => {
|
|
2052
|
-
let { items: e, pointer: t } =
|
|
2053
|
-
return e.filter((e, n) => n <= t && e.action.name ===
|
|
1875
|
+
let { items: e, pointer: t } = h.history;
|
|
1876
|
+
return e.filter((e, n) => n <= t && e.action.name === z.FILTERS).at(-1) ?? null;
|
|
2054
1877
|
}, C = () => {
|
|
2055
|
-
let { items: e, pointer: t } =
|
|
1878
|
+
let { items: e, pointer: t } = h.history;
|
|
2056
1879
|
if (e.length === 0 || t < 0) return 0;
|
|
2057
|
-
let n = e.slice(0, t + 1).findLast((e) => e.action.name ===
|
|
2058
|
-
return n?.action.name ===
|
|
2059
|
-
}, w = () =>
|
|
1880
|
+
let n = e.slice(0, t + 1).findLast((e) => e.action.name === z.ROTATE);
|
|
1881
|
+
return n?.action.name === z.ROTATE ? n.action.args.degrees : 0;
|
|
1882
|
+
}, w = () => g((e) => ({
|
|
2060
1883
|
...e,
|
|
2061
1884
|
history: {
|
|
2062
1885
|
items: [e.history.items[0]],
|
|
2063
1886
|
pointer: 0
|
|
2064
1887
|
}
|
|
2065
|
-
})), T = () =>
|
|
1888
|
+
})), T = () => g((e) => e.history.pointer <= 0 ? e : {
|
|
2066
1889
|
...e,
|
|
2067
1890
|
history: {
|
|
2068
1891
|
...e.history,
|
|
2069
1892
|
pointer: e.history.pointer - 1
|
|
2070
1893
|
}
|
|
2071
|
-
}), E = () =>
|
|
1894
|
+
}), E = () => g((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
|
|
2072
1895
|
...e,
|
|
2073
1896
|
history: {
|
|
2074
1897
|
...e.history,
|
|
2075
1898
|
pointer: e.history.pointer + 1
|
|
2076
1899
|
}
|
|
2077
|
-
}), D = (e) =>
|
|
1900
|
+
}), D = (e) => g((t) => ({
|
|
2078
1901
|
...t,
|
|
2079
1902
|
sidebar: e
|
|
2080
1903
|
})), O = l(() => new EventTarget(), []), k = (e) => {
|
|
2081
|
-
|
|
1904
|
+
_.current && URL.revokeObjectURL(_.current), _.current = URL.createObjectURL(e.previewBlob), g(Tt(e.mimeType, e.width, e.height, e.newBlob, _.current, e.isAlpha, c));
|
|
2082
1905
|
};
|
|
2083
|
-
return /* @__PURE__ */ (
|
|
1906
|
+
return /* @__PURE__ */ p(Le, {
|
|
2084
1907
|
value: {
|
|
2085
|
-
...
|
|
1908
|
+
...h,
|
|
2086
1909
|
setImage: k,
|
|
2087
|
-
setCurrentAction:
|
|
2088
|
-
toggleCompare:
|
|
2089
|
-
getLastHistoryItem:
|
|
1910
|
+
setCurrentAction: v,
|
|
1911
|
+
toggleCompare: b,
|
|
1912
|
+
getLastHistoryItem: x,
|
|
2090
1913
|
getLastRotation: C,
|
|
2091
1914
|
getLastFilter: S,
|
|
2092
|
-
addToHistory:
|
|
1915
|
+
addToHistory: y,
|
|
2093
1916
|
resetHistory: w,
|
|
2094
1917
|
undo: T,
|
|
2095
1918
|
redo: E,
|
|
2096
1919
|
setSidebar: D,
|
|
2097
1920
|
eventBus: O,
|
|
2098
1921
|
onSave: f,
|
|
2099
|
-
onBack:
|
|
1922
|
+
onBack: m
|
|
2100
1923
|
},
|
|
2101
1924
|
children: e
|
|
2102
1925
|
});
|
|
@@ -2109,40 +1932,40 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2109
1932
|
tools: "_tools_m05h6_39",
|
|
2110
1933
|
history: "_history_m05h6_43",
|
|
2111
1934
|
historyText: "_historyText_m05h6_48"
|
|
2112
|
-
},
|
|
2113
|
-
let { save: t, reset: n, isSaving: r } = at(), { sidebar: i, history: a, undo: o, redo: s, setSidebar: c, setCurrentAction: l, onBack: u } =
|
|
2114
|
-
return /* @__PURE__ */ (
|
|
1935
|
+
}, Ot = ({ isMobile: e }) => {
|
|
1936
|
+
let { save: t, reset: n, isSaving: r } = at(), { sidebar: i, history: a, undo: o, redo: s, setSidebar: c, setCurrentAction: l, onBack: u } = B(), d = a.items.length > 1 && !r, f = a.pointer === 0, h = a.pointer === a.items.length - 1, g = a.items.length < 2 || r, _ = g || a.pointer === 0;
|
|
1937
|
+
return /* @__PURE__ */ m("div", {
|
|
2115
1938
|
className: Z.header,
|
|
2116
|
-
children: [/* @__PURE__ */ (
|
|
1939
|
+
children: [/* @__PURE__ */ m("div", {
|
|
2117
1940
|
className: Z.left,
|
|
2118
|
-
children: [/* @__PURE__ */ (
|
|
1941
|
+
children: [/* @__PURE__ */ p("div", {
|
|
2119
1942
|
className: `${Z.sidebarToggle} ${e ? Z.mobile : ""}`,
|
|
2120
1943
|
onClick: () => {
|
|
2121
1944
|
c(!i);
|
|
2122
1945
|
},
|
|
2123
|
-
children: i ?
|
|
2124
|
-
}), /* @__PURE__ */ (
|
|
1946
|
+
children: p(i ? ue : le, { className: Z.sidebarIcon })
|
|
1947
|
+
}), /* @__PURE__ */ p(M, {
|
|
2125
1948
|
variant: "ghost",
|
|
2126
|
-
className:
|
|
1949
|
+
className: j.rect,
|
|
2127
1950
|
onClick: () => u(),
|
|
2128
|
-
children: /* @__PURE__ */ (
|
|
1951
|
+
children: /* @__PURE__ */ p(w, {})
|
|
2129
1952
|
})]
|
|
2130
|
-
}), /* @__PURE__ */ (
|
|
1953
|
+
}), /* @__PURE__ */ m("div", {
|
|
2131
1954
|
className: Z.tools,
|
|
2132
1955
|
children: [
|
|
2133
|
-
d && /* @__PURE__ */ (
|
|
1956
|
+
d && /* @__PURE__ */ m("div", {
|
|
2134
1957
|
className: Z.history,
|
|
2135
1958
|
children: [
|
|
2136
|
-
/* @__PURE__ */ (
|
|
1959
|
+
/* @__PURE__ */ p(M, {
|
|
2137
1960
|
variant: "outline",
|
|
2138
1961
|
disabled: f,
|
|
2139
|
-
className:
|
|
1962
|
+
className: j.rect,
|
|
2140
1963
|
onClick: () => {
|
|
2141
1964
|
o(), l(null);
|
|
2142
1965
|
},
|
|
2143
|
-
children: /* @__PURE__ */ (
|
|
1966
|
+
children: /* @__PURE__ */ p(E, {})
|
|
2144
1967
|
}),
|
|
2145
|
-
/* @__PURE__ */ (
|
|
1968
|
+
/* @__PURE__ */ m("div", {
|
|
2146
1969
|
className: Z.historyText,
|
|
2147
1970
|
children: [
|
|
2148
1971
|
a.pointer + 1,
|
|
@@ -2150,76 +1973,76 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2150
1973
|
a.items.length
|
|
2151
1974
|
]
|
|
2152
1975
|
}),
|
|
2153
|
-
/* @__PURE__ */ (
|
|
1976
|
+
/* @__PURE__ */ p(M, {
|
|
2154
1977
|
variant: "outline",
|
|
2155
|
-
disabled:
|
|
2156
|
-
className:
|
|
1978
|
+
disabled: h,
|
|
1979
|
+
className: j.rect,
|
|
2157
1980
|
onClick: () => {
|
|
2158
1981
|
s(), l(null);
|
|
2159
1982
|
},
|
|
2160
|
-
children: /* @__PURE__ */ (
|
|
1983
|
+
children: /* @__PURE__ */ p(D, {})
|
|
2161
1984
|
})
|
|
2162
1985
|
]
|
|
2163
1986
|
}),
|
|
2164
|
-
/* @__PURE__ */ (
|
|
1987
|
+
/* @__PURE__ */ p(M, {
|
|
2165
1988
|
variant: "outline",
|
|
2166
|
-
disabled:
|
|
1989
|
+
disabled: g,
|
|
2167
1990
|
onClick: n,
|
|
2168
1991
|
children: "Reset"
|
|
2169
1992
|
}),
|
|
2170
|
-
/* @__PURE__ */ (
|
|
2171
|
-
disabled:
|
|
1993
|
+
/* @__PURE__ */ m(M, {
|
|
1994
|
+
disabled: _,
|
|
2172
1995
|
onClick: () => t(),
|
|
2173
|
-
children: [r ?
|
|
1996
|
+
children: [p(r ? me : x, {}), "Save"]
|
|
2174
1997
|
})
|
|
2175
1998
|
]
|
|
2176
1999
|
})]
|
|
2177
2000
|
});
|
|
2178
|
-
},
|
|
2179
|
-
[
|
|
2180
|
-
icon: /* @__PURE__ */ (
|
|
2001
|
+
}, kt = {
|
|
2002
|
+
[z.RESIZE]: {
|
|
2003
|
+
icon: /* @__PURE__ */ p(ne, {}),
|
|
2181
2004
|
label: "Resize"
|
|
2182
2005
|
},
|
|
2183
|
-
[
|
|
2184
|
-
icon: /* @__PURE__ */ (
|
|
2006
|
+
[z.CROP]: {
|
|
2007
|
+
icon: /* @__PURE__ */ p(O, {}),
|
|
2185
2008
|
label: "Crop"
|
|
2186
2009
|
},
|
|
2187
|
-
[
|
|
2188
|
-
icon: /* @__PURE__ */ (
|
|
2010
|
+
[z.PRESET_CROP]: {
|
|
2011
|
+
icon: /* @__PURE__ */ p(se, {}),
|
|
2189
2012
|
label: "Presets"
|
|
2190
2013
|
},
|
|
2191
|
-
[
|
|
2192
|
-
icon: /* @__PURE__ */ (
|
|
2014
|
+
[z.FLIP]: {
|
|
2015
|
+
icon: /* @__PURE__ */ p(re, {}),
|
|
2193
2016
|
label: "Flip"
|
|
2194
2017
|
},
|
|
2195
|
-
[
|
|
2196
|
-
icon: /* @__PURE__ */ (
|
|
2018
|
+
[z.ROTATE]: {
|
|
2019
|
+
icon: /* @__PURE__ */ p(ae, {}),
|
|
2197
2020
|
label: "Rotate"
|
|
2198
2021
|
},
|
|
2199
|
-
[
|
|
2200
|
-
icon: /* @__PURE__ */ (
|
|
2022
|
+
[z.FILTERS]: {
|
|
2023
|
+
icon: /* @__PURE__ */ p(ce, {}),
|
|
2201
2024
|
label: "Filters"
|
|
2202
2025
|
}
|
|
2203
|
-
},
|
|
2204
|
-
let { settings: e, currentAction: t, showCompare: n, toggleCompare: r, getLastRotation: i, getLastHistoryItem: a, setCurrentAction: o, setSidebar: s } =
|
|
2026
|
+
}, At = (e) => kt[e] ?? null, jt = () => {
|
|
2027
|
+
let { settings: e, currentAction: t, showCompare: n, toggleCompare: r, getLastRotation: i, getLastHistoryItem: a, setCurrentAction: o, setSidebar: s } = B(), c = e?.tools || [], l = t?.name, { width: u, height: d } = a();
|
|
2205
2028
|
return { click: (e) => {
|
|
2206
2029
|
if (c.includes(e) && l === e) {
|
|
2207
2030
|
o(null);
|
|
2208
2031
|
return;
|
|
2209
2032
|
}
|
|
2210
2033
|
switch (e) {
|
|
2211
|
-
case
|
|
2034
|
+
case z.RESIZE:
|
|
2212
2035
|
o({
|
|
2213
|
-
name:
|
|
2036
|
+
name: z.RESIZE,
|
|
2214
2037
|
args: {
|
|
2215
2038
|
width: u,
|
|
2216
2039
|
height: d
|
|
2217
2040
|
}
|
|
2218
2041
|
});
|
|
2219
2042
|
break;
|
|
2220
|
-
case
|
|
2043
|
+
case z.CROP:
|
|
2221
2044
|
o({
|
|
2222
|
-
name:
|
|
2045
|
+
name: z.CROP,
|
|
2223
2046
|
args: {
|
|
2224
2047
|
id: "freeform",
|
|
2225
2048
|
ratio: u / d,
|
|
@@ -2227,9 +2050,9 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2227
2050
|
}
|
|
2228
2051
|
});
|
|
2229
2052
|
break;
|
|
2230
|
-
case
|
|
2053
|
+
case z.PRESET_CROP:
|
|
2231
2054
|
o({
|
|
2232
|
-
name:
|
|
2055
|
+
name: z.PRESET_CROP,
|
|
2233
2056
|
args: {
|
|
2234
2057
|
id: "facebook-post",
|
|
2235
2058
|
ratio: 1200 / 630,
|
|
@@ -2241,25 +2064,25 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2241
2064
|
}
|
|
2242
2065
|
});
|
|
2243
2066
|
break;
|
|
2244
|
-
case
|
|
2067
|
+
case z.FLIP:
|
|
2245
2068
|
o({
|
|
2246
|
-
name:
|
|
2069
|
+
name: z.FLIP,
|
|
2247
2070
|
args: {
|
|
2248
2071
|
horizontal: !1,
|
|
2249
2072
|
vertical: !1
|
|
2250
2073
|
}
|
|
2251
2074
|
});
|
|
2252
2075
|
break;
|
|
2253
|
-
case
|
|
2076
|
+
case z.ROTATE:
|
|
2254
2077
|
o({
|
|
2255
|
-
name:
|
|
2078
|
+
name: z.ROTATE,
|
|
2256
2079
|
args: { degrees: i() }
|
|
2257
2080
|
});
|
|
2258
2081
|
break;
|
|
2259
|
-
case
|
|
2082
|
+
case z.FILTERS:
|
|
2260
2083
|
o({
|
|
2261
|
-
name:
|
|
2262
|
-
args:
|
|
2084
|
+
name: z.FILTERS,
|
|
2085
|
+
args: St()
|
|
2263
2086
|
});
|
|
2264
2087
|
break;
|
|
2265
2088
|
}
|
|
@@ -2272,18 +2095,18 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2272
2095
|
wrapper: "_wrapper_1lx29_20",
|
|
2273
2096
|
item: "_item_1lx29_24",
|
|
2274
2097
|
selected: "_selected_1lx29_43"
|
|
2275
|
-
},
|
|
2276
|
-
let { settings: t, sidebar: n, currentAction: r } =
|
|
2277
|
-
return /* @__PURE__ */ (
|
|
2098
|
+
}, Mt = ({ isMobile: e }) => {
|
|
2099
|
+
let { settings: t, sidebar: n, currentAction: r } = B(), i = t?.tools || [], a = r?.name, { click: o } = jt();
|
|
2100
|
+
return /* @__PURE__ */ p("nav", {
|
|
2278
2101
|
className: `${Q.sidebar} ${e ? Q.mobile : ""} ${e && n ? Q.open : ""}`,
|
|
2279
|
-
children: /* @__PURE__ */ (
|
|
2102
|
+
children: /* @__PURE__ */ p(R, {
|
|
2280
2103
|
position: "right",
|
|
2281
2104
|
className: Q.tooltip,
|
|
2282
2105
|
children: i.map((e) => {
|
|
2283
|
-
let t =
|
|
2106
|
+
let t = At(e);
|
|
2284
2107
|
if (!t) return null;
|
|
2285
2108
|
let { icon: n, label: r } = t;
|
|
2286
|
-
return /* @__PURE__ */ (
|
|
2109
|
+
return /* @__PURE__ */ p("div", {
|
|
2287
2110
|
className: `${Q.item} ${a === e ? Q.selected : ""}`,
|
|
2288
2111
|
onClick: () => o(e),
|
|
2289
2112
|
"data-tooltip": r,
|
|
@@ -2293,15 +2116,15 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2293
2116
|
})
|
|
2294
2117
|
})
|
|
2295
2118
|
});
|
|
2296
|
-
},
|
|
2297
|
-
let { originalBlob: e, getLastHistoryItem: t } =
|
|
2298
|
-
return /* @__PURE__ */ (
|
|
2299
|
-
className:
|
|
2300
|
-
children: [/* @__PURE__ */ (
|
|
2301
|
-
className:
|
|
2302
|
-
children: e ?
|
|
2303
|
-
}), /* @__PURE__ */ (
|
|
2304
|
-
className:
|
|
2119
|
+
}, Nt = { infobar: "_infobar_1kq0f_1" }, Pt = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`, Ft = () => {
|
|
2120
|
+
let { originalBlob: e, getLastHistoryItem: t } = B(), { width: n, height: r } = t();
|
|
2121
|
+
return /* @__PURE__ */ m("div", {
|
|
2122
|
+
className: Nt.infobar,
|
|
2123
|
+
children: [/* @__PURE__ */ p("div", {
|
|
2124
|
+
className: Nt.filesize,
|
|
2125
|
+
children: e ? Pt(e.size) : "0 B"
|
|
2126
|
+
}), /* @__PURE__ */ m("div", {
|
|
2127
|
+
className: Nt.sizes,
|
|
2305
2128
|
children: [
|
|
2306
2129
|
n,
|
|
2307
2130
|
" / ",
|
|
@@ -2309,17 +2132,17 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2309
2132
|
]
|
|
2310
2133
|
})]
|
|
2311
2134
|
});
|
|
2312
|
-
},
|
|
2313
|
-
let r = Math.min(
|
|
2135
|
+
}, It = 15, Lt = 200, Rt = 2, zt = (e, t, n) => {
|
|
2136
|
+
let r = Math.min(Lt, Math.max(It, e));
|
|
2314
2137
|
return {
|
|
2315
2138
|
scale: r,
|
|
2316
2139
|
width: Math.round(r / 100 * t),
|
|
2317
2140
|
height: Math.round(r / 100 * n)
|
|
2318
2141
|
};
|
|
2319
|
-
},
|
|
2320
|
-
let { getLastHistoryItem: e, eventBus: t } =
|
|
2321
|
-
let n =
|
|
2322
|
-
f(n.width), m(n.height), g(n.scale), _.current = n.scale,
|
|
2142
|
+
}, Bt = () => {
|
|
2143
|
+
let { getLastHistoryItem: e, eventBus: t } = B(), { commit: n, close: r, isSaving: a } = G(), { width: s, height: c } = e(), [l, f] = d(s), [p, m] = d(c), [h, g] = d(100), _ = u(h), v = u(0), y = u(null), b = i((e) => {
|
|
2144
|
+
let n = zt(e, s, c);
|
|
2145
|
+
f(n.width), m(n.height), g(n.scale), _.current = n.scale, mt(t, n.scale);
|
|
2323
2146
|
}, [
|
|
2324
2147
|
c,
|
|
2325
2148
|
s,
|
|
@@ -2337,13 +2160,13 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2337
2160
|
let t = y.current?.parentElement, n = e.composedPath?.()[0] ?? e.target;
|
|
2338
2161
|
return n instanceof Node && !!t?.contains(n);
|
|
2339
2162
|
}, t = (t) => {
|
|
2340
|
-
e(t) && b(_.current - Math.sign(t.deltaY) *
|
|
2163
|
+
e(t) && b(_.current - Math.sign(t.deltaY) * Rt);
|
|
2341
2164
|
}, n = (t) => {
|
|
2342
2165
|
e(t) && (v.current = t.touches[0].clientY);
|
|
2343
2166
|
}, r = (t) => {
|
|
2344
2167
|
if (!e(t)) return;
|
|
2345
2168
|
let n = t.touches[0].clientY, r = v.current - n;
|
|
2346
|
-
Math.abs(r) < 10 || (b(_.current + Math.sign(r) *
|
|
2169
|
+
Math.abs(r) < 10 || (b(_.current + Math.sign(r) * Rt), v.current = n);
|
|
2347
2170
|
}, i = new AbortController(), { signal: a } = i;
|
|
2348
2171
|
return window.addEventListener("wheel", t, { signal: a }), window.addEventListener("touchstart", n, { signal: a }), window.addEventListener("touchmove", r, { signal: a }), () => i.abort();
|
|
2349
2172
|
}, [b]), {
|
|
@@ -2366,38 +2189,38 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2366
2189
|
width: l,
|
|
2367
2190
|
height: p,
|
|
2368
2191
|
action: {
|
|
2369
|
-
name:
|
|
2192
|
+
name: z.RESIZE,
|
|
2370
2193
|
args: {
|
|
2371
2194
|
width: l,
|
|
2372
2195
|
height: p
|
|
2373
2196
|
}
|
|
2374
2197
|
}
|
|
2375
|
-
}),
|
|
2198
|
+
}), mt(t, 100);
|
|
2376
2199
|
},
|
|
2377
2200
|
close: () => {
|
|
2378
|
-
|
|
2201
|
+
mt(t, 100), r();
|
|
2379
2202
|
},
|
|
2380
2203
|
isSaving: a
|
|
2381
2204
|
};
|
|
2382
|
-
},
|
|
2205
|
+
}, Vt = {
|
|
2383
2206
|
resize: "_resize_1sbig_1",
|
|
2384
2207
|
toolsLock: "_toolsLock_1sbig_5",
|
|
2385
2208
|
indicatorWrapper: "_indicatorWrapper_1sbig_10",
|
|
2386
2209
|
indicator: "_indicator_1sbig_10"
|
|
2387
|
-
},
|
|
2388
|
-
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, isSaving: f } =
|
|
2389
|
-
return /* @__PURE__ */ (
|
|
2210
|
+
}, Ht = () => {
|
|
2211
|
+
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, isSaving: f } = Bt();
|
|
2212
|
+
return /* @__PURE__ */ m(q, {
|
|
2390
2213
|
ref: e,
|
|
2391
|
-
className:
|
|
2214
|
+
className: Vt.resize,
|
|
2392
2215
|
children: [
|
|
2393
|
-
/* @__PURE__ */ (
|
|
2394
|
-
className:
|
|
2395
|
-
children: /* @__PURE__ */ (
|
|
2396
|
-
className:
|
|
2216
|
+
/* @__PURE__ */ p("div", {
|
|
2217
|
+
className: Vt.indicatorWrapper,
|
|
2218
|
+
children: /* @__PURE__ */ p("div", {
|
|
2219
|
+
className: Vt.indicator,
|
|
2397
2220
|
style: { width: `${r / 2}%` }
|
|
2398
2221
|
})
|
|
2399
2222
|
}),
|
|
2400
|
-
/* @__PURE__ */ (
|
|
2223
|
+
/* @__PURE__ */ p(Ce, {
|
|
2401
2224
|
value: t,
|
|
2402
2225
|
name: "width",
|
|
2403
2226
|
label: "Width",
|
|
@@ -2405,8 +2228,8 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2405
2228
|
onChange: (e) => o(Number(e.target.value)),
|
|
2406
2229
|
onBlur: c
|
|
2407
2230
|
}),
|
|
2408
|
-
/* @__PURE__ */ (
|
|
2409
|
-
/* @__PURE__ */ (
|
|
2231
|
+
/* @__PURE__ */ p(C, { className: Vt.toolsLock }),
|
|
2232
|
+
/* @__PURE__ */ p(Ce, {
|
|
2410
2233
|
value: n,
|
|
2411
2234
|
name: "height",
|
|
2412
2235
|
label: "Height",
|
|
@@ -2414,7 +2237,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2414
2237
|
onChange: (e) => s(Number(e.target.value)),
|
|
2415
2238
|
onBlur: l
|
|
2416
2239
|
}),
|
|
2417
|
-
/* @__PURE__ */ (
|
|
2240
|
+
/* @__PURE__ */ p(F, {
|
|
2418
2241
|
onSave: u,
|
|
2419
2242
|
onClose: d,
|
|
2420
2243
|
saving: f,
|
|
@@ -2446,15 +2269,15 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2446
2269
|
infoH: "_infoH_1co2u_146",
|
|
2447
2270
|
group: "_group_1co2u_153",
|
|
2448
2271
|
active: "_active_1co2u_162"
|
|
2449
|
-
},
|
|
2450
|
-
let { getLastHistoryItem: e } =
|
|
2451
|
-
return /* @__PURE__ */ (
|
|
2272
|
+
}, Ut = () => {
|
|
2273
|
+
let { getLastHistoryItem: e } = B(), t = Pe(), n = u(null), { handleCropStart: r, initialCrop: i } = tn({ boxRef: n }), { width: a, height: o } = e(), { x: s, y: c, w: l, h: d } = i;
|
|
2274
|
+
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(yt, {
|
|
2452
2275
|
isClipped: !0,
|
|
2453
2276
|
style: { clipPath: `xywh(${s}% ${c}% ${l}% ${d}%)` }
|
|
2454
|
-
}), /* @__PURE__ */ (
|
|
2277
|
+
}), /* @__PURE__ */ p("div", {
|
|
2455
2278
|
className: $.wrapper,
|
|
2456
2279
|
style: { aspectRatio: `${a} / ${o}` },
|
|
2457
|
-
children: /* @__PURE__ */ (
|
|
2280
|
+
children: /* @__PURE__ */ m("div", {
|
|
2458
2281
|
ref: n,
|
|
2459
2282
|
className: $.box,
|
|
2460
2283
|
style: {
|
|
@@ -2463,40 +2286,40 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2463
2286
|
top: `${c}%`,
|
|
2464
2287
|
left: `${s}%`
|
|
2465
2288
|
},
|
|
2466
|
-
children: [/* @__PURE__ */ (
|
|
2289
|
+
children: [/* @__PURE__ */ p(Jt, {}), t ? /* @__PURE__ */ p(nn, { onMouseDown: r }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Yt, { onMouseDown: r }), /* @__PURE__ */ p(rn, {})] })]
|
|
2467
2290
|
})
|
|
2468
2291
|
})] });
|
|
2469
|
-
},
|
|
2292
|
+
}, Wt = [
|
|
2470
2293
|
{
|
|
2471
2294
|
id: "freeform",
|
|
2472
|
-
icon: /* @__PURE__ */ (
|
|
2295
|
+
icon: /* @__PURE__ */ p(O, {}),
|
|
2473
2296
|
label: "Freeform"
|
|
2474
2297
|
},
|
|
2475
2298
|
{
|
|
2476
2299
|
id: "origin",
|
|
2477
|
-
icon: /* @__PURE__ */ (
|
|
2300
|
+
icon: /* @__PURE__ */ p(k, {}),
|
|
2478
2301
|
label: "Original"
|
|
2479
2302
|
},
|
|
2480
2303
|
{
|
|
2481
2304
|
id: "1:1",
|
|
2482
|
-
icon: /* @__PURE__ */ (
|
|
2305
|
+
icon: /* @__PURE__ */ p(A, {}),
|
|
2483
2306
|
label: "1 : 1"
|
|
2484
2307
|
},
|
|
2485
2308
|
{
|
|
2486
2309
|
id: "4:3",
|
|
2487
|
-
icon: /* @__PURE__ */ (
|
|
2310
|
+
icon: /* @__PURE__ */ p(te, {}),
|
|
2488
2311
|
label: "4 : 3"
|
|
2489
2312
|
},
|
|
2490
2313
|
{
|
|
2491
2314
|
id: "16:9",
|
|
2492
|
-
icon: /* @__PURE__ */ (
|
|
2315
|
+
icon: /* @__PURE__ */ p(ee, {}),
|
|
2493
2316
|
label: "16 : 9"
|
|
2494
2317
|
}
|
|
2495
|
-
],
|
|
2318
|
+
], Gt = ({ value: e, onChange: t }) => /* @__PURE__ */ p("div", {
|
|
2496
2319
|
className: $.group,
|
|
2497
|
-
children: /* @__PURE__ */ (
|
|
2320
|
+
children: /* @__PURE__ */ p(R, {
|
|
2498
2321
|
position: "top",
|
|
2499
|
-
children:
|
|
2322
|
+
children: Wt.map((n) => /* @__PURE__ */ p(M, {
|
|
2500
2323
|
variant: "outline",
|
|
2501
2324
|
className: `${$.groupBtn} ${e === n.id ? $.active : ""}`,
|
|
2502
2325
|
onClick: () => t(n.id),
|
|
@@ -2505,16 +2328,16 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2505
2328
|
children: n.icon
|
|
2506
2329
|
}, n.id))
|
|
2507
2330
|
})
|
|
2508
|
-
}),
|
|
2509
|
-
let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, eventBus: r } =
|
|
2331
|
+
}), Kt = () => {
|
|
2332
|
+
let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, eventBus: r } = B(), { commit: i, close: a, isSaving: s } = G(), { width: c, height: l } = n(), { name: d, args: f } = t || {}, p = d === z.CROP ? f?.id : "", m = c / l, h = u({
|
|
2510
2333
|
x: 0,
|
|
2511
2334
|
y: 0,
|
|
2512
2335
|
w: 0,
|
|
2513
2336
|
h: 0
|
|
2514
2337
|
});
|
|
2515
2338
|
return o(() => {
|
|
2516
|
-
if (t?.name !==
|
|
2517
|
-
let e =
|
|
2339
|
+
if (t?.name !== z.CROP) return;
|
|
2340
|
+
let e = H(t.args.ratio, c, l);
|
|
2518
2341
|
h.current = e;
|
|
2519
2342
|
let n = (e) => {
|
|
2520
2343
|
h.current = e.detail;
|
|
@@ -2531,7 +2354,7 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2531
2354
|
currentValue: p,
|
|
2532
2355
|
handleChange: (t) => {
|
|
2533
2356
|
t !== p && e({
|
|
2534
|
-
name:
|
|
2357
|
+
name: z.CROP,
|
|
2535
2358
|
args: {
|
|
2536
2359
|
id: t,
|
|
2537
2360
|
ratio: /^\d+:\d+$/.test(t) ? t.split(":").map(Number).reduce((e, t) => e / t) : m,
|
|
@@ -2540,13 +2363,13 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2540
2363
|
});
|
|
2541
2364
|
},
|
|
2542
2365
|
handleSave: () => {
|
|
2543
|
-
if (!t || t.name !==
|
|
2366
|
+
if (!t || t.name !== z.CROP) return;
|
|
2544
2367
|
let e = t.args?.preset?.width || Math.round(c * h.current.w / 100), n = t.args?.preset?.height || Math.round(l * h.current.h / 100);
|
|
2545
2368
|
i({
|
|
2546
2369
|
width: e,
|
|
2547
2370
|
height: n,
|
|
2548
2371
|
action: {
|
|
2549
|
-
name:
|
|
2372
|
+
name: z.CROP,
|
|
2550
2373
|
args: {
|
|
2551
2374
|
...t.args,
|
|
2552
2375
|
...h.current
|
|
@@ -2557,53 +2380,53 @@ var dt = ({ surfaceRef: e }) => {
|
|
|
2557
2380
|
handleClose: a,
|
|
2558
2381
|
isSaving: s
|
|
2559
2382
|
};
|
|
2560
|
-
},
|
|
2561
|
-
let { currentValue: e, handleChange: t, handleSave: n, handleClose: r, isSaving: i } =
|
|
2562
|
-
return /* @__PURE__ */ (
|
|
2383
|
+
}, qt = () => {
|
|
2384
|
+
let { currentValue: e, handleChange: t, handleSave: n, handleClose: r, isSaving: i } = Kt();
|
|
2385
|
+
return /* @__PURE__ */ m(q, { children: [/* @__PURE__ */ p(Gt, {
|
|
2563
2386
|
value: e,
|
|
2564
2387
|
onChange: t
|
|
2565
|
-
}), /* @__PURE__ */ (
|
|
2388
|
+
}), /* @__PURE__ */ p(F, {
|
|
2566
2389
|
onSave: n,
|
|
2567
2390
|
onClose: r,
|
|
2568
2391
|
saving: i
|
|
2569
2392
|
})] });
|
|
2570
|
-
},
|
|
2393
|
+
}, Jt = () => /* @__PURE__ */ m("div", {
|
|
2571
2394
|
className: $.linesBox,
|
|
2572
|
-
children: [/* @__PURE__ */ (
|
|
2573
|
-
}),
|
|
2574
|
-
/* @__PURE__ */ (
|
|
2395
|
+
children: [/* @__PURE__ */ p("span", { className: `${$.line} ${$.lineV}` }), /* @__PURE__ */ p("span", { className: `${$.line} ${$.lineH}` })]
|
|
2396
|
+
}), Yt = ({ onMouseDown: e }) => /* @__PURE__ */ m(f, { children: [
|
|
2397
|
+
/* @__PURE__ */ p("div", {
|
|
2575
2398
|
className: `${$.pointer} ${$.pointerTopLeft}`,
|
|
2576
2399
|
onMouseDown: (t) => e(t, "tl", "nwse")
|
|
2577
2400
|
}),
|
|
2578
|
-
/* @__PURE__ */ (
|
|
2401
|
+
/* @__PURE__ */ p("div", {
|
|
2579
2402
|
className: `${$.pointer} ${$.pointerTopRight}`,
|
|
2580
2403
|
onMouseDown: (t) => e(t, "tr", "nesw")
|
|
2581
2404
|
}),
|
|
2582
|
-
/* @__PURE__ */ (
|
|
2405
|
+
/* @__PURE__ */ p("div", {
|
|
2583
2406
|
className: `${$.pointer} ${$.pointerBottomRight}`,
|
|
2584
2407
|
onMouseDown: (t) => e(t, "br", "nwse")
|
|
2585
2408
|
}),
|
|
2586
|
-
/* @__PURE__ */ (
|
|
2409
|
+
/* @__PURE__ */ p("div", {
|
|
2587
2410
|
className: `${$.pointer} ${$.pointerBottomLeft}`,
|
|
2588
2411
|
onMouseDown: (t) => e(t, "bl", "nesw")
|
|
2589
2412
|
})
|
|
2590
2413
|
] });
|
|
2591
2414
|
//#endregion
|
|
2592
2415
|
//#region src/shared/components/Pixedi/crop/useCropInteraction.ts
|
|
2593
|
-
function
|
|
2416
|
+
function Xt(e, t, n) {
|
|
2594
2417
|
return Math.min(Math.max(e, t), n);
|
|
2595
2418
|
}
|
|
2596
|
-
function
|
|
2419
|
+
function Zt(e, { x: t, y: n, w: r, h: i }) {
|
|
2597
2420
|
e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
|
|
2598
2421
|
}
|
|
2599
|
-
function
|
|
2422
|
+
function Qt(e) {
|
|
2600
2423
|
let { width: t, height: n } = e.getBoundingClientRect();
|
|
2601
2424
|
return {
|
|
2602
2425
|
frameW: t,
|
|
2603
2426
|
frameH: n
|
|
2604
2427
|
};
|
|
2605
2428
|
}
|
|
2606
|
-
function
|
|
2429
|
+
function $t({ x: e, y: t, w: n, h: r }, i, a) {
|
|
2607
2430
|
return {
|
|
2608
2431
|
x: e / 100 * i,
|
|
2609
2432
|
y: t / 100 * a,
|
|
@@ -2611,7 +2434,7 @@ function tn({ x: e, y: t, w: n, h: r }, i, a) {
|
|
|
2611
2434
|
h: r / 100 * a
|
|
2612
2435
|
};
|
|
2613
2436
|
}
|
|
2614
|
-
function
|
|
2437
|
+
function en({ x: e, y: t, w: n, h: r }, i, a) {
|
|
2615
2438
|
return {
|
|
2616
2439
|
x: e / i * 100,
|
|
2617
2440
|
y: t / a * 100,
|
|
@@ -2619,22 +2442,22 @@ function nn({ x: e, y: t, w: n, h: r }, i, a) {
|
|
|
2619
2442
|
h: r / a * 100
|
|
2620
2443
|
};
|
|
2621
2444
|
}
|
|
2622
|
-
var
|
|
2623
|
-
let { currentAction: t, getLastHistoryItem: n, eventBus: r } =
|
|
2445
|
+
var tn = ({ boxRef: e }) => {
|
|
2446
|
+
let { currentAction: t, getLastHistoryItem: n, eventBus: r } = B(), i = Pe(), { width: a, height: s } = n(), c = t?.name === z.CROP || t?.name === z.PRESET_CROP, d = c ? t.args.ratio : 1, f = !c || t.args.isFree, p = l(() => H(d, a, s), [
|
|
2624
2447
|
d,
|
|
2625
2448
|
a,
|
|
2626
2449
|
s
|
|
2627
2450
|
]), m = u(null), h = u(""), g = u(p), _ = u(p);
|
|
2628
2451
|
return o(() => {
|
|
2629
|
-
g.current = p,
|
|
2452
|
+
g.current = p, pt(r, p);
|
|
2630
2453
|
}, [p, r]), o(() => {
|
|
2631
2454
|
let t = (e, t) => {
|
|
2632
|
-
g.current = t,
|
|
2455
|
+
g.current = t, Zt(e, t), ft(r, {
|
|
2633
2456
|
x: Math.round(t.x / 100 * a),
|
|
2634
2457
|
y: Math.round(t.y / 100 * s),
|
|
2635
2458
|
w: Math.round(t.w / 100 * a),
|
|
2636
2459
|
h: Math.round(t.h / 100 * s)
|
|
2637
|
-
}),
|
|
2460
|
+
}), pt(r, t);
|
|
2638
2461
|
}, n = (e) => {
|
|
2639
2462
|
e.preventDefault(), _.current = g.current;
|
|
2640
2463
|
let t = "clientX" in e ? e.clientX : e.touches[0].clientX, n = "clientY" in e ? e.clientY : e.touches[0].clientY;
|
|
@@ -2647,7 +2470,7 @@ var rn = ({ boxRef: e }) => {
|
|
|
2647
2470
|
t.preventDefault();
|
|
2648
2471
|
let n = e.current, r = n.parentElement;
|
|
2649
2472
|
if (!r) return;
|
|
2650
|
-
let { frameW: i, frameH: a } =
|
|
2473
|
+
let { frameW: i, frameH: a } = Qt(r);
|
|
2651
2474
|
if (h.current) {
|
|
2652
2475
|
o(t, n, i, a);
|
|
2653
2476
|
return;
|
|
@@ -2655,14 +2478,14 @@ var rn = ({ boxRef: e }) => {
|
|
|
2655
2478
|
c(t, n, i, a);
|
|
2656
2479
|
}, o = (e, n, r, i) => {
|
|
2657
2480
|
if (!m.current) return;
|
|
2658
|
-
let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY, l =
|
|
2659
|
-
t(n, f ? l :
|
|
2481
|
+
let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY, l = en(Ue(h.current, f, d, m.current.x, m.current.y, o, c, r, i, $t(_.current, r, i), $t(g.current, r, i)), r, i);
|
|
2482
|
+
t(n, f ? l : We(l, d, a, s));
|
|
2660
2483
|
}, c = (e, n, r, i) => {
|
|
2661
2484
|
if (!m.current) return;
|
|
2662
2485
|
let { x: a, y: o, w: s, h: c } = _.current, l = "clientX" in e ? e.clientX : e.touches[0].clientX, u = "clientY" in e ? e.clientY : e.touches[0].clientY, d = (l - m.current.x) / r * 100, f = (u - m.current.y) / i * 100;
|
|
2663
2486
|
t(n, {
|
|
2664
|
-
x:
|
|
2665
|
-
y:
|
|
2487
|
+
x: Xt(a + d, 0, Math.max(0, 100 - s)),
|
|
2488
|
+
y: Xt(o + f, 0, Math.max(0, 100 - c)),
|
|
2666
2489
|
w: s,
|
|
2667
2490
|
h: c
|
|
2668
2491
|
});
|
|
@@ -2697,17 +2520,17 @@ var rn = ({ boxRef: e }) => {
|
|
|
2697
2520
|
},
|
|
2698
2521
|
initialCrop: p
|
|
2699
2522
|
};
|
|
2700
|
-
},
|
|
2523
|
+
}, nn = ({ onMouseDown: e }) => /* @__PURE__ */ p("div", {
|
|
2701
2524
|
className: $.mobileBorder,
|
|
2702
|
-
children: /* @__PURE__ */ (
|
|
2525
|
+
children: /* @__PURE__ */ p("div", {
|
|
2703
2526
|
className: $.mobilePointer,
|
|
2704
2527
|
onTouchStart: (t) => e(t, "br", "nwse")
|
|
2705
2528
|
})
|
|
2706
|
-
}),
|
|
2707
|
-
let e = u(null), t = u(null), n = u(null), r = u(null), { currentAction: i, getLastHistoryItem: a, eventBus: s } =
|
|
2529
|
+
}), rn = () => {
|
|
2530
|
+
let e = u(null), t = u(null), n = u(null), r = u(null), { currentAction: i, getLastHistoryItem: a, eventBus: s } = B(), { width: c, height: l } = a();
|
|
2708
2531
|
return o(() => {
|
|
2709
|
-
if (!(i?.name ===
|
|
2710
|
-
let { xP: a, yP: o, wP: u, hP: d } =
|
|
2532
|
+
if (!(i?.name === z.CROP || i?.name === z.PRESET_CROP)) return;
|
|
2533
|
+
let { xP: a, yP: o, wP: u, hP: d } = H(i.args.ratio, c, l);
|
|
2711
2534
|
e.current && (e.current.textContent = a.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = u.toString()), r.current && (r.current.textContent = d.toString());
|
|
2712
2535
|
let f = (i) => {
|
|
2713
2536
|
let { x: a, y: o, w: s, h: c } = i.detail;
|
|
@@ -2721,34 +2544,34 @@ var rn = ({ boxRef: e }) => {
|
|
|
2721
2544
|
l,
|
|
2722
2545
|
c,
|
|
2723
2546
|
s
|
|
2724
|
-
]), /* @__PURE__ */ (
|
|
2725
|
-
/* @__PURE__ */ (
|
|
2547
|
+
]), /* @__PURE__ */ m(f, { children: [
|
|
2548
|
+
/* @__PURE__ */ p("div", {
|
|
2726
2549
|
className: `${$.info} ${$.infoX}`,
|
|
2727
|
-
children: /* @__PURE__ */ (
|
|
2550
|
+
children: /* @__PURE__ */ p("b", { ref: e })
|
|
2728
2551
|
}),
|
|
2729
|
-
/* @__PURE__ */ (
|
|
2552
|
+
/* @__PURE__ */ p("div", {
|
|
2730
2553
|
className: `${$.info} ${$.infoY}`,
|
|
2731
|
-
children: /* @__PURE__ */ (
|
|
2554
|
+
children: /* @__PURE__ */ p("b", { ref: t })
|
|
2732
2555
|
}),
|
|
2733
|
-
/* @__PURE__ */ (
|
|
2556
|
+
/* @__PURE__ */ p("div", {
|
|
2734
2557
|
className: `${$.info} ${$.infoW}`,
|
|
2735
|
-
children: /* @__PURE__ */ (
|
|
2558
|
+
children: /* @__PURE__ */ p("b", { ref: n })
|
|
2736
2559
|
}),
|
|
2737
|
-
/* @__PURE__ */ (
|
|
2560
|
+
/* @__PURE__ */ p("div", {
|
|
2738
2561
|
className: `${$.info} ${$.infoH}`,
|
|
2739
|
-
children: /* @__PURE__ */ (
|
|
2562
|
+
children: /* @__PURE__ */ p("b", { ref: r })
|
|
2740
2563
|
})
|
|
2741
2564
|
] });
|
|
2742
|
-
},
|
|
2743
|
-
let { currentAction: e, getLastHistoryItem: t, setCurrentAction: n, eventBus: r } =
|
|
2565
|
+
}, an = _.map((e) => e.options).flat(), on = () => an, sn = () => {
|
|
2566
|
+
let { currentAction: e, getLastHistoryItem: t, setCurrentAction: n, eventBus: r } = B(), { commit: i, close: a, isSaving: s } = G(), { width: c, height: l } = t(), d = e?.name === z.PRESET_CROP && an.some((t) => t.value === e.args.id) ? e.args.id : "", f = u({
|
|
2744
2567
|
x: 0,
|
|
2745
2568
|
y: 0,
|
|
2746
2569
|
w: 0,
|
|
2747
2570
|
h: 0
|
|
2748
2571
|
});
|
|
2749
2572
|
return o(() => {
|
|
2750
|
-
if (e?.name !==
|
|
2751
|
-
let t =
|
|
2573
|
+
if (e?.name !== z.PRESET_CROP) return;
|
|
2574
|
+
let t = H(e.args.ratio, c, l);
|
|
2752
2575
|
f.current = t;
|
|
2753
2576
|
let n = (e) => {
|
|
2754
2577
|
f.current = e.detail;
|
|
@@ -2763,10 +2586,10 @@ var rn = ({ boxRef: e }) => {
|
|
|
2763
2586
|
r
|
|
2764
2587
|
]), {
|
|
2765
2588
|
currentValue: d,
|
|
2766
|
-
presetsData:
|
|
2589
|
+
presetsData: _,
|
|
2767
2590
|
handleChange: (e) => {
|
|
2768
2591
|
if (!e) return;
|
|
2769
|
-
let t =
|
|
2592
|
+
let t = on().find((t) => t.value === e);
|
|
2770
2593
|
if (!t) return;
|
|
2771
2594
|
let r = {
|
|
2772
2595
|
id: e,
|
|
@@ -2778,16 +2601,16 @@ var rn = ({ boxRef: e }) => {
|
|
|
2778
2601
|
}
|
|
2779
2602
|
};
|
|
2780
2603
|
n({
|
|
2781
|
-
name:
|
|
2604
|
+
name: z.PRESET_CROP,
|
|
2782
2605
|
args: r
|
|
2783
2606
|
});
|
|
2784
2607
|
},
|
|
2785
2608
|
handleSave: () => {
|
|
2786
|
-
!e || e.name !==
|
|
2609
|
+
!e || e.name !== z.PRESET_CROP || i({
|
|
2787
2610
|
width: e.args?.preset?.width || 0,
|
|
2788
2611
|
height: e.args?.preset?.height || 0,
|
|
2789
2612
|
action: {
|
|
2790
|
-
name:
|
|
2613
|
+
name: z.CROP,
|
|
2791
2614
|
args: {
|
|
2792
2615
|
...e.args,
|
|
2793
2616
|
...f.current
|
|
@@ -2798,23 +2621,23 @@ var rn = ({ boxRef: e }) => {
|
|
|
2798
2621
|
handleClose: a,
|
|
2799
2622
|
isSaving: s
|
|
2800
2623
|
};
|
|
2801
|
-
},
|
|
2802
|
-
let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i, isSaving: a } =
|
|
2803
|
-
return /* @__PURE__ */ (
|
|
2624
|
+
}, cn = { select: "_select_1ieak_1" }, ln = () => {
|
|
2625
|
+
let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i, isSaving: a } = sn();
|
|
2626
|
+
return /* @__PURE__ */ m(q, { children: [/* @__PURE__ */ p(ye, {
|
|
2804
2627
|
value: e,
|
|
2805
2628
|
placeholder: "Select preset",
|
|
2806
2629
|
onChange: n,
|
|
2807
2630
|
items: t,
|
|
2808
|
-
className:
|
|
2809
|
-
}), /* @__PURE__ */ (
|
|
2631
|
+
className: cn.select
|
|
2632
|
+
}), /* @__PURE__ */ p(F, {
|
|
2810
2633
|
onSave: r,
|
|
2811
2634
|
onClose: i,
|
|
2812
2635
|
saving: a
|
|
2813
2636
|
})] });
|
|
2814
|
-
},
|
|
2815
|
-
let { getLastHistoryItem: e, setCurrentAction: t } =
|
|
2637
|
+
}, un = () => {
|
|
2638
|
+
let { getLastHistoryItem: e, setCurrentAction: t } = B(), { commit: n, close: r, isSaving: i } = G(), { width: a, height: o } = e(), [s, c] = d(!1), [l, u] = d(!1), f = (e, n) => {
|
|
2816
2639
|
t({
|
|
2817
|
-
name:
|
|
2640
|
+
name: z.FLIP,
|
|
2818
2641
|
args: {
|
|
2819
2642
|
horizontal: e,
|
|
2820
2643
|
vertical: n
|
|
@@ -2837,7 +2660,7 @@ var rn = ({ boxRef: e }) => {
|
|
|
2837
2660
|
width: a,
|
|
2838
2661
|
height: o,
|
|
2839
2662
|
action: {
|
|
2840
|
-
name:
|
|
2663
|
+
name: z.FLIP,
|
|
2841
2664
|
args: {
|
|
2842
2665
|
horizontal: s,
|
|
2843
2666
|
vertical: l
|
|
@@ -2848,51 +2671,51 @@ var rn = ({ boxRef: e }) => {
|
|
|
2848
2671
|
handleClose: r,
|
|
2849
2672
|
isSaving: i
|
|
2850
2673
|
};
|
|
2851
|
-
},
|
|
2674
|
+
}, dn = {
|
|
2852
2675
|
btnH: "_btnH_15adi_1",
|
|
2853
2676
|
btnV: "_btnV_15adi_7"
|
|
2854
|
-
},
|
|
2855
|
-
let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a, isSaving: o } =
|
|
2856
|
-
return /* @__PURE__ */ (
|
|
2857
|
-
className:
|
|
2858
|
-
children: /* @__PURE__ */ (
|
|
2677
|
+
}, fn = () => {
|
|
2678
|
+
let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a, isSaving: o } = un();
|
|
2679
|
+
return /* @__PURE__ */ m(q, { children: [/* @__PURE__ */ p("div", {
|
|
2680
|
+
className: dn.scGroup,
|
|
2681
|
+
children: /* @__PURE__ */ m(R, {
|
|
2859
2682
|
position: "top",
|
|
2860
|
-
children: [/* @__PURE__ */ (
|
|
2683
|
+
children: [/* @__PURE__ */ p(M, {
|
|
2861
2684
|
variant: "outline",
|
|
2862
|
-
className:
|
|
2685
|
+
className: dn.btnH,
|
|
2863
2686
|
onClick: n,
|
|
2864
2687
|
"aria-label": "Horizontal",
|
|
2865
2688
|
"data-tooltip": "Horizontal",
|
|
2866
|
-
children: /* @__PURE__ */ (
|
|
2867
|
-
}), /* @__PURE__ */ (
|
|
2689
|
+
children: /* @__PURE__ */ p(re, { style: { color: e ? "var(--accent-blue)" : "var(--foreground)" } })
|
|
2690
|
+
}), /* @__PURE__ */ p(M, {
|
|
2868
2691
|
variant: "outline",
|
|
2869
|
-
className:
|
|
2692
|
+
className: dn.btnV,
|
|
2870
2693
|
onClick: r,
|
|
2871
2694
|
"aria-label": "Vertical",
|
|
2872
2695
|
"data-tooltip": "Vertical",
|
|
2873
|
-
children: /* @__PURE__ */ (
|
|
2696
|
+
children: /* @__PURE__ */ p(ie, { style: { color: t ? "var(--accent-blue)" : "var(--foreground)" } })
|
|
2874
2697
|
})]
|
|
2875
2698
|
})
|
|
2876
|
-
}), /* @__PURE__ */ (
|
|
2699
|
+
}), /* @__PURE__ */ p(F, {
|
|
2877
2700
|
disabled: !e && !t,
|
|
2878
2701
|
saving: o,
|
|
2879
2702
|
onSave: i,
|
|
2880
2703
|
onClose: a
|
|
2881
2704
|
})] });
|
|
2882
|
-
},
|
|
2883
|
-
let { getLastRotation: e, getLastHistoryItem: t, setCurrentAction: n } =
|
|
2705
|
+
}, pn = () => {
|
|
2706
|
+
let { getLastRotation: e, getLastHistoryItem: t, setCurrentAction: n } = B(), { commit: r, close: i, isSaving: a } = G(), { width: o, height: s } = t(), c = e(), l = u(c), d = u(c);
|
|
2884
2707
|
return {
|
|
2885
2708
|
handleRotate: (e) => {
|
|
2886
2709
|
d.current += e, n({
|
|
2887
|
-
name:
|
|
2710
|
+
name: z.ROTATE,
|
|
2888
2711
|
args: { degrees: d.current }
|
|
2889
2712
|
});
|
|
2890
2713
|
},
|
|
2891
2714
|
handleSave: () => {
|
|
2892
2715
|
r({
|
|
2893
|
-
...
|
|
2716
|
+
...Ge(o, s, l.current, d.current),
|
|
2894
2717
|
action: {
|
|
2895
|
-
name:
|
|
2718
|
+
name: z.ROTATE,
|
|
2896
2719
|
args: { degrees: d.current }
|
|
2897
2720
|
}
|
|
2898
2721
|
});
|
|
@@ -2900,61 +2723,61 @@ var rn = ({ boxRef: e }) => {
|
|
|
2900
2723
|
handleClose: i,
|
|
2901
2724
|
isSaving: a
|
|
2902
2725
|
};
|
|
2903
|
-
},
|
|
2726
|
+
}, mn = {
|
|
2904
2727
|
btnH: "_btnH_15adi_1",
|
|
2905
2728
|
btnV: "_btnV_15adi_7"
|
|
2906
|
-
},
|
|
2907
|
-
let { handleRotate: e, handleSave: t, handleClose: n, isSaving: r } =
|
|
2908
|
-
return /* @__PURE__ */ (
|
|
2909
|
-
className:
|
|
2910
|
-
children: /* @__PURE__ */ (
|
|
2729
|
+
}, hn = () => {
|
|
2730
|
+
let { handleRotate: e, handleSave: t, handleClose: n, isSaving: r } = pn();
|
|
2731
|
+
return /* @__PURE__ */ m(q, { children: [/* @__PURE__ */ p("div", {
|
|
2732
|
+
className: mn.scGroup,
|
|
2733
|
+
children: /* @__PURE__ */ m(R, {
|
|
2911
2734
|
position: "top",
|
|
2912
|
-
children: [/* @__PURE__ */ (
|
|
2735
|
+
children: [/* @__PURE__ */ p(M, {
|
|
2913
2736
|
variant: "outline",
|
|
2914
|
-
className:
|
|
2737
|
+
className: mn.btnH,
|
|
2915
2738
|
onClick: () => e(90),
|
|
2916
2739
|
"aria-label": "+90°",
|
|
2917
2740
|
"data-tooltip": "+90°",
|
|
2918
|
-
children: /* @__PURE__ */ (
|
|
2919
|
-
}), /* @__PURE__ */ (
|
|
2741
|
+
children: /* @__PURE__ */ p(ae, {})
|
|
2742
|
+
}), /* @__PURE__ */ p(M, {
|
|
2920
2743
|
variant: "outline",
|
|
2921
|
-
className:
|
|
2744
|
+
className: mn.btnV,
|
|
2922
2745
|
onClick: () => e(-90),
|
|
2923
2746
|
"aria-label": "-90°",
|
|
2924
2747
|
"data-tooltip": "-90°",
|
|
2925
|
-
children: /* @__PURE__ */ (
|
|
2748
|
+
children: /* @__PURE__ */ p(oe, {})
|
|
2926
2749
|
})]
|
|
2927
2750
|
})
|
|
2928
|
-
}), /* @__PURE__ */ (
|
|
2751
|
+
}), /* @__PURE__ */ p(F, {
|
|
2929
2752
|
onSave: t,
|
|
2930
2753
|
onClose: n,
|
|
2931
2754
|
saving: r
|
|
2932
2755
|
})] });
|
|
2933
|
-
},
|
|
2756
|
+
}, gn = {
|
|
2934
2757
|
frame: "_frame_17rae_1",
|
|
2935
2758
|
"bg-circled": "_bg-circled_17rae_12",
|
|
2936
2759
|
"bg-diagonals": "_bg-diagonals_17rae_74",
|
|
2937
2760
|
"bg-rhombus": "_bg-rhombus_17rae_103"
|
|
2938
|
-
},
|
|
2939
|
-
let { settings: e, currentAction: t } =
|
|
2940
|
-
return /* @__PURE__ */ (
|
|
2761
|
+
}, _n = () => {
|
|
2762
|
+
let { settings: e, currentAction: t } = B(), n = t?.name === z.RESIZE, r = t?.name === z.CROP, i = t?.name === z.PRESET_CROP, a = t?.name === z.FLIP, o = t?.name === z.ROTATE, s = t?.name === z.FILTERS, c = r || i;
|
|
2763
|
+
return /* @__PURE__ */ m("div", {
|
|
2941
2764
|
className: `
|
|
2942
|
-
${
|
|
2943
|
-
${e?.background ?
|
|
2765
|
+
${gn.frame}
|
|
2766
|
+
${e?.background ? gn[`bg-${e.background}`] : ""}
|
|
2944
2767
|
`,
|
|
2945
2768
|
children: [
|
|
2946
|
-
/* @__PURE__ */ (
|
|
2947
|
-
n && /* @__PURE__ */ (
|
|
2948
|
-
r && /* @__PURE__ */ (
|
|
2949
|
-
i && /* @__PURE__ */ (
|
|
2950
|
-
a && /* @__PURE__ */ (
|
|
2951
|
-
o && /* @__PURE__ */ (
|
|
2952
|
-
s && /* @__PURE__ */ (
|
|
2953
|
-
(r || i) && /* @__PURE__ */ (
|
|
2954
|
-
s && /* @__PURE__ */ (
|
|
2769
|
+
/* @__PURE__ */ p(yt, { faded: c }),
|
|
2770
|
+
n && /* @__PURE__ */ p(Ht, {}),
|
|
2771
|
+
r && /* @__PURE__ */ p(qt, {}),
|
|
2772
|
+
i && /* @__PURE__ */ p(ln, {}),
|
|
2773
|
+
a && /* @__PURE__ */ p(fn, {}),
|
|
2774
|
+
o && /* @__PURE__ */ p(hn, {}),
|
|
2775
|
+
s && /* @__PURE__ */ p(_t, {}),
|
|
2776
|
+
(r || i) && /* @__PURE__ */ p(Ut, {}, t?.args?.id),
|
|
2777
|
+
s && /* @__PURE__ */ p(xt, {})
|
|
2955
2778
|
]
|
|
2956
2779
|
});
|
|
2957
|
-
},
|
|
2780
|
+
}, vn = () => /* @__PURE__ */ p("svg", {
|
|
2958
2781
|
style: {
|
|
2959
2782
|
position: "absolute",
|
|
2960
2783
|
width: 0,
|
|
@@ -2962,206 +2785,206 @@ var rn = ({ boxRef: e }) => {
|
|
|
2962
2785
|
overflow: "hidden"
|
|
2963
2786
|
},
|
|
2964
2787
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2965
|
-
children: /* @__PURE__ */ (
|
|
2966
|
-
/* @__PURE__ */ (
|
|
2788
|
+
children: /* @__PURE__ */ m("defs", { children: [
|
|
2789
|
+
/* @__PURE__ */ p("filter", {
|
|
2967
2790
|
id: "vintage",
|
|
2968
|
-
children: /* @__PURE__ */ (
|
|
2791
|
+
children: /* @__PURE__ */ p("feColorMatrix", {
|
|
2969
2792
|
type: "matrix",
|
|
2970
2793
|
values: "\n 1.2 0 0 0 0.1\n 0 1.0 0 0 0.0\n 0 0 0.8 0 0.1\n 0 0 0 1 0"
|
|
2971
2794
|
})
|
|
2972
2795
|
}),
|
|
2973
|
-
/* @__PURE__ */ (
|
|
2796
|
+
/* @__PURE__ */ p("filter", {
|
|
2974
2797
|
id: "olive-army",
|
|
2975
|
-
children: /* @__PURE__ */ (
|
|
2798
|
+
children: /* @__PURE__ */ p("feColorMatrix", {
|
|
2976
2799
|
type: "matrix",
|
|
2977
2800
|
values: "\n 0.35 0.35 0.35 0 0\n 0.45 0.45 0.45 0 0\n 0.20 0.20 0.20 0 0\n 0 0 0 1 0"
|
|
2978
2801
|
})
|
|
2979
2802
|
}),
|
|
2980
|
-
/* @__PURE__ */ (
|
|
2803
|
+
/* @__PURE__ */ p("filter", {
|
|
2981
2804
|
id: "warm-sunset",
|
|
2982
|
-
children: /* @__PURE__ */ (
|
|
2805
|
+
children: /* @__PURE__ */ p("feColorMatrix", {
|
|
2983
2806
|
type: "matrix",
|
|
2984
2807
|
values: "\n 1.3 0 0 0 0.1\n 0 1.1 0 0 0.05\n 0 0 0.7 0 -0.05\n 0 0 0 1 0"
|
|
2985
2808
|
})
|
|
2986
2809
|
}),
|
|
2987
|
-
/* @__PURE__ */ (
|
|
2810
|
+
/* @__PURE__ */ p("filter", {
|
|
2988
2811
|
id: "sin-city-red",
|
|
2989
|
-
children: /* @__PURE__ */ (
|
|
2812
|
+
children: /* @__PURE__ */ p("feColorMatrix", {
|
|
2990
2813
|
type: "matrix",
|
|
2991
2814
|
values: "\n 1.5 0 0 0 0\n 0.3 0.3 0.3 0 0\n 0.3 0.3 0.3 0 0\n 0 0 0 1 0"
|
|
2992
2815
|
})
|
|
2993
2816
|
}),
|
|
2994
|
-
/* @__PURE__ */ (
|
|
2817
|
+
/* @__PURE__ */ m("filter", {
|
|
2995
2818
|
id: "emboss",
|
|
2996
|
-
children: [/* @__PURE__ */ (
|
|
2819
|
+
children: [/* @__PURE__ */ p("feConvolveMatrix", {
|
|
2997
2820
|
order: "3",
|
|
2998
2821
|
kernelMatrix: "-2 -1 0 -1 1 1 0 1 2"
|
|
2999
|
-
}), /* @__PURE__ */ (
|
|
2822
|
+
}), /* @__PURE__ */ p("feColorMatrix", {
|
|
3000
2823
|
type: "matrix",
|
|
3001
2824
|
values: "\n 0.33 0.33 0.33 0 0.5\n 0.33 0.33 0.33 0 0.5\n 0.33 0.33 0.33 0 0.5\n 0 0 0 1 0"
|
|
3002
2825
|
})]
|
|
3003
2826
|
}),
|
|
3004
|
-
/* @__PURE__ */ (
|
|
2827
|
+
/* @__PURE__ */ m("filter", {
|
|
3005
2828
|
id: "crt-lines",
|
|
3006
2829
|
children: [
|
|
3007
|
-
/* @__PURE__ */ (
|
|
2830
|
+
/* @__PURE__ */ p("feTurbulence", {
|
|
3008
2831
|
type: "fractalNoise",
|
|
3009
2832
|
baseFrequency: "0 0.9",
|
|
3010
2833
|
numOctaves: "1",
|
|
3011
2834
|
result: "lines"
|
|
3012
2835
|
}),
|
|
3013
|
-
/* @__PURE__ */ (
|
|
2836
|
+
/* @__PURE__ */ p("feColorMatrix", {
|
|
3014
2837
|
type: "matrix",
|
|
3015
2838
|
values: "\n 1 0 0 0 0\n 0 1 0 0 0\n 0 0 1 0 0\n 0 0 0 15 -7",
|
|
3016
2839
|
result: "sharpLines"
|
|
3017
2840
|
}),
|
|
3018
|
-
/* @__PURE__ */ (
|
|
2841
|
+
/* @__PURE__ */ p("feComposite", {
|
|
3019
2842
|
operator: "in",
|
|
3020
2843
|
in: "SourceGraphic",
|
|
3021
2844
|
in2: "sharpLines",
|
|
3022
2845
|
result: "pattern"
|
|
3023
2846
|
}),
|
|
3024
|
-
/* @__PURE__ */ (
|
|
2847
|
+
/* @__PURE__ */ p("feBlend", {
|
|
3025
2848
|
mode: "overlay",
|
|
3026
2849
|
in: "SourceGraphic",
|
|
3027
2850
|
in2: "pattern"
|
|
3028
2851
|
})
|
|
3029
2852
|
]
|
|
3030
2853
|
}),
|
|
3031
|
-
/* @__PURE__ */ (
|
|
2854
|
+
/* @__PURE__ */ m("filter", {
|
|
3032
2855
|
id: "grain",
|
|
3033
2856
|
x: "0%",
|
|
3034
2857
|
y: "0%",
|
|
3035
2858
|
width: "100%",
|
|
3036
2859
|
height: "100%",
|
|
3037
|
-
children: [/* @__PURE__ */ (
|
|
2860
|
+
children: [/* @__PURE__ */ p("feTurbulence", {
|
|
3038
2861
|
type: "fractalNoise",
|
|
3039
2862
|
baseFrequency: "0.8",
|
|
3040
2863
|
numOctaves: "3",
|
|
3041
2864
|
result: "noise"
|
|
3042
|
-
}), /* @__PURE__ */ (
|
|
2865
|
+
}), /* @__PURE__ */ p("feBlend", {
|
|
3043
2866
|
mode: "multiply",
|
|
3044
2867
|
in: "SourceGraphic",
|
|
3045
2868
|
in2: "noise"
|
|
3046
2869
|
})]
|
|
3047
2870
|
}),
|
|
3048
|
-
/* @__PURE__ */ (
|
|
2871
|
+
/* @__PURE__ */ m("filter", {
|
|
3049
2872
|
id: "cross-process",
|
|
3050
|
-
children: [/* @__PURE__ */ (
|
|
3051
|
-
/* @__PURE__ */ (
|
|
2873
|
+
children: [/* @__PURE__ */ m("feComponentTransfer", { children: [
|
|
2874
|
+
/* @__PURE__ */ p("feFuncR", {
|
|
3052
2875
|
type: "table",
|
|
3053
2876
|
tableValues: "0 0.05 0.2 0.5 0.8 0.95 1"
|
|
3054
2877
|
}),
|
|
3055
|
-
/* @__PURE__ */ (
|
|
2878
|
+
/* @__PURE__ */ p("feFuncG", {
|
|
3056
2879
|
type: "table",
|
|
3057
2880
|
tableValues: "0 0.1 0.3 0.6 0.85 1 1"
|
|
3058
2881
|
}),
|
|
3059
|
-
/* @__PURE__ */ (
|
|
2882
|
+
/* @__PURE__ */ p("feFuncB", {
|
|
3060
2883
|
type: "table",
|
|
3061
2884
|
tableValues: "0.05 0.15 0.4 0.5 0.7 0.8 0.9"
|
|
3062
2885
|
})
|
|
3063
|
-
] }), /* @__PURE__ */ (
|
|
2886
|
+
] }), /* @__PURE__ */ m("feComponentTransfer", { children: [/* @__PURE__ */ p("feFuncR", {
|
|
3064
2887
|
type: "linear",
|
|
3065
2888
|
slope: "1.2",
|
|
3066
2889
|
intercept: "-0.1"
|
|
3067
|
-
}), /* @__PURE__ */ (
|
|
2890
|
+
}), /* @__PURE__ */ p("feFuncG", {
|
|
3068
2891
|
type: "linear",
|
|
3069
2892
|
slope: "1.1",
|
|
3070
2893
|
intercept: "-0.05"
|
|
3071
2894
|
})] })]
|
|
3072
2895
|
}),
|
|
3073
|
-
/* @__PURE__ */ (
|
|
2896
|
+
/* @__PURE__ */ p("filter", {
|
|
3074
2897
|
id: "x-ray",
|
|
3075
|
-
children: /* @__PURE__ */ (
|
|
2898
|
+
children: /* @__PURE__ */ p("feColorMatrix", {
|
|
3076
2899
|
type: "matrix",
|
|
3077
2900
|
values: "\n -0.33 -0.33 -0.33 0 1\n -0.2 -0.2 -0.2 0 0.6\n -0.1 -0.1 -0.1 0 0.9\n 0 0 0 1 0"
|
|
3078
2901
|
})
|
|
3079
2902
|
}),
|
|
3080
|
-
/* @__PURE__ */ (
|
|
2903
|
+
/* @__PURE__ */ m("filter", {
|
|
3081
2904
|
id: "plastic-wrap",
|
|
3082
|
-
children: [/* @__PURE__ */ (
|
|
2905
|
+
children: [/* @__PURE__ */ p("feSpecularLighting", {
|
|
3083
2906
|
surfaceScale: "5",
|
|
3084
2907
|
specularConstant: "1",
|
|
3085
2908
|
specularExponent: "20",
|
|
3086
2909
|
lightingColor: "#fff",
|
|
3087
2910
|
result: "light",
|
|
3088
|
-
children: /* @__PURE__ */ (
|
|
2911
|
+
children: /* @__PURE__ */ p("feDistantLight", {
|
|
3089
2912
|
azimuth: "225",
|
|
3090
2913
|
elevation: "45"
|
|
3091
2914
|
})
|
|
3092
|
-
}), /* @__PURE__ */ (
|
|
2915
|
+
}), /* @__PURE__ */ p("feBlend", {
|
|
3093
2916
|
mode: "overlay",
|
|
3094
2917
|
in: "SourceGraphic",
|
|
3095
2918
|
in2: "light"
|
|
3096
2919
|
})]
|
|
3097
2920
|
})
|
|
3098
2921
|
] })
|
|
3099
|
-
}),
|
|
3100
|
-
let [a, o] = d(null), s =
|
|
3101
|
-
...
|
|
2922
|
+
}), yn = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = wt }) => {
|
|
2923
|
+
let [a, o] = d(null), s = Ie("sm", a), c = {
|
|
2924
|
+
...wt,
|
|
3102
2925
|
...i
|
|
3103
|
-
}, { loading: l, error: u, mimeType: f, width:
|
|
2926
|
+
}, { loading: l, error: u, mimeType: f, width: h, height: g, originalBlob: _, previewUrl: v, isAlpha: y } = Me({
|
|
3104
2927
|
src: e,
|
|
3105
2928
|
skip: c?.tools?.length === 0
|
|
3106
2929
|
});
|
|
3107
|
-
return c?.tools?.length === 0 ? /* @__PURE__ */ (
|
|
3108
|
-
className: `${
|
|
2930
|
+
return c?.tools?.length === 0 ? /* @__PURE__ */ p("div", {
|
|
2931
|
+
className: `${P.root} ${P.wrapper}`,
|
|
3109
2932
|
"data-theme": r,
|
|
3110
|
-
children: /* @__PURE__ */ (
|
|
3111
|
-
className:
|
|
3112
|
-
children: /* @__PURE__ */ (
|
|
3113
|
-
className:
|
|
2933
|
+
children: /* @__PURE__ */ p("div", {
|
|
2934
|
+
className: P.system,
|
|
2935
|
+
children: /* @__PURE__ */ p("div", {
|
|
2936
|
+
className: P.textRed,
|
|
3114
2937
|
children: "No tools selected."
|
|
3115
2938
|
})
|
|
3116
2939
|
})
|
|
3117
|
-
}) : l || u || !
|
|
3118
|
-
className: `${
|
|
2940
|
+
}) : l || u || !_ || !f ? /* @__PURE__ */ p("div", {
|
|
2941
|
+
className: `${P.root} ${P.wrapper}`,
|
|
3119
2942
|
"data-theme": r,
|
|
3120
|
-
children: /* @__PURE__ */ (
|
|
3121
|
-
className:
|
|
2943
|
+
children: /* @__PURE__ */ m("div", {
|
|
2944
|
+
className: P.system,
|
|
3122
2945
|
children: [
|
|
3123
|
-
l && /* @__PURE__ */ (
|
|
2946
|
+
l && /* @__PURE__ */ p(me, { style: {
|
|
3124
2947
|
width: 48,
|
|
3125
2948
|
height: 48
|
|
3126
2949
|
} }),
|
|
3127
|
-
u && /* @__PURE__ */ (
|
|
3128
|
-
className:
|
|
2950
|
+
u && /* @__PURE__ */ p("div", {
|
|
2951
|
+
className: P.textRed,
|
|
3129
2952
|
children: u
|
|
3130
2953
|
}),
|
|
3131
|
-
!l && !u && (!
|
|
3132
|
-
className:
|
|
2954
|
+
!l && !u && (!_ || !f) && /* @__PURE__ */ p("div", {
|
|
2955
|
+
className: P.textRed,
|
|
3133
2956
|
children: "Failed to load image."
|
|
3134
2957
|
})
|
|
3135
2958
|
]
|
|
3136
2959
|
})
|
|
3137
|
-
}) : /* @__PURE__ */ (
|
|
2960
|
+
}) : /* @__PURE__ */ p(Dt, {
|
|
3138
2961
|
mimeType: f,
|
|
3139
|
-
width:
|
|
3140
|
-
height:
|
|
3141
|
-
originalBlob:
|
|
3142
|
-
previewUrl:
|
|
3143
|
-
isAlpha:
|
|
2962
|
+
width: h,
|
|
2963
|
+
height: g,
|
|
2964
|
+
originalBlob: _,
|
|
2965
|
+
previewUrl: v,
|
|
2966
|
+
isAlpha: y,
|
|
3144
2967
|
settings: c,
|
|
3145
2968
|
onSave: t,
|
|
3146
2969
|
onBack: n,
|
|
3147
|
-
children: /* @__PURE__ */ (
|
|
2970
|
+
children: /* @__PURE__ */ m("div", {
|
|
3148
2971
|
ref: o,
|
|
3149
|
-
className: `${
|
|
2972
|
+
className: `${P.root} ${P.wrapper}`,
|
|
3150
2973
|
"data-theme": r,
|
|
3151
|
-
children: [c?.tools?.includes(
|
|
3152
|
-
className:
|
|
3153
|
-
children: /* @__PURE__ */ (
|
|
3154
|
-
}) : /* @__PURE__ */ (
|
|
3155
|
-
className: `${c?.infobar ?
|
|
2974
|
+
children: [c?.tools?.includes(z.FILTERS) && /* @__PURE__ */ p(vn, {}), c?.tools?.length === 1 ? /* @__PURE__ */ p("div", {
|
|
2975
|
+
className: P.gridSingleTool,
|
|
2976
|
+
children: /* @__PURE__ */ p(_n, {})
|
|
2977
|
+
}) : /* @__PURE__ */ m("div", {
|
|
2978
|
+
className: `${c?.infobar ? P.grid : P.gridNoInfobar} ${s ? P.mobile : ""}`,
|
|
3156
2979
|
children: [
|
|
3157
|
-
/* @__PURE__ */ (
|
|
3158
|
-
/* @__PURE__ */ (
|
|
3159
|
-
/* @__PURE__ */ (
|
|
3160
|
-
c?.infobar && /* @__PURE__ */ (
|
|
2980
|
+
/* @__PURE__ */ p(Ot, { isMobile: s }),
|
|
2981
|
+
/* @__PURE__ */ p(Mt, { isMobile: s }),
|
|
2982
|
+
/* @__PURE__ */ p(_n, {}),
|
|
2983
|
+
c?.infobar && /* @__PURE__ */ p(Ft, {})
|
|
3161
2984
|
]
|
|
3162
2985
|
})]
|
|
3163
2986
|
})
|
|
3164
2987
|
});
|
|
3165
2988
|
};
|
|
3166
2989
|
//#endregion
|
|
3167
|
-
export {
|
|
2990
|
+
export { yn as Pixedi };
|