var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import { n as normalizeComponent, m as mixins, L as LazyImage, k as material, l as lodash, P as MaterialMark, h as Icon, F as Favo, o as editor } from "./index.js";
import "vue";
import { M as MaterialDetailModal } from "./gd-abtest.js";
class Waterfall$1 {
  constructor({ width, margin, grid = 1 }) {
    this.config({ width, margin, grid });
  }
  config({ width, margin, grid = 1 }) {
    this.width = width;
    this.margin = margin;
    this.grid = grid;
    this.rowsLength = Math.floor(this.width / this.grid);
    let rows = [{ num: this.rowsLength, value: 0 }];
    this.rows = rows;
  }
  getPostion(width, height) {
    let num = Math.ceil(width / this.grid);
    if (num > this.rowsLength) {
      throw new Error("\u8D85\u51FA\u6700\u5927\u5BBD\u5EA6");
    }
    let min = Infinity;
    let idx = 0;
    let rowsLength = 0;
    let leftNum = 0;
    let total = this.rowsLength;
    for (let i = this.rows.length - 1; i > -1; i--) {
      rowsLength += this.rows[i].num;
      total -= this.rows[i].num;
      if (rowsLength >= num) {
        const top = this.rows[i].value;
        if (top <= min) {
          leftNum = total;
          min = this.rows[i].value;
          idx = i;
        }
      }
      if (this.rows[i - 1] && this.rows[i - 1].value < this.rows[i].value) {
        rowsLength = 0;
      }
    }
    const row = this.rows[idx];
    if (row.num > num) {
      const newRow = { num: row.num - num, value: row.value };
      this.rows.splice(idx + 1, 0, newRow);
      row.num = num;
    } else if (row.num < num) {
      let total2 = row.num;
      for (let index = idx + 1; index < this.rows.length; index++) {
        total2 += this.rows[index].num;
        if (total2 <= num) {
          row.num += this.rows[index].num;
          this.rows.splice(index, 1);
          index -= 1;
        } else {
          row.num = num;
          this.rows[index].num = total2 - num;
        }
        if (total2 >= num)
          break;
      }
    }
    let value = row.value;
    row.value += height + this.margin;
    return { left: leftNum * this.grid + idx * this.margin, top: value };
  }
}
var render$b = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("transition", {
    attrs: {
      "name": _vm.transition
    }
  }, [_c("div", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.show,
      expression: "show"
    }],
    class: _vm.bem({
      active: _vm.loaded
    }),
    style: _vm.loaded ? null : {
      visibility: "hidden"
    }
  }, [_vm._t("default")], 2)]);
};
var staticRenderFns$b = [];
const { bem: bem$2 } = mixins;
const __vue2_script$b = {
  inject: ["waterfail"],
  name: "g-waterfall-item",
  mixins: [bem$2],
  props: {
    transition: {
      type: String,
      default: "waterfall-fade"
    }
  },
  data() {
    return {
      show: true,
      loaded: false
    };
  },
  mounted() {
    this.update();
  },
  beforeDestroy() {
    this.show = false;
  },
  destroyed() {
    this.waterfail.update();
  },
  methods: {
    async update() {
      await this.waterfail.update();
      this.show = true;
      this.loaded = true;
    }
  }
};
const __cssModules$b = {};
var __component__$b = /* @__PURE__ */ normalizeComponent(__vue2_script$b, render$b, staticRenderFns$b, false, __vue2_injectStyles$b, null, null, null);
function __vue2_injectStyles$b(context) {
  for (let o in __cssModules$b) {
    this[o] = __cssModules$b[o];
  }
}
var Item = /* @__PURE__ */ function() {
  return __component__$b.exports;
}();
var render$a = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem({
      loaded: _vm.loaded
    })
  }, _vm._l(_vm.columnItems, function(column, index) {
    return _c("div", {
      key: index,
      class: _vm.bem("column"),
      style: {
        width: _vm.columnWidth
      }
    }, _vm._l(column.items, function(item, i) {
      return _c("div", {
        key: _vm.getKey(item),
        class: _vm.bem("item"),
        style: i !== 0 && {
          "margin-top": _vm.margins[1] + "px"
        }
      }, [_vm._t("default", null, {
        "item": item,
        "index": item.__index__
      })], 2);
    }), 0);
  }), 0);
};
var staticRenderFns$a = [];
const DEFAULT_WIDTH = 500;
const { bem: bem$1 } = mixins;
const __vue2_script$a = {
  name: "waterfall",
  Item,
  mixins: [bem$1],
  provide() {
    return {
      waterfail: this
    };
  },
  props: {
    transition: {
      type: String,
      default: "waterfall-fade"
    },
    grid: {
      type: Number,
      default: 1
    },
    list: {
      type: Array,
      required: true
    },
    columns: {
      type: Number,
      default: 5
    },
    getKey: {
      type: Function,
      default: (item) => item.id
    },
    getItemSize: {
      type: Function,
      required: true
    },
    margin: {
      type: [Number, Array],
      default: 10
    }
  },
  data() {
    return {
      itemStyles: [],
      height: 0,
      loaded: false
    };
  },
  computed: {
    margins() {
      return typeof this.margin === "number" ? [this.margin, this.margin] : this.margin;
    },
    columnWidth() {
      return `calc((100% - ${(this.columns - 1) * this.margins[0]}px) / ${this.columns})`;
    },
    columnItems() {
      const columns = [];
      for (let index = 0; index < this.columns; index++) {
        columns.push({ height: 0, items: [] });
      }
      this.list.forEach((item, i) => {
        const { width, height } = this.getItemSize(item);
        const h = Math.floor(width / DEFAULT_WIDTH * height);
        const minColoums = columns.reduce((a, b) => a.height > b.height ? b : a, columns[0]);
        minColoums.height += h;
        item.__index__ = i;
        minColoums.items.push(item);
      });
      return columns;
    }
  },
  mounted() {
    this.loaded = true;
  },
  beforeDestroy() {
  },
  methods: {
    resize() {
    },
    update() {
      if (!this.loaded || this.timer)
        return;
      this.timer = setTimeout(() => {
        this.waterfail = new Waterfall$1({
          width: this.$el.clientWidth,
          margin: this.margin,
          grid: this.grid
        });
        this.lastClientWidth = this.$el.clientWidth;
        let itemStyles = [];
        let maxHeight = 0;
        for (let index = 0; index < this.list.length; index++) {
          const { width, height } = this.getItemSize(this.list[index]);
          const { left, top } = this.waterfail.getPostion(width, height);
          itemStyles.push({
            w: width,
            h: height,
            width: width + "px",
            height: height + "px",
            left: left + "px",
            top: top + "px"
          });
          let h = top + height;
          if (h > maxHeight) {
            maxHeight = h;
          }
        }
        this.height = maxHeight + "px";
        this.itemStyles = itemStyles;
        clearTimeout(this.timer);
      }, 50);
    }
  }
};
const __cssModules$a = {};
var __component__$a = /* @__PURE__ */ normalizeComponent(__vue2_script$a, render$a, staticRenderFns$a, false, __vue2_injectStyles$a, null, null, null);
function __vue2_injectStyles$a(context) {
  for (let o in __cssModules$a) {
    this[o] = __cssModules$a[o];
  }
}
var Waterfall = /* @__PURE__ */ function() {
  return __component__$a.exports;
}();
var render$9 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("LazyImage", {
    ref: "preview",
    attrs: {
      "src": _vm.previewUrl,
      "srcset": _vm.doublePreviewUrl,
      "lazy": _vm.lazy,
      "alt": _vm.template.title,
      "ratio": 0,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  })], 1);
};
var staticRenderFns$9 = [];
var normal_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.normal-preview .lazy-image{position:absolute;top:0;left:0;width:100%}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const { isRepositoryTemplate: isRepositoryTemplate$3 } = material;
const TEMPLATE_PREVIEW_WIDTH$7 = 750;
const __vue2_script$9 = {
  name: "normal-preview",
  components: {
    LazyImage
  },
  inject: {
    hoverLoad: {
      default: false
    }
  },
  props: {
    maxRatio: {
      type: Number,
      default: 1.77
    },
    minRatio: {
      type: Number,
      default: 0
    },
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    lazy: {
      type: Boolean,
      default: true
    },
    hover: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    isdynamicFile() {
      return this.noOss ? false : /\.gif$/.test(this.preview.url);
    },
    previewUrl() {
      if (this.noOss) {
        return this.preview.url;
      }
      const option = {
        width: this.previewWidth * 1.5,
        useDpr: false
      };
      if (this.hoverLoad && this.isdynamicFile && !this.hover) {
        option.type = "jpg";
      } else if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option);
    },
    doublePreviewUrl() {
      if (this.noOss || this.preview.width < 325)
        return null;
      const option = {
        width: this.previewWidth * 2,
        useDpr: false
      };
      if (this.hoverLoad && this.isdynamicFile && !this.hover) {
        option.type = "jpg";
      } else if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option) + " 2x";
    },
    previewWidth() {
      if (this.preview.width < 325)
        return this.preview.width;
      return Math.min(Math.max(this.preview.width / 2, 325), TEMPLATE_PREVIEW_WIDTH$7);
    },
    aspectRatio() {
      return Math.max(Math.min(this.preview.height / this.preview.width, this.maxRatio), this.minRatio);
    },
    imgAspectRatio() {
      return Math.max(this.aspectRatio, this.preview.height / this.preview.width);
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    },
    noOss() {
      if (!this.preview) {
        return true;
      }
      const { url } = this.preview;
      if (!url) {
        return true;
      }
      if (url.includes(".svg")) {
        return true;
      }
      if (url.includes(".gif") && isRepositoryTemplate$3(this.template)) {
        return true;
      }
      return false;
    }
  }
};
const __cssModules$9 = {};
var __component__$9 = /* @__PURE__ */ normalizeComponent(__vue2_script$9, render$9, staticRenderFns$9, false, __vue2_injectStyles$9, null, null, null);
function __vue2_injectStyles$9(context) {
  for (let o in __cssModules$9) {
    this[o] = __cssModules$9[o];
  }
}
var Normal = /* @__PURE__ */ function() {
  return __component__$9.exports;
}();
var render$8 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("LazyImage", {
    ref: "preview",
    attrs: {
      "src": _vm.url,
      "srcset": _vm.doubleUrl,
      "lazy": _vm.lazy,
      "alt": _vm.template.title,
      "ratio": 0,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  }), _c("transition", {
    attrs: {
      "name": _vm.bem("img")
    }
  }, [_vm.previewUrl && _vm.doublePreviewUrl ? _c("img", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.hover && _vm.previewLoad,
      expression: "hover && previewLoad"
    }],
    class: _vm.bem("img"),
    style: _vm.style,
    attrs: {
      "src": _vm.previewUrl,
      "srcset": _vm.doublePreviewUrl
    },
    on: {
      "load": function($event) {
        _vm.previewLoad = true;
      }
    }
  }) : _vm._e()]), _c("div", {
    class: _vm.bem("mask"),
    on: {
      "mousemove": _vm.mousemove,
      "mouseenter": _vm.mouseenter,
      "mouseleave": _vm.mouseleave
    }
  }, [_vm.hover && _vm.previewLoad ? _c("div", {
    class: _vm.bem("progress")
  }, [_c("div", {
    style: _vm.progressStyle
  })]) : _vm._e()])], 1);
};
var staticRenderFns$8 = [];
var long_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.long-preview .lazy-image{position:absolute;top:0;left:0;width:100%}.long-preview .lazy-image>img{object-position:top}.long-preview__img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;transition:opacity .1s linear}.long-preview__img-enter-active,.long-preview__img-leave-active{opacity:0}.long-preview__progress{position:absolute;bottom:0;width:calc(100% - 16px);height:4px;margin:0 8px;overflow:hidden;background:rgba(0,0,0,.4);border-radius:2px;opacity:0;pointer-events:none;transition:opacity .3s ease}.long-preview__progress>div{height:100%;background:#fff}.long-preview__mask{position:absolute;top:40px;right:0;bottom:8px;left:0}.long-preview__mask:hover .long-preview__progress{opacity:1}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const { isRepositoryTemplate: isRepositoryTemplate$2 } = material;
const TEMPLATE_PREVIEW_WIDTH$6 = 750;
const PROGRESS_MARGIN$1 = 8;
const __vue2_script$8 = {
  name: "long-preview",
  components: {
    LazyImage
  },
  props: {
    maxRatio: {
      type: Number,
      default: 1.77
    },
    minRatio: {
      type: Number,
      default: 0
    },
    setRatio: {
      type: Number,
      default: 0
    },
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    lazy: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      progress: 0,
      hover: false,
      previewLoad: false,
      previewUrl: null,
      doublePreviewUrl: null
    };
  },
  computed: {
    progressStyle() {
      return {
        width: this.progress + "%"
      };
    },
    url() {
      if (this.noOss) {
        return this.preview.url;
      }
      const previewWidth = this.previewWidth * 1.5;
      const option = { width: previewWidth, useDpr: false };
      option.crop = {
        width: previewWidth,
        height: previewWidth * (this.setRatio || this.aspectRatio)
      };
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option);
    },
    doubleUrl() {
      if (this.noOss || this.preview.width < 325)
        return null;
      const previewWidth = this.previewWidth * 2;
      const option = { width: previewWidth, useDpr: false };
      option.crop = {
        width: previewWidth,
        height: previewWidth * (this.setRatio || this.aspectRatio)
      };
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option) + " 2x";
    },
    previewWidth() {
      if (this.preview.width < 325)
        return this.preview.width;
      return Math.min(Math.max(this.preview.width / 2, 325), TEMPLATE_PREVIEW_WIDTH$6);
    },
    aspectRatio() {
      return Math.max(Math.min(this.preview.height / this.preview.width, this.maxRatio), this.minRatio);
    },
    imgAspectRatio() {
      return Math.max(this.aspectRatio, this.preview.height / this.preview.width);
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    },
    style() {
      return {
        objectPosition: `0 ${this.progress}%`
      };
    },
    noOss() {
      if (!this.preview) {
        return true;
      }
      const { url } = this.preview;
      if (!url) {
        return true;
      }
      if (url.includes(".svg")) {
        return true;
      }
      if (url.includes(".gif") && isRepositoryTemplate$2(this.template)) {
        return true;
      }
      return false;
    }
  },
  mounted() {
    this.$unwatch = this.$watch("hover", this.setPreviewUrl);
  },
  methods: {
    setPreviewUrl() {
      if (this.noOss) {
        this.previewUrl = this.preview.url;
        this.doublePreviewUrl = `${this.preview.url} 2x`;
      } else {
        const urlOption = {
          width: this.previewWidth * 2,
          useDpr: false
        };
        const doubleUrlOption = {
          width: this.previewWidth,
          useDpr: false
        };
        const { previewUrl, doublePreviewUrl } = this.setOssUrl(urlOption, doubleUrlOption);
        this.previewUrl = previewUrl;
        this.doublePreviewUrl = doublePreviewUrl;
      }
      this.$unwatch();
    },
    setOssUrl(urlOption, doubleUrlOption) {
      const url = this.preview.url;
      const option = {};
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      const previewUrl = this.ossUrl(url, __spreadValues(__spreadValues({}, urlOption), option));
      const doublePreviewUrl = this.ossUrl(url, __spreadValues(__spreadValues({}, doubleUrlOption), option)) + " 2x";
      return {
        previewUrl,
        doublePreviewUrl
      };
    },
    mouseenter() {
      clearTimeout(this.timmer);
      this.timmer = setTimeout(() => {
        this.hover = true;
      }, 100);
    },
    mouseleave() {
      clearTimeout(this.timmer);
      this.hover = false;
    },
    mousemove(e) {
      if (e.offsetX < PROGRESS_MARGIN$1 || e.offsetX > this.$el.offsetWidth - PROGRESS_MARGIN$1) {
        return;
      }
      this.progress = (e.offsetX - PROGRESS_MARGIN$1) / (this.$el.offsetWidth - PROGRESS_MARGIN$1 * 2) * 100;
    }
  }
};
const __cssModules$8 = {};
var __component__$8 = /* @__PURE__ */ normalizeComponent(__vue2_script$8, render$8, staticRenderFns$8, false, __vue2_injectStyles$8, null, null, null);
function __vue2_injectStyles$8(context) {
  for (let o in __cssModules$8) {
    this[o] = __cssModules$8[o];
  }
}
var Long = /* @__PURE__ */ function() {
  return __component__$8.exports;
}();
var render$7 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("LazyImage", {
    ref: "preview",
    attrs: {
      "src": _vm.url,
      "srcset": _vm.doubleUrl,
      "lazy": _vm.lazy,
      "alt": _vm.template.title,
      "ratio": 0,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  }), _c("transition", {
    attrs: {
      "name": _vm.bem("img")
    }
  }, [_vm.previewUrl && _vm.doublePreviewUrl ? _c("img", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.hover && _vm.previewLoad,
      expression: "hover && previewLoad"
    }],
    class: _vm.bem("img"),
    style: _vm.style,
    attrs: {
      "src": _vm.previewUrl,
      "srcset": _vm.doublePreviewUrl
    },
    on: {
      "load": function($event) {
        _vm.previewLoad = true;
      }
    }
  }) : _vm._e()]), _c("div", {
    class: _vm.bem("mask"),
    on: {
      "mousemove": _vm.mousemove,
      "mouseenter": _vm.mouseenter,
      "mouseleave": _vm.mouseleave
    }
  }, [_vm.hover && _vm.previewLoad ? _c("div", {
    class: _vm.bem("tag")
  }, [_vm._v(" " + _vm._s(_vm.currentPage) + " / " + _vm._s(_vm.templateCount) + " ")]) : _vm._e(), _vm.hover && _vm.previewLoad ? _c("div", {
    class: _vm.bem("progress")
  }, [_c("div", {
    style: _vm.progressStyle
  })]) : _vm._e()])], 1);
};
var staticRenderFns$7 = [];
var wide_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.wide-preview .lazy-image{position:absolute;top:0;left:0;width:100%}.wide-preview__img{position:absolute;top:0;left:0;height:100%;transition:opacity .1s linear}.wide-preview__img-enter-active,.wide-preview__img-leave-active{opacity:0}.wide-preview__progress{position:absolute;bottom:0;width:calc(100% - 16px);height:4px;margin:0 8px;overflow:hidden;background:rgba(0,0,0,.4);border-radius:2px;opacity:0;pointer-events:none;transition:opacity .3s ease}.wide-preview__progress>div{height:100%;background:#fff}.wide-preview__mask{position:absolute;top:40px;right:0;bottom:8px;left:0}.wide-preview__mask:hover .wide-preview__progress{opacity:1}.wide-preview__tag{position:absolute;right:8px;bottom:8px;padding:6px 10px;font-size:12px;font-weight:600;color:#fff;text-align:center;background:rgba(0,0,0,.64);border-radius:4px;pointer-events:none}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const { isRepositoryTemplate: isRepositoryTemplate$1 } = material;
const TEMPLATE_PREVIEW_WIDTH$5 = 750;
const PROGRESS_MARGIN = 8;
const __vue2_script$7 = {
  name: "wide-preview",
  components: {
    LazyImage
  },
  props: {
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    lazy: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      hover: false,
      previewLoad: false,
      previewUrl: null,
      doublePreviewUrl: null,
      progress: 0
    };
  },
  computed: {
    currentPage() {
      return Math.ceil(this.progress / 100 * this.templateCount) || 1;
    },
    progressStyle() {
      return {
        width: this.progress + "%"
      };
    },
    url() {
      if (this.noOss) {
        return this.preview.url;
      }
      const previewHeight = this.previewHeight * 1.5;
      const option = {
        height: previewHeight,
        useDpr: false,
        crop: {
          width: TEMPLATE_PREVIEW_WIDTH$5 / 2 * 1.5,
          height: previewHeight
        }
      };
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option);
    },
    doubleUrl() {
      if (this.noOss || this.preview.width < 325)
        return null;
      const previewHeight = this.previewHeight * 2;
      const option = {
        height: previewHeight,
        useDpr: false,
        crop: {
          width: TEMPLATE_PREVIEW_WIDTH$5,
          height: previewHeight
        }
      };
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option) + " 2x";
    },
    previewWidth() {
      return this.preview.width / 2;
    },
    previewHeight() {
      return this.previewWidth * this.preview.height / this.preview.width;
    },
    aspectRatio() {
      return this.preview.height / TEMPLATE_PREVIEW_WIDTH$5;
    },
    imgAspectRatio() {
      return Math.max(this.aspectRatio, this.preview.height / this.preview.width);
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    },
    style() {
      const transformX = -(this.currentPage - 1) / this.templateCount * 100;
      return {
        wdith: this.templateCount + "%",
        transform: `translate3D(${transformX}%, 0, 0)`
      };
    },
    templateCount() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return ~~(compositePreview.width / TEMPLATE_PREVIEW_WIDTH$5);
      }
      return 1;
    },
    noOss() {
      if (!this.preview) {
        return true;
      }
      const { url } = this.preview;
      if (!url) {
        return true;
      }
      if (url.includes(".svg")) {
        return true;
      }
      if (url.includes(".gif") && isRepositoryTemplate$1(this.template)) {
        return true;
      }
      return false;
    }
  },
  mounted() {
    this.$unwatch = this.$watch("hover", this.setPreviewUrl);
  },
  methods: {
    setPreviewUrl() {
      if (this.noOss) {
        this.previewUrl = this.preview.url;
        this.doublePreviewUrl = `${this.preview.url} 2x`;
      } else {
        const urlOption = {
          height: this.previewHeight * 2,
          useDpr: false
        };
        const doubleUrlOption = {
          height: this.previewHeight,
          useDpr: false
        };
        const { previewUrl, doublePreviewUrl } = this.setOssUrl(urlOption, doubleUrlOption);
        this.previewUrl = previewUrl;
        this.doublePreviewUrl = doublePreviewUrl;
      }
      this.$unwatch();
    },
    setOssUrl(urlOption, doubleUrlOption) {
      const url = this.preview.url;
      const option = {};
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      const previewUrl = this.ossUrl(url, __spreadValues(__spreadValues({}, urlOption), option));
      const doublePreviewUrl = this.ossUrl(url, __spreadValues(__spreadValues({}, doubleUrlOption), option)) + " 2x";
      return {
        previewUrl,
        doublePreviewUrl
      };
    },
    mouseenter() {
      clearTimeout(this.timmer);
      this.timmer = setTimeout(() => {
        this.hover = true;
      }, 100);
    },
    mouseleave() {
      clearTimeout(this.timmer);
      this.hover = false;
    },
    mousemove(e) {
      if (e.offsetX < PROGRESS_MARGIN || e.offsetX > this.$el.offsetWidth - PROGRESS_MARGIN) {
        return;
      }
      this.progress = (e.offsetX - PROGRESS_MARGIN) / (this.$el.offsetWidth - PROGRESS_MARGIN * 2) * 100;
    }
  }
};
const __cssModules$7 = {};
var __component__$7 = /* @__PURE__ */ normalizeComponent(__vue2_script$7, render$7, staticRenderFns$7, false, __vue2_injectStyles$7, null, null, null);
function __vue2_injectStyles$7(context) {
  for (let o in __cssModules$7) {
    this[o] = __cssModules$7[o];
  }
}
var Wide = /* @__PURE__ */ function() {
  return __component__$7.exports;
}();
var render$6 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem("", {
      loaded: _vm.loaded,
      transition: _vm.transition
    }),
    style: _vm.aspectRatio ? {
      "padding-bottom": _vm.aspectRatio * 100 + "%"
    } : null
  }, [_vm.hoverLoad ? _c("img", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.hover && _vm.imgSrc,
      expression: "!hover && imgSrc"
    }],
    class: _vm.bem("img"),
    attrs: {
      "src": _vm.imgSrc,
      "alt": _vm.alt
    },
    on: {
      "load": function($event) {
        _vm.loaded = true;
      }
    }
  }) : _vm._e(), _c("video", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.hoverLoad || _vm.hover,
      expression: "!hoverLoad || hover"
    }],
    ref: "video",
    class: _vm.bem("video"),
    attrs: {
      "muted": "muted",
      "loop": "loop",
      "autoplay": !_vm.openAb,
      "src": _vm.video
    },
    domProps: {
      "muted": true
    },
    on: {
      "canplaythrough": function($event) {
        _vm.loaded = true;
      },
      "error": _vm.onError
    }
  }), _c("div", {
    class: _vm.bem("bg"),
    style: {
      background: _vm.color
    }
  })]);
};
var staticRenderFns$6 = [];
var lazyVideo_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.lazy-video{position:absolute;top:0;left:0;width:100%}.lazy-video--loaded .lazy-video__bg{opacity:0}.lazy-video__video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;pointer-events:none}.lazy-video--transition .lazy-video__bg{transition:all ease .2s}.lazy-video__img{width:100%}.lazy-video__bg{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
if (typeof window !== "undefined") {
  import("./index.js").then(function(n) {
    return n.bz;
  });
}
const intersectionObservers = {};
const __vue2_script$6 = {
  name: "lazy-video",
  inject: {
    hoverLoad: {
      default: false
    }
  },
  props: {
    src: {
      type: String,
      default: ""
    },
    aspectRatio: {
      type: Number,
      default: 0
    },
    color: {
      type: String,
      default: "#ecebeb"
    },
    ratio: {
      type: Number,
      default: 0.5
    },
    transition: {
      type: Boolean,
      default: true
    },
    margin: {
      type: String,
      default: "0px 0px 0px 0px"
    },
    openAb: {
      type: Boolean,
      default: false
    },
    threshold: {
      type: Array,
      default: () => [0, 1e-7, 0.25, 0.5, 0.75, 1]
    },
    hover: {
      type: Boolean,
      default: false
    },
    imgSrc: {
      type: String,
      default: ""
    },
    alt: {
      type: String,
      default: ""
    }
  },
  data() {
    return {
      loaded: false,
      playing: false,
      pausing: true,
      beginLoad: false,
      timmer: null
    };
  },
  computed: {
    video() {
      return this.beginLoad ? this.src : null;
    }
  },
  mounted() {
    if (!intersectionObservers[this.margin]) {
      const io = new IntersectionObserver((entries) => {
        entries.forEach((e) => {
          const lazyVideo = e.target.$$lazyVideo;
          if (lazyVideo && lazyVideo.$refs && lazyVideo.$refs.video) {
            const videoNode = lazyVideo.$refs.video;
            if (e.intersectionRatio > lazyVideo.ratio) {
              lazyVideo.beginLoad = true;
              if (lazyVideo.openAb && !lazyVideo.playing) {
                clearTimeout(lazyVideo.timmer);
                lazyVideo.timmer = setTimeout(async () => {
                  await videoNode.play();
                  lazyVideo.playing = true;
                  lazyVideo.pausing = false;
                  lazyVideo.$emit("expose");
                }, 300);
              } else {
                io.unobserve(e.target);
              }
            } else {
              if (lazyVideo.openAb && !lazyVideo.pausing) {
                clearTimeout(lazyVideo.timmer);
                lazyVideo.timmer = setTimeout(async () => {
                  await videoNode.pause();
                  lazyVideo.playing = false;
                  lazyVideo.pausing = true;
                  lazyVideo.$emit("hide");
                }, 300);
              }
            }
          }
        });
      }, {
        threshold: this.threshold,
        rootMargin: this.margin
      });
      intersectionObservers[this.margin] = io;
    }
    this.$el.$$lazyVideo = this;
    intersectionObservers[this.margin].observe(this.$el);
  },
  beforeDestroy() {
    if (!this.$isServer && intersectionObservers[this.margin]) {
      clearTimeout(this.timmer);
      intersectionObservers[this.margin].unobserve(this.$el);
    }
  },
  methods: {
    onError(e) {
      this.$emit("error", e);
    }
  }
};
const __cssModules$6 = {};
var __component__$6 = /* @__PURE__ */ normalizeComponent(__vue2_script$6, render$6, staticRenderFns$6, false, __vue2_injectStyles$6, null, null, null);
function __vue2_injectStyles$6(context) {
  for (let o in __cssModules$6) {
    this[o] = __cssModules$6[o];
  }
}
var LazyVideo = /* @__PURE__ */ function() {
  return __component__$6.exports;
}();
var render$5 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_vm.preview.partial_video ? _c("LazyVideo", {
    attrs: {
      "hover": _vm.hover,
      "src": _vm.preview.partial_video,
      "imgSrc": _vm.previewUrl,
      "alt": _vm.template.title,
      "ratio": 0.5,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  }) : _c("LazyImage", {
    ref: "preview",
    attrs: {
      "src": _vm.previewUrl,
      "srcset": _vm.doublePreviewUrl,
      "lazy": _vm.lazy,
      "alt": _vm.template.title,
      "ratio": 0,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  }), _vm.showVideo ? _c("video", {
    ref: "video",
    class: _vm.bem("video"),
    attrs: {
      "src": _vm.preview.video,
      "autoplay": "true",
      "loop": "loop",
      "volume": "0.5",
      "preload": "metadata"
    }
  }) : _vm._e()], 1);
};
var staticRenderFns$5 = [];
var movie_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.video-preview .lazy-image{position:absolute;top:0;left:0;width:100%}.video-preview__video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const TEMPLATE_PREVIEW_WIDTH$4 = 750;
const __vue2_script$5 = {
  name: "video-preview",
  components: {
    LazyImage,
    LazyVideo
  },
  inject: {
    abTest: {
      default: null
    },
    hoverLoad: {
      default: false
    }
  },
  props: {
    maxRatio: {
      type: Number,
      default: 1.77
    },
    minRatio: {
      type: Number,
      default: 0
    },
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    lazy: {
      type: Boolean,
      default: true
    },
    showVideo: {
      type: Boolean,
      default: false
    },
    hover: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    isdynamicFile() {
      return this.noOss ? false : /\.gif$/.test(this.preview.url);
    },
    previewUrl() {
      const option = {
        width: this.previewWidth * 1.5,
        useDpr: false
      };
      if (this.hoverLoad && this.isdynamicFile && !this.hover) {
        option.type = "jpg";
      } else if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option);
    },
    doublePreviewUrl() {
      const option = {
        width: this.previewWidth * 2,
        useDpr: false
      };
      if (this.hoverLoad && this.isdynamicFile && !this.hover) {
        option.type = "jpg";
      } else if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option) + " 2x";
    },
    previewWidth() {
      if (this.preview.width < 325)
        return this.preview.width;
      return Math.min(Math.max(this.preview.width / 2, 325), TEMPLATE_PREVIEW_WIDTH$4);
    },
    aspectRatio() {
      return Math.max(Math.min(this.preview.height / this.preview.width, this.maxRatio), this.minRatio);
    },
    imgAspectRatio() {
      return Math.max(this.aspectRatio, this.preview.height / this.preview.width);
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    }
  },
  async mounted() {
    if (this.showVideo && this.preview.video) {
      this.$refs.video.setAttribute("controls", true);
    }
  }
};
const __cssModules$5 = {};
var __component__$5 = /* @__PURE__ */ normalizeComponent(__vue2_script$5, render$5, staticRenderFns$5, false, __vue2_injectStyles$5, null, null, null);
function __vue2_injectStyles$5(context) {
  for (let o in __cssModules$5) {
    this[o] = __cssModules$5[o];
  }
}
var Movie = /* @__PURE__ */ function() {
  return __component__$5.exports;
}();
var render$4 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("LazyImage", {
    ref: "preview",
    attrs: {
      "src": _vm.previewUrl,
      "srcset": _vm.doublePreviewUrl,
      "lazy": _vm.lazy,
      "alt": _vm.template.title,
      "ratio": 0,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  }), _c("div", {
    class: _vm.bem("detail-padding")
  }), _c("div", {
    class: _vm.bem("detail")
  }, [_c("div", {
    class: _vm.bem("title")
  }, [_vm._v(_vm._s(_vm.template.title))]), _vm.template.description ? _c("div", {
    class: _vm.bem("description")
  }, [_vm._v(" " + _vm._s(_vm.template.description) + " ")]) : _vm._e()])], 1);
};
var staticRenderFns$4 = [];
var ad_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.ad-preview .lazy-image{position:absolute;top:0;left:0;width:100%}.ad-preview__detail-padding{height:68px}.ad-preview__detail{position:absolute;bottom:0;left:14px;height:68px}.ad-preview__title{padding-top:16px;overflow:hidden;font-size:16px;font-weight:700;line-height:16px;color:#202020;text-overflow:ellipsis;white-space:nowrap}.ad-preview__description{margin-top:8px;overflow:hidden;font-size:12px;line-height:12px;color:#939ba6;text-overflow:ellipsis;white-space:nowrap}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const TEMPLATE_PREVIEW_WIDTH$3 = 750;
const __vue2_script$4 = {
  name: "ad-preview",
  components: {
    LazyImage
  },
  props: {
    maxRatio: {
      type: Number,
      default: 1.77
    },
    minRatio: {
      type: Number,
      default: 0
    },
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    lazy: {
      type: Boolean,
      default: true
    }
  },
  computed: {
    previewUrl() {
      if (this.isSvg) {
        return this.preview.url;
      }
      ({ width: this.previewWidth * 1.5, useDpr: false });
      if (this.$ssrContext && this.$ssrContext.supportWebp)
        ;
      return this.preview.url;
    },
    doublePreviewUrl() {
      if (this.isSvg || this.preview.width < 325)
        return null;
      ({ width: this.previewWidth * 2, useDpr: false });
      if (this.$ssrContext && this.$ssrContext.supportWebp)
        ;
      return this.preview.url;
    },
    previewWidth() {
      if (this.preview.width < 325)
        return this.preview.width;
      return Math.min(Math.max(this.preview.width / 2, 325), TEMPLATE_PREVIEW_WIDTH$3);
    },
    aspectRatio() {
      return Math.max(Math.min(this.preview.height / this.preview.width, this.maxRatio), this.minRatio);
    },
    imgAspectRatio() {
      return Math.max(this.aspectRatio, this.preview.height / this.preview.width);
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    },
    isSvg() {
      return lodash.exports.get(this.preview, "url").indexOf(".svg") > -1;
    }
  }
};
const __cssModules$4 = {};
var __component__$4 = /* @__PURE__ */ normalizeComponent(__vue2_script$4, render$4, staticRenderFns$4, false, __vue2_injectStyles$4, null, null, null);
function __vue2_injectStyles$4(context) {
  for (let o in __cssModules$4) {
    this[o] = __cssModules$4[o];
  }
}
var Ad = /* @__PURE__ */ function() {
  return __component__$4.exports;
}();
var render$3 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_vm.showMusic ? _c("audio", {
    class: _vm.bem("music"),
    attrs: {
      "src": _vm.template.play_url,
      "controls": "",
      "autoplay": "",
      "loop": "",
      "preload": "auto"
    }
  }) : _c("LazyImage", {
    ref: "preview",
    attrs: {
      "src": _vm.previewUrl,
      "srcset": _vm.doublePreviewUrl,
      "lazy": _vm.lazy,
      "alt": _vm.template.title,
      "ratio": 0,
      "aspectRatio": _vm.imgAspectRatio,
      "color": _vm.preview.hex || "#f0f3f4"
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  })], 1);
};
var staticRenderFns$3 = [];
var music_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.music-preview .lazy-image{position:absolute;top:0;left:0;width:100%}.music-preview__music{position:absolute;top:50%;left:0;width:100%;outline:none;transform:translateY(-50%)}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const TEMPLATE_PREVIEW_WIDTH$2 = 750;
const __vue2_script$3 = {
  name: "music-preview",
  components: {
    LazyImage
  },
  props: {
    maxRatio: {
      type: Number,
      default: 1.77
    },
    minRatio: {
      type: Number,
      default: 0
    },
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    lazy: {
      type: Boolean,
      default: true
    },
    showVideo: {
      type: Boolean,
      default: false
    },
    showMusic: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      hover: false
    };
  },
  computed: {
    previewUrl() {
      const option = { width: this.previewWidth * 1.5, useDpr: false };
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option);
    },
    doublePreviewUrl() {
      if (this.preview.width < 325)
        return null;
      const option = { width: this.previewWidth * 2, useDpr: false };
      if (this.$ssrContext && this.$ssrContext.supportWebp) {
        option.supportWebp = true;
        option.type = "webp";
      } else {
        option.allowJPGOnUnsupportedWebp = true;
      }
      return this.ossUrl(this.preview.url, option) + " 2x";
    },
    previewWidth() {
      if (this.preview.width < 325)
        return this.preview.width;
      return Math.min(Math.max(this.preview.width / 2, 325), TEMPLATE_PREVIEW_WIDTH$2);
    },
    aspectRatio() {
      return Math.max(Math.min(this.preview.height / this.preview.width, this.maxRatio), this.minRatio);
    },
    imgAspectRatio() {
      return Math.max(this.aspectRatio, this.preview.height / this.preview.width);
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    }
  }
};
const __cssModules$3 = {};
var __component__$3 = /* @__PURE__ */ normalizeComponent(__vue2_script$3, render$3, staticRenderFns$3, false, __vue2_injectStyles$3, null, null, null);
function __vue2_injectStyles$3(context) {
  for (let o in __cssModules$3) {
    this[o] = __cssModules$3[o];
  }
}
var Music = /* @__PURE__ */ function() {
  return __component__$3.exports;
}();
var render$2 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem(),
    style: {
      "padding-bottom": _vm.aspectRatio * 100 + "%"
    }
  }, [_c(_vm.component, {
    tag: "component",
    attrs: {
      "template": _vm.template,
      "minRatio": _vm.minRatio,
      "setRatio": _vm.setRatio,
      "maxRatio": _vm.maxRatio,
      "lazy": _vm.lazy,
      "showVideo": _vm.showVideo,
      "showMusic": _vm.showMusic,
      "hover": _vm.hover
    },
    on: {
      "load": function($event) {
        return _vm.$emit("load");
      }
    }
  })], 1);
};
var staticRenderFns$2 = [];
var index_vue_vue_type_style_index_0_lang$2 = /* @__PURE__ */ (() => '.material-preview{position:relative;width:100%;overflow:hidden;background:linear-gradient(45deg,#eee 25%,transparent 0,transparent 75%,#eee 0,#eee),linear-gradient(45deg,#eee 25%,#fff 0,#fff 75%,#eee 0,#eee);background-position:0 0,6px 6px;background-size:12px 12px}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const TEMPLATE_PREVIEW_WIDTH$1 = 750;
const { isRepositoryTemplate } = material;
const __vue2_script$2 = {
  name: "material-preview",
  components: {
    Normal,
    Long,
    Wide,
    Ad
  },
  props: {
    template: {
      type: Object,
      required: true,
      validator(value) {
        return value && value.preview;
      }
    },
    maxRatio: {
      type: Number,
      default: 1.77
    },
    minRatio: {
      type: Number,
      default: 0
    },
    setRatio: {
      type: Number,
      default: 0
    },
    lazy: {
      type: Boolean,
      default: true
    },
    showVideo: {
      type: Boolean,
      default: false
    },
    showMusic: {
      type: Boolean,
      default: false
    },
    hover: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    aspectRatio() {
      if (this.setRatio) {
        return this.setRatio;
      }
      if (this.isWide) {
        return this.preview.height / TEMPLATE_PREVIEW_WIDTH$1;
      }
      return Math.max(Math.min(this.preview.height / this.preview.width, this.maxRatio), this.minRatio);
    },
    isLong() {
      return this.preview.height / this.preview.width - this.aspectRatio > 0.2;
    },
    isWide() {
      return this.wideTemplateCount > 1 && this.template.type === "web_page";
    },
    isMovie() {
      return this.template.type === "movie" && !isRepositoryTemplate(this.template) || this.template.type === "video";
    },
    isAd() {
      return this.template.type === "ad";
    },
    isMusic() {
      return this.template.type === "music";
    },
    wideTemplateCount() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return ~~(compositePreview.width / TEMPLATE_PREVIEW_WIDTH$1);
      }
      return 1;
    },
    preview() {
      const compositePreview = this.template.composite_preview || this.template.compositePreview;
      if (this.template.type !== "movie" && compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return compositePreview;
      }
      return this.template.preview;
    },
    component() {
      if (this.isAd)
        return Ad;
      else if (this.isLong)
        return Long;
      else if (this.isWide)
        return Wide;
      else if (this.isMovie)
        return Movie;
      else if (this.isMusic)
        return Music;
      return Normal;
    }
  }
};
const __cssModules$2 = {};
var __component__$2 = /* @__PURE__ */ normalizeComponent(__vue2_script$2, render$2, staticRenderFns$2, false, __vue2_injectStyles$2, null, null, null);
function __vue2_injectStyles$2(context) {
  for (let o in __cssModules$2) {
    this[o] = __cssModules$2[o];
  }
}
var MaterialPreview = /* @__PURE__ */ function() {
  return __component__$2.exports;
}();
var render$1 = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", {
    class: _vm.bem()
  }, [_c("MaterialPreview", {
    ref: "preview",
    attrs: {
      "template": _vm.material,
      "minRatio": _vm.aspectRatio,
      "setRatio": _vm.setRatio,
      "lazy": _vm.lazy,
      "hover": _vm.hideMark,
      "showVideo": _vm.showVideo
    },
    on: {
      "load": _vm.load
    }
  }), _c("MaterialMark", {
    class: _vm.bem("mark", {
      hide: _vm.hideMark
    }),
    attrs: {
      "material": _vm.material,
      "templateConfirmed": _vm.templateConfirmed
    }
  })], 1);
};
var staticRenderFns$1 = [];
var index_vue_vue_type_style_index_0_lang$1 = /* @__PURE__ */ (() => '.material-preview-with-mark{position:relative;overflow:hidden;border-radius:4px}.material-preview-with-mark__mark{position:absolute;bottom:8px;left:8px;pointer-events:none}.material-preview-with-mark__mark--hide{display:none}.material-preview-with-mark:after{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid rgba(0,0,0,.08);border-radius:4px;pointer-events:none;content:""}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const { bem } = mixins;
const { getPreview, getAspectRatio } = material;
const __vue2_script$1 = {
  name: "material-preview-with-mark",
  components: {
    MaterialPreview,
    MaterialMark
  },
  mixins: [bem],
  provide() {
    return {
      hoverLoad: this.hoverLoad
    };
  },
  props: {
    material: {
      type: Object,
      required: true
    },
    setRatio: {
      type: Number,
      default: 0
    },
    hideMark: {
      type: Boolean,
      defalut: false
    },
    showVideo: {
      type: Boolean,
      default: false
    },
    lazy: {
      type: Boolean
    },
    templateConfirmed: {
      type: Boolean
    },
    hoverLoad: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {};
  },
  computed: {
    preview() {
      return getPreview(this.material);
    },
    aspectRatio() {
      return getAspectRatio({
        preview: this.preview,
        material: this.material
      });
    }
  },
  methods: {
    load() {
      const templetPreview = this.$refs.preview.$el;
      if (parseInt(templetPreview.style.height) < 85) {
        this.$emit("showEdit", false);
      }
      this.$emit("load");
    }
  }
};
const __cssModules$1 = {};
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, render$1, staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
function __vue2_injectStyles$1(context) {
  for (let o in __cssModules$1) {
    this[o] = __cssModules$1[o];
  }
}
var MaterialPreviewWithMark = /* @__PURE__ */ function() {
  return __component__$1.exports;
}();
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("section", {
    class: _vm.bem()
  }, [_c("Waterfall", {
    attrs: {
      "margin": [_vm.MATERIAL_MARGIN, 24],
      "list": _vm.list,
      "getItemSize": _vm.getItemSize,
      "columns": _vm.innerColumns
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function(_ref) {
        var item = _ref.item, index = _ref.index;
        return [_c("div", [_c("div", {
          class: _vm.bem("material-preview-box"),
          on: {
            "click": function($event) {
              return _vm.showDetail(item, index);
            },
            "mouseenter": function($event) {
              return _vm.handleMouseenter(item);
            },
            "mouseleave": _vm.handleMouseleave
          }
        }, [_c("MaterialPreviewWithMark", {
          attrs: {
            "hoverLoad": _vm.hoverLoad,
            "data-type": "material",
            "material": item,
            "setRatio": _vm.setRatio,
            "lazy": index > 10,
            "showVideo": _vm.showVideoIndex === index,
            "hideMark": _vm.hoveringId === item.id,
            "templateConfirmed": true
          },
          on: {
            "load": function($event) {
              return _vm.handleLoad(item, index);
            }
          }
        }), _vm.canEdit ? _c("div", [_c("div", {
          class: _vm.bem("material-mask")
        }), _c("div", {
          class: _vm.bem("btn-wrap")
        }, [_c("span", {
          directives: [{
            name: "paid",
            rawName: "v-paid",
            value: {
              type: "MATERIAL"
            },
            expression: "{ type: 'MATERIAL' }"
          }],
          class: _vm.bem("material-btn"),
          on: {
            "click": function($event) {
              $event.stopPropagation();
              return _vm.toEditor(item, index);
            }
          }
        }, [_c("Icon", {
          class: _vm.bem("material-btn-icon"),
          attrs: {
            "type": "iconcolor_lens_fill"
          }
        }), _vm._v(" \u5F00\u59CB\u521B\u4F5C ")], 1)])]) : _vm._e(), _c("div", {
          class: _vm.bem("favo")
        }, [_c("Favo", {
          attrs: {
            "type": "solid",
            "contentId": item.id,
            "contentType": 0,
            "sourceType": "GD"
          },
          model: {
            value: item.favo,
            callback: function($$v) {
              _vm.$set(item, "favo", $$v);
            },
            expression: "item.favo"
          }
        })], 1)], 1), _c("div", {
          class: _vm.bem("material-title")
        }, [_vm._v(_vm._s(item.title))])])];
      }
    }])
  }), _c("div", {
    ref: "material-list-bottom",
    class: _vm.bem("material-list-bottom")
  }), _c("GaodingMaterialDetailModal", {
    attrs: {
      "visible": _vm.materialDetailVisible,
      "materials": _vm.list,
      "canEdit": _vm.canEdit,
      "index": _vm.activeIndex
    },
    on: {
      "change": _vm.handleMaterialDetailVisibleChange,
      "recordOpenEditor": _vm.recordOpenEditor,
      "update:index": function($event) {
        _vm.activeIndex = $event;
      }
    },
    scopedSlots: _vm._u([{
      key: "favo",
      fn: function(_ref2) {
        var material2 = _ref2.material;
        return [_c("Favo", {
          attrs: {
            "contentType": material2.content_type,
            "contentId": material2.id,
            "sourceType": "GD"
          },
          model: {
            value: material2.favo,
            callback: function($$v) {
              _vm.$set(material2, "favo", $$v);
            },
            expression: "material.favo"
          }
        })];
      }
    }])
  })], 1);
};
var staticRenderFns = [];
var index_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.material-list{position:relative}.material-list__material-preview-box{position:relative;overflow:hidden;border-radius:4px;cursor:zoom-in}.material-list__material-preview-box:hover .material-list__favo,.material-list__material-preview-box:hover .material-list__btn-wrap,.material-list__material-preview-box:hover .material-list__material-mask{opacity:1}.material-list__btn-wrap{opacity:0}.material-list__material-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.08);opacity:0;pointer-events:none}.material-list__material-btn{position:absolute;right:12px;bottom:12px;left:12px;display:inline-flex;align-items:center;justify-content:center;height:40px;color:#fff;background:#000;border-radius:20px;opacity:.6;cursor:pointer}.material-list__material-btn:hover{opacity:.8}.material-list__material-btn-icon{margin-right:4px;font-size:18px}.material-list__material-title{display:block;margin-top:12px;overflow:hidden;font-size:14px;line-height:20px;color:#5f6771;text-overflow:ellipsis;white-space:nowrap}.material-list__material-list-bottom{position:absolute;right:0;bottom:0;left:0;z-index:-1000;height:100px}.material-list__favo{position:absolute;top:12px;right:12px;opacity:0}body{min-width:1200px;overflow:overlay;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0)}body::-webkit-scrollbar{width:7px}body::-webkit-scrollbar-thumb{background-color:#000000b3;border:1px solid #fff;border-radius:10rem}body::-webkit-scrollbar-track-piece:start,body::-webkit-scrollbar-track-piece:end{background:transparent}ul{padding:0;list-style:none}.tofh{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[id^=HUABAN],[class^=HUABAN],[id^=ZCOOL],[class^=ZCOOL],[id^=lvye],[class^=lvye],[id^=xmt-],[class^=xmt-]{display:none!important}body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/grid.html"],body>iframe[src="chrome-extension://gpdjojdkbbmdfjfahjcgigfpmkopogic/html/search.html"]{visibility:hidden!important;transform:translate(-10000px)!important}.eui-popup-base{z-index:2100!important}.eui-tabs__header{border-bottom-width:1px!important}.gda-btn:not(.gda-btn-sm){min-width:88px}.gda-btn>.gdaicon{font-size:20px;vertical-align:-.1em}.gda-btn svg{vertical-align:bottom}.gda-btn.disabled,.gda-btn[disabled]{cursor:default}.gda-dropdown-menu{box-shadow:0 2px 8px #00000029}.gda-dropdown-menu-item{padding:10px 12px;line-height:20px}.gda-dropdown-menu-item>.gdaicon:first-child{font-size:20px;vertical-align:bottom}.gda-dropdown-menu-item:hover,.gda-dropdown-menu-submenu-title:hover{background:#f6f7f9}.gda-dropdown-menu-item-disabled:hover,.gda-dropdown-menu-submenu-title-disabled:hover{background-color:#fff}.gda-modal-header{padding:18px 24px;border-bottom:none}.gda-modal-title{line-height:24px}.gda-modal-close-x{width:60px;height:60px;line-height:60px}.gda-modal-footer{border-top:none}.gda-form-item-label{font-weight:700}.gda-form-horizontal .gda-form-item{margin-bottom:10px}.gda-form-horizontal .gda-form-item-label{font-weight:700;line-height:48px}.gda-pagination-item,.gda-pagination-item:focus,.gda-pagination-item:hover,.gda-pagination-prev .gda-pagination-item-link,.gda-pagination-next .gda-pagination-item-link{color:#444950;background-color:#f0f3f4;border:none}.gda-pagination-item-active,.gda-pagination-item-active:focus,.gda-pagination-item-active:hover{background:#2254f4;border:none}.gda-pagination-item-active a,.gda-pagination-item-active:focus a,.gda-pagination-item-active:hover a{color:#fff}.gda-pagination-prev.gda-pagination-disabled .gda-pagination-item-link,.gda-pagination-next.gda-pagination-disabled .gda-pagination-item-link{opacity:.3}.gda-pagination-prev:focus .gda-pagination-item-link,.gda-pagination-next:focus .gda-pagination-item-link,.gda-pagination-prev:hover .gda-pagination-item-link,.gda-pagination-next:hover .gda-pagination-item-link{color:#444950}.gda-tree li,.gda-tree li:first-child,.gda-tree li:last-child{padding:0}.gda-tree-child-tree>li:first-child{padding-top:0}:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_close .gda-tree-switcher-icon,:root .gda-tree li span.gda-tree-switcher.gda-tree-switcher_open .gda-tree-switcher-icon{font-size:16px;vertical-align:-3px}.gda-tree.gda-tree-directory>li span.gda-tree-node-content-wrapper:hover:before,.gda-tree.gda-tree-directory .gda-tree-child-tree>li span.gda-tree-node-content-wrapper:hover:before{border-radius:4px}.gda-tree .gda-tree-treenode-checkbox-checked .gda-tree-checkbox-checked:after{display:none}\n')();
const TEMPLATE_PREVIEW_WIDTH = 750;
const MATERIAL_MARGIN = 16;
const { materailMaxRatio } = material;
const { GaodingMaterialDetailModal } = MaterialDetailModal;
const { openEditor } = editor;
let intersectionObserver = {};
const __vue2_script = {
  name: "material-list",
  components: {
    Waterfall,
    GaodingMaterialDetailModal,
    MaterialPreviewWithMark,
    Icon,
    Favo
  },
  props: {
    rows: {
      type: Number,
      default: 0
    },
    materials: {
      type: Array,
      required: true
    },
    columns: {
      type: Number,
      default: 5
    },
    columnsOffset: {
      type: Number,
      default: 1
    },
    responsiveWidth: {
      type: Number,
      default: 1200
    },
    canEdit: {
      type: Boolean,
      default: true
    },
    trackerData: {
      type: Object,
      default: () => ({})
    },
    tracker: {
      type: Boolean,
      default: false
    },
    hoverLoad: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      MATERIAL_MARGIN,
      clientWidth: 1920,
      observedEl: null,
      materialDetailVisible: false,
      activeIndex: -1,
      currentMaterialElem: null,
      showVideoIndex: -1,
      hoveringId: ""
    };
  },
  computed: {
    list() {
      let materials = this.materials;
      if (this.rows) {
        materials = this.materials.slice(0, this.innerColumns * this.rows);
      }
      return materials.filter((m) => m.compositePreview && m.compositePreview.height || m.preview && m.preview.height);
    },
    innerColumns() {
      return this.clientWidth >= this.responsiveWidth ? this.columns + this.columnsOffset : this.columns;
    },
    setRatio() {
      if (!["home", "templates", "scene-search"].includes(this.$route.name))
        return 0;
      if (this.$route.name === "scene-search" && this.$route.params.scene !== "h5")
        return 0;
      const h5List = this.list.filter((item) => item.type === "h5_bargraph");
      const webPageList = this.list.filter((item) => item.type === "web_page");
      const hasH5AndWebPage = [...new Set(this.list.map((item) => item.type))].length === 2 && h5List.length && webPageList.length;
      let ratio = 0;
      if (hasH5AndWebPage) {
        const template = webPageList[0];
        let preview = template.preview;
        let wideTemplateCount = 1;
        if (template.type !== "movie" && template.compositePreview && template.compositePreview.url && template.compositePreview.width && template.compositePreview.height) {
          preview = template.compositePreview;
          wideTemplateCount = ~~(template.compositePreview.width / TEMPLATE_PREVIEW_WIDTH);
        }
        if (wideTemplateCount > 1) {
          ratio = preview.height / TEMPLATE_PREVIEW_WIDTH;
        } else {
          const minRatio = Math.max(Math.min(preview.height / preview.width, materailMaxRatio(template)), 0.35);
          ratio = Math.max(Math.min(preview.height / preview.width, 1.77), minRatio);
        }
      }
      return ratio;
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.update();
    });
    window.addEventListener("resize", this.update);
    document.addEventListener("mouseover", this.handleMouseOver, false);
    document.addEventListener("mouseout", this.handleMouseOut, false);
    this.startObserve();
  },
  beforeDestroy() {
    window.removeEventListener("resize", this.update);
    document.removeEventListener("mouseover", this.handleMouseOver, false);
    document.removeEventListener("mouseout", this.handleMouseOut, false);
    intersectionObserver.unobserve(this.observedEl);
  },
  methods: {
    handleLoad(item, index) {
      const { ext = {} } = item;
      const { dist_code, material_location } = ext;
      const _a = this.trackerData, { source, source_topic_id, source_topic_title } = _a, rest = __objRest(_a, ["source", "source_topic_id", "source_topic_title"]);
      __spreadValues(__spreadValues(__spreadValues(__spreadValues({
        event_id: 33001,
        project_name: "gd_qiye_web",
        material_id: `${item.id}`,
        material_location: material_location || index,
        expose_source: source
      }, source_topic_id ? { expose_source_topic_id: source_topic_id } : null), source_topic_title ? { expose_source_topic_title: source_topic_title } : null), dist_code ? { dist_code } : null), rest);
    },
    handleMouseOver(e) {
      if (this.currentMaterialElem) {
        return;
      }
      const target = e.target.closest('[data-type="material"]');
      if (!target || !this.$el.contains(target)) {
        return;
      }
      this.currentMaterialElem = target;
      this.showVideoIndex = parseInt(target.dataset.index);
    },
    handleMouseOut(e) {
      if (!this.currentMaterialElem) {
        return;
      }
      let relatedTarget = e.relatedTarget;
      while (relatedTarget) {
        if (relatedTarget === this.currentMaterialElem) {
          return;
        }
        relatedTarget = relatedTarget.parentNode;
      }
      this.currentMaterialElem = null;
      this.showVideoIndex = -1;
    },
    getItemSize(item) {
      const compositePreview = item.composite_preview;
      let preview = compositePreview && compositePreview.height ? compositePreview : item.preview;
      if (item.type === "web_page" && this.isWideImage(item)) {
        preview = item.preview;
      }
      const width = Math.round((this.clientWidth - (this.columns - 1) * MATERIAL_MARGIN) / this.columns);
      const zoom = preview.width / width;
      return {
        height: Math.floor(Math.max(Math.min(preview.height / zoom, width * materailMaxRatio(item)), width * 0.3) + 52),
        width
      };
    },
    isWideImage(item) {
      const compositePreview = item.compositePreview || item.composite_preview;
      if (compositePreview && compositePreview.url && compositePreview.width && compositePreview.height) {
        return ~~(compositePreview.width / 750) > 1;
      }
      return false;
    },
    update() {
      this.clientWidth = this.$el.clientWidth;
    },
    startObserve() {
      intersectionObserver = new IntersectionObserver((entries) => {
        if (entries[0].isIntersecting) {
          this.$emit("loadNextPage");
        }
      }, {
        rootMargin: "0px 0px 0px 0px"
      });
      this.observedEl = this.$refs["material-list-bottom"];
      intersectionObserver.observe(this.observedEl);
    },
    showDetail(item, index) {
      this.materialDetailVisible = true;
      this.activeIndex = index;
      const { ext = {} } = item;
      const { dist_code, material_location } = ext;
      const _a = this.trackerData, { source, source_topic_id, source_topic_title } = _a, rest = __objRest(_a, ["source", "source_topic_id", "source_topic_title"]);
      __spreadValues(__spreadValues(__spreadValues(__spreadValues({
        event_id: 33002,
        project_name: "gd_qiye_web",
        click_type: "\u9884\u89C8",
        material_id: `${item.id}`,
        material_location: material_location || index,
        click_source: source
      }, source_topic_id ? { click_source_topic_id: source_topic_id } : null), source_topic_title ? { click_source_topic_title: source_topic_title } : null), dist_code ? { dist_code } : null), rest);
    },
    recordClick(item, index, from = "\u5F00\u59CB\u521B\u4F5C") {
      if (!this.tracker) {
        return;
      }
      const { ext = {} } = item;
      const { dist_code, material_location } = ext;
      const _a = this.trackerData, { source, source_topic_id, source_topic_title } = _a, rest = __objRest(_a, ["source", "source_topic_id", "source_topic_title"]);
      __spreadValues(__spreadValues(__spreadValues(__spreadValues({
        event_id: 33002,
        click_type: from,
        material_id: `${item.id}`,
        material_location: material_location || index,
        click_source: source
      }, source_topic_id ? { click_source_topic_id: source_topic_id } : null), source_topic_title ? { click_source_topic_title: source_topic_title } : null), dist_code ? { dist_code } : null), rest);
    },
    recordOpenEditor(item, index) {
      this.recordClick(item, index, "\u9884\u89C8_\u5F00\u59CB\u521B\u4F5C");
    },
    handleMaterialDetailVisibleChange(visible) {
      this.materialDetailVisible = visible;
      if (!visible) {
        this.activeIndex = -1;
      }
    },
    handleMouseenter(item) {
      this.hoveringId = item.id;
    },
    handleMouseleave() {
      this.hoveringId = "";
    },
    toEditor(template, index) {
      this.recordClick(template, index);
      openEditor(template);
    }
  }
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
  for (let o in __cssModules) {
    this[o] = __cssModules[o];
  }
}
var MaterialList = /* @__PURE__ */ function() {
  return __component__.exports;
}();
export { MaterialList as M };
