import { defineComponent as ft, ref as se, resolveComponent as k, openBlock as ct, createBlock as zt, withCtx as E, createElementVNode as at, createVNode as h, createTextVNode as V, toDisplayString as H, createElementBlock as It, Fragment as Ot, nextTick as Lt, inject as Ut, computed as qt } from "vue";
import { l as vt, d as At, p as Kt, o as $e } from "./index-597e6e44.mjs";
const Zt = { class: "dialog-footer" }, Qt = /* @__PURE__ */ ft({
  __name: "MethodParaEditorDialog",
  setup(o, { expose: e }) {
    function t(s, l) {
      i.value = s, r = l, n.value = !0;
    }
    const n = se(!1), i = se({});
    let r;
    const a = se(), u = async (s) => {
      s && await s.validate((l) => {
        l && (n.value = !1, r && r(i.value));
      });
    };
    return e({ show: t }), (s, l) => {
      const p = k("el-input"), f = k("el-form-item"), v = k("el-option"), w = k("el-select"), y = k("el-form"), c = k("el-button"), b = k("el-dialog");
      return ct(), zt(b, {
        modelValue: n.value,
        "onUpdate:modelValue": l[5] || (l[5] = (C) => n.value = C),
        title: s.$t("_.builtIn.plugin.methodEditor.paraDialogTitle"),
        "close-on-click-modal": !1,
        "close-on-press-escape": !1
      }, {
        footer: E(() => [
          at("span", Zt, [
            h(c, {
              onClick: l[3] || (l[3] = (C) => n.value = !1)
            }, {
              default: E(() => [
                V(H(s.$t("_._.cancel")), 1)
              ]),
              _: 1
            }),
            h(c, {
              type: "primary",
              onClick: l[4] || (l[4] = (C) => u(a.value))
            }, {
              default: E(() => [
                V(H(s.$t("_._.save")), 1)
              ]),
              _: 1
            })
          ])
        ]),
        default: E(() => [
          h(y, {
            ref_key: "dataEditorFormRef",
            ref: a,
            model: i.value,
            "label-width": "120px"
          }, {
            default: E(() => [
              h(f, {
                label: s.$t("_._.key"),
                prop: "key",
                required: ""
              }, {
                default: E(() => [
                  h(p, {
                    modelValue: i.value.key,
                    "onUpdate:modelValue": l[0] || (l[0] = (C) => i.value.key = C)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }, 8, ["label"]),
              h(f, {
                label: s.$t("_._.description"),
                prop: "description"
              }, {
                default: E(() => [
                  h(p, {
                    modelValue: i.value.description,
                    "onUpdate:modelValue": l[1] || (l[1] = (C) => i.value.description = C)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }, 8, ["label"]),
              h(f, {
                label: s.$t("_.builtIn.plugin.methodEditor.parameter_type"),
                prop: "type",
                required: ""
              }, {
                default: E(() => [
                  h(w, {
                    modelValue: i.value.type,
                    "onUpdate:modelValue": l[2] || (l[2] = (C) => i.value.type = C)
                  }, {
                    default: E(() => [
                      h(v, {
                        label: "String",
                        value: "String"
                      }),
                      h(v, {
                        label: "Number",
                        value: "Number"
                      }),
                      h(v, {
                        label: "Boolean",
                        value: "Boolean"
                      }),
                      h(v, {
                        label: "Object",
                        value: "Object"
                      }),
                      h(v, {
                        label: "Array",
                        value: "Array"
                      })
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              }, 8, ["label"])
            ]),
            _: 1
          }, 8, ["model"])
        ]),
        _: 1
      }, 8, ["modelValue", "title"]);
    };
  }
});
/**!
 * Sortable 1.15.2
 * @author	RubaXa   <trash@rubaxa.org>
 * @author	owenm    <owen23355@gmail.com>
 * @license MIT
 */
function bt(o, e) {
  var t = Object.keys(o);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(o);
    e && (n = n.filter(function(i) {
      return Object.getOwnPropertyDescriptor(o, i).enumerable;
    })), t.push.apply(t, n);
  }
  return t;
}
function Z(o) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? bt(Object(t), !0).forEach(function(n) {
      Jt(o, n, t[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : bt(Object(t)).forEach(function(n) {
      Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
    });
  }
  return o;
}
function Ye(o) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ye = function(e) {
    return typeof e;
  } : Ye = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Ye(o);
}
function Jt(o, e, t) {
  return e in o ? Object.defineProperty(o, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : o[e] = t, o;
}
function ne() {
  return ne = Object.assign || function(o) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var n in t)
        Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
    }
    return o;
  }, ne.apply(this, arguments);
}
function en(o, e) {
  if (o == null)
    return {};
  var t = {}, n = Object.keys(o), i, r;
  for (r = 0; r < n.length; r++)
    i = n[r], !(e.indexOf(i) >= 0) && (t[i] = o[i]);
  return t;
}
function tn(o, e) {
  if (o == null)
    return {};
  var t = en(o, e), n, i;
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(o);
    for (i = 0; i < r.length; i++)
      n = r[i], !(e.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (t[n] = o[n]);
  }
  return t;
}
var nn = "1.15.2";
function te(o) {
  if (typeof window < "u" && window.navigator)
    return !!/* @__PURE__ */ navigator.userAgent.match(o);
}
var oe = te(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Ne = te(/Edge/i), _t = te(/firefox/i), Ie = te(/safari/i) && !te(/chrome/i) && !te(/android/i), Pt = te(/iP(ad|od|hone)/i), kt = te(/chrome/i) && te(/android/i), Nt = {
  capture: !1,
  passive: !1
};
function S(o, e, t) {
  o.addEventListener(e, t, !oe && Nt);
}
function D(o, e, t) {
  o.removeEventListener(e, t, !oe && Nt);
}
function Ge(o, e) {
  if (e) {
    if (e[0] === ">" && (e = e.substring(1)), o)
      try {
        if (o.matches)
          return o.matches(e);
        if (o.msMatchesSelector)
          return o.msMatchesSelector(e);
        if (o.webkitMatchesSelector)
          return o.webkitMatchesSelector(e);
      } catch {
        return !1;
      }
    return !1;
  }
}
function on(o) {
  return o.host && o !== document && o.host.nodeType ? o.host : o.parentNode;
}
function q(o, e, t, n) {
  if (o) {
    t = t || document;
    do {
      if (e != null && (e[0] === ">" ? o.parentNode === t && Ge(o, e) : Ge(o, e)) || n && o === t)
        return o;
      if (o === t)
        break;
    } while (o = on(o));
  }
  return null;
}
var yt = /\s+/g;
function W(o, e, t) {
  if (o && e)
    if (o.classList)
      o.classList[t ? "add" : "remove"](e);
    else {
      var n = (" " + o.className + " ").replace(yt, " ").replace(" " + e + " ", " ");
      o.className = (n + (t ? " " + e : "")).replace(yt, " ");
    }
}
function m(o, e, t) {
  var n = o && o.style;
  if (n) {
    if (t === void 0)
      return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(o, "") : o.currentStyle && (t = o.currentStyle), e === void 0 ? t : t[e];
    !(e in n) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), n[e] = t + (typeof t == "string" ? "" : "px");
  }
}
function ye(o, e) {
  var t = "";
  if (typeof o == "string")
    t = o;
  else
    do {
      var n = m(o, "transform");
      n && n !== "none" && (t = n + " " + t);
    } while (!e && (o = o.parentNode));
  var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
  return i && new i(t);
}
function xt(o, e, t) {
  if (o) {
    var n = o.getElementsByTagName(e), i = 0, r = n.length;
    if (t)
      for (; i < r; i++)
        t(n[i], i);
    return n;
  }
  return [];
}
function K() {
  var o = document.scrollingElement;
  return o || document.documentElement;
}
function M(o, e, t, n, i) {
  if (!(!o.getBoundingClientRect && o !== window)) {
    var r, a, u, s, l, p, f;
    if (o !== window && o.parentNode && o !== K() ? (r = o.getBoundingClientRect(), a = r.top, u = r.left, s = r.bottom, l = r.right, p = r.height, f = r.width) : (a = 0, u = 0, s = window.innerHeight, l = window.innerWidth, p = window.innerHeight, f = window.innerWidth), (e || t) && o !== window && (i = i || o.parentNode, !oe))
      do
        if (i && i.getBoundingClientRect && (m(i, "transform") !== "none" || t && m(i, "position") !== "static")) {
          var v = i.getBoundingClientRect();
          a -= v.top + parseInt(m(i, "border-top-width")), u -= v.left + parseInt(m(i, "border-left-width")), s = a + r.height, l = u + r.width;
          break;
        }
      while (i = i.parentNode);
    if (n && o !== window) {
      var w = ye(i || o), y = w && w.a, c = w && w.d;
      w && (a /= c, u /= y, f /= y, p /= c, s = a + p, l = u + f);
    }
    return {
      top: a,
      left: u,
      bottom: s,
      right: l,
      width: f,
      height: p
    };
  }
}
function Et(o, e, t) {
  for (var n = ue(o, !0), i = M(o)[e]; n; ) {
    var r = M(n)[t], a = void 0;
    if (t === "top" || t === "left" ? a = i >= r : a = i <= r, !a)
      return n;
    if (n === K())
      break;
    n = ue(n, !1);
  }
  return !1;
}
function Ee(o, e, t, n) {
  for (var i = 0, r = 0, a = o.children; r < a.length; ) {
    if (a[r].style.display !== "none" && a[r] !== g.ghost && (n || a[r] !== g.dragged) && q(a[r], t.draggable, o, !1)) {
      if (i === e)
        return a[r];
      i++;
    }
    r++;
  }
  return null;
}
function pt(o, e) {
  for (var t = o.lastElementChild; t && (t === g.ghost || m(t, "display") === "none" || e && !Ge(t, e)); )
    t = t.previousElementSibling;
  return t || null;
}
function L(o, e) {
  var t = 0;
  if (!o || !o.parentNode)
    return -1;
  for (; o = o.previousElementSibling; )
    o.nodeName.toUpperCase() !== "TEMPLATE" && o !== g.clone && (!e || Ge(o, e)) && t++;
  return t;
}
function wt(o) {
  var e = 0, t = 0, n = K();
  if (o)
    do {
      var i = ye(o), r = i.a, a = i.d;
      e += o.scrollLeft * r, t += o.scrollTop * a;
    } while (o !== n && (o = o.parentNode));
  return [e, t];
}
function rn(o, e) {
  for (var t in o)
    if (o.hasOwnProperty(t)) {
      for (var n in e)
        if (e.hasOwnProperty(n) && e[n] === o[t][n])
          return Number(t);
    }
  return -1;
}
function ue(o, e) {
  if (!o || !o.getBoundingClientRect)
    return K();
  var t = o, n = !1;
  do
    if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
      var i = m(t);
      if (t.clientWidth < t.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
        if (!t.getBoundingClientRect || t === document.body)
          return K();
        if (n || e)
          return t;
        n = !0;
      }
    }
  while (t = t.parentNode);
  return K();
}
function an(o, e) {
  if (o && e)
    for (var t in e)
      e.hasOwnProperty(t) && (o[t] = e[t]);
  return o;
}
function Ze(o, e) {
  return Math.round(o.top) === Math.round(e.top) && Math.round(o.left) === Math.round(e.left) && Math.round(o.height) === Math.round(e.height) && Math.round(o.width) === Math.round(e.width);
}
var Oe;
function Mt(o, e) {
  return function() {
    if (!Oe) {
      var t = arguments, n = this;
      t.length === 1 ? o.call(n, t[0]) : o.apply(n, t), Oe = setTimeout(function() {
        Oe = void 0;
      }, e);
    }
  };
}
function ln() {
  clearTimeout(Oe), Oe = void 0;
}
function $t(o, e, t) {
  o.scrollLeft += e, o.scrollTop += t;
}
function Ft(o) {
  var e = window.Polymer, t = window.jQuery || window.Zepto;
  return e && e.dom ? e.dom(o).cloneNode(!0) : t ? t(o).clone(!0)[0] : o.cloneNode(!0);
}
function Rt(o, e, t) {
  var n = {};
  return Array.from(o.children).forEach(function(i) {
    var r, a, u, s;
    if (!(!q(i, e.draggable, o, !1) || i.animated || i === t)) {
      var l = M(i);
      n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, l.left), n.top = Math.min((a = n.top) !== null && a !== void 0 ? a : 1 / 0, l.top), n.right = Math.max((u = n.right) !== null && u !== void 0 ? u : -1 / 0, l.right), n.bottom = Math.max((s = n.bottom) !== null && s !== void 0 ? s : -1 / 0, l.bottom);
    }
  }), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
}
var G = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function sn() {
  var o = [], e;
  return {
    captureAnimationState: function() {
      if (o = [], !!this.options.animation) {
        var n = [].slice.call(this.el.children);
        n.forEach(function(i) {
          if (!(m(i, "display") === "none" || i === g.ghost)) {
            o.push({
              target: i,
              rect: M(i)
            });
            var r = Z({}, o[o.length - 1].rect);
            if (i.thisAnimationDuration) {
              var a = ye(i, !0);
              a && (r.top -= a.f, r.left -= a.e);
            }
            i.fromRect = r;
          }
        });
      }
    },
    addAnimationState: function(n) {
      o.push(n);
    },
    removeAnimationState: function(n) {
      o.splice(rn(o, {
        target: n
      }), 1);
    },
    animateAll: function(n) {
      var i = this;
      if (!this.options.animation) {
        clearTimeout(e), typeof n == "function" && n();
        return;
      }
      var r = !1, a = 0;
      o.forEach(function(u) {
        var s = 0, l = u.target, p = l.fromRect, f = M(l), v = l.prevFromRect, w = l.prevToRect, y = u.rect, c = ye(l, !0);
        c && (f.top -= c.f, f.left -= c.e), l.toRect = f, l.thisAnimationDuration && Ze(v, f) && !Ze(p, f) && // Make sure animatingRect is on line between toRect & fromRect
        (y.top - f.top) / (y.left - f.left) === (p.top - f.top) / (p.left - f.left) && (s = dn(y, v, w, i.options)), Ze(f, p) || (l.prevFromRect = p, l.prevToRect = f, s || (s = i.options.animation), i.animate(l, y, f, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(l.animationResetTimer), l.animationResetTimer = setTimeout(function() {
          l.animationTime = 0, l.prevFromRect = null, l.fromRect = null, l.prevToRect = null, l.thisAnimationDuration = null;
        }, s), l.thisAnimationDuration = s);
      }), clearTimeout(e), r ? e = setTimeout(function() {
        typeof n == "function" && n();
      }, a) : typeof n == "function" && n(), o = [];
    },
    animate: function(n, i, r, a) {
      if (a) {
        m(n, "transition", ""), m(n, "transform", "");
        var u = ye(this.el), s = u && u.a, l = u && u.d, p = (i.left - r.left) / (s || 1), f = (i.top - r.top) / (l || 1);
        n.animatingX = !!p, n.animatingY = !!f, m(n, "transform", "translate3d(" + p + "px," + f + "px,0)"), this.forRepaintDummy = un(n), m(n, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), m(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
          m(n, "transition", ""), m(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
        }, a);
      }
    }
  };
}
function un(o) {
  return o.offsetWidth;
}
function dn(o, e, t, n) {
  return Math.sqrt(Math.pow(e.top - o.top, 2) + Math.pow(e.left - o.left, 2)) / Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) * n.animation;
}
var ge = [], Qe = {
  initializeByDefault: !0
}, xe = {
  mount: function(e) {
    for (var t in Qe)
      Qe.hasOwnProperty(t) && !(t in e) && (e[t] = Qe[t]);
    ge.forEach(function(n) {
      if (n.pluginName === e.pluginName)
        throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
    }), ge.push(e);
  },
  pluginEvent: function(e, t, n) {
    var i = this;
    this.eventCanceled = !1, n.cancel = function() {
      i.eventCanceled = !0;
    };
    var r = e + "Global";
    ge.forEach(function(a) {
      t[a.pluginName] && (t[a.pluginName][r] && t[a.pluginName][r](Z({
        sortable: t
      }, n)), t.options[a.pluginName] && t[a.pluginName][e] && t[a.pluginName][e](Z({
        sortable: t
      }, n)));
    });
  },
  initializePlugins: function(e, t, n, i) {
    ge.forEach(function(u) {
      var s = u.pluginName;
      if (!(!e.options[s] && !u.initializeByDefault)) {
        var l = new u(e, t, e.options);
        l.sortable = e, l.options = e.options, e[s] = l, ne(n, l.defaults);
      }
    });
    for (var r in e.options)
      if (e.options.hasOwnProperty(r)) {
        var a = this.modifyOption(e, r, e.options[r]);
        typeof a < "u" && (e.options[r] = a);
      }
  },
  getEventProperties: function(e, t) {
    var n = {};
    return ge.forEach(function(i) {
      typeof i.eventProperties == "function" && ne(n, i.eventProperties.call(t[i.pluginName], e));
    }), n;
  },
  modifyOption: function(e, t, n) {
    var i;
    return ge.forEach(function(r) {
      e[r.pluginName] && r.optionListeners && typeof r.optionListeners[t] == "function" && (i = r.optionListeners[t].call(e[r.pluginName], n));
    }), i;
  }
};
function fn(o) {
  var e = o.sortable, t = o.rootEl, n = o.name, i = o.targetEl, r = o.cloneEl, a = o.toEl, u = o.fromEl, s = o.oldIndex, l = o.newIndex, p = o.oldDraggableIndex, f = o.newDraggableIndex, v = o.originalEvent, w = o.putSortable, y = o.extraEventProperties;
  if (e = e || t && t[G], !!e) {
    var c, b = e.options, C = "on" + n.charAt(0).toUpperCase() + n.substr(1);
    window.CustomEvent && !oe && !Ne ? c = new CustomEvent(n, {
      bubbles: !0,
      cancelable: !0
    }) : (c = document.createEvent("Event"), c.initEvent(n, !0, !0)), c.to = a || t, c.from = u || t, c.item = i || t, c.clone = r, c.oldIndex = s, c.newIndex = l, c.oldDraggableIndex = p, c.newDraggableIndex = f, c.originalEvent = v, c.pullMode = w ? w.lastPutMode : void 0;
    var O = Z(Z({}, y), xe.getEventProperties(n, e));
    for (var $ in O)
      c[$] = O[$];
    t && t.dispatchEvent(c), b[C] && b[C].call(e, c);
  }
}
var cn = ["evt"], Y = function(e, t) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = tn(n, cn);
  xe.pluginEvent.bind(g)(e, t, Z({
    dragEl: d,
    parentEl: P,
    ghostEl: _,
    rootEl: T,
    nextEl: me,
    lastDownEl: Ve,
    cloneEl: I,
    cloneHidden: le,
    dragStarted: Se,
    putSortable: F,
    activeSortable: g.active,
    originalEvent: i,
    oldIndex: _e,
    oldDraggableIndex: Ae,
    newIndex: j,
    newDraggableIndex: ae,
    hideGhostForTarget: Vt,
    unhideGhostForTarget: Ht,
    cloneNowHidden: function() {
      le = !0;
    },
    cloneNowShown: function() {
      le = !1;
    },
    dispatchSortableEvent: function(u) {
      X({
        sortable: t,
        name: u,
        originalEvent: i
      });
    }
  }, r));
};
function X(o) {
  fn(Z({
    putSortable: F,
    cloneEl: I,
    targetEl: d,
    rootEl: T,
    oldIndex: _e,
    oldDraggableIndex: Ae,
    newIndex: j,
    newDraggableIndex: ae
  }, o));
}
var d, P, _, T, me, Ve, I, le, _e, j, Ae, ae, Fe, F, be = !1, ze = !1, Le = [], pe, U, Je, et, Dt, St, Se, ve, Pe, ke = !1, Re = !1, He, R, tt = [], lt = !1, Ue = [], Ke = typeof document < "u", Be = Pt, Ct = Ne || oe ? "cssFloat" : "float", pn = Ke && !kt && !Pt && "draggable" in document.createElement("div"), Bt = function() {
  if (Ke) {
    if (oe)
      return !1;
    var o = document.createElement("x");
    return o.style.cssText = "pointer-events:auto", o.style.pointerEvents === "auto";
  }
}(), Xt = function(e, t) {
  var n = m(e), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = Ee(e, 0, t), a = Ee(e, 1, t), u = r && m(r), s = a && m(a), l = u && parseInt(u.marginLeft) + parseInt(u.marginRight) + M(r).width, p = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + M(a).width;
  if (n.display === "flex")
    return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
  if (n.display === "grid")
    return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
  if (r && u.float && u.float !== "none") {
    var f = u.float === "left" ? "left" : "right";
    return a && (s.clear === "both" || s.clear === f) ? "vertical" : "horizontal";
  }
  return r && (u.display === "block" || u.display === "flex" || u.display === "table" || u.display === "grid" || l >= i && n[Ct] === "none" || a && n[Ct] === "none" && l + p > i) ? "vertical" : "horizontal";
}, hn = function(e, t, n) {
  var i = n ? e.left : e.top, r = n ? e.right : e.bottom, a = n ? e.width : e.height, u = n ? t.left : t.top, s = n ? t.right : t.bottom, l = n ? t.width : t.height;
  return i === u || r === s || i + a / 2 === u + l / 2;
}, mn = function(e, t) {
  var n;
  return Le.some(function(i) {
    var r = i[G].options.emptyInsertThreshold;
    if (!(!r || pt(i))) {
      var a = M(i), u = e >= a.left - r && e <= a.right + r, s = t >= a.top - r && t <= a.bottom + r;
      if (u && s)
        return n = i;
    }
  }), n;
}, Yt = function(e) {
  function t(r, a) {
    return function(u, s, l, p) {
      var f = u.options.group.name && s.options.group.name && u.options.group.name === s.options.group.name;
      if (r == null && (a || f))
        return !0;
      if (r == null || r === !1)
        return !1;
      if (a && r === "clone")
        return r;
      if (typeof r == "function")
        return t(r(u, s, l, p), a)(u, s, l, p);
      var v = (a ? u : s).options.group.name;
      return r === !0 || typeof r == "string" && r === v || r.join && r.indexOf(v) > -1;
    };
  }
  var n = {}, i = e.group;
  (!i || Ye(i) != "object") && (i = {
    name: i
  }), n.name = i.name, n.checkPull = t(i.pull, !0), n.checkPut = t(i.put), n.revertClone = i.revertClone, e.group = n;
}, Vt = function() {
  !Bt && _ && m(_, "display", "none");
}, Ht = function() {
  !Bt && _ && m(_, "display", "");
};
Ke && !kt && document.addEventListener("click", function(o) {
  if (ze)
    return o.preventDefault(), o.stopPropagation && o.stopPropagation(), o.stopImmediatePropagation && o.stopImmediatePropagation(), ze = !1, !1;
}, !0);
var he = function(e) {
  if (d) {
    e = e.touches ? e.touches[0] : e;
    var t = mn(e.clientX, e.clientY);
    if (t) {
      var n = {};
      for (var i in e)
        e.hasOwnProperty(i) && (n[i] = e[i]);
      n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[G]._onDragOver(n);
    }
  }
}, gn = function(e) {
  d && d.parentNode[G]._isOutsideThisEl(e.target);
};
function g(o, e) {
  if (!(o && o.nodeType && o.nodeType === 1))
    throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));
  this.el = o, this.options = e = ne({}, e), o[G] = this;
  var t = {
    group: null,
    sort: !0,
    disabled: !1,
    store: null,
    handle: null,
    draggable: /^[uo]l$/i.test(o.nodeName) ? ">li" : ">*",
    swapThreshold: 1,
    // percentage; 0 <= x <= 1
    invertSwap: !1,
    // invert always
    invertedSwapThreshold: null,
    // will be set to same as swapThreshold if default
    removeCloneOnHide: !0,
    direction: function() {
      return Xt(o, this.options);
    },
    ghostClass: "sortable-ghost",
    chosenClass: "sortable-chosen",
    dragClass: "sortable-drag",
    ignore: "a, img",
    filter: null,
    preventOnFilter: !0,
    animation: 0,
    easing: null,
    setData: function(a, u) {
      a.setData("Text", u.textContent);
    },
    dropBubble: !1,
    dragoverBubble: !1,
    dataIdAttr: "data-id",
    delay: 0,
    delayOnTouchOnly: !1,
    touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
    forceFallback: !1,
    fallbackClass: "sortable-fallback",
    fallbackOnBody: !1,
    fallbackTolerance: 0,
    fallbackOffset: {
      x: 0,
      y: 0
    },
    supportPointer: g.supportPointer !== !1 && "PointerEvent" in window && !Ie,
    emptyInsertThreshold: 5
  };
  xe.initializePlugins(this, o, t);
  for (var n in t)
    !(n in e) && (e[n] = t[n]);
  Yt(e);
  for (var i in this)
    i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
  this.nativeDraggable = e.forceFallback ? !1 : pn, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? S(o, "pointerdown", this._onTapStart) : (S(o, "mousedown", this._onTapStart), S(o, "touchstart", this._onTapStart)), this.nativeDraggable && (S(o, "dragover", this), S(o, "dragenter", this)), Le.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), ne(this, sn());
}
g.prototype = /** @lends Sortable.prototype */
{
  constructor: g,
  _isOutsideThisEl: function(e) {
    !this.el.contains(e) && e !== this.el && (ve = null);
  },
  _getDirection: function(e, t) {
    return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, d) : this.options.direction;
  },
  _onTapStart: function(e) {
    if (e.cancelable) {
      var t = this, n = this.el, i = this.options, r = i.preventOnFilter, a = e.type, u = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (u || e).target, l = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, p = i.filter;
      if (Sn(n), !d && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || i.disabled) && !l.isContentEditable && !(!this.nativeDraggable && Ie && s && s.tagName.toUpperCase() === "SELECT") && (s = q(s, i.draggable, n, !1), !(s && s.animated) && Ve !== s)) {
        if (_e = L(s), Ae = L(s, i.draggable), typeof p == "function") {
          if (p.call(this, e, s, this)) {
            X({
              sortable: t,
              rootEl: l,
              name: "filter",
              targetEl: s,
              toEl: n,
              fromEl: n
            }), Y("filter", t, {
              evt: e
            }), r && e.cancelable && e.preventDefault();
            return;
          }
        } else if (p && (p = p.split(",").some(function(f) {
          if (f = q(l, f.trim(), n, !1), f)
            return X({
              sortable: t,
              rootEl: f,
              name: "filter",
              targetEl: s,
              fromEl: n,
              toEl: n
            }), Y("filter", t, {
              evt: e
            }), !0;
        }), p)) {
          r && e.cancelable && e.preventDefault();
          return;
        }
        i.handle && !q(l, i.handle, n, !1) || this._prepareDragStart(e, u, s);
      }
    }
  },
  _prepareDragStart: function(e, t, n) {
    var i = this, r = i.el, a = i.options, u = r.ownerDocument, s;
    if (n && !d && n.parentNode === r) {
      var l = M(n);
      if (T = r, d = n, P = d.parentNode, me = d.nextSibling, Ve = n, Fe = a.group, g.dragged = d, pe = {
        target: d,
        clientX: (t || e).clientX,
        clientY: (t || e).clientY
      }, Dt = pe.clientX - l.left, St = pe.clientY - l.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, d.style["will-change"] = "all", s = function() {
        if (Y("delayEnded", i, {
          evt: e
        }), g.eventCanceled) {
          i._onDrop();
          return;
        }
        i._disableDelayedDragEvents(), !_t && i.nativeDraggable && (d.draggable = !0), i._triggerDragStart(e, t), X({
          sortable: i,
          name: "choose",
          originalEvent: e
        }), W(d, a.chosenClass, !0);
      }, a.ignore.split(",").forEach(function(p) {
        xt(d, p.trim(), nt);
      }), S(u, "dragover", he), S(u, "mousemove", he), S(u, "touchmove", he), S(u, "mouseup", i._onDrop), S(u, "touchend", i._onDrop), S(u, "touchcancel", i._onDrop), _t && this.nativeDraggable && (this.options.touchStartThreshold = 4, d.draggable = !0), Y("delayStart", this, {
        evt: e
      }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Ne || oe))) {
        if (g.eventCanceled) {
          this._onDrop();
          return;
        }
        S(u, "mouseup", i._disableDelayedDrag), S(u, "touchend", i._disableDelayedDrag), S(u, "touchcancel", i._disableDelayedDrag), S(u, "mousemove", i._delayedDragTouchMoveHandler), S(u, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && S(u, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(s, a.delay);
      } else
        s();
    }
  },
  _delayedDragTouchMoveHandler: function(e) {
    var t = e.touches ? e.touches[0] : e;
    Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
  },
  _disableDelayedDrag: function() {
    d && nt(d), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
  },
  _disableDelayedDragEvents: function() {
    var e = this.el.ownerDocument;
    D(e, "mouseup", this._disableDelayedDrag), D(e, "touchend", this._disableDelayedDrag), D(e, "touchcancel", this._disableDelayedDrag), D(e, "mousemove", this._delayedDragTouchMoveHandler), D(e, "touchmove", this._delayedDragTouchMoveHandler), D(e, "pointermove", this._delayedDragTouchMoveHandler);
  },
  _triggerDragStart: function(e, t) {
    t = t || e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? S(document, "pointermove", this._onTouchMove) : t ? S(document, "touchmove", this._onTouchMove) : S(document, "mousemove", this._onTouchMove) : (S(d, "dragend", this), S(T, "dragstart", this._onDragStart));
    try {
      document.selection ? We(function() {
        document.selection.empty();
      }) : window.getSelection().removeAllRanges();
    } catch {
    }
  },
  _dragStarted: function(e, t) {
    if (be = !1, T && d) {
      Y("dragStarted", this, {
        evt: t
      }), this.nativeDraggable && S(document, "dragover", gn);
      var n = this.options;
      !e && W(d, n.dragClass, !1), W(d, n.ghostClass, !0), g.active = this, e && this._appendGhost(), X({
        sortable: this,
        name: "start",
        originalEvent: t
      });
    } else
      this._nulling();
  },
  _emulateDragOver: function() {
    if (U) {
      this._lastX = U.clientX, this._lastY = U.clientY, Vt();
      for (var e = document.elementFromPoint(U.clientX, U.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(U.clientX, U.clientY), e !== t); )
        t = e;
      if (d.parentNode[G]._isOutsideThisEl(e), t)
        do {
          if (t[G]) {
            var n = void 0;
            if (n = t[G]._onDragOver({
              clientX: U.clientX,
              clientY: U.clientY,
              target: e,
              rootEl: t
            }), n && !this.options.dragoverBubble)
              break;
          }
          e = t;
        } while (t = t.parentNode);
      Ht();
    }
  },
  _onTouchMove: function(e) {
    if (pe) {
      var t = this.options, n = t.fallbackTolerance, i = t.fallbackOffset, r = e.touches ? e.touches[0] : e, a = _ && ye(_, !0), u = _ && a && a.a, s = _ && a && a.d, l = Be && R && wt(R), p = (r.clientX - pe.clientX + i.x) / (u || 1) + (l ? l[0] - tt[0] : 0) / (u || 1), f = (r.clientY - pe.clientY + i.y) / (s || 1) + (l ? l[1] - tt[1] : 0) / (s || 1);
      if (!g.active && !be) {
        if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
          return;
        this._onDragStart(e, !0);
      }
      if (_) {
        a ? (a.e += p - (Je || 0), a.f += f - (et || 0)) : a = {
          a: 1,
          b: 0,
          c: 0,
          d: 1,
          e: p,
          f
        };
        var v = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
        m(_, "webkitTransform", v), m(_, "mozTransform", v), m(_, "msTransform", v), m(_, "transform", v), Je = p, et = f, U = r;
      }
      e.cancelable && e.preventDefault();
    }
  },
  _appendGhost: function() {
    if (!_) {
      var e = this.options.fallbackOnBody ? document.body : T, t = M(d, !0, Be, !0, e), n = this.options;
      if (Be) {
        for (R = e; m(R, "position") === "static" && m(R, "transform") === "none" && R !== document; )
          R = R.parentNode;
        R !== document.body && R !== document.documentElement ? (R === document && (R = K()), t.top += R.scrollTop, t.left += R.scrollLeft) : R = K(), tt = wt(R);
      }
      _ = d.cloneNode(!0), W(_, n.ghostClass, !1), W(_, n.fallbackClass, !0), W(_, n.dragClass, !0), m(_, "transition", ""), m(_, "transform", ""), m(_, "box-sizing", "border-box"), m(_, "margin", 0), m(_, "top", t.top), m(_, "left", t.left), m(_, "width", t.width), m(_, "height", t.height), m(_, "opacity", "0.8"), m(_, "position", Be ? "absolute" : "fixed"), m(_, "zIndex", "100000"), m(_, "pointerEvents", "none"), g.ghost = _, e.appendChild(_), m(_, "transform-origin", Dt / parseInt(_.style.width) * 100 + "% " + St / parseInt(_.style.height) * 100 + "%");
    }
  },
  _onDragStart: function(e, t) {
    var n = this, i = e.dataTransfer, r = n.options;
    if (Y("dragStart", this, {
      evt: e
    }), g.eventCanceled) {
      this._onDrop();
      return;
    }
    Y("setupClone", this), g.eventCanceled || (I = Ft(d), I.removeAttribute("id"), I.draggable = !1, I.style["will-change"] = "", this._hideClone(), W(I, this.options.chosenClass, !1), g.clone = I), n.cloneId = We(function() {
      Y("clone", n), !g.eventCanceled && (n.options.removeCloneOnHide || T.insertBefore(I, d), n._hideClone(), X({
        sortable: n,
        name: "clone"
      }));
    }), !t && W(d, r.dragClass, !0), t ? (ze = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (D(document, "mouseup", n._onDrop), D(document, "touchend", n._onDrop), D(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, d)), S(document, "drop", n), m(d, "transform", "translateZ(0)")), be = !0, n._dragStartId = We(n._dragStarted.bind(n, t, e)), S(document, "selectstart", n), Se = !0, Ie && m(document.body, "user-select", "none");
  },
  // Returns true - if no further action is needed (either inserted or another condition)
  _onDragOver: function(e) {
    var t = this.el, n = e.target, i, r, a, u = this.options, s = u.group, l = g.active, p = Fe === s, f = u.sort, v = F || l, w, y = this, c = !1;
    if (lt)
      return;
    function b(De, jt) {
      Y(De, y, Z({
        evt: e,
        isOwner: p,
        axis: w ? "vertical" : "horizontal",
        revert: a,
        dragRect: i,
        targetRect: r,
        canSort: f,
        fromSortable: v,
        target: n,
        completed: O,
        onMove: function(gt, Gt) {
          return Xe(T, t, d, i, gt, M(gt), e, Gt);
        },
        changed: $
      }, jt));
    }
    function C() {
      b("dragOverAnimationCapture"), y.captureAnimationState(), y !== v && v.captureAnimationState();
    }
    function O(De) {
      return b("dragOverCompleted", {
        insertion: De
      }), De && (p ? l._hideClone() : l._showClone(y), y !== v && (W(d, F ? F.options.ghostClass : l.options.ghostClass, !1), W(d, u.ghostClass, !0)), F !== y && y !== g.active ? F = y : y === g.active && F && (F = null), v === y && (y._ignoreWhileAnimating = n), y.animateAll(function() {
        b("dragOverAnimationComplete"), y._ignoreWhileAnimating = null;
      }), y !== v && (v.animateAll(), v._ignoreWhileAnimating = null)), (n === d && !d.animated || n === t && !n.animated) && (ve = null), !u.dragoverBubble && !e.rootEl && n !== document && (d.parentNode[G]._isOutsideThisEl(e.target), !De && he(e)), !u.dragoverBubble && e.stopPropagation && e.stopPropagation(), c = !0;
    }
    function $() {
      j = L(d), ae = L(d, u.draggable), X({
        sortable: y,
        name: "change",
        toEl: t,
        newIndex: j,
        newDraggableIndex: ae,
        originalEvent: e
      });
    }
    if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = q(n, u.draggable, t, !0), b("dragOver"), g.eventCanceled)
      return c;
    if (d.contains(e.target) || n.animated && n.animatingX && n.animatingY || y._ignoreWhileAnimating === n)
      return O(!1);
    if (ze = !1, l && !u.disabled && (p ? f || (a = P !== T) : F === this || (this.lastPutMode = Fe.checkPull(this, l, d, e)) && s.checkPut(this, l, d, e))) {
      if (w = this._getDirection(e, n) === "vertical", i = M(d), b("dragOverValid"), g.eventCanceled)
        return c;
      if (a)
        return P = T, C(), this._hideClone(), b("revert"), g.eventCanceled || (me ? T.insertBefore(d, me) : T.appendChild(d)), O(!0);
      var N = pt(t, u.draggable);
      if (!N || yn(e, w, this) && !N.animated) {
        if (N === d)
          return O(!1);
        if (N && t === e.target && (n = N), n && (r = M(n)), Xe(T, t, d, i, n, r, e, !!n) !== !1)
          return C(), N && N.nextSibling ? t.insertBefore(d, N.nextSibling) : t.appendChild(d), P = t, $(), O(!0);
      } else if (N && _n(e, w, this)) {
        var Q = Ee(t, 0, u, !0);
        if (Q === d)
          return O(!1);
        if (n = Q, r = M(n), Xe(T, t, d, i, n, r, e, !1) !== !1)
          return C(), t.insertBefore(d, Q), P = t, $(), O(!0);
      } else if (n.parentNode === t) {
        r = M(n);
        var z = 0, J, de = d.parentNode !== t, B = !hn(d.animated && d.toRect || i, n.animated && n.toRect || r, w), fe = w ? "top" : "left", A = Et(n, "top", "top") || Et(d, "top", "top"), ie = A ? A.scrollTop : void 0;
        ve !== n && (J = r[fe], ke = !1, Re = !B && u.invertSwap || de), z = En(e, n, r, w, B ? 1 : u.swapThreshold, u.invertedSwapThreshold == null ? u.swapThreshold : u.invertedSwapThreshold, Re, ve === n);
        var ee;
        if (z !== 0) {
          var ce = L(d);
          do
            ce -= z, ee = P.children[ce];
          while (ee && (m(ee, "display") === "none" || ee === _));
        }
        if (z === 0 || ee === n)
          return O(!1);
        ve = n, Pe = z;
        var we = n.nextElementSibling, re = !1;
        re = z === 1;
        var Me = Xe(T, t, d, i, n, r, e, re);
        if (Me !== !1)
          return (Me === 1 || Me === -1) && (re = Me === 1), lt = !0, setTimeout(bn, 30), C(), re && !we ? t.appendChild(d) : n.parentNode.insertBefore(d, re ? we : n), A && $t(A, 0, ie - A.scrollTop), P = d.parentNode, J !== void 0 && !Re && (He = Math.abs(J - M(n)[fe])), $(), O(!0);
      }
      if (t.contains(d))
        return O(!1);
    }
    return !1;
  },
  _ignoreWhileAnimating: null,
  _offMoveEvents: function() {
    D(document, "mousemove", this._onTouchMove), D(document, "touchmove", this._onTouchMove), D(document, "pointermove", this._onTouchMove), D(document, "dragover", he), D(document, "mousemove", he), D(document, "touchmove", he);
  },
  _offUpEvents: function() {
    var e = this.el.ownerDocument;
    D(e, "mouseup", this._onDrop), D(e, "touchend", this._onDrop), D(e, "pointerup", this._onDrop), D(e, "touchcancel", this._onDrop), D(document, "selectstart", this);
  },
  _onDrop: function(e) {
    var t = this.el, n = this.options;
    if (j = L(d), ae = L(d, n.draggable), Y("drop", this, {
      evt: e
    }), P = d && d.parentNode, j = L(d), ae = L(d, n.draggable), g.eventCanceled) {
      this._nulling();
      return;
    }
    be = !1, Re = !1, ke = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), st(this.cloneId), st(this._dragStartId), this.nativeDraggable && (D(document, "drop", this), D(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Ie && m(document.body, "user-select", ""), m(d, "transform", ""), e && (Se && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), _ && _.parentNode && _.parentNode.removeChild(_), (T === P || F && F.lastPutMode !== "clone") && I && I.parentNode && I.parentNode.removeChild(I), d && (this.nativeDraggable && D(d, "dragend", this), nt(d), d.style["will-change"] = "", Se && !be && W(d, F ? F.options.ghostClass : this.options.ghostClass, !1), W(d, this.options.chosenClass, !1), X({
      sortable: this,
      name: "unchoose",
      toEl: P,
      newIndex: null,
      newDraggableIndex: null,
      originalEvent: e
    }), T !== P ? (j >= 0 && (X({
      rootEl: P,
      name: "add",
      toEl: P,
      fromEl: T,
      originalEvent: e
    }), X({
      sortable: this,
      name: "remove",
      toEl: P,
      originalEvent: e
    }), X({
      rootEl: P,
      name: "sort",
      toEl: P,
      fromEl: T,
      originalEvent: e
    }), X({
      sortable: this,
      name: "sort",
      toEl: P,
      originalEvent: e
    })), F && F.save()) : j !== _e && j >= 0 && (X({
      sortable: this,
      name: "update",
      toEl: P,
      originalEvent: e
    }), X({
      sortable: this,
      name: "sort",
      toEl: P,
      originalEvent: e
    })), g.active && ((j == null || j === -1) && (j = _e, ae = Ae), X({
      sortable: this,
      name: "end",
      toEl: P,
      originalEvent: e
    }), this.save()))), this._nulling();
  },
  _nulling: function() {
    Y("nulling", this), T = d = P = _ = me = I = Ve = le = pe = U = Se = j = ae = _e = Ae = ve = Pe = F = Fe = g.dragged = g.ghost = g.clone = g.active = null, Ue.forEach(function(e) {
      e.checked = !0;
    }), Ue.length = Je = et = 0;
  },
  handleEvent: function(e) {
    switch (e.type) {
      case "drop":
      case "dragend":
        this._onDrop(e);
        break;
      case "dragenter":
      case "dragover":
        d && (this._onDragOver(e), vn(e));
        break;
      case "selectstart":
        e.preventDefault();
        break;
    }
  },
  /**
   * Serializes the item into an array of string.
   * @returns {String[]}
   */
  toArray: function() {
    for (var e = [], t, n = this.el.children, i = 0, r = n.length, a = this.options; i < r; i++)
      t = n[i], q(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || Dn(t));
    return e;
  },
  /**
   * Sorts the elements according to the array.
   * @param  {String[]}  order  order of the items
   */
  sort: function(e, t) {
    var n = {}, i = this.el;
    this.toArray().forEach(function(r, a) {
      var u = i.children[a];
      q(u, this.options.draggable, i, !1) && (n[r] = u);
    }, this), t && this.captureAnimationState(), e.forEach(function(r) {
      n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
    }), t && this.animateAll();
  },
  /**
   * Save the current sorting
   */
  save: function() {
    var e = this.options.store;
    e && e.set && e.set(this);
  },
  /**
   * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
   * @param   {HTMLElement}  el
   * @param   {String}       [selector]  default: `options.draggable`
   * @returns {HTMLElement|null}
   */
  closest: function(e, t) {
    return q(e, t || this.options.draggable, this.el, !1);
  },
  /**
   * Set/get option
   * @param   {string} name
   * @param   {*}      [value]
   * @returns {*}
   */
  option: function(e, t) {
    var n = this.options;
    if (t === void 0)
      return n[e];
    var i = xe.modifyOption(this, e, t);
    typeof i < "u" ? n[e] = i : n[e] = t, e === "group" && Yt(n);
  },
  /**
   * Destroy
   */
  destroy: function() {
    Y("destroy", this);
    var e = this.el;
    e[G] = null, D(e, "mousedown", this._onTapStart), D(e, "touchstart", this._onTapStart), D(e, "pointerdown", this._onTapStart), this.nativeDraggable && (D(e, "dragover", this), D(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(t) {
      t.removeAttribute("draggable");
    }), this._onDrop(), this._disableDelayedDragEvents(), Le.splice(Le.indexOf(this.el), 1), this.el = e = null;
  },
  _hideClone: function() {
    if (!le) {
      if (Y("hideClone", this), g.eventCanceled)
        return;
      m(I, "display", "none"), this.options.removeCloneOnHide && I.parentNode && I.parentNode.removeChild(I), le = !0;
    }
  },
  _showClone: function(e) {
    if (e.lastPutMode !== "clone") {
      this._hideClone();
      return;
    }
    if (le) {
      if (Y("showClone", this), g.eventCanceled)
        return;
      d.parentNode == T && !this.options.group.revertClone ? T.insertBefore(I, d) : me ? T.insertBefore(I, me) : T.appendChild(I), this.options.group.revertClone && this.animate(d, I), m(I, "display", ""), le = !1;
    }
  }
};
function vn(o) {
  o.dataTransfer && (o.dataTransfer.dropEffect = "move"), o.cancelable && o.preventDefault();
}
function Xe(o, e, t, n, i, r, a, u) {
  var s, l = o[G], p = l.options.onMove, f;
  return window.CustomEvent && !oe && !Ne ? s = new CustomEvent("move", {
    bubbles: !0,
    cancelable: !0
  }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = e, s.from = o, s.dragged = t, s.draggedRect = n, s.related = i || e, s.relatedRect = r || M(e), s.willInsertAfter = u, s.originalEvent = a, o.dispatchEvent(s), p && (f = p.call(l, s, a)), f;
}
function nt(o) {
  o.draggable = !1;
}
function bn() {
  lt = !1;
}
function _n(o, e, t) {
  var n = M(Ee(t.el, 0, t.options, !0)), i = Rt(t.el, t.options, _), r = 10;
  return e ? o.clientX < i.left - r || o.clientY < n.top && o.clientX < n.right : o.clientY < i.top - r || o.clientY < n.bottom && o.clientX < n.left;
}
function yn(o, e, t) {
  var n = M(pt(t.el, t.options.draggable)), i = Rt(t.el, t.options, _), r = 10;
  return e ? o.clientX > i.right + r || o.clientY > n.bottom && o.clientX > n.left : o.clientY > i.bottom + r || o.clientX > n.right && o.clientY > n.top;
}
function En(o, e, t, n, i, r, a, u) {
  var s = n ? o.clientY : o.clientX, l = n ? t.height : t.width, p = n ? t.top : t.left, f = n ? t.bottom : t.right, v = !1;
  if (!a) {
    if (u && He < l * i) {
      if (!ke && (Pe === 1 ? s > p + l * r / 2 : s < f - l * r / 2) && (ke = !0), ke)
        v = !0;
      else if (Pe === 1 ? s < p + He : s > f - He)
        return -Pe;
    } else if (s > p + l * (1 - i) / 2 && s < f - l * (1 - i) / 2)
      return wn(e);
  }
  return v = v || a, v && (s < p + l * r / 2 || s > f - l * r / 2) ? s > p + l / 2 ? 1 : -1 : 0;
}
function wn(o) {
  return L(d) < L(o) ? 1 : -1;
}
function Dn(o) {
  for (var e = o.tagName + o.className + o.src + o.href + o.textContent, t = e.length, n = 0; t--; )
    n += e.charCodeAt(t);
  return n.toString(36);
}
function Sn(o) {
  Ue.length = 0;
  for (var e = o.getElementsByTagName("input"), t = e.length; t--; ) {
    var n = e[t];
    n.checked && Ue.push(n);
  }
}
function We(o) {
  return setTimeout(o, 0);
}
function st(o) {
  return clearTimeout(o);
}
Ke && S(document, "touchmove", function(o) {
  (g.active || be) && o.cancelable && o.preventDefault();
});
g.utils = {
  on: S,
  off: D,
  css: m,
  find: xt,
  is: function(e, t) {
    return !!q(e, t, e, !1);
  },
  extend: an,
  throttle: Mt,
  closest: q,
  toggleClass: W,
  clone: Ft,
  index: L,
  nextTick: We,
  cancelNextTick: st,
  detectDirection: Xt,
  getChild: Ee
};
g.get = function(o) {
  return o[G];
};
g.mount = function() {
  for (var o = arguments.length, e = new Array(o), t = 0; t < o; t++)
    e[t] = arguments[t];
  e[0].constructor === Array && (e = e[0]), e.forEach(function(n) {
    if (!n.prototype || !n.prototype.constructor)
      throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
    n.utils && (g.utils = Z(Z({}, g.utils), n.utils)), xe.mount(n);
  });
};
g.create = function(o, e) {
  return new g(o, e);
};
g.version = nn;
var x = [], Ce, ut, dt = !1, ot, it, qe, Te;
function Cn() {
  function o() {
    this.defaults = {
      scroll: !0,
      forceAutoScrollFallback: !1,
      scrollSensitivity: 30,
      scrollSpeed: 10,
      bubbleScroll: !0
    };
    for (var e in this)
      e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
  }
  return o.prototype = {
    dragStarted: function(t) {
      var n = t.originalEvent;
      this.sortable.nativeDraggable ? S(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? S(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? S(document, "touchmove", this._handleFallbackAutoScroll) : S(document, "mousemove", this._handleFallbackAutoScroll);
    },
    dragOverCompleted: function(t) {
      var n = t.originalEvent;
      !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
    },
    drop: function() {
      this.sortable.nativeDraggable ? D(document, "dragover", this._handleAutoScroll) : (D(document, "pointermove", this._handleFallbackAutoScroll), D(document, "touchmove", this._handleFallbackAutoScroll), D(document, "mousemove", this._handleFallbackAutoScroll)), Tt(), je(), ln();
    },
    nulling: function() {
      qe = ut = Ce = dt = Te = ot = it = null, x.length = 0;
    },
    _handleFallbackAutoScroll: function(t) {
      this._handleAutoScroll(t, !0);
    },
    _handleAutoScroll: function(t, n) {
      var i = this, r = (t.touches ? t.touches[0] : t).clientX, a = (t.touches ? t.touches[0] : t).clientY, u = document.elementFromPoint(r, a);
      if (qe = t, n || this.options.forceAutoScrollFallback || Ne || oe || Ie) {
        rt(t, this.options, u, n);
        var s = ue(u, !0);
        dt && (!Te || r !== ot || a !== it) && (Te && Tt(), Te = setInterval(function() {
          var l = ue(document.elementFromPoint(r, a), !0);
          l !== s && (s = l, je()), rt(t, i.options, l, n);
        }, 10), ot = r, it = a);
      } else {
        if (!this.options.bubbleScroll || ue(u, !0) === K()) {
          je();
          return;
        }
        rt(t, this.options, ue(u, !1), !1);
      }
    }
  }, ne(o, {
    pluginName: "scroll",
    initializeByDefault: !0
  });
}
function je() {
  x.forEach(function(o) {
    clearInterval(o.pid);
  }), x = [];
}
function Tt() {
  clearInterval(Te);
}
var rt = Mt(function(o, e, t, n) {
  if (e.scroll) {
    var i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, a = e.scrollSensitivity, u = e.scrollSpeed, s = K(), l = !1, p;
    ut !== t && (ut = t, je(), Ce = e.scroll, p = e.scrollFn, Ce === !0 && (Ce = ue(t, !0)));
    var f = 0, v = Ce;
    do {
      var w = v, y = M(w), c = y.top, b = y.bottom, C = y.left, O = y.right, $ = y.width, N = y.height, Q = void 0, z = void 0, J = w.scrollWidth, de = w.scrollHeight, B = m(w), fe = w.scrollLeft, A = w.scrollTop;
      w === s ? (Q = $ < J && (B.overflowX === "auto" || B.overflowX === "scroll" || B.overflowX === "visible"), z = N < de && (B.overflowY === "auto" || B.overflowY === "scroll" || B.overflowY === "visible")) : (Q = $ < J && (B.overflowX === "auto" || B.overflowX === "scroll"), z = N < de && (B.overflowY === "auto" || B.overflowY === "scroll"));
      var ie = Q && (Math.abs(O - i) <= a && fe + $ < J) - (Math.abs(C - i) <= a && !!fe), ee = z && (Math.abs(b - r) <= a && A + N < de) - (Math.abs(c - r) <= a && !!A);
      if (!x[f])
        for (var ce = 0; ce <= f; ce++)
          x[ce] || (x[ce] = {});
      (x[f].vx != ie || x[f].vy != ee || x[f].el !== w) && (x[f].el = w, x[f].vx = ie, x[f].vy = ee, clearInterval(x[f].pid), (ie != 0 || ee != 0) && (l = !0, x[f].pid = setInterval((function() {
        n && this.layer === 0 && g.active._onTouchMove(qe);
        var we = x[this.layer].vy ? x[this.layer].vy * u : 0, re = x[this.layer].vx ? x[this.layer].vx * u : 0;
        typeof p == "function" && p.call(g.dragged.parentNode[G], re, we, o, qe, x[this.layer].el) !== "continue" || $t(x[this.layer].el, re, we);
      }).bind({
        layer: f
      }), 24))), f++;
    } while (e.bubbleScroll && v !== s && (v = ue(v, !1)));
    dt = l;
  }
}, 30), Wt = function(e) {
  var t = e.originalEvent, n = e.putSortable, i = e.dragEl, r = e.activeSortable, a = e.dispatchSortableEvent, u = e.hideGhostForTarget, s = e.unhideGhostForTarget;
  if (t) {
    var l = n || r;
    u();
    var p = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, f = document.elementFromPoint(p.clientX, p.clientY);
    s(), l && !l.el.contains(f) && (a("spill"), this.onSpill({
      dragEl: i,
      putSortable: n
    }));
  }
};
function ht() {
}
ht.prototype = {
  startIndex: null,
  dragStart: function(e) {
    var t = e.oldDraggableIndex;
    this.startIndex = t;
  },
  onSpill: function(e) {
    var t = e.dragEl, n = e.putSortable;
    this.sortable.captureAnimationState(), n && n.captureAnimationState();
    var i = Ee(this.sortable.el, this.startIndex, this.options);
    i ? this.sortable.el.insertBefore(t, i) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
  },
  drop: Wt
};
ne(ht, {
  pluginName: "revertOnSpill"
});
function mt() {
}
mt.prototype = {
  onSpill: function(e) {
    var t = e.dragEl, n = e.putSortable, i = n || this.sortable;
    i.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), i.animateAll();
  },
  drop: Wt
};
ne(mt, {
  pluginName: "removeOnSpill"
});
g.mount(new Cn());
g.mount(mt, ht);
const Tn = { class: "dialog-footer" }, In = /* @__PURE__ */ ft({
  __name: "MethodEditorDialog",
  setup(o, { expose: e }) {
    let t = -1;
    const n = se();
    function i(c, b) {
      a.value = c, u = b, r.value = !0, Lt(() => y());
    }
    const r = se(!1), a = se({});
    let u;
    const s = se();
    function l() {
      t = -1, n.value.show({}, f);
    }
    function p(c) {
      t = c.$index;
      const b = At(c.row);
      n.value.show(b, f);
    }
    const f = (c) => {
      t < 0 ? a.value.paras.push(c) : a.value.paras[t] = c;
    }, v = (c) => {
      a.value.paras.splice(c.$index, 1);
    }, w = async (c) => {
      c && await c.validate((b) => {
        b && (r.value = !1, u && u(a.value));
      });
    };
    function y() {
      document.body.ondrop = function(b) {
        b.preventDefault(), b.stopPropagation();
      };
      const c = document.querySelector(".draggable-dummy .el-table__body tbody");
      if (!c) {
        console.log("no table is found,drag and drop disabeld");
        return;
      }
      g.create(c, {
        handle: ".table-drag-handle",
        // handle's class
        animation: 150,
        onEnd({ newIndex: b, oldIndex: C }) {
          const O = a.value.paras.splice(C, 1)[0];
          a.value.paras.splice(b, 0, O);
        }
      });
    }
    return e({ show: i }), (c, b) => {
      const C = k("el-input"), O = k("el-form-item"), $ = k("el-table-column"), N = k("el-button"), Q = k("el-button-group"), z = k("el-table"), J = k("el-popover"), de = k("b-ace-editor"), B = k("el-form"), fe = k("el-dialog");
      return ct(), It(Ot, null, [
        h(fe, {
          modelValue: r.value,
          "onUpdate:modelValue": b[7] || (b[7] = (A) => r.value = A),
          title: c.$t("_.builtIn.plugin.methodEditor.dialogTitle"),
          "close-on-click-modal": !1,
          "close-on-press-escape": !1
        }, {
          footer: E(() => [
            at("span", Tn, [
              h(N, {
                onClick: b[5] || (b[5] = (A) => r.value = !1)
              }, {
                default: E(() => [
                  V(H(c.$t("_._.cancel")), 1)
                ]),
                _: 1
              }),
              h(N, {
                type: "primary",
                onClick: b[6] || (b[6] = (A) => w(s.value))
              }, {
                default: E(() => [
                  V(H(c.$t("_._.save")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: E(() => [
            h(B, {
              ref_key: "dataEditorFormRef",
              ref: s,
              model: a.value,
              "label-width": "120px"
            }, {
              default: E(() => [
                h(O, {
                  label: c.$t("_._.key"),
                  prop: "key",
                  required: ""
                }, {
                  default: E(() => [
                    h(C, {
                      modelValue: a.value.key,
                      "onUpdate:modelValue": b[0] || (b[0] = (A) => a.value.key = A)
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }, 8, ["label"]),
                h(O, {
                  label: c.$t("_._.description"),
                  prop: "description"
                }, {
                  default: E(() => [
                    h(C, {
                      modelValue: a.value.description,
                      "onUpdate:modelValue": b[1] || (b[1] = (A) => a.value.description = A)
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }, 8, ["label"]),
                h(O, {
                  label: c.$t("_.builtIn.plugin.methodEditor.parameter"),
                  prop: "paras",
                  class: "draggable-dummy"
                }, {
                  default: E(() => [
                    h(z, {
                      data: a.value.paras,
                      style: { width: "100%" },
                      "row-key": "key"
                    }, {
                      empty: E(() => [
                        h(N, {
                          type: "primary",
                          onClick: b[3] || (b[3] = (A) => l())
                        }, {
                          default: E(() => [
                            V(H(c.$t("_._.add")), 1)
                          ]),
                          _: 1
                        })
                      ]),
                      default: E(() => [
                        h($, {
                          label: c.$t("_.builtIn.plugin.methodEditor.drag")
                        }, {
                          default: E(() => [
                            h(vt, {
                              icon: "mdiDrag",
                              class: "table-drag-handle",
                              size: "2em"
                            })
                          ]),
                          _: 1
                        }, 8, ["label"]),
                        h($, {
                          prop: "key",
                          label: c.$t("_._.key")
                        }, null, 8, ["label"]),
                        h($, {
                          prop: "description",
                          label: c.$t("_._.description")
                        }, null, 8, ["label"]),
                        h($, {
                          prop: "type",
                          label: c.$t("_.builtIn.plugin.methodEditor.parameter_type")
                        }, null, 8, ["label"]),
                        h($, {
                          fixed: "right",
                          label: c.$t("_._.operation"),
                          width: "240px"
                        }, {
                          default: E((A) => [
                            h(Q, null, {
                              default: E(() => [
                                h(N, {
                                  type: "primary",
                                  onClick: b[2] || (b[2] = (ie) => l())
                                }, {
                                  default: E(() => [
                                    V(H(c.$t("_._.add")), 1)
                                  ]),
                                  _: 1
                                }),
                                h(N, {
                                  type: "success",
                                  onClick: (ie) => p(A)
                                }, {
                                  default: E(() => [
                                    V(H(c.$t("_._.edit")), 1)
                                  ]),
                                  _: 2
                                }, 1032, ["onClick"]),
                                h(N, {
                                  type: "danger",
                                  onClick: (ie) => v(A)
                                }, {
                                  default: E(() => [
                                    V(H(c.$t("_._.del")), 1)
                                  ]),
                                  _: 2
                                }, 1032, ["onClick"])
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          _: 1
                        }, 8, ["label"])
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ]),
                  _: 1
                }, 8, ["label"]),
                h(O, { prop: "code" }, {
                  label: E(() => [
                    h(J, {
                      placement: "bottom",
                      title: "How to use",
                      width: 640,
                      trigger: "click",
                      content: "this is content, this is content, this is content"
                    }, {
                      reference: E(() => [
                        at("span", null, [
                          V(H(c.$t("_.builtIn.plugin.methodEditor.code")) + " ", 1),
                          h(vt, {
                            icon: "mdiHelpCircleOutline",
                            size: "1.2em"
                          })
                        ])
                      ]),
                      default: E(() => [
                        V(" " + H(c.$t("_.builtIn.plugin.methodEditor.codePrompt")), 1)
                      ]),
                      _: 1
                    })
                  ]),
                  default: E(() => [
                    h(de, {
                      modelValue: a.value.code,
                      "onUpdate:modelValue": b[4] || (b[4] = (A) => a.value.code = A),
                      lang: "javascript",
                      width: "100%",
                      height: "40vh",
                      readonly: !1,
                      "font-size": 14
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["model"])
          ]),
          _: 1
        }, 8, ["modelValue", "title"]),
        h(Qt, {
          ref_key: "methodParaEditorDialogRef",
          ref: n
        }, null, 512)
      ], 64);
    };
  }
}), kn = /* @__PURE__ */ ft({
  __name: "index",
  setup(o) {
    const e = se();
    let t = -1;
    const n = Ut("context");
    function i() {
      t = -1, e.value.show({
        paras: [{
          key: "contextWrap",
          type: "Object"
        }],
        code: ""
      }, a);
    }
    function r(l) {
      t = l.$index;
      const p = At(l.row);
      e.value.show(p, a);
    }
    const a = (l) => {
      t < 0 ? s.value.push(l) : s.value[t] = l;
    }, u = (l) => {
      Kt.confirm(
        $e("_.builtIn.plugin.methodEditor.deletePrompt"),
        $e("_._.warning"),
        {
          confirmButtonText: $e("_._.yes"),
          cancelButtonText: $e("_._.no"),
          type: "warning"
        }
      ).then(() => {
        s.value.splice(l.$index, 1);
      });
    }, s = qt(() => n.codeManager.getCode().methods);
    return (l, p) => {
      const f = k("el-table-column"), v = k("el-button"), w = k("el-button-group"), y = k("el-table");
      return ct(), It(Ot, null, [
        h(y, {
          data: s.value,
          border: ""
        }, {
          empty: E(() => [
            h(v, {
              type: "primary",
              onClick: p[1] || (p[1] = (c) => i())
            }, {
              default: E(() => [
                V(H(l.$t("_._.add")), 1)
              ]),
              _: 1
            })
          ]),
          default: E(() => [
            h(f, {
              prop: "key",
              label: l.$t("_._.key")
            }, null, 8, ["label"]),
            h(f, {
              prop: "description",
              label: l.$t("_._.description")
            }, null, 8, ["label"]),
            h(f, {
              fixed: "right",
              label: l.$t("_._.operation"),
              width: "220px"
            }, {
              default: E((c) => [
                h(w, null, {
                  default: E(() => [
                    h(v, {
                      type: "primary",
                      onClick: p[0] || (p[0] = (b) => i())
                    }, {
                      default: E(() => [
                        V(H(l.$t("_._.add")), 1)
                      ]),
                      _: 1
                    }),
                    h(v, {
                      type: "success",
                      onClick: (b) => r(c)
                    }, {
                      default: E(() => [
                        V(H(l.$t("_._.edit")), 1)
                      ]),
                      _: 2
                    }, 1032, ["onClick"]),
                    h(v, {
                      type: "danger",
                      onClick: (b) => u(c)
                    }, {
                      default: E(() => [
                        V(H(l.$t("_._.del")), 1)
                      ]),
                      _: 2
                    }, 1032, ["onClick"])
                  ]),
                  _: 2
                }, 1024)
              ]),
              _: 1
            }, 8, ["label"])
          ]),
          _: 1
        }, 8, ["data"]),
        h(In, {
          ref_key: "methodEditorDialogRef",
          ref: e
        }, null, 512)
      ], 64);
    };
  }
});
export {
  kn as default
};
