'use strict'
!(function(require, directRequire) {
  const a = require('./0634ee2ebd3e560d9d4804ecc960160f.js'),
    b = require('./3bfffbe88b3d923921f851c0697974fe.js')
  let c = null
  module.exports = {
    showActionSheet: async function(b, c) {
      let { itemList: e = [], itemColor: f = '#000000', alertIndex: d } = c.args
      b({
        type: a.SIMULATOR_SET_ACTIONSHEET,
        data: {
          show: !0,
          alertIndex: d,
          itemList: e,
          itemColor: f,
          cancelColor: '#000000',
          cancelText: '\u53D6\u6D88',
          callbackID: c.callbackID
        }
      })
    },
    showToast: async function(d, e) {
      let {
        title: f,
        image: g,
        duration: i = 1500,
        mask: j = !1,
        icon: h
      } = e.args
      return (
        f &&
          (h || g) &&
          (f = ((a, b) => {
            let c = 0
            const d = a.length
            let e = -1,
              f = ''
            for (
              let g = 0;
              g < d &&
              ((e = a.charCodeAt(g)),
              0 <= e && 128 >= e ? ++c : (c += 2),
              !(c > b));
              g++
            )
              f += a.slice(g, g + 1)
            return f
          })(f, 14)),
        g && (g = b.getResourceUrl(g)),
        d({
          type: a.SIMULATOR_SET_TOAST,
          data: { show: !0, icon: h, image: g, title: f, mask: j }
        }),
        c && (clearTimeout(c), (c = null)),
        (c = setTimeout(() => {
          d({ type: a.SIMULATOR_SET_TOAST, data: { show: !1 } })
        }, i)),
        { errMsg: `${e.api}:ok` }
      )
    },
    hideToast: async function(b, d) {
      return (
        c && (clearTimeout(c), (c = null)),
        b({ type: a.SIMULATOR_SET_TOAST, data: { show: !1 } }),
        { errMsg: `${d.api}:ok` }
      )
    },
    showModal: async function(b, c) {
      let {
        title: d,
        content: e,
        showCancel: f = !0,
        cancelText: g = '\u53D6\u6D88',
        cancelColor: h = '#000000',
        confirmText: i = '\u786E\u5B9A',
        confirmColor: j = '#3CC51F'
      } = c.args
      b({
        type: a.SIMULATOR_SET_MODAL,
        data: {
          show: !0,
          callbackID: c.callbackID,
          showCancel: f,
          cancelText: g,
          cancelColor: h,
          confirmText: i,
          confirmColor: j,
          content: e,
          title: d
        }
      })
    }
  }
})(require('lazyload'), require)
