@prosopo/procaptcha-bundle 0.3.1 → 0.3.3

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.
Files changed (36) hide show
  1. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
  2. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +14 -7
  3. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
  4. package/dist/bundle/Captcha-O2tGirAv.js +106 -0
  5. package/dist/bundle/ProcaptchaWidget-f7S-UgEx.js +891 -0
  6. package/dist/bundle/{index-DUjgpJkc.js → index-BoRQHVyP.js} +4649 -3729
  7. package/dist/bundle/index.d.ts.map +1 -1
  8. package/dist/bundle/procaptcha.bundle.js +1 -1
  9. package/dist/bundle/{interface-CyIrD5th.js → utils-CIX8CwBe.js} +5092 -5181
  10. package/dist/cjs/account/dist/extension/ExtensionWeb3.cjs +28 -0
  11. package/dist/cjs/account/dist/index.cjs +2 -0
  12. package/dist/cjs/index.cjs +15 -6
  13. package/dist/cjs/procaptcha-frictionless/dist/ProcaptchaFrictionless.cjs +27 -0
  14. package/dist/cjs/procaptcha-frictionless/dist/index.cjs +4 -0
  15. package/dist/cjs/procaptcha-pow/dist/Services/Manager.cjs +91 -27
  16. package/dist/cjs/procaptcha-pow/dist/components/Captcha.cjs +22 -67
  17. package/dist/cjs/procaptcha-pow/dist/components/ProcaptchaPoW.cjs +1 -1
  18. package/dist/cjs/web-components/dist/CaptchaPlaceholder.cjs +13 -55
  19. package/dist/cjs/web-components/dist/Checkbox.cjs +21 -11
  20. package/dist/cjs/web-components/dist/Containers.cjs +42 -0
  21. package/dist/cjs/web-components/dist/LoadingSpinner.cjs +4 -0
  22. package/dist/cjs/web-components/dist/Logo.cjs +16 -0
  23. package/dist/cjs/web-components/dist/LogoWithText.cjs +10 -0
  24. package/dist/cjs/web-components/dist/LogoWithoutText.cjs +10 -0
  25. package/dist/cjs/web-components/dist/WidgetConstants.cjs +12 -0
  26. package/dist/cjs/web-components/dist/index.cjs +11 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +14 -7
  29. package/dist/index.js.map +1 -1
  30. package/package.json +7 -6
  31. package/stats.html +1 -1
  32. package/typedoc.config.js +13 -0
  33. package/vite.cjs.config.ts +13 -0
  34. package/vite.config.ts +14 -1
  35. package/dist/bundle/Captcha-wrP5sDne.js +0 -169
  36. package/dist/bundle/ProcaptchaWidget-CggtG-1W.js +0 -1037
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const Extension = require("./Extension.cjs");
4
+ const common = require("@prosopo/common");
5
+ const extensionDapp = require("@polkadot/extension-dapp");
6
+ class ExtensionWeb3 extends Extension.Extension {
7
+ async getAccount(config) {
8
+ const { dappName, userAccountAddress: address } = config;
9
+ if (!address) {
10
+ throw new common.ProsopoError("WIDGET.NO_ACCOUNTS_FOUND", { context: { error: "No account address provided" } });
11
+ }
12
+ const extensions = await extensionDapp.web3Enable(dappName);
13
+ if (extensions.length === 0) {
14
+ throw new common.ProsopoError("WIDGET.NO_EXTENSION_FOUND");
15
+ }
16
+ for (const extension of extensions) {
17
+ const accounts = await extension.accounts.get();
18
+ const account = accounts.find((account2) => account2.address === address);
19
+ if (account) {
20
+ return { account, extension };
21
+ }
22
+ }
23
+ throw new common.ProsopoError("WIDGET.ACCOUNT_NOT_FOUND", {
24
+ context: { error: `No account found matching ${address}` }
25
+ });
26
+ }
27
+ }
28
+ exports.ExtensionWeb3 = ExtensionWeb3;
@@ -2,5 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const Extension = require("./extension/Extension.cjs");
4
4
  const ExtensionWeb2 = require("./extension/ExtensionWeb2.cjs");
5
+ const ExtensionWeb3 = require("./extension/ExtensionWeb3.cjs");
5
6
  exports.Extension = Extension.Extension;
6
7
  exports.ExtensionWeb2 = ExtensionWeb2.ExtensionWeb2;
8
+ exports.ExtensionWeb3 = ExtensionWeb3.ExtensionWeb3;
@@ -3,9 +3,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const types = require("@prosopo/types");
5
5
  const procaptchaReact = require("@prosopo/procaptcha-react");
6
+ require("./procaptcha-frictionless/dist/index.cjs");
6
7
  require("./procaptcha-pow/dist/index.cjs");
7
8
  const util = require("@prosopo/util");
8
9
  const client = require("react-dom/client");
