altcha 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -6
- package/dist/altcha.i18n.js +1664 -1714
- package/dist/altcha.i18n.umd.js +4 -4
- package/dist/altcha.js +1614 -1664
- package/dist/altcha.umd.cjs +4 -4
- package/dist_external/altcha.css +1 -1
- package/dist_external/altcha.js +1665 -1713
- package/dist_external/altcha.umd.cjs +3 -3
- package/dist_external/worker.js +1 -1
- package/package.json +9 -20
- package/dist_plugins/analytics.d.ts +0 -1
- package/dist_plugins/analytics.js +0 -290
- package/dist_plugins/analytics.umd.cjs +0 -1
- package/dist_plugins/obfuscation.d.ts +0 -1
- package/dist_plugins/obfuscation.js +0 -138
- package/dist_plugins/obfuscation.umd.cjs +0 -1
- package/dist_plugins/upload.d.ts +0 -1
- package/dist_plugins/upload.js +0 -475
- package/dist_plugins/upload.umd.cjs +0 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function($,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):($=typeof globalThis<"u"?globalThis:$||self,S($.altcha={}))})(this,function($){"use strict";var La=Object.defineProperty;var el=$=>{throw TypeError($)};var Pa=($,S,W)=>S in $?La($,S,{enumerable:!0,configurable:!0,writable:!0,value:W}):$[S]=W;var Re=($,S,W)=>Pa($,typeof S!="symbol"?S+"":S,W),tl=($,S,W)=>S.has($)||el("Cannot "+W);var ve=($,S,W)=>(tl($,S,"read from private field"),W?W.call($):S.get($)),rn=($,S,W)=>S.has($)?el("Cannot add the same private member more than once"):S instanceof WeakSet?S.add($):S.set($,W),nn=($,S,W,zt)=>(tl($,S,"write to private field"),zt?zt.call($,W):S.set($,W),W);var hi,Ve,pe;var S=typeof document<"u"?document.currentScript:null;const W="5";typeof window<"u"&&((hi=window.__svelte??(window.__svelte={})).v??(hi.v=new Set)).add(W);const zt=1,rl=4,nl=8,il=16,ll=1,ol=2,xr="[",ln="[!",on="]",_t={},ue=Symbol(),al="http://www.w3.org/1999/xhtml",an=!1;function sn(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var un=Array.isArray,sl=Array.prototype.indexOf,ul=Array.from,Qt=Object.keys,Tt=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,fl=Object.getOwnPropertyDescriptors,cl=Object.prototype,dl=Array.prototype,fn=Object.getPrototypeOf,cn=Object.isExtensible;const mt=()=>{};function dn(e){for(var t=0;t<e.length;t++)e[t]()}function vl(e,t,r=!1){return e===void 0?r?t():t:e}const we=2,vn=4,er=8,kr=16,Fe=32,et=64,tr=128,he=256,rr=512,fe=1024,xe=2048,tt=4096,bt=8192,nr=16384,hl=32768,$r=65536,gl=1<<19,hn=1<<20,Sr=1<<21,Nt=Symbol("$state"),gn=Symbol("legacy props"),_l=Symbol("");function ml(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function pl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function yl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function wl(){throw new Error("https://svelte.dev/e/hydration_failed")}function El(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Cl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Al(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Il(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ir(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let V=!1;function pt(e){V=e}let M;function qe(e){if(e===null)throw ir(),_t;return M=e}function yt(){return qe(Be(M))}function J(e){if(V){if(Be(M)!==null)throw ir(),_t;M=e}}function Rl(){for(var e=0,t=M;;){if(t.nodeType===8){var r=t.data;if(r===on){if(e===0)return t;e-=1}else(r===xr||r===ln)&&(e+=1)}var i=Be(t);t.remove(),t=i}}let xl=!1;function je(e){if(typeof e!="object"||e===null||Nt in e)return e;const t=fn(e);if(t!==cl&&t!==dl)return e;var r=new Map,i=un(e),a=P(0),l=N,f=s=>{var c=N;Se(l);var d=s();return Se(c),d};return i&&r.set("length",P(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&Cl();var b=r.get(c);return b===void 0?(b=f(()=>P(d.value)),r.set(c,b)):p(b,f(()=>je(d.value))),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&(r.set(c,f(()=>P(ue))),Tr(a));else{if(i&&typeof c=="string"){var b=r.get("length"),h=Number(c);Number.isInteger(h)&&h<b.v&&p(b,h)}p(d,ue),Tr(a)}return!0},get(s,c,d){var y;if(c===Nt)return e;var b=r.get(c),h=c in s;if(b===void 0&&(!h||(y=Qe(s,c))!=null&&y.writable)&&(b=f(()=>P(je(h?s[c]:ue))),r.set(c,b)),b!==void 0){var m=o(b);return m===ue?void 0:m}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var b=r.get(c);b&&(d.value=o(b))}else if(d===void 0){var h=r.get(c),m=h==null?void 0:h.v;if(h!==void 0&&m!==ue)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return d},has(s,c){var m;if(c===Nt)return!0;var d=r.get(c),b=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||D!==null&&(!b||(m=Qe(s,c))!=null&&m.writable)){d===void 0&&(d=f(()=>P(b?je(s[c]):ue)),r.set(c,d));var h=o(d);if(h===ue)return!1}return b},set(s,c,d,b){var re;var h=r.get(c),m=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var L=r.get(y+"");L!==void 0?p(L,ue):y in s&&(L=f(()=>P(ue)),r.set(y+"",L))}h===void 0?(!m||(re=Qe(s,c))!=null&&re.writable)&&(h=f(()=>P(void 0)),p(h,f(()=>je(d))),r.set(c,h)):(m=h.v!==ue,p(h,f(()=>je(d))));var O=Reflect.getOwnPropertyDescriptor(s,c);if(O!=null&&O.set&&O.set.call(b,d),!m){if(i&&typeof c=="string"){var B=r.get("length"),k=Number(c);Number.isInteger(k)&&k>=B.v&&p(B,k+1)}Tr(a)}return!0},ownKeys(s){o(a);var c=Reflect.ownKeys(s).filter(h=>{var m=r.get(h);return m===void 0||m.v!==ue});for(var[d,b]of r)b.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){Al()}})}function Tr(e,t=1){p(e,e.v+t)}var _n,mn,bn,pn;function Nr(){if(_n===void 0){_n=window,mn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;bn=Qe(t,"firstChild").get,pn=Qe(t,"nextSibling").get,cn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),cn(r)&&(r.__t=void 0)}}function lr(e=""){return document.createTextNode(e)}function me(e){return bn.call(e)}function Be(e){return pn.call(e)}function K(e,t){if(!V)return me(e);var r=me(M);return r===null&&(r=M.appendChild(lr())),qe(r),r}function Dt(e,t){if(!V){var r=me(e);return r instanceof Comment&&r.data===""?Be(r):r}return M}function X(e,t=1,r=!1){let i=V?M:e;for(var a;t--;)a=i,i=Be(i);if(!V)return i;var l=i==null?void 0:i.nodeType;if(r&&l!==3){var f=lr();return i===null?a==null||a.after(f):i.before(f),qe(f),f}return qe(i),i}function kl(e){e.textContent=""}function yn(e){return e===this.v}function wn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Dr(e){return!wn(e,this.v)}function or(e){var t=we|xe,r=N!==null&&(N.f&we)!==0?N:null;return D===null||r!==null&&(r.f&he)!==0?t|=he:D.f|=hn,{ctx:ae,deps:null,effects:null,equals:yn,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??D}}function Lt(e){const t=or(e);return On(t),t}function $l(e){const t=or(e);return t.equals=Dr,t}function En(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)He(t[r])}}function Sl(e){for(var t=e.parent;t!==null;){if((t.f&we)===0)return t;t=t.parent}return null}function Cn(e){var t,r=D;Ye(Sl(e));try{En(e),t=qn(e)}finally{Ye(r)}return t}function An(e){var t=Cn(e),r=(Ge||(e.f&he)!==0)&&e.deps!==null?tt:fe;Ee(e,r),e.equals(t)||(e.v=t,e.wv=Vn())}function Tl(e){D===null&&N===null&&pl(),N!==null&&(N.f&he)!==0&&D===null&&bl(),Ft&&ml()}function Nl(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function rt(e,t,r,i=!0){var a=D,l={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:e|xe,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(r)try{qr(l),l.f|=hl}catch(c){throw He(l),c}else t!==null&&vr(l);var f=r&&l.deps===null&&l.first===null&&l.nodes_start===null&&l.teardown===null&&(l.f&(hn|tr))===0;if(!f&&i&&(a!==null&&Nl(l,a),N!==null&&(N.f&we)!==0)){var s=N;(s.effects??(s.effects=[])).push(l)}return l}function Lr(e){const t=rt(er,null,!1);return Ee(t,fe),t.teardown=e,t}function Pr(e){Tl();var t=D!==null&&(D.f&Fe)!==0&&ae!==null&&!ae.m;if(t){var r=ae;(r.e??(r.e=[])).push({fn:e,effect:D,reaction:N})}else{var i=Or(e);return i}}function Dl(e){const t=rt(et,e,!0);return()=>{He(t)}}function Ll(e){const t=rt(et,e,!0);return(r={})=>new Promise(i=>{r.outro?Mr(t,()=>{He(t),i(void 0)}):(He(t),i(void 0))})}function Or(e){return rt(vn,e,!1)}function Fr(e){return rt(er,e,!0)}function ke(e,t=[],r=or){const i=t.map(r);return In(()=>e(...i.map(o)))}function In(e,t=0){return rt(er|kr|t,e,!0)}function Vr(e,t=!0){return rt(er|Fe,e,!0,t)}function Rn(e){var t=e.teardown;if(t!==null){const r=Ft,i=N;Pn(!0),Se(null);try{t.call(null)}finally{Pn(r),Se(i)}}}function xn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&et)!==0?r.parent=null:He(r,t),r=i}}function Pl(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Fe)===0&&He(t),t=r}}function He(e,t=!0){var r=!1;(t||(e.f&gl)!==0)&&e.nodes_start!==null&&(kn(e.nodes_start,e.nodes_end),r=!0),xn(e,t&&!r),dr(e,0),Ee(e,nr);var i=e.transitions;if(i!==null)for(const l of i)l.stop();Rn(e);var a=e.parent;a!==null&&a.first!==null&&$n(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function kn(e,t){for(;e!==null;){var r=e===t?null:Be(e);e.remove(),e=r}}function $n(e){var t=e.parent,r=e.prev,i=e.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=r))}function Mr(e,t){var r=[];Sn(e,r,!0),Ol(r,()=>{He(e),t&&t()})}function Ol(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var a of e)a.out(i)}else t()}function Sn(e,t,r){if((e.f&bt)===0){if(e.f^=bt,e.transitions!==null)for(const f of e.transitions)(f.is_global||r)&&t.push(f);for(var i=e.first;i!==null;){var a=i.next,l=(i.f&$r)!==0||(i.f&Fe)!==0;Sn(i,t,l?r:!1),i=a}}}function Tn(e){Nn(e,!0)}function Nn(e,t){if((e.f&bt)!==0){e.f^=bt,(e.f&fe)===0&&(e.f^=fe),Mt(e)&&(Ee(e,xe),vr(e));for(var r=e.first;r!==null;){var i=r.next,a=(r.f&$r)!==0||(r.f&Fe)!==0;Nn(r,a?t:!1),r=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const Fl=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Pt=[],Ot=[];function Dn(){var e=Pt;Pt=[],dn(e)}function Ln(){var e=Ot;Ot=[],dn(e)}function Ur(e){Pt.length===0&&queueMicrotask(Dn),Pt.push(e)}function Vl(e){Ot.length===0&&Fl(Ln),Ot.push(e)}function Ml(){Pt.length>0&&Dn(),Ot.length>0&&Ln()}let ar=!1,sr=!1,ur=null,nt=!1,Ft=!1;function Pn(e){Ft=e}let Vt=[],Oa=[],N=null,$e=!1;function Se(e){N=e}let D=null;function Ye(e){D=e}let le=null;function On(e){N!==null&&N.f&Sr&&(le===null?le=[e]:le.push(e))}let oe=null,ge=0,be=null;function Ul(e){be=e}let Fn=1,fr=0,Ge=!1;function Vn(){return++Fn}function Mt(e){var h;var t=e.f;if((t&xe)!==0)return!0;if((t&tt)!==0){var r=e.deps,i=(t&he)!==0;if(r!==null){var a,l,f=(t&rr)!==0,s=i&&D!==null&&!Ge,c=r.length;if(f||s){var d=e,b=d.parent;for(a=0;a<c;a++)l=r[a],(f||!((h=l==null?void 0:l.reactions)!=null&&h.includes(d)))&&(l.reactions??(l.reactions=[])).push(d);f&&(d.f^=rr),s&&b!==null&&(b.f&he)===0&&(d.f^=he)}for(a=0;a<c;a++)if(l=r[a],Mt(l)&&An(l),l.wv>e.wv)return!0}(!i||D!==null&&!Ge)&&Ee(e,fe)}return!1}function ql(e,t){for(var r=t;r!==null;){if((r.f&tr)!==0)try{r.fn(e);return}catch{r.f^=tr}r=r.parent}throw ar=!1,e}function Mn(e){return(e.f&nr)===0&&(e.parent===null||(e.parent.f&tr)===0)}function cr(e,t,r,i){if(ar){if(r===null&&(ar=!1),Mn(t))throw e;return}if(r!==null&&(ar=!0),ql(e,t),Mn(t))throw e}function Un(e,t,r=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var l=i[a];le!=null&&le.includes(e)||((l.f&we)!==0?Un(l,t,!1):t===l&&(r?Ee(l,xe):(l.f&fe)!==0&&Ee(l,tt),vr(l)))}}function qn(e){var y;var t=oe,r=ge,i=be,a=N,l=Ge,f=le,s=ae,c=$e,d=e.f;oe=null,ge=0,be=null,Ge=(d&he)!==0&&($e||!nt||N===null),N=(d&(Fe|et))===0?e:null,le=null,Yn(e.ctx),$e=!1,fr++,e.f|=Sr;try{var b=(0,e.fn)(),h=e.deps;if(oe!==null){var m;if(dr(e,ge),h!==null&&ge>0)for(h.length=ge+oe.length,m=0;m<oe.length;m++)h[ge+m]=oe[m];else e.deps=h=oe;if(!Ge)for(m=ge;m<h.length;m++)((y=h[m]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(dr(e,ge),h.length=ge);if(Wn()&&be!==null&&!$e&&h!==null&&(e.f&(we|tt|xe))===0)for(m=0;m<be.length;m++)Un(be[m],e);return a!==null&&a!==e&&(fr++,be!==null&&(i===null?i=be:i.push(...be))),b}finally{oe=t,ge=r,be=i,N=a,Ge=l,le=f,Yn(s),$e=c,e.f^=Sr}}function jl(e,t){let r=t.reactions;if(r!==null){var i=sl.call(r,e);if(i!==-1){var a=r.length-1;a===0?r=t.reactions=null:(r[i]=r[a],r.pop())}}r===null&&(t.f&we)!==0&&(oe===null||!oe.includes(t))&&(Ee(t,tt),(t.f&(he|rr))===0&&(t.f^=rr),En(t),dr(t,0))}function dr(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)jl(e,r[i])}function qr(e){var t=e.f;if((t&nr)===0){Ee(e,fe);var r=D,i=ae,a=nt;D=e,nt=!0;try{(t&kr)!==0?Pl(e):xn(e),Rn(e);var l=qn(e);e.teardown=typeof l=="function"?l:null,e.wv=Fn;var f=e.deps,s;an&&xl&&e.f&xe}catch(c){cr(c,e,r,i||e.ctx)}finally{nt=a,D=r}}}function Bl(){try{yl()}catch(e){if(ur!==null)cr(e,ur,null);else throw e}}function jn(){var e=nt;try{var t=0;for(nt=!0;Vt.length>0;){t++>1e3&&Bl();var r=Vt,i=r.length;Vt=[];for(var a=0;a<i;a++){var l=Yl(r[a]);Hl(l)}Ut.clear()}}finally{sr=!1,nt=e,ur=null}}function Hl(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(nr|bt))===0)try{Mt(i)&&(qr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?$n(i):i.fn=null))}catch(a){cr(a,i,null,i.ctx)}}}function vr(e){sr||(sr=!0,queueMicrotask(jn));for(var t=ur=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(et|Fe))!==0){if((r&fe)===0)return;t.f^=fe}}Vt.push(t)}function Yl(e){for(var t=[],r=e;r!==null;){var i=r.f,a=(i&(Fe|et))!==0,l=a&&(i&fe)!==0;if(!l&&(i&bt)===0){if((i&vn)!==0)t.push(r);else if(a)r.f^=fe;else try{Mt(r)&&qr(r)}catch(c){cr(c,r,null,r.ctx)}var f=r.first;if(f!==null){r=f;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function C(e){for(var t;;){if(Ml(),Vt.length===0)return t;sr=!0,jn()}}async function jr(){await Promise.resolve(),C()}function o(e){var t=e.f,r=(t&we)!==0;if(N!==null&&!$e){if(!(le!=null&&le.includes(e))){var i=N.deps;e.rv<fr&&(e.rv=fr,oe===null&&i!==null&&i[ge]===e?ge++:oe===null?oe=[e]:(!Ge||!oe.includes(e))&&oe.push(e))}}else if(r&&e.deps===null&&e.effects===null){var a=e,l=a.parent;l!==null&&(l.f&he)===0&&(a.f^=he)}return r&&(a=e,Mt(a)&&An(a)),Ft&&Ut.has(e)?Ut.get(e):e.v}function it(e){var t=$e;try{return $e=!0,e()}finally{$e=t}}const Gl=-7169;function Ee(e,t){e.f=e.f&Gl|t}const Ut=new Map;function Bn(e,t){var r={f:0,v:e,reactions:null,equals:yn,rv:0,wv:0};return r}function P(e,t){const r=Bn(e);return On(r),r}function Br(e,t=!1){const r=Bn(e);return t||(r.equals=Dr),r}function p(e,t,r=!1){N!==null&&!$e&&Wn()&&(N.f&(we|kr))!==0&&!(le!=null&&le.includes(e))&&Il();let i=r?je(t):t;return Zl(e,i)}function Zl(e,t){if(!e.equals(t)){var r=e.v;Ft?Ut.set(e,t):Ut.set(e,r),e.v=t,(e.f&we)!==0&&((e.f&xe)!==0&&Cn(e),Ee(e,(e.f&he)===0?fe:tt)),e.wv=Vn(),Hn(e,xe),D!==null&&(D.f&fe)!==0&&(D.f&(Fe|et))===0&&(be===null?Ul([e]):be.push(e))}return t}function Hn(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,a=0;a<i;a++){var l=r[a],f=l.f;(f&xe)===0&&(Ee(l,t),(f&(fe|he))!==0&&((f&we)!==0?Hn(l,tt):vr(l)))}}let ae=null;function Yn(e){ae=e}function Gn(e,t=!1,r){var i=ae={p:ae,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Lr(()=>{i.d=!0})}function Zn(e){const t=ae;if(t!==null){e!==void 0&&(t.x=e);const f=t.e;if(f!==null){var r=D,i=N;t.e=null;try{for(var a=0;a<f.length;a++){var l=f[a];Ye(l.effect),Se(l.reaction),Or(l.fn)}}finally{Ye(r),Se(i)}}ae=t.p,t.m=!0}return e||{}}function Wn(){return!0}const Wl=["touchstart","touchmove"];function Jl(e){return Wl.includes(e)}function Kl(e,t){if(t){const r=document.body;e.autofocus=!0,Ur(()=>{document.activeElement===r&&e.focus()})}}let Jn=!1;function Kn(){Jn||(Jn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function Xn(e){var t=N,r=D;Se(null),Ye(null);try{return e()}finally{Se(t),Ye(r)}}function Xl(e,t,r,i=r){e.addEventListener(t,()=>Xn(r));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Kn()}const zn=new Set,Hr=new Set;function zl(e,t,r,i={}){function a(l){if(i.capture||qt.call(t,l),!l.cancelBubble)return Xn(()=>r==null?void 0:r.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ur(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Ze(e,t,r,i,a){var l={capture:i,passive:a},f=zl(e,t,r,l);(t===document.body||t===window||t===document)&&Lr(()=>{t.removeEventListener(e,f,l)})}function Ql(e){for(var t=0;t<e.length;t++)zn.add(e[t]);for(var r of Hr)r(e)}function qt(e){var re;var t=this,r=t.ownerDocument,i=e.type,a=((re=e.composedPath)==null?void 0:re.call(e))||[],l=a[0]||e.target,f=0,s=e.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(f=c)}if(l=a[f]||e.target,l!==t){Tt(e,"currentTarget",{configurable:!0,get(){return l||r}});var b=N,h=D;Se(null),Ye(null);try{for(var m,y=[];l!==null;){var L=l.assignedSlot||l.parentNode||l.host||null;try{var O=l["__"+i];if(O!=null&&(!l.disabled||e.target===l))if(un(O)){var[B,...k]=O;B.apply(l,[e,...k])}else O.call(l,e)}catch(ce){m?y.push(ce):m=ce}if(e.cancelBubble||L===t||L===null)break;l=L}if(m){for(let ce of y)queueMicrotask(()=>{throw ce});throw m}}finally{e.__root=t,delete e.currentTarget,Se(b),Ye(h)}}}function Yr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Te(e,t){var r=D;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Ce(e,t){var r=(t&ll)!==0,i=(t&ol)!==0,a,l=!e.startsWith("<!>");return()=>{if(V)return Te(M,null),M;a===void 0&&(a=Yr(l?e:"<!>"+e),r||(a=me(a)));var f=i||mn?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=me(f),c=f.lastChild;Te(s,c)}else Te(f,f);return f}}function hr(e,t,r="svg"){var i=!e.startsWith("<!>"),a=`<${r}>${i?e:"<!>"+e}</${r}>`,l;return()=>{if(V)return Te(M,null),M;if(!l){var f=Yr(a),s=me(f);l=me(s)}var c=l.cloneNode(!0);return Te(c,c),c}}function gr(){if(V)return Te(M,null),M;var e=document.createDocumentFragment(),t=document.createComment(""),r=lr();return e.append(t,r),Te(t,r),e}function Y(e,t){if(V){D.nodes_end=M,yt();return}e!==null&&e.before(t)}function eo(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function Qn(e,t){return ei(e,t)}function to(e,t){Nr(),t.intro=t.intro??!1;const r=t.target,i=V,a=M;try{for(var l=me(r);l&&(l.nodeType!==8||l.data!==xr);)l=Be(l);if(!l)throw _t;pt(!0),qe(l),yt();const f=ei(e,{...t,anchor:l});if(M===null||M.nodeType!==8||M.data!==on)throw ir(),_t;return pt(!1),f}catch(f){if(f===_t)return t.recover===!1&&wl(),Nr(),kl(r),pt(!1),Qn(e,t);throw f}finally{pt(i),qe(a)}}const wt=new Map;function ei(e,{target:t,anchor:r,props:i={},events:a,context:l,intro:f=!0}){Nr();var s=new Set,c=h=>{for(var m=0;m<h.length;m++){var y=h[m];if(!s.has(y)){s.add(y);var L=Jl(y);t.addEventListener(y,qt,{passive:L});var O=wt.get(y);O===void 0?(document.addEventListener(y,qt,{passive:L}),wt.set(y,1)):wt.set(y,O+1)}}};c(ul(zn)),Hr.add(c);var d=void 0,b=Ll(()=>{var h=r??t.appendChild(lr());return Vr(()=>{if(l){Gn({});var m=ae;m.c=l}a&&(i.$$events=a),V&&Te(h,null),d=e(h,i)||{},V&&(D.nodes_end=M),l&&Zn()}),()=>{var L;for(var m of s){t.removeEventListener(m,qt);var y=wt.get(m);--y===0?(document.removeEventListener(m,qt),wt.delete(m)):wt.set(m,y)}Hr.delete(c),h!==r&&((L=h.parentNode)==null||L.removeChild(h))}});return Gr.set(d,b),d}let Gr=new WeakMap;function ro(e,t){const r=Gr.get(e);return r?(Gr.delete(e),r(t)):Promise.resolve()}function z(e,t,[r,i]=[0,0]){V&&r===0&&yt();var a=e,l=null,f=null,s=ue,c=r>0?$r:0,d=!1;const b=(m,y=!0)=>{d=!0,h(y,m)},h=(m,y)=>{if(s===(s=m))return;let L=!1;if(V&&i!==-1){if(r===0){const B=a.data;B===xr?i=0:B===ln?i=1/0:(i=parseInt(B.substring(1)),i!==i&&(i=s?1/0:-1))}const O=i>r;!!s===O&&(a=Rl(),qe(a),pt(!1),L=!0,i=-1)}s?(l?Tn(l):y&&(l=Vr(()=>y(a))),f&&Mr(f,()=>{f=null})):(f?Tn(f):y&&(f=Vr(()=>y(a,[r+1,i]))),l&&Mr(l,()=>{l=null})),L&&pt(!0)};In(()=>{d=!1,t(b),d||h(null,null)},c),V&&(a=M)}function lt(e,t,r=!1,i=!1,a=!1){var l=e,f="";ke(()=>{var s=D;if(f===(f=t()??"")){V&&yt();return}if(s.nodes_start!==null&&(kn(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),f!==""){if(V){M.data;for(var c=yt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Be(c);if(c===null)throw ir(),_t;Te(M,d),l=qe(c);return}var b=f+"";r?b=`<svg>${b}</svg>`:i&&(b=`<math>${b}</math>`);var h=Yr(b);if((r||i)&&(h=me(h)),Te(me(h),h.lastChild),r||i)for(;me(h);)l.before(me(h));else l.before(h)}})}function no(e,t,r,i,a){var s;V&&yt();var l=(s=t.$$slots)==null?void 0:s[r],f=!1;l===!0&&(l=t.children,f=!0),l===void 0||l(e,f?()=>i:i)}const ti=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function io(e,t,r){var i=""+e;if(r){for(var a in r)if(r[a])i=i?i+" "+a:a;else if(i.length)for(var l=a.length,f=0;(f=i.indexOf(a,f))>=0;){var s=f+l;(f===0||ti.includes(i[f-1]))&&(s===i.length||ti.includes(i[s]))?i=(f===0?"":i.substring(0,f))+i.substring(s+1):f=s}}return i===""?null:i}function lo(e,t,r,i,a,l){var f=e.__className;if(V||f!==r||f===void 0){var s=io(r,i,l);(!V||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}else if(l&&a!==l)for(var c in l){var d=!!l[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return l}const oo=Symbol("is custom element"),ao=Symbol("is html");function ri(e){if(V){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;T(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;T(e,"checked",null),e.checked=a}}};e.__on_r=r,Vl(r),Kn()}}function so(e,t){var r=ni(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function T(e,t,r,i){var a=ni(e);V&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=r)&&(t==="loading"&&(e[_l]=r),r==null?e.removeAttribute(t):typeof r!="string"&&uo(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function ni(e){return e.__attributes??(e.__attributes={[oo]:e.nodeName.includes("-"),[ao]:e.namespaceURI===al})}var ii=new Map;function uo(e){var t=ii.get(e.nodeName);if(t)return t;ii.set(e.nodeName,t=[]);for(var r,i=e,a=Element.prototype;a!==i;){r=fl(i);for(var l in r)r[l].set&&t.push(l);i=fn(i)}return t}function fo(e,t,r=t){Xl(e,"change",i=>{var a=i?e.defaultChecked:e.checked;r(a)}),(V&&e.defaultChecked!==e.checked||it(t)==null)&&r(e.checked),Fr(()=>{var i=t();e.checked=!!i})}function li(e,t){return e===t||(e==null?void 0:e[Nt])===t}function _r(e={},t,r,i){return Or(()=>{var a,l;return Fr(()=>{a=l,l=[],it(()=>{e!==r(...l)&&(t(e,...l),a&&li(r(...a),e)&&t(null,...a))})}),()=>{Ur(()=>{l&&li(r(...l),e)&&t(null,...l)})}}),e}function oi(e){ae===null&&sn(),Pr(()=>{const t=it(e);if(typeof t=="function")return t})}function co(e){ae===null&&sn(),oi(()=>()=>it(e))}function ai(e,t,r){if(e==null)return t(void 0),mt;const i=it(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const Et=[];function vo(e,t=mt){let r=null;const i=new Set;function a(s){if(wn(e,s)&&(e=s,r)){const c=!Et.length;for(const d of i)d[1](),Et.push(d,e);if(c){for(let d=0;d<Et.length;d+=2)Et[d][0](Et[d+1]);Et.length=0}}}function l(s){a(s(e))}function f(s,c=mt){const d=[s,c];return i.add(d),i.size===1&&(r=t(a,l)||mt),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:a,update:l,subscribe:f}}function mr(e){let t;return ai(e,r=>t=r)(),t}let br=!1,Zr=Symbol();function ho(e,t,r){const i=r[t]??(r[t]={store:null,source:Br(void 0),unsubscribe:mt});if(i.store!==e&&!(Zr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=mt;else{var a=!0;i.unsubscribe=ai(e,l=>{a?i.source.v=l:p(i.source,l)}),a=!1}return e&&Zr in r?mr(e):o(i.source)}function go(){const e={};function t(){Lr(()=>{for(var r in e)e[r].unsubscribe();Tt(e,Zr,{enumerable:!1,value:!0})})}return[e,t]}function _o(e){var t=br;try{return br=!1,[e(),br]}finally{br=t}}function si(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function A(e,t,r,i){var Me;var a=(r&zt)!==0,l=!0,f=(r&nl)!==0,s=(r&il)!==0,c=!1,d;f?[d,c]=_o(()=>e[t]):d=e[t];var b=Nt in e||gn in e,h=f&&(((Me=Qe(e,t))==null?void 0:Me.set)??(b&&t in e&&(H=>e[t]=H)))||void 0,m=i,y=!0,L=!1,O=()=>(L=!0,y&&(y=!1,s?m=it(i):m=i),m);d===void 0&&i!==void 0&&(h&&l&&El(),d=O(),h&&h(d));var B;if(B=()=>{var H=e[t];return H===void 0?O():(y=!0,L=!1,H)},(r&rl)===0)return B;if(h){var k=e.$$legacy;return function(H,Ne){return arguments.length>0?((!Ne||k||c)&&h(Ne?B():H),H):B()}}var re=!1,ce=Br(d),ne=or(()=>{var H=B(),Ne=o(ce);return re?(re=!1,Ne):ce.v=H});return f&&o(ne),a||(ne.equals=Dr),function(H,Ne){if(arguments.length>0){const We=Ne?o(ne):f?je(H):H;if(!ne.equals(We)){if(re=!0,p(ce,We),L&&m!==void 0&&(m=We),si(ne))return H;it(()=>o(ne))}return H}return si(ne)?ne.v:o(ne)}}function mo(e){return new bo(e)}class bo{constructor(t){rn(this,Ve);rn(this,pe);var l;var r=new Map,i=(f,s)=>{var c=Br(s);return r.set(f,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(f,s){return o(r.get(s)??i(s,Reflect.get(f,s)))},has(f,s){return s===gn?!0:(o(r.get(s)??i(s,Reflect.get(f,s))),Reflect.has(f,s))},set(f,s,c){return p(r.get(s)??i(s,c),c),Reflect.set(f,s,c)}});nn(this,pe,(t.hydrate?to:Qn)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&C(),nn(this,Ve,a.$$events);for(const f of Object.keys(ve(this,pe)))f==="$set"||f==="$destroy"||f==="$on"||Tt(this,f,{get(){return ve(this,pe)[f]},set(s){ve(this,pe)[f]=s},enumerable:!0});ve(this,pe).$set=f=>{Object.assign(a,f)},ve(this,pe).$destroy=()=>{ro(ve(this,pe))}}$set(t){ve(this,pe).$set(t)}$on(t,r){ve(this,Ve)[t]=ve(this,Ve)[t]||[];const i=(...a)=>r.call(this,...a);return ve(this,Ve)[t].push(i),()=>{ve(this,Ve)[t]=ve(this,Ve)[t].filter(a=>a!==i)}}$destroy(){ve(this,pe).$destroy()}}Ve=new WeakMap,pe=new WeakMap;let ui;typeof HTMLElement=="function"&&(ui=class extends HTMLElement{constructor(t,r,i){super();Re(this,"$$ctor");Re(this,"$$s");Re(this,"$$c");Re(this,"$$cn",!1);Re(this,"$$d",{});Re(this,"$$r",!1);Re(this,"$$p_d",{});Re(this,"$$l",{});Re(this,"$$l_u",new Map);Re(this,"$$me");this.$$ctor=t,this.$$s=r,i&&this.attachShadow({mode:"open"})}addEventListener(t,r,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const a=this.$$c.$on(t,r);this.$$l_u.set(r,a)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const a=this.$$l_u.get(r);a&&(a(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return l=>{const f=document.createElement("slot");a!=="default"&&(f.name=a),Y(l,f)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=po(this);for(const a of this.$$s)a in i&&(a==="default"&&!this.$$d.children?(this.$$d.children=t(a),r.default=!0):r[a]=t(a));for(const a of this.attributes){const l=this.$$g_p(a.name);l in this.$$d||(this.$$d[l]=pr(l,a.value,this.$$p_d,"toProp"))}for(const a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=mo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Dl(()=>{Fr(()=>{var a;this.$$r=!0;for(const l of Qt(this.$$c)){if(!((a=this.$$p_d[l])!=null&&a.reflect))continue;this.$$d[l]=this.$$c[l];const f=pr(l,this.$$d[l],this.$$p_d,"toAttribute");f==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,f)}this.$$r=!1})});for(const a in this.$$l)for(const l of this.$$l[a]){const f=this.$$c.$on(a,l);this.$$l_u.set(l,f)}this.$$l={}}}attributeChangedCallback(t,r,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=pr(t,i,this.$$p_d,"toProp"),(a=this.$$c)==null||a.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Qt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function pr(e,t,r,i){var l;const a=(l=r[e])==null?void 0:l.type;if(t=a==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(a){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function po(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function yo(e,t,r,i,a,l){let f=class extends ui{constructor(){super(e,r,a),this.$$p_d=t}static get observedAttributes(){return Qt(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Qt(t).forEach(s=>{Tt(f.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=pr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var b=(h=Qe(d,s))==null?void 0:h.get;b?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Tt(f.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=f,f}const fi=new TextEncoder;function wo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function Eo(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const a=await ci(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ci(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return wo(await crypto.subtle.digest(r.toUpperCase(),fi.encode(e+t)))}function Co(e,t,r="SHA-256",i=1e6,a=0){const l=new AbortController,f=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(l.signal.aborted)return null;if(await ci(t,c,r)===e)return{number:c,took:Date.now()-f}}return null})(),controller:l}}function di(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Ao(e){const t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function Io(e,t=12){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e%256,e=Math.floor(e/256);return r}async function Ro(e,t="",r=1e6,i=0){const a="AES-GCM",l=new AbortController,f=Date.now(),s=async()=>{for(let b=i;b<=r;b+=1){if(l.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:Io(b)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-f}}catch{}}return null};let c=null,d=null;try{d=Ao(e);const b=await crypto.subtle.digest("SHA-256",fi.encode(t));c=await crypto.subtle.importKey("raw",b,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var w=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),te=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(te||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>mr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(mr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(mr(globalThis.altchaI18n.store))},store:vo({})};const xo={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",xo);const Wr=(e,t)=>{let r=$l(()=>vl(t==null?void 0:t(),24));var i=To();ke(()=>{T(i,"width",o(r)),T(i,"height",o(r))}),Y(e,i)};function ko(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function $o(e,t){e.preventDefault(),t()}function So(e,t,r,i,a,l,f,s){var c;[w.UNVERIFIED,w.ERROR,w.EXPIRED,w.CODE].includes(o(t))?r()!==!1&&((c=o(i))==null?void 0:c.reportValidity())===!1?p(a,!1):l()?f():s():p(a,!0)}var To=hr('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" fill="currentColor" opacity=".25"></path><path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" fill="currentColor"></path></svg>'),No=Ce('<input type="hidden">'),Do=Ce('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z" fill="currentColor"></path><path d="M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z" fill="currentColor"></path><path d="M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z" fill="currentColor"></path></svg></a></div>'),Lo=hr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),Po=hr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),Oo=hr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),Fo=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Vo=Ce("<audio hidden autoplay><source></audio>"),Mo=Ce('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),Uo=Ce("<div><!></div>"),qo=Ce("<div><!></div>"),jo=Ce('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),Bo=Ce('<div class="altcha-footer"><div><!></div></div>'),Ho=Ce('<div class="altcha-anchor-arrow"></div>'),Yo=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function vi(e,t){var zi,Qi;Gn(t,!0);const[r,i]=go(),a=()=>ho(Zo,"$altchaI18nStore",r);let l=A(t,"auto",7,void 0),f=A(t,"blockspam",7,void 0),s=A(t,"challengeurl",7,void 0),c=A(t,"challengejson",7,void 0),d=A(t,"credentials",7,void 0),b=A(t,"customfetch",7,void 0),h=A(t,"debug",7,!1),m=A(t,"delay",7,0),y=A(t,"disableautofocus",7,!1),L=A(t,"refetchonexpire",7,!0),O=A(t,"disablerefetchonexpire",23,()=>!L()),B=A(t,"expire",7,void 0),k=A(t,"floating",7,void 0),re=A(t,"floatinganchor",7,void 0),ce=A(t,"floatingoffset",7,void 0),ne=A(t,"floatingpersist",7,!1),Me=A(t,"hidefooter",7,!1),H=A(t,"hidelogo",7,!1),Ne=A(t,"id",7,void 0),We=A(t,"language",7,void 0),ot=A(t,"name",7,"altcha"),at=A(t,"maxnumber",7,1e6),jt=A(t,"mockerror",7,!1),Je=A(t,"obfuscated",7,void 0),Ae=A(t,"overlay",7,void 0),Bt=A(t,"overlaycontent",7,void 0),yr=A(t,"plugins",7,void 0),st=A(t,"sentinel",7,void 0),De=A(t,"spamfilter",7,!1),Ct=A(t,"strings",7,void 0),ye=A(t,"test",7,!1),se=A(t,"verifyurl",7,void 0),At=A(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ht=A(t,"workerurl",7,void 0);const{altchaI18n:Go}=globalThis,Zo=Go.store,gi=["SHA-256","SHA-384","SHA-512"],Wo="https://altcha.org/",Ke=(n,u)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:u}))},_i=(Qi=(zi=document.documentElement.lang)==null?void 0:zi.split("-"))==null?void 0:Qi[0],Jr=Lt(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),wr=Lt(()=>c()?Ti(c()):void 0),Jo=Lt(()=>Ct()?Ti(Ct()):{}),U=Lt(()=>({...yi(a()),...o(Jo)})),mi=Lt(()=>`${Ne()||ot()}_checkbox_${Math.round(Math.random()*1e8)}`);let ut=P(null),Yt=P(!1),Z=P(null),R=P(je(w.UNVERIFIED)),q=P(void 0),Gt=P(null),Xe=P(null),_e=P(null),Kr=P(null),It=P(null),F=P(null),Zt=P(null),ft=P(null),Le=null,Q=P(null),ct=P(!1),ze=[],Xr=P(!1),Pe=P(null);Pr(()=>{sa(o(ft))}),Pr(()=>{ua(o(R))}),co(()=>{Ko(),p(Zt,null),o(F)&&(o(F).removeEventListener("submit",Ri),o(F).removeEventListener("reset",xi),o(F).removeEventListener("focusin",Ii),p(F,null)),Le&&(clearTimeout(Le),Le=null),document.removeEventListener("click",Ci),document.removeEventListener("scroll",Ai),window.removeEventListener("resize",Si)}),oi(()=>{var n;x("mounted","2.2.3"),x("workers",At()),ea(),x("plugins",ze.length?ze.map(u=>u.constructor.pluginName).join(", "):"none"),ye()&&x("using test mode"),B()&&zr(B()),l()!==void 0&&x("auto",l()),k()!==void 0&&Pi(k()),p(F,(n=o(q))==null?void 0:n.closest("form"),!0),o(F)&&(o(F).addEventListener("submit",Ri,{capture:!0}),o(F).addEventListener("reset",xi),(l()==="onfocus"||ne()==="focus")&&o(F).addEventListener("focusin",Ii)),Ae()&&Oi(!0),l()==="onload"&&(Je()?Wt():Ue()),o(Jr)&&(Me()||H())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ke("load")})});function Er(n,u){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:u.number,salt:n.salt,signature:n.signature,test:ye()?!0:void 0,took:u.took}))}function Ko(){for(const n of ze)n.destroy()}function bi(){s()&&!O()&&o(R)===w.VERIFIED?Ue():dt(w.EXPIRED,o(U).expired)}async function Xo(){if(jt())throw x("mocking error"),new Error("Mocked error.");if(o(wr))return x("using provided json data"),Ni(o(wr).salt),o(wr);if(ye())return x("generating test challenge",{test:ye()}),Eo(typeof ye()!="boolean"?+ye():void 0);{if(!s()&&o(F)){const v=o(F).getAttribute("action");v!=null&&v.includes("/form/")&&s(v+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");x("fetching challenge from",s());const n={credentials:typeof d()=="boolean"?"include":d(),headers:De()!==!1?{"x-altcha-spam-filter":"1"}:{}},u=await pi()(s(),n);if(!u||!(u instanceof Response))throw new Error("Custom fetch function did not return a response.");if(u.status!==200)throw new Error(`Server responded with ${u.status}.`);const g=u.headers.get("X-Altcha-Config"),_=await u.json();if(Ni(_.salt),g)try{const v=JSON.parse(g);v&&typeof v=="object"&&(v.verifyurl&&!v.verifyurl.startsWith("fn:")&&(v.verifyurl=Ei(v.verifyurl)),Mi(v))}catch(v){x("unable to configure from X-Altcha-Config",v)}return _}}function zo(n){var g,_;const u=(g=o(F))==null?void 0:g.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((_=u==null?void 0:u.value)==null?void 0:_.slice(u.value.indexOf("@")))||void 0}function pi(){let n=fetch;if(b())if(x("using customfetch"),typeof b()=="string"){if(n=globalThis[b()]||null,!n)throw new Error(`Custom fetch function not found: ${b()}`)}else n=b();return n}function yi(n,u=[We()||"",document.documentElement.lang||"",...navigator.languages]){const g=Object.keys(n).map(v=>v.toLowerCase()),_=u.reduce((v,E)=>(E=E.toLowerCase(),v||(n[E]?E:null)||g.find(I=>E.split("-")[0]===I.split("-")[0])||null),null);return n[_||"en"]}function Qo(){return De()==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof De()=="object"?De():{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function wi(n){var g;return[...((g=o(F))==null?void 0:g.querySelectorAll(n!=null&&n.length?n.map(_=>`input[name="${_}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((_,v)=>{const E=v.name,I=v.value;return E&&I&&(_[E]=/\n/.test(I)?I.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
3
|
-
`):I),_},{})}function Ei(n,u){const g=new URL(s()||location.origin),_=new URL(n,g);if(_.search||(_.search=g.search),u)for(const v in u)u[v]!==void 0&&u[v]!==null&&_.searchParams.set(v,u[v]);return _.toString()}function ea(){const n=yr()!==void 0?yr().split(","):void 0;for(const u of globalThis.altchaPlugins)(!n||n.includes(u.pluginName))&&ze.push(new u({el:o(q),clarify:Wt,dispatch:Ke,getConfiguration:Ui,getFloatingAnchor:qi,getState:ji,log:x,reset:dt,solve:Vi,setState:Oe,setFloatingAnchor:Bi,verify:Ue}))}function x(...n){(h()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ot()}]`,...n)}function ta(){p(Q,te.PAUSED,!0)}function ra(n){p(Q,te.ERROR,!0)}function na(){p(Q,te.READY,!0)}function ia(){p(Q,te.LOADING,!0)}function la(){p(Q,te.PLAYING,!0)}function oa(){p(Q,te.PAUSED,!0)}function aa(n){var u;if(n.preventDefault(),n.stopPropagation(),o(Z)){const g=new FormData(n.target),_=String(g.get("code"));if((u=se())!=null&&u.startsWith("fn:")){const v=se().replace(/^fn:/,"");if(x(`calling ${v} function instead of verifyurl`),!(v in globalThis))throw new Error(`Global function "${v}" is undefined.`);return globalThis[v]({challenge:o(Z).challenge,code:_,solution:o(Z).solution})}p(ct,!0),Di(Er(o(Z).challenge,o(Z).solution),_).then(({reason:v,verified:E})=>{E?(p(Z,null),Oe(w.VERIFIED),x("verified"),jr().then(()=>{var I;(I=o(Kr))==null||I.focus(),Ke("verified",{payload:o(Pe)}),l()==="onsubmit"?Li(o(Zt)):Ae()&&Jt()})):(dt(),p(ft,v||"Verification failed",!0))}).catch(v=>{p(Z,null),Oe(w.ERROR,v),x("sentinel verification failed:",v)}).finally(()=>{p(ct,!1)})}}function Ci(n){var g;const u=n.target;k()&&u&&!o(q).contains(u)&&(o(R)===w.VERIFIED&&ne()===!1||o(R)===w.VERIFIED&&ne()==="focus"&&!((g=o(F))!=null&&g.matches(":focus-within"))||l()==="off"&&o(R)===w.UNVERIFIED)&&Jt()}function Ai(){k()&&o(R)!==w.UNVERIFIED&&Kt()}function sa(n){for(const u of ze)typeof u.onErrorChange=="function"&&u.onErrorChange(o(ft))}function Ii(n){o(R)===w.UNVERIFIED?Ue():k()&&ne()==="focus"&&o(R)===w.VERIFIED&&Cr()}function Ri(n){var _;const u=n.target;u!=null&&u.hasAttribute("data-code-challenge-form")||(p(Zt,n.submitter,!0),o(F)&&l()==="onsubmit"?((_=o(Zt))==null||_.blur(),o(R)===w.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ue().then(()=>{Li(o(Zt))})):o(R)!==w.VERIFIED&&(n.preventDefault(),n.stopPropagation(),o(R)===w.VERIFYING&&ki())):o(F)&&k()&&l()==="off"&&o(R)===w.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Cr()))}function xi(){dt()}function ki(){o(R)===w.VERIFYING&&o(U).waitAlert&&alert(o(U).waitAlert)}function $i(){o(Xe)?o(Xe).paused?(o(Xe).currentTime=0,o(Xe).play()):o(Xe).pause():(p(Xr,!0),requestAnimationFrame(()=>{var n;(n=o(Xe))==null||n.play()}))}function ua(n){for(const u of ze)typeof u.onStateChange=="function"&&u.onStateChange(o(R));k()&&o(R)!==w.UNVERIFIED&&requestAnimationFrame(()=>{Kt()}),p(Yt,o(R)===w.VERIFIED),Ae()&&o(_e)&&(o(R)!==w.UNVERIFIED?Cr():Jt())}function Si(){k()&&Kt()}function Ti(n){return JSON.parse(n)}function Ni(n){var _;const u=new URLSearchParams((_=n.split("?"))==null?void 0:_[1]),g=u.get("expires")||u.get("expire");if(g){const v=new Date(+g*1e3),E=isNaN(v.getTime())?0:v.getTime()-Date.now();E>0&&zr(E)}else Le&&(clearTimeout(Le),Le=null)}async function fa(n){if(!se())throw new Error("Attribute verifyurl not set.");x("requesting server verification from",se());const u={payload:n};if(De()!==!1){const{blockedCountries:v,classifier:E,disableRules:I,email:G,expectedLanguages:j,expectedCountries:ie,fields:de,ipAddress:ht,text:xt,timeZone:gt}=Qo();u.blockedCountries=v,u.classifier=E,u.disableRules=I,u.email=G===!1?void 0:zo(G),u.expectedCountries=ie,u.expectedLanguages=j||(_i?[_i]:void 0),u.fields=de===!1?void 0:wi(de),u.ipAddress=ht===!1?void 0:ht||"auto",u.text=xt,u.timeZone=gt===!1?void 0:gt||di()}const g=await pi()(se(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!g||!(g instanceof Response))throw new Error("Custom fetch function did not return a response.");if(g.status!==200)throw new Error(`Server responded with ${g.status}.`);const _=await g.json();if(_!=null&&_.payload&&p(Pe,_.payload,!0),Ke("serververification",_),f()&&_.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Di(n,u){if(!se())throw new Error("Attribute verifyurl not set.");x("requesting sentinel verification from",se());const g={code:u,payload:n};st()&&(g.fields=st().fields?wi():void 0,g.timeZone=st().timeZone?di():void 0);const _=await fetch(se(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(!_||!(_ instanceof Response))throw new Error("Fetch function did not return a response.");if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const v=await _.json();return v!=null&&v.payload&&p(Pe,v.payload,!0),Ke("sentinelverification",v),v}function Li(n){var u;o(F)&&"requestSubmit"in o(F)?o(F).requestSubmit(n):(u=o(F))!=null&&u.reportValidity()&&(n?n.click():o(F).submit())}function zr(n){x("expire",n),Le&&(clearTimeout(Le),Le=null),n<1?bi():Le=setTimeout(bi,n)}function Pi(n){x("floating",n),k()!==n&&(o(q).style.left="",o(q).style.top=""),k(n===!0||n===""?"auto":n===!1||n==="false"?void 0:k()),k()?(l()||l("onsubmit"),document.addEventListener("scroll",Ai),document.addEventListener("click",Ci),window.addEventListener("resize",Si)):l()==="onsubmit"&&l(void 0)}function Oi(n){var u,g;if(x("overlay",n),Ae(n),n){if(l()||l("onsubmit"),o(_e)&&o(q).parentElement&&o(_e).replaceWith(o(q).parentElement),(g=(u=o(q))==null?void 0:u.parentElement)!=null&&g.parentElement){p(_e,document.createElement("div"),!0),o(q).parentElement.parentElement.appendChild(o(_e));const _=document.createElement("div"),v=document.createElement("button");v.type="button",v.innerHTML="×",v.addEventListener("click",E=>{E.preventDefault(),dt()}),o(_e).classList.add("altcha-overlay-backdrop"),v.classList.add("altcha-overlay-close-button"),_.classList.add("altcha-overlay"),o(_e).append(_),_.append(v),Bt()&&_.append(...document.querySelectorAll(Bt())),_.append(o(q).parentElement)}}else o(_e)&&o(q).parentElement&&(o(_e).replaceWith(o(q).parentElement),o(q).style.display="block")}function Fi(n){if(!n.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(n.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!gi.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${gi.join(", ")}`);if(!n.challenge||n.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!n.salt||n.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Vi(n){let u=null,g=null;if("Worker"in window){try{u=ca(n,n.maxNumber||n.maxnumber||at()),p(ut,u.controller,!0),g=await u.promise}catch(_){x(_)}finally{p(ut,null)}if(g===null||(g==null?void 0:g.number)!==void 0||"obfuscated"in n)return{data:n,solution:g}}if("obfuscated"in n){const _=await Ro(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await _.promise}}u=Co(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||at()),p(ut,u.controller,!0);try{g=await u.promise}catch(_){x(_)}finally{p(ut,null)}return{data:n,solution:g}}function ca(n,u=typeof ye()=="number"?ye():n.maxNumber||n.maxnumber||at(),g=Math.ceil(At())){const _=new AbortController,v=[];g=Math.min(16,u,Math.max(1,g));for(let G=0;G<g;G++)v.push(altchaCreateWorker(Ht()));const E=Math.ceil(u/g);return{promise:(async()=>{const G=await Promise.all(v.map((j,ie)=>{const de=ie*E;return _.signal.addEventListener("abort",()=>{j.postMessage({type:"abort"})}),new Promise(ht=>{j.addEventListener("message",xt=>{if(xt.data)for(const gt of v)gt!==j&>.postMessage({type:"abort"});ht(xt.data)}),j.postMessage({payload:n,max:de+E,start:de,type:"work"})})}));for(const j of v)j.terminate();return G.find(j=>!!j)||null})(),controller:_}}async function Wt(){if(!Je()){Oe(w.ERROR);return}const n=ze.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Oe(w.ERROR),x("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function Mi(n){n.obfuscated!==void 0&&Je(n.obfuscated),n.auto!==void 0&&(l(n.auto),l()==="onload"&&(Je()?Wt():Ue())),n.blockspam!==void 0&&f(!!n.blockspam),n.customfetch!==void 0&&b(n.customfetch),n.floatinganchor!==void 0&&re(n.floatinganchor),n.delay!==void 0&&m(n.delay),n.floatingoffset!==void 0&&ce(n.floatingoffset),n.floating!==void 0&&Pi(n.floating),n.expire!==void 0&&(zr(n.expire),B(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),Fi(o(wr))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&Me(!!n.hidefooter),n.hidelogo!==void 0&&H(!!n.hidelogo),n.language!==void 0&&Ct(yi(a(),[n.language])),n.maxnumber!==void 0&&at(+n.maxnumber),n.mockerror!==void 0&&jt(!!n.mockerror),n.name!==void 0&&ot(n.name),n.overlaycontent!==void 0&&Bt(n.overlaycontent),n.overlay!==void 0&&Oi(n.overlay),n.refetchonexpire!==void 0&&O(!n.refetchonexpire),n.disablerefetchonexpire!==void 0&&O(!n.disablerefetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&st(n.sentinel),n.spamfilter!==void 0&&De(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&Ct(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&ye(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&se(n.verifyurl),n.workers!==void 0&&At(+n.workers),n.workerurl!==void 0&&Ht(n.workerurl)}function Ui(){return{auto:l(),blockspam:f(),challengeurl:s(),debug:h(),delay:m(),disableautofocus:y(),disablerefetchonexpire:O(),expire:B(),floating:k(),floatinganchor:re(),floatingoffset:ce(),hidefooter:Me(),hidelogo:H(),name:ot(),maxnumber:at(),mockerror:jt(),obfuscated:Je(),overlay:Ae(),refetchonexpire:!O(),spamfilter:De(),strings:o(U),test:ye(),verifyurl:se(),workers:At(),workerurl:Ht()}}function qi(){return o(It)}function da(n){return ze.find(u=>u.constructor.pluginName===n)}function ji(){return o(R)}function Jt(){o(q).style.display="none",Ae()&&o(_e)&&(o(_e).style.display="none")}function Kt(n=20){var u;if(o(q))if(o(It)||p(It,(re()?document.querySelector(re()):(u=o(F))==null?void 0:u.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||o(F),!0),o(It)){const g=parseInt(ce(),10)||12,_=o(It).getBoundingClientRect(),v=o(q).getBoundingClientRect(),E=document.documentElement.clientHeight,I=document.documentElement.clientWidth,G=k()==="auto"?_.bottom+v.height+g+n>E:k()==="top",j=Math.max(n,Math.min(I-n-v.width,_.left+_.width/2-v.width/2));if(G?o(q).style.top=`${_.top-(v.height+g)}px`:o(q).style.top=`${_.bottom+g}px`,o(q).style.left=`${j}px`,o(q).setAttribute("data-floating",G?"top":"bottom"),o(Gt)){const ie=o(Gt).getBoundingClientRect();o(Gt).style.left=_.left-j+_.width/2-ie.width/2+"px"}}else x("unable to find floating anchor element")}function dt(n=w.UNVERIFIED,u=null){o(ut)&&(o(ut).abort(),p(ut,null)),p(Yt,!1),p(Pe,null),p(Z,null),p(Xr,!1),p(Q,null),Oe(n,u)}function Bi(n){p(It,n,!0)}function Oe(n,u=null){p(R,n,!0),p(ft,u,!0),Ke("statechange",{payload:o(Pe),state:o(R)})}function Cr(){o(q).style.display="block",k()&&Kt(),Ae()&&o(_e)&&(o(_e).style.display="flex")}async function Ue(){return dt(w.VERIFYING),await new Promise(n=>setTimeout(n,m()||0)),Xo().then(n=>(Fi(n),x("challenge",n),Vi(n))).then(({data:n,solution:u})=>{var g;if(x("solution",u),!u||n&&"challenge"in n&&!("clearText"in u)){if((u==null?void 0:u.number)!==void 0&&"challenge"in n)if(se()&&"codeChallenge"in n)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(((g=document.activeElement)==null?void 0:g.tagName)||"")&&y()===!1&&document.activeElement.blur(),p(Z,{challenge:n,solution:u},!0);else{if(se()&&st()!==void 0)return Di(Er(n,u));if(se())return fa(Er(n,u));p(Pe,Er(n,u),!0),x("payload",o(Pe))}else if(o(R)!==w.EXPIRED)throw x("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}}).then(()=>{o(Z)?(Oe(w.CODE),jr().then(()=>{Ke("code",{codeChallenge:o(Z)})})):o(Pe)&&(Oe(w.VERIFIED),x("verified"),jr().then(()=>{Ke("verified",{payload:o(Pe)}),Ae()&&Jt()}))}).catch(n=>{x(n),Oe(w.ERROR,n.message)})}var Hi=Yo(),Yi=Dt(Hi);no(Yi,t,"default",{});var Rt=X(Yi,2),Qr=K(Rt),Ar=K(Qr);let Gi;var Zi=K(Ar);{var va=n=>{Wr(n)};z(Zi,n=>{o(R)===w.VERIFYING&&n(va)})}var vt=X(Zi,2);ri(vt),vt.__change=[So,R,De,F,Yt,Je,Wt,Ue],_r(vt,n=>p(Kr,n),()=>o(Kr)),J(Ar);var Ir=X(Ar,2),ha=K(Ir);{var ga=n=>{var u=gr(),g=Dt(u);lt(g,()=>o(U).verified),Y(n,u)},_a=(n,u)=>{{var g=v=>{var E=gr(),I=Dt(E);lt(I,()=>o(U).verifying),Y(v,E)},_=(v,E)=>{{var I=j=>{var ie=gr(),de=Dt(ie);lt(de,()=>o(U).verificationRequired),Y(j,ie)},G=j=>{var ie=gr(),de=Dt(ie);lt(de,()=>o(U).label),Y(j,ie)};z(v,j=>{o(R)===w.CODE?j(I):j(G,!1)},E)}};z(n,v=>{o(R)===w.VERIFYING?v(g):v(_,!1)},u)}};z(ha,n=>{o(R)===w.VERIFIED?n(ga):n(_a,!1)})}J(Ir);var Wi=X(Ir,2);{var ma=n=>{var u=No();ri(u),ke(()=>{T(u,"name",ot()),so(u,o(Pe))}),Y(n,u)};z(Wi,n=>{o(R)===w.VERIFIED&&n(ma)})}var Ji=X(Wi,2);{var ba=n=>{var u=Do(),g=K(u);T(g,"href",Wo),J(u),ke(()=>T(g,"aria-label",o(U).ariaLinkLabel)),Y(n,u)};z(Ji,n=>{(H()!==!0||o(Jr))&&n(ba)})}var pa=X(Ji,2);{var ya=n=>{var u=Mo(),g=X(K(u),2),_=K(g),v=X(_,2);Kl(v,!y()),v.__keydown=[ko,$i];var E=X(v,2),I=K(E),G=K(I);{var j=Ie=>{var ee=Fo();ee.__click=$i;var Rr=K(ee);{var Xt=kt=>{Wr(kt,()=>20)},ka=(kt,$a)=>{{var Sa=$t=>{var en=Lo();Y($t,en)},Ta=($t,en)=>{{var Na=St=>{var tn=Po();Y(St,tn)},Da=St=>{var tn=Oo();Y(St,tn)};z($t,St=>{o(Q)===te.PLAYING?St(Na):St(Da,!1)},en)}};z(kt,$t=>{o(Q)===te.ERROR?$t(Sa):$t(Ta,!1)},$a)}};z(Rr,kt=>{o(Q)===te.LOADING?kt(Xt):kt(ka,!1)})}J(ee),ke(()=>{T(ee,"title",o(U).getAudioChallenge),ee.disabled=o(Q)===te.LOADING||o(Q)===te.ERROR||o(ct),T(ee,"aria-label",o(Q)===te.LOADING?o(U).loading:o(U).getAudioChallenge)}),Y(Ie,ee)};z(G,Ie=>{o(Z).challenge.codeChallenge.audio&&Ie(j)})}var ie=X(G,2);ie.__click=[$o,Ue],J(I);var de=X(I,2),ht=K(de);{var xt=Ie=>{Wr(Ie,()=>16)};z(ht,Ie=>{o(ct)&&Ie(xt)})}var gt=X(ht);J(de),J(E);var Ra=X(E,2);{var xa=Ie=>{var ee=Vo(),Rr=K(ee);J(ee),_r(ee,Xt=>p(Xe,Xt),()=>o(Xe)),ke(Xt=>T(Rr,"src",Xt),[()=>Ei(o(Z).challenge.codeChallenge.audio,{language:We()})]),Ze("loadstart",ee,ia),Ze("canplay",ee,na),Ze("pause",ee,oa),Ze("playing",ee,la),Ze("ended",ee,ta),Ze("error",Rr,ra),Y(Ie,ee)};z(Ra,Ie=>{o(Z).challenge.codeChallenge.audio&&o(Xr)&&Ie(xa)})}J(g),J(u),ke(()=>{T(u,"aria-label",o(U).verificationRequired),T(_,"src",o(Z).challenge.codeChallenge.image),T(v,"minlength",o(Z).challenge.codeChallenge.length||1),T(v,"maxlength",o(Z).challenge.codeChallenge.length),T(v,"placeholder",o(U).enterCode),T(v,"aria-label",o(Q)===te.LOADING?o(U).loading:o(Q)===te.PLAYING?"":o(U).enterCodeAria),T(v,"aria-live",o(Q)?"assertive":"polite"),T(v,"aria-busy",o(Q)===te.LOADING),v.disabled=o(ct),T(ie,"aria-label",o(U).reload),T(ie,"title",o(U).reload),ie.disabled=o(ct),de.disabled=o(ct),T(de,"aria-label",o(U).verify),eo(gt,` ${o(U).verify??""}`)}),Ze("submit",g,aa,!0),Y(n,u)};z(pa,n=>{var u;(u=o(Z))!=null&&u.challenge.codeChallenge&&n(ya)})}J(Qr);var Ki=X(Qr,2);{var wa=n=>{var u=jo(),g=X(K(u),2);{var _=E=>{var I=Uo(),G=K(I);lt(G,()=>o(U).expired),J(I),ke(()=>T(I,"title",o(ft))),Y(E,I)},v=E=>{var I=qo(),G=K(I);lt(G,()=>o(U).error),J(I),ke(()=>T(I,"title",o(ft))),Y(E,I)};z(g,E=>{o(R)===w.EXPIRED?E(_):E(v,!1)})}J(u),Y(n,u)};z(Ki,n=>{(o(ft)||o(R)===w.EXPIRED)&&n(wa)})}var Xi=X(Ki,2);{var Ea=n=>{var u=Bo(),g=K(u),_=K(g);lt(_,()=>o(U).footer),J(g),J(u),Y(n,u)};z(Xi,n=>{o(U).footer&&(Me()!==!0||o(Jr))&&n(Ea)})}var Ca=X(Xi,2);{var Aa=n=>{var u=Ho();_r(u,g=>p(Gt,g),()=>o(Gt)),Y(n,u)};z(Ca,n=>{k()&&n(Aa)})}J(Rt),_r(Rt,n=>p(q,n),()=>o(q)),ke(n=>{T(Rt,"data-state",o(R)),T(Rt,"data-floating",k()),T(Rt,"data-overlay",Ae()),Gi=lo(Ar,1,"altcha-checkbox",null,Gi,n),T(vt,"id",o(mi)),vt.required=l()!=="onsubmit"&&(!k()||l()!=="off"),T(Ir,"for",o(mi))},[()=>({"altcha-checkbox-verifying":o(R)===w.VERIFYING})]),Ze("invalid",vt,ki),fo(vt,()=>o(Yt),n=>p(Yt,n)),Y(e,Hi);var Ia=Zn({clarify:Wt,configure:Mi,getConfiguration:Ui,getFloatingAnchor:qi,getPlugin:da,getState:ji,hide:Jt,repositionFloating:Kt,reset:dt,setFloatingAnchor:Bi,setState:Oe,show:Cr,verify:Ue,get auto(){return l()},set auto(n=void 0){l(n),C()},get blockspam(){return f()},set blockspam(n=void 0){f(n),C()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),C()},get challengejson(){return c()},set challengejson(n=void 0){c(n),C()},get credentials(){return d()},set credentials(n=void 0){d(n),C()},get customfetch(){return b()},set customfetch(n=void 0){b(n),C()},get debug(){return h()},set debug(n=!1){h(n),C()},get delay(){return m()},set delay(n=0){m(n),C()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),C()},get refetchonexpire(){return L()},set refetchonexpire(n=!0){L(n),C()},get disablerefetchonexpire(){return O()},set disablerefetchonexpire(n=!L){O(n),C()},get expire(){return B()},set expire(n=void 0){B(n),C()},get floating(){return k()},set floating(n=void 0){k(n),C()},get floatinganchor(){return re()},set floatinganchor(n=void 0){re(n),C()},get floatingoffset(){return ce()},set floatingoffset(n=void 0){ce(n),C()},get floatingpersist(){return ne()},set floatingpersist(n=!1){ne(n),C()},get hidefooter(){return Me()},set hidefooter(n=!1){Me(n),C()},get hidelogo(){return H()},set hidelogo(n=!1){H(n),C()},get id(){return Ne()},set id(n=void 0){Ne(n),C()},get language(){return We()},set language(n=void 0){We(n),C()},get name(){return ot()},set name(n="altcha"){ot(n),C()},get maxnumber(){return at()},set maxnumber(n=1e6){at(n),C()},get mockerror(){return jt()},set mockerror(n=!1){jt(n),C()},get obfuscated(){return Je()},set obfuscated(n=void 0){Je(n),C()},get overlay(){return Ae()},set overlay(n=void 0){Ae(n),C()},get overlaycontent(){return Bt()},set overlaycontent(n=void 0){Bt(n),C()},get plugins(){return yr()},set plugins(n=void 0){yr(n),C()},get sentinel(){return st()},set sentinel(n=void 0){st(n),C()},get spamfilter(){return De()},set spamfilter(n=!1){De(n),C()},get strings(){return Ct()},set strings(n=void 0){Ct(n),C()},get test(){return ye()},set test(n=!1){ye(n),C()},get verifyurl(){return se()},set verifyurl(n=void 0){se(n),C()},get workers(){return At()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){At(n),C()},get workerurl(){return Ht()},set workerurl(n=void 0){Ht(n),C()}});return i(),Ia}Ql(["change","keydown","click"]),customElements.define("altcha-widget",yo(vi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},disablerefetchonexpire:{type:"Boolean"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},overlay:{},overlaycontent:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>new Worker(new URL(e||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:S&&S.tagName.toUpperCase()==="SCRIPT"&&S.src||new URL("altcha.umd.cjs",document.baseURI).href)),$.Altcha=vi,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(ut,He){typeof exports=="object"&&typeof module<"u"?He(exports):typeof define=="function"&&define.amd?define(["exports"],He):(ut=typeof globalThis<"u"?globalThis:ut||self,He(ut.altcha={}))})(this,function(ut){"use strict";var He=typeof document<"u"?document.currentScript:null;const Bi="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Bi);const Hi=1,Yi=4,Gi=8,Zi=16,Wi=1,Ji=2,En="[",zn="[!",Qn="]",ft={},ie=Symbol(),Ki="http://www.w3.org/1999/xhtml",er=!1;function tr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var nr=Array.isArray,Xi=Array.prototype.indexOf,zi=Array.from,Gt=Object.keys,It=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,Qi=Object.getOwnPropertyDescriptors,el=Object.prototype,tl=Array.prototype,rr=Object.getPrototypeOf,ir=Object.isExtensible;const ct=()=>{};function lr(e){for(var t=0;t<e.length;t++)e[t]()}function nl(e,t,n=!1){return e===void 0?n?t():t:e}const ge=2,or=4,Zt=8,Cn=16,ke=32,Ge=64,Wt=128,se=256,Jt=512,le=1024,ye=2048,Ze=4096,dt=8192,Kt=16384,rl=32768,An=65536,il=1<<19,ar=1<<20,In=1<<21,xt=Symbol("$state"),sr=Symbol("legacy props"),ll=Symbol("");function ol(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function al(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function sl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ul(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function fl(){throw new Error("https://svelte.dev/e/hydration_failed")}function cl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function dl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function vl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function hl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Xt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let L=!1;function vt(e){L=e}let P;function De(e){if(e===null)throw Xt(),ft;return P=e}function ht(){return De(Pe(P))}function G(e){if(L){if(Pe(P)!==null)throw Xt(),ft;P=e}}function gl(){for(var e=0,t=P;;){if(t.nodeType===8){var n=t.data;if(n===Qn){if(e===0)return t;e-=1}else(n===En||n===zn)&&(e+=1)}var i=Pe(t);t.remove(),t=i}}let _l=!1;function Le(e){if(typeof e!="object"||e===null||xt in e)return e;const t=rr(e);if(t!==el&&t!==tl)return e;var n=new Map,i=nr(e),a=T(0),o=k,s=f=>{var c=k;Ce(o);var d=f();return Ce(c),d};return i&&n.set("length",T(e.length)),new Proxy(e,{defineProperty(f,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&dl();var m=n.get(c);return m===void 0?(m=s(()=>T(d.value)),n.set(c,m)):b(m,s(()=>Le(d.value))),!0},deleteProperty(f,c){var d=n.get(c);if(d===void 0)c in f&&(n.set(c,s(()=>T(ie))),xn(a));else{if(i&&typeof c=="string"){var m=n.get("length"),h=Number(c);Number.isInteger(h)&&h<m.v&&b(m,h)}b(d,ie),xn(a)}return!0},get(f,c,d){if(c===xt)return e;var m=n.get(c),h=c in f;if(m===void 0&&(!h||Ye(f,c)?.writable)&&(m=s(()=>T(Le(h?f[c]:ie))),n.set(c,m)),m!==void 0){var p=l(m);return p===ie?void 0:p}return Reflect.get(f,c,d)},getOwnPropertyDescriptor(f,c){var d=Reflect.getOwnPropertyDescriptor(f,c);if(d&&"value"in d){var m=n.get(c);m&&(d.value=l(m))}else if(d===void 0){var h=n.get(c),p=h?.v;if(h!==void 0&&p!==ie)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return d},has(f,c){if(c===xt)return!0;var d=n.get(c),m=d!==void 0&&d.v!==ie||Reflect.has(f,c);if(d!==void 0||S!==null&&(!m||Ye(f,c)?.writable)){d===void 0&&(d=s(()=>T(m?Le(f[c]):ie)),n.set(c,d));var h=l(d);if(h===ie)return!1}return m},set(f,c,d,m){var h=n.get(c),p=c in f;if(i&&c==="length")for(var w=d;w<h.v;w+=1){var F=n.get(w+"");F!==void 0?b(F,ie):w in f&&(F=s(()=>T(ie)),n.set(w+"",F))}h===void 0?(!p||Ye(f,c)?.writable)&&(h=s(()=>T(void 0)),b(h,s(()=>Le(d))),n.set(c,h)):(p=h.v!==ie,b(h,s(()=>Le(d))));var V=Reflect.getOwnPropertyDescriptor(f,c);if(V?.set&&V.set.call(m,d),!p){if(i&&typeof c=="string"){var U=n.get("length"),R=Number(c);Number.isInteger(R)&&R>=U.v&&b(U,R+1)}xn(a)}return!0},ownKeys(f){l(a);var c=Reflect.ownKeys(f).filter(h=>{var p=n.get(h);return p===void 0||p.v!==ie});for(var[d,m]of n)m.v!==ie&&!(d in f)&&c.push(d);return c},setPrototypeOf(){vl()}})}function xn(e,t=1){b(e,e.v+t)}var ur,fr,cr,dr;function Rn(){if(ur===void 0){ur=window,fr=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;cr=Ye(t,"firstChild").get,dr=Ye(t,"nextSibling").get,ir(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ir(n)&&(n.__t=void 0)}}function zt(e=""){return document.createTextNode(e)}function de(e){return cr.call(e)}function Pe(e){return dr.call(e)}function Z(e,t){if(!L)return de(e);var n=de(P);return n===null&&(n=P.appendChild(zt())),De(n),n}function Rt(e,t){if(!L){var n=de(e);return n instanceof Comment&&n.data===""?Pe(n):n}return P}function W(e,t=1,n=!1){let i=L?P:e;for(var a;t--;)a=i,i=Pe(i);if(!L)return i;var o=i?.nodeType;if(n&&o!==3){var s=zt();return i===null?a?.after(s):i.before(s),De(s),s}return De(i),i}function ml(e){e.textContent=""}function vr(e){return e===this.v}function hr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function $n(e){return!hr(e,this.v)}function Qt(e){var t=ge|ye,n=k!==null&&(k.f&ge)!==0?k:null;return S===null||n!==null&&(n.f&se)!==0?t|=se:S.f|=ar,{ctx:te,deps:null,effects:null,equals:vr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??S}}function $t(e){const t=Qt(e);return kr(t),t}function pl(e){const t=Qt(e);return t.equals=$n,t}function gr(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Oe(t[n])}}function bl(e){for(var t=e.parent;t!==null;){if((t.f&ge)===0)return t;t=t.parent}return null}function _r(e){var t,n=S;Fe(bl(e));try{gr(e),t=Lr(e)}finally{Fe(n)}return t}function mr(e){var t=_r(e),n=(Ve||(e.f&se)!==0)&&e.deps!==null?Ze:le;_e(e,n),e.equals(t)||(e.v=t,e.wv=Tr())}function yl(e){S===null&&k===null&&sl(),k!==null&&(k.f&se)!==0&&S===null&&al(),Tt&&ol()}function wl(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function We(e,t,n,i=!0){var a=S,o={ctx:te,deps:null,nodes_start:null,nodes_end:null,f:e|ye,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(n)try{On(o),o.f|=rl}catch(c){throw Oe(o),c}else t!==null&&an(o);var s=n&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(ar|Wt))===0;if(!s&&i&&(a!==null&&wl(o,a),k!==null&&(k.f&ge)!==0)){var f=k;(f.effects??=[]).push(o)}return o}function kn(e){const t=We(Zt,null,!1);return _e(t,le),t.teardown=e,t}function Sn(e){yl();var t=S!==null&&(S.f&ke)!==0&&te!==null&&!te.m;if(t){var n=te;(n.e??=[]).push({fn:e,effect:S,reaction:k})}else{var i=Tn(e);return i}}function El(e){const t=We(Ge,e,!0);return()=>{Oe(t)}}function Cl(e){const t=We(Ge,e,!0);return(n={})=>new Promise(i=>{n.outro?Ln(t,()=>{Oe(t),i(void 0)}):(Oe(t),i(void 0))})}function Tn(e){return We(or,e,!1)}function Nn(e){return We(Zt,e,!0)}function we(e,t=[],n=Qt){const i=t.map(n);return pr(()=>e(...i.map(l)))}function pr(e,t=0){return We(Zt|Cn|t,e,!0)}function Dn(e,t=!0){return We(Zt|ke,e,!0,t)}function br(e){var t=e.teardown;if(t!==null){const n=Tt,i=k;$r(!0),Ce(null);try{t.call(null)}finally{$r(n),Ce(i)}}}function yr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;(n.f&Ge)!==0?n.parent=null:Oe(n,t),n=i}}function Al(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&ke)===0&&Oe(t),t=n}}function Oe(e,t=!0){var n=!1;(t||(e.f&il)!==0)&&e.nodes_start!==null&&(wr(e.nodes_start,e.nodes_end),n=!0),yr(e,t&&!n),on(e,0),_e(e,Kt);var i=e.transitions;if(i!==null)for(const o of i)o.stop();br(e);var a=e.parent;a!==null&&a.first!==null&&Er(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function wr(e,t){for(;e!==null;){var n=e===t?null:Pe(e);e.remove(),e=n}}function Er(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function Ln(e,t){var n=[];Cr(e,n,!0),Il(n,()=>{Oe(e),t&&t()})}function Il(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var a of e)a.out(i)}else t()}function Cr(e,t,n){if((e.f&dt)===0){if(e.f^=dt,e.transitions!==null)for(const s of e.transitions)(s.is_global||n)&&t.push(s);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&An)!==0||(i.f&ke)!==0;Cr(i,t,o?n:!1),i=a}}}function Ar(e){Ir(e,!0)}function Ir(e,t){if((e.f&dt)!==0){e.f^=dt,(e.f&le)===0&&(e.f^=le),Dt(e)&&(_e(e,ye),an(e));for(var n=e.first;n!==null;){var i=n.next,a=(n.f&An)!==0||(n.f&ke)!==0;Ir(n,a?t:!1),n=i}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}const xl=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let kt=[],St=[];function xr(){var e=kt;kt=[],lr(e)}function Rr(){var e=St;St=[],lr(e)}function Pn(e){kt.length===0&&queueMicrotask(xr),kt.push(e)}function Rl(e){St.length===0&&xl(Rr),St.push(e)}function $l(){kt.length>0&&xr(),St.length>0&&Rr()}let en=!1,tn=!1,nn=null,Je=!1,Tt=!1;function $r(e){Tt=e}let Nt=[],Ca=[],k=null,Ee=!1;function Ce(e){k=e}let S=null;function Fe(e){S=e}let Se=null;function kr(e){k!==null&&k.f&In&&(Se===null?Se=[e]:Se.push(e))}let ee=null,ue=0,ve=null;function kl(e){ve=e}let Sr=1,rn=0,Ve=!1;function Tr(){return++Sr}function Dt(e){var t=e.f;if((t&ye)!==0)return!0;if((t&Ze)!==0){var n=e.deps,i=(t&se)!==0;if(n!==null){var a,o,s=(t&Jt)!==0,f=i&&S!==null&&!Ve,c=n.length;if(s||f){var d=e,m=d.parent;for(a=0;a<c;a++)o=n[a],(s||!o?.reactions?.includes(d))&&(o.reactions??=[]).push(d);s&&(d.f^=Jt),f&&m!==null&&(m.f&se)===0&&(d.f^=se)}for(a=0;a<c;a++)if(o=n[a],Dt(o)&&mr(o),o.wv>e.wv)return!0}(!i||S!==null&&!Ve)&&_e(e,le)}return!1}function Sl(e,t){for(var n=t;n!==null;){if((n.f&Wt)!==0)try{n.fn(e);return}catch{n.f^=Wt}n=n.parent}throw en=!1,e}function Nr(e){return(e.f&Kt)===0&&(e.parent===null||(e.parent.f&Wt)===0)}function ln(e,t,n,i){if(en){if(n===null&&(en=!1),Nr(t))throw e;return}if(n!==null&&(en=!0),Sl(e,t),Nr(t))throw e}function Dr(e,t,n=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];Se?.includes(e)||((o.f&ge)!==0?Dr(o,t,!1):t===o&&(n?_e(o,ye):(o.f&le)!==0&&_e(o,Ze),an(o)))}}function Lr(e){var t=ee,n=ue,i=ve,a=k,o=Ve,s=Se,f=te,c=Ee,d=e.f;ee=null,ue=0,ve=null,Ve=(d&se)!==0&&(Ee||!Je||k===null),k=(d&(ke|Ge))===0?e:null,Se=null,Vr(e.ctx),Ee=!1,rn++,e.f|=In;try{var m=(0,e.fn)(),h=e.deps;if(ee!==null){var p;if(on(e,ue),h!==null&&ue>0)for(h.length=ue+ee.length,p=0;p<ee.length;p++)h[ue+p]=ee[p];else e.deps=h=ee;if(!Ve)for(p=ue;p<h.length;p++)(h[p].reactions??=[]).push(e)}else h!==null&&ue<h.length&&(on(e,ue),h.length=ue);if(qr()&&ve!==null&&!Ee&&h!==null&&(e.f&(ge|Ze|ye))===0)for(p=0;p<ve.length;p++)Dr(ve[p],e);return a!==null&&a!==e&&(rn++,ve!==null&&(i===null?i=ve:i.push(...ve))),m}finally{ee=t,ue=n,ve=i,k=a,Ve=o,Se=s,Vr(f),Ee=c,e.f^=In}}function Tl(e,t){let n=t.reactions;if(n!==null){var i=Xi.call(n,e);if(i!==-1){var a=n.length-1;a===0?n=t.reactions=null:(n[i]=n[a],n.pop())}}n===null&&(t.f&ge)!==0&&(ee===null||!ee.includes(t))&&(_e(t,Ze),(t.f&(se|Jt))===0&&(t.f^=Jt),gr(t),on(t,0))}function on(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)Tl(e,n[i])}function On(e){var t=e.f;if((t&Kt)===0){_e(e,le);var n=S,i=te,a=Je;S=e,Je=!0;try{(t&Cn)!==0?Al(e):yr(e),br(e);var o=Lr(e);e.teardown=typeof o=="function"?o:null,e.wv=Sr;var s=e.deps,f;er&&_l&&e.f&ye}catch(c){ln(c,e,n,i||e.ctx)}finally{Je=a,S=n}}}function Nl(){try{ul()}catch(e){if(nn!==null)ln(e,nn,null);else throw e}}function Pr(){var e=Je;try{var t=0;for(Je=!0;Nt.length>0;){t++>1e3&&Nl();var n=Nt,i=n.length;Nt=[];for(var a=0;a<i;a++){var o=Ll(n[a]);Dl(o)}Lt.clear()}}finally{tn=!1,Je=e,nn=null}}function Dl(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if((i.f&(Kt|dt))===0)try{Dt(i)&&(On(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?Er(i):i.fn=null))}catch(a){ln(a,i,null,i.ctx)}}}function an(e){tn||(tn=!0,queueMicrotask(Pr));for(var t=nn=e;t.parent!==null;){t=t.parent;var n=t.f;if((n&(Ge|ke))!==0){if((n&le)===0)return;t.f^=le}}Nt.push(t)}function Ll(e){for(var t=[],n=e;n!==null;){var i=n.f,a=(i&(ke|Ge))!==0,o=a&&(i&le)!==0;if(!o&&(i&dt)===0){if((i&or)!==0)t.push(n);else if(a)n.f^=le;else try{Dt(n)&&On(n)}catch(c){ln(c,n,null,n.ctx)}var s=n.first;if(s!==null){n=s;continue}}var f=n.parent;for(n=n.next;n===null&&f!==null;)n=f.next,f=f.parent}return t}function E(e){for(var t;;){if($l(),Nt.length===0)return t;tn=!0,Pr()}}async function Fn(){await Promise.resolve(),E()}function l(e){var t=e.f,n=(t&ge)!==0;if(k!==null&&!Ee){if(!Se?.includes(e)){var i=k.deps;e.rv<rn&&(e.rv=rn,ee===null&&i!==null&&i[ue]===e?ue++:ee===null?ee=[e]:(!Ve||!ee.includes(e))&&ee.push(e))}}else if(n&&e.deps===null&&e.effects===null){var a=e,o=a.parent;o!==null&&(o.f&se)===0&&(a.f^=se)}return n&&(a=e,Dt(a)&&mr(a)),Tt&&Lt.has(e)?Lt.get(e):e.v}function Ke(e){var t=Ee;try{return Ee=!0,e()}finally{Ee=t}}const Pl=-7169;function _e(e,t){e.f=e.f&Pl|t}const Lt=new Map;function Or(e,t){var n={f:0,v:e,reactions:null,equals:vr,rv:0,wv:0};return n}function T(e,t){const n=Or(e);return kr(n),n}function Vn(e,t=!1){const n=Or(e);return t||(n.equals=$n),n}function b(e,t,n=!1){k!==null&&!Ee&&qr()&&(k.f&(ge|Cn))!==0&&!Se?.includes(e)&&hl();let i=n?Le(t):t;return Ol(e,i)}function Ol(e,t){if(!e.equals(t)){var n=e.v;Tt?Lt.set(e,t):Lt.set(e,n),e.v=t,(e.f&ge)!==0&&((e.f&ye)!==0&&_r(e),_e(e,(e.f&se)===0?le:Ze)),e.wv=Tr(),Fr(e,ye),S!==null&&(S.f&le)!==0&&(S.f&(ke|Ge))===0&&(ve===null?kl([e]):ve.push(e))}return t}function Fr(e,t){var n=e.reactions;if(n!==null)for(var i=n.length,a=0;a<i;a++){var o=n[a],s=o.f;(s&ye)===0&&(_e(o,t),(s&(le|se))!==0&&((s&ge)!==0?Fr(o,Ze):an(o)))}}let te=null;function Vr(e){te=e}function Mr(e,t=!1,n){var i=te={p:te,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};kn(()=>{i.d=!0})}function Ur(e){const t=te;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var n=S,i=k;t.e=null;try{for(var a=0;a<s.length;a++){var o=s[a];Fe(o.effect),Ce(o.reaction),Tn(o.fn)}}finally{Fe(n),Ce(i)}}te=t.p,t.m=!0}return e||{}}function qr(){return!0}const Fl=["touchstart","touchmove"];function Vl(e){return Fl.includes(e)}function Ml(e,t){if(t){const n=document.body;e.autofocus=!0,Pn(()=>{document.activeElement===n&&e.focus()})}}let jr=!1;function Br(){jr||(jr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Hr(e){var t=k,n=S;Ce(null),Fe(null);try{return e()}finally{Ce(t),Fe(n)}}function Ul(e,t,n,i=n){e.addEventListener(t,()=>Hr(n));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Br()}const Yr=new Set,Mn=new Set;function ql(e,t,n,i={}){function a(o){if(i.capture||Pt.call(t,o),!o.cancelBubble)return Hr(()=>n?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Pn(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Me(e,t,n,i,a){var o={capture:i,passive:a},s=ql(e,t,n,o);(t===document.body||t===window||t===document)&&kn(()=>{t.removeEventListener(e,s,o)})}function jl(e){for(var t=0;t<e.length;t++)Yr.add(e[t]);for(var n of Mn)n(e)}function Pt(e){var t=this,n=t.ownerDocument,i=e.type,a=e.composedPath?.()||[],o=a[0]||e.target,s=0,f=e.__root;if(f){var c=a.indexOf(f);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=a.indexOf(t);if(d===-1)return;c<=d&&(s=c)}if(o=a[s]||e.target,o!==t){It(e,"currentTarget",{configurable:!0,get(){return o||n}});var m=k,h=S;Ce(null),Fe(null);try{for(var p,w=[];o!==null;){var F=o.assignedSlot||o.parentNode||o.host||null;try{var V=o["__"+i];if(V!=null&&(!o.disabled||e.target===o))if(nr(V)){var[U,...R]=V;U.apply(o,[e,...R])}else V.call(o,e)}catch(ne){p?w.push(ne):p=ne}if(e.cancelBubble||F===t||F===null)break;o=F}if(p){for(let ne of w)queueMicrotask(()=>{throw ne});throw p}}finally{e.__root=t,delete e.currentTarget,Ce(m),Fe(h)}}}function Un(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ae(e,t){var n=S;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function me(e,t){var n=(t&Wi)!==0,i=(t&Ji)!==0,a,o=!e.startsWith("<!>");return()=>{if(L)return Ae(P,null),P;a===void 0&&(a=Un(o?e:"<!>"+e),n||(a=de(a)));var s=i||fr?document.importNode(a,!0):a.cloneNode(!0);if(n){var f=de(s),c=s.lastChild;Ae(f,c)}else Ae(s,s);return s}}function sn(e,t,n="svg"){var i=!e.startsWith("<!>"),a=`<${n}>${i?e:"<!>"+e}</${n}>`,o;return()=>{if(L)return Ae(P,null),P;if(!o){var s=Un(a),f=de(s);o=de(f)}var c=o.cloneNode(!0);return Ae(c,c),c}}function un(){if(L)return Ae(P,null),P;var e=document.createDocumentFragment(),t=document.createComment(""),n=zt();return e.append(t,n),Ae(t,n),e}function B(e,t){if(L){S.nodes_end=P,ht();return}e!==null&&e.before(t)}function Bl(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function Gr(e,t){return Zr(e,t)}function Hl(e,t){Rn(),t.intro=t.intro??!1;const n=t.target,i=L,a=P;try{for(var o=de(n);o&&(o.nodeType!==8||o.data!==En);)o=Pe(o);if(!o)throw ft;vt(!0),De(o),ht();const s=Zr(e,{...t,anchor:o});if(P===null||P.nodeType!==8||P.data!==Qn)throw Xt(),ft;return vt(!1),s}catch(s){if(s===ft)return t.recover===!1&&fl(),Rn(),ml(n),vt(!1),Gr(e,t);throw s}finally{vt(i),De(a)}}const gt=new Map;function Zr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0}){Rn();var f=new Set,c=h=>{for(var p=0;p<h.length;p++){var w=h[p];if(!f.has(w)){f.add(w);var F=Vl(w);t.addEventListener(w,Pt,{passive:F});var V=gt.get(w);V===void 0?(document.addEventListener(w,Pt,{passive:F}),gt.set(w,1)):gt.set(w,V+1)}}};c(zi(Yr)),Mn.add(c);var d=void 0,m=Cl(()=>{var h=n??t.appendChild(zt());return Dn(()=>{if(o){Mr({});var p=te;p.c=o}a&&(i.$$events=a),L&&Ae(h,null),d=e(h,i)||{},L&&(S.nodes_end=P),o&&Ur()}),()=>{for(var p of f){t.removeEventListener(p,Pt);var w=gt.get(p);--w===0?(document.removeEventListener(p,Pt),gt.delete(p)):gt.set(p,w)}Mn.delete(c),h!==n&&h.parentNode?.removeChild(h)}});return qn.set(d,m),d}let qn=new WeakMap;function Yl(e,t){const n=qn.get(e);return n?(qn.delete(e),n(t)):Promise.resolve()}function J(e,t,[n,i]=[0,0]){L&&n===0&&ht();var a=e,o=null,s=null,f=ie,c=n>0?An:0,d=!1;const m=(p,w=!0)=>{d=!0,h(w,p)},h=(p,w)=>{if(f===(f=p))return;let F=!1;if(L&&i!==-1){if(n===0){const U=a.data;U===En?i=0:U===zn?i=1/0:(i=parseInt(U.substring(1)),i!==i&&(i=f?1/0:-1))}const V=i>n;!!f===V&&(a=gl(),De(a),vt(!1),F=!0,i=-1)}f?(o?Ar(o):w&&(o=Dn(()=>w(a))),s&&Ln(s,()=>{s=null})):(s?Ar(s):w&&(s=Dn(()=>w(a,[n+1,i]))),o&&Ln(o,()=>{o=null})),F&&vt(!0)};pr(()=>{d=!1,t(m),d||h(null,null)},c),L&&(a=P)}function Xe(e,t,n=!1,i=!1,a=!1){var o=e,s="";we(()=>{var f=S;if(s===(s=t()??"")){L&&ht();return}if(f.nodes_start!==null&&(wr(f.nodes_start,f.nodes_end),f.nodes_start=f.nodes_end=null),s!==""){if(L){P.data;for(var c=ht(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Pe(c);if(c===null)throw Xt(),ft;Ae(P,d),o=De(c);return}var m=s+"";n?m=`<svg>${m}</svg>`:i&&(m=`<math>${m}</math>`);var h=Un(m);if((n||i)&&(h=de(h)),Ae(de(h),h.lastChild),n||i)for(;de(h);)o.before(de(h));else o.before(h)}})}function Gl(e,t,n,i,a){L&&ht();var o=t.$$slots?.[n],s=!1;o===!0&&(o=t.children,s=!0),o===void 0||o(e,s?()=>i:i)}const Wr=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Zl(e,t,n){var i=""+e;if(n){for(var a in n)if(n[a])i=i?i+" "+a:a;else if(i.length)for(var o=a.length,s=0;(s=i.indexOf(a,s))>=0;){var f=s+o;(s===0||Wr.includes(i[s-1]))&&(f===i.length||Wr.includes(i[f]))?i=(s===0?"":i.substring(0,s))+i.substring(f+1):s=f}}return i===""?null:i}function Wl(e,t,n,i,a,o){var s=e.__className;if(L||s!==n||s===void 0){var f=Zl(n,i,o);(!L||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=n}else if(o&&a!==o)for(var c in o){var d=!!o[c];(a==null||d!==!!a[c])&&e.classList.toggle(c,d)}return o}const Jl=Symbol("is custom element"),Kl=Symbol("is html");function Jr(e){if(L){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;$(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;$(e,"checked",null),e.checked=a}}};e.__on_r=n,Rl(n),Br()}}function Xl(e,t){var n=Kr(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function $(e,t,n,i){var a=Kr(e);L&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=n)&&(t==="loading"&&(e[ll]=n),n==null?e.removeAttribute(t):typeof n!="string"&&zl(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Kr(e){return e.__attributes??={[Jl]:e.nodeName.includes("-"),[Kl]:e.namespaceURI===Ki}}var Xr=new Map;function zl(e){var t=Xr.get(e.nodeName);if(t)return t;Xr.set(e.nodeName,t=[]);for(var n,i=e,a=Element.prototype;a!==i;){n=Qi(i);for(var o in n)n[o].set&&t.push(o);i=rr(i)}return t}function Ql(e,t,n=t){Ul(e,"change",i=>{var a=i?e.defaultChecked:e.checked;n(a)}),(L&&e.defaultChecked!==e.checked||Ke(t)==null)&&n(e.checked),Nn(()=>{var i=t();e.checked=!!i})}function zr(e,t){return e===t||e?.[xt]===t}function fn(e={},t,n,i){return Tn(()=>{var a,o;return Nn(()=>{a=o,o=[],Ke(()=>{e!==n(...o)&&(t(e,...o),a&&zr(n(...a),e)&&t(null,...a))})}),()=>{Pn(()=>{o&&zr(n(...o),e)&&t(null,...o)})}}),e}function Qr(e){te===null&&tr(),Sn(()=>{const t=Ke(e);if(typeof t=="function")return t})}function eo(e){te===null&&tr(),Qr(()=>()=>Ke(e))}function ei(e,t,n){if(e==null)return t(void 0),ct;const i=Ke(()=>e.subscribe(t,n));return i.unsubscribe?()=>i.unsubscribe():i}const _t=[];function to(e,t=ct){let n=null;const i=new Set;function a(f){if(hr(e,f)&&(e=f,n)){const c=!_t.length;for(const d of i)d[1](),_t.push(d,e);if(c){for(let d=0;d<_t.length;d+=2)_t[d][0](_t[d+1]);_t.length=0}}}function o(f){a(f(e))}function s(f,c=ct){const d=[f,c];return i.add(d),i.size===1&&(n=t(a,o)||ct),f(e),()=>{i.delete(d),i.size===0&&n&&(n(),n=null)}}return{set:a,update:o,subscribe:s}}function cn(e){let t;return ei(e,n=>t=n)(),t}let dn=!1,jn=Symbol();function no(e,t,n){const i=n[t]??={store:null,source:Vn(void 0),unsubscribe:ct};if(i.store!==e&&!(jn in n))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ct;else{var a=!0;i.unsubscribe=ei(e,o=>{a?i.source.v=o:b(i.source,o)}),a=!1}return e&&jn in n?cn(e):l(i.source)}function ro(){const e={};function t(){kn(()=>{for(var n in e)e[n].unsubscribe();It(e,jn,{enumerable:!1,value:!0})})}return[e,t]}function io(e){var t=dn;try{return dn=!1,[e(),dn]}finally{dn=t}}function ti(e){return e.ctx?.d??!1}function C(e,t,n,i){var a=(n&Hi)!==0,o=!0,s=(n&Gi)!==0,f=(n&Zi)!==0,c=!1,d;s?[d,c]=io(()=>e[t]):d=e[t];var m=xt in e||sr in e,h=s&&(Ye(e,t)?.set??(m&&t in e&&(q=>e[t]=q)))||void 0,p=i,w=!0,F=!1,V=()=>(F=!0,w&&(w=!1,f?p=Ke(i):p=i),p);d===void 0&&i!==void 0&&(h&&o&&cl(),d=V(),h&&h(d));var U;if(U=()=>{var q=e[t];return q===void 0?V():(w=!0,F=!1,q)},(n&Yi)===0)return U;if(h){var R=e.$$legacy;return function(q,fe){return arguments.length>0?((!fe||R||c)&&h(fe?U():q),q):U()}}var ne=!1,Te=Vn(d),Q=Qt(()=>{var q=U(),fe=l(Te);return ne?(ne=!1,fe):Te.v=q});return s&&l(Q),a||(Q.equals=$n),function(q,fe){if(arguments.length>0){const ze=fe?l(Q):s?Le(q):q;if(!Q.equals(ze)){if(ne=!0,b(Te,ze),F&&p!==void 0&&(p=ze),ti(Q))return q;Ke(()=>l(Q))}return q}return ti(Q)?Q.v:l(Q)}}function lo(e){return new oo(e)}class oo{#t;#e;constructor(t){var n=new Map,i=(o,s)=>{var f=Vn(s);return n.set(o,f),f};const a=new Proxy({...t.props||{},$$events:{}},{get(o,s){return l(n.get(s)??i(s,Reflect.get(o,s)))},has(o,s){return s===sr?!0:(l(n.get(s)??i(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,f){return b(n.get(s)??i(s,f),f),Reflect.set(o,s,f)}});this.#e=(t.hydrate?Hl:Gr)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&E(),this.#t=a.$$events;for(const o of Object.keys(this.#e))o==="$set"||o==="$destroy"||o==="$on"||It(this,o,{get(){return this.#e[o]},set(s){this.#e[o]=s},enumerable:!0});this.#e.$set=o=>{Object.assign(a,o)},this.#e.$destroy=()=>{Yl(this.#e)}}$set(t){this.#e.$set(t)}$on(t,n){this.#t[t]=this.#t[t]||[];const i=(...a)=>n.call(this,...a);return this.#t[t].push(i),()=>{this.#t[t]=this.#t[t].filter(a=>a!==i)}}$destroy(){this.#e.$destroy()}}let ni;typeof HTMLElement=="function"&&(ni=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const i=this.$$c.$on(e,t);this.$$l_u.set(t,i)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const i=this.$$l_u.get(t);i&&(i(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(i){return a=>{const o=document.createElement("slot");i!=="default"&&(o.name=i),B(a,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=ao(this);for(const i of this.$$s)i in n&&(i==="default"&&!this.$$d.children?(this.$$d.children=e(i),t.default=!0):t[i]=e(i));for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=vn(a,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=lo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=El(()=>{Nn(()=>{this.$$r=!0;for(const i of Gt(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];const a=vn(i,this.$$d[i],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,a)}this.$$r=!1})});for(const i in this.$$l)for(const a of this.$$l[i]){const o=this.$$c.$on(i,a);this.$$l_u.set(a,o)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=vn(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Gt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function vn(e,t,n,i){const a=n[e]?.type;if(t=a==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(a){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(a){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function ao(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function so(e,t,n,i,a,o){let s=class extends ni{constructor(){super(e,n,a),this.$$p_d=t}static get observedAttributes(){return Gt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return Gt(t).forEach(f=>{It(s.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(c){c=vn(f,c,t),this.$$d[f]=c;var d=this.$$c;if(d){var m=Ye(d,f)?.get;m?d[f]=c:d.$set({[f]:c})}}})}),i.forEach(f=>{It(s.prototype,f,{get(){return this.$$c?.[f]}})}),e.element=s,s}const ri=new TextEncoder;function uo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function fo(e,t="SHA-256",n=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*n));const a=await ii(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ii(e,t,n){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return uo(await crypto.subtle.digest(n.toUpperCase(),ri.encode(e+t)))}function co(e,t,n="SHA-256",i=1e6,a=0){const o=new AbortController,s=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(o.signal.aborted)return null;if(await ii(t,c,n)===e)return{number:c,took:Date.now()-s}}return null})(),controller:o}}function li(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vo(e){const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function ho(e,t=12){const n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e%256,e=Math.floor(e/256);return n}async function go(e,t="",n=1e6,i=0){const a="AES-GCM",o=new AbortController,s=Date.now(),f=async()=>{for(let m=i;m<=n;m+=1){if(o.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:ho(m)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-s}}catch{}}return null};let c=null,d=null;try{d=vo(e);const m=await crypto.subtle.digest("SHA-256",ri.encode(t));c=await crypto.subtle.importKey("raw",m,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:f(),controller:o}}var y=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(y||{}),z=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(z||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>cn(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(cn(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(cn(globalThis.altchaI18n.store))},store:to({})};const _o={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",_o);const Bn=(e,t)=>{let n=pl(()=>nl(t?.(),24));var i=yo();we(()=>{$(i,"width",l(n)),$(i,"height",l(n))}),B(e,i)};function mo(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function po(e,t){e.preventDefault(),t()}function bo(e,t,n,i,a,o,s,f){[y.UNVERIFIED,y.ERROR,y.EXPIRED,y.CODE].includes(l(t))?n()!==!1&&l(i)?.reportValidity()===!1?b(a,!1):o()?s():f():b(a,!0)}var yo=sn('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" fill="currentColor" opacity=".25"></path><path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" fill="currentColor"></path></svg>'),wo=me('<input type="hidden">'),Eo=me('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z" fill="currentColor"></path><path d="M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z" fill="currentColor"></path><path d="M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z" fill="currentColor"></path></svg></a></div>'),Co=sn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),Ao=sn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),Io=sn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),xo=me('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Ro=me("<audio hidden autoplay><source></audio>"),$o=me('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),ko=me("<div><!></div>"),So=me("<div><!></div>"),To=me('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),No=me('<div class="altcha-footer"><div><!></div></div>'),Do=me('<div class="altcha-anchor-arrow"></div>'),Lo=me('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){Mr(t,!0);const[n,i]=ro(),a=()=>no(Oo,"$altchaI18nStore",n);let o=C(t,"auto",7,void 0),s=C(t,"blockspam",7,void 0),f=C(t,"challengeurl",7,void 0),c=C(t,"challengejson",7,void 0),d=C(t,"credentials",7,void 0),m=C(t,"customfetch",7,void 0),h=C(t,"debug",7,!1),p=C(t,"delay",7,0),w=C(t,"disableautofocus",7,!1),F=C(t,"refetchonexpire",7,!0),V=C(t,"disablerefetchonexpire",23,()=>!F()),U=C(t,"expire",7,void 0),R=C(t,"floating",7,void 0),ne=C(t,"floatinganchor",7,void 0),Te=C(t,"floatingoffset",7,void 0),Q=C(t,"floatingpersist",7,!1),q=C(t,"hidefooter",7,!1),fe=C(t,"hidelogo",7,!1),ze=C(t,"id",7,void 0),hn=C(t,"language",7,void 0),Qe=C(t,"name",7,"altcha"),et=C(t,"maxnumber",7,1e6),Ot=C(t,"mockerror",7,!1),Ue=C(t,"obfuscated",7,void 0),pe=C(t,"overlay",7,void 0),Ft=C(t,"overlaycontent",7,void 0),gn=C(t,"plugins",7,void 0),tt=C(t,"sentinel",7,void 0),Ie=C(t,"spamfilter",7,!1),mt=C(t,"strings",7,void 0),he=C(t,"test",7,!1),re=C(t,"verifyurl",7,void 0),pt=C(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Vt=C(t,"workerurl",7,void 0);const{altchaI18n:Po}=globalThis,Oo=Po.store,ai=["SHA-256","SHA-384","SHA-512"],Fo="https://altcha.org/",qe=(r,u)=>{t.$$host.dispatchEvent(new CustomEvent(r,{detail:u}))},si=document.documentElement.lang?.split("-")?.[0],Hn=$t(()=>f()&&new URL(f(),location.origin).host.endsWith(".altcha.org")&&!!f()?.includes("apiKey=ckey_")),_n=$t(()=>c()?Ei(c()):void 0),Vo=$t(()=>mt()?Ei(mt()):{}),O=$t(()=>({...ci(a()),...l(Vo)})),ui=$t(()=>`${ze()||Qe()}_checkbox_${Math.round(Math.random()*1e8)}`);let nt=T(null),Mt=T(!1),Y=T(null),I=T(Le(y.UNVERIFIED)),M=T(void 0),Ut=T(null),je=T(null),ce=T(null),Yn=T(null),bt=T(null),N=T(null),qt=T(null),rt=T(null),xe=null,K=T(null),it=T(!1),Be=[],Gn=T(!1),Re=T(null);Sn(()=>{Xo(l(rt))}),Sn(()=>{zo(l(I))}),eo(()=>{Mo(),b(qt,null),l(N)&&(l(N).removeEventListener("submit",mi),l(N).removeEventListener("reset",pi),l(N).removeEventListener("focusin",_i),b(N,null)),xe&&(clearTimeout(xe),xe=null),document.removeEventListener("click",hi),document.removeEventListener("scroll",gi),window.removeEventListener("resize",wi)}),Qr(()=>{x("mounted","2.2.4"),x("workers",pt()),Bo(),x("plugins",Be.length?Be.map(r=>r.constructor.pluginName).join(", "):"none"),he()&&x("using test mode"),U()&&Wn(U()),o()!==void 0&&x("auto",o()),R()!==void 0&&xi(R()),b(N,l(M)?.closest("form"),!0),l(N)&&(l(N).addEventListener("submit",mi,{capture:!0}),l(N).addEventListener("reset",pi),(o()==="onfocus"||Q()==="focus")&&l(N).addEventListener("focusin",_i)),pe()&&Ri(!0),o()==="onload"&&(Ue()?jt():Ne()),l(Hn)&&(q()||fe())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{qe("load")})});function mn(r,u){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:u.number,salt:r.salt,signature:r.signature,test:he()?!0:void 0,took:u.took}))}function Mo(){for(const r of Be)r.destroy()}function fi(){f()&&!V()&&l(I)===y.VERIFIED?Ne():lt(y.EXPIRED,l(O).expired)}async function Uo(){if(Ot())throw x("mocking error"),new Error("Mocked error.");if(l(_n))return x("using provided json data"),Ci(l(_n).salt),l(_n);if(he())return x("generating test challenge",{test:he()}),fo(typeof he()!="boolean"?+he():void 0);{if(!f()&&l(N)){const g=l(N).getAttribute("action");g?.includes("/form/")&&f(g+"/altcha")}if(!f())throw new Error("Attribute challengeurl not set.");x("fetching challenge from",f());const r={credentials:typeof d()=="boolean"?"include":d(),headers:Ie()!==!1?{"x-altcha-spam-filter":"1"}:{}},u=await Zn()(f(),r);if(!u||!(u instanceof Response))throw new Error("Custom fetch function did not return a response.");if(u.status!==200)throw new Error(`Server responded with ${u.status}.`);const v=u.headers.get("X-Altcha-Config"),_=await u.json();if(Ci(_.salt),v)try{const g=JSON.parse(v);g&&typeof g=="object"&&(g.verifyurl&&!g.verifyurl.startsWith("fn:")&&(g.verifyurl=vi(g.verifyurl)),Si(g))}catch(g){x("unable to configure from X-Altcha-Config",g)}return _}}function qo(r){const u=l(N)?.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return u?.value?.slice(u.value.indexOf("@"))||void 0}function Zn(){let r=fetch;if(m())if(x("using customfetch"),typeof m()=="string"){if(r=globalThis[m()]||null,!r)throw new Error(`Custom fetch function not found: ${m()}`)}else r=m();return r}function ci(r,u=[hn()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(r).map(g=>g.toLowerCase()),_=u.reduce((g,A)=>(A=A.toLowerCase(),g||(r[A]?A:null)||v.find(D=>A.split("-")[0]===D.split("-")[0])||null),null);return r[_||"en"]}function jo(){return Ie()==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof Ie()=="object"?Ie():{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function di(r){return[...l(N)?.querySelectorAll(r?.length?r.map(v=>`input[name="${v}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')||[]].reduce((v,_)=>{const g=_.name,A=_.value;return g&&A&&(v[g]=/\n/.test(A)?A.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
3
|
+
`):A),v},{})}function vi(r,u){const v=new URL(f()||location.origin),_=new URL(r,v);if(_.search||(_.search=v.search),u)for(const g in u)u[g]!==void 0&&u[g]!==null&&_.searchParams.set(g,u[g]);return _.toString()}function Bo(){const r=gn()!==void 0?gn().split(","):void 0;for(const u of globalThis.altchaPlugins)(!r||r.includes(u.pluginName))&&Be.push(new u({el:l(M),clarify:jt,dispatch:qe,getConfiguration:Ti,getFloatingAnchor:Ni,getState:Di,log:x,reset:lt,solve:ki,setState:$e,setFloatingAnchor:Li,verify:Ne}))}function x(...r){(h()||r.some(u=>u instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${Qe()}]`,...r)}function Ho(){b(K,z.PAUSED,!0)}function Yo(r){b(K,z.ERROR,!0)}function Go(){b(K,z.READY,!0)}function Zo(){b(K,z.LOADING,!0)}function Wo(){b(K,z.PLAYING,!0)}function Jo(){b(K,z.PAUSED,!0)}function Ko(r){if(r.preventDefault(),r.stopPropagation(),l(Y)){const u=new FormData(r.target),v=String(u.get("code"));if(re()?.startsWith("fn:")){const _=re().replace(/^fn:/,"");if(x(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:l(Y).challenge,code:v,solution:l(Y).solution})}b(it,!0),Ai(mn(l(Y).challenge,l(Y).solution),v).then(({reason:_,verified:g})=>{g?(b(Y,null),$e(y.VERIFIED),x("verified"),Fn().then(()=>{l(Yn)?.focus(),qe("verified",{payload:l(Re)}),o()==="onsubmit"?Ii(l(qt)):pe()&&Bt()})):(lt(),b(rt,_||"Verification failed",!0))}).catch(_=>{b(Y,null),$e(y.ERROR,_),x("sentinel verification failed:",_)}).finally(()=>{b(it,!1)})}}function hi(r){const u=r.target;R()&&u&&!l(M).contains(u)&&(l(I)===y.VERIFIED&&Q()===!1||l(I)===y.VERIFIED&&Q()==="focus"&&!l(N)?.matches(":focus-within")||o()==="off"&&l(I)===y.UNVERIFIED)&&Bt()}function gi(){R()&&l(I)!==y.UNVERIFIED&&Ht()}function Xo(r){for(const u of Be)typeof u.onErrorChange=="function"&&u.onErrorChange(l(rt))}function _i(r){l(I)===y.UNVERIFIED?Ne():R()&&Q()==="focus"&&l(I)===y.VERIFIED&&pn()}function mi(r){r.target?.hasAttribute("data-code-challenge-form")||(b(qt,r.submitter,!0),l(N)&&o()==="onsubmit"?(l(qt)?.blur(),l(I)===y.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),Ne().then(()=>{Ii(l(qt))})):l(I)!==y.VERIFIED&&(r.preventDefault(),r.stopPropagation(),l(I)===y.VERIFYING&&bi())):l(N)&&R()&&o()==="off"&&l(I)===y.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),pn()))}function pi(){lt()}function bi(){l(I)===y.VERIFYING&&l(O).waitAlert&&alert(l(O).waitAlert)}function yi(){l(je)?l(je).paused?(l(je).currentTime=0,l(je).play()):l(je).pause():(b(Gn,!0),requestAnimationFrame(()=>{l(je)?.play()}))}function zo(r){for(const u of Be)typeof u.onStateChange=="function"&&u.onStateChange(l(I));R()&&l(I)!==y.UNVERIFIED&&requestAnimationFrame(()=>{Ht()}),b(Mt,l(I)===y.VERIFIED),pe()&&l(ce)&&(l(I)!==y.UNVERIFIED?pn():Bt())}function wi(){R()&&Ht()}function Ei(r){return JSON.parse(r)}function Ci(r){const u=new URLSearchParams(r.split("?")?.[1]),v=u.get("expires")||u.get("expire");if(v){const _=new Date(+v*1e3),g=isNaN(_.getTime())?0:_.getTime()-Date.now();g>0&&Wn(g)}else xe&&(clearTimeout(xe),xe=null)}async function Qo(r){if(!re())throw new Error("Attribute verifyurl not set.");x("requesting server verification from",re());const u={payload:r};if(Ie()!==!1){const{blockedCountries:g,classifier:A,disableRules:D,email:H,expectedLanguages:j,expectedCountries:oe,fields:ae,ipAddress:at,text:wt,timeZone:st}=jo();u.blockedCountries=g,u.classifier=A,u.disableRules=D,u.email=H===!1?void 0:qo(H),u.expectedCountries=oe,u.expectedLanguages=j||(si?[si]:void 0),u.fields=ae===!1?void 0:di(ae),u.ipAddress=at===!1?void 0:at||"auto",u.text=wt,u.timeZone=st===!1?void 0:st||li()}const v=await Zn()(re(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.");if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const _=await v.json();if(_?.payload&&b(Re,_.payload,!0),qe("serververification",_),s()&&_.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ai(r,u){if(!re())throw new Error("Attribute verifyurl not set.");x("requesting sentinel verification from",re());const v={code:u,payload:r};tt()&&(v.fields=tt().fields?di():void 0,v.timeZone=tt().timeZone?li():void 0);const _=await Zn()(re(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!_||!(_ instanceof Response))throw new Error("Fetch function did not return a response.");if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const g=await _.json();return g?.payload&&b(Re,g.payload,!0),qe("sentinelverification",g),g}function Ii(r){l(N)&&"requestSubmit"in l(N)?l(N).requestSubmit(r):l(N)?.reportValidity()&&(r?r.click():l(N).submit())}function Wn(r){x("expire",r),xe&&(clearTimeout(xe),xe=null),r<1?fi():xe=setTimeout(fi,r)}function xi(r){x("floating",r),R()!==r&&(l(M).style.left="",l(M).style.top=""),R(r===!0||r===""?"auto":r===!1||r==="false"?void 0:R()),R()?(o()||o("onsubmit"),document.addEventListener("scroll",gi),document.addEventListener("click",hi),window.addEventListener("resize",wi)):o()==="onsubmit"&&o(void 0)}function Ri(r){if(x("overlay",r),pe(r),r){if(o()||o("onsubmit"),l(ce)&&l(M).parentElement&&l(ce).replaceWith(l(M).parentElement),l(M)?.parentElement?.parentElement){b(ce,document.createElement("div"),!0),l(M).parentElement.parentElement.appendChild(l(ce));const u=document.createElement("div"),v=document.createElement("button");v.type="button",v.innerHTML="×",v.addEventListener("click",_=>{_.preventDefault(),lt()}),l(ce).classList.add("altcha-overlay-backdrop"),v.classList.add("altcha-overlay-close-button"),u.classList.add("altcha-overlay"),l(ce).append(u),u.append(v),Ft()&&u.append(...document.querySelectorAll(Ft())),u.append(l(M).parentElement)}}else l(ce)&&l(M).parentElement&&(l(ce).replaceWith(l(M).parentElement),l(M).style.display="block")}function $i(r){if(!r.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(r.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!ai.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${ai.join(", ")}`);if(!r.challenge||r.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!r.salt||r.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function ki(r){let u=null,v=null;if("Worker"in window){try{u=ea(r,r.maxNumber||r.maxnumber||et()),b(nt,u.controller,!0),v=await u.promise}catch(_){x(_)}finally{b(nt,null)}if(v===null||v?.number!==void 0||"obfuscated"in r)return{data:r,solution:v}}if("obfuscated"in r){const _=await go(r.obfuscated,r.key,r.maxNumber||r.maxnumber);return{data:r,solution:await _.promise}}u=co(r.challenge,r.salt,r.algorithm,r.maxNumber||r.maxnumber||et()),b(nt,u.controller,!0);try{v=await u.promise}catch(_){x(_)}finally{b(nt,null)}return{data:r,solution:v}}function ea(r,u=typeof he()=="number"?he():r.maxNumber||r.maxnumber||et(),v=Math.ceil(pt())){const _=new AbortController,g=[];v=Math.min(16,u,Math.max(1,v));for(let H=0;H<v;H++)g.push(altchaCreateWorker(Vt()));const A=Math.ceil(u/v);return{promise:(async()=>{const H=await Promise.all(g.map((j,oe)=>{const ae=oe*A;return _.signal.addEventListener("abort",()=>{j.postMessage({type:"abort"})}),new Promise(at=>{j.addEventListener("message",wt=>{if(wt.data)for(const st of g)st!==j&&st.postMessage({type:"abort"});at(wt.data)}),j.postMessage({payload:r,max:ae+A,start:ae,type:"work"})})}));for(const j of g)j.terminate();return H.find(j=>!!j)||null})(),controller:_}}async function jt(){if(!Ue()){$e(y.ERROR);return}const r=Be.find(u=>u.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){$e(y.ERROR),x("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function Si(r){r.obfuscated!==void 0&&Ue(r.obfuscated),r.auto!==void 0&&(o(r.auto),o()==="onload"&&(Ue()?jt():Ne())),r.blockspam!==void 0&&s(!!r.blockspam),r.customfetch!==void 0&&m(r.customfetch),r.floatinganchor!==void 0&&ne(r.floatinganchor),r.delay!==void 0&&p(r.delay),r.floatingoffset!==void 0&&Te(r.floatingoffset),r.floating!==void 0&&xi(r.floating),r.expire!==void 0&&(Wn(r.expire),U(r.expire)),r.challenge&&(c(typeof r.challenge=="string"?r.challenge:JSON.stringify(r.challenge)),$i(l(_n))),r.challengeurl!==void 0&&f(r.challengeurl),r.debug!==void 0&&h(!!r.debug),r.hidefooter!==void 0&&q(!!r.hidefooter),r.hidelogo!==void 0&&fe(!!r.hidelogo),r.language!==void 0&&mt(ci(a(),[r.language])),r.maxnumber!==void 0&&et(+r.maxnumber),r.mockerror!==void 0&&Ot(!!r.mockerror),r.name!==void 0&&Qe(r.name),r.overlaycontent!==void 0&&Ft(r.overlaycontent),r.overlay!==void 0&&Ri(r.overlay),r.refetchonexpire!==void 0&&V(!r.refetchonexpire),r.disablerefetchonexpire!==void 0&&V(!r.disablerefetchonexpire),r.sentinel!==void 0&&typeof r.sentinel=="object"&&tt(r.sentinel),r.spamfilter!==void 0&&Ie(typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&mt(typeof r.strings=="string"?r.strings:JSON.stringify(r.strings)),r.test!==void 0&&he(typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&re(r.verifyurl),r.workers!==void 0&&pt(+r.workers),r.workerurl!==void 0&&Vt(r.workerurl)}function Ti(){return{auto:o(),blockspam:s(),challengeurl:f(),debug:h(),delay:p(),disableautofocus:w(),disablerefetchonexpire:V(),expire:U(),floating:R(),floatinganchor:ne(),floatingoffset:Te(),hidefooter:q(),hidelogo:fe(),name:Qe(),maxnumber:et(),mockerror:Ot(),obfuscated:Ue(),overlay:pe(),refetchonexpire:!V(),spamfilter:Ie(),strings:l(O),test:he(),verifyurl:re(),workers:pt(),workerurl:Vt()}}function Ni(){return l(bt)}function ta(r){return Be.find(u=>u.constructor.pluginName===r)}function Di(){return l(I)}function Bt(){l(M).style.display="none",pe()&&l(ce)&&(l(ce).style.display="none")}function Ht(r=20){if(l(M))if(l(bt)||b(bt,(ne()?document.querySelector(ne()):l(N)?.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(N),!0),l(bt)){const u=parseInt(Te(),10)||12,v=l(bt).getBoundingClientRect(),_=l(M).getBoundingClientRect(),g=document.documentElement.clientHeight,A=document.documentElement.clientWidth,D=R()==="auto"?v.bottom+_.height+u+r>g:R()==="top",H=Math.max(r,Math.min(A-r-_.width,v.left+v.width/2-_.width/2));if(D?l(M).style.top=`${v.top-(_.height+u)}px`:l(M).style.top=`${v.bottom+u}px`,l(M).style.left=`${H}px`,l(M).setAttribute("data-floating",D?"top":"bottom"),l(Ut)){const j=l(Ut).getBoundingClientRect();l(Ut).style.left=v.left-H+v.width/2-j.width/2+"px"}}else x("unable to find floating anchor element")}function lt(r=y.UNVERIFIED,u=null){l(nt)&&(l(nt).abort(),b(nt,null)),b(Mt,!1),b(Re,null),b(Y,null),b(Gn,!1),b(K,null),$e(r,u)}function Li(r){b(bt,r,!0)}function $e(r,u=null){b(I,r,!0),b(rt,u,!0),qe("statechange",{payload:l(Re),state:l(I)})}function pn(){l(M).style.display="block",R()&&Ht(),pe()&&l(ce)&&(l(ce).style.display="flex")}async function Ne(){return lt(y.VERIFYING),await new Promise(r=>setTimeout(r,p()||0)),Uo().then(r=>($i(r),x("challenge",r),ki(r))).then(({data:r,solution:u})=>{if(x("solution",u),!u||r&&"challenge"in r&&!("clearText"in u)){if(u?.number!==void 0&&"challenge"in r)if(re()&&"codeChallenge"in r)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(document.activeElement?.tagName||"")&&w()===!1&&document.activeElement.blur(),b(Y,{challenge:r,solution:u},!0);else{if(re()&&tt()!==void 0)return Ai(mn(r,u));if(re())return Qo(mn(r,u));b(Re,mn(r,u),!0),x("payload",l(Re))}else if(l(I)!==y.EXPIRED)throw x("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}}).then(()=>{l(Y)?($e(y.CODE),Fn().then(()=>{qe("code",{codeChallenge:l(Y)})})):l(Re)&&($e(y.VERIFIED),x("verified"),Fn().then(()=>{qe("verified",{payload:l(Re)}),pe()&&Bt()}))}).catch(r=>{x(r),$e(y.ERROR,r.message)})}var Pi=Lo(),Oi=Rt(Pi);Gl(Oi,t,"default",{});var yt=W(Oi,2),Jn=Z(yt),bn=Z(Jn);let Fi;var Vi=Z(bn);{var na=r=>{Bn(r)};J(Vi,r=>{l(I)===y.VERIFYING&&r(na)})}var ot=W(Vi,2);Jr(ot),ot.__change=[bo,I,Ie,N,Mt,Ue,jt,Ne],fn(ot,r=>b(Yn,r),()=>l(Yn)),G(bn);var yn=W(bn,2),ra=Z(yn);{var ia=r=>{var u=un(),v=Rt(u);Xe(v,()=>l(O).verified),B(r,u)},la=(r,u)=>{{var v=g=>{var A=un(),D=Rt(A);Xe(D,()=>l(O).verifying),B(g,A)},_=(g,A)=>{{var D=j=>{var oe=un(),ae=Rt(oe);Xe(ae,()=>l(O).verificationRequired),B(j,oe)},H=j=>{var oe=un(),ae=Rt(oe);Xe(ae,()=>l(O).label),B(j,oe)};J(g,j=>{l(I)===y.CODE?j(D):j(H,!1)},A)}};J(r,g=>{l(I)===y.VERIFYING?g(v):g(_,!1)},u)}};J(ra,r=>{l(I)===y.VERIFIED?r(ia):r(la,!1)})}G(yn);var Mi=W(yn,2);{var oa=r=>{var u=wo();Jr(u),we(()=>{$(u,"name",Qe()),Xl(u,l(Re))}),B(r,u)};J(Mi,r=>{l(I)===y.VERIFIED&&r(oa)})}var Ui=W(Mi,2);{var aa=r=>{var u=Eo(),v=Z(u);$(v,"href",Fo),G(u),we(()=>$(v,"aria-label",l(O).ariaLinkLabel)),B(r,u)};J(Ui,r=>{(fe()!==!0||l(Hn))&&r(aa)})}var sa=W(Ui,2);{var ua=r=>{var u=$o(),v=W(Z(u),2),_=Z(v),g=W(_,2);Ml(g,!w()),g.__keydown=[mo,yi];var A=W(g,2),D=Z(A),H=Z(D);{var j=be=>{var X=xo();X.__click=yi;var wn=Z(X);{var Yt=Et=>{Bn(Et,()=>20)},ma=(Et,pa)=>{{var ba=Ct=>{var Kn=Co();B(Ct,Kn)},ya=(Ct,Kn)=>{{var wa=At=>{var Xn=Ao();B(At,Xn)},Ea=At=>{var Xn=Io();B(At,Xn)};J(Ct,At=>{l(K)===z.PLAYING?At(wa):At(Ea,!1)},Kn)}};J(Et,Ct=>{l(K)===z.ERROR?Ct(ba):Ct(ya,!1)},pa)}};J(wn,Et=>{l(K)===z.LOADING?Et(Yt):Et(ma,!1)})}G(X),we(()=>{$(X,"title",l(O).getAudioChallenge),X.disabled=l(K)===z.LOADING||l(K)===z.ERROR||l(it),$(X,"aria-label",l(K)===z.LOADING?l(O).loading:l(O).getAudioChallenge)}),B(be,X)};J(H,be=>{l(Y).challenge.codeChallenge.audio&&be(j)})}var oe=W(H,2);oe.__click=[po,Ne],G(D);var ae=W(D,2),at=Z(ae);{var wt=be=>{Bn(be,()=>16)};J(at,be=>{l(it)&&be(wt)})}var st=W(at);G(ae),G(A);var ga=W(A,2);{var _a=be=>{var X=Ro(),wn=Z(X);G(X),fn(X,Yt=>b(je,Yt),()=>l(je)),we(Yt=>$(wn,"src",Yt),[()=>vi(l(Y).challenge.codeChallenge.audio,{language:hn()})]),Me("loadstart",X,Zo),Me("canplay",X,Go),Me("pause",X,Jo),Me("playing",X,Wo),Me("ended",X,Ho),Me("error",wn,Yo),B(be,X)};J(ga,be=>{l(Y).challenge.codeChallenge.audio&&l(Gn)&&be(_a)})}G(v),G(u),we(()=>{$(u,"aria-label",l(O).verificationRequired),$(_,"src",l(Y).challenge.codeChallenge.image),$(g,"minlength",l(Y).challenge.codeChallenge.length||1),$(g,"maxlength",l(Y).challenge.codeChallenge.length),$(g,"placeholder",l(O).enterCode),$(g,"aria-label",l(K)===z.LOADING?l(O).loading:l(K)===z.PLAYING?"":l(O).enterCodeAria),$(g,"aria-live",l(K)?"assertive":"polite"),$(g,"aria-busy",l(K)===z.LOADING),g.disabled=l(it),$(oe,"aria-label",l(O).reload),$(oe,"title",l(O).reload),oe.disabled=l(it),ae.disabled=l(it),$(ae,"aria-label",l(O).verify),Bl(st,` ${l(O).verify??""}`)}),Me("submit",v,Ko,!0),B(r,u)};J(sa,r=>{l(Y)?.challenge.codeChallenge&&r(ua)})}G(Jn);var qi=W(Jn,2);{var fa=r=>{var u=To(),v=W(Z(u),2);{var _=A=>{var D=ko(),H=Z(D);Xe(H,()=>l(O).expired),G(D),we(()=>$(D,"title",l(rt))),B(A,D)},g=A=>{var D=So(),H=Z(D);Xe(H,()=>l(O).error),G(D),we(()=>$(D,"title",l(rt))),B(A,D)};J(v,A=>{l(I)===y.EXPIRED?A(_):A(g,!1)})}G(u),B(r,u)};J(qi,r=>{(l(rt)||l(I)===y.EXPIRED)&&r(fa)})}var ji=W(qi,2);{var ca=r=>{var u=No(),v=Z(u),_=Z(v);Xe(_,()=>l(O).footer),G(v),G(u),B(r,u)};J(ji,r=>{l(O).footer&&(q()!==!0||l(Hn))&&r(ca)})}var da=W(ji,2);{var va=r=>{var u=Do();fn(u,v=>b(Ut,v),()=>l(Ut)),B(r,u)};J(da,r=>{R()&&r(va)})}G(yt),fn(yt,r=>b(M,r),()=>l(M)),we(r=>{$(yt,"data-state",l(I)),$(yt,"data-floating",R()),$(yt,"data-overlay",pe()),Fi=Wl(bn,1,"altcha-checkbox",null,Fi,r),$(ot,"id",l(ui)),ot.required=o()!=="onsubmit"&&(!R()||o()!=="off"),$(yn,"for",l(ui))},[()=>({"altcha-checkbox-verifying":l(I)===y.VERIFYING})]),Me("invalid",ot,bi),Ql(ot,()=>l(Mt),r=>b(Mt,r)),B(e,Pi);var ha=Ur({clarify:jt,configure:Si,getConfiguration:Ti,getFloatingAnchor:Ni,getPlugin:ta,getState:Di,hide:Bt,repositionFloating:Ht,reset:lt,setFloatingAnchor:Li,setState:$e,show:pn,verify:Ne,get auto(){return o()},set auto(r=void 0){o(r),E()},get blockspam(){return s()},set blockspam(r=void 0){s(r),E()},get challengeurl(){return f()},set challengeurl(r=void 0){f(r),E()},get challengejson(){return c()},set challengejson(r=void 0){c(r),E()},get credentials(){return d()},set credentials(r=void 0){d(r),E()},get customfetch(){return m()},set customfetch(r=void 0){m(r),E()},get debug(){return h()},set debug(r=!1){h(r),E()},get delay(){return p()},set delay(r=0){p(r),E()},get disableautofocus(){return w()},set disableautofocus(r=!1){w(r),E()},get refetchonexpire(){return F()},set refetchonexpire(r=!0){F(r),E()},get disablerefetchonexpire(){return V()},set disablerefetchonexpire(r=!F){V(r),E()},get expire(){return U()},set expire(r=void 0){U(r),E()},get floating(){return R()},set floating(r=void 0){R(r),E()},get floatinganchor(){return ne()},set floatinganchor(r=void 0){ne(r),E()},get floatingoffset(){return Te()},set floatingoffset(r=void 0){Te(r),E()},get floatingpersist(){return Q()},set floatingpersist(r=!1){Q(r),E()},get hidefooter(){return q()},set hidefooter(r=!1){q(r),E()},get hidelogo(){return fe()},set hidelogo(r=!1){fe(r),E()},get id(){return ze()},set id(r=void 0){ze(r),E()},get language(){return hn()},set language(r=void 0){hn(r),E()},get name(){return Qe()},set name(r="altcha"){Qe(r),E()},get maxnumber(){return et()},set maxnumber(r=1e6){et(r),E()},get mockerror(){return Ot()},set mockerror(r=!1){Ot(r),E()},get obfuscated(){return Ue()},set obfuscated(r=void 0){Ue(r),E()},get overlay(){return pe()},set overlay(r=void 0){pe(r),E()},get overlaycontent(){return Ft()},set overlaycontent(r=void 0){Ft(r),E()},get plugins(){return gn()},set plugins(r=void 0){gn(r),E()},get sentinel(){return tt()},set sentinel(r=void 0){tt(r),E()},get spamfilter(){return Ie()},set spamfilter(r=!1){Ie(r),E()},get strings(){return mt()},set strings(r=void 0){mt(r),E()},get test(){return he()},set test(r=!1){he(r),E()},get verifyurl(){return re()},set verifyurl(r=void 0){re(r),E()},get workers(){return pt()},set workers(r=Math.min(16,navigator.hardwareConcurrency||8)){pt(r),E()},get workerurl(){return Vt()},set workerurl(r=void 0){Vt(r),E()}});return i(),ha}jl(["change","keydown","click"]),customElements.define("altcha-widget",so(oi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},disablerefetchonexpire:{type:"Boolean"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},overlay:{},overlaycontent:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>new Worker(new URL(e||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:He&&He.tagName.toUpperCase()==="SCRIPT"&&He.src||new URL("altcha.umd.cjs",document.baseURI).href)),ut.Altcha=oi,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});
|
package/dist_external/worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,
|
|
1
|
+
(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,l=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=l;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const l="AES-GCM",o=new AbortController,a=Date.now(),s=async()=>{for(let i=n;i<=r;i+=1){if(o.signal.aborted||!c||!u)return null;try{const f=await crypto.subtle.decrypt({name:l,iv:g(i)},c,u);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,u=null;try{u=h(e);const i=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",i,l,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}let y;onmessage=async e=>{const{type:t,payload:r,start:n,max:l}=e.data;let o=null;if(t==="abort")y?.abort(),y=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:s}=r||{};o=await m(s,a,l,n)}else{const{algorithm:a,challenge:s,salt:c}=r||{};o=w(s,c,a,l,n)}y=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altcha",
|
|
3
3
|
"description": "Privacy-first CAPTCHA widget, compliant with global regulations (GDPR/HIPAA/CCPA/LGDP/DPDPA/PIPL) and WCAG accessible. No tracking, self-verifying.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Daniel Regeci",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
39
39
|
"dist_external",
|
|
40
|
-
"dist_plugins",
|
|
41
40
|
"dist_i18n"
|
|
42
41
|
],
|
|
43
42
|
"main": "./dist/altcha.umd.cjs",
|
|
@@ -52,18 +51,6 @@
|
|
|
52
51
|
"import": "./dist_external/altcha.css",
|
|
53
52
|
"require": "./dist_external/altcha.css"
|
|
54
53
|
},
|
|
55
|
-
"./analytics": {
|
|
56
|
-
"import": "./dist_plugins/analytics.js",
|
|
57
|
-
"require": "./dist_plugins/analytics.umd.cjs"
|
|
58
|
-
},
|
|
59
|
-
"./obfuscation": {
|
|
60
|
-
"import": "./dist_plugins/obfuscation.js",
|
|
61
|
-
"require": "./dist_plugins/obfuscation.umd.cjs"
|
|
62
|
-
},
|
|
63
|
-
"./upload": {
|
|
64
|
-
"import": "./dist_plugins/upload.js",
|
|
65
|
-
"require": "./dist_plugins/upload.umd.cjs"
|
|
66
|
-
},
|
|
67
54
|
"./external": {
|
|
68
55
|
"import": "./dist_external/altcha.js",
|
|
69
56
|
"require": "./dist_external/altcha.umd.cjs"
|
|
@@ -83,24 +70,23 @@
|
|
|
83
70
|
},
|
|
84
71
|
"scripts": {
|
|
85
72
|
"dev": "vite",
|
|
86
|
-
"build": "npm run build:bundle && npm run build:external && npm run build:
|
|
73
|
+
"build": "npm run build:bundle && npm run build:external && npm run build:i18n",
|
|
87
74
|
"build:bundle": "rimraf dist && vite build && vite build -c vite.bundle-i18n.config.ts && cp src/declarations.d.ts dist/altcha.d.ts && cp src/declarations.d.ts dist/altcha.i18n.d.ts",
|
|
88
75
|
"build:external": "rimraf dist_external && vite build -c vite.external.config.ts && cp src/declarations.d.ts dist_external/altcha.d.ts",
|
|
89
|
-
"build:plugins": "rimraf dist_plugins && find src/plugins -type f -name '*.ts' | xargs -I {} vite build -c vite.plugins.config.ts -- {}",
|
|
90
76
|
"build:i18n": "rimraf dist_i18n && find src/i18n -type f -name '*.ts' | xargs -I {} vite build -c vite.i18n.config.ts -- {}",
|
|
91
77
|
"preview": "vite preview",
|
|
92
78
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
93
79
|
"format": "prettier --write ./src/**/*",
|
|
94
80
|
"test": "vitest run tests/helpers.test.ts",
|
|
95
|
-
"test:e2e": "testcafe chrome
|
|
81
|
+
"test:e2e": "testcafe chrome e2e/altcha.fixture.ts --hostname localhost",
|
|
96
82
|
"prepare": "husky"
|
|
97
83
|
},
|
|
98
84
|
"devDependencies": {
|
|
99
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
85
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
100
86
|
"@tsconfig/svelte": "^5.0.4",
|
|
101
87
|
"@types/csso": "^5.0.4",
|
|
102
88
|
"@types/node": "^20.16.3",
|
|
103
|
-
"@types/react": "^19.
|
|
89
|
+
"@types/react": "^19.1.14",
|
|
104
90
|
"csso": "^5.0.5",
|
|
105
91
|
"husky": "^9.1.5",
|
|
106
92
|
"prettier": "3.2.5",
|
|
@@ -112,7 +98,7 @@
|
|
|
112
98
|
"testcafe": "^3.7.2",
|
|
113
99
|
"tslib": "^2.7.0",
|
|
114
100
|
"typescript": "^5.5.4",
|
|
115
|
-
"vite": "^
|
|
101
|
+
"vite": "^7.1.7",
|
|
116
102
|
"vite-plugin-string": "^1.2.3",
|
|
117
103
|
"vitest": "^3.0.8"
|
|
118
104
|
},
|
|
@@ -121,5 +107,8 @@
|
|
|
121
107
|
},
|
|
122
108
|
"optionalDependencies": {
|
|
123
109
|
"@rollup/rollup-linux-x64-gnu": "4.18.0"
|
|
110
|
+
},
|
|
111
|
+
"overrides": {
|
|
112
|
+
"tmp": "0.2.5"
|
|
124
113
|
}
|
|
125
114
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module 'altcha/analytics';
|