altcha 2.2.4 → 3.0.0-beta.1
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.txt +1 -1
- package/README.md +152 -197
- package/dist/external/altcha.css +1 -0
- package/dist/external/altcha.js +6681 -0
- package/dist/external/altcha.min.js +1 -0
- package/dist/external/altcha.umd.cjs +6687 -0
- package/dist/external/altcha.umd.min.cjs +1 -0
- package/dist/external/index.d.ts +1 -0
- package/dist/i18n/419.d.ts +1 -0
- package/dist/i18n/af.d.ts +1 -0
- package/dist/i18n/af.js +22 -0
- package/dist/i18n/af.umd.cjs +27 -0
- package/dist/i18n/africa.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/africa.js +52 -97
- package/dist/i18n/africa.umd.cjs +159 -0
- package/dist/i18n/all.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/all.js +465 -299
- package/dist/i18n/all.umd.cjs +1325 -0
- package/dist/i18n/am.d.ts +1 -0
- package/dist/i18n/am.js +22 -0
- package/dist/i18n/am.umd.cjs +27 -0
- package/dist/i18n/americas.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/americas.js +24 -85
- package/dist/i18n/americas.umd.cjs +71 -0
- package/dist/i18n/ar.d.ts +1 -0
- package/dist/i18n/ar.js +22 -0
- package/dist/i18n/ar.umd.cjs +27 -0
- package/dist/i18n/asia.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/asia.js +177 -158
- package/dist/i18n/asia.umd.cjs +511 -0
- package/dist/i18n/az.d.ts +1 -0
- package/dist/i18n/az.js +22 -0
- package/dist/i18n/az.umd.cjs +27 -0
- package/dist/i18n/be.d.ts +1 -0
- package/dist/i18n/be.js +22 -0
- package/dist/i18n/be.umd.cjs +27 -0
- package/dist/i18n/bg.d.ts +1 -0
- package/dist/i18n/bg.js +22 -0
- package/dist/i18n/bg.umd.cjs +27 -0
- package/dist/i18n/bn.d.ts +1 -0
- package/dist/i18n/bn.js +22 -0
- package/dist/i18n/bn.umd.cjs +27 -0
- package/dist/i18n/br.d.ts +1 -0
- package/dist/i18n/bs.d.ts +1 -0
- package/dist/i18n/bs.js +22 -0
- package/dist/i18n/bs.umd.cjs +27 -0
- package/dist/i18n/ca.d.ts +1 -0
- package/dist/i18n/ca.js +22 -0
- package/dist/i18n/ca.umd.cjs +27 -0
- package/dist/i18n/cn.d.ts +1 -0
- package/dist/i18n/cs.d.ts +1 -0
- package/dist/i18n/cs.js +22 -0
- package/dist/i18n/cs.umd.cjs +27 -0
- package/dist/i18n/da.d.ts +1 -0
- package/dist/i18n/da.js +22 -0
- package/dist/i18n/da.umd.cjs +27 -0
- package/dist/i18n/de.d.ts +1 -0
- package/dist/i18n/de.js +22 -0
- package/dist/i18n/de.umd.cjs +27 -0
- package/dist/i18n/el.d.ts +1 -0
- package/dist/i18n/el.js +22 -0
- package/dist/i18n/el.umd.cjs +27 -0
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.js +22 -0
- package/dist/i18n/en.umd.cjs +27 -0
- package/dist/i18n/es-419.js +22 -0
- package/dist/i18n/es-419.umd.cjs +27 -0
- package/dist/i18n/es-es.js +22 -0
- package/dist/i18n/es-es.umd.cjs +27 -0
- package/dist/i18n/es.d.ts +1 -0
- package/dist/i18n/et.d.ts +1 -0
- package/dist/i18n/et.js +22 -0
- package/dist/i18n/et.umd.cjs +27 -0
- package/dist/i18n/eu.d.ts +1 -0
- package/dist/i18n/eu.js +22 -0
- package/dist/i18n/eu.umd.cjs +27 -0
- package/dist/i18n/europe.d.ts +1 -0
- package/{dist_i18n → dist/i18n}/europe.js +283 -209
- package/dist/i18n/europe.umd.cjs +819 -0
- package/dist/i18n/fa.d.ts +1 -0
- package/dist/i18n/fa.js +22 -0
- package/dist/i18n/fa.umd.cjs +27 -0
- package/dist/i18n/fi.d.ts +1 -0
- package/dist/i18n/fi.js +22 -0
- package/dist/i18n/fi.umd.cjs +27 -0
- package/dist/i18n/fr-ca.js +22 -0
- package/dist/i18n/fr-ca.umd.cjs +27 -0
- package/dist/i18n/fr-fr.js +22 -0
- package/dist/i18n/fr-fr.umd.cjs +27 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/ga.d.ts +1 -0
- package/dist/i18n/ga.js +22 -0
- package/dist/i18n/ga.umd.cjs +27 -0
- package/dist/i18n/he.d.ts +1 -0
- package/dist/i18n/he.js +22 -0
- package/dist/i18n/he.umd.cjs +27 -0
- package/dist/i18n/hi.d.ts +1 -0
- package/dist/i18n/hi.js +22 -0
- package/dist/i18n/hi.umd.cjs +27 -0
- package/dist/i18n/hr.d.ts +1 -0
- package/dist/i18n/hr.js +22 -0
- package/dist/i18n/hr.umd.cjs +27 -0
- package/dist/i18n/hu.d.ts +1 -0
- package/dist/i18n/hu.js +22 -0
- package/dist/i18n/hu.umd.cjs +27 -0
- package/dist/i18n/hy.d.ts +1 -0
- package/dist/i18n/hy.js +22 -0
- package/dist/i18n/hy.umd.cjs +27 -0
- package/dist/i18n/id.d.ts +1 -0
- package/dist/i18n/id.js +22 -0
- package/dist/i18n/id.umd.cjs +27 -0
- package/dist/i18n/is.d.ts +1 -0
- package/dist/i18n/is.js +22 -0
- package/dist/i18n/is.umd.cjs +27 -0
- package/dist/i18n/it.d.ts +1 -0
- package/dist/i18n/it.js +22 -0
- package/dist/i18n/it.umd.cjs +27 -0
- package/dist/i18n/ja.d.ts +1 -0
- package/dist/i18n/ja.js +22 -0
- package/dist/i18n/ja.umd.cjs +27 -0
- package/dist/i18n/ka.d.ts +1 -0
- package/dist/i18n/ka.js +22 -0
- package/dist/i18n/ka.umd.cjs +27 -0
- package/dist/i18n/kk.d.ts +1 -0
- package/dist/i18n/kk.js +22 -0
- package/dist/i18n/kk.umd.cjs +27 -0
- package/dist/i18n/ko.d.ts +1 -0
- package/dist/i18n/ko.js +22 -0
- package/dist/i18n/ko.umd.cjs +27 -0
- package/dist/i18n/lb.d.ts +1 -0
- package/dist/i18n/lb.js +22 -0
- package/dist/i18n/lb.umd.cjs +27 -0
- package/dist/i18n/lt.d.ts +1 -0
- package/dist/i18n/lt.js +22 -0
- package/dist/i18n/lt.umd.cjs +27 -0
- package/dist/i18n/lv.d.ts +1 -0
- package/dist/i18n/lv.js +22 -0
- package/dist/i18n/lv.umd.cjs +27 -0
- package/dist/i18n/me.d.ts +1 -0
- package/dist/i18n/me.js +22 -0
- package/dist/i18n/me.umd.cjs +27 -0
- package/dist/i18n/mk.d.ts +1 -0
- package/dist/i18n/mk.js +22 -0
- package/dist/i18n/mk.umd.cjs +27 -0
- package/dist/i18n/mr.d.ts +1 -0
- package/dist/i18n/mr.js +22 -0
- package/dist/i18n/mr.umd.cjs +27 -0
- package/dist/i18n/mt.d.ts +1 -0
- package/dist/i18n/mt.js +22 -0
- package/dist/i18n/mt.umd.cjs +27 -0
- package/dist/i18n/nb.d.ts +1 -0
- package/dist/i18n/nb.js +22 -0
- package/dist/i18n/nb.umd.cjs +27 -0
- package/dist/i18n/nl.d.ts +1 -0
- package/dist/i18n/nl.js +22 -0
- package/dist/i18n/nl.umd.cjs +27 -0
- package/dist/i18n/pl.d.ts +1 -0
- package/dist/i18n/pl.js +22 -0
- package/dist/i18n/pl.umd.cjs +27 -0
- package/dist/i18n/pt-br.js +22 -0
- package/dist/i18n/pt-br.umd.cjs +27 -0
- package/dist/i18n/pt-pt.js +22 -0
- package/dist/i18n/pt-pt.umd.cjs +27 -0
- package/dist/i18n/pt.d.ts +1 -0
- package/dist/i18n/ro.d.ts +1 -0
- package/dist/i18n/ro.js +22 -0
- package/dist/i18n/ro.umd.cjs +27 -0
- package/dist/i18n/ru.d.ts +1 -0
- package/dist/i18n/ru.js +22 -0
- package/dist/i18n/ru.umd.cjs +27 -0
- package/dist/i18n/sk.d.ts +1 -0
- package/dist/i18n/sk.js +22 -0
- package/dist/i18n/sk.umd.cjs +27 -0
- package/dist/i18n/sl.d.ts +1 -0
- package/dist/i18n/sl.js +22 -0
- package/dist/i18n/sl.umd.cjs +27 -0
- package/dist/i18n/sq.d.ts +1 -0
- package/dist/i18n/sq.js +22 -0
- package/dist/i18n/sq.umd.cjs +27 -0
- package/dist/i18n/sr.d.ts +1 -0
- package/dist/i18n/sr.js +22 -0
- package/dist/i18n/sr.umd.cjs +27 -0
- package/dist/i18n/sv.d.ts +1 -0
- package/dist/i18n/sv.js +22 -0
- package/dist/i18n/sv.umd.cjs +27 -0
- package/dist/i18n/sw.d.ts +1 -0
- package/dist/i18n/sw.js +22 -0
- package/dist/i18n/sw.umd.cjs +27 -0
- package/dist/i18n/ta.d.ts +1 -0
- package/dist/i18n/ta.js +22 -0
- package/dist/i18n/ta.umd.cjs +27 -0
- package/dist/i18n/te.d.ts +1 -0
- package/dist/i18n/te.js +22 -0
- package/dist/i18n/te.umd.cjs +27 -0
- package/dist/i18n/th.d.ts +1 -0
- package/dist/i18n/th.js +22 -0
- package/dist/i18n/th.umd.cjs +27 -0
- package/dist/i18n/tk.d.ts +1 -0
- package/dist/i18n/tk.js +22 -0
- package/dist/i18n/tk.umd.cjs +27 -0
- package/dist/i18n/tr.d.ts +1 -0
- package/dist/i18n/tr.js +22 -0
- package/dist/i18n/tr.umd.cjs +27 -0
- package/dist/i18n/tw.d.ts +1 -0
- package/dist/i18n/uk.d.ts +1 -0
- package/dist/i18n/uk.js +22 -0
- package/dist/i18n/uk.umd.cjs +27 -0
- package/dist/i18n/ur.d.ts +1 -0
- package/dist/i18n/ur.js +22 -0
- package/dist/i18n/ur.umd.cjs +27 -0
- package/dist/i18n/uz.d.ts +1 -0
- package/dist/i18n/uz.js +22 -0
- package/dist/i18n/uz.umd.cjs +27 -0
- package/dist/i18n/vi.d.ts +1 -0
- package/dist/i18n/vi.js +22 -0
- package/dist/i18n/vi.umd.cjs +27 -0
- package/dist/i18n/yo.d.ts +1 -0
- package/dist/i18n/yo.js +22 -0
- package/dist/i18n/yo.umd.cjs +27 -0
- package/dist/i18n/zh-cn.js +22 -0
- package/dist/i18n/zh-cn.umd.cjs +27 -0
- package/dist/i18n/zh-tw.js +22 -0
- package/dist/i18n/zh-tw.umd.cjs +27 -0
- package/dist/lib/index.d.ts +143 -0
- package/dist/lib/index.js +1344 -0
- package/dist/lib/index.min.js +1 -0
- package/dist/lib/index.umd.cjs +1348 -0
- package/dist/lib/index.umd.min.cjs +1 -0
- package/dist/main/altcha.i18n.js +8389 -0
- package/dist/main/altcha.i18n.min.js +1 -0
- package/dist/main/altcha.i18n.umd.cjs +8392 -0
- package/dist/main/altcha.i18n.umd.min.cjs +1 -0
- package/dist/main/altcha.js +7069 -0
- package/dist/main/altcha.min.js +1 -0
- package/dist/main/altcha.umd.cjs +7072 -0
- package/dist/main/altcha.umd.min.cjs +1 -0
- package/dist/plugins/obfuscation.plugin.d.ts +1 -0
- package/dist/plugins/obfuscation.plugin.js +320 -0
- package/dist/plugins/obfuscation.plugin.min.js +1 -0
- package/dist/plugins/obfuscation.plugin.umd.cjs +325 -0
- package/dist/plugins/obfuscation.plugin.umd.min.cjs +1 -0
- package/dist/themes/aqua.css +19 -0
- package/dist/themes/aqua.min.css +1 -0
- package/dist/themes/business.css +15 -0
- package/dist/themes/business.min.css +1 -0
- package/dist/themes/caramel.css +19 -0
- package/dist/themes/caramel.min.css +1 -0
- package/dist/themes/cupcake.css +16 -0
- package/dist/themes/cupcake.min.css +1 -0
- package/dist/themes/cyberpunk.css +24 -0
- package/dist/themes/cyberpunk.min.css +1 -0
- package/dist/themes/lime.css +13 -0
- package/dist/themes/lime.min.css +1 -0
- package/dist/themes/wireframe.css +17 -0
- package/dist/themes/wireframe.min.css +1 -0
- package/dist/types/generic.d.ts +25 -0
- package/dist/types/generic.js +1 -0
- package/dist/types/global.d.ts +5 -0
- package/dist/types/global.js +1 -0
- package/dist/types/index.d.ts +352 -0
- package/dist/types/index.js +23 -0
- package/dist/types/jsx.d.ts +13 -0
- package/dist/types/jsx.js +1 -0
- package/dist/types/react.d.ts +35 -0
- package/dist/types/react.js +1 -0
- package/dist/types/svelte.d.ts +26 -0
- package/dist/types/svelte.js +1 -0
- package/dist/workers/argon2id.js +786 -0
- package/dist/workers/pbkdf2.js +166 -0
- package/dist/workers/scrypt.js +739 -0
- package/dist/workers/sha.js +160 -0
- package/package.json +115 -95
- package/dist/altcha.d.ts +0 -183
- package/dist/altcha.i18n.d.ts +0 -183
- package/dist/altcha.i18n.js +0 -4182
- package/dist/altcha.i18n.umd.js +0 -4
- package/dist/altcha.js +0 -3105
- package/dist/altcha.umd.cjs +0 -4
- package/dist_external/altcha.css +0 -1
- package/dist_external/altcha.d.ts +0 -183
- package/dist_external/altcha.js +0 -3075
- package/dist_external/altcha.umd.cjs +0 -3
- package/dist_external/worker.js +0 -1
- package/dist_i18n/af.d.ts +0 -1
- package/dist_i18n/af.js +0 -94
- package/dist_i18n/af.umd.cjs +0 -1
- package/dist_i18n/africa.d.ts +0 -1
- package/dist_i18n/africa.umd.cjs +0 -1
- package/dist_i18n/all.d.ts +0 -1
- package/dist_i18n/all.umd.cjs +0 -1
- package/dist_i18n/am.d.ts +0 -1
- package/dist_i18n/am.js +0 -94
- package/dist_i18n/am.umd.cjs +0 -1
- package/dist_i18n/americas.d.ts +0 -1
- package/dist_i18n/americas.umd.cjs +0 -1
- package/dist_i18n/ar.d.ts +0 -1
- package/dist_i18n/ar.js +0 -94
- package/dist_i18n/ar.umd.cjs +0 -1
- package/dist_i18n/asia.d.ts +0 -1
- package/dist_i18n/asia.umd.cjs +0 -1
- package/dist_i18n/az.d.ts +0 -1
- package/dist_i18n/az.js +0 -94
- package/dist_i18n/az.umd.cjs +0 -1
- package/dist_i18n/be.d.ts +0 -1
- package/dist_i18n/be.js +0 -94
- package/dist_i18n/be.umd.cjs +0 -1
- package/dist_i18n/bg.d.ts +0 -1
- package/dist_i18n/bg.js +0 -94
- package/dist_i18n/bg.umd.cjs +0 -1
- package/dist_i18n/bn.d.ts +0 -1
- package/dist_i18n/bn.js +0 -94
- package/dist_i18n/bn.umd.cjs +0 -1
- package/dist_i18n/bs.d.ts +0 -1
- package/dist_i18n/bs.js +0 -94
- package/dist_i18n/bs.umd.cjs +0 -1
- package/dist_i18n/ca.d.ts +0 -1
- package/dist_i18n/ca.js +0 -94
- package/dist_i18n/ca.umd.cjs +0 -1
- package/dist_i18n/cs.d.ts +0 -1
- package/dist_i18n/cs.js +0 -94
- package/dist_i18n/cs.umd.cjs +0 -1
- package/dist_i18n/da.d.ts +0 -1
- package/dist_i18n/da.js +0 -94
- package/dist_i18n/da.umd.cjs +0 -1
- package/dist_i18n/de.d.ts +0 -1
- package/dist_i18n/de.js +0 -94
- package/dist_i18n/de.umd.cjs +0 -1
- package/dist_i18n/el.d.ts +0 -1
- package/dist_i18n/el.js +0 -94
- package/dist_i18n/el.umd.cjs +0 -1
- package/dist_i18n/en.d.ts +0 -1
- package/dist_i18n/en.js +0 -94
- package/dist_i18n/en.umd.cjs +0 -1
- package/dist_i18n/es-419.d.ts +0 -1
- package/dist_i18n/es-419.js +0 -94
- package/dist_i18n/es-419.umd.cjs +0 -1
- package/dist_i18n/es-es.d.ts +0 -1
- package/dist_i18n/es-es.js +0 -94
- package/dist_i18n/es-es.umd.cjs +0 -1
- package/dist_i18n/et.d.ts +0 -1
- package/dist_i18n/et.js +0 -94
- package/dist_i18n/et.umd.cjs +0 -1
- package/dist_i18n/eu.d.ts +0 -1
- package/dist_i18n/eu.js +0 -94
- package/dist_i18n/eu.umd.cjs +0 -1
- package/dist_i18n/europe.d.ts +0 -1
- package/dist_i18n/europe.umd.cjs +0 -1
- package/dist_i18n/fa.d.ts +0 -1
- package/dist_i18n/fa.js +0 -94
- package/dist_i18n/fa.umd.cjs +0 -1
- package/dist_i18n/fi.d.ts +0 -1
- package/dist_i18n/fi.js +0 -94
- package/dist_i18n/fi.umd.cjs +0 -1
- package/dist_i18n/fr-ca.d.ts +0 -1
- package/dist_i18n/fr-ca.js +0 -94
- package/dist_i18n/fr-ca.umd.cjs +0 -1
- package/dist_i18n/fr-fr.d.ts +0 -1
- package/dist_i18n/fr-fr.js +0 -94
- package/dist_i18n/fr-fr.umd.cjs +0 -1
- package/dist_i18n/ga.d.ts +0 -1
- package/dist_i18n/ga.js +0 -94
- package/dist_i18n/ga.umd.cjs +0 -1
- package/dist_i18n/he.d.ts +0 -1
- package/dist_i18n/he.js +0 -94
- package/dist_i18n/he.umd.cjs +0 -1
- package/dist_i18n/hi.d.ts +0 -1
- package/dist_i18n/hi.js +0 -94
- package/dist_i18n/hi.umd.cjs +0 -1
- package/dist_i18n/hr.d.ts +0 -1
- package/dist_i18n/hr.js +0 -94
- package/dist_i18n/hr.umd.cjs +0 -1
- package/dist_i18n/hu.d.ts +0 -1
- package/dist_i18n/hu.js +0 -94
- package/dist_i18n/hu.umd.cjs +0 -1
- package/dist_i18n/hy.d.ts +0 -1
- package/dist_i18n/hy.js +0 -94
- package/dist_i18n/hy.umd.cjs +0 -1
- package/dist_i18n/id.d.ts +0 -1
- package/dist_i18n/id.js +0 -94
- package/dist_i18n/id.umd.cjs +0 -1
- package/dist_i18n/is.d.ts +0 -1
- package/dist_i18n/is.js +0 -94
- package/dist_i18n/is.umd.cjs +0 -1
- package/dist_i18n/it.d.ts +0 -1
- package/dist_i18n/it.js +0 -94
- package/dist_i18n/it.umd.cjs +0 -1
- package/dist_i18n/ja.d.ts +0 -1
- package/dist_i18n/ja.js +0 -94
- package/dist_i18n/ja.umd.cjs +0 -1
- package/dist_i18n/ka.d.ts +0 -1
- package/dist_i18n/ka.js +0 -94
- package/dist_i18n/ka.umd.cjs +0 -1
- package/dist_i18n/kk.d.ts +0 -1
- package/dist_i18n/kk.js +0 -94
- package/dist_i18n/kk.umd.cjs +0 -1
- package/dist_i18n/ko.d.ts +0 -1
- package/dist_i18n/ko.js +0 -94
- package/dist_i18n/ko.umd.cjs +0 -1
- package/dist_i18n/lb.d.ts +0 -1
- package/dist_i18n/lb.js +0 -94
- package/dist_i18n/lb.umd.cjs +0 -1
- package/dist_i18n/lt.d.ts +0 -1
- package/dist_i18n/lt.js +0 -94
- package/dist_i18n/lt.umd.cjs +0 -1
- package/dist_i18n/lv.d.ts +0 -1
- package/dist_i18n/lv.js +0 -94
- package/dist_i18n/lv.umd.cjs +0 -1
- package/dist_i18n/me.d.ts +0 -1
- package/dist_i18n/me.js +0 -94
- package/dist_i18n/me.umd.cjs +0 -1
- package/dist_i18n/mk.d.ts +0 -1
- package/dist_i18n/mk.js +0 -94
- package/dist_i18n/mk.umd.cjs +0 -1
- package/dist_i18n/mr.d.ts +0 -1
- package/dist_i18n/mr.js +0 -94
- package/dist_i18n/mr.umd.cjs +0 -1
- package/dist_i18n/mt.d.ts +0 -1
- package/dist_i18n/mt.js +0 -94
- package/dist_i18n/mt.umd.cjs +0 -1
- package/dist_i18n/nb.d.ts +0 -1
- package/dist_i18n/nb.js +0 -95
- package/dist_i18n/nb.umd.cjs +0 -1
- package/dist_i18n/nl.d.ts +0 -1
- package/dist_i18n/nl.js +0 -94
- package/dist_i18n/nl.umd.cjs +0 -1
- package/dist_i18n/pl.d.ts +0 -1
- package/dist_i18n/pl.js +0 -94
- package/dist_i18n/pl.umd.cjs +0 -1
- package/dist_i18n/pt-br.d.ts +0 -1
- package/dist_i18n/pt-br.js +0 -94
- package/dist_i18n/pt-br.umd.cjs +0 -1
- package/dist_i18n/pt-pt.d.ts +0 -1
- package/dist_i18n/pt-pt.js +0 -94
- package/dist_i18n/pt-pt.umd.cjs +0 -1
- package/dist_i18n/ro.d.ts +0 -1
- package/dist_i18n/ro.js +0 -94
- package/dist_i18n/ro.umd.cjs +0 -1
- package/dist_i18n/ru.d.ts +0 -1
- package/dist_i18n/ru.js +0 -94
- package/dist_i18n/ru.umd.cjs +0 -1
- package/dist_i18n/sk.d.ts +0 -1
- package/dist_i18n/sk.js +0 -94
- package/dist_i18n/sk.umd.cjs +0 -1
- package/dist_i18n/sl.d.ts +0 -1
- package/dist_i18n/sl.js +0 -94
- package/dist_i18n/sl.umd.cjs +0 -1
- package/dist_i18n/sq.d.ts +0 -1
- package/dist_i18n/sq.js +0 -94
- package/dist_i18n/sq.umd.cjs +0 -1
- package/dist_i18n/sr.d.ts +0 -1
- package/dist_i18n/sr.js +0 -94
- package/dist_i18n/sr.umd.cjs +0 -1
- package/dist_i18n/sv.d.ts +0 -1
- package/dist_i18n/sv.js +0 -94
- package/dist_i18n/sv.umd.cjs +0 -1
- package/dist_i18n/sw.d.ts +0 -1
- package/dist_i18n/sw.js +0 -94
- package/dist_i18n/sw.umd.cjs +0 -1
- package/dist_i18n/ta.d.ts +0 -1
- package/dist_i18n/ta.js +0 -94
- package/dist_i18n/ta.umd.cjs +0 -1
- package/dist_i18n/te.d.ts +0 -1
- package/dist_i18n/te.js +0 -94
- package/dist_i18n/te.umd.cjs +0 -1
- package/dist_i18n/th.d.ts +0 -1
- package/dist_i18n/th.js +0 -94
- package/dist_i18n/th.umd.cjs +0 -1
- package/dist_i18n/tk.d.ts +0 -1
- package/dist_i18n/tk.js +0 -94
- package/dist_i18n/tk.umd.cjs +0 -1
- package/dist_i18n/tr.d.ts +0 -1
- package/dist_i18n/tr.js +0 -94
- package/dist_i18n/tr.umd.cjs +0 -1
- package/dist_i18n/uk.d.ts +0 -1
- package/dist_i18n/uk.js +0 -94
- package/dist_i18n/uk.umd.cjs +0 -1
- package/dist_i18n/ur.d.ts +0 -1
- package/dist_i18n/ur.js +0 -94
- package/dist_i18n/ur.umd.cjs +0 -1
- package/dist_i18n/uz.d.ts +0 -1
- package/dist_i18n/uz.js +0 -94
- package/dist_i18n/uz.umd.cjs +0 -1
- package/dist_i18n/vi.d.ts +0 -1
- package/dist_i18n/vi.js +0 -94
- package/dist_i18n/vi.umd.cjs +0 -1
- package/dist_i18n/yo.d.ts +0 -1
- package/dist_i18n/yo.js +0 -94
- package/dist_i18n/yo.umd.cjs +0 -1
- package/dist_i18n/zh-cn.d.ts +0 -1
- package/dist_i18n/zh-cn.js +0 -94
- package/dist_i18n/zh-cn.umd.cjs +0 -1
- package/dist_i18n/zh-tw.d.ts +0 -1
- package/dist_i18n/zh-tw.js +0 -94
- package/dist_i18n/zh-tw.umd.cjs +0 -1
- package/dist_plugins/analytics.d.ts +0 -1
- package/dist_plugins/analytics.js +0 -276
- package/dist_plugins/analytics.umd.cjs +0 -1
- package/dist_plugins/obfuscation.d.ts +0 -1
- package/dist_plugins/obfuscation.js +0 -129
- package/dist_plugins/obfuscation.umd.cjs +0 -1
- package/dist_plugins/upload.d.ts +0 -1
- package/dist_plugins/upload.js +0 -503
- package/dist_plugins/upload.umd.cjs +0 -4
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Daniel Regeci, BAU Software s.r.o.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -9,33 +9,32 @@ ALTCHA is fully compliant with:
|
|
|
9
9
|
|
|
10
10
|
For more details, visit [altcha.org](https://altcha.org).
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Playground
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- **Code Challenge (New in v2)**: Supports accessible code challenges ("enter code from image") with an audio option.
|
|
16
|
-
- **Cookie-Free Design**: GDPR-compliant by default—no cookies or tracking.
|
|
17
|
-
- **Fully Accessible**: Meets WCAG 2.2 AA-level standards and complies with the European Accessibility Act (EAA).
|
|
18
|
-
- **Lightweight**: Minimal bundle size for fast page loads and optimal performance.
|
|
19
|
-
- **Self-Hosted**: No dependency on third-party services.
|
|
14
|
+
Want to see it in action? Visit the official ALTCHA Playground to experiment with widget configurations, fine-tune the Proof-of-Work (PoW) settings, and see how the security mechanisms hold up in real-time.
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
[Open ALTCHA Playground](https://playground.altcha.org)
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
## Features
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
- **Frictionless Experience**: Eliminates frustrating visual puzzles by using background **Proof-of-Work (PoW)** for a seamless user journey.
|
|
21
|
+
- **Hardware-Resistant Security**: Leverages **Argon2 and Scrypt** memory-bound algorithms to neutralize hardware acceleration (ASICs/GPUs) and sophisticated bot farms.
|
|
22
|
+
- **Accessible Code Challenges**: Provides "Enter code from image" fallbacks with built-in **audio support** for visually impaired users.
|
|
23
|
+
- **Privacy by Design**: Fully **GDPR compliant** and cookie-free—no tracking, no fingerprinting, and no data collection.
|
|
24
|
+
- **Universal Accessibility**: Engineered to exceed **WCAG 2.2 AA** standards, ensuring compliance with the **European Accessibility Act (EAA)**.
|
|
25
|
+
- **Lightweight**: Minimal footprint and zero dependencies, optimized for rapid page loads and high-performance environments.
|
|
26
|
+
- **100% Self-Hosted**: Maintain full sovereignty over your infrastructure with no reliance on third-party API availability.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
- **Improved RTL (right-to-left) language support**
|
|
29
|
-
- **Enhanced WCAG accessibility**
|
|
30
|
-
- **Support for accessible code challenges** (image + audio options)
|
|
31
|
-
- **Overlay UI**
|
|
28
|
+
## What’s New in v3
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
- **Next-Gen PoW**: Significant performance gains and reduced CPU overhead through an optimized verification mechanism.
|
|
31
|
+
- **Advanced Bot Defense**: Native support for **Argon2 and Scrypt**, raising the cost of attack for automated scripts and specialized hardware.
|
|
32
|
+
- **Modern UI**: Refined styling options, including a suite of new built-in themes and improved CSS custom property support.
|
|
33
|
+
- **Developer Experience**: Improved TypeScript support and streamlined integration.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
### Migrating from v2
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
- [ALTCHA Sentinel](https://altcha.org/docs/v2/sentinel): Sentinel is a new self-hosted solution that replaces the previous SaaS services and the SpamFilter. We recommend migrating to Sentinel for better compliance, enhanced security, unlimited verifications, and an adaptive Captcha with code-challenge support.
|
|
37
|
+
See [MIGRATION-v2.md](/MIGRATION-v2.md).
|
|
39
38
|
|
|
40
39
|
## Examples
|
|
41
40
|
|
|
@@ -60,11 +59,11 @@ Explore starter templates for popular frameworks:
|
|
|
60
59
|
|
|
61
60
|
## Plugins & CMS
|
|
62
61
|
|
|
63
|
-
- [Libraries and plugins](https://altcha.org/docs/
|
|
62
|
+
- [Libraries and plugins](https://altcha.org/docs/v2/libraries/)
|
|
64
63
|
|
|
65
64
|
## Usage
|
|
66
65
|
|
|
67
|
-
The ALTCHA widget is distributed as a **Web Component
|
|
66
|
+
The ALTCHA widget is distributed as a **Web Component**.
|
|
68
67
|
|
|
69
68
|
### 1. Install ALTCHA
|
|
70
69
|
|
|
@@ -84,30 +83,19 @@ Or load via `<script>` tag:
|
|
|
84
83
|
<script async defer src="/altcha.js" type="module"></script>
|
|
85
84
|
```
|
|
86
85
|
|
|
87
|
-
**CDN**:
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<script
|
|
91
|
-
async
|
|
92
|
-
defer
|
|
93
|
-
src="https://cdn.jsdelivr.net/gh/altcha-org/altcha@main/dist/altcha.min.js"
|
|
94
|
-
type="module"
|
|
95
|
-
></script>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
86
|
### 2. Add `<altcha-widget>` to Your Forms
|
|
99
87
|
|
|
100
88
|
```html
|
|
101
89
|
<form>
|
|
102
|
-
|
|
90
|
+
<altcha-widget challenge="https://..."></altcha-widget>
|
|
103
91
|
</form>
|
|
104
92
|
```
|
|
105
93
|
|
|
106
|
-
See [configuration options](#configuration) or the [website integration docs](https://altcha.org/docs/
|
|
94
|
+
See [configuration options](#configuration) or the [website integration docs](https://altcha.org/docs/v2/widget-integration).
|
|
107
95
|
|
|
108
96
|
### 3. Integrate with Your Server
|
|
109
97
|
|
|
110
|
-
Refer to the [server documentation](https://altcha.org/docs/server-integration) for implementation details.
|
|
98
|
+
Refer to the [server documentation](https://altcha.org/docs/v2/server-integration) for implementation details.
|
|
111
99
|
|
|
112
100
|
## Supported Browsers
|
|
113
101
|
|
|
@@ -131,61 +119,107 @@ ALTCHA is optimized for performance:
|
|
|
131
119
|
|
|
132
120
|
| Distribution | Size (GZIPped) |
|
|
133
121
|
| ---------------------------- | -------------- |
|
|
134
|
-
| ALTCHA |
|
|
135
|
-
| ALTCHA with all translations |
|
|
122
|
+
| ALTCHA | 31 kB |
|
|
123
|
+
| ALTCHA with all translations | 49 kB |
|
|
136
124
|
| Cloudflare Turnstile | 85+ kB |
|
|
137
125
|
| hCaptcha | 250+ kB |
|
|
138
126
|
| reCAPTCHA | 300+ kB |
|
|
139
127
|
|
|
140
|
-
When GZIPped, it totals about
|
|
128
|
+
When GZIPped, it totals about 31 kB, making ALTCHA’s widget about 90% smaller than reCAPTCHA.
|
|
141
129
|
|
|
142
130
|
## Content Security Policy (CSP)
|
|
143
131
|
|
|
144
|
-
The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/
|
|
132
|
+
The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/dist/external`. Learn more in the [documentation](https://altcha.org/docs/v2/widget-integration).
|
|
145
133
|
|
|
146
134
|
## Configuration
|
|
147
135
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
|
|
188
|
-
|
|
136
|
+
### Programmatic Configuration
|
|
137
|
+
|
|
138
|
+
The widget provides a global `$altcha` object to manage defaults, register new algorithms, or add custom translations.
|
|
139
|
+
|
|
140
|
+
To update an existing widget instance, use the `.configure()` [method](). This is the preferred way to handle complex objects or functions that cannot be passed via HTML attributes.
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
// Set defaults for all future widget instances:
|
|
144
|
+
$altcha.defaults.set({
|
|
145
|
+
challenge: 'https://api.example.com/challenge',
|
|
146
|
+
debug: true
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Update a specific instance dynamically:
|
|
150
|
+
const widget = document.querySelector('altcha-widget');
|
|
151
|
+
widget.configure({
|
|
152
|
+
workers: 2,
|
|
153
|
+
language: 'fr'
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Attribute Configuration
|
|
158
|
+
|
|
159
|
+
For simple implementations, the widget supports a subset of configuration options directly as HTML attributes. For more advanced properties, use the programmatic approach above.
|
|
160
|
+
|
|
161
|
+
**Supported Attributes:**
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<altcha-widget
|
|
165
|
+
auto="off"
|
|
166
|
+
challenge="https://api.example.com/challenge"
|
|
167
|
+
configuration='{"delay": 500}'
|
|
168
|
+
display="standard"
|
|
169
|
+
language="en"
|
|
170
|
+
name="altcha"
|
|
171
|
+
theme="default"
|
|
172
|
+
type="checkbox"
|
|
173
|
+
workers="4"
|
|
174
|
+
></altcha-widget>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
> [!TIP]
|
|
178
|
+
> The `configuration` attribute accepts a JSON-encoded string, allowing you to pass complex settings directly in your HTML markup.
|
|
179
|
+
|
|
180
|
+
### Core Settings
|
|
181
|
+
|
|
182
|
+
- **`name`**: The `name` attribute of the hidden input field containing the payload. (Default: `"altcha"`)
|
|
183
|
+
- **`challenge`**: The challenge data or the URL to fetch a new challenge from.
|
|
184
|
+
- **`type`**: Visual style of the interaction element (`'native'`, `'checkbox'`, or `'switch'`).
|
|
185
|
+
- **`language`**: The ISO alpha-2 language code for localization (requires corresponding i18n file).
|
|
186
|
+
- **`workers`**: The number of Web Workers to spawn for proof-of-work calculations.
|
|
187
|
+
|
|
188
|
+
### Automation & Timing
|
|
189
|
+
|
|
190
|
+
- **`auto`**: Determines when verification triggers automatically (`'off'`, `'onfocus'`, `'onload'`, or `'onsubmit'`).
|
|
191
|
+
- **`minDuration`**: The minimum verification time in milliseconds; adds an artificial delay if the PoW is faster. (Default: `500`)
|
|
192
|
+
- **`retryOnOutOfMemoryError`**: Automatically attempts to restart verification with fewer workers if the browser runs out of memory (Argon2 and Scrypt only).
|
|
193
|
+
|
|
194
|
+
### UI & Display
|
|
195
|
+
|
|
196
|
+
- **`display`**: The visual layout mode (`'standard'`, `'bar'`, `'floating'`, `'overlay'`, or `'invisible'`).
|
|
197
|
+
- **`barPlacement`**: Vertical position of the widget when `display` is set to `bar` (`'bottom'` or `'top'`).
|
|
198
|
+
- **`hideLogo`**: Hides the ALTCHA logo icon.
|
|
199
|
+
- **`hideFooter`**: Hides the "ALTCHA" attribution link.
|
|
200
|
+
- **`validationMessage`**: Custom validation message for the HTML5 `setCustomValidity` API.
|
|
201
|
+
|
|
202
|
+
### Floating Widget Settings
|
|
203
|
+
|
|
204
|
+
- **`floatingAnchor`**: The element or CSS selector the floating UI attaches to. Defaults to the first submit button.
|
|
205
|
+
- **`floatingPlacement`**: Preferred position relative to the anchor (`'auto'`, `'bottom'`, or `'top'`).
|
|
206
|
+
- **`floatingOffset`**: Vertical offset in pixels between the UI and its anchor. (Default: `12`)
|
|
207
|
+
- **`floatingPersist`**: Whether the floating widget remains visible after successful verification.
|
|
208
|
+
|
|
209
|
+
### Modal & Challenge Settings
|
|
210
|
+
|
|
211
|
+
- **`codeChallengeDisplay`**: UI layout for the code-challenge modal (`'standard'`, `'overlay'`, or `'bottomsheet'`).
|
|
212
|
+
- **`overlayContent`**: CSS selector for an element to be mirrored inside the overlay modal.
|
|
213
|
+
- **`audioChallengeLanguage`**: Forces a specific language for audio-based challenges.
|
|
214
|
+
- **`disableAutoFocus`**: Prevents the code-challenge modal from stealing focus when opened.
|
|
215
|
+
|
|
216
|
+
### Advanced & Debugging
|
|
217
|
+
|
|
218
|
+
- **`debug`**: Enables verbose logging in the browser console.
|
|
219
|
+
- **`test`**: Mocks a successful verification for testing environments.
|
|
220
|
+
- **`mockError`**: Forces the widget into a failed state for UI testing.
|
|
221
|
+
- **`fetch`**: A custom `fetch` implementation for network requests.
|
|
222
|
+
- **`verifyFunction`**: A custom verification handler that overrides default network verification.
|
|
189
223
|
|
|
190
224
|
## Internationalization (i18n)
|
|
191
225
|
|
|
@@ -227,14 +261,14 @@ To override the language manually, use the `language` attribute:
|
|
|
227
261
|
|
|
228
262
|
### Customizing Translations
|
|
229
263
|
|
|
230
|
-
You can override default translations by updating the global `
|
|
264
|
+
You can override default translations by updating the global `$altcha` registry (`globalThis.$altcha.i18n`):
|
|
231
265
|
|
|
232
266
|
```js
|
|
233
267
|
import 'altcha/i18n/de';
|
|
234
268
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
269
|
+
$altcha.i18n.set('de', {
|
|
270
|
+
...$altcha.i18n.get('de'),
|
|
271
|
+
label: 'Ich bin ein Mensch' // Custom label
|
|
238
272
|
});
|
|
239
273
|
```
|
|
240
274
|
|
|
@@ -242,106 +276,31 @@ globalThis.altchaI18n.set('de', {
|
|
|
242
276
|
|
|
243
277
|
For additional verification, ALTCHA supports **image/audio code challenges** (e.g., "Enter the code from the image"). This feature requires [ALTCHA Sentinel](https://altcha.org/docs/v2/sentinel) or a custom server implementation.
|
|
244
278
|
|
|
245
|
-
##
|
|
246
|
-
|
|
247
|
-
Extend functionality with plugins:
|
|
279
|
+
## Data Obfuscation
|
|
248
280
|
|
|
249
|
-
|
|
250
|
-
import 'altcha/obfuscation'; // Data obfuscation
|
|
251
|
-
import 'altcha/upload'; // File uploads
|
|
252
|
-
import 'altcha'; // Main package
|
|
253
|
-
```
|
|
281
|
+
[Data obfuscation]() is supported via an official plugin, which must be imported alongside the widget. This is ideal for protecting sensitive information, such as email addresses, from scrapers until the challenge is solved.
|
|
254
282
|
|
|
255
|
-
|
|
283
|
+
### Programmatic Usage
|
|
256
284
|
|
|
257
|
-
|
|
258
|
-
<altcha-widget plugins="upload,obfuscation"></altcha-widget>
|
|
259
|
-
```
|
|
285
|
+
The plugin exports `obfuscate` and `deobfuscate` functions for manual data handling:
|
|
260
286
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
- **obfuscation**: Secure sensitive data (emails, phone numbers).
|
|
264
|
-
- **upload**: File uploads with ALTCHA Sentinel or a custom backend.
|
|
287
|
+
```ts
|
|
288
|
+
import { obfuscate } from 'altcha/plugins/obfuscation';
|
|
265
289
|
|
|
266
|
-
|
|
290
|
+
const obfuscatedData = await obfuscate('mailto:hello@example.com');
|
|
291
|
+
```
|
|
267
292
|
|
|
268
|
-
|
|
293
|
+
### Widget Integration
|
|
269
294
|
|
|
270
|
-
|
|
271
|
-
document.querySelector('#altcha').configure({
|
|
272
|
-
challenge: {
|
|
273
|
-
algorithm: 'SHA-256',
|
|
274
|
-
challenge: '...',
|
|
275
|
-
salt: '...',
|
|
276
|
-
signature: '...',
|
|
277
|
-
},
|
|
278
|
-
strings: {
|
|
279
|
-
label: 'Verify',
|
|
280
|
-
},
|
|
281
|
-
});
|
|
282
|
-
```
|
|
295
|
+
To use the plugin with the widget, ensure `altcha/plugins/obfuscation` is imported **after** the main library. Use the `data-obfuscated` attribute to provide the Base64-encoded payload:
|
|
283
296
|
|
|
284
|
-
|
|
297
|
+
```html
|
|
298
|
+
<script>
|
|
299
|
+
import 'altcha';
|
|
300
|
+
import 'altcha/plugins/obfuscation';
|
|
301
|
+
</script>
|
|
285
302
|
|
|
286
|
-
|
|
287
|
-
export interface Configure {
|
|
288
|
-
auto?: 'off' | 'onfocus' | 'onload' | 'onsubmit';
|
|
289
|
-
challenge?: {
|
|
290
|
-
codeChallenge?: {
|
|
291
|
-
audio?: string;
|
|
292
|
-
image: string;
|
|
293
|
-
length?: number;
|
|
294
|
-
};
|
|
295
|
-
algorithm: string;
|
|
296
|
-
challenge: string;
|
|
297
|
-
maxnumber?: number;
|
|
298
|
-
salt: string;
|
|
299
|
-
signature: string;
|
|
300
|
-
};
|
|
301
|
-
challengeurl?: string;
|
|
302
|
-
credentials?: 'omit' | 'same-origin' | 'include' | boolean;
|
|
303
|
-
customfetch?:
|
|
304
|
-
| string
|
|
305
|
-
| ((url: string, init?: RequestInit) => Promise<Response>);
|
|
306
|
-
debug?: boolean;
|
|
307
|
-
delay?: number;
|
|
308
|
-
disableautofocus?: boolean;
|
|
309
|
-
disablerefetchonexpire?: boolean;
|
|
310
|
-
expire?: number;
|
|
311
|
-
floating?: 'auto' | 'top' | 'bottom';
|
|
312
|
-
floatinganchor?: string;
|
|
313
|
-
floatingoffset?: number;
|
|
314
|
-
floatingpersist?: boolean | 'focus';
|
|
315
|
-
hidefooter?: boolean;
|
|
316
|
-
hidelogo?: boolean;
|
|
317
|
-
maxnumber?: number;
|
|
318
|
-
mockerror?: boolean;
|
|
319
|
-
name?: string;
|
|
320
|
-
obfuscated?: string;
|
|
321
|
-
overlay?: boolean;
|
|
322
|
-
refetchonexpire?: boolean; // deprecated, use disablerefetchonexpire
|
|
323
|
-
spamfilter?: boolean | 'ipAddress' | SpamFilter; // deprecated
|
|
324
|
-
strings?: {
|
|
325
|
-
ariaLinkLabel: strin;
|
|
326
|
-
enterCode: string;
|
|
327
|
-
enterCodeAria: string;
|
|
328
|
-
error: string;
|
|
329
|
-
expired: string;
|
|
330
|
-
footer: string;
|
|
331
|
-
getAudioChallenge: string;
|
|
332
|
-
label: string;
|
|
333
|
-
loading: string;
|
|
334
|
-
reload: strin;
|
|
335
|
-
verificationRequired: string;
|
|
336
|
-
verified: string;
|
|
337
|
-
verifying: string;
|
|
338
|
-
waitAlert: string;
|
|
339
|
-
};
|
|
340
|
-
test?: boolean | number | 'delay';
|
|
341
|
-
verifyurl?: string;
|
|
342
|
-
workers?: number;
|
|
343
|
-
workerurl?: string;
|
|
344
|
-
}
|
|
303
|
+
<altcha-widget data-obfuscated="${obfuscatedData}" display="floating"></altcha-widget>
|
|
345
304
|
```
|
|
346
305
|
|
|
347
306
|
## Methods
|
|
@@ -349,40 +308,40 @@ export interface Configure {
|
|
|
349
308
|
- `configure(options)` - Configures the widget with the given options. See Configuration options above.
|
|
350
309
|
- `getConfiguration()` - Returns the current configuration.
|
|
351
310
|
- `getState()` - Returns the current `state` of the widget.
|
|
352
|
-
- `show()` - Displays the widget (used in
|
|
353
|
-
- `hide()` - Hides the widget (used in
|
|
311
|
+
- `show()` - Displays the widget (used in some display modes).
|
|
312
|
+
- `hide()` - Hides the widget (used in some display modes).
|
|
354
313
|
- `reset(state?, err?)` - Resets the internal `state`, optionally with an error.
|
|
355
314
|
- `setState(state, err?)` - Manually sets the specified `state`, optionally with an error.
|
|
356
|
-
- `
|
|
357
|
-
- `verify()` - Initiates the verification process.
|
|
358
|
-
|
|
315
|
+
- `updateUI()` - Force UI update or reposition, for example for the floating display mode.
|
|
316
|
+
- `verify()` - Initiates the verification process.
|
|
359
317
|
|
|
360
318
|
## Events
|
|
361
319
|
|
|
362
|
-
- **
|
|
320
|
+
- **codechallenge** - Triggers when code-challenge verification is requested.
|
|
321
|
+
- **expired** - Triggers when the challenge expires.
|
|
363
322
|
- **load** - Triggers when the widget loads. The exported methods become available after this event.
|
|
364
|
-
- **
|
|
365
|
-
- **serververification** -
|
|
323
|
+
- **outofmemory** - Triggers when an Out-Of-Memory error is received (Argon2 and Scrypt only).
|
|
324
|
+
- **serververification** -Triggers upon a server verification.
|
|
366
325
|
- **statechange** - Triggers whenever an internal `state` changes.
|
|
367
326
|
- **verified** - Triggers when the challenge is verified.
|
|
368
327
|
|
|
369
328
|
```ts
|
|
370
329
|
enum State {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
330
|
+
CODE = 'code',
|
|
331
|
+
ERROR = 'error',
|
|
332
|
+
VERIFIED = 'verified',
|
|
333
|
+
VERIFYING = 'verifying',
|
|
334
|
+
UNVERIFIED = 'unverified',
|
|
335
|
+
EXPIRED = 'expired'
|
|
377
336
|
}
|
|
378
337
|
```
|
|
379
338
|
|
|
380
339
|
Using events:
|
|
381
340
|
|
|
382
341
|
```js
|
|
383
|
-
document.querySelector('
|
|
384
|
-
|
|
385
|
-
|
|
342
|
+
document.querySelector('altcha-widget').addEventListener('statechange', (ev) => {
|
|
343
|
+
// See enum State above
|
|
344
|
+
console.log('state:', ev.detail.state);
|
|
386
345
|
});
|
|
387
346
|
```
|
|
388
347
|
|
|
@@ -393,10 +352,6 @@ document.querySelector('#altcha').addEventListener('statechange', (ev) => {
|
|
|
393
352
|
|
|
394
353
|
See [Contributing Guide](https://github.com/altcha-org/altcha/blob/main/CONTRIBUTING.md) and please follow our [Code of Conduct](https://github.com/altcha-org/altcha/blob/main/CODE_OF_CONDUCT.md).
|
|
395
354
|
|
|
396
|
-
## Sponsorship
|
|
397
|
-
|
|
398
|
-
This project is sponsored by [BAUSW.com - Digital Construction Site Diary](https://bausw.com/digital-construction-diary/), promoting transparency and trust in construction projects with real-time documentation.
|
|
399
|
-
|
|
400
355
|
## License
|
|
401
356
|
|
|
402
|
-
|
|
357
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--altcha-border-color:var(--altcha-color-neutral);--altcha-border-width:1px;--altcha-border-radius:6px;--altcha-color-base:light-dark(oklch(100% 0.00011 271.152),oklch(20.904% 0.00002 271.152));--altcha-color-base-content:light-dark(oklch(20.904% 0.00002 271.152),oklch(100% 0.00011 271.152));--altcha-color-error:oklch(51.284% 0.20527 28.678);--altcha-color-error-content:oklch(100% 0.00011 271.152);--altcha-color-neutral:light-dark(oklch(83.591% 0.0001 271.152),oklch(46.04% 0.00005 271.152));--altcha-color-neutral-content:light-dark(oklch(46.76% 0.00005 271.152),oklch(100% 0.00011 271.152));--altcha-color-primary:oklch(40.279% 0.2449 268.131);--altcha-color-primary-content:oklch(100% 0.00011 271.152);--altcha-color-success:oklch(55.748% 0.18968 142.511);--altcha-color-success-content:oklch(100% 0.00011 271.152);--altcha-checkbox-border-color:var(--altcha-color-neutral);--altcha-checkbox-border-radius:5px;--altcha-checkbox-border-width:var(--altcha-border-width);--altcha-checkbox-outline:2px solid var(--altcha-checkbox-outline-color);--altcha-checkbox-outline-color:light-dark(color-mix(in srgb,var(--altcha-color-primary) 20%,transparent),color-mix(in srgb,var(--altcha-color-primary) 60%,transparent));--altcha-checkbox-outline-offset:2px;--altcha-checkbox-size:22px;--altcha-checkbox-transition-duration:var(--altcha-transition-duration);--altcha-input-background-color:var(--altcha-color-base);--altcha-input-border-radius:3px;--altcha-input-border-width:1px;--altcha-input-color:var(--altcha-color-base-content);--altcha-max-width:320px;--altcha-padding:0.75rem;--altcha-popover-arrow-size:6px;--altcha-popover-color:var(--altcha-border-color);--altcha-shadow:drop-shadow(3px 3px 6px oklch(0% 0 0/0.2));--altcha-spinner-color:var(--altcha-color-base-content);--altcha-switch-background-color:var(--altcha-color-neutral);--altcha-switch-border-radius:calc(infinity*1px);--altcha-switch-height:var(--altcha-checkbox-size);--altcha-switch-padding:0.25rem;--altcha-switch-width:calc(var(--altcha-checkbox-size)*1.75);--altcha-switch-toggle-border-radius:100%;--altcha-switch-toggle-color:var(--altcha-color-neutral-content);--altcha-switch-toggle-size:calc(var(--altcha-switch-height) - var(--altcha-switch-padding)*2);--altcha-transition-duration:0.6s;--altcha-z-index:99999999;--altcha-z-index-popover:999999999}.altcha{all:revert-layer;display:none;font-family:inherit;font-size:inherit;position:relative}.altcha[data-visible]{display:block}.altcha *,.altcha-popover,.altcha-popover *{all:revert-layer;box-sizing:border-box;font-family:inherit;font-size:inherit;line-height:1.25}.altcha a,.altcha-popover a{color:currentColor;text-decoration:none}.altcha a:hover,.altcha-popover a:hover{color:currentColor}.altcha-main{align-items:start;background-color:var(--altcha-color-base);border:var(--altcha-border-width,1px) solid var(--altcha-border-color);border-radius:var(--altcha-border-radius,0);color:var(--altcha-color-base-content);display:flex;flex-direction:column;gap:.5rem;justify-content:space-between;max-width:var(--altcha-max-width,100%);padding:var(--altcha-padding)}.altcha-main>*{display:flex;width:100%}.altcha-main>:first-child{flex-grow:1}.altcha-checkbox-wrap{align-items:center;display:flex;flex-direction:row;flex-grow:1;gap:.5rem}.altcha-checkbox-wrap>*{display:flex}.altcha-logo{opacity:.7}.altcha-footer{align-items:center;display:flex;flex-grow:1;font-size:.7rem;gap:.5rem;justify-content:flex-end;opacity:.7}.altcha-error{font-size:.85rem}.altcha-button{align-items:center;background:var(--altcha-color-primary);border:var(--altcha-input-border-width) solid var(--altcha-color-primary);border-radius:var(--altcha-input-border-radius);color:var(--altcha-color-primary-content);cursor:pointer;display:flex;font-size:.9rem;gap:.5rem;padding:.35rem}.altcha-button:focus{border-color:var(--altcha-color-primary);outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-button>.altcha-spinner,.altcha-button>svg{height:20px;width:20px}.altcha-button-secondary{background:transparent;border-color:var(--altcha-color-neutral);color:var(--altcha-color-neutral-content)}.altcha-input{background:var(--altcha-input-background-color);border:var(--altcha-input-border-width) solid var(--altcha-color-neutral);border-radius:var(--altcha-input-border-radius);color:var(--altcha-input-color);flex-grow:1;font-size:1rem;min-width:0;padding:.25rem;width:auto}.altcha-input:focus{border-color:var(--altcha-color-primary);outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-spinner{animation:altcha-rotate .6s linear infinite;border:var(--altcha-checkbox-border-width) solid var(--altcha-spinner-color);border-bottom-color:transparent;border-radius:100%;border-right-color:transparent;opacity:.5}.altcha-popover{background-color:var(--altcha-color-base);border:var(--altcha-border-width) solid var(--altcha-border-color);border-radius:var(--altcha-border-radius);color:var(--altcha-color-base-content);filter:var(--altcha-shadow);left:calc(var(--altcha-padding)/2);max-width:calc(var(--altcha-max-width) - var(--altcha-padding));position:absolute;top:calc(var(--altcha-padding) + var(--altcha-checkbox-size) + var(--altcha-popover-arrow-size));z-index:var(--altcha-z-index-popover)}.altcha-popover-arrow{border-bottom-color:transparent;border:var(--altcha-popover-arrow-size) solid transparent;border-bottom:var(--altcha-popover-arrow-size) solid var(--altcha-popover-color);content:"";height:0;left:calc(var(--altcha-checkbox-size)/2);position:absolute;top:calc(var(--altcha-popover-arrow-size)*-2);width:0}.altcha-popover-content{max-height:100dvh;overflow:auto;padding:var(--altcha-padding)}.altcha-popover[data-top=true][data-display=standard]{bottom:calc(100% - var(--altcha-padding) + var(--altcha-popover-arrow-size));top:auto}.altcha-popover[data-top=true][data-display=standard] .altcha-popover-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-popover-color);bottom:calc(var(--altcha-popover-arrow-size)*-2);top:auto}.altcha-popover[data-variant=error]{--altcha-popover-color:var(--altcha-color-error);background-color:var(--altcha-color-error);border-color:var(--altcha-color-error);color:var(--altcha-color-error-content)}.altcha-popover[data-variant=error] .altcha-popover-content{padding:calc(var(--altcha-padding)/1.5) var(--altcha-padding)}.altcha-popover[data-display=overlay]{animation:altcha-overlay-slidein .5s forwards;top:45%;transform:translate(-50%,-50%)}.altcha-popover[data-display=bottomsheet],.altcha-popover[data-display=overlay]{left:50%;position:fixed;width:var(--altcha-max-width);z-index:var(--altcha-z-index)}.altcha-popover[data-display=bottomsheet]{animation:altcha-bottomsheet-slideup .5s forwards;border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:-100%;top:auto;transform:translate(-50%)}.altcha-popover[data-display=bottomsheet] .altcha-popover-content{padding-bottom:calc(var(--altcha-padding)*2)}.altcha-popover-backdrop{background:var(--altcha-color-base-content);bottom:0;left:0;opacity:.1;position:fixed;right:0;top:0;transition:opacity .5s;z-index:var(--altcha-z-index)}.altcha-popover-close{color:var(--altcha-color-base-content);cursor:pointer;display:inline-block;font-size:1rem;height:1.25rem;line-height:.95;position:absolute;right:0;text-align:center;text-shadow:0 0 1px var(--altcha-color-base);top:-1.5rem;width:1.25rem;z-index:var(--altcha-z-index)}.altcha-popover[data-display=bottomsheet] .altcha-footer,.altcha-popover[data-display=overlay] .altcha-footer{align-items:center;gap:.5rem;justify-content:center;padding-top:1rem}.altcha-popover[data-display=bottomsheet] .altcha-footer svg,.altcha-popover[data-display=overlay] .altcha-footer svg{height:18px;vertical-align:middle;width:18px}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-title{font-weight:600}.altcha-code-challenge-text{font-size:.85rem}.altcha-code-challenge-image{background:#fff;border:var(--altcha-input-border-width) solid var(--altcha-color-neutral);border-radius:var(--altcha-input-border-radius);height:50px;object-fit:contain}.altcha-code-challenge-row{display:flex;gap:.5rem}.altcha-code-challenge-buttons{align-items:center;display:flex;flex-direction:column;gap:.5rem;justify-content:space-between;margin-top:var(--altcha-padding)}.altcha-code-challenge-buttons button{justify-content:center;width:100%}.altcha-checkbox{cursor:pointer;position:relative}.altcha-checkbox,.altcha-checkbox input{height:var(--altcha-checkbox-size);width:var(--altcha-checkbox-size)}.altcha-checkbox input{appearance:none;background:var(--altcha-input-background-color);border:var(--altcha-checkbox-border-width,2px) solid var(--altcha-checkbox-border-color);border-radius:var(--altcha-checkbox-border-radius);left:0;margin:0;outline:none;padding:0;position:absolute;top:0}.altcha-checkbox input:before{background:var(--altcha-color-neutral);border-radius:var(--altcha-checkbox-border-radius);content:"";display:block;height:100%;transform:scale(0);width:100%}.altcha-checkbox input:focus{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-checkbox input:checked{background-color:var(--altcha-color-success);border-color:var(--altcha-color-success)}.altcha-checkbox input:checked:before{background-color:var(--altcha-color-success);opacity:0;transform:scale(2.2);transition:all var(--altcha-checkbox-transition-duration) ease;transition-delay:.1s}.altcha-checkbox svg{--altcha-radio-svg-size:calc(var(--altcha-checkbox-size)*0.5);--altcha-radio-svg-offset:calc(var(--altcha-checkbox-size)*0.25);fill:none;height:var(--altcha-radio-svg-size);left:var(--altcha-radio-svg-offset);opacity:0;position:absolute;stroke:currentColor;stroke-dasharray:16px;stroke-dashoffset:16px;stroke-linecap:round;stroke-linejoin:round;stroke-width:2;top:var(--altcha-radio-svg-offset);transform:translateZ(0);width:var(--altcha-radio-svg-size)}.altcha-checkbox input:checked+svg{color:var(--altcha-color-success-content);opacity:1;stroke-dashoffset:0;transition:all var(--altcha-checkbox-transition-duration) ease;transition-delay:.1s}.altcha-checkbox-spinner{display:none;height:var(--altcha-checkbox-size);left:0;position:absolute;top:0;width:var(--altcha-checkbox-size)}.altcha-checkbox[data-loading=true] input{appearance:none;opacity:0;pointer-events:none}.altcha-checkbox[data-loading=true] .altcha-checkbox-spinner{display:block}.altcha-checkbox-native{position:relative}.altcha-checkbox-native,.altcha-checkbox-native input{height:var(--altcha-checkbox-size);width:var(--altcha-checkbox-size)}.altcha-checkbox-native input{margin:0}.altcha-checkbox-native input:focus{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-checkbox-native-spinner{display:none;height:var(--altcha-checkbox-size);left:0;position:absolute;top:0;width:var(--altcha-checkbox-size)}.altcha-checkbox-native[data-loading=true] input{appearance:none;opacity:0;pointer-events:none}.altcha-checkbox-native[data-loading=true] .altcha-checkbox-native-spinner{display:block}.altcha-switch{align-items:center;background-color:var(--altcha-switch-background-color);border-radius:var(--altcha-switch-border-radius);cursor:pointer;display:flex;height:var(--altcha-switch-height);padding:var(--altcha-switch-padding);position:relative;width:var(--altcha-switch-width)}.altcha-switch:focus-within{outline:var(--altcha-checkbox-outline);outline-offset:var(--altcha-checkbox-outline-offset)}.altcha-switch input{appearance:none;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.altcha-switch-toggle{align-items:center;background-color:var(--altcha-switch-toggle-color);border-radius:var(--altcha-switch-toggle-border-radius);display:flex;justify-content:center;left:var(--altcha-switch-padding);position:absolute;transition:width .15s ease-out,left .15s ease-out}.altcha-switch-spinner,.altcha-switch-toggle{height:var(--altcha-switch-toggle-size);width:var(--altcha-switch-toggle-size)}.altcha-switch-spinner{display:none}.altcha-switch[data-loading=true]{pointer-events:none}.altcha-switch[data-loading=true] .altcha-switch-spinner{display:block}.altcha-switch[data-loading=true] .altcha-switch-toggle{background-color:transparent;left:calc(50% - var(--altcha-switch-toggle-size)/2)}[data-state=verified] .altcha-switch{--altcha-switch-background-color:var(--altcha-color-success)}[data-state=verified] .altcha-switch-toggle{background-color:var(--altcha-color-success-content)}[data-state=verified] .altcha-switch-toggle,[dir=rtl] .altcha-switch-toggle{left:calc(100% - var(--altcha-switch-height) + var(--altcha-switch-padding))}[dir=rtl][data-state=verified] .altcha-switch-toggle{left:var(--altcha-switch-padding)}.altcha-floating-arrow{border:6px solid transparent;border-bottom:6px solid var(--altcha-border-color);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-overlay-backdrop{bottom:0;left:0;position:fixed;right:0;top:0;transition:opacity var(--altcha-transition-duration);z-index:var(--altcha-z-index)}.altcha-overlay-close{color:currentColor;cursor:pointer;display:inline-block;font-size:1rem;height:1rem;line-height:.85;position:absolute;right:0;text-align:center;text-shadow:0 0 1px var(--altcha-color-base);top:-1.5rem;width:1rem;z-index:var(--altcha-z-index)}.altcha[data-display=overlay]{animation:altcha-overlay-slidein var(--altcha-transition-duration) forwards;filter:var(--altcha-shadow);left:50%;opacity:0;position:fixed;top:45%;transform:translate(-50%,-50%);z-index:var(--altcha-z-index)}.altcha[data-display=overlay] .altcha-main{width:var(--altcha-max-width)}.altcha[data-display=floating]{display:none;filter:var(--altcha-shadow);left:var(--altcha-floating-left,-100%);position:fixed;top:var(--altcha-floating-top,-100%);z-index:var(--altcha-z-index)}.altcha[data-display=floating] .altcha-main{width:var(--altcha-max-width)}.altcha[data-display=floating][data-placement=top] .altcha-floating-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-border-color);bottom:-12px;top:auto}.altcha[data-display=floating][data-visible]{display:flex}.altcha[data-display=bar]{bottom:-100%;filter:var(--altcha-shadow);left:0;position:fixed;right:0;transition:bottom var(--altcha-transition-duration),top var(--altcha-transition-duration);z-index:var(--altcha-z-index)}.altcha[data-display=bar] .altcha-main{align-items:center;border-radius:0;border-width:var(--altcha-border-width) 0 0 0;flex-direction:row;max-width:100%!important}.altcha[data-display=bar] .altcha-main>*{width:auto}.altcha[data-display=bar][data-placement=top]{bottom:auto;top:-100%}.altcha[data-display=bar][data-placement=top] .altcha-main{border-width:0 0 var(--altcha-border-width) 0}.altcha[data-display=bar][data-placement=bottom]:not([data-state=unverified]){bottom:0}.altcha[data-display=bar][data-placement=top]:not([data-state=unverified]){top:0}.altcha[data-display=invisible]{display:none}@keyframes altcha-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes altcha-bottomsheet-slideup{to{bottom:0}}@keyframes altcha-overlay-slidein{to{opacity:1;top:50%}}
|