10
+ const ProcaptchaFrictionless = require("./procaptcha-frictionless/dist/ProcaptchaFrictionless.cjs");
9
11
  const ProcaptchaPoW = require("./procaptcha-pow/dist/components/ProcaptchaPoW.cjs");
10
12
  const BUNDLE_NAME = "procaptcha.bundle.js";
11
13
  const getProcaptchaScript = () => document.querySelector(`script[src*="${BUNDLE_NAME}"]`);
@@ -32,7 +34,8 @@ const getConfig = (siteKey) => {
32
34
  address: siteKey
33
35
  },
34
36
  serverUrl: process.env.PROSOPO_SERVER_URL || "",
35
- mongoAtlasUri: process.env._DEV_ONLY_WATCH_EVENTS === "true" || false
37
+ mongoAtlasUri: process.env.PROSOPO_MONGO_EVENTS_URI || "",
38
+ devOnlyWatchEvents: process.env._DEV_ONLY_WATCH_EVENTS === "true" || false
36
39
  });
37
40
  };
38
41
  const getParentForm = (element) => element.closest("form");
@@ -101,10 +104,16 @@ const renderLogic = (elements, config, renderOptions) => {
101
104
  if (challengeValidLengthAttribute) {
102
105
  config.challengeValidLength = parseInt(challengeValidLengthAttribute);
103
106
  }
104
- if (renderOptions?.captchaType === "pow") {
105
- client.createRoot(element).render(/* @__PURE__ */ jsxRuntime.jsx(ProcaptchaPoW.ProcaptchaPow, { config, callbacks }));
106
- } else {
107
- client.createRoot(element).render(/* @__PURE__ */ jsxRuntime.jsx(procaptchaReact.Procaptcha, { config, callbacks }));
107
+ switch (renderOptions?.captchaType) {
108
+ case "pow":
109
+ client.createRoot(element).render(/* @__PURE__ */ jsxRuntime.jsx(ProcaptchaPoW.ProcaptchaPow, { config, callbacks }));
110
+ break;
111
+ case "frictionless":
112
+ client.createRoot(element).render(/* @__PURE__ */ jsxRuntime.jsx(ProcaptchaFrictionless.ProcaptchaFrictionless, { config, callbacks }));
113
+ break;
114
+ default:
115
+ client.createRoot(element).render(/* @__PURE__ */ jsxRuntime.jsx(procaptchaReact.Procaptcha, { config, callbacks }));
116
+ break;
108
117
  }
109
118
  });
110
119
  };
@@ -117,7 +126,7 @@ const implicitRender = () => {
117
126
  return;
118
127
  }
119
128
  const features = Object.values(types.FeaturesEnum);
120
- const captchaType = features.find((feature) => feature === util.at(elements, 0).getAttribute("data-captcha-type")) || "image";
129
+ const captchaType = features.find((feature) => feature === util.at(elements, 0).getAttribute("data-captcha-type")) || "frictionless";
121
130
  renderLogic(elements, getConfig(siteKey), { captchaType, siteKey });
122
131
  }
123
132
  };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const procaptchaReact = require("@prosopo/procaptcha-react");
5
+ require("../../web-components/dist/index.cjs");
6
+ require("../../procaptcha-pow/dist/index.cjs");
7
+ const botd = require("@fingerprintjs/botd");
8
+ const react = require("react");
9
+ const CaptchaPlaceholder = require("../../web-components/dist/CaptchaPlaceholder.cjs");
10
+ const ProcaptchaPoW = require("../../procaptcha-pow/dist/components/ProcaptchaPoW.cjs");
11
+ const ProcaptchaFrictionless = ({ config, callbacks }) => {
12
+ const [componentToRender, setComponentToRender] = react.useState(jsxRuntime.jsx(CaptchaPlaceholder.ProcaptchaPlaceholder, { darkMode: config.theme }));
13
+ react.useEffect(() => {
14
+ const detectBot = async () => {
15
+ const botd$1 = await botd.load();
16
+ const result = botd$1.detect();
17
+ if (result.bot) {
18
+ setComponentToRender(jsxRuntime.jsx(procaptchaReact.Procaptcha, { config, callbacks }));
19
+ } else {
20
+ setComponentToRender(jsxRuntime.jsx(ProcaptchaPoW.ProcaptchaPow, { config, callbacks }));
21
+ }
22
+ };
23
+ detectBot();
24
+ }, [config, callbacks]);
25
+ return componentToRender;
26
+ };
27
+ exports.ProcaptchaFrictionless = ProcaptchaFrictionless;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ProcaptchaFrictionless = require("./ProcaptchaFrictionless.cjs");
4
+ exports.ProcaptchaFrictionless = ProcaptchaFrictionless.ProcaptchaFrictionless;
@@ -1,29 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const types = require("@prosopo/types");
3
4
  const Api = require("@polkadot/api/promise/Api");
4
5
  require("../../../account/dist/index.cjs");
5
6
  const keyring = require("@polkadot/keyring");
6
- const types = require("@prosopo/types");
7
7
  const contract = require("@prosopo/contract");
