@prosopo/procaptcha-audio 0.2.9 → 0.2.11
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/.turbo/turbo-build$colon$cjs.log +2 -2
- package/.turbo/{turbo-build.log → turbo-build$colon$esm.log} +8 -9
- package/.turbo/turbo-build$colon$tsc.log +17 -17
- package/.turbo/turbo-build$colon$types.log +1 -0
- package/CHANGELOG.md +46 -0
- package/dist/cjs/services/Manager.cjs +1 -2
- package/dist/{services → esm/services}/Manager.js +2 -3
- package/dist/tsc/components/audioPlayer.d.ts.map +1 -0
- package/dist/tsc/components/audioPlayer.js +285 -0
- package/dist/tsc/components/audioPlayer.js.map +1 -0
- package/dist/tsc/components/procaptchaAudio.d.ts.map +1 -0
- package/dist/tsc/components/procaptchaAudio.js +4 -0
- package/dist/tsc/components/procaptchaAudio.js.map +1 -0
- package/dist/tsc/components/procaptchaWidget.d.ts.map +1 -0
- package/dist/tsc/components/procaptchaWidget.js +243 -0
- package/dist/tsc/components/procaptchaWidget.js.map +1 -0
- package/dist/tsc/errorSites.d.ts.map +1 -0
- package/dist/{errorSites.js.map → tsc/errorSites.js.map} +1 -1
- package/dist/tsc/index.d.ts.map +1 -0
- package/dist/tsc/index.js +4 -0
- package/dist/tsc/index.js.map +1 -0
- package/dist/tsc/services/Manager.d.ts.map +1 -0
- package/dist/tsc/services/Manager.js +270 -0
- package/dist/tsc/services/Manager.js.map +1 -0
- package/dist/tsc/tests/audioPlayer.unit.test.d.ts.map +1 -0
- package/dist/tsc/tests/audioPlayer.unit.test.js.map +1 -0
- package/dist/tsc/tests/domHarness.d.ts.map +1 -0
- package/dist/tsc/tests/domHarness.js.map +1 -0
- package/dist/tsc/tests/manager.unit.test.d.ts.map +1 -0
- package/dist/{tests → tsc/tests}/manager.unit.test.js +10 -3
- package/dist/tsc/tests/manager.unit.test.js.map +1 -0
- package/dist/tsc/tests/managerHarness.d.ts.map +1 -0
- package/dist/tsc/tests/managerHarness.js.map +1 -0
- package/dist/tsc/tests/procaptchaAudio.test-d.d.ts.map +1 -0
- package/dist/tsc/tests/procaptchaAudio.test-d.js.map +1 -0
- package/dist/tsc/tests/procaptchaAudio.unit.test.d.ts.map +1 -0
- package/dist/tsc/tests/procaptchaAudio.unit.test.js.map +1 -0
- package/dist/tsc/tests/procaptchaWidget.unit.test.d.ts.map +1 -0
- package/dist/tsc/tests/procaptchaWidget.unit.test.js.map +1 -0
- package/dist/tsc/tests/setup.d.ts.map +1 -0
- package/dist/tsc/tests/setup.js.map +1 -0
- package/dist/types/components/audioPlayer.d.ts +18 -0
- package/dist/types/components/audioPlayer.d.ts.map +1 -0
- package/dist/types/components/procaptchaAudio.d.ts +7 -0
- package/dist/types/components/procaptchaAudio.d.ts.map +1 -0
- package/dist/types/components/procaptchaWidget.d.ts +7 -0
- package/dist/types/components/procaptchaWidget.d.ts.map +1 -0
- package/dist/types/errorSites.d.ts +12 -0
- package/dist/types/errorSites.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/services/Manager.d.ts +10 -0
- package/dist/types/services/Manager.d.ts.map +1 -0
- package/dist/types/tests/audioPlayer.unit.test.d.ts +2 -0
- package/dist/types/tests/audioPlayer.unit.test.d.ts.map +1 -0
- package/dist/types/tests/domHarness.d.ts +20 -0
- package/dist/types/tests/domHarness.d.ts.map +1 -0
- package/dist/types/tests/manager.unit.test.d.ts +2 -0
- package/dist/types/tests/manager.unit.test.d.ts.map +1 -0
- package/dist/types/tests/managerHarness.d.ts +21 -0
- package/dist/types/tests/managerHarness.d.ts.map +1 -0
- package/dist/types/tests/procaptchaAudio.test-d.d.ts +2 -0
- package/dist/types/tests/procaptchaAudio.test-d.d.ts.map +1 -0
- package/dist/types/tests/procaptchaAudio.unit.test.d.ts +2 -0
- package/dist/types/tests/procaptchaAudio.unit.test.d.ts.map +1 -0
- package/dist/types/tests/procaptchaWidget.unit.test.d.ts +2 -0
- package/dist/types/tests/procaptchaWidget.unit.test.d.ts.map +1 -0
- package/dist/types/tests/setup.d.ts +2 -0
- package/dist/types/tests/setup.d.ts.map +1 -0
- package/package.json +17 -18
- package/dist/components/audioPlayer.d.ts.map +0 -1
- package/dist/components/audioPlayer.js.map +0 -1
- package/dist/components/procaptchaAudio.d.ts.map +0 -1
- package/dist/components/procaptchaAudio.js.map +0 -1
- package/dist/components/procaptchaWidget.d.ts.map +0 -1
- package/dist/components/procaptchaWidget.js.map +0 -1
- package/dist/errorSites.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/services/Manager.d.ts.map +0 -1
- package/dist/services/Manager.js.map +0 -1
- package/dist/tests/audioPlayer.unit.test.d.ts.map +0 -1
- package/dist/tests/audioPlayer.unit.test.js.map +0 -1
- package/dist/tests/domHarness.d.ts.map +0 -1
- package/dist/tests/domHarness.js.map +0 -1
- package/dist/tests/manager.unit.test.d.ts.map +0 -1
- package/dist/tests/manager.unit.test.js.map +0 -1
- package/dist/tests/managerHarness.d.ts.map +0 -1
- package/dist/tests/managerHarness.js.map +0 -1
- package/dist/tests/procaptchaAudio.test-d.d.ts.map +0 -1
- package/dist/tests/procaptchaAudio.test-d.js.map +0 -1
- package/dist/tests/procaptchaAudio.unit.test.d.ts.map +0 -1
- package/dist/tests/procaptchaAudio.unit.test.js.map +0 -1
- package/dist/tests/procaptchaWidget.unit.test.d.ts.map +0 -1
- package/dist/tests/procaptchaWidget.unit.test.js.map +0 -1
- package/dist/tests/setup.d.ts.map +0 -1
- package/dist/tests/setup.js.map +0 -1
- /package/dist/{_virtual → esm/_virtual}/_rolldown/runtime.js +0 -0
- /package/dist/{components → esm/components}/audioPlayer.js +0 -0
- /package/dist/{components → esm/components}/procaptchaAudio.js +0 -0
- /package/dist/{components → esm/components}/procaptchaWidget.js +0 -0
- /package/dist/{index.js → esm/index.js} +0 -0
- /package/dist/{components → tsc/components}/audioPlayer.d.ts +0 -0
- /package/dist/{components → tsc/components}/procaptchaAudio.d.ts +0 -0
- /package/dist/{components → tsc/components}/procaptchaWidget.d.ts +0 -0
- /package/dist/{errorSites.d.ts → tsc/errorSites.d.ts} +0 -0
- /package/dist/{errorSites.js → tsc/errorSites.js} +0 -0
- /package/dist/{index.d.ts → tsc/index.d.ts} +0 -0
- /package/dist/{services → tsc/services}/Manager.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/audioPlayer.unit.test.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/audioPlayer.unit.test.js +0 -0
- /package/dist/{tests → tsc/tests}/domHarness.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/domHarness.js +0 -0
- /package/dist/{tests → tsc/tests}/manager.unit.test.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/managerHarness.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/managerHarness.js +0 -0
- /package/dist/{tests → tsc/tests}/procaptchaAudio.test-d.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/procaptchaAudio.test-d.js +0 -0
- /package/dist/{tests → tsc/tests}/procaptchaAudio.unit.test.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/procaptchaAudio.unit.test.js +0 -0
- /package/dist/{tests → tsc/tests}/procaptchaWidget.unit.test.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/procaptchaWidget.unit.test.js +0 -0
- /package/dist/{tests → tsc/tests}/setup.d.ts +0 -0
- /package/dist/{tests → tsc/tests}/setup.js +0 -0
|
@@ -45,6 +45,6 @@ dist/cjs/components/procaptchaAudio.cjs 0.46 kB │ gzip: 0.22 kB
|
|
|
45
45
|
dist/cjs/index.cjs 0.58 kB │ gzip: 0.21 kB
|
|
46
46
|
dist/cjs/components/procaptchaWidget.cjs 6.83 kB │ gzip: 2.04 kB
|
|
47
47
|
dist/cjs/components/audioPlayer.cjs 8.80 kB │ gzip: 2.91 kB
|
|
48
|
-
dist/cjs/services/Manager.cjs 9.
|
|
48
|
+
dist/cjs/services/Manager.cjs 9.13 kB │ gzip: 2.55 kB
|
|
49
49
|
|
|
50
|
-
[32m✓ built in
|
|
50
|
+
[32m✓ built in 50ms[39m
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
$
|
|
2
|
-
$ vite build --config vite.esm.config.ts --mode production
|
|
1
|
+
$ vite build --config vite.esm.config.ts --mode ${NODE_ENV:-development}
|
|
3
2
|
ViteEsmConfig: .
|
|
4
3
|
{
|
|
5
4
|
tsConfigPaths: [
|
|
@@ -42,11 +41,11 @@ Bundle build started
|
|
|
42
41
|
✓ 6 modules transformed.
|
|
43
42
|
rendering chunks...
|
|
44
43
|
computing gzip size...
|
|
45
|
-
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
46
|
-
dist/components/procaptchaAudio.js 0.33 kB │ gzip: 0.19 kB
|
|
47
|
-
dist/index.js 0.37 kB │ gzip: 0.16 kB
|
|
48
|
-
dist/components/procaptchaWidget.js 6.52 kB │ gzip: 2.03 kB
|
|
49
|
-
dist/components/audioPlayer.js 8.17 kB │ gzip: 2.88 kB
|
|
50
|
-
dist/services/Manager.js 8.
|
|
44
|
+
dist/esm/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
45
|
+
dist/esm/components/procaptchaAudio.js 0.33 kB │ gzip: 0.19 kB
|
|
46
|
+
dist/esm/index.js 0.37 kB │ gzip: 0.16 kB
|
|
47
|
+
dist/esm/components/procaptchaWidget.js 6.52 kB │ gzip: 2.03 kB
|
|
48
|
+
dist/esm/components/audioPlayer.js 8.17 kB │ gzip: 2.88 kB
|
|
49
|
+
dist/esm/services/Manager.js 8.55 kB │ gzip: 2.51 kB
|
|
51
50
|
|
|
52
|
-
[32m✓ built in
|
|
51
|
+
[32m✓ built in 51ms[39m
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ tsc --build --verbose
|
|
2
|
-
|
|
2
|
+
12:57:37 PM - Projects in this build:
|
|
3
3
|
* ../../dev/config/tsconfig.json
|
|
4
4
|
* ../util/tsconfig.json
|
|
5
5
|
* ../locale/tsconfig.json
|
|
@@ -16,35 +16,35 @@ $ tsc --build --verbose
|
|
|
16
16
|
* ../procaptcha-common/tsconfig.json
|
|
17
17
|
* tsconfig.json
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
12:57:37 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/vite.esm.config.ts' is older than output '../../dev/config/dist/tsc/tsconfig.tsbuildinfo'
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
12:57:37 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/dist/tsc/tsconfig.tsbuildinfo'
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
12:57:37 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translator.ts' is older than output '../locale/dist/tsc/tsconfig.tsbuildinfo'
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
12:57:37 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/dist/tsc/tsconfig.tsbuildinfo'
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
12:57:37 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/dist/tsc/tsconfig.tsbuildinfo'
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
12:57:37 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/dist/tsc/tsconfig.tsbuildinfo'
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
12:57:37 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/dist/tsc/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
12:57:37 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/dist/tsc/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
12:57:37 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/theme.ts' is older than output '../widget-skeleton/dist/tsc/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
12:57:37 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/sources/webgl.ts' is older than output '../fingerprintjs/dist/tsc/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
12:57:38 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.test.ts' is older than output '../fingerprint/dist/tsc/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
12:57:38 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/dist/tsc/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
12:57:38 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/dist/tsc/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
12:57:38 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/tests/protectSession.test.ts' is older than output '../procaptcha-common/dist/tsc/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
12:57:38 PM - Project 'tsconfig.json' is out of date because output file 'dist/tsc/tsconfig.tsbuildinfo' does not exist
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
12:57:38 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-audio/tsconfig.json'...
|
|
50
50
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ tsc --project tsconfig.types.json
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @prosopo/procaptcha-audio
|
|
2
2
|
|
|
3
|
+
## 0.2.11
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 76b6edd: The widget now tells the provider which bundle it is and where it was loaded from, on every request:
|
|
7
|
+
|
|
8
|
+
- `X-Prosopo-Bundle-Version`: the release the bundle was built from, or `dev` for a local build.
|
|
9
|
+
- `X-Prosopo-Bundle-Origin`: the origin the widget's code came from. `https://js.prosopo.io` is the hosted bundle. Anything else is a site serving its own copy, or building our npm packages into its app.
|
|
10
|
+
|
|
11
|
+
Providers store request headers on the session and in the request logs, so together with the site key these show which sites self-host and which version each one runs.
|
|
12
|
+
|
|
13
|
+
The provider now allows both headers in CORS. Every provider must run this version before the new bundle is published to the CDN: a widget sending these headers to an older provider fails the browser's preflight check and cannot load a captcha.
|
|
14
|
+
- Updated dependencies [1966fc1]
|
|
15
|
+
- Updated dependencies [c69b636]
|
|
16
|
+
- Updated dependencies [78107d9]
|
|
17
|
+
- Updated dependencies [d6cc6fe]
|
|
18
|
+
- Updated dependencies [f13677e]
|
|
19
|
+
- Updated dependencies [77bd891]
|
|
20
|
+
- Updated dependencies [76b6edd]
|
|
21
|
+
- @prosopo/common@3.3.2
|
|
22
|
+
- @prosopo/locale@3.13.2
|
|
23
|
+
- @prosopo/procaptcha-common@2.21.10
|
|
24
|
+
- @prosopo/types@5.20.0
|
|
25
|
+
- @prosopo/util@3.4.0
|
|
26
|
+
- @prosopo/util-crypto@13.6.3
|
|
27
|
+
- @prosopo/widget-skeleton@2.10.5
|
|
28
|
+
- @prosopo/api@4.8.0
|
|
29
|
+
|
|
30
|
+
## 0.2.10
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 2086040: Each kind of build now writes to its own folder under dist: dist/esm (vite ESM), dist/cjs (vite CommonJS), dist/types (declarations), dist/tsc (plain tsc), dist/bundle and dist/bundle-webpack (bundles) and dist/native (the Rust addons). Turbo caches each folder separately, so building one variant no longer overwrites or invalidates another. Package exports point at the new folders; anything importing a file from dist by path has to add the variant folder.
|
|
34
|
+
|
|
35
|
+
The Rust addons are no longer committed. They are built into dist/native, in debug for development and tests and fully optimised when NODE_ENV=production, so building them now needs a Rust toolchain.
|
|
36
|
+
|
|
37
|
+
Code that found the repo root or its certificates by climbing a fixed number of folders up from its own file now starts from its package's folder instead (new `packageDir` in @prosopo/util/node). The fixed count stopped working once the build output moved one folder deeper.
|
|
38
|
+
- Updated dependencies [2086040]
|
|
39
|
+
- Updated dependencies [915f30b]
|
|
40
|
+
- @prosopo/api@4.7.7
|
|
41
|
+
- @prosopo/common@3.3.1
|
|
42
|
+
- @prosopo/locale@3.13.1
|
|
43
|
+
- @prosopo/procaptcha-common@2.21.9
|
|
44
|
+
- @prosopo/types@5.19.0
|
|
45
|
+
- @prosopo/util-crypto@13.6.2
|
|
46
|
+
- @prosopo/util@3.3.17
|
|
47
|
+
- @prosopo/widget-skeleton@2.10.4
|
|
48
|
+
|
|
3
49
|
## 0.2.9
|
|
4
50
|
### Patch Changes
|
|
5
51
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
let _prosopo_locale = require("@prosopo/locale");
|
|
2
1
|
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
3
2
|
let _prosopo_types = require("@prosopo/types");
|
|
4
3
|
let _polkadot_util_string = require("@polkadot/util/string");
|
|
@@ -116,7 +115,7 @@ var Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState,
|
|
|
116
115
|
}
|
|
117
116
|
const providerUrl = getRandomProviderResponse.provider.url;
|
|
118
117
|
previousProviderUrl = providerUrl;
|
|
119
|
-
const providerApi = new _prosopo_api.ProviderApi(providerUrl, getDappAccount(), void 0, (0,
|
|
118
|
+
const providerApi = new _prosopo_api.ProviderApi(providerUrl, getDappAccount(), void 0, (0, _prosopo_procaptcha_common.widgetRequestHeaders)(getConfig().language));
|
|
120
119
|
const challengeSessionId = frictionlessState?.sessionId;
|
|
121
120
|
if (spentSession.isSpent(challengeSessionId)) {
|
|
122
121
|
updateState({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ExtensionLoader, buildClientMetaData, buildUpdateState, createManagerLifecycle, createSpentSessionGuard, encryptBehavioralDataForSubmit, getDefaultEvents, getProcaptchaRandomActiveProvider, getSimdReadingsForSubmit, pickIpMode, providerRetry } from "@prosopo/procaptcha-common";
|
|
1
|
+
import { ExtensionLoader, buildClientMetaData, buildUpdateState, createManagerLifecycle, createSpentSessionGuard, encryptBehavioralDataForSubmit, getDefaultEvents, getProcaptchaRandomActiveProvider, getSimdReadingsForSubmit, pickIpMode, providerRetry, widgetRequestHeaders } from "@prosopo/procaptcha-common";
|
|
3
2
|
import { ApiParams, CaptchaType, ProcaptchaConfigSchema, encodeProcaptchaOutput } from "@prosopo/types";
|
|
4
3
|
import { stringToHex } from "@polkadot/util/string";
|
|
5
4
|
import { ProviderApi } from "@prosopo/api";
|
|
@@ -116,7 +115,7 @@ var Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState,
|
|
|
116
115
|
}
|
|
117
116
|
const providerUrl = getRandomProviderResponse.provider.url;
|
|
118
117
|
previousProviderUrl = providerUrl;
|
|
119
|
-
const providerApi = new ProviderApi(providerUrl, getDappAccount(), void 0,
|
|
118
|
+
const providerApi = new ProviderApi(providerUrl, getDappAccount(), void 0, widgetRequestHeaders(getConfig().language));
|
|
120
119
|
const challengeSessionId = frictionlessState?.sessionId;
|
|
121
120
|
if (spentSession.isSpent(challengeSessionId)) {
|
|
122
121
|
updateState({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/audioPlayer.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAGN,KAAK,SAAS,EAOd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAEhC,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,UAAU,EAAE,KACrB,IAAI,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAkCD,eAAO,MAAM,gBAAgB,iBACd,gBAAgB,KAC5B,SAAS,CAAC,gBAAgB,CA8T5B,CAAC"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { Teardown, applyAttributes, applyStyles, createElement, mountChallengeSurface, } from "@prosopo/procaptcha-common";
|
|
2
|
+
const CONTAINER_WIDTH = 320;
|
|
3
|
+
const SHAKE_MS = 500;
|
|
4
|
+
const SHAKE_KEYFRAMES = `
|
|
5
|
+
@keyframes prosopo-audio-shake {
|
|
6
|
+
0%, 100% { transform: translateX(0); }
|
|
7
|
+
10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
|
|
8
|
+
20%, 40%, 60%, 80% { transform: translateX(4px); }
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
const VISUALLY_HIDDEN = {
|
|
12
|
+
position: "absolute",
|
|
13
|
+
width: "1px",
|
|
14
|
+
height: "1px",
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
clip: "rect(0 0 0 0)",
|
|
17
|
+
clipPath: "inset(50%)",
|
|
18
|
+
whiteSpace: "nowrap",
|
|
19
|
+
};
|
|
20
|
+
export const mountAudioPlayer = (initialProps) => {
|
|
21
|
+
const teardown = new Teardown();
|
|
22
|
+
let props = initialProps;
|
|
23
|
+
let answer = "";
|
|
24
|
+
let playing = false;
|
|
25
|
+
let visible = false;
|
|
26
|
+
let shaking = false;
|
|
27
|
+
let shakeTimer;
|
|
28
|
+
let replays = 0;
|
|
29
|
+
let hasPlayed = false;
|
|
30
|
+
let events = [];
|
|
31
|
+
let startedAt = Date.now();
|
|
32
|
+
const t = (key, options) => props.translator.t(key, options);
|
|
33
|
+
const record = (kind) => {
|
|
34
|
+
events.push({ kind, t: Date.now() - startedAt });
|
|
35
|
+
};
|
|
36
|
+
const style = createElement("style", { text: SHAKE_KEYFRAMES });
|
|
37
|
+
const instruction = createElement("p", {
|
|
38
|
+
style: { margin: 0, fontSize: "14px" },
|
|
39
|
+
});
|
|
40
|
+
const audio = createElement("audio", {
|
|
41
|
+
attributes: { preload: "auto" },
|
|
42
|
+
style: { display: "none" },
|
|
43
|
+
});
|
|
44
|
+
const playButton = createElement("button", {
|
|
45
|
+
attributes: { type: "button" },
|
|
46
|
+
});
|
|
47
|
+
const playRow = createElement("div", {
|
|
48
|
+
style: { display: "flex", gap: "8px" },
|
|
49
|
+
children: [playButton],
|
|
50
|
+
});
|
|
51
|
+
const input = createElement("input", {
|
|
52
|
+
attributes: {
|
|
53
|
+
type: "text",
|
|
54
|
+
inputmode: "numeric",
|
|
55
|
+
autocomplete: "off",
|
|
56
|
+
autocorrect: "off",
|
|
57
|
+
autocapitalize: "off",
|
|
58
|
+
spellcheck: "false",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const submitButton = createElement("button", {
|
|
62
|
+
attributes: { type: "button" },
|
|
63
|
+
});
|
|
64
|
+
const announcer = createElement("div", {
|
|
65
|
+
attributes: { "aria-live": "polite", "aria-atomic": "true" },
|
|
66
|
+
style: VISUALLY_HIDDEN,
|
|
67
|
+
});
|
|
68
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
69
|
+
applyAttributes(audio, { "data-cy": "prosopo-audio-clip" });
|
|
70
|
+
applyAttributes(playButton, { "data-cy": "prosopo-audio-play" });
|
|
71
|
+
applyAttributes(input, { "data-cy": "prosopo-audio-answer" });
|
|
72
|
+
applyAttributes(submitButton, { "data-cy": "prosopo-audio-submit" });
|
|
73
|
+
}
|
|
74
|
+
const panel = createElement("div", {
|
|
75
|
+
style: {
|
|
76
|
+
position: "relative",
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
gap: "14px",
|
|
80
|
+
width: `${CONTAINER_WIDTH}px`,
|
|
81
|
+
boxSizing: "border-box",
|
|
82
|
+
padding: "20px",
|
|
83
|
+
borderRadius: "20px",
|
|
84
|
+
transition: "opacity 0.3s ease, transform 0.3s ease",
|
|
85
|
+
},
|
|
86
|
+
children: [instruction, audio, playRow, input, submitButton, announcer],
|
|
87
|
+
});
|
|
88
|
+
const surfaceProps = () => ({
|
|
89
|
+
show: true,
|
|
90
|
+
placement: props.placement,
|
|
91
|
+
anchor: props.anchor,
|
|
92
|
+
onDismiss: props.onDismiss,
|
|
93
|
+
scrim: visible ? "dim" : "none",
|
|
94
|
+
dialogLabel: t("WIDGET.AUDIO_CHALLENGE_LABEL"),
|
|
95
|
+
});
|
|
96
|
+
const surface = mountChallengeSurface(surfaceProps());
|
|
97
|
+
surface.content.append(style, panel);
|
|
98
|
+
const announce = (message) => {
|
|
99
|
+
announcer.textContent = message;
|
|
100
|
+
};
|
|
101
|
+
const playLabel = () => {
|
|
102
|
+
if (playing) {
|
|
103
|
+
return t("WIDGET.AUDIO_PLAYING");
|
|
104
|
+
}
|
|
105
|
+
return hasPlayed || answer.length > 0
|
|
106
|
+
? t("WIDGET.AUDIO_REPLAY")
|
|
107
|
+
: t("WIDGET.AUDIO_PLAY");
|
|
108
|
+
};
|
|
109
|
+
const render = () => {
|
|
110
|
+
const { theme, showRetry, submitting, characterCount } = props;
|
|
111
|
+
const accent = showRetry
|
|
112
|
+
? theme.palette.error.main
|
|
113
|
+
: theme.palette.primary.main;
|
|
114
|
+
const blocked = submitting || 0 === answer.length;
|
|
115
|
+
const buttonStyle = {
|
|
116
|
+
fontFamily: theme.font.fontFamily,
|
|
117
|
+
fontSize: "14px",
|
|
118
|
+
padding: "10px 16px",
|
|
119
|
+
borderRadius: "8px",
|
|
120
|
+
border: `1px solid ${accent}`,
|
|
121
|
+
backgroundColor: "transparent",
|
|
122
|
+
color: accent,
|
|
123
|
+
cursor: "pointer",
|
|
124
|
+
};
|
|
125
|
+
applyStyles(panel, {
|
|
126
|
+
backgroundColor: theme.palette.surface,
|
|
127
|
+
color: theme.palette.onSurface,
|
|
128
|
+
fontFamily: theme.font.fontFamily,
|
|
129
|
+
opacity: visible ? 1 : 0,
|
|
130
|
+
transform: visible ? "scale(1)" : "scale(0.9)",
|
|
131
|
+
animation: shaking ? `prosopo-audio-shake ${SHAKE_MS}ms ease` : "none",
|
|
132
|
+
});
|
|
133
|
+
instruction.textContent = showRetry
|
|
134
|
+
? t("WIDGET.AUDIO_INCORRECT")
|
|
135
|
+
: t("WIDGET.AUDIO_INSTRUCTIONS", { count: characterCount });
|
|
136
|
+
applyStyles(instruction, {
|
|
137
|
+
color: showRetry ? theme.palette.error.main : theme.palette.onSurface,
|
|
138
|
+
});
|
|
139
|
+
if (audio.getAttribute("src") !== props.clip) {
|
|
140
|
+
audio.setAttribute("src", props.clip);
|
|
141
|
+
}
|
|
142
|
+
playButton.textContent = playLabel();
|
|
143
|
+
applyStyles(playButton, { ...buttonStyle, flex: 1 });
|
|
144
|
+
input.maxLength = characterCount * 2;
|
|
145
|
+
input.disabled = submitting;
|
|
146
|
+
if (input.value !== answer) {
|
|
147
|
+
input.value = answer;
|
|
148
|
+
}
|
|
149
|
+
applyAttributes(input, {
|
|
150
|
+
"aria-label": t("WIDGET.AUDIO_INPUT_LABEL", { count: characterCount }),
|
|
151
|
+
});
|
|
152
|
+
applyStyles(input, {
|
|
153
|
+
fontFamily: theme.font.fontFamily,
|
|
154
|
+
fontSize: "18px",
|
|
155
|
+
letterSpacing: "0.3em",
|
|
156
|
+
textAlign: "center",
|
|
157
|
+
padding: "10px",
|
|
158
|
+
borderRadius: "8px",
|
|
159
|
+
border: `1px solid ${accent}`,
|
|
160
|
+
backgroundColor: "transparent",
|
|
161
|
+
color: theme.palette.onSurface,
|
|
162
|
+
});
|
|
163
|
+
submitButton.textContent = submitting
|
|
164
|
+
? t("WIDGET.AUDIO_CHECKING")
|
|
165
|
+
: t("WIDGET.AUDIO_SUBMIT");
|
|
166
|
+
submitButton.disabled = blocked;
|
|
167
|
+
applyStyles(submitButton, {
|
|
168
|
+
...buttonStyle,
|
|
169
|
+
backgroundColor: theme.palette.primary.main,
|
|
170
|
+
borderColor: theme.palette.primary.main,
|
|
171
|
+
color: theme.palette.primary.contrastText,
|
|
172
|
+
opacity: blocked ? 0.5 : 1,
|
|
173
|
+
cursor: blocked ? "not-allowed" : "pointer",
|
|
174
|
+
});
|
|
175
|
+
surface.update(surfaceProps());
|
|
176
|
+
};
|
|
177
|
+
const play = () => {
|
|
178
|
+
const isReplay = hasPlayed;
|
|
179
|
+
audio.currentTime = 0;
|
|
180
|
+
record(isReplay ? "replay" : "play");
|
|
181
|
+
if (isReplay) {
|
|
182
|
+
replays += 1;
|
|
183
|
+
}
|
|
184
|
+
hasPlayed = true;
|
|
185
|
+
const clipAtPlay = props.clip;
|
|
186
|
+
void audio.play().then(() => {
|
|
187
|
+
if (clipAtPlay !== props.clip) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
playing = true;
|
|
191
|
+
announce(t("WIDGET.AUDIO_PLAYING"));
|
|
192
|
+
render();
|
|
193
|
+
}, () => {
|
|
194
|
+
playing = false;
|
|
195
|
+
announce(t("WIDGET.AUDIO_PLAYBACK_FAILED"));
|
|
196
|
+
render();
|
|
197
|
+
});
|
|
198
|
+
render();
|
|
199
|
+
};
|
|
200
|
+
const submit = () => {
|
|
201
|
+
if (props.submitting || 0 === answer.length) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
props.onComplete(answer, replays, [...events]);
|
|
205
|
+
};
|
|
206
|
+
teardown.addEventListener(playButton, "click", play);
|
|
207
|
+
teardown.addEventListener(submitButton, "click", submit);
|
|
208
|
+
teardown.addEventListener(input, "input", () => {
|
|
209
|
+
record("key");
|
|
210
|
+
answer = input.value;
|
|
211
|
+
render();
|
|
212
|
+
});
|
|
213
|
+
teardown.addEventListener(input, "keydown", (event) => {
|
|
214
|
+
if (!(event instanceof KeyboardEvent) || "Enter" !== event.key) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
submit();
|
|
219
|
+
});
|
|
220
|
+
teardown.addEventListener(audio, "ended", () => {
|
|
221
|
+
playing = false;
|
|
222
|
+
announce(t("WIDGET.AUDIO_FINISHED"));
|
|
223
|
+
render();
|
|
224
|
+
});
|
|
225
|
+
teardown.addEventListener(audio, "pause", () => {
|
|
226
|
+
playing = false;
|
|
227
|
+
render();
|
|
228
|
+
});
|
|
229
|
+
const resetForNewClip = () => {
|
|
230
|
+
audio.pause();
|
|
231
|
+
audio.currentTime = 0;
|
|
232
|
+
answer = "";
|
|
233
|
+
playing = false;
|
|
234
|
+
replays = 0;
|
|
235
|
+
hasPlayed = false;
|
|
236
|
+
events = [];
|
|
237
|
+
startedAt = Date.now();
|
|
238
|
+
};
|
|
239
|
+
const startShake = () => {
|
|
240
|
+
shaking = true;
|
|
241
|
+
announce(t("WIDGET.AUDIO_INCORRECT"));
|
|
242
|
+
if (undefined !== shakeTimer) {
|
|
243
|
+
clearTimeout(shakeTimer);
|
|
244
|
+
}
|
|
245
|
+
shakeTimer = setTimeout(() => {
|
|
246
|
+
shakeTimer = undefined;
|
|
247
|
+
shaking = false;
|
|
248
|
+
render();
|
|
249
|
+
}, SHAKE_MS);
|
|
250
|
+
};
|
|
251
|
+
teardown.add(() => {
|
|
252
|
+
if (undefined !== shakeTimer) {
|
|
253
|
+
clearTimeout(shakeTimer);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
if (props.showRetry) {
|
|
257
|
+
startShake();
|
|
258
|
+
}
|
|
259
|
+
render();
|
|
260
|
+
input.focus();
|
|
261
|
+
const frameRequest = requestAnimationFrame(() => {
|
|
262
|
+
visible = true;
|
|
263
|
+
render();
|
|
264
|
+
});
|
|
265
|
+
teardown.add(() => cancelAnimationFrame(frameRequest));
|
|
266
|
+
return {
|
|
267
|
+
update: (nextProps) => {
|
|
268
|
+
const previous = props;
|
|
269
|
+
props = nextProps;
|
|
270
|
+
if (nextProps.clip !== previous.clip) {
|
|
271
|
+
resetForNewClip();
|
|
272
|
+
}
|
|
273
|
+
if (nextProps.showRetry && !previous.showRetry) {
|
|
274
|
+
startShake();
|
|
275
|
+
}
|
|
276
|
+
render();
|
|
277
|
+
},
|
|
278
|
+
destroy: () => {
|
|
279
|
+
teardown.run();
|
|
280
|
+
audio.pause();
|
|
281
|
+
surface.destroy();
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
//# sourceMappingURL=audioPlayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioPlayer.js","sourceRoot":"","sources":["../../../src/components/audioPlayer.ts"],"names":[],"mappings":"AAeA,OAAO,EAKN,QAAQ,EACR,eAAe,EACf,WAAW,EACX,aAAa,EACb,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AAuBpC,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,MAAM,eAAe,GAAG;;;;;;CAMvB,CAAC;AAEF,MAAM,eAAe,GAAa;IACjC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,YAAY;IACtB,UAAU,EAAE,QAAQ;CACpB,CAAC;AAYF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC/B,YAA8B,EACA,EAAE;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C,YAAY,CAAC,CAAC,CAAC;IAEvD,OAAO;QACN,MAAM,EAAE,CAAC,SAA2B,EAAE,EAAE;YACvC,MAAM,QAAQ,GAAG,KAAK,CAAC;YACvB,KAAK,GAAG,SAAS,CAAC;YAClB,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACtC,eAAe,EAAE,CAAC;YACnB,CAAC;YACD,IAAI,SAAS,CAAC,SAAS,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;gBAChD,UAAU,EAAE,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC;QACV,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACb,QAAQ,CAAC,GAAG,EAAE,CAAC;YACf,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procaptchaAudio.d.ts","sourceRoot":"","sources":["../../../src/components/procaptchaAudio.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAE1E,eAAO,MAAM,mBAAmB,QAAa,OAAO,CAAC,sBAAsB,CACR,CAAC;AAEpE,eAAO,MAAM,oBAAoB,EAAE,sBACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { lazyMount } from "@prosopo/procaptcha-common";
|
|
2
|
+
export const loadProcaptchaAudio = async () => (await import("./procaptchaWidget.js")).mountProcaptchaAudioWidget;
|
|
3
|
+
export const mountProcaptchaAudio = lazyMount(loadProcaptchaAudio);
|
|
4
|
+
//# sourceMappingURL=procaptchaAudio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procaptchaAudio.js","sourceRoot":"","sources":["../../../src/components/procaptchaAudio.ts"],"names":[],"mappings":"AAcA,OAAO,EAAsB,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAO3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,IAAqC,EAAE,CAC9E,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,0BAA0B,CAAC;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAChC,SAAS,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procaptchaWidget.d.ts","sourceRoot":"","sources":["../../../src/components/procaptchaWidget.ts"],"names":[],"mappings":"AA+BA,OAAO,EAIN,KAAK,eAAe,EAEpB,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,qBAAqB;IACrC,OAAO,IAAI,IAAI,CAAC;CAChB;AAED,eAAO,MAAM,0BAA0B,cAC3B,WAAW,SACf,eAAe,KACpB,qBAoTF,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|