/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var VueCompositionAPI = require('@vue/composition-api');
var iconsVue = require('@ldesign/icons-vue');
var components_tooltip_index = require('../../tooltip/index.js');
var hooks_useConfig = require('../../../hooks/use-config.js');
var components_imageViewer_utils = require('../utils.js');
var components_imageViewer_base_ImageModalIcon = require('./ImageModalIcon.js');
require('../../../utils/map-props.js');
require('vue');
require('../../../utils/with-install.js');
require('lodash');
require('../../../config.js');
require('../../tooltip/tooltip.js');
require('../../../chunks/helper.js');
require('lodash/isFunction');
require('../../popup/props.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('../../../chunks/set-style.js');
require('../../../utils/dom.js');
require('raf');
require('lodash/isString');
require('../../../chunks/log.js');
require('../../../chunks/_commonjsHelpers-2e6815bd.js');
require('../../../utils/easing.js');
require('../../../utils/render-node.js');
require('../../../utils/helper.js');
require('lodash/camelCase');
require('../../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../config-provider/context.js');
require('../../../chunks/zh_CN.js');
require('../../../utils/mixins.js');
require('../../popup/container.js');
require('../../tooltip/props.js');
require('../../config-provider/useConfig.js');
require('../../../hooks/lnode.js');
require('lodash/isEmpty');
require('lodash/kebabCase');
require('../../../hooks/render-lnode.js');

const currentImage = {
  type: Object,
  default() {
    return {};
  }
};
var TImageViewerUtils = VueCompositionAPI.defineComponent({
  name: "LImageViewerUtils",
  props: {
    scale: Number,
    rotateHandler: Function,
    zoomInHandler: Function,
    zoomOutHandler: Function,
    mirrorHandler: Function,
    resetHandler: Function,
    currentImage
  },
  setup() {
    const classPrefix = hooks_useConfig.usePrefixClass();
    return {
      classPrefix
    };
  },
  render() {
    const h = arguments[0];
    return h("div", {
      "class": `${this.classPrefix}-image-viewer__utils`
    }, [h("div", {
      "class": `${this.classPrefix}-image-viewer__utils-content`
    }, [h(components_tooltip_index.Tooltip, {
      "attrs": {
        "overlayClassName": `${this.classPrefix}-image-viewer__utils--tip`,
        "content": "\u955C\u50CF",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h(components_imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "clickHandler": this.mirrorHandler,
        "icon": () => h(iconsVue.MirrorIcon, {
          "attrs": {
            "size": "medium"
          }
        })
      }
    })]), h(components_tooltip_index.Tooltip, {
      "attrs": {
        "overlayClassName": `${this.classPrefix}-image-viewer__utils--tip`,
        "content": "\u65CB\u8F6C",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h(components_imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "clickHandler": this.rotateHandler,
        "icon": () => h(iconsVue.RotationIcon, {
          "attrs": {
            "size": "medium"
          }
        })
      }
    })]), h(components_imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": () => h(iconsVue.ZoomOutIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": this.zoomOutHandler
      }
    }), h(components_imageViewer_base_ImageModalIcon["default"], {
      "class": `${this.classPrefix}-image-viewer__utils-scale`,
      "attrs": {
        "size": "medium",
        "label": `${this.scale * 100}%`
      }
    }), h(components_imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": () => h(iconsVue.ZoomInIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": this.zoomInHandler
      }
    }), h(components_tooltip_index.Tooltip, {
      "attrs": {
        "overlayClassName": `${this.classPrefix}-image-viewer__utils--tip`,
        "content": "\u539F\u59CB\u5927\u5C0F",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h("div", {
      "class": `${this.classPrefix}-image-viewer__modal-icon`
    }, [h(components_imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": () => h(iconsVue.ImageIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": this.resetHandler
      }
    })])]), this.currentImage.download && h(components_imageViewer_base_ImageModalIcon["default"], {
      "attrs": {
        "icon": () => h(iconsVue.DownloadIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": () => {
          components_imageViewer_utils.downloadFile(this.currentImage.mainImage);
        }
      }
    })])]);
  }
});

exports["default"] = TImageViewerUtils;
//# sourceMappingURL=ImageViewerUtils.js.map