8
8
  const common = require("@prosopo/common");
9
9
  const api = require("@prosopo/api");
10
10
  const ws = require("@polkadot/rpc-provider/ws");
11
11
  const contractInfo = require("@prosopo/captcha-contract/contract-info");
12
+ const procaptchaCommon = require("@prosopo/procaptcha-common");
13
+ const procaptcha = require("@prosopo/procaptcha");
12
14
  const SolverService = require("./SolverService.cjs");
13
15
  const ExtensionWeb2 = require("../../../account/dist/extension/ExtensionWeb2.cjs");
14
- const Manager = async (configInput) => {
16
+ const Manager = (configInput, state, onStateUpdate, callbacks) => {
17
+ const defaultState = () => {
18
+ return {
19
+ showModal: false,
20
+ loading: false,
21
+ index: 0,
22
+ challenge: void 0,
23
+ solutions: void 0,
24
+ isHuman: false,
25
+ captchaApi: void 0,
26
+ account: void 0
27
+ };
28
+ };
29
+ const clearTimeout = () => {
30
+ window.clearTimeout(state.timeout);
31
+ updateState({ timeout: void 0 });
32
+ };
15
33
  const getConfig = () => {
16
- const config2 = {
34
+ const config = {
17
35
  userAccountAddress: "",
18
36
  ...configInput
19
37
  };
20
- return types.ProcaptchaConfigSchema.parse(config2);
38
+ return types.ProcaptchaConfigSchema.parse(config);
21
39
  };
22
- const getNetwork = (config2) => {
23
- const network = config2.networks[config2.defaultNetwork];
40
+ const getNetwork = (config) => {
41
+ const network = config.networks[config.defaultNetwork];
24
42
  if (!network) {
25
43
  throw new common.ProsopoEnvError("DEVELOPER.NETWORK_NOT_FOUND", {
26
- context: { error: `No network found for environment ${config2.defaultEnvironment}` }
44
+ context: { error: `No network found for environment ${config.defaultEnvironment}` }
27
45
  });
28
46
  }
29
47
  return network;
@@ -35,25 +53,71 @@ const Manager = async (configInput) => {
35
53
  const keyring$1 = new keyring.Keyring({ type, ss58Format: api2.registry.chainSS58 });
36
54
  return new contract.ProsopoCaptchaContract(api2, JSON.parse(contractInfo.ContractAbi), network.contract.address, "prosopo", 0, keyring$1.addFromAddress(getConfig().account.address || ""));
37
55
  };
38
- const config = getConfig();
39
- if (!config.web2 && !config.userAccountAddress) {
40
- throw new common.ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", {
41
- context: { error: "Account address has not been set for web3 mode" }
42
- });
43
- }
44
- const ext = new ExtensionWeb2.ExtensionWeb2();
45
- const account = await ext.getAccount(config);
46
- const contract$1 = await loadContract();
47
- const getRandomProviderResponse = await contract.wrapQuery(contract$1.query.getRandomActiveProvider, contract$1.query)(account.account.address, configInput.account.address || "");
48
- const providerUrl = common.trimProviderUrl(getRandomProviderResponse.provider.url.toString());
49
- const providerApi = new api.ProviderApi(getNetwork(getConfig()), providerUrl, configInput.account.address || "");
50
- const challenge = await providerApi.getPowCaptchaChallenge(account.account.address, configInput.account.address || "");
51
- console.log("challenge", challenge);
52
- console.log("challenge", challenge.challenge);
53
- console.log("challenge", challenge.difficulty);
54
- const solution = SolverService.solvePoW(challenge.challenge, challenge.difficulty);
55
- console.log("solution", solution);
56
- const verifiedSolution = await providerApi.submitPowCaptchaSolution(challenge, account.account.address, configInput.account.address || "", getRandomProviderResponse, solution);
57
- return verifiedSolution;
56
+ const getAccount = () => {
57
+ if (!state.account) {
58
+ throw new common.ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", { context: { error: "Account not loaded" } });
59
+ }
60
+ const account = state.account;
61
+ return account;
62
+ };
63
+ const getDappAccount = () => {
64
+ if (!state.dappAccount) {
65
+ throw new common.ProsopoEnvError("GENERAL.SITE_KEY_MISSING");
66
+ }
67
+ const dappAccount = state.dappAccount;
68
+ return dappAccount;
69
+ };
70
+ const getBlockNumber = () => {
71
+ if (!state.blockNumber) {
72
+ throw new common.ProsopoContractError("CAPTCHA.INVALID_BLOCK_NO", { context: { error: "Block number not found" } });
73
+ }
74
+ const blockNumber = state.blockNumber;
75
+ return blockNumber;
76
+ };
77
+ const updateState = procaptchaCommon.buildUpdateState(state, onStateUpdate);
78
+ const resetState = () => {
79
+ clearTimeout();
80
+ updateState(defaultState());
81
+ };
82
+ const start = async () => {
83
+ if (state.loading) {
84
+ return;
85
+ }
86
+ if (state.isHuman) {
87
+ return;
88
+ }
89
+ resetState();
90
+ updateState({ loading: true });
91
+ const config = getConfig();
92
+ updateState({ dappAccount: config.account.address });
93
+ await procaptcha.sleep(100);
94
+ if (!config.web2 && !config.userAccountAddress) {
95
+ throw new common.ProsopoEnvError("GENERAL.ACCOUNT_NOT_FOUND", {
96
+ context: { error: "Account address has not been set for web3 mode" }
97
+ });
98
+ }
99
+ const ext = new ExtensionWeb2.ExtensionWeb2();
100
+ const account = await ext.getAccount(config);
101
+ const contract$1 = await loadContract();
102
+ const events = procaptchaCommon.getDefaultEvents(onStateUpdate, state, callbacks);
103
+ const getRandomProviderResponse = await contract.wrapQuery(contract$1.query.getRandomActiveProvider, contract$1.query)(account.account.address, getDappAccount());
104
+ const providerUrl = common.trimProviderUrl(getRandomProviderResponse.provider.url.toString());
105
+ const providerApi = new api.ProviderApi(getNetwork(getConfig()), providerUrl, getDappAccount());
106
+ const challenge = await providerApi.getPowCaptchaChallenge(account.account.address, getDappAccount());
107
+ const solution = SolverService.solvePoW(challenge.challenge, challenge.difficulty);
108
+ await providerApi.submitPowCaptchaSolution(challenge, getAccount().account.address, getDappAccount(), getRandomProviderResponse, solution);
109
+ if (state.isHuman) {
110
+ events.onHuman({
111
+ providerUrl,
112
+ [types.ApiParams.user]: getAccount().account.address,
113
+ [types.ApiParams.dapp]: getDappAccount(),
114
+ [types.ApiParams.challengeId]: challenge.challenge,
115
+ [types.ApiParams.blockNumber]: getBlockNumber()
116
+ });
117
+ }
118
+ };
119
+ return {
120
+ start
121
+ };
58
122
  };
59
123
  exports.Manager = Manager;
@@ -2,77 +2,40 @@
2
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
3
3
  require("../../../web-components/dist/index.cjs");
4
4
  const Manager = require("../Services/Manager.cjs");
5
- const react = require("@emotion/react");
6
- const react$1 = require("react");
5
+ const procaptchaCommon = require("@prosopo/procaptcha-common");
6
+ const react = require("react");
7
7
  const theme = require("../../../web-components/dist/theme.cjs");
8
+ const Containers = require("../../../web-components/dist/Containers.cjs");
9
+ const WidgetConstants = require("../../../web-components/dist/WidgetConstants.cjs");
8
10
  const LoadingSpinner = require("../../../web-components/dist/LoadingSpinner.cjs");
9
11
  const Checkbox = require("../../../web-components/dist/Checkbox.cjs");
10
- const logoStyle = react.css`
11
- align-items: center;
12
- justify-content: flex-end;
13
- display: flex;
14
- padding: 8px;
15
-
16
- @media (max-width: 245px) {
17
- &:nth-of-type(1),
18
- &:nth-of-type(2) {
19
- display: none;
20
- } /* Both logos hidden */
21
- }
22
-
23
- @media (min-width: 245px) and (max-width: 400px) {
24
- &:nth-of-type(1) {
25
- display: flex;
26
- } /* logoWithText */
27
- &:nth-of-type(2) {
28
- display: none;
29
- } /* logoWithoutText */
30
- }
31
-
32
- @media (min-width: 401px) {
33
- &:nth-of-type(1) {
34
- display: none;
35
- } /* logoWithText */
36
- &:nth-of-type(2) {
37
- display: flex;
38
- } /* logoWithoutText */
39
- }
40
- `;
12
+ const Logo = require("../../../web-components/dist/Logo.cjs");
41
13
  const Procaptcha = (props) => {
42
- const [checked, setChecked] = react$1.useState(false);
43
- const [loading, setLoading] = react$1.useState(false);
44
- const darkMode = props.config.theme;
45
- const styleWidth = { maxWidth: "400px", minWidth: "200px", margin: "8px" };
46
- const themeColor = darkMode ? "light" : "dark";
47
- const theme$1 = react$1.useMemo(() => darkMode === "light" ? theme.lightTheme : theme.darkTheme, [darkMode]);
48
- const handlePowCaptcha = async () => {
49
- setLoading(true);
50
- Manager.Manager(props.config).then((verified) => {
51
- if (verified.verified) {
52
- console.log("verified");
53
- setChecked(true);
54
- }
55
- setLoading(false);
56
- });
57
- };
58
- return jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: jsxRuntime.jsxs("div", { style: styleWidth, "data-cy": "button-human", children: [" ", jsxRuntime.jsxs("div", { style: {
59
- padding: "8px",
14
+ const config = props.config;
15
+ const themeColor = config.theme === "light" ? "light" : "dark";
16
+ const theme$1 = props.config.theme === "light" ? theme.lightTheme : theme.darkTheme;
17
+ const callbacks = props.callbacks || {};
18
+ const [state, _updateState] = procaptchaCommon.useProcaptcha(react.useState, react.useRef);
19
+ const updateState = procaptchaCommon.buildUpdateState(state, _updateState);
20
+ const manager = Manager.Manager(config, state, updateState, callbacks);
21
+ return jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: jsxRuntime.jsx(Containers.ContainerDiv, { children: jsxRuntime.jsx(Containers.WidthBasedStylesDiv, { children: jsxRuntime.jsxs("div", { style: WidgetConstants.WIDGET_DIMENSIONS, "data-cy": "button-human", children: [" ", jsxRuntime.jsxs("div", { style: {
22
+ padding: "2px",
60
23
  border: "1px solid",
61
24
  backgroundColor: theme$1.palette.background.default,
62
25
  borderColor: theme$1.palette.grey[300],
63
- borderRadius: "8px",
26
+ borderRadius: "4px",
64
27
  display: "flex",
65
- justifyContent: "space-between",
66
28
  alignItems: "center",
67
- flexWrap: "wrap"
68
- }, children: [jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column" }, children: jsxRuntime.jsxs("div", { style: {
29
+ flexWrap: "wrap",
30
+ justifyContent: "space-between",
31
+ minHeight: `${WidgetConstants.WIDGET_INNER_HEIGHT}px`,
32
+ overflow: "hidden"
33
+ }, children: [jsxRuntime.jsx("div", { style: { display: "inline-flex", flexDirection: "column" }, children: jsxRuntime.jsx("div", { style: {
69
34
  display: "flex",
70
35
  justifyContent: "flex-start",
71
36
  alignItems: "center",
72
37
  flexWrap: "wrap"
73
- }, children: [jsxRuntime.jsx("div", { style: {
74
- height: "50px",
75
- width: "50px",
38
+ }, children: jsxRuntime.jsx("div", { style: {
76
39
  display: "flex",
77
40
  alignItems: "center",
78
41
  justifyContent: "center",
@@ -80,14 +43,6 @@ const Procaptcha = (props) => {
80
43
  verticalAlign: "middle"
81
44
  }, children: jsxRuntime.jsx("div", { style: {
82
45
  display: "flex"
83
- }, children: jsxRuntime.jsx("div", { style: { flex: 1 }, children: loading ? jsxRuntime.jsx(LoadingSpinner.LoadingSpinner, { themeColor }) : jsxRuntime.jsx(Checkbox.Checkbox, { checked, onChange: handlePowCaptcha, themeColor: props.config.theme || "light" }) }) }) }), jsxRuntime.jsx("div", { style: { padding: 1 }, children: jsxRuntime.jsx("span", { style: { color: theme$1.palette.background.contrastText, paddingLeft: "4px" }, children: "I am a human" }) })] }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("a", { href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox", target: "_blank", "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.", children: jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
84
- __html: darkMode === "light" ? logoWithoutTextBlack : logoWithoutTextWhite
85
- } }), jsxRuntime.jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
86
- __html: darkMode === "light" ? logoWithTextBlack : logoWithTextWhite
87
- } })] }) }) }) })] })] }) }) });
46
+ }, children: jsxRuntime.jsx("div", { style: { flex: 1 }, children: state.loading ? jsxRuntime.jsx(LoadingSpinner.LoadingSpinner, { themeColor }) : jsxRuntime.jsx(Checkbox.Checkbox, { checked: state.isHuman, onChange: manager.start, themeColor, labelText: "I am human" }) }) }) }) }) }), jsxRuntime.jsx("div", { style: { display: "inline-flex", flexDirection: "column" }, children: jsxRuntime.jsx("a", { href: WidgetConstants.WIDGET_URL, target: "_blank", "aria-label": WidgetConstants.WIDGET_URL_TEXT, children: jsxRuntime.jsx("div", { style: { flex: 1 }, children: jsxRuntime.jsx(Logo, { themeColor }) }) }) })] })] }) }) }) }) });
88
47
  };
