jdzcaptcha 2.0.0
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/LICENSE +21 -0
- package/README.md +55 -0
- package/cli/jpack.js +3 -0
- package/config/jpack.js +129 -0
- package/config/jpack.template +5 -0
- package/config/jpack.wrapper.js +16 -0
- package/dist/assets/jdzcaptcha/placeholder.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-1.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-10.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-11.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-12.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-13.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-14.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-15.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-16.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-17.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-18.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-19.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-2.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-20.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-21.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-22.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-23.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-24.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-25.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-26.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-27.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-28.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-29.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-3.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-30.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-31.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-32.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-33.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-34.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-35.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-36.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-37.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-38.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-39.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-4.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-40.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-41.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-42.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-43.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-44.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-45.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-46.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-47.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-48.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-49.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-5.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-50.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-6.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-7.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-8.png +0 -0
- package/dist/assets/jdzcaptcha/streamline/light/icon-9.png +0 -0
- package/dist/public/css/jdzcaptcha.min.css +1 -0
- package/dist/public/js/jdzcaptcha.min.js +2 -0
- package/lib/iconsets/streamline/Icons by Streamline.txt +5 -0
- package/lib/iconsets/streamline/light/icon-1.png +0 -0
- package/lib/iconsets/streamline/light/icon-10.png +0 -0
- package/lib/iconsets/streamline/light/icon-11.png +0 -0
- package/lib/iconsets/streamline/light/icon-12.png +0 -0
- package/lib/iconsets/streamline/light/icon-13.png +0 -0
- package/lib/iconsets/streamline/light/icon-14.png +0 -0
- package/lib/iconsets/streamline/light/icon-15.png +0 -0
- package/lib/iconsets/streamline/light/icon-16.png +0 -0
- package/lib/iconsets/streamline/light/icon-17.png +0 -0
- package/lib/iconsets/streamline/light/icon-18.png +0 -0
- package/lib/iconsets/streamline/light/icon-19.png +0 -0
- package/lib/iconsets/streamline/light/icon-2.png +0 -0
- package/lib/iconsets/streamline/light/icon-20.png +0 -0
- package/lib/iconsets/streamline/light/icon-21.png +0 -0
- package/lib/iconsets/streamline/light/icon-22.png +0 -0
- package/lib/iconsets/streamline/light/icon-23.png +0 -0
- package/lib/iconsets/streamline/light/icon-24.png +0 -0
- package/lib/iconsets/streamline/light/icon-25.png +0 -0
- package/lib/iconsets/streamline/light/icon-26.png +0 -0
- package/lib/iconsets/streamline/light/icon-27.png +0 -0
- package/lib/iconsets/streamline/light/icon-28.png +0 -0
- package/lib/iconsets/streamline/light/icon-29.png +0 -0
- package/lib/iconsets/streamline/light/icon-3.png +0 -0
- package/lib/iconsets/streamline/light/icon-30.png +0 -0
- package/lib/iconsets/streamline/light/icon-31.png +0 -0
- package/lib/iconsets/streamline/light/icon-32.png +0 -0
- package/lib/iconsets/streamline/light/icon-33.png +0 -0
- package/lib/iconsets/streamline/light/icon-34.png +0 -0
- package/lib/iconsets/streamline/light/icon-35.png +0 -0
- package/lib/iconsets/streamline/light/icon-36.png +0 -0
- package/lib/iconsets/streamline/light/icon-37.png +0 -0
- package/lib/iconsets/streamline/light/icon-38.png +0 -0
- package/lib/iconsets/streamline/light/icon-39.png +0 -0
- package/lib/iconsets/streamline/light/icon-4.png +0 -0
- package/lib/iconsets/streamline/light/icon-40.png +0 -0
- package/lib/iconsets/streamline/light/icon-41.png +0 -0
- package/lib/iconsets/streamline/light/icon-42.png +0 -0
- package/lib/iconsets/streamline/light/icon-43.png +0 -0
- package/lib/iconsets/streamline/light/icon-44.png +0 -0
- package/lib/iconsets/streamline/light/icon-45.png +0 -0
- package/lib/iconsets/streamline/light/icon-46.png +0 -0
- package/lib/iconsets/streamline/light/icon-47.png +0 -0
- package/lib/iconsets/streamline/light/icon-48.png +0 -0
- package/lib/iconsets/streamline/light/icon-49.png +0 -0
- package/lib/iconsets/streamline/light/icon-5.png +0 -0
- package/lib/iconsets/streamline/light/icon-50.png +0 -0
- package/lib/iconsets/streamline/light/icon-6.png +0 -0
- package/lib/iconsets/streamline/light/icon-7.png +0 -0
- package/lib/iconsets/streamline/light/icon-8.png +0 -0
- package/lib/iconsets/streamline/light/icon-9.png +0 -0
- package/lib/index.less +5 -0
- package/lib/js/captcha.js +182 -0
- package/lib/js/constants.js +61 -0
- package/lib/js/fetch.js +51 -0
- package/lib/js/ui.js +117 -0
- package/lib/js/utils.js +159 -0
- package/lib/js/widget.js +624 -0
- package/lib/less/animations.less +45 -0
- package/lib/less/structure.less +259 -0
- package/lib/less/variables.less +2 -0
- package/lib/less/variants/dark.less +62 -0
- package/lib/less/variants/light.less +66 -0
- package/lib/placeholder.png +0 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-present Joffrey Demetz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# JiZy Captcha
|
|
2
|
+
|
|
3
|
+
Frontend assets (JS + CSS + icons) for JdzCaptcha — an icon-based CAPTCHA where users select the least-displayed icon in a randomized grid. No distorted text.
|
|
4
|
+
|
|
5
|
+
This package is the client-side companion to the PHP server library [JdzCaptcha](https://jdz.joffreydemetz.com/jdzcaptcha).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install jdzcaptcha
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What's in the package
|
|
14
|
+
|
|
15
|
+
- `dist/public/js/jdzcaptcha.min.js` — client script
|
|
16
|
+
- `dist/public/css/jdzcaptcha.min.css` — stylesheet
|
|
17
|
+
- `dist/assets/jdzcaptcha/` — icon series and placeholder
|
|
18
|
+
- `lib/` — Less sources and icon sets for custom builds
|
|
19
|
+
- `cli/jpack.js`, `config/` — jpack build entrypoint and templates
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Include the built CSS and JS in your page, and add a container where the captcha should render:
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<link rel="stylesheet" href="/css/jdzcaptcha.min.css">
|
|
27
|
+
<script src="/js/jdzcaptcha.min.js"></script>
|
|
28
|
+
|
|
29
|
+
<div class="jdzc" data-series="streamline" data-theme="light"></div>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The server-side PHP library issues the challenge and validates the submission. See the [JdzCaptcha docs](https://jdz.joffreydemetz.com/jdzcaptcha) for full integration.
|
|
33
|
+
|
|
34
|
+
## Icon series & variants
|
|
35
|
+
|
|
36
|
+
Icons are organized as `{series}/{variant}`. The package ships with one series — **streamline** (50 icons, light variant only: black icons on a clear background). Dark-variant and additional series can be dropped into `lib/iconsets/{series}/{variant}/` for a custom build.
|
|
37
|
+
|
|
38
|
+
Select the iconset on the container via `data-series` and `data-theme`:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<div class="jdzc" data-series="streamline" data-theme="light"></div>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Custom build
|
|
45
|
+
|
|
46
|
+
The package ships with [jizy-packer](https://jizy.joffreydemetz.com/jizy-packer) scripts:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm run jpack:dist # build into dist/
|
|
50
|
+
npm run jpack:build # build into build/ with custom json config
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT — Joffrey Demetz
|
package/cli/jpack.js
ADDED
package/config/jpack.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
LogMe,
|
|
6
|
+
jPackConfig,
|
|
7
|
+
generateLessVariablesFromConfig,
|
|
8
|
+
deleteLessVariablesFile
|
|
9
|
+
} from 'jizy-packer';
|
|
10
|
+
|
|
11
|
+
function availableIconsets() {
|
|
12
|
+
const iconsPath = path.join(jPackConfig.get('basePath'), 'lib', 'iconsets');
|
|
13
|
+
if (!fs.existsSync(iconsPath)) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const results = [];
|
|
18
|
+
fs.readdirSync(iconsPath)
|
|
19
|
+
.filter(f => fs.statSync(path.join(iconsPath, f)).isDirectory())
|
|
20
|
+
.forEach(theme => {
|
|
21
|
+
const themePath = path.join(iconsPath, theme);
|
|
22
|
+
fs.readdirSync(themePath)
|
|
23
|
+
.filter(f => fs.statSync(path.join(themePath, f)).isDirectory())
|
|
24
|
+
.forEach(variant => {
|
|
25
|
+
results.push({ theme, variant });
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return results;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const jPackData = function () {
|
|
33
|
+
const lessBuildVariablesPath = path.join(jPackConfig.get('basePath'), 'lib/less/_variables.less');
|
|
34
|
+
|
|
35
|
+
jPackConfig.sets({
|
|
36
|
+
name: 'JdzCaptcha',
|
|
37
|
+
alias: 'jdzcaptcha',
|
|
38
|
+
lessVariables: {
|
|
39
|
+
desktopBreakpoint: '900px',
|
|
40
|
+
scrollbarWidth: '17px'
|
|
41
|
+
},
|
|
42
|
+
iconsets: []
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
jPackConfig.set('onCheckConfig', () => {
|
|
46
|
+
// iconsets are theme/variant names (native or consumer-specific).
|
|
47
|
+
// Native ones exist in lib/iconsets/{theme}/{variant}/ and will be copied to the
|
|
48
|
+
// build output. Consumer-specific ones are skipped here — the consumer serves them
|
|
49
|
+
// from their own path (e.g. [WEBSITE]/assets/icons/{theme}/{variant}/).
|
|
50
|
+
let iconsets = jPackConfig.get('iconsets') ?? [];
|
|
51
|
+
if (iconsets.length === 0) {
|
|
52
|
+
iconsets = [{ theme: 'streamline', variant: 'light' }];
|
|
53
|
+
LogMe.log('No iconsets specified — defaulting to streamline/light');
|
|
54
|
+
}
|
|
55
|
+
jPackConfig.set('iconsets', iconsets);
|
|
56
|
+
|
|
57
|
+
if (iconsets.length > 0) {
|
|
58
|
+
LogMe.log(`Iconsets declared: ${iconsets.map(s => s.theme + '/' + s.variant).join(', ')}`);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
jPackConfig.set('onGenerateBuildJs', (code) => {
|
|
63
|
+
LogMe.log('Build lib/less/_variables.less');
|
|
64
|
+
const lessVariables = jPackConfig.get('lessVariables') ?? {};
|
|
65
|
+
const lessOriginalVariablesPath = path.join(jPackConfig.get('basePath'), 'lib/less/variables.less');
|
|
66
|
+
generateLessVariablesFromConfig(lessOriginalVariablesPath, lessBuildVariablesPath, lessVariables);
|
|
67
|
+
return code;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
jPackConfig.set('onGenerateWrappedJs', (wrapped) => wrapped);
|
|
71
|
+
|
|
72
|
+
jPackConfig.set('onPacked', () => {
|
|
73
|
+
const targetPath = jPackConfig.get('targetPath');
|
|
74
|
+
const basePath = jPackConfig.get('basePath');
|
|
75
|
+
const iconsets = jPackConfig.get('iconsets') ?? [];
|
|
76
|
+
const publicPath = path.join(targetPath, 'public');
|
|
77
|
+
const assetsPath = path.join(targetPath, 'assets', 'jdzcaptcha');
|
|
78
|
+
const nativeIconsPath = path.join(basePath, 'lib', 'iconsets');
|
|
79
|
+
|
|
80
|
+
// Move js/, css/ into public/
|
|
81
|
+
fs.mkdirSync(publicPath, { recursive: true });
|
|
82
|
+
|
|
83
|
+
for (const folder of ['js', 'css']) {
|
|
84
|
+
const src = path.join(targetPath, folder);
|
|
85
|
+
if (fs.existsSync(src)) {
|
|
86
|
+
const dest = path.join(publicPath, folder);
|
|
87
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
88
|
+
fs.readdirSync(src).forEach(file => {
|
|
89
|
+
fs.renameSync(path.join(src, file), path.join(dest, file));
|
|
90
|
+
});
|
|
91
|
+
fs.rmdirSync(src);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Always copy placeholder.png (needed by the PHP backend regardless of iconsets).
|
|
96
|
+
fs.mkdirSync(assetsPath, { recursive: true });
|
|
97
|
+
const placeholderSrc = path.join(basePath, 'lib', 'placeholder.png');
|
|
98
|
+
if (fs.existsSync(placeholderSrc)) {
|
|
99
|
+
fs.copyFileSync(placeholderSrc, path.join(assetsPath, 'placeholder.png'));
|
|
100
|
+
LogMe.log('Copied placeholder.png to assets/jdzcaptcha/');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Copy native iconsets into assets/jdzcaptcha/{theme}/{variant}/ (consumer-specific
|
|
104
|
+
// iconsets are skipped — the consumer serves those from their own path).
|
|
105
|
+
const nativeSets = availableIconsets();
|
|
106
|
+
const nativeSelected = iconsets.filter(set =>
|
|
107
|
+
nativeSets.some(ok => ok.theme === set.theme && ok.variant === set.variant)
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
for (const { theme, variant } of nativeSelected) {
|
|
111
|
+
const srcDir = path.join(nativeIconsPath, theme, variant);
|
|
112
|
+
const destDir = path.join(assetsPath, theme, variant);
|
|
113
|
+
|
|
114
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
115
|
+
fs.readdirSync(srcDir)
|
|
116
|
+
.filter(file => path.extname(file).toLowerCase() === '.png')
|
|
117
|
+
.forEach(file => {
|
|
118
|
+
fs.copyFileSync(path.join(srcDir, file), path.join(destDir, file));
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
LogMe.log(`Copied native iconset: ${theme}/${variant}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Clean up generated LESS variables
|
|
125
|
+
deleteLessVariablesFile(lessBuildVariablesPath);
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export default jPackData;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*! JdzCaptcha v@VERSION | MIT | @DATE | [@BUNDLE] */
|
|
2
|
+
(function (global) {
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
if (typeof global !== "object" || !global || !global.document) {
|
|
6
|
+
throw new Error("JdzCaptcha requires a window with a document");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (typeof global.JdzCaptcha !== "undefined") {
|
|
10
|
+
throw new Error("JdzCaptcha is already defined");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @CODE
|
|
14
|
+
|
|
15
|
+
global.JdzCaptcha = JdzCaptcha;
|
|
16
|
+
})(typeof window !== "undefined" ? window : this);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@-webkit-keyframes jdzc-breath{0%{border-color:#11243c;transform:scale(1) translateZ(0)}25%{border-color:#8e8a94;transform:scale(.8) translateZ(0)}50%{border-color:#11243c;transform:scale(1) translateZ(0)}75%{border-color:#8e8a94;transform:scale(.8) translateZ(0)}to{border-color:#11243c;transform:scale(1) translateZ(0)}}@keyframes jdzc-breath{0%{border-color:#11243c;transform:scale(1) translateZ(0)}25%{border-color:#8e8a94;transform:scale(.8) translateZ(0)}50%{border-color:#11243c;transform:scale(1) translateZ(0)}75%{border-color:#8e8a94;transform:scale(.8) translateZ(0)}to{border-color:#11243c;transform:scale(1) translateZ(0)}}.jdzc{border-radius:8px;font-family:inherit;height:auto;line-height:1;margin-left:auto;margin-right:auto;max-width:330px;min-height:50px;position:relative;text-rendering:optimizeLegibility;text-shadow:none;user-select:none;width:99%}.jdzc,.jdzc *{-webkit-font-smoothing:antialiased}.jdzc *{-webkit-tap-highlight-color:transparent;box-sizing:border-box}.jdzc ::selection{background:none!important}.jdzc a{text-decoration:none}.jdzc .jdzc-box{display:block;width:100%}.jdzc .jdzc-box-title{font-size:20px;font-weight:700;text-transform:uppercase;top:8px}.jdzc .jdzc-box-subtitle,.jdzc .jdzc-box-title{display:inline-block;left:0;position:absolute;right:0;width:100%}.jdzc .jdzc-box-subtitle{font-size:12px;top:35px}.jdzc .jdzc-box-h{display:block;height:auto;padding:0 10px}.jdzc .jdzc-box-h span{cursor:default;display:block;font-size:11px;font-weight:700;line-height:14px;padding:6px 0;text-align:center}.jdzc .jdzc-box-h span::selection{background:none!important}.jdzc .jdzc-box-b{box-sizing:initial;display:block;height:50px;min-height:50px;overflow:hidden;padding:2px 4px;position:relative;text-align:center}.jdzc .jdzc-box-icons{background-position:50% 50%;background-repeat:no-repeat;height:50px;position:relative;z-index:1}.jdzc .jdzc-box-selection{bottom:0;cursor:none;height:50px;left:0;margin:2px 4px;position:absolute;right:0;top:2px;z-index:999}.jdzc .jdzc-box-selection>i{background:#52b3d9;border-radius:100%;content:"";display:none;height:14px;position:absolute;width:14px}.jdzc .jdzc-box-icons,.jdzc .jdzc-box-selection{margin:0 auto;max-width:320px;width:100%}.jdzc .jdzc-box-info{bottom:4px;font-size:9px;position:absolute;right:6px}.jdzc .jdzc-box-info:hover{text-decoration:underline}.jdzc .jdzc-box-b .jdzc-loader{animation:jdzc-breath 2s ease-in-out infinite;border:6px solid #52b3d9;border-radius:100%;bottom:0;box-sizing:border-box;height:34px;left:0;margin:auto;position:absolute;right:0;top:0;width:34px;z-index:10}.jdzc .jdzc-box-b.jdzc-opacity>div:not(.jdzc-loader){cursor:default;opacity:.15;pointer-events:none}.jdzc .jdzc-box-b.jdzc-opacity>div:not(.jdzc-loader):after,.jdzc .jdzc-box-b.jdzc-opacity>div:not(.jdzc-loader):hover:after{content:none}.jdzc .jdzc-box-checkmark{background-image:url("data: image/svg+xml,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg enable-background='new 0 0 98.5 98.5' version='1.1' viewBox='0 0 98.5 98.5' xml: space='preserve' xmlns='http: //www.w3.org/2000/svg'%3E%3Cpath class='checkmark' d='M81.7,17.8C73.5,9.3,62,4,49.2,4 C24.3,4,4,24.3,4,49.2s20.3,45.2,45.2,45.2s45.2-20.3,45.2-45.2c0-8.6-2.4-16.6-6.5-23.4l0,0L45.6,68.2L24.7,47.3' fill='none' stroke-miterlimit='10' stroke-width='8' stroke='none'/%3E%3C/svg%3E");height:28px;left:15px;position:absolute;top:13px;width:28px}.jdzc .jdzc-box-f{cursor:default;display:block!important;font-size:9px;padding:3px;text-align:center}.jdzc .jdzc-box-f>span a{text-align:center;text-decoration:none}.jdzc .jdzc-box-f>span a,.jdzc .jdzc-box-f>span a:hover{transition:color .1s linear}.jdzc .jdzc-box-f-hide{visibility:hidden}.jdzc .jdzc-fields,.jdzc .jdzc-fields input[type=text]{display:none;visibility:hidden}.jdzc.jdzc-init{transition:background .15s linear}.jdzc.jdzc-init .jdzc-box-b{cursor:pointer}.jdzc.jdzc-init .jdzc-box-circle{animation:jdzc-breath 5s linear infinite;border:6px solid #11243c;border-radius:100%;height:28px;left:15px;position:absolute;top:13px;transition:opacity .1s linear;width:28px}.jdzc.jdzc-init:hover{transition:background .15s linear}.jdzc.jdzc-init:hover .jdzc-box-circle{opacity:.75;transition:opacity .1s linear}.jdzc.jdzc-error,.jdzc.jdzc-success{cursor:default}.jdzc.jdzc-init .jdzc-box-title,.jdzc.jdzc-success .jdzc-box-title{font-size:15px;overflow:hidden;padding-left:60px;padding-right:20px;text-align:left;text-overflow:ellipsis;top:19px;white-space:nowrap}.jdzc.jdzc-theme-light{background:#fafafa;border:1px solid #d8d8d8}.jdzc.jdzc-theme-light .jdzc-box-subtitle{color:#9e9e9e}.jdzc.jdzc-theme-light .jdzc-box-h{border-bottom:2px solid #d8d8d8}.jdzc.jdzc-theme-light .jdzc-box-h span{color:#1d1d1d}.jdzc.jdzc-theme-light .jdzc-box-f{border-top:2px solid #d8d8d8;color:#a7a7a7;padding-bottom:5px;padding-top:6px}.jdzc.jdzc-theme-light .jdzc-box-f>span{color:#448aff}.jdzc.jdzc-theme-light .jdzc-box-f>span a{color:#448aff;font-weight:700;text-transform:uppercase}.jdzc.jdzc-theme-light .jdzc-box-f>span a:hover{color:#74a8ff}.jdzc.jdzc-theme-light .jdzc-box-info a,.jdzc.jdzc-theme-light .jdzc-box-info span{color:#afafaf}.jdzc.jdzc-theme-light.jdzc-init:hover{background:#f1f1f1}.jdzc.jdzc-theme-light.jdzc-init .jdzc-box-title{color:#464646}.jdzc.jdzc-theme-light.jdzc-success .jdzc-box-checkmark svg{stroke:#5bd25b}.jdzc.jdzc-theme-light.jdzc-success .jdzc-box-title{color:#5bd25b}.jdzc.jdzc-theme-light.jdzc-error .jdzc-box-title{color:#ef5858}.jdzc.jdzc-theme-dark{background:#4c4c4c;border:1px solid #404040}.jdzc.jdzc-theme-dark .jdzc-box-subtitle{color:#b1b1b1}.jdzc.jdzc-theme-dark .jdzc-box-h{border-bottom:2px solid #404040}.jdzc.jdzc-theme-dark .jdzc-box-h span{color:#dadada}.jdzc.jdzc-theme-dark .jdzc-box-f{border-top:2px solid #404040;color:#a7a7a7;padding-bottom:5px;padding-top:6px}.jdzc.jdzc-theme-dark .jdzc-box-f>span a{color:#fff;font-weight:700;text-transform:uppercase}.jdzc.jdzc-theme-dark .jdzc-box-f>span a:hover{color:#f0f0f0}.jdzc.jdzc-theme-dark .jdzc-box-info a,.jdzc.jdzc-theme-dark .jdzc-box-info span{color:#b1b1b1}.jdzc.jdzc-theme-dark.jdzc-init:hover{background:#454545}.jdzc.jdzc-theme-dark.jdzc-init .jdzc-box-title{color:#dadada}.jdzc.jdzc-theme-dark.jdzc-success .jdzc-box-checkmark svg{stroke:#93d293}.jdzc.jdzc-theme-dark.jdzc-success .jdzc-box-title{color:#93d293}.jdzc.jdzc-theme-dark.jdzc-error .jdzc-box-title{color:#ef5858}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! JdzCaptcha v2.0.0 | MIT | 2026-04-12T20:06Z | [default] */
|
|
2
|
+
!function(e){"use strict";if("object"!=typeof e||!e||!e.document)throw new Error("JdzCaptcha requires a window with a document");if(void 0!==e.JdzCaptcha)throw new Error("JdzCaptcha is already defined");var t=function(){const e="jdzc-opacity",t="jdzc-error",i="jdzc-success",s="jdzc-init",n="jdzc-loader",o="jdzc-box-selection",r="jdzc-box",a="jdzc-box-h",d="jdzc-box-b",c="jdzc-box-f",l="jdzc-box-circle",h="jdzc-box-info",u="jdzc-box-title",p="jdzc-box-icons",m="jdzc-box-checkmark",g="jdzc-box-subtitle",v="jdzc-fields",f={path:"/captcha/request/",token:!0,fontFamily:"",credits:"show",series:"streamline",theme:"light",security:{clickDelay:1500,hoverDetection:!0,enableInitialMessage:!0,initializeDelay:500,selectionResetDelay:3e3,loadingAnimationDelay:1e3,invalidateTime:12e4},fields:{selection:"_jdzc-hf-se",id:"_jdzc-hf-id",honeypot:"_jdzc-hf-hp",token:"_jdzc-token"},messages:{initialization:{loading:"Loading challenge...",verify:"Verify that you are human."},header:"Select the image displayed the <u>least</u> amount of times",correct:"Verification complete.",incorrect:{title:"Uh oh.",subtitle:"You’ve selected the wrong image."},timeout:{title:"Please wait 60 sec.",subtitle:"You made too many incorrect selections."}}},y={extend:(e={},...t)=>(t.forEach(t=>{t&&"object"==typeof t&&Object.keys(t).forEach(i=>{"object"!=typeof t[i]||Array.isArray(t[i])?e[i]=t[i]:e[i]=y.extend(e[i]||{},t[i])})}),e),thrown:e=>{window.JdzCaptcha&&window.JdzCaptcha.debugMode&&("string"==typeof e?console.warn("JdzCaptcha ERROR:",e):e instanceof Error?console.error("JdzCaptcha ERROR:",e.message):"object"==typeof e?console.dir("JdzCaptcha ERROR:",e):console.warn("JdzCaptcha ERROR:",e))},trigger:(e,t,i)=>{const s=new CustomEvent(t,{detail:i});e.dispatchEvent(s)},empty:e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},detectOffset:e=>{if(!e.getClientRects().length)return{top:0,left:0};const{top:t,left:i}=e.getBoundingClientRect(),{pageYOffset:s,pageXOffset:n}=e.ownerDocument.defaultView;return{top:t+s,left:i+n}},width:e=>parseFloat(getComputedStyle(e,null).width.replace("px","")),debug:(...e)=>{if(!(window.JdzCaptcha&&window.JdzCaptcha.debugMode))return;const t="string"==typeof e[e.length-1]&&console[e[e.length-1]]?e.pop():"log";e.forEach(e=>{"object"==typeof e||Array.isArray(e)?("warn"!==t&&"error"!==t||console[t]("JdzCaptcha: "+t.toUpperCase()+":"),console.dir(e)):"dir"===t?console.log("JdzCaptcha: "+e):console[t](e)})},warn:(...e)=>{y.debug(...e,"warn")},error:(...e)=>{y.debug(...e,"error")},createPayload:e=>btoa(JSON.stringify({...e,ts:Date.now()})),isBase64:e=>{try{return btoa(atob(e))===e}catch(e){return!1}},clearInvalidationTimeout:e=>{e&&clearTimeout(e)}},b={buildCredits:e=>e.credits?"<span"+("hide"===e.credits?' style="display:none;"':"")+'><a href="https://joffreydemetz.com/jdzcaptcha" target="_blank" rel="follow" title="JdzCaptcha by Joffrey Demetz">JdzCaptcha</a> ©</span>':"",buildCaptchaInitialHolder:e=>'<div class="'+r+'"><div class="'+d+'"><div class="'+l+'"></div><div class="'+h+'">'+b.buildCredits(e)+'</div><div class="'+u+'">'+e.messages.initialization.verify+"</div></div></div>",buildCaptchaHolder:(e,t)=>'<div class="'+r+'"><div class="'+a+'"><span>'+e.messages.header+'</span></div><div class="'+d+'"><div class="'+p+'"></div></div><div class="'+c+'">'+b.buildCredits(e)+'</div><div class="'+v+'"><input type="hidden" name="jdzc['+e.fields.selection+']" required /><input type="hidden" name="jdzc['+e.fields.id+']" value="'+t+'" required /><input type="hidden" name="jdzc['+e.fields.honeypot+']" required /></div></div>',buildCheckmark:()=>'<svg viewBox="0 0 98.5 98.5" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path class="checkmark" d="M81.7 17.8C73.5 9.3 62 4 49.2 4 24.3 4 4 24.3 4 49.2s20.3 45.2 45.2 45.2 45.2-20.3 45.2-45.2c0-8.6-2.4-16.6-6.5-23.4L45.6 68.2 24.7 47.3" fill="none" stroke-miterlimit="10" stroke-width="8" /></svg>',buildValidSelectionMessage:e=>'<div class="'+u+'">'+e.messages.correct+'</div><div class="'+m+'">'+b.buildCheckmark()+"</div>",buildInvalidSelectionMessage:e=>'<div class="'+u+'">'+e.messages.incorrect.title+'</div><div class="'+g+'">'+e.messages.incorrect.subtitle+"</div>",buildErrorMessage:(e,t)=>'<div class="'+u+'"> '+e+'</div><div class="'+g+'">'+t+"</div>",addLoadingSpinner:t=>{t.classList.add(e),t.querySelector(`.${n} `)||t.insertAdjacentHTML("beforeend",`<div class="${n}"></div>`)},removeLoadingSpinner:t=>{t.classList.remove(e),t.querySelector(`.${n} `)&&t.querySelector(`.${n} `).remove()},removeLoadingSpinnerOnImageLoad:(e,t)=>{const i=e.style.backgroundImage.match(/\((.*?)\)/)?.[1]?.replace(/(['"])/g,"");if(!i)return;const s=new Image;s.onload=()=>t(),s.src=i}},z=async(e={})=>{const{url:t,type:i="GET",headers:s={},data:n,success:o,error:r}=e,a={method:i.toUpperCase(),headers:{"X-Requested-With":"XMLHttpRequest",...s}};n&&(n instanceof FormData?a.body=n:(a.headers["Content-Type"]="application/json",a.body=JSON.stringify(n)));try{const e=await fetch(t,a);if(!e.ok)throw new Error(`Request failed with status ${e.status}`);const i=await e.text();let s;try{s=JSON.parse(i)}catch(e){s=i}o&&o(s)}catch(e){r&&r(e)}};class ${constructor(e,t){return e?t.path?e.dataset.jdzcId?(y.warn("The widget is already initialized."),null):(this.id=this.generateCaptchaId(),this.$element=e,this.$element.dataset.jdzcId=this.id,this.$iconHolder=null,this.token=null,this.startedInitialization=!1,this.invalidateTimeoutId=null,this.captchaImageWidth=0,this.generated=!1,this.generatedInTime=0,this.hovering=!1,this.submitting=!1,this.options=t,void this.generate()):(this.error('The option "path" has not been set.'),null):(y.warn("Element is not a valid DOM element."),null)}generate(){if(this.generated)return void y.warn("The widget "+this.id+" has already been generated.");const e=this.$element.closest("form");if(e){const t=e.querySelector(`input[name = "jdzc[${this.options.fields.token}]"]`);this.token=t?t.value:null}if(!this.token)return void y.error("CSRF token is missing or invalid for widget["+this.id+"]. Ensure the form contains a valid input field for the token.");if(this.$element.setAttribute("data-theme",this.options.theme),this.$element.setAttribute("data-series",this.options.series),this.$element.classList.add(`jdzc-theme-${this.options.theme}`),this.options.fontFamily&&(this.$element.style.fontFamily=this.options.fontFamily),!this.startedInitialization&&this.options.security.enableInitialMessage)return this.startedInitialization=!0,this.$element.classList.add(s),this.$element.classList.remove(t,i),this.$element.innerHTML=b.buildCaptchaInitialHolder(this.options),void this.$element.addEventListener("click",()=>{this.$element.classList.remove(s),this.generate()},{once:!0});this.generated||(this.$element.innerHTML=b.buildCaptchaHolder(this.options,this.id)),this.$iconHolder=this.$element.querySelector(`.${d}`),b.addLoadingSpinner(this.$iconHolder),this.options.security.loadingAnimationDelay&&this.options.security.loadingAnimationDelay>0&&!this.options.security.enableInitialMessage?setTimeout(()=>this.load(),this.options.security.loadingAnimationDelay):this.load();const n=this.$element.querySelector(`.${o}`);n&&n.addEventListener("click",e=>{const t=n.getBoundingClientRect(),i=e.clientX-t.left,s=e.clientY-t.top;this.submitIconSelection(i,s)}),this.generated=!0}load(){if(this.generated)return;const e=y.createPayload({i:this.id,a:1,t:(this.$element.getAttribute("data-series")||"streamline")+"/"+(this.$element.getAttribute("data-theme")||"light"),tk:this.token});z({url:this.options.path,type:"POST",headers:this.createHeaders(this.token),data:{payload:e},success:e=>{if(e&&"string"==typeof e&&y.isBase64(e)){const t=JSON.parse(atob(e));if(t.error)return void b.processCaptchaRequestError(t.error,t.data);const i=y.createPayload({i:this.id,tk:this.token}),s=this.options.path.indexOf("?")>-1?"&":"?",n=this.$iconHolder.querySelector(`.${p}`);n.style.backgroundImage=`url(${this.options.path}${s}payload=${i})`,b.removeLoadingSpinnerOnImageLoad(n,()=>b.removeLoadingSpinner(this.$iconHolder)),n.parentNode.insertAdjacentHTML("beforeend",`<div class="${o}"><i></i></div>`),this.$iconHolder.querySelector(`.${o} > i`),this.registerSelectionEvents(),this.generated||y.trigger(this.$element,"jdzc.init",{captchaId:this.id,options:this.options});const r=this.$iconHolder.querySelector(`.${o}`);return this.captchaImageWidth=y.width(r),this.generatedInTime=new Date,this.generated=!0,void(this.invalidateTimeoutId=setTimeout(()=>this.invalidateSession(!0),this.options.security.invalidateTime))}this.setCaptchaError("The JdzCaptcha could not be loaded.","Invalid data was returned by the captcha back-end service. Make sure JdzCaptcha is installed/configured properly.")},error:()=>this.showIncorrectIconMessage(this.options.messages.incorrect.title,this.options.messages.incorrect.subtitle,!0)}),this.generated=!0}reset(){y.clearInvalidationTimeout(this.invalidateTimeoutId),this.startedInitialization=!1,this.generated=!1,y.trigger(this.$element,"jdzc.reset",{captchaId:this.id}),this.generate()}invalidateSession(e=!0){if(this.generated=!1,this.startedInitialization=!1,e){const e=y.createPayload({i:this.id,a:3,tk:this.token});z({url:this.options.path,type:"POST",headers:this.createHeaders(this.token),data:{payload:e},success:()=>{y.trigger(this.$element,"jdzc.invalidated",{captchaId:this.id}),this.resetCaptchaHolder()},error:()=>{this.setCaptchaError("The JdzCaptcha could not be reset.","Invalid data was returned by the captcha back-end service. Make sure JdzCaptcha is installed/configured properly.")}})}else this.resetCaptchaHolder()}submitIconSelection(e,t){if(!this.submitting&&void 0!==e&&void 0!==t){this.submitting=!0,y.clearInvalidationTimeout(this.invalidateTimeoutId),e=Math.round(e),t=Math.round(t);const i=this.$element.querySelector(`input[name = "jdzc[${this.options.fields.selection}]"]`),s=this.$element.querySelector(`input[name = "jdzc[${this.options.fields.id}]"]`);i&&i.setAttribute("value",[e,t,this.captchaImageWidth].join(",")),s&&s.setAttribute("value",this.id);const n=this.$iconHolder.querySelector(`.${o} > i`);n&&(n.style.display="none");const r=y.createPayload({i:this.id,x:e,y:t,w:this.captchaImageWidth,a:2,tk:this.token});z({url:this.options.path,type:"POST",headers:this.createHeaders(this.token),data:{payload:r},success:e=>{this.submitting=!1,!0===e.success?this.showCompletionMessage():this.showIncorrectIconMessage()},error:()=>{this.submitting=!1,this.setCaptchaError("The JdzCaptcha selection could not be submitted.","Invalid data was returned by the captcha back-end service. Make sure JdzCaptcha is installed/configured properly.")}})}}showCompletionMessage(){this.$element.classList.add(i),this.$element.classList.remove(t),this.$iconHolder.innerHTML=b.buildValidSelectionMessage(this.options),this.unregisterSelectionEvents(),y.trigger(this.$element,"jdzc.success",{captchaId:this.id}),setTimeout(()=>this.reset(),this.options.security.selectionResetDelay)}showIncorrectIconMessage(){this.$element.classList.add(t),this.$element.classList.remove(i),this.$iconHolder.innerHTML=b.buildInvalidSelectionMessage(this.options),y.trigger(this.$element,"jdzc.error",{captchaId:this.id}),setTimeout(()=>this.reset(),this.options.security.selectionResetDelay)}setCaptchaError(e,t="",i=!0){const s=window.JdzCaptcha&&window.JdzCaptcha.debugMode,n=s?"JdzCaptcha error":this.messages.incorrect.title,o=s?e:this.messages.incorrect.subtitle,r=!s;this.showIncorrectIconMessage(n,o,r),y.error(t||e),i&&y.trigger(this.$element,"jdzc.error",{captchaId:this.id})}processCaptchaRequestError(e,t){switch(e=parseInt(e)){case 1:this.showIncorrectIconMessage(this.options.messages.timeout.title,this.options.messages.timeout.subtitle,!1);const e=this.$element.querySelector(`.${a}`);e.parentNode.removeChild(e),y.trigger(this.$element,"jdzc.timeout",{captchaId:this.id}),setTimeout(()=>this.invalidateSession(!1),t);break;case 2:this.setCaptchaError("The captcha token is missing or is incorrect.","A server request was made without including a captcha token, however this option is enabled.");break;default:this.setCaptchaError("An unexpected error occurred.","An unexpected error occurred while JdzCaptcha performed an action.")}}showIncorrectIconMessage(i=null,s=null,n=!0){i=i||this.options.messages.incorrect.title,s=s||this.options.messages.incorrect.subtitle,this.$iconHolder.classList.remove(e),this.$element.classList.remove(e),this.unregisterSelectionEvents(),this.$element.classList.add(t),this.$iconHolder.innerHTML=b.buildErrorMessage(i,s),this.submitting=!1,y.trigger(this.$element,"jdzc.error",{captchaId:this.id}),n?setTimeout(()=>this.reset(),this.options.security.selectionResetDelay):y.trigger(this.$element,"jdzc.timeout",{captchaId:this.id})}resetCaptchaHolder(){this.$element.classList.remove(t);const e=this.$element.querySelector(`input[name = "jdzc[${this.options.fields.selection}]"]`);e&&e.setAttribute("value",null),y.empty(this.$iconHolder),this.$iconHolder.insertAdjacentHTML("beforeend",`<div class="${p}"></div>`),this.generate(),y.trigger(this.$element,"jdzc.refreshed",{captchaId:this.id})}registerSelectionEvents(){const e=this.$element.querySelector(`.${o}`);if(!e||e._jdzc_listeners)return;const t={click:this.mouseClickEvent.bind(this),mousemove:this.mouseMoveEvent.bind(this),mouseenter:this.mouseEnterEvent.bind(this),mouseleave:this.mouseLeaveEvent.bind(this)};e._jdzc_listeners=t,Object.entries(t).forEach(([t,i])=>{e.addEventListener(t,i)})}unregisterSelectionEvents(){const e=this.$element.querySelector(`.${o}`);e&&e._jdzc_listeners&&(Object.entries(e._jdzc_listeners).forEach(([t,i])=>{e.removeEventListener(t,i)}),delete e._jdzc_listeners)}moveCustomCursor(e){if(!e.currentTarget)return;const t=e.currentTarget.getBoundingClientRect(),i=Math.round(e.clientX-t.left),s=Math.round(e.clientY-t.top),n=this.$iconHolder.querySelector(`.${o} > i`);n&&(n.style.left=i-8+"px",n.style.top=s-7+"px")}mouseClickEvent(e){if(!this.generated||this.submitting)return;if(new Date-this.generatedInTime<=this.options.security.clickDelay)return;const t=e.currentTarget.getBoundingClientRect(),i=e.clientX-t.left,s=e.clientY-t.top;i&&s&&this.submitIconSelection(i,s)}mouseMoveEvent(e){this.hovering&&!this.submitting&&this.generated&&this.moveCustomCursor(e)}mouseEnterEvent(e){const t=this.$iconHolder.querySelector(`.${o} > i`);t&&(t.style.display="inline"),this.hovering=!0,this.moveCustomCursor(e)}mouseLeaveEvent(){const e=this.$iconHolder.querySelector(`.${o} > i`);e&&(e.style.display="none"),this.hovering=!1}createHeaders(e){return e?{"X-JdzCaptcha-Token":e}:{}}generateCaptchaId(){return Math.floor(Math.random()*(10**13-1))}}return{NAME:"JdzCaptcha",VERSION:"2.0.0",debugMode:window.JDZ_DEBUG_MODE||!1,debug:y.debug,config:null,initialized:!1,instances:[],initialize:function(e,t=null,i={}){const s=e=>{e&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this.loadFromSelector(e)}):this.loadFromSelector(e))};return this.initialized?(y.warning("Already initialized. Cannot use Captcha.initliaze() twice."),s(t),this):e?(z({url:e,type:"POST",success:e=>{this.config=y.extend({},f,i||{},e||{}),this.initialized=!0,s(t)},error:()=>{y.error("Failed to load configuration. Using default options."),this.config=y.extend({},f,i||{}),this.initialized=!0,s(t)}}),this):(y.error("LoaderUrl is required to initialize the configuration."),this.config=y.extend({},f,i||{}),this.initialized=!0,s(t),this)},loadFromSelector:function(e,t={}){if(!e)return this;t=y.extend({},this.config,t||{});const i=Array.from(document.querySelectorAll(e)).map(e=>new $(e,t)).filter(e=>null!==e);return 0===i.length?(y.warn("No valid elements found for the provided selector:",e),this):(this.instances=[...this.instances,...i],t.callbacks&&i.forEach(e=>{Object.entries(t.callbacks).forEach(([t,i])=>{e.$element.addEventListener(t,i)})}),this)},checkIfValid:function(){return this.initialized?0!==this.instances.length||(y.warning("No instances found."),!1):(y.warning("Captcha has not been initialized."),!1)},reset:function(e=null){if(!this.checkIfValid())return y.error("Cannot reset."),this;if(!e)return this.instances.forEach(e=>{e.reset()}),this;const t=this.instances.find(t=>t.id===e);return t?t.reset():y.error(`No instance found with ID "${e}".Cannot reset.`),this},bind:function(e,t,i=null){if(!this.checkIfValid())return y.error("Cannot bind."),this;if(!i)return this.instances.forEach(i=>{i.$element.addEventListener(e,t)}),this;const s=this.instances.find(e=>e.id===i);return s?s.$element.addEventListener(e,t):y.error(`No instance found with ID "${i}".Cannot bind event.`),this}}}();e.JdzCaptcha=t}("undefined"!=typeof window?window:this);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|