ss-component-new 1.1.402 → 1.1.405
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-8lXzP3Oa.js → array-D9MKKQmi.js} +2 -2
- package/dist/{array-BDS3aai0.cjs → array-Pzwccs_9.cjs} +1 -1
- package/dist/index-4ajMt1uY.cjs +1 -0
- package/dist/{index-B8GIT0hN.js → index-6RWIKYOO.js} +5 -5
- package/dist/{index-BagZzu6p.js → index-B0iTrB4A.js} +10 -10
- package/dist/index-BMAdvw1I.cjs +87 -0
- package/dist/{index-hnO_NhVa.cjs → index-BOo_8sQ3.cjs} +1 -1
- package/dist/{index-piJWl5b2.js → index-BWxSbHfr.js} +1103 -960
- package/dist/{index-Brwyptk1.cjs → index-BfIcf2WC.cjs} +1 -1
- package/dist/{index-Btp0-NR_.js → index-BgyJezGf.js} +7 -7
- package/dist/{index-BpPyaNFa.cjs → index-Bk37DuoM.cjs} +1 -1
- package/dist/{index-XhgdCXZS.cjs → index-Bl2HH9gT.cjs} +1 -1
- package/dist/{index-BOvltwWF.js → index-BoC890jM.js} +1 -1
- package/dist/{index-CxjbXK-o.cjs → index-BzM7Obtl.cjs} +1 -1
- package/dist/{index-wCvQNdnW.cjs → index-C7RtEOWe.cjs} +1 -1
- package/dist/{index-IHBVKKqf.cjs → index-C8B6zx6K.cjs} +1 -1
- package/dist/{index-CjNY8OSy.cjs → index-CD0Ic-22.cjs} +1 -1
- package/dist/{index-BePsuMkH.js → index-CDoE3M7s.js} +7 -7
- package/dist/{index-B-k-BnbC.cjs → index-CLQwH__o.cjs} +2 -2
- package/dist/{index-Kky6qk6y.js → index-COFwNurc.js} +5 -5
- package/dist/{index-B-WoFTYh.cjs → index-COjzBEyA.cjs} +2 -2
- package/dist/{index-B1GoYVQa.cjs → index-CTDatDr8.cjs} +1 -1
- package/dist/{index-ByZ4KsR3.js → index-CVLvz7cG.js} +6 -6
- package/dist/{index-DWudNkib.cjs → index-CWdjG6bV.cjs} +1 -1
- package/dist/{index-CLex_4Jb.cjs → index-CYrv7tDC.cjs} +1 -1
- package/dist/{index-BuJwn_Lt.js → index-Cfal546m.js} +4 -4
- package/dist/{index-bVkzb9Sy.js → index-CkYjduSB.js} +4 -4
- package/dist/{index-DgWGY6rU.cjs → index-Cm4vLcn3.cjs} +1 -1
- package/dist/{index-JYy9zyCo.cjs → index-CmlWxc3n.cjs} +1 -1
- package/dist/{index-DhlsCYbc.js → index-Cq8j3Vl0.js} +4 -4
- package/dist/{index-BtIcDHbX.js → index-CrK6Kt7N.js} +3 -3
- package/dist/{index-DuHEQx8F.js → index-CtK1G4vA.js} +3 -3
- package/dist/{index-QXZaIo5S.js → index-CwN48ZX_.js} +2 -2
- package/dist/{index-Bx_WaJCq.cjs → index-DAyTsyUv.cjs} +1 -1
- package/dist/{index-bnboWxey.js → index-DGi6xbQn.js} +1 -1
- package/dist/{index-DO_FH8U9.js → index-DJSxeNRD.js} +9 -9
- package/dist/{index-Bn95cqrG.js → index-DLX-ONAd.js} +3 -3
- package/dist/{index-NfgOX2R7.js → index-DM1-yw58.js} +7 -7
- package/dist/{index-wBJhPYQH.cjs → index-DOPVTIEe.cjs} +1 -1
- package/dist/{index-CNgUzVdJ.cjs → index-DVgsClbe.cjs} +1 -1
- package/dist/{index-N3l4V2Ph.cjs → index-DjPhILPB.cjs} +1 -1
- package/dist/{index-Bvys-LNm.cjs → index-DlljSyZC.cjs} +1 -1
- package/dist/{index-xOU_6Fdn.js → index-DmGrvkB9.js} +4 -4
- package/dist/{index-CH2kImo6.js → index-DoB-EL-v.js} +15 -15
- package/dist/{index-BochF1HQ.js → index-DrlBLRqU.js} +5 -5
- package/dist/{index--ph08_ZR.cjs → index-DyesVjtL.cjs} +1 -1
- package/dist/{index-D0u9YecS.js → index-GOdDDqyW.js} +1 -1
- package/dist/{index-CmOyXNOv.cjs → index-HiY9Xa2x.cjs} +1 -1
- package/dist/{index-CzfpInCW.js → index-HjUuaTuo.js} +6 -6
- package/dist/{index-DyHbztYM.cjs → index-KpAXjjU4.cjs} +1 -1
- package/dist/{index-BuGupwSd.cjs → index-MZorD9Ma.cjs} +1 -1
- package/dist/{index-BUKnaSEP.js → index-S4uikzxe.js} +5 -5
- package/dist/{index-DDLQ2cxG.cjs → index-ib_WHRUh.cjs} +1 -1
- package/dist/{index-DIynIRv_.js → index-qpmvS6LG.js} +4 -4
- package/dist/{index-DV1_dtPV.js → index-swJF77zy.js} +7051 -7021
- package/dist/{index.vue_vue_type_script_setup_true_lang-Dooh20EH.js → index.vue_vue_type_script_setup_true_lang-BUHITq6H.js} +3 -3
- package/dist/{index.vue_vue_type_script_setup_true_lang-DwbA-ZQu.cjs → index.vue_vue_type_script_setup_true_lang-CNEIoL-G.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C97yuUK3.js +51941 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CB343OKX.cjs +244 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_306ecd73_lang-cVwA5q5z.js → index.vue_vue_type_style_index_0_scoped_306ecd73_lang-BVKDGx20.js} +8 -8
- package/dist/{index.vue_vue_type_style_index_0_scoped_306ecd73_lang-D8TOi-wA.cjs → index.vue_vue_type_style_index_0_scoped_306ecd73_lang-DcGxIB6I.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_7ee96c6e_lang-RGeCv8zv.cjs +1 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_7ee96c6e_lang-pl5rsLMz.js +1582 -0
- package/dist/{login-Bux_-K9J.js → login-CG1cMAKa.js} +1 -1
- package/dist/{login-zaDK0VdZ.cjs → login-CdvTfeG5.cjs} +1 -1
- package/dist/{main-BB-BJ6EV.cjs → main-CBtU-k6c.cjs} +1 -1
- package/dist/{main-28_1zDTX.js → main-D4Vhn_0J.js} +6 -6
- package/dist/{menu-CMFwisaq.js → menu-Dq1Flt_a.js} +3 -5
- package/dist/{menu-q5xpYrZn.cjs → menu-_qCM4Xsp.cjs} +3 -3
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +10 -10
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component3.cjs +1 -1
- package/dist/ss-component3.js +1 -1
- package/dist/threeModel-BFRSKK_1.cjs +1 -0
- package/dist/{threeModel-BxzKdpuZ.js → threeModel-D5YprdDT.js} +561 -688
- package/dist/{threeModel.vue_vue_type_style_index_0_scoped_28fc9fe5_lang-Crq9Zc_8.js → threeModel.vue_vue_type_style_index_0_scoped_28fc9fe5_lang-BZbdtyIF.js} +9176 -9962
- package/dist/threeModel.vue_vue_type_style_index_0_scoped_28fc9fe5_lang-Z4LR0tCC.cjs +4207 -0
- package/package.json +3 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-DRQaPnRz.cjs +0 -1
- package/dist/index-raQwXjkL.cjs +0 -74
- package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DHybSdlr.cjs +0 -15
- package/dist/index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-GgChFXxK.js +0 -3689
- package/dist/index.vue_vue_type_style_index_0_scoped_7ee96c6e_lang-2Nz71ikS.js +0 -3902
- package/dist/index.vue_vue_type_style_index_0_scoped_7ee96c6e_lang-C-d8XN4F.cjs +0 -12
- package/dist/threeModel-Cwb5sw9P.cjs +0 -1
- package/dist/threeModel.vue_vue_type_style_index_0_scoped_28fc9fe5_lang-BYm11dA-.cjs +0 -4207
|
@@ -1,3689 +0,0 @@
|
|
|
1
|
-
import { g as St, s as Or, i as Mr, u as Cr, p as Ar } from "./menu-CMFwisaq.js";
|
|
2
|
-
import { ref as Ir, computed as Nr } from "vue";
|
|
3
|
-
import { a7 as Ot, a8 as ze, o as Ba, a4 as $r, a9 as Pr, a5 as Mt, aa as ei, ab as jr, m as $i, ac as Pi, ad as Ut, a3 as kr, ae as ot, S as Ui } from "./index-BagZzu6p.js";
|
|
4
|
-
var gi = Ot(ze, "WeakMap"), Gi = Object.create, Rr = /* @__PURE__ */ function() {
|
|
5
|
-
function a() {
|
|
6
|
-
}
|
|
7
|
-
return function(e) {
|
|
8
|
-
if (!Ba(e))
|
|
9
|
-
return {};
|
|
10
|
-
if (Gi)
|
|
11
|
-
return Gi(e);
|
|
12
|
-
a.prototype = e;
|
|
13
|
-
var t = new a();
|
|
14
|
-
return a.prototype = void 0, t;
|
|
15
|
-
};
|
|
16
|
-
}(), Vi = function() {
|
|
17
|
-
try {
|
|
18
|
-
var a = Ot(Object, "defineProperty");
|
|
19
|
-
return a({}, "", {}), a;
|
|
20
|
-
} catch {
|
|
21
|
-
}
|
|
22
|
-
}();
|
|
23
|
-
function Br(a, e) {
|
|
24
|
-
for (var t = -1, i = a == null ? 0 : a.length; ++t < i && e(a[t], t, a) !== !1; )
|
|
25
|
-
;
|
|
26
|
-
return a;
|
|
27
|
-
}
|
|
28
|
-
var Lr = 9007199254740991, Yr = /^(?:0|[1-9]\d*)$/;
|
|
29
|
-
function Hr(a, e) {
|
|
30
|
-
var t = typeof a;
|
|
31
|
-
return e = e ?? Lr, !!e && (t == "number" || t != "symbol" && Yr.test(a)) && a > -1 && a % 1 == 0 && a < e;
|
|
32
|
-
}
|
|
33
|
-
function Xr(a, e, t) {
|
|
34
|
-
e == "__proto__" && Vi ? Vi(a, e, {
|
|
35
|
-
configurable: !0,
|
|
36
|
-
enumerable: !0,
|
|
37
|
-
value: t,
|
|
38
|
-
writable: !0
|
|
39
|
-
}) : a[e] = t;
|
|
40
|
-
}
|
|
41
|
-
var Fr = Object.prototype, Wr = Fr.hasOwnProperty;
|
|
42
|
-
function zr(a, e, t) {
|
|
43
|
-
var i = a[e];
|
|
44
|
-
(!(Wr.call(a, e) && $r(i, t)) || t === void 0 && !(e in a)) && Xr(a, e, t);
|
|
45
|
-
}
|
|
46
|
-
var Ur = 9007199254740991;
|
|
47
|
-
function La(a) {
|
|
48
|
-
return typeof a == "number" && a > -1 && a % 1 == 0 && a <= Ur;
|
|
49
|
-
}
|
|
50
|
-
function Gr(a) {
|
|
51
|
-
return a != null && La(a.length) && !Pr(a);
|
|
52
|
-
}
|
|
53
|
-
var Vr = Object.prototype;
|
|
54
|
-
function Ya(a) {
|
|
55
|
-
var e = a && a.constructor, t = typeof e == "function" && e.prototype || Vr;
|
|
56
|
-
return a === t;
|
|
57
|
-
}
|
|
58
|
-
function Kr(a, e) {
|
|
59
|
-
for (var t = -1, i = Array(a); ++t < a; )
|
|
60
|
-
i[t] = e(t);
|
|
61
|
-
return i;
|
|
62
|
-
}
|
|
63
|
-
var qr = "[object Arguments]";
|
|
64
|
-
function Ki(a) {
|
|
65
|
-
return Mt(a) && ei(a) == qr;
|
|
66
|
-
}
|
|
67
|
-
var Ha = Object.prototype, Zr = Ha.hasOwnProperty, Qr = Ha.propertyIsEnumerable, Jr = Ki(/* @__PURE__ */ function() {
|
|
68
|
-
return arguments;
|
|
69
|
-
}()) ? Ki : function(a) {
|
|
70
|
-
return Mt(a) && Zr.call(a, "callee") && !Qr.call(a, "callee");
|
|
71
|
-
};
|
|
72
|
-
function en() {
|
|
73
|
-
return !1;
|
|
74
|
-
}
|
|
75
|
-
var Xa = typeof exports == "object" && exports && !exports.nodeType && exports, qi = Xa && typeof module == "object" && module && !module.nodeType && module, tn = qi && qi.exports === Xa, Zi = tn ? ze.Buffer : void 0, an = Zi ? Zi.isBuffer : void 0, Fa = an || en, rn = "[object Arguments]", nn = "[object Array]", on = "[object Boolean]", sn = "[object Date]", ln = "[object Error]", cn = "[object Function]", hn = "[object Map]", un = "[object Number]", fn = "[object Object]", dn = "[object RegExp]", pn = "[object Set]", gn = "[object String]", mn = "[object WeakMap]", vn = "[object ArrayBuffer]", bn = "[object DataView]", yn = "[object Float32Array]", wn = "[object Float64Array]", Dn = "[object Int8Array]", En = "[object Int16Array]", Tn = "[object Int32Array]", Sn = "[object Uint8Array]", xn = "[object Uint8ClampedArray]", _n = "[object Uint16Array]", On = "[object Uint32Array]", z = {};
|
|
76
|
-
z[yn] = z[wn] = z[Dn] = z[En] = z[Tn] = z[Sn] = z[xn] = z[_n] = z[On] = !0;
|
|
77
|
-
z[rn] = z[nn] = z[vn] = z[on] = z[bn] = z[sn] = z[ln] = z[cn] = z[hn] = z[un] = z[fn] = z[dn] = z[pn] = z[gn] = z[mn] = !1;
|
|
78
|
-
function Mn(a) {
|
|
79
|
-
return Mt(a) && La(a.length) && !!z[ei(a)];
|
|
80
|
-
}
|
|
81
|
-
function ji(a) {
|
|
82
|
-
return function(e) {
|
|
83
|
-
return a(e);
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
var Wa = typeof exports == "object" && exports && !exports.nodeType && exports, vt = Wa && typeof module == "object" && module && !module.nodeType && module, Cn = vt && vt.exports === Wa, ai = Cn && jr.process, rt = function() {
|
|
87
|
-
try {
|
|
88
|
-
var a = vt && vt.require && vt.require("util").types;
|
|
89
|
-
return a || ai && ai.binding && ai.binding("util");
|
|
90
|
-
} catch {
|
|
91
|
-
}
|
|
92
|
-
}(), Qi = rt && rt.isTypedArray, An = Qi ? ji(Qi) : Mn, In = Object.prototype, Nn = In.hasOwnProperty;
|
|
93
|
-
function $n(a, e) {
|
|
94
|
-
var t = $i(a), i = !t && Jr(a), n = !t && !i && Fa(a), r = !t && !i && !n && An(a), o = t || i || n || r, l = o ? Kr(a.length, String) : [], c = l.length;
|
|
95
|
-
for (var s in a)
|
|
96
|
-
Nn.call(a, s) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
97
|
-
(s == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
98
|
-
n && (s == "offset" || s == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
99
|
-
r && (s == "buffer" || s == "byteLength" || s == "byteOffset") || // Skip index properties.
|
|
100
|
-
Hr(s, c))) && l.push(s);
|
|
101
|
-
return l;
|
|
102
|
-
}
|
|
103
|
-
function za(a, e) {
|
|
104
|
-
return function(t) {
|
|
105
|
-
return a(e(t));
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
var Pn = za(Object.keys, Object), jn = Object.prototype, kn = jn.hasOwnProperty;
|
|
109
|
-
function Rn(a) {
|
|
110
|
-
if (!Ya(a))
|
|
111
|
-
return Pn(a);
|
|
112
|
-
var e = [];
|
|
113
|
-
for (var t in Object(a))
|
|
114
|
-
kn.call(a, t) && t != "constructor" && e.push(t);
|
|
115
|
-
return e;
|
|
116
|
-
}
|
|
117
|
-
function Bn(a) {
|
|
118
|
-
return Gr(a) ? $n(a) : Rn(a);
|
|
119
|
-
}
|
|
120
|
-
function Ln(a, e) {
|
|
121
|
-
for (var t = -1, i = e.length, n = a.length; ++t < i; )
|
|
122
|
-
a[n + t] = e[t];
|
|
123
|
-
return a;
|
|
124
|
-
}
|
|
125
|
-
var Yn = za(Object.getPrototypeOf, Object);
|
|
126
|
-
function Hn() {
|
|
127
|
-
this.__data__ = new Pi(), this.size = 0;
|
|
128
|
-
}
|
|
129
|
-
function Xn(a) {
|
|
130
|
-
var e = this.__data__, t = e.delete(a);
|
|
131
|
-
return this.size = e.size, t;
|
|
132
|
-
}
|
|
133
|
-
function Fn(a) {
|
|
134
|
-
return this.__data__.get(a);
|
|
135
|
-
}
|
|
136
|
-
function Wn(a) {
|
|
137
|
-
return this.__data__.has(a);
|
|
138
|
-
}
|
|
139
|
-
var zn = 200;
|
|
140
|
-
function Un(a, e) {
|
|
141
|
-
var t = this.__data__;
|
|
142
|
-
if (t instanceof Pi) {
|
|
143
|
-
var i = t.__data__;
|
|
144
|
-
if (!Ut || i.length < zn - 1)
|
|
145
|
-
return i.push([a, e]), this.size = ++t.size, this;
|
|
146
|
-
t = this.__data__ = new kr(i);
|
|
147
|
-
}
|
|
148
|
-
return t.set(a, e), this.size = t.size, this;
|
|
149
|
-
}
|
|
150
|
-
function st(a) {
|
|
151
|
-
var e = this.__data__ = new Pi(a);
|
|
152
|
-
this.size = e.size;
|
|
153
|
-
}
|
|
154
|
-
st.prototype.clear = Hn;
|
|
155
|
-
st.prototype.delete = Xn;
|
|
156
|
-
st.prototype.get = Fn;
|
|
157
|
-
st.prototype.has = Wn;
|
|
158
|
-
st.prototype.set = Un;
|
|
159
|
-
var Ua = typeof exports == "object" && exports && !exports.nodeType && exports, Ji = Ua && typeof module == "object" && module && !module.nodeType && module, Gn = Ji && Ji.exports === Ua, ea = Gn ? ze.Buffer : void 0;
|
|
160
|
-
ea && ea.allocUnsafe;
|
|
161
|
-
function Vn(a, e) {
|
|
162
|
-
return a.slice();
|
|
163
|
-
}
|
|
164
|
-
function Kn(a, e) {
|
|
165
|
-
for (var t = -1, i = a == null ? 0 : a.length, n = 0, r = []; ++t < i; ) {
|
|
166
|
-
var o = a[t];
|
|
167
|
-
e(o, t, a) && (r[n++] = o);
|
|
168
|
-
}
|
|
169
|
-
return r;
|
|
170
|
-
}
|
|
171
|
-
function qn() {
|
|
172
|
-
return [];
|
|
173
|
-
}
|
|
174
|
-
var Zn = Object.prototype, Qn = Zn.propertyIsEnumerable, ta = Object.getOwnPropertySymbols, Jn = ta ? function(a) {
|
|
175
|
-
return a == null ? [] : (a = Object(a), Kn(ta(a), function(e) {
|
|
176
|
-
return Qn.call(a, e);
|
|
177
|
-
}));
|
|
178
|
-
} : qn;
|
|
179
|
-
function eo(a, e, t) {
|
|
180
|
-
var i = e(a);
|
|
181
|
-
return $i(a) ? i : Ln(i, t(a));
|
|
182
|
-
}
|
|
183
|
-
function to(a) {
|
|
184
|
-
return eo(a, Bn, Jn);
|
|
185
|
-
}
|
|
186
|
-
var mi = Ot(ze, "DataView"), vi = Ot(ze, "Promise"), bi = Ot(ze, "Set"), ia = "[object Map]", io = "[object Object]", aa = "[object Promise]", ra = "[object Set]", na = "[object WeakMap]", oa = "[object DataView]", ao = ot(mi), ro = ot(Ut), no = ot(vi), oo = ot(bi), so = ot(gi), _e = ei;
|
|
187
|
-
(mi && _e(new mi(new ArrayBuffer(1))) != oa || Ut && _e(new Ut()) != ia || vi && _e(vi.resolve()) != aa || bi && _e(new bi()) != ra || gi && _e(new gi()) != na) && (_e = function(a) {
|
|
188
|
-
var e = ei(a), t = e == io ? a.constructor : void 0, i = t ? ot(t) : "";
|
|
189
|
-
if (i)
|
|
190
|
-
switch (i) {
|
|
191
|
-
case ao:
|
|
192
|
-
return oa;
|
|
193
|
-
case ro:
|
|
194
|
-
return ia;
|
|
195
|
-
case no:
|
|
196
|
-
return aa;
|
|
197
|
-
case oo:
|
|
198
|
-
return ra;
|
|
199
|
-
case so:
|
|
200
|
-
return na;
|
|
201
|
-
}
|
|
202
|
-
return e;
|
|
203
|
-
});
|
|
204
|
-
var lo = Object.prototype, co = lo.hasOwnProperty;
|
|
205
|
-
function ho(a) {
|
|
206
|
-
var e = a.length, t = new a.constructor(e);
|
|
207
|
-
return e && typeof a[0] == "string" && co.call(a, "index") && (t.index = a.index, t.input = a.input), t;
|
|
208
|
-
}
|
|
209
|
-
var sa = ze.Uint8Array;
|
|
210
|
-
function ki(a) {
|
|
211
|
-
var e = new a.constructor(a.byteLength);
|
|
212
|
-
return new sa(e).set(new sa(a)), e;
|
|
213
|
-
}
|
|
214
|
-
function uo(a, e) {
|
|
215
|
-
var t = ki(a.buffer);
|
|
216
|
-
return new a.constructor(t, a.byteOffset, a.byteLength);
|
|
217
|
-
}
|
|
218
|
-
var fo = /\w*$/;
|
|
219
|
-
function po(a) {
|
|
220
|
-
var e = new a.constructor(a.source, fo.exec(a));
|
|
221
|
-
return e.lastIndex = a.lastIndex, e;
|
|
222
|
-
}
|
|
223
|
-
var la = Ui ? Ui.prototype : void 0, ca = la ? la.valueOf : void 0;
|
|
224
|
-
function go(a) {
|
|
225
|
-
return ca ? Object(ca.call(a)) : {};
|
|
226
|
-
}
|
|
227
|
-
function mo(a, e) {
|
|
228
|
-
var t = ki(a.buffer);
|
|
229
|
-
return new a.constructor(t, a.byteOffset, a.length);
|
|
230
|
-
}
|
|
231
|
-
var vo = "[object Boolean]", bo = "[object Date]", yo = "[object Map]", wo = "[object Number]", Do = "[object RegExp]", Eo = "[object Set]", To = "[object String]", So = "[object Symbol]", xo = "[object ArrayBuffer]", _o = "[object DataView]", Oo = "[object Float32Array]", Mo = "[object Float64Array]", Co = "[object Int8Array]", Ao = "[object Int16Array]", Io = "[object Int32Array]", No = "[object Uint8Array]", $o = "[object Uint8ClampedArray]", Po = "[object Uint16Array]", jo = "[object Uint32Array]";
|
|
232
|
-
function ko(a, e, t) {
|
|
233
|
-
var i = a.constructor;
|
|
234
|
-
switch (e) {
|
|
235
|
-
case xo:
|
|
236
|
-
return ki(a);
|
|
237
|
-
case vo:
|
|
238
|
-
case bo:
|
|
239
|
-
return new i(+a);
|
|
240
|
-
case _o:
|
|
241
|
-
return uo(a);
|
|
242
|
-
case Oo:
|
|
243
|
-
case Mo:
|
|
244
|
-
case Co:
|
|
245
|
-
case Ao:
|
|
246
|
-
case Io:
|
|
247
|
-
case No:
|
|
248
|
-
case $o:
|
|
249
|
-
case Po:
|
|
250
|
-
case jo:
|
|
251
|
-
return mo(a);
|
|
252
|
-
case yo:
|
|
253
|
-
return new i();
|
|
254
|
-
case wo:
|
|
255
|
-
case To:
|
|
256
|
-
return new i(a);
|
|
257
|
-
case Do:
|
|
258
|
-
return po(a);
|
|
259
|
-
case Eo:
|
|
260
|
-
return new i();
|
|
261
|
-
case So:
|
|
262
|
-
return go(a);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function Ro(a) {
|
|
266
|
-
return typeof a.constructor == "function" && !Ya(a) ? Rr(Yn(a)) : {};
|
|
267
|
-
}
|
|
268
|
-
var Bo = "[object Map]";
|
|
269
|
-
function Lo(a) {
|
|
270
|
-
return Mt(a) && _e(a) == Bo;
|
|
271
|
-
}
|
|
272
|
-
var ha = rt && rt.isMap, Yo = ha ? ji(ha) : Lo, Ho = "[object Set]";
|
|
273
|
-
function Xo(a) {
|
|
274
|
-
return Mt(a) && _e(a) == Ho;
|
|
275
|
-
}
|
|
276
|
-
var ua = rt && rt.isSet, Fo = ua ? ji(ua) : Xo, Ga = "[object Arguments]", Wo = "[object Array]", zo = "[object Boolean]", Uo = "[object Date]", Go = "[object Error]", Va = "[object Function]", Vo = "[object GeneratorFunction]", Ko = "[object Map]", qo = "[object Number]", Ka = "[object Object]", Zo = "[object RegExp]", Qo = "[object Set]", Jo = "[object String]", es = "[object Symbol]", ts = "[object WeakMap]", is = "[object ArrayBuffer]", as = "[object DataView]", rs = "[object Float32Array]", ns = "[object Float64Array]", os = "[object Int8Array]", ss = "[object Int16Array]", ls = "[object Int32Array]", cs = "[object Uint8Array]", hs = "[object Uint8ClampedArray]", us = "[object Uint16Array]", fs = "[object Uint32Array]", F = {};
|
|
277
|
-
F[Ga] = F[Wo] = F[is] = F[as] = F[zo] = F[Uo] = F[rs] = F[ns] = F[os] = F[ss] = F[ls] = F[Ko] = F[qo] = F[Ka] = F[Zo] = F[Qo] = F[Jo] = F[es] = F[cs] = F[hs] = F[us] = F[fs] = !0;
|
|
278
|
-
F[Go] = F[Va] = F[ts] = !1;
|
|
279
|
-
function Lt(a, e, t, i, n, r) {
|
|
280
|
-
var o;
|
|
281
|
-
if (o !== void 0)
|
|
282
|
-
return o;
|
|
283
|
-
if (!Ba(a))
|
|
284
|
-
return a;
|
|
285
|
-
var l = $i(a);
|
|
286
|
-
if (l)
|
|
287
|
-
o = ho(a);
|
|
288
|
-
else {
|
|
289
|
-
var c = _e(a), s = c == Va || c == Vo;
|
|
290
|
-
if (Fa(a))
|
|
291
|
-
return Vn(a);
|
|
292
|
-
if (c == Ka || c == Ga || s && !n)
|
|
293
|
-
o = s ? {} : Ro(a);
|
|
294
|
-
else {
|
|
295
|
-
if (!F[c])
|
|
296
|
-
return n ? a : {};
|
|
297
|
-
o = ko(a, c);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
r || (r = new st());
|
|
301
|
-
var u = r.get(a);
|
|
302
|
-
if (u)
|
|
303
|
-
return u;
|
|
304
|
-
r.set(a, o), Fo(a) ? a.forEach(function(m) {
|
|
305
|
-
o.add(Lt(m, e, t, m, a, r));
|
|
306
|
-
}) : Yo(a) && a.forEach(function(m, v) {
|
|
307
|
-
o.set(v, Lt(m, e, t, v, a, r));
|
|
308
|
-
});
|
|
309
|
-
var h = to, f = l ? void 0 : h(a);
|
|
310
|
-
return Br(f || a, function(m, v) {
|
|
311
|
-
f && (v = m, m = a[v]), zr(o, v, Lt(m, e, t, v, a, r));
|
|
312
|
-
}), o;
|
|
313
|
-
}
|
|
314
|
-
var ds = 1, ps = 4;
|
|
315
|
-
function De(a) {
|
|
316
|
-
return Lt(a, ds | ps);
|
|
317
|
-
}
|
|
318
|
-
var Ql = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
319
|
-
function gs(a) {
|
|
320
|
-
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
321
|
-
}
|
|
322
|
-
var Yt = { exports: {} }, ms = Yt.exports, fa;
|
|
323
|
-
function vs() {
|
|
324
|
-
return fa || (fa = 1, function(a, e) {
|
|
325
|
-
(function(t, i) {
|
|
326
|
-
a.exports = i();
|
|
327
|
-
})(ms, function() {
|
|
328
|
-
var t = 1e3, i = 6e4, n = 36e5, r = "millisecond", o = "second", l = "minute", c = "hour", s = "day", u = "week", h = "month", f = "quarter", m = "year", v = "date", E = "Invalid Date", M = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, B = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, I = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(w) {
|
|
329
|
-
var g = ["th", "st", "nd", "rd"], p = w % 100;
|
|
330
|
-
return "[" + w + (g[(p - 20) % 10] || g[p] || g[0]) + "]";
|
|
331
|
-
} }, N = function(w, g, p) {
|
|
332
|
-
var D = String(w);
|
|
333
|
-
return !D || D.length >= g ? w : "" + Array(g + 1 - D.length).join(p) + w;
|
|
334
|
-
}, W = { s: N, z: function(w) {
|
|
335
|
-
var g = -w.utcOffset(), p = Math.abs(g), D = Math.floor(p / 60), y = p % 60;
|
|
336
|
-
return (g <= 0 ? "+" : "-") + N(D, 2, "0") + ":" + N(y, 2, "0");
|
|
337
|
-
}, m: function w(g, p) {
|
|
338
|
-
if (g.date() < p.date()) return -w(p, g);
|
|
339
|
-
var D = 12 * (p.year() - g.year()) + (p.month() - g.month()), y = g.clone().add(D, h), S = p - y < 0, O = g.clone().add(D + (S ? -1 : 1), h);
|
|
340
|
-
return +(-(D + (p - y) / (S ? y - O : O - y)) || 0);
|
|
341
|
-
}, a: function(w) {
|
|
342
|
-
return w < 0 ? Math.ceil(w) || 0 : Math.floor(w);
|
|
343
|
-
}, p: function(w) {
|
|
344
|
-
return { M: h, y: m, w: u, d: s, D: v, h: c, m: l, s: o, ms: r, Q: f }[w] || String(w || "").toLowerCase().replace(/s$/, "");
|
|
345
|
-
}, u: function(w) {
|
|
346
|
-
return w === void 0;
|
|
347
|
-
} }, H = "en", d = {};
|
|
348
|
-
d[H] = I;
|
|
349
|
-
var A = "$isDayjsObject", Y = function(w) {
|
|
350
|
-
return w instanceof ie || !(!w || !w[A]);
|
|
351
|
-
}, L = function w(g, p, D) {
|
|
352
|
-
var y;
|
|
353
|
-
if (!g) return H;
|
|
354
|
-
if (typeof g == "string") {
|
|
355
|
-
var S = g.toLowerCase();
|
|
356
|
-
d[S] && (y = S), p && (d[S] = p, y = S);
|
|
357
|
-
var O = g.split("-");
|
|
358
|
-
if (!y && O.length > 1) return w(O[0]);
|
|
359
|
-
} else {
|
|
360
|
-
var R = g.name;
|
|
361
|
-
d[R] = g, y = R;
|
|
362
|
-
}
|
|
363
|
-
return !D && y && (H = y), y || !D && H;
|
|
364
|
-
}, k = function(w, g) {
|
|
365
|
-
if (Y(w)) return w.clone();
|
|
366
|
-
var p = typeof g == "object" ? g : {};
|
|
367
|
-
return p.date = w, p.args = arguments, new ie(p);
|
|
368
|
-
}, _ = W;
|
|
369
|
-
_.l = L, _.i = Y, _.w = function(w, g) {
|
|
370
|
-
return k(w, { locale: g.$L, utc: g.$u, x: g.$x, $offset: g.$offset });
|
|
371
|
-
};
|
|
372
|
-
var ie = function() {
|
|
373
|
-
function w(p) {
|
|
374
|
-
this.$L = L(p.locale, null, !0), this.parse(p), this.$x = this.$x || p.x || {}, this[A] = !0;
|
|
375
|
-
}
|
|
376
|
-
var g = w.prototype;
|
|
377
|
-
return g.parse = function(p) {
|
|
378
|
-
this.$d = function(D) {
|
|
379
|
-
var y = D.date, S = D.utc;
|
|
380
|
-
if (y === null) return /* @__PURE__ */ new Date(NaN);
|
|
381
|
-
if (_.u(y)) return /* @__PURE__ */ new Date();
|
|
382
|
-
if (y instanceof Date) return new Date(y);
|
|
383
|
-
if (typeof y == "string" && !/Z$/i.test(y)) {
|
|
384
|
-
var O = y.match(M);
|
|
385
|
-
if (O) {
|
|
386
|
-
var R = O[2] - 1 || 0, X = (O[7] || "0").substring(0, 3);
|
|
387
|
-
return S ? new Date(Date.UTC(O[1], R, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, X)) : new Date(O[1], R, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, X);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
return new Date(y);
|
|
391
|
-
}(p), this.init();
|
|
392
|
-
}, g.init = function() {
|
|
393
|
-
var p = this.$d;
|
|
394
|
-
this.$y = p.getFullYear(), this.$M = p.getMonth(), this.$D = p.getDate(), this.$W = p.getDay(), this.$H = p.getHours(), this.$m = p.getMinutes(), this.$s = p.getSeconds(), this.$ms = p.getMilliseconds();
|
|
395
|
-
}, g.$utils = function() {
|
|
396
|
-
return _;
|
|
397
|
-
}, g.isValid = function() {
|
|
398
|
-
return this.$d.toString() !== E;
|
|
399
|
-
}, g.isSame = function(p, D) {
|
|
400
|
-
var y = k(p);
|
|
401
|
-
return this.startOf(D) <= y && y <= this.endOf(D);
|
|
402
|
-
}, g.isAfter = function(p, D) {
|
|
403
|
-
return k(p) < this.startOf(D);
|
|
404
|
-
}, g.isBefore = function(p, D) {
|
|
405
|
-
return this.endOf(D) < k(p);
|
|
406
|
-
}, g.$g = function(p, D, y) {
|
|
407
|
-
return _.u(p) ? this[D] : this.set(y, p);
|
|
408
|
-
}, g.unix = function() {
|
|
409
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
410
|
-
}, g.valueOf = function() {
|
|
411
|
-
return this.$d.getTime();
|
|
412
|
-
}, g.startOf = function(p, D) {
|
|
413
|
-
var y = this, S = !!_.u(D) || D, O = _.p(p), R = function(Be, ce) {
|
|
414
|
-
var Ae = _.w(y.$u ? Date.UTC(y.$y, ce, Be) : new Date(y.$y, ce, Be), y);
|
|
415
|
-
return S ? Ae : Ae.endOf(s);
|
|
416
|
-
}, X = function(Be, ce) {
|
|
417
|
-
return _.w(y.toDate()[Be].apply(y.toDate("s"), (S ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ce)), y);
|
|
418
|
-
}, Q = this.$W, ae = this.$M, le = this.$D, Ue = "set" + (this.$u ? "UTC" : "");
|
|
419
|
-
switch (O) {
|
|
420
|
-
case m:
|
|
421
|
-
return S ? R(1, 0) : R(31, 11);
|
|
422
|
-
case h:
|
|
423
|
-
return S ? R(1, ae) : R(0, ae + 1);
|
|
424
|
-
case u:
|
|
425
|
-
var Re = this.$locale().weekStart || 0, lt = (Q < Re ? Q + 7 : Q) - Re;
|
|
426
|
-
return R(S ? le - lt : le + (6 - lt), ae);
|
|
427
|
-
case s:
|
|
428
|
-
case v:
|
|
429
|
-
return X(Ue + "Hours", 0);
|
|
430
|
-
case c:
|
|
431
|
-
return X(Ue + "Minutes", 1);
|
|
432
|
-
case l:
|
|
433
|
-
return X(Ue + "Seconds", 2);
|
|
434
|
-
case o:
|
|
435
|
-
return X(Ue + "Milliseconds", 3);
|
|
436
|
-
default:
|
|
437
|
-
return this.clone();
|
|
438
|
-
}
|
|
439
|
-
}, g.endOf = function(p) {
|
|
440
|
-
return this.startOf(p, !1);
|
|
441
|
-
}, g.$set = function(p, D) {
|
|
442
|
-
var y, S = _.p(p), O = "set" + (this.$u ? "UTC" : ""), R = (y = {}, y[s] = O + "Date", y[v] = O + "Date", y[h] = O + "Month", y[m] = O + "FullYear", y[c] = O + "Hours", y[l] = O + "Minutes", y[o] = O + "Seconds", y[r] = O + "Milliseconds", y)[S], X = S === s ? this.$D + (D - this.$W) : D;
|
|
443
|
-
if (S === h || S === m) {
|
|
444
|
-
var Q = this.clone().set(v, 1);
|
|
445
|
-
Q.$d[R](X), Q.init(), this.$d = Q.set(v, Math.min(this.$D, Q.daysInMonth())).$d;
|
|
446
|
-
} else R && this.$d[R](X);
|
|
447
|
-
return this.init(), this;
|
|
448
|
-
}, g.set = function(p, D) {
|
|
449
|
-
return this.clone().$set(p, D);
|
|
450
|
-
}, g.get = function(p) {
|
|
451
|
-
return this[_.p(p)]();
|
|
452
|
-
}, g.add = function(p, D) {
|
|
453
|
-
var y, S = this;
|
|
454
|
-
p = Number(p);
|
|
455
|
-
var O = _.p(D), R = function(ae) {
|
|
456
|
-
var le = k(S);
|
|
457
|
-
return _.w(le.date(le.date() + Math.round(ae * p)), S);
|
|
458
|
-
};
|
|
459
|
-
if (O === h) return this.set(h, this.$M + p);
|
|
460
|
-
if (O === m) return this.set(m, this.$y + p);
|
|
461
|
-
if (O === s) return R(1);
|
|
462
|
-
if (O === u) return R(7);
|
|
463
|
-
var X = (y = {}, y[l] = i, y[c] = n, y[o] = t, y)[O] || 1, Q = this.$d.getTime() + p * X;
|
|
464
|
-
return _.w(Q, this);
|
|
465
|
-
}, g.subtract = function(p, D) {
|
|
466
|
-
return this.add(-1 * p, D);
|
|
467
|
-
}, g.format = function(p) {
|
|
468
|
-
var D = this, y = this.$locale();
|
|
469
|
-
if (!this.isValid()) return y.invalidDate || E;
|
|
470
|
-
var S = p || "YYYY-MM-DDTHH:mm:ssZ", O = _.z(this), R = this.$H, X = this.$m, Q = this.$M, ae = y.weekdays, le = y.months, Ue = y.meridiem, Re = function(ce, Ae, ct, Nt) {
|
|
471
|
-
return ce && (ce[Ae] || ce(D, S)) || ct[Ae].slice(0, Nt);
|
|
472
|
-
}, lt = function(ce) {
|
|
473
|
-
return _.s(R % 12 || 12, ce, "0");
|
|
474
|
-
}, Be = Ue || function(ce, Ae, ct) {
|
|
475
|
-
var Nt = ce < 12 ? "AM" : "PM";
|
|
476
|
-
return ct ? Nt.toLowerCase() : Nt;
|
|
477
|
-
};
|
|
478
|
-
return S.replace(B, function(ce, Ae) {
|
|
479
|
-
return Ae || function(ct) {
|
|
480
|
-
switch (ct) {
|
|
481
|
-
case "YY":
|
|
482
|
-
return String(D.$y).slice(-2);
|
|
483
|
-
case "YYYY":
|
|
484
|
-
return _.s(D.$y, 4, "0");
|
|
485
|
-
case "M":
|
|
486
|
-
return Q + 1;
|
|
487
|
-
case "MM":
|
|
488
|
-
return _.s(Q + 1, 2, "0");
|
|
489
|
-
case "MMM":
|
|
490
|
-
return Re(y.monthsShort, Q, le, 3);
|
|
491
|
-
case "MMMM":
|
|
492
|
-
return Re(le, Q);
|
|
493
|
-
case "D":
|
|
494
|
-
return D.$D;
|
|
495
|
-
case "DD":
|
|
496
|
-
return _.s(D.$D, 2, "0");
|
|
497
|
-
case "d":
|
|
498
|
-
return String(D.$W);
|
|
499
|
-
case "dd":
|
|
500
|
-
return Re(y.weekdaysMin, D.$W, ae, 2);
|
|
501
|
-
case "ddd":
|
|
502
|
-
return Re(y.weekdaysShort, D.$W, ae, 3);
|
|
503
|
-
case "dddd":
|
|
504
|
-
return ae[D.$W];
|
|
505
|
-
case "H":
|
|
506
|
-
return String(R);
|
|
507
|
-
case "HH":
|
|
508
|
-
return _.s(R, 2, "0");
|
|
509
|
-
case "h":
|
|
510
|
-
return lt(1);
|
|
511
|
-
case "hh":
|
|
512
|
-
return lt(2);
|
|
513
|
-
case "a":
|
|
514
|
-
return Be(R, X, !0);
|
|
515
|
-
case "A":
|
|
516
|
-
return Be(R, X, !1);
|
|
517
|
-
case "m":
|
|
518
|
-
return String(X);
|
|
519
|
-
case "mm":
|
|
520
|
-
return _.s(X, 2, "0");
|
|
521
|
-
case "s":
|
|
522
|
-
return String(D.$s);
|
|
523
|
-
case "ss":
|
|
524
|
-
return _.s(D.$s, 2, "0");
|
|
525
|
-
case "SSS":
|
|
526
|
-
return _.s(D.$ms, 3, "0");
|
|
527
|
-
case "Z":
|
|
528
|
-
return O;
|
|
529
|
-
}
|
|
530
|
-
return null;
|
|
531
|
-
}(ce) || O.replace(":", "");
|
|
532
|
-
});
|
|
533
|
-
}, g.utcOffset = function() {
|
|
534
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
535
|
-
}, g.diff = function(p, D, y) {
|
|
536
|
-
var S, O = this, R = _.p(D), X = k(p), Q = (X.utcOffset() - this.utcOffset()) * i, ae = this - X, le = function() {
|
|
537
|
-
return _.m(O, X);
|
|
538
|
-
};
|
|
539
|
-
switch (R) {
|
|
540
|
-
case m:
|
|
541
|
-
S = le() / 12;
|
|
542
|
-
break;
|
|
543
|
-
case h:
|
|
544
|
-
S = le();
|
|
545
|
-
break;
|
|
546
|
-
case f:
|
|
547
|
-
S = le() / 3;
|
|
548
|
-
break;
|
|
549
|
-
case u:
|
|
550
|
-
S = (ae - Q) / 6048e5;
|
|
551
|
-
break;
|
|
552
|
-
case s:
|
|
553
|
-
S = (ae - Q) / 864e5;
|
|
554
|
-
break;
|
|
555
|
-
case c:
|
|
556
|
-
S = ae / n;
|
|
557
|
-
break;
|
|
558
|
-
case l:
|
|
559
|
-
S = ae / i;
|
|
560
|
-
break;
|
|
561
|
-
case o:
|
|
562
|
-
S = ae / t;
|
|
563
|
-
break;
|
|
564
|
-
default:
|
|
565
|
-
S = ae;
|
|
566
|
-
}
|
|
567
|
-
return y ? S : _.a(S);
|
|
568
|
-
}, g.daysInMonth = function() {
|
|
569
|
-
return this.endOf(h).$D;
|
|
570
|
-
}, g.$locale = function() {
|
|
571
|
-
return d[this.$L];
|
|
572
|
-
}, g.locale = function(p, D) {
|
|
573
|
-
if (!p) return this.$L;
|
|
574
|
-
var y = this.clone(), S = L(p, D, !0);
|
|
575
|
-
return S && (y.$L = S), y;
|
|
576
|
-
}, g.clone = function() {
|
|
577
|
-
return _.w(this.$d, this);
|
|
578
|
-
}, g.toDate = function() {
|
|
579
|
-
return new Date(this.valueOf());
|
|
580
|
-
}, g.toJSON = function() {
|
|
581
|
-
return this.isValid() ? this.toISOString() : null;
|
|
582
|
-
}, g.toISOString = function() {
|
|
583
|
-
return this.$d.toISOString();
|
|
584
|
-
}, g.toString = function() {
|
|
585
|
-
return this.$d.toUTCString();
|
|
586
|
-
}, w;
|
|
587
|
-
}(), Z = ie.prototype;
|
|
588
|
-
return k.prototype = Z, [["$ms", r], ["$s", o], ["$m", l], ["$H", c], ["$W", s], ["$M", h], ["$y", m], ["$D", v]].forEach(function(w) {
|
|
589
|
-
Z[w[1]] = function(g) {
|
|
590
|
-
return this.$g(g, w[0], w[1]);
|
|
591
|
-
};
|
|
592
|
-
}), k.extend = function(w, g) {
|
|
593
|
-
return w.$i || (w(g, ie, k), w.$i = !0), k;
|
|
594
|
-
}, k.locale = L, k.isDayjs = Y, k.unix = function(w) {
|
|
595
|
-
return k(1e3 * w);
|
|
596
|
-
}, k.en = d[H], k.Ls = d, k.p = {}, k;
|
|
597
|
-
});
|
|
598
|
-
}(Yt)), Yt.exports;
|
|
599
|
-
}
|
|
600
|
-
var bs = vs();
|
|
601
|
-
const Jl = /* @__PURE__ */ gs(bs);
|
|
602
|
-
/**!
|
|
603
|
-
* Sortable 1.15.6
|
|
604
|
-
* @author RubaXa <trash@rubaxa.org>
|
|
605
|
-
* @author owenm <owen23355@gmail.com>
|
|
606
|
-
* @license MIT
|
|
607
|
-
*/
|
|
608
|
-
function da(a, e) {
|
|
609
|
-
var t = Object.keys(a);
|
|
610
|
-
if (Object.getOwnPropertySymbols) {
|
|
611
|
-
var i = Object.getOwnPropertySymbols(a);
|
|
612
|
-
e && (i = i.filter(function(n) {
|
|
613
|
-
return Object.getOwnPropertyDescriptor(a, n).enumerable;
|
|
614
|
-
})), t.push.apply(t, i);
|
|
615
|
-
}
|
|
616
|
-
return t;
|
|
617
|
-
}
|
|
618
|
-
function Se(a) {
|
|
619
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
620
|
-
var t = arguments[e] != null ? arguments[e] : {};
|
|
621
|
-
e % 2 ? da(Object(t), !0).forEach(function(i) {
|
|
622
|
-
ys(a, i, t[i]);
|
|
623
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : da(Object(t)).forEach(function(i) {
|
|
624
|
-
Object.defineProperty(a, i, Object.getOwnPropertyDescriptor(t, i));
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
return a;
|
|
628
|
-
}
|
|
629
|
-
function Ht(a) {
|
|
630
|
-
"@babel/helpers - typeof";
|
|
631
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ht = function(e) {
|
|
632
|
-
return typeof e;
|
|
633
|
-
} : Ht = function(e) {
|
|
634
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
635
|
-
}, Ht(a);
|
|
636
|
-
}
|
|
637
|
-
function ys(a, e, t) {
|
|
638
|
-
return e in a ? Object.defineProperty(a, e, {
|
|
639
|
-
value: t,
|
|
640
|
-
enumerable: !0,
|
|
641
|
-
configurable: !0,
|
|
642
|
-
writable: !0
|
|
643
|
-
}) : a[e] = t, a;
|
|
644
|
-
}
|
|
645
|
-
function Me() {
|
|
646
|
-
return Me = Object.assign || function(a) {
|
|
647
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
648
|
-
var t = arguments[e];
|
|
649
|
-
for (var i in t)
|
|
650
|
-
Object.prototype.hasOwnProperty.call(t, i) && (a[i] = t[i]);
|
|
651
|
-
}
|
|
652
|
-
return a;
|
|
653
|
-
}, Me.apply(this, arguments);
|
|
654
|
-
}
|
|
655
|
-
function ws(a, e) {
|
|
656
|
-
if (a == null) return {};
|
|
657
|
-
var t = {}, i = Object.keys(a), n, r;
|
|
658
|
-
for (r = 0; r < i.length; r++)
|
|
659
|
-
n = i[r], !(e.indexOf(n) >= 0) && (t[n] = a[n]);
|
|
660
|
-
return t;
|
|
661
|
-
}
|
|
662
|
-
function Ds(a, e) {
|
|
663
|
-
if (a == null) return {};
|
|
664
|
-
var t = ws(a, e), i, n;
|
|
665
|
-
if (Object.getOwnPropertySymbols) {
|
|
666
|
-
var r = Object.getOwnPropertySymbols(a);
|
|
667
|
-
for (n = 0; n < r.length; n++)
|
|
668
|
-
i = r[n], !(e.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(a, i) && (t[i] = a[i]);
|
|
669
|
-
}
|
|
670
|
-
return t;
|
|
671
|
-
}
|
|
672
|
-
var Es = "1.15.6";
|
|
673
|
-
function Oe(a) {
|
|
674
|
-
if (typeof window < "u" && window.navigator)
|
|
675
|
-
return !!/* @__PURE__ */ navigator.userAgent.match(a);
|
|
676
|
-
}
|
|
677
|
-
var Ce = Oe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Ct = Oe(/Edge/i), pa = Oe(/firefox/i), bt = Oe(/safari/i) && !Oe(/chrome/i) && !Oe(/android/i), Ri = Oe(/iP(ad|od|hone)/i), qa = Oe(/chrome/i) && Oe(/android/i), Za = {
|
|
678
|
-
capture: !1,
|
|
679
|
-
passive: !1
|
|
680
|
-
};
|
|
681
|
-
function j(a, e, t) {
|
|
682
|
-
a.addEventListener(e, t, !Ce && Za);
|
|
683
|
-
}
|
|
684
|
-
function $(a, e, t) {
|
|
685
|
-
a.removeEventListener(e, t, !Ce && Za);
|
|
686
|
-
}
|
|
687
|
-
function Gt(a, e) {
|
|
688
|
-
if (e) {
|
|
689
|
-
if (e[0] === ">" && (e = e.substring(1)), a)
|
|
690
|
-
try {
|
|
691
|
-
if (a.matches)
|
|
692
|
-
return a.matches(e);
|
|
693
|
-
if (a.msMatchesSelector)
|
|
694
|
-
return a.msMatchesSelector(e);
|
|
695
|
-
if (a.webkitMatchesSelector)
|
|
696
|
-
return a.webkitMatchesSelector(e);
|
|
697
|
-
} catch {
|
|
698
|
-
return !1;
|
|
699
|
-
}
|
|
700
|
-
return !1;
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
function Qa(a) {
|
|
704
|
-
return a.host && a !== document && a.host.nodeType ? a.host : a.parentNode;
|
|
705
|
-
}
|
|
706
|
-
function we(a, e, t, i) {
|
|
707
|
-
if (a) {
|
|
708
|
-
t = t || document;
|
|
709
|
-
do {
|
|
710
|
-
if (e != null && (e[0] === ">" ? a.parentNode === t && Gt(a, e) : Gt(a, e)) || i && a === t)
|
|
711
|
-
return a;
|
|
712
|
-
if (a === t) break;
|
|
713
|
-
} while (a = Qa(a));
|
|
714
|
-
}
|
|
715
|
-
return null;
|
|
716
|
-
}
|
|
717
|
-
var ga = /\s+/g;
|
|
718
|
-
function pe(a, e, t) {
|
|
719
|
-
if (a && e)
|
|
720
|
-
if (a.classList)
|
|
721
|
-
a.classList[t ? "add" : "remove"](e);
|
|
722
|
-
else {
|
|
723
|
-
var i = (" " + a.className + " ").replace(ga, " ").replace(" " + e + " ", " ");
|
|
724
|
-
a.className = (i + (t ? " " + e : "")).replace(ga, " ");
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
function T(a, e, t) {
|
|
728
|
-
var i = a && a.style;
|
|
729
|
-
if (i) {
|
|
730
|
-
if (t === void 0)
|
|
731
|
-
return document.defaultView && document.defaultView.getComputedStyle ? t = document.defaultView.getComputedStyle(a, "") : a.currentStyle && (t = a.currentStyle), e === void 0 ? t : t[e];
|
|
732
|
-
!(e in i) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), i[e] = t + (typeof t == "string" ? "" : "px");
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
function et(a, e) {
|
|
736
|
-
var t = "";
|
|
737
|
-
if (typeof a == "string")
|
|
738
|
-
t = a;
|
|
739
|
-
else
|
|
740
|
-
do {
|
|
741
|
-
var i = T(a, "transform");
|
|
742
|
-
i && i !== "none" && (t = i + " " + t);
|
|
743
|
-
} while (!e && (a = a.parentNode));
|
|
744
|
-
var n = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
745
|
-
return n && new n(t);
|
|
746
|
-
}
|
|
747
|
-
function Ja(a, e, t) {
|
|
748
|
-
if (a) {
|
|
749
|
-
var i = a.getElementsByTagName(e), n = 0, r = i.length;
|
|
750
|
-
if (t)
|
|
751
|
-
for (; n < r; n++)
|
|
752
|
-
t(i[n], n);
|
|
753
|
-
return i;
|
|
754
|
-
}
|
|
755
|
-
return [];
|
|
756
|
-
}
|
|
757
|
-
function Ee() {
|
|
758
|
-
var a = document.scrollingElement;
|
|
759
|
-
return a || document.documentElement;
|
|
760
|
-
}
|
|
761
|
-
function ee(a, e, t, i, n) {
|
|
762
|
-
if (!(!a.getBoundingClientRect && a !== window)) {
|
|
763
|
-
var r, o, l, c, s, u, h;
|
|
764
|
-
if (a !== window && a.parentNode && a !== Ee() ? (r = a.getBoundingClientRect(), o = r.top, l = r.left, c = r.bottom, s = r.right, u = r.height, h = r.width) : (o = 0, l = 0, c = window.innerHeight, s = window.innerWidth, u = window.innerHeight, h = window.innerWidth), (e || t) && a !== window && (n = n || a.parentNode, !Ce))
|
|
765
|
-
do
|
|
766
|
-
if (n && n.getBoundingClientRect && (T(n, "transform") !== "none" || t && T(n, "position") !== "static")) {
|
|
767
|
-
var f = n.getBoundingClientRect();
|
|
768
|
-
o -= f.top + parseInt(T(n, "border-top-width")), l -= f.left + parseInt(T(n, "border-left-width")), c = o + r.height, s = l + r.width;
|
|
769
|
-
break;
|
|
770
|
-
}
|
|
771
|
-
while (n = n.parentNode);
|
|
772
|
-
if (i && a !== window) {
|
|
773
|
-
var m = et(n || a), v = m && m.a, E = m && m.d;
|
|
774
|
-
m && (o /= E, l /= v, h /= v, u /= E, c = o + u, s = l + h);
|
|
775
|
-
}
|
|
776
|
-
return {
|
|
777
|
-
top: o,
|
|
778
|
-
left: l,
|
|
779
|
-
bottom: c,
|
|
780
|
-
right: s,
|
|
781
|
-
width: h,
|
|
782
|
-
height: u
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
function ma(a, e, t) {
|
|
787
|
-
for (var i = Pe(a, !0), n = ee(a)[e]; i; ) {
|
|
788
|
-
var r = ee(i)[t], o = void 0;
|
|
789
|
-
if (o = n >= r, !o) return i;
|
|
790
|
-
if (i === Ee()) break;
|
|
791
|
-
i = Pe(i, !1);
|
|
792
|
-
}
|
|
793
|
-
return !1;
|
|
794
|
-
}
|
|
795
|
-
function nt(a, e, t, i) {
|
|
796
|
-
for (var n = 0, r = 0, o = a.children; r < o.length; ) {
|
|
797
|
-
if (o[r].style.display !== "none" && o[r] !== x.ghost && (i || o[r] !== x.dragged) && we(o[r], t.draggable, a, !1)) {
|
|
798
|
-
if (n === e)
|
|
799
|
-
return o[r];
|
|
800
|
-
n++;
|
|
801
|
-
}
|
|
802
|
-
r++;
|
|
803
|
-
}
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
function Bi(a, e) {
|
|
807
|
-
for (var t = a.lastElementChild; t && (t === x.ghost || T(t, "display") === "none" || e && !Gt(t, e)); )
|
|
808
|
-
t = t.previousElementSibling;
|
|
809
|
-
return t || null;
|
|
810
|
-
}
|
|
811
|
-
function ve(a, e) {
|
|
812
|
-
var t = 0;
|
|
813
|
-
if (!a || !a.parentNode)
|
|
814
|
-
return -1;
|
|
815
|
-
for (; a = a.previousElementSibling; )
|
|
816
|
-
a.nodeName.toUpperCase() !== "TEMPLATE" && a !== x.clone && (!e || Gt(a, e)) && t++;
|
|
817
|
-
return t;
|
|
818
|
-
}
|
|
819
|
-
function va(a) {
|
|
820
|
-
var e = 0, t = 0, i = Ee();
|
|
821
|
-
if (a)
|
|
822
|
-
do {
|
|
823
|
-
var n = et(a), r = n.a, o = n.d;
|
|
824
|
-
e += a.scrollLeft * r, t += a.scrollTop * o;
|
|
825
|
-
} while (a !== i && (a = a.parentNode));
|
|
826
|
-
return [e, t];
|
|
827
|
-
}
|
|
828
|
-
function Ts(a, e) {
|
|
829
|
-
for (var t in a)
|
|
830
|
-
if (a.hasOwnProperty(t)) {
|
|
831
|
-
for (var i in e)
|
|
832
|
-
if (e.hasOwnProperty(i) && e[i] === a[t][i]) return Number(t);
|
|
833
|
-
}
|
|
834
|
-
return -1;
|
|
835
|
-
}
|
|
836
|
-
function Pe(a, e) {
|
|
837
|
-
if (!a || !a.getBoundingClientRect) return Ee();
|
|
838
|
-
var t = a, i = !1;
|
|
839
|
-
do
|
|
840
|
-
if (t.clientWidth < t.scrollWidth || t.clientHeight < t.scrollHeight) {
|
|
841
|
-
var n = T(t);
|
|
842
|
-
if (t.clientWidth < t.scrollWidth && (n.overflowX == "auto" || n.overflowX == "scroll") || t.clientHeight < t.scrollHeight && (n.overflowY == "auto" || n.overflowY == "scroll")) {
|
|
843
|
-
if (!t.getBoundingClientRect || t === document.body) return Ee();
|
|
844
|
-
if (i || e) return t;
|
|
845
|
-
i = !0;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
while (t = t.parentNode);
|
|
849
|
-
return Ee();
|
|
850
|
-
}
|
|
851
|
-
function Ss(a, e) {
|
|
852
|
-
if (a && e)
|
|
853
|
-
for (var t in e)
|
|
854
|
-
e.hasOwnProperty(t) && (a[t] = e[t]);
|
|
855
|
-
return a;
|
|
856
|
-
}
|
|
857
|
-
function ri(a, e) {
|
|
858
|
-
return Math.round(a.top) === Math.round(e.top) && Math.round(a.left) === Math.round(e.left) && Math.round(a.height) === Math.round(e.height) && Math.round(a.width) === Math.round(e.width);
|
|
859
|
-
}
|
|
860
|
-
var yt;
|
|
861
|
-
function er(a, e) {
|
|
862
|
-
return function() {
|
|
863
|
-
if (!yt) {
|
|
864
|
-
var t = arguments, i = this;
|
|
865
|
-
t.length === 1 ? a.call(i, t[0]) : a.apply(i, t), yt = setTimeout(function() {
|
|
866
|
-
yt = void 0;
|
|
867
|
-
}, e);
|
|
868
|
-
}
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
function xs() {
|
|
872
|
-
clearTimeout(yt), yt = void 0;
|
|
873
|
-
}
|
|
874
|
-
function tr(a, e, t) {
|
|
875
|
-
a.scrollLeft += e, a.scrollTop += t;
|
|
876
|
-
}
|
|
877
|
-
function ir(a) {
|
|
878
|
-
var e = window.Polymer, t = window.jQuery || window.Zepto;
|
|
879
|
-
return e && e.dom ? e.dom(a).cloneNode(!0) : t ? t(a).clone(!0)[0] : a.cloneNode(!0);
|
|
880
|
-
}
|
|
881
|
-
function ar(a, e, t) {
|
|
882
|
-
var i = {};
|
|
883
|
-
return Array.from(a.children).forEach(function(n) {
|
|
884
|
-
var r, o, l, c;
|
|
885
|
-
if (!(!we(n, e.draggable, a, !1) || n.animated || n === t)) {
|
|
886
|
-
var s = ee(n);
|
|
887
|
-
i.left = Math.min((r = i.left) !== null && r !== void 0 ? r : 1 / 0, s.left), i.top = Math.min((o = i.top) !== null && o !== void 0 ? o : 1 / 0, s.top), i.right = Math.max((l = i.right) !== null && l !== void 0 ? l : -1 / 0, s.right), i.bottom = Math.max((c = i.bottom) !== null && c !== void 0 ? c : -1 / 0, s.bottom);
|
|
888
|
-
}
|
|
889
|
-
}), i.width = i.right - i.left, i.height = i.bottom - i.top, i.x = i.left, i.y = i.top, i;
|
|
890
|
-
}
|
|
891
|
-
var de = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
892
|
-
function _s() {
|
|
893
|
-
var a = [], e;
|
|
894
|
-
return {
|
|
895
|
-
captureAnimationState: function() {
|
|
896
|
-
if (a = [], !!this.options.animation) {
|
|
897
|
-
var i = [].slice.call(this.el.children);
|
|
898
|
-
i.forEach(function(n) {
|
|
899
|
-
if (!(T(n, "display") === "none" || n === x.ghost)) {
|
|
900
|
-
a.push({
|
|
901
|
-
target: n,
|
|
902
|
-
rect: ee(n)
|
|
903
|
-
});
|
|
904
|
-
var r = Se({}, a[a.length - 1].rect);
|
|
905
|
-
if (n.thisAnimationDuration) {
|
|
906
|
-
var o = et(n, !0);
|
|
907
|
-
o && (r.top -= o.f, r.left -= o.e);
|
|
908
|
-
}
|
|
909
|
-
n.fromRect = r;
|
|
910
|
-
}
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
},
|
|
914
|
-
addAnimationState: function(i) {
|
|
915
|
-
a.push(i);
|
|
916
|
-
},
|
|
917
|
-
removeAnimationState: function(i) {
|
|
918
|
-
a.splice(Ts(a, {
|
|
919
|
-
target: i
|
|
920
|
-
}), 1);
|
|
921
|
-
},
|
|
922
|
-
animateAll: function(i) {
|
|
923
|
-
var n = this;
|
|
924
|
-
if (!this.options.animation) {
|
|
925
|
-
clearTimeout(e), typeof i == "function" && i();
|
|
926
|
-
return;
|
|
927
|
-
}
|
|
928
|
-
var r = !1, o = 0;
|
|
929
|
-
a.forEach(function(l) {
|
|
930
|
-
var c = 0, s = l.target, u = s.fromRect, h = ee(s), f = s.prevFromRect, m = s.prevToRect, v = l.rect, E = et(s, !0);
|
|
931
|
-
E && (h.top -= E.f, h.left -= E.e), s.toRect = h, s.thisAnimationDuration && ri(f, h) && !ri(u, h) && // Make sure animatingRect is on line between toRect & fromRect
|
|
932
|
-
(v.top - h.top) / (v.left - h.left) === (u.top - h.top) / (u.left - h.left) && (c = Ms(v, f, m, n.options)), ri(h, u) || (s.prevFromRect = u, s.prevToRect = h, c || (c = n.options.animation), n.animate(s, v, h, c)), c && (r = !0, o = Math.max(o, c), clearTimeout(s.animationResetTimer), s.animationResetTimer = setTimeout(function() {
|
|
933
|
-
s.animationTime = 0, s.prevFromRect = null, s.fromRect = null, s.prevToRect = null, s.thisAnimationDuration = null;
|
|
934
|
-
}, c), s.thisAnimationDuration = c);
|
|
935
|
-
}), clearTimeout(e), r ? e = setTimeout(function() {
|
|
936
|
-
typeof i == "function" && i();
|
|
937
|
-
}, o) : typeof i == "function" && i(), a = [];
|
|
938
|
-
},
|
|
939
|
-
animate: function(i, n, r, o) {
|
|
940
|
-
if (o) {
|
|
941
|
-
T(i, "transition", ""), T(i, "transform", "");
|
|
942
|
-
var l = et(this.el), c = l && l.a, s = l && l.d, u = (n.left - r.left) / (c || 1), h = (n.top - r.top) / (s || 1);
|
|
943
|
-
i.animatingX = !!u, i.animatingY = !!h, T(i, "transform", "translate3d(" + u + "px," + h + "px,0)"), this.forRepaintDummy = Os(i), T(i, "transition", "transform " + o + "ms" + (this.options.easing ? " " + this.options.easing : "")), T(i, "transform", "translate3d(0,0,0)"), typeof i.animated == "number" && clearTimeout(i.animated), i.animated = setTimeout(function() {
|
|
944
|
-
T(i, "transition", ""), T(i, "transform", ""), i.animated = !1, i.animatingX = !1, i.animatingY = !1;
|
|
945
|
-
}, o);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
function Os(a) {
|
|
951
|
-
return a.offsetWidth;
|
|
952
|
-
}
|
|
953
|
-
function Ms(a, e, t, i) {
|
|
954
|
-
return Math.sqrt(Math.pow(e.top - a.top, 2) + Math.pow(e.left - a.left, 2)) / Math.sqrt(Math.pow(e.top - t.top, 2) + Math.pow(e.left - t.left, 2)) * i.animation;
|
|
955
|
-
}
|
|
956
|
-
var Ge = [], ni = {
|
|
957
|
-
initializeByDefault: !0
|
|
958
|
-
}, At = {
|
|
959
|
-
mount: function(e) {
|
|
960
|
-
for (var t in ni)
|
|
961
|
-
ni.hasOwnProperty(t) && !(t in e) && (e[t] = ni[t]);
|
|
962
|
-
Ge.forEach(function(i) {
|
|
963
|
-
if (i.pluginName === e.pluginName)
|
|
964
|
-
throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
|
|
965
|
-
}), Ge.push(e);
|
|
966
|
-
},
|
|
967
|
-
pluginEvent: function(e, t, i) {
|
|
968
|
-
var n = this;
|
|
969
|
-
this.eventCanceled = !1, i.cancel = function() {
|
|
970
|
-
n.eventCanceled = !0;
|
|
971
|
-
};
|
|
972
|
-
var r = e + "Global";
|
|
973
|
-
Ge.forEach(function(o) {
|
|
974
|
-
t[o.pluginName] && (t[o.pluginName][r] && t[o.pluginName][r](Se({
|
|
975
|
-
sortable: t
|
|
976
|
-
}, i)), t.options[o.pluginName] && t[o.pluginName][e] && t[o.pluginName][e](Se({
|
|
977
|
-
sortable: t
|
|
978
|
-
}, i)));
|
|
979
|
-
});
|
|
980
|
-
},
|
|
981
|
-
initializePlugins: function(e, t, i, n) {
|
|
982
|
-
Ge.forEach(function(l) {
|
|
983
|
-
var c = l.pluginName;
|
|
984
|
-
if (!(!e.options[c] && !l.initializeByDefault)) {
|
|
985
|
-
var s = new l(e, t, e.options);
|
|
986
|
-
s.sortable = e, s.options = e.options, e[c] = s, Me(i, s.defaults);
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
for (var r in e.options)
|
|
990
|
-
if (e.options.hasOwnProperty(r)) {
|
|
991
|
-
var o = this.modifyOption(e, r, e.options[r]);
|
|
992
|
-
typeof o < "u" && (e.options[r] = o);
|
|
993
|
-
}
|
|
994
|
-
},
|
|
995
|
-
getEventProperties: function(e, t) {
|
|
996
|
-
var i = {};
|
|
997
|
-
return Ge.forEach(function(n) {
|
|
998
|
-
typeof n.eventProperties == "function" && Me(i, n.eventProperties.call(t[n.pluginName], e));
|
|
999
|
-
}), i;
|
|
1000
|
-
},
|
|
1001
|
-
modifyOption: function(e, t, i) {
|
|
1002
|
-
var n;
|
|
1003
|
-
return Ge.forEach(function(r) {
|
|
1004
|
-
e[r.pluginName] && r.optionListeners && typeof r.optionListeners[t] == "function" && (n = r.optionListeners[t].call(e[r.pluginName], i));
|
|
1005
|
-
}), n;
|
|
1006
|
-
}
|
|
1007
|
-
};
|
|
1008
|
-
function Cs(a) {
|
|
1009
|
-
var e = a.sortable, t = a.rootEl, i = a.name, n = a.targetEl, r = a.cloneEl, o = a.toEl, l = a.fromEl, c = a.oldIndex, s = a.newIndex, u = a.oldDraggableIndex, h = a.newDraggableIndex, f = a.originalEvent, m = a.putSortable, v = a.extraEventProperties;
|
|
1010
|
-
if (e = e || t && t[de], !!e) {
|
|
1011
|
-
var E, M = e.options, B = "on" + i.charAt(0).toUpperCase() + i.substr(1);
|
|
1012
|
-
window.CustomEvent && !Ce && !Ct ? E = new CustomEvent(i, {
|
|
1013
|
-
bubbles: !0,
|
|
1014
|
-
cancelable: !0
|
|
1015
|
-
}) : (E = document.createEvent("Event"), E.initEvent(i, !0, !0)), E.to = o || t, E.from = l || t, E.item = n || t, E.clone = r, E.oldIndex = c, E.newIndex = s, E.oldDraggableIndex = u, E.newDraggableIndex = h, E.originalEvent = f, E.pullMode = m ? m.lastPutMode : void 0;
|
|
1016
|
-
var I = Se(Se({}, v), At.getEventProperties(i, e));
|
|
1017
|
-
for (var N in I)
|
|
1018
|
-
E[N] = I[N];
|
|
1019
|
-
t && t.dispatchEvent(E), M[B] && M[B].call(e, E);
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
var As = ["evt"], he = function(e, t) {
|
|
1023
|
-
var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = i.evt, r = Ds(i, As);
|
|
1024
|
-
At.pluginEvent.bind(x)(e, t, Se({
|
|
1025
|
-
dragEl: b,
|
|
1026
|
-
parentEl: q,
|
|
1027
|
-
ghostEl: C,
|
|
1028
|
-
rootEl: U,
|
|
1029
|
-
nextEl: Fe,
|
|
1030
|
-
lastDownEl: Xt,
|
|
1031
|
-
cloneEl: K,
|
|
1032
|
-
cloneHidden: $e,
|
|
1033
|
-
dragStarted: pt,
|
|
1034
|
-
putSortable: ne,
|
|
1035
|
-
activeSortable: x.active,
|
|
1036
|
-
originalEvent: n,
|
|
1037
|
-
oldIndex: Ze,
|
|
1038
|
-
oldDraggableIndex: wt,
|
|
1039
|
-
newIndex: ge,
|
|
1040
|
-
newDraggableIndex: Ne,
|
|
1041
|
-
hideGhostForTarget: sr,
|
|
1042
|
-
unhideGhostForTarget: lr,
|
|
1043
|
-
cloneNowHidden: function() {
|
|
1044
|
-
$e = !0;
|
|
1045
|
-
},
|
|
1046
|
-
cloneNowShown: function() {
|
|
1047
|
-
$e = !1;
|
|
1048
|
-
},
|
|
1049
|
-
dispatchSortableEvent: function(l) {
|
|
1050
|
-
se({
|
|
1051
|
-
sortable: t,
|
|
1052
|
-
name: l,
|
|
1053
|
-
originalEvent: n
|
|
1054
|
-
});
|
|
1055
|
-
}
|
|
1056
|
-
}, r));
|
|
1057
|
-
};
|
|
1058
|
-
function se(a) {
|
|
1059
|
-
Cs(Se({
|
|
1060
|
-
putSortable: ne,
|
|
1061
|
-
cloneEl: K,
|
|
1062
|
-
targetEl: b,
|
|
1063
|
-
rootEl: U,
|
|
1064
|
-
oldIndex: Ze,
|
|
1065
|
-
oldDraggableIndex: wt,
|
|
1066
|
-
newIndex: ge,
|
|
1067
|
-
newDraggableIndex: Ne
|
|
1068
|
-
}, a));
|
|
1069
|
-
}
|
|
1070
|
-
var b, q, C, U, Fe, Xt, K, $e, Ze, ge, wt, Ne, $t, ne, qe = !1, Vt = !1, Kt = [], Le, be, oi, si, ba, ya, pt, Ve, Dt, Et = !1, Pt = !1, Ft, oe, li = [], yi = !1, qt = [], ti = typeof document < "u", jt = Ri, wa = Ct || Ce ? "cssFloat" : "float", Is = ti && !qa && !Ri && "draggable" in document.createElement("div"), rr = function() {
|
|
1071
|
-
if (ti) {
|
|
1072
|
-
if (Ce)
|
|
1073
|
-
return !1;
|
|
1074
|
-
var a = document.createElement("x");
|
|
1075
|
-
return a.style.cssText = "pointer-events:auto", a.style.pointerEvents === "auto";
|
|
1076
|
-
}
|
|
1077
|
-
}(), nr = function(e, t) {
|
|
1078
|
-
var i = T(e), n = parseInt(i.width) - parseInt(i.paddingLeft) - parseInt(i.paddingRight) - parseInt(i.borderLeftWidth) - parseInt(i.borderRightWidth), r = nt(e, 0, t), o = nt(e, 1, t), l = r && T(r), c = o && T(o), s = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + ee(r).width, u = c && parseInt(c.marginLeft) + parseInt(c.marginRight) + ee(o).width;
|
|
1079
|
-
if (i.display === "flex")
|
|
1080
|
-
return i.flexDirection === "column" || i.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
1081
|
-
if (i.display === "grid")
|
|
1082
|
-
return i.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
1083
|
-
if (r && l.float && l.float !== "none") {
|
|
1084
|
-
var h = l.float === "left" ? "left" : "right";
|
|
1085
|
-
return o && (c.clear === "both" || c.clear === h) ? "vertical" : "horizontal";
|
|
1086
|
-
}
|
|
1087
|
-
return r && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || s >= n && i[wa] === "none" || o && i[wa] === "none" && s + u > n) ? "vertical" : "horizontal";
|
|
1088
|
-
}, Ns = function(e, t, i) {
|
|
1089
|
-
var n = i ? e.left : e.top, r = i ? e.right : e.bottom, o = i ? e.width : e.height, l = i ? t.left : t.top, c = i ? t.right : t.bottom, s = i ? t.width : t.height;
|
|
1090
|
-
return n === l || r === c || n + o / 2 === l + s / 2;
|
|
1091
|
-
}, $s = function(e, t) {
|
|
1092
|
-
var i;
|
|
1093
|
-
return Kt.some(function(n) {
|
|
1094
|
-
var r = n[de].options.emptyInsertThreshold;
|
|
1095
|
-
if (!(!r || Bi(n))) {
|
|
1096
|
-
var o = ee(n), l = e >= o.left - r && e <= o.right + r, c = t >= o.top - r && t <= o.bottom + r;
|
|
1097
|
-
if (l && c)
|
|
1098
|
-
return i = n;
|
|
1099
|
-
}
|
|
1100
|
-
}), i;
|
|
1101
|
-
}, or = function(e) {
|
|
1102
|
-
function t(r, o) {
|
|
1103
|
-
return function(l, c, s, u) {
|
|
1104
|
-
var h = l.options.group.name && c.options.group.name && l.options.group.name === c.options.group.name;
|
|
1105
|
-
if (r == null && (o || h))
|
|
1106
|
-
return !0;
|
|
1107
|
-
if (r == null || r === !1)
|
|
1108
|
-
return !1;
|
|
1109
|
-
if (o && r === "clone")
|
|
1110
|
-
return r;
|
|
1111
|
-
if (typeof r == "function")
|
|
1112
|
-
return t(r(l, c, s, u), o)(l, c, s, u);
|
|
1113
|
-
var f = (o ? l : c).options.group.name;
|
|
1114
|
-
return r === !0 || typeof r == "string" && r === f || r.join && r.indexOf(f) > -1;
|
|
1115
|
-
};
|
|
1116
|
-
}
|
|
1117
|
-
var i = {}, n = e.group;
|
|
1118
|
-
(!n || Ht(n) != "object") && (n = {
|
|
1119
|
-
name: n
|
|
1120
|
-
}), i.name = n.name, i.checkPull = t(n.pull, !0), i.checkPut = t(n.put), i.revertClone = n.revertClone, e.group = i;
|
|
1121
|
-
}, sr = function() {
|
|
1122
|
-
!rr && C && T(C, "display", "none");
|
|
1123
|
-
}, lr = function() {
|
|
1124
|
-
!rr && C && T(C, "display", "");
|
|
1125
|
-
};
|
|
1126
|
-
ti && !qa && document.addEventListener("click", function(a) {
|
|
1127
|
-
if (Vt)
|
|
1128
|
-
return a.preventDefault(), a.stopPropagation && a.stopPropagation(), a.stopImmediatePropagation && a.stopImmediatePropagation(), Vt = !1, !1;
|
|
1129
|
-
}, !0);
|
|
1130
|
-
var Ye = function(e) {
|
|
1131
|
-
if (b) {
|
|
1132
|
-
e = e.touches ? e.touches[0] : e;
|
|
1133
|
-
var t = $s(e.clientX, e.clientY);
|
|
1134
|
-
if (t) {
|
|
1135
|
-
var i = {};
|
|
1136
|
-
for (var n in e)
|
|
1137
|
-
e.hasOwnProperty(n) && (i[n] = e[n]);
|
|
1138
|
-
i.target = i.rootEl = t, i.preventDefault = void 0, i.stopPropagation = void 0, t[de]._onDragOver(i);
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
}, Ps = function(e) {
|
|
1142
|
-
b && b.parentNode[de]._isOutsideThisEl(e.target);
|
|
1143
|
-
};
|
|
1144
|
-
function x(a, e) {
|
|
1145
|
-
if (!(a && a.nodeType && a.nodeType === 1))
|
|
1146
|
-
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(a));
|
|
1147
|
-
this.el = a, this.options = e = Me({}, e), a[de] = this;
|
|
1148
|
-
var t = {
|
|
1149
|
-
group: null,
|
|
1150
|
-
sort: !0,
|
|
1151
|
-
disabled: !1,
|
|
1152
|
-
store: null,
|
|
1153
|
-
handle: null,
|
|
1154
|
-
draggable: /^[uo]l$/i.test(a.nodeName) ? ">li" : ">*",
|
|
1155
|
-
swapThreshold: 1,
|
|
1156
|
-
// percentage; 0 <= x <= 1
|
|
1157
|
-
invertSwap: !1,
|
|
1158
|
-
// invert always
|
|
1159
|
-
invertedSwapThreshold: null,
|
|
1160
|
-
// will be set to same as swapThreshold if default
|
|
1161
|
-
removeCloneOnHide: !0,
|
|
1162
|
-
direction: function() {
|
|
1163
|
-
return nr(a, this.options);
|
|
1164
|
-
},
|
|
1165
|
-
ghostClass: "sortable-ghost",
|
|
1166
|
-
chosenClass: "sortable-chosen",
|
|
1167
|
-
dragClass: "sortable-drag",
|
|
1168
|
-
ignore: "a, img",
|
|
1169
|
-
filter: null,
|
|
1170
|
-
preventOnFilter: !0,
|
|
1171
|
-
animation: 0,
|
|
1172
|
-
easing: null,
|
|
1173
|
-
setData: function(o, l) {
|
|
1174
|
-
o.setData("Text", l.textContent);
|
|
1175
|
-
},
|
|
1176
|
-
dropBubble: !1,
|
|
1177
|
-
dragoverBubble: !1,
|
|
1178
|
-
dataIdAttr: "data-id",
|
|
1179
|
-
delay: 0,
|
|
1180
|
-
delayOnTouchOnly: !1,
|
|
1181
|
-
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
1182
|
-
forceFallback: !1,
|
|
1183
|
-
fallbackClass: "sortable-fallback",
|
|
1184
|
-
fallbackOnBody: !1,
|
|
1185
|
-
fallbackTolerance: 0,
|
|
1186
|
-
fallbackOffset: {
|
|
1187
|
-
x: 0,
|
|
1188
|
-
y: 0
|
|
1189
|
-
},
|
|
1190
|
-
// Disabled on Safari: #1571; Enabled on Safari IOS: #2244
|
|
1191
|
-
supportPointer: x.supportPointer !== !1 && "PointerEvent" in window && (!bt || Ri),
|
|
1192
|
-
emptyInsertThreshold: 5
|
|
1193
|
-
};
|
|
1194
|
-
At.initializePlugins(this, a, t);
|
|
1195
|
-
for (var i in t)
|
|
1196
|
-
!(i in e) && (e[i] = t[i]);
|
|
1197
|
-
or(e);
|
|
1198
|
-
for (var n in this)
|
|
1199
|
-
n.charAt(0) === "_" && typeof this[n] == "function" && (this[n] = this[n].bind(this));
|
|
1200
|
-
this.nativeDraggable = e.forceFallback ? !1 : Is, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? j(a, "pointerdown", this._onTapStart) : (j(a, "mousedown", this._onTapStart), j(a, "touchstart", this._onTapStart)), this.nativeDraggable && (j(a, "dragover", this), j(a, "dragenter", this)), Kt.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), Me(this, _s());
|
|
1201
|
-
}
|
|
1202
|
-
x.prototype = /** @lends Sortable.prototype */
|
|
1203
|
-
{
|
|
1204
|
-
constructor: x,
|
|
1205
|
-
_isOutsideThisEl: function(e) {
|
|
1206
|
-
!this.el.contains(e) && e !== this.el && (Ve = null);
|
|
1207
|
-
},
|
|
1208
|
-
_getDirection: function(e, t) {
|
|
1209
|
-
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, b) : this.options.direction;
|
|
1210
|
-
},
|
|
1211
|
-
_onTapStart: function(e) {
|
|
1212
|
-
if (e.cancelable) {
|
|
1213
|
-
var t = this, i = this.el, n = this.options, r = n.preventOnFilter, o = e.type, l = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, c = (l || e).target, s = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || c, u = n.filter;
|
|
1214
|
-
if (Xs(i), !b && !(/mousedown|pointerdown/.test(o) && e.button !== 0 || n.disabled) && !s.isContentEditable && !(!this.nativeDraggable && bt && c && c.tagName.toUpperCase() === "SELECT") && (c = we(c, n.draggable, i, !1), !(c && c.animated) && Xt !== c)) {
|
|
1215
|
-
if (Ze = ve(c), wt = ve(c, n.draggable), typeof u == "function") {
|
|
1216
|
-
if (u.call(this, e, c, this)) {
|
|
1217
|
-
se({
|
|
1218
|
-
sortable: t,
|
|
1219
|
-
rootEl: s,
|
|
1220
|
-
name: "filter",
|
|
1221
|
-
targetEl: c,
|
|
1222
|
-
toEl: i,
|
|
1223
|
-
fromEl: i
|
|
1224
|
-
}), he("filter", t, {
|
|
1225
|
-
evt: e
|
|
1226
|
-
}), r && e.preventDefault();
|
|
1227
|
-
return;
|
|
1228
|
-
}
|
|
1229
|
-
} else if (u && (u = u.split(",").some(function(h) {
|
|
1230
|
-
if (h = we(s, h.trim(), i, !1), h)
|
|
1231
|
-
return se({
|
|
1232
|
-
sortable: t,
|
|
1233
|
-
rootEl: h,
|
|
1234
|
-
name: "filter",
|
|
1235
|
-
targetEl: c,
|
|
1236
|
-
fromEl: i,
|
|
1237
|
-
toEl: i
|
|
1238
|
-
}), he("filter", t, {
|
|
1239
|
-
evt: e
|
|
1240
|
-
}), !0;
|
|
1241
|
-
}), u)) {
|
|
1242
|
-
r && e.preventDefault();
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
n.handle && !we(s, n.handle, i, !1) || this._prepareDragStart(e, l, c);
|
|
1246
|
-
}
|
|
1247
|
-
}
|
|
1248
|
-
},
|
|
1249
|
-
_prepareDragStart: function(e, t, i) {
|
|
1250
|
-
var n = this, r = n.el, o = n.options, l = r.ownerDocument, c;
|
|
1251
|
-
if (i && !b && i.parentNode === r) {
|
|
1252
|
-
var s = ee(i);
|
|
1253
|
-
if (U = r, b = i, q = b.parentNode, Fe = b.nextSibling, Xt = i, $t = o.group, x.dragged = b, Le = {
|
|
1254
|
-
target: b,
|
|
1255
|
-
clientX: (t || e).clientX,
|
|
1256
|
-
clientY: (t || e).clientY
|
|
1257
|
-
}, ba = Le.clientX - s.left, ya = Le.clientY - s.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, b.style["will-change"] = "all", c = function() {
|
|
1258
|
-
if (he("delayEnded", n, {
|
|
1259
|
-
evt: e
|
|
1260
|
-
}), x.eventCanceled) {
|
|
1261
|
-
n._onDrop();
|
|
1262
|
-
return;
|
|
1263
|
-
}
|
|
1264
|
-
n._disableDelayedDragEvents(), !pa && n.nativeDraggable && (b.draggable = !0), n._triggerDragStart(e, t), se({
|
|
1265
|
-
sortable: n,
|
|
1266
|
-
name: "choose",
|
|
1267
|
-
originalEvent: e
|
|
1268
|
-
}), pe(b, o.chosenClass, !0);
|
|
1269
|
-
}, o.ignore.split(",").forEach(function(u) {
|
|
1270
|
-
Ja(b, u.trim(), ci);
|
|
1271
|
-
}), j(l, "dragover", Ye), j(l, "mousemove", Ye), j(l, "touchmove", Ye), o.supportPointer ? (j(l, "pointerup", n._onDrop), !this.nativeDraggable && j(l, "pointercancel", n._onDrop)) : (j(l, "mouseup", n._onDrop), j(l, "touchend", n._onDrop), j(l, "touchcancel", n._onDrop)), pa && this.nativeDraggable && (this.options.touchStartThreshold = 4, b.draggable = !0), he("delayStart", this, {
|
|
1272
|
-
evt: e
|
|
1273
|
-
}), o.delay && (!o.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Ct || Ce))) {
|
|
1274
|
-
if (x.eventCanceled) {
|
|
1275
|
-
this._onDrop();
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
o.supportPointer ? (j(l, "pointerup", n._disableDelayedDrag), j(l, "pointercancel", n._disableDelayedDrag)) : (j(l, "mouseup", n._disableDelayedDrag), j(l, "touchend", n._disableDelayedDrag), j(l, "touchcancel", n._disableDelayedDrag)), j(l, "mousemove", n._delayedDragTouchMoveHandler), j(l, "touchmove", n._delayedDragTouchMoveHandler), o.supportPointer && j(l, "pointermove", n._delayedDragTouchMoveHandler), n._dragStartTimer = setTimeout(c, o.delay);
|
|
1279
|
-
} else
|
|
1280
|
-
c();
|
|
1281
|
-
}
|
|
1282
|
-
},
|
|
1283
|
-
_delayedDragTouchMoveHandler: function(e) {
|
|
1284
|
-
var t = e.touches ? e.touches[0] : e;
|
|
1285
|
-
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();
|
|
1286
|
-
},
|
|
1287
|
-
_disableDelayedDrag: function() {
|
|
1288
|
-
b && ci(b), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
1289
|
-
},
|
|
1290
|
-
_disableDelayedDragEvents: function() {
|
|
1291
|
-
var e = this.el.ownerDocument;
|
|
1292
|
-
$(e, "mouseup", this._disableDelayedDrag), $(e, "touchend", this._disableDelayedDrag), $(e, "touchcancel", this._disableDelayedDrag), $(e, "pointerup", this._disableDelayedDrag), $(e, "pointercancel", this._disableDelayedDrag), $(e, "mousemove", this._delayedDragTouchMoveHandler), $(e, "touchmove", this._delayedDragTouchMoveHandler), $(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
1293
|
-
},
|
|
1294
|
-
_triggerDragStart: function(e, t) {
|
|
1295
|
-
t = t || e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? j(document, "pointermove", this._onTouchMove) : t ? j(document, "touchmove", this._onTouchMove) : j(document, "mousemove", this._onTouchMove) : (j(b, "dragend", this), j(U, "dragstart", this._onDragStart));
|
|
1296
|
-
try {
|
|
1297
|
-
document.selection ? Wt(function() {
|
|
1298
|
-
document.selection.empty();
|
|
1299
|
-
}) : window.getSelection().removeAllRanges();
|
|
1300
|
-
} catch {
|
|
1301
|
-
}
|
|
1302
|
-
},
|
|
1303
|
-
_dragStarted: function(e, t) {
|
|
1304
|
-
if (qe = !1, U && b) {
|
|
1305
|
-
he("dragStarted", this, {
|
|
1306
|
-
evt: t
|
|
1307
|
-
}), this.nativeDraggable && j(document, "dragover", Ps);
|
|
1308
|
-
var i = this.options;
|
|
1309
|
-
!e && pe(b, i.dragClass, !1), pe(b, i.ghostClass, !0), x.active = this, e && this._appendGhost(), se({
|
|
1310
|
-
sortable: this,
|
|
1311
|
-
name: "start",
|
|
1312
|
-
originalEvent: t
|
|
1313
|
-
});
|
|
1314
|
-
} else
|
|
1315
|
-
this._nulling();
|
|
1316
|
-
},
|
|
1317
|
-
_emulateDragOver: function() {
|
|
1318
|
-
if (be) {
|
|
1319
|
-
this._lastX = be.clientX, this._lastY = be.clientY, sr();
|
|
1320
|
-
for (var e = document.elementFromPoint(be.clientX, be.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(be.clientX, be.clientY), e !== t); )
|
|
1321
|
-
t = e;
|
|
1322
|
-
if (b.parentNode[de]._isOutsideThisEl(e), t)
|
|
1323
|
-
do {
|
|
1324
|
-
if (t[de]) {
|
|
1325
|
-
var i = void 0;
|
|
1326
|
-
if (i = t[de]._onDragOver({
|
|
1327
|
-
clientX: be.clientX,
|
|
1328
|
-
clientY: be.clientY,
|
|
1329
|
-
target: e,
|
|
1330
|
-
rootEl: t
|
|
1331
|
-
}), i && !this.options.dragoverBubble)
|
|
1332
|
-
break;
|
|
1333
|
-
}
|
|
1334
|
-
e = t;
|
|
1335
|
-
} while (t = Qa(t));
|
|
1336
|
-
lr();
|
|
1337
|
-
}
|
|
1338
|
-
},
|
|
1339
|
-
_onTouchMove: function(e) {
|
|
1340
|
-
if (Le) {
|
|
1341
|
-
var t = this.options, i = t.fallbackTolerance, n = t.fallbackOffset, r = e.touches ? e.touches[0] : e, o = C && et(C, !0), l = C && o && o.a, c = C && o && o.d, s = jt && oe && va(oe), u = (r.clientX - Le.clientX + n.x) / (l || 1) + (s ? s[0] - li[0] : 0) / (l || 1), h = (r.clientY - Le.clientY + n.y) / (c || 1) + (s ? s[1] - li[1] : 0) / (c || 1);
|
|
1342
|
-
if (!x.active && !qe) {
|
|
1343
|
-
if (i && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < i)
|
|
1344
|
-
return;
|
|
1345
|
-
this._onDragStart(e, !0);
|
|
1346
|
-
}
|
|
1347
|
-
if (C) {
|
|
1348
|
-
o ? (o.e += u - (oi || 0), o.f += h - (si || 0)) : o = {
|
|
1349
|
-
a: 1,
|
|
1350
|
-
b: 0,
|
|
1351
|
-
c: 0,
|
|
1352
|
-
d: 1,
|
|
1353
|
-
e: u,
|
|
1354
|
-
f: h
|
|
1355
|
-
};
|
|
1356
|
-
var f = "matrix(".concat(o.a, ",").concat(o.b, ",").concat(o.c, ",").concat(o.d, ",").concat(o.e, ",").concat(o.f, ")");
|
|
1357
|
-
T(C, "webkitTransform", f), T(C, "mozTransform", f), T(C, "msTransform", f), T(C, "transform", f), oi = u, si = h, be = r;
|
|
1358
|
-
}
|
|
1359
|
-
e.cancelable && e.preventDefault();
|
|
1360
|
-
}
|
|
1361
|
-
},
|
|
1362
|
-
_appendGhost: function() {
|
|
1363
|
-
if (!C) {
|
|
1364
|
-
var e = this.options.fallbackOnBody ? document.body : U, t = ee(b, !0, jt, !0, e), i = this.options;
|
|
1365
|
-
if (jt) {
|
|
1366
|
-
for (oe = e; T(oe, "position") === "static" && T(oe, "transform") === "none" && oe !== document; )
|
|
1367
|
-
oe = oe.parentNode;
|
|
1368
|
-
oe !== document.body && oe !== document.documentElement ? (oe === document && (oe = Ee()), t.top += oe.scrollTop, t.left += oe.scrollLeft) : oe = Ee(), li = va(oe);
|
|
1369
|
-
}
|
|
1370
|
-
C = b.cloneNode(!0), pe(C, i.ghostClass, !1), pe(C, i.fallbackClass, !0), pe(C, i.dragClass, !0), T(C, "transition", ""), T(C, "transform", ""), T(C, "box-sizing", "border-box"), T(C, "margin", 0), T(C, "top", t.top), T(C, "left", t.left), T(C, "width", t.width), T(C, "height", t.height), T(C, "opacity", "0.8"), T(C, "position", jt ? "absolute" : "fixed"), T(C, "zIndex", "100000"), T(C, "pointerEvents", "none"), x.ghost = C, e.appendChild(C), T(C, "transform-origin", ba / parseInt(C.style.width) * 100 + "% " + ya / parseInt(C.style.height) * 100 + "%");
|
|
1371
|
-
}
|
|
1372
|
-
},
|
|
1373
|
-
_onDragStart: function(e, t) {
|
|
1374
|
-
var i = this, n = e.dataTransfer, r = i.options;
|
|
1375
|
-
if (he("dragStart", this, {
|
|
1376
|
-
evt: e
|
|
1377
|
-
}), x.eventCanceled) {
|
|
1378
|
-
this._onDrop();
|
|
1379
|
-
return;
|
|
1380
|
-
}
|
|
1381
|
-
he("setupClone", this), x.eventCanceled || (K = ir(b), K.removeAttribute("id"), K.draggable = !1, K.style["will-change"] = "", this._hideClone(), pe(K, this.options.chosenClass, !1), x.clone = K), i.cloneId = Wt(function() {
|
|
1382
|
-
he("clone", i), !x.eventCanceled && (i.options.removeCloneOnHide || U.insertBefore(K, b), i._hideClone(), se({
|
|
1383
|
-
sortable: i,
|
|
1384
|
-
name: "clone"
|
|
1385
|
-
}));
|
|
1386
|
-
}), !t && pe(b, r.dragClass, !0), t ? (Vt = !0, i._loopId = setInterval(i._emulateDragOver, 50)) : ($(document, "mouseup", i._onDrop), $(document, "touchend", i._onDrop), $(document, "touchcancel", i._onDrop), n && (n.effectAllowed = "move", r.setData && r.setData.call(i, n, b)), j(document, "drop", i), T(b, "transform", "translateZ(0)")), qe = !0, i._dragStartId = Wt(i._dragStarted.bind(i, t, e)), j(document, "selectstart", i), pt = !0, window.getSelection().removeAllRanges(), bt && T(document.body, "user-select", "none");
|
|
1387
|
-
},
|
|
1388
|
-
// Returns true - if no further action is needed (either inserted or another condition)
|
|
1389
|
-
_onDragOver: function(e) {
|
|
1390
|
-
var t = this.el, i = e.target, n, r, o, l = this.options, c = l.group, s = x.active, u = $t === c, h = l.sort, f = ne || s, m, v = this, E = !1;
|
|
1391
|
-
if (yi) return;
|
|
1392
|
-
function M(y, S) {
|
|
1393
|
-
he(y, v, Se({
|
|
1394
|
-
evt: e,
|
|
1395
|
-
isOwner: u,
|
|
1396
|
-
axis: m ? "vertical" : "horizontal",
|
|
1397
|
-
revert: o,
|
|
1398
|
-
dragRect: n,
|
|
1399
|
-
targetRect: r,
|
|
1400
|
-
canSort: h,
|
|
1401
|
-
fromSortable: f,
|
|
1402
|
-
target: i,
|
|
1403
|
-
completed: I,
|
|
1404
|
-
onMove: function(R, X) {
|
|
1405
|
-
return kt(U, t, b, n, R, ee(R), e, X);
|
|
1406
|
-
},
|
|
1407
|
-
changed: N
|
|
1408
|
-
}, S));
|
|
1409
|
-
}
|
|
1410
|
-
function B() {
|
|
1411
|
-
M("dragOverAnimationCapture"), v.captureAnimationState(), v !== f && f.captureAnimationState();
|
|
1412
|
-
}
|
|
1413
|
-
function I(y) {
|
|
1414
|
-
return M("dragOverCompleted", {
|
|
1415
|
-
insertion: y
|
|
1416
|
-
}), y && (u ? s._hideClone() : s._showClone(v), v !== f && (pe(b, ne ? ne.options.ghostClass : s.options.ghostClass, !1), pe(b, l.ghostClass, !0)), ne !== v && v !== x.active ? ne = v : v === x.active && ne && (ne = null), f === v && (v._ignoreWhileAnimating = i), v.animateAll(function() {
|
|
1417
|
-
M("dragOverAnimationComplete"), v._ignoreWhileAnimating = null;
|
|
1418
|
-
}), v !== f && (f.animateAll(), f._ignoreWhileAnimating = null)), (i === b && !b.animated || i === t && !i.animated) && (Ve = null), !l.dragoverBubble && !e.rootEl && i !== document && (b.parentNode[de]._isOutsideThisEl(e.target), !y && Ye(e)), !l.dragoverBubble && e.stopPropagation && e.stopPropagation(), E = !0;
|
|
1419
|
-
}
|
|
1420
|
-
function N() {
|
|
1421
|
-
ge = ve(b), Ne = ve(b, l.draggable), se({
|
|
1422
|
-
sortable: v,
|
|
1423
|
-
name: "change",
|
|
1424
|
-
toEl: t,
|
|
1425
|
-
newIndex: ge,
|
|
1426
|
-
newDraggableIndex: Ne,
|
|
1427
|
-
originalEvent: e
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
|
-
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), i = we(i, l.draggable, t, !0), M("dragOver"), x.eventCanceled) return E;
|
|
1431
|
-
if (b.contains(e.target) || i.animated && i.animatingX && i.animatingY || v._ignoreWhileAnimating === i)
|
|
1432
|
-
return I(!1);
|
|
1433
|
-
if (Vt = !1, s && !l.disabled && (u ? h || (o = q !== U) : ne === this || (this.lastPutMode = $t.checkPull(this, s, b, e)) && c.checkPut(this, s, b, e))) {
|
|
1434
|
-
if (m = this._getDirection(e, i) === "vertical", n = ee(b), M("dragOverValid"), x.eventCanceled) return E;
|
|
1435
|
-
if (o)
|
|
1436
|
-
return q = U, B(), this._hideClone(), M("revert"), x.eventCanceled || (Fe ? U.insertBefore(b, Fe) : U.appendChild(b)), I(!0);
|
|
1437
|
-
var W = Bi(t, l.draggable);
|
|
1438
|
-
if (!W || Bs(e, m, this) && !W.animated) {
|
|
1439
|
-
if (W === b)
|
|
1440
|
-
return I(!1);
|
|
1441
|
-
if (W && t === e.target && (i = W), i && (r = ee(i)), kt(U, t, b, n, i, r, e, !!i) !== !1)
|
|
1442
|
-
return B(), W && W.nextSibling ? t.insertBefore(b, W.nextSibling) : t.appendChild(b), q = t, N(), I(!0);
|
|
1443
|
-
} else if (W && Rs(e, m, this)) {
|
|
1444
|
-
var H = nt(t, 0, l, !0);
|
|
1445
|
-
if (H === b)
|
|
1446
|
-
return I(!1);
|
|
1447
|
-
if (i = H, r = ee(i), kt(U, t, b, n, i, r, e, !1) !== !1)
|
|
1448
|
-
return B(), t.insertBefore(b, H), q = t, N(), I(!0);
|
|
1449
|
-
} else if (i.parentNode === t) {
|
|
1450
|
-
r = ee(i);
|
|
1451
|
-
var d = 0, A, Y = b.parentNode !== t, L = !Ns(b.animated && b.toRect || n, i.animated && i.toRect || r, m), k = m ? "top" : "left", _ = ma(i, "top", "top") || ma(b, "top", "top"), ie = _ ? _.scrollTop : void 0;
|
|
1452
|
-
Ve !== i && (A = r[k], Et = !1, Pt = !L && l.invertSwap || Y), d = Ls(e, i, r, m, L ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Pt, Ve === i);
|
|
1453
|
-
var Z;
|
|
1454
|
-
if (d !== 0) {
|
|
1455
|
-
var w = ve(b);
|
|
1456
|
-
do
|
|
1457
|
-
w -= d, Z = q.children[w];
|
|
1458
|
-
while (Z && (T(Z, "display") === "none" || Z === C));
|
|
1459
|
-
}
|
|
1460
|
-
if (d === 0 || Z === i)
|
|
1461
|
-
return I(!1);
|
|
1462
|
-
Ve = i, Dt = d;
|
|
1463
|
-
var g = i.nextElementSibling, p = !1;
|
|
1464
|
-
p = d === 1;
|
|
1465
|
-
var D = kt(U, t, b, n, i, r, e, p);
|
|
1466
|
-
if (D !== !1)
|
|
1467
|
-
return (D === 1 || D === -1) && (p = D === 1), yi = !0, setTimeout(ks, 30), B(), p && !g ? t.appendChild(b) : i.parentNode.insertBefore(b, p ? g : i), _ && tr(_, 0, ie - _.scrollTop), q = b.parentNode, A !== void 0 && !Pt && (Ft = Math.abs(A - ee(i)[k])), N(), I(!0);
|
|
1468
|
-
}
|
|
1469
|
-
if (t.contains(b))
|
|
1470
|
-
return I(!1);
|
|
1471
|
-
}
|
|
1472
|
-
return !1;
|
|
1473
|
-
},
|
|
1474
|
-
_ignoreWhileAnimating: null,
|
|
1475
|
-
_offMoveEvents: function() {
|
|
1476
|
-
$(document, "mousemove", this._onTouchMove), $(document, "touchmove", this._onTouchMove), $(document, "pointermove", this._onTouchMove), $(document, "dragover", Ye), $(document, "mousemove", Ye), $(document, "touchmove", Ye);
|
|
1477
|
-
},
|
|
1478
|
-
_offUpEvents: function() {
|
|
1479
|
-
var e = this.el.ownerDocument;
|
|
1480
|
-
$(e, "mouseup", this._onDrop), $(e, "touchend", this._onDrop), $(e, "pointerup", this._onDrop), $(e, "pointercancel", this._onDrop), $(e, "touchcancel", this._onDrop), $(document, "selectstart", this);
|
|
1481
|
-
},
|
|
1482
|
-
_onDrop: function(e) {
|
|
1483
|
-
var t = this.el, i = this.options;
|
|
1484
|
-
if (ge = ve(b), Ne = ve(b, i.draggable), he("drop", this, {
|
|
1485
|
-
evt: e
|
|
1486
|
-
}), q = b && b.parentNode, ge = ve(b), Ne = ve(b, i.draggable), x.eventCanceled) {
|
|
1487
|
-
this._nulling();
|
|
1488
|
-
return;
|
|
1489
|
-
}
|
|
1490
|
-
qe = !1, Pt = !1, Et = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), wi(this.cloneId), wi(this._dragStartId), this.nativeDraggable && ($(document, "drop", this), $(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), bt && T(document.body, "user-select", ""), T(b, "transform", ""), e && (pt && (e.cancelable && e.preventDefault(), !i.dropBubble && e.stopPropagation()), C && C.parentNode && C.parentNode.removeChild(C), (U === q || ne && ne.lastPutMode !== "clone") && K && K.parentNode && K.parentNode.removeChild(K), b && (this.nativeDraggable && $(b, "dragend", this), ci(b), b.style["will-change"] = "", pt && !qe && pe(b, ne ? ne.options.ghostClass : this.options.ghostClass, !1), pe(b, this.options.chosenClass, !1), se({
|
|
1491
|
-
sortable: this,
|
|
1492
|
-
name: "unchoose",
|
|
1493
|
-
toEl: q,
|
|
1494
|
-
newIndex: null,
|
|
1495
|
-
newDraggableIndex: null,
|
|
1496
|
-
originalEvent: e
|
|
1497
|
-
}), U !== q ? (ge >= 0 && (se({
|
|
1498
|
-
rootEl: q,
|
|
1499
|
-
name: "add",
|
|
1500
|
-
toEl: q,
|
|
1501
|
-
fromEl: U,
|
|
1502
|
-
originalEvent: e
|
|
1503
|
-
}), se({
|
|
1504
|
-
sortable: this,
|
|
1505
|
-
name: "remove",
|
|
1506
|
-
toEl: q,
|
|
1507
|
-
originalEvent: e
|
|
1508
|
-
}), se({
|
|
1509
|
-
rootEl: q,
|
|
1510
|
-
name: "sort",
|
|
1511
|
-
toEl: q,
|
|
1512
|
-
fromEl: U,
|
|
1513
|
-
originalEvent: e
|
|
1514
|
-
}), se({
|
|
1515
|
-
sortable: this,
|
|
1516
|
-
name: "sort",
|
|
1517
|
-
toEl: q,
|
|
1518
|
-
originalEvent: e
|
|
1519
|
-
})), ne && ne.save()) : ge !== Ze && ge >= 0 && (se({
|
|
1520
|
-
sortable: this,
|
|
1521
|
-
name: "update",
|
|
1522
|
-
toEl: q,
|
|
1523
|
-
originalEvent: e
|
|
1524
|
-
}), se({
|
|
1525
|
-
sortable: this,
|
|
1526
|
-
name: "sort",
|
|
1527
|
-
toEl: q,
|
|
1528
|
-
originalEvent: e
|
|
1529
|
-
})), x.active && ((ge == null || ge === -1) && (ge = Ze, Ne = wt), se({
|
|
1530
|
-
sortable: this,
|
|
1531
|
-
name: "end",
|
|
1532
|
-
toEl: q,
|
|
1533
|
-
originalEvent: e
|
|
1534
|
-
}), this.save()))), this._nulling();
|
|
1535
|
-
},
|
|
1536
|
-
_nulling: function() {
|
|
1537
|
-
he("nulling", this), U = b = q = C = Fe = K = Xt = $e = Le = be = pt = ge = Ne = Ze = wt = Ve = Dt = ne = $t = x.dragged = x.ghost = x.clone = x.active = null, qt.forEach(function(e) {
|
|
1538
|
-
e.checked = !0;
|
|
1539
|
-
}), qt.length = oi = si = 0;
|
|
1540
|
-
},
|
|
1541
|
-
handleEvent: function(e) {
|
|
1542
|
-
switch (e.type) {
|
|
1543
|
-
case "drop":
|
|
1544
|
-
case "dragend":
|
|
1545
|
-
this._onDrop(e);
|
|
1546
|
-
break;
|
|
1547
|
-
case "dragenter":
|
|
1548
|
-
case "dragover":
|
|
1549
|
-
b && (this._onDragOver(e), js(e));
|
|
1550
|
-
break;
|
|
1551
|
-
case "selectstart":
|
|
1552
|
-
e.preventDefault();
|
|
1553
|
-
break;
|
|
1554
|
-
}
|
|
1555
|
-
},
|
|
1556
|
-
/**
|
|
1557
|
-
* Serializes the item into an array of string.
|
|
1558
|
-
* @returns {String[]}
|
|
1559
|
-
*/
|
|
1560
|
-
toArray: function() {
|
|
1561
|
-
for (var e = [], t, i = this.el.children, n = 0, r = i.length, o = this.options; n < r; n++)
|
|
1562
|
-
t = i[n], we(t, o.draggable, this.el, !1) && e.push(t.getAttribute(o.dataIdAttr) || Hs(t));
|
|
1563
|
-
return e;
|
|
1564
|
-
},
|
|
1565
|
-
/**
|
|
1566
|
-
* Sorts the elements according to the array.
|
|
1567
|
-
* @param {String[]} order order of the items
|
|
1568
|
-
*/
|
|
1569
|
-
sort: function(e, t) {
|
|
1570
|
-
var i = {}, n = this.el;
|
|
1571
|
-
this.toArray().forEach(function(r, o) {
|
|
1572
|
-
var l = n.children[o];
|
|
1573
|
-
we(l, this.options.draggable, n, !1) && (i[r] = l);
|
|
1574
|
-
}, this), t && this.captureAnimationState(), e.forEach(function(r) {
|
|
1575
|
-
i[r] && (n.removeChild(i[r]), n.appendChild(i[r]));
|
|
1576
|
-
}), t && this.animateAll();
|
|
1577
|
-
},
|
|
1578
|
-
/**
|
|
1579
|
-
* Save the current sorting
|
|
1580
|
-
*/
|
|
1581
|
-
save: function() {
|
|
1582
|
-
var e = this.options.store;
|
|
1583
|
-
e && e.set && e.set(this);
|
|
1584
|
-
},
|
|
1585
|
-
/**
|
|
1586
|
-
* 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.
|
|
1587
|
-
* @param {HTMLElement} el
|
|
1588
|
-
* @param {String} [selector] default: `options.draggable`
|
|
1589
|
-
* @returns {HTMLElement|null}
|
|
1590
|
-
*/
|
|
1591
|
-
closest: function(e, t) {
|
|
1592
|
-
return we(e, t || this.options.draggable, this.el, !1);
|
|
1593
|
-
},
|
|
1594
|
-
/**
|
|
1595
|
-
* Set/get option
|
|
1596
|
-
* @param {string} name
|
|
1597
|
-
* @param {*} [value]
|
|
1598
|
-
* @returns {*}
|
|
1599
|
-
*/
|
|
1600
|
-
option: function(e, t) {
|
|
1601
|
-
var i = this.options;
|
|
1602
|
-
if (t === void 0)
|
|
1603
|
-
return i[e];
|
|
1604
|
-
var n = At.modifyOption(this, e, t);
|
|
1605
|
-
typeof n < "u" ? i[e] = n : i[e] = t, e === "group" && or(i);
|
|
1606
|
-
},
|
|
1607
|
-
/**
|
|
1608
|
-
* Destroy
|
|
1609
|
-
*/
|
|
1610
|
-
destroy: function() {
|
|
1611
|
-
he("destroy", this);
|
|
1612
|
-
var e = this.el;
|
|
1613
|
-
e[de] = null, $(e, "mousedown", this._onTapStart), $(e, "touchstart", this._onTapStart), $(e, "pointerdown", this._onTapStart), this.nativeDraggable && ($(e, "dragover", this), $(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(t) {
|
|
1614
|
-
t.removeAttribute("draggable");
|
|
1615
|
-
}), this._onDrop(), this._disableDelayedDragEvents(), Kt.splice(Kt.indexOf(this.el), 1), this.el = e = null;
|
|
1616
|
-
},
|
|
1617
|
-
_hideClone: function() {
|
|
1618
|
-
if (!$e) {
|
|
1619
|
-
if (he("hideClone", this), x.eventCanceled) return;
|
|
1620
|
-
T(K, "display", "none"), this.options.removeCloneOnHide && K.parentNode && K.parentNode.removeChild(K), $e = !0;
|
|
1621
|
-
}
|
|
1622
|
-
},
|
|
1623
|
-
_showClone: function(e) {
|
|
1624
|
-
if (e.lastPutMode !== "clone") {
|
|
1625
|
-
this._hideClone();
|
|
1626
|
-
return;
|
|
1627
|
-
}
|
|
1628
|
-
if ($e) {
|
|
1629
|
-
if (he("showClone", this), x.eventCanceled) return;
|
|
1630
|
-
b.parentNode == U && !this.options.group.revertClone ? U.insertBefore(K, b) : Fe ? U.insertBefore(K, Fe) : U.appendChild(K), this.options.group.revertClone && this.animate(b, K), T(K, "display", ""), $e = !1;
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
};
|
|
1634
|
-
function js(a) {
|
|
1635
|
-
a.dataTransfer && (a.dataTransfer.dropEffect = "move"), a.cancelable && a.preventDefault();
|
|
1636
|
-
}
|
|
1637
|
-
function kt(a, e, t, i, n, r, o, l) {
|
|
1638
|
-
var c, s = a[de], u = s.options.onMove, h;
|
|
1639
|
-
return window.CustomEvent && !Ce && !Ct ? c = new CustomEvent("move", {
|
|
1640
|
-
bubbles: !0,
|
|
1641
|
-
cancelable: !0
|
|
1642
|
-
}) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = e, c.from = a, c.dragged = t, c.draggedRect = i, c.related = n || e, c.relatedRect = r || ee(e), c.willInsertAfter = l, c.originalEvent = o, a.dispatchEvent(c), u && (h = u.call(s, c, o)), h;
|
|
1643
|
-
}
|
|
1644
|
-
function ci(a) {
|
|
1645
|
-
a.draggable = !1;
|
|
1646
|
-
}
|
|
1647
|
-
function ks() {
|
|
1648
|
-
yi = !1;
|
|
1649
|
-
}
|
|
1650
|
-
function Rs(a, e, t) {
|
|
1651
|
-
var i = ee(nt(t.el, 0, t.options, !0)), n = ar(t.el, t.options, C), r = 10;
|
|
1652
|
-
return e ? a.clientX < n.left - r || a.clientY < i.top && a.clientX < i.right : a.clientY < n.top - r || a.clientY < i.bottom && a.clientX < i.left;
|
|
1653
|
-
}
|
|
1654
|
-
function Bs(a, e, t) {
|
|
1655
|
-
var i = ee(Bi(t.el, t.options.draggable)), n = ar(t.el, t.options, C), r = 10;
|
|
1656
|
-
return e ? a.clientX > n.right + r || a.clientY > i.bottom && a.clientX > i.left : a.clientY > n.bottom + r || a.clientX > i.right && a.clientY > i.top;
|
|
1657
|
-
}
|
|
1658
|
-
function Ls(a, e, t, i, n, r, o, l) {
|
|
1659
|
-
var c = i ? a.clientY : a.clientX, s = i ? t.height : t.width, u = i ? t.top : t.left, h = i ? t.bottom : t.right, f = !1;
|
|
1660
|
-
if (!o) {
|
|
1661
|
-
if (l && Ft < s * n) {
|
|
1662
|
-
if (!Et && (Dt === 1 ? c > u + s * r / 2 : c < h - s * r / 2) && (Et = !0), Et)
|
|
1663
|
-
f = !0;
|
|
1664
|
-
else if (Dt === 1 ? c < u + Ft : c > h - Ft)
|
|
1665
|
-
return -Dt;
|
|
1666
|
-
} else if (c > u + s * (1 - n) / 2 && c < h - s * (1 - n) / 2)
|
|
1667
|
-
return Ys(e);
|
|
1668
|
-
}
|
|
1669
|
-
return f = f || o, f && (c < u + s * r / 2 || c > h - s * r / 2) ? c > u + s / 2 ? 1 : -1 : 0;
|
|
1670
|
-
}
|
|
1671
|
-
function Ys(a) {
|
|
1672
|
-
return ve(b) < ve(a) ? 1 : -1;
|
|
1673
|
-
}
|
|
1674
|
-
function Hs(a) {
|
|
1675
|
-
for (var e = a.tagName + a.className + a.src + a.href + a.textContent, t = e.length, i = 0; t--; )
|
|
1676
|
-
i += e.charCodeAt(t);
|
|
1677
|
-
return i.toString(36);
|
|
1678
|
-
}
|
|
1679
|
-
function Xs(a) {
|
|
1680
|
-
qt.length = 0;
|
|
1681
|
-
for (var e = a.getElementsByTagName("input"), t = e.length; t--; ) {
|
|
1682
|
-
var i = e[t];
|
|
1683
|
-
i.checked && qt.push(i);
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
function Wt(a) {
|
|
1687
|
-
return setTimeout(a, 0);
|
|
1688
|
-
}
|
|
1689
|
-
function wi(a) {
|
|
1690
|
-
return clearTimeout(a);
|
|
1691
|
-
}
|
|
1692
|
-
ti && j(document, "touchmove", function(a) {
|
|
1693
|
-
(x.active || qe) && a.cancelable && a.preventDefault();
|
|
1694
|
-
});
|
|
1695
|
-
x.utils = {
|
|
1696
|
-
on: j,
|
|
1697
|
-
off: $,
|
|
1698
|
-
css: T,
|
|
1699
|
-
find: Ja,
|
|
1700
|
-
is: function(e, t) {
|
|
1701
|
-
return !!we(e, t, e, !1);
|
|
1702
|
-
},
|
|
1703
|
-
extend: Ss,
|
|
1704
|
-
throttle: er,
|
|
1705
|
-
closest: we,
|
|
1706
|
-
toggleClass: pe,
|
|
1707
|
-
clone: ir,
|
|
1708
|
-
index: ve,
|
|
1709
|
-
nextTick: Wt,
|
|
1710
|
-
cancelNextTick: wi,
|
|
1711
|
-
detectDirection: nr,
|
|
1712
|
-
getChild: nt,
|
|
1713
|
-
expando: de
|
|
1714
|
-
};
|
|
1715
|
-
x.get = function(a) {
|
|
1716
|
-
return a[de];
|
|
1717
|
-
};
|
|
1718
|
-
x.mount = function() {
|
|
1719
|
-
for (var a = arguments.length, e = new Array(a), t = 0; t < a; t++)
|
|
1720
|
-
e[t] = arguments[t];
|
|
1721
|
-
e[0].constructor === Array && (e = e[0]), e.forEach(function(i) {
|
|
1722
|
-
if (!i.prototype || !i.prototype.constructor)
|
|
1723
|
-
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));
|
|
1724
|
-
i.utils && (x.utils = Se(Se({}, x.utils), i.utils)), At.mount(i);
|
|
1725
|
-
});
|
|
1726
|
-
};
|
|
1727
|
-
x.create = function(a, e) {
|
|
1728
|
-
return new x(a, e);
|
|
1729
|
-
};
|
|
1730
|
-
x.version = Es;
|
|
1731
|
-
var J = [], gt, Di, Ei = !1, hi, ui, Zt, mt;
|
|
1732
|
-
function Fs() {
|
|
1733
|
-
function a() {
|
|
1734
|
-
this.defaults = {
|
|
1735
|
-
scroll: !0,
|
|
1736
|
-
forceAutoScrollFallback: !1,
|
|
1737
|
-
scrollSensitivity: 30,
|
|
1738
|
-
scrollSpeed: 10,
|
|
1739
|
-
bubbleScroll: !0
|
|
1740
|
-
};
|
|
1741
|
-
for (var e in this)
|
|
1742
|
-
e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
|
|
1743
|
-
}
|
|
1744
|
-
return a.prototype = {
|
|
1745
|
-
dragStarted: function(t) {
|
|
1746
|
-
var i = t.originalEvent;
|
|
1747
|
-
this.sortable.nativeDraggable ? j(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? j(document, "pointermove", this._handleFallbackAutoScroll) : i.touches ? j(document, "touchmove", this._handleFallbackAutoScroll) : j(document, "mousemove", this._handleFallbackAutoScroll);
|
|
1748
|
-
},
|
|
1749
|
-
dragOverCompleted: function(t) {
|
|
1750
|
-
var i = t.originalEvent;
|
|
1751
|
-
!this.options.dragOverBubble && !i.rootEl && this._handleAutoScroll(i);
|
|
1752
|
-
},
|
|
1753
|
-
drop: function() {
|
|
1754
|
-
this.sortable.nativeDraggable ? $(document, "dragover", this._handleAutoScroll) : ($(document, "pointermove", this._handleFallbackAutoScroll), $(document, "touchmove", this._handleFallbackAutoScroll), $(document, "mousemove", this._handleFallbackAutoScroll)), Da(), zt(), xs();
|
|
1755
|
-
},
|
|
1756
|
-
nulling: function() {
|
|
1757
|
-
Zt = Di = gt = Ei = mt = hi = ui = null, J.length = 0;
|
|
1758
|
-
},
|
|
1759
|
-
_handleFallbackAutoScroll: function(t) {
|
|
1760
|
-
this._handleAutoScroll(t, !0);
|
|
1761
|
-
},
|
|
1762
|
-
_handleAutoScroll: function(t, i) {
|
|
1763
|
-
var n = this, r = (t.touches ? t.touches[0] : t).clientX, o = (t.touches ? t.touches[0] : t).clientY, l = document.elementFromPoint(r, o);
|
|
1764
|
-
if (Zt = t, i || this.options.forceAutoScrollFallback || Ct || Ce || bt) {
|
|
1765
|
-
fi(t, this.options, l, i);
|
|
1766
|
-
var c = Pe(l, !0);
|
|
1767
|
-
Ei && (!mt || r !== hi || o !== ui) && (mt && Da(), mt = setInterval(function() {
|
|
1768
|
-
var s = Pe(document.elementFromPoint(r, o), !0);
|
|
1769
|
-
s !== c && (c = s, zt()), fi(t, n.options, s, i);
|
|
1770
|
-
}, 10), hi = r, ui = o);
|
|
1771
|
-
} else {
|
|
1772
|
-
if (!this.options.bubbleScroll || Pe(l, !0) === Ee()) {
|
|
1773
|
-
zt();
|
|
1774
|
-
return;
|
|
1775
|
-
}
|
|
1776
|
-
fi(t, this.options, Pe(l, !1), !1);
|
|
1777
|
-
}
|
|
1778
|
-
}
|
|
1779
|
-
}, Me(a, {
|
|
1780
|
-
pluginName: "scroll",
|
|
1781
|
-
initializeByDefault: !0
|
|
1782
|
-
});
|
|
1783
|
-
}
|
|
1784
|
-
function zt() {
|
|
1785
|
-
J.forEach(function(a) {
|
|
1786
|
-
clearInterval(a.pid);
|
|
1787
|
-
}), J = [];
|
|
1788
|
-
}
|
|
1789
|
-
function Da() {
|
|
1790
|
-
clearInterval(mt);
|
|
1791
|
-
}
|
|
1792
|
-
var fi = er(function(a, e, t, i) {
|
|
1793
|
-
if (e.scroll) {
|
|
1794
|
-
var n = (a.touches ? a.touches[0] : a).clientX, r = (a.touches ? a.touches[0] : a).clientY, o = e.scrollSensitivity, l = e.scrollSpeed, c = Ee(), s = !1, u;
|
|
1795
|
-
Di !== t && (Di = t, zt(), gt = e.scroll, u = e.scrollFn, gt === !0 && (gt = Pe(t, !0)));
|
|
1796
|
-
var h = 0, f = gt;
|
|
1797
|
-
do {
|
|
1798
|
-
var m = f, v = ee(m), E = v.top, M = v.bottom, B = v.left, I = v.right, N = v.width, W = v.height, H = void 0, d = void 0, A = m.scrollWidth, Y = m.scrollHeight, L = T(m), k = m.scrollLeft, _ = m.scrollTop;
|
|
1799
|
-
m === c ? (H = N < A && (L.overflowX === "auto" || L.overflowX === "scroll" || L.overflowX === "visible"), d = W < Y && (L.overflowY === "auto" || L.overflowY === "scroll" || L.overflowY === "visible")) : (H = N < A && (L.overflowX === "auto" || L.overflowX === "scroll"), d = W < Y && (L.overflowY === "auto" || L.overflowY === "scroll"));
|
|
1800
|
-
var ie = H && (Math.abs(I - n) <= o && k + N < A) - (Math.abs(B - n) <= o && !!k), Z = d && (Math.abs(M - r) <= o && _ + W < Y) - (Math.abs(E - r) <= o && !!_);
|
|
1801
|
-
if (!J[h])
|
|
1802
|
-
for (var w = 0; w <= h; w++)
|
|
1803
|
-
J[w] || (J[w] = {});
|
|
1804
|
-
(J[h].vx != ie || J[h].vy != Z || J[h].el !== m) && (J[h].el = m, J[h].vx = ie, J[h].vy = Z, clearInterval(J[h].pid), (ie != 0 || Z != 0) && (s = !0, J[h].pid = setInterval((function() {
|
|
1805
|
-
i && this.layer === 0 && x.active._onTouchMove(Zt);
|
|
1806
|
-
var g = J[this.layer].vy ? J[this.layer].vy * l : 0, p = J[this.layer].vx ? J[this.layer].vx * l : 0;
|
|
1807
|
-
typeof u == "function" && u.call(x.dragged.parentNode[de], p, g, a, Zt, J[this.layer].el) !== "continue" || tr(J[this.layer].el, p, g);
|
|
1808
|
-
}).bind({
|
|
1809
|
-
layer: h
|
|
1810
|
-
}), 24))), h++;
|
|
1811
|
-
} while (e.bubbleScroll && f !== c && (f = Pe(f, !1)));
|
|
1812
|
-
Ei = s;
|
|
1813
|
-
}
|
|
1814
|
-
}, 30), cr = function(e) {
|
|
1815
|
-
var t = e.originalEvent, i = e.putSortable, n = e.dragEl, r = e.activeSortable, o = e.dispatchSortableEvent, l = e.hideGhostForTarget, c = e.unhideGhostForTarget;
|
|
1816
|
-
if (t) {
|
|
1817
|
-
var s = i || r;
|
|
1818
|
-
l();
|
|
1819
|
-
var u = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, h = document.elementFromPoint(u.clientX, u.clientY);
|
|
1820
|
-
c(), s && !s.el.contains(h) && (o("spill"), this.onSpill({
|
|
1821
|
-
dragEl: n,
|
|
1822
|
-
putSortable: i
|
|
1823
|
-
}));
|
|
1824
|
-
}
|
|
1825
|
-
};
|
|
1826
|
-
function Li() {
|
|
1827
|
-
}
|
|
1828
|
-
Li.prototype = {
|
|
1829
|
-
startIndex: null,
|
|
1830
|
-
dragStart: function(e) {
|
|
1831
|
-
var t = e.oldDraggableIndex;
|
|
1832
|
-
this.startIndex = t;
|
|
1833
|
-
},
|
|
1834
|
-
onSpill: function(e) {
|
|
1835
|
-
var t = e.dragEl, i = e.putSortable;
|
|
1836
|
-
this.sortable.captureAnimationState(), i && i.captureAnimationState();
|
|
1837
|
-
var n = nt(this.sortable.el, this.startIndex, this.options);
|
|
1838
|
-
n ? this.sortable.el.insertBefore(t, n) : this.sortable.el.appendChild(t), this.sortable.animateAll(), i && i.animateAll();
|
|
1839
|
-
},
|
|
1840
|
-
drop: cr
|
|
1841
|
-
};
|
|
1842
|
-
Me(Li, {
|
|
1843
|
-
pluginName: "revertOnSpill"
|
|
1844
|
-
});
|
|
1845
|
-
function Yi() {
|
|
1846
|
-
}
|
|
1847
|
-
Yi.prototype = {
|
|
1848
|
-
onSpill: function(e) {
|
|
1849
|
-
var t = e.dragEl, i = e.putSortable, n = i || this.sortable;
|
|
1850
|
-
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
1851
|
-
},
|
|
1852
|
-
drop: cr
|
|
1853
|
-
};
|
|
1854
|
-
Me(Yi, {
|
|
1855
|
-
pluginName: "removeOnSpill"
|
|
1856
|
-
});
|
|
1857
|
-
x.mount(new Fs());
|
|
1858
|
-
x.mount(Yi, Li);
|
|
1859
|
-
const tt = Ir(0), Ws = Cr(Ar), { activeMenuPath: zs } = Or(Ws), Qt = (a) => a == null ? void 0 : a.map((t) => (tt.value++, Array.isArray(t) ? Qt(t) : {
|
|
1860
|
-
label: (t == null ? void 0 : t.label) ?? "",
|
|
1861
|
-
prop: (t == null ? void 0 : t.label) === "操作" ? "operate" : (t == null ? void 0 : t.prop) ?? "a" + tt.value,
|
|
1862
|
-
width: (t == null ? void 0 : t.label) === "操作" ? "200" : t != null && t.width ? parseInt(t.width) : "",
|
|
1863
|
-
fixed: (t == null ? void 0 : t.fixed) ?? void 0,
|
|
1864
|
-
sortable: (t == null ? void 0 : t.sortable) ?? !1,
|
|
1865
|
-
align: (t == null ? void 0 : t.align) ?? "center",
|
|
1866
|
-
showOverflowTooltip: (t == null ? void 0 : t.showOverflowTooltip) ?? !0,
|
|
1867
|
-
isNotDrag: (t == null ? void 0 : t.isNotDrag) ?? !1,
|
|
1868
|
-
isEditCol: (t == null ? void 0 : t.isEditCol) ?? !1,
|
|
1869
|
-
isOperate: (t == null ? void 0 : t.isOperate) ?? !1,
|
|
1870
|
-
id: (t == null ? void 0 : t.id) ?? tt.value,
|
|
1871
|
-
type: (t == null ? void 0 : t.label) === "操作" ? "operate" : void 0,
|
|
1872
|
-
formType: (t == null ? void 0 : t.formType) ?? "",
|
|
1873
|
-
isHidden: t == null ? void 0 : t.isHidden,
|
|
1874
|
-
options: (t == null ? void 0 : t.options) ?? [],
|
|
1875
|
-
children: Qt(t.children) ?? void 0
|
|
1876
|
-
})), ec = (a) => {
|
|
1877
|
-
const e = [];
|
|
1878
|
-
function t(i) {
|
|
1879
|
-
if (Array.isArray(i))
|
|
1880
|
-
for (const n of i)
|
|
1881
|
-
!n.children || n.children.length === 0 ? e.push(n) : t(n.children);
|
|
1882
|
-
}
|
|
1883
|
-
return t(a), e;
|
|
1884
|
-
}, tc = (a) => De(a).map((t) => (Array.isArray(t) && (t = t.map((i) => (Array.isArray(i) ? i = Qt(i) : (i = {
|
|
1885
|
-
label: (i == null ? void 0 : i.label) ?? "",
|
|
1886
|
-
prop: (i == null ? void 0 : i.label) === "操作" ? "operate" : (i == null ? void 0 : i.prop) ?? "a" + tt.value,
|
|
1887
|
-
width: (i == null ? void 0 : i.label) === "操作" ? "200" : i != null && i.width ? parseInt(i.width) : "",
|
|
1888
|
-
fixed: (i == null ? void 0 : i.fixed) ?? void 0,
|
|
1889
|
-
sortable: (i == null ? void 0 : i.sortable) ?? !1,
|
|
1890
|
-
align: (i == null ? void 0 : i.align) ?? "center",
|
|
1891
|
-
showOverflowTooltip: (i == null ? void 0 : i.showOverflowTooltip) ?? !0,
|
|
1892
|
-
isNotDrag: (i == null ? void 0 : i.isNotDrag) ?? !1,
|
|
1893
|
-
isEditCol: (i == null ? void 0 : i.isEditCol) ?? !1,
|
|
1894
|
-
isOperate: (i == null ? void 0 : i.isOperate) ?? !1,
|
|
1895
|
-
id: (i == null ? void 0 : i.id) ?? tt.value,
|
|
1896
|
-
type: (i == null ? void 0 : i.label) === "操作" ? "operate" : void 0,
|
|
1897
|
-
formType: (i == null ? void 0 : i.formType) ?? "",
|
|
1898
|
-
isHidden: i == null ? void 0 : i.isHidden,
|
|
1899
|
-
options: (i == null ? void 0 : i.options) ?? [],
|
|
1900
|
-
children: Qt(i.children)
|
|
1901
|
-
}, tt.value++), i))), t)), Us = (a) => {
|
|
1902
|
-
function e(t, i = []) {
|
|
1903
|
-
if (!t || t.length === 0) return [];
|
|
1904
|
-
let n = i;
|
|
1905
|
-
return Array.isArray(t) && (t == null || t.forEach((r) => {
|
|
1906
|
-
var o;
|
|
1907
|
-
r != null && r.children && ((o = r.children) == null ? void 0 : o.length) > 0 ? n = e(r == null ? void 0 : r.children, n) : n.push(r);
|
|
1908
|
-
})), n;
|
|
1909
|
-
}
|
|
1910
|
-
return e(a);
|
|
1911
|
-
}, ic = (a) => {
|
|
1912
|
-
let e = De(a);
|
|
1913
|
-
return e = e == null ? void 0 : e.map((t) => ((t == null ? void 0 : t.type) === "Select" && (t = {
|
|
1914
|
-
label: t == null ? void 0 : t.label,
|
|
1915
|
-
name: t == null ? void 0 : t.name,
|
|
1916
|
-
type: t == null ? void 0 : t.type,
|
|
1917
|
-
value: "",
|
|
1918
|
-
optionUrl: {
|
|
1919
|
-
groupSelect: t == null ? void 0 : t.groupSelect,
|
|
1920
|
-
menuSelect: t == null ? void 0 : t.menuSelect,
|
|
1921
|
-
type: "Select",
|
|
1922
|
-
selectRelateType: t == null ? void 0 : t.selectRelateType
|
|
1923
|
-
}
|
|
1924
|
-
}), t)), e;
|
|
1925
|
-
}, ac = async (a) => {
|
|
1926
|
-
var t, i, n, r;
|
|
1927
|
-
const e = await St({
|
|
1928
|
-
key: {
|
|
1929
|
-
tableId: a,
|
|
1930
|
-
pageKey: zs.value,
|
|
1931
|
-
type: "data",
|
|
1932
|
-
systemKey: sessionStorage.getItem("systemKey")
|
|
1933
|
-
}
|
|
1934
|
-
});
|
|
1935
|
-
return (r = (n = (i = (t = e == null ? void 0 : e.data) == null ? void 0 : t.result) == null ? void 0 : i[0]) == null ? void 0 : n.value) == null ? void 0 : r.tableData;
|
|
1936
|
-
}, Gs = (a) => {
|
|
1937
|
-
var e, t, i, n, r;
|
|
1938
|
-
if (((e = a == null ? void 0 : a.pageData) == null ? void 0 : e.comp) === "Form") {
|
|
1939
|
-
let o = (i = (t = a == null ? void 0 : a.pageData) == null ? void 0 : t.compData) == null ? void 0 : i.map((c) => {
|
|
1940
|
-
var s;
|
|
1941
|
-
return (c == null ? void 0 : c.key) === "formContent" && (c.contents = (s = c.contents) == null ? void 0 : s.map((u) => (u.value = "", u))), c;
|
|
1942
|
-
});
|
|
1943
|
-
return {
|
|
1944
|
-
pageData: {
|
|
1945
|
-
comp: (n = a == null ? void 0 : a.pageData) == null ? void 0 : n.comp,
|
|
1946
|
-
compData: o,
|
|
1947
|
-
name: (r = a == null ? void 0 : a.pageData) == null ? void 0 : r.name
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
} else
|
|
1951
|
-
return a;
|
|
1952
|
-
}, rc = async (a, e) => {
|
|
1953
|
-
var r, o, l, c;
|
|
1954
|
-
let t = [];
|
|
1955
|
-
const i = await St({
|
|
1956
|
-
key: {
|
|
1957
|
-
pageKey: a,
|
|
1958
|
-
type: "structure",
|
|
1959
|
-
systemKey: sessionStorage.getItem("systemKey")
|
|
1960
|
-
}
|
|
1961
|
-
}), n = await St({
|
|
1962
|
-
key: {
|
|
1963
|
-
pageKey: a,
|
|
1964
|
-
systemKey: sessionStorage.getItem("systemKey"),
|
|
1965
|
-
type: "structureMethod"
|
|
1966
|
-
}
|
|
1967
|
-
});
|
|
1968
|
-
(o = (r = i == null ? void 0 : i.data) == null ? void 0 : r.result) == null || o.forEach((s) => {
|
|
1969
|
-
var u, h, f;
|
|
1970
|
-
t.push({
|
|
1971
|
-
key: {
|
|
1972
|
-
pageKey: e,
|
|
1973
|
-
parentTable: (u = s == null ? void 0 : s.key) == null ? void 0 : u.parentTable,
|
|
1974
|
-
systemKey: (h = s == null ? void 0 : s.key) == null ? void 0 : h.systemKey,
|
|
1975
|
-
type: (f = s == null ? void 0 : s.key) == null ? void 0 : f.type,
|
|
1976
|
-
version: 1
|
|
1977
|
-
},
|
|
1978
|
-
value: Gs(s == null ? void 0 : s.value)
|
|
1979
|
-
});
|
|
1980
|
-
}), (c = (l = n == null ? void 0 : n.data) == null ? void 0 : l.result) == null || c.forEach((s) => {
|
|
1981
|
-
var u, h;
|
|
1982
|
-
t.push({
|
|
1983
|
-
key: {
|
|
1984
|
-
pageKey: e,
|
|
1985
|
-
systemKey: (u = s == null ? void 0 : s.key) == null ? void 0 : u.systemKey,
|
|
1986
|
-
type: (h = s == null ? void 0 : s.key) == null ? void 0 : h.type,
|
|
1987
|
-
version: 1
|
|
1988
|
-
},
|
|
1989
|
-
value: s == null ? void 0 : s.value
|
|
1990
|
-
});
|
|
1991
|
-
}), await Mr({
|
|
1992
|
-
dataList: t
|
|
1993
|
-
});
|
|
1994
|
-
}, Vs = (a) => a == null ? void 0 : a.map((t) => (t = ur(t), t)), hr = async () => {
|
|
1995
|
-
var t, i, n, r, o, l, c, s, u, h, f, m;
|
|
1996
|
-
let a;
|
|
1997
|
-
const e = await St({
|
|
1998
|
-
key: {
|
|
1999
|
-
type: "structure",
|
|
2000
|
-
pageKey: "menu",
|
|
2001
|
-
systemKey: sessionStorage.getItem("systemKey")
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
return (l = (o = (r = (n = (i = (t = e.data.result) == null ? void 0 : t[0]) == null ? void 0 : i.value) == null ? void 0 : n.pageData) == null ? void 0 : r.compData) == null ? void 0 : o[0]) != null && l.contents && (a = Vs((m = (f = (h = (u = (s = (c = e.data.result) == null ? void 0 : c[0]) == null ? void 0 : s.value) == null ? void 0 : u.pageData) == null ? void 0 : h.compData) == null ? void 0 : f[0]) == null ? void 0 : m.contents)), a;
|
|
2005
|
-
}, Ks = (a) => {
|
|
2006
|
-
var i, n, r;
|
|
2007
|
-
const e = (n = (i = a == null ? void 0 : a.compData) == null ? void 0 : i.find((o) => (o == null ? void 0 : o.key) === "header")) == null ? void 0 : n.contents;
|
|
2008
|
-
return {
|
|
2009
|
-
label: a == null ? void 0 : a.name,
|
|
2010
|
-
value: a == null ? void 0 : a.name,
|
|
2011
|
-
children: e != null && e.every((o) => !Array.isArray(o)) ? e == null ? void 0 : e.map((o) => ({
|
|
2012
|
-
label: o == null ? void 0 : o.label,
|
|
2013
|
-
value: o == null ? void 0 : o.label
|
|
2014
|
-
})) : (r = Us(e == null ? void 0 : e[0])) == null ? void 0 : r.map((o) => ({
|
|
2015
|
-
label: o == null ? void 0 : o.label,
|
|
2016
|
-
value: o == null ? void 0 : o.label
|
|
2017
|
-
}))
|
|
2018
|
-
};
|
|
2019
|
-
}, qs = async (a) => {
|
|
2020
|
-
var i;
|
|
2021
|
-
let e = "";
|
|
2022
|
-
return (i = De(a)) == null || i.forEach((n) => {
|
|
2023
|
-
e = e === "" ? e + n : e + "/" + n;
|
|
2024
|
-
}), await St({
|
|
2025
|
-
key: {
|
|
2026
|
-
type: "structure",
|
|
2027
|
-
pageKey: e,
|
|
2028
|
-
systemKey: sessionStorage.getItem("systemKey"),
|
|
2029
|
-
parentTable: ""
|
|
2030
|
-
}
|
|
2031
|
-
});
|
|
2032
|
-
}, nc = async (a) => {
|
|
2033
|
-
var i, n, r;
|
|
2034
|
-
const e = await qs(a);
|
|
2035
|
-
let t = [];
|
|
2036
|
-
return ((i = e == null ? void 0 : e.data) == null ? void 0 : i.type) === "success" && (t = (r = (n = e.data.result) == null ? void 0 : n.map((o) => o.value.pageData)) == null ? void 0 : r.filter((o) => (o == null ? void 0 : o.comp) === "Table"), t = t == null ? void 0 : t.map((o) => Ks(o))), t;
|
|
2037
|
-
}, oc = [
|
|
2038
|
-
{
|
|
2039
|
-
key: "单选",
|
|
2040
|
-
value: "Select"
|
|
2041
|
-
},
|
|
2042
|
-
{
|
|
2043
|
-
key: "日期",
|
|
2044
|
-
value: "Date"
|
|
2045
|
-
},
|
|
2046
|
-
{
|
|
2047
|
-
key: "长文本",
|
|
2048
|
-
value: "TextArea"
|
|
2049
|
-
},
|
|
2050
|
-
{
|
|
2051
|
-
key: "上传",
|
|
2052
|
-
value: "Upload"
|
|
2053
|
-
}
|
|
2054
|
-
], It = [
|
|
2055
|
-
{
|
|
2056
|
-
label: "输入框",
|
|
2057
|
-
value: "Input"
|
|
2058
|
-
},
|
|
2059
|
-
{
|
|
2060
|
-
label: "单选框",
|
|
2061
|
-
value: "Select"
|
|
2062
|
-
},
|
|
2063
|
-
{
|
|
2064
|
-
label: "日期选择器",
|
|
2065
|
-
value: "Date"
|
|
2066
|
-
},
|
|
2067
|
-
{
|
|
2068
|
-
label: "长文本",
|
|
2069
|
-
value: "TextArea"
|
|
2070
|
-
},
|
|
2071
|
-
{
|
|
2072
|
-
label: "附件选择器",
|
|
2073
|
-
value: "Upload"
|
|
2074
|
-
}
|
|
2075
|
-
], Zs = [
|
|
2076
|
-
{
|
|
2077
|
-
key: "label",
|
|
2078
|
-
label: "标签名",
|
|
2079
|
-
type: "Input"
|
|
2080
|
-
},
|
|
2081
|
-
{
|
|
2082
|
-
key: "type",
|
|
2083
|
-
label: "类型",
|
|
2084
|
-
type: "Select",
|
|
2085
|
-
options: It
|
|
2086
|
-
},
|
|
2087
|
-
{
|
|
2088
|
-
key: "originalContent",
|
|
2089
|
-
label: "初始值",
|
|
2090
|
-
type: "Input"
|
|
2091
|
-
},
|
|
2092
|
-
{
|
|
2093
|
-
key: "value",
|
|
2094
|
-
label: "固定值",
|
|
2095
|
-
type: "Input"
|
|
2096
|
-
}
|
|
2097
|
-
], Qs = async () => {
|
|
2098
|
-
const a = await hr();
|
|
2099
|
-
return [
|
|
2100
|
-
{
|
|
2101
|
-
key: "label",
|
|
2102
|
-
label: "标签名",
|
|
2103
|
-
type: "Input"
|
|
2104
|
-
},
|
|
2105
|
-
{
|
|
2106
|
-
key: "type",
|
|
2107
|
-
label: "类型",
|
|
2108
|
-
type: "Select",
|
|
2109
|
-
options: It
|
|
2110
|
-
},
|
|
2111
|
-
{
|
|
2112
|
-
key: "originalContent",
|
|
2113
|
-
label: "初始值",
|
|
2114
|
-
type: "Select"
|
|
2115
|
-
},
|
|
2116
|
-
{
|
|
2117
|
-
key: "selectRelateType",
|
|
2118
|
-
label: "下拉绑定类型",
|
|
2119
|
-
type: "Select",
|
|
2120
|
-
options: [
|
|
2121
|
-
{
|
|
2122
|
-
label: "关联绑定列",
|
|
2123
|
-
value: "关联绑定列"
|
|
2124
|
-
},
|
|
2125
|
-
{
|
|
2126
|
-
label: "自定义绑定",
|
|
2127
|
-
value: "自定义绑定"
|
|
2128
|
-
}
|
|
2129
|
-
]
|
|
2130
|
-
},
|
|
2131
|
-
{
|
|
2132
|
-
key: "menuSelect",
|
|
2133
|
-
label: "菜单选项",
|
|
2134
|
-
type: "cascader",
|
|
2135
|
-
options: a
|
|
2136
|
-
},
|
|
2137
|
-
{
|
|
2138
|
-
key: "groupSelect",
|
|
2139
|
-
label: "组信息选项",
|
|
2140
|
-
type: "cascader",
|
|
2141
|
-
options: []
|
|
2142
|
-
},
|
|
2143
|
-
{
|
|
2144
|
-
key: "contents",
|
|
2145
|
-
label: "选项值",
|
|
2146
|
-
type: "Input"
|
|
2147
|
-
}
|
|
2148
|
-
];
|
|
2149
|
-
}, Js = async () => [
|
|
2150
|
-
{
|
|
2151
|
-
value: "",
|
|
2152
|
-
id: "v1",
|
|
2153
|
-
label: "菜单选项",
|
|
2154
|
-
name: "菜单选项",
|
|
2155
|
-
type: "cascader",
|
|
2156
|
-
contents: await hr()
|
|
2157
|
-
},
|
|
2158
|
-
{
|
|
2159
|
-
value: "",
|
|
2160
|
-
id: "v2",
|
|
2161
|
-
label: "组信息选项",
|
|
2162
|
-
name: "组信息选项",
|
|
2163
|
-
type: "cascader",
|
|
2164
|
-
contents: []
|
|
2165
|
-
},
|
|
2166
|
-
{
|
|
2167
|
-
value: "",
|
|
2168
|
-
id: "v2",
|
|
2169
|
-
label: "选项值",
|
|
2170
|
-
name: "选项值",
|
|
2171
|
-
type: "Input",
|
|
2172
|
-
contents: []
|
|
2173
|
-
}
|
|
2174
|
-
], el = Nr(async () => await Qs()), tl = [
|
|
2175
|
-
{
|
|
2176
|
-
key: "label",
|
|
2177
|
-
label: "标签名",
|
|
2178
|
-
type: "Input"
|
|
2179
|
-
},
|
|
2180
|
-
{
|
|
2181
|
-
key: "type",
|
|
2182
|
-
label: "类型",
|
|
2183
|
-
type: "Select",
|
|
2184
|
-
options: It
|
|
2185
|
-
},
|
|
2186
|
-
{
|
|
2187
|
-
key: "originalContent",
|
|
2188
|
-
label: "初始值",
|
|
2189
|
-
type: "Date"
|
|
2190
|
-
}
|
|
2191
|
-
], il = [
|
|
2192
|
-
{
|
|
2193
|
-
key: "label",
|
|
2194
|
-
label: "标签名",
|
|
2195
|
-
type: "Input"
|
|
2196
|
-
},
|
|
2197
|
-
{
|
|
2198
|
-
key: "type",
|
|
2199
|
-
label: "类型",
|
|
2200
|
-
type: "Select",
|
|
2201
|
-
options: It
|
|
2202
|
-
},
|
|
2203
|
-
{
|
|
2204
|
-
key: "originalContent",
|
|
2205
|
-
label: "初始值",
|
|
2206
|
-
type: "Input"
|
|
2207
|
-
}
|
|
2208
|
-
], al = [
|
|
2209
|
-
{
|
|
2210
|
-
key: "label",
|
|
2211
|
-
label: "标签名",
|
|
2212
|
-
type: "Input"
|
|
2213
|
-
},
|
|
2214
|
-
{
|
|
2215
|
-
key: "type",
|
|
2216
|
-
label: "类型",
|
|
2217
|
-
type: "Select",
|
|
2218
|
-
options: It
|
|
2219
|
-
}
|
|
2220
|
-
], sc = [
|
|
2221
|
-
{
|
|
2222
|
-
key: "Input",
|
|
2223
|
-
value: Zs
|
|
2224
|
-
},
|
|
2225
|
-
{
|
|
2226
|
-
key: "Select",
|
|
2227
|
-
value: el
|
|
2228
|
-
},
|
|
2229
|
-
{
|
|
2230
|
-
key: "Date",
|
|
2231
|
-
value: tl
|
|
2232
|
-
},
|
|
2233
|
-
{
|
|
2234
|
-
key: "TextArea",
|
|
2235
|
-
value: il
|
|
2236
|
-
},
|
|
2237
|
-
{
|
|
2238
|
-
key: "Upload",
|
|
2239
|
-
value: al
|
|
2240
|
-
}
|
|
2241
|
-
], rl = [
|
|
2242
|
-
{
|
|
2243
|
-
value: "normal",
|
|
2244
|
-
label: "自定义"
|
|
2245
|
-
},
|
|
2246
|
-
{
|
|
2247
|
-
value: "add",
|
|
2248
|
-
label: "新增"
|
|
2249
|
-
},
|
|
2250
|
-
{
|
|
2251
|
-
value: "fix",
|
|
2252
|
-
label: "修改"
|
|
2253
|
-
},
|
|
2254
|
-
{
|
|
2255
|
-
value: "view",
|
|
2256
|
-
label: "查看"
|
|
2257
|
-
},
|
|
2258
|
-
{
|
|
2259
|
-
value: "delete",
|
|
2260
|
-
label: "删除"
|
|
2261
|
-
}
|
|
2262
|
-
], lc = [
|
|
2263
|
-
{
|
|
2264
|
-
key: "label",
|
|
2265
|
-
label: "按钮名",
|
|
2266
|
-
type: "Input"
|
|
2267
|
-
},
|
|
2268
|
-
{
|
|
2269
|
-
key: "type",
|
|
2270
|
-
label: "类型",
|
|
2271
|
-
type: "Select",
|
|
2272
|
-
options: rl
|
|
2273
|
-
},
|
|
2274
|
-
{
|
|
2275
|
-
key: "background",
|
|
2276
|
-
label: "颜色",
|
|
2277
|
-
type: "Color"
|
|
2278
|
-
}
|
|
2279
|
-
], cc = (a) => {
|
|
2280
|
-
var t, i, n, r, o, l, c, s;
|
|
2281
|
-
let e = De(a);
|
|
2282
|
-
if (((t = e == null ? void 0 : e.find((u) => (u == null ? void 0 : u.name) === "类型")) == null ? void 0 : t.type) === "Select" && ((r = (n = (i = De(e)) == null ? void 0 : i.find((u) => (u == null ? void 0 : u.name) === "选项值")) == null ? void 0 : n.value) == null ? void 0 : r.length) > 0) {
|
|
2283
|
-
const u = (s = (c = (l = (o = De(e)) == null ? void 0 : o.find((h) => (h == null ? void 0 : h.name) === "选项值")) == null ? void 0 : l.value) == null ? void 0 : c.split(",")) == null ? void 0 : s.map((h) => ({
|
|
2284
|
-
label: h,
|
|
2285
|
-
value: h
|
|
2286
|
-
}));
|
|
2287
|
-
e = e == null ? void 0 : e.map((h) => ((h == null ? void 0 : h.name) === "初始值" && (h.contents = u, h.value = (h == null ? void 0 : h.value) ?? ""), h));
|
|
2288
|
-
}
|
|
2289
|
-
return e;
|
|
2290
|
-
}, ur = (a) => {
|
|
2291
|
-
var n;
|
|
2292
|
-
let e = {};
|
|
2293
|
-
const t = (n = a == null ? void 0 : a.filter((r) => !Array.isArray(r))) == null ? void 0 : n[0];
|
|
2294
|
-
e.label = t, e.value = t;
|
|
2295
|
-
const i = a == null ? void 0 : a.filter((r) => Array.isArray(r));
|
|
2296
|
-
return i && (i == null ? void 0 : i.length) > 0 && (e.children = i == null ? void 0 : i.map((r) => ur(r))), e;
|
|
2297
|
-
}, hc = async (a) => {
|
|
2298
|
-
var r, o, l, c;
|
|
2299
|
-
let e = De(a);
|
|
2300
|
-
const t = (r = a == null ? void 0 : a.find((s) => (s == null ? void 0 : s.name) === "下拉绑定类型")) == null ? void 0 : r.value, i = (o = a == null ? void 0 : a.find((s) => (s == null ? void 0 : s.name) === "类型")) == null ? void 0 : o.value, n = await Js();
|
|
2301
|
-
return i === "Select" && t === "" ? e = e == null ? void 0 : e.filter((s) => (s == null ? void 0 : s.name) !== "菜单选项" && (s == null ? void 0 : s.name) !== "组信息选项" && (s == null ? void 0 : s.name) !== "选项值") : i === "Select" && t === "关联绑定列" ? e != null && e.find((s) => (s == null ? void 0 : s.name) === "菜单选项" || (s == null ? void 0 : s.name) === "组信息选项") ? e = (l = De(e)) == null ? void 0 : l.filter((s) => (s == null ? void 0 : s.name) !== "选项值") : e = [...De(e), ...n].filter((s) => (s == null ? void 0 : s.name) !== "选项值") : i === "Select" && t === "自定义绑定" && (e != null && e.find((s) => (s == null ? void 0 : s.name) === "选项值") ? e = (c = De(e)) == null ? void 0 : c.filter((s) => (s == null ? void 0 : s.name) !== "菜单选项" && (s == null ? void 0 : s.name) !== "组信息选项") : e = [...De(e), ...n].filter((s) => (s == null ? void 0 : s.name) !== "菜单选项" && (s == null ? void 0 : s.name) !== "组信息选项")), e;
|
|
2302
|
-
};
|
|
2303
|
-
/*!
|
|
2304
|
-
* Cropper.js v1.6.2
|
|
2305
|
-
* https://fengyuanchen.github.io/cropperjs
|
|
2306
|
-
*
|
|
2307
|
-
* Copyright 2015-present Chen Fengyuan
|
|
2308
|
-
* Released under the MIT license
|
|
2309
|
-
*
|
|
2310
|
-
* Date: 2024-04-21T07:43:05.335Z
|
|
2311
|
-
*/
|
|
2312
|
-
function Ea(a, e) {
|
|
2313
|
-
var t = Object.keys(a);
|
|
2314
|
-
if (Object.getOwnPropertySymbols) {
|
|
2315
|
-
var i = Object.getOwnPropertySymbols(a);
|
|
2316
|
-
e && (i = i.filter(function(n) {
|
|
2317
|
-
return Object.getOwnPropertyDescriptor(a, n).enumerable;
|
|
2318
|
-
})), t.push.apply(t, i);
|
|
2319
|
-
}
|
|
2320
|
-
return t;
|
|
2321
|
-
}
|
|
2322
|
-
function fr(a) {
|
|
2323
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
2324
|
-
var t = arguments[e] != null ? arguments[e] : {};
|
|
2325
|
-
e % 2 ? Ea(Object(t), !0).forEach(function(i) {
|
|
2326
|
-
ll(a, i, t[i]);
|
|
2327
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : Ea(Object(t)).forEach(function(i) {
|
|
2328
|
-
Object.defineProperty(a, i, Object.getOwnPropertyDescriptor(t, i));
|
|
2329
|
-
});
|
|
2330
|
-
}
|
|
2331
|
-
return a;
|
|
2332
|
-
}
|
|
2333
|
-
function nl(a, e) {
|
|
2334
|
-
if (typeof a != "object" || !a) return a;
|
|
2335
|
-
var t = a[Symbol.toPrimitive];
|
|
2336
|
-
if (t !== void 0) {
|
|
2337
|
-
var i = t.call(a, e);
|
|
2338
|
-
if (typeof i != "object") return i;
|
|
2339
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2340
|
-
}
|
|
2341
|
-
return String(a);
|
|
2342
|
-
}
|
|
2343
|
-
function dr(a) {
|
|
2344
|
-
var e = nl(a, "string");
|
|
2345
|
-
return typeof e == "symbol" ? e : e + "";
|
|
2346
|
-
}
|
|
2347
|
-
function Ti(a) {
|
|
2348
|
-
"@babel/helpers - typeof";
|
|
2349
|
-
return Ti = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2350
|
-
return typeof e;
|
|
2351
|
-
} : function(e) {
|
|
2352
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2353
|
-
}, Ti(a);
|
|
2354
|
-
}
|
|
2355
|
-
function ol(a, e) {
|
|
2356
|
-
if (!(a instanceof e))
|
|
2357
|
-
throw new TypeError("Cannot call a class as a function");
|
|
2358
|
-
}
|
|
2359
|
-
function Ta(a, e) {
|
|
2360
|
-
for (var t = 0; t < e.length; t++) {
|
|
2361
|
-
var i = e[t];
|
|
2362
|
-
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(a, dr(i.key), i);
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
function sl(a, e, t) {
|
|
2366
|
-
return e && Ta(a.prototype, e), t && Ta(a, t), Object.defineProperty(a, "prototype", {
|
|
2367
|
-
writable: !1
|
|
2368
|
-
}), a;
|
|
2369
|
-
}
|
|
2370
|
-
function ll(a, e, t) {
|
|
2371
|
-
return e = dr(e), e in a ? Object.defineProperty(a, e, {
|
|
2372
|
-
value: t,
|
|
2373
|
-
enumerable: !0,
|
|
2374
|
-
configurable: !0,
|
|
2375
|
-
writable: !0
|
|
2376
|
-
}) : a[e] = t, a;
|
|
2377
|
-
}
|
|
2378
|
-
function pr(a) {
|
|
2379
|
-
return cl(a) || hl(a) || ul(a) || fl();
|
|
2380
|
-
}
|
|
2381
|
-
function cl(a) {
|
|
2382
|
-
if (Array.isArray(a)) return Si(a);
|
|
2383
|
-
}
|
|
2384
|
-
function hl(a) {
|
|
2385
|
-
if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
|
|
2386
|
-
}
|
|
2387
|
-
function ul(a, e) {
|
|
2388
|
-
if (a) {
|
|
2389
|
-
if (typeof a == "string") return Si(a, e);
|
|
2390
|
-
var t = Object.prototype.toString.call(a).slice(8, -1);
|
|
2391
|
-
if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(a);
|
|
2392
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Si(a, e);
|
|
2393
|
-
}
|
|
2394
|
-
}
|
|
2395
|
-
function Si(a, e) {
|
|
2396
|
-
(e == null || e > a.length) && (e = a.length);
|
|
2397
|
-
for (var t = 0, i = new Array(e); t < e; t++) i[t] = a[t];
|
|
2398
|
-
return i;
|
|
2399
|
-
}
|
|
2400
|
-
function fl() {
|
|
2401
|
-
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2402
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2403
|
-
}
|
|
2404
|
-
var ii = typeof window < "u" && typeof window.document < "u", xe = ii ? window : {}, Hi = ii && xe.document.documentElement ? "ontouchstart" in xe.document.documentElement : !1, Xi = ii ? "PointerEvent" in xe : !1, G = "cropper", Fi = "all", gr = "crop", mr = "move", vr = "zoom", He = "e", Xe = "w", Ke = "s", Ie = "n", ht = "ne", ut = "nw", ft = "se", dt = "sw", xi = "".concat(G, "-crop"), Sa = "".concat(G, "-disabled"), fe = "".concat(G, "-hidden"), xa = "".concat(G, "-hide"), dl = "".concat(G, "-invisible"), Jt = "".concat(G, "-modal"), _i = "".concat(G, "-move"), xt = "".concat(G, "Action"), Rt = "".concat(G, "Preview"), Wi = "crop", br = "move", yr = "none", Oi = "crop", Mi = "cropend", Ci = "cropmove", Ai = "cropstart", _a = "dblclick", pl = Hi ? "touchstart" : "mousedown", gl = Hi ? "touchmove" : "mousemove", ml = Hi ? "touchend touchcancel" : "mouseup", Oa = Xi ? "pointerdown" : pl, Ma = Xi ? "pointermove" : gl, Ca = Xi ? "pointerup pointercancel" : ml, Aa = "ready", Ia = "resize", Na = "wheel", Ii = "zoom", $a = "image/jpeg", vl = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/, bl = /^data:/, yl = /^data:image\/jpeg;base64,/, wl = /^img|canvas$/i, wr = 200, Dr = 100, Pa = {
|
|
2405
|
-
// Define the view mode of the cropper
|
|
2406
|
-
viewMode: 0,
|
|
2407
|
-
// 0, 1, 2, 3
|
|
2408
|
-
// Define the dragging mode of the cropper
|
|
2409
|
-
dragMode: Wi,
|
|
2410
|
-
// 'crop', 'move' or 'none'
|
|
2411
|
-
// Define the initial aspect ratio of the crop box
|
|
2412
|
-
initialAspectRatio: NaN,
|
|
2413
|
-
// Define the aspect ratio of the crop box
|
|
2414
|
-
aspectRatio: NaN,
|
|
2415
|
-
// An object with the previous cropping result data
|
|
2416
|
-
data: null,
|
|
2417
|
-
// A selector for adding extra containers to preview
|
|
2418
|
-
preview: "",
|
|
2419
|
-
// Re-render the cropper when resize the window
|
|
2420
|
-
responsive: !0,
|
|
2421
|
-
// Restore the cropped area after resize the window
|
|
2422
|
-
restore: !0,
|
|
2423
|
-
// Check if the current image is a cross-origin image
|
|
2424
|
-
checkCrossOrigin: !0,
|
|
2425
|
-
// Check the current image's Exif Orientation information
|
|
2426
|
-
checkOrientation: !0,
|
|
2427
|
-
// Show the black modal
|
|
2428
|
-
modal: !0,
|
|
2429
|
-
// Show the dashed lines for guiding
|
|
2430
|
-
guides: !0,
|
|
2431
|
-
// Show the center indicator for guiding
|
|
2432
|
-
center: !0,
|
|
2433
|
-
// Show the white modal to highlight the crop box
|
|
2434
|
-
highlight: !0,
|
|
2435
|
-
// Show the grid background
|
|
2436
|
-
background: !0,
|
|
2437
|
-
// Enable to crop the image automatically when initialize
|
|
2438
|
-
autoCrop: !0,
|
|
2439
|
-
// Define the percentage of automatic cropping area when initializes
|
|
2440
|
-
autoCropArea: 0.8,
|
|
2441
|
-
// Enable to move the image
|
|
2442
|
-
movable: !0,
|
|
2443
|
-
// Enable to rotate the image
|
|
2444
|
-
rotatable: !0,
|
|
2445
|
-
// Enable to scale the image
|
|
2446
|
-
scalable: !0,
|
|
2447
|
-
// Enable to zoom the image
|
|
2448
|
-
zoomable: !0,
|
|
2449
|
-
// Enable to zoom the image by dragging touch
|
|
2450
|
-
zoomOnTouch: !0,
|
|
2451
|
-
// Enable to zoom the image by wheeling mouse
|
|
2452
|
-
zoomOnWheel: !0,
|
|
2453
|
-
// Define zoom ratio when zoom the image by wheeling mouse
|
|
2454
|
-
wheelZoomRatio: 0.1,
|
|
2455
|
-
// Enable to move the crop box
|
|
2456
|
-
cropBoxMovable: !0,
|
|
2457
|
-
// Enable to resize the crop box
|
|
2458
|
-
cropBoxResizable: !0,
|
|
2459
|
-
// Toggle drag mode between "crop" and "move" when click twice on the cropper
|
|
2460
|
-
toggleDragModeOnDblclick: !0,
|
|
2461
|
-
// Size limitation
|
|
2462
|
-
minCanvasWidth: 0,
|
|
2463
|
-
minCanvasHeight: 0,
|
|
2464
|
-
minCropBoxWidth: 0,
|
|
2465
|
-
minCropBoxHeight: 0,
|
|
2466
|
-
minContainerWidth: wr,
|
|
2467
|
-
minContainerHeight: Dr,
|
|
2468
|
-
// Shortcuts of events
|
|
2469
|
-
ready: null,
|
|
2470
|
-
cropstart: null,
|
|
2471
|
-
cropmove: null,
|
|
2472
|
-
cropend: null,
|
|
2473
|
-
crop: null,
|
|
2474
|
-
zoom: null
|
|
2475
|
-
}, Dl = '<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>', El = Number.isNaN || xe.isNaN;
|
|
2476
|
-
function P(a) {
|
|
2477
|
-
return typeof a == "number" && !El(a);
|
|
2478
|
-
}
|
|
2479
|
-
var ja = function(e) {
|
|
2480
|
-
return e > 0 && e < 1 / 0;
|
|
2481
|
-
};
|
|
2482
|
-
function di(a) {
|
|
2483
|
-
return typeof a > "u";
|
|
2484
|
-
}
|
|
2485
|
-
function We(a) {
|
|
2486
|
-
return Ti(a) === "object" && a !== null;
|
|
2487
|
-
}
|
|
2488
|
-
var Tl = Object.prototype.hasOwnProperty;
|
|
2489
|
-
function Qe(a) {
|
|
2490
|
-
if (!We(a))
|
|
2491
|
-
return !1;
|
|
2492
|
-
try {
|
|
2493
|
-
var e = a.constructor, t = e.prototype;
|
|
2494
|
-
return e && t && Tl.call(t, "isPrototypeOf");
|
|
2495
|
-
} catch {
|
|
2496
|
-
return !1;
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
function ue(a) {
|
|
2500
|
-
return typeof a == "function";
|
|
2501
|
-
}
|
|
2502
|
-
var Sl = Array.prototype.slice;
|
|
2503
|
-
function Er(a) {
|
|
2504
|
-
return Array.from ? Array.from(a) : Sl.call(a);
|
|
2505
|
-
}
|
|
2506
|
-
function te(a, e) {
|
|
2507
|
-
return a && ue(e) && (Array.isArray(a) || P(a.length) ? Er(a).forEach(function(t, i) {
|
|
2508
|
-
e.call(a, t, i, a);
|
|
2509
|
-
}) : We(a) && Object.keys(a).forEach(function(t) {
|
|
2510
|
-
e.call(a, a[t], t, a);
|
|
2511
|
-
})), a;
|
|
2512
|
-
}
|
|
2513
|
-
var V = Object.assign || function(e) {
|
|
2514
|
-
for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
2515
|
-
i[n - 1] = arguments[n];
|
|
2516
|
-
return We(e) && i.length > 0 && i.forEach(function(r) {
|
|
2517
|
-
We(r) && Object.keys(r).forEach(function(o) {
|
|
2518
|
-
e[o] = r[o];
|
|
2519
|
-
});
|
|
2520
|
-
}), e;
|
|
2521
|
-
}, xl = /\.\d*(?:0|9){12}\d*$/;
|
|
2522
|
-
function it(a) {
|
|
2523
|
-
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
|
|
2524
|
-
return xl.test(a) ? Math.round(a * e) / e : a;
|
|
2525
|
-
}
|
|
2526
|
-
var _l = /^width|height|left|top|marginLeft|marginTop$/;
|
|
2527
|
-
function je(a, e) {
|
|
2528
|
-
var t = a.style;
|
|
2529
|
-
te(e, function(i, n) {
|
|
2530
|
-
_l.test(n) && P(i) && (i = "".concat(i, "px")), t[n] = i;
|
|
2531
|
-
});
|
|
2532
|
-
}
|
|
2533
|
-
function Ol(a, e) {
|
|
2534
|
-
return a.classList ? a.classList.contains(e) : a.className.indexOf(e) > -1;
|
|
2535
|
-
}
|
|
2536
|
-
function re(a, e) {
|
|
2537
|
-
if (e) {
|
|
2538
|
-
if (P(a.length)) {
|
|
2539
|
-
te(a, function(i) {
|
|
2540
|
-
re(i, e);
|
|
2541
|
-
});
|
|
2542
|
-
return;
|
|
2543
|
-
}
|
|
2544
|
-
if (a.classList) {
|
|
2545
|
-
a.classList.add(e);
|
|
2546
|
-
return;
|
|
2547
|
-
}
|
|
2548
|
-
var t = a.className.trim();
|
|
2549
|
-
t ? t.indexOf(e) < 0 && (a.className = "".concat(t, " ").concat(e)) : a.className = e;
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
function Te(a, e) {
|
|
2553
|
-
if (e) {
|
|
2554
|
-
if (P(a.length)) {
|
|
2555
|
-
te(a, function(t) {
|
|
2556
|
-
Te(t, e);
|
|
2557
|
-
});
|
|
2558
|
-
return;
|
|
2559
|
-
}
|
|
2560
|
-
if (a.classList) {
|
|
2561
|
-
a.classList.remove(e);
|
|
2562
|
-
return;
|
|
2563
|
-
}
|
|
2564
|
-
a.className.indexOf(e) >= 0 && (a.className = a.className.replace(e, ""));
|
|
2565
|
-
}
|
|
2566
|
-
}
|
|
2567
|
-
function Je(a, e, t) {
|
|
2568
|
-
if (e) {
|
|
2569
|
-
if (P(a.length)) {
|
|
2570
|
-
te(a, function(i) {
|
|
2571
|
-
Je(i, e, t);
|
|
2572
|
-
});
|
|
2573
|
-
return;
|
|
2574
|
-
}
|
|
2575
|
-
t ? re(a, e) : Te(a, e);
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
var Ml = /([a-z\d])([A-Z])/g;
|
|
2579
|
-
function zi(a) {
|
|
2580
|
-
return a.replace(Ml, "$1-$2").toLowerCase();
|
|
2581
|
-
}
|
|
2582
|
-
function Ni(a, e) {
|
|
2583
|
-
return We(a[e]) ? a[e] : a.dataset ? a.dataset[e] : a.getAttribute("data-".concat(zi(e)));
|
|
2584
|
-
}
|
|
2585
|
-
function _t(a, e, t) {
|
|
2586
|
-
We(t) ? a[e] = t : a.dataset ? a.dataset[e] = t : a.setAttribute("data-".concat(zi(e)), t);
|
|
2587
|
-
}
|
|
2588
|
-
function Cl(a, e) {
|
|
2589
|
-
if (We(a[e]))
|
|
2590
|
-
try {
|
|
2591
|
-
delete a[e];
|
|
2592
|
-
} catch {
|
|
2593
|
-
a[e] = void 0;
|
|
2594
|
-
}
|
|
2595
|
-
else if (a.dataset)
|
|
2596
|
-
try {
|
|
2597
|
-
delete a.dataset[e];
|
|
2598
|
-
} catch {
|
|
2599
|
-
a.dataset[e] = void 0;
|
|
2600
|
-
}
|
|
2601
|
-
else
|
|
2602
|
-
a.removeAttribute("data-".concat(zi(e)));
|
|
2603
|
-
}
|
|
2604
|
-
var Tr = /\s\s*/, Sr = function() {
|
|
2605
|
-
var a = !1;
|
|
2606
|
-
if (ii) {
|
|
2607
|
-
var e = !1, t = function() {
|
|
2608
|
-
}, i = Object.defineProperty({}, "once", {
|
|
2609
|
-
get: function() {
|
|
2610
|
-
return a = !0, e;
|
|
2611
|
-
},
|
|
2612
|
-
/**
|
|
2613
|
-
* This setter can fix a `TypeError` in strict mode
|
|
2614
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
|
|
2615
|
-
* @param {boolean} value - The value to set
|
|
2616
|
-
*/
|
|
2617
|
-
set: function(r) {
|
|
2618
|
-
e = r;
|
|
2619
|
-
}
|
|
2620
|
-
});
|
|
2621
|
-
xe.addEventListener("test", t, i), xe.removeEventListener("test", t, i);
|
|
2622
|
-
}
|
|
2623
|
-
return a;
|
|
2624
|
-
}();
|
|
2625
|
-
function ye(a, e, t) {
|
|
2626
|
-
var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, n = t;
|
|
2627
|
-
e.trim().split(Tr).forEach(function(r) {
|
|
2628
|
-
if (!Sr) {
|
|
2629
|
-
var o = a.listeners;
|
|
2630
|
-
o && o[r] && o[r][t] && (n = o[r][t], delete o[r][t], Object.keys(o[r]).length === 0 && delete o[r], Object.keys(o).length === 0 && delete a.listeners);
|
|
2631
|
-
}
|
|
2632
|
-
a.removeEventListener(r, n, i);
|
|
2633
|
-
});
|
|
2634
|
-
}
|
|
2635
|
-
function me(a, e, t) {
|
|
2636
|
-
var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, n = t;
|
|
2637
|
-
e.trim().split(Tr).forEach(function(r) {
|
|
2638
|
-
if (i.once && !Sr) {
|
|
2639
|
-
var o = a.listeners, l = o === void 0 ? {} : o;
|
|
2640
|
-
n = function() {
|
|
2641
|
-
delete l[r][t], a.removeEventListener(r, n, i);
|
|
2642
|
-
for (var s = arguments.length, u = new Array(s), h = 0; h < s; h++)
|
|
2643
|
-
u[h] = arguments[h];
|
|
2644
|
-
t.apply(a, u);
|
|
2645
|
-
}, l[r] || (l[r] = {}), l[r][t] && a.removeEventListener(r, l[r][t], i), l[r][t] = n, a.listeners = l;
|
|
2646
|
-
}
|
|
2647
|
-
a.addEventListener(r, n, i);
|
|
2648
|
-
});
|
|
2649
|
-
}
|
|
2650
|
-
function at(a, e, t) {
|
|
2651
|
-
var i;
|
|
2652
|
-
return ue(Event) && ue(CustomEvent) ? i = new CustomEvent(e, {
|
|
2653
|
-
detail: t,
|
|
2654
|
-
bubbles: !0,
|
|
2655
|
-
cancelable: !0
|
|
2656
|
-
}) : (i = document.createEvent("CustomEvent"), i.initCustomEvent(e, !0, !0, t)), a.dispatchEvent(i);
|
|
2657
|
-
}
|
|
2658
|
-
function xr(a) {
|
|
2659
|
-
var e = a.getBoundingClientRect();
|
|
2660
|
-
return {
|
|
2661
|
-
left: e.left + (window.pageXOffset - document.documentElement.clientLeft),
|
|
2662
|
-
top: e.top + (window.pageYOffset - document.documentElement.clientTop)
|
|
2663
|
-
};
|
|
2664
|
-
}
|
|
2665
|
-
var pi = xe.location, Al = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
|
|
2666
|
-
function ka(a) {
|
|
2667
|
-
var e = a.match(Al);
|
|
2668
|
-
return e !== null && (e[1] !== pi.protocol || e[2] !== pi.hostname || e[3] !== pi.port);
|
|
2669
|
-
}
|
|
2670
|
-
function Ra(a) {
|
|
2671
|
-
var e = "timestamp=".concat((/* @__PURE__ */ new Date()).getTime());
|
|
2672
|
-
return a + (a.indexOf("?") === -1 ? "?" : "&") + e;
|
|
2673
|
-
}
|
|
2674
|
-
function Tt(a) {
|
|
2675
|
-
var e = a.rotate, t = a.scaleX, i = a.scaleY, n = a.translateX, r = a.translateY, o = [];
|
|
2676
|
-
P(n) && n !== 0 && o.push("translateX(".concat(n, "px)")), P(r) && r !== 0 && o.push("translateY(".concat(r, "px)")), P(e) && e !== 0 && o.push("rotate(".concat(e, "deg)")), P(t) && t !== 1 && o.push("scaleX(".concat(t, ")")), P(i) && i !== 1 && o.push("scaleY(".concat(i, ")"));
|
|
2677
|
-
var l = o.length ? o.join(" ") : "none";
|
|
2678
|
-
return {
|
|
2679
|
-
WebkitTransform: l,
|
|
2680
|
-
msTransform: l,
|
|
2681
|
-
transform: l
|
|
2682
|
-
};
|
|
2683
|
-
}
|
|
2684
|
-
function Il(a) {
|
|
2685
|
-
var e = fr({}, a), t = 0;
|
|
2686
|
-
return te(a, function(i, n) {
|
|
2687
|
-
delete e[n], te(e, function(r) {
|
|
2688
|
-
var o = Math.abs(i.startX - r.startX), l = Math.abs(i.startY - r.startY), c = Math.abs(i.endX - r.endX), s = Math.abs(i.endY - r.endY), u = Math.sqrt(o * o + l * l), h = Math.sqrt(c * c + s * s), f = (h - u) / u;
|
|
2689
|
-
Math.abs(f) > Math.abs(t) && (t = f);
|
|
2690
|
-
});
|
|
2691
|
-
}), t;
|
|
2692
|
-
}
|
|
2693
|
-
function Bt(a, e) {
|
|
2694
|
-
var t = a.pageX, i = a.pageY, n = {
|
|
2695
|
-
endX: t,
|
|
2696
|
-
endY: i
|
|
2697
|
-
};
|
|
2698
|
-
return e ? n : fr({
|
|
2699
|
-
startX: t,
|
|
2700
|
-
startY: i
|
|
2701
|
-
}, n);
|
|
2702
|
-
}
|
|
2703
|
-
function Nl(a) {
|
|
2704
|
-
var e = 0, t = 0, i = 0;
|
|
2705
|
-
return te(a, function(n) {
|
|
2706
|
-
var r = n.startX, o = n.startY;
|
|
2707
|
-
e += r, t += o, i += 1;
|
|
2708
|
-
}), e /= i, t /= i, {
|
|
2709
|
-
pageX: e,
|
|
2710
|
-
pageY: t
|
|
2711
|
-
};
|
|
2712
|
-
}
|
|
2713
|
-
function ke(a) {
|
|
2714
|
-
var e = a.aspectRatio, t = a.height, i = a.width, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "contain", r = ja(i), o = ja(t);
|
|
2715
|
-
if (r && o) {
|
|
2716
|
-
var l = t * e;
|
|
2717
|
-
n === "contain" && l > i || n === "cover" && l < i ? t = i / e : i = t * e;
|
|
2718
|
-
} else r ? t = i / e : o && (i = t * e);
|
|
2719
|
-
return {
|
|
2720
|
-
width: i,
|
|
2721
|
-
height: t
|
|
2722
|
-
};
|
|
2723
|
-
}
|
|
2724
|
-
function $l(a) {
|
|
2725
|
-
var e = a.width, t = a.height, i = a.degree;
|
|
2726
|
-
if (i = Math.abs(i) % 180, i === 90)
|
|
2727
|
-
return {
|
|
2728
|
-
width: t,
|
|
2729
|
-
height: e
|
|
2730
|
-
};
|
|
2731
|
-
var n = i % 90 * Math.PI / 180, r = Math.sin(n), o = Math.cos(n), l = e * o + t * r, c = e * r + t * o;
|
|
2732
|
-
return i > 90 ? {
|
|
2733
|
-
width: c,
|
|
2734
|
-
height: l
|
|
2735
|
-
} : {
|
|
2736
|
-
width: l,
|
|
2737
|
-
height: c
|
|
2738
|
-
};
|
|
2739
|
-
}
|
|
2740
|
-
function Pl(a, e, t, i) {
|
|
2741
|
-
var n = e.aspectRatio, r = e.naturalWidth, o = e.naturalHeight, l = e.rotate, c = l === void 0 ? 0 : l, s = e.scaleX, u = s === void 0 ? 1 : s, h = e.scaleY, f = h === void 0 ? 1 : h, m = t.aspectRatio, v = t.naturalWidth, E = t.naturalHeight, M = i.fillColor, B = M === void 0 ? "transparent" : M, I = i.imageSmoothingEnabled, N = I === void 0 ? !0 : I, W = i.imageSmoothingQuality, H = W === void 0 ? "low" : W, d = i.maxWidth, A = d === void 0 ? 1 / 0 : d, Y = i.maxHeight, L = Y === void 0 ? 1 / 0 : Y, k = i.minWidth, _ = k === void 0 ? 0 : k, ie = i.minHeight, Z = ie === void 0 ? 0 : ie, w = document.createElement("canvas"), g = w.getContext("2d"), p = ke({
|
|
2742
|
-
aspectRatio: m,
|
|
2743
|
-
width: A,
|
|
2744
|
-
height: L
|
|
2745
|
-
}), D = ke({
|
|
2746
|
-
aspectRatio: m,
|
|
2747
|
-
width: _,
|
|
2748
|
-
height: Z
|
|
2749
|
-
}, "cover"), y = Math.min(p.width, Math.max(D.width, v)), S = Math.min(p.height, Math.max(D.height, E)), O = ke({
|
|
2750
|
-
aspectRatio: n,
|
|
2751
|
-
width: A,
|
|
2752
|
-
height: L
|
|
2753
|
-
}), R = ke({
|
|
2754
|
-
aspectRatio: n,
|
|
2755
|
-
width: _,
|
|
2756
|
-
height: Z
|
|
2757
|
-
}, "cover"), X = Math.min(O.width, Math.max(R.width, r)), Q = Math.min(O.height, Math.max(R.height, o)), ae = [-X / 2, -Q / 2, X, Q];
|
|
2758
|
-
return w.width = it(y), w.height = it(S), g.fillStyle = B, g.fillRect(0, 0, y, S), g.save(), g.translate(y / 2, S / 2), g.rotate(c * Math.PI / 180), g.scale(u, f), g.imageSmoothingEnabled = N, g.imageSmoothingQuality = H, g.drawImage.apply(g, [a].concat(pr(ae.map(function(le) {
|
|
2759
|
-
return Math.floor(it(le));
|
|
2760
|
-
})))), g.restore(), w;
|
|
2761
|
-
}
|
|
2762
|
-
var _r = String.fromCharCode;
|
|
2763
|
-
function jl(a, e, t) {
|
|
2764
|
-
var i = "";
|
|
2765
|
-
t += e;
|
|
2766
|
-
for (var n = e; n < t; n += 1)
|
|
2767
|
-
i += _r(a.getUint8(n));
|
|
2768
|
-
return i;
|
|
2769
|
-
}
|
|
2770
|
-
var kl = /^data:.*,/;
|
|
2771
|
-
function Rl(a) {
|
|
2772
|
-
var e = a.replace(kl, ""), t = atob(e), i = new ArrayBuffer(t.length), n = new Uint8Array(i);
|
|
2773
|
-
return te(n, function(r, o) {
|
|
2774
|
-
n[o] = t.charCodeAt(o);
|
|
2775
|
-
}), i;
|
|
2776
|
-
}
|
|
2777
|
-
function Bl(a, e) {
|
|
2778
|
-
for (var t = [], i = 8192, n = new Uint8Array(a); n.length > 0; )
|
|
2779
|
-
t.push(_r.apply(null, Er(n.subarray(0, i)))), n = n.subarray(i);
|
|
2780
|
-
return "data:".concat(e, ";base64,").concat(btoa(t.join("")));
|
|
2781
|
-
}
|
|
2782
|
-
function Ll(a) {
|
|
2783
|
-
var e = new DataView(a), t;
|
|
2784
|
-
try {
|
|
2785
|
-
var i, n, r;
|
|
2786
|
-
if (e.getUint8(0) === 255 && e.getUint8(1) === 216)
|
|
2787
|
-
for (var o = e.byteLength, l = 2; l + 1 < o; ) {
|
|
2788
|
-
if (e.getUint8(l) === 255 && e.getUint8(l + 1) === 225) {
|
|
2789
|
-
n = l;
|
|
2790
|
-
break;
|
|
2791
|
-
}
|
|
2792
|
-
l += 1;
|
|
2793
|
-
}
|
|
2794
|
-
if (n) {
|
|
2795
|
-
var c = n + 4, s = n + 10;
|
|
2796
|
-
if (jl(e, c, 4) === "Exif") {
|
|
2797
|
-
var u = e.getUint16(s);
|
|
2798
|
-
if (i = u === 18761, (i || u === 19789) && e.getUint16(s + 2, i) === 42) {
|
|
2799
|
-
var h = e.getUint32(s + 4, i);
|
|
2800
|
-
h >= 8 && (r = s + h);
|
|
2801
|
-
}
|
|
2802
|
-
}
|
|
2803
|
-
}
|
|
2804
|
-
if (r) {
|
|
2805
|
-
var f = e.getUint16(r, i), m, v;
|
|
2806
|
-
for (v = 0; v < f; v += 1)
|
|
2807
|
-
if (m = r + v * 12 + 2, e.getUint16(m, i) === 274) {
|
|
2808
|
-
m += 8, t = e.getUint16(m, i), e.setUint16(m, 1, i);
|
|
2809
|
-
break;
|
|
2810
|
-
}
|
|
2811
|
-
}
|
|
2812
|
-
} catch {
|
|
2813
|
-
t = 1;
|
|
2814
|
-
}
|
|
2815
|
-
return t;
|
|
2816
|
-
}
|
|
2817
|
-
function Yl(a) {
|
|
2818
|
-
var e = 0, t = 1, i = 1;
|
|
2819
|
-
switch (a) {
|
|
2820
|
-
// Flip horizontal
|
|
2821
|
-
case 2:
|
|
2822
|
-
t = -1;
|
|
2823
|
-
break;
|
|
2824
|
-
// Rotate left 180°
|
|
2825
|
-
case 3:
|
|
2826
|
-
e = -180;
|
|
2827
|
-
break;
|
|
2828
|
-
// Flip vertical
|
|
2829
|
-
case 4:
|
|
2830
|
-
i = -1;
|
|
2831
|
-
break;
|
|
2832
|
-
// Flip vertical and rotate right 90°
|
|
2833
|
-
case 5:
|
|
2834
|
-
e = 90, i = -1;
|
|
2835
|
-
break;
|
|
2836
|
-
// Rotate right 90°
|
|
2837
|
-
case 6:
|
|
2838
|
-
e = 90;
|
|
2839
|
-
break;
|
|
2840
|
-
// Flip horizontal and rotate right 90°
|
|
2841
|
-
case 7:
|
|
2842
|
-
e = 90, t = -1;
|
|
2843
|
-
break;
|
|
2844
|
-
// Rotate left 90°
|
|
2845
|
-
case 8:
|
|
2846
|
-
e = -90;
|
|
2847
|
-
break;
|
|
2848
|
-
}
|
|
2849
|
-
return {
|
|
2850
|
-
rotate: e,
|
|
2851
|
-
scaleX: t,
|
|
2852
|
-
scaleY: i
|
|
2853
|
-
};
|
|
2854
|
-
}
|
|
2855
|
-
var Hl = {
|
|
2856
|
-
render: function() {
|
|
2857
|
-
this.initContainer(), this.initCanvas(), this.initCropBox(), this.renderCanvas(), this.cropped && this.renderCropBox();
|
|
2858
|
-
},
|
|
2859
|
-
initContainer: function() {
|
|
2860
|
-
var e = this.element, t = this.options, i = this.container, n = this.cropper, r = Number(t.minContainerWidth), o = Number(t.minContainerHeight);
|
|
2861
|
-
re(n, fe), Te(e, fe);
|
|
2862
|
-
var l = {
|
|
2863
|
-
width: Math.max(i.offsetWidth, r >= 0 ? r : wr),
|
|
2864
|
-
height: Math.max(i.offsetHeight, o >= 0 ? o : Dr)
|
|
2865
|
-
};
|
|
2866
|
-
this.containerData = l, je(n, {
|
|
2867
|
-
width: l.width,
|
|
2868
|
-
height: l.height
|
|
2869
|
-
}), re(e, fe), Te(n, fe);
|
|
2870
|
-
},
|
|
2871
|
-
// Canvas (image wrapper)
|
|
2872
|
-
initCanvas: function() {
|
|
2873
|
-
var e = this.containerData, t = this.imageData, i = this.options.viewMode, n = Math.abs(t.rotate) % 180 === 90, r = n ? t.naturalHeight : t.naturalWidth, o = n ? t.naturalWidth : t.naturalHeight, l = r / o, c = e.width, s = e.height;
|
|
2874
|
-
e.height * l > e.width ? i === 3 ? c = e.height * l : s = e.width / l : i === 3 ? s = e.width / l : c = e.height * l;
|
|
2875
|
-
var u = {
|
|
2876
|
-
aspectRatio: l,
|
|
2877
|
-
naturalWidth: r,
|
|
2878
|
-
naturalHeight: o,
|
|
2879
|
-
width: c,
|
|
2880
|
-
height: s
|
|
2881
|
-
};
|
|
2882
|
-
this.canvasData = u, this.limited = i === 1 || i === 2, this.limitCanvas(!0, !0), u.width = Math.min(Math.max(u.width, u.minWidth), u.maxWidth), u.height = Math.min(Math.max(u.height, u.minHeight), u.maxHeight), u.left = (e.width - u.width) / 2, u.top = (e.height - u.height) / 2, u.oldLeft = u.left, u.oldTop = u.top, this.initialCanvasData = V({}, u);
|
|
2883
|
-
},
|
|
2884
|
-
limitCanvas: function(e, t) {
|
|
2885
|
-
var i = this.options, n = this.containerData, r = this.canvasData, o = this.cropBoxData, l = i.viewMode, c = r.aspectRatio, s = this.cropped && o;
|
|
2886
|
-
if (e) {
|
|
2887
|
-
var u = Number(i.minCanvasWidth) || 0, h = Number(i.minCanvasHeight) || 0;
|
|
2888
|
-
l > 1 ? (u = Math.max(u, n.width), h = Math.max(h, n.height), l === 3 && (h * c > u ? u = h * c : h = u / c)) : l > 0 && (u ? u = Math.max(u, s ? o.width : 0) : h ? h = Math.max(h, s ? o.height : 0) : s && (u = o.width, h = o.height, h * c > u ? u = h * c : h = u / c));
|
|
2889
|
-
var f = ke({
|
|
2890
|
-
aspectRatio: c,
|
|
2891
|
-
width: u,
|
|
2892
|
-
height: h
|
|
2893
|
-
});
|
|
2894
|
-
u = f.width, h = f.height, r.minWidth = u, r.minHeight = h, r.maxWidth = 1 / 0, r.maxHeight = 1 / 0;
|
|
2895
|
-
}
|
|
2896
|
-
if (t)
|
|
2897
|
-
if (l > (s ? 0 : 1)) {
|
|
2898
|
-
var m = n.width - r.width, v = n.height - r.height;
|
|
2899
|
-
r.minLeft = Math.min(0, m), r.minTop = Math.min(0, v), r.maxLeft = Math.max(0, m), r.maxTop = Math.max(0, v), s && this.limited && (r.minLeft = Math.min(o.left, o.left + (o.width - r.width)), r.minTop = Math.min(o.top, o.top + (o.height - r.height)), r.maxLeft = o.left, r.maxTop = o.top, l === 2 && (r.width >= n.width && (r.minLeft = Math.min(0, m), r.maxLeft = Math.max(0, m)), r.height >= n.height && (r.minTop = Math.min(0, v), r.maxTop = Math.max(0, v))));
|
|
2900
|
-
} else
|
|
2901
|
-
r.minLeft = -r.width, r.minTop = -r.height, r.maxLeft = n.width, r.maxTop = n.height;
|
|
2902
|
-
},
|
|
2903
|
-
renderCanvas: function(e, t) {
|
|
2904
|
-
var i = this.canvasData, n = this.imageData;
|
|
2905
|
-
if (t) {
|
|
2906
|
-
var r = $l({
|
|
2907
|
-
width: n.naturalWidth * Math.abs(n.scaleX || 1),
|
|
2908
|
-
height: n.naturalHeight * Math.abs(n.scaleY || 1),
|
|
2909
|
-
degree: n.rotate || 0
|
|
2910
|
-
}), o = r.width, l = r.height, c = i.width * (o / i.naturalWidth), s = i.height * (l / i.naturalHeight);
|
|
2911
|
-
i.left -= (c - i.width) / 2, i.top -= (s - i.height) / 2, i.width = c, i.height = s, i.aspectRatio = o / l, i.naturalWidth = o, i.naturalHeight = l, this.limitCanvas(!0, !1);
|
|
2912
|
-
}
|
|
2913
|
-
(i.width > i.maxWidth || i.width < i.minWidth) && (i.left = i.oldLeft), (i.height > i.maxHeight || i.height < i.minHeight) && (i.top = i.oldTop), i.width = Math.min(Math.max(i.width, i.minWidth), i.maxWidth), i.height = Math.min(Math.max(i.height, i.minHeight), i.maxHeight), this.limitCanvas(!1, !0), i.left = Math.min(Math.max(i.left, i.minLeft), i.maxLeft), i.top = Math.min(Math.max(i.top, i.minTop), i.maxTop), i.oldLeft = i.left, i.oldTop = i.top, je(this.canvas, V({
|
|
2914
|
-
width: i.width,
|
|
2915
|
-
height: i.height
|
|
2916
|
-
}, Tt({
|
|
2917
|
-
translateX: i.left,
|
|
2918
|
-
translateY: i.top
|
|
2919
|
-
}))), this.renderImage(e), this.cropped && this.limited && this.limitCropBox(!0, !0);
|
|
2920
|
-
},
|
|
2921
|
-
renderImage: function(e) {
|
|
2922
|
-
var t = this.canvasData, i = this.imageData, n = i.naturalWidth * (t.width / t.naturalWidth), r = i.naturalHeight * (t.height / t.naturalHeight);
|
|
2923
|
-
V(i, {
|
|
2924
|
-
width: n,
|
|
2925
|
-
height: r,
|
|
2926
|
-
left: (t.width - n) / 2,
|
|
2927
|
-
top: (t.height - r) / 2
|
|
2928
|
-
}), je(this.image, V({
|
|
2929
|
-
width: i.width,
|
|
2930
|
-
height: i.height
|
|
2931
|
-
}, Tt(V({
|
|
2932
|
-
translateX: i.left,
|
|
2933
|
-
translateY: i.top
|
|
2934
|
-
}, i)))), e && this.output();
|
|
2935
|
-
},
|
|
2936
|
-
initCropBox: function() {
|
|
2937
|
-
var e = this.options, t = this.canvasData, i = e.aspectRatio || e.initialAspectRatio, n = Number(e.autoCropArea) || 0.8, r = {
|
|
2938
|
-
width: t.width,
|
|
2939
|
-
height: t.height
|
|
2940
|
-
};
|
|
2941
|
-
i && (t.height * i > t.width ? r.height = r.width / i : r.width = r.height * i), this.cropBoxData = r, this.limitCropBox(!0, !0), r.width = Math.min(Math.max(r.width, r.minWidth), r.maxWidth), r.height = Math.min(Math.max(r.height, r.minHeight), r.maxHeight), r.width = Math.max(r.minWidth, r.width * n), r.height = Math.max(r.minHeight, r.height * n), r.left = t.left + (t.width - r.width) / 2, r.top = t.top + (t.height - r.height) / 2, r.oldLeft = r.left, r.oldTop = r.top, this.initialCropBoxData = V({}, r);
|
|
2942
|
-
},
|
|
2943
|
-
limitCropBox: function(e, t) {
|
|
2944
|
-
var i = this.options, n = this.containerData, r = this.canvasData, o = this.cropBoxData, l = this.limited, c = i.aspectRatio;
|
|
2945
|
-
if (e) {
|
|
2946
|
-
var s = Number(i.minCropBoxWidth) || 0, u = Number(i.minCropBoxHeight) || 0, h = l ? Math.min(n.width, r.width, r.width + r.left, n.width - r.left) : n.width, f = l ? Math.min(n.height, r.height, r.height + r.top, n.height - r.top) : n.height;
|
|
2947
|
-
s = Math.min(s, n.width), u = Math.min(u, n.height), c && (s && u ? u * c > s ? u = s / c : s = u * c : s ? u = s / c : u && (s = u * c), f * c > h ? f = h / c : h = f * c), o.minWidth = Math.min(s, h), o.minHeight = Math.min(u, f), o.maxWidth = h, o.maxHeight = f;
|
|
2948
|
-
}
|
|
2949
|
-
t && (l ? (o.minLeft = Math.max(0, r.left), o.minTop = Math.max(0, r.top), o.maxLeft = Math.min(n.width, r.left + r.width) - o.width, o.maxTop = Math.min(n.height, r.top + r.height) - o.height) : (o.minLeft = 0, o.minTop = 0, o.maxLeft = n.width - o.width, o.maxTop = n.height - o.height));
|
|
2950
|
-
},
|
|
2951
|
-
renderCropBox: function() {
|
|
2952
|
-
var e = this.options, t = this.containerData, i = this.cropBoxData;
|
|
2953
|
-
(i.width > i.maxWidth || i.width < i.minWidth) && (i.left = i.oldLeft), (i.height > i.maxHeight || i.height < i.minHeight) && (i.top = i.oldTop), i.width = Math.min(Math.max(i.width, i.minWidth), i.maxWidth), i.height = Math.min(Math.max(i.height, i.minHeight), i.maxHeight), this.limitCropBox(!1, !0), i.left = Math.min(Math.max(i.left, i.minLeft), i.maxLeft), i.top = Math.min(Math.max(i.top, i.minTop), i.maxTop), i.oldLeft = i.left, i.oldTop = i.top, e.movable && e.cropBoxMovable && _t(this.face, xt, i.width >= t.width && i.height >= t.height ? mr : Fi), je(this.cropBox, V({
|
|
2954
|
-
width: i.width,
|
|
2955
|
-
height: i.height
|
|
2956
|
-
}, Tt({
|
|
2957
|
-
translateX: i.left,
|
|
2958
|
-
translateY: i.top
|
|
2959
|
-
}))), this.cropped && this.limited && this.limitCanvas(!0, !0), this.disabled || this.output();
|
|
2960
|
-
},
|
|
2961
|
-
output: function() {
|
|
2962
|
-
this.preview(), at(this.element, Oi, this.getData());
|
|
2963
|
-
}
|
|
2964
|
-
}, Xl = {
|
|
2965
|
-
initPreview: function() {
|
|
2966
|
-
var e = this.element, t = this.crossOrigin, i = this.options.preview, n = t ? this.crossOriginUrl : this.url, r = e.alt || "The image to preview", o = document.createElement("img");
|
|
2967
|
-
if (t && (o.crossOrigin = t), o.src = n, o.alt = r, this.viewBox.appendChild(o), this.viewBoxImage = o, !!i) {
|
|
2968
|
-
var l = i;
|
|
2969
|
-
typeof i == "string" ? l = e.ownerDocument.querySelectorAll(i) : i.querySelector && (l = [i]), this.previews = l, te(l, function(c) {
|
|
2970
|
-
var s = document.createElement("img");
|
|
2971
|
-
_t(c, Rt, {
|
|
2972
|
-
width: c.offsetWidth,
|
|
2973
|
-
height: c.offsetHeight,
|
|
2974
|
-
html: c.innerHTML
|
|
2975
|
-
}), t && (s.crossOrigin = t), s.src = n, s.alt = r, s.style.cssText = 'display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"', c.innerHTML = "", c.appendChild(s);
|
|
2976
|
-
});
|
|
2977
|
-
}
|
|
2978
|
-
},
|
|
2979
|
-
resetPreview: function() {
|
|
2980
|
-
te(this.previews, function(e) {
|
|
2981
|
-
var t = Ni(e, Rt);
|
|
2982
|
-
je(e, {
|
|
2983
|
-
width: t.width,
|
|
2984
|
-
height: t.height
|
|
2985
|
-
}), e.innerHTML = t.html, Cl(e, Rt);
|
|
2986
|
-
});
|
|
2987
|
-
},
|
|
2988
|
-
preview: function() {
|
|
2989
|
-
var e = this.imageData, t = this.canvasData, i = this.cropBoxData, n = i.width, r = i.height, o = e.width, l = e.height, c = i.left - t.left - e.left, s = i.top - t.top - e.top;
|
|
2990
|
-
!this.cropped || this.disabled || (je(this.viewBoxImage, V({
|
|
2991
|
-
width: o,
|
|
2992
|
-
height: l
|
|
2993
|
-
}, Tt(V({
|
|
2994
|
-
translateX: -c,
|
|
2995
|
-
translateY: -s
|
|
2996
|
-
}, e)))), te(this.previews, function(u) {
|
|
2997
|
-
var h = Ni(u, Rt), f = h.width, m = h.height, v = f, E = m, M = 1;
|
|
2998
|
-
n && (M = f / n, E = r * M), r && E > m && (M = m / r, v = n * M, E = m), je(u, {
|
|
2999
|
-
width: v,
|
|
3000
|
-
height: E
|
|
3001
|
-
}), je(u.getElementsByTagName("img")[0], V({
|
|
3002
|
-
width: o * M,
|
|
3003
|
-
height: l * M
|
|
3004
|
-
}, Tt(V({
|
|
3005
|
-
translateX: -c * M,
|
|
3006
|
-
translateY: -s * M
|
|
3007
|
-
}, e))));
|
|
3008
|
-
}));
|
|
3009
|
-
}
|
|
3010
|
-
}, Fl = {
|
|
3011
|
-
bind: function() {
|
|
3012
|
-
var e = this.element, t = this.options, i = this.cropper;
|
|
3013
|
-
ue(t.cropstart) && me(e, Ai, t.cropstart), ue(t.cropmove) && me(e, Ci, t.cropmove), ue(t.cropend) && me(e, Mi, t.cropend), ue(t.crop) && me(e, Oi, t.crop), ue(t.zoom) && me(e, Ii, t.zoom), me(i, Oa, this.onCropStart = this.cropStart.bind(this)), t.zoomable && t.zoomOnWheel && me(i, Na, this.onWheel = this.wheel.bind(this), {
|
|
3014
|
-
passive: !1,
|
|
3015
|
-
capture: !0
|
|
3016
|
-
}), t.toggleDragModeOnDblclick && me(i, _a, this.onDblclick = this.dblclick.bind(this)), me(e.ownerDocument, Ma, this.onCropMove = this.cropMove.bind(this)), me(e.ownerDocument, Ca, this.onCropEnd = this.cropEnd.bind(this)), t.responsive && me(window, Ia, this.onResize = this.resize.bind(this));
|
|
3017
|
-
},
|
|
3018
|
-
unbind: function() {
|
|
3019
|
-
var e = this.element, t = this.options, i = this.cropper;
|
|
3020
|
-
ue(t.cropstart) && ye(e, Ai, t.cropstart), ue(t.cropmove) && ye(e, Ci, t.cropmove), ue(t.cropend) && ye(e, Mi, t.cropend), ue(t.crop) && ye(e, Oi, t.crop), ue(t.zoom) && ye(e, Ii, t.zoom), ye(i, Oa, this.onCropStart), t.zoomable && t.zoomOnWheel && ye(i, Na, this.onWheel, {
|
|
3021
|
-
passive: !1,
|
|
3022
|
-
capture: !0
|
|
3023
|
-
}), t.toggleDragModeOnDblclick && ye(i, _a, this.onDblclick), ye(e.ownerDocument, Ma, this.onCropMove), ye(e.ownerDocument, Ca, this.onCropEnd), t.responsive && ye(window, Ia, this.onResize);
|
|
3024
|
-
}
|
|
3025
|
-
}, Wl = {
|
|
3026
|
-
resize: function() {
|
|
3027
|
-
if (!this.disabled) {
|
|
3028
|
-
var e = this.options, t = this.container, i = this.containerData, n = t.offsetWidth / i.width, r = t.offsetHeight / i.height, o = Math.abs(n - 1) > Math.abs(r - 1) ? n : r;
|
|
3029
|
-
if (o !== 1) {
|
|
3030
|
-
var l, c;
|
|
3031
|
-
e.restore && (l = this.getCanvasData(), c = this.getCropBoxData()), this.render(), e.restore && (this.setCanvasData(te(l, function(s, u) {
|
|
3032
|
-
l[u] = s * o;
|
|
3033
|
-
})), this.setCropBoxData(te(c, function(s, u) {
|
|
3034
|
-
c[u] = s * o;
|
|
3035
|
-
})));
|
|
3036
|
-
}
|
|
3037
|
-
}
|
|
3038
|
-
},
|
|
3039
|
-
dblclick: function() {
|
|
3040
|
-
this.disabled || this.options.dragMode === yr || this.setDragMode(Ol(this.dragBox, xi) ? br : Wi);
|
|
3041
|
-
},
|
|
3042
|
-
wheel: function(e) {
|
|
3043
|
-
var t = this, i = Number(this.options.wheelZoomRatio) || 0.1, n = 1;
|
|
3044
|
-
this.disabled || (e.preventDefault(), !this.wheeling && (this.wheeling = !0, setTimeout(function() {
|
|
3045
|
-
t.wheeling = !1;
|
|
3046
|
-
}, 50), e.deltaY ? n = e.deltaY > 0 ? 1 : -1 : e.wheelDelta ? n = -e.wheelDelta / 120 : e.detail && (n = e.detail > 0 ? 1 : -1), this.zoom(-n * i, e)));
|
|
3047
|
-
},
|
|
3048
|
-
cropStart: function(e) {
|
|
3049
|
-
var t = e.buttons, i = e.button;
|
|
3050
|
-
if (!(this.disabled || (e.type === "mousedown" || e.type === "pointerdown" && e.pointerType === "mouse") && // No primary button (Usually the left button)
|
|
3051
|
-
(P(t) && t !== 1 || P(i) && i !== 0 || e.ctrlKey))) {
|
|
3052
|
-
var n = this.options, r = this.pointers, o;
|
|
3053
|
-
e.changedTouches ? te(e.changedTouches, function(l) {
|
|
3054
|
-
r[l.identifier] = Bt(l);
|
|
3055
|
-
}) : r[e.pointerId || 0] = Bt(e), Object.keys(r).length > 1 && n.zoomable && n.zoomOnTouch ? o = vr : o = Ni(e.target, xt), vl.test(o) && at(this.element, Ai, {
|
|
3056
|
-
originalEvent: e,
|
|
3057
|
-
action: o
|
|
3058
|
-
}) !== !1 && (e.preventDefault(), this.action = o, this.cropping = !1, o === gr && (this.cropping = !0, re(this.dragBox, Jt)));
|
|
3059
|
-
}
|
|
3060
|
-
},
|
|
3061
|
-
cropMove: function(e) {
|
|
3062
|
-
var t = this.action;
|
|
3063
|
-
if (!(this.disabled || !t)) {
|
|
3064
|
-
var i = this.pointers;
|
|
3065
|
-
e.preventDefault(), at(this.element, Ci, {
|
|
3066
|
-
originalEvent: e,
|
|
3067
|
-
action: t
|
|
3068
|
-
}) !== !1 && (e.changedTouches ? te(e.changedTouches, function(n) {
|
|
3069
|
-
V(i[n.identifier] || {}, Bt(n, !0));
|
|
3070
|
-
}) : V(i[e.pointerId || 0] || {}, Bt(e, !0)), this.change(e));
|
|
3071
|
-
}
|
|
3072
|
-
},
|
|
3073
|
-
cropEnd: function(e) {
|
|
3074
|
-
if (!this.disabled) {
|
|
3075
|
-
var t = this.action, i = this.pointers;
|
|
3076
|
-
e.changedTouches ? te(e.changedTouches, function(n) {
|
|
3077
|
-
delete i[n.identifier];
|
|
3078
|
-
}) : delete i[e.pointerId || 0], t && (e.preventDefault(), Object.keys(i).length || (this.action = ""), this.cropping && (this.cropping = !1, Je(this.dragBox, Jt, this.cropped && this.options.modal)), at(this.element, Mi, {
|
|
3079
|
-
originalEvent: e,
|
|
3080
|
-
action: t
|
|
3081
|
-
}));
|
|
3082
|
-
}
|
|
3083
|
-
}
|
|
3084
|
-
}, zl = {
|
|
3085
|
-
change: function(e) {
|
|
3086
|
-
var t = this.options, i = this.canvasData, n = this.containerData, r = this.cropBoxData, o = this.pointers, l = this.action, c = t.aspectRatio, s = r.left, u = r.top, h = r.width, f = r.height, m = s + h, v = u + f, E = 0, M = 0, B = n.width, I = n.height, N = !0, W;
|
|
3087
|
-
!c && e.shiftKey && (c = h && f ? h / f : 1), this.limited && (E = r.minLeft, M = r.minTop, B = E + Math.min(n.width, i.width, i.left + i.width), I = M + Math.min(n.height, i.height, i.top + i.height));
|
|
3088
|
-
var H = o[Object.keys(o)[0]], d = {
|
|
3089
|
-
x: H.endX - H.startX,
|
|
3090
|
-
y: H.endY - H.startY
|
|
3091
|
-
}, A = function(L) {
|
|
3092
|
-
switch (L) {
|
|
3093
|
-
case He:
|
|
3094
|
-
m + d.x > B && (d.x = B - m);
|
|
3095
|
-
break;
|
|
3096
|
-
case Xe:
|
|
3097
|
-
s + d.x < E && (d.x = E - s);
|
|
3098
|
-
break;
|
|
3099
|
-
case Ie:
|
|
3100
|
-
u + d.y < M && (d.y = M - u);
|
|
3101
|
-
break;
|
|
3102
|
-
case Ke:
|
|
3103
|
-
v + d.y > I && (d.y = I - v);
|
|
3104
|
-
break;
|
|
3105
|
-
}
|
|
3106
|
-
};
|
|
3107
|
-
switch (l) {
|
|
3108
|
-
// Move crop box
|
|
3109
|
-
case Fi:
|
|
3110
|
-
s += d.x, u += d.y;
|
|
3111
|
-
break;
|
|
3112
|
-
// Resize crop box
|
|
3113
|
-
case He:
|
|
3114
|
-
if (d.x >= 0 && (m >= B || c && (u <= M || v >= I))) {
|
|
3115
|
-
N = !1;
|
|
3116
|
-
break;
|
|
3117
|
-
}
|
|
3118
|
-
A(He), h += d.x, h < 0 && (l = Xe, h = -h, s -= h), c && (f = h / c, u += (r.height - f) / 2);
|
|
3119
|
-
break;
|
|
3120
|
-
case Ie:
|
|
3121
|
-
if (d.y <= 0 && (u <= M || c && (s <= E || m >= B))) {
|
|
3122
|
-
N = !1;
|
|
3123
|
-
break;
|
|
3124
|
-
}
|
|
3125
|
-
A(Ie), f -= d.y, u += d.y, f < 0 && (l = Ke, f = -f, u -= f), c && (h = f * c, s += (r.width - h) / 2);
|
|
3126
|
-
break;
|
|
3127
|
-
case Xe:
|
|
3128
|
-
if (d.x <= 0 && (s <= E || c && (u <= M || v >= I))) {
|
|
3129
|
-
N = !1;
|
|
3130
|
-
break;
|
|
3131
|
-
}
|
|
3132
|
-
A(Xe), h -= d.x, s += d.x, h < 0 && (l = He, h = -h, s -= h), c && (f = h / c, u += (r.height - f) / 2);
|
|
3133
|
-
break;
|
|
3134
|
-
case Ke:
|
|
3135
|
-
if (d.y >= 0 && (v >= I || c && (s <= E || m >= B))) {
|
|
3136
|
-
N = !1;
|
|
3137
|
-
break;
|
|
3138
|
-
}
|
|
3139
|
-
A(Ke), f += d.y, f < 0 && (l = Ie, f = -f, u -= f), c && (h = f * c, s += (r.width - h) / 2);
|
|
3140
|
-
break;
|
|
3141
|
-
case ht:
|
|
3142
|
-
if (c) {
|
|
3143
|
-
if (d.y <= 0 && (u <= M || m >= B)) {
|
|
3144
|
-
N = !1;
|
|
3145
|
-
break;
|
|
3146
|
-
}
|
|
3147
|
-
A(Ie), f -= d.y, u += d.y, h = f * c;
|
|
3148
|
-
} else
|
|
3149
|
-
A(Ie), A(He), d.x >= 0 ? m < B ? h += d.x : d.y <= 0 && u <= M && (N = !1) : h += d.x, d.y <= 0 ? u > M && (f -= d.y, u += d.y) : (f -= d.y, u += d.y);
|
|
3150
|
-
h < 0 && f < 0 ? (l = dt, f = -f, h = -h, u -= f, s -= h) : h < 0 ? (l = ut, h = -h, s -= h) : f < 0 && (l = ft, f = -f, u -= f);
|
|
3151
|
-
break;
|
|
3152
|
-
case ut:
|
|
3153
|
-
if (c) {
|
|
3154
|
-
if (d.y <= 0 && (u <= M || s <= E)) {
|
|
3155
|
-
N = !1;
|
|
3156
|
-
break;
|
|
3157
|
-
}
|
|
3158
|
-
A(Ie), f -= d.y, u += d.y, h = f * c, s += r.width - h;
|
|
3159
|
-
} else
|
|
3160
|
-
A(Ie), A(Xe), d.x <= 0 ? s > E ? (h -= d.x, s += d.x) : d.y <= 0 && u <= M && (N = !1) : (h -= d.x, s += d.x), d.y <= 0 ? u > M && (f -= d.y, u += d.y) : (f -= d.y, u += d.y);
|
|
3161
|
-
h < 0 && f < 0 ? (l = ft, f = -f, h = -h, u -= f, s -= h) : h < 0 ? (l = ht, h = -h, s -= h) : f < 0 && (l = dt, f = -f, u -= f);
|
|
3162
|
-
break;
|
|
3163
|
-
case dt:
|
|
3164
|
-
if (c) {
|
|
3165
|
-
if (d.x <= 0 && (s <= E || v >= I)) {
|
|
3166
|
-
N = !1;
|
|
3167
|
-
break;
|
|
3168
|
-
}
|
|
3169
|
-
A(Xe), h -= d.x, s += d.x, f = h / c;
|
|
3170
|
-
} else
|
|
3171
|
-
A(Ke), A(Xe), d.x <= 0 ? s > E ? (h -= d.x, s += d.x) : d.y >= 0 && v >= I && (N = !1) : (h -= d.x, s += d.x), d.y >= 0 ? v < I && (f += d.y) : f += d.y;
|
|
3172
|
-
h < 0 && f < 0 ? (l = ht, f = -f, h = -h, u -= f, s -= h) : h < 0 ? (l = ft, h = -h, s -= h) : f < 0 && (l = ut, f = -f, u -= f);
|
|
3173
|
-
break;
|
|
3174
|
-
case ft:
|
|
3175
|
-
if (c) {
|
|
3176
|
-
if (d.x >= 0 && (m >= B || v >= I)) {
|
|
3177
|
-
N = !1;
|
|
3178
|
-
break;
|
|
3179
|
-
}
|
|
3180
|
-
A(He), h += d.x, f = h / c;
|
|
3181
|
-
} else
|
|
3182
|
-
A(Ke), A(He), d.x >= 0 ? m < B ? h += d.x : d.y >= 0 && v >= I && (N = !1) : h += d.x, d.y >= 0 ? v < I && (f += d.y) : f += d.y;
|
|
3183
|
-
h < 0 && f < 0 ? (l = ut, f = -f, h = -h, u -= f, s -= h) : h < 0 ? (l = dt, h = -h, s -= h) : f < 0 && (l = ht, f = -f, u -= f);
|
|
3184
|
-
break;
|
|
3185
|
-
// Move canvas
|
|
3186
|
-
case mr:
|
|
3187
|
-
this.move(d.x, d.y), N = !1;
|
|
3188
|
-
break;
|
|
3189
|
-
// Zoom canvas
|
|
3190
|
-
case vr:
|
|
3191
|
-
this.zoom(Il(o), e), N = !1;
|
|
3192
|
-
break;
|
|
3193
|
-
// Create crop box
|
|
3194
|
-
case gr:
|
|
3195
|
-
if (!d.x || !d.y) {
|
|
3196
|
-
N = !1;
|
|
3197
|
-
break;
|
|
3198
|
-
}
|
|
3199
|
-
W = xr(this.cropper), s = H.startX - W.left, u = H.startY - W.top, h = r.minWidth, f = r.minHeight, d.x > 0 ? l = d.y > 0 ? ft : ht : d.x < 0 && (s -= h, l = d.y > 0 ? dt : ut), d.y < 0 && (u -= f), this.cropped || (Te(this.cropBox, fe), this.cropped = !0, this.limited && this.limitCropBox(!0, !0));
|
|
3200
|
-
break;
|
|
3201
|
-
}
|
|
3202
|
-
N && (r.width = h, r.height = f, r.left = s, r.top = u, this.action = l, this.renderCropBox()), te(o, function(Y) {
|
|
3203
|
-
Y.startX = Y.endX, Y.startY = Y.endY;
|
|
3204
|
-
});
|
|
3205
|
-
}
|
|
3206
|
-
}, Ul = {
|
|
3207
|
-
// Show the crop box manually
|
|
3208
|
-
crop: function() {
|
|
3209
|
-
return this.ready && !this.cropped && !this.disabled && (this.cropped = !0, this.limitCropBox(!0, !0), this.options.modal && re(this.dragBox, Jt), Te(this.cropBox, fe), this.setCropBoxData(this.initialCropBoxData)), this;
|
|
3210
|
-
},
|
|
3211
|
-
// Reset the image and crop box to their initial states
|
|
3212
|
-
reset: function() {
|
|
3213
|
-
return this.ready && !this.disabled && (this.imageData = V({}, this.initialImageData), this.canvasData = V({}, this.initialCanvasData), this.cropBoxData = V({}, this.initialCropBoxData), this.renderCanvas(), this.cropped && this.renderCropBox()), this;
|
|
3214
|
-
},
|
|
3215
|
-
// Clear the crop box
|
|
3216
|
-
clear: function() {
|
|
3217
|
-
return this.cropped && !this.disabled && (V(this.cropBoxData, {
|
|
3218
|
-
left: 0,
|
|
3219
|
-
top: 0,
|
|
3220
|
-
width: 0,
|
|
3221
|
-
height: 0
|
|
3222
|
-
}), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(), Te(this.dragBox, Jt), re(this.cropBox, fe)), this;
|
|
3223
|
-
},
|
|
3224
|
-
/**
|
|
3225
|
-
* Replace the image's src and rebuild the cropper
|
|
3226
|
-
* @param {string} url - The new URL.
|
|
3227
|
-
* @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.
|
|
3228
|
-
* @returns {Cropper} this
|
|
3229
|
-
*/
|
|
3230
|
-
replace: function(e) {
|
|
3231
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
3232
|
-
return !this.disabled && e && (this.isImg && (this.element.src = e), t ? (this.url = e, this.image.src = e, this.ready && (this.viewBoxImage.src = e, te(this.previews, function(i) {
|
|
3233
|
-
i.getElementsByTagName("img")[0].src = e;
|
|
3234
|
-
}))) : (this.isImg && (this.replaced = !0), this.options.data = null, this.uncreate(), this.load(e))), this;
|
|
3235
|
-
},
|
|
3236
|
-
// Enable (unfreeze) the cropper
|
|
3237
|
-
enable: function() {
|
|
3238
|
-
return this.ready && this.disabled && (this.disabled = !1, Te(this.cropper, Sa)), this;
|
|
3239
|
-
},
|
|
3240
|
-
// Disable (freeze) the cropper
|
|
3241
|
-
disable: function() {
|
|
3242
|
-
return this.ready && !this.disabled && (this.disabled = !0, re(this.cropper, Sa)), this;
|
|
3243
|
-
},
|
|
3244
|
-
/**
|
|
3245
|
-
* Destroy the cropper and remove the instance from the image
|
|
3246
|
-
* @returns {Cropper} this
|
|
3247
|
-
*/
|
|
3248
|
-
destroy: function() {
|
|
3249
|
-
var e = this.element;
|
|
3250
|
-
return e[G] ? (e[G] = void 0, this.isImg && this.replaced && (e.src = this.originalUrl), this.uncreate(), this) : this;
|
|
3251
|
-
},
|
|
3252
|
-
/**
|
|
3253
|
-
* Move the canvas with relative offsets
|
|
3254
|
-
* @param {number} offsetX - The relative offset distance on the x-axis.
|
|
3255
|
-
* @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.
|
|
3256
|
-
* @returns {Cropper} this
|
|
3257
|
-
*/
|
|
3258
|
-
move: function(e) {
|
|
3259
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, i = this.canvasData, n = i.left, r = i.top;
|
|
3260
|
-
return this.moveTo(di(e) ? e : n + Number(e), di(t) ? t : r + Number(t));
|
|
3261
|
-
},
|
|
3262
|
-
/**
|
|
3263
|
-
* Move the canvas to an absolute point
|
|
3264
|
-
* @param {number} x - The x-axis coordinate.
|
|
3265
|
-
* @param {number} [y=x] - The y-axis coordinate.
|
|
3266
|
-
* @returns {Cropper} this
|
|
3267
|
-
*/
|
|
3268
|
-
moveTo: function(e) {
|
|
3269
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, i = this.canvasData, n = !1;
|
|
3270
|
-
return e = Number(e), t = Number(t), this.ready && !this.disabled && this.options.movable && (P(e) && (i.left = e, n = !0), P(t) && (i.top = t, n = !0), n && this.renderCanvas(!0)), this;
|
|
3271
|
-
},
|
|
3272
|
-
/**
|
|
3273
|
-
* Zoom the canvas with a relative ratio
|
|
3274
|
-
* @param {number} ratio - The target ratio.
|
|
3275
|
-
* @param {Event} _originalEvent - The original event if any.
|
|
3276
|
-
* @returns {Cropper} this
|
|
3277
|
-
*/
|
|
3278
|
-
zoom: function(e, t) {
|
|
3279
|
-
var i = this.canvasData;
|
|
3280
|
-
return e = Number(e), e < 0 ? e = 1 / (1 - e) : e = 1 + e, this.zoomTo(i.width * e / i.naturalWidth, null, t);
|
|
3281
|
-
},
|
|
3282
|
-
/**
|
|
3283
|
-
* Zoom the canvas to an absolute ratio
|
|
3284
|
-
* @param {number} ratio - The target ratio.
|
|
3285
|
-
* @param {Object} pivot - The zoom pivot point coordinate.
|
|
3286
|
-
* @param {Event} _originalEvent - The original event if any.
|
|
3287
|
-
* @returns {Cropper} this
|
|
3288
|
-
*/
|
|
3289
|
-
zoomTo: function(e, t, i) {
|
|
3290
|
-
var n = this.options, r = this.canvasData, o = r.width, l = r.height, c = r.naturalWidth, s = r.naturalHeight;
|
|
3291
|
-
if (e = Number(e), e >= 0 && this.ready && !this.disabled && n.zoomable) {
|
|
3292
|
-
var u = c * e, h = s * e;
|
|
3293
|
-
if (at(this.element, Ii, {
|
|
3294
|
-
ratio: e,
|
|
3295
|
-
oldRatio: o / c,
|
|
3296
|
-
originalEvent: i
|
|
3297
|
-
}) === !1)
|
|
3298
|
-
return this;
|
|
3299
|
-
if (i) {
|
|
3300
|
-
var f = this.pointers, m = xr(this.cropper), v = f && Object.keys(f).length ? Nl(f) : {
|
|
3301
|
-
pageX: i.pageX,
|
|
3302
|
-
pageY: i.pageY
|
|
3303
|
-
};
|
|
3304
|
-
r.left -= (u - o) * ((v.pageX - m.left - r.left) / o), r.top -= (h - l) * ((v.pageY - m.top - r.top) / l);
|
|
3305
|
-
} else Qe(t) && P(t.x) && P(t.y) ? (r.left -= (u - o) * ((t.x - r.left) / o), r.top -= (h - l) * ((t.y - r.top) / l)) : (r.left -= (u - o) / 2, r.top -= (h - l) / 2);
|
|
3306
|
-
r.width = u, r.height = h, this.renderCanvas(!0);
|
|
3307
|
-
}
|
|
3308
|
-
return this;
|
|
3309
|
-
},
|
|
3310
|
-
/**
|
|
3311
|
-
* Rotate the canvas with a relative degree
|
|
3312
|
-
* @param {number} degree - The rotate degree.
|
|
3313
|
-
* @returns {Cropper} this
|
|
3314
|
-
*/
|
|
3315
|
-
rotate: function(e) {
|
|
3316
|
-
return this.rotateTo((this.imageData.rotate || 0) + Number(e));
|
|
3317
|
-
},
|
|
3318
|
-
/**
|
|
3319
|
-
* Rotate the canvas to an absolute degree
|
|
3320
|
-
* @param {number} degree - The rotate degree.
|
|
3321
|
-
* @returns {Cropper} this
|
|
3322
|
-
*/
|
|
3323
|
-
rotateTo: function(e) {
|
|
3324
|
-
return e = Number(e), P(e) && this.ready && !this.disabled && this.options.rotatable && (this.imageData.rotate = e % 360, this.renderCanvas(!0, !0)), this;
|
|
3325
|
-
},
|
|
3326
|
-
/**
|
|
3327
|
-
* Scale the image on the x-axis.
|
|
3328
|
-
* @param {number} scaleX - The scale ratio on the x-axis.
|
|
3329
|
-
* @returns {Cropper} this
|
|
3330
|
-
*/
|
|
3331
|
-
scaleX: function(e) {
|
|
3332
|
-
var t = this.imageData.scaleY;
|
|
3333
|
-
return this.scale(e, P(t) ? t : 1);
|
|
3334
|
-
},
|
|
3335
|
-
/**
|
|
3336
|
-
* Scale the image on the y-axis.
|
|
3337
|
-
* @param {number} scaleY - The scale ratio on the y-axis.
|
|
3338
|
-
* @returns {Cropper} this
|
|
3339
|
-
*/
|
|
3340
|
-
scaleY: function(e) {
|
|
3341
|
-
var t = this.imageData.scaleX;
|
|
3342
|
-
return this.scale(P(t) ? t : 1, e);
|
|
3343
|
-
},
|
|
3344
|
-
/**
|
|
3345
|
-
* Scale the image
|
|
3346
|
-
* @param {number} scaleX - The scale ratio on the x-axis.
|
|
3347
|
-
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
|
|
3348
|
-
* @returns {Cropper} this
|
|
3349
|
-
*/
|
|
3350
|
-
scale: function(e) {
|
|
3351
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, i = this.imageData, n = !1;
|
|
3352
|
-
return e = Number(e), t = Number(t), this.ready && !this.disabled && this.options.scalable && (P(e) && (i.scaleX = e, n = !0), P(t) && (i.scaleY = t, n = !0), n && this.renderCanvas(!0, !0)), this;
|
|
3353
|
-
},
|
|
3354
|
-
/**
|
|
3355
|
-
* Get the cropped area position and size data (base on the original image)
|
|
3356
|
-
* @param {boolean} [rounded=false] - Indicate if round the data values or not.
|
|
3357
|
-
* @returns {Object} The result cropped data.
|
|
3358
|
-
*/
|
|
3359
|
-
getData: function() {
|
|
3360
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.options, i = this.imageData, n = this.canvasData, r = this.cropBoxData, o;
|
|
3361
|
-
if (this.ready && this.cropped) {
|
|
3362
|
-
o = {
|
|
3363
|
-
x: r.left - n.left,
|
|
3364
|
-
y: r.top - n.top,
|
|
3365
|
-
width: r.width,
|
|
3366
|
-
height: r.height
|
|
3367
|
-
};
|
|
3368
|
-
var l = i.width / i.naturalWidth;
|
|
3369
|
-
if (te(o, function(u, h) {
|
|
3370
|
-
o[h] = u / l;
|
|
3371
|
-
}), e) {
|
|
3372
|
-
var c = Math.round(o.y + o.height), s = Math.round(o.x + o.width);
|
|
3373
|
-
o.x = Math.round(o.x), o.y = Math.round(o.y), o.width = s - o.x, o.height = c - o.y;
|
|
3374
|
-
}
|
|
3375
|
-
} else
|
|
3376
|
-
o = {
|
|
3377
|
-
x: 0,
|
|
3378
|
-
y: 0,
|
|
3379
|
-
width: 0,
|
|
3380
|
-
height: 0
|
|
3381
|
-
};
|
|
3382
|
-
return t.rotatable && (o.rotate = i.rotate || 0), t.scalable && (o.scaleX = i.scaleX || 1, o.scaleY = i.scaleY || 1), o;
|
|
3383
|
-
},
|
|
3384
|
-
/**
|
|
3385
|
-
* Set the cropped area position and size with new data
|
|
3386
|
-
* @param {Object} data - The new data.
|
|
3387
|
-
* @returns {Cropper} this
|
|
3388
|
-
*/
|
|
3389
|
-
setData: function(e) {
|
|
3390
|
-
var t = this.options, i = this.imageData, n = this.canvasData, r = {};
|
|
3391
|
-
if (this.ready && !this.disabled && Qe(e)) {
|
|
3392
|
-
var o = !1;
|
|
3393
|
-
t.rotatable && P(e.rotate) && e.rotate !== i.rotate && (i.rotate = e.rotate, o = !0), t.scalable && (P(e.scaleX) && e.scaleX !== i.scaleX && (i.scaleX = e.scaleX, o = !0), P(e.scaleY) && e.scaleY !== i.scaleY && (i.scaleY = e.scaleY, o = !0)), o && this.renderCanvas(!0, !0);
|
|
3394
|
-
var l = i.width / i.naturalWidth;
|
|
3395
|
-
P(e.x) && (r.left = e.x * l + n.left), P(e.y) && (r.top = e.y * l + n.top), P(e.width) && (r.width = e.width * l), P(e.height) && (r.height = e.height * l), this.setCropBoxData(r);
|
|
3396
|
-
}
|
|
3397
|
-
return this;
|
|
3398
|
-
},
|
|
3399
|
-
/**
|
|
3400
|
-
* Get the container size data.
|
|
3401
|
-
* @returns {Object} The result container data.
|
|
3402
|
-
*/
|
|
3403
|
-
getContainerData: function() {
|
|
3404
|
-
return this.ready ? V({}, this.containerData) : {};
|
|
3405
|
-
},
|
|
3406
|
-
/**
|
|
3407
|
-
* Get the image position and size data.
|
|
3408
|
-
* @returns {Object} The result image data.
|
|
3409
|
-
*/
|
|
3410
|
-
getImageData: function() {
|
|
3411
|
-
return this.sized ? V({}, this.imageData) : {};
|
|
3412
|
-
},
|
|
3413
|
-
/**
|
|
3414
|
-
* Get the canvas position and size data.
|
|
3415
|
-
* @returns {Object} The result canvas data.
|
|
3416
|
-
*/
|
|
3417
|
-
getCanvasData: function() {
|
|
3418
|
-
var e = this.canvasData, t = {};
|
|
3419
|
-
return this.ready && te(["left", "top", "width", "height", "naturalWidth", "naturalHeight"], function(i) {
|
|
3420
|
-
t[i] = e[i];
|
|
3421
|
-
}), t;
|
|
3422
|
-
},
|
|
3423
|
-
/**
|
|
3424
|
-
* Set the canvas position and size with new data.
|
|
3425
|
-
* @param {Object} data - The new canvas data.
|
|
3426
|
-
* @returns {Cropper} this
|
|
3427
|
-
*/
|
|
3428
|
-
setCanvasData: function(e) {
|
|
3429
|
-
var t = this.canvasData, i = t.aspectRatio;
|
|
3430
|
-
return this.ready && !this.disabled && Qe(e) && (P(e.left) && (t.left = e.left), P(e.top) && (t.top = e.top), P(e.width) ? (t.width = e.width, t.height = e.width / i) : P(e.height) && (t.height = e.height, t.width = e.height * i), this.renderCanvas(!0)), this;
|
|
3431
|
-
},
|
|
3432
|
-
/**
|
|
3433
|
-
* Get the crop box position and size data.
|
|
3434
|
-
* @returns {Object} The result crop box data.
|
|
3435
|
-
*/
|
|
3436
|
-
getCropBoxData: function() {
|
|
3437
|
-
var e = this.cropBoxData, t;
|
|
3438
|
-
return this.ready && this.cropped && (t = {
|
|
3439
|
-
left: e.left,
|
|
3440
|
-
top: e.top,
|
|
3441
|
-
width: e.width,
|
|
3442
|
-
height: e.height
|
|
3443
|
-
}), t || {};
|
|
3444
|
-
},
|
|
3445
|
-
/**
|
|
3446
|
-
* Set the crop box position and size with new data.
|
|
3447
|
-
* @param {Object} data - The new crop box data.
|
|
3448
|
-
* @returns {Cropper} this
|
|
3449
|
-
*/
|
|
3450
|
-
setCropBoxData: function(e) {
|
|
3451
|
-
var t = this.cropBoxData, i = this.options.aspectRatio, n, r;
|
|
3452
|
-
return this.ready && this.cropped && !this.disabled && Qe(e) && (P(e.left) && (t.left = e.left), P(e.top) && (t.top = e.top), P(e.width) && e.width !== t.width && (n = !0, t.width = e.width), P(e.height) && e.height !== t.height && (r = !0, t.height = e.height), i && (n ? t.height = t.width / i : r && (t.width = t.height * i)), this.renderCropBox()), this;
|
|
3453
|
-
},
|
|
3454
|
-
/**
|
|
3455
|
-
* Get a canvas drawn the cropped image.
|
|
3456
|
-
* @param {Object} [options={}] - The config options.
|
|
3457
|
-
* @returns {HTMLCanvasElement} - The result canvas.
|
|
3458
|
-
*/
|
|
3459
|
-
getCroppedCanvas: function() {
|
|
3460
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3461
|
-
if (!this.ready || !window.HTMLCanvasElement)
|
|
3462
|
-
return null;
|
|
3463
|
-
var t = this.canvasData, i = Pl(this.image, this.imageData, t, e);
|
|
3464
|
-
if (!this.cropped)
|
|
3465
|
-
return i;
|
|
3466
|
-
var n = this.getData(e.rounded), r = n.x, o = n.y, l = n.width, c = n.height, s = i.width / Math.floor(t.naturalWidth);
|
|
3467
|
-
s !== 1 && (r *= s, o *= s, l *= s, c *= s);
|
|
3468
|
-
var u = l / c, h = ke({
|
|
3469
|
-
aspectRatio: u,
|
|
3470
|
-
width: e.maxWidth || 1 / 0,
|
|
3471
|
-
height: e.maxHeight || 1 / 0
|
|
3472
|
-
}), f = ke({
|
|
3473
|
-
aspectRatio: u,
|
|
3474
|
-
width: e.minWidth || 0,
|
|
3475
|
-
height: e.minHeight || 0
|
|
3476
|
-
}, "cover"), m = ke({
|
|
3477
|
-
aspectRatio: u,
|
|
3478
|
-
width: e.width || (s !== 1 ? i.width : l),
|
|
3479
|
-
height: e.height || (s !== 1 ? i.height : c)
|
|
3480
|
-
}), v = m.width, E = m.height;
|
|
3481
|
-
v = Math.min(h.width, Math.max(f.width, v)), E = Math.min(h.height, Math.max(f.height, E));
|
|
3482
|
-
var M = document.createElement("canvas"), B = M.getContext("2d");
|
|
3483
|
-
M.width = it(v), M.height = it(E), B.fillStyle = e.fillColor || "transparent", B.fillRect(0, 0, v, E);
|
|
3484
|
-
var I = e.imageSmoothingEnabled, N = I === void 0 ? !0 : I, W = e.imageSmoothingQuality;
|
|
3485
|
-
B.imageSmoothingEnabled = N, W && (B.imageSmoothingQuality = W);
|
|
3486
|
-
var H = i.width, d = i.height, A = r, Y = o, L, k, _, ie, Z, w;
|
|
3487
|
-
A <= -l || A > H ? (A = 0, L = 0, _ = 0, Z = 0) : A <= 0 ? (_ = -A, A = 0, L = Math.min(H, l + A), Z = L) : A <= H && (_ = 0, L = Math.min(l, H - A), Z = L), L <= 0 || Y <= -c || Y > d ? (Y = 0, k = 0, ie = 0, w = 0) : Y <= 0 ? (ie = -Y, Y = 0, k = Math.min(d, c + Y), w = k) : Y <= d && (ie = 0, k = Math.min(c, d - Y), w = k);
|
|
3488
|
-
var g = [A, Y, L, k];
|
|
3489
|
-
if (Z > 0 && w > 0) {
|
|
3490
|
-
var p = v / l;
|
|
3491
|
-
g.push(_ * p, ie * p, Z * p, w * p);
|
|
3492
|
-
}
|
|
3493
|
-
return B.drawImage.apply(B, [i].concat(pr(g.map(function(D) {
|
|
3494
|
-
return Math.floor(it(D));
|
|
3495
|
-
})))), M;
|
|
3496
|
-
},
|
|
3497
|
-
/**
|
|
3498
|
-
* Change the aspect ratio of the crop box.
|
|
3499
|
-
* @param {number} aspectRatio - The new aspect ratio.
|
|
3500
|
-
* @returns {Cropper} this
|
|
3501
|
-
*/
|
|
3502
|
-
setAspectRatio: function(e) {
|
|
3503
|
-
var t = this.options;
|
|
3504
|
-
return !this.disabled && !di(e) && (t.aspectRatio = Math.max(0, e) || NaN, this.ready && (this.initCropBox(), this.cropped && this.renderCropBox())), this;
|
|
3505
|
-
},
|
|
3506
|
-
/**
|
|
3507
|
-
* Change the drag mode.
|
|
3508
|
-
* @param {string} mode - The new drag mode.
|
|
3509
|
-
* @returns {Cropper} this
|
|
3510
|
-
*/
|
|
3511
|
-
setDragMode: function(e) {
|
|
3512
|
-
var t = this.options, i = this.dragBox, n = this.face;
|
|
3513
|
-
if (this.ready && !this.disabled) {
|
|
3514
|
-
var r = e === Wi, o = t.movable && e === br;
|
|
3515
|
-
e = r || o ? e : yr, t.dragMode = e, _t(i, xt, e), Je(i, xi, r), Je(i, _i, o), t.cropBoxMovable || (_t(n, xt, e), Je(n, xi, r), Je(n, _i, o));
|
|
3516
|
-
}
|
|
3517
|
-
return this;
|
|
3518
|
-
}
|
|
3519
|
-
}, Gl = xe.Cropper, Vl = /* @__PURE__ */ function() {
|
|
3520
|
-
function a(e) {
|
|
3521
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3522
|
-
if (ol(this, a), !e || !wl.test(e.tagName))
|
|
3523
|
-
throw new Error("The first argument is required and must be an <img> or <canvas> element.");
|
|
3524
|
-
this.element = e, this.options = V({}, Pa, Qe(t) && t), this.cropped = !1, this.disabled = !1, this.pointers = {}, this.ready = !1, this.reloading = !1, this.replaced = !1, this.sized = !1, this.sizing = !1, this.init();
|
|
3525
|
-
}
|
|
3526
|
-
return sl(a, [{
|
|
3527
|
-
key: "init",
|
|
3528
|
-
value: function() {
|
|
3529
|
-
var t = this.element, i = t.tagName.toLowerCase(), n;
|
|
3530
|
-
if (!t[G]) {
|
|
3531
|
-
if (t[G] = this, i === "img") {
|
|
3532
|
-
if (this.isImg = !0, n = t.getAttribute("src") || "", this.originalUrl = n, !n)
|
|
3533
|
-
return;
|
|
3534
|
-
n = t.src;
|
|
3535
|
-
} else i === "canvas" && window.HTMLCanvasElement && (n = t.toDataURL());
|
|
3536
|
-
this.load(n);
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
}, {
|
|
3540
|
-
key: "load",
|
|
3541
|
-
value: function(t) {
|
|
3542
|
-
var i = this;
|
|
3543
|
-
if (t) {
|
|
3544
|
-
this.url = t, this.imageData = {};
|
|
3545
|
-
var n = this.element, r = this.options;
|
|
3546
|
-
if (!r.rotatable && !r.scalable && (r.checkOrientation = !1), !r.checkOrientation || !window.ArrayBuffer) {
|
|
3547
|
-
this.clone();
|
|
3548
|
-
return;
|
|
3549
|
-
}
|
|
3550
|
-
if (bl.test(t)) {
|
|
3551
|
-
yl.test(t) ? this.read(Rl(t)) : this.clone();
|
|
3552
|
-
return;
|
|
3553
|
-
}
|
|
3554
|
-
var o = new XMLHttpRequest(), l = this.clone.bind(this);
|
|
3555
|
-
this.reloading = !0, this.xhr = o, o.onabort = l, o.onerror = l, o.ontimeout = l, o.onprogress = function() {
|
|
3556
|
-
o.getResponseHeader("content-type") !== $a && o.abort();
|
|
3557
|
-
}, o.onload = function() {
|
|
3558
|
-
i.read(o.response);
|
|
3559
|
-
}, o.onloadend = function() {
|
|
3560
|
-
i.reloading = !1, i.xhr = null;
|
|
3561
|
-
}, r.checkCrossOrigin && ka(t) && n.crossOrigin && (t = Ra(t)), o.open("GET", t, !0), o.responseType = "arraybuffer", o.withCredentials = n.crossOrigin === "use-credentials", o.send();
|
|
3562
|
-
}
|
|
3563
|
-
}
|
|
3564
|
-
}, {
|
|
3565
|
-
key: "read",
|
|
3566
|
-
value: function(t) {
|
|
3567
|
-
var i = this.options, n = this.imageData, r = Ll(t), o = 0, l = 1, c = 1;
|
|
3568
|
-
if (r > 1) {
|
|
3569
|
-
this.url = Bl(t, $a);
|
|
3570
|
-
var s = Yl(r);
|
|
3571
|
-
o = s.rotate, l = s.scaleX, c = s.scaleY;
|
|
3572
|
-
}
|
|
3573
|
-
i.rotatable && (n.rotate = o), i.scalable && (n.scaleX = l, n.scaleY = c), this.clone();
|
|
3574
|
-
}
|
|
3575
|
-
}, {
|
|
3576
|
-
key: "clone",
|
|
3577
|
-
value: function() {
|
|
3578
|
-
var t = this.element, i = this.url, n = t.crossOrigin, r = i;
|
|
3579
|
-
this.options.checkCrossOrigin && ka(i) && (n || (n = "anonymous"), r = Ra(i)), this.crossOrigin = n, this.crossOriginUrl = r;
|
|
3580
|
-
var o = document.createElement("img");
|
|
3581
|
-
n && (o.crossOrigin = n), o.src = r || i, o.alt = t.alt || "The image to crop", this.image = o, o.onload = this.start.bind(this), o.onerror = this.stop.bind(this), re(o, xa), t.parentNode.insertBefore(o, t.nextSibling);
|
|
3582
|
-
}
|
|
3583
|
-
}, {
|
|
3584
|
-
key: "start",
|
|
3585
|
-
value: function() {
|
|
3586
|
-
var t = this, i = this.image;
|
|
3587
|
-
i.onload = null, i.onerror = null, this.sizing = !0;
|
|
3588
|
-
var n = xe.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(xe.navigator.userAgent), r = function(s, u) {
|
|
3589
|
-
V(t.imageData, {
|
|
3590
|
-
naturalWidth: s,
|
|
3591
|
-
naturalHeight: u,
|
|
3592
|
-
aspectRatio: s / u
|
|
3593
|
-
}), t.initialImageData = V({}, t.imageData), t.sizing = !1, t.sized = !0, t.build();
|
|
3594
|
-
};
|
|
3595
|
-
if (i.naturalWidth && !n) {
|
|
3596
|
-
r(i.naturalWidth, i.naturalHeight);
|
|
3597
|
-
return;
|
|
3598
|
-
}
|
|
3599
|
-
var o = document.createElement("img"), l = document.body || document.documentElement;
|
|
3600
|
-
this.sizingImage = o, o.onload = function() {
|
|
3601
|
-
r(o.width, o.height), n || l.removeChild(o);
|
|
3602
|
-
}, o.src = i.src, n || (o.style.cssText = "left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;", l.appendChild(o));
|
|
3603
|
-
}
|
|
3604
|
-
}, {
|
|
3605
|
-
key: "stop",
|
|
3606
|
-
value: function() {
|
|
3607
|
-
var t = this.image;
|
|
3608
|
-
t.onload = null, t.onerror = null, t.parentNode.removeChild(t), this.image = null;
|
|
3609
|
-
}
|
|
3610
|
-
}, {
|
|
3611
|
-
key: "build",
|
|
3612
|
-
value: function() {
|
|
3613
|
-
if (!(!this.sized || this.ready)) {
|
|
3614
|
-
var t = this.element, i = this.options, n = this.image, r = t.parentNode, o = document.createElement("div");
|
|
3615
|
-
o.innerHTML = Dl;
|
|
3616
|
-
var l = o.querySelector(".".concat(G, "-container")), c = l.querySelector(".".concat(G, "-canvas")), s = l.querySelector(".".concat(G, "-drag-box")), u = l.querySelector(".".concat(G, "-crop-box")), h = u.querySelector(".".concat(G, "-face"));
|
|
3617
|
-
this.container = r, this.cropper = l, this.canvas = c, this.dragBox = s, this.cropBox = u, this.viewBox = l.querySelector(".".concat(G, "-view-box")), this.face = h, c.appendChild(n), re(t, fe), r.insertBefore(l, t.nextSibling), Te(n, xa), this.initPreview(), this.bind(), i.initialAspectRatio = Math.max(0, i.initialAspectRatio) || NaN, i.aspectRatio = Math.max(0, i.aspectRatio) || NaN, i.viewMode = Math.max(0, Math.min(3, Math.round(i.viewMode))) || 0, re(u, fe), i.guides || re(u.getElementsByClassName("".concat(G, "-dashed")), fe), i.center || re(u.getElementsByClassName("".concat(G, "-center")), fe), i.background && re(l, "".concat(G, "-bg")), i.highlight || re(h, dl), i.cropBoxMovable && (re(h, _i), _t(h, xt, Fi)), i.cropBoxResizable || (re(u.getElementsByClassName("".concat(G, "-line")), fe), re(u.getElementsByClassName("".concat(G, "-point")), fe)), this.render(), this.ready = !0, this.setDragMode(i.dragMode), i.autoCrop && this.crop(), this.setData(i.data), ue(i.ready) && me(t, Aa, i.ready, {
|
|
3618
|
-
once: !0
|
|
3619
|
-
}), at(t, Aa);
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3622
|
-
}, {
|
|
3623
|
-
key: "unbuild",
|
|
3624
|
-
value: function() {
|
|
3625
|
-
if (this.ready) {
|
|
3626
|
-
this.ready = !1, this.unbind(), this.resetPreview();
|
|
3627
|
-
var t = this.cropper.parentNode;
|
|
3628
|
-
t && t.removeChild(this.cropper), Te(this.element, fe);
|
|
3629
|
-
}
|
|
3630
|
-
}
|
|
3631
|
-
}, {
|
|
3632
|
-
key: "uncreate",
|
|
3633
|
-
value: function() {
|
|
3634
|
-
this.ready ? (this.unbuild(), this.ready = !1, this.cropped = !1) : this.sizing ? (this.sizingImage.onload = null, this.sizing = !1, this.sized = !1) : this.reloading ? (this.xhr.onabort = null, this.xhr.abort()) : this.image && this.stop();
|
|
3635
|
-
}
|
|
3636
|
-
/**
|
|
3637
|
-
* Get the no conflict cropper class.
|
|
3638
|
-
* @returns {Cropper} The cropper class.
|
|
3639
|
-
*/
|
|
3640
|
-
}], [{
|
|
3641
|
-
key: "noConflict",
|
|
3642
|
-
value: function() {
|
|
3643
|
-
return window.Cropper = Gl, a;
|
|
3644
|
-
}
|
|
3645
|
-
/**
|
|
3646
|
-
* Change the default options.
|
|
3647
|
-
* @param {Object} options - The new default options.
|
|
3648
|
-
*/
|
|
3649
|
-
}, {
|
|
3650
|
-
key: "setDefaults",
|
|
3651
|
-
value: function(t) {
|
|
3652
|
-
V(Pa, Qe(t) && t);
|
|
3653
|
-
}
|
|
3654
|
-
}]);
|
|
3655
|
-
}();
|
|
3656
|
-
V(Vl.prototype, Hl, Xl, Fl, Wl, zl, Ul);
|
|
3657
|
-
export {
|
|
3658
|
-
qs as A,
|
|
3659
|
-
Vl as C,
|
|
3660
|
-
oc as F,
|
|
3661
|
-
st as S,
|
|
3662
|
-
sa as U,
|
|
3663
|
-
Ql as a,
|
|
3664
|
-
Us as b,
|
|
3665
|
-
De as c,
|
|
3666
|
-
sc as d,
|
|
3667
|
-
lc as e,
|
|
3668
|
-
cc as f,
|
|
3669
|
-
gs as g,
|
|
3670
|
-
Vi as h,
|
|
3671
|
-
Jr as i,
|
|
3672
|
-
Ln as j,
|
|
3673
|
-
La as k,
|
|
3674
|
-
Hr as l,
|
|
3675
|
-
nc as m,
|
|
3676
|
-
zr as n,
|
|
3677
|
-
to as o,
|
|
3678
|
-
_e as p,
|
|
3679
|
-
Fa as q,
|
|
3680
|
-
An as r,
|
|
3681
|
-
hc as s,
|
|
3682
|
-
tc as t,
|
|
3683
|
-
ec as u,
|
|
3684
|
-
ic as v,
|
|
3685
|
-
ac as w,
|
|
3686
|
-
rc as x,
|
|
3687
|
-
Jl as y,
|
|
3688
|
-
x as z
|
|
3689
|
-
};
|