89
- const logoWithTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#1d1d1b;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
90
- const logoWithTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#fff;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
91
- const logoWithoutTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#fff"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#fff"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#fff"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#fff"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
92
- const logoWithoutTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#000000"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#000000"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#000000"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#000000"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
93
48
  module.exports = Procaptcha;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@emotion/react/jsx-runtime");
4
- require("../../../web-components/dist/index.cjs");
5
4
  const react = require("react");
5
+ require("../../../web-components/dist/index.cjs");
6
6
  const CaptchaPlaceholder = require("../../../web-components/dist/CaptchaPlaceholder.cjs");
7
7
  const _interopNamespaceDefaultOnly = (e) => Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: "Module" }));
8
8
  const ProcaptchaWidget = react.lazy(async () => Promise.resolve().then(() => /* @__PURE__ */ _interopNamespaceDefaultOnly(require("./Captcha.cjs"))));
@@ -1,64 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("@emotion/react/jsx-runtime");
4
+ const Containers = require("./Containers.cjs");
4
5
  const LoadingSpinner = require("./LoadingSpinner.cjs");
5
- const react = require("@emotion/react");
6
+ const WidgetConstants = require("./WidgetConstants.cjs");
6
7
  const theme = require("./theme.cjs");
7
- const react$1 = require("react");
8
- const logoStyle = react.css`
9
- align-items: center;
10
- justify-content: flex-end;
11
- display: flex;
12
- padding: 8px;
13
-
14
- @media (max-width: 245px) {
15
- &:nth-of-type(1),
16
- &:nth-of-type(2) {
17
- display: none;
18
- } /* Both logos hidden */
19
- }
20
-
21
- @media (min-width: 245px) and (max-width: 400px) {
22
- &:nth-of-type(1) {
23
- display: flex;
24
- } /* logoWithText */
25
- &:nth-of-type(2) {
26
- display: none;
27
- } /* logoWithoutText */
28
- }
29
-
30
- @media (min-width: 401px) {
31
- &:nth-of-type(1) {
32
- display: none;
33
- } /* logoWithText */
34
- &:nth-of-type(2) {
35
- display: flex;
36
- } /* logoWithoutText */
37
- }
38
- `;
8
+ const Logo = require("./Logo.cjs");
39
9
  const ProcaptchaPlaceholder = (props) => {
40
- const darkMode = props.darkMode;
41
- const styleWidth = { maxWidth: "400px", minWidth: "200px", margin: "8px" };
42
- const themeColor = darkMode ? "light" : "dark";
43
- const theme$1 = react$1.useMemo(() => darkMode === "light" ? theme.lightTheme : theme.darkTheme, [darkMode]);
44
- return jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: jsxRuntime.jsxs("div", { style: styleWidth, "data-cy": "button-human", children: [" ", jsxRuntime.jsxs("div", { style: {
45
- padding: "8px",
10
+ const themeColor = props.darkMode === "light" ? "light" : "dark";
11
+ const theme$1 = props.darkMode === "light" ? theme.lightTheme : theme.darkTheme;
12
+ return jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { style: { maxWidth: "100%", maxHeight: "100%", overflowX: "auto" }, children: jsxRuntime.jsx(Containers.ContainerDiv, { children: jsxRuntime.jsx(Containers.WidthBasedStylesDiv, { children: jsxRuntime.jsxs("div", { style: WidgetConstants.WIDGET_DIMENSIONS, "data-cy": "button-human", children: [" ", jsxRuntime.jsxs("div", { style: {
13
+ padding: "2px",
46
14
  border: "1px solid",
47
15
  backgroundColor: theme$1.palette.background.default,
48
16
  borderColor: theme$1.palette.grey[300],
49
17
  borderRadius: "8px",
50
18
  display: "flex",
51
- justifyContent: "space-between",
52
19
  alignItems: "center",
53
- flexWrap: "wrap"
20
+ flexWrap: "wrap",
21
+ justifyContent: "space-between",
22
+ minHeight: `${WidgetConstants.WIDGET_INNER_HEIGHT}px`,
23
+ overflow: "hidden"
54
24
  }, children: [jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column" }, children: jsxRuntime.jsx("div", { style: {
55
- display: "flex",
56
- justifyContent: "flex-start",
57
25
  alignItems: "center",
58
- flexWrap: "wrap"
26
+ flex: 1
59
27
  }, children: jsxRuntime.jsx("div", { style: {
60
- height: "50px",
61
- width: "50px",
62
28
  display: "flex",
63
29
  alignItems: "center",
64
30
  justifyContent: "center",
@@ -66,14 +32,6 @@ const ProcaptchaPlaceholder = (props) => {
66
32
  verticalAlign: "middle"
67
33
  }, children: jsxRuntime.jsx("div", { style: {
68
34
  display: "flex"
69
- }, children: jsxRuntime.jsx("div", { style: { flex: 1 }, children: jsxRuntime.jsx(LoadingSpinner.LoadingSpinner, { themeColor }) }) }) }) }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("a", { href: "https://www.prosopo.io/#features?ref=accounts.prosopo.io&utm_campaign=widget&utm_medium=checkbox", target: "_blank", "aria-label": "Visit prosopo.io to learn more about the service and its accessibility options.", children: jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
70
- __html: darkMode === "light" ? logoWithoutTextBlack : logoWithoutTextWhite
71
- } }), jsxRuntime.jsx("div", { css: logoStyle, dangerouslySetInnerHTML: {
72
- __html: darkMode === "light" ? logoWithTextBlack : logoWithTextWhite
73
- } })] }) }) }) })] })] }) }) });
35
+ }, children: jsxRuntime.jsx("div", { style: { display: "inline-flex" }, children: jsxRuntime.jsx(LoadingSpinner.LoadingSpinner, { themeColor }) }) }) }) }) }), jsxRuntime.jsx("div", { style: { display: "inline-flex", flexDirection: "column" }, children: jsxRuntime.jsx("a", { href: WidgetConstants.WIDGET_URL, target: "_blank", "aria-label": WidgetConstants.WIDGET_URL_TEXT, children: jsxRuntime.jsx("div", { style: { flex: 1 }, children: jsxRuntime.jsx(Logo, { themeColor }) }) }) })] })] }) }) }) }) });
74
36
  };
