go-captcha-vue 2.0.0 → 2.0.2
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/README.md +13 -8
- package/dist/go-captcha-vue.es.js +456 -426
- package/dist/go-captcha-vue.umd.js +8 -8
- package/dist/index.d.ts +2 -4
- package/dist/style.css +1 -1
- package/package.json +14 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as X, openBlock as w, createElementBlock as C, mergeProps as I, createElementVNode as c, reactive as ne, toRaw as me, ref as z, watch as K, computed as P, normalizeClass as j, normalizeStyle as _, toDisplayString as U, withDirectives as V, unref as a, vShow as N, createVNode as D, Fragment as pe, renderList as _e, onMounted as ie, nextTick as ae, toRefs as Ee, createBlock as O, createCommentVNode as be } from "vue";
|
|
2
|
+
const re = () => ({
|
|
3
3
|
width: 300,
|
|
4
4
|
height: 220,
|
|
5
5
|
thumbWidth: 150,
|
|
@@ -9,31 +9,31 @@ const lt = () => ({
|
|
|
9
9
|
showTheme: !0,
|
|
10
10
|
title: "请在下图依次点击",
|
|
11
11
|
buttonText: "确认"
|
|
12
|
-
}),
|
|
12
|
+
}), we = /* @__PURE__ */ c("path", { d: `M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
|
|
13
13
|
c49.6,0,89.9,40.4,89.9,89.9c0,18.2-5.4,35.7-15.6,50.7c-1.5,2.1-3.6,3.4-6.1,3.9c-2.5,0.4-5-0.1-7-1.6c-4.2-3-5.3-8.6-2.4-12.9
|
|
14
14
|
c8.1-11.9,12.4-25.7,12.4-40.1c0-39.2-31.9-71.1-71.1-71.1c-39.2,0-71.1,31.9-71.1,71.1c0,39.2,31.9,71.1,71.1,71.1
|
|
15
15
|
c7.7,0,15.3-1.2,22.6-3.6c2.4-0.8,4.9-0.6,7.2,0.5c2.2,1.1,3.9,3.1,4.7,5.5c1.6,4.9-1,10.2-5.9,11.9
|
|
16
16
|
C119.3,188.4,109.8,189.9,100.1,189.9z M73,136.4C73,136.4,73,136.4,73,136.4c-2.5,0-4.9-1-6.7-2.8c-3.7-3.7-3.7-9.6,0-13.3
|
|
17
17
|
L86.7,100L66.4,79.7c-3.7-3.7-3.7-9.6,0-13.3c3.7-3.7,9.6-3.7,13.3,0L100,86.7l20.3-20.3c1.8-1.8,4.1-2.8,6.7-2.8c0,0,0,0,0,0
|
|
18
18
|
c2.5,0,4.9,1,6.7,2.8c1.8,1.8,2.8,4.1,2.8,6.7c0,2.5-1,4.9-2.8,6.7L113.3,100l20.3,20.3c3.7,3.7,3.7,9.6,0,13.3
|
|
19
|
-
c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1),
|
|
20
|
-
|
|
21
|
-
],
|
|
19
|
+
c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z` }, null, -1), xe = [
|
|
20
|
+
we
|
|
21
|
+
], ce = /* @__PURE__ */ X({
|
|
22
22
|
__name: "close-icon",
|
|
23
23
|
emits: ["click"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
|
|
24
|
+
setup(l, { emit: n }) {
|
|
25
|
+
const t = n;
|
|
26
|
+
function s(e) {
|
|
27
|
+
t("click", e);
|
|
28
28
|
}
|
|
29
|
-
return (
|
|
29
|
+
return (e, i) => (w(), C("svg", I({
|
|
30
30
|
xmlns: "http://www.w3.org/2000/svg",
|
|
31
31
|
viewBox: "0 0 200 200",
|
|
32
32
|
width: "20",
|
|
33
33
|
height: "20"
|
|
34
|
-
},
|
|
34
|
+
}, e.$attrs, { onClick: s }), xe, 16));
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), Le = /* @__PURE__ */ c("path", { d: `M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
|
|
37
37
|
c-0.8-0.2-1.6-0.4-2.3-0.5c-1.2-0.3-2.5-0.6-3.7-1c-0.6-0.2-1.2-0.4-1.7-0.6c-1.4-0.5-2.8-1-4.2-1.5c-0.3-0.1-0.6-0.3-0.9-0.4
|
|
38
38
|
c-1.6-0.7-3.2-1.4-4.7-2.3c-0.1,0-0.1-0.1-0.2-0.1c-5.1-2.9-9.8-6.4-14-10.6c-0.1-0.1-0.1-0.1-0.2-0.2c-1.3-1.3-2.5-2.7-3.7-4.1
|
|
39
39
|
c-0.2-0.3-0.5-0.6-0.7-0.9c-8.4-10.6-13.5-24.1-13.5-38.8h14.3c0.4,0,0.7-0.2,0.9-0.5c0.2-0.3,0.2-0.8,0-1.1L29.5,60.9
|
|
@@ -50,24 +50,24 @@ const lt = () => ({
|
|
|
50
50
|
c0.6,0.1,1.3,0.3,1.9,0.4c1.4,0.3,2.8,0.7,4.2,1.1c0.4,0.1,0.9,0.3,1.3,0.4c1.6,0.5,3.1,1.1,4.6,1.7c0.2,0.1,0.3,0.1,0.5,0.2
|
|
51
51
|
c9,3.9,17,10,23.2,17.6c0,0,0.1,0.1,0.1,0.2c8.7,10.7,14,24.5,14,39.4H147c-0.4,0-0.7,0.2-0.9,0.5c-0.2,0.3-0.2,0.8,0,1.1l24,36.4
|
|
52
52
|
c0.2,0.3,0.5,0.5,0.9,0.5c0.4,0,0.7-0.2,0.9-0.5l23.9-36.4c0.2-0.3,0.2-0.7,0-1.1c-0.2-0.3-0.5-0.5-0.9-0.5L180.6,98.9L180.6,98.9
|
|
53
|
-
L180.6,98.9z` }, null, -1),
|
|
54
|
-
|
|
55
|
-
],
|
|
53
|
+
L180.6,98.9z` }, null, -1), ke = [
|
|
54
|
+
Le
|
|
55
|
+
], se = /* @__PURE__ */ X({
|
|
56
56
|
__name: "refresh-icon",
|
|
57
57
|
emits: ["click"],
|
|
58
|
-
setup(
|
|
59
|
-
const
|
|
60
|
-
function
|
|
61
|
-
|
|
58
|
+
setup(l, { emit: n }) {
|
|
59
|
+
const t = n;
|
|
60
|
+
function s(e) {
|
|
61
|
+
t("click", e);
|
|
62
62
|
}
|
|
63
|
-
return (
|
|
63
|
+
return (e, i) => (w(), C("svg", I({
|
|
64
64
|
xmlns: "http://www.w3.org/2000/svg",
|
|
65
65
|
viewBox: "0 0 200 200",
|
|
66
66
|
width: "20",
|
|
67
67
|
height: "20"
|
|
68
|
-
},
|
|
68
|
+
}, e.$attrs, { onClick: s }), ke, 16));
|
|
69
69
|
}
|
|
70
|
-
}),
|
|
70
|
+
}), ye = /* @__PURE__ */ c("circle", {
|
|
71
71
|
cx: "50",
|
|
72
72
|
cy: "36.8101",
|
|
73
73
|
r: "10"
|
|
@@ -81,164 +81,164 @@ const lt = () => ({
|
|
|
81
81
|
keyTimes: "0;0.5;1",
|
|
82
82
|
values: "23;77;23"
|
|
83
83
|
})
|
|
84
|
-
], -1),
|
|
85
|
-
|
|
86
|
-
],
|
|
84
|
+
], -1), $e = [
|
|
85
|
+
ye
|
|
86
|
+
], le = /* @__PURE__ */ X({
|
|
87
87
|
__name: "loading-icon",
|
|
88
88
|
emits: ["click"],
|
|
89
|
-
setup(
|
|
90
|
-
const
|
|
91
|
-
function
|
|
92
|
-
|
|
89
|
+
setup(l, { emit: n }) {
|
|
90
|
+
const t = n;
|
|
91
|
+
function s(e) {
|
|
92
|
+
t("click", e);
|
|
93
93
|
}
|
|
94
|
-
return (
|
|
94
|
+
return (e, i) => (w(), C("svg", I({
|
|
95
95
|
xmlns: "http://www.w3.org/2000/svg",
|
|
96
96
|
viewBox: "0 0 100 100",
|
|
97
97
|
preserveAspectRatio: "xMidYMid",
|
|
98
98
|
width: "84",
|
|
99
99
|
height: "84"
|
|
100
|
-
},
|
|
100
|
+
}, e.$attrs, { onClick: s }), $e, 16));
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
|
-
function
|
|
104
|
-
let n = 0,
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
n =
|
|
103
|
+
function Ce(l) {
|
|
104
|
+
let n = 0, t = 0;
|
|
105
|
+
if (l.getBoundingClientRect) {
|
|
106
|
+
const s = l.getBoundingClientRect(), e = document.documentElement;
|
|
107
|
+
n = s.left + Math.max(e.scrollLeft, document.body.scrollLeft) - e.clientLeft, t = s.top + Math.max(e.scrollTop, document.body.scrollTop) - e.clientTop;
|
|
108
108
|
} else
|
|
109
|
-
for (;
|
|
110
|
-
n +=
|
|
109
|
+
for (; l !== document.body; )
|
|
110
|
+
n += l.offsetLeft, t += l.offsetTop, l = l.offsetParent;
|
|
111
111
|
return {
|
|
112
112
|
domX: n,
|
|
113
|
-
domY:
|
|
113
|
+
domY: t
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
let
|
|
116
|
+
function ue(l, n) {
|
|
117
|
+
let t = n.relatedTarget;
|
|
118
118
|
try {
|
|
119
|
-
for (;
|
|
120
|
-
|
|
121
|
-
} catch (
|
|
122
|
-
console.warn(
|
|
119
|
+
for (; t && t !== l; )
|
|
120
|
+
t = t.parentNode;
|
|
121
|
+
} catch (s) {
|
|
122
|
+
console.warn(s);
|
|
123
123
|
}
|
|
124
|
-
return
|
|
124
|
+
return t !== l;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
const
|
|
126
|
+
function Te(l, n) {
|
|
127
|
+
const t = ne({ list: [] });
|
|
128
128
|
return {
|
|
129
|
-
dots:
|
|
129
|
+
dots: t,
|
|
130
130
|
clickEvent: (o) => {
|
|
131
|
-
const
|
|
132
|
-
return
|
|
131
|
+
const x = o.currentTarget, u = Ce(x), m = o.pageX || o.clientX, r = o.pageY || o.clientY, v = u.domX, E = u.domY, b = m - v, g = r - E, p = parseInt(b.toString()), L = parseInt(g.toString()), $ = /* @__PURE__ */ new Date(), M = t.list.length, T = t.list;
|
|
132
|
+
return T.push({ key: $.getTime(), index: M + 1, x: p, y: L }), t.list = T, n.click && n.click(p, L), o.cancelBubble = !0, o.preventDefault(), !1;
|
|
133
133
|
},
|
|
134
|
-
confirmEvent: (o) => (n.confirm && n.confirm(
|
|
135
|
-
|
|
134
|
+
confirmEvent: (o) => (n.confirm && n.confirm(me(t.list), () => {
|
|
135
|
+
t.list = [];
|
|
136
136
|
}), o.cancelBubble = !0, o.preventDefault(), !1),
|
|
137
|
-
closeEvent: (o) => (n.close && n.close(),
|
|
138
|
-
refreshEvent: (o) => (n.refresh && n.refresh(),
|
|
137
|
+
closeEvent: (o) => (n.close && n.close(), t.list = [], o.cancelBubble = !0, o.preventDefault(), !1),
|
|
138
|
+
refreshEvent: (o) => (n.refresh && n.refresh(), t.list = [], o.cancelBubble = !0, o.preventDefault(), !1)
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
const
|
|
141
|
+
const De = { class: "gc-header" }, Pe = ["src"], ze = { class: "gc-loading" }, Xe = ["src"], Me = { class: "gc-dots" }, Se = { class: "gc-footer" }, Be = { class: "gc-icon-block gc-icon-block2" }, We = { class: "gc-button-block" }, Q = /* @__PURE__ */ X({
|
|
142
142
|
__name: "index",
|
|
143
143
|
props: {
|
|
144
|
-
config: { default:
|
|
144
|
+
config: { default: re },
|
|
145
145
|
events: { default: () => ({}) },
|
|
146
146
|
data: { default: () => ({}) }
|
|
147
147
|
},
|
|
148
|
-
setup(
|
|
149
|
-
const n =
|
|
150
|
-
...
|
|
148
|
+
setup(l) {
|
|
149
|
+
const n = l, { data: t, events: s } = n, e = z({
|
|
150
|
+
...re(),
|
|
151
151
|
...n.config
|
|
152
152
|
});
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
...
|
|
153
|
+
K(() => n.config, () => {
|
|
154
|
+
e.value = {
|
|
155
|
+
...e.value,
|
|
156
156
|
...n.config
|
|
157
157
|
};
|
|
158
158
|
});
|
|
159
|
-
const
|
|
160
|
-
width:
|
|
159
|
+
const i = Te(t, s), d = e.value.horizontalPadding || 0, o = e.value.verticalPadding || 0, x = (e.value.width || 0) + d * 2 + (e.value.showTheme ? 2 : 0), u = i.dots, m = P(() => ({
|
|
160
|
+
width: x + "px",
|
|
161
161
|
paddingLeft: d + "px",
|
|
162
162
|
paddingRight: d + "px",
|
|
163
163
|
paddingTop: o + "px",
|
|
164
164
|
paddingBottom: o + "px"
|
|
165
|
-
})), r =
|
|
166
|
-
width:
|
|
167
|
-
height:
|
|
168
|
-
})),
|
|
169
|
-
width:
|
|
170
|
-
height:
|
|
165
|
+
})), r = P(() => ({
|
|
166
|
+
width: e.value.thumbWidth + "px",
|
|
167
|
+
height: e.value.thumbHeight + "px"
|
|
168
|
+
})), v = P(() => ({
|
|
169
|
+
width: e.value.width + "px",
|
|
170
|
+
height: e.value.height + "px"
|
|
171
171
|
}));
|
|
172
|
-
return (
|
|
173
|
-
class:
|
|
174
|
-
style: m
|
|
172
|
+
return (E, b) => (w(), C("div", {
|
|
173
|
+
class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
|
|
174
|
+
style: _(m.value)
|
|
175
175
|
}, [
|
|
176
|
-
c("div",
|
|
177
|
-
c("span", null,
|
|
178
|
-
|
|
179
|
-
style:
|
|
180
|
-
src:
|
|
176
|
+
c("div", De, [
|
|
177
|
+
c("span", null, U(e.value.title), 1),
|
|
178
|
+
V(c("img", {
|
|
179
|
+
style: _(r.value),
|
|
180
|
+
src: a(t).thumb,
|
|
181
181
|
alt: "..."
|
|
182
|
-
}, null, 12,
|
|
183
|
-
[
|
|
182
|
+
}, null, 12, Pe), [
|
|
183
|
+
[N, a(t).thumb !== ""]
|
|
184
184
|
])
|
|
185
185
|
]),
|
|
186
186
|
c("div", {
|
|
187
187
|
class: "gc-body",
|
|
188
|
-
style:
|
|
188
|
+
style: _(v.value)
|
|
189
189
|
}, [
|
|
190
|
-
c("div",
|
|
191
|
-
|
|
190
|
+
c("div", ze, [
|
|
191
|
+
D(le)
|
|
192
192
|
]),
|
|
193
|
-
|
|
194
|
-
style:
|
|
193
|
+
V(c("img", {
|
|
194
|
+
style: _(v.value),
|
|
195
195
|
class: "gc-picture",
|
|
196
|
-
src:
|
|
196
|
+
src: a(t).image,
|
|
197
197
|
alt: "...",
|
|
198
|
-
onClick:
|
|
199
|
-
(...
|
|
200
|
-
}, null, 12,
|
|
201
|
-
[
|
|
198
|
+
onClick: b[0] || (b[0] = //@ts-ignore
|
|
199
|
+
(...g) => a(i).clickEvent && a(i).clickEvent(...g))
|
|
200
|
+
}, null, 12, Xe), [
|
|
201
|
+
[N, a(t).image !== ""]
|
|
202
202
|
]),
|
|
203
|
-
c("div",
|
|
204
|
-
(
|
|
203
|
+
c("div", Me, [
|
|
204
|
+
(w(!0), C(pe, null, _e(a(u).list, (g) => (w(), C("div", {
|
|
205
205
|
class: "gc-dot",
|
|
206
|
-
key: `${
|
|
207
|
-
style:
|
|
208
|
-
top:
|
|
209
|
-
left:
|
|
206
|
+
key: `${g.key + "-" + g.index}`,
|
|
207
|
+
style: _({
|
|
208
|
+
top: g.y - 11 + "px",
|
|
209
|
+
left: g.x - 11 + "px"
|
|
210
210
|
})
|
|
211
|
-
},
|
|
211
|
+
}, U(g.index), 5))), 128))
|
|
212
212
|
])
|
|
213
213
|
], 4),
|
|
214
|
-
c("div",
|
|
215
|
-
c("div",
|
|
216
|
-
|
|
214
|
+
c("div", Se, [
|
|
215
|
+
c("div", Be, [
|
|
216
|
+
D(ce, {
|
|
217
217
|
width: 22,
|
|
218
218
|
height: 22,
|
|
219
|
-
onClick: i
|
|
219
|
+
onClick: a(i).closeEvent
|
|
220
220
|
}, null, 8, ["onClick"]),
|
|
221
|
-
|
|
221
|
+
D(se, {
|
|
222
222
|
width: 22,
|
|
223
223
|
height: 22,
|
|
224
|
-
onClick: i
|
|
224
|
+
onClick: a(i).refreshEvent
|
|
225
225
|
}, null, 8, ["onClick"])
|
|
226
226
|
]),
|
|
227
|
-
c("div",
|
|
227
|
+
c("div", We, [
|
|
228
228
|
c("button", {
|
|
229
|
-
onClick:
|
|
230
|
-
(...
|
|
231
|
-
},
|
|
229
|
+
onClick: b[1] || (b[1] = //@ts-ignore
|
|
230
|
+
(...g) => a(i).confirmEvent && a(i).confirmEvent(...g))
|
|
231
|
+
}, U(e.value.buttonText), 1)
|
|
232
232
|
])
|
|
233
233
|
])
|
|
234
234
|
], 6));
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
Q.name = "gocaptcha-click";
|
|
238
|
+
Q.install = function(l) {
|
|
239
|
+
l.component("gocaptcha-click", Q);
|
|
240
240
|
};
|
|
241
|
-
const
|
|
241
|
+
const de = () => ({
|
|
242
242
|
width: 300,
|
|
243
243
|
height: 220,
|
|
244
244
|
thumbWidth: 150,
|
|
@@ -247,111 +247,119 @@ const ot = () => ({
|
|
|
247
247
|
horizontalPadding: 12,
|
|
248
248
|
showTheme: !0,
|
|
249
249
|
title: "请拖动滑块完成拼图"
|
|
250
|
-
}),
|
|
250
|
+
}), Ye = /* @__PURE__ */ c("path", { d: `M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
|
|
251
251
|
s-5.4-5.4-30.4-30.7c-6.4-6.4-6.4-16.7,0-23.1s16.7-6.4,23.1,0l58.4,58.4c6.4,6.4,6.4,16.7,0,23.1c0,0-32.9,32.9-57.9,57.9
|
|
252
|
-
c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1),
|
|
253
|
-
|
|
254
|
-
],
|
|
252
|
+
c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z` }, null, -1), He = [
|
|
253
|
+
Ye
|
|
254
|
+
], fe = /* @__PURE__ */ X({
|
|
255
255
|
__name: "arrows-icon",
|
|
256
256
|
emits: ["click"],
|
|
257
|
-
setup(
|
|
258
|
-
const
|
|
259
|
-
function
|
|
260
|
-
|
|
257
|
+
setup(l, { emit: n }) {
|
|
258
|
+
const t = n;
|
|
259
|
+
function s(e) {
|
|
260
|
+
t("click", e);
|
|
261
261
|
}
|
|
262
|
-
return (
|
|
262
|
+
return (e, i) => (w(), C("svg", I({
|
|
263
263
|
xmlns: "http://www.w3.org/2000/svg",
|
|
264
264
|
viewBox: "0 0 200 200",
|
|
265
265
|
width: "20",
|
|
266
266
|
height: "20"
|
|
267
|
-
},
|
|
267
|
+
}, e.$attrs, { onClick: s }), He, 16));
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
|
-
function
|
|
271
|
-
const d =
|
|
270
|
+
function Fe(l, n, t, s, e, i) {
|
|
271
|
+
const d = ne({ dragLeft: 0, thumbLeft: l.thumbX || 0 }), o = () => {
|
|
272
272
|
d.dragLeft = 0, d.thumbLeft = 0;
|
|
273
273
|
};
|
|
274
274
|
return {
|
|
275
275
|
state: d,
|
|
276
276
|
dragEvent: (r) => {
|
|
277
|
-
const
|
|
278
|
-
let
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
let
|
|
284
|
-
if (
|
|
285
|
-
d.dragLeft =
|
|
277
|
+
const v = r.touches && r.touches[0], E = e.value.offsetLeft, b = t.value.offsetWidth, g = e.value.offsetWidth, p = b - g, L = l.thumbX || 0, $ = s.value.offsetWidth, M = g - $, T = (p - L + M) / p;
|
|
278
|
+
let k = !1, S = null, Y = 0, H = 0;
|
|
279
|
+
v ? Y = v.pageX - E : Y = r.clientX - E;
|
|
280
|
+
const B = (f) => {
|
|
281
|
+
k = !0;
|
|
282
|
+
const G = f.touches && f.touches[0];
|
|
283
|
+
let y = 0;
|
|
284
|
+
if (G ? y = G.pageX - Y : y = f.clientX - Y, y >= p) {
|
|
285
|
+
d.dragLeft = p;
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
if (
|
|
288
|
+
if (y <= 0) {
|
|
289
289
|
d.dragLeft = 0;
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
d.dragLeft =
|
|
293
|
-
},
|
|
294
|
-
|
|
292
|
+
d.dragLeft = y, H = L + y * T, d.thumbLeft = H, n.move && n.move(H, l.thumbY || 0), f.cancelBubble = !0, f.preventDefault();
|
|
293
|
+
}, h = (f) => {
|
|
294
|
+
ue(i.value, f) && k && (k = !1, J(), n.confirm && n.confirm({ x: parseInt(H.toString()), y: l.thumbY || 0 }, () => {
|
|
295
295
|
o();
|
|
296
|
-
}),
|
|
296
|
+
}), f.cancelBubble = !0, f.preventDefault());
|
|
297
|
+
}, A = (f) => {
|
|
298
|
+
S = f;
|
|
299
|
+
}, W = () => {
|
|
300
|
+
S = null;
|
|
301
|
+
}, q = (f) => {
|
|
302
|
+
S && (h(S), J());
|
|
303
|
+
}, J = () => {
|
|
304
|
+
i.value.removeEventListener("mousemove", B, !1), i.value.removeEventListener("touchmove", B, { passive: !1 }), i.value.removeEventListener("mouseup", h, !1), i.value.removeEventListener("mouseenter", W, !1), i.value.removeEventListener("mouseleave", A, !1), i.value.removeEventListener("touchend", h, !1), document.body.removeEventListener("mouseleave", h, !1), document.body.removeEventListener("mouseup", q, !1);
|
|
297
305
|
};
|
|
298
|
-
|
|
306
|
+
i.value.addEventListener("mousemove", B, !1), i.value.addEventListener("touchmove", B, { passive: !1 }), i.value.addEventListener("mouseup", h, !1), i.value.addEventListener("mouseenter", W, !1), i.value.addEventListener("mouseleave", A, !1), i.value.addEventListener("touchend", h, !1), document.body.addEventListener("mouseleave", h, !1), document.body.addEventListener("mouseup", q, !1);
|
|
299
307
|
},
|
|
300
308
|
closeEvent: (r) => (n && n.close && n.close(), o(), r.cancelBubble = !0, r.preventDefault(), !1),
|
|
301
309
|
refreshEvent: (r) => (n && n.refresh && n.refresh(), o(), r.cancelBubble = !0, r.preventDefault(), !1)
|
|
302
310
|
};
|
|
303
311
|
}
|
|
304
|
-
const
|
|
312
|
+
const Ae = { class: "gc-header" }, Ve = { class: "gc-icon-block" }, Ne = { class: "gc-loading" }, Ie = ["src"], Ue = ["src"], Ge = { class: "gc-footer" }, je = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), Z = /* @__PURE__ */ X({
|
|
305
313
|
__name: "index",
|
|
306
314
|
props: {
|
|
307
|
-
config: { default:
|
|
315
|
+
config: { default: de },
|
|
308
316
|
events: { default: () => ({}) },
|
|
309
317
|
data: { default: () => ({}) }
|
|
310
318
|
},
|
|
311
|
-
setup(
|
|
312
|
-
const n =
|
|
313
|
-
...
|
|
319
|
+
setup(l) {
|
|
320
|
+
const n = l, { data: t, events: s } = n, e = z({
|
|
321
|
+
...de(),
|
|
314
322
|
...n.config
|
|
315
323
|
});
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
...
|
|
324
|
+
K(() => n.config, () => {
|
|
325
|
+
e.value = {
|
|
326
|
+
...e.value,
|
|
319
327
|
...n.config
|
|
320
328
|
};
|
|
321
329
|
});
|
|
322
|
-
const
|
|
323
|
-
width:
|
|
324
|
-
paddingLeft:
|
|
325
|
-
paddingRight:
|
|
330
|
+
const i = z(null), d = z(null), o = z(null), x = z(null), u = Fe(t, s, d, x, o, i), m = e.value.horizontalPadding || 0, r = e.value.verticalPadding || 0, v = (e.value.width || 0) + m * 2 + (e.value.showTheme ? 2 : 0), E = P(() => ({
|
|
331
|
+
width: v + "px",
|
|
332
|
+
paddingLeft: m + "px",
|
|
333
|
+
paddingRight: m + "px",
|
|
326
334
|
paddingTop: r + "px",
|
|
327
335
|
paddingBottom: r + "px"
|
|
328
|
-
})),
|
|
329
|
-
width:
|
|
330
|
-
height:
|
|
331
|
-
top:
|
|
336
|
+
})), b = P(() => ({
|
|
337
|
+
width: t.thumbWidth + "px",
|
|
338
|
+
height: t.thumbHeight + "px",
|
|
339
|
+
top: t.thumbY + "px",
|
|
332
340
|
left: u.state.thumbLeft + "px"
|
|
333
|
-
})),
|
|
334
|
-
width:
|
|
335
|
-
height:
|
|
341
|
+
})), g = P(() => ({
|
|
342
|
+
width: e.value.width + "px",
|
|
343
|
+
height: e.value.height + "px"
|
|
336
344
|
}));
|
|
337
|
-
return
|
|
338
|
-
await
|
|
339
|
-
}), (
|
|
340
|
-
class:
|
|
341
|
-
style:
|
|
345
|
+
return ie(async () => {
|
|
346
|
+
await ae(), o.value && o.value.addEventListener("dragstart", (p) => p.preventDefault());
|
|
347
|
+
}), (p, L) => (w(), C("div", {
|
|
348
|
+
class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
|
|
349
|
+
style: _(E.value)
|
|
342
350
|
}, [
|
|
343
|
-
c("div",
|
|
344
|
-
c("span", null,
|
|
345
|
-
c("div",
|
|
346
|
-
|
|
351
|
+
c("div", Ae, [
|
|
352
|
+
c("span", null, U(e.value.title), 1),
|
|
353
|
+
c("div", Ve, [
|
|
354
|
+
D(ce, {
|
|
347
355
|
width: 22,
|
|
348
356
|
height: 22,
|
|
349
|
-
onClick:
|
|
357
|
+
onClick: a(u).closeEvent
|
|
350
358
|
}, null, 8, ["onClick"]),
|
|
351
|
-
|
|
359
|
+
D(se, {
|
|
352
360
|
width: 22,
|
|
353
361
|
height: 22,
|
|
354
|
-
onClick:
|
|
362
|
+
onClick: a(u).refreshEvent
|
|
355
363
|
}, null, 8, ["onClick"])
|
|
356
364
|
])
|
|
357
365
|
]),
|
|
@@ -359,62 +367,66 @@ const St = { class: "gc-header" }, Bt = { class: "gc-icon-block" }, Wt = { class
|
|
|
359
367
|
class: "gc-body",
|
|
360
368
|
ref_key: "containerRef",
|
|
361
369
|
ref: d,
|
|
362
|
-
style:
|
|
370
|
+
style: _(g.value)
|
|
363
371
|
}, [
|
|
364
|
-
c("div",
|
|
365
|
-
|
|
372
|
+
c("div", Ne, [
|
|
373
|
+
D(le)
|
|
366
374
|
]),
|
|
367
|
-
|
|
375
|
+
V(c("img", {
|
|
368
376
|
class: "gc-picture",
|
|
369
|
-
style:
|
|
370
|
-
src:
|
|
377
|
+
style: _(g.value),
|
|
378
|
+
src: a(t).image,
|
|
371
379
|
alt: "..."
|
|
372
|
-
}, null, 12,
|
|
373
|
-
[
|
|
380
|
+
}, null, 12, Ie), [
|
|
381
|
+
[N, a(t).image !== ""]
|
|
374
382
|
]),
|
|
375
383
|
c("div", {
|
|
376
384
|
class: "gc-tile",
|
|
377
385
|
ref_key: "tileRef",
|
|
378
|
-
ref:
|
|
379
|
-
style:
|
|
386
|
+
ref: x,
|
|
387
|
+
style: _(b.value)
|
|
380
388
|
}, [
|
|
381
|
-
|
|
382
|
-
src:
|
|
389
|
+
V(c("img", {
|
|
390
|
+
src: a(t).thumb,
|
|
383
391
|
alt: "..."
|
|
384
|
-
}, null, 8,
|
|
385
|
-
[
|
|
392
|
+
}, null, 8, Ue), [
|
|
393
|
+
[N, a(t).thumb !== ""]
|
|
386
394
|
])
|
|
387
395
|
], 4)
|
|
388
396
|
], 4),
|
|
389
|
-
c("div",
|
|
397
|
+
c("div", Ge, [
|
|
390
398
|
c("div", {
|
|
391
399
|
class: "gc-drag-slide-bar",
|
|
392
400
|
ref_key: "dragBarRef",
|
|
393
|
-
ref:
|
|
394
|
-
onMousedown: k[1] || (k[1] = //@ts-ignore
|
|
395
|
-
(...$) => i(u).dragEvent && i(u).dragEvent(...$))
|
|
401
|
+
ref: i
|
|
396
402
|
}, [
|
|
397
|
-
|
|
403
|
+
je,
|
|
398
404
|
c("div", {
|
|
399
405
|
class: "gc-drag-block",
|
|
400
406
|
ref_key: "dragBlockRef",
|
|
401
407
|
ref: o,
|
|
402
|
-
|
|
403
|
-
(...$) =>
|
|
404
|
-
style:
|
|
408
|
+
onMousedown: L[1] || (L[1] = //@ts-ignore
|
|
409
|
+
(...$) => a(u).dragEvent && a(u).dragEvent(...$)),
|
|
410
|
+
style: _({ left: a(u).state.dragLeft + "px" })
|
|
405
411
|
}, [
|
|
406
|
-
|
|
412
|
+
c("div", {
|
|
413
|
+
class: "drag-block-inline",
|
|
414
|
+
onTouchstart: L[0] || (L[0] = //@ts-ignore
|
|
415
|
+
(...$) => a(u).dragEvent && a(u).dragEvent(...$))
|
|
416
|
+
}, [
|
|
417
|
+
D(fe)
|
|
418
|
+
], 32)
|
|
407
419
|
], 36)
|
|
408
|
-
],
|
|
420
|
+
], 512)
|
|
409
421
|
])
|
|
410
422
|
], 6));
|
|
411
423
|
}
|
|
412
424
|
});
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
425
|
+
Z.name = "gocaptcha-slide";
|
|
426
|
+
Z.install = function(l) {
|
|
427
|
+
l.component("gocaptcha-slide", Z);
|
|
416
428
|
};
|
|
417
|
-
const
|
|
429
|
+
const ve = () => ({
|
|
418
430
|
width: 300,
|
|
419
431
|
height: 220,
|
|
420
432
|
verticalPadding: 16,
|
|
@@ -422,133 +434,141 @@ const it = () => ({
|
|
|
422
434
|
showTheme: !0,
|
|
423
435
|
title: "请拖拽贴图完成拼图"
|
|
424
436
|
});
|
|
425
|
-
function
|
|
426
|
-
const
|
|
427
|
-
|
|
437
|
+
function qe(l, n, t, s) {
|
|
438
|
+
const e = ne({ x: l.thumbX || 0, y: l.thumbY || 0 }), i = () => {
|
|
439
|
+
e.x = l.thumbX || 0, e.y = l.thumbY || 0;
|
|
428
440
|
};
|
|
429
441
|
return {
|
|
430
|
-
state:
|
|
442
|
+
state: e,
|
|
431
443
|
dragEvent: (u) => {
|
|
432
|
-
const
|
|
433
|
-
let
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
const
|
|
438
|
-
let
|
|
439
|
-
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}),
|
|
444
|
+
const m = u.touches && u.touches[0], r = s.value.offsetLeft, v = s.value.offsetTop, E = t.value.offsetWidth, b = t.value.offsetHeight, g = s.value.offsetWidth, p = s.value.offsetHeight, L = E - g, $ = b - p;
|
|
445
|
+
let M = !1, T = null, k = 0, S = 0, Y = 0, H = 0;
|
|
446
|
+
m ? (k = m.pageX - r, S = m.pageY - v) : (k = u.clientX - r, S = u.clientY - v);
|
|
447
|
+
const B = (f) => {
|
|
448
|
+
M = !0;
|
|
449
|
+
const G = f.touches && f.touches[0];
|
|
450
|
+
let y = 0, F = 0;
|
|
451
|
+
G ? (y = G.pageX - k, F = G.pageY - S) : (y = f.clientX - k, F = f.clientY - S), y <= 0 && (y = 0), F <= 0 && (F = 0), y >= L && (y = L), F >= $ && (F = $), e.x = y, e.y = F, Y = y, H = F, n.move && n.move(y, F), f.cancelBubble = !0, f.preventDefault();
|
|
452
|
+
}, h = (f) => {
|
|
453
|
+
ue(t.value, f) && M && (M = !1, J(), n.confirm && n.confirm({ x: Y, y: H }, () => {
|
|
454
|
+
i();
|
|
455
|
+
}), f.cancelBubble = !0, f.preventDefault());
|
|
456
|
+
}, A = (f) => {
|
|
457
|
+
T = f;
|
|
458
|
+
}, W = () => {
|
|
459
|
+
T = null;
|
|
460
|
+
}, q = (f) => {
|
|
461
|
+
T && (h(T), J());
|
|
462
|
+
}, J = () => {
|
|
463
|
+
t.value.removeEventListener("mousemove", B, !1), t.value.removeEventListener("touchmove", B, { passive: !1 }), t.value.removeEventListener("mouseup", h, !1), t.value.removeEventListener("mouseenter", W, !1), t.value.removeEventListener("mouseleave", A, !1), t.value.removeEventListener("touchend", h, !1), document.body.removeEventListener("mouseleave", h, !1), document.body.removeEventListener("mouseup", q, !1);
|
|
444
464
|
};
|
|
445
|
-
|
|
465
|
+
t.value.addEventListener("mousemove", B, !1), t.value.addEventListener("touchmove", B, { passive: !1 }), t.value.addEventListener("mouseup", h, !1), t.value.addEventListener("mouseenter", W, !1), t.value.addEventListener("mouseleave", A, !1), t.value.addEventListener("touchend", h, !1), document.body.addEventListener("mouseleave", h, !1), document.body.addEventListener("mouseup", q, !1);
|
|
446
466
|
},
|
|
447
|
-
closeEvent: (u) => (n && n.close && n.close(),
|
|
448
|
-
refreshEvent: (u) => (n && n.refresh && n.refresh(),
|
|
467
|
+
closeEvent: (u) => (n && n.close && n.close(), i(), u.cancelBubble = !0, u.preventDefault(), !1),
|
|
468
|
+
refreshEvent: (u) => (n && n.refresh && n.refresh(), i(), u.cancelBubble = !0, u.preventDefault(), !1)
|
|
449
469
|
};
|
|
450
470
|
}
|
|
451
|
-
const
|
|
471
|
+
const Je = { class: "gc-header gc-header2" }, Ke = { class: "gc-loading" }, Oe = ["src"], Qe = ["src"], Ze = { class: "gc-footer" }, Re = { class: "gc-icon-block" }, R = /* @__PURE__ */ X({
|
|
452
472
|
__name: "index",
|
|
453
473
|
props: {
|
|
454
|
-
config: { default:
|
|
474
|
+
config: { default: ve },
|
|
455
475
|
events: { default: () => ({}) },
|
|
456
476
|
data: { default: () => ({}) }
|
|
457
477
|
},
|
|
458
|
-
setup(
|
|
459
|
-
const n =
|
|
460
|
-
...
|
|
478
|
+
setup(l) {
|
|
479
|
+
const n = l, { data: t, events: s } = n, e = z({
|
|
480
|
+
...ve(),
|
|
461
481
|
...n.config
|
|
462
482
|
});
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
...
|
|
483
|
+
K(() => n.config, () => {
|
|
484
|
+
e.value = {
|
|
485
|
+
...e.value,
|
|
466
486
|
...n.config
|
|
467
487
|
};
|
|
468
488
|
});
|
|
469
|
-
const
|
|
470
|
-
let
|
|
471
|
-
const r =
|
|
472
|
-
width:
|
|
473
|
-
paddingLeft:
|
|
474
|
-
paddingRight:
|
|
489
|
+
const i = z(null), d = z(null), o = qe(t, s, i, d), x = e.value.horizontalPadding || 0, u = e.value.verticalPadding || 0;
|
|
490
|
+
let m = (e.value.width || 0) + x * 2 + (e.value.showTheme ? 2 : 0);
|
|
491
|
+
const r = P(() => ({
|
|
492
|
+
width: m + "px",
|
|
493
|
+
paddingLeft: x + "px",
|
|
494
|
+
paddingRight: x + "px",
|
|
475
495
|
paddingTop: u + "px",
|
|
476
496
|
paddingBottom: u + "px"
|
|
477
|
-
})),
|
|
478
|
-
width:
|
|
479
|
-
height:
|
|
497
|
+
})), v = P(() => ({
|
|
498
|
+
width: t.thumbWidth + "px",
|
|
499
|
+
height: t.thumbHeight + "px",
|
|
480
500
|
top: o.state.y + "px",
|
|
481
501
|
left: o.state.x + "px"
|
|
482
|
-
})),
|
|
483
|
-
width:
|
|
484
|
-
height:
|
|
502
|
+
})), E = P(() => ({
|
|
503
|
+
width: e.value.width + "px",
|
|
504
|
+
height: e.value.height + "px"
|
|
485
505
|
}));
|
|
486
|
-
return
|
|
487
|
-
await
|
|
488
|
-
}), (
|
|
489
|
-
class:
|
|
490
|
-
style:
|
|
506
|
+
return ie(async () => {
|
|
507
|
+
await ae(), d.value && d.value.addEventListener("dragstart", (b) => b.preventDefault());
|
|
508
|
+
}), (b, g) => (w(), C("div", {
|
|
509
|
+
class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
|
|
510
|
+
style: _(r.value)
|
|
491
511
|
}, [
|
|
492
|
-
c("div",
|
|
493
|
-
c("span", null,
|
|
512
|
+
c("div", Je, [
|
|
513
|
+
c("span", null, U(e.value.title), 1)
|
|
494
514
|
]),
|
|
495
515
|
c("div", {
|
|
496
516
|
class: "gc-body",
|
|
497
517
|
ref_key: "containerRef",
|
|
498
|
-
ref:
|
|
499
|
-
style:
|
|
518
|
+
ref: i,
|
|
519
|
+
style: _(E.value)
|
|
500
520
|
}, [
|
|
501
|
-
c("div",
|
|
502
|
-
|
|
521
|
+
c("div", Ke, [
|
|
522
|
+
D(le)
|
|
503
523
|
]),
|
|
504
|
-
|
|
524
|
+
V(c("img", {
|
|
505
525
|
class: "gc-picture",
|
|
506
|
-
style:
|
|
507
|
-
src:
|
|
526
|
+
style: _(E.value),
|
|
527
|
+
src: a(t).image,
|
|
508
528
|
alt: "..."
|
|
509
|
-
}, null, 12,
|
|
510
|
-
[
|
|
529
|
+
}, null, 12, Oe), [
|
|
530
|
+
[N, a(t).image !== ""]
|
|
511
531
|
]),
|
|
512
532
|
c("div", {
|
|
513
533
|
class: "gc-tile",
|
|
514
534
|
ref_key: "tileRef",
|
|
515
535
|
ref: d,
|
|
516
|
-
style:
|
|
517
|
-
onMousedown:
|
|
518
|
-
(...
|
|
519
|
-
onTouchstart:
|
|
520
|
-
(...
|
|
536
|
+
style: _(v.value),
|
|
537
|
+
onMousedown: g[0] || (g[0] = //@ts-ignore
|
|
538
|
+
(...p) => a(o).dragEvent && a(o).dragEvent(...p)),
|
|
539
|
+
onTouchstart: g[1] || (g[1] = //@ts-ignore
|
|
540
|
+
(...p) => a(o).dragEvent && a(o).dragEvent(...p))
|
|
521
541
|
}, [
|
|
522
|
-
|
|
523
|
-
src:
|
|
542
|
+
V(c("img", {
|
|
543
|
+
src: a(t).thumb,
|
|
524
544
|
alt: "..."
|
|
525
|
-
}, null, 8,
|
|
526
|
-
[
|
|
545
|
+
}, null, 8, Qe), [
|
|
546
|
+
[N, a(t).thumb !== ""]
|
|
527
547
|
])
|
|
528
548
|
], 36)
|
|
529
549
|
], 4),
|
|
530
|
-
c("div",
|
|
531
|
-
c("div",
|
|
532
|
-
|
|
550
|
+
c("div", Ze, [
|
|
551
|
+
c("div", Re, [
|
|
552
|
+
D(ce, {
|
|
533
553
|
width: 22,
|
|
534
554
|
height: 22,
|
|
535
|
-
onClick:
|
|
555
|
+
onClick: a(o).closeEvent
|
|
536
556
|
}, null, 8, ["onClick"]),
|
|
537
|
-
|
|
557
|
+
D(se, {
|
|
538
558
|
width: 22,
|
|
539
559
|
height: 22,
|
|
540
|
-
onClick:
|
|
560
|
+
onClick: a(o).refreshEvent
|
|
541
561
|
}, null, 8, ["onClick"])
|
|
542
562
|
])
|
|
543
563
|
])
|
|
544
564
|
], 6));
|
|
545
565
|
}
|
|
546
566
|
});
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
567
|
+
R.name = "gocaptcha-slide-region";
|
|
568
|
+
R.install = function(l) {
|
|
569
|
+
l.component("gocaptcha-slide-region", R);
|
|
550
570
|
};
|
|
551
|
-
const
|
|
571
|
+
const oe = () => ({
|
|
552
572
|
width: 300,
|
|
553
573
|
height: 220,
|
|
554
574
|
size: 220,
|
|
@@ -557,285 +577,297 @@ const et = () => ({
|
|
|
557
577
|
showTheme: !0,
|
|
558
578
|
title: "请拖动滑块完成拼图"
|
|
559
579
|
});
|
|
560
|
-
function
|
|
561
|
-
const
|
|
562
|
-
|
|
580
|
+
function et(l, n, t, s) {
|
|
581
|
+
const e = ne({ dragLeft: 0, thumbAngle: l.angle || 0 }), i = () => {
|
|
582
|
+
e.dragLeft = 0, e.thumbAngle = 0;
|
|
563
583
|
};
|
|
564
584
|
return {
|
|
565
|
-
state:
|
|
585
|
+
state: e,
|
|
566
586
|
dragEvent: (u) => {
|
|
567
|
-
const
|
|
568
|
-
let
|
|
569
|
-
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
const
|
|
573
|
-
let
|
|
574
|
-
if (
|
|
575
|
-
|
|
587
|
+
const m = u.touches && u.touches[0], r = t.value.offsetLeft, v = s.value.offsetWidth, E = t.value.offsetWidth, b = v - E, g = 360 / b;
|
|
588
|
+
let p = 0, L = !1, $ = null, M = 0;
|
|
589
|
+
m ? M = m.pageX - r : M = u.clientX - r;
|
|
590
|
+
const T = (h) => {
|
|
591
|
+
L = !0;
|
|
592
|
+
const A = h.touches && h.touches[0];
|
|
593
|
+
let W = 0;
|
|
594
|
+
if (A ? W = A.pageX - M : W = h.clientX - M, W >= b) {
|
|
595
|
+
e.dragLeft = b;
|
|
576
596
|
return;
|
|
577
597
|
}
|
|
578
|
-
if (
|
|
579
|
-
|
|
598
|
+
if (W <= 0) {
|
|
599
|
+
e.dragLeft = 0;
|
|
580
600
|
return;
|
|
581
601
|
}
|
|
582
|
-
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
}),
|
|
602
|
+
e.dragLeft = W, p = W * g, e.thumbAngle = p, n.rotate && n.rotate(p), h.cancelBubble = !0, h.preventDefault();
|
|
603
|
+
}, k = (h) => {
|
|
604
|
+
ue(s.value, h) && L && (B(), L = !1, n.confirm && n.confirm(parseInt(p.toString()), () => {
|
|
605
|
+
i();
|
|
606
|
+
}), h.cancelBubble = !0, h.preventDefault());
|
|
607
|
+
}, S = (h) => {
|
|
608
|
+
$ = h;
|
|
609
|
+
}, Y = () => {
|
|
610
|
+
$ = null;
|
|
611
|
+
}, H = (h) => {
|
|
612
|
+
$ && (k($), B());
|
|
613
|
+
}, B = () => {
|
|
614
|
+
s.value.removeEventListener("mousemove", T, !1), s.value.removeEventListener("touchmove", T, { passive: !1 }), s.value.removeEventListener("mouseup", k, !1), s.value.removeEventListener("mouseenter", Y, !1), s.value.removeEventListener("mouseleave", S, !1), s.value.removeEventListener("touchend", k, !1), document.body.removeEventListener("mouseleave", k, !1), document.body.removeEventListener("mouseup", H, !1);
|
|
587
615
|
};
|
|
588
|
-
|
|
616
|
+
s.value.addEventListener("mousemove", T, !1), s.value.addEventListener("touchmove", T, { passive: !1 }), s.value.addEventListener("mouseup", k, !1), s.value.addEventListener("mouseenter", Y, !1), s.value.addEventListener("mouseleave", S, !1), s.value.addEventListener("touchend", k, !1), document.body.addEventListener("mouseleave", k, !1), document.body.addEventListener("mouseup", H, !1);
|
|
589
617
|
},
|
|
590
|
-
closeEvent: (u) => (n && n.close && n.close(),
|
|
591
|
-
refreshEvent: (u) => (n && n.refresh && n.refresh(),
|
|
618
|
+
closeEvent: (u) => (n && n.close && n.close(), i(), u.cancelBubble = !0, u.preventDefault(), !1),
|
|
619
|
+
refreshEvent: (u) => (n && n.refresh && n.refresh(), i(), u.cancelBubble = !0, u.preventDefault(), !1)
|
|
592
620
|
};
|
|
593
621
|
}
|
|
594
|
-
const
|
|
622
|
+
const tt = { class: "gc-header" }, nt = { class: "gc-icon-block" }, ct = { class: "gc-loading" }, st = ["src"], lt = /* @__PURE__ */ c("div", { class: "gc-round" }, null, -1), ot = { class: "gc-thumb gc-rotate-thumb" }, it = ["src"], at = { class: "gc-footer" }, ut = /* @__PURE__ */ c("div", { class: "gc-drag-line" }, null, -1), ee = /* @__PURE__ */ X({
|
|
595
623
|
__name: "index",
|
|
596
624
|
props: {
|
|
597
|
-
config: { default:
|
|
625
|
+
config: { default: oe },
|
|
598
626
|
events: { default: () => ({}) },
|
|
599
627
|
data: { default: () => ({}) }
|
|
600
628
|
},
|
|
601
|
-
setup(
|
|
602
|
-
const n =
|
|
603
|
-
...
|
|
629
|
+
setup(l) {
|
|
630
|
+
const n = l, { data: t, events: s } = n, e = z({
|
|
631
|
+
...oe(),
|
|
604
632
|
...n.config
|
|
605
633
|
});
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
...
|
|
634
|
+
K(() => n.config, () => {
|
|
635
|
+
e.value = {
|
|
636
|
+
...e.value,
|
|
609
637
|
...n.config
|
|
610
638
|
};
|
|
611
639
|
});
|
|
612
|
-
const
|
|
613
|
-
const r =
|
|
640
|
+
const i = z(null), d = z(null), o = et(t, s, d, i), x = P(() => {
|
|
641
|
+
const r = e.value.horizontalPadding || 0, v = e.value.verticalPadding || 0;
|
|
614
642
|
return {
|
|
615
|
-
width: (
|
|
643
|
+
width: (e.value.width || 0) + r * 2 + (e.value.showTheme ? 2 : 0) + "px",
|
|
616
644
|
paddingLeft: r + "px",
|
|
617
645
|
paddingRight: r + "px",
|
|
618
|
-
paddingTop:
|
|
619
|
-
paddingBottom:
|
|
646
|
+
paddingTop: v + "px",
|
|
647
|
+
paddingBottom: v + "px"
|
|
620
648
|
};
|
|
621
|
-
}), u =
|
|
649
|
+
}), u = P(() => ({
|
|
622
650
|
transform: `rotate(${o.state.thumbAngle}deg)`
|
|
623
|
-
})),
|
|
624
|
-
var
|
|
625
|
-
const r = (((
|
|
651
|
+
})), m = P(() => {
|
|
652
|
+
var v;
|
|
653
|
+
const r = (((v = e.value) == null ? void 0 : v.size) || 0) > 0 ? e.value.size : oe().size;
|
|
626
654
|
return {
|
|
627
655
|
width: r + "px",
|
|
628
656
|
height: r + "px"
|
|
629
657
|
};
|
|
630
658
|
});
|
|
631
|
-
return
|
|
632
|
-
await
|
|
633
|
-
}), (r,
|
|
634
|
-
class:
|
|
635
|
-
style:
|
|
659
|
+
return ie(async () => {
|
|
660
|
+
await ae(), d.value && d.value.addEventListener("dragstart", (r) => r.preventDefault());
|
|
661
|
+
}), (r, v) => (w(), C("div", {
|
|
662
|
+
class: j(`go-captcha gc-wrapper ${e.value.showTheme ? "gc-theme" : ""}`),
|
|
663
|
+
style: _(x.value)
|
|
636
664
|
}, [
|
|
637
|
-
c("div",
|
|
638
|
-
c("span", null,
|
|
639
|
-
c("div",
|
|
640
|
-
|
|
665
|
+
c("div", tt, [
|
|
666
|
+
c("span", null, U(e.value.title), 1),
|
|
667
|
+
c("div", nt, [
|
|
668
|
+
D(ce, {
|
|
641
669
|
width: 22,
|
|
642
670
|
height: 22,
|
|
643
|
-
onClick:
|
|
671
|
+
onClick: a(o).closeEvent
|
|
644
672
|
}, null, 8, ["onClick"]),
|
|
645
|
-
|
|
673
|
+
D(se, {
|
|
646
674
|
width: 22,
|
|
647
675
|
height: 22,
|
|
648
|
-
onClick:
|
|
676
|
+
onClick: a(o).refreshEvent
|
|
649
677
|
}, null, 8, ["onClick"])
|
|
650
678
|
])
|
|
651
679
|
]),
|
|
652
680
|
c("div", {
|
|
653
681
|
class: "gc-body gc-rotate-body",
|
|
654
682
|
ref: "containerRef",
|
|
655
|
-
style: m
|
|
683
|
+
style: _(m.value)
|
|
656
684
|
}, [
|
|
657
|
-
c("div",
|
|
658
|
-
|
|
685
|
+
c("div", ct, [
|
|
686
|
+
D(le)
|
|
659
687
|
]),
|
|
660
688
|
c("div", {
|
|
661
689
|
class: "gc-picture gc-rotate-picture",
|
|
662
|
-
style: m
|
|
690
|
+
style: _(m.value)
|
|
663
691
|
}, [
|
|
664
|
-
|
|
665
|
-
src:
|
|
692
|
+
V(c("img", {
|
|
693
|
+
src: a(t).image,
|
|
666
694
|
alt: "..."
|
|
667
|
-
}, null, 8,
|
|
668
|
-
[
|
|
695
|
+
}, null, 8, st), [
|
|
696
|
+
[N, a(t).image !== ""]
|
|
669
697
|
]),
|
|
670
|
-
|
|
698
|
+
lt
|
|
671
699
|
], 4),
|
|
672
|
-
c("div",
|
|
700
|
+
c("div", ot, [
|
|
673
701
|
c("div", {
|
|
674
702
|
class: "gc-rotate-thumb-block",
|
|
675
|
-
style:
|
|
703
|
+
style: _(u.value)
|
|
676
704
|
}, [
|
|
677
|
-
|
|
678
|
-
src:
|
|
705
|
+
V(c("img", {
|
|
706
|
+
src: a(t).thumb,
|
|
679
707
|
alt: "..."
|
|
680
|
-
}, null, 8,
|
|
681
|
-
[
|
|
708
|
+
}, null, 8, it), [
|
|
709
|
+
[N, a(t).thumb !== ""]
|
|
682
710
|
])
|
|
683
711
|
], 4)
|
|
684
712
|
])
|
|
685
713
|
], 4),
|
|
686
|
-
c("div",
|
|
714
|
+
c("div", at, [
|
|
687
715
|
c("div", {
|
|
688
716
|
class: "gc-drag-slide-bar",
|
|
689
717
|
ref_key: "dragBarRef",
|
|
690
|
-
ref:
|
|
691
|
-
onMousedown: h[1] || (h[1] = //@ts-ignore
|
|
692
|
-
(..._) => i(o).dragEvent && i(o).dragEvent(..._))
|
|
718
|
+
ref: i
|
|
693
719
|
}, [
|
|
694
|
-
|
|
720
|
+
ut,
|
|
695
721
|
c("div", {
|
|
696
722
|
class: "gc-drag-block",
|
|
697
723
|
ref_key: "dragBlockRef",
|
|
698
724
|
ref: d,
|
|
699
|
-
|
|
700
|
-
(...
|
|
701
|
-
style:
|
|
725
|
+
onMousedown: v[1] || (v[1] = //@ts-ignore
|
|
726
|
+
(...E) => a(o).dragEvent && a(o).dragEvent(...E)),
|
|
727
|
+
style: _({ left: a(o).state.dragLeft + "px" })
|
|
702
728
|
}, [
|
|
703
|
-
|
|
729
|
+
c("div", {
|
|
730
|
+
class: "drag-block-inline",
|
|
731
|
+
onTouchstart: v[0] || (v[0] = //@ts-ignore
|
|
732
|
+
(...E) => a(o).dragEvent && a(o).dragEvent(...E))
|
|
733
|
+
}, [
|
|
734
|
+
D(fe)
|
|
735
|
+
], 32)
|
|
704
736
|
], 36)
|
|
705
|
-
],
|
|
737
|
+
], 512)
|
|
706
738
|
])
|
|
707
739
|
], 6));
|
|
708
740
|
}
|
|
709
741
|
});
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
742
|
+
ee.name = "gocaptcha-rotate";
|
|
743
|
+
ee.install = function(l) {
|
|
744
|
+
l.component("gocaptcha-rotate", ee);
|
|
713
745
|
};
|
|
714
|
-
const
|
|
746
|
+
const rt = /* @__PURE__ */ c("circle", {
|
|
715
747
|
fill: "#3E7CFF",
|
|
716
748
|
cx: "100",
|
|
717
749
|
cy: "100",
|
|
718
750
|
r: "96.3"
|
|
719
|
-
}, null, -1),
|
|
751
|
+
}, null, -1), dt = /* @__PURE__ */ c("path", {
|
|
720
752
|
fill: "#FFFFFF",
|
|
721
753
|
d: `M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
|
|
722
754
|
c0.4,0,0.8,0.4,1.2,0.4c0.4,0,0.8,0,1.2-0.4c26.5-8.7,42.3-28.9,42.3-54.6V68.3C143.5,66.8,142.3,65.2,140.8,64.4z`
|
|
723
|
-
}, null, -1),
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
],
|
|
755
|
+
}, null, -1), vt = [
|
|
756
|
+
rt,
|
|
757
|
+
dt
|
|
758
|
+
], ht = /* @__PURE__ */ X({
|
|
727
759
|
__name: "btn-default-icon",
|
|
728
760
|
emits: ["click"],
|
|
729
|
-
setup(
|
|
730
|
-
const
|
|
731
|
-
function
|
|
732
|
-
|
|
761
|
+
setup(l, { emit: n }) {
|
|
762
|
+
const t = n;
|
|
763
|
+
function s(e) {
|
|
764
|
+
t("click", e);
|
|
733
765
|
}
|
|
734
|
-
return (
|
|
766
|
+
return (e, i) => (w(), C("svg", I({
|
|
735
767
|
xmlns: "http://www.w3.org/2000/svg",
|
|
736
768
|
viewBox: "0 0 200 200",
|
|
737
769
|
width: "20",
|
|
738
770
|
height: "20"
|
|
739
|
-
},
|
|
771
|
+
}, e.$attrs, { onClick: s }), vt, 16));
|
|
740
772
|
}
|
|
741
|
-
}),
|
|
773
|
+
}), gt = /* @__PURE__ */ c("path", {
|
|
742
774
|
fill: "#FFA000",
|
|
743
775
|
d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
|
|
744
776
|
c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M107.3,109.1
|
|
745
777
|
c-0.5,5.4-3.9,7.9-7.3,7.9c-2.5,0,0,0,0,0c-3.2-0.6-5.7-2-6.8-7.4l-4.4-50.9c0-5.1,6.2-9.7,11.5-9.7c5.3,0,11,4.7,11,9.9
|
|
746
778
|
L107.3,109.1z M109.3,133.3c0,5.1-4.2,9.3-9.3,9.3c-5.1,0-9.3-4.2-9.3-9.3c0-5.1,4.2-9.3,9.3-9.3C105.1,124,109.3,128.1,109.3,133.3
|
|
747
779
|
z`
|
|
748
|
-
}, null, -1),
|
|
749
|
-
|
|
750
|
-
],
|
|
780
|
+
}, null, -1), ft = [
|
|
781
|
+
gt
|
|
782
|
+
], mt = /* @__PURE__ */ X({
|
|
751
783
|
__name: "btn-warn-icon",
|
|
752
784
|
emits: ["click"],
|
|
753
|
-
setup(
|
|
754
|
-
const
|
|
755
|
-
function
|
|
756
|
-
|
|
785
|
+
setup(l, { emit: n }) {
|
|
786
|
+
const t = n;
|
|
787
|
+
function s(e) {
|
|
788
|
+
t("click", e);
|
|
757
789
|
}
|
|
758
|
-
return (
|
|
790
|
+
return (e, i) => (w(), C("svg", I({
|
|
759
791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
760
792
|
viewBox: "0 0 200 200",
|
|
761
793
|
width: "20",
|
|
762
794
|
height: "20"
|
|
763
|
-
},
|
|
795
|
+
}, e.$attrs, { onClick: s }), ft, 16));
|
|
764
796
|
}
|
|
765
|
-
}),
|
|
797
|
+
}), pt = /* @__PURE__ */ c("path", {
|
|
766
798
|
fill: "#ED4630",
|
|
767
799
|
d: `M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
|
|
768
800
|
c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M134.5,123.1
|
|
769
801
|
c3.1,3.1,3.1,8.2,0,11.3c-1.6,1.6-3.6,2.3-5.7,2.3s-4.1-0.8-5.7-2.3L100,111.3l-23.1,23.1c-1.6,1.6-3.6,2.3-5.7,2.3
|
|
770
802
|
c-2,0-4.1-0.8-5.7-2.3c-3.1-3.1-3.1-8.2,0-11.3L88.7,100L65.5,76.9c-3.1-3.1-3.1-8.2,0-11.3c3.1-3.1,8.2-3.1,11.3,0L100,88.7
|
|
771
803
|
l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`
|
|
772
|
-
}, null, -1),
|
|
773
|
-
|
|
774
|
-
],
|
|
804
|
+
}, null, -1), _t = [
|
|
805
|
+
pt
|
|
806
|
+
], Et = /* @__PURE__ */ X({
|
|
775
807
|
__name: "btn-error-icon",
|
|
776
808
|
emits: ["click"],
|
|
777
|
-
setup(
|
|
778
|
-
const
|
|
779
|
-
function
|
|
780
|
-
|
|
809
|
+
setup(l, { emit: n }) {
|
|
810
|
+
const t = n;
|
|
811
|
+
function s(e) {
|
|
812
|
+
t("click", e);
|
|
781
813
|
}
|
|
782
|
-
return (
|
|
814
|
+
return (e, i) => (w(), C("svg", I({
|
|
783
815
|
xmlns: "http://www.w3.org/2000/svg",
|
|
784
816
|
viewBox: "0 0 200 200",
|
|
785
817
|
width: "20",
|
|
786
818
|
height: "20"
|
|
787
|
-
},
|
|
819
|
+
}, e.$attrs, { onClick: s }), _t, 16));
|
|
788
820
|
}
|
|
789
|
-
}),
|
|
821
|
+
}), bt = /* @__PURE__ */ c("path", {
|
|
790
822
|
fill: "#5EAA2F",
|
|
791
823
|
d: `M183.3,27.2L102.4,2.9h-4.9L16.7,27.2C13.4,28.8,11,32,11,35.3v49.4c0,51.8,32.4,93.9,86.6,111.7
|
|
792
824
|
c0.8,0,1.6,0.8,2.4,0.8c0.8,0,1.6,0,2.4-0.8c54.2-17.8,86.6-59.1,86.6-111.7V35.3C189,32,186.6,28.8,183.3,27.2z M146.1,81.4
|
|
793
825
|
l-48.5,48.5c-1.6,1.6-3.2,2.4-5.7,2.4c-2.4,0-4-0.8-5.7-2.4L62,105.7c-3.2-3.2-3.2-8.1,0-11.3c3.2-3.2,8.1-3.2,11.3,0l18.6,18.6
|
|
794
826
|
l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`
|
|
795
|
-
}, null, -1),
|
|
796
|
-
|
|
797
|
-
],
|
|
827
|
+
}, null, -1), wt = [
|
|
828
|
+
bt
|
|
829
|
+
], xt = /* @__PURE__ */ X({
|
|
798
830
|
__name: "btn-success-icon",
|
|
799
831
|
emits: ["click"],
|
|
800
|
-
setup(
|
|
801
|
-
const
|
|
802
|
-
function
|
|
803
|
-
|
|
832
|
+
setup(l, { emit: n }) {
|
|
833
|
+
const t = n;
|
|
834
|
+
function s(e) {
|
|
835
|
+
t("click", e);
|
|
804
836
|
}
|
|
805
|
-
return (
|
|
837
|
+
return (e, i) => (w(), C("svg", I({
|
|
806
838
|
xmlns: "http://www.w3.org/2000/svg",
|
|
807
839
|
viewBox: "0 0 200 200",
|
|
808
840
|
width: "20",
|
|
809
841
|
height: "20"
|
|
810
|
-
},
|
|
842
|
+
}, e.$attrs, { onClick: s }), wt, 16));
|
|
811
843
|
}
|
|
812
|
-
}),
|
|
844
|
+
}), he = () => ({
|
|
813
845
|
width: 330,
|
|
814
846
|
height: 44,
|
|
815
847
|
verticalPadding: 12,
|
|
816
848
|
horizontalPadding: 16
|
|
817
|
-
}),
|
|
849
|
+
}), te = /* @__PURE__ */ X({
|
|
818
850
|
__name: "index",
|
|
819
851
|
props: {
|
|
820
|
-
config: { default:
|
|
852
|
+
config: { default: he },
|
|
821
853
|
clickEvent: {},
|
|
822
854
|
disabled: { type: Boolean, default: !1 },
|
|
823
855
|
type: { default: "default" },
|
|
824
856
|
title: { default: "点击按键进行验证" }
|
|
825
857
|
},
|
|
826
858
|
emits: ["click-event"],
|
|
827
|
-
setup(
|
|
828
|
-
const
|
|
829
|
-
...
|
|
830
|
-
...
|
|
859
|
+
setup(l, { emit: n }) {
|
|
860
|
+
const t = l, { type: s, title: e, disabled: i } = Ee(t), d = z({
|
|
861
|
+
...he(),
|
|
862
|
+
...t.config
|
|
831
863
|
});
|
|
832
|
-
|
|
864
|
+
K(() => t.config, () => {
|
|
833
865
|
d.value = {
|
|
834
866
|
...d.value,
|
|
835
|
-
...
|
|
867
|
+
...t.config
|
|
836
868
|
};
|
|
837
869
|
});
|
|
838
|
-
const o =
|
|
870
|
+
const o = P(() => ["go-captcha", "gc-btn-block", `gc-${s.value}`, i.value ? "gc-disabled" : ""]), x = P(() => ({
|
|
839
871
|
width: d.value.width + "px",
|
|
840
872
|
height: d.value.height + "px",
|
|
841
873
|
paddingLeft: d.value.horizontalPadding + "px",
|
|
@@ -843,37 +875,35 @@ const se = /* @__PURE__ */ c("circle", {
|
|
|
843
875
|
paddingTop: d.value.verticalPadding + "px",
|
|
844
876
|
paddingBottom: d.value.verticalPadding + "px"
|
|
845
877
|
})), u = n;
|
|
846
|
-
function
|
|
878
|
+
function m(r) {
|
|
847
879
|
u("click-event", r);
|
|
848
880
|
}
|
|
849
|
-
return (r,
|
|
850
|
-
class:
|
|
851
|
-
style:
|
|
852
|
-
onClick:
|
|
881
|
+
return (r, v) => (w(), C("div", {
|
|
882
|
+
class: j(o.value),
|
|
883
|
+
style: _(x.value),
|
|
884
|
+
onClick: m
|
|
853
885
|
}, [
|
|
854
886
|
c("div", {
|
|
855
|
-
class:
|
|
887
|
+
class: j(a(s) === "default" ? "gc-ripple" : "")
|
|
856
888
|
}, [
|
|
857
|
-
|
|
889
|
+
a(s) === "default" ? (w(), O(ht, { key: 0 })) : a(s) === "warn" ? (w(), O(mt, { key: 1 })) : a(s) === "error" ? (w(), O(Et, { key: 2 })) : a(s) === "success" ? (w(), O(xt, { key: 3 })) : be("", !0)
|
|
858
890
|
], 2),
|
|
859
|
-
c("span", null,
|
|
891
|
+
c("span", null, U(a(e)), 1)
|
|
860
892
|
], 6));
|
|
861
893
|
}
|
|
862
894
|
});
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
895
|
+
te.name = "gocaptcha-button";
|
|
896
|
+
te.install = function(l) {
|
|
897
|
+
l.component("gocaptcha-button", te);
|
|
866
898
|
};
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
G.install(s), J.install(s), K.install(s), O.install(s), Q.install(s);
|
|
870
|
-
}
|
|
899
|
+
const ge = "go_captcha_installed", kt = (l) => {
|
|
900
|
+
l[ge] || (l[ge] = !0, [Q, Z, R, ee, te].map((n) => l.use(n)));
|
|
871
901
|
};
|
|
872
902
|
export {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
903
|
+
te as Button,
|
|
904
|
+
Q as Click,
|
|
905
|
+
ee as Rotate,
|
|
906
|
+
Z as Slide,
|
|
907
|
+
R as SlideRegion,
|
|
908
|
+
kt as default
|
|
879
909
|
};
|