/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { defineComponent, createVNode } from 'vue';
import { MirrorIcon, RotationIcon, ZoomOutIcon, ZoomInIcon, ImageIcon, DownloadIcon } from '@ldesign/icons-vue-next';
import { Tooltip } from '../../tooltip/index.mjs';
import { usePrefixClass } from '../../hooks/useConfig.mjs';
import { downloadFile } from '../utils.mjs';
import TImageViewerIcon from './ImageModalIcon.mjs';
import '../../utils/withInstall.mjs';
import '../../tooltip/tooltip.mjs';
import '../../_chunks/dep-55846619.mjs';
import '../../_chunks/dep-cfcedf47.mjs';
import '../../_chunks/dep-eb20e23f.mjs';
import '../../_chunks/dep-b4041200.mjs';
import '../../_chunks/dep-6b22dd27.mjs';
import '../../_chunks/dep-a0b4a044.mjs';
import '../../_chunks/dep-c959a6fb.mjs';
import '../../_chunks/dep-0f0c89ff.mjs';
import '../../_chunks/dep-b2af48ba.mjs';
import '../../_chunks/dep-37ba476d.mjs';
import '../../_chunks/dep-e3b14d70.mjs';
import '../../_chunks/dep-66d6733b.mjs';
import '../../_chunks/dep-be27d184.mjs';
import '../../_chunks/dep-c31e1d9e.mjs';
import '../../_chunks/dep-bf74f1c2.mjs';
import '../../_chunks/dep-79821ff2.mjs';
import '../../_chunks/dep-0bfbf721.mjs';
import '../../_chunks/dep-39cc276d.mjs';
import '../../_chunks/dep-8f777748.mjs';
import '../../_chunks/dep-ae357f26.mjs';
import '../../_chunks/dep-352691c2.mjs';
import '../../_chunks/dep-2cfd5b3a.mjs';
import '../../_chunks/dep-05fa17c9.mjs';
import '../../_chunks/dep-a9c8a5d5.mjs';
import '../../_chunks/dep-10085c61.mjs';
import '../../_chunks/dep-1b058de3.mjs';
import '../../_chunks/dep-c852a61a.mjs';
import '../../_chunks/dep-92e7085e.mjs';
import '../../_chunks/dep-44f056cd.mjs';
import '../../_chunks/dep-23a0f453.mjs';
import '../../_chunks/dep-7acc11cb.mjs';
import '../../_chunks/dep-59c8420d.mjs';
import '../../_chunks/dep-ba3c0b2e.mjs';
import '../../_chunks/dep-774ac2d0.mjs';
import '../../_chunks/dep-3afa94cf.mjs';
import '../../popup/props.mjs';
import '../../popup/index.mjs';
import '../../popup/popup.mjs';
import '@popperjs/core';
import '../../_chunks/dep-1cf2b129.mjs';
import '../../hooks/index.mjs';
import '../../hooks/icon.mjs';
import '../../hooks/slot.mjs';
import '../../hooks/tnode.mjs';
import '../../_chunks/dep-f6649a46.mjs';
import '../../_chunks/dep-1fe0ad42.mjs';
import '../../_chunks/dep-d54f2690.mjs';
import '../../_chunks/dep-74848b92.mjs';
import '../../_chunks/dep-c4e1a112.mjs';
import '../../utils/render-tnode.mjs';
import '../../_chunks/dep-bd03960e.mjs';
import '../../hooks/useCommonClassName.mjs';
import '../../config-provider/useConfig.mjs';
import '../../_chunks/dep-44417261.mjs';
import '../../_chunks/dep-99920870.mjs';
import '../../_chunks/dep-c7e9ce16.mjs';
import '../../_chunks/dep-ee57d235.mjs';
import '../../_common/js/global-config/default-config.mjs';
import '../../_common/js/global-config/locale/zh_CN.mjs';
import '../../_chunks/dep-6b4aa943.mjs';
import '../../_chunks/dep-d52291a9.mjs';
import '../../config-provider/type.mjs';
import '../../hooks/useDefaultValue.mjs';
import '../../hooks/useDestroyOnClose.mjs';
import '../../hooks/useKeepAnimation.mjs';
import '../../hooks/useRipple.mjs';
import '../../utils/set-style.mjs';
import '../../hooks/useVirtualScroll.mjs';
import '../../hooks/useVModel.mjs';
import '../../utils/dom.mjs';
import '../../utils/easing.mjs';
import '../../_common/js/utils/set-style.mjs';
import '../../popup/container.mjs';
import '../../_chunks/dep-e091cfd9.mjs';
import '../../hooks/useResizeObserver.mjs';
import '../../popup/style/css.mjs';
import '../../popup/type.mjs';
import '../../tooltip/util.mjs';
import '../../tooltip/props.mjs';
import '../../tooltip/style/css.mjs';
import '../../tooltip/type.mjs';

var TImageViewerUtils = defineComponent({
  name: "TImageViewerUtils",
  props: {
    scale: Number,
    onRotate: Function,
    onZoomIn: Function,
    onZoomOut: Function,
    onMirror: Function,
    onReset: Function,
    currentImage: {
      type: Object,
      "default": function _default() {
        return {};
      }
    }
  },
  setup: function setup(props) {
    var classPrefix = usePrefixClass();
    return function () {
      return createVNode("div", {
        "class": "".concat(classPrefix.value, "-image-viewer__utils")
      }, [createVNode("div", {
        "class": "".concat(classPrefix.value, "-image-viewer__utils-content")
      }, [createVNode(Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u955C\u50CF",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [createVNode(TImageViewerIcon, {
            "onClick": props.onMirror,
            "icon": function icon() {
              return createVNode(MirrorIcon, {
                "size": "medium"
              }, null);
            }
          }, null)];
        }
      }), createVNode(Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u65CB\u8F6C",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [createVNode(TImageViewerIcon, {
            "onClick": props.onRotate,
            "icon": function icon() {
              return createVNode(RotationIcon, {
                "size": "medium"
              }, null);
            }
          }, null)];
        }
      }), createVNode(TImageViewerIcon, {
        "icon": function icon() {
          return createVNode(ZoomOutIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": props.onZoomOut
      }, null), createVNode(TImageViewerIcon, {
        "class": "".concat(classPrefix.value, "-image-viewer__utils-scale"),
        "size": "medium",
        "label": "".concat(props.scale * 100, "%")
      }, null), createVNode(TImageViewerIcon, {
        "icon": function icon() {
          return createVNode(ZoomInIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": props.onZoomIn
      }, null), createVNode(Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u539F\u59CB\u5927\u5C0F",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [createVNode("div", {
            "class": "".concat(classPrefix.value, "-image-viewer__modal-icon")
          }, [createVNode(TImageViewerIcon, {
            "icon": function icon() {
              return createVNode(ImageIcon, {
                "size": "medium"
              }, null);
            },
            "onClick": props.onReset
          }, null)])];
        }
      }), props.currentImage.download && createVNode(TImageViewerIcon, {
        "icon": function icon() {
          return createVNode(DownloadIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": function onClick() {
          downloadFile(props.currentImage.mainImage);
        }
      }, null)])]);
    };
  }
});

export { TImageViewerUtils as default };
//# sourceMappingURL=ImageViewerUtils.mjs.map