75
- const logoWithTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#1d1d1b;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
76
- const logoWithTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2062.63 468.67" height="35px" width="140px"><defs><style>.cls-1{fill:#fff;}</style></defs><title>Prosopo Logo Black</title><path class="cls-1" d="M335.55,1825.19A147.75,147.75,0,0,1,483.3,1972.94h50.5c0-109.49-88.76-198.25-198.25-198.25v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M269.36,1891.39A147.74,147.74,0,0,1,417.1,2039.13h50.5c0-109.49-88.75-198.24-198.24-198.24v50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M414,2157.17a147.75,147.75,0,0,1-147.74-147.74h-50.5c0,109.49,88.75,198.24,198.24,198.24v-50.5Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M480.17,2091a147.74,147.74,0,0,1-147.74-147.75H281.92c0,109.49,88.76,198.25,198.25,198.25V2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M862.8,2017.5q-27.39,22.86-78.25,22.86h-65v112.19H654.82v-312h134q46.32,0,73.86,24.13t27.55,74.72Q890.2,1994.64,862.8,2017.5ZM813,1905.1q-12.37-10.36-34.7-10.38H719.59v91.87h58.75q22.32,0,34.7-11.22t12.39-35.56Q825.43,1915.48,813,1905.1Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1045.69,1916.42c.78.08,2.51.19,5.19.32v61.81c-3.81-.42-7.2-.71-10.16-.85s-5.36-.21-7.2-.21q-36.4,0-48.89,23.71-7,13.33-7,41.06v110.29H916.89V1921.82h57.58V1962q14-23.07,24.34-31.54,16.94-14.18,44-14.18C1044,1916.32,1044.92,1916.35,1045.69,1916.42Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1265.64,2124.32q-29.21,36.06-88.69,36.06t-88.69-36.06Q1059,2088.26,1059,2037.5q0-49.9,29.22-86.5t88.69-36.59q59.47,0,88.69,36.59t29.21,86.5Q1294.85,2088.26,1265.64,2124.32ZM1217.38,2091q14.17-18.81,14.18-53.48t-14.18-53.37q-14.19-18.7-40.64-18.71T1136,1984.13q-14.29,18.72-14.29,53.37T1136,2091q14.28,18.81,40.75,18.81T1217.38,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1371.81,2078.88q1.92,16.1,8.29,22.87,11.28,12.06,41.7,12.06,17.85,0,28.39-5.29t10.53-15.88a17.12,17.12,0,0,0-8.48-15.45q-8.49-5.28-63.12-18.2-39.33-9.73-55.41-24.35-16.08-14.39-16.09-41.49,0-32,25.14-54.93t70.75-23q43.26,0,70.53,17.25t31.29,59.59H1455q-1.27-11.64-6.58-18.42-10-12.27-34-12.28-19.74,0-28.13,6.14t-8.38,14.4c0,6.91,3,11.93,8.92,15q8.89,4.89,63,16.73,36,8.46,54.05,25.61,17.77,17.35,17.78,43.39,0,34.3-25.56,56t-79,21.7q-54.51,0-80.49-23t-26-58.53Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1745.54,2124.32q-29.22,36.06-88.7,36.06t-88.69-36.06q-29.2-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.7,36.59t29.21,86.5Q1774.75,2088.26,1745.54,2124.32ZM1697.27,2091q14.19-18.81,14.19-53.48t-14.19-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.28,53.37t14.28,53.48q14.3,18.81,40.75,18.81T1697.27,2091Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M1992.75,1946.59q28.24,29.84,28.23,87.63,0,61-27.58,92.93t-71.06,32q-27.69,0-46-13.76-10-7.62-19.6-22.23v120.24H1797V1921.82h57.79v34.08q9.79-15,20.88-23.71,20.23-15.43,48.15-15.45Q1964.53,1916.74,1992.75,1946.59Zm-46.3,43.39q-12.3-20.52-39.88-20.53-33.15,0-45.54,31.11-6.43,16.51-6.42,41.92,0,40.21,21.58,56.51,12.82,9.53,30.37,9.53,25.45,0,38.83-19.48t13.36-51.86Q1958.75,2010.51,1946.45,1990Z" transform="translate(-215.73 -1774.69)"/><path class="cls-1" d="M2249.14,2124.32q-29.2,36.06-88.69,36.06t-88.69-36.06q-29.22-36.06-29.21-86.82,0-49.9,29.21-86.5t88.69-36.59q59.49,0,88.69,36.59t29.22,86.5Q2278.36,2088.26,2249.14,2124.32ZM2200.88,2091q14.19-18.81,14.18-53.48t-14.18-53.37q-14.18-18.7-40.64-18.71t-40.75,18.71q-14.28,18.72-14.29,53.37t14.29,53.48q14.3,18.81,40.75,18.81T2200.88,2091Z" transform="translate(-215.73 -1774.69)"/></svg>';
77
- const logoWithoutTextWhite = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#fff"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#fff"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#fff"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#fff"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
78
- const logoWithoutTextBlack = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 260 348" height="35px"><path id="Vector" d="M95.7053 40.2707C127.005 40.2707 157.022 52.6841 179.154 74.78C201.286 96.8759 213.719 126.844 213.719 158.093H254.056C254.056 70.7808 183.16 -4.57764e-05 95.7053 -4.57764e-05V40.2707Z" fill="#000000"/><path id="Vector_2" d="M42.8365 93.0614C58.3333 93.0614 73.6784 96.1087 87.9955 102.029C102.313 107.95 115.322 116.628 126.279 127.568C137.237 138.508 145.93 151.496 151.86 165.79C157.79 180.084 160.843 195.404 160.843 210.875H201.179C201.179 123.564 130.291 52.7906 42.8365 52.7906V93.0614Z" fill="#000000"/><path id="Vector_3" d="M158.367 305.005C127.07 305.003 97.056 292.59 74.926 270.496C52.796 248.402 40.3626 218.437 40.3604 187.191H0.0239563C0.0239563 274.503 70.9123 345.276 158.367 345.276V305.005Z" fill="#000000"/><path id="Vector_4" d="M211.219 252.239C195.722 252.239 180.376 249.191 166.059 243.27C151.741 237.349 138.732 228.67 127.774 217.729C116.816 206.788 108.123 193.799 102.194 179.505C96.2637 165.21 93.2121 149.889 93.2132 134.417H52.8687C52.8687 221.729 123.765 292.509 211.219 292.509V252.239Z" fill="#000000"/></g><defs><clipPath id="clip0_1_2"><rect width="254" height="345" fill="white"/></clipPath></defs></svg>';
79
37
  exports.ProcaptchaPlaceholder = ProcaptchaPlaceholder;
