altcha 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@ ALTCHA is a self-hosted, privacy-first security solution that protects your webs
5
5
  ALTCHA is fully compliant with:
6
6
 
7
7
  - **Global privacy regulations**: GDPR, HIPAA, CCPA, PIPEDA/CPPA, LGPD, DPDPA, and PIPL
8
- - **Accessibility standards**: [WCAG 2.2 AA-level](https://altcha.org/docs/wcag/) and the [European Accessibility Act](https://altcha.org/docs/european-accessibility-act-2025/)
8
+ - **Accessibility standards**: [WCAG 2.2 AA-level](https://altcha.org/docs/v2/compliance/wcag/) and the [European Accessibility Act](https://altcha.org/docs/v2/compliance/european-accessibility-act-2025/)
9
9
 
10
10
  For more details, visit [altcha.org](https://altcha.org).
11
11
 
@@ -169,6 +169,7 @@ Additional options:
169
169
  - **name**: Name of the hidden field containing the payload (defaults to "altcha").
170
170
  - **strings**: JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/widget-customization).
171
171
  - **refetchonexpire**: Automatically re-fetch and re-validate when the challenge expires (defaults to true).
172
+ - **verifyurl**: URL for server-side verification requests. This option is automatically configured with Sentinel. Override this setting only if using a custom server implementation. Supports `fn:function_name` format to call a global JS function instead.
172
173
  - **workers**: Number of workers to utilize for PoW (defaults to `navigator.hardwareConcurrency || 8`, max value `16`).
173
174
  - **workerurl**: URL of the Worker script (defaults to `./worker.js`, only works with `external` build).
174
175
 
@@ -3096,7 +3096,7 @@ function ws(e, t) {
3096
3096
  if (m)
3097
3097
  try {
3098
3098
  const L = JSON.parse(m);
3099
- L && typeof L == "object" && L.verifyurl && !L.verifyurl.startsWith("javascript:") && (L.verifyurl = ea(L.verifyurl));
3099
+ L && typeof L == "object" && L.verifyurl && !L.verifyurl.startsWith("fn:") && (L.verifyurl = ea(L.verifyurl));
3100
3100
  } catch (L) {
3101
3101
  I("unable to configure from X-Altcha-Config", L);
3102
3102
  }
@@ -3217,8 +3217,8 @@ function ws(e, t) {
3217
3217
  var f;
3218
3218
  if (a.preventDefault(), a.stopPropagation(), l(M)) {
3219
3219
  const g = new FormData(a.target), m = String(g.get("code"));
3220
- if ((f = te()) != null && f.startsWith("javascript:")) {
3221
- const b = te().replace(/^javascript:/, "");
3220
+ if ((f = te()) != null && f.startsWith("fn:")) {
3221
+ const b = te().replace(/^fn:/, "");
3222
3222
  if (I(`calling ${b} function instead of verifyurl`), !(b in globalThis))
3223
3223
  throw new Error(`Global function "${b}" is undefined.`);
3224
3224
  return globalThis[b]({
@@ -1,4 +1,4 @@
1
1
  (function(V,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(V=typeof globalThis<"u"?globalThis:V||self,P(V["altcha-i18n"]={}))})(this,function(V){"use strict";var Es=Object.defineProperty;var Bi=V=>{throw TypeError(V)};var xs=(V,P,U)=>P in V?Es(V,P,{enumerable:!0,configurable:!0,writable:!0,value:U}):V[P]=U;var Ee=(V,P,U)=>xs(V,typeof P!="symbol"?P+"":P,U),Ui=(V,P,U)=>P.has(V)||Bi("Cannot "+U);var he=(V,P,U)=>(Ui(V,P,"read from private field"),U?U.call(V):P.get(V)),Wr=(V,P,U)=>P.has(V)?Bi("Cannot add the same private member more than once"):P instanceof WeakSet?P.add(V):P.set(V,U),Kr=(V,P,U,Mt)=>(Ui(V,P,"write to private field"),Mt?Mt.call(V,U):P.set(V,U),U);var ze,ye,li;var U=Array.isArray,Mt=Array.prototype.indexOf,Zi=Array.from,Bt=Object.keys,wt=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,Gi=Object.getOwnPropertyDescriptors,Yi=Object.prototype,Wi=Array.prototype,Jr=Object.getPrototypeOf,Xr=Object.isExtensible;const st=()=>{};function Qr(e){for(var t=0;t<e.length;t++)e[t]()}function Ki(e,t,r=!1){return e===void 0?r?t():t:e}const ke=2,ea=4,Ut=8,pr=16,Se=32,Xe=64,Zt=128,ge=256,Gt=512,ue=1024,Pe=2048,Qe=4096,ut=8192,Yt=16384,Ji=32768,mr=65536,Xi=1<<19,ta=1<<20,yr=1<<21,Ct=Symbol("$state"),ra=Symbol("legacy props"),Qi=Symbol(""),en=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Lt=[],Et=[];function aa(){var e=Lt;Lt=[],Qr(e)}function ia(){var e=Et;Et=[],Qr(e)}function Ar(e){Lt.length===0&&queueMicrotask(aa),Lt.push(e)}function tn(e){Et.length===0&&en(ia),Et.push(e)}function rn(){Lt.length>0&&aa(),Et.length>0&&ia()}function na(e){return e===this.v}function oa(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function kr(e){return!oa(e,this.v)}function an(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function nn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function on(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ln(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function sn(){throw new Error("https://svelte.dev/e/hydration_failed")}function un(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function fn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function cn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function dn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Ts=!1;const hn=1,gn=4,vn=8,bn=16,pn=1,mn=2,_r="[",la="[!",sa="]",ft={},fe=Symbol(),yn="http://www.w3.org/1999/xhtml";function ua(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let ae=null;function fa(e){ae=e}function ca(e,t=!1,r){var i=ae={p:ae,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Tr(()=>{i.d=!0})}function da(e){const t=ae;if(t!==null){e!==void 0&&(t.x=e);const u=t.e;if(u!==null){var r=$,i=j;t.e=null;try{for(var o=0;o<u.length;o++){var n=u[o];Fe(n.effect),Te(n.reaction),Vr(n.fn)}}finally{Fe(r),Te(i)}}ae=t.p,t.m=!0}return e||{}}function ha(){return!0}function qe(e){if(typeof e!="object"||e===null||Ct in e)return e;const t=Jr(e);if(t!==Yi&&t!==Wi)return e;var r=new Map,i=U(e),o=O(0),n=j,u=s=>{var c=j;Te(n);var d=s();return Te(c),d};return i&&r.set("length",O(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&fn();var p=r.get(c);return p===void 0?(p=u(()=>O(d.value)),r.set(c,p)):y(p,u(()=>qe(d.value))),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&(r.set(c,u(()=>O(fe))),wr(o));else{if(i&&typeof c=="string"){var p=r.get("length"),h=Number(c);Number.isInteger(h)&&h<p.v&&y(p,h)}y(d,fe),wr(o)}return!0},get(s,c,d){var k;if(c===Ct)return e;var p=r.get(c),h=c in s;if(p===void 0&&(!h||(k=Je(s,c))!=null&&k.writable)&&(p=u(()=>O(qe(h?s[c]:fe))),r.set(c,p)),p!==void 0){var v=l(p);return v===fe?void 0:v}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var p=r.get(c);p&&(d.value=l(p))}else if(d===void 0){var h=r.get(c),v=h==null?void 0:h.v;if(h!==void 0&&v!==fe)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return d},has(s,c){var v;if(c===Ct)return!0;var d=r.get(c),p=d!==void 0&&d.v!==fe||Reflect.has(s,c);if(d!==void 0||$!==null&&(!p||(v=Je(s,c))!=null&&v.writable)){d===void 0&&(d=u(()=>O(p?qe(s[c]):fe)),r.set(c,d));var h=l(d);if(h===fe)return!1}return p},set(s,c,d,p){var ee;var h=r.get(c),v=c in s;if(i&&c==="length")for(var k=d;k<h.v;k+=1){var R=r.get(k+"");R!==void 0?y(R,fe):k in s&&(R=u(()=>O(fe)),r.set(k+"",R))}h===void 0?(!v||(ee=Je(s,c))!=null&&ee.writable)&&(h=u(()=>O(void 0)),y(h,u(()=>qe(d))),r.set(c,h)):(v=h.v!==fe,y(h,u(()=>qe(d))));var _=Reflect.getOwnPropertyDescriptor(s,c);if(_!=null&&_.set&&_.set.call(p,d),!v){if(i&&typeof c=="string"){var H=r.get("length"),be=Number(c);Number.isInteger(be)&&be>=H.v&&y(H,be+1)}wr(o)}return!0},ownKeys(s){l(o);var c=Reflect.ownKeys(s).filter(h=>{var v=r.get(h);return v===void 0||v.v!==fe});for(var[d,p]of r)p.v!==fe&&!(d in s)&&c.push(d);return c},setPrototypeOf(){cn()}})}function wr(e,t=1){y(e,e.v+t)}function Wt(e){var t=ke|Pe,r=j!==null&&(j.f&ke)!==0?j:null;return $===null||r!==null&&(r.f&ge)!==0?t|=ge:$.f|=ta,{ctx:ae,deps:null,effects:null,equals:na,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??$}}function xt(e){const t=Wt(e);return Ca(t),t}function An(e){const t=Wt(e);return t.equals=kr,t}function ga(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Be(t[r])}}function kn(e){for(var t=e.parent;t!==null;){if((t.f&ke)===0)return t;t=t.parent}return null}function va(e){var t,r=$;Fe(kn(e));try{ga(e),t=Ia(e)}finally{Fe(r)}return t}function ba(e){var t=va(e),r=(Me||(e.f&ge)!==0)&&e.deps!==null?Qe:ue;_e(e,r),e.equals(t)||(e.v=t,e.wv=Ea())}const Tt=new Map;function pa(e,t){var r={f:0,v:e,reactions:null,equals:na,rv:0,wv:0};return r}function O(e,t){const r=pa(e);return Ca(r),r}function Cr(e,t=!1){const r=pa(e);return t||(r.equals=kr),r}function y(e,t,r=!1){j!==null&&!xe&&ha()&&(j.f&(ke|pr))!==0&&!(ie!=null&&ie.includes(e))&&dn();let i=r?qe(t):t;return _n(e,i)}function _n(e,t){if(!e.equals(t)){var r=e.v;Vt?Tt.set(e,t):Tt.set(e,r),e.v=t,(e.f&ke)!==0&&((e.f&Pe)!==0&&va(e),_e(e,(e.f&ge)===0?ue:Qe)),e.wv=Ea(),ma(e,Pe),$!==null&&($.f&ue)!==0&&($.f&(Se|Xe))===0&&(me===null?Ln([e]):me.push(e))}return t}function ma(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,o=0;o<i;o++){var n=r[o],u=n.f;(u&Pe)===0&&(_e(n,t),(u&(ue|ge))!==0&&((u&ke)!==0?ma(n,Qe):ir(n)))}}function Kt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let N=!1;function ct(e){N=e}let D;function Oe(e){if(e===null)throw Kt(),ft;return D=e}function dt(){return Oe(He(D))}function G(e){if(N){if(He(D)!==null)throw Kt(),ft;D=e}}function wn(){for(var e=0,t=D;;){if(t.nodeType===8){var r=t.data;if(r===sa){if(e===0)return t;e-=1}else(r===_r||r===la)&&(e+=1)}var i=He(t);t.remove(),t=i}}var ya,Aa,ka,_a;function Lr(){if(ya===void 0){ya=window,Aa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;ka=Je(t,"firstChild").get,_a=Je(t,"nextSibling").get,Xr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Xr(r)&&(r.__t=void 0)}}function Jt(e=""){return document.createTextNode(e)}function pe(e){return ka.call(e)}function He(e){return _a.call(e)}function Y(e,t){if(!N)return pe(e);var r=pe(D);return r===null&&(r=D.appendChild(Jt())),Oe(r),r}function It(e,t){if(!N){var r=pe(e);return r instanceof Comment&&r.data===""?He(r):r}return D}function W(e,t=1,r=!1){let i=N?D:e;for(var o;t--;)o=i,i=He(i);if(!N)return i;var n=i==null?void 0:i.nodeType;if(r&&n!==3){var u=Jt();return i===null?o==null||o.after(u):i.before(u),Oe(u),u}return Oe(i),i}function Cn(e){e.textContent=""}let Xt=!1,Qt=!1,er=null,et=!1,Vt=!1;function wa(e){Vt=e}let Rt=[],Is=[],j=null,xe=!1;function Te(e){j=e}let $=null;function Fe(e){$=e}let ie=null;function Ca(e){j!==null&&j.f&yr&&(ie===null?ie=[e]:ie.push(e))}let ne=null,ve=0,me=null;function Ln(e){me=e}let La=1,tr=0,Me=!1;function Ea(){return++La}function jt(e){var h;var t=e.f;if((t&Pe)!==0)return!0;if((t&Qe)!==0){var r=e.deps,i=(t&ge)!==0;if(r!==null){var o,n,u=(t&Gt)!==0,s=i&&$!==null&&!Me,c=r.length;if(u||s){var d=e,p=d.parent;for(o=0;o<c;o++)n=r[o],(u||!((h=n==null?void 0:n.reactions)!=null&&h.includes(d)))&&(n.reactions??(n.reactions=[])).push(d);u&&(d.f^=Gt),s&&p!==null&&(p.f&ge)===0&&(d.f^=ge)}for(o=0;o<c;o++)if(n=r[o],jt(n)&&ba(n),n.wv>e.wv)return!0}(!i||$!==null&&!Me)&&_e(e,ue)}return!1}function En(e,t){for(var r=t;r!==null;){if((r.f&Zt)!==0)try{r.fn(e);return}catch{r.f^=Zt}r=r.parent}throw Xt=!1,e}function xa(e){return(e.f&Yt)===0&&(e.parent===null||(e.parent.f&Zt)===0)}function rr(e,t,r,i){if(Xt){if(r===null&&(Xt=!1),xa(t))throw e;return}if(r!==null&&(Xt=!0),En(e,t),xa(t))throw e}function Ta(e,t,r=!0){var i=e.reactions;if(i!==null)for(var o=0;o<i.length;o++){var n=i[o];ie!=null&&ie.includes(e)||((n.f&ke)!==0?Ta(n,t,!1):t===n&&(r?_e(n,Pe):(n.f&ue)!==0&&_e(n,Qe),ir(n)))}}function Ia(e){var k;var t=ne,r=ve,i=me,o=j,n=Me,u=ie,s=ae,c=xe,d=e.f;ne=null,ve=0,me=null,Me=(d&ge)!==0&&(xe||!et||j===null),j=(d&(Se|Xe))===0?e:null,ie=null,fa(e.ctx),xe=!1,tr++,e.f|=yr;try{var p=(0,e.fn)(),h=e.deps;if(ne!==null){var v;if(ar(e,ve),h!==null&&ve>0)for(h.length=ve+ne.length,v=0;v<ne.length;v++)h[ve+v]=ne[v];else e.deps=h=ne;if(!Me)for(v=ve;v<h.length;v++)((k=h[v]).reactions??(k.reactions=[])).push(e)}else h!==null&&ve<h.length&&(ar(e,ve),h.length=ve);if(ha()&&me!==null&&!xe&&h!==null&&(e.f&(ke|Qe|Pe))===0)for(v=0;v<me.length;v++)Ta(me[v],e);return o!==null&&o!==e&&(tr++,me!==null&&(i===null?i=me:i.push(...me))),p}finally{ne=t,ve=r,me=i,j=o,Me=n,ie=u,fa(s),xe=c,e.f^=yr}}function xn(e,t){let r=t.reactions;if(r!==null){var i=Mt.call(r,e);if(i!==-1){var o=r.length-1;o===0?r=t.reactions=null:(r[i]=r[o],r.pop())}}r===null&&(t.f&ke)!==0&&(ne===null||!ne.includes(t))&&(_e(t,Qe),(t.f&(ge|Gt))===0&&(t.f^=Gt),ga(t),ar(t,0))}function ar(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)xn(e,r[i])}function Er(e){var t=e.f;if((t&Yt)===0){_e(e,ue);var r=$,i=ae,o=et;$=e,et=!0;try{(t&pr)!==0?zn(e):$a(e),ja(e);var n=Ia(e);e.teardown=typeof n=="function"?n:null,e.wv=La;var u=e.deps,s}catch(c){rr(c,e,r,i||e.ctx)}finally{et=o,$=r}}}function Tn(){try{ln()}catch(e){if(er!==null)rr(e,er,null);else throw e}}function Va(){var e=et;try{var t=0;for(et=!0;Rt.length>0;){t++>1e3&&Tn();var r=Rt,i=r.length;Rt=[];for(var o=0;o<i;o++){var n=Vn(r[o]);In(n)}Tt.clear()}}finally{Qt=!1,et=e,er=null}}function In(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(Yt|ut))===0)try{jt(i)&&(Er(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?Pa(i):i.fn=null))}catch(o){rr(o,i,null,i.ctx)}}}function ir(e){Qt||(Qt=!0,queueMicrotask(Va));for(var t=er=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Xe|Se))!==0){if((r&ue)===0)return;t.f^=ue}}Rt.push(t)}function Vn(e){for(var t=[],r=e;r!==null;){var i=r.f,o=(i&(Se|Xe))!==0,n=o&&(i&ue)!==0;if(!n&&(i&ut)===0){if((i&ea)!==0)t.push(r);else if(o)r.f^=ue;else try{jt(r)&&Er(r)}catch(c){rr(c,r,null,r.ctx)}var u=r.first;if(u!==null){r=u;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function L(e){for(var t;;){if(rn(),Rt.length===0)return t;Qt=!0,Va()}}async function xr(){await Promise.resolve(),L()}function l(e){var t=e.f,r=(t&ke)!==0;if(j!==null&&!xe){if(!(ie!=null&&ie.includes(e))){var i=j.deps;e.rv<tr&&(e.rv=tr,ne===null&&i!==null&&i[ve]===e?ve++:ne===null?ne=[e]:(!Me||!ne.includes(e))&&ne.push(e))}}else if(r&&e.deps===null&&e.effects===null){var o=e,n=o.parent;n!==null&&(n.f&ge)===0&&(o.f^=ge)}return r&&(o=e,jt(o)&&ba(o)),Vt&&Tt.has(e)?Tt.get(e):e.v}function tt(e){var t=xe;try{return xe=!0,e()}finally{xe=t}}const Rn=-7169;function _e(e,t){e.f=e.f&Rn|t}function jn(e){$===null&&j===null&&on(),j!==null&&(j.f&ge)!==0&&$===null&&nn(),Vt&&an()}function $n(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 o=$,n={ctx:ae,deps:null,nodes_start:null,nodes_end:null,f:e|Pe,first:null,fn:t,last:null,next:null,parent:o,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Er(n),n.f|=Ji}catch(c){throw Be(n),c}else t!==null&&ir(n);var u=r&&n.deps===null&&n.first===null&&n.nodes_start===null&&n.teardown===null&&(n.f&(ta|Zt))===0;if(!u&&i&&(o!==null&&$n(n,o),j!==null&&(j.f&ke)!==0)){var s=j;(s.effects??(s.effects=[])).push(n)}return n}function Tr(e){const t=rt(Ut,null,!1);return _e(t,ue),t.teardown=e,t}function Ir(e){jn();var t=$!==null&&($.f&Se)!==0&&ae!==null&&!ae.m;if(t){var r=ae;(r.e??(r.e=[])).push({fn:e,effect:$,reaction:j})}else{var i=Vr(e);return i}}function Sn(e){const t=rt(Xe,e,!0);return()=>{Be(t)}}function Pn(e){const t=rt(Xe,e,!0);return(r={})=>new Promise(i=>{r.outro?$r(t,()=>{Be(t),i(void 0)}):(Be(t),i(void 0))})}function Vr(e){return rt(ea,e,!1)}function Rr(e){return rt(Ut,e,!0)}function Ie(e,t=[],r=Wt){const i=t.map(r);return Ra(()=>e(...i.map(l)))}function Ra(e,t=0){return rt(Ut|pr|t,e,!0)}function jr(e,t=!0){return rt(Ut|Se,e,!0,t)}function ja(e){var t=e.teardown;if(t!==null){const r=Vt,i=j;wa(!0),Te(null);try{t.call(null)}finally{wa(r),Te(i)}}}function $a(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&Xe)!==0?r.parent=null:Be(r,t),r=i}}function zn(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Se)===0&&Be(t),t=r}}function Be(e,t=!0){var r=!1;(t||(e.f&Xi)!==0)&&e.nodes_start!==null&&(Sa(e.nodes_start,e.nodes_end),r=!0),$a(e,t&&!r),ar(e,0),_e(e,Yt);var i=e.transitions;if(i!==null)for(const n of i)n.stop();ja(e);var o=e.parent;o!==null&&o.first!==null&&Pa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function Sa(e,t){for(;e!==null;){var r=e===t?null:He(e);e.remove(),e=r}}function Pa(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 $r(e,t){var r=[];za(e,r,!0),Nn(r,()=>{Be(e),t&&t()})}function Nn(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var o of e)o.out(i)}else t()}function za(e,t,r){if((e.f&ut)===0){if(e.f^=ut,e.transitions!==null)for(const u of e.transitions)(u.is_global||r)&&t.push(u);for(var i=e.first;i!==null;){var o=i.next,n=(i.f&mr)!==0||(i.f&Se)!==0;za(i,t,n?r:!1),i=o}}}function Na(e){Da(e,!0)}function Da(e,t){if((e.f&ut)!==0){e.f^=ut,(e.f&ue)===0&&(e.f^=ue),jt(e)&&(_e(e,Pe),ir(e));for(var r=e.first;r!==null;){var i=r.next,o=(r.f&mr)!==0||(r.f&Se)!==0;Da(r,o?t:!1),r=i}if(e.transitions!==null)for(const n of e.transitions)(n.is_global||t)&&n.in()}}const Dn=["touchstart","touchmove"];function qn(e){return Dn.includes(e)}function On(e,t){if(t){const r=document.body;e.autofocus=!0,Ar(()=>{document.activeElement===r&&e.focus()})}}let qa=!1;function Oa(){qa||(qa=!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 Ha(e){var t=j,r=$;Te(null),Fe(null);try{return e()}finally{Te(t),Fe(r)}}function Hn(e,t,r,i=r){e.addEventListener(t,()=>Ha(r));const o=e.__on_r;o?e.__on_r=()=>{o(),i(!0)}:e.__on_r=()=>i(!0),Oa()}const Fa=new Set,Sr=new Set;function Fn(e,t,r,i={}){function o(n){if(i.capture||$t.call(t,n),!n.cancelBubble)return Ha(()=>r==null?void 0:r.call(this,n))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ar(()=>{t.addEventListener(e,o,i)}):t.addEventListener(e,o,i),o}function Ue(e,t,r,i,o){var n={capture:i,passive:o},u=Fn(e,t,r,n);(t===document.body||t===window||t===document)&&Tr(()=>{t.removeEventListener(e,u,n)})}function Mn(e){for(var t=0;t<e.length;t++)Fa.add(e[t]);for(var r of Sr)r(e)}function $t(e){var ee;var t=this,r=t.ownerDocument,i=e.type,o=((ee=e.composedPath)==null?void 0:ee.call(e))||[],n=o[0]||e.target,u=0,s=e.__root;if(s){var c=o.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=o.indexOf(t);if(d===-1)return;c<=d&&(u=c)}if(n=o[u]||e.target,n!==t){wt(e,"currentTarget",{configurable:!0,get(){return n||r}});var p=j,h=$;Te(null),Fe(null);try{for(var v,k=[];n!==null;){var R=n.assignedSlot||n.parentNode||n.host||null;try{var _=n["__"+i];if(_!=null&&(!n.disabled||e.target===n))if(U(_)){var[H,...be]=_;H.apply(n,[e,...be])}else _.call(n,e)}catch(oe){v?k.push(oe):v=oe}if(e.cancelBubble||R===t||R===null)break;n=R}if(v){for(let oe of k)queueMicrotask(()=>{throw oe});throw v}}finally{e.__root=t,delete e.currentTarget,Te(p),Fe(h)}}}function Pr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ve(e,t){var r=$;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function we(e,t){var r=(t&pn)!==0,i=(t&mn)!==0,o,n=!e.startsWith("<!>");return()=>{if(N)return Ve(D,null),D;o===void 0&&(o=Pr(n?e:"<!>"+e),r||(o=pe(o)));var u=i||Aa?document.importNode(o,!0):o.cloneNode(!0);if(r){var s=pe(u),c=u.lastChild;Ve(s,c)}else Ve(u,u);return u}}function nr(e,t,r="svg"){var i=!e.startsWith("<!>"),o=`<${r}>${i?e:"<!>"+e}</${r}>`,n;return()=>{if(N)return Ve(D,null),D;if(!n){var u=Pr(o),s=pe(u);n=pe(s)}var c=n.cloneNode(!0);return Ve(c,c),c}}function or(){if(N)return Ve(D,null),D;var e=document.createDocumentFragment(),t=document.createComment(""),r=Jt();return e.append(t,r),Ve(t,r),e}function F(e,t){if(N){$.nodes_end=D,dt();return}e!==null&&e.before(t)}function Bn(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 Ma(e,t){return Ba(e,t)}function Un(e,t){Lr(),t.intro=t.intro??!1;const r=t.target,i=N,o=D;try{for(var n=pe(r);n&&(n.nodeType!==8||n.data!==_r);)n=He(n);if(!n)throw ft;ct(!0),Oe(n),dt();const u=Ba(e,{...t,anchor:n});if(D===null||D.nodeType!==8||D.data!==sa)throw Kt(),ft;return ct(!1),u}catch(u){if(u===ft)return t.recover===!1&&sn(),Lr(),Cn(r),ct(!1),Ma(e,t);throw u}finally{ct(i),Oe(o)}}const ht=new Map;function Ba(e,{target:t,anchor:r,props:i={},events:o,context:n,intro:u=!0}){Lr();var s=new Set,c=h=>{for(var v=0;v<h.length;v++){var k=h[v];if(!s.has(k)){s.add(k);var R=qn(k);t.addEventListener(k,$t,{passive:R});var _=ht.get(k);_===void 0?(document.addEventListener(k,$t,{passive:R}),ht.set(k,1)):ht.set(k,_+1)}}};c(Zi(Fa)),Sr.add(c);var d=void 0,p=Pn(()=>{var h=r??t.appendChild(Jt());return jr(()=>{if(n){ca({});var v=ae;v.c=n}o&&(i.$$events=o),N&&Ve(h,null),d=e(h,i)||{},N&&($.nodes_end=D),n&&da()}),()=>{var R;for(var v of s){t.removeEventListener(v,$t);var k=ht.get(v);--k===0?(document.removeEventListener(v,$t),ht.delete(v)):ht.set(v,k)}Sr.delete(c),h!==r&&((R=h.parentNode)==null||R.removeChild(h))}});return zr.set(d,p),d}let zr=new WeakMap;function Zn(e,t){const r=zr.get(e);return r?(zr.delete(e),r(t)):Promise.resolve()}function K(e,t,[r,i]=[0,0]){N&&r===0&&dt();var o=e,n=null,u=null,s=fe,c=r>0?mr:0,d=!1;const p=(v,k=!0)=>{d=!0,h(k,v)},h=(v,k)=>{if(s===(s=v))return;let R=!1;if(N&&i!==-1){if(r===0){const H=o.data;H===_r?i=0:H===la?i=1/0:(i=parseInt(H.substring(1)),i!==i&&(i=s?1/0:-1))}const _=i>r;!!s===_&&(o=wn(),Oe(o),ct(!1),R=!0,i=-1)}s?(n?Na(n):k&&(n=jr(()=>k(o))),u&&$r(u,()=>{u=null})):(u?Na(u):k&&(u=jr(()=>k(o,[r+1,i]))),n&&$r(n,()=>{n=null})),R&&ct(!0)};Ra(()=>{d=!1,t(p),d||h(null,null)},c),N&&(o=D)}function at(e,t,r=!1,i=!1,o=!1){var n=e,u="";Ie(()=>{var s=$;if(u===(u=t()??"")){N&&dt();return}if(s.nodes_start!==null&&(Sa(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),u!==""){if(N){D.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=He(c);if(c===null)throw Kt(),ft;Ve(D,d),n=Oe(c);return}var p=u+"";r?p=`<svg>${p}</svg>`:i&&(p=`<math>${p}</math>`);var h=Pr(p);if((r||i)&&(h=pe(h)),Ve(pe(h),h.lastChild),r||i)for(;pe(h);)n.before(pe(h));else n.before(h)}})}function Gn(e,t,r,i,o){var s;N&&dt();var n=(s=t.$$slots)==null?void 0:s[r],u=!1;n===!0&&(n=t.children,u=!0),n===void 0||n(e,u?()=>i:i)}const Ua=[...`
2
2
  \r\f \v\uFEFF`];function Yn(e,t,r){var i=""+e;if(r){for(var o in r)if(r[o])i=i?i+" "+o:o;else if(i.length)for(var n=o.length,u=0;(u=i.indexOf(o,u))>=0;){var s=u+n;(u===0||Ua.includes(i[u-1]))&&(s===i.length||Ua.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function Wn(e,t,r,i,o,n){var u=e.__className;if(N||u!==r||u===void 0){var s=Yn(r,i,n);(!N||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}else if(n&&o!==n)for(var c in n){var d=!!n[c];(o==null||d!==!!o[c])&&e.classList.toggle(c,d)}return n}const Kn=Symbol("is custom element"),Jn=Symbol("is html");function Za(e){if(N){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;S(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var o=e.checked;S(e,"checked",null),e.checked=o}}};e.__on_r=r,tn(r),Oa()}}function Xn(e,t){var r=Ga(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function S(e,t,r,i){var o=Ga(e);N&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=r)&&(t==="loading"&&(e[Qi]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Qn(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Ga(e){return e.__attributes??(e.__attributes={[Kn]:e.nodeName.includes("-"),[Jn]:e.namespaceURI===yn})}var Ya=new Map;function Qn(e){var t=Ya.get(e.nodeName);if(t)return t;Ya.set(e.nodeName,t=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=Gi(i);for(var n in r)r[n].set&&t.push(n);i=Jr(i)}return t}function eo(e,t,r=t){Hn(e,"change",i=>{var o=i?e.defaultChecked:e.checked;r(o)}),(N&&e.defaultChecked!==e.checked||tt(t)==null)&&r(e.checked),Rr(()=>{var i=t();e.checked=!!i})}function Wa(e,t){return e===t||(e==null?void 0:e[Ct])===t}function lr(e={},t,r,i){return Vr(()=>{var o,n;return Rr(()=>{o=n,n=[],tt(()=>{e!==r(...n)&&(t(e,...n),o&&Wa(r(...o),e)&&t(null,...o))})}),()=>{Ar(()=>{n&&Wa(r(...n),e)&&t(null,...n)})}}),e}let sr=!1,Nr=Symbol();function to(e,t,r){const i=r[t]??(r[t]={store:null,source:Cr(void 0),unsubscribe:st});if(i.store!==e&&!(Nr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=st;else{var o=!0;i.unsubscribe=Qa(e,n=>{o?i.source.v=n:y(i.source,n)}),o=!1}return e&&Nr in r?fr(e):l(i.source)}function ro(){const e={};function t(){Tr(()=>{for(var r in e)e[r].unsubscribe();wt(e,Nr,{enumerable:!1,value:!0})})}return[e,t]}function ao(e){var t=sr;try{return sr=!1,[e(),sr]}finally{sr=t}}function Ka(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function x(e,t,r,i){var vt;var o=(r&hn)!==0,n=!0,u=(r&vn)!==0,s=(r&bn)!==0,c=!1,d;u?[d,c]=ao(()=>e[t]):d=e[t];var p=Ct in e||ra in e,h=u&&(((vt=Je(e,t))==null?void 0:vt.set)??(p&&t in e&&(M=>e[t]=M)))||void 0,v=i,k=!0,R=!1,_=()=>(R=!0,k&&(k=!1,s?v=tt(i):v=i),v);d===void 0&&i!==void 0&&(h&&n&&un(),d=_(),h&&h(d));var H;if(H=()=>{var M=e[t];return M===void 0?_():(k=!0,R=!1,M)},(r&gn)===0)return H;if(h){var be=e.$$legacy;return function(M,ce){return arguments.length>0?((!ce||be||c)&&h(ce?H():M),M):H()}}var ee=!1,oe=Cr(d),te=Wt(()=>{var M=H(),ce=l(oe);return ee?(ee=!1,ce):oe.v=M});return u&&l(te),o||(te.equals=kr),function(M,ce){if(arguments.length>0){const Ce=ce?l(te):u?qe(M):M;if(!te.equals(Ce)){if(ee=!0,y(oe,Ce),R&&v!==void 0&&(v=Ce),Ka(te))return M;tt(()=>l(te))}return M}return Ka(te)?te.v:l(te)}}function io(e){return new no(e)}class no{constructor(t){Wr(this,ze);Wr(this,ye);var n;var r=new Map,i=(u,s)=>{var c=Cr(s);return r.set(u,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(u,s){return l(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===ra?!0:(l(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return y(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});Kr(this,ye,(t.hydrate?Un:Ma)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((n=t==null?void 0:t.props)!=null&&n.$$host)||t.sync===!1)&&L(),Kr(this,ze,o.$$events);for(const u of Object.keys(he(this,ye)))u==="$set"||u==="$destroy"||u==="$on"||wt(this,u,{get(){return he(this,ye)[u]},set(s){he(this,ye)[u]=s},enumerable:!0});he(this,ye).$set=u=>{Object.assign(o,u)},he(this,ye).$destroy=()=>{Zn(he(this,ye))}}$set(t){he(this,ye).$set(t)}$on(t,r){he(this,ze)[t]=he(this,ze)[t]||[];const i=(...o)=>r.call(this,...o);return he(this,ze)[t].push(i),()=>{he(this,ze)[t]=he(this,ze)[t].filter(o=>o!==i)}}$destroy(){he(this,ye).$destroy()}}ze=new WeakMap,ye=new WeakMap;let Ja;typeof HTMLElement=="function"&&(Ja=class extends HTMLElement{constructor(t,r,i){super();Ee(this,"$$ctor");Ee(this,"$$s");Ee(this,"$$c");Ee(this,"$$cn",!1);Ee(this,"$$d",{});Ee(this,"$$r",!1);Ee(this,"$$p_d",{});Ee(this,"$$l",{});Ee(this,"$$l_u",new Map);Ee(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 o=this.$$c.$on(t,r);this.$$l_u.set(r,o)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const o=this.$$l_u.get(r);o&&(o(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return n=>{const u=document.createElement("slot");o!=="default"&&(u.name=o),F(n,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=oo(this);for(const o of this.$$s)o in i&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),r.default=!0):r[o]=t(o));for(const o of this.attributes){const n=this.$$g_p(o.name);n in this.$$d||(this.$$d[n]=ur(n,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=io({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Sn(()=>{Rr(()=>{var o;this.$$r=!0;for(const n of Bt(this.$$c)){if(!((o=this.$$p_d[n])!=null&&o.reflect))continue;this.$$d[n]=this.$$c[n];const u=ur(n,this.$$d[n],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,u)}this.$$r=!1})});for(const o in this.$$l)for(const n of this.$$l[o]){const u=this.$$c.$on(o,n);this.$$l_u.set(n,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=ur(t,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$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 Bt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function ur(e,t,r,i){var n;const o=(n=r[e])==null?void 0:n.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(o){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(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function oo(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function lo(e,t,r,i,o,n){let u=class extends Ja{constructor(){super(e,r,o),this.$$p_d=t}static get observedAttributes(){return Bt(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Bt(t).forEach(s=>{wt(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=ur(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var p=(h=Je(d,s))==null?void 0:h.get;p?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{wt(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}function Xa(e){ae===null&&ua(),Ir(()=>{const t=tt(e);if(typeof t=="function")return t})}function so(e){ae===null&&ua(),Xa(()=>()=>tt(e))}function Qa(e,t,r){if(e==null)return t(void 0),st;const i=tt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const gt=[];function uo(e,t=st){let r=null;const i=new Set;function o(s){if(oa(e,s)&&(e=s,r)){const c=!gt.length;for(const d of i)d[1](),gt.push(d,e);if(c){for(let d=0;d<gt.length;d+=2)gt[d][0](gt[d+1]);gt.length=0}}}function n(s){o(s(e))}function u(s,c=st){const d=[s,c];return i.add(d),i.size===1&&(r=t(o,n)||st),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:o,update:n,subscribe:u}}function fr(e){let t;return Qa(e,r=>t=r)(),t}globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>fr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(fr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(fr(globalThis.altchaI18n.store))},store:uo({})};const fo={ariaLinkLabel:"Besoek Altcha.org",enterCode:"Voer kode in",enterCodeAria:"Voer die kode in wat jy hoor. Druk Spasie om die klank af te speel.",error:"Verifikasie het misluk. Probeer later weer.",expired:"Verifikasie het verval. Probeer weer.",footer:'Beskerm deur <a href="https://altcha.org/" target="_blank" aria-label="Besoek Altcha.org">ALTCHA</a>',getAudioChallenge:"Kry 'n klankuitdaging",label:"Ek is nie 'n robot nie",loading:"Laai...",reload:"Laai weer",verify:"Verifieer",verificationRequired:"Verifikasie is vereis!",verified:"Geverifieer",verifying:"Verifieer...",waitAlert:"Verifieer... wag asseblief."};globalThis.altchaI18n.set("af",fo);const co={ariaLinkLabel:"زور Altcha.org",enterCode:"أدخل الرمز",enterCodeAria:"أدخل الرمز الذي تسمعه. اضغط على المسافة لتشغيل الصوت.",error:"فشل التحقق. حاول مرة أخرى لاحقاً.",expired:"انتهت صلاحية التحقق. حاول مرة أخرى.",verificationRequired:"مطلوب التحقق!",footer:'محمي بواسطة <a href="https://altcha.org/" target="_blank" aria-label="زور Altcha.org">ALTCHA</a>',getAudioChallenge:"احصل على تحدي صوتي",label:"أنا لست روبوتاً",loading:"جارٍ التحميل...",reload:"إعادة تحميل",verify:"تحقق",verified:"تم التحقق",verifying:"جارٍ التحقق...",waitAlert:"جارٍ التحقق... يرجى الانتظار."};globalThis.altchaI18n.set("ar",co);const ho={ariaLinkLabel:"Посетете Altcha.org",enterCode:"Въведете код",enterCodeAria:"Въведете кода, който чувате. Натиснете Space за възпроизвеждане на аудио.",error:"Проверката неуспешна. Моля, опитайте по-късно.",expired:"Времето за проверка изтече. Моля, опитайте отново.",verificationRequired:"Изисква се проверка!",footer:'Защитено от <a href="https://altcha.org/" target="_blank" aria-label="Посетете Altcha.org">ALTCHA</a>',getAudioChallenge:"Аудио проверка",label:"Аз не съм робот",loading:"Зареждане...",reload:"Презареди",verify:"Провери",verified:"Проверено",verifying:"Проверява се...",waitAlert:"Проверката е в процес... моля изчакайте."};globalThis.altchaI18n.set("bg",ho);const go={ariaLinkLabel:"Posjetite Altcha.org",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite Space da biste pustili zvuk.",error:"Verifikacija nije uspjela. Pokušajte ponovo kasnije.",expired:"Verifikacija je istekla. Pokušajte ponovo.",footer:'Zaštićeno od strane <a href="https://altcha.org/" target="_blank" aria-label="Posjetite Altcha.org">ALTCHA</a>',getAudioChallenge:"Dohvatite audio izazov",label:"Nisam robot",loading:"Učitavanje...",reload:"Ponovno učitaj",verify:"Verifikuj",verificationRequired:"Verifikacija je obavezna!",verified:"Verifikovano",verifying:"Verifikacija u toku...",waitAlert:"Verifikacija u toku... molimo vas da sačekate."};globalThis.altchaI18n.set("bs",go);const vo={ariaLinkLabel:"Visita Altcha.org",enterCode:"Introdueix el codi",enterCodeAria:"Introdueix el codi que escoltes. Prem Espai per reproduir l’àudio.",error:"Verificació fallida. Torna-ho a provar més tard.",expired:"Verificació expirada. Torna-ho a provar.",footer:'Protegit per <a href="https://altcha.org/" target="_blank" aria-label="Visita Altcha.org">ALTCHA</a>',getAudioChallenge:"Obtenir un desafiament d’àudio",label:"No sóc un robot",loading:"Carregant...",reload:"Torna a carregar",verify:"Verificar",verificationRequired:"Es requereix verificació!",verified:"Verificat",verifying:"Verificant...",waitAlert:"Verificant... si us plau, espera."};globalThis.altchaI18n.set("ca",vo);const bo={ariaLinkLabel:"Navštivte Altcha.org",enterCode:"Zadejte kód",enterCodeAria:"Zadejte kód, který slyšíte. Stisknutím mezerníku přehrajete zvuk.",error:"Ověření selhalo. Zkuste to prosím později.",expired:"Ověření vypršelo. Zkuste to prosím znovu.",verificationRequired:"Vyžaduje se ověření!",footer:'Chráněno pomocí <a href="https://altcha.org/" target="_blank" aria-label="Navštivte Altcha.org">ALTCHA</a>',getAudioChallenge:"Získat audio výzvu",label:"Nejsem robot",loading:"Načítání...",reload:"Znovu načíst",verify:"Ověřit",verified:"Ověřeno",verifying:"Ověřování...",waitAlert:"Probíhá ověření... prosím počkejte."};globalThis.altchaI18n.set("cs",bo);const po={ariaLinkLabel:"Besøg Altcha.org",enterCode:"Indtast kode",enterCodeAria:"Indtast den kode, du hører. Tryk på mellemrumstasten for at afspille lyd.",error:"Verificering mislykkedes. Prøv venligst igen senere.",expired:"Verificering udløbet. Prøv venligst igen.",verificationRequired:"Verificering kræves!",footer:'Beskyttet af <a href="https://altcha.org/" target="_blank" aria-label="Besøg Altcha.org">ALTCHA</a>',getAudioChallenge:"Hent lydudfordring",label:"Jeg er ikke en robot",loading:"Indlæser...",reload:"Genindlæs",verify:"Verificer",verified:"Verificeret",verifying:"Verificerer...",waitAlert:"Verificerer... vent venligst."};globalThis.altchaI18n.set("da",po);const mo={ariaLinkLabel:"Besuche Altcha.org",enterCode:"Code eingeben",enterCodeAria:"Geben Sie den Code ein, den Sie hören. Drücken Sie die Leertaste, um die Audio abzuspielen.",error:"Überprüfung fehlgeschlagen. Bitte versuchen Sie es später erneut.",expired:"Überprüfung abgelaufen. Bitte versuchen Sie es erneut.",verificationRequired:"Überprüfung erforderlich!",footer:'Geschützt durch <a href="https://altcha.org/" target="_blank" aria-label="Besuche Altcha.org">ALTCHA</a>',getAudioChallenge:"Audio-Herausforderung anfordern",label:"Ich bin kein Roboter",loading:"Lade...",reload:"Neu laden",verify:"Überprüfen",verified:"Überprüft",verifying:"Wird überprüft...",waitAlert:"Überprüfung läuft... bitte warten."};globalThis.altchaI18n.set("de",mo);const yo={ariaLinkLabel:"Επισκεφθείτε το Altcha.org",enterCode:"Εισαγάγετε κωδικό",enterCodeAria:"Εισαγάγετε τον κωδικό που ακούτε. Πατήστε Space για να παίξετε τον ήχο.",error:"Η επαλήθευση απέτυχε. Δοκιμάστε ξανά αργότερα.",expired:"Η επαλήθευση έληξε. Δοκιμάστε ξανά.",verificationRequired:"Απαιτείται έλεγχος!",footer:'Προστατεύεται από το <a href="https://altcha.org/" target="_blank" aria-label="Επισκεφθείτε το Altcha.org">ALTCHA</a>',getAudioChallenge:"Λήψη ηχητικής δοκιμασίας",label:"Δεν είμαι ρομπότ",loading:"Φόρτωση...",reload:"Επαναφόρτωση",verify:"Επαλήθευση",verified:"Επαληθεύτηκε",verifying:"Γίνεται επαλήθευση...",waitAlert:"Γίνεται επαλήθευση... παρακαλώ περιμένετε."};globalThis.altchaI18n.set("el",yo);const Ao={ariaLinkLabel:"Visitar Altcha.org",enterCode:"Introduce el código",enterCodeAria:"Introduce el código que escuchas. Pulsa Espacio para reproducir el audio.",error:"Falló la verificación. Por favor intente nuevamente más tarde.",expired:"Verificación expirada. Por favor intente nuevamente.",verificationRequired:"¡Verificación requerida!",footer:'Protegido por <a href="https://altcha.org/" target="_blank" aria-label="Visitar Altcha.org">ALTCHA</a>',getAudioChallenge:"Obtener un desafío de audio",label:"No soy un robot",loading:"Cargando...",reload:"Recargar",verify:"Verificar",verified:"Verificado",verifying:"Verificando...",waitAlert:"Verificando... por favor espere."};globalThis.altchaI18n.set("es-es",Ao);const ko={ariaLinkLabel:"Visitar Altcha.org",enterCode:"Ingresa el código",enterCodeAria:"Ingresa el código que escuchas. Presiona Espacio para reproducir el audio.",error:"Falló la verificación. Por favor vuelve a intentarlo más tarde.",expired:"La verificación expiró. Por favor inténtalo de nuevo.",verificationRequired:"¡Verificación requerida!",footer:'Protegido por <a href="https://altcha.org/" target="_blank" aria-label="Visitar Altcha.org">ALTCHA</a>',getAudioChallenge:"Obtener un reto de audio",label:"No soy un robot",loading:"Cargando...",reload:"Volver a cargar",verify:"Verificar",verified:"Verificado",verifying:"Verificando...",waitAlert:"Verificando... por favor espera."};globalThis.altchaI18n.set("es-419",ko);const _o={ariaLinkLabel:"Külasta Altcha.org",enterCode:"Sisesta kood",enterCodeAria:"Sisestage kuuldu kood. Vajutage tühikut, et esitada heli.",error:"Kinnitamine ebaõnnestus. Proovi hiljem uuesti.",expired:"Kinnitamine aegus. Proovi uuesti.",verificationRequired:"Kontroll on vajalik!",footer:'Kaitstud <a href="https://altcha.org/" target="_blank" aria-label="Külasta Altcha.org">ALTCHA</a> poolt',getAudioChallenge:"Hangi heliülesanne",label:"Ma ei ole robot",loading:"Laadimine...",reload:"Laadi uuesti",verify:"Kinnita",verified:"Kinnitatud",verifying:"Kinnitamine...",waitAlert:"Kinnitamine... palun oota."};globalThis.altchaI18n.set("et",_o);const wo={ariaLinkLabel:"Bisitatu Altcha.org",enterCode:"Sartu kodea",enterCodeAria:"Sartu entzun duzun kodea. Sakatu Espazioa audioa erreproduzitzeko.",error:"Egiaztatzeak huts egin du. Saiatu berriro geroago.",expired:"Egiaztatzea iraungi da. Saiatu berriro.",verificationRequired:"Egiaztatzea beharrezkoa da!",footer:'<a href="https://altcha.org/" target="_blank" aria-label="Bisitatu Altcha.org">ALTCHA</a>k babestuta',getAudioChallenge:"Jaso audio-erronka bat",label:"Ez naiz robot bat",loading:"Kargatzen...",reload:"Birkargatu",verify:"Egiaztatu",verified:"Egiaztatuta",verifying:"Egiaztatzen...",waitAlert:"Egiaztatzen... itxaron mesedez."};globalThis.altchaI18n.set("eu",wo);const Co={ariaLinkLabel:"Vieraile sivulla Altcha.org",enterCode:"Syötä koodi",enterCodeAria:"Kirjoita kuulemasi koodi. Paina välilyöntiä toistaaksesi äänen.",error:"Varmennus epäonnistui. Yritä myöhemmin uudelleen.",expired:"Varmennus vanhentui. Yritä uudelleen.",verificationRequired:"Vahvistus vaaditaan!",footer:'Suojattu <a href="https://altcha.org/" target="_blank" aria-label="Vieraile sivulla Altcha.org">ALTCHA</a>:lla',getAudioChallenge:"Hae äänitehtävä",label:"En ole robotti",loading:"Ladataan...",reload:"Lataa uudelleen",verify:"Vahvista",verified:"Vahvistettu",verifying:"Vahvistetaan...",waitAlert:"Vahvistetaan... odota hetki."};globalThis.altchaI18n.set("fi",Co);const Lo={ariaLinkLabel:"Visitez Altcha.org",enterCode:"Entrez le code",enterCodeAria:"Entrez le code que vous entendez. Appuyez sur la barre d'espace pour écouter l'audio.",error:"Échec de la vérification. Réessayez plus tard.",expired:"La vérification a expiré. Réessayez.",verificationRequired:"Vérification requise !",footer:'Protégé par <a href="https://altcha.org/" target="_blank" aria-label="Visitez Altcha.org">ALTCHA</a>',getAudioChallenge:"Obtenir un défi audio",label:"Pas un robot",loading:"Chargement...",reload:"Recharger",verify:"Vérifier",verified:"Vérifié",verifying:"Vérification en cours...",waitAlert:"Vérification en cours... veuillez patienter."};globalThis.altchaI18n.set("fr-ca",Lo);const Eo={ariaLinkLabel:"Visitez Altcha.org",enterCode:"Entrez le code",enterCodeAria:"Entrez le code que vous entendez. Appuyez sur Espace pour écouter l'audio.",error:"Échec de la vérification. Essayez à nouveau plus tard.",expired:"La vérification a expiré. Essayez à nouveau.",verificationRequired:"Vérification requise !",footer:'Protégé par <a href="https://altcha.org/" target="_blank" aria-label="Visitez Altcha.org">ALTCHA</a>',getAudioChallenge:"Obtenir un défi audio",label:"Pas un robot",loading:"Chargement...",reload:"Recharger",verify:"Vérifier",verified:"Vérifié",verifying:"Vérification en cours...",waitAlert:"Vérification en cours... veuillez patienter."};globalThis.altchaI18n.set("fr-fr",Eo);const xo={ariaLinkLabel:"Tabhair cuairt ar Altcha.org",enterCode:"Iontráil cód",enterCodeAria:"Cuir isteach an cód a chloiseann tú. Brúigh Spás chun an fuaime a sheinm.",error:"Theip ar an bhfíorú. Bain triail eile as níos déanaí.",expired:"Tá an fíorú as feidhm. Bain triail eile as.",verificationRequired:"Fíorú riachtanach!",footer:'Cosanta ag <a href="https://altcha.org/" target="_blank" aria-label="Tabhair cuairt ar Altcha.org">ALTCHA</a>',getAudioChallenge:"Faigh dúshlán fuaime",label:"Níl mé i mo róbat",loading:"Á luchtú...",reload:"Athluchtaigh",verify:"Fíoraigh",verified:"Fíoraithe",verifying:"Fíorú ar siúl...",waitAlert:"Fíorú ar siúl... fan go fóill."};globalThis.altchaI18n.set("ga",xo);const To={ariaLinkLabel:"Posjetite Altcha.org",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite razmaknicu za reprodukciju zvuka.",error:"Provjera nije uspjela. Molimo pokušajte kasnije.",expired:"Provjera je istekla. Molimo pokušajte ponovo.",verificationRequired:"Potrebna je provjera!",footer:'Zaštićeno od strane <a href="https://altcha.org/" target="_blank" aria-label="Posjetite Altcha.org">ALTCHA</a>',getAudioChallenge:"Audio provjera",label:"Ja nisam robot",loading:"Učitavanje...",reload:"Ponovno učitaj",verify:"Provjeri",verified:"Provjereno",verifying:"Provjeravanje...",waitAlert:"Provjera je u tijeku... molimo pričekajte."};globalThis.altchaI18n.set("hr",To);const Io={ariaLinkLabel:"Látogass el az Altcha.org oldalra",enterCode:"Írja be a kódot",enterCodeAria:"Írja be a hallott kódot. Nyomja meg a Szóköz billentyűt a hang lejátszásához.",error:"A hitelesítés nem sikerült. Próbáld meg később újra.",expired:"A hitelesítés lejárt. Próbáld újra.",verificationRequired:"Ellenőrzés szükséges!",footer:'Védve a következő által: <a href="https://altcha.org/" target="_blank" aria-label="Látogass el az Altcha.org oldalra">ALTCHA</a>',getAudioChallenge:"Hangalapú kihívás kérése",label:"Nem vagyok robot",loading:"Betöltés...",reload:"Újratöltés",verify:"Ellenőrzés",verified:"Ellenőrizve",verifying:"Ellenőrzés folyamatban...",waitAlert:"Ellenőrzés folyamatban... kérlek várj."};globalThis.altchaI18n.set("hu",Io);const Vo={ariaLinkLabel:"Heimsækja Altcha.org",enterCode:"Sláðu inn kóða",enterCodeAria:"Sláðu inn kóðann sem þú heyrir. Ýttu á Space til að spila hljóðið.",error:"Staðfesting mistókst. Reyndu aftur síðar.",expired:"Staðfesting er útrunnin. Reyndu aftur.",footer:'Verndað af <a href="https://altcha.org/" target="_blank" aria-label="Heimsækja Altcha.org">ALTCHA</a>',getAudioChallenge:"Fá hljóðáskorun",label:"Ég er ekki robot",loading:"Hleður...",reload:"Hleð aftur",verify:"Staðfesta",verificationRequired:"Staðfesting er nauðsynleg!",verified:"Staðfest",verifying:"Að staðfesta...",waitAlert:"Að staðfesta... vinsamlegast bíða."};globalThis.altchaI18n.set("is",Vo);const Ro={ariaLinkLabel:"Visita Altcha.org",enterCode:"Inserisci il codice",enterCodeAria:"Inserisci il codice che senti. Premi Spazio per riprodurre l'audio.",error:"Verifica fallita. Riprova più tardi.",expired:"Verifica scaduta. Riprova.",verificationRequired:"Verifica richiesta!",footer:'Protetto da <a href="https://altcha.org/" target="_blank" aria-label="Visita Altcha.org">ALTCHA</a>',getAudioChallenge:"Ottieni una sfida audio",label:"Non sono un robot",loading:"Caricamento...",reload:"Ricarica",verify:"Verifica",verified:"Verificato",verifying:"Verifica in corso...",waitAlert:"Verifica in corso... attendere."};globalThis.altchaI18n.set("it",Ro);const jo={ariaLinkLabel:"Apsilankykite Altcha.org",enterCode:"Įveskite kodą",enterCodeAria:"Įveskite girdimą kodą. Paspauskite tarpo klavišą, kad grotumėte garso įrašą.",error:"Patvirtinimas nepavyko. Bandykite vėliau.",expired:"Patvirtinimo laikas baigėsi. Bandykite dar kartą.",verificationRequired:"Reikalingas patvirtinimas!",footer:'Apsaugota <a href="https://altcha.org/" target="_blank" aria-label="Apsilankykite Altcha.org">ALTCHA</a>',getAudioChallenge:"Gauti garso užduotį",label:"Aš nesu robotas",loading:"Įkeliama...",reload:"Įkelti iš naujo",verify:"Patvirtinti",verified:"Patvirtinta",verifying:"Tikrinama...",waitAlert:"Tikrinama... prašome palaukti."};globalThis.altchaI18n.set("lt",jo);const $o={ariaLinkLabel:"Apmeklējiet Altcha.org",enterCode:"Ievadiet kodu",enterCodeAria:"Ievadiet dzirdamo kodu. Nospiediet atstarpes taustiņu, lai atskaņotu audio.",error:"Verifikācija neizdevās. Mēģiniet vēlāk vēlreiz.",expired:"Verifikācijas laiks ir beidzies. Mēģiniet vēlreiz.",verificationRequired:"Nepieciešama verifikācija!",footer:'Aizsargāts ar <a href="https://altcha.org/" target="_blank" aria-label="Apmeklējiet Altcha.org">ALTCHA</a>',getAudioChallenge:"Saņemt audio izaicinājumu",label:"Es neesmu robots",loading:"Notiek ielāde...",reload:"Pārlādēt",verify:"Verificēt",verified:"Verificēts",verifying:"Notiek verifikācija...",waitAlert:"Notiek verifikācija... lūdzu, uzgaidiet."};globalThis.altchaI18n.set("lv",$o);const So={ariaLinkLabel:"Żur Altcha.org",enterCode:"Idħol il-kodiċi",enterCodeAria:"Idħol il-kodiċi li tisma'. Agħfas Spazju biex tindaqq l-awdjo.",error:"Il-verifika falliet. Erġa’ pprova aktar tard.",expired:"Il-verifika skadiet. Erġa’ pprova.",verificationRequired:"Verifika meħtieġa!",footer:'Protett minn <a href="https://altcha.org/" target="_blank" aria-label="Żur Altcha.org">ALTCHA</a>',getAudioChallenge:"Ikseb sfida bl-awdjo",label:"M’inix robot",loading:"Qed jitgħabba...",reload:"Ittella’ mill-ġdid",verify:"Ivverifika",verified:"Ivverifikat",verifying:"Verifika għaddejja...",waitAlert:"Verifika għaddejja... stenna ftit."};globalThis.altchaI18n.set("mt",So);const ei={ariaLinkLabel:"Besøk Altcha.org",enterCode:"Skriv inn kode",enterCodeAria:"Skriv inn koden du hører. Trykk på Space for å spille av lyden.",error:"Verifisering mislyktes. Prøv igjen senere.",expired:"Verifiseringen utløp. Prøv igjen.",footer:'Beskyttet av <a href="https://altcha.org/" target="_blank" aria-label="Besøk Altcha.org">ALTCHA</a>',getAudioChallenge:"Få en lydutfordring",label:"Jeg er ikke en robot",loading:"Laster...",reload:"Last på nytt",verify:"Verifiser",verificationRequired:"Verifisering kreves!",verified:"Verifisert",verifying:"Verifiserer...",waitAlert:"Verifiserer... vennligst vent."};globalThis.altchaI18n.set("nb",ei),globalThis.altchaI18n.set("no",ei);const Po={ariaLinkLabel:"Bezoek Altcha.org",enterCode:"Voer code in",enterCodeAria:"Voer de code in die je hoort. Druk op Spatie om de audio af te spelen.",error:"Verificatie mislukt. Probeer het later opnieuw.",expired:"Verificatie verlopen. Probeer het opnieuw.",verificationRequired:"Verificatie vereist!",footer:'Beschermd door <a href="https://altcha.org/" target="_blank" aria-label="Bezoek Altcha.org">ALTCHA</a>',getAudioChallenge:"Audio-uitdaging ontvangen",label:"Ik ben geen robot",loading:"Laden...",reload:"Herladen",verify:"Verifiëren",verified:"Geverifieerd",verifying:"Bezig met verifiëren...",waitAlert:"Bezig met verifiëren... even geduld a.u.b."};globalThis.altchaI18n.set("nl",Po);const zo={ariaLinkLabel:"Odwiedź Altcha.org",enterCode:"Wprowadź kod",enterCodeAria:"Wpisz kod, który słyszysz. Naciśnij Spację, aby odtworzyć dźwięk.",error:"Weryfikacja nie powiodła się. Spróbuj ponownie później.",expired:"Weryfikacja wygasła. Spróbuj ponownie.",verificationRequired:"Wymagana weryfikacja!",footer:'Chronione przez <a href="https://altcha.org/" target="_blank" aria-label="Odwiedź Altcha.org">ALTCHA</a>',getAudioChallenge:"Pobierz zadanie dźwiękowe",label:"Nie jestem robotem",loading:"Ładowanie...",reload:"Odśwież",verify:"Zweryfikuj",verified:"Zweryfikowano",verifying:"Weryfikacja...",waitAlert:"Trwa weryfikacja... proszę czekać."};globalThis.altchaI18n.set("pl",zo);const No={ariaLinkLabel:"Visitar Altcha.org",enterCode:"Introduza o código",enterCodeAria:"Introduza o código que ouve. Prima Espaço para reproduzir o áudio.",error:"A verificação falhou. Por favor, tente novamente mais tarde.",expired:"Verificação expirada. Por favor, tente novamente.",verificationRequired:"Verificação necessária!",footer:'Protegido por <a href="https://altcha.org/" target="_blank" aria-label="Visitar Altcha.org">ALTCHA</a>',getAudioChallenge:"Obter desafio de áudio",label:"Não sou um robô",loading:"A carregar...",reload:"Recarregar",verify:"Verificar",verified:"Verificado",verifying:"A verificar...",waitAlert:"A verificar... por favor aguarde."};globalThis.altchaI18n.set("pt-pt",No);const Do={ariaLinkLabel:"Visitar Altcha.org",enterCode:"Digite o código",enterCodeAria:"Digite o código que você ouve. Pressione Espaço para reproduzir o áudio.",error:"Falha na verificação. Por favor, tente novamente mais tarde.",expired:"Verificação expirada. Por favor, tente novamente.",verificationRequired:"Verificação necessária!",footer:'Protegido por <a href="https://altcha.org/" target="_blank" aria-label="Visitar Altcha.org">ALTCHA</a>',getAudioChallenge:"Obter desafio de áudio",label:"Eu não sou um robô",loading:"Carregando...",reload:"Recarregar",verify:"Verificar",verified:"Verificado",verifying:"Verificando...",waitAlert:"Verificando... por favor aguarde."};globalThis.altchaI18n.set("pt-br",Do);const qo={ariaLinkLabel:"Vizitează Altcha.org",enterCode:"Introduceți codul",enterCodeAria:"Introduceți codul pe care îl auziți. Apăsați Spațiu pentru a reda audio.",error:"Verificarea a eșuat. Încearcă din nou mai târziu.",expired:"Verificarea a expirat. Încearcă din nou.",verificationRequired:"Verificare necesară!",footer:'Protejat de <a href="https://altcha.org/" target="_blank" aria-label="Vizitează Altcha.org">ALTCHA</a>',getAudioChallenge:"Obține o provocare audio",label:"Nu sunt un robot",loading:"Se încarcă...",reload:"Reîncarcă",verify:"Verifică",verified:"Verificat",verifying:"Se verifică...",waitAlert:"Se verifică... te rugăm să aștepți."};globalThis.altchaI18n.set("ro",qo);const Oo={ariaLinkLabel:"Перейти на Altcha.org",enterCode:"Введите код",enterCodeAria:"Введите код, который слышите. Нажмите пробел для воспроизведения аудио.",error:"Ошибка верификации. Попробуйте позже.",expired:"Срок действия верификации истек. Попробуйте снова.",verificationRequired:"Требуется проверка!",footer:'Защищено <a href="https://altcha.org/" target="_blank" aria-label="Перейти на Altcha.org">ALTCHA</a>',getAudioChallenge:"Получить аудио задачу",label:"Я не робот",loading:"Загрузка...",reload:"Перезагрузить",verify:"Проверить",verified:"Проверено",verifying:"Идет проверка...",waitAlert:"Идет проверка... Пожалуйста, подождите."};globalThis.altchaI18n.set("ru",Oo);const Ho={ariaLinkLabel:"Navštívte Altcha.org",enterCode:"Zadajte kód",enterCodeAria:"Zadajte kód, ktorý počujete. Stlačením medzerníka prehráte zvuk.",error:"Verifikácia zlyhala. Skúste to znova neskôr.",expired:"Verifikácia vypršala. Skúste to znova.",verificationRequired:"Vyžaduje sa overenie!",footer:'Chránené <a href="https://altcha.org/" target="_blank" aria-label="Navštívte Altcha.org">ALTCHA</a>',getAudioChallenge:"Získať audio výzvu",label:"Nie som robot",loading:"Načítava sa...",reload:"Obnoviť",verify:"Verifikovať",verified:"Verifikované",verifying:"Prebieha verifikácia...",waitAlert:"Prebieha verifikácia... prosím čakajte."};globalThis.altchaI18n.set("sk",Ho);const Fo={ariaLinkLabel:"Obiščite Altcha.org",enterCode:"Vnesite kodo",enterCodeAria:"Vnesite kodo, ki jo slišite. Pritisnite preslednico za predvajanje zvoka.",error:"Preverjanje ni uspelo. Poskusite znova kasneje.",expired:"Preverjanje je poteklo. Poskusite znova.",verificationRequired:"Potrebna je preveritev!",footer:'Zaščiteno z <a href="https://altcha.org/" target="_blank" aria-label="Obiščite Altcha.org">ALTCHA</a>',getAudioChallenge:"Pridobite zvočni izziv",label:"Nisem robot",loading:"Nalagam...",reload:"Ponovno naloži",verify:"Preveri",verified:"Preverjeno",verifying:"Preverjanje...",waitAlert:"Preverjanje... prosim počakajte."};globalThis.altchaI18n.set("sl",Fo);const Mo={ariaLinkLabel:"Posetite Altcha.org",enterCode:"Unesite kod",enterCodeAria:"Unesite kod koji čujete. Pritisnite Space da biste pustili zvuk.",error:"Verifikacija nije uspela. Pokušajte ponovo kasnije.",expired:"Verifikacija je istekla. Pokušajte ponovo.",footer:'Zaštićeno od strane <a href="https://altcha.org/" target="_blank" aria-label="Posetite Altcha.org">ALTCHA</a>',getAudioChallenge:"Dohvatite audio izazov",label:"Nisam robot",loading:"Učitavanje...",reload:"Ponovo učitaj",verify:"Verifikuj",verificationRequired:"Verifikacija je obavezna!",verified:"Verifikovano",verifying:"Verifikacija u toku...",waitAlert:"Verifikacija u toku... molimo vas da sačekate."};globalThis.altchaI18n.set("sr",Mo);const Bo={ariaLinkLabel:"Besök Altcha.org",enterCode:"Ange kod",enterCodeAria:"Ange koden du hör. Tryck på mellanslag för att spela upp ljudet.",error:"Verifiering misslyckades. Försök igen senare.",expired:"Verifieringen har gått ut. Försök igen.",verificationRequired:"Verifiering krävs!",footer:'Skyddad av <a href="https://altcha.org/" target="_blank" aria-label="Besök Altcha.org">ALTCHA</a>',getAudioChallenge:"Få ljudutmaning",label:"Jag är inte en robot",loading:"Laddar...",reload:"Ladda om",verify:"Verifiera",verified:"Verifierad",verifying:"Verifierar...",waitAlert:"Verifierar... vänligen vänta."};globalThis.altchaI18n.set("sv",Bo);const Uo={ariaLinkLabel:"Altcha.org'yu ziyaret edin",enterCode:"Kodu girin",enterCodeAria:"Duyduğunuz kodu girin. Ses dosyasını oynatmak için Boşluk tuşuna basın.",error:"Doğrulama başarısız oldu. Lütfen daha sonra tekrar deneyin.",expired:"Doğrulama süresi doldu. Lütfen tekrar deneyin.",verificationRequired:"Doğrulama gerekli!",footer:`ALTCHA tarafından korunuyor <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org'yu ziyaret edin">ALTCHA</a>`,getAudioChallenge:"Sesli doğrulama al",label:"Ben robot değilim",loading:"Yükleniyor...",reload:"Yeniden yükle",verify:"Doğrula",verified:"Doğrulandı",verifying:"Doğrulama yapılıyor...",waitAlert:"Doğrulama yapılıyor... lütfen bekleyin."};globalThis.altchaI18n.set("tr",Uo);const Zo={ariaLinkLabel:"Відвідати Altcha.org",enterCode:"Введіть код",enterCodeAria:"Введіть код, який ви чуєте. Натисніть пробіл, щоб відтворити аудіо.",error:"Перевірка не вдалася. Спробуйте пізніше.",expired:"Перевірка прострочена. Спробуйте знову.",verificationRequired:"Потрібна перевірка!",footer:'Захищено <a href="https://altcha.org/" target="_blank" aria-label="Відвідати Altcha.org">ALTCHA</a>',getAudioChallenge:"Отримати аудіо-челлендж",label:"Я не робот",loading:"Завантаження...",reload:"Перезавантажити",verify:"Перевірити",verified:"Перевірено",verifying:"Перевіряється...",waitAlert:"Перевірка... будь ласка, зачекайте."};globalThis.altchaI18n.set("uk",Zo);const Go={ariaLinkLabel:"Altcha.org পরিদর্শন করুন",enterCode:"কোড লিখুন",enterCodeAria:"আপনি যে কোড শুনতে পান তা লিখুন। অডিও প্লে করতে স্পেস বাটন টিপুন।",error:"যাচাইকরণ ব্যর্থ হয়েছে। পরে আবার চেষ্টা করুন।",expired:"যাচাইকরণ সময়সীমা শেষ হয়েছে। আবার চেষ্টা করুন।",verificationRequired:"যাচাই প্রয়োজন!",footer:'দ্বারা সুরক্ষিত <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org পরিদর্শন করুন">ALTCHA</a>',getAudioChallenge:"অডিও চ্যালেঞ্জ নিন",label:"আমি রোবট নই",loading:"লোড হচ্ছে...",reload:"পুনরায় লোড করুন",verify:"যাচাই করুন",verified:"যাচাই করা হয়েছে",verifying:"যাচাই করা হচ্ছে...",waitAlert:"যাচাই করা হচ্ছে... দয়া করে অপেক্ষা করুন।"};globalThis.altchaI18n.set("bn",Go);const Yo={ariaLinkLabel:"בקר באתר Altcha.org",enterCode:"הזן קוד",enterCodeAria:"הזן את הקוד שאתה שומע. לחץ על רווח להפעלת השמע.",error:"האימות נכשל. נסה שוב מאוחר יותר.",expired:"תוקף האימות פג. נסה שוב.",verificationRequired:"נדרש אימות!",footer:'מוגן על ידי <a href="https://altcha.org/" target="_blank" aria-label="בקר באתר Altcha.org">ALTCHA</a>',getAudioChallenge:"קבל אתגר שמע",label:"אני לא רובוט",loading:"טוען...",reload:"טען מחדש",verify:"אמת",verified:"אומת",verifying:"מאמת...",waitAlert:"מבצע אימות... אנא המתן."};globalThis.altchaI18n.set("he",Yo);const Wo={ariaLinkLabel:"Altcha.org पर जाएं",enterCode:"कोड दर्ज करेंं",enterCodeAria:"आप जो कोड सुनते हैं उसे दर्ज करें। ऑडियो चलाने के लिए स्पेस दबाएं।",error:"सत्यापन विफल। कृपया बाद में फिर से प्रयास करें।",expired:"सत्यापन समाप्त हो गया है। कृपया पुनः प्रयास करें।",verificationRequired:"सत्यापन आवश्यक है!",footer:'द्वारा संरक्षित <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org पर जाएं">ALTCHA</a>',getAudioChallenge:"ऑडियो चुनौती प्राप्त करें",label:"मैं रोबोट नहीं हूँ",loading:"लोड हो रहा है...",reload:"पुनः लोड करें",verify:"सत्यापित करें",verified:"सत्यापित",verifying:"सत्यापित कर रहे हैं...",waitAlert:"सत्यापित किया जा रहा है... कृपया प्रतीक्षा करें।"};globalThis.altchaI18n.set("hi",Wo);const Ko={ariaLinkLabel:"Kunjungi Altcha.org",enterCode:"Masukkan kode",enterCodeAria:"Masukkan kode yang Anda dengar. Tekan Spasi untuk memutar audio.",error:"Verifikasi gagal. Coba lagi nanti.",expired:"Verifikasi telah kedaluwarsa. Coba lagi.",verificationRequired:"Verifikasi diperlukan!",footer:'Dilindungi oleh <a href="https://altcha.org/" target="_blank" aria-label="Kunjungi Altcha.org">ALTCHA</a>',getAudioChallenge:"Dapatkan tantangan audio",label:"Saya bukan robot",loading:"Memuat...",reload:"Muat ulang",verify:"Verifikasi",verified:"Terverifikasi",verifying:"Memverifikasi...",waitAlert:"Memverifikasi... harap tunggu."};globalThis.altchaI18n.set("id",Ko);const Jo={ariaLinkLabel:"Altcha.orgを訪問",enterCode:"コードを入力",enterCodeAria:"聞こえるコードを入力してください。スペースキーを押して音声を再生します。",error:"認証に失敗しました。後でもう一度試してください。",expired:"認証が期限切れです。再試行してください。",verificationRequired:"認証が必要です!",footer:'保護されています <a href="https://altcha.org/" target="_blank" aria-label="Altcha.orgを訪問">ALTCHA</a>',getAudioChallenge:"音声チャレンジを取得",label:"ロボットじゃない",loading:"読み込み中...",reload:"再読み込み",verify:"確認",verified:"確認済み",verifying:"確認中...",waitAlert:"確認中...少々お待ちください。"};globalThis.altchaI18n.set("ja",Jo);const Xo={ariaLinkLabel:"Altcha.org 방문하기",enterCode:"코드 입력",enterCodeAria:"들리는 코드를 입력하세요. 스페이스 바를 눌러 오디오를 재생합니다.",error:"인증 실패. 나중에 다시 시도해주세요.",expired:"인증이 만료되었습니다. 다시 시도해주세요.",verificationRequired:"인증이 필요합니다!",footer:'ALTCHA에서 보호됨 <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org 방문하기">ALTCHA</a>',getAudioChallenge:"오디오 챌린지 받기",label:"저는 로봇이 아닙니다",loading:"로딩 중...",reload:"새로 고침",verify:"확인",verified:"확인됨",verifying:"확인 중...",waitAlert:"확인 중... 잠시만 기다려주세요."};globalThis.altchaI18n.set("ko",Xo);const Qo={ariaLinkLabel:"Altcha.org भेट द्या",enterCode:"कोड टाकाा",enterCodeAria:"तुम्ही ऐकत असलेला कोड टाका. ऑडिओ प्ले करण्यासाठी स्पेस दाबा.",error:"पुष्टीकरण अयशस्वी झाले. कृपया नंतर पुन्हा प्रयत्न करा.",expired:"पुष्टीकरण कालबाह्य झाले आहे. कृपया पुन्हा प्रयत्न करा.",verificationRequired:"पडताळणी आवश्यक आहे!",footer:'द्वारे संरक्षित <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org भेट द्या">ALTCHA</a>',getAudioChallenge:"ऑडिओ चॅलेंज मिळवा",label:"मी रोबोट नाही",loading:"लोड होत आहे...",reload:"पुन्हा लोड करा",verify:"पुष्टीकरण करा",verified:"पुष्टीकरण झाले",verifying:"पुष्टीकरण करत आहे...",waitAlert:"पुष्टीकरण करत आहे... कृपया थोडा वेळ थांबा."};globalThis.altchaI18n.set("mr",Qo);const el={ariaLinkLabel:"Altcha.org ஐ பார்வையிடவும்",enterCode:"குறியீட்டை உள்ளிடவும்",enterCodeAria:"நீங்கள் கேட்கும் குறியீட்டை உள்ளிடவும். ஆடியோவை இயக்க Space ஐ அழுத்தவும்.",error:"சரிபார்ப்பு தோல்வி. பிறகு மீண்டும் முயற்சிக்கவும்.",expired:"சரிபார்ப்பு காலாவதியானது. மீண்டும் முயற்சிக்கவும்.",verificationRequired:"சரிபார்ப்பு தேவை!",footer:'மூலமாக பாதுகாக்கப்பட்டவை <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org ஐ பார்வையிடவும்">ALTCHA</a>',getAudioChallenge:"ஒலி சவாலை பெறவும்",label:"நான் ரோபோடான அல்ல",loading:"செயலாக்கம்...",reload:"மீண்டும் புதுப்பிக்கவும்",verify:"சரிபார்க்கவும்",verified:"சரிபார்க்கப்பட்டது",verifying:"சரிபார்க்கப்படுகிறது...",waitAlert:"சரிபார்க்கப்படுகிறது... தயவுசெய்து காத்திருக்கவும்."};globalThis.altchaI18n.set("ta",el);const tl={ariaLinkLabel:"Altcha.org సందర్శించండి",enterCode:"కోడ్‌ని నమోదు చేయండి",enterCodeAria:"మీరు విన్న కోడ్‌ని నమోదు చేయండి. ఆడియో ప్లే చేయడానికి స్పేస్‌ను నొక్కండి.",error:"చెకింగ్ విఫలమైంది. దయచేసి మరల ప్రయత్నించండి.",expired:"చెకింగ్ కాలం ముగిసింది. దయచేసి మరల ప్రయత్నించండి.",verificationRequired:"ధృవీకరణ అవసరం!",footer:'ఈ సైట్ రక్షించబడింది <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org సందర్శించండి">ALTCHA</a>',getAudioChallenge:"ఆడియో ఛాలెంజ్ పొందండి",label:"నేను రోబోట్ కాదు",loading:"లోడ్ అవుతోంది...",reload:"మళ్ళీ లోడ్ చేయండి",verify:"ధ్రువీకరించు",verified:"ధ్రువీకరించబడింది",verifying:"ధ్రువీకరణ జరుగుతుంది...",waitAlert:"ధ్రువీకరణ జరుగుతుంది... దయచేసి వేచి ఉండండి."};globalThis.altchaI18n.set("te",tl);const rl={ariaLinkLabel:"เยี่ยมชม Altcha.org",enterCode:"ป้อนรหัส",enterCodeAria:"ป้อนรหัสที่คุณได้ยิน กด Space เพื่อเล่นเสียง",error:"การตรวจสอบล้มเหลว กรุณาลองอีกครั้งภายหลัง",expired:"การตรวจสอบหมดอายุ กรุณาลองใหม่",verificationRequired:"จำเป็นต้องตรวจสอบ!",footer:'ป้องกันโดย <a href="https://altcha.org/" target="_blank" aria-label="เยี่ยมชม Altcha.org">ALTCHA</a>',getAudioChallenge:"รับการท้าทายเสียง",label:"ฉันไม่ใช่บอท",loading:"กำลังโหลด...",reload:"โหลดใหม่",verify:"ตรวจสอบ",verified:"ตรวจสอบแล้ว",verifying:"กำลังตรวจสอบ...",waitAlert:"กำลังตรวจสอบ... กรุณารอ"};globalThis.altchaI18n.set("th",rl);const al={ariaLinkLabel:"Altcha.org پر جائیں",enterCode:"کوڈ درج کریں",enterCodeAria:"جو کوڈ آپ سنتے ہیں وہ درج کریں۔ آڈیو چلانے کے لیے اسپیس دبائیں۔",error:"توثیق ناکام ہو گئی۔ براہ کرم بعد میں دوبارہ کوشش کریں۔",expired:"توثیق کی مدت ختم ہو گئی ہے۔ براہ کرم دوبارہ کوشش کریں۔",verificationRequired:"تصدیق ضروری ہے!",footer:'کے ذریعے محفوظ <a href="https://altcha.org/" target="_blank" aria-label="Altcha.org پر جائیں">ALTCHA</a>',getAudioChallenge:"آڈیو چیلنج حاصل کریں",label:"میں روبوٹ نہیں ہوں",loading:"لوڈ ہو رہا ہے...",reload:"دوبارہ لوڈ کریں",verify:"توثیق کریں",verified:"توثیق شدہ",verifying:"توثیق ہو رہی ہے...",waitAlert:"توثیق ہو رہی ہے... براہ کرم انتظار کریں۔"};globalThis.altchaI18n.set("ur",al);const il={ariaLinkLabel:"Truy cập Altcha.org",enterCode:"Nhập mã",enterCodeAria:"Nhập mã bạn nghe được. Nhấn Phím cách để phát âm thanh.",error:"Xác minh thất bại. Vui lòng thử lại sau.",expired:"Xác minh đã hết hạn. Vui lòng thử lại.",verificationRequired:"Yêu cầu xác minh!",footer:'Được bảo vệ bởi <a href="https://altcha.org/" target="_blank" aria-label="Truy cập Altcha.org">ALTCHA</a>',getAudioChallenge:"Nhận thử thách âm thanh",label:"Tôi không phải là robot",loading:"Đang tải...",reload:"Tải lại",verify:"Xác minh",verified:"Đã xác minh",verifying:"Đang xác minh...",waitAlert:"Đang xác minh... vui lòng chờ."};globalThis.altchaI18n.set("vi",il);const nl={ariaLinkLabel:"访问 Altcha.org",enterCode:"输入代码",enterCodeAria:"输入您听到的代码。按空格键播放音频。",error:"验证失败。稍后再试。",expired:"验证已过期。请重试。",verificationRequired:"需要验证!",footer:'由 <a href="https://altcha.org/" target="_blank" aria-label="访问 Altcha.org">ALTCHA</a> 保护',getAudioChallenge:"获取音频挑战",label:"我不是机器人",loading:"加载中...",reload:"重新加载",verify:"验证",verified:"已验证",verifying:"正在验证...",waitAlert:"正在验证... 请稍等。"};globalThis.altchaI18n.set("zh-cn",nl);const ol={ariaLinkLabel:"訪問 Altcha.org",enterCode:"輸入代碼",enterCodeAria:"輸入您聽到的代碼。按空格鍵播放音頻。",error:"驗證失敗。稍後再試。",expired:"驗證已過期。請重試。",verificationRequired:"需要驗證!",footer:'由 <a href="https://altcha.org/" target="_blank" aria-label="訪問 Altcha.org">ALTCHA</a> 保護',getAudioChallenge:"獲取音頻挑戰",label:"我不是機器人",loading:"載入中...",reload:"重新載入",verify:"驗證",verified:"已驗證",verifying:"正在驗證...",waitAlert:"正在驗證... 請稍等。"};globalThis.altchaI18n.set("zh-tw",ol);const ti=`(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,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;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 s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
3
- `,ri=typeof self<"u"&&self.Blob&&new Blob([ti],{type:"text/javascript;charset=utf-8"});function ll(e){let t;try{if(t=ri&&(self.URL||self.webkitURL).createObjectURL(ri),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ti),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const sl="5";typeof window<"u"&&((li=window.__svelte??(window.__svelte={})).v??(li.v=new Set)).add(sl);const ai=new TextEncoder;function ul(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function fl(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await ii(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function ii(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 ul(await crypto.subtle.digest(r.toUpperCase(),ai.encode(e+t)))}function cl(e,t,r="SHA-256",i=1e6,o=0){const n=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=o;c<=i;c+=1){if(n.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:n}}function ni(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function dl(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 hl(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 gl(e,t="",r=1e6,i=0){const o="AES-GCM",n=new AbortController,u=Date.now(),s=async()=>{for(let p=i;p<=r;p+=1){if(n.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:o,iv:hl(p)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=dl(e);const p=await crypto.subtle.digest("SHA-256",ai.encode(t));c=await crypto.subtle.importKey("raw",p,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:n}}return{promise:s(),controller:n}}var w=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});const vl={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",vl);const Dr=(e,t)=>{let r=An(()=>Ki(t==null?void 0:t(),24));var i=yl();Ie(()=>{S(i,"width",l(r)),S(i,"height",l(r))}),F(e,i)};function bl(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function pl(e,t){e.preventDefault(),t()}function ml(e,t,r,i,o,n,u,s){var c;[w.UNVERIFIED,w.ERROR,w.EXPIRED,w.CODE].includes(l(t))?r()!==!1&&((c=l(i))==null?void 0:c.reportValidity())===!1?y(o,!1):n()?u():s():y(o,!0)}var yl=nr('<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>'),Al=we('<input type="hidden">'),kl=we('<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>'),_l=nr('<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>'),wl=nr('<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>'),Cl=nr('<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>'),Ll=we('<button type="button" class="altcha-code-challenge-audio"><!></button>'),El=we("<audio hidden autoplay><source></audio>"),xl=we('<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>'),Tl=we("<div><!></div>"),Il=we("<div><!></div>"),Vl=we('<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>'),Rl=we('<div class="altcha-footer"><div><!></div></div>'),jl=we('<div class="altcha-anchor-arrow"></div>'),$l=we('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){var Fi,Mi;ca(t,!0);const[r,i]=ro(),o=()=>to(Nl,"$altchaI18nStore",r);let n=x(t,"auto",7,void 0),u=x(t,"blockspam",7,void 0),s=x(t,"challengeurl",7,void 0),c=x(t,"challengejson",7,void 0),d=x(t,"credentials",7,void 0),p=x(t,"customfetch",7,void 0),h=x(t,"debug",7,!1),v=x(t,"delay",7,0),k=x(t,"disableautofocus",7,!1),R=x(t,"expire",7,void 0),_=x(t,"floating",7,void 0),H=x(t,"floatinganchor",7,void 0),be=x(t,"floatingoffset",7,void 0),ee=x(t,"floatingpersist",7,!1),oe=x(t,"hidefooter",7,!1),te=x(t,"hidelogo",7,!1),vt=x(t,"id",7,void 0),M=x(t,"language",7,void 0),ce=x(t,"name",7,"altcha"),Ce=x(t,"maxnumber",7,1e6),St=x(t,"mockerror",7,!1),Ze=x(t,"obfuscated",7,void 0),cr=x(t,"plugins",7,void 0),Pt=x(t,"refetchonexpire",7,!0),it=x(t,"sentinel",7,void 0),Re=x(t,"spamfilter",7,!1),bt=x(t,"strings",7,void 0),Ae=x(t,"test",7,!1),le=x(t,"verifyurl",7,void 0),pt=x(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),zt=x(t,"workerurl",7,void 0);const{altchaI18n:zl}=globalThis,Nl=zl.store,si=["SHA-256","SHA-384","SHA-512"],Dl="https://altcha.org/",Ge=(a,f)=>{t.$$host.dispatchEvent(new CustomEvent(a,{detail:f}))},ui=(Mi=(Fi=document.documentElement.lang)==null?void 0:Fi.split("-"))==null?void 0:Mi[0],qr=xt(()=>{var a;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((a=s())!=null&&a.includes("apiKey=ckey_"))}),Or=xt(()=>c()?Ci(c()):void 0),ql=xt(()=>bt()?Ci(bt()):{}),q=xt(()=>({...hi(o()),...l(ql)})),fi=xt(()=>`${vt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Nt=O(!1),Z=O(null),T=O(qe(w.UNVERIFIED)),se=O(void 0),Dt=O(null),Ye=O(null),Hr=O(null),mt=O(null),z=O(null),nt=O(null),je=null,J=O(null),ot=O(!1),We=[],Fr=O(!1),Ne=O(null);Ir(()=>{Xl(l(nt))}),Ir(()=>{Ql(l(T))}),so(()=>{Ol(),l(z)&&(l(z).removeEventListener("submit",yi),l(z).removeEventListener("reset",Ai),l(z).removeEventListener("focusin",mi),y(z,null)),je&&(clearTimeout(je),je=null),document.removeEventListener("click",bi),document.removeEventListener("scroll",pi),window.removeEventListener("resize",wi)}),Xa(()=>{var a;I("mounted","2.0.0"),I("workers",pt()),Bl(),I("plugins",We.length?We.map(f=>f.constructor.pluginName).join(", "):"none"),Ae()&&I("using test mode"),R()&&Mr(R()),n()!==void 0&&I("auto",n()),_()!==void 0&&Ei(_()),y(z,(a=l(se))==null?void 0:a.closest("form"),!0),l(z)&&(l(z).addEventListener("submit",yi,{capture:!0}),l(z).addEventListener("reset",Ai),(n()==="onfocus"||ee()==="focus")&&l(z).addEventListener("focusin",mi)),n()==="onload"&&(Ze()?qt():De()),l(qr)&&(oe()||te())&&I("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ge("load")})});function dr(a,f){return btoa(JSON.stringify({algorithm:a.algorithm,challenge:a.challenge,number:f.number,salt:a.salt,signature:a.signature,test:Ae()?!0:void 0,took:f.took}))}function Ol(){for(const a of We)a.destroy()}function ci(){s()&&Pt()&&l(T)===w.VERIFIED?De():yt(w.EXPIRED,l(q).expired)}async function Hl(){var a;if(St())throw I("mocking error"),new Error("Mocked error.");if(l(Or))return I("using provided json data"),l(Or);if(Ae())return I("generating test challenge",{test:Ae()}),fl(typeof Ae()!="boolean"?+Ae():void 0);{if(!s()&&l(z)){const E=l(z).getAttribute("action");E!=null&&E.includes("/form/")&&s(E+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");I("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:Re()!==!1?{"x-altcha-spam-filter":"1"}:{}},g=await di()(s(),f);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 m=g.headers.get("X-Altcha-Config"),b=await g.json(),C=new URLSearchParams((a=b.salt.split("?"))==null?void 0:a[1]),A=C.get("expires")||C.get("expire");if(A){const E=new Date(+A*1e3),B=isNaN(E.getTime())?0:E.getTime()-Date.now();B>0&&Mr(B)}if(m)try{const E=JSON.parse(m);E&&typeof E=="object"&&E.verifyurl&&!E.verifyurl.startsWith("javascript:")&&(E.verifyurl=vi(E.verifyurl))}catch(E){I("unable to configure from X-Altcha-Config",E)}return b}}function Fl(a){var g,m;const f=(g=l(z))==null?void 0:g.querySelector(typeof a=="string"?`input[name="${a}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function di(){let a=fetch;if(p())if(I("using customfetch"),typeof p()=="string"){if(a=globalThis[p()]||null,!a)throw new Error(`Custom fetch function not found: ${p()}`)}else a=p();return a}function hi(a,f=[M()||"",document.documentElement.lang||"",...navigator.languages]){const g=Object.keys(a).map(b=>b.toLowerCase()),m=f.reduce((b,C)=>(C=C.toLowerCase(),b||(a[C]?C:null)||g.find(A=>C.split("-")[0]===A.split("-")[0])||null),null);return a[m||"en"]}function Ml(){return Re()==="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 Re()=="object"?Re():{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 gi(a){var g;return[...((g=l(z))==null?void 0:g.querySelectorAll(a!=null&&a.length?a.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,b)=>{const C=b.name,A=b.value;return C&&A&&(m[C]=/\n/.test(A)?A.replace(new RegExp("(?<!\\r)\\n","g"),`\r
4
- `):A),m},{})}function vi(a,f){const g=new URL(s()||location.origin),m=new URL(a,g);if(m.search||(m.search=g.search),f)for(const b in f)f[b]!==void 0&&f[b]!==null&&m.searchParams.set(b,f[b]);return m.toString()}function Bl(){const a=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!a||a.includes(f.pluginName))&&We.push(new f({el:l(se),clarify:qt,dispatch:Ge,getConfiguration:Ii,getFloatingAnchor:Vi,getState:Ri,log:I,reset:yt,solve:Ti,setState:$e,setFloatingAnchor:$i,verify:De}))}function I(...a){(h()||a.some(f=>f instanceof Error))&&console[a[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...a)}function Ul(){y(J,Q.PAUSED,!0)}function Zl(a){y(J,Q.ERROR,!0)}function Gl(){y(J,Q.READY,!0)}function Yl(){y(J,Q.LOADING,!0)}function Wl(){y(J,Q.PLAYING,!0)}function Kl(){y(J,Q.PAUSED,!0)}function Jl(a){var f;if(a.preventDefault(),a.stopPropagation(),l(Z)){const g=new FormData(a.target),m=String(g.get("code"));if((f=le())!=null&&f.startsWith("javascript:")){const b=le().replace(/^javascript:/,"");if(I(`calling ${b} function instead of verifyurl`),!(b in globalThis))throw new Error(`Global function "${b}" is undefined.`);return globalThis[b]({challenge:l(Z).challenge,code:m,solution:l(Z).solution})}y(ot,!0),Li(dr(l(Z).challenge,l(Z).solution),m).then(({reason:b,verified:C})=>{C?(y(Z,null),$e(w.VERIFIED),I("verified"),xr().then(()=>{var A;(A=l(Hr))==null||A.focus(),Ge("verified",{payload:l(Ne)})})):(yt(),y(nt,b||"Verification failed",!0))}).catch(b=>{y(Z,null),$e(w.ERROR,b),I("sentinel verification failed:",b)}).finally(()=>{y(ot,!1)})}}function bi(a){var g;const f=a.target;_()&&f&&!l(se).contains(f)&&(l(T)===w.VERIFIED&&ee()===!1||l(T)===w.VERIFIED&&ee()==="focus"&&!((g=l(z))!=null&&g.matches(":focus-within"))||n()==="off"&&l(T)===w.UNVERIFIED)&&ji()}function pi(){_()&&l(T)!==w.UNVERIFIED&&Ot()}function Xl(a){for(const f of We)typeof f.onErrorChange=="function"&&f.onErrorChange(l(nt))}function mi(a){l(T)===w.UNVERIFIED?De():_()&&ee()==="focus"&&l(T)===w.VERIFIED&&Br()}function yi(a){const f=a.target,g=a.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(l(z)&&n()==="onsubmit"?l(T)===w.UNVERIFIED?(a.preventDefault(),a.stopPropagation(),De().then(()=>{ts(g)})):l(T)!==w.VERIFIED&&(a.preventDefault(),a.stopPropagation(),l(T)===w.VERIFYING&&ki()):l(z)&&_()&&n()==="off"&&l(T)===w.UNVERIFIED&&(a.preventDefault(),a.stopPropagation(),Br()))}function Ai(){yt()}function ki(){l(T)===w.VERIFYING&&l(q).waitAlert&&alert(l(q).waitAlert)}function _i(){l(Ye)?l(Ye).paused?(l(Ye).currentTime=0,l(Ye).play()):l(Ye).pause():(y(Fr,!0),requestAnimationFrame(()=>{var a;(a=l(Ye))==null||a.play()}))}function Ql(a){for(const f of We)typeof f.onStateChange=="function"&&f.onStateChange(l(T));_()&&l(T)!==w.UNVERIFIED&&requestAnimationFrame(()=>{Ot()}),y(Nt,l(T)===w.VERIFIED)}function wi(){_()&&Ot()}function Ci(a){return JSON.parse(a)}async function es(a){if(!le())throw new Error("Attribute verifyurl not set.");I("requesting server verification from",le());const f={payload:a};if(Re()!==!1){const{blockedCountries:b,classifier:C,disableRules:A,email:E,expectedLanguages:B,expectedCountries:re,fields:de,ipAddress:Ke,text:Zr,timeZone:vr}=Ml();f.blockedCountries=b,f.classifier=C,f.disableRules=A,f.email=E===!1?void 0:Fl(E),f.expectedCountries=re,f.expectedLanguages=B||(ui?[ui]:void 0),f.fields=de===!1?void 0:gi(de),f.ipAddress=Ke===!1?void 0:Ke||"auto",f.text=Zr,f.timeZone=vr===!1?void 0:vr||ni()}const g=await di()(le(),{body:JSON.stringify(f),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 m=await g.json();if(m!=null&&m.payload&&y(Ne,m.payload,!0),Ge("serververification",m),u()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Li(a,f){if(!le())throw new Error("Attribute verifyurl not set.");I("requesting sentinel verification from",le());const g={code:f,payload:a};it()&&(g.fields=it().fields?gi():void 0,g.timeZone=it().timeZone?ni():void 0);const m=await fetch(le(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(!m||!(m instanceof Response))throw new Error("Fetch function did not return a response.");if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const b=await m.json();return b!=null&&b.payload&&y(Ne,b.payload,!0),Ge("sentinelverification",b),b}function ts(a){var f;l(z)&&"requestSubmit"in l(z)?l(z).requestSubmit(a):(f=l(z))!=null&&f.reportValidity()&&(a?a.click():l(z).submit())}function Mr(a){I("expire",a),je&&(clearTimeout(je),je=null),a<1?ci():je=setTimeout(ci,a)}function Ei(a){I("floating",a),_()!==a&&(l(se).style.left="",l(se).style.top=""),_(a===!0||a===""?"auto":a===!1||a==="false"?void 0:_()),_()?(n()||n("onsubmit"),document.addEventListener("scroll",pi),document.addEventListener("click",bi),window.addEventListener("resize",wi)):n()==="onsubmit"&&n(void 0)}function xi(a){if(!a.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(a.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!si.includes(a.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${si.join(", ")}`);if(!a.challenge||a.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!a.salt||a.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Ti(a){let f=null;if("Worker"in window){try{f=await rs(a,a.maxNumber||a.maxnumber||Ce())}catch(g){I(g)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in a)return{data:a,solution:f}}if("obfuscated"in a){const g=await gl(a.obfuscated,a.key,a.maxNumber||a.maxnumber);return{data:a,solution:await g.promise}}return{data:a,solution:await cl(a.challenge,a.salt,a.algorithm,a.maxNumber||a.maxnumber||Ce()).promise}}async function rs(a,f=typeof Ae()=="number"?Ae():a.maxNumber||a.maxnumber||Ce(),g=Math.ceil(pt())){const m=[];g=Math.min(16,f,Math.max(1,g));for(let A=0;A<g;A++)m.push(altchaCreateWorker(zt()));const b=Math.ceil(f/g),C=await Promise.all(m.map((A,E)=>{const B=E*b;return new Promise(re=>{A.addEventListener("message",de=>{if(de.data)for(const Ke of m)Ke!==A&&Ke.postMessage({type:"abort"});re(de.data)}),A.postMessage({payload:a,max:B+b,start:B,type:"work"})})}));for(const A of m)A.terminate();return C.find(A=>!!A)||null}async function qt(){if(!Ze()){$e(w.ERROR);return}const a=We.find(f=>f.constructor.pluginName==="obfuscation");if(!a||!("clarify"in a)){$e(w.ERROR),I("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in a&&typeof a.clarify=="function")return a.clarify()}function as(a){a.obfuscated!==void 0&&Ze(a.obfuscated),a.auto!==void 0&&(n(a.auto),n()==="onload"&&(Ze()?qt():De())),a.blockspam!==void 0&&u(!!a.blockspam),a.customfetch!==void 0&&p(a.customfetch),a.floatinganchor!==void 0&&H(a.floatinganchor),a.delay!==void 0&&v(a.delay),a.floatingoffset!==void 0&&be(a.floatingoffset),a.floating!==void 0&&Ei(a.floating),a.expire!==void 0&&(Mr(a.expire),R(a.expire)),a.challenge&&(c(typeof a.challenge=="string"?a.challenge:JSON.stringify(a.challenge)),xi(l(Or))),a.challengeurl!==void 0&&s(a.challengeurl),a.debug!==void 0&&h(!!a.debug),a.hidefooter!==void 0&&oe(!!a.hidefooter),a.hidelogo!==void 0&&te(!!a.hidelogo),a.language!==void 0&&bt(hi(o(),[a.language])),a.maxnumber!==void 0&&Ce(+a.maxnumber),a.mockerror!==void 0&&St(!!a.mockerror),a.name!==void 0&&ce(a.name),a.refetchonexpire!==void 0&&Pt(!!a.refetchonexpire),a.sentinel!==void 0&&typeof a.sentinel=="object"&&it(a.sentinel),a.spamfilter!==void 0&&Re(typeof a.spamfilter=="object"?a.spamfilter:!!a.spamfilter),a.strings&&bt(typeof a.strings=="string"?a.strings:JSON.stringify(a.strings)),a.test!==void 0&&Ae(typeof a.test=="number"?a.test:!!a.test),a.verifyurl!==void 0&&le(a.verifyurl),a.workers!==void 0&&pt(+a.workers),a.workerurl!==void 0&&zt(a.workerurl)}function Ii(){return{auto:n(),blockspam:u(),challengeurl:s(),debug:h(),delay:v(),expire:R(),floating:_(),floatinganchor:H(),floatingoffset:be(),hidefooter:oe(),hidelogo:te(),name:ce(),maxnumber:Ce(),mockerror:St(),obfuscated:Ze(),refetchonexpire:Pt(),spamfilter:Re(),strings:l(q),test:Ae(),verifyurl:le(),workers:pt(),workerurl:zt()}}function Vi(){return l(mt)}function is(a){return We.find(f=>f.constructor.pluginName===a)}function Ri(){return l(T)}function ji(){l(se).style.display="none"}function Ot(a=20){var f;if(l(se))if(l(mt)||y(mt,(H()?document.querySelector(H()):(f=l(z))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(z),!0),l(mt)){const g=parseInt(be(),10)||12,m=l(mt).getBoundingClientRect(),b=l(se).getBoundingClientRect(),C=document.documentElement.clientHeight,A=document.documentElement.clientWidth,E=_()==="auto"?m.bottom+b.height+g+a>C:_()==="top",B=Math.max(a,Math.min(A-a-b.width,m.left+m.width/2-b.width/2));if(E?l(se).style.top=`${m.top-(b.height+g)}px`:l(se).style.top=`${m.bottom+g}px`,l(se).style.left=`${B}px`,l(se).setAttribute("data-floating",E?"top":"bottom"),l(Dt)){const re=l(Dt).getBoundingClientRect();l(Dt).style.left=m.left-B+m.width/2-re.width/2+"px"}}else I("unable to find floating anchor element")}function yt(a=w.UNVERIFIED,f=null){je&&(clearTimeout(je),je=null),y(Nt,!1),y(Ne,null),y(Z,null),y(Fr,!1),y(J,null),$e(a,f)}function $i(a){y(mt,a,!0)}function $e(a,f=null){y(T,a,!0),y(nt,f,!0),Ge("statechange",{payload:l(Ne),state:l(T)})}function Br(){l(se).style.display="block",_()&&Ot()}async function De(){return yt(w.VERIFYING),await new Promise(a=>setTimeout(a,v()||0)),Hl().then(a=>(xi(a),I("challenge",a),Ti(a))).then(({data:a,solution:f})=>{var g;if(I("solution",f),!f||a&&"challenge"in a&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in a)if(le()&&"codeChallenge"in a)((g=document.activeElement)==null?void 0:g.tagName)==="INPUT"&&k()===!1&&document.activeElement.blur(),y(Z,{challenge:a,solution:f},!0);else{if(le()&&it()!==void 0)return Li(dr(a,f));if(le())return es(dr(a,f));y(Ne,dr(a,f),!0),I("payload",l(Ne))}else throw I("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{l(Z)?($e(w.CODE),xr().then(()=>{Ge("code",{codeChallenge:l(Z)})})):($e(w.VERIFIED),I("verified"),xr().then(()=>{Ge("verified",{payload:l(Ne)})}))}).catch(a=>{I(a),$e(w.ERROR,a.message)})}var Si=$l(),Pi=It(Si);Gn(Pi,t,"default",{});var Ht=W(Pi,2),Ur=Y(Ht),hr=Y(Ur);let zi;var Ni=Y(hr);{var ns=a=>{Dr(a)};K(Ni,a=>{l(T)===w.VERIFYING&&a(ns)})}var lt=W(Ni,2);Za(lt),lt.__change=[ml,T,Re,z,Nt,Ze,qt,De],lr(lt,a=>y(Hr,a),()=>l(Hr)),G(hr);var gr=W(hr,2),os=Y(gr);{var ls=a=>{var f=or(),g=It(f);at(g,()=>l(q).verified),F(a,f)},ss=(a,f)=>{{var g=b=>{var C=or(),A=It(C);at(A,()=>l(q).verifying),F(b,C)},m=(b,C)=>{{var A=B=>{var re=or(),de=It(re);at(de,()=>l(q).verificationRequired),F(B,re)},E=B=>{var re=or(),de=It(re);at(de,()=>l(q).label),F(B,re)};K(b,B=>{l(T)===w.CODE?B(A):B(E,!1)},C)}};K(a,b=>{l(T)===w.VERIFYING?b(g):b(m,!1)},f)}};K(os,a=>{l(T)===w.VERIFIED?a(ls):a(ss,!1)})}G(gr);var Di=W(gr,2);{var us=a=>{var f=Al();Za(f),Ie(()=>{S(f,"name",ce()),Xn(f,l(Ne))}),F(a,f)};K(Di,a=>{l(T)===w.VERIFIED&&a(us)})}var qi=W(Di,2);{var fs=a=>{var f=kl(),g=Y(f);S(g,"href",Dl),G(f),Ie(()=>S(g,"aria-label",l(q).ariaLinkLabel)),F(a,f)};K(qi,a=>{(te()!==!0||l(qr))&&a(fs)})}var cs=W(qi,2);{var ds=a=>{var f=xl(),g=W(Y(f),2),m=Y(g),b=W(m,2);On(b,!k()),b.__keydown=[bl,_i];var C=W(b,2),A=Y(C),E=Y(A);{var B=Le=>{var X=Ll();X.__click=_i;var br=Y(X);{var Ft=At=>{Dr(At,()=>20)},As=(At,ks)=>{{var _s=kt=>{var Gr=_l();F(kt,Gr)},ws=(kt,Gr)=>{{var Cs=_t=>{var Yr=wl();F(_t,Yr)},Ls=_t=>{var Yr=Cl();F(_t,Yr)};K(kt,_t=>{l(J)===Q.PLAYING?_t(Cs):_t(Ls,!1)},Gr)}};K(At,kt=>{l(J)===Q.ERROR?kt(_s):kt(ws,!1)},ks)}};K(br,At=>{l(J)===Q.LOADING?At(Ft):At(As,!1)})}G(X),Ie(()=>{S(X,"title",l(q).getAudioChallenge),X.disabled=l(J)===Q.LOADING||l(J)===Q.ERROR||l(ot),S(X,"aria-label",l(J)===Q.LOADING?l(q).loading:l(q).getAudioChallenge)}),F(Le,X)};K(E,Le=>{l(Z).challenge.codeChallenge.audio&&Le(B)})}var re=W(E,2);re.__click=[pl,De],G(A);var de=W(A,2),Ke=Y(de);{var Zr=Le=>{Dr(Le,()=>16)};K(Ke,Le=>{l(ot)&&Le(Zr)})}var vr=W(Ke);G(de),G(C);var ms=W(C,2);{var ys=Le=>{var X=El(),br=Y(X);G(X),lr(X,Ft=>y(Ye,Ft),()=>l(Ye)),Ie(Ft=>S(br,"src",Ft),[()=>vi(l(Z).challenge.codeChallenge.audio,{language:M()})]),Ue("loadstart",X,Yl),Ue("canplay",X,Gl),Ue("pause",X,Kl),Ue("playing",X,Wl),Ue("ended",X,Ul),Ue("error",br,Zl),F(Le,X)};K(ms,Le=>{l(Z).challenge.codeChallenge.audio&&l(Fr)&&Le(ys)})}G(g),G(f),Ie(()=>{S(f,"aria-label",l(q).verificationRequired),S(m,"src",l(Z).challenge.codeChallenge.image),S(b,"minlength",l(Z).challenge.codeChallenge.length||1),S(b,"maxlength",l(Z).challenge.codeChallenge.length),S(b,"placeholder",l(q).enterCode),S(b,"aria-label",l(J)===Q.LOADING?l(q).loading:l(J)===Q.PLAYING?"":l(q).enterCodeAria),S(b,"aria-live",l(J)?"assertive":"polite"),S(b,"aria-busy",l(J)===Q.LOADING),b.disabled=l(ot),S(re,"aria-label",l(q).reload),S(re,"title",l(q).reload),re.disabled=l(ot),de.disabled=l(ot),S(de,"aria-label",l(q).verify),Bn(vr,` ${l(q).verify??""}`)}),Ue("submit",g,Jl,!0),F(a,f)};K(cs,a=>{var f;(f=l(Z))!=null&&f.challenge.codeChallenge&&a(ds)})}G(Ur);var Oi=W(Ur,2);{var hs=a=>{var f=Vl(),g=W(Y(f),2);{var m=C=>{var A=Tl(),E=Y(A);at(E,()=>l(q).expired),G(A),Ie(()=>S(A,"title",l(nt))),F(C,A)},b=C=>{var A=Il(),E=Y(A);at(E,()=>l(q).error),G(A),Ie(()=>S(A,"title",l(nt))),F(C,A)};K(g,C=>{l(T)===w.EXPIRED?C(m):C(b,!1)})}G(f),F(a,f)};K(Oi,a=>{(l(nt)||l(T)===w.EXPIRED)&&a(hs)})}var Hi=W(Oi,2);{var gs=a=>{var f=Rl(),g=Y(f),m=Y(g);at(m,()=>l(q).footer),G(g),G(f),F(a,f)};K(Hi,a=>{l(q).footer&&(oe()!==!0||l(qr))&&a(gs)})}var vs=W(Hi,2);{var bs=a=>{var f=jl();lr(f,g=>y(Dt,g),()=>l(Dt)),F(a,f)};K(vs,a=>{_()&&a(bs)})}G(Ht),lr(Ht,a=>y(se,a),()=>l(se)),Ie(a=>{S(Ht,"data-state",l(T)),S(Ht,"data-floating",_()),zi=Wn(hr,1,"altcha-checkbox",null,zi,a),S(lt,"id",l(fi)),lt.required=n()!=="onsubmit"&&(!_()||n()!=="off"),S(gr,"for",l(fi))},[()=>({"altcha-checkbox-verifying":l(T)===w.VERIFYING})]),Ue("invalid",lt,ki),eo(lt,()=>l(Nt),a=>y(Nt,a)),F(e,Si);var ps=da({clarify:qt,configure:as,getConfiguration:Ii,getFloatingAnchor:Vi,getPlugin:is,getState:Ri,hide:ji,repositionFloating:Ot,reset:yt,setFloatingAnchor:$i,setState:$e,show:Br,verify:De,get auto(){return n()},set auto(a=void 0){n(a),L()},get blockspam(){return u()},set blockspam(a=void 0){u(a),L()},get challengeurl(){return s()},set challengeurl(a=void 0){s(a),L()},get challengejson(){return c()},set challengejson(a=void 0){c(a),L()},get credentials(){return d()},set credentials(a=void 0){d(a),L()},get customfetch(){return p()},set customfetch(a=void 0){p(a),L()},get debug(){return h()},set debug(a=!1){h(a),L()},get delay(){return v()},set delay(a=0){v(a),L()},get disableautofocus(){return k()},set disableautofocus(a=!1){k(a),L()},get expire(){return R()},set expire(a=void 0){R(a),L()},get floating(){return _()},set floating(a=void 0){_(a),L()},get floatinganchor(){return H()},set floatinganchor(a=void 0){H(a),L()},get floatingoffset(){return be()},set floatingoffset(a=void 0){be(a),L()},get floatingpersist(){return ee()},set floatingpersist(a=!1){ee(a),L()},get hidefooter(){return oe()},set hidefooter(a=!1){oe(a),L()},get hidelogo(){return te()},set hidelogo(a=!1){te(a),L()},get id(){return vt()},set id(a=void 0){vt(a),L()},get language(){return M()},set language(a=void 0){M(a),L()},get name(){return ce()},set name(a="altcha"){ce(a),L()},get maxnumber(){return Ce()},set maxnumber(a=1e6){Ce(a),L()},get mockerror(){return St()},set mockerror(a=!1){St(a),L()},get obfuscated(){return Ze()},set obfuscated(a=void 0){Ze(a),L()},get plugins(){return cr()},set plugins(a=void 0){cr(a),L()},get refetchonexpire(){return Pt()},set refetchonexpire(a=!0){Pt(a),L()},get sentinel(){return it()},set sentinel(a=void 0){it(a),L()},get spamfilter(){return Re()},set spamfilter(a=!1){Re(a),L()},get strings(){return bt()},set strings(a=void 0){bt(a),L()},get test(){return Ae()},set test(a=!1){Ae(a),L()},get verifyurl(){return le()},set verifyurl(a=void 0){le(a),L()},get workers(){return pt()},set workers(a=Math.min(16,navigator.hardwareConcurrency||8)){pt(a),L()},get workerurl(){return zt()},set workerurl(a=void 0){zt(a),L()}});return i(),ps}Mn(["change","keydown","click"]),customElements.define("altcha-widget",lo(oi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{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:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1));const Sl='@keyframes altcha-spinner{to{transform:rotate(360deg)}}.altcha{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:0;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled,.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor!important;opacity:.7}.altcha-footer:hover,.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;justify-content:center;height:24px;position:relative;width:24px}.altcha-checkbox .altcha-spinner{bottom:0;left:0;position:absolute;right:0;top:0}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{appearance:none;opacity:0;pointer-events:none}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}';function Pl(e,t="__altcha-css"){if(!document.getElementById(t)){const r=document.createElement("style");r.id=t,r.textContent=e,document.head.appendChild(r)}}globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new ll,Pl(Sl),V.Altcha=oi,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
3
+ `,ri=typeof self<"u"&&self.Blob&&new Blob([ti],{type:"text/javascript;charset=utf-8"});function ll(e){let t;try{if(t=ri&&(self.URL||self.webkitURL).createObjectURL(ri),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ti),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const sl="5";typeof window<"u"&&((li=window.__svelte??(window.__svelte={})).v??(li.v=new Set)).add(sl);const ai=new TextEncoder;function ul(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function fl(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await ii(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function ii(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 ul(await crypto.subtle.digest(r.toUpperCase(),ai.encode(e+t)))}function cl(e,t,r="SHA-256",i=1e6,o=0){const n=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=o;c<=i;c+=1){if(n.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:n}}function ni(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function dl(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 hl(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 gl(e,t="",r=1e6,i=0){const o="AES-GCM",n=new AbortController,u=Date.now(),s=async()=>{for(let p=i;p<=r;p+=1){if(n.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:o,iv:hl(p)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=dl(e);const p=await crypto.subtle.digest("SHA-256",ai.encode(t));c=await crypto.subtle.importKey("raw",p,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:n}}return{promise:s(),controller:n}}var w=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});const vl={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",vl);const Dr=(e,t)=>{let r=An(()=>Ki(t==null?void 0:t(),24));var i=yl();Ie(()=>{S(i,"width",l(r)),S(i,"height",l(r))}),F(e,i)};function bl(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function pl(e,t){e.preventDefault(),t()}function ml(e,t,r,i,o,n,u,s){var c;[w.UNVERIFIED,w.ERROR,w.EXPIRED,w.CODE].includes(l(t))?r()!==!1&&((c=l(i))==null?void 0:c.reportValidity())===!1?y(o,!1):n()?u():s():y(o,!0)}var yl=nr('<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>'),Al=we('<input type="hidden">'),kl=we('<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>'),_l=nr('<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>'),wl=nr('<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>'),Cl=nr('<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>'),Ll=we('<button type="button" class="altcha-code-challenge-audio"><!></button>'),El=we("<audio hidden autoplay><source></audio>"),xl=we('<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>'),Tl=we("<div><!></div>"),Il=we("<div><!></div>"),Vl=we('<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>'),Rl=we('<div class="altcha-footer"><div><!></div></div>'),jl=we('<div class="altcha-anchor-arrow"></div>'),$l=we('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){var Fi,Mi;ca(t,!0);const[r,i]=ro(),o=()=>to(Nl,"$altchaI18nStore",r);let n=x(t,"auto",7,void 0),u=x(t,"blockspam",7,void 0),s=x(t,"challengeurl",7,void 0),c=x(t,"challengejson",7,void 0),d=x(t,"credentials",7,void 0),p=x(t,"customfetch",7,void 0),h=x(t,"debug",7,!1),v=x(t,"delay",7,0),k=x(t,"disableautofocus",7,!1),R=x(t,"expire",7,void 0),_=x(t,"floating",7,void 0),H=x(t,"floatinganchor",7,void 0),be=x(t,"floatingoffset",7,void 0),ee=x(t,"floatingpersist",7,!1),oe=x(t,"hidefooter",7,!1),te=x(t,"hidelogo",7,!1),vt=x(t,"id",7,void 0),M=x(t,"language",7,void 0),ce=x(t,"name",7,"altcha"),Ce=x(t,"maxnumber",7,1e6),St=x(t,"mockerror",7,!1),Ze=x(t,"obfuscated",7,void 0),cr=x(t,"plugins",7,void 0),Pt=x(t,"refetchonexpire",7,!0),it=x(t,"sentinel",7,void 0),Re=x(t,"spamfilter",7,!1),bt=x(t,"strings",7,void 0),Ae=x(t,"test",7,!1),le=x(t,"verifyurl",7,void 0),pt=x(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),zt=x(t,"workerurl",7,void 0);const{altchaI18n:zl}=globalThis,Nl=zl.store,si=["SHA-256","SHA-384","SHA-512"],Dl="https://altcha.org/",Ge=(a,f)=>{t.$$host.dispatchEvent(new CustomEvent(a,{detail:f}))},ui=(Mi=(Fi=document.documentElement.lang)==null?void 0:Fi.split("-"))==null?void 0:Mi[0],qr=xt(()=>{var a;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((a=s())!=null&&a.includes("apiKey=ckey_"))}),Or=xt(()=>c()?Ci(c()):void 0),ql=xt(()=>bt()?Ci(bt()):{}),q=xt(()=>({...hi(o()),...l(ql)})),fi=xt(()=>`${vt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Nt=O(!1),Z=O(null),T=O(qe(w.UNVERIFIED)),se=O(void 0),Dt=O(null),Ye=O(null),Hr=O(null),mt=O(null),z=O(null),nt=O(null),je=null,J=O(null),ot=O(!1),We=[],Fr=O(!1),Ne=O(null);Ir(()=>{Xl(l(nt))}),Ir(()=>{Ql(l(T))}),so(()=>{Ol(),l(z)&&(l(z).removeEventListener("submit",yi),l(z).removeEventListener("reset",Ai),l(z).removeEventListener("focusin",mi),y(z,null)),je&&(clearTimeout(je),je=null),document.removeEventListener("click",bi),document.removeEventListener("scroll",pi),window.removeEventListener("resize",wi)}),Xa(()=>{var a;I("mounted","2.0.0"),I("workers",pt()),Bl(),I("plugins",We.length?We.map(f=>f.constructor.pluginName).join(", "):"none"),Ae()&&I("using test mode"),R()&&Mr(R()),n()!==void 0&&I("auto",n()),_()!==void 0&&Ei(_()),y(z,(a=l(se))==null?void 0:a.closest("form"),!0),l(z)&&(l(z).addEventListener("submit",yi,{capture:!0}),l(z).addEventListener("reset",Ai),(n()==="onfocus"||ee()==="focus")&&l(z).addEventListener("focusin",mi)),n()==="onload"&&(Ze()?qt():De()),l(qr)&&(oe()||te())&&I("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ge("load")})});function dr(a,f){return btoa(JSON.stringify({algorithm:a.algorithm,challenge:a.challenge,number:f.number,salt:a.salt,signature:a.signature,test:Ae()?!0:void 0,took:f.took}))}function Ol(){for(const a of We)a.destroy()}function ci(){s()&&Pt()&&l(T)===w.VERIFIED?De():yt(w.EXPIRED,l(q).expired)}async function Hl(){var a;if(St())throw I("mocking error"),new Error("Mocked error.");if(l(Or))return I("using provided json data"),l(Or);if(Ae())return I("generating test challenge",{test:Ae()}),fl(typeof Ae()!="boolean"?+Ae():void 0);{if(!s()&&l(z)){const E=l(z).getAttribute("action");E!=null&&E.includes("/form/")&&s(E+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");I("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:Re()!==!1?{"x-altcha-spam-filter":"1"}:{}},g=await di()(s(),f);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 m=g.headers.get("X-Altcha-Config"),b=await g.json(),C=new URLSearchParams((a=b.salt.split("?"))==null?void 0:a[1]),A=C.get("expires")||C.get("expire");if(A){const E=new Date(+A*1e3),B=isNaN(E.getTime())?0:E.getTime()-Date.now();B>0&&Mr(B)}if(m)try{const E=JSON.parse(m);E&&typeof E=="object"&&E.verifyurl&&!E.verifyurl.startsWith("fn:")&&(E.verifyurl=vi(E.verifyurl))}catch(E){I("unable to configure from X-Altcha-Config",E)}return b}}function Fl(a){var g,m;const f=(g=l(z))==null?void 0:g.querySelector(typeof a=="string"?`input[name="${a}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function di(){let a=fetch;if(p())if(I("using customfetch"),typeof p()=="string"){if(a=globalThis[p()]||null,!a)throw new Error(`Custom fetch function not found: ${p()}`)}else a=p();return a}function hi(a,f=[M()||"",document.documentElement.lang||"",...navigator.languages]){const g=Object.keys(a).map(b=>b.toLowerCase()),m=f.reduce((b,C)=>(C=C.toLowerCase(),b||(a[C]?C:null)||g.find(A=>C.split("-")[0]===A.split("-")[0])||null),null);return a[m||"en"]}function Ml(){return Re()==="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 Re()=="object"?Re():{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 gi(a){var g;return[...((g=l(z))==null?void 0:g.querySelectorAll(a!=null&&a.length?a.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,b)=>{const C=b.name,A=b.value;return C&&A&&(m[C]=/\n/.test(A)?A.replace(new RegExp("(?<!\\r)\\n","g"),`\r
4
+ `):A),m},{})}function vi(a,f){const g=new URL(s()||location.origin),m=new URL(a,g);if(m.search||(m.search=g.search),f)for(const b in f)f[b]!==void 0&&f[b]!==null&&m.searchParams.set(b,f[b]);return m.toString()}function Bl(){const a=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!a||a.includes(f.pluginName))&&We.push(new f({el:l(se),clarify:qt,dispatch:Ge,getConfiguration:Ii,getFloatingAnchor:Vi,getState:Ri,log:I,reset:yt,solve:Ti,setState:$e,setFloatingAnchor:$i,verify:De}))}function I(...a){(h()||a.some(f=>f instanceof Error))&&console[a[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...a)}function Ul(){y(J,Q.PAUSED,!0)}function Zl(a){y(J,Q.ERROR,!0)}function Gl(){y(J,Q.READY,!0)}function Yl(){y(J,Q.LOADING,!0)}function Wl(){y(J,Q.PLAYING,!0)}function Kl(){y(J,Q.PAUSED,!0)}function Jl(a){var f;if(a.preventDefault(),a.stopPropagation(),l(Z)){const g=new FormData(a.target),m=String(g.get("code"));if((f=le())!=null&&f.startsWith("fn:")){const b=le().replace(/^fn:/,"");if(I(`calling ${b} function instead of verifyurl`),!(b in globalThis))throw new Error(`Global function "${b}" is undefined.`);return globalThis[b]({challenge:l(Z).challenge,code:m,solution:l(Z).solution})}y(ot,!0),Li(dr(l(Z).challenge,l(Z).solution),m).then(({reason:b,verified:C})=>{C?(y(Z,null),$e(w.VERIFIED),I("verified"),xr().then(()=>{var A;(A=l(Hr))==null||A.focus(),Ge("verified",{payload:l(Ne)})})):(yt(),y(nt,b||"Verification failed",!0))}).catch(b=>{y(Z,null),$e(w.ERROR,b),I("sentinel verification failed:",b)}).finally(()=>{y(ot,!1)})}}function bi(a){var g;const f=a.target;_()&&f&&!l(se).contains(f)&&(l(T)===w.VERIFIED&&ee()===!1||l(T)===w.VERIFIED&&ee()==="focus"&&!((g=l(z))!=null&&g.matches(":focus-within"))||n()==="off"&&l(T)===w.UNVERIFIED)&&ji()}function pi(){_()&&l(T)!==w.UNVERIFIED&&Ot()}function Xl(a){for(const f of We)typeof f.onErrorChange=="function"&&f.onErrorChange(l(nt))}function mi(a){l(T)===w.UNVERIFIED?De():_()&&ee()==="focus"&&l(T)===w.VERIFIED&&Br()}function yi(a){const f=a.target,g=a.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(l(z)&&n()==="onsubmit"?l(T)===w.UNVERIFIED?(a.preventDefault(),a.stopPropagation(),De().then(()=>{ts(g)})):l(T)!==w.VERIFIED&&(a.preventDefault(),a.stopPropagation(),l(T)===w.VERIFYING&&ki()):l(z)&&_()&&n()==="off"&&l(T)===w.UNVERIFIED&&(a.preventDefault(),a.stopPropagation(),Br()))}function Ai(){yt()}function ki(){l(T)===w.VERIFYING&&l(q).waitAlert&&alert(l(q).waitAlert)}function _i(){l(Ye)?l(Ye).paused?(l(Ye).currentTime=0,l(Ye).play()):l(Ye).pause():(y(Fr,!0),requestAnimationFrame(()=>{var a;(a=l(Ye))==null||a.play()}))}function Ql(a){for(const f of We)typeof f.onStateChange=="function"&&f.onStateChange(l(T));_()&&l(T)!==w.UNVERIFIED&&requestAnimationFrame(()=>{Ot()}),y(Nt,l(T)===w.VERIFIED)}function wi(){_()&&Ot()}function Ci(a){return JSON.parse(a)}async function es(a){if(!le())throw new Error("Attribute verifyurl not set.");I("requesting server verification from",le());const f={payload:a};if(Re()!==!1){const{blockedCountries:b,classifier:C,disableRules:A,email:E,expectedLanguages:B,expectedCountries:re,fields:de,ipAddress:Ke,text:Zr,timeZone:vr}=Ml();f.blockedCountries=b,f.classifier=C,f.disableRules=A,f.email=E===!1?void 0:Fl(E),f.expectedCountries=re,f.expectedLanguages=B||(ui?[ui]:void 0),f.fields=de===!1?void 0:gi(de),f.ipAddress=Ke===!1?void 0:Ke||"auto",f.text=Zr,f.timeZone=vr===!1?void 0:vr||ni()}const g=await di()(le(),{body:JSON.stringify(f),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 m=await g.json();if(m!=null&&m.payload&&y(Ne,m.payload,!0),Ge("serververification",m),u()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Li(a,f){if(!le())throw new Error("Attribute verifyurl not set.");I("requesting sentinel verification from",le());const g={code:f,payload:a};it()&&(g.fields=it().fields?gi():void 0,g.timeZone=it().timeZone?ni():void 0);const m=await fetch(le(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(!m||!(m instanceof Response))throw new Error("Fetch function did not return a response.");if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const b=await m.json();return b!=null&&b.payload&&y(Ne,b.payload,!0),Ge("sentinelverification",b),b}function ts(a){var f;l(z)&&"requestSubmit"in l(z)?l(z).requestSubmit(a):(f=l(z))!=null&&f.reportValidity()&&(a?a.click():l(z).submit())}function Mr(a){I("expire",a),je&&(clearTimeout(je),je=null),a<1?ci():je=setTimeout(ci,a)}function Ei(a){I("floating",a),_()!==a&&(l(se).style.left="",l(se).style.top=""),_(a===!0||a===""?"auto":a===!1||a==="false"?void 0:_()),_()?(n()||n("onsubmit"),document.addEventListener("scroll",pi),document.addEventListener("click",bi),window.addEventListener("resize",wi)):n()==="onsubmit"&&n(void 0)}function xi(a){if(!a.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(a.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!si.includes(a.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${si.join(", ")}`);if(!a.challenge||a.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!a.salt||a.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Ti(a){let f=null;if("Worker"in window){try{f=await rs(a,a.maxNumber||a.maxnumber||Ce())}catch(g){I(g)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in a)return{data:a,solution:f}}if("obfuscated"in a){const g=await gl(a.obfuscated,a.key,a.maxNumber||a.maxnumber);return{data:a,solution:await g.promise}}return{data:a,solution:await cl(a.challenge,a.salt,a.algorithm,a.maxNumber||a.maxnumber||Ce()).promise}}async function rs(a,f=typeof Ae()=="number"?Ae():a.maxNumber||a.maxnumber||Ce(),g=Math.ceil(pt())){const m=[];g=Math.min(16,f,Math.max(1,g));for(let A=0;A<g;A++)m.push(altchaCreateWorker(zt()));const b=Math.ceil(f/g),C=await Promise.all(m.map((A,E)=>{const B=E*b;return new Promise(re=>{A.addEventListener("message",de=>{if(de.data)for(const Ke of m)Ke!==A&&Ke.postMessage({type:"abort"});re(de.data)}),A.postMessage({payload:a,max:B+b,start:B,type:"work"})})}));for(const A of m)A.terminate();return C.find(A=>!!A)||null}async function qt(){if(!Ze()){$e(w.ERROR);return}const a=We.find(f=>f.constructor.pluginName==="obfuscation");if(!a||!("clarify"in a)){$e(w.ERROR),I("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in a&&typeof a.clarify=="function")return a.clarify()}function as(a){a.obfuscated!==void 0&&Ze(a.obfuscated),a.auto!==void 0&&(n(a.auto),n()==="onload"&&(Ze()?qt():De())),a.blockspam!==void 0&&u(!!a.blockspam),a.customfetch!==void 0&&p(a.customfetch),a.floatinganchor!==void 0&&H(a.floatinganchor),a.delay!==void 0&&v(a.delay),a.floatingoffset!==void 0&&be(a.floatingoffset),a.floating!==void 0&&Ei(a.floating),a.expire!==void 0&&(Mr(a.expire),R(a.expire)),a.challenge&&(c(typeof a.challenge=="string"?a.challenge:JSON.stringify(a.challenge)),xi(l(Or))),a.challengeurl!==void 0&&s(a.challengeurl),a.debug!==void 0&&h(!!a.debug),a.hidefooter!==void 0&&oe(!!a.hidefooter),a.hidelogo!==void 0&&te(!!a.hidelogo),a.language!==void 0&&bt(hi(o(),[a.language])),a.maxnumber!==void 0&&Ce(+a.maxnumber),a.mockerror!==void 0&&St(!!a.mockerror),a.name!==void 0&&ce(a.name),a.refetchonexpire!==void 0&&Pt(!!a.refetchonexpire),a.sentinel!==void 0&&typeof a.sentinel=="object"&&it(a.sentinel),a.spamfilter!==void 0&&Re(typeof a.spamfilter=="object"?a.spamfilter:!!a.spamfilter),a.strings&&bt(typeof a.strings=="string"?a.strings:JSON.stringify(a.strings)),a.test!==void 0&&Ae(typeof a.test=="number"?a.test:!!a.test),a.verifyurl!==void 0&&le(a.verifyurl),a.workers!==void 0&&pt(+a.workers),a.workerurl!==void 0&&zt(a.workerurl)}function Ii(){return{auto:n(),blockspam:u(),challengeurl:s(),debug:h(),delay:v(),expire:R(),floating:_(),floatinganchor:H(),floatingoffset:be(),hidefooter:oe(),hidelogo:te(),name:ce(),maxnumber:Ce(),mockerror:St(),obfuscated:Ze(),refetchonexpire:Pt(),spamfilter:Re(),strings:l(q),test:Ae(),verifyurl:le(),workers:pt(),workerurl:zt()}}function Vi(){return l(mt)}function is(a){return We.find(f=>f.constructor.pluginName===a)}function Ri(){return l(T)}function ji(){l(se).style.display="none"}function Ot(a=20){var f;if(l(se))if(l(mt)||y(mt,(H()?document.querySelector(H()):(f=l(z))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(z),!0),l(mt)){const g=parseInt(be(),10)||12,m=l(mt).getBoundingClientRect(),b=l(se).getBoundingClientRect(),C=document.documentElement.clientHeight,A=document.documentElement.clientWidth,E=_()==="auto"?m.bottom+b.height+g+a>C:_()==="top",B=Math.max(a,Math.min(A-a-b.width,m.left+m.width/2-b.width/2));if(E?l(se).style.top=`${m.top-(b.height+g)}px`:l(se).style.top=`${m.bottom+g}px`,l(se).style.left=`${B}px`,l(se).setAttribute("data-floating",E?"top":"bottom"),l(Dt)){const re=l(Dt).getBoundingClientRect();l(Dt).style.left=m.left-B+m.width/2-re.width/2+"px"}}else I("unable to find floating anchor element")}function yt(a=w.UNVERIFIED,f=null){je&&(clearTimeout(je),je=null),y(Nt,!1),y(Ne,null),y(Z,null),y(Fr,!1),y(J,null),$e(a,f)}function $i(a){y(mt,a,!0)}function $e(a,f=null){y(T,a,!0),y(nt,f,!0),Ge("statechange",{payload:l(Ne),state:l(T)})}function Br(){l(se).style.display="block",_()&&Ot()}async function De(){return yt(w.VERIFYING),await new Promise(a=>setTimeout(a,v()||0)),Hl().then(a=>(xi(a),I("challenge",a),Ti(a))).then(({data:a,solution:f})=>{var g;if(I("solution",f),!f||a&&"challenge"in a&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in a)if(le()&&"codeChallenge"in a)((g=document.activeElement)==null?void 0:g.tagName)==="INPUT"&&k()===!1&&document.activeElement.blur(),y(Z,{challenge:a,solution:f},!0);else{if(le()&&it()!==void 0)return Li(dr(a,f));if(le())return es(dr(a,f));y(Ne,dr(a,f),!0),I("payload",l(Ne))}else throw I("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{l(Z)?($e(w.CODE),xr().then(()=>{Ge("code",{codeChallenge:l(Z)})})):($e(w.VERIFIED),I("verified"),xr().then(()=>{Ge("verified",{payload:l(Ne)})}))}).catch(a=>{I(a),$e(w.ERROR,a.message)})}var Si=$l(),Pi=It(Si);Gn(Pi,t,"default",{});var Ht=W(Pi,2),Ur=Y(Ht),hr=Y(Ur);let zi;var Ni=Y(hr);{var ns=a=>{Dr(a)};K(Ni,a=>{l(T)===w.VERIFYING&&a(ns)})}var lt=W(Ni,2);Za(lt),lt.__change=[ml,T,Re,z,Nt,Ze,qt,De],lr(lt,a=>y(Hr,a),()=>l(Hr)),G(hr);var gr=W(hr,2),os=Y(gr);{var ls=a=>{var f=or(),g=It(f);at(g,()=>l(q).verified),F(a,f)},ss=(a,f)=>{{var g=b=>{var C=or(),A=It(C);at(A,()=>l(q).verifying),F(b,C)},m=(b,C)=>{{var A=B=>{var re=or(),de=It(re);at(de,()=>l(q).verificationRequired),F(B,re)},E=B=>{var re=or(),de=It(re);at(de,()=>l(q).label),F(B,re)};K(b,B=>{l(T)===w.CODE?B(A):B(E,!1)},C)}};K(a,b=>{l(T)===w.VERIFYING?b(g):b(m,!1)},f)}};K(os,a=>{l(T)===w.VERIFIED?a(ls):a(ss,!1)})}G(gr);var Di=W(gr,2);{var us=a=>{var f=Al();Za(f),Ie(()=>{S(f,"name",ce()),Xn(f,l(Ne))}),F(a,f)};K(Di,a=>{l(T)===w.VERIFIED&&a(us)})}var qi=W(Di,2);{var fs=a=>{var f=kl(),g=Y(f);S(g,"href",Dl),G(f),Ie(()=>S(g,"aria-label",l(q).ariaLinkLabel)),F(a,f)};K(qi,a=>{(te()!==!0||l(qr))&&a(fs)})}var cs=W(qi,2);{var ds=a=>{var f=xl(),g=W(Y(f),2),m=Y(g),b=W(m,2);On(b,!k()),b.__keydown=[bl,_i];var C=W(b,2),A=Y(C),E=Y(A);{var B=Le=>{var X=Ll();X.__click=_i;var br=Y(X);{var Ft=At=>{Dr(At,()=>20)},As=(At,ks)=>{{var _s=kt=>{var Gr=_l();F(kt,Gr)},ws=(kt,Gr)=>{{var Cs=_t=>{var Yr=wl();F(_t,Yr)},Ls=_t=>{var Yr=Cl();F(_t,Yr)};K(kt,_t=>{l(J)===Q.PLAYING?_t(Cs):_t(Ls,!1)},Gr)}};K(At,kt=>{l(J)===Q.ERROR?kt(_s):kt(ws,!1)},ks)}};K(br,At=>{l(J)===Q.LOADING?At(Ft):At(As,!1)})}G(X),Ie(()=>{S(X,"title",l(q).getAudioChallenge),X.disabled=l(J)===Q.LOADING||l(J)===Q.ERROR||l(ot),S(X,"aria-label",l(J)===Q.LOADING?l(q).loading:l(q).getAudioChallenge)}),F(Le,X)};K(E,Le=>{l(Z).challenge.codeChallenge.audio&&Le(B)})}var re=W(E,2);re.__click=[pl,De],G(A);var de=W(A,2),Ke=Y(de);{var Zr=Le=>{Dr(Le,()=>16)};K(Ke,Le=>{l(ot)&&Le(Zr)})}var vr=W(Ke);G(de),G(C);var ms=W(C,2);{var ys=Le=>{var X=El(),br=Y(X);G(X),lr(X,Ft=>y(Ye,Ft),()=>l(Ye)),Ie(Ft=>S(br,"src",Ft),[()=>vi(l(Z).challenge.codeChallenge.audio,{language:M()})]),Ue("loadstart",X,Yl),Ue("canplay",X,Gl),Ue("pause",X,Kl),Ue("playing",X,Wl),Ue("ended",X,Ul),Ue("error",br,Zl),F(Le,X)};K(ms,Le=>{l(Z).challenge.codeChallenge.audio&&l(Fr)&&Le(ys)})}G(g),G(f),Ie(()=>{S(f,"aria-label",l(q).verificationRequired),S(m,"src",l(Z).challenge.codeChallenge.image),S(b,"minlength",l(Z).challenge.codeChallenge.length||1),S(b,"maxlength",l(Z).challenge.codeChallenge.length),S(b,"placeholder",l(q).enterCode),S(b,"aria-label",l(J)===Q.LOADING?l(q).loading:l(J)===Q.PLAYING?"":l(q).enterCodeAria),S(b,"aria-live",l(J)?"assertive":"polite"),S(b,"aria-busy",l(J)===Q.LOADING),b.disabled=l(ot),S(re,"aria-label",l(q).reload),S(re,"title",l(q).reload),re.disabled=l(ot),de.disabled=l(ot),S(de,"aria-label",l(q).verify),Bn(vr,` ${l(q).verify??""}`)}),Ue("submit",g,Jl,!0),F(a,f)};K(cs,a=>{var f;(f=l(Z))!=null&&f.challenge.codeChallenge&&a(ds)})}G(Ur);var Oi=W(Ur,2);{var hs=a=>{var f=Vl(),g=W(Y(f),2);{var m=C=>{var A=Tl(),E=Y(A);at(E,()=>l(q).expired),G(A),Ie(()=>S(A,"title",l(nt))),F(C,A)},b=C=>{var A=Il(),E=Y(A);at(E,()=>l(q).error),G(A),Ie(()=>S(A,"title",l(nt))),F(C,A)};K(g,C=>{l(T)===w.EXPIRED?C(m):C(b,!1)})}G(f),F(a,f)};K(Oi,a=>{(l(nt)||l(T)===w.EXPIRED)&&a(hs)})}var Hi=W(Oi,2);{var gs=a=>{var f=Rl(),g=Y(f),m=Y(g);at(m,()=>l(q).footer),G(g),G(f),F(a,f)};K(Hi,a=>{l(q).footer&&(oe()!==!0||l(qr))&&a(gs)})}var vs=W(Hi,2);{var bs=a=>{var f=jl();lr(f,g=>y(Dt,g),()=>l(Dt)),F(a,f)};K(vs,a=>{_()&&a(bs)})}G(Ht),lr(Ht,a=>y(se,a),()=>l(se)),Ie(a=>{S(Ht,"data-state",l(T)),S(Ht,"data-floating",_()),zi=Wn(hr,1,"altcha-checkbox",null,zi,a),S(lt,"id",l(fi)),lt.required=n()!=="onsubmit"&&(!_()||n()!=="off"),S(gr,"for",l(fi))},[()=>({"altcha-checkbox-verifying":l(T)===w.VERIFYING})]),Ue("invalid",lt,ki),eo(lt,()=>l(Nt),a=>y(Nt,a)),F(e,Si);var ps=da({clarify:qt,configure:as,getConfiguration:Ii,getFloatingAnchor:Vi,getPlugin:is,getState:Ri,hide:ji,repositionFloating:Ot,reset:yt,setFloatingAnchor:$i,setState:$e,show:Br,verify:De,get auto(){return n()},set auto(a=void 0){n(a),L()},get blockspam(){return u()},set blockspam(a=void 0){u(a),L()},get challengeurl(){return s()},set challengeurl(a=void 0){s(a),L()},get challengejson(){return c()},set challengejson(a=void 0){c(a),L()},get credentials(){return d()},set credentials(a=void 0){d(a),L()},get customfetch(){return p()},set customfetch(a=void 0){p(a),L()},get debug(){return h()},set debug(a=!1){h(a),L()},get delay(){return v()},set delay(a=0){v(a),L()},get disableautofocus(){return k()},set disableautofocus(a=!1){k(a),L()},get expire(){return R()},set expire(a=void 0){R(a),L()},get floating(){return _()},set floating(a=void 0){_(a),L()},get floatinganchor(){return H()},set floatinganchor(a=void 0){H(a),L()},get floatingoffset(){return be()},set floatingoffset(a=void 0){be(a),L()},get floatingpersist(){return ee()},set floatingpersist(a=!1){ee(a),L()},get hidefooter(){return oe()},set hidefooter(a=!1){oe(a),L()},get hidelogo(){return te()},set hidelogo(a=!1){te(a),L()},get id(){return vt()},set id(a=void 0){vt(a),L()},get language(){return M()},set language(a=void 0){M(a),L()},get name(){return ce()},set name(a="altcha"){ce(a),L()},get maxnumber(){return Ce()},set maxnumber(a=1e6){Ce(a),L()},get mockerror(){return St()},set mockerror(a=!1){St(a),L()},get obfuscated(){return Ze()},set obfuscated(a=void 0){Ze(a),L()},get plugins(){return cr()},set plugins(a=void 0){cr(a),L()},get refetchonexpire(){return Pt()},set refetchonexpire(a=!0){Pt(a),L()},get sentinel(){return it()},set sentinel(a=void 0){it(a),L()},get spamfilter(){return Re()},set spamfilter(a=!1){Re(a),L()},get strings(){return bt()},set strings(a=void 0){bt(a),L()},get test(){return Ae()},set test(a=!1){Ae(a),L()},get verifyurl(){return le()},set verifyurl(a=void 0){le(a),L()},get workers(){return pt()},set workers(a=Math.min(16,navigator.hardwareConcurrency||8)){pt(a),L()},get workerurl(){return zt()},set workerurl(a=void 0){zt(a),L()}});return i(),ps}Mn(["change","keydown","click"]),customElements.define("altcha-widget",lo(oi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{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:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1));const Sl='@keyframes altcha-spinner{to{transform:rotate(360deg)}}.altcha{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:0;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled,.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor!important;opacity:.7}.altcha-footer:hover,.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;justify-content:center;height:24px;position:relative;width:24px}.altcha-checkbox .altcha-spinner{bottom:0;left:0;position:absolute;right:0;top:0}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{appearance:none;opacity:0;pointer-events:none}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}';function Pl(e,t="__altcha-css"){if(!document.getElementById(t)){const r=document.createElement("style");r.id=t,r.textContent=e,document.head.appendChild(r)}}globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new ll,Pl(Sl),V.Altcha=oi,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
package/dist/altcha.js CHANGED
@@ -2180,7 +2180,7 @@ function Sl(e, t) {
2180
2180
  if (m)
2181
2181
  try {
2182
2182
  const k = JSON.parse(m);
2183
- k && typeof k == "object" && k.verifyurl && !k.verifyurl.startsWith("javascript:") && (k.verifyurl = en(k.verifyurl));
2183
+ k && typeof k == "object" && k.verifyurl && !k.verifyurl.startsWith("fn:") && (k.verifyurl = en(k.verifyurl));
2184
2184
  } catch (k) {
2185
2185
  $("unable to configure from X-Altcha-Config", k);
2186
2186
  }
@@ -2301,8 +2301,8 @@ function Sl(e, t) {
2301
2301
  var f;
2302
2302
  if (n.preventDefault(), n.stopPropagation(), l(B)) {
2303
2303
  const v = new FormData(n.target), m = String(v.get("code"));
2304
- if ((f = te()) != null && f.startsWith("javascript:")) {
2305
- const _ = te().replace(/^javascript:/, "");
2304
+ if ((f = te()) != null && f.startsWith("fn:")) {
2305
+ const _ = te().replace(/^fn:/, "");
2306
2306
  if ($(`calling ${_} function instead of verifyurl`), !(_ in globalThis))
2307
2307
  throw new Error(`Global function "${_}" is undefined.`);
2308
2308
  return globalThis[_]({
@@ -1,4 +1,4 @@
1
1
  (function(S,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(S=typeof globalThis<"u"?globalThis:S||self,D(S.altcha={}))})(this,function(S){"use strict";var Sl=Object.defineProperty;var Yi=S=>{throw TypeError(S)};var Tl=(S,D,G)=>D in S?Sl(S,D,{enumerable:!0,configurable:!0,writable:!0,value:G}):S[D]=G;var Ae=(S,D,G)=>Tl(S,typeof D!="symbol"?D+"":D,G),Wi=(S,D,G)=>D.has(S)||Yi("Cannot "+G);var he=(S,D,G)=>(Wi(S,D,"read from private field"),G?G.call(S):D.get(S)),zr=(S,D,G)=>D.has(S)?Yi("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(S):D.set(S,G),Jr=(S,D,G,Bt)=>(Wi(S,D,"write to private field"),Bt?Bt.call(S,G):D.set(S,G),G);var ui,Oe,be;const D=`(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,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;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 s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
2
2
  `,G=typeof self<"u"&&self.Blob&&new Blob([D],{type:"text/javascript;charset=utf-8"});function Bt(e){let t;try{if(t=G&&(self.URL||self.webkitURL).createObjectURL(G),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(D),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Zi="5";typeof window<"u"&&((ui=window.__svelte??(window.__svelte={})).v??(ui.v=new Set)).add(Zi);const zi=1,Ji=4,Ki=8,Xi=16,Qi=1,eo=2,pr="[",Kr="[!",Xr="]",st={},ue=Symbol(),to="http://www.w3.org/1999/xhtml",Qr=!1;function en(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var tn=Array.isArray,ro=Array.prototype.indexOf,no=Array.from,Ht=Object.keys,Ct=Object.defineProperty,Ke=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyDescriptors,oo=Object.prototype,ao=Array.prototype,rn=Object.getPrototypeOf,nn=Object.isExtensible;const ut=()=>{};function on(e){for(var t=0;t<e.length;t++)e[t]()}function lo(e,t,r=!1){return e===void 0?r?t():t:e}const ye=2,an=4,Gt=8,mr=16,Pe=32,Xe=64,Yt=128,ve=256,Wt=512,fe=1024,Ie=2048,Qe=4096,ft=8192,Zt=16384,so=32768,br=65536,uo=1<<19,ln=1<<20,wr=1<<21,xt=Symbol("$state"),sn=Symbol("legacy props"),fo=Symbol("");function co(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ho(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function vo(e){throw new Error("https://svelte.dev/e/effect_orphan")}function go(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _o(){throw new Error("https://svelte.dev/e/hydration_failed")}function po(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function mo(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function bo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function wo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function ct(e){F=e}let M;function Ve(e){if(e===null)throw zt(),st;return M=e}function dt(){return Ve(je(M))}function W(e){if(F){if(je(M)!==null)throw zt(),st;M=e}}function yo(){for(var e=0,t=M;;){if(t.nodeType===8){var r=t.data;if(r===Xr){if(e===0)return t;e-=1}else(r===pr||r===Kr)&&(e+=1)}var i=je(t);t.remove(),t=i}}let Eo=!1;function Ue(e){if(typeof e!="object"||e===null||xt in e)return e;const t=rn(e);if(t!==oo&&t!==ao)return e;var r=new Map,i=tn(e),a=U(0),o=N,u=s=>{var c=N;Se(o);var d=s();return Se(c),d};return i&&r.set("length",U(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&mo();var p=r.get(c);return p===void 0?(p=u(()=>U(d.value)),r.set(c,p)):b(p,u(()=>Ue(d.value))),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&(r.set(c,u(()=>U(ue))),yr(a));else{if(i&&typeof c=="string"){var p=r.get("length"),h=Number(c);Number.isInteger(h)&&h<p.v&&b(p,h)}b(d,ue),yr(a)}return!0},get(s,c,d){var y;if(c===xt)return e;var p=r.get(c),h=c in s;if(p===void 0&&(!h||(y=Ke(s,c))!=null&&y.writable)&&(p=u(()=>U(Ue(h?s[c]:ue))),r.set(c,p)),p!==void 0){var g=l(p);return g===ue?void 0:g}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var p=r.get(c);p&&(d.value=l(p))}else if(d===void 0){var h=r.get(c),g=h==null?void 0:h.v;if(h!==void 0&&g!==ue)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return d},has(s,c){var g;if(c===xt)return!0;var d=r.get(c),p=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||L!==null&&(!p||(g=Ke(s,c))!=null&&g.writable)){d===void 0&&(d=u(()=>U(p?Ue(s[c]):ue)),r.set(c,d));var h=l(d);if(h===ue)return!1}return p},set(s,c,d,p){var ee;var h=r.get(c),g=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var T=r.get(y+"");T!==void 0?b(T,ue):y in s&&(T=u(()=>U(ue)),r.set(y+"",T))}h===void 0?(!g||(ee=Ke(s,c))!=null&&ee.writable)&&(h=u(()=>U(void 0)),b(h,u(()=>Ue(d))),r.set(c,h)):(g=h.v!==ue,b(h,u(()=>Ue(d))));var E=Reflect.getOwnPropertyDescriptor(s,c);if(E!=null&&E.set&&E.set.call(p,d),!g){if(i&&typeof c=="string"){var j=r.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=j.v&&b(j,_e+1)}yr(a)}return!0},ownKeys(s){l(a);var c=Reflect.ownKeys(s).filter(h=>{var g=r.get(h);return g===void 0||g.v!==ue});for(var[d,p]of r)p.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){bo()}})}function yr(e,t=1){b(e,e.v+t)}var un,fn,cn,dn;function Er(){if(un===void 0){un=window,fn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;cn=Ke(t,"firstChild").get,dn=Ke(t,"nextSibling").get,nn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),nn(r)&&(r.__t=void 0)}}function Jt(e=""){return document.createTextNode(e)}function pe(e){return cn.call(e)}function je(e){return dn.call(e)}function Z(e,t){if(!F)return pe(e);var r=pe(M);return r===null&&(r=M.appendChild(Jt())),Ve(r),r}function kt(e,t){if(!F){var r=pe(e);return r instanceof Comment&&r.data===""?je(r):r}return M}function z(e,t=1,r=!1){let i=F?M:e;for(var a;t--;)a=i,i=je(i);if(!F)return i;var o=i==null?void 0:i.nodeType;if(r&&o!==3){var u=Jt();return i===null?a==null||a.after(u):i.before(u),Ve(u),u}return Ve(i),i}function Co(e){e.textContent=""}function hn(e){return e===this.v}function vn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Cr(e){return!vn(e,this.v)}function Kt(e){var t=ye|Ie,r=N!==null&&(N.f&ye)!==0?N:null;return L===null||r!==null&&(r.f&ve)!==0?t|=ve:L.f|=ln,{ctx:oe,deps:null,effects:null,equals:hn,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function At(e){const t=Kt(e);return $n(t),t}function xo(e){const t=Kt(e);return t.equals=Cr,t}function gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)qe(t[r])}}function ko(e){for(var t=e.parent;t!==null;){if((t.f&ye)===0)return t;t=t.parent}return null}function _n(e){var t,r=L;Be(ko(e));try{gn(e),t=Ln(e)}finally{Be(r)}return t}function pn(e){var t=_n(e),r=(He||(e.f&ve)!==0)&&e.deps!==null?Qe:fe;Ee(e,r),e.equals(t)||(e.v=t,e.wv=Tn())}function Ao(e){L===null&&N===null&&vo(),N!==null&&(N.f&ve)!==0&&L===null&&ho(),$t&&co()}function Io(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function et(e,t,r,i=!0){var a=L,o={ctx:oe,deps:null,nodes_start:null,nodes_end:null,f:e|Ie,first:null,fn:t,last:null,next:null,parent:a,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Tr(o),o.f|=so}catch(c){throw qe(o),c}else t!==null&&ir(o);var u=r&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(ln|Yt))===0;if(!u&&i&&(a!==null&&Io(o,a),N!==null&&(N.f&ye)!==0)){var s=N;(s.effects??(s.effects=[])).push(o)}return o}function xr(e){const t=et(Gt,null,!1);return Ee(t,fe),t.teardown=e,t}function kr(e){Ao();var t=L!==null&&(L.f&Pe)!==0&&oe!==null&&!oe.m;if(t){var r=oe;(r.e??(r.e=[])).push({fn:e,effect:L,reaction:N})}else{var i=Ar(e);return i}}function Ro(e){const t=et(Xe,e,!0);return()=>{qe(t)}}function $o(e){const t=et(Xe,e,!0);return(r={})=>new Promise(i=>{r.outro?$r(t,()=>{qe(t),i(void 0)}):(qe(t),i(void 0))})}function Ar(e){return et(an,e,!1)}function Ir(e){return et(Gt,e,!0)}function Re(e,t=[],r=Kt){const i=t.map(r);return mn(()=>e(...i.map(l)))}function mn(e,t=0){return et(Gt|mr|t,e,!0)}function Rr(e,t=!0){return et(Gt|Pe,e,!0,t)}function bn(e){var t=e.teardown;if(t!==null){const r=$t,i=N;Rn(!0),Se(null);try{t.call(null)}finally{Rn(r),Se(i)}}}function wn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&Xe)!==0?r.parent=null:qe(r,t),r=i}}function So(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Pe)===0&&qe(t),t=r}}function qe(e,t=!0){var r=!1;(t||(e.f&uo)!==0)&&e.nodes_start!==null&&(yn(e.nodes_start,e.nodes_end),r=!0),wn(e,t&&!r),nr(e,0),Ee(e,Zt);var i=e.transitions;if(i!==null)for(const o of i)o.stop();bn(e);var a=e.parent;a!==null&&a.first!==null&&En(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function yn(e,t){for(;e!==null;){var r=e===t?null:je(e);e.remove(),e=r}}function En(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 $r(e,t){var r=[];Cn(e,r,!0),To(r,()=>{qe(e),t&&t()})}function To(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var a of e)a.out(i)}else t()}function Cn(e,t,r){if((e.f&ft)===0){if(e.f^=ft,e.transitions!==null)for(const u of e.transitions)(u.is_global||r)&&t.push(u);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&br)!==0||(i.f&Pe)!==0;Cn(i,t,o?r:!1),i=a}}}function xn(e){kn(e,!0)}function kn(e,t){if((e.f&ft)!==0){e.f^=ft,(e.f&fe)===0&&(e.f^=fe),Tt(e)&&(Ee(e,Ie),ir(e));for(var r=e.first;r!==null;){var i=r.next,a=(r.f&br)!==0||(r.f&Pe)!==0;kn(r,a?t:!1),r=i}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}const Do=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let It=[],Rt=[];function An(){var e=It;It=[],on(e)}function In(){var e=Rt;Rt=[],on(e)}function Sr(e){It.length===0&&queueMicrotask(An),It.push(e)}function No(e){Rt.length===0&&Do(In),Rt.push(e)}function Lo(){It.length>0&&An(),Rt.length>0&&In()}let Xt=!1,Qt=!1,er=null,tt=!1,$t=!1;function Rn(e){$t=e}let St=[],Dl=[],N=null,$e=!1;function Se(e){N=e}let L=null;function Be(e){L=e}let ne=null;function $n(e){N!==null&&N.f&wr&&(ne===null?ne=[e]:ne.push(e))}let ie=null,ge=0,me=null;function Po(e){me=e}let Sn=1,tr=0,He=!1;function Tn(){return++Sn}function Tt(e){var h;var t=e.f;if((t&Ie)!==0)return!0;if((t&Qe)!==0){var r=e.deps,i=(t&ve)!==0;if(r!==null){var a,o,u=(t&Wt)!==0,s=i&&L!==null&&!He,c=r.length;if(u||s){var d=e,p=d.parent;for(a=0;a<c;a++)o=r[a],(u||!((h=o==null?void 0:o.reactions)!=null&&h.includes(d)))&&(o.reactions??(o.reactions=[])).push(d);u&&(d.f^=Wt),s&&p!==null&&(p.f&ve)===0&&(d.f^=ve)}for(a=0;a<c;a++)if(o=r[a],Tt(o)&&pn(o),o.wv>e.wv)return!0}(!i||L!==null&&!He)&&Ee(e,fe)}return!1}function Oo(e,t){for(var r=t;r!==null;){if((r.f&Yt)!==0)try{r.fn(e);return}catch{r.f^=Yt}r=r.parent}throw Xt=!1,e}function Dn(e){return(e.f&Zt)===0&&(e.parent===null||(e.parent.f&Yt)===0)}function rr(e,t,r,i){if(Xt){if(r===null&&(Xt=!1),Dn(t))throw e;return}if(r!==null&&(Xt=!0),Oo(e,t),Dn(t))throw e}function Nn(e,t,r=!0){var i=e.reactions;if(i!==null)for(var a=0;a<i.length;a++){var o=i[a];ne!=null&&ne.includes(e)||((o.f&ye)!==0?Nn(o,t,!1):t===o&&(r?Ee(o,Ie):(o.f&fe)!==0&&Ee(o,Qe),ir(o)))}}function Ln(e){var y;var t=ie,r=ge,i=me,a=N,o=He,u=ne,s=oe,c=$e,d=e.f;ie=null,ge=0,me=null,He=(d&ve)!==0&&($e||!tt||N===null),N=(d&(Pe|Xe))===0?e:null,ne=null,Mn(e.ctx),$e=!1,tr++,e.f|=wr;try{var p=(0,e.fn)(),h=e.deps;if(ie!==null){var g;if(nr(e,ge),h!==null&&ge>0)for(h.length=ge+ie.length,g=0;g<ie.length;g++)h[ge+g]=ie[g];else e.deps=h=ie;if(!He)for(g=ge;g<h.length;g++)((y=h[g]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(nr(e,ge),h.length=ge);if(jn()&&me!==null&&!$e&&h!==null&&(e.f&(ye|Qe|Ie))===0)for(g=0;g<me.length;g++)Nn(me[g],e);return a!==null&&a!==e&&(tr++,me!==null&&(i===null?i=me:i.push(...me))),p}finally{ie=t,ge=r,me=i,N=a,He=o,ne=u,Mn(s),$e=c,e.f^=wr}}function Fo(e,t){let r=t.reactions;if(r!==null){var i=ro.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&ye)!==0&&(ie===null||!ie.includes(t))&&(Ee(t,Qe),(t.f&(ve|Wt))===0&&(t.f^=Wt),gn(t),nr(t,0))}function nr(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)Fo(e,r[i])}function Tr(e){var t=e.f;if((t&Zt)===0){Ee(e,fe);var r=L,i=oe,a=tt;L=e,tt=!0;try{(t&mr)!==0?So(e):wn(e),bn(e);var o=Ln(e);e.teardown=typeof o=="function"?o:null,e.wv=Sn;var u=e.deps,s;Qr&&Eo&&e.f&Ie}catch(c){rr(c,e,r,i||e.ctx)}finally{tt=a,L=r}}}function Mo(){try{go()}catch(e){if(er!==null)rr(e,er,null);else throw e}}function Pn(){var e=tt;try{var t=0;for(tt=!0;St.length>0;){t++>1e3&&Mo();var r=St,i=r.length;St=[];for(var a=0;a<i;a++){var o=Uo(r[a]);Vo(o)}Dt.clear()}}finally{Qt=!1,tt=e,er=null}}function Vo(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(Zt|ft))===0)try{Tt(i)&&(Tr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?En(i):i.fn=null))}catch(a){rr(a,i,null,i.ctx)}}}function ir(e){Qt||(Qt=!0,queueMicrotask(Pn));for(var t=er=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Xe|Pe))!==0){if((r&fe)===0)return;t.f^=fe}}St.push(t)}function Uo(e){for(var t=[],r=e;r!==null;){var i=r.f,a=(i&(Pe|Xe))!==0,o=a&&(i&fe)!==0;if(!o&&(i&ft)===0){if((i&an)!==0)t.push(r);else if(a)r.f^=fe;else try{Tt(r)&&Tr(r)}catch(c){rr(c,r,null,r.ctx)}var u=r.first;if(u!==null){r=u;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function k(e){for(var t;;){if(Lo(),St.length===0)return t;Qt=!0,Pn()}}async function Dr(){await Promise.resolve(),k()}function l(e){var t=e.f,r=(t&ye)!==0;if(N!==null&&!$e){if(!(ne!=null&&ne.includes(e))){var i=N.deps;e.rv<tr&&(e.rv=tr,ie===null&&i!==null&&i[ge]===e?ge++:ie===null?ie=[e]:(!He||!ie.includes(e))&&ie.push(e))}}else if(r&&e.deps===null&&e.effects===null){var a=e,o=a.parent;o!==null&&(o.f&ve)===0&&(a.f^=ve)}return r&&(a=e,Tt(a)&&pn(a)),$t&&Dt.has(e)?Dt.get(e):e.v}function rt(e){var t=$e;try{return $e=!0,e()}finally{$e=t}}const jo=-7169;function Ee(e,t){e.f=e.f&jo|t}const Dt=new Map;function On(e,t){var r={f:0,v:e,reactions:null,equals:hn,rv:0,wv:0};return r}function U(e,t){const r=On(e);return $n(r),r}function Nr(e,t=!1){const r=On(e);return t||(r.equals=Cr),r}function b(e,t,r=!1){N!==null&&!$e&&jn()&&(N.f&(ye|mr))!==0&&!(ne!=null&&ne.includes(e))&&wo();let i=r?Ue(t):t;return qo(e,i)}function qo(e,t){if(!e.equals(t)){var r=e.v;$t?Dt.set(e,t):Dt.set(e,r),e.v=t,(e.f&ye)!==0&&((e.f&Ie)!==0&&_n(e),Ee(e,(e.f&ve)===0?fe:Qe)),e.wv=Tn(),Fn(e,Ie),L!==null&&(L.f&fe)!==0&&(L.f&(Pe|Xe))===0&&(me===null?Po([e]):me.push(e))}return t}function Fn(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,a=0;a<i;a++){var o=r[a],u=o.f;(u&Ie)===0&&(Ee(o,t),(u&(fe|ve))!==0&&((u&ye)!==0?Fn(o,Qe):ir(o)))}}let oe=null;function Mn(e){oe=e}function Vn(e,t=!1,r){var i=oe={p:oe,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};xr(()=>{i.d=!0})}function Un(e){const t=oe;if(t!==null){e!==void 0&&(t.x=e);const u=t.e;if(u!==null){var r=L,i=N;t.e=null;try{for(var a=0;a<u.length;a++){var o=u[a];Be(o.effect),Se(o.reaction),Ar(o.fn)}}finally{Be(r),Se(i)}}oe=t.p,t.m=!0}return e||{}}function jn(){return!0}const Bo=["touchstart","touchmove"];function Ho(e){return Bo.includes(e)}function Go(e,t){if(t){const r=document.body;e.autofocus=!0,Sr(()=>{document.activeElement===r&&e.focus()})}}let qn=!1;function Bn(){qn||(qn=!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 Hn(e){var t=N,r=L;Se(null),Be(null);try{return e()}finally{Se(t),Be(r)}}function Yo(e,t,r,i=r){e.addEventListener(t,()=>Hn(r));const a=e.__on_r;a?e.__on_r=()=>{a(),i(!0)}:e.__on_r=()=>i(!0),Bn()}const Gn=new Set,Lr=new Set;function Wo(e,t,r,i={}){function a(o){if(i.capture||Nt.call(t,o),!o.cancelBubble)return Hn(()=>r==null?void 0:r.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Sr(()=>{t.addEventListener(e,a,i)}):t.addEventListener(e,a,i),a}function Ge(e,t,r,i,a){var o={capture:i,passive:a},u=Wo(e,t,r,o);(t===document.body||t===window||t===document)&&xr(()=>{t.removeEventListener(e,u,o)})}function Zo(e){for(var t=0;t<e.length;t++)Gn.add(e[t]);for(var r of Lr)r(e)}function Nt(e){var ee;var t=this,r=t.ownerDocument,i=e.type,a=((ee=e.composedPath)==null?void 0:ee.call(e))||[],o=a[0]||e.target,u=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&&(u=c)}if(o=a[u]||e.target,o!==t){Ct(e,"currentTarget",{configurable:!0,get(){return o||r}});var p=N,h=L;Se(null),Be(null);try{for(var g,y=[];o!==null;){var T=o.assignedSlot||o.parentNode||o.host||null;try{var E=o["__"+i];if(E!=null&&(!o.disabled||e.target===o))if(tn(E)){var[j,..._e]=E;j.apply(o,[e,..._e])}else E.call(o,e)}catch(ae){g?y.push(ae):g=ae}if(e.cancelBubble||T===t||T===null)break;o=T}if(g){for(let ae of y)queueMicrotask(()=>{throw ae});throw g}}finally{e.__root=t,delete e.currentTarget,Se(p),Be(h)}}}function Pr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Te(e,t){var r=L;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Ce(e,t){var r=(t&Qi)!==0,i=(t&eo)!==0,a,o=!e.startsWith("<!>");return()=>{if(F)return Te(M,null),M;a===void 0&&(a=Pr(o?e:"<!>"+e),r||(a=pe(a)));var u=i||fn?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=pe(u),c=u.lastChild;Te(s,c)}else Te(u,u);return u}}function or(e,t,r="svg"){var i=!e.startsWith("<!>"),a=`<${r}>${i?e:"<!>"+e}</${r}>`,o;return()=>{if(F)return Te(M,null),M;if(!o){var u=Pr(a),s=pe(u);o=pe(s)}var c=o.cloneNode(!0);return Te(c,c),c}}function ar(){if(F)return Te(M,null),M;var e=document.createDocumentFragment(),t=document.createComment(""),r=Jt();return e.append(t,r),Te(t,r),e}function q(e,t){if(F){L.nodes_end=M,dt();return}e!==null&&e.before(t)}function zo(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 Yn(e,t){return Wn(e,t)}function Jo(e,t){Er(),t.intro=t.intro??!1;const r=t.target,i=F,a=M;try{for(var o=pe(r);o&&(o.nodeType!==8||o.data!==pr);)o=je(o);if(!o)throw st;ct(!0),Ve(o),dt();const u=Wn(e,{...t,anchor:o});if(M===null||M.nodeType!==8||M.data!==Xr)throw zt(),st;return ct(!1),u}catch(u){if(u===st)return t.recover===!1&&_o(),Er(),Co(r),ct(!1),Yn(e,t);throw u}finally{ct(i),Ve(a)}}const ht=new Map;function Wn(e,{target:t,anchor:r,props:i={},events:a,context:o,intro:u=!0}){Er();var s=new Set,c=h=>{for(var g=0;g<h.length;g++){var y=h[g];if(!s.has(y)){s.add(y);var T=Ho(y);t.addEventListener(y,Nt,{passive:T});var E=ht.get(y);E===void 0?(document.addEventListener(y,Nt,{passive:T}),ht.set(y,1)):ht.set(y,E+1)}}};c(no(Gn)),Lr.add(c);var d=void 0,p=$o(()=>{var h=r??t.appendChild(Jt());return Rr(()=>{if(o){Vn({});var g=oe;g.c=o}a&&(i.$$events=a),F&&Te(h,null),d=e(h,i)||{},F&&(L.nodes_end=M),o&&Un()}),()=>{var T;for(var g of s){t.removeEventListener(g,Nt);var y=ht.get(g);--y===0?(document.removeEventListener(g,Nt),ht.delete(g)):ht.set(g,y)}Lr.delete(c),h!==r&&((T=h.parentNode)==null||T.removeChild(h))}});return Or.set(d,p),d}let Or=new WeakMap;function Ko(e,t){const r=Or.get(e);return r?(Or.delete(e),r(t)):Promise.resolve()}function J(e,t,[r,i]=[0,0]){F&&r===0&&dt();var a=e,o=null,u=null,s=ue,c=r>0?br:0,d=!1;const p=(g,y=!0)=>{d=!0,h(y,g)},h=(g,y)=>{if(s===(s=g))return;let T=!1;if(F&&i!==-1){if(r===0){const j=a.data;j===pr?i=0:j===Kr?i=1/0:(i=parseInt(j.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>r;!!s===E&&(a=yo(),Ve(a),ct(!1),T=!0,i=-1)}s?(o?xn(o):y&&(o=Rr(()=>y(a))),u&&$r(u,()=>{u=null})):(u?xn(u):y&&(u=Rr(()=>y(a,[r+1,i]))),o&&$r(o,()=>{o=null})),T&&ct(!0)};mn(()=>{d=!1,t(p),d||h(null,null)},c),F&&(a=M)}function nt(e,t,r=!1,i=!1,a=!1){var o=e,u="";Re(()=>{var s=L;if(u===(u=t()??"")){F&&dt();return}if(s.nodes_start!==null&&(yn(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),u!==""){if(F){M.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=je(c);if(c===null)throw zt(),st;Te(M,d),o=Ve(c);return}var p=u+"";r?p=`<svg>${p}</svg>`:i&&(p=`<math>${p}</math>`);var h=Pr(p);if((r||i)&&(h=pe(h)),Te(pe(h),h.lastChild),r||i)for(;pe(h);)o.before(pe(h));else o.before(h)}})}function Xo(e,t,r,i,a){var s;F&&dt();var o=(s=t.$$slots)==null?void 0:s[r],u=!1;o===!0&&(o=t.children,u=!0),o===void 0||o(e,u?()=>i:i)}const Zn=[...`
3
- \r\f \v\uFEFF`];function Qo(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 o=a.length,u=0;(u=i.indexOf(a,u))>=0;){var s=u+o;(u===0||Zn.includes(i[u-1]))&&(s===i.length||Zn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function ea(e,t,r,i,a,o){var u=e.__className;if(F||u!==r||u===void 0){var s=Qo(r,i,o);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}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 ta=Symbol("is custom element"),ra=Symbol("is html");function zn(e){if(F){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;P(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;P(e,"checked",null),e.checked=a}}};e.__on_r=r,No(r),Bn()}}function na(e,t){var r=Jn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function P(e,t,r,i){var a=Jn(e);F&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=r)&&(t==="loading"&&(e[fo]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ia(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Jn(e){return e.__attributes??(e.__attributes={[ta]:e.nodeName.includes("-"),[ra]:e.namespaceURI===to})}var Kn=new Map;function ia(e){var t=Kn.get(e.nodeName);if(t)return t;Kn.set(e.nodeName,t=[]);for(var r,i=e,a=Element.prototype;a!==i;){r=io(i);for(var o in r)r[o].set&&t.push(o);i=rn(i)}return t}function oa(e,t,r=t){Yo(e,"change",i=>{var a=i?e.defaultChecked:e.checked;r(a)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),Ir(()=>{var i=t();e.checked=!!i})}function Xn(e,t){return e===t||(e==null?void 0:e[xt])===t}function lr(e={},t,r,i){return Ar(()=>{var a,o;return Ir(()=>{a=o,o=[],rt(()=>{e!==r(...o)&&(t(e,...o),a&&Xn(r(...a),e)&&t(null,...a))})}),()=>{Sr(()=>{o&&Xn(r(...o),e)&&t(null,...o)})}}),e}function Qn(e){oe===null&&en(),kr(()=>{const t=rt(e);if(typeof t=="function")return t})}function aa(e){oe===null&&en(),Qn(()=>()=>rt(e))}function ei(e,t,r){if(e==null)return t(void 0),ut;const i=rt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const vt=[];function la(e,t=ut){let r=null;const i=new Set;function a(s){if(vn(e,s)&&(e=s,r)){const c=!vt.length;for(const d of i)d[1](),vt.push(d,e);if(c){for(let d=0;d<vt.length;d+=2)vt[d][0](vt[d+1]);vt.length=0}}}function o(s){a(s(e))}function u(s,c=ut){const d=[s,c];return i.add(d),i.size===1&&(r=t(a,o)||ut),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:a,update:o,subscribe:u}}function sr(e){let t;return ei(e,r=>t=r)(),t}let ur=!1,Fr=Symbol();function sa(e,t,r){const i=r[t]??(r[t]={store:null,source:Nr(void 0),unsubscribe:ut});if(i.store!==e&&!(Fr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ut;else{var a=!0;i.unsubscribe=ei(e,o=>{a?i.source.v=o:b(i.source,o)}),a=!1}return e&&Fr in r?sr(e):l(i.source)}function ua(){const e={};function t(){xr(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Fr,{enumerable:!1,value:!0})})}return[e,t]}function fa(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ti(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function I(e,t,r,i){var gt;var a=(r&zi)!==0,o=!0,u=(r&Ki)!==0,s=(r&Xi)!==0,c=!1,d;u?[d,c]=fa(()=>e[t]):d=e[t];var p=xt in e||sn in e,h=u&&(((gt=Ke(e,t))==null?void 0:gt.set)??(p&&t in e&&(B=>e[t]=B)))||void 0,g=i,y=!0,T=!1,E=()=>(T=!0,y&&(y=!1,s?g=rt(i):g=i),g);d===void 0&&i!==void 0&&(h&&o&&po(),d=E(),h&&h(d));var j;if(j=()=>{var B=e[t];return B===void 0?E():(y=!0,T=!1,B)},(r&Ji)===0)return j;if(h){var _e=e.$$legacy;return function(B,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?j():B),B):j()}}var ee=!1,ae=Nr(d),te=Kt(()=>{var B=j(),ce=l(ae);return ee?(ee=!1,ce):ae.v=B});return u&&l(te),a||(te.equals=Cr),function(B,ce){if(arguments.length>0){const xe=ce?l(te):u?Ue(B):B;if(!te.equals(xe)){if(ee=!0,b(ae,xe),T&&g!==void 0&&(g=xe),ti(te))return B;rt(()=>l(te))}return B}return ti(te)?te.v:l(te)}}function ca(e){return new da(e)}class da{constructor(t){zr(this,Oe);zr(this,be);var o;var r=new Map,i=(u,s)=>{var c=Nr(s);return r.set(u,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(u,s){return l(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===sn?!0:(l(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return b(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});Jr(this,be,(t.hydrate?Jo:Yn)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&k(),Jr(this,Oe,a.$$events);for(const u of Object.keys(he(this,be)))u==="$set"||u==="$destroy"||u==="$on"||Ct(this,u,{get(){return he(this,be)[u]},set(s){he(this,be)[u]=s},enumerable:!0});he(this,be).$set=u=>{Object.assign(a,u)},he(this,be).$destroy=()=>{Ko(he(this,be))}}$set(t){he(this,be).$set(t)}$on(t,r){he(this,Oe)[t]=he(this,Oe)[t]||[];const i=(...a)=>r.call(this,...a);return he(this,Oe)[t].push(i),()=>{he(this,Oe)[t]=he(this,Oe)[t].filter(a=>a!==i)}}$destroy(){he(this,be).$destroy()}}Oe=new WeakMap,be=new WeakMap;let ri;typeof HTMLElement=="function"&&(ri=class extends HTMLElement{constructor(t,r,i){super();Ae(this,"$$ctor");Ae(this,"$$s");Ae(this,"$$c");Ae(this,"$$cn",!1);Ae(this,"$$d",{});Ae(this,"$$r",!1);Ae(this,"$$p_d",{});Ae(this,"$$l",{});Ae(this,"$$l_u",new Map);Ae(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 o=>{const u=document.createElement("slot");a!=="default"&&(u.name=a),q(o,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=ha(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 o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=fr(o,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=ca({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Ro(()=>{Ir(()=>{var a;this.$$r=!0;for(const o of Ht(this.$$c)){if(!((a=this.$$p_d[o])!=null&&a.reflect))continue;this.$$d[o]=this.$$c[o];const u=fr(o,this.$$d[o],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,u)}this.$$r=!1})});for(const a in this.$$l)for(const o of this.$$l[a]){const u=this.$$c.$on(a,o);this.$$l_u.set(o,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=fr(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 Ht(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function fr(e,t,r,i){var o;const a=(o=r[e])==null?void 0:o.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 ha(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function va(e,t,r,i,a,o){let u=class extends ri{constructor(){super(e,r,a),this.$$p_d=t}static get observedAttributes(){return Ht(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Ht(t).forEach(s=>{Ct(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=fr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var p=(h=Ke(d,s))==null?void 0:h.get;p?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Ct(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ni=new TextEncoder;function ga(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function _a(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const a=await ii(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ii(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 ga(await crypto.subtle.digest(r.toUpperCase(),ni.encode(e+t)))}function pa(e,t,r="SHA-256",i=1e6,a=0){const o=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(o.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:o}}function oi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ma(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 ba(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 wa(e,t="",r=1e6,i=0){const a="AES-GCM",o=new AbortController,u=Date.now(),s=async()=>{for(let p=i;p<=r;p+=1){if(o.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:ba(p)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=ma(e);const p=await crypto.subtle.digest("SHA-256",ni.encode(t));c=await crypto.subtle.importKey("raw",p,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>sr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(sr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(sr(globalThis.altchaI18n.store))},store:la({})};const ya={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",ya);const Mr=(e,t)=>{let r=xo(()=>lo(t==null?void 0:t(),24));var i=ka();Re(()=>{P(i,"width",l(r)),P(i,"height",l(r))}),q(e,i)};function Ea(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function Ca(e,t){e.preventDefault(),t()}function xa(e,t,r,i,a,o,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(l(t))?r()!==!1&&((c=l(i))==null?void 0:c.reportValidity())===!1?b(a,!1):o()?u():s():b(a,!0)}var ka=or('<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>'),Aa=Ce('<input type="hidden">'),Ia=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>'),Ra=or('<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>'),$a=or('<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>'),Sa=or('<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>'),Ta=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Da=Ce("<audio hidden autoplay><source></audio>"),Na=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>'),La=Ce("<div><!></div>"),Pa=Ce("<div><!></div>"),Oa=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>'),Fa=Ce('<div class="altcha-footer"><div><!></div></div>'),Ma=Ce('<div class="altcha-anchor-arrow"></div>'),Va=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function ai(e,t){var Hi,Gi;Vn(t,!0);const[r,i]=ua(),a=()=>sa(ja,"$altchaI18nStore",r);let o=I(t,"auto",7,void 0),u=I(t,"blockspam",7,void 0),s=I(t,"challengeurl",7,void 0),c=I(t,"challengejson",7,void 0),d=I(t,"credentials",7,void 0),p=I(t,"customfetch",7,void 0),h=I(t,"debug",7,!1),g=I(t,"delay",7,0),y=I(t,"disableautofocus",7,!1),T=I(t,"expire",7,void 0),E=I(t,"floating",7,void 0),j=I(t,"floatinganchor",7,void 0),_e=I(t,"floatingoffset",7,void 0),ee=I(t,"floatingpersist",7,!1),ae=I(t,"hidefooter",7,!1),te=I(t,"hidelogo",7,!1),gt=I(t,"id",7,void 0),B=I(t,"language",7,void 0),ce=I(t,"name",7,"altcha"),xe=I(t,"maxnumber",7,1e6),Lt=I(t,"mockerror",7,!1),Ye=I(t,"obfuscated",7,void 0),cr=I(t,"plugins",7,void 0),Pt=I(t,"refetchonexpire",7,!0),it=I(t,"sentinel",7,void 0),De=I(t,"spamfilter",7,!1),_t=I(t,"strings",7,void 0),we=I(t,"test",7,!1),le=I(t,"verifyurl",7,void 0),pt=I(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ot=I(t,"workerurl",7,void 0);const{altchaI18n:Ua}=globalThis,ja=Ua.store,fi=["SHA-256","SHA-384","SHA-512"],qa="https://altcha.org/",We=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},ci=(Gi=(Hi=document.documentElement.lang)==null?void 0:Hi.split("-"))==null?void 0:Gi[0],Vr=At(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),Ur=At(()=>c()?Ai(c()):void 0),Ba=At(()=>_t()?Ai(_t()):{}),V=At(()=>({...gi(a()),...l(Ba)})),di=At(()=>`${gt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Ft=U(!1),Y=U(null),R=U(Ue(C.UNVERIFIED)),se=U(void 0),Mt=U(null),Ze=U(null),jr=U(null),mt=U(null),O=U(null),ot=U(null),Ne=null,K=U(null),at=U(!1),ze=[],qr=U(!1),Fe=U(null);kr(()=>{rl(l(ot))}),kr(()=>{nl(l(R))}),aa(()=>{Ha(),l(O)&&(l(O).removeEventListener("submit",yi),l(O).removeEventListener("reset",Ei),l(O).removeEventListener("focusin",wi),b(O,null)),Ne&&(clearTimeout(Ne),Ne=null),document.removeEventListener("click",mi),document.removeEventListener("scroll",bi),window.removeEventListener("resize",ki)}),Qn(()=>{var n;$("mounted","2.0.0"),$("workers",pt()),Za(),$("plugins",ze.length?ze.map(f=>f.constructor.pluginName).join(", "):"none"),we()&&$("using test mode"),T()&&Br(T()),o()!==void 0&&$("auto",o()),E()!==void 0&&Ri(E()),b(O,(n=l(se))==null?void 0:n.closest("form"),!0),l(O)&&(l(O).addEventListener("submit",yi,{capture:!0}),l(O).addEventListener("reset",Ei),(o()==="onfocus"||ee()==="focus")&&l(O).addEventListener("focusin",wi)),o()==="onload"&&(Ye()?Vt():Me()),l(Vr)&&(ae()||te())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{We("load")})});function dr(n,f){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:f.number,salt:n.salt,signature:n.signature,test:we()?!0:void 0,took:f.took}))}function Ha(){for(const n of ze)n.destroy()}function hi(){s()&&Pt()&&l(R)===C.VERIFIED?Me():bt(C.EXPIRED,l(V).expired)}async function Ga(){var n;if(Lt())throw $("mocking error"),new Error("Mocked error.");if(l(Ur))return $("using provided json data"),l(Ur);if(we())return $("generating test challenge",{test:we()}),_a(typeof we()!="boolean"?+we():void 0);{if(!s()&&l(O)){const A=l(O).getAttribute("action");A!=null&&A.includes("/form/")&&s(A+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:De()!==!1?{"x-altcha-spam-filter":"1"}:{}},v=await vi()(s(),f);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 m=v.headers.get("X-Altcha-Config"),_=await v.json(),x=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),w=x.get("expires")||x.get("expire");if(w){const A=new Date(+w*1e3),H=isNaN(A.getTime())?0:A.getTime()-Date.now();H>0&&Br(H)}if(m)try{const A=JSON.parse(m);A&&typeof A=="object"&&A.verifyurl&&!A.verifyurl.startsWith("javascript:")&&(A.verifyurl=pi(A.verifyurl))}catch(A){$("unable to configure from X-Altcha-Config",A)}return _}}function Ya(n){var v,m;const f=(v=l(O))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function vi(){let n=fetch;if(p())if($("using customfetch"),typeof p()=="string"){if(n=globalThis[p()]||null,!n)throw new Error(`Custom fetch function not found: ${p()}`)}else n=p();return n}function gi(n,f=[B()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(n).map(_=>_.toLowerCase()),m=f.reduce((_,x)=>(x=x.toLowerCase(),_||(n[x]?x:null)||v.find(w=>x.split("-")[0]===w.split("-")[0])||null),null);return n[m||"en"]}function Wa(){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 _i(n){var v;return[...((v=l(O))==null?void 0:v.querySelectorAll(n!=null&&n.length?n.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,_)=>{const x=_.name,w=_.value;return x&&w&&(m[x]=/\n/.test(w)?w.replace(new RegExp("(?<!\\r)\\n","g"),`\r
4
- `):w),m},{})}function pi(n,f){const v=new URL(s()||location.origin),m=new URL(n,v);if(m.search||(m.search=v.search),f)for(const _ in f)f[_]!==void 0&&f[_]!==null&&m.searchParams.set(_,f[_]);return m.toString()}function Za(){const n=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!n||n.includes(f.pluginName))&&ze.push(new f({el:l(se),clarify:Vt,dispatch:We,getConfiguration:Ti,getFloatingAnchor:Di,getState:Ni,log:$,reset:bt,solve:Si,setState:Le,setFloatingAnchor:Pi,verify:Me}))}function $(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function za(){b(K,Q.PAUSED,!0)}function Ja(n){b(K,Q.ERROR,!0)}function Ka(){b(K,Q.READY,!0)}function Xa(){b(K,Q.LOADING,!0)}function Qa(){b(K,Q.PLAYING,!0)}function el(){b(K,Q.PAUSED,!0)}function tl(n){var f;if(n.preventDefault(),n.stopPropagation(),l(Y)){const v=new FormData(n.target),m=String(v.get("code"));if((f=le())!=null&&f.startsWith("javascript:")){const _=le().replace(/^javascript:/,"");if($(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:l(Y).challenge,code:m,solution:l(Y).solution})}b(at,!0),Ii(dr(l(Y).challenge,l(Y).solution),m).then(({reason:_,verified:x})=>{x?(b(Y,null),Le(C.VERIFIED),$("verified"),Dr().then(()=>{var w;(w=l(jr))==null||w.focus(),We("verified",{payload:l(Fe)})})):(bt(),b(ot,_||"Verification failed",!0))}).catch(_=>{b(Y,null),Le(C.ERROR,_),$("sentinel verification failed:",_)}).finally(()=>{b(at,!1)})}}function mi(n){var v;const f=n.target;E()&&f&&!l(se).contains(f)&&(l(R)===C.VERIFIED&&ee()===!1||l(R)===C.VERIFIED&&ee()==="focus"&&!((v=l(O))!=null&&v.matches(":focus-within"))||o()==="off"&&l(R)===C.UNVERIFIED)&&Li()}function bi(){E()&&l(R)!==C.UNVERIFIED&&Ut()}function rl(n){for(const f of ze)typeof f.onErrorChange=="function"&&f.onErrorChange(l(ot))}function wi(n){l(R)===C.UNVERIFIED?Me():E()&&ee()==="focus"&&l(R)===C.VERIFIED&&Hr()}function yi(n){const f=n.target,v=n.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(l(O)&&o()==="onsubmit"?l(R)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Me().then(()=>{ol(v)})):l(R)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),l(R)===C.VERIFYING&&Ci()):l(O)&&E()&&o()==="off"&&l(R)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Hr()))}function Ei(){bt()}function Ci(){l(R)===C.VERIFYING&&l(V).waitAlert&&alert(l(V).waitAlert)}function xi(){l(Ze)?l(Ze).paused?(l(Ze).currentTime=0,l(Ze).play()):l(Ze).pause():(b(qr,!0),requestAnimationFrame(()=>{var n;(n=l(Ze))==null||n.play()}))}function nl(n){for(const f of ze)typeof f.onStateChange=="function"&&f.onStateChange(l(R));E()&&l(R)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Ut()}),b(Ft,l(R)===C.VERIFIED)}function ki(){E()&&Ut()}function Ai(n){return JSON.parse(n)}async function il(n){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",le());const f={payload:n};if(De()!==!1){const{blockedCountries:_,classifier:x,disableRules:w,email:A,expectedLanguages:H,expectedCountries:re,fields:de,ipAddress:Je,text:Yr,timeZone:gr}=Wa();f.blockedCountries=_,f.classifier=x,f.disableRules=w,f.email=A===!1?void 0:Ya(A),f.expectedCountries=re,f.expectedLanguages=H||(ci?[ci]:void 0),f.fields=de===!1?void 0:_i(de),f.ipAddress=Je===!1?void 0:Je||"auto",f.text=Yr,f.timeZone=gr===!1?void 0:gr||oi()}const v=await vi()(le(),{body:JSON.stringify(f),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 m=await v.json();if(m!=null&&m.payload&&b(Fe,m.payload,!0),We("serververification",m),u()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ii(n,f){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",le());const v={code:f,payload:n};it()&&(v.fields=it().fields?_i():void 0,v.timeZone=it().timeZone?oi():void 0);const m=await fetch(le(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!m||!(m instanceof Response))throw new Error("Fetch function did not return a response.");if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const _=await m.json();return _!=null&&_.payload&&b(Fe,_.payload,!0),We("sentinelverification",_),_}function ol(n){var f;l(O)&&"requestSubmit"in l(O)?l(O).requestSubmit(n):(f=l(O))!=null&&f.reportValidity()&&(n?n.click():l(O).submit())}function Br(n){$("expire",n),Ne&&(clearTimeout(Ne),Ne=null),n<1?hi():Ne=setTimeout(hi,n)}function Ri(n){$("floating",n),E()!==n&&(l(se).style.left="",l(se).style.top=""),E(n===!0||n===""?"auto":n===!1||n==="false"?void 0:E()),E()?(o()||o("onsubmit"),document.addEventListener("scroll",bi),document.addEventListener("click",mi),window.addEventListener("resize",ki)):o()==="onsubmit"&&o(void 0)}function $i(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(!fi.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${fi.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 Si(n){let f=null;if("Worker"in window){try{f=await al(n,n.maxNumber||n.maxnumber||xe())}catch(v){$(v)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in n)return{data:n,solution:f}}if("obfuscated"in n){const v=await wa(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await pa(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||xe()).promise}}async function al(n,f=typeof we()=="number"?we():n.maxNumber||n.maxnumber||xe(),v=Math.ceil(pt())){const m=[];v=Math.min(16,f,Math.max(1,v));for(let w=0;w<v;w++)m.push(altchaCreateWorker(Ot()));const _=Math.ceil(f/v),x=await Promise.all(m.map((w,A)=>{const H=A*_;return new Promise(re=>{w.addEventListener("message",de=>{if(de.data)for(const Je of m)Je!==w&&Je.postMessage({type:"abort"});re(de.data)}),w.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const w of m)w.terminate();return x.find(w=>!!w)||null}async function Vt(){if(!Ye()){Le(C.ERROR);return}const n=ze.find(f=>f.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Le(C.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function ll(n){n.obfuscated!==void 0&&Ye(n.obfuscated),n.auto!==void 0&&(o(n.auto),o()==="onload"&&(Ye()?Vt():Me())),n.blockspam!==void 0&&u(!!n.blockspam),n.customfetch!==void 0&&p(n.customfetch),n.floatinganchor!==void 0&&j(n.floatinganchor),n.delay!==void 0&&g(n.delay),n.floatingoffset!==void 0&&_e(n.floatingoffset),n.floating!==void 0&&Ri(n.floating),n.expire!==void 0&&(Br(n.expire),T(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),$i(l(Ur))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&ae(!!n.hidefooter),n.hidelogo!==void 0&&te(!!n.hidelogo),n.language!==void 0&&_t(gi(a(),[n.language])),n.maxnumber!==void 0&&xe(+n.maxnumber),n.mockerror!==void 0&&Lt(!!n.mockerror),n.name!==void 0&&ce(n.name),n.refetchonexpire!==void 0&&Pt(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&De(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&_t(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&we(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&le(n.verifyurl),n.workers!==void 0&&pt(+n.workers),n.workerurl!==void 0&&Ot(n.workerurl)}function Ti(){return{auto:o(),blockspam:u(),challengeurl:s(),debug:h(),delay:g(),expire:T(),floating:E(),floatinganchor:j(),floatingoffset:_e(),hidefooter:ae(),hidelogo:te(),name:ce(),maxnumber:xe(),mockerror:Lt(),obfuscated:Ye(),refetchonexpire:Pt(),spamfilter:De(),strings:l(V),test:we(),verifyurl:le(),workers:pt(),workerurl:Ot()}}function Di(){return l(mt)}function sl(n){return ze.find(f=>f.constructor.pluginName===n)}function Ni(){return l(R)}function Li(){l(se).style.display="none"}function Ut(n=20){var f;if(l(se))if(l(mt)||b(mt,(j()?document.querySelector(j()):(f=l(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(O),!0),l(mt)){const v=parseInt(_e(),10)||12,m=l(mt).getBoundingClientRect(),_=l(se).getBoundingClientRect(),x=document.documentElement.clientHeight,w=document.documentElement.clientWidth,A=E()==="auto"?m.bottom+_.height+v+n>x:E()==="top",H=Math.max(n,Math.min(w-n-_.width,m.left+m.width/2-_.width/2));if(A?l(se).style.top=`${m.top-(_.height+v)}px`:l(se).style.top=`${m.bottom+v}px`,l(se).style.left=`${H}px`,l(se).setAttribute("data-floating",A?"top":"bottom"),l(Mt)){const re=l(Mt).getBoundingClientRect();l(Mt).style.left=m.left-H+m.width/2-re.width/2+"px"}}else $("unable to find floating anchor element")}function bt(n=C.UNVERIFIED,f=null){Ne&&(clearTimeout(Ne),Ne=null),b(Ft,!1),b(Fe,null),b(Y,null),b(qr,!1),b(K,null),Le(n,f)}function Pi(n){b(mt,n,!0)}function Le(n,f=null){b(R,n,!0),b(ot,f,!0),We("statechange",{payload:l(Fe),state:l(R)})}function Hr(){l(se).style.display="block",E()&&Ut()}async function Me(){return bt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),Ga().then(n=>($i(n),$("challenge",n),Si(n))).then(({data:n,solution:f})=>{var v;if($("solution",f),!f||n&&"challenge"in n&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in n)if(le()&&"codeChallenge"in n)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&y()===!1&&document.activeElement.blur(),b(Y,{challenge:n,solution:f},!0);else{if(le()&&it()!==void 0)return Ii(dr(n,f));if(le())return il(dr(n,f));b(Fe,dr(n,f),!0),$("payload",l(Fe))}else throw $("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)?(Le(C.CODE),Dr().then(()=>{We("code",{codeChallenge:l(Y)})})):(Le(C.VERIFIED),$("verified"),Dr().then(()=>{We("verified",{payload:l(Fe)})}))}).catch(n=>{$(n),Le(C.ERROR,n.message)})}var Oi=Va(),Fi=kt(Oi);Xo(Fi,t,"default",{});var jt=z(Fi,2),Gr=Z(jt),hr=Z(Gr);let Mi;var Vi=Z(hr);{var ul=n=>{Mr(n)};J(Vi,n=>{l(R)===C.VERIFYING&&n(ul)})}var lt=z(Vi,2);zn(lt),lt.__change=[xa,R,De,O,Ft,Ye,Vt,Me],lr(lt,n=>b(jr,n),()=>l(jr)),W(hr);var vr=z(hr,2),fl=Z(vr);{var cl=n=>{var f=ar(),v=kt(f);nt(v,()=>l(V).verified),q(n,f)},dl=(n,f)=>{{var v=_=>{var x=ar(),w=kt(x);nt(w,()=>l(V).verifying),q(_,x)},m=(_,x)=>{{var w=H=>{var re=ar(),de=kt(re);nt(de,()=>l(V).verificationRequired),q(H,re)},A=H=>{var re=ar(),de=kt(re);nt(de,()=>l(V).label),q(H,re)};J(_,H=>{l(R)===C.CODE?H(w):H(A,!1)},x)}};J(n,_=>{l(R)===C.VERIFYING?_(v):_(m,!1)},f)}};J(fl,n=>{l(R)===C.VERIFIED?n(cl):n(dl,!1)})}W(vr);var Ui=z(vr,2);{var hl=n=>{var f=Aa();zn(f),Re(()=>{P(f,"name",ce()),na(f,l(Fe))}),q(n,f)};J(Ui,n=>{l(R)===C.VERIFIED&&n(hl)})}var ji=z(Ui,2);{var vl=n=>{var f=Ia(),v=Z(f);P(v,"href",qa),W(f),Re(()=>P(v,"aria-label",l(V).ariaLinkLabel)),q(n,f)};J(ji,n=>{(te()!==!0||l(Vr))&&n(vl)})}var gl=z(ji,2);{var _l=n=>{var f=Na(),v=z(Z(f),2),m=Z(v),_=z(m,2);Go(_,!y()),_.__keydown=[Ea,xi];var x=z(_,2),w=Z(x),A=Z(w);{var H=ke=>{var X=Ta();X.__click=xi;var _r=Z(X);{var qt=wt=>{Mr(wt,()=>20)},xl=(wt,kl)=>{{var Al=yt=>{var Wr=Ra();q(yt,Wr)},Il=(yt,Wr)=>{{var Rl=Et=>{var Zr=$a();q(Et,Zr)},$l=Et=>{var Zr=Sa();q(Et,Zr)};J(yt,Et=>{l(K)===Q.PLAYING?Et(Rl):Et($l,!1)},Wr)}};J(wt,yt=>{l(K)===Q.ERROR?yt(Al):yt(Il,!1)},kl)}};J(_r,wt=>{l(K)===Q.LOADING?wt(qt):wt(xl,!1)})}W(X),Re(()=>{P(X,"title",l(V).getAudioChallenge),X.disabled=l(K)===Q.LOADING||l(K)===Q.ERROR||l(at),P(X,"aria-label",l(K)===Q.LOADING?l(V).loading:l(V).getAudioChallenge)}),q(ke,X)};J(A,ke=>{l(Y).challenge.codeChallenge.audio&&ke(H)})}var re=z(A,2);re.__click=[Ca,Me],W(w);var de=z(w,2),Je=Z(de);{var Yr=ke=>{Mr(ke,()=>16)};J(Je,ke=>{l(at)&&ke(Yr)})}var gr=z(Je);W(de),W(x);var El=z(x,2);{var Cl=ke=>{var X=Da(),_r=Z(X);W(X),lr(X,qt=>b(Ze,qt),()=>l(Ze)),Re(qt=>P(_r,"src",qt),[()=>pi(l(Y).challenge.codeChallenge.audio,{language:B()})]),Ge("loadstart",X,Xa),Ge("canplay",X,Ka),Ge("pause",X,el),Ge("playing",X,Qa),Ge("ended",X,za),Ge("error",_r,Ja),q(ke,X)};J(El,ke=>{l(Y).challenge.codeChallenge.audio&&l(qr)&&ke(Cl)})}W(v),W(f),Re(()=>{P(f,"aria-label",l(V).verificationRequired),P(m,"src",l(Y).challenge.codeChallenge.image),P(_,"minlength",l(Y).challenge.codeChallenge.length||1),P(_,"maxlength",l(Y).challenge.codeChallenge.length),P(_,"placeholder",l(V).enterCode),P(_,"aria-label",l(K)===Q.LOADING?l(V).loading:l(K)===Q.PLAYING?"":l(V).enterCodeAria),P(_,"aria-live",l(K)?"assertive":"polite"),P(_,"aria-busy",l(K)===Q.LOADING),_.disabled=l(at),P(re,"aria-label",l(V).reload),P(re,"title",l(V).reload),re.disabled=l(at),de.disabled=l(at),P(de,"aria-label",l(V).verify),zo(gr,` ${l(V).verify??""}`)}),Ge("submit",v,tl,!0),q(n,f)};J(gl,n=>{var f;(f=l(Y))!=null&&f.challenge.codeChallenge&&n(_l)})}W(Gr);var qi=z(Gr,2);{var pl=n=>{var f=Oa(),v=z(Z(f),2);{var m=x=>{var w=La(),A=Z(w);nt(A,()=>l(V).expired),W(w),Re(()=>P(w,"title",l(ot))),q(x,w)},_=x=>{var w=Pa(),A=Z(w);nt(A,()=>l(V).error),W(w),Re(()=>P(w,"title",l(ot))),q(x,w)};J(v,x=>{l(R)===C.EXPIRED?x(m):x(_,!1)})}W(f),q(n,f)};J(qi,n=>{(l(ot)||l(R)===C.EXPIRED)&&n(pl)})}var Bi=z(qi,2);{var ml=n=>{var f=Fa(),v=Z(f),m=Z(v);nt(m,()=>l(V).footer),W(v),W(f),q(n,f)};J(Bi,n=>{l(V).footer&&(ae()!==!0||l(Vr))&&n(ml)})}var bl=z(Bi,2);{var wl=n=>{var f=Ma();lr(f,v=>b(Mt,v),()=>l(Mt)),q(n,f)};J(bl,n=>{E()&&n(wl)})}W(jt),lr(jt,n=>b(se,n),()=>l(se)),Re(n=>{P(jt,"data-state",l(R)),P(jt,"data-floating",E()),Mi=ea(hr,1,"altcha-checkbox",null,Mi,n),P(lt,"id",l(di)),lt.required=o()!=="onsubmit"&&(!E()||o()!=="off"),P(vr,"for",l(di))},[()=>({"altcha-checkbox-verifying":l(R)===C.VERIFYING})]),Ge("invalid",lt,Ci),oa(lt,()=>l(Ft),n=>b(Ft,n)),q(e,Oi);var yl=Un({clarify:Vt,configure:ll,getConfiguration:Ti,getFloatingAnchor:Di,getPlugin:sl,getState:Ni,hide:Li,repositionFloating:Ut,reset:bt,setFloatingAnchor:Pi,setState:Le,show:Hr,verify:Me,get auto(){return o()},set auto(n=void 0){o(n),k()},get blockspam(){return u()},set blockspam(n=void 0){u(n),k()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),k()},get challengejson(){return c()},set challengejson(n=void 0){c(n),k()},get credentials(){return d()},set credentials(n=void 0){d(n),k()},get customfetch(){return p()},set customfetch(n=void 0){p(n),k()},get debug(){return h()},set debug(n=!1){h(n),k()},get delay(){return g()},set delay(n=0){g(n),k()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),k()},get expire(){return T()},set expire(n=void 0){T(n),k()},get floating(){return E()},set floating(n=void 0){E(n),k()},get floatinganchor(){return j()},set floatinganchor(n=void 0){j(n),k()},get floatingoffset(){return _e()},set floatingoffset(n=void 0){_e(n),k()},get floatingpersist(){return ee()},set floatingpersist(n=!1){ee(n),k()},get hidefooter(){return ae()},set hidefooter(n=!1){ae(n),k()},get hidelogo(){return te()},set hidelogo(n=!1){te(n),k()},get id(){return gt()},set id(n=void 0){gt(n),k()},get language(){return B()},set language(n=void 0){B(n),k()},get name(){return ce()},set name(n="altcha"){ce(n),k()},get maxnumber(){return xe()},set maxnumber(n=1e6){xe(n),k()},get mockerror(){return Lt()},set mockerror(n=!1){Lt(n),k()},get obfuscated(){return Ye()},set obfuscated(n=void 0){Ye(n),k()},get plugins(){return cr()},set plugins(n=void 0){cr(n),k()},get refetchonexpire(){return Pt()},set refetchonexpire(n=!0){Pt(n),k()},get sentinel(){return it()},set sentinel(n=void 0){it(n),k()},get spamfilter(){return De()},set spamfilter(n=!1){De(n),k()},get strings(){return _t()},set strings(n=void 0){_t(n),k()},get test(){return we()},set test(n=!1){we(n),k()},get verifyurl(){return le()},set verifyurl(n=void 0){le(n),k()},get workers(){return pt()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){pt(n),k()},get workerurl(){return Ot()},set workerurl(n=void 0){Ot(n),k()}});return i(),yl}Zo(["change","keydown","click"]),customElements.define("altcha-widget",va(ai,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{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:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1));const li='@keyframes altcha-spinner{to{transform:rotate(360deg)}}.altcha{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:0;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled,.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor!important;opacity:.7}.altcha-footer:hover,.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;justify-content:center;height:24px;position:relative;width:24px}.altcha-checkbox .altcha-spinner{bottom:0;left:0;position:absolute;right:0;top:0}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{appearance:none;opacity:0;pointer-events:none}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}';function si(e,t="__altcha-css"){if(!document.getElementById(t)){const r=document.createElement("style");r.id=t,r.textContent=e,document.head.appendChild(r)}}globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new Bt,si(li),si(li),S.Altcha=ai,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
3
+ \r\f \v\uFEFF`];function Qo(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 o=a.length,u=0;(u=i.indexOf(a,u))>=0;){var s=u+o;(u===0||Zn.includes(i[u-1]))&&(s===i.length||Zn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function ea(e,t,r,i,a,o){var u=e.__className;if(F||u!==r||u===void 0){var s=Qo(r,i,o);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}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 ta=Symbol("is custom element"),ra=Symbol("is html");function zn(e){if(F){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;P(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var a=e.checked;P(e,"checked",null),e.checked=a}}};e.__on_r=r,No(r),Bn()}}function na(e,t){var r=Jn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function P(e,t,r,i){var a=Jn(e);F&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=r)&&(t==="loading"&&(e[fo]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ia(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Jn(e){return e.__attributes??(e.__attributes={[ta]:e.nodeName.includes("-"),[ra]:e.namespaceURI===to})}var Kn=new Map;function ia(e){var t=Kn.get(e.nodeName);if(t)return t;Kn.set(e.nodeName,t=[]);for(var r,i=e,a=Element.prototype;a!==i;){r=io(i);for(var o in r)r[o].set&&t.push(o);i=rn(i)}return t}function oa(e,t,r=t){Yo(e,"change",i=>{var a=i?e.defaultChecked:e.checked;r(a)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),Ir(()=>{var i=t();e.checked=!!i})}function Xn(e,t){return e===t||(e==null?void 0:e[xt])===t}function lr(e={},t,r,i){return Ar(()=>{var a,o;return Ir(()=>{a=o,o=[],rt(()=>{e!==r(...o)&&(t(e,...o),a&&Xn(r(...a),e)&&t(null,...a))})}),()=>{Sr(()=>{o&&Xn(r(...o),e)&&t(null,...o)})}}),e}function Qn(e){oe===null&&en(),kr(()=>{const t=rt(e);if(typeof t=="function")return t})}function aa(e){oe===null&&en(),Qn(()=>()=>rt(e))}function ei(e,t,r){if(e==null)return t(void 0),ut;const i=rt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const vt=[];function la(e,t=ut){let r=null;const i=new Set;function a(s){if(vn(e,s)&&(e=s,r)){const c=!vt.length;for(const d of i)d[1](),vt.push(d,e);if(c){for(let d=0;d<vt.length;d+=2)vt[d][0](vt[d+1]);vt.length=0}}}function o(s){a(s(e))}function u(s,c=ut){const d=[s,c];return i.add(d),i.size===1&&(r=t(a,o)||ut),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:a,update:o,subscribe:u}}function sr(e){let t;return ei(e,r=>t=r)(),t}let ur=!1,Fr=Symbol();function sa(e,t,r){const i=r[t]??(r[t]={store:null,source:Nr(void 0),unsubscribe:ut});if(i.store!==e&&!(Fr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ut;else{var a=!0;i.unsubscribe=ei(e,o=>{a?i.source.v=o:b(i.source,o)}),a=!1}return e&&Fr in r?sr(e):l(i.source)}function ua(){const e={};function t(){xr(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Fr,{enumerable:!1,value:!0})})}return[e,t]}function fa(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ti(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function I(e,t,r,i){var gt;var a=(r&zi)!==0,o=!0,u=(r&Ki)!==0,s=(r&Xi)!==0,c=!1,d;u?[d,c]=fa(()=>e[t]):d=e[t];var p=xt in e||sn in e,h=u&&(((gt=Ke(e,t))==null?void 0:gt.set)??(p&&t in e&&(B=>e[t]=B)))||void 0,g=i,y=!0,T=!1,E=()=>(T=!0,y&&(y=!1,s?g=rt(i):g=i),g);d===void 0&&i!==void 0&&(h&&o&&po(),d=E(),h&&h(d));var j;if(j=()=>{var B=e[t];return B===void 0?E():(y=!0,T=!1,B)},(r&Ji)===0)return j;if(h){var _e=e.$$legacy;return function(B,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?j():B),B):j()}}var ee=!1,ae=Nr(d),te=Kt(()=>{var B=j(),ce=l(ae);return ee?(ee=!1,ce):ae.v=B});return u&&l(te),a||(te.equals=Cr),function(B,ce){if(arguments.length>0){const xe=ce?l(te):u?Ue(B):B;if(!te.equals(xe)){if(ee=!0,b(ae,xe),T&&g!==void 0&&(g=xe),ti(te))return B;rt(()=>l(te))}return B}return ti(te)?te.v:l(te)}}function ca(e){return new da(e)}class da{constructor(t){zr(this,Oe);zr(this,be);var o;var r=new Map,i=(u,s)=>{var c=Nr(s);return r.set(u,c),c};const a=new Proxy({...t.props||{},$$events:{}},{get(u,s){return l(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===sn?!0:(l(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return b(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});Jr(this,be,(t.hydrate?Jo:Yn)(t.component,{target:t.target,anchor:t.anchor,props:a,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&k(),Jr(this,Oe,a.$$events);for(const u of Object.keys(he(this,be)))u==="$set"||u==="$destroy"||u==="$on"||Ct(this,u,{get(){return he(this,be)[u]},set(s){he(this,be)[u]=s},enumerable:!0});he(this,be).$set=u=>{Object.assign(a,u)},he(this,be).$destroy=()=>{Ko(he(this,be))}}$set(t){he(this,be).$set(t)}$on(t,r){he(this,Oe)[t]=he(this,Oe)[t]||[];const i=(...a)=>r.call(this,...a);return he(this,Oe)[t].push(i),()=>{he(this,Oe)[t]=he(this,Oe)[t].filter(a=>a!==i)}}$destroy(){he(this,be).$destroy()}}Oe=new WeakMap,be=new WeakMap;let ri;typeof HTMLElement=="function"&&(ri=class extends HTMLElement{constructor(t,r,i){super();Ae(this,"$$ctor");Ae(this,"$$s");Ae(this,"$$c");Ae(this,"$$cn",!1);Ae(this,"$$d",{});Ae(this,"$$r",!1);Ae(this,"$$p_d",{});Ae(this,"$$l",{});Ae(this,"$$l_u",new Map);Ae(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 o=>{const u=document.createElement("slot");a!=="default"&&(u.name=a),q(o,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=ha(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 o=this.$$g_p(a.name);o in this.$$d||(this.$$d[o]=fr(o,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=ca({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Ro(()=>{Ir(()=>{var a;this.$$r=!0;for(const o of Ht(this.$$c)){if(!((a=this.$$p_d[o])!=null&&a.reflect))continue;this.$$d[o]=this.$$c[o];const u=fr(o,this.$$d[o],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,u)}this.$$r=!1})});for(const a in this.$$l)for(const o of this.$$l[a]){const u=this.$$c.$on(a,o);this.$$l_u.set(o,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var a;this.$$r||(t=this.$$g_p(t),this.$$d[t]=fr(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 Ht(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function fr(e,t,r,i){var o;const a=(o=r[e])==null?void 0:o.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 ha(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function va(e,t,r,i,a,o){let u=class extends ri{constructor(){super(e,r,a),this.$$p_d=t}static get observedAttributes(){return Ht(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Ht(t).forEach(s=>{Ct(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=fr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var p=(h=Ke(d,s))==null?void 0:h.get;p?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Ct(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ni=new TextEncoder;function ga(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function _a(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const a=await ii(i,e,t);return{algorithm:t,challenge:a,salt:i,signature:""}}async function ii(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 ga(await crypto.subtle.digest(r.toUpperCase(),ni.encode(e+t)))}function pa(e,t,r="SHA-256",i=1e6,a=0){const o=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=a;c<=i;c+=1){if(o.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:o}}function oi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ma(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 ba(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 wa(e,t="",r=1e6,i=0){const a="AES-GCM",o=new AbortController,u=Date.now(),s=async()=>{for(let p=i;p<=r;p+=1){if(o.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:a,iv:ba(p)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=ma(e);const p=await crypto.subtle.digest("SHA-256",ni.encode(t));c=await crypto.subtle.importKey("raw",p,a,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>sr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(sr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(sr(globalThis.altchaI18n.store))},store:la({})};const ya={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",ya);const Mr=(e,t)=>{let r=xo(()=>lo(t==null?void 0:t(),24));var i=ka();Re(()=>{P(i,"width",l(r)),P(i,"height",l(r))}),q(e,i)};function Ea(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function Ca(e,t){e.preventDefault(),t()}function xa(e,t,r,i,a,o,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(l(t))?r()!==!1&&((c=l(i))==null?void 0:c.reportValidity())===!1?b(a,!1):o()?u():s():b(a,!0)}var ka=or('<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>'),Aa=Ce('<input type="hidden">'),Ia=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>'),Ra=or('<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>'),$a=or('<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>'),Sa=or('<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>'),Ta=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Da=Ce("<audio hidden autoplay><source></audio>"),Na=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>'),La=Ce("<div><!></div>"),Pa=Ce("<div><!></div>"),Oa=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>'),Fa=Ce('<div class="altcha-footer"><div><!></div></div>'),Ma=Ce('<div class="altcha-anchor-arrow"></div>'),Va=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function ai(e,t){var Hi,Gi;Vn(t,!0);const[r,i]=ua(),a=()=>sa(ja,"$altchaI18nStore",r);let o=I(t,"auto",7,void 0),u=I(t,"blockspam",7,void 0),s=I(t,"challengeurl",7,void 0),c=I(t,"challengejson",7,void 0),d=I(t,"credentials",7,void 0),p=I(t,"customfetch",7,void 0),h=I(t,"debug",7,!1),g=I(t,"delay",7,0),y=I(t,"disableautofocus",7,!1),T=I(t,"expire",7,void 0),E=I(t,"floating",7,void 0),j=I(t,"floatinganchor",7,void 0),_e=I(t,"floatingoffset",7,void 0),ee=I(t,"floatingpersist",7,!1),ae=I(t,"hidefooter",7,!1),te=I(t,"hidelogo",7,!1),gt=I(t,"id",7,void 0),B=I(t,"language",7,void 0),ce=I(t,"name",7,"altcha"),xe=I(t,"maxnumber",7,1e6),Lt=I(t,"mockerror",7,!1),Ye=I(t,"obfuscated",7,void 0),cr=I(t,"plugins",7,void 0),Pt=I(t,"refetchonexpire",7,!0),it=I(t,"sentinel",7,void 0),De=I(t,"spamfilter",7,!1),_t=I(t,"strings",7,void 0),we=I(t,"test",7,!1),le=I(t,"verifyurl",7,void 0),pt=I(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ot=I(t,"workerurl",7,void 0);const{altchaI18n:Ua}=globalThis,ja=Ua.store,fi=["SHA-256","SHA-384","SHA-512"],qa="https://altcha.org/",We=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},ci=(Gi=(Hi=document.documentElement.lang)==null?void 0:Hi.split("-"))==null?void 0:Gi[0],Vr=At(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),Ur=At(()=>c()?Ai(c()):void 0),Ba=At(()=>_t()?Ai(_t()):{}),V=At(()=>({...gi(a()),...l(Ba)})),di=At(()=>`${gt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Ft=U(!1),Y=U(null),R=U(Ue(C.UNVERIFIED)),se=U(void 0),Mt=U(null),Ze=U(null),jr=U(null),mt=U(null),O=U(null),ot=U(null),Ne=null,K=U(null),at=U(!1),ze=[],qr=U(!1),Fe=U(null);kr(()=>{rl(l(ot))}),kr(()=>{nl(l(R))}),aa(()=>{Ha(),l(O)&&(l(O).removeEventListener("submit",yi),l(O).removeEventListener("reset",Ei),l(O).removeEventListener("focusin",wi),b(O,null)),Ne&&(clearTimeout(Ne),Ne=null),document.removeEventListener("click",mi),document.removeEventListener("scroll",bi),window.removeEventListener("resize",ki)}),Qn(()=>{var n;$("mounted","2.0.0"),$("workers",pt()),Za(),$("plugins",ze.length?ze.map(f=>f.constructor.pluginName).join(", "):"none"),we()&&$("using test mode"),T()&&Br(T()),o()!==void 0&&$("auto",o()),E()!==void 0&&Ri(E()),b(O,(n=l(se))==null?void 0:n.closest("form"),!0),l(O)&&(l(O).addEventListener("submit",yi,{capture:!0}),l(O).addEventListener("reset",Ei),(o()==="onfocus"||ee()==="focus")&&l(O).addEventListener("focusin",wi)),o()==="onload"&&(Ye()?Vt():Me()),l(Vr)&&(ae()||te())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{We("load")})});function dr(n,f){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:f.number,salt:n.salt,signature:n.signature,test:we()?!0:void 0,took:f.took}))}function Ha(){for(const n of ze)n.destroy()}function hi(){s()&&Pt()&&l(R)===C.VERIFIED?Me():bt(C.EXPIRED,l(V).expired)}async function Ga(){var n;if(Lt())throw $("mocking error"),new Error("Mocked error.");if(l(Ur))return $("using provided json data"),l(Ur);if(we())return $("generating test challenge",{test:we()}),_a(typeof we()!="boolean"?+we():void 0);{if(!s()&&l(O)){const A=l(O).getAttribute("action");A!=null&&A.includes("/form/")&&s(A+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:De()!==!1?{"x-altcha-spam-filter":"1"}:{}},v=await vi()(s(),f);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 m=v.headers.get("X-Altcha-Config"),_=await v.json(),x=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),w=x.get("expires")||x.get("expire");if(w){const A=new Date(+w*1e3),H=isNaN(A.getTime())?0:A.getTime()-Date.now();H>0&&Br(H)}if(m)try{const A=JSON.parse(m);A&&typeof A=="object"&&A.verifyurl&&!A.verifyurl.startsWith("fn:")&&(A.verifyurl=pi(A.verifyurl))}catch(A){$("unable to configure from X-Altcha-Config",A)}return _}}function Ya(n){var v,m;const f=(v=l(O))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function vi(){let n=fetch;if(p())if($("using customfetch"),typeof p()=="string"){if(n=globalThis[p()]||null,!n)throw new Error(`Custom fetch function not found: ${p()}`)}else n=p();return n}function gi(n,f=[B()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(n).map(_=>_.toLowerCase()),m=f.reduce((_,x)=>(x=x.toLowerCase(),_||(n[x]?x:null)||v.find(w=>x.split("-")[0]===w.split("-")[0])||null),null);return n[m||"en"]}function Wa(){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 _i(n){var v;return[...((v=l(O))==null?void 0:v.querySelectorAll(n!=null&&n.length?n.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,_)=>{const x=_.name,w=_.value;return x&&w&&(m[x]=/\n/.test(w)?w.replace(new RegExp("(?<!\\r)\\n","g"),`\r
4
+ `):w),m},{})}function pi(n,f){const v=new URL(s()||location.origin),m=new URL(n,v);if(m.search||(m.search=v.search),f)for(const _ in f)f[_]!==void 0&&f[_]!==null&&m.searchParams.set(_,f[_]);return m.toString()}function Za(){const n=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!n||n.includes(f.pluginName))&&ze.push(new f({el:l(se),clarify:Vt,dispatch:We,getConfiguration:Ti,getFloatingAnchor:Di,getState:Ni,log:$,reset:bt,solve:Si,setState:Le,setFloatingAnchor:Pi,verify:Me}))}function $(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function za(){b(K,Q.PAUSED,!0)}function Ja(n){b(K,Q.ERROR,!0)}function Ka(){b(K,Q.READY,!0)}function Xa(){b(K,Q.LOADING,!0)}function Qa(){b(K,Q.PLAYING,!0)}function el(){b(K,Q.PAUSED,!0)}function tl(n){var f;if(n.preventDefault(),n.stopPropagation(),l(Y)){const v=new FormData(n.target),m=String(v.get("code"));if((f=le())!=null&&f.startsWith("fn:")){const _=le().replace(/^fn:/,"");if($(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:l(Y).challenge,code:m,solution:l(Y).solution})}b(at,!0),Ii(dr(l(Y).challenge,l(Y).solution),m).then(({reason:_,verified:x})=>{x?(b(Y,null),Le(C.VERIFIED),$("verified"),Dr().then(()=>{var w;(w=l(jr))==null||w.focus(),We("verified",{payload:l(Fe)})})):(bt(),b(ot,_||"Verification failed",!0))}).catch(_=>{b(Y,null),Le(C.ERROR,_),$("sentinel verification failed:",_)}).finally(()=>{b(at,!1)})}}function mi(n){var v;const f=n.target;E()&&f&&!l(se).contains(f)&&(l(R)===C.VERIFIED&&ee()===!1||l(R)===C.VERIFIED&&ee()==="focus"&&!((v=l(O))!=null&&v.matches(":focus-within"))||o()==="off"&&l(R)===C.UNVERIFIED)&&Li()}function bi(){E()&&l(R)!==C.UNVERIFIED&&Ut()}function rl(n){for(const f of ze)typeof f.onErrorChange=="function"&&f.onErrorChange(l(ot))}function wi(n){l(R)===C.UNVERIFIED?Me():E()&&ee()==="focus"&&l(R)===C.VERIFIED&&Hr()}function yi(n){const f=n.target,v=n.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(l(O)&&o()==="onsubmit"?l(R)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Me().then(()=>{ol(v)})):l(R)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),l(R)===C.VERIFYING&&Ci()):l(O)&&E()&&o()==="off"&&l(R)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Hr()))}function Ei(){bt()}function Ci(){l(R)===C.VERIFYING&&l(V).waitAlert&&alert(l(V).waitAlert)}function xi(){l(Ze)?l(Ze).paused?(l(Ze).currentTime=0,l(Ze).play()):l(Ze).pause():(b(qr,!0),requestAnimationFrame(()=>{var n;(n=l(Ze))==null||n.play()}))}function nl(n){for(const f of ze)typeof f.onStateChange=="function"&&f.onStateChange(l(R));E()&&l(R)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Ut()}),b(Ft,l(R)===C.VERIFIED)}function ki(){E()&&Ut()}function Ai(n){return JSON.parse(n)}async function il(n){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",le());const f={payload:n};if(De()!==!1){const{blockedCountries:_,classifier:x,disableRules:w,email:A,expectedLanguages:H,expectedCountries:re,fields:de,ipAddress:Je,text:Yr,timeZone:gr}=Wa();f.blockedCountries=_,f.classifier=x,f.disableRules=w,f.email=A===!1?void 0:Ya(A),f.expectedCountries=re,f.expectedLanguages=H||(ci?[ci]:void 0),f.fields=de===!1?void 0:_i(de),f.ipAddress=Je===!1?void 0:Je||"auto",f.text=Yr,f.timeZone=gr===!1?void 0:gr||oi()}const v=await vi()(le(),{body:JSON.stringify(f),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 m=await v.json();if(m!=null&&m.payload&&b(Fe,m.payload,!0),We("serververification",m),u()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ii(n,f){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",le());const v={code:f,payload:n};it()&&(v.fields=it().fields?_i():void 0,v.timeZone=it().timeZone?oi():void 0);const m=await fetch(le(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!m||!(m instanceof Response))throw new Error("Fetch function did not return a response.");if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const _=await m.json();return _!=null&&_.payload&&b(Fe,_.payload,!0),We("sentinelverification",_),_}function ol(n){var f;l(O)&&"requestSubmit"in l(O)?l(O).requestSubmit(n):(f=l(O))!=null&&f.reportValidity()&&(n?n.click():l(O).submit())}function Br(n){$("expire",n),Ne&&(clearTimeout(Ne),Ne=null),n<1?hi():Ne=setTimeout(hi,n)}function Ri(n){$("floating",n),E()!==n&&(l(se).style.left="",l(se).style.top=""),E(n===!0||n===""?"auto":n===!1||n==="false"?void 0:E()),E()?(o()||o("onsubmit"),document.addEventListener("scroll",bi),document.addEventListener("click",mi),window.addEventListener("resize",ki)):o()==="onsubmit"&&o(void 0)}function $i(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(!fi.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${fi.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 Si(n){let f=null;if("Worker"in window){try{f=await al(n,n.maxNumber||n.maxnumber||xe())}catch(v){$(v)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in n)return{data:n,solution:f}}if("obfuscated"in n){const v=await wa(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await pa(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||xe()).promise}}async function al(n,f=typeof we()=="number"?we():n.maxNumber||n.maxnumber||xe(),v=Math.ceil(pt())){const m=[];v=Math.min(16,f,Math.max(1,v));for(let w=0;w<v;w++)m.push(altchaCreateWorker(Ot()));const _=Math.ceil(f/v),x=await Promise.all(m.map((w,A)=>{const H=A*_;return new Promise(re=>{w.addEventListener("message",de=>{if(de.data)for(const Je of m)Je!==w&&Je.postMessage({type:"abort"});re(de.data)}),w.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const w of m)w.terminate();return x.find(w=>!!w)||null}async function Vt(){if(!Ye()){Le(C.ERROR);return}const n=ze.find(f=>f.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Le(C.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function ll(n){n.obfuscated!==void 0&&Ye(n.obfuscated),n.auto!==void 0&&(o(n.auto),o()==="onload"&&(Ye()?Vt():Me())),n.blockspam!==void 0&&u(!!n.blockspam),n.customfetch!==void 0&&p(n.customfetch),n.floatinganchor!==void 0&&j(n.floatinganchor),n.delay!==void 0&&g(n.delay),n.floatingoffset!==void 0&&_e(n.floatingoffset),n.floating!==void 0&&Ri(n.floating),n.expire!==void 0&&(Br(n.expire),T(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),$i(l(Ur))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&ae(!!n.hidefooter),n.hidelogo!==void 0&&te(!!n.hidelogo),n.language!==void 0&&_t(gi(a(),[n.language])),n.maxnumber!==void 0&&xe(+n.maxnumber),n.mockerror!==void 0&&Lt(!!n.mockerror),n.name!==void 0&&ce(n.name),n.refetchonexpire!==void 0&&Pt(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&De(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&_t(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&we(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&le(n.verifyurl),n.workers!==void 0&&pt(+n.workers),n.workerurl!==void 0&&Ot(n.workerurl)}function Ti(){return{auto:o(),blockspam:u(),challengeurl:s(),debug:h(),delay:g(),expire:T(),floating:E(),floatinganchor:j(),floatingoffset:_e(),hidefooter:ae(),hidelogo:te(),name:ce(),maxnumber:xe(),mockerror:Lt(),obfuscated:Ye(),refetchonexpire:Pt(),spamfilter:De(),strings:l(V),test:we(),verifyurl:le(),workers:pt(),workerurl:Ot()}}function Di(){return l(mt)}function sl(n){return ze.find(f=>f.constructor.pluginName===n)}function Ni(){return l(R)}function Li(){l(se).style.display="none"}function Ut(n=20){var f;if(l(se))if(l(mt)||b(mt,(j()?document.querySelector(j()):(f=l(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||l(O),!0),l(mt)){const v=parseInt(_e(),10)||12,m=l(mt).getBoundingClientRect(),_=l(se).getBoundingClientRect(),x=document.documentElement.clientHeight,w=document.documentElement.clientWidth,A=E()==="auto"?m.bottom+_.height+v+n>x:E()==="top",H=Math.max(n,Math.min(w-n-_.width,m.left+m.width/2-_.width/2));if(A?l(se).style.top=`${m.top-(_.height+v)}px`:l(se).style.top=`${m.bottom+v}px`,l(se).style.left=`${H}px`,l(se).setAttribute("data-floating",A?"top":"bottom"),l(Mt)){const re=l(Mt).getBoundingClientRect();l(Mt).style.left=m.left-H+m.width/2-re.width/2+"px"}}else $("unable to find floating anchor element")}function bt(n=C.UNVERIFIED,f=null){Ne&&(clearTimeout(Ne),Ne=null),b(Ft,!1),b(Fe,null),b(Y,null),b(qr,!1),b(K,null),Le(n,f)}function Pi(n){b(mt,n,!0)}function Le(n,f=null){b(R,n,!0),b(ot,f,!0),We("statechange",{payload:l(Fe),state:l(R)})}function Hr(){l(se).style.display="block",E()&&Ut()}async function Me(){return bt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),Ga().then(n=>($i(n),$("challenge",n),Si(n))).then(({data:n,solution:f})=>{var v;if($("solution",f),!f||n&&"challenge"in n&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in n)if(le()&&"codeChallenge"in n)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&y()===!1&&document.activeElement.blur(),b(Y,{challenge:n,solution:f},!0);else{if(le()&&it()!==void 0)return Ii(dr(n,f));if(le())return il(dr(n,f));b(Fe,dr(n,f),!0),$("payload",l(Fe))}else throw $("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)?(Le(C.CODE),Dr().then(()=>{We("code",{codeChallenge:l(Y)})})):(Le(C.VERIFIED),$("verified"),Dr().then(()=>{We("verified",{payload:l(Fe)})}))}).catch(n=>{$(n),Le(C.ERROR,n.message)})}var Oi=Va(),Fi=kt(Oi);Xo(Fi,t,"default",{});var jt=z(Fi,2),Gr=Z(jt),hr=Z(Gr);let Mi;var Vi=Z(hr);{var ul=n=>{Mr(n)};J(Vi,n=>{l(R)===C.VERIFYING&&n(ul)})}var lt=z(Vi,2);zn(lt),lt.__change=[xa,R,De,O,Ft,Ye,Vt,Me],lr(lt,n=>b(jr,n),()=>l(jr)),W(hr);var vr=z(hr,2),fl=Z(vr);{var cl=n=>{var f=ar(),v=kt(f);nt(v,()=>l(V).verified),q(n,f)},dl=(n,f)=>{{var v=_=>{var x=ar(),w=kt(x);nt(w,()=>l(V).verifying),q(_,x)},m=(_,x)=>{{var w=H=>{var re=ar(),de=kt(re);nt(de,()=>l(V).verificationRequired),q(H,re)},A=H=>{var re=ar(),de=kt(re);nt(de,()=>l(V).label),q(H,re)};J(_,H=>{l(R)===C.CODE?H(w):H(A,!1)},x)}};J(n,_=>{l(R)===C.VERIFYING?_(v):_(m,!1)},f)}};J(fl,n=>{l(R)===C.VERIFIED?n(cl):n(dl,!1)})}W(vr);var Ui=z(vr,2);{var hl=n=>{var f=Aa();zn(f),Re(()=>{P(f,"name",ce()),na(f,l(Fe))}),q(n,f)};J(Ui,n=>{l(R)===C.VERIFIED&&n(hl)})}var ji=z(Ui,2);{var vl=n=>{var f=Ia(),v=Z(f);P(v,"href",qa),W(f),Re(()=>P(v,"aria-label",l(V).ariaLinkLabel)),q(n,f)};J(ji,n=>{(te()!==!0||l(Vr))&&n(vl)})}var gl=z(ji,2);{var _l=n=>{var f=Na(),v=z(Z(f),2),m=Z(v),_=z(m,2);Go(_,!y()),_.__keydown=[Ea,xi];var x=z(_,2),w=Z(x),A=Z(w);{var H=ke=>{var X=Ta();X.__click=xi;var _r=Z(X);{var qt=wt=>{Mr(wt,()=>20)},xl=(wt,kl)=>{{var Al=yt=>{var Wr=Ra();q(yt,Wr)},Il=(yt,Wr)=>{{var Rl=Et=>{var Zr=$a();q(Et,Zr)},$l=Et=>{var Zr=Sa();q(Et,Zr)};J(yt,Et=>{l(K)===Q.PLAYING?Et(Rl):Et($l,!1)},Wr)}};J(wt,yt=>{l(K)===Q.ERROR?yt(Al):yt(Il,!1)},kl)}};J(_r,wt=>{l(K)===Q.LOADING?wt(qt):wt(xl,!1)})}W(X),Re(()=>{P(X,"title",l(V).getAudioChallenge),X.disabled=l(K)===Q.LOADING||l(K)===Q.ERROR||l(at),P(X,"aria-label",l(K)===Q.LOADING?l(V).loading:l(V).getAudioChallenge)}),q(ke,X)};J(A,ke=>{l(Y).challenge.codeChallenge.audio&&ke(H)})}var re=z(A,2);re.__click=[Ca,Me],W(w);var de=z(w,2),Je=Z(de);{var Yr=ke=>{Mr(ke,()=>16)};J(Je,ke=>{l(at)&&ke(Yr)})}var gr=z(Je);W(de),W(x);var El=z(x,2);{var Cl=ke=>{var X=Da(),_r=Z(X);W(X),lr(X,qt=>b(Ze,qt),()=>l(Ze)),Re(qt=>P(_r,"src",qt),[()=>pi(l(Y).challenge.codeChallenge.audio,{language:B()})]),Ge("loadstart",X,Xa),Ge("canplay",X,Ka),Ge("pause",X,el),Ge("playing",X,Qa),Ge("ended",X,za),Ge("error",_r,Ja),q(ke,X)};J(El,ke=>{l(Y).challenge.codeChallenge.audio&&l(qr)&&ke(Cl)})}W(v),W(f),Re(()=>{P(f,"aria-label",l(V).verificationRequired),P(m,"src",l(Y).challenge.codeChallenge.image),P(_,"minlength",l(Y).challenge.codeChallenge.length||1),P(_,"maxlength",l(Y).challenge.codeChallenge.length),P(_,"placeholder",l(V).enterCode),P(_,"aria-label",l(K)===Q.LOADING?l(V).loading:l(K)===Q.PLAYING?"":l(V).enterCodeAria),P(_,"aria-live",l(K)?"assertive":"polite"),P(_,"aria-busy",l(K)===Q.LOADING),_.disabled=l(at),P(re,"aria-label",l(V).reload),P(re,"title",l(V).reload),re.disabled=l(at),de.disabled=l(at),P(de,"aria-label",l(V).verify),zo(gr,` ${l(V).verify??""}`)}),Ge("submit",v,tl,!0),q(n,f)};J(gl,n=>{var f;(f=l(Y))!=null&&f.challenge.codeChallenge&&n(_l)})}W(Gr);var qi=z(Gr,2);{var pl=n=>{var f=Oa(),v=z(Z(f),2);{var m=x=>{var w=La(),A=Z(w);nt(A,()=>l(V).expired),W(w),Re(()=>P(w,"title",l(ot))),q(x,w)},_=x=>{var w=Pa(),A=Z(w);nt(A,()=>l(V).error),W(w),Re(()=>P(w,"title",l(ot))),q(x,w)};J(v,x=>{l(R)===C.EXPIRED?x(m):x(_,!1)})}W(f),q(n,f)};J(qi,n=>{(l(ot)||l(R)===C.EXPIRED)&&n(pl)})}var Bi=z(qi,2);{var ml=n=>{var f=Fa(),v=Z(f),m=Z(v);nt(m,()=>l(V).footer),W(v),W(f),q(n,f)};J(Bi,n=>{l(V).footer&&(ae()!==!0||l(Vr))&&n(ml)})}var bl=z(Bi,2);{var wl=n=>{var f=Ma();lr(f,v=>b(Mt,v),()=>l(Mt)),q(n,f)};J(bl,n=>{E()&&n(wl)})}W(jt),lr(jt,n=>b(se,n),()=>l(se)),Re(n=>{P(jt,"data-state",l(R)),P(jt,"data-floating",E()),Mi=ea(hr,1,"altcha-checkbox",null,Mi,n),P(lt,"id",l(di)),lt.required=o()!=="onsubmit"&&(!E()||o()!=="off"),P(vr,"for",l(di))},[()=>({"altcha-checkbox-verifying":l(R)===C.VERIFYING})]),Ge("invalid",lt,Ci),oa(lt,()=>l(Ft),n=>b(Ft,n)),q(e,Oi);var yl=Un({clarify:Vt,configure:ll,getConfiguration:Ti,getFloatingAnchor:Di,getPlugin:sl,getState:Ni,hide:Li,repositionFloating:Ut,reset:bt,setFloatingAnchor:Pi,setState:Le,show:Hr,verify:Me,get auto(){return o()},set auto(n=void 0){o(n),k()},get blockspam(){return u()},set blockspam(n=void 0){u(n),k()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),k()},get challengejson(){return c()},set challengejson(n=void 0){c(n),k()},get credentials(){return d()},set credentials(n=void 0){d(n),k()},get customfetch(){return p()},set customfetch(n=void 0){p(n),k()},get debug(){return h()},set debug(n=!1){h(n),k()},get delay(){return g()},set delay(n=0){g(n),k()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),k()},get expire(){return T()},set expire(n=void 0){T(n),k()},get floating(){return E()},set floating(n=void 0){E(n),k()},get floatinganchor(){return j()},set floatinganchor(n=void 0){j(n),k()},get floatingoffset(){return _e()},set floatingoffset(n=void 0){_e(n),k()},get floatingpersist(){return ee()},set floatingpersist(n=!1){ee(n),k()},get hidefooter(){return ae()},set hidefooter(n=!1){ae(n),k()},get hidelogo(){return te()},set hidelogo(n=!1){te(n),k()},get id(){return gt()},set id(n=void 0){gt(n),k()},get language(){return B()},set language(n=void 0){B(n),k()},get name(){return ce()},set name(n="altcha"){ce(n),k()},get maxnumber(){return xe()},set maxnumber(n=1e6){xe(n),k()},get mockerror(){return Lt()},set mockerror(n=!1){Lt(n),k()},get obfuscated(){return Ye()},set obfuscated(n=void 0){Ye(n),k()},get plugins(){return cr()},set plugins(n=void 0){cr(n),k()},get refetchonexpire(){return Pt()},set refetchonexpire(n=!0){Pt(n),k()},get sentinel(){return it()},set sentinel(n=void 0){it(n),k()},get spamfilter(){return De()},set spamfilter(n=!1){De(n),k()},get strings(){return _t()},set strings(n=void 0){_t(n),k()},get test(){return we()},set test(n=!1){we(n),k()},get verifyurl(){return le()},set verifyurl(n=void 0){le(n),k()},get workers(){return pt()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){pt(n),k()},get workerurl(){return Ot()},set workerurl(n=void 0){Ot(n),k()}});return i(),yl}Zo(["change","keydown","click"]),customElements.define("altcha-widget",va(ai,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{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:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1));const li='@keyframes altcha-spinner{to{transform:rotate(360deg)}}.altcha{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative}.altcha:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top] .altcha-anchor-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom]:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top]:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating]:not([data-state=unverified]){display:block}.altcha-anchor-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main{align-items:center;display:flex;gap:.4rem;padding:.7rem;position:relative}.altcha-code-challenge{background:var(--altcha-color-base, white);border:1px solid var(--altcha-color-border-focus, currentColor);border-radius:var(--altcha-border-radius, 3px);filter:drop-shadow(3px 3px 6px rgba(0,0,0,.2));padding:.5rem;position:absolute;top:2.5rem;z-index:9999999}.altcha-code-challenge>form{display:flex;flex-direction:column;gap:.5rem}.altcha-code-challenge-input{border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:0;font-size:16px;padding:.35rem;width:220px}.altcha-code-challenge-input:focus{outline:2px solid color-mix(in srgb,var(--altcha-color-active, #1D1DC9) 20%,transparent)}.altcha-code-challenge-input:disabled{opacity:.7}.altcha-code-challenge-image{background-color:#fff;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px}.altcha-code-challenge-audio,.altcha-code-challenge-reload{background:color-mix(in srgb,var(--altcha-color-text, currentColor) 10%,transparent);border:0;border-radius:3px;color:var(--altcha-color-text, currentColor);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:.35rem}.altcha-code-challenge-audio:disabled,.altcha-code-challenge-reload:disabled,.altcha-code-challenge-verify:disabled{opacity:.7;pointer-events:none}.altcha-code-challenge-audio>*,.altcha-code-challenge-reload>*{height:20px;width:20px}.altcha-code-challenge-buttons{display:flex;justify-content:space-between}.altcha-code-challenge-buttons-left{display:flex;gap:.25rem}.altcha-code-challenge-verify{align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:#fff;cursor:pointer;display:flex;gap:.5rem;font-size:100%;padding:.35rem 1rem}.altcha-code-challenge-arrow{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:.15rem;position:absolute;top:-12px;width:0}.altcha[data-floating=top] .altcha-code-challenge{top:-150px}.altcha[data-floating=top] .altcha-code-challenge-arrow{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto}.altcha-label{cursor:pointer;flex-grow:1}.altcha-logo{color:currentColor!important;opacity:.7}.altcha-footer:hover,.altcha-logo:hover{opacity:1}.altcha-error{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:.85rem;gap:.3rem;padding:0 .7rem .7rem}.altcha-footer{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:.75rem;opacity:.7;justify-content:end;padding:.2rem .7rem}.altcha-footer a{color:currentColor}.altcha-checkbox{display:flex;align-items:center;justify-content:center;height:24px;position:relative;width:24px}.altcha-checkbox .altcha-spinner{bottom:0;left:0;position:absolute;right:0;top:0}.altcha-checkbox input{width:18px;height:18px;margin:0}.altcha-checkbox-verifying input{appearance:none;opacity:0;pointer-events:none}.altcha-spinner{animation:altcha-spinner .75s infinite linear;transform-origin:center}';function si(e,t="__altcha-css"){if(!document.getElementById(t)){const r=document.createElement("style");r.id=t,r.textContent=e,document.head.appendChild(r)}}globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new Bt,si(li),si(li),S.Altcha=ai,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
@@ -2157,7 +2157,7 @@ function Ia(e, t) {
2157
2157
  if (b)
2158
2158
  try {
2159
2159
  const I = JSON.parse(b);
2160
- I && typeof I == "object" && I.verifyurl && !I.verifyurl.startsWith("javascript:") && (I.verifyurl = en(I.verifyurl));
2160
+ I && typeof I == "object" && I.verifyurl && !I.verifyurl.startsWith("fn:") && (I.verifyurl = en(I.verifyurl));
2161
2161
  } catch (I) {
2162
2162
  x("unable to configure from X-Altcha-Config", I);
2163
2163
  }
@@ -2278,8 +2278,8 @@ function Ia(e, t) {
2278
2278
  var f;
2279
2279
  if (n.preventDefault(), n.stopPropagation(), a(B)) {
2280
2280
  const v = new FormData(n.target), b = String(v.get("code"));
2281
- if ((f = te()) != null && f.startsWith("javascript:")) {
2282
- const _ = te().replace(/^javascript:/, "");
2281
+ if ((f = te()) != null && f.startsWith("fn:")) {
2282
+ const _ = te().replace(/^fn:/, "");
2283
2283
  if (x(`calling ${_} function instead of verifyurl`), !(_ in globalThis))
2284
2284
  throw new Error(`Global function "${_}" is undefined.`);
2285
2285
  return globalThis[_]({
@@ -1,3 +1,3 @@
1
1
  (function(S,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(S=typeof globalThis<"u"?globalThis:S||self,T(S.altcha={}))})(this,function(S){"use strict";var Ra=Object.defineProperty;var Hi=S=>{throw TypeError(S)};var $a=(S,T,G)=>T in S?Ra(S,T,{enumerable:!0,configurable:!0,writable:!0,value:G}):S[T]=G;var Re=(S,T,G)=>$a(S,typeof T!="symbol"?T+"":T,G),Yi=(S,T,G)=>T.has(S)||Hi("Cannot "+G);var he=(S,T,G)=>(Yi(S,T,"read from private field"),G?G.call(S):T.get(S)),Jr=(S,T,G)=>T.has(S)?Hi("Cannot add the same private member more than once"):T instanceof WeakSet?T.add(S):T.set(S,G),Kr=(S,T,G,Bt)=>(Yi(S,T,"write to private field"),Bt?Bt.call(S,G):T.set(S,G),G);var ai,Oe,we;var T=typeof document<"u"?document.currentScript:null;const G="5";typeof window<"u"&&((ai=window.__svelte??(window.__svelte={})).v??(ai.v=new Set)).add(G);const Bt=1,Gi=4,Zi=8,Wi=16,Ji=1,Ki=2,mr="[",zr="[!",Xr="]",st={},ue=Symbol(),zi="http://www.w3.org/1999/xhtml",Qr=!1;function en(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var tn=Array.isArray,Xi=Array.prototype.indexOf,Qi=Array.from,Ht=Object.keys,Ct=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,el=Object.getOwnPropertyDescriptors,tl=Object.prototype,rl=Array.prototype,rn=Object.getPrototypeOf,nn=Object.isExtensible;const ut=()=>{};function ln(e){for(var t=0;t<e.length;t++)e[t]()}function nl(e,t,r=!1){return e===void 0?r?t():t:e}const ye=2,on=4,Yt=8,br=16,Pe=32,Xe=64,Gt=128,ve=256,Zt=512,fe=1024,$e=2048,Qe=4096,ft=8192,Wt=16384,il=32768,wr=65536,ll=1<<19,an=1<<20,pr=1<<21,At=Symbol("$state"),sn=Symbol("legacy props"),ol=Symbol("");function al(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ul(e){throw new Error("https://svelte.dev/e/effect_orphan")}function fl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function cl(){throw new Error("https://svelte.dev/e/hydration_failed")}function dl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function hl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function vl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function gl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Jt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function ct(e){F=e}let V;function Me(e){if(e===null)throw Jt(),st;return V=e}function dt(){return Me(qe(V))}function Z(e){if(F){if(qe(V)!==null)throw Jt(),st;V=e}}function _l(){for(var e=0,t=V;;){if(t.nodeType===8){var r=t.data;if(r===Xr){if(e===0)return t;e-=1}else(r===mr||r===zr)&&(e+=1)}var i=qe(t);t.remove(),t=i}}let ml=!1;function Ue(e){if(typeof e!="object"||e===null||At in e)return e;const t=rn(e);if(t!==tl&&t!==rl)return e;var r=new Map,i=tn(e),o=U(0),l=D,u=s=>{var c=D;Se(l);var d=s();return Se(c),d};return i&&r.set("length",U(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&hl();var m=r.get(c);return m===void 0?(m=u(()=>U(d.value)),r.set(c,m)):w(m,u(()=>Ue(d.value))),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&(r.set(c,u(()=>U(ue))),yr(o));else{if(i&&typeof c=="string"){var m=r.get("length"),h=Number(c);Number.isInteger(h)&&h<m.v&&w(m,h)}w(d,ue),yr(o)}return!0},get(s,c,d){var y;if(c===At)return e;var m=r.get(c),h=c in s;if(m===void 0&&(!h||(y=ze(s,c))!=null&&y.writable)&&(m=u(()=>U(Ue(h?s[c]:ue))),r.set(c,m)),m!==void 0){var g=a(m);return g===ue?void 0:g}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var m=r.get(c);m&&(d.value=a(m))}else if(d===void 0){var h=r.get(c),g=h==null?void 0:h.v;if(h!==void 0&&g!==ue)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return d},has(s,c){var g;if(c===At)return!0;var d=r.get(c),m=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||L!==null&&(!m||(g=ze(s,c))!=null&&g.writable)){d===void 0&&(d=u(()=>U(m?Ue(s[c]):ue)),r.set(c,d));var h=a(d);if(h===ue)return!1}return m},set(s,c,d,m){var ee;var h=r.get(c),g=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var N=r.get(y+"");N!==void 0?w(N,ue):y in s&&(N=u(()=>U(ue)),r.set(y+"",N))}h===void 0?(!g||(ee=ze(s,c))!=null&&ee.writable)&&(h=u(()=>U(void 0)),w(h,u(()=>Ue(d))),r.set(c,h)):(g=h.v!==ue,w(h,u(()=>Ue(d))));var E=Reflect.getOwnPropertyDescriptor(s,c);if(E!=null&&E.set&&E.set.call(m,d),!g){if(i&&typeof c=="string"){var q=r.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=q.v&&w(q,_e+1)}yr(o)}return!0},ownKeys(s){a(o);var c=Reflect.ownKeys(s).filter(h=>{var g=r.get(h);return g===void 0||g.v!==ue});for(var[d,m]of r)m.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){vl()}})}function yr(e,t=1){w(e,e.v+t)}var un,fn,cn,dn;function Er(){if(un===void 0){un=window,fn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;cn=ze(t,"firstChild").get,dn=ze(t,"nextSibling").get,nn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),nn(r)&&(r.__t=void 0)}}function Kt(e=""){return document.createTextNode(e)}function me(e){return cn.call(e)}function qe(e){return dn.call(e)}function W(e,t){if(!F)return me(e);var r=me(V);return r===null&&(r=V.appendChild(Kt())),Me(r),r}function It(e,t){if(!F){var r=me(e);return r instanceof Comment&&r.data===""?qe(r):r}return V}function J(e,t=1,r=!1){let i=F?V:e;for(var o;t--;)o=i,i=qe(i);if(!F)return i;var l=i==null?void 0:i.nodeType;if(r&&l!==3){var u=Kt();return i===null?o==null||o.after(u):i.before(u),Me(u),u}return Me(i),i}function bl(e){e.textContent=""}function hn(e){return e===this.v}function vn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Cr(e){return!vn(e,this.v)}function zt(e){var t=ye|$e,r=D!==null&&(D.f&ye)!==0?D:null;return L===null||r!==null&&(r.f&ve)!==0?t|=ve:L.f|=an,{ctx:le,deps:null,effects:null,equals:hn,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function Rt(e){const t=zt(e);return xn(t),t}function wl(e){const t=zt(e);return t.equals=Cr,t}function gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)je(t[r])}}function pl(e){for(var t=e.parent;t!==null;){if((t.f&ye)===0)return t;t=t.parent}return null}function _n(e){var t,r=L;Be(pl(e));try{gn(e),t=Ln(e)}finally{Be(r)}return t}function mn(e){var t=_n(e),r=(He||(e.f&ve)!==0)&&e.deps!==null?Qe:fe;Ee(e,r),e.equals(t)||(e.v=t,e.wv=Tn())}function yl(e){L===null&&D===null&&ul(),D!==null&&(D.f&ve)!==0&&L===null&&sl(),xt&&al()}function El(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function et(e,t,r,i=!0){var o=L,l={ctx:le,deps:null,nodes_start:null,nodes_end:null,f:e|$e,first:null,fn:t,last:null,next:null,parent:o,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Tr(l),l.f|=il}catch(c){throw je(l),c}else t!==null&&ir(l);var u=r&&l.deps===null&&l.first===null&&l.nodes_start===null&&l.teardown===null&&(l.f&(an|Gt))===0;if(!u&&i&&(o!==null&&El(l,o),D!==null&&(D.f&ye)!==0)){var s=D;(s.effects??(s.effects=[])).push(l)}return l}function Ar(e){const t=et(Yt,null,!1);return Ee(t,fe),t.teardown=e,t}function Ir(e){yl();var t=L!==null&&(L.f&Pe)!==0&&le!==null&&!le.m;if(t){var r=le;(r.e??(r.e=[])).push({fn:e,effect:L,reaction:D})}else{var i=Rr(e);return i}}function Cl(e){const t=et(Xe,e,!0);return()=>{je(t)}}function Al(e){const t=et(Xe,e,!0);return(r={})=>new Promise(i=>{r.outro?xr(t,()=>{je(t),i(void 0)}):(je(t),i(void 0))})}function Rr(e){return et(on,e,!1)}function $r(e){return et(Yt,e,!0)}function ke(e,t=[],r=zt){const i=t.map(r);return bn(()=>e(...i.map(a)))}function bn(e,t=0){return et(Yt|br|t,e,!0)}function kr(e,t=!0){return et(Yt|Pe,e,!0,t)}function wn(e){var t=e.teardown;if(t!==null){const r=xt,i=D;kn(!0),Se(null);try{t.call(null)}finally{kn(r),Se(i)}}}function pn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&Xe)!==0?r.parent=null:je(r,t),r=i}}function Il(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Pe)===0&&je(t),t=r}}function je(e,t=!0){var r=!1;(t||(e.f&ll)!==0)&&e.nodes_start!==null&&(yn(e.nodes_start,e.nodes_end),r=!0),pn(e,t&&!r),nr(e,0),Ee(e,Wt);var i=e.transitions;if(i!==null)for(const l of i)l.stop();wn(e);var o=e.parent;o!==null&&o.first!==null&&En(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function yn(e,t){for(;e!==null;){var r=e===t?null:qe(e);e.remove(),e=r}}function En(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 xr(e,t){var r=[];Cn(e,r,!0),Rl(r,()=>{je(e),t&&t()})}function Rl(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var o of e)o.out(i)}else t()}function Cn(e,t,r){if((e.f&ft)===0){if(e.f^=ft,e.transitions!==null)for(const u of e.transitions)(u.is_global||r)&&t.push(u);for(var i=e.first;i!==null;){var o=i.next,l=(i.f&wr)!==0||(i.f&Pe)!==0;Cn(i,t,l?r:!1),i=o}}}function An(e){In(e,!0)}function In(e,t){if((e.f&ft)!==0){e.f^=ft,(e.f&fe)===0&&(e.f^=fe),Tt(e)&&(Ee(e,$e),ir(e));for(var r=e.first;r!==null;){var i=r.next,o=(r.f&wr)!==0||(r.f&Pe)!==0;In(r,o?t:!1),r=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const $l=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let $t=[],kt=[];function Rn(){var e=$t;$t=[],ln(e)}function $n(){var e=kt;kt=[],ln(e)}function Sr(e){$t.length===0&&queueMicrotask(Rn),$t.push(e)}function kl(e){kt.length===0&&$l($n),kt.push(e)}function xl(){$t.length>0&&Rn(),kt.length>0&&$n()}let Xt=!1,Qt=!1,er=null,tt=!1,xt=!1;function kn(e){xt=e}let St=[],ka=[],D=null,xe=!1;function Se(e){D=e}let L=null;function Be(e){L=e}let ne=null;function xn(e){D!==null&&D.f&pr&&(ne===null?ne=[e]:ne.push(e))}let ie=null,ge=0,be=null;function Sl(e){be=e}let Sn=1,tr=0,He=!1;function Tn(){return++Sn}function Tt(e){var h;var t=e.f;if((t&$e)!==0)return!0;if((t&Qe)!==0){var r=e.deps,i=(t&ve)!==0;if(r!==null){var o,l,u=(t&Zt)!==0,s=i&&L!==null&&!He,c=r.length;if(u||s){var d=e,m=d.parent;for(o=0;o<c;o++)l=r[o],(u||!((h=l==null?void 0:l.reactions)!=null&&h.includes(d)))&&(l.reactions??(l.reactions=[])).push(d);u&&(d.f^=Zt),s&&m!==null&&(m.f&ve)===0&&(d.f^=ve)}for(o=0;o<c;o++)if(l=r[o],Tt(l)&&mn(l),l.wv>e.wv)return!0}(!i||L!==null&&!He)&&Ee(e,fe)}return!1}function Tl(e,t){for(var r=t;r!==null;){if((r.f&Gt)!==0)try{r.fn(e);return}catch{r.f^=Gt}r=r.parent}throw Xt=!1,e}function Nn(e){return(e.f&Wt)===0&&(e.parent===null||(e.parent.f&Gt)===0)}function rr(e,t,r,i){if(Xt){if(r===null&&(Xt=!1),Nn(t))throw e;return}if(r!==null&&(Xt=!0),Tl(e,t),Nn(t))throw e}function Dn(e,t,r=!0){var i=e.reactions;if(i!==null)for(var o=0;o<i.length;o++){var l=i[o];ne!=null&&ne.includes(e)||((l.f&ye)!==0?Dn(l,t,!1):t===l&&(r?Ee(l,$e):(l.f&fe)!==0&&Ee(l,Qe),ir(l)))}}function Ln(e){var y;var t=ie,r=ge,i=be,o=D,l=He,u=ne,s=le,c=xe,d=e.f;ie=null,ge=0,be=null,He=(d&ve)!==0&&(xe||!tt||D===null),D=(d&(Pe|Xe))===0?e:null,ne=null,Vn(e.ctx),xe=!1,tr++,e.f|=pr;try{var m=(0,e.fn)(),h=e.deps;if(ie!==null){var g;if(nr(e,ge),h!==null&&ge>0)for(h.length=ge+ie.length,g=0;g<ie.length;g++)h[ge+g]=ie[g];else e.deps=h=ie;if(!He)for(g=ge;g<h.length;g++)((y=h[g]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(nr(e,ge),h.length=ge);if(qn()&&be!==null&&!xe&&h!==null&&(e.f&(ye|Qe|$e))===0)for(g=0;g<be.length;g++)Dn(be[g],e);return o!==null&&o!==e&&(tr++,be!==null&&(i===null?i=be:i.push(...be))),m}finally{ie=t,ge=r,be=i,D=o,He=l,ne=u,Vn(s),xe=c,e.f^=pr}}function Nl(e,t){let r=t.reactions;if(r!==null){var i=Xi.call(r,e);if(i!==-1){var o=r.length-1;o===0?r=t.reactions=null:(r[i]=r[o],r.pop())}}r===null&&(t.f&ye)!==0&&(ie===null||!ie.includes(t))&&(Ee(t,Qe),(t.f&(ve|Zt))===0&&(t.f^=Zt),gn(t),nr(t,0))}function nr(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)Nl(e,r[i])}function Tr(e){var t=e.f;if((t&Wt)===0){Ee(e,fe);var r=L,i=le,o=tt;L=e,tt=!0;try{(t&br)!==0?Il(e):pn(e),wn(e);var l=Ln(e);e.teardown=typeof l=="function"?l:null,e.wv=Sn;var u=e.deps,s;Qr&&ml&&e.f&$e}catch(c){rr(c,e,r,i||e.ctx)}finally{tt=o,L=r}}}function Dl(){try{fl()}catch(e){if(er!==null)rr(e,er,null);else throw e}}function Pn(){var e=tt;try{var t=0;for(tt=!0;St.length>0;){t++>1e3&&Dl();var r=St,i=r.length;St=[];for(var o=0;o<i;o++){var l=Pl(r[o]);Ll(l)}Nt.clear()}}finally{Qt=!1,tt=e,er=null}}function Ll(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(Wt|ft))===0)try{Tt(i)&&(Tr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?En(i):i.fn=null))}catch(o){rr(o,i,null,i.ctx)}}}function ir(e){Qt||(Qt=!0,queueMicrotask(Pn));for(var t=er=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Xe|Pe))!==0){if((r&fe)===0)return;t.f^=fe}}St.push(t)}function Pl(e){for(var t=[],r=e;r!==null;){var i=r.f,o=(i&(Pe|Xe))!==0,l=o&&(i&fe)!==0;if(!l&&(i&ft)===0){if((i&on)!==0)t.push(r);else if(o)r.f^=fe;else try{Tt(r)&&Tr(r)}catch(c){rr(c,r,null,r.ctx)}var u=r.first;if(u!==null){r=u;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function I(e){for(var t;;){if(xl(),St.length===0)return t;Qt=!0,Pn()}}async function Nr(){await Promise.resolve(),I()}function a(e){var t=e.f,r=(t&ye)!==0;if(D!==null&&!xe){if(!(ne!=null&&ne.includes(e))){var i=D.deps;e.rv<tr&&(e.rv=tr,ie===null&&i!==null&&i[ge]===e?ge++:ie===null?ie=[e]:(!He||!ie.includes(e))&&ie.push(e))}}else if(r&&e.deps===null&&e.effects===null){var o=e,l=o.parent;l!==null&&(l.f&ve)===0&&(o.f^=ve)}return r&&(o=e,Tt(o)&&mn(o)),xt&&Nt.has(e)?Nt.get(e):e.v}function rt(e){var t=xe;try{return xe=!0,e()}finally{xe=t}}const Ol=-7169;function Ee(e,t){e.f=e.f&Ol|t}const Nt=new Map;function On(e,t){var r={f:0,v:e,reactions:null,equals:hn,rv:0,wv:0};return r}function U(e,t){const r=On(e);return xn(r),r}function Dr(e,t=!1){const r=On(e);return t||(r.equals=Cr),r}function w(e,t,r=!1){D!==null&&!xe&&qn()&&(D.f&(ye|br))!==0&&!(ne!=null&&ne.includes(e))&&gl();let i=r?Ue(t):t;return Fl(e,i)}function Fl(e,t){if(!e.equals(t)){var r=e.v;xt?Nt.set(e,t):Nt.set(e,r),e.v=t,(e.f&ye)!==0&&((e.f&$e)!==0&&_n(e),Ee(e,(e.f&ve)===0?fe:Qe)),e.wv=Tn(),Fn(e,$e),L!==null&&(L.f&fe)!==0&&(L.f&(Pe|Xe))===0&&(be===null?Sl([e]):be.push(e))}return t}function Fn(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,o=0;o<i;o++){var l=r[o],u=l.f;(u&$e)===0&&(Ee(l,t),(u&(fe|ve))!==0&&((u&ye)!==0?Fn(l,Qe):ir(l)))}}let le=null;function Vn(e){le=e}function Mn(e,t=!1,r){var i=le={p:le,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Ar(()=>{i.d=!0})}function Un(e){const t=le;if(t!==null){e!==void 0&&(t.x=e);const u=t.e;if(u!==null){var r=L,i=D;t.e=null;try{for(var o=0;o<u.length;o++){var l=u[o];Be(l.effect),Se(l.reaction),Rr(l.fn)}}finally{Be(r),Se(i)}}le=t.p,t.m=!0}return e||{}}function qn(){return!0}const Vl=["touchstart","touchmove"];function Ml(e){return Vl.includes(e)}function Ul(e,t){if(t){const r=document.body;e.autofocus=!0,Sr(()=>{document.activeElement===r&&e.focus()})}}let jn=!1;function Bn(){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 Hn(e){var t=D,r=L;Se(null),Be(null);try{return e()}finally{Se(t),Be(r)}}function ql(e,t,r,i=r){e.addEventListener(t,()=>Hn(r));const o=e.__on_r;o?e.__on_r=()=>{o(),i(!0)}:e.__on_r=()=>i(!0),Bn()}const Yn=new Set,Lr=new Set;function jl(e,t,r,i={}){function o(l){if(i.capture||Dt.call(t,l),!l.cancelBubble)return Hn(()=>r==null?void 0:r.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Sr(()=>{t.addEventListener(e,o,i)}):t.addEventListener(e,o,i),o}function Ye(e,t,r,i,o){var l={capture:i,passive:o},u=jl(e,t,r,l);(t===document.body||t===window||t===document)&&Ar(()=>{t.removeEventListener(e,u,l)})}function Bl(e){for(var t=0;t<e.length;t++)Yn.add(e[t]);for(var r of Lr)r(e)}function Dt(e){var ee;var t=this,r=t.ownerDocument,i=e.type,o=((ee=e.composedPath)==null?void 0:ee.call(e))||[],l=o[0]||e.target,u=0,s=e.__root;if(s){var c=o.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=o.indexOf(t);if(d===-1)return;c<=d&&(u=c)}if(l=o[u]||e.target,l!==t){Ct(e,"currentTarget",{configurable:!0,get(){return l||r}});var m=D,h=L;Se(null),Be(null);try{for(var g,y=[];l!==null;){var N=l.assignedSlot||l.parentNode||l.host||null;try{var E=l["__"+i];if(E!=null&&(!l.disabled||e.target===l))if(tn(E)){var[q,..._e]=E;q.apply(l,[e,..._e])}else E.call(l,e)}catch(oe){g?y.push(oe):g=oe}if(e.cancelBubble||N===t||N===null)break;l=N}if(g){for(let oe of y)queueMicrotask(()=>{throw oe});throw g}}finally{e.__root=t,delete e.currentTarget,Se(m),Be(h)}}}function Pr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Te(e,t){var r=L;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Ce(e,t){var r=(t&Ji)!==0,i=(t&Ki)!==0,o,l=!e.startsWith("<!>");return()=>{if(F)return Te(V,null),V;o===void 0&&(o=Pr(l?e:"<!>"+e),r||(o=me(o)));var u=i||fn?document.importNode(o,!0):o.cloneNode(!0);if(r){var s=me(u),c=u.lastChild;Te(s,c)}else Te(u,u);return u}}function lr(e,t,r="svg"){var i=!e.startsWith("<!>"),o=`<${r}>${i?e:"<!>"+e}</${r}>`,l;return()=>{if(F)return Te(V,null),V;if(!l){var u=Pr(o),s=me(u);l=me(s)}var c=l.cloneNode(!0);return Te(c,c),c}}function or(){if(F)return Te(V,null),V;var e=document.createDocumentFragment(),t=document.createComment(""),r=Kt();return e.append(t,r),Te(t,r),e}function j(e,t){if(F){L.nodes_end=V,dt();return}e!==null&&e.before(t)}function Hl(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 Gn(e,t){return Zn(e,t)}function Yl(e,t){Er(),t.intro=t.intro??!1;const r=t.target,i=F,o=V;try{for(var l=me(r);l&&(l.nodeType!==8||l.data!==mr);)l=qe(l);if(!l)throw st;ct(!0),Me(l),dt();const u=Zn(e,{...t,anchor:l});if(V===null||V.nodeType!==8||V.data!==Xr)throw Jt(),st;return ct(!1),u}catch(u){if(u===st)return t.recover===!1&&cl(),Er(),bl(r),ct(!1),Gn(e,t);throw u}finally{ct(i),Me(o)}}const ht=new Map;function Zn(e,{target:t,anchor:r,props:i={},events:o,context:l,intro:u=!0}){Er();var s=new Set,c=h=>{for(var g=0;g<h.length;g++){var y=h[g];if(!s.has(y)){s.add(y);var N=Ml(y);t.addEventListener(y,Dt,{passive:N});var E=ht.get(y);E===void 0?(document.addEventListener(y,Dt,{passive:N}),ht.set(y,1)):ht.set(y,E+1)}}};c(Qi(Yn)),Lr.add(c);var d=void 0,m=Al(()=>{var h=r??t.appendChild(Kt());return kr(()=>{if(l){Mn({});var g=le;g.c=l}o&&(i.$$events=o),F&&Te(h,null),d=e(h,i)||{},F&&(L.nodes_end=V),l&&Un()}),()=>{var N;for(var g of s){t.removeEventListener(g,Dt);var y=ht.get(g);--y===0?(document.removeEventListener(g,Dt),ht.delete(g)):ht.set(g,y)}Lr.delete(c),h!==r&&((N=h.parentNode)==null||N.removeChild(h))}});return Or.set(d,m),d}let Or=new WeakMap;function Gl(e,t){const r=Or.get(e);return r?(Or.delete(e),r(t)):Promise.resolve()}function K(e,t,[r,i]=[0,0]){F&&r===0&&dt();var o=e,l=null,u=null,s=ue,c=r>0?wr:0,d=!1;const m=(g,y=!0)=>{d=!0,h(y,g)},h=(g,y)=>{if(s===(s=g))return;let N=!1;if(F&&i!==-1){if(r===0){const q=o.data;q===mr?i=0:q===zr?i=1/0:(i=parseInt(q.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>r;!!s===E&&(o=_l(),Me(o),ct(!1),N=!0,i=-1)}s?(l?An(l):y&&(l=kr(()=>y(o))),u&&xr(u,()=>{u=null})):(u?An(u):y&&(u=kr(()=>y(o,[r+1,i]))),l&&xr(l,()=>{l=null})),N&&ct(!0)};bn(()=>{d=!1,t(m),d||h(null,null)},c),F&&(o=V)}function nt(e,t,r=!1,i=!1,o=!1){var l=e,u="";ke(()=>{var s=L;if(u===(u=t()??"")){F&&dt();return}if(s.nodes_start!==null&&(yn(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),u!==""){if(F){V.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=qe(c);if(c===null)throw Jt(),st;Te(V,d),l=Me(c);return}var m=u+"";r?m=`<svg>${m}</svg>`:i&&(m=`<math>${m}</math>`);var h=Pr(m);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 Zl(e,t,r,i,o){var s;F&&dt();var l=(s=t.$$slots)==null?void 0:s[r],u=!1;l===!0&&(l=t.children,u=!0),l===void 0||l(e,u?()=>i:i)}const Wn=[...`
2
- \r\f \v\uFEFF`];function Wl(e,t,r){var i=""+e;if(r){for(var o in r)if(r[o])i=i?i+" "+o:o;else if(i.length)for(var l=o.length,u=0;(u=i.indexOf(o,u))>=0;){var s=u+l;(u===0||Wn.includes(i[u-1]))&&(s===i.length||Wn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function Jl(e,t,r,i,o,l){var u=e.__className;if(F||u!==r||u===void 0){var s=Wl(r,i,l);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}else if(l&&o!==l)for(var c in l){var d=!!l[c];(o==null||d!==!!o[c])&&e.classList.toggle(c,d)}return l}const Kl=Symbol("is custom element"),zl=Symbol("is html");function Jn(e){if(F){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;P(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var o=e.checked;P(e,"checked",null),e.checked=o}}};e.__on_r=r,kl(r),Bn()}}function Xl(e,t){var r=Kn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function P(e,t,r,i){var o=Kn(e);F&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=r)&&(t==="loading"&&(e[ol]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ql(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Kn(e){return e.__attributes??(e.__attributes={[Kl]:e.nodeName.includes("-"),[zl]:e.namespaceURI===zi})}var zn=new Map;function Ql(e){var t=zn.get(e.nodeName);if(t)return t;zn.set(e.nodeName,t=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=el(i);for(var l in r)r[l].set&&t.push(l);i=rn(i)}return t}function eo(e,t,r=t){ql(e,"change",i=>{var o=i?e.defaultChecked:e.checked;r(o)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),$r(()=>{var i=t();e.checked=!!i})}function Xn(e,t){return e===t||(e==null?void 0:e[At])===t}function ar(e={},t,r,i){return Rr(()=>{var o,l;return $r(()=>{o=l,l=[],rt(()=>{e!==r(...l)&&(t(e,...l),o&&Xn(r(...o),e)&&t(null,...o))})}),()=>{Sr(()=>{l&&Xn(r(...l),e)&&t(null,...l)})}}),e}function Qn(e){le===null&&en(),Ir(()=>{const t=rt(e);if(typeof t=="function")return t})}function to(e){le===null&&en(),Qn(()=>()=>rt(e))}function ei(e,t,r){if(e==null)return t(void 0),ut;const i=rt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const vt=[];function ro(e,t=ut){let r=null;const i=new Set;function o(s){if(vn(e,s)&&(e=s,r)){const c=!vt.length;for(const d of i)d[1](),vt.push(d,e);if(c){for(let d=0;d<vt.length;d+=2)vt[d][0](vt[d+1]);vt.length=0}}}function l(s){o(s(e))}function u(s,c=ut){const d=[s,c];return i.add(d),i.size===1&&(r=t(o,l)||ut),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:o,update:l,subscribe:u}}function sr(e){let t;return ei(e,r=>t=r)(),t}let ur=!1,Fr=Symbol();function no(e,t,r){const i=r[t]??(r[t]={store:null,source:Dr(void 0),unsubscribe:ut});if(i.store!==e&&!(Fr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ut;else{var o=!0;i.unsubscribe=ei(e,l=>{o?i.source.v=l:w(i.source,l)}),o=!1}return e&&Fr in r?sr(e):a(i.source)}function io(){const e={};function t(){Ar(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Fr,{enumerable:!1,value:!0})})}return[e,t]}function lo(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ti(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function $(e,t,r,i){var gt;var o=(r&Bt)!==0,l=!0,u=(r&Zi)!==0,s=(r&Wi)!==0,c=!1,d;u?[d,c]=lo(()=>e[t]):d=e[t];var m=At in e||sn in e,h=u&&(((gt=ze(e,t))==null?void 0:gt.set)??(m&&t in e&&(B=>e[t]=B)))||void 0,g=i,y=!0,N=!1,E=()=>(N=!0,y&&(y=!1,s?g=rt(i):g=i),g);d===void 0&&i!==void 0&&(h&&l&&dl(),d=E(),h&&h(d));var q;if(q=()=>{var B=e[t];return B===void 0?E():(y=!0,N=!1,B)},(r&Gi)===0)return q;if(h){var _e=e.$$legacy;return function(B,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?q():B),B):q()}}var ee=!1,oe=Dr(d),te=zt(()=>{var B=q(),ce=a(oe);return ee?(ee=!1,ce):oe.v=B});return u&&a(te),o||(te.equals=Cr),function(B,ce){if(arguments.length>0){const Ae=ce?a(te):u?Ue(B):B;if(!te.equals(Ae)){if(ee=!0,w(oe,Ae),N&&g!==void 0&&(g=Ae),ti(te))return B;rt(()=>a(te))}return B}return ti(te)?te.v:a(te)}}function oo(e){return new ao(e)}class ao{constructor(t){Jr(this,Oe);Jr(this,we);var l;var r=new Map,i=(u,s)=>{var c=Dr(s);return r.set(u,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(u,s){return a(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===sn?!0:(a(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return w(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});Kr(this,we,(t.hydrate?Yl:Gn)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&I(),Kr(this,Oe,o.$$events);for(const u of Object.keys(he(this,we)))u==="$set"||u==="$destroy"||u==="$on"||Ct(this,u,{get(){return he(this,we)[u]},set(s){he(this,we)[u]=s},enumerable:!0});he(this,we).$set=u=>{Object.assign(o,u)},he(this,we).$destroy=()=>{Gl(he(this,we))}}$set(t){he(this,we).$set(t)}$on(t,r){he(this,Oe)[t]=he(this,Oe)[t]||[];const i=(...o)=>r.call(this,...o);return he(this,Oe)[t].push(i),()=>{he(this,Oe)[t]=he(this,Oe)[t].filter(o=>o!==i)}}$destroy(){he(this,we).$destroy()}}Oe=new WeakMap,we=new WeakMap;let ri;typeof HTMLElement=="function"&&(ri=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 o=this.$$c.$on(t,r);this.$$l_u.set(r,o)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const o=this.$$l_u.get(r);o&&(o(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return l=>{const u=document.createElement("slot");o!=="default"&&(u.name=o),j(l,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=so(this);for(const o of this.$$s)o in i&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),r.default=!0):r[o]=t(o));for(const o of this.attributes){const l=this.$$g_p(o.name);l in this.$$d||(this.$$d[l]=fr(l,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=oo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Cl(()=>{$r(()=>{var o;this.$$r=!0;for(const l of Ht(this.$$c)){if(!((o=this.$$p_d[l])!=null&&o.reflect))continue;this.$$d[l]=this.$$c[l];const u=fr(l,this.$$d[l],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,u)}this.$$r=!1})});for(const o in this.$$l)for(const l of this.$$l[o]){const u=this.$$c.$on(o,l);this.$$l_u.set(l,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=fr(t,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$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 Ht(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function fr(e,t,r,i){var l;const o=(l=r[e])==null?void 0:l.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(o){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(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function so(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function uo(e,t,r,i,o,l){let u=class extends ri{constructor(){super(e,r,o),this.$$p_d=t}static get observedAttributes(){return Ht(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Ht(t).forEach(s=>{Ct(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=fr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var m=(h=ze(d,s))==null?void 0:h.get;m?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Ct(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ni=new TextEncoder;function fo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function co(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await ii(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function ii(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 fo(await crypto.subtle.digest(r.toUpperCase(),ni.encode(e+t)))}function ho(e,t,r="SHA-256",i=1e6,o=0){const l=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=o;c<=i;c+=1){if(l.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:l}}function li(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vo(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 go(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 _o(e,t="",r=1e6,i=0){const o="AES-GCM",l=new AbortController,u=Date.now(),s=async()=>{for(let m=i;m<=r;m+=1){if(l.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:o,iv:go(m)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=vo(e);const m=await crypto.subtle.digest("SHA-256",ni.encode(t));c=await crypto.subtle.importKey("raw",m,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>sr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(sr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(sr(globalThis.altchaI18n.store))},store:ro({})};const mo={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",mo);const Vr=(e,t)=>{let r=wl(()=>nl(t==null?void 0:t(),24));var i=yo();ke(()=>{P(i,"width",a(r)),P(i,"height",a(r))}),j(e,i)};function bo(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function wo(e,t){e.preventDefault(),t()}function po(e,t,r,i,o,l,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(a(t))?r()!==!1&&((c=a(i))==null?void 0:c.reportValidity())===!1?w(o,!1):l()?u():s():w(o,!0)}var yo=lr('<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>'),Eo=Ce('<input type="hidden">'),Co=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>'),Ao=lr('<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>'),Io=lr('<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>'),Ro=lr('<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>'),$o=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),ko=Ce("<audio hidden autoplay><source></audio>"),xo=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>'),So=Ce("<div><!></div>"),To=Ce("<div><!></div>"),No=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>'),Do=Ce('<div class="altcha-footer"><div><!></div></div>'),Lo=Ce('<div class="altcha-anchor-arrow"></div>'),Po=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){var ji,Bi;Mn(t,!0);const[r,i]=io(),o=()=>no(Fo,"$altchaI18nStore",r);let l=$(t,"auto",7,void 0),u=$(t,"blockspam",7,void 0),s=$(t,"challengeurl",7,void 0),c=$(t,"challengejson",7,void 0),d=$(t,"credentials",7,void 0),m=$(t,"customfetch",7,void 0),h=$(t,"debug",7,!1),g=$(t,"delay",7,0),y=$(t,"disableautofocus",7,!1),N=$(t,"expire",7,void 0),E=$(t,"floating",7,void 0),q=$(t,"floatinganchor",7,void 0),_e=$(t,"floatingoffset",7,void 0),ee=$(t,"floatingpersist",7,!1),oe=$(t,"hidefooter",7,!1),te=$(t,"hidelogo",7,!1),gt=$(t,"id",7,void 0),B=$(t,"language",7,void 0),ce=$(t,"name",7,"altcha"),Ae=$(t,"maxnumber",7,1e6),Lt=$(t,"mockerror",7,!1),Ge=$(t,"obfuscated",7,void 0),cr=$(t,"plugins",7,void 0),Pt=$(t,"refetchonexpire",7,!0),it=$(t,"sentinel",7,void 0),Ne=$(t,"spamfilter",7,!1),_t=$(t,"strings",7,void 0),pe=$(t,"test",7,!1),ae=$(t,"verifyurl",7,void 0),mt=$(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ot=$(t,"workerurl",7,void 0);const{altchaI18n:Oo}=globalThis,Fo=Oo.store,si=["SHA-256","SHA-384","SHA-512"],Vo="https://altcha.org/",Ze=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},ui=(Bi=(ji=document.documentElement.lang)==null?void 0:ji.split("-"))==null?void 0:Bi[0],Mr=Rt(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),Ur=Rt(()=>c()?Ai(c()):void 0),Mo=Rt(()=>_t()?Ai(_t()):{}),M=Rt(()=>({...hi(o()),...a(Mo)})),fi=Rt(()=>`${gt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Ft=U(!1),Y=U(null),k=U(Ue(C.UNVERIFIED)),se=U(void 0),Vt=U(null),We=U(null),qr=U(null),bt=U(null),O=U(null),lt=U(null),De=null,z=U(null),ot=U(!1),Je=[],jr=U(!1),Fe=U(null);Ir(()=>{Xo(a(lt))}),Ir(()=>{Qo(a(k))}),to(()=>{Uo(),a(O)&&(a(O).removeEventListener("submit",wi),a(O).removeEventListener("reset",pi),a(O).removeEventListener("focusin",bi),w(O,null)),De&&(clearTimeout(De),De=null),document.removeEventListener("click",_i),document.removeEventListener("scroll",mi),window.removeEventListener("resize",Ci)}),Qn(()=>{var n;x("mounted","2.0.0"),x("workers",mt()),Ho(),x("plugins",Je.length?Je.map(f=>f.constructor.pluginName).join(", "):"none"),pe()&&x("using test mode"),N()&&Br(N()),l()!==void 0&&x("auto",l()),E()!==void 0&&Ri(E()),w(O,(n=a(se))==null?void 0:n.closest("form"),!0),a(O)&&(a(O).addEventListener("submit",wi,{capture:!0}),a(O).addEventListener("reset",pi),(l()==="onfocus"||ee()==="focus")&&a(O).addEventListener("focusin",bi)),l()==="onload"&&(Ge()?Mt():Ve()),a(Mr)&&(oe()||te())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ze("load")})});function dr(n,f){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:f.number,salt:n.salt,signature:n.signature,test:pe()?!0:void 0,took:f.took}))}function Uo(){for(const n of Je)n.destroy()}function ci(){s()&&Pt()&&a(k)===C.VERIFIED?Ve():wt(C.EXPIRED,a(M).expired)}async function qo(){var n;if(Lt())throw x("mocking error"),new Error("Mocked error.");if(a(Ur))return x("using provided json data"),a(Ur);if(pe())return x("generating test challenge",{test:pe()}),co(typeof pe()!="boolean"?+pe():void 0);{if(!s()&&a(O)){const R=a(O).getAttribute("action");R!=null&&R.includes("/form/")&&s(R+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");x("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:Ne()!==!1?{"x-altcha-spam-filter":"1"}:{}},v=await di()(s(),f);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 b=v.headers.get("X-Altcha-Config"),_=await v.json(),A=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),p=A.get("expires")||A.get("expire");if(p){const R=new Date(+p*1e3),H=isNaN(R.getTime())?0:R.getTime()-Date.now();H>0&&Br(H)}if(b)try{const R=JSON.parse(b);R&&typeof R=="object"&&R.verifyurl&&!R.verifyurl.startsWith("javascript:")&&(R.verifyurl=gi(R.verifyurl))}catch(R){x("unable to configure from X-Altcha-Config",R)}return _}}function jo(n){var v,b;const f=(v=a(O))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((b=f==null?void 0:f.value)==null?void 0:b.slice(f.value.indexOf("@")))||void 0}function di(){let n=fetch;if(m())if(x("using customfetch"),typeof m()=="string"){if(n=globalThis[m()]||null,!n)throw new Error(`Custom fetch function not found: ${m()}`)}else n=m();return n}function hi(n,f=[B()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(n).map(_=>_.toLowerCase()),b=f.reduce((_,A)=>(A=A.toLowerCase(),_||(n[A]?A:null)||v.find(p=>A.split("-")[0]===p.split("-")[0])||null),null);return n[b||"en"]}function Bo(){return Ne()==="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 Ne()=="object"?Ne():{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 vi(n){var v;return[...((v=a(O))==null?void 0:v.querySelectorAll(n!=null&&n.length?n.map(b=>`input[name="${b}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((b,_)=>{const A=_.name,p=_.value;return A&&p&&(b[A]=/\n/.test(p)?p.replace(new RegExp("(?<!\\r)\\n","g"),`\r
3
- `):p),b},{})}function gi(n,f){const v=new URL(s()||location.origin),b=new URL(n,v);if(b.search||(b.search=v.search),f)for(const _ in f)f[_]!==void 0&&f[_]!==null&&b.searchParams.set(_,f[_]);return b.toString()}function Ho(){const n=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!n||n.includes(f.pluginName))&&Je.push(new f({el:a(se),clarify:Mt,dispatch:Ze,getConfiguration:xi,getFloatingAnchor:Si,getState:Ti,log:x,reset:wt,solve:ki,setState:Le,setFloatingAnchor:Di,verify:Ve}))}function x(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function Yo(){w(z,Q.PAUSED,!0)}function Go(n){w(z,Q.ERROR,!0)}function Zo(){w(z,Q.READY,!0)}function Wo(){w(z,Q.LOADING,!0)}function Jo(){w(z,Q.PLAYING,!0)}function Ko(){w(z,Q.PAUSED,!0)}function zo(n){var f;if(n.preventDefault(),n.stopPropagation(),a(Y)){const v=new FormData(n.target),b=String(v.get("code"));if((f=ae())!=null&&f.startsWith("javascript:")){const _=ae().replace(/^javascript:/,"");if(x(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:a(Y).challenge,code:b,solution:a(Y).solution})}w(ot,!0),Ii(dr(a(Y).challenge,a(Y).solution),b).then(({reason:_,verified:A})=>{A?(w(Y,null),Le(C.VERIFIED),x("verified"),Nr().then(()=>{var p;(p=a(qr))==null||p.focus(),Ze("verified",{payload:a(Fe)})})):(wt(),w(lt,_||"Verification failed",!0))}).catch(_=>{w(Y,null),Le(C.ERROR,_),x("sentinel verification failed:",_)}).finally(()=>{w(ot,!1)})}}function _i(n){var v;const f=n.target;E()&&f&&!a(se).contains(f)&&(a(k)===C.VERIFIED&&ee()===!1||a(k)===C.VERIFIED&&ee()==="focus"&&!((v=a(O))!=null&&v.matches(":focus-within"))||l()==="off"&&a(k)===C.UNVERIFIED)&&Ni()}function mi(){E()&&a(k)!==C.UNVERIFIED&&Ut()}function Xo(n){for(const f of Je)typeof f.onErrorChange=="function"&&f.onErrorChange(a(lt))}function bi(n){a(k)===C.UNVERIFIED?Ve():E()&&ee()==="focus"&&a(k)===C.VERIFIED&&Hr()}function wi(n){const f=n.target,v=n.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(a(O)&&l()==="onsubmit"?a(k)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ve().then(()=>{ta(v)})):a(k)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),a(k)===C.VERIFYING&&yi()):a(O)&&E()&&l()==="off"&&a(k)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Hr()))}function pi(){wt()}function yi(){a(k)===C.VERIFYING&&a(M).waitAlert&&alert(a(M).waitAlert)}function Ei(){a(We)?a(We).paused?(a(We).currentTime=0,a(We).play()):a(We).pause():(w(jr,!0),requestAnimationFrame(()=>{var n;(n=a(We))==null||n.play()}))}function Qo(n){for(const f of Je)typeof f.onStateChange=="function"&&f.onStateChange(a(k));E()&&a(k)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Ut()}),w(Ft,a(k)===C.VERIFIED)}function Ci(){E()&&Ut()}function Ai(n){return JSON.parse(n)}async function ea(n){if(!ae())throw new Error("Attribute verifyurl not set.");x("requesting server verification from",ae());const f={payload:n};if(Ne()!==!1){const{blockedCountries:_,classifier:A,disableRules:p,email:R,expectedLanguages:H,expectedCountries:re,fields:de,ipAddress:Ke,text:Gr,timeZone:gr}=Bo();f.blockedCountries=_,f.classifier=A,f.disableRules=p,f.email=R===!1?void 0:jo(R),f.expectedCountries=re,f.expectedLanguages=H||(ui?[ui]:void 0),f.fields=de===!1?void 0:vi(de),f.ipAddress=Ke===!1?void 0:Ke||"auto",f.text=Gr,f.timeZone=gr===!1?void 0:gr||li()}const v=await di()(ae(),{body:JSON.stringify(f),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 b=await v.json();if(b!=null&&b.payload&&w(Fe,b.payload,!0),Ze("serververification",b),u()&&b.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ii(n,f){if(!ae())throw new Error("Attribute verifyurl not set.");x("requesting sentinel verification from",ae());const v={code:f,payload:n};it()&&(v.fields=it().fields?vi():void 0,v.timeZone=it().timeZone?li():void 0);const b=await fetch(ae(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!b||!(b instanceof Response))throw new Error("Fetch function did not return a response.");if(b.status!==200)throw new Error(`Server responded with ${b.status}.`);const _=await b.json();return _!=null&&_.payload&&w(Fe,_.payload,!0),Ze("sentinelverification",_),_}function ta(n){var f;a(O)&&"requestSubmit"in a(O)?a(O).requestSubmit(n):(f=a(O))!=null&&f.reportValidity()&&(n?n.click():a(O).submit())}function Br(n){x("expire",n),De&&(clearTimeout(De),De=null),n<1?ci():De=setTimeout(ci,n)}function Ri(n){x("floating",n),E()!==n&&(a(se).style.left="",a(se).style.top=""),E(n===!0||n===""?"auto":n===!1||n==="false"?void 0:E()),E()?(l()||l("onsubmit"),document.addEventListener("scroll",mi),document.addEventListener("click",_i),window.addEventListener("resize",Ci)):l()==="onsubmit"&&l(void 0)}function $i(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(!si.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${si.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 ki(n){let f=null;if("Worker"in window){try{f=await ra(n,n.maxNumber||n.maxnumber||Ae())}catch(v){x(v)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in n)return{data:n,solution:f}}if("obfuscated"in n){const v=await _o(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await ho(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||Ae()).promise}}async function ra(n,f=typeof pe()=="number"?pe():n.maxNumber||n.maxnumber||Ae(),v=Math.ceil(mt())){const b=[];v=Math.min(16,f,Math.max(1,v));for(let p=0;p<v;p++)b.push(altchaCreateWorker(Ot()));const _=Math.ceil(f/v),A=await Promise.all(b.map((p,R)=>{const H=R*_;return new Promise(re=>{p.addEventListener("message",de=>{if(de.data)for(const Ke of b)Ke!==p&&Ke.postMessage({type:"abort"});re(de.data)}),p.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const p of b)p.terminate();return A.find(p=>!!p)||null}async function Mt(){if(!Ge()){Le(C.ERROR);return}const n=Je.find(f=>f.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Le(C.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 na(n){n.obfuscated!==void 0&&Ge(n.obfuscated),n.auto!==void 0&&(l(n.auto),l()==="onload"&&(Ge()?Mt():Ve())),n.blockspam!==void 0&&u(!!n.blockspam),n.customfetch!==void 0&&m(n.customfetch),n.floatinganchor!==void 0&&q(n.floatinganchor),n.delay!==void 0&&g(n.delay),n.floatingoffset!==void 0&&_e(n.floatingoffset),n.floating!==void 0&&Ri(n.floating),n.expire!==void 0&&(Br(n.expire),N(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),$i(a(Ur))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&oe(!!n.hidefooter),n.hidelogo!==void 0&&te(!!n.hidelogo),n.language!==void 0&&_t(hi(o(),[n.language])),n.maxnumber!==void 0&&Ae(+n.maxnumber),n.mockerror!==void 0&&Lt(!!n.mockerror),n.name!==void 0&&ce(n.name),n.refetchonexpire!==void 0&&Pt(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&Ne(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&_t(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&pe(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&ae(n.verifyurl),n.workers!==void 0&&mt(+n.workers),n.workerurl!==void 0&&Ot(n.workerurl)}function xi(){return{auto:l(),blockspam:u(),challengeurl:s(),debug:h(),delay:g(),expire:N(),floating:E(),floatinganchor:q(),floatingoffset:_e(),hidefooter:oe(),hidelogo:te(),name:ce(),maxnumber:Ae(),mockerror:Lt(),obfuscated:Ge(),refetchonexpire:Pt(),spamfilter:Ne(),strings:a(M),test:pe(),verifyurl:ae(),workers:mt(),workerurl:Ot()}}function Si(){return a(bt)}function ia(n){return Je.find(f=>f.constructor.pluginName===n)}function Ti(){return a(k)}function Ni(){a(se).style.display="none"}function Ut(n=20){var f;if(a(se))if(a(bt)||w(bt,(q()?document.querySelector(q()):(f=a(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||a(O),!0),a(bt)){const v=parseInt(_e(),10)||12,b=a(bt).getBoundingClientRect(),_=a(se).getBoundingClientRect(),A=document.documentElement.clientHeight,p=document.documentElement.clientWidth,R=E()==="auto"?b.bottom+_.height+v+n>A:E()==="top",H=Math.max(n,Math.min(p-n-_.width,b.left+b.width/2-_.width/2));if(R?a(se).style.top=`${b.top-(_.height+v)}px`:a(se).style.top=`${b.bottom+v}px`,a(se).style.left=`${H}px`,a(se).setAttribute("data-floating",R?"top":"bottom"),a(Vt)){const re=a(Vt).getBoundingClientRect();a(Vt).style.left=b.left-H+b.width/2-re.width/2+"px"}}else x("unable to find floating anchor element")}function wt(n=C.UNVERIFIED,f=null){De&&(clearTimeout(De),De=null),w(Ft,!1),w(Fe,null),w(Y,null),w(jr,!1),w(z,null),Le(n,f)}function Di(n){w(bt,n,!0)}function Le(n,f=null){w(k,n,!0),w(lt,f,!0),Ze("statechange",{payload:a(Fe),state:a(k)})}function Hr(){a(se).style.display="block",E()&&Ut()}async function Ve(){return wt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),qo().then(n=>($i(n),x("challenge",n),ki(n))).then(({data:n,solution:f})=>{var v;if(x("solution",f),!f||n&&"challenge"in n&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in n)if(ae()&&"codeChallenge"in n)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&y()===!1&&document.activeElement.blur(),w(Y,{challenge:n,solution:f},!0);else{if(ae()&&it()!==void 0)return Ii(dr(n,f));if(ae())return ea(dr(n,f));w(Fe,dr(n,f),!0),x("payload",a(Fe))}else 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(()=>{a(Y)?(Le(C.CODE),Nr().then(()=>{Ze("code",{codeChallenge:a(Y)})})):(Le(C.VERIFIED),x("verified"),Nr().then(()=>{Ze("verified",{payload:a(Fe)})}))}).catch(n=>{x(n),Le(C.ERROR,n.message)})}var Li=Po(),Pi=It(Li);Zl(Pi,t,"default",{});var qt=J(Pi,2),Yr=W(qt),hr=W(Yr);let Oi;var Fi=W(hr);{var la=n=>{Vr(n)};K(Fi,n=>{a(k)===C.VERIFYING&&n(la)})}var at=J(Fi,2);Jn(at),at.__change=[po,k,Ne,O,Ft,Ge,Mt,Ve],ar(at,n=>w(qr,n),()=>a(qr)),Z(hr);var vr=J(hr,2),oa=W(vr);{var aa=n=>{var f=or(),v=It(f);nt(v,()=>a(M).verified),j(n,f)},sa=(n,f)=>{{var v=_=>{var A=or(),p=It(A);nt(p,()=>a(M).verifying),j(_,A)},b=(_,A)=>{{var p=H=>{var re=or(),de=It(re);nt(de,()=>a(M).verificationRequired),j(H,re)},R=H=>{var re=or(),de=It(re);nt(de,()=>a(M).label),j(H,re)};K(_,H=>{a(k)===C.CODE?H(p):H(R,!1)},A)}};K(n,_=>{a(k)===C.VERIFYING?_(v):_(b,!1)},f)}};K(oa,n=>{a(k)===C.VERIFIED?n(aa):n(sa,!1)})}Z(vr);var Vi=J(vr,2);{var ua=n=>{var f=Eo();Jn(f),ke(()=>{P(f,"name",ce()),Xl(f,a(Fe))}),j(n,f)};K(Vi,n=>{a(k)===C.VERIFIED&&n(ua)})}var Mi=J(Vi,2);{var fa=n=>{var f=Co(),v=W(f);P(v,"href",Vo),Z(f),ke(()=>P(v,"aria-label",a(M).ariaLinkLabel)),j(n,f)};K(Mi,n=>{(te()!==!0||a(Mr))&&n(fa)})}var ca=J(Mi,2);{var da=n=>{var f=xo(),v=J(W(f),2),b=W(v),_=J(b,2);Ul(_,!y()),_.__keydown=[bo,Ei];var A=J(_,2),p=W(A),R=W(p);{var H=Ie=>{var X=$o();X.__click=Ei;var _r=W(X);{var jt=pt=>{Vr(pt,()=>20)},pa=(pt,ya)=>{{var Ea=yt=>{var Zr=Ao();j(yt,Zr)},Ca=(yt,Zr)=>{{var Aa=Et=>{var Wr=Io();j(Et,Wr)},Ia=Et=>{var Wr=Ro();j(Et,Wr)};K(yt,Et=>{a(z)===Q.PLAYING?Et(Aa):Et(Ia,!1)},Zr)}};K(pt,yt=>{a(z)===Q.ERROR?yt(Ea):yt(Ca,!1)},ya)}};K(_r,pt=>{a(z)===Q.LOADING?pt(jt):pt(pa,!1)})}Z(X),ke(()=>{P(X,"title",a(M).getAudioChallenge),X.disabled=a(z)===Q.LOADING||a(z)===Q.ERROR||a(ot),P(X,"aria-label",a(z)===Q.LOADING?a(M).loading:a(M).getAudioChallenge)}),j(Ie,X)};K(R,Ie=>{a(Y).challenge.codeChallenge.audio&&Ie(H)})}var re=J(R,2);re.__click=[wo,Ve],Z(p);var de=J(p,2),Ke=W(de);{var Gr=Ie=>{Vr(Ie,()=>16)};K(Ke,Ie=>{a(ot)&&Ie(Gr)})}var gr=J(Ke);Z(de),Z(A);var ba=J(A,2);{var wa=Ie=>{var X=ko(),_r=W(X);Z(X),ar(X,jt=>w(We,jt),()=>a(We)),ke(jt=>P(_r,"src",jt),[()=>gi(a(Y).challenge.codeChallenge.audio,{language:B()})]),Ye("loadstart",X,Wo),Ye("canplay",X,Zo),Ye("pause",X,Ko),Ye("playing",X,Jo),Ye("ended",X,Yo),Ye("error",_r,Go),j(Ie,X)};K(ba,Ie=>{a(Y).challenge.codeChallenge.audio&&a(jr)&&Ie(wa)})}Z(v),Z(f),ke(()=>{P(f,"aria-label",a(M).verificationRequired),P(b,"src",a(Y).challenge.codeChallenge.image),P(_,"minlength",a(Y).challenge.codeChallenge.length||1),P(_,"maxlength",a(Y).challenge.codeChallenge.length),P(_,"placeholder",a(M).enterCode),P(_,"aria-label",a(z)===Q.LOADING?a(M).loading:a(z)===Q.PLAYING?"":a(M).enterCodeAria),P(_,"aria-live",a(z)?"assertive":"polite"),P(_,"aria-busy",a(z)===Q.LOADING),_.disabled=a(ot),P(re,"aria-label",a(M).reload),P(re,"title",a(M).reload),re.disabled=a(ot),de.disabled=a(ot),P(de,"aria-label",a(M).verify),Hl(gr,` ${a(M).verify??""}`)}),Ye("submit",v,zo,!0),j(n,f)};K(ca,n=>{var f;(f=a(Y))!=null&&f.challenge.codeChallenge&&n(da)})}Z(Yr);var Ui=J(Yr,2);{var ha=n=>{var f=No(),v=J(W(f),2);{var b=A=>{var p=So(),R=W(p);nt(R,()=>a(M).expired),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)},_=A=>{var p=To(),R=W(p);nt(R,()=>a(M).error),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)};K(v,A=>{a(k)===C.EXPIRED?A(b):A(_,!1)})}Z(f),j(n,f)};K(Ui,n=>{(a(lt)||a(k)===C.EXPIRED)&&n(ha)})}var qi=J(Ui,2);{var va=n=>{var f=Do(),v=W(f),b=W(v);nt(b,()=>a(M).footer),Z(v),Z(f),j(n,f)};K(qi,n=>{a(M).footer&&(oe()!==!0||a(Mr))&&n(va)})}var ga=J(qi,2);{var _a=n=>{var f=Lo();ar(f,v=>w(Vt,v),()=>a(Vt)),j(n,f)};K(ga,n=>{E()&&n(_a)})}Z(qt),ar(qt,n=>w(se,n),()=>a(se)),ke(n=>{P(qt,"data-state",a(k)),P(qt,"data-floating",E()),Oi=Jl(hr,1,"altcha-checkbox",null,Oi,n),P(at,"id",a(fi)),at.required=l()!=="onsubmit"&&(!E()||l()!=="off"),P(vr,"for",a(fi))},[()=>({"altcha-checkbox-verifying":a(k)===C.VERIFYING})]),Ye("invalid",at,yi),eo(at,()=>a(Ft),n=>w(Ft,n)),j(e,Li);var ma=Un({clarify:Mt,configure:na,getConfiguration:xi,getFloatingAnchor:Si,getPlugin:ia,getState:Ti,hide:Ni,repositionFloating:Ut,reset:wt,setFloatingAnchor:Di,setState:Le,show:Hr,verify:Ve,get auto(){return l()},set auto(n=void 0){l(n),I()},get blockspam(){return u()},set blockspam(n=void 0){u(n),I()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),I()},get challengejson(){return c()},set challengejson(n=void 0){c(n),I()},get credentials(){return d()},set credentials(n=void 0){d(n),I()},get customfetch(){return m()},set customfetch(n=void 0){m(n),I()},get debug(){return h()},set debug(n=!1){h(n),I()},get delay(){return g()},set delay(n=0){g(n),I()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),I()},get expire(){return N()},set expire(n=void 0){N(n),I()},get floating(){return E()},set floating(n=void 0){E(n),I()},get floatinganchor(){return q()},set floatinganchor(n=void 0){q(n),I()},get floatingoffset(){return _e()},set floatingoffset(n=void 0){_e(n),I()},get floatingpersist(){return ee()},set floatingpersist(n=!1){ee(n),I()},get hidefooter(){return oe()},set hidefooter(n=!1){oe(n),I()},get hidelogo(){return te()},set hidelogo(n=!1){te(n),I()},get id(){return gt()},set id(n=void 0){gt(n),I()},get language(){return B()},set language(n=void 0){B(n),I()},get name(){return ce()},set name(n="altcha"){ce(n),I()},get maxnumber(){return Ae()},set maxnumber(n=1e6){Ae(n),I()},get mockerror(){return Lt()},set mockerror(n=!1){Lt(n),I()},get obfuscated(){return Ge()},set obfuscated(n=void 0){Ge(n),I()},get plugins(){return cr()},set plugins(n=void 0){cr(n),I()},get refetchonexpire(){return Pt()},set refetchonexpire(n=!0){Pt(n),I()},get sentinel(){return it()},set sentinel(n=void 0){it(n),I()},get spamfilter(){return Ne()},set spamfilter(n=!1){Ne(n),I()},get strings(){return _t()},set strings(n=void 0){_t(n),I()},get test(){return pe()},set test(n=!1){pe(n),I()},get verifyurl(){return ae()},set verifyurl(n=void 0){ae(n),I()},get workers(){return mt()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){mt(n),I()},get workerurl(){return Ot()},set workerurl(n=void 0){Ot(n),I()}});return i(),ma}Bl(["change","keydown","click"]),customElements.define("altcha-widget",uo(oi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{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:{},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:T&&T.tagName.toUpperCase()==="SCRIPT"&&T.src||new URL("altcha.umd.cjs",document.baseURI).href)),S.Altcha=oi,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
2
+ \r\f \v\uFEFF`];function Wl(e,t,r){var i=""+e;if(r){for(var o in r)if(r[o])i=i?i+" "+o:o;else if(i.length)for(var l=o.length,u=0;(u=i.indexOf(o,u))>=0;){var s=u+l;(u===0||Wn.includes(i[u-1]))&&(s===i.length||Wn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function Jl(e,t,r,i,o,l){var u=e.__className;if(F||u!==r||u===void 0){var s=Wl(r,i,l);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}else if(l&&o!==l)for(var c in l){var d=!!l[c];(o==null||d!==!!o[c])&&e.classList.toggle(c,d)}return l}const Kl=Symbol("is custom element"),zl=Symbol("is html");function Jn(e){if(F){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;P(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var o=e.checked;P(e,"checked",null),e.checked=o}}};e.__on_r=r,kl(r),Bn()}}function Xl(e,t){var r=Kn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function P(e,t,r,i){var o=Kn(e);F&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=r)&&(t==="loading"&&(e[ol]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ql(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Kn(e){return e.__attributes??(e.__attributes={[Kl]:e.nodeName.includes("-"),[zl]:e.namespaceURI===zi})}var zn=new Map;function Ql(e){var t=zn.get(e.nodeName);if(t)return t;zn.set(e.nodeName,t=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=el(i);for(var l in r)r[l].set&&t.push(l);i=rn(i)}return t}function eo(e,t,r=t){ql(e,"change",i=>{var o=i?e.defaultChecked:e.checked;r(o)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),$r(()=>{var i=t();e.checked=!!i})}function Xn(e,t){return e===t||(e==null?void 0:e[At])===t}function ar(e={},t,r,i){return Rr(()=>{var o,l;return $r(()=>{o=l,l=[],rt(()=>{e!==r(...l)&&(t(e,...l),o&&Xn(r(...o),e)&&t(null,...o))})}),()=>{Sr(()=>{l&&Xn(r(...l),e)&&t(null,...l)})}}),e}function Qn(e){le===null&&en(),Ir(()=>{const t=rt(e);if(typeof t=="function")return t})}function to(e){le===null&&en(),Qn(()=>()=>rt(e))}function ei(e,t,r){if(e==null)return t(void 0),ut;const i=rt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const vt=[];function ro(e,t=ut){let r=null;const i=new Set;function o(s){if(vn(e,s)&&(e=s,r)){const c=!vt.length;for(const d of i)d[1](),vt.push(d,e);if(c){for(let d=0;d<vt.length;d+=2)vt[d][0](vt[d+1]);vt.length=0}}}function l(s){o(s(e))}function u(s,c=ut){const d=[s,c];return i.add(d),i.size===1&&(r=t(o,l)||ut),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:o,update:l,subscribe:u}}function sr(e){let t;return ei(e,r=>t=r)(),t}let ur=!1,Fr=Symbol();function no(e,t,r){const i=r[t]??(r[t]={store:null,source:Dr(void 0),unsubscribe:ut});if(i.store!==e&&!(Fr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ut;else{var o=!0;i.unsubscribe=ei(e,l=>{o?i.source.v=l:w(i.source,l)}),o=!1}return e&&Fr in r?sr(e):a(i.source)}function io(){const e={};function t(){Ar(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Fr,{enumerable:!1,value:!0})})}return[e,t]}function lo(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ti(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function $(e,t,r,i){var gt;var o=(r&Bt)!==0,l=!0,u=(r&Zi)!==0,s=(r&Wi)!==0,c=!1,d;u?[d,c]=lo(()=>e[t]):d=e[t];var m=At in e||sn in e,h=u&&(((gt=ze(e,t))==null?void 0:gt.set)??(m&&t in e&&(B=>e[t]=B)))||void 0,g=i,y=!0,N=!1,E=()=>(N=!0,y&&(y=!1,s?g=rt(i):g=i),g);d===void 0&&i!==void 0&&(h&&l&&dl(),d=E(),h&&h(d));var q;if(q=()=>{var B=e[t];return B===void 0?E():(y=!0,N=!1,B)},(r&Gi)===0)return q;if(h){var _e=e.$$legacy;return function(B,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?q():B),B):q()}}var ee=!1,oe=Dr(d),te=zt(()=>{var B=q(),ce=a(oe);return ee?(ee=!1,ce):oe.v=B});return u&&a(te),o||(te.equals=Cr),function(B,ce){if(arguments.length>0){const Ae=ce?a(te):u?Ue(B):B;if(!te.equals(Ae)){if(ee=!0,w(oe,Ae),N&&g!==void 0&&(g=Ae),ti(te))return B;rt(()=>a(te))}return B}return ti(te)?te.v:a(te)}}function oo(e){return new ao(e)}class ao{constructor(t){Jr(this,Oe);Jr(this,we);var l;var r=new Map,i=(u,s)=>{var c=Dr(s);return r.set(u,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(u,s){return a(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===sn?!0:(a(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return w(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});Kr(this,we,(t.hydrate?Yl:Gn)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&I(),Kr(this,Oe,o.$$events);for(const u of Object.keys(he(this,we)))u==="$set"||u==="$destroy"||u==="$on"||Ct(this,u,{get(){return he(this,we)[u]},set(s){he(this,we)[u]=s},enumerable:!0});he(this,we).$set=u=>{Object.assign(o,u)},he(this,we).$destroy=()=>{Gl(he(this,we))}}$set(t){he(this,we).$set(t)}$on(t,r){he(this,Oe)[t]=he(this,Oe)[t]||[];const i=(...o)=>r.call(this,...o);return he(this,Oe)[t].push(i),()=>{he(this,Oe)[t]=he(this,Oe)[t].filter(o=>o!==i)}}$destroy(){he(this,we).$destroy()}}Oe=new WeakMap,we=new WeakMap;let ri;typeof HTMLElement=="function"&&(ri=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 o=this.$$c.$on(t,r);this.$$l_u.set(r,o)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const o=this.$$l_u.get(r);o&&(o(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return l=>{const u=document.createElement("slot");o!=="default"&&(u.name=o),j(l,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=so(this);for(const o of this.$$s)o in i&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),r.default=!0):r[o]=t(o));for(const o of this.attributes){const l=this.$$g_p(o.name);l in this.$$d||(this.$$d[l]=fr(l,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=oo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Cl(()=>{$r(()=>{var o;this.$$r=!0;for(const l of Ht(this.$$c)){if(!((o=this.$$p_d[l])!=null&&o.reflect))continue;this.$$d[l]=this.$$c[l];const u=fr(l,this.$$d[l],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,u)}this.$$r=!1})});for(const o in this.$$l)for(const l of this.$$l[o]){const u=this.$$c.$on(o,l);this.$$l_u.set(l,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=fr(t,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$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 Ht(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function fr(e,t,r,i){var l;const o=(l=r[e])==null?void 0:l.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(o){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(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function so(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function uo(e,t,r,i,o,l){let u=class extends ri{constructor(){super(e,r,o),this.$$p_d=t}static get observedAttributes(){return Ht(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Ht(t).forEach(s=>{Ct(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=fr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var m=(h=ze(d,s))==null?void 0:h.get;m?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Ct(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ni=new TextEncoder;function fo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function co(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await ii(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function ii(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 fo(await crypto.subtle.digest(r.toUpperCase(),ni.encode(e+t)))}function ho(e,t,r="SHA-256",i=1e6,o=0){const l=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=o;c<=i;c+=1){if(l.signal.aborted)return null;if(await ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:l}}function li(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vo(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 go(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 _o(e,t="",r=1e6,i=0){const o="AES-GCM",l=new AbortController,u=Date.now(),s=async()=>{for(let m=i;m<=r;m+=1){if(l.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:o,iv:go(m)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=vo(e);const m=await crypto.subtle.digest("SHA-256",ni.encode(t));c=await crypto.subtle.importKey("raw",m,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>sr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(sr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(sr(globalThis.altchaI18n.store))},store:ro({})};const mo={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",mo);const Vr=(e,t)=>{let r=wl(()=>nl(t==null?void 0:t(),24));var i=yo();ke(()=>{P(i,"width",a(r)),P(i,"height",a(r))}),j(e,i)};function bo(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function wo(e,t){e.preventDefault(),t()}function po(e,t,r,i,o,l,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(a(t))?r()!==!1&&((c=a(i))==null?void 0:c.reportValidity())===!1?w(o,!1):l()?u():s():w(o,!0)}var yo=lr('<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>'),Eo=Ce('<input type="hidden">'),Co=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>'),Ao=lr('<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>'),Io=lr('<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>'),Ro=lr('<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>'),$o=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),ko=Ce("<audio hidden autoplay><source></audio>"),xo=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>'),So=Ce("<div><!></div>"),To=Ce("<div><!></div>"),No=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>'),Do=Ce('<div class="altcha-footer"><div><!></div></div>'),Lo=Ce('<div class="altcha-anchor-arrow"></div>'),Po=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){var ji,Bi;Mn(t,!0);const[r,i]=io(),o=()=>no(Fo,"$altchaI18nStore",r);let l=$(t,"auto",7,void 0),u=$(t,"blockspam",7,void 0),s=$(t,"challengeurl",7,void 0),c=$(t,"challengejson",7,void 0),d=$(t,"credentials",7,void 0),m=$(t,"customfetch",7,void 0),h=$(t,"debug",7,!1),g=$(t,"delay",7,0),y=$(t,"disableautofocus",7,!1),N=$(t,"expire",7,void 0),E=$(t,"floating",7,void 0),q=$(t,"floatinganchor",7,void 0),_e=$(t,"floatingoffset",7,void 0),ee=$(t,"floatingpersist",7,!1),oe=$(t,"hidefooter",7,!1),te=$(t,"hidelogo",7,!1),gt=$(t,"id",7,void 0),B=$(t,"language",7,void 0),ce=$(t,"name",7,"altcha"),Ae=$(t,"maxnumber",7,1e6),Lt=$(t,"mockerror",7,!1),Ge=$(t,"obfuscated",7,void 0),cr=$(t,"plugins",7,void 0),Pt=$(t,"refetchonexpire",7,!0),it=$(t,"sentinel",7,void 0),Ne=$(t,"spamfilter",7,!1),_t=$(t,"strings",7,void 0),pe=$(t,"test",7,!1),ae=$(t,"verifyurl",7,void 0),mt=$(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ot=$(t,"workerurl",7,void 0);const{altchaI18n:Oo}=globalThis,Fo=Oo.store,si=["SHA-256","SHA-384","SHA-512"],Vo="https://altcha.org/",Ze=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},ui=(Bi=(ji=document.documentElement.lang)==null?void 0:ji.split("-"))==null?void 0:Bi[0],Mr=Rt(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),Ur=Rt(()=>c()?Ai(c()):void 0),Mo=Rt(()=>_t()?Ai(_t()):{}),M=Rt(()=>({...hi(o()),...a(Mo)})),fi=Rt(()=>`${gt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Ft=U(!1),Y=U(null),k=U(Ue(C.UNVERIFIED)),se=U(void 0),Vt=U(null),We=U(null),qr=U(null),bt=U(null),O=U(null),lt=U(null),De=null,z=U(null),ot=U(!1),Je=[],jr=U(!1),Fe=U(null);Ir(()=>{Xo(a(lt))}),Ir(()=>{Qo(a(k))}),to(()=>{Uo(),a(O)&&(a(O).removeEventListener("submit",wi),a(O).removeEventListener("reset",pi),a(O).removeEventListener("focusin",bi),w(O,null)),De&&(clearTimeout(De),De=null),document.removeEventListener("click",_i),document.removeEventListener("scroll",mi),window.removeEventListener("resize",Ci)}),Qn(()=>{var n;x("mounted","2.0.0"),x("workers",mt()),Ho(),x("plugins",Je.length?Je.map(f=>f.constructor.pluginName).join(", "):"none"),pe()&&x("using test mode"),N()&&Br(N()),l()!==void 0&&x("auto",l()),E()!==void 0&&Ri(E()),w(O,(n=a(se))==null?void 0:n.closest("form"),!0),a(O)&&(a(O).addEventListener("submit",wi,{capture:!0}),a(O).addEventListener("reset",pi),(l()==="onfocus"||ee()==="focus")&&a(O).addEventListener("focusin",bi)),l()==="onload"&&(Ge()?Mt():Ve()),a(Mr)&&(oe()||te())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ze("load")})});function dr(n,f){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:f.number,salt:n.salt,signature:n.signature,test:pe()?!0:void 0,took:f.took}))}function Uo(){for(const n of Je)n.destroy()}function ci(){s()&&Pt()&&a(k)===C.VERIFIED?Ve():wt(C.EXPIRED,a(M).expired)}async function qo(){var n;if(Lt())throw x("mocking error"),new Error("Mocked error.");if(a(Ur))return x("using provided json data"),a(Ur);if(pe())return x("generating test challenge",{test:pe()}),co(typeof pe()!="boolean"?+pe():void 0);{if(!s()&&a(O)){const R=a(O).getAttribute("action");R!=null&&R.includes("/form/")&&s(R+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");x("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:Ne()!==!1?{"x-altcha-spam-filter":"1"}:{}},v=await di()(s(),f);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 b=v.headers.get("X-Altcha-Config"),_=await v.json(),A=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),p=A.get("expires")||A.get("expire");if(p){const R=new Date(+p*1e3),H=isNaN(R.getTime())?0:R.getTime()-Date.now();H>0&&Br(H)}if(b)try{const R=JSON.parse(b);R&&typeof R=="object"&&R.verifyurl&&!R.verifyurl.startsWith("fn:")&&(R.verifyurl=gi(R.verifyurl))}catch(R){x("unable to configure from X-Altcha-Config",R)}return _}}function jo(n){var v,b;const f=(v=a(O))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((b=f==null?void 0:f.value)==null?void 0:b.slice(f.value.indexOf("@")))||void 0}function di(){let n=fetch;if(m())if(x("using customfetch"),typeof m()=="string"){if(n=globalThis[m()]||null,!n)throw new Error(`Custom fetch function not found: ${m()}`)}else n=m();return n}function hi(n,f=[B()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(n).map(_=>_.toLowerCase()),b=f.reduce((_,A)=>(A=A.toLowerCase(),_||(n[A]?A:null)||v.find(p=>A.split("-")[0]===p.split("-")[0])||null),null);return n[b||"en"]}function Bo(){return Ne()==="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 Ne()=="object"?Ne():{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 vi(n){var v;return[...((v=a(O))==null?void 0:v.querySelectorAll(n!=null&&n.length?n.map(b=>`input[name="${b}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((b,_)=>{const A=_.name,p=_.value;return A&&p&&(b[A]=/\n/.test(p)?p.replace(new RegExp("(?<!\\r)\\n","g"),`\r
3
+ `):p),b},{})}function gi(n,f){const v=new URL(s()||location.origin),b=new URL(n,v);if(b.search||(b.search=v.search),f)for(const _ in f)f[_]!==void 0&&f[_]!==null&&b.searchParams.set(_,f[_]);return b.toString()}function Ho(){const n=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!n||n.includes(f.pluginName))&&Je.push(new f({el:a(se),clarify:Mt,dispatch:Ze,getConfiguration:xi,getFloatingAnchor:Si,getState:Ti,log:x,reset:wt,solve:ki,setState:Le,setFloatingAnchor:Di,verify:Ve}))}function x(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function Yo(){w(z,Q.PAUSED,!0)}function Go(n){w(z,Q.ERROR,!0)}function Zo(){w(z,Q.READY,!0)}function Wo(){w(z,Q.LOADING,!0)}function Jo(){w(z,Q.PLAYING,!0)}function Ko(){w(z,Q.PAUSED,!0)}function zo(n){var f;if(n.preventDefault(),n.stopPropagation(),a(Y)){const v=new FormData(n.target),b=String(v.get("code"));if((f=ae())!=null&&f.startsWith("fn:")){const _=ae().replace(/^fn:/,"");if(x(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:a(Y).challenge,code:b,solution:a(Y).solution})}w(ot,!0),Ii(dr(a(Y).challenge,a(Y).solution),b).then(({reason:_,verified:A})=>{A?(w(Y,null),Le(C.VERIFIED),x("verified"),Nr().then(()=>{var p;(p=a(qr))==null||p.focus(),Ze("verified",{payload:a(Fe)})})):(wt(),w(lt,_||"Verification failed",!0))}).catch(_=>{w(Y,null),Le(C.ERROR,_),x("sentinel verification failed:",_)}).finally(()=>{w(ot,!1)})}}function _i(n){var v;const f=n.target;E()&&f&&!a(se).contains(f)&&(a(k)===C.VERIFIED&&ee()===!1||a(k)===C.VERIFIED&&ee()==="focus"&&!((v=a(O))!=null&&v.matches(":focus-within"))||l()==="off"&&a(k)===C.UNVERIFIED)&&Ni()}function mi(){E()&&a(k)!==C.UNVERIFIED&&Ut()}function Xo(n){for(const f of Je)typeof f.onErrorChange=="function"&&f.onErrorChange(a(lt))}function bi(n){a(k)===C.UNVERIFIED?Ve():E()&&ee()==="focus"&&a(k)===C.VERIFIED&&Hr()}function wi(n){const f=n.target,v=n.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(a(O)&&l()==="onsubmit"?a(k)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ve().then(()=>{ta(v)})):a(k)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),a(k)===C.VERIFYING&&yi()):a(O)&&E()&&l()==="off"&&a(k)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Hr()))}function pi(){wt()}function yi(){a(k)===C.VERIFYING&&a(M).waitAlert&&alert(a(M).waitAlert)}function Ei(){a(We)?a(We).paused?(a(We).currentTime=0,a(We).play()):a(We).pause():(w(jr,!0),requestAnimationFrame(()=>{var n;(n=a(We))==null||n.play()}))}function Qo(n){for(const f of Je)typeof f.onStateChange=="function"&&f.onStateChange(a(k));E()&&a(k)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Ut()}),w(Ft,a(k)===C.VERIFIED)}function Ci(){E()&&Ut()}function Ai(n){return JSON.parse(n)}async function ea(n){if(!ae())throw new Error("Attribute verifyurl not set.");x("requesting server verification from",ae());const f={payload:n};if(Ne()!==!1){const{blockedCountries:_,classifier:A,disableRules:p,email:R,expectedLanguages:H,expectedCountries:re,fields:de,ipAddress:Ke,text:Gr,timeZone:gr}=Bo();f.blockedCountries=_,f.classifier=A,f.disableRules=p,f.email=R===!1?void 0:jo(R),f.expectedCountries=re,f.expectedLanguages=H||(ui?[ui]:void 0),f.fields=de===!1?void 0:vi(de),f.ipAddress=Ke===!1?void 0:Ke||"auto",f.text=Gr,f.timeZone=gr===!1?void 0:gr||li()}const v=await di()(ae(),{body:JSON.stringify(f),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 b=await v.json();if(b!=null&&b.payload&&w(Fe,b.payload,!0),Ze("serververification",b),u()&&b.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ii(n,f){if(!ae())throw new Error("Attribute verifyurl not set.");x("requesting sentinel verification from",ae());const v={code:f,payload:n};it()&&(v.fields=it().fields?vi():void 0,v.timeZone=it().timeZone?li():void 0);const b=await fetch(ae(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!b||!(b instanceof Response))throw new Error("Fetch function did not return a response.");if(b.status!==200)throw new Error(`Server responded with ${b.status}.`);const _=await b.json();return _!=null&&_.payload&&w(Fe,_.payload,!0),Ze("sentinelverification",_),_}function ta(n){var f;a(O)&&"requestSubmit"in a(O)?a(O).requestSubmit(n):(f=a(O))!=null&&f.reportValidity()&&(n?n.click():a(O).submit())}function Br(n){x("expire",n),De&&(clearTimeout(De),De=null),n<1?ci():De=setTimeout(ci,n)}function Ri(n){x("floating",n),E()!==n&&(a(se).style.left="",a(se).style.top=""),E(n===!0||n===""?"auto":n===!1||n==="false"?void 0:E()),E()?(l()||l("onsubmit"),document.addEventListener("scroll",mi),document.addEventListener("click",_i),window.addEventListener("resize",Ci)):l()==="onsubmit"&&l(void 0)}function $i(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(!si.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${si.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 ki(n){let f=null;if("Worker"in window){try{f=await ra(n,n.maxNumber||n.maxnumber||Ae())}catch(v){x(v)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in n)return{data:n,solution:f}}if("obfuscated"in n){const v=await _o(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await ho(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||Ae()).promise}}async function ra(n,f=typeof pe()=="number"?pe():n.maxNumber||n.maxnumber||Ae(),v=Math.ceil(mt())){const b=[];v=Math.min(16,f,Math.max(1,v));for(let p=0;p<v;p++)b.push(altchaCreateWorker(Ot()));const _=Math.ceil(f/v),A=await Promise.all(b.map((p,R)=>{const H=R*_;return new Promise(re=>{p.addEventListener("message",de=>{if(de.data)for(const Ke of b)Ke!==p&&Ke.postMessage({type:"abort"});re(de.data)}),p.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const p of b)p.terminate();return A.find(p=>!!p)||null}async function Mt(){if(!Ge()){Le(C.ERROR);return}const n=Je.find(f=>f.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Le(C.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 na(n){n.obfuscated!==void 0&&Ge(n.obfuscated),n.auto!==void 0&&(l(n.auto),l()==="onload"&&(Ge()?Mt():Ve())),n.blockspam!==void 0&&u(!!n.blockspam),n.customfetch!==void 0&&m(n.customfetch),n.floatinganchor!==void 0&&q(n.floatinganchor),n.delay!==void 0&&g(n.delay),n.floatingoffset!==void 0&&_e(n.floatingoffset),n.floating!==void 0&&Ri(n.floating),n.expire!==void 0&&(Br(n.expire),N(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),$i(a(Ur))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&oe(!!n.hidefooter),n.hidelogo!==void 0&&te(!!n.hidelogo),n.language!==void 0&&_t(hi(o(),[n.language])),n.maxnumber!==void 0&&Ae(+n.maxnumber),n.mockerror!==void 0&&Lt(!!n.mockerror),n.name!==void 0&&ce(n.name),n.refetchonexpire!==void 0&&Pt(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&Ne(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&_t(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&pe(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&ae(n.verifyurl),n.workers!==void 0&&mt(+n.workers),n.workerurl!==void 0&&Ot(n.workerurl)}function xi(){return{auto:l(),blockspam:u(),challengeurl:s(),debug:h(),delay:g(),expire:N(),floating:E(),floatinganchor:q(),floatingoffset:_e(),hidefooter:oe(),hidelogo:te(),name:ce(),maxnumber:Ae(),mockerror:Lt(),obfuscated:Ge(),refetchonexpire:Pt(),spamfilter:Ne(),strings:a(M),test:pe(),verifyurl:ae(),workers:mt(),workerurl:Ot()}}function Si(){return a(bt)}function ia(n){return Je.find(f=>f.constructor.pluginName===n)}function Ti(){return a(k)}function Ni(){a(se).style.display="none"}function Ut(n=20){var f;if(a(se))if(a(bt)||w(bt,(q()?document.querySelector(q()):(f=a(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||a(O),!0),a(bt)){const v=parseInt(_e(),10)||12,b=a(bt).getBoundingClientRect(),_=a(se).getBoundingClientRect(),A=document.documentElement.clientHeight,p=document.documentElement.clientWidth,R=E()==="auto"?b.bottom+_.height+v+n>A:E()==="top",H=Math.max(n,Math.min(p-n-_.width,b.left+b.width/2-_.width/2));if(R?a(se).style.top=`${b.top-(_.height+v)}px`:a(se).style.top=`${b.bottom+v}px`,a(se).style.left=`${H}px`,a(se).setAttribute("data-floating",R?"top":"bottom"),a(Vt)){const re=a(Vt).getBoundingClientRect();a(Vt).style.left=b.left-H+b.width/2-re.width/2+"px"}}else x("unable to find floating anchor element")}function wt(n=C.UNVERIFIED,f=null){De&&(clearTimeout(De),De=null),w(Ft,!1),w(Fe,null),w(Y,null),w(jr,!1),w(z,null),Le(n,f)}function Di(n){w(bt,n,!0)}function Le(n,f=null){w(k,n,!0),w(lt,f,!0),Ze("statechange",{payload:a(Fe),state:a(k)})}function Hr(){a(se).style.display="block",E()&&Ut()}async function Ve(){return wt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),qo().then(n=>($i(n),x("challenge",n),ki(n))).then(({data:n,solution:f})=>{var v;if(x("solution",f),!f||n&&"challenge"in n&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in n)if(ae()&&"codeChallenge"in n)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&y()===!1&&document.activeElement.blur(),w(Y,{challenge:n,solution:f},!0);else{if(ae()&&it()!==void 0)return Ii(dr(n,f));if(ae())return ea(dr(n,f));w(Fe,dr(n,f),!0),x("payload",a(Fe))}else 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(()=>{a(Y)?(Le(C.CODE),Nr().then(()=>{Ze("code",{codeChallenge:a(Y)})})):(Le(C.VERIFIED),x("verified"),Nr().then(()=>{Ze("verified",{payload:a(Fe)})}))}).catch(n=>{x(n),Le(C.ERROR,n.message)})}var Li=Po(),Pi=It(Li);Zl(Pi,t,"default",{});var qt=J(Pi,2),Yr=W(qt),hr=W(Yr);let Oi;var Fi=W(hr);{var la=n=>{Vr(n)};K(Fi,n=>{a(k)===C.VERIFYING&&n(la)})}var at=J(Fi,2);Jn(at),at.__change=[po,k,Ne,O,Ft,Ge,Mt,Ve],ar(at,n=>w(qr,n),()=>a(qr)),Z(hr);var vr=J(hr,2),oa=W(vr);{var aa=n=>{var f=or(),v=It(f);nt(v,()=>a(M).verified),j(n,f)},sa=(n,f)=>{{var v=_=>{var A=or(),p=It(A);nt(p,()=>a(M).verifying),j(_,A)},b=(_,A)=>{{var p=H=>{var re=or(),de=It(re);nt(de,()=>a(M).verificationRequired),j(H,re)},R=H=>{var re=or(),de=It(re);nt(de,()=>a(M).label),j(H,re)};K(_,H=>{a(k)===C.CODE?H(p):H(R,!1)},A)}};K(n,_=>{a(k)===C.VERIFYING?_(v):_(b,!1)},f)}};K(oa,n=>{a(k)===C.VERIFIED?n(aa):n(sa,!1)})}Z(vr);var Vi=J(vr,2);{var ua=n=>{var f=Eo();Jn(f),ke(()=>{P(f,"name",ce()),Xl(f,a(Fe))}),j(n,f)};K(Vi,n=>{a(k)===C.VERIFIED&&n(ua)})}var Mi=J(Vi,2);{var fa=n=>{var f=Co(),v=W(f);P(v,"href",Vo),Z(f),ke(()=>P(v,"aria-label",a(M).ariaLinkLabel)),j(n,f)};K(Mi,n=>{(te()!==!0||a(Mr))&&n(fa)})}var ca=J(Mi,2);{var da=n=>{var f=xo(),v=J(W(f),2),b=W(v),_=J(b,2);Ul(_,!y()),_.__keydown=[bo,Ei];var A=J(_,2),p=W(A),R=W(p);{var H=Ie=>{var X=$o();X.__click=Ei;var _r=W(X);{var jt=pt=>{Vr(pt,()=>20)},pa=(pt,ya)=>{{var Ea=yt=>{var Zr=Ao();j(yt,Zr)},Ca=(yt,Zr)=>{{var Aa=Et=>{var Wr=Io();j(Et,Wr)},Ia=Et=>{var Wr=Ro();j(Et,Wr)};K(yt,Et=>{a(z)===Q.PLAYING?Et(Aa):Et(Ia,!1)},Zr)}};K(pt,yt=>{a(z)===Q.ERROR?yt(Ea):yt(Ca,!1)},ya)}};K(_r,pt=>{a(z)===Q.LOADING?pt(jt):pt(pa,!1)})}Z(X),ke(()=>{P(X,"title",a(M).getAudioChallenge),X.disabled=a(z)===Q.LOADING||a(z)===Q.ERROR||a(ot),P(X,"aria-label",a(z)===Q.LOADING?a(M).loading:a(M).getAudioChallenge)}),j(Ie,X)};K(R,Ie=>{a(Y).challenge.codeChallenge.audio&&Ie(H)})}var re=J(R,2);re.__click=[wo,Ve],Z(p);var de=J(p,2),Ke=W(de);{var Gr=Ie=>{Vr(Ie,()=>16)};K(Ke,Ie=>{a(ot)&&Ie(Gr)})}var gr=J(Ke);Z(de),Z(A);var ba=J(A,2);{var wa=Ie=>{var X=ko(),_r=W(X);Z(X),ar(X,jt=>w(We,jt),()=>a(We)),ke(jt=>P(_r,"src",jt),[()=>gi(a(Y).challenge.codeChallenge.audio,{language:B()})]),Ye("loadstart",X,Wo),Ye("canplay",X,Zo),Ye("pause",X,Ko),Ye("playing",X,Jo),Ye("ended",X,Yo),Ye("error",_r,Go),j(Ie,X)};K(ba,Ie=>{a(Y).challenge.codeChallenge.audio&&a(jr)&&Ie(wa)})}Z(v),Z(f),ke(()=>{P(f,"aria-label",a(M).verificationRequired),P(b,"src",a(Y).challenge.codeChallenge.image),P(_,"minlength",a(Y).challenge.codeChallenge.length||1),P(_,"maxlength",a(Y).challenge.codeChallenge.length),P(_,"placeholder",a(M).enterCode),P(_,"aria-label",a(z)===Q.LOADING?a(M).loading:a(z)===Q.PLAYING?"":a(M).enterCodeAria),P(_,"aria-live",a(z)?"assertive":"polite"),P(_,"aria-busy",a(z)===Q.LOADING),_.disabled=a(ot),P(re,"aria-label",a(M).reload),P(re,"title",a(M).reload),re.disabled=a(ot),de.disabled=a(ot),P(de,"aria-label",a(M).verify),Hl(gr,` ${a(M).verify??""}`)}),Ye("submit",v,zo,!0),j(n,f)};K(ca,n=>{var f;(f=a(Y))!=null&&f.challenge.codeChallenge&&n(da)})}Z(Yr);var Ui=J(Yr,2);{var ha=n=>{var f=No(),v=J(W(f),2);{var b=A=>{var p=So(),R=W(p);nt(R,()=>a(M).expired),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)},_=A=>{var p=To(),R=W(p);nt(R,()=>a(M).error),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)};K(v,A=>{a(k)===C.EXPIRED?A(b):A(_,!1)})}Z(f),j(n,f)};K(Ui,n=>{(a(lt)||a(k)===C.EXPIRED)&&n(ha)})}var qi=J(Ui,2);{var va=n=>{var f=Do(),v=W(f),b=W(v);nt(b,()=>a(M).footer),Z(v),Z(f),j(n,f)};K(qi,n=>{a(M).footer&&(oe()!==!0||a(Mr))&&n(va)})}var ga=J(qi,2);{var _a=n=>{var f=Lo();ar(f,v=>w(Vt,v),()=>a(Vt)),j(n,f)};K(ga,n=>{E()&&n(_a)})}Z(qt),ar(qt,n=>w(se,n),()=>a(se)),ke(n=>{P(qt,"data-state",a(k)),P(qt,"data-floating",E()),Oi=Jl(hr,1,"altcha-checkbox",null,Oi,n),P(at,"id",a(fi)),at.required=l()!=="onsubmit"&&(!E()||l()!=="off"),P(vr,"for",a(fi))},[()=>({"altcha-checkbox-verifying":a(k)===C.VERIFYING})]),Ye("invalid",at,yi),eo(at,()=>a(Ft),n=>w(Ft,n)),j(e,Li);var ma=Un({clarify:Mt,configure:na,getConfiguration:xi,getFloatingAnchor:Si,getPlugin:ia,getState:Ti,hide:Ni,repositionFloating:Ut,reset:wt,setFloatingAnchor:Di,setState:Le,show:Hr,verify:Ve,get auto(){return l()},set auto(n=void 0){l(n),I()},get blockspam(){return u()},set blockspam(n=void 0){u(n),I()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),I()},get challengejson(){return c()},set challengejson(n=void 0){c(n),I()},get credentials(){return d()},set credentials(n=void 0){d(n),I()},get customfetch(){return m()},set customfetch(n=void 0){m(n),I()},get debug(){return h()},set debug(n=!1){h(n),I()},get delay(){return g()},set delay(n=0){g(n),I()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),I()},get expire(){return N()},set expire(n=void 0){N(n),I()},get floating(){return E()},set floating(n=void 0){E(n),I()},get floatinganchor(){return q()},set floatinganchor(n=void 0){q(n),I()},get floatingoffset(){return _e()},set floatingoffset(n=void 0){_e(n),I()},get floatingpersist(){return ee()},set floatingpersist(n=!1){ee(n),I()},get hidefooter(){return oe()},set hidefooter(n=!1){oe(n),I()},get hidelogo(){return te()},set hidelogo(n=!1){te(n),I()},get id(){return gt()},set id(n=void 0){gt(n),I()},get language(){return B()},set language(n=void 0){B(n),I()},get name(){return ce()},set name(n="altcha"){ce(n),I()},get maxnumber(){return Ae()},set maxnumber(n=1e6){Ae(n),I()},get mockerror(){return Lt()},set mockerror(n=!1){Lt(n),I()},get obfuscated(){return Ge()},set obfuscated(n=void 0){Ge(n),I()},get plugins(){return cr()},set plugins(n=void 0){cr(n),I()},get refetchonexpire(){return Pt()},set refetchonexpire(n=!0){Pt(n),I()},get sentinel(){return it()},set sentinel(n=void 0){it(n),I()},get spamfilter(){return Ne()},set spamfilter(n=!1){Ne(n),I()},get strings(){return _t()},set strings(n=void 0){_t(n),I()},get test(){return pe()},set test(n=!1){pe(n),I()},get verifyurl(){return ae()},set verifyurl(n=void 0){ae(n),I()},get workers(){return mt()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){mt(n),I()},get workerurl(){return Ot()},set workerurl(n=void 0){Ot(n),I()}});return i(),ma}Bl(["change","keydown","click"]),customElements.define("altcha-widget",uo(oi,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{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:{},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:T&&T.tagName.toUpperCase()==="SCRIPT"&&T.src||new URL("altcha.umd.cjs",document.baseURI).href)),S.Altcha=oi,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
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.0.0",
4
+ "version": "2.0.1",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Daniel Regeci",