go-captcha-vue 1.0.4 → 1.0.5-pre1
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 +95 -42
- package/dist/go-captcha-vue.es.js +30 -15
- package/dist/go-captcha-vue.umd.js +8 -8
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img width="120" style="padding-top: 50px; margin: 0;" src="http://47.104.180.148/go-captcha/gocaptcha_logo.svg?v=1"/>
|
|
3
|
+
<h1 style="margin: 0; padding: 0">Go Captcha</h1>
|
|
4
|
+
<p>Behavior Captcha For Vue</p>
|
|
5
|
+
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<br/>
|
|
9
|
+
|
|
10
|
+
> English | [中文](README_zh.md)
|
|
2
11
|
|
|
3
12
|
<br/>
|
|
4
13
|
|
|
14
|
+
<p> ⭐️ If it helps you, please give a star.</p>
|
|
15
|
+
|
|
16
|
+
<img src="http://47.104.180.148/go-captcha/go-captcha-v2.jpg" alt="Poster">
|
|
17
|
+
|
|
18
|
+
|
|
5
19
|
| Vue Version | Go Captcha Version |
|
|
6
20
|
|:-----------------------|:------------------:|
|
|
7
21
|
| vue >= 2.7.14 && < 3.0 | go-captcha-vue@^1 |
|
|
8
22
|
| vue >= 3.0 | go-captcha-vue@^2 |
|
|
9
23
|
|
|
10
24
|
## Install
|
|
25
|
+
Greater than or equal to vue2.7.14 and less than vue3.0
|
|
11
26
|
```shell
|
|
12
|
-
# Greater than or equal to vue2.7.14 and less than vue3.0
|
|
13
27
|
yarn add go-captcha-vue@^1
|
|
14
28
|
# or
|
|
15
29
|
npm install go-captcha-vue@^1
|
|
16
30
|
# or
|
|
17
31
|
pnpm install go-captcha-vue@^1
|
|
32
|
+
```
|
|
18
33
|
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
Greater than vue3.0
|
|
35
|
+
```shell
|
|
21
36
|
yarn add go-captcha-vue@^2
|
|
22
37
|
# or
|
|
23
38
|
npm install go-captcha-vue@^2
|
|
@@ -25,27 +40,44 @@ npm install go-captcha-vue@^2
|
|
|
25
40
|
pnpm install go-captcha-vue@^2
|
|
26
41
|
```
|
|
27
42
|
|
|
28
|
-
Use Go Captcha
|
|
43
|
+
## Use Go Captcha
|
|
29
44
|
```ts
|
|
30
45
|
import "go-captcha-vue/dist/style.css"
|
|
31
46
|
import GoCaptcha from "go-captcha-vue"
|
|
32
47
|
|
|
33
48
|
Vue.use(GoCaptcha)
|
|
49
|
+
|
|
50
|
+
// OR
|
|
51
|
+
import {Click, Rotate, Slide, SlideRegion, Button} from "go-captcha-vue";
|
|
52
|
+
Vue.component('gocaptcha-click', Click)
|
|
53
|
+
Vue.component('gocaptcha-rotate', Rotate)
|
|
54
|
+
Vue.component('gocaptcha-slide', Slide)
|
|
55
|
+
Vue.component('gocaptcha-slide-region', SlideRegion)
|
|
56
|
+
Vue.component('gocaptcha-button', Button)
|
|
34
57
|
```
|
|
35
58
|
|
|
36
|
-
|
|
59
|
+
|
|
60
|
+
## Click Mode
|
|
37
61
|
```vue
|
|
38
62
|
<gocaptcha-click
|
|
39
63
|
:config="{}"
|
|
40
64
|
:data="{}"
|
|
41
65
|
:events="{}"
|
|
66
|
+
ref="domRef"
|
|
42
67
|
/>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
// call methods
|
|
71
|
+
const domRef = ref(null)
|
|
72
|
+
domRef.value.clear()
|
|
73
|
+
domRef.value.refresh()
|
|
74
|
+
</script>
|
|
43
75
|
```
|
|
44
76
|
|
|
45
|
-
|
|
77
|
+
|
|
46
78
|
```ts
|
|
47
79
|
// config = {}
|
|
48
|
-
interface
|
|
80
|
+
interface Config {
|
|
49
81
|
width?: number;
|
|
50
82
|
height?: number;
|
|
51
83
|
thumbWidth?: number;
|
|
@@ -60,21 +92,21 @@ interface ClickConfig {
|
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
// data = {}
|
|
63
|
-
interface
|
|
95
|
+
interface Data {
|
|
64
96
|
image: string;
|
|
65
97
|
thumb: string;
|
|
66
98
|
}
|
|
67
99
|
|
|
68
100
|
// events = {}
|
|
69
|
-
interface
|
|
101
|
+
interface Events {
|
|
70
102
|
click?: (x: number, y: number) => void;
|
|
71
103
|
refresh?: () => void;
|
|
72
104
|
close?: () => void;
|
|
73
105
|
confirm?: (dots: Array<ClickDot>, reset:() => void) => boolean;
|
|
74
106
|
}
|
|
75
107
|
|
|
76
|
-
// component method
|
|
77
|
-
interface
|
|
108
|
+
// export component method
|
|
109
|
+
interface ExportMethods {
|
|
78
110
|
reset: () => void,
|
|
79
111
|
clear: () => void,
|
|
80
112
|
refresh: () => void,
|
|
@@ -82,21 +114,24 @@ interface ClickExpose {
|
|
|
82
114
|
}
|
|
83
115
|
```
|
|
84
116
|
|
|
85
|
-
##
|
|
117
|
+
## Slide Mode
|
|
86
118
|
```vue
|
|
87
119
|
<gocaptcha-slide
|
|
88
120
|
:config="{}"
|
|
89
121
|
:data="{}"
|
|
90
122
|
:events="{}"
|
|
123
|
+
ref="domRef"
|
|
91
124
|
/>
|
|
92
125
|
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
<script>
|
|
127
|
+
// call methods
|
|
128
|
+
const domRef = ref(null)
|
|
129
|
+
domRef.value.clear()
|
|
130
|
+
domRef.value.refresh()
|
|
131
|
+
</script>
|
|
98
132
|
```
|
|
99
|
-
|
|
133
|
+
|
|
134
|
+
|
|
100
135
|
```ts
|
|
101
136
|
// config = {}
|
|
102
137
|
interface SlideConfig {
|
|
@@ -130,14 +165,33 @@ interface SlideEvents {
|
|
|
130
165
|
confirm?: (point: SlidePoint, reset:() => void) => boolean;
|
|
131
166
|
}
|
|
132
167
|
|
|
133
|
-
// component method
|
|
134
|
-
interface
|
|
168
|
+
// export component method
|
|
169
|
+
interface ExportMethods {
|
|
135
170
|
reset: () => void,
|
|
136
171
|
clear: () => void,
|
|
137
172
|
refresh: () => void,
|
|
138
173
|
close: () => void,
|
|
139
174
|
}
|
|
140
175
|
```
|
|
176
|
+
|
|
177
|
+
## Drag-And-Drop Mode
|
|
178
|
+
```vue
|
|
179
|
+
<gocaptcha-slide-region
|
|
180
|
+
:config="{}"
|
|
181
|
+
:data="{}"
|
|
182
|
+
:events="{}"
|
|
183
|
+
ref="domRef"
|
|
184
|
+
/>
|
|
185
|
+
|
|
186
|
+
<script>
|
|
187
|
+
// call methods
|
|
188
|
+
const domRef = ref(null)
|
|
189
|
+
domRef.value.clear()
|
|
190
|
+
domRef.value.refresh()
|
|
191
|
+
</script>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
|
|
141
195
|
```ts
|
|
142
196
|
// config = {}
|
|
143
197
|
interface SlideRegionConfig {
|
|
@@ -171,9 +225,8 @@ interface SlideRegionEvents {
|
|
|
171
225
|
confirm?: (point: SlideRegionPoint, reset:() => void) => boolean;
|
|
172
226
|
}
|
|
173
227
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
interface SlideRegionExpose {
|
|
228
|
+
// export component method
|
|
229
|
+
interface ExportMethods {
|
|
177
230
|
reset: () => void,
|
|
178
231
|
clear: () => void,
|
|
179
232
|
refresh: () => void,
|
|
@@ -181,19 +234,27 @@ interface SlideRegionExpose {
|
|
|
181
234
|
}
|
|
182
235
|
```
|
|
183
236
|
|
|
184
|
-
##
|
|
237
|
+
## Rotation Mode
|
|
185
238
|
```vue
|
|
186
239
|
<gocaptcha-rotate
|
|
187
240
|
:config="{}"
|
|
188
241
|
:data="{}"
|
|
189
242
|
:events="{}"
|
|
243
|
+
ref="domRef"
|
|
190
244
|
/>
|
|
245
|
+
|
|
246
|
+
<script>
|
|
247
|
+
// call methods
|
|
248
|
+
const domRef = ref(null)
|
|
249
|
+
domRef.value.clear()
|
|
250
|
+
domRef.value.refresh()
|
|
251
|
+
</script>
|
|
191
252
|
```
|
|
192
253
|
|
|
193
|
-
|
|
254
|
+
|
|
194
255
|
```ts
|
|
195
256
|
// config = {}
|
|
196
|
-
interface
|
|
257
|
+
interface Config {
|
|
197
258
|
width?: number;
|
|
198
259
|
height?: number;
|
|
199
260
|
thumbWidth?: number;
|
|
@@ -207,22 +268,22 @@ interface RotateConfig {
|
|
|
207
268
|
}
|
|
208
269
|
|
|
209
270
|
// data = {}
|
|
210
|
-
interface
|
|
271
|
+
interface Data {
|
|
211
272
|
angle: number;
|
|
212
273
|
image: string;
|
|
213
274
|
thumb: string;
|
|
214
275
|
}
|
|
215
276
|
|
|
216
277
|
// events = {}
|
|
217
|
-
interface
|
|
278
|
+
interface Events {
|
|
218
279
|
rotate?: (angle: number) => void;
|
|
219
280
|
refresh?: () => void;
|
|
220
281
|
close?: () => void;
|
|
221
282
|
confirm?: (angle: number, reset:() => void) => boolean;
|
|
222
283
|
}
|
|
223
284
|
|
|
224
|
-
// component method
|
|
225
|
-
interface
|
|
285
|
+
// export component method
|
|
286
|
+
interface ExportMethods {
|
|
226
287
|
reset: () => void,
|
|
227
288
|
clear: () => void,
|
|
228
289
|
refresh: () => void,
|
|
@@ -231,12 +292,13 @@ interface RotateExpose {
|
|
|
231
292
|
```
|
|
232
293
|
|
|
233
294
|
|
|
295
|
+
|
|
234
296
|
## Button
|
|
235
297
|
```vue
|
|
236
298
|
<gocaptcha-button @clickEvent="() => console.log('hello')"/>
|
|
237
299
|
```
|
|
238
300
|
|
|
239
|
-
|
|
301
|
+
|
|
240
302
|
```ts
|
|
241
303
|
interface $Attr {
|
|
242
304
|
config?: CaptchaConfig;
|
|
@@ -249,19 +311,10 @@ interface $Event {
|
|
|
249
311
|
clickEvent?: ()=>void; // event -> @clickEvent=""
|
|
250
312
|
}
|
|
251
313
|
|
|
252
|
-
export interface
|
|
314
|
+
export interface CaptchaConfig {
|
|
253
315
|
width?: number;
|
|
254
316
|
height?: number;
|
|
255
317
|
verticalPadding?: number;
|
|
256
318
|
horizontalPadding?: number;
|
|
257
319
|
}
|
|
258
|
-
|
|
259
320
|
```
|
|
260
|
-
|
|
261
|
-
<br/>
|
|
262
|
-
|
|
263
|
-
## 👍 Sponsor
|
|
264
|
-
<div>
|
|
265
|
-
<a href="http://gocaptcha.wencodes.com/sponsor/" target="_blank">http://gocaptcha.wencodes.com/sponsor/</a>
|
|
266
|
-
</div>
|
|
267
|
-
<br/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive, toRaw, watch, computed, ref, onMounted, nextTick, toRefs } from "vue";
|
|
1
|
+
import { reactive, toRaw, watch, computed, ref, onMounted, nextTick, onUnmounted, toRefs } from "vue";
|
|
2
2
|
var gocaptcha = "";
|
|
3
3
|
const defaultConfig$4 = () => ({
|
|
4
4
|
width: 300,
|
|
@@ -489,6 +489,9 @@ function useHandler$2(data, event, config, rootRef, containerRef, tileRef, dragB
|
|
|
489
489
|
}
|
|
490
490
|
}, { deep: true });
|
|
491
491
|
const dragEvent = (e) => {
|
|
492
|
+
if (!checkTargetFather(dragBarRef.value, e)) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
492
495
|
const touch = e.touches && e.touches[0];
|
|
493
496
|
const offsetLeft = dragBlockRef.value.offsetLeft;
|
|
494
497
|
const width = containerRef.value.offsetWidth;
|
|
@@ -538,14 +541,14 @@ function useHandler$2(data, event, config, rootRef, containerRef, tileRef, dragB
|
|
|
538
541
|
if (!checkTargetFather(dragBarRef.value, e2)) {
|
|
539
542
|
return;
|
|
540
543
|
}
|
|
544
|
+
clearEvent();
|
|
541
545
|
if (!isMoving) {
|
|
542
546
|
return;
|
|
543
547
|
}
|
|
544
|
-
|
|
548
|
+
isMoving = false;
|
|
545
549
|
if (currentThumbX < 0) {
|
|
546
550
|
return;
|
|
547
551
|
}
|
|
548
|
-
isMoving = false;
|
|
549
552
|
event.confirm && event.confirm({ x: parseInt(currentThumbX.toString()), y: data.thumbY || 0 }, () => {
|
|
550
553
|
resetData();
|
|
551
554
|
});
|
|
@@ -730,11 +733,13 @@ __sfc_main$7.setup = (__props, __ctx) => {
|
|
|
730
733
|
const hasDisplayWrapperState = computed(() => {
|
|
731
734
|
return (localConfig.width || 0) > 0 || (localConfig.height || 0) > 0;
|
|
732
735
|
});
|
|
736
|
+
const fn = (event) => event.preventDefault();
|
|
733
737
|
onMounted(async () => {
|
|
734
738
|
await nextTick();
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
739
|
+
dragBlockRef.value && dragBlockRef.value.addEventListener("dragstart", fn);
|
|
740
|
+
});
|
|
741
|
+
onUnmounted(() => {
|
|
742
|
+
dragBlockRef.value && dragBlockRef.value.removeEventListener("dragstart", fn);
|
|
738
743
|
});
|
|
739
744
|
return Object.assign({
|
|
740
745
|
localData,
|
|
@@ -822,6 +827,9 @@ function useHandler$1(data, event, config, rootRef, containerRef, tileRef, clear
|
|
|
822
827
|
}
|
|
823
828
|
}, { deep: true });
|
|
824
829
|
const dragEvent = (e) => {
|
|
830
|
+
if (!checkTargetFather(containerRef.value, e)) {
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
825
833
|
const touch = e.touches && e.touches[0];
|
|
826
834
|
const offsetLeft = tileRef.value.offsetLeft;
|
|
827
835
|
const offsetTop = tileRef.value.offsetTop;
|
|
@@ -880,11 +888,11 @@ function useHandler$1(data, event, config, rootRef, containerRef, tileRef, clear
|
|
|
880
888
|
if (!checkTargetFather(containerRef.value, e2)) {
|
|
881
889
|
return;
|
|
882
890
|
}
|
|
891
|
+
clearEvent();
|
|
883
892
|
if (!isMoving) {
|
|
884
893
|
return;
|
|
885
894
|
}
|
|
886
895
|
isMoving = false;
|
|
887
|
-
clearEvent();
|
|
888
896
|
if (tileLeft < 0 || tileTop < 0) {
|
|
889
897
|
return;
|
|
890
898
|
}
|
|
@@ -1070,11 +1078,13 @@ __sfc_main$6.setup = (__props, __ctx) => {
|
|
|
1070
1078
|
const hasDisplayWrapperState = computed(() => {
|
|
1071
1079
|
return (localConfig.width || 0) > 0 || (localConfig.height || 0) > 0;
|
|
1072
1080
|
});
|
|
1081
|
+
const fn = (event) => event.preventDefault();
|
|
1073
1082
|
onMounted(async () => {
|
|
1074
1083
|
await nextTick();
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1084
|
+
tileRef.value && tileRef.value.addEventListener("dragstart", fn);
|
|
1085
|
+
});
|
|
1086
|
+
onUnmounted(() => {
|
|
1087
|
+
tileRef.value && tileRef.value.removeEventListener("dragstart", fn);
|
|
1078
1088
|
});
|
|
1079
1089
|
return Object.assign({
|
|
1080
1090
|
localData,
|
|
@@ -1156,6 +1166,9 @@ function useHandler(data, event, config, rootRef, dragBlockRef, dragBarRef, clea
|
|
|
1156
1166
|
}
|
|
1157
1167
|
}, { deep: true });
|
|
1158
1168
|
const dragEvent = (e) => {
|
|
1169
|
+
if (!checkTargetFather(dragBarRef.value, e)) {
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1159
1172
|
const touch = e.touches && e.touches[0];
|
|
1160
1173
|
const offsetLeft = dragBlockRef.value.offsetLeft;
|
|
1161
1174
|
const width = dragBarRef.value.offsetWidth;
|
|
@@ -1203,14 +1216,14 @@ function useHandler(data, event, config, rootRef, dragBlockRef, dragBarRef, clea
|
|
|
1203
1216
|
if (!checkTargetFather(dragBarRef.value, e2)) {
|
|
1204
1217
|
return;
|
|
1205
1218
|
}
|
|
1219
|
+
clearEvent();
|
|
1206
1220
|
if (!isMoving) {
|
|
1207
1221
|
return;
|
|
1208
1222
|
}
|
|
1209
|
-
|
|
1223
|
+
isMoving = false;
|
|
1210
1224
|
if (currentAngle < 0) {
|
|
1211
1225
|
return;
|
|
1212
1226
|
}
|
|
1213
|
-
isMoving = false;
|
|
1214
1227
|
event.confirm && event.confirm(parseInt(currentAngle.toString()), () => {
|
|
1215
1228
|
resetData();
|
|
1216
1229
|
});
|
|
@@ -1394,11 +1407,13 @@ __sfc_main$5.setup = (__props, __ctx) => {
|
|
|
1394
1407
|
const hasDisplayWrapperState = computed(() => {
|
|
1395
1408
|
return (localConfig.width || 0) > 0 || (localConfig.height || 0) > 0;
|
|
1396
1409
|
});
|
|
1410
|
+
const fn = (event) => event.preventDefault();
|
|
1397
1411
|
onMounted(async () => {
|
|
1398
1412
|
await nextTick();
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1413
|
+
dragBlockRef.value && dragBlockRef.value.addEventListener("dragstart", fn);
|
|
1414
|
+
});
|
|
1415
|
+
onUnmounted(() => {
|
|
1416
|
+
dragBlockRef.value && dragBlockRef.value.removeEventListener("dragstart", fn);
|
|
1402
1417
|
});
|
|
1403
1418
|
return Object.assign({
|
|
1404
1419
|
localData,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(P,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(P=typeof globalThis!="undefined"?globalThis:P||self,s(P["go-captcha-vue"]={},P.Vue))})(this,function(P,s){"use strict";var Nt="";const re=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"\u8BF7\u5728\u4E0B\u56FE\u4F9D\u6B21\u70B9\u51FB",buttonText:"\u786E\u8BA4",iconSize:22,dotSize:24}),le={};le.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var Re=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("path",{attrs:{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
|
|
2
2
|
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
|
|
3
3
|
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
|
|
4
4
|
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
|
|
5
5
|
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
|
|
6
6
|
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
|
|
7
7
|
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
|
|
8
|
-
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`}})])},Ie=[],
|
|
8
|
+
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`}})])},Ie=[],Ut="";function M(e,n,t,i,u,v,o,r){var a=typeof e=="function"?e.options:e;n&&(a.render=n,a.staticRenderFns=t,a._compiled=!0),i&&(a.functional=!0),v&&(a._scopeId="data-v-"+v);var d;if(o?(d=function(c){c=c||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!c&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(c=__VUE_SSR_CONTEXT__),u&&u.call(this,c),c&&c._registeredComponents&&c._registeredComponents.add(o)},a._ssrRegister=d):u&&(d=r?function(){u.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:u),d)if(a.functional){a._injectStyles=d;var b=a.render;a.render=function(g,w){return d.call(w),b(g,w)}}else{var f=a.beforeCreate;a.beforeCreate=f?[].concat(f,d):[d]}return{exports:e,options:a}}const ue={};var Me=M(le,Re,Ie,!1,We,"3972774c",null,null);function We(e){for(let n in ue)this[n]=ue[n]}var ae=function(){return Me.exports}();const de={};de.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var Xe=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("path",{attrs:{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
|
|
9
9
|
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
|
|
10
10
|
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
|
|
11
11
|
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
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
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
|
|
23
23
|
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
|
|
24
24
|
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
|
|
25
|
-
L180.6,98.9z`}})])},je=[],
|
|
25
|
+
L180.6,98.9z`}})])},je=[],Vt="";const he={};var Pe=M(de,Xe,je,!1,Oe,"1120f0d2",null,null);function Oe(e){for(let n in he)this[n]=he[n]}var ce=function(){return Pe.exports}();const fe={};fe.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var Ye=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:"84",height:"84"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("circle",{attrs:{cx:"50",cy:"36.8101",r:"10"}},[t("animate",{attrs:{attributeName:"cy",dur:"1s",repeatCount:"indefinite",calcMode:"spline",keySplines:"0.45 0 0.9 0.55;0 0.45 0.55 0.9",keyTimes:"0;0.5;1",values:"23;77;23"}})])])},qe=[],Gt="";const pe={};var Ae=M(fe,Ye,qe,!1,He,"c6fd8106",null,null);function He(e){for(let n in pe)this[n]=pe[n]}var oe=function(){return Ae.exports}();function Ne(e){let n=0,t=0;if(e.getBoundingClientRect){const i=e.getBoundingClientRect(),u=document.documentElement;n=i.left+Math.max(u.scrollLeft,document.body.scrollLeft)-u.clientLeft,t=i.top+Math.max(u.scrollTop,document.body.scrollTop)-u.clientTop}else for(;e!==document.body;)n+=e.offsetLeft,t+=e.offsetTop,e=e.offsetParent;return{domX:n,domY:t}}function U(e,n){let t=n.relatedTarget;try{for(;t&&t!==e;)t=t.parentNode}catch(i){console.warn(i)}return t!==e}function Ue(e,n,t){const i=s.reactive({list:[]}),u=c=>{const g=c.currentTarget,w=Ne(g),l=c.pageX||c.clientX,E=c.pageY||c.clientY,_=w.domX,D=w.domY,B=l-_,m=E-D,h=parseInt(B.toString()),p=parseInt(m.toString()),C=new Date,W=i.list.length;return i.list.push({key:C.getTime(),index:W+1,x:h,y:p}),n.click&&n.click(h,p),c.cancelBubble=!0,c.preventDefault(),!1},v=c=>(n.confirm&&n.confirm(s.toRaw(i.list),()=>{b()}),c.cancelBubble=!0,c.preventDefault(),!1),o=c=>(a(),c.cancelBubble=!0,c.preventDefault(),!1),r=c=>(d(),c.cancelBubble=!0,c.preventDefault(),!1),a=()=>{n.close&&n.close(),b()},d=()=>{n.refresh&&n.refresh(),b()},b=()=>{i.list=[]};return{dots:i,clickEvent:u,confirmEvent:v,closeEvent:o,refreshEvent:r,resetData:b,clearData:()=>{b(),t&&t()},refresh:d,close:a}}const V={};V.props={config:{key:"config",required:!1,type:null,default:re},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},V.setup=(e,n)=>{const t=e,{data:i,events:u,config:v}=t,o=s.reactive({...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...re(),...s.toRaw(v)});s.watch(()=>t.data,(l,E)=>{Object.assign(o,l)},{deep:!0}),s.watch(()=>t.events,(l,E)=>{Object.assign(r,l)},{deep:!0}),s.watch(()=>t.config,(l,E)=>{Object.assign(a,l)},{deep:!0});const d=Ue(o,r,()=>{o.thumb="",o.image=""}),b=s.computed(()=>{const l=a.horizontalPadding||0,E=a.verticalPadding||0;return{width:(a.width||0)+l*2+(a.showTheme?2:0)+"px",paddingLeft:l+"px",paddingRight:l+"px",paddingTop:E+"px",paddingBottom:E+"px"}}),f=s.computed(()=>({width:a.thumbWidth+"px",height:a.thumbHeight+"px"})),c=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),g=s.computed(()=>o.image!=""||o.thumb!=""),w=s.computed(()=>(a.width||0)>0||(a.height||0)>0);return Object.assign({localData:o,localConfig:a,handler:d,wrapperStyles:b,thumbStyles:f,imageStyles:c,hasDisplayImageState:g,hasDisplayWrapperState:w},{reset:d.resetData,clear:d.clearData,refresh:d.refresh,close:d.close})},V.components=Object.assign({LoadingIcon:oe,CloseIcon:ae,RefreshIcon:ce},V.components);var Ve=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header"},[t("span",[e._v(e._s(e.localConfig.title))]),t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],style:e.thumbStyles,attrs:{src:e.localData.thumb,alt:""}})]),t("div",{staticClass:"gc-body",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],staticClass:"gc-picture",style:e.imageStyles,attrs:{src:e.localData.image,alt:""},on:{click:e.handler.clickEvent}}),t("div",{staticClass:"gc-dots"},e._l(e.handler.dots.list,function(i){return t("div",{key:i.key+"-"+i.index,staticClass:"gc-dot",style:{width:e.localConfig.dotSize+"px",height:e.localConfig.dotSize+"px",borderRadius:e.localConfig.dotSize+"px",top:i.y-(e.localConfig.dotSize||1)/2-1+"px",left:i.x-(e.localConfig.dotSize||1)/2-1+"px"}},[e._v(e._s(i.index))])}),0)]),t("div",{staticClass:"gc-footer"},[t("div",{staticClass:"gc-icon-block gc-icon-block2"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1),t("div",{staticClass:"gc-button-block"},[t("button",{class:!e.hasDisplayImageState&&"disabled",on:{click:e.handler.confirmEvent}},[e._v(e._s(e.localConfig.buttonText))])])])])},Ge=[],Jt="";const ge={};var Je=M(V,Ve,Ge,!1,Ke,null,null,null);function Ke(e){for(let n in ge)this[n]=ge[n]}var G=function(){return Je.exports}();G.name="gocaptcha-click",G.install=function(e){e.component("gocaptcha-click",G)};const me=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"\u8BF7\u62D6\u52A8\u6ED1\u5757\u5B8C\u6210\u62FC\u56FE",iconSize:22,scope:!0}),ve={};ve.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var Qe=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("path",{attrs:{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
|
|
26
26
|
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
|
|
27
|
-
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`}})])},Ze=[],Kt="";const _e={};var et=I(ve,Qe,Ze,!1,tt,"30853052",null,null);function tt(e){for(let n in _e)this[n]=_e[n]}var be=function(){return et.exports}();const nt=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function st(e,n,t,i,u,m,o,r,a){const d=s.reactive({dragLeft:0,thumbLeft:e.thumbX||0,isFreeze:!1});s.watch(()=>e,(_,D)=>{d.isFreeze||(d.thumbLeft=_.thumbX||0)},{deep:!0});const v=_=>{const D=_.touches&&_.touches[0],b=o.value.offsetLeft,h=u.value.offsetWidth,g=o.value.offsetWidth,S=h-g,j=m.value.offsetWidth,P=m.value.offsetLeft,A=h-j,O=(h-(j+P))/S;let M=!1,L=null,q=0,F=0;D?q=D.pageX-b:q=_.clientX-b;const B=k=>{M=!0;const Y=k.touches&&k.touches[0];let z=0;Y?z=Y.pageX-q:z=k.clientX-q;let Ht=P+z*O;if(z>=S){d.dragLeft=S,d.thumbLeft=F=A;return}if(z<=0){d.dragLeft=0,d.thumbLeft=F=P;return}d.dragLeft=z,d.thumbLeft=F=Ht,n.move&&n.move(F,e.thumbY||0),k.cancelBubble=!0,k.preventDefault()},W=k=>{!oe(r.value,k)||!M||($(),!(F<0)&&(M=!1,n.confirm&&n.confirm({x:parseInt(F.toString()),y:e.thumbY||0},()=>{l()}),k.cancelBubble=!0,k.preventDefault()))},R=k=>{L=k},T=()=>{L=null},N=k=>{!L||(W(L),$())},y=t.scope,x=y?i.value:r.value,C=y?i.value:document.body,$=()=>{C.removeEventListener("mousemove",B,!1),C.removeEventListener("touchmove",B,{passive:!1}),x.removeEventListener("mouseup",W,!1),x.removeEventListener("mouseenter",T,!1),x.removeEventListener("mouseleave",R,!1),x.removeEventListener("touchend",W,!1),C.removeEventListener("mouseleave",W,!1),C.removeEventListener("mouseup",N,!1),d.isFreeze=!1};d.isFreeze=!0,C.addEventListener("mousemove",B,!1),C.addEventListener("touchmove",B,{passive:!1}),x.addEventListener("mouseup",W,!1),x.addEventListener("mouseenter",T,!1),x.addEventListener("mouseleave",R,!1),x.addEventListener("touchend",W,!1),C.addEventListener("mouseleave",W,!1),C.addEventListener("mouseup",N,!1)},f=_=>(p(),_.cancelBubble=!0,_.preventDefault(),!1),c=_=>(w(),_.cancelBubble=!0,_.preventDefault(),!1),p=()=>{n&&n.close&&n.close(),l()},w=()=>{n&&n.refresh&&n.refresh(),l()},l=()=>{d.dragLeft=0,d.thumbLeft=e.thumbX||0};return{state:d,dragEvent:v,closeEvent:f,refreshEvent:c,resetData:l,clearData:()=>{a&&a(),l()},refresh:w,close:p}}const G={};G.props={config:{key:"config",required:!1,type:null,default:me},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},G.setup=(e,n)=>{const t=e,{data:i,events:u,config:m}=t,o=s.reactive({...nt(),...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...me(),...s.toRaw(m)});s.watch(()=>t.data,(g,S)=>{Object.assign(o,g)},{deep:!0}),s.watch(()=>t.events,(g,S)=>{Object.assign(r,g)},{deep:!0}),s.watch(()=>t.config,(g,S)=>{Object.assign(a,g)},{deep:!0});const d=s.ref(null),v=s.ref(null),f=s.ref(null),c=s.ref(null),p=s.ref(null),w=st(o,r,a,d,f,p,c,v,()=>{o.thumb="",o.image="",o.thumbX=0,o.thumbY=0,o.thumbWidth=0,o.thumbHeight=0}),l=s.computed(()=>{const g=a.horizontalPadding||0,S=a.verticalPadding||0;return{width:(a.width||0)+g*2+(a.showTheme?2:0)+"px",paddingLeft:g+"px",paddingRight:g+"px",paddingTop:S+"px",paddingBottom:S+"px"}}),E=s.computed(()=>({width:o.thumbWidth+"px",height:o.thumbHeight+"px",top:o.thumbY+"px",left:w.state.thumbLeft+"px"})),_=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),D=s.computed(()=>o.image!=""),b=s.computed(()=>o.thumb!=""),h=s.computed(()=>(a.width||0)>0||(a.height||0)>0);return s.onMounted(async()=>{await s.nextTick(),c.value&&c.value.addEventListener("dragstart",g=>g.preventDefault())}),Object.assign({localData:o,localConfig:a,rootRef:d,dragBarRef:v,containerRef:f,dragBlockRef:c,tileRef:p,handler:w,wrapperStyles:l,thumbStyles:E,imageStyles:_,hasDisplayImageState:D,hasDisplayThumbImageState:b,hasDisplayWrapperState:h},{reset:w.resetData,clear:w.clearData,refresh:w.refresh,close:w.close})},G.components=Object.assign({CloseIcon:se,RefreshIcon:ae,LoadingIcon:ce,ArrowsIcon:be},G.components);var at=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],ref:"rootRef",class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header"},[t("span",[e._v(e._s(e.localConfig.title))]),t("div",{staticClass:"gc-icon-block"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1)]),t("div",{ref:"containerRef",staticClass:"gc-body",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],staticClass:"gc-picture",style:e.imageStyles,attrs:{src:e.localData.image,alt:""}}),t("div",{ref:"tileRef",staticClass:"gc-tile",style:e.thumbStyles},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayThumbImageState,expression:"hasDisplayThumbImageState"}],attrs:{src:e.localData.thumb,alt:""}})])]),t("div",{staticClass:"gc-footer"},[t("div",{ref:"dragBarRef",staticClass:"gc-drag-slide-bar"},[t("div",{staticClass:"gc-drag-line"}),t("div",{ref:"dragBlockRef",staticClass:"gc-drag-block",class:!e.hasDisplayImageState&&"disabled",style:{left:e.handler.state.dragLeft+"px"},on:{mousedown:e.handler.dragEvent}},[t("div",{staticClass:"gc-drag-block-inline",on:{touchstart:e.handler.dragEvent}},[t("arrows-icon")],1)])])])])},ct=[],Qt="";const ye={};var ot=I(G,at,ct,!1,it,null,null,null);function it(e){for(let n in ye)this[n]=ye[n]}var J=function(){return ot.exports}();J.name="gocaptcha-slide",J.install=function(e){e.component("gocaptcha-slide",J)};const we=()=>({width:300,height:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"\u8BF7\u62D6\u62FD\u8D34\u56FE\u5B8C\u6210\u62FC\u56FE",iconSize:22,scope:!0}),rt=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function lt(e,n,t,i,u,m,o){const r=s.reactive({x:e.thumbX||0,y:e.thumbY||0,isFreeze:!1});s.watch(()=>e,(l,E)=>{r.isFreeze||(r.x=l.thumbX||0,r.y=l.thumbY||0)},{deep:!0});const a=l=>{const E=l.touches&&l.touches[0],_=m.value.offsetLeft,D=m.value.offsetTop,b=u.value.offsetWidth,h=u.value.offsetHeight,g=m.value.offsetWidth,S=m.value.offsetHeight,j=b-g,P=h-S;let A=!1,H=null,O=0,M=0,L=0,q=0;E?(O=E.pageX-_,M=E.pageY-D):(O=l.clientX-_,M=l.clientY-D);const F=$=>{A=!0;const k=$.touches&&$.touches[0];let Y=0,z=0;k?(Y=k.pageX-O,z=k.pageY-M):(Y=$.clientX-O,z=$.clientY-M),Y<=0&&(Y=0),z<=0&&(z=0),Y>=j&&(Y=j),z>=P&&(z=P),r.x=Y,r.y=z,L=Y,q=z,n.move&&n.move(Y,z),$.cancelBubble=!0,$.preventDefault()},B=$=>{!oe(u.value,$)||!A||(A=!1,C(),!(L<0||q<0)&&(n.confirm&&n.confirm({x:L,y:q},()=>{p()}),$.cancelBubble=!0,$.preventDefault()))},W=$=>{H=$},R=()=>{H=null},T=$=>{!H||(B(H),C())},N=t.scope,y=N?i.value:u.value,x=N?i.value:document.body,C=()=>{x.removeEventListener("mousemove",F,!1),x.removeEventListener("touchmove",F,{passive:!1}),y.removeEventListener("mouseup",B,!1),y.removeEventListener("mouseenter",R,!1),y.removeEventListener("mouseleave",W,!1),y.removeEventListener("touchend",B,!1),x.removeEventListener("mouseleave",B,!1),x.removeEventListener("mouseup",T,!1),r.isFreeze=!1};r.isFreeze=!0,x.addEventListener("mousemove",F,!1),x.addEventListener("touchmove",F,{passive:!1}),y.addEventListener("mouseup",B,!1),y.addEventListener("mouseenter",R,!1),y.addEventListener("mouseleave",W,!1),y.addEventListener("touchend",B,!1),x.addEventListener("mouseleave",B,!1),x.addEventListener("mouseup",T,!1)},d=l=>(f(),l.cancelBubble=!0,l.preventDefault(),!1),v=l=>(c(),l.cancelBubble=!0,l.preventDefault(),!1),f=()=>{n&&n.close&&n.close(),p()},c=()=>{n&&n.refresh&&n.refresh(),p()},p=()=>{r.x=e.thumbX||0,r.y=e.thumbY||0};return{state:r,dragEvent:a,closeEvent:d,refreshEvent:v,resetData:p,clearData:()=>{o&&o(),p()},refresh:c,close:f}}const K={};K.props={config:{key:"config",required:!1,type:null,default:we},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},K.setup=(e,n)=>{const t=e,{data:i,events:u,config:m}=t,o=s.reactive({...rt(),...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...we(),...s.toRaw(m)});s.watch(()=>t.data,(b,h)=>{Object.assign(o,b)},{deep:!0}),s.watch(()=>t.events,(b,h)=>{Object.assign(r,b)},{deep:!0}),s.watch(()=>t.config,(b,h)=>{Object.assign(a,b)},{deep:!0});const d=s.ref(null),v=s.ref(null),f=s.ref(null),c=lt(o,r,a,d,v,f,()=>{o.thumb="",o.image="",o.thumbX=0,o.thumbY=0,o.thumbWidth=0,o.thumbHeight=0}),p=s.computed(()=>{const b=a.horizontalPadding||0,h=a.verticalPadding||0;return{width:(a.width||0)+b*2+(a.showTheme?2:0)+"px",paddingLeft:b+"px",paddingRight:b+"px",paddingTop:h+"px",paddingBottom:h+"px"}}),w=s.computed(()=>({width:o.thumbWidth+"px",height:o.thumbHeight+"px",top:c.state.y+"px",left:c.state.x+"px"})),l=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),E=s.computed(()=>o.image!=""),_=s.computed(()=>o.thumb!=""),D=s.computed(()=>(a.width||0)>0||(a.height||0)>0);return s.onMounted(async()=>{await s.nextTick(),f.value&&f.value.addEventListener("dragstart",b=>b.preventDefault())}),Object.assign({localData:o,localConfig:a,rootRef:d,containerRef:v,tileRef:f,handler:c,wrapperStyles:p,thumbStyles:w,imageStyles:l,hasDisplayImageState:E,hasDisplayThumbImageState:_,hasDisplayWrapperState:D},{reset:c.resetData,clear:c.clearData,refresh:c.refresh,close:c.close})},K.components=Object.assign({LoadingIcon:ce,CloseIcon:se,RefreshIcon:ae},K.components);var ut=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],ref:"rootRef",class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header gc-header2"},[t("span",[e._v(e._s(e.localConfig.title))])]),t("div",{ref:"containerRef",staticClass:"gc-body",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],staticClass:"gc-picture",style:e.imageStyles,attrs:{src:e.localData.image,alt:""}}),t("div",{ref:"tileRef",staticClass:"gc-tile",style:e.thumbStyles,on:{mousedown:e.handler.dragEvent,touchstart:e.handler.dragEvent}},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayThumbImageState,expression:"hasDisplayThumbImageState"}],attrs:{src:e.localData.thumb,alt:""}})])]),t("div",{staticClass:"gc-footer"},[t("div",{staticClass:"gc-icon-block"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1)])])},dt=[],Zt="";const Ee={};var ht=I(K,ut,dt,!1,ft,null,null,null);function ft(e){for(let n in Ee)this[n]=Ee[n]}var Q=function(){return ht.exports}();Q.name="gocaptcha-slide-region",Q.install=function(e){e.component("gocaptcha-slide-region",Q)};const ie=()=>({width:300,height:220,size:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"\u8BF7\u62D6\u52A8\u6ED1\u5757\u5B8C\u6210\u62FC\u56FE",iconSize:22,scope:!0}),pt=()=>({angle:0,image:"",thumb:""});function gt(e,n,t,i,u,m,o){const r=s.reactive({dragLeft:0,thumbAngle:e.angle||0,isFreeze:!1});s.watch(()=>e,(l,E)=>{r.isFreeze||(r.thumbAngle=l.angle||0)},{deep:!0});const a=l=>{const E=l.touches&&l.touches[0],_=u.value.offsetLeft,D=m.value.offsetWidth,b=u.value.offsetWidth,h=D-b,g=360,S=(g-e.angle)/h;let j=0,P=!1,A=null,H=0,O=0;E?H=E.pageX-_:H=l.clientX-_;const M=y=>{P=!0;const x=y.touches&&y.touches[0];let C=0;if(x?C=x.pageX-H:C=y.clientX-H,j=e.angle+C*S,C>=h){r.dragLeft=h,r.thumbAngle=O=g;return}if(C<=0){r.dragLeft=0,r.thumbAngle=O=e.angle;return}r.dragLeft=C,r.thumbAngle=O=j,n.rotate&&n.rotate(j),y.cancelBubble=!0,y.preventDefault()},L=y=>{!oe(m.value,y)||!P||(N(),!(O<0)&&(P=!1,n.confirm&&n.confirm(parseInt(O.toString()),()=>{p()}),y.cancelBubble=!0,y.preventDefault()))},q=y=>{A=y},F=()=>{A=null},B=y=>{!A||(L(A),N())},W=t.scope,R=W?i.value:m.value,T=W?i.value:document.body,N=()=>{T.removeEventListener("mousemove",M,!1),T.removeEventListener("touchmove",M,{passive:!1}),R.removeEventListener("mouseup",L,!1),R.removeEventListener("mouseenter",F,!1),R.removeEventListener("mouseleave",q,!1),R.removeEventListener("touchend",L,!1),T.removeEventListener("mouseleave",L,!1),T.removeEventListener("mouseup",B,!1),r.isFreeze=!1};r.isFreeze=!0,T.addEventListener("mousemove",M,!1),T.addEventListener("touchmove",M,{passive:!1}),R.addEventListener("mouseup",L,!1),R.addEventListener("mouseenter",F,!1),R.addEventListener("mouseleave",q,!1),R.addEventListener("touchend",L,!1),T.addEventListener("mouseleave",L,!1),T.addEventListener("mouseup",B,!1)},d=l=>(f(),l.cancelBubble=!0,l.preventDefault(),!1),v=l=>(c(),l.cancelBubble=!0,l.preventDefault(),!1),f=()=>{n&&n.close&&n.close(),p()},c=()=>{n&&n.refresh&&n.refresh(),p()},p=()=>{r.dragLeft=0,r.thumbAngle=e.angle};return{state:r,dragEvent:a,closeEvent:d,refreshEvent:v,resetData:p,clearData:()=>{o&&o(),p()},refresh:c,close:f}}const Z={};Z.props={config:{key:"config",required:!1,type:null,default:ie},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},Z.setup=(e,n)=>{const t=e,{data:i,events:u,config:m}=t,o=s.reactive({...pt(),...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...ie(),...s.toRaw(m)});s.watch(()=>t.data,(h,g)=>{Object.assign(o,h)},{deep:!0}),s.watch(()=>t.events,(h,g)=>{Object.assign(r,h)},{deep:!0}),s.watch(()=>t.config,(h,g)=>{Object.assign(a,h)},{deep:!0});const d=s.ref(null),v=s.ref(null),f=s.ref(null),c=gt(o,r,a,d,f,v,()=>{o.thumb="",o.image="",o.angle=0}),p=s.computed(()=>{const h=a.horizontalPadding||0,g=a.verticalPadding||0;return{width:(a.width||0)+h*2+(a.showTheme?2:0)+"px",paddingLeft:h+"px",paddingRight:h+"px",paddingTop:g+"px",paddingBottom:g+"px"}}),w=s.computed(()=>({transform:`rotate(${c.state.thumbAngle}deg)`})),l=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),E=s.computed(()=>{const h=(a.size||0)>0?a.size:ie().size;return{width:h+"px",height:h+"px"}}),_=s.computed(()=>o.image!=""),D=s.computed(()=>o.thumb!=""),b=s.computed(()=>(a.width||0)>0||(a.height||0)>0);return s.onMounted(async()=>{await s.nextTick(),f.value&&f.value.addEventListener("dragstart",h=>h.preventDefault())}),Object.assign({localData:o,localConfig:a,rootRef:d,dragBarRef:v,dragBlockRef:f,handler:c,wrapperStyles:p,thumbStyles:w,imageBlockStyles:l,imageStyles:E,hasDisplayImageState:_,hasDisplayThumbImageState:D,hasDisplayWrapperState:b},{reset:c.resetData,clear:c.clearData,refresh:c.refresh,close:c.close})},Z.components=Object.assign({CloseIcon:se,RefreshIcon:ae,LoadingIcon:ce,ArrowsIcon:be},Z.components);var mt=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],ref:"rootRef",class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header"},[t("span",[e._v(e._s(e.localConfig.title))]),t("div",{staticClass:"gc-icon-block"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1)]),t("div",{ref:"containerRef",staticClass:"gc-body gc-rotate-body",style:e.imageBlockStyles},[t("div",{staticClass:"gc-body-inner",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("div",{staticClass:"gc-picture gc-rotate-picture",style:e.imageStyles},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],attrs:{src:e.localData.image,alt:""}}),t("div",{staticClass:"gc-round"})]),t("div",{staticClass:"gc-thumb gc-rotate-thumb"},[t("div",{staticClass:"gc-rotate-thumb-block",style:e.thumbStyles},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayThumbImageState,expression:"hasDisplayThumbImageState"}],attrs:{src:e.localData.thumb,alt:""}})])])])]),t("div",{staticClass:"gc-footer"},[t("div",{ref:"dragBarRef",staticClass:"gc-drag-slide-bar"},[t("div",{staticClass:"gc-drag-line"}),t("div",{ref:"dragBlockRef",staticClass:"gc-drag-block",class:!e.hasDisplayImageState&&"disabled",style:{left:e.handler.state.dragLeft+"px"},on:{mousedown:e.handler.dragEvent}},[t("div",{staticClass:"gc-drag-block-inline",on:{touchstart:e.handler.dragEvent}},[t("arrows-icon")],1)])])])])},vt=[],en="";const xe={};var _t=I(Z,mt,vt,!1,bt,null,null,null);function bt(e){for(let n in xe)this[n]=xe[n]}var ee=function(){return _t.exports}();ee.name="gocaptcha-rotate",ee.install=function(e){e.component("gocaptcha-rotate",ee)};const Ce={};Ce.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var yt=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("circle",{attrs:{fill:"#3E7CFF",cx:"100",cy:"100",r:"96.3"}}),t("path",{attrs:{fill:"#FFFFFF",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
|
|
28
|
-
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`}})])},wt=[],tn="";const Se={};var Et=
|
|
27
|
+
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`}})])},Ze=[],Kt="";const _e={};var et=M(ve,Qe,Ze,!1,tt,"30853052",null,null);function tt(e){for(let n in _e)this[n]=_e[n]}var be=function(){return et.exports}();const nt=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function st(e,n,t,i,u,v,o,r,a){const d=s.reactive({dragLeft:0,thumbLeft:e.thumbX||0,isFreeze:!1});s.watch(()=>e,(_,D)=>{d.isFreeze||(d.thumbLeft=_.thumbX||0)},{deep:!0});const b=_=>{if(!U(r.value,_))return;const D=_.touches&&_.touches[0],B=o.value.offsetLeft,m=u.value.offsetWidth,h=o.value.offsetWidth,p=m-h,C=v.value.offsetWidth,W=v.value.offsetLeft,A=m-C,O=(m-(C+W))/p;let X=!1,L=null,q=0,T=0;D?q=D.pageX-B:q=_.clientX-B;const F=k=>{X=!0;const Y=k.touches&&k.touches[0];let z=0;Y?z=Y.pageX-q:z=k.clientX-q;let Ht=W+z*O;if(z>=p){d.dragLeft=p,d.thumbLeft=T=A;return}if(z<=0){d.dragLeft=0,d.thumbLeft=T=W;return}d.dragLeft=z,d.thumbLeft=T=Ht,n.move&&n.move(T,e.thumbY||0),k.cancelBubble=!0,k.preventDefault()},j=k=>{!U(r.value,k)||($(),X&&(X=!1,!(T<0)&&(n.confirm&&n.confirm({x:parseInt(T.toString()),y:e.thumbY||0},()=>{l()}),k.cancelBubble=!0,k.preventDefault())))},R=k=>{L=k},I=()=>{L=null},N=k=>{!L||(j(L),$())},y=t.scope,x=y?i.value:r.value,S=y?i.value:document.body,$=()=>{S.removeEventListener("mousemove",F,!1),S.removeEventListener("touchmove",F,{passive:!1}),x.removeEventListener("mouseup",j,!1),x.removeEventListener("mouseenter",I,!1),x.removeEventListener("mouseleave",R,!1),x.removeEventListener("touchend",j,!1),S.removeEventListener("mouseleave",j,!1),S.removeEventListener("mouseup",N,!1),d.isFreeze=!1};d.isFreeze=!0,S.addEventListener("mousemove",F,!1),S.addEventListener("touchmove",F,{passive:!1}),x.addEventListener("mouseup",j,!1),x.addEventListener("mouseenter",I,!1),x.addEventListener("mouseleave",R,!1),x.addEventListener("touchend",j,!1),S.addEventListener("mouseleave",j,!1),S.addEventListener("mouseup",N,!1)},f=_=>(g(),_.cancelBubble=!0,_.preventDefault(),!1),c=_=>(w(),_.cancelBubble=!0,_.preventDefault(),!1),g=()=>{n&&n.close&&n.close(),l()},w=()=>{n&&n.refresh&&n.refresh(),l()},l=()=>{d.dragLeft=0,d.thumbLeft=e.thumbX||0};return{state:d,dragEvent:b,closeEvent:f,refreshEvent:c,resetData:l,clearData:()=>{a&&a(),l()},refresh:w,close:g}}const J={};J.props={config:{key:"config",required:!1,type:null,default:me},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},J.setup=(e,n)=>{const t=e,{data:i,events:u,config:v}=t,o=s.reactive({...nt(),...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...me(),...s.toRaw(v)});s.watch(()=>t.data,(p,C)=>{Object.assign(o,p)},{deep:!0}),s.watch(()=>t.events,(p,C)=>{Object.assign(r,p)},{deep:!0}),s.watch(()=>t.config,(p,C)=>{Object.assign(a,p)},{deep:!0});const d=s.ref(null),b=s.ref(null),f=s.ref(null),c=s.ref(null),g=s.ref(null),w=st(o,r,a,d,f,g,c,b,()=>{o.thumb="",o.image="",o.thumbX=0,o.thumbY=0,o.thumbWidth=0,o.thumbHeight=0}),l=s.computed(()=>{const p=a.horizontalPadding||0,C=a.verticalPadding||0;return{width:(a.width||0)+p*2+(a.showTheme?2:0)+"px",paddingLeft:p+"px",paddingRight:p+"px",paddingTop:C+"px",paddingBottom:C+"px"}}),E=s.computed(()=>({width:o.thumbWidth+"px",height:o.thumbHeight+"px",top:o.thumbY+"px",left:w.state.thumbLeft+"px"})),_=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),D=s.computed(()=>o.image!=""),B=s.computed(()=>o.thumb!=""),m=s.computed(()=>(a.width||0)>0||(a.height||0)>0),h=p=>p.preventDefault();return s.onMounted(async()=>{await s.nextTick(),c.value&&c.value.addEventListener("dragstart",h)}),s.onUnmounted(()=>{c.value&&c.value.removeEventListener("dragstart",h)}),Object.assign({localData:o,localConfig:a,rootRef:d,dragBarRef:b,containerRef:f,dragBlockRef:c,tileRef:g,handler:w,wrapperStyles:l,thumbStyles:E,imageStyles:_,hasDisplayImageState:D,hasDisplayThumbImageState:B,hasDisplayWrapperState:m},{reset:w.resetData,clear:w.clearData,refresh:w.refresh,close:w.close})},J.components=Object.assign({CloseIcon:ae,RefreshIcon:ce,LoadingIcon:oe,ArrowsIcon:be},J.components);var at=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],ref:"rootRef",class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header"},[t("span",[e._v(e._s(e.localConfig.title))]),t("div",{staticClass:"gc-icon-block"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1)]),t("div",{ref:"containerRef",staticClass:"gc-body",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],staticClass:"gc-picture",style:e.imageStyles,attrs:{src:e.localData.image,alt:""}}),t("div",{ref:"tileRef",staticClass:"gc-tile",style:e.thumbStyles},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayThumbImageState,expression:"hasDisplayThumbImageState"}],attrs:{src:e.localData.thumb,alt:""}})])]),t("div",{staticClass:"gc-footer"},[t("div",{ref:"dragBarRef",staticClass:"gc-drag-slide-bar"},[t("div",{staticClass:"gc-drag-line"}),t("div",{ref:"dragBlockRef",staticClass:"gc-drag-block",class:!e.hasDisplayImageState&&"disabled",style:{left:e.handler.state.dragLeft+"px"},on:{mousedown:e.handler.dragEvent}},[t("div",{staticClass:"gc-drag-block-inline",on:{touchstart:e.handler.dragEvent}},[t("arrows-icon")],1)])])])])},ct=[],Qt="";const ye={};var ot=M(J,at,ct,!1,it,null,null,null);function it(e){for(let n in ye)this[n]=ye[n]}var K=function(){return ot.exports}();K.name="gocaptcha-slide",K.install=function(e){e.component("gocaptcha-slide",K)};const we=()=>({width:300,height:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"\u8BF7\u62D6\u62FD\u8D34\u56FE\u5B8C\u6210\u62FC\u56FE",iconSize:22,scope:!0}),rt=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function lt(e,n,t,i,u,v,o){const r=s.reactive({x:e.thumbX||0,y:e.thumbY||0,isFreeze:!1});s.watch(()=>e,(l,E)=>{r.isFreeze||(r.x=l.thumbX||0,r.y=l.thumbY||0)},{deep:!0});const a=l=>{if(!U(u.value,l))return;const E=l.touches&&l.touches[0],_=v.value.offsetLeft,D=v.value.offsetTop,B=u.value.offsetWidth,m=u.value.offsetHeight,h=v.value.offsetWidth,p=v.value.offsetHeight,C=B-h,W=m-p;let A=!1,H=null,O=0,X=0,L=0,q=0;E?(O=E.pageX-_,X=E.pageY-D):(O=l.clientX-_,X=l.clientY-D);const T=$=>{A=!0;const k=$.touches&&$.touches[0];let Y=0,z=0;k?(Y=k.pageX-O,z=k.pageY-X):(Y=$.clientX-O,z=$.clientY-X),Y<=0&&(Y=0),z<=0&&(z=0),Y>=C&&(Y=C),z>=W&&(z=W),r.x=Y,r.y=z,L=Y,q=z,n.move&&n.move(Y,z),$.cancelBubble=!0,$.preventDefault()},F=$=>{!U(u.value,$)||(S(),A&&(A=!1,!(L<0||q<0)&&(n.confirm&&n.confirm({x:L,y:q},()=>{g()}),$.cancelBubble=!0,$.preventDefault())))},j=$=>{H=$},R=()=>{H=null},I=$=>{!H||(F(H),S())},N=t.scope,y=N?i.value:u.value,x=N?i.value:document.body,S=()=>{x.removeEventListener("mousemove",T,!1),x.removeEventListener("touchmove",T,{passive:!1}),y.removeEventListener("mouseup",F,!1),y.removeEventListener("mouseenter",R,!1),y.removeEventListener("mouseleave",j,!1),y.removeEventListener("touchend",F,!1),x.removeEventListener("mouseleave",F,!1),x.removeEventListener("mouseup",I,!1),r.isFreeze=!1};r.isFreeze=!0,x.addEventListener("mousemove",T,!1),x.addEventListener("touchmove",T,{passive:!1}),y.addEventListener("mouseup",F,!1),y.addEventListener("mouseenter",R,!1),y.addEventListener("mouseleave",j,!1),y.addEventListener("touchend",F,!1),x.addEventListener("mouseleave",F,!1),x.addEventListener("mouseup",I,!1)},d=l=>(f(),l.cancelBubble=!0,l.preventDefault(),!1),b=l=>(c(),l.cancelBubble=!0,l.preventDefault(),!1),f=()=>{n&&n.close&&n.close(),g()},c=()=>{n&&n.refresh&&n.refresh(),g()},g=()=>{r.x=e.thumbX||0,r.y=e.thumbY||0};return{state:r,dragEvent:a,closeEvent:d,refreshEvent:b,resetData:g,clearData:()=>{o&&o(),g()},refresh:c,close:f}}const Q={};Q.props={config:{key:"config",required:!1,type:null,default:we},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},Q.setup=(e,n)=>{const t=e,{data:i,events:u,config:v}=t,o=s.reactive({...rt(),...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...we(),...s.toRaw(v)});s.watch(()=>t.data,(m,h)=>{Object.assign(o,m)},{deep:!0}),s.watch(()=>t.events,(m,h)=>{Object.assign(r,m)},{deep:!0}),s.watch(()=>t.config,(m,h)=>{Object.assign(a,m)},{deep:!0});const d=s.ref(null),b=s.ref(null),f=s.ref(null),c=lt(o,r,a,d,b,f,()=>{o.thumb="",o.image="",o.thumbX=0,o.thumbY=0,o.thumbWidth=0,o.thumbHeight=0}),g=s.computed(()=>{const m=a.horizontalPadding||0,h=a.verticalPadding||0;return{width:(a.width||0)+m*2+(a.showTheme?2:0)+"px",paddingLeft:m+"px",paddingRight:m+"px",paddingTop:h+"px",paddingBottom:h+"px"}}),w=s.computed(()=>({width:o.thumbWidth+"px",height:o.thumbHeight+"px",top:c.state.y+"px",left:c.state.x+"px"})),l=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),E=s.computed(()=>o.image!=""),_=s.computed(()=>o.thumb!=""),D=s.computed(()=>(a.width||0)>0||(a.height||0)>0),B=m=>m.preventDefault();return s.onMounted(async()=>{await s.nextTick(),f.value&&f.value.addEventListener("dragstart",B)}),s.onUnmounted(()=>{f.value&&f.value.removeEventListener("dragstart",B)}),Object.assign({localData:o,localConfig:a,rootRef:d,containerRef:b,tileRef:f,handler:c,wrapperStyles:g,thumbStyles:w,imageStyles:l,hasDisplayImageState:E,hasDisplayThumbImageState:_,hasDisplayWrapperState:D},{reset:c.resetData,clear:c.clearData,refresh:c.refresh,close:c.close})},Q.components=Object.assign({LoadingIcon:oe,CloseIcon:ae,RefreshIcon:ce},Q.components);var ut=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],ref:"rootRef",class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header gc-header2"},[t("span",[e._v(e._s(e.localConfig.title))])]),t("div",{ref:"containerRef",staticClass:"gc-body",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],staticClass:"gc-picture",style:e.imageStyles,attrs:{src:e.localData.image,alt:""}}),t("div",{ref:"tileRef",staticClass:"gc-tile",style:e.thumbStyles,on:{mousedown:e.handler.dragEvent,touchstart:e.handler.dragEvent}},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayThumbImageState,expression:"hasDisplayThumbImageState"}],attrs:{src:e.localData.thumb,alt:""}})])]),t("div",{staticClass:"gc-footer"},[t("div",{staticClass:"gc-icon-block"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1)])])},dt=[],Zt="";const Ee={};var ht=M(Q,ut,dt,!1,ft,null,null,null);function ft(e){for(let n in Ee)this[n]=Ee[n]}var Z=function(){return ht.exports}();Z.name="gocaptcha-slide-region",Z.install=function(e){e.component("gocaptcha-slide-region",Z)};const ie=()=>({width:300,height:220,size:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"\u8BF7\u62D6\u52A8\u6ED1\u5757\u5B8C\u6210\u62FC\u56FE",iconSize:22,scope:!0}),pt=()=>({angle:0,image:"",thumb:""});function gt(e,n,t,i,u,v,o){const r=s.reactive({dragLeft:0,thumbAngle:e.angle||0,isFreeze:!1});s.watch(()=>e,(l,E)=>{r.isFreeze||(r.thumbAngle=l.angle||0)},{deep:!0});const a=l=>{if(!U(v.value,l))return;const E=l.touches&&l.touches[0],_=u.value.offsetLeft,D=v.value.offsetWidth,B=u.value.offsetWidth,m=D-B,h=360,p=(h-e.angle)/m;let C=0,W=!1,A=null,H=0,O=0;E?H=E.pageX-_:H=l.clientX-_;const X=y=>{W=!0;const x=y.touches&&y.touches[0];let S=0;if(x?S=x.pageX-H:S=y.clientX-H,C=e.angle+S*p,S>=m){r.dragLeft=m,r.thumbAngle=O=h;return}if(S<=0){r.dragLeft=0,r.thumbAngle=O=e.angle;return}r.dragLeft=S,r.thumbAngle=O=C,n.rotate&&n.rotate(C),y.cancelBubble=!0,y.preventDefault()},L=y=>{!U(v.value,y)||(N(),W&&(W=!1,!(O<0)&&(n.confirm&&n.confirm(parseInt(O.toString()),()=>{g()}),y.cancelBubble=!0,y.preventDefault())))},q=y=>{A=y},T=()=>{A=null},F=y=>{!A||(L(A),N())},j=t.scope,R=j?i.value:v.value,I=j?i.value:document.body,N=()=>{I.removeEventListener("mousemove",X,!1),I.removeEventListener("touchmove",X,{passive:!1}),R.removeEventListener("mouseup",L,!1),R.removeEventListener("mouseenter",T,!1),R.removeEventListener("mouseleave",q,!1),R.removeEventListener("touchend",L,!1),I.removeEventListener("mouseleave",L,!1),I.removeEventListener("mouseup",F,!1),r.isFreeze=!1};r.isFreeze=!0,I.addEventListener("mousemove",X,!1),I.addEventListener("touchmove",X,{passive:!1}),R.addEventListener("mouseup",L,!1),R.addEventListener("mouseenter",T,!1),R.addEventListener("mouseleave",q,!1),R.addEventListener("touchend",L,!1),I.addEventListener("mouseleave",L,!1),I.addEventListener("mouseup",F,!1)},d=l=>(f(),l.cancelBubble=!0,l.preventDefault(),!1),b=l=>(c(),l.cancelBubble=!0,l.preventDefault(),!1),f=()=>{n&&n.close&&n.close(),g()},c=()=>{n&&n.refresh&&n.refresh(),g()},g=()=>{r.dragLeft=0,r.thumbAngle=e.angle};return{state:r,dragEvent:a,closeEvent:d,refreshEvent:b,resetData:g,clearData:()=>{o&&o(),g()},refresh:c,close:f}}const ee={};ee.props={config:{key:"config",required:!1,type:null,default:ie},events:{key:"events",required:!1,type:null,default:()=>({})},data:{key:"data",required:!1,type:null,default:()=>({})}},ee.setup=(e,n)=>{const t=e,{data:i,events:u,config:v}=t,o=s.reactive({...pt(),...s.toRaw(i)}),r=s.reactive({...s.toRaw(u)}),a=s.reactive({...ie(),...s.toRaw(v)});s.watch(()=>t.data,(h,p)=>{Object.assign(o,h)},{deep:!0}),s.watch(()=>t.events,(h,p)=>{Object.assign(r,h)},{deep:!0}),s.watch(()=>t.config,(h,p)=>{Object.assign(a,h)},{deep:!0});const d=s.ref(null),b=s.ref(null),f=s.ref(null),c=gt(o,r,a,d,f,b,()=>{o.thumb="",o.image="",o.angle=0}),g=s.computed(()=>{const h=a.horizontalPadding||0,p=a.verticalPadding||0;return{width:(a.width||0)+h*2+(a.showTheme?2:0)+"px",paddingLeft:h+"px",paddingRight:h+"px",paddingTop:p+"px",paddingBottom:p+"px"}}),w=s.computed(()=>({transform:`rotate(${c.state.thumbAngle}deg)`})),l=s.computed(()=>({width:a.width+"px",height:a.height+"px"})),E=s.computed(()=>{const h=(a.size||0)>0?a.size:ie().size;return{width:h+"px",height:h+"px"}}),_=s.computed(()=>o.image!=""),D=s.computed(()=>o.thumb!=""),B=s.computed(()=>(a.width||0)>0||(a.height||0)>0),m=h=>h.preventDefault();return s.onMounted(async()=>{await s.nextTick(),f.value&&f.value.addEventListener("dragstart",m)}),s.onUnmounted(()=>{f.value&&f.value.removeEventListener("dragstart",m)}),Object.assign({localData:o,localConfig:a,rootRef:d,dragBarRef:b,dragBlockRef:f,handler:c,wrapperStyles:g,thumbStyles:w,imageBlockStyles:l,imageStyles:E,hasDisplayImageState:_,hasDisplayThumbImageState:D,hasDisplayWrapperState:B},{reset:c.resetData,clear:c.clearData,refresh:c.refresh,close:c.close})},ee.components=Object.assign({CloseIcon:ae,RefreshIcon:ce,LoadingIcon:oe,ArrowsIcon:be},ee.components);var mt=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayWrapperState,expression:"hasDisplayWrapperState"}],ref:"rootRef",class:"go-captcha gc-wrapper "+(e.localConfig.showTheme&&"gc-theme"),style:e.wrapperStyles},[t("div",{staticClass:"gc-header"},[t("span",[e._v(e._s(e.localConfig.title))]),t("div",{staticClass:"gc-icon-block"},[t("close-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.closeEvent}}),t("refresh-icon",{attrs:{width:e.localConfig.iconSize,height:e.localConfig.iconSize},on:{click:e.handler.refreshEvent}})],1)]),t("div",{ref:"containerRef",staticClass:"gc-body gc-rotate-body",style:e.imageBlockStyles},[t("div",{staticClass:"gc-body-inner",style:e.imageStyles},[t("div",{staticClass:"gc-loading"},[t("loading-icon")],1),t("div",{staticClass:"gc-picture gc-rotate-picture",style:e.imageStyles},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayImageState,expression:"hasDisplayImageState"}],attrs:{src:e.localData.image,alt:""}}),t("div",{staticClass:"gc-round"})]),t("div",{staticClass:"gc-thumb gc-rotate-thumb"},[t("div",{staticClass:"gc-rotate-thumb-block",style:e.thumbStyles},[t("img",{directives:[{name:"show",rawName:"v-show",value:e.hasDisplayThumbImageState,expression:"hasDisplayThumbImageState"}],attrs:{src:e.localData.thumb,alt:""}})])])])]),t("div",{staticClass:"gc-footer"},[t("div",{ref:"dragBarRef",staticClass:"gc-drag-slide-bar"},[t("div",{staticClass:"gc-drag-line"}),t("div",{ref:"dragBlockRef",staticClass:"gc-drag-block",class:!e.hasDisplayImageState&&"disabled",style:{left:e.handler.state.dragLeft+"px"},on:{mousedown:e.handler.dragEvent}},[t("div",{staticClass:"gc-drag-block-inline",on:{touchstart:e.handler.dragEvent}},[t("arrows-icon")],1)])])])])},vt=[],en="";const xe={};var _t=M(ee,mt,vt,!1,bt,null,null,null);function bt(e){for(let n in xe)this[n]=xe[n]}var te=function(){return _t.exports}();te.name="gocaptcha-rotate",te.install=function(e){e.component("gocaptcha-rotate",te)};const Ce={};Ce.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var yt=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("circle",{attrs:{fill:"#3E7CFF",cx:"100",cy:"100",r:"96.3"}}),t("path",{attrs:{fill:"#FFFFFF",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
|
|
28
|
+
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`}})])},wt=[],tn="";const Se={};var Et=M(Ce,yt,wt,!1,xt,"5511614f",null,null);function xt(e){for(let n in Se)this[n]=Se[n]}var Ct=function(){return Et.exports}();const De={};De.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var St=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("path",{attrs:{fill:"#FFA000",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
|
|
29
29
|
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
|
|
30
30
|
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
|
|
31
31
|
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
|
|
32
|
-
z`}})])},Dt=[],nn="";const Le={};var Lt=
|
|
32
|
+
z`}})])},Dt=[],nn="";const Le={};var Lt=M(De,St,Dt,!1,$t,"3fd7b394",null,null);function $t(e){for(let n in Le)this[n]=Le[n]}var kt=function(){return Lt.exports}();const $e={};$e.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var zt=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("path",{attrs:{fill:"#ED4630",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
|
|
33
33
|
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
|
|
34
34
|
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
|
|
35
35
|
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
|
|
36
|
-
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`}})])},Bt=[],sn="";const ke={};var Ft=
|
|
36
|
+
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`}})])},Bt=[],sn="";const ke={};var Ft=M($e,zt,Bt,!1,Tt,"6c20e1c2",null,null);function Tt(e){for(let n in ke)this[n]=ke[n]}var Rt=function(){return Ft.exports}();const ze={};ze.setup=(e,n)=>{const t=n.emit;function i(u){t("click",u)}return{emitClickEvent:i}};var It=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("svg",e._b({attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},on:{click:e.emitClickEvent}},"svg",e.$attrs,!1),[t("path",{attrs:{fill:"#5EAA2F",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
|
|
37
37
|
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
|
|
38
38
|
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
|
|
39
|
-
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`}})])},Mt=[],an="";const Be={};var Wt=
|
|
39
|
+
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`}})])},Mt=[],an="";const Be={};var Wt=M(ze,It,Mt,!1,Xt,"5a795cd4",null,null);function Xt(e){for(let n in Be)this[n]=Be[n]}var jt=function(){return Wt.exports}();const Fe=()=>({width:330,height:44,verticalPadding:12,horizontalPadding:16}),ne={};ne.props={config:{key:"config",required:!1,type:null,default:Fe},clickEvent:{key:"clickEvent",required:!1,type:Function},disabled:{key:"disabled",required:!1,type:Boolean,default:!1},type:{key:"type",required:!1,type:null,default:"default"},title:{key:"title",required:!1,type:String,default:"\u70B9\u51FB\u6309\u952E\u8FDB\u884C\u9A8C\u8BC1"}},ne.setup=(e,n)=>{const t=e,{type:i,title:u,disabled:v,config:o}=s.toRefs(t),r=s.reactive({...Fe(),...s.toRaw(o)});s.watch(()=>t.config,(c,g)=>{Object.assign(r,c)},{deep:!0});const a=s.computed(()=>{const c=`gc-${i.value}`;return["go-captcha","gc-btn-block",c,v.value?"gc-disabled":""]}),d=s.computed(()=>({width:r.width+"px",height:r.height+"px",paddingLeft:r.horizontalPadding+"px",paddingRight:r.horizontalPadding+"px",paddingTop:r.verticalPadding+"px",paddingBottom:r.verticalPadding+"px"})),b=n.emit;function f(c){b("click-event",c)}return{type:i,title:u,btnClass:a,btnStyle:d,emitClickEvent:f}},ne.components=Object.assign({BtnDefaultIcon:Ct,BtnWarnIcon:kt,BtnErrorIcon:Rt,BtnSuccessIcon:jt},ne.components);var Pt=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{class:e.btnClass,style:e.btnStyle,on:{click:e.emitClickEvent}},[t("div",{class:e.type==="default"?"gc-ripple":""},[e.type==="default"?t("btn-default-icon"):e.type==="warn"?t("btn-warn-icon"):e.type==="error"?t("btn-error-icon"):e.type==="success"?t("btn-success-icon"):e._e()],1),t("span",[e._v(e._s(e.title))])])},Ot=[],cn="";const Te={};var Yt=M(ne,Pt,Ot,!1,qt,null,null,null);function qt(e){for(let n in Te)this[n]=Te[n]}var se=function(){return Yt.exports}();se.name="gocaptcha-button",se.install=function(e){e.component("gocaptcha-button",se)};const At={install(e){G.install(e),K.install(e),Z.install(e),te.install(e),se.install(e)}};P.Button=se,P.Click=G,P.Rotate=te,P.Slide=K,P.SlideRegion=Z,P.default=At,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "go-captcha-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5-pre1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "GoCaptcha for Vue, which implements click mode, slider mode, drag-drop mode and rotation mode.",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"go-captcha-vue",
|
|
10
10
|
"go-captcha",
|
|
@@ -45,14 +45,11 @@
|
|
|
45
45
|
"scripts": {
|
|
46
46
|
"dev": "vite",
|
|
47
47
|
"build": "run-p type-check \"build-only {@}\" --",
|
|
48
|
-
"build
|
|
48
|
+
"build:only": "vite build && run-p tsd",
|
|
49
49
|
"tsd": "vue-tsc --rootDir ./packages --declaration --emitDeclarationOnly --noEmit false --outDir ./dist",
|
|
50
50
|
"preview": "vite preview --port 5050",
|
|
51
51
|
"type-check": "vue-tsc --noEmit -p tsconfig.json"
|
|
52
52
|
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"vue": "<3"
|
|
55
|
-
},
|
|
56
53
|
"peerDependencies": {
|
|
57
54
|
"vue": "<3"
|
|
58
55
|
},
|
|
@@ -70,8 +67,9 @@
|
|
|
70
67
|
"unplugin-vue2-script-setup": "^0.7.1",
|
|
71
68
|
"vite": "^2.6.14",
|
|
72
69
|
"vite-plugin-vue2": "^1.9.0",
|
|
70
|
+
"vue": "^2.7.14",
|
|
73
71
|
"vue-demi": "^0.13.11",
|
|
74
72
|
"vue-template-compiler": "^2.7.14",
|
|
75
|
-
"vue-tsc": "^1
|
|
73
|
+
"vue-tsc": "^1"
|
|
76
74
|
}
|
|
77
75
|
}
|