@@ -5,16 +5,16 @@ const react = require("@emotion/react");
5
5
  const theme = require("./theme.cjs");
6
6
  const react$1 = require("react");
7
7
  const checkboxBefore = react.css`{
8
- &:before {
9
- content: '""';
10
- position: absolute;
11
- height: 100%;
12
- width: 100%;
13
- }
8
+ &:before {
9
+ content: '""';
10
+ position: absolute;
11
+ height: 100%;
12
+ width: 100%;
13
+ }
14
14
  }`;
15
15
  const baseStyle = {
16
- width: "2.2em",
17
- height: "2.2em",
16
+ width: "28px",
17
+ height: "28px",
18
18
  top: "auto",
19
19
  left: "auto",
20
20
  opacity: "1",
@@ -25,7 +25,7 @@ const baseStyle = {
25
25
  borderStyle: "solid",
26
26
  borderWidth: "1px"
27
27
  };
28
- const Checkbox = ({ themeColor, onChange, checked }) => {
28
+ const Checkbox = ({ themeColor, onChange, checked, labelText }) => {
29
29
  const theme$1 = react$1.useMemo(() => themeColor === "light" ? theme.lightTheme : theme.darkTheme, [themeColor]);
30
30
  const checkboxStyleBase = {
31
31
  ...baseStyle,
@@ -36,10 +36,20 @@ const Checkbox = ({ themeColor, onChange, checked }) => {
36
36
  return {
37
37
  ...checkboxStyleBase,
38
38
  borderColor: hover ? theme$1.palette.background.contrastText : theme$1.palette.grey[400],
39
- appearance: checked ? "auto" : "none"
39
+ appearance: checked ? "auto" : "none",
40
+ flex: 1,
41
+ margin: "0 15px"
40
42
  };
41
43
  }, [hover, theme$1, checked]);
42
- return jsxRuntime.jsx("input", { onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), css: checkboxBefore, type: "checkbox", "aria-live": "assertive", "aria-haspopup": "true", onChange, checked, style: checkboxStyle });
44
+ const id = react$1.useId();
45
+ return jsxRuntime.jsxs("span", { style: { display: "inline-flex" }, children: [jsxRuntime.jsx("input", { name: id, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), css: checkboxBefore, type: "checkbox", "aria-live": "assertive", "aria-haspopup": "true", onChange, checked, style: checkboxStyle }), jsxRuntime.jsx("label", { css: {
46
+ color: theme$1.palette.background.contrastText,
47
+ position: "relative",
48
+ display: "flex",
49
+ cursor: "pointer",
50
+ userSelect: "none",
51
+ top: "4px"
52
+ }, htmlFor: id, children: labelText })] });
43
53
  };
44
54
  exports.Checkbox = Checkbox;
45
55
  exports.default = Checkbox;