altcha 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +1 -1
- package/README.md +142 -93
- package/dist/altcha.d.ts +5 -2
- package/dist/altcha.i18n.d.ts +158 -0
- package/dist/altcha.i18n.js +4017 -0
- package/dist/altcha.i18n.umd.js +4 -0
- package/dist/altcha.js +1888 -1763
- package/dist/altcha.umd.cjs +4 -14
- package/dist_external/altcha.css +1 -255
- package/dist_external/altcha.d.ts +5 -2
- package/dist_external/altcha.js +1844 -1728
- package/dist_external/altcha.umd.cjs +3 -13
- package/dist_i18n/af.d.ts +1 -0
- package/dist_i18n/af.js +76 -3
- package/dist_i18n/af.umd.cjs +1 -1
- package/dist_i18n/all.d.ts +1 -0
- package/dist_i18n/all.js +178 -105
- package/dist_i18n/all.umd.cjs +1 -1
- package/dist_i18n/americas.d.ts +1 -0
- package/dist_i18n/americas.js +80 -7
- package/dist_i18n/americas.umd.cjs +1 -1
- package/dist_i18n/ar.d.ts +1 -0
- package/dist_i18n/ar.js +76 -3
- package/dist_i18n/ar.umd.cjs +1 -1
- package/dist_i18n/asia.d.ts +1 -0
- package/dist_i18n/asia.js +105 -32
- package/dist_i18n/asia.umd.cjs +1 -1
- package/dist_i18n/bg.d.ts +1 -0
- package/dist_i18n/bg.js +76 -3
- package/dist_i18n/bg.umd.cjs +1 -1
- package/dist_i18n/bn.d.ts +1 -0
- package/dist_i18n/bn.js +76 -3
- package/dist_i18n/bn.umd.cjs +1 -1
- package/dist_i18n/bs.d.ts +1 -0
- package/dist_i18n/bs.js +76 -3
- package/dist_i18n/bs.umd.cjs +1 -1
- package/dist_i18n/ca.d.ts +1 -0
- package/dist_i18n/ca.js +76 -3
- package/dist_i18n/ca.umd.cjs +1 -1
- package/dist_i18n/cs.d.ts +1 -0
- package/dist_i18n/cs.js +76 -3
- package/dist_i18n/cs.umd.cjs +1 -1
- package/dist_i18n/da.d.ts +1 -0
- package/dist_i18n/da.js +76 -3
- package/dist_i18n/da.umd.cjs +1 -1
- package/dist_i18n/de.d.ts +1 -0
- package/dist_i18n/de.js +76 -3
- package/dist_i18n/de.umd.cjs +1 -1
- package/dist_i18n/el.d.ts +1 -0
- package/dist_i18n/el.js +76 -3
- package/dist_i18n/el.umd.cjs +1 -1
- package/dist_i18n/en.d.ts +1 -0
- package/dist_i18n/en.js +76 -3
- package/dist_i18n/en.umd.cjs +1 -1
- package/dist_i18n/es-419.d.ts +1 -0
- package/dist_i18n/es-419.js +76 -3
- package/dist_i18n/es-419.umd.cjs +1 -1
- package/dist_i18n/es-es.d.ts +1 -0
- package/dist_i18n/es-es.js +76 -3
- package/dist_i18n/es-es.umd.cjs +1 -1
- package/dist_i18n/et.d.ts +1 -0
- package/dist_i18n/et.js +76 -3
- package/dist_i18n/et.umd.cjs +1 -1
- package/dist_i18n/eu.d.ts +1 -0
- package/dist_i18n/eu.js +76 -3
- package/dist_i18n/eu.umd.cjs +1 -1
- package/dist_i18n/europe.d.ts +1 -0
- package/dist_i18n/europe.js +139 -66
- package/dist_i18n/europe.umd.cjs +1 -1
- package/dist_i18n/fi.d.ts +1 -0
- package/dist_i18n/fi.js +76 -3
- package/dist_i18n/fi.umd.cjs +1 -1
- package/dist_i18n/fr-ca.d.ts +1 -0
- package/dist_i18n/fr-ca.js +77 -4
- package/dist_i18n/fr-ca.umd.cjs +1 -1
- package/dist_i18n/fr-fr.d.ts +1 -0
- package/dist_i18n/fr-fr.js +77 -4
- package/dist_i18n/fr-fr.umd.cjs +1 -1
- package/dist_i18n/ga.d.ts +1 -0
- package/dist_i18n/ga.js +76 -3
- package/dist_i18n/ga.umd.cjs +1 -1
- package/dist_i18n/he.d.ts +1 -0
- package/dist_i18n/he.js +76 -3
- package/dist_i18n/he.umd.cjs +1 -1
- package/dist_i18n/hi.d.ts +1 -0
- package/dist_i18n/hi.js +76 -3
- package/dist_i18n/hi.umd.cjs +1 -1
- package/dist_i18n/hr.d.ts +1 -0
- package/dist_i18n/hr.js +76 -3
- package/dist_i18n/hr.umd.cjs +1 -1
- package/dist_i18n/hu.d.ts +1 -0
- package/dist_i18n/hu.js +76 -3
- package/dist_i18n/hu.umd.cjs +1 -1
- package/dist_i18n/id.d.ts +1 -0
- package/dist_i18n/id.js +76 -3
- package/dist_i18n/id.umd.cjs +1 -1
- package/dist_i18n/is.d.ts +1 -0
- package/dist_i18n/is.js +76 -3
- package/dist_i18n/is.umd.cjs +1 -1
- package/dist_i18n/it.d.ts +1 -0
- package/dist_i18n/it.js +76 -3
- package/dist_i18n/it.umd.cjs +1 -1
- package/dist_i18n/ja.d.ts +1 -0
- package/dist_i18n/ja.js +76 -3
- package/dist_i18n/ja.umd.cjs +1 -1
- package/dist_i18n/ko.d.ts +1 -0
- package/dist_i18n/ko.js +76 -3
- package/dist_i18n/ko.umd.cjs +1 -1
- package/dist_i18n/lt.d.ts +1 -0
- package/dist_i18n/lt.js +76 -3
- package/dist_i18n/lt.umd.cjs +1 -1
- package/dist_i18n/lv.d.ts +1 -0
- package/dist_i18n/lv.js +76 -3
- package/dist_i18n/lv.umd.cjs +1 -1
- package/dist_i18n/mr.d.ts +1 -0
- package/dist_i18n/mr.js +76 -3
- package/dist_i18n/mr.umd.cjs +1 -1
- package/dist_i18n/mt.d.ts +1 -0
- package/dist_i18n/mt.js +76 -3
- package/dist_i18n/mt.umd.cjs +1 -1
- package/dist_i18n/nb.d.ts +1 -0
- package/dist_i18n/nb.js +77 -4
- package/dist_i18n/nb.umd.cjs +1 -1
- package/dist_i18n/nl.d.ts +1 -0
- package/dist_i18n/nl.js +76 -3
- package/dist_i18n/nl.umd.cjs +1 -1
- package/dist_i18n/pl.d.ts +1 -0
- package/dist_i18n/pl.js +76 -3
- package/dist_i18n/pl.umd.cjs +1 -1
- package/dist_i18n/pt-br.d.ts +1 -0
- package/dist_i18n/pt-br.js +76 -3
- package/dist_i18n/pt-br.umd.cjs +1 -1
- package/dist_i18n/pt-pt.d.ts +1 -0
- package/dist_i18n/pt-pt.js +76 -3
- package/dist_i18n/pt-pt.umd.cjs +1 -1
- package/dist_i18n/ro.d.ts +1 -0
- package/dist_i18n/ro.js +76 -3
- package/dist_i18n/ro.umd.cjs +1 -1
- package/dist_i18n/ru.d.ts +1 -0
- package/dist_i18n/ru.js +76 -3
- package/dist_i18n/ru.umd.cjs +1 -1
- package/dist_i18n/sk.d.ts +1 -0
- package/dist_i18n/sk.js +76 -3
- package/dist_i18n/sk.umd.cjs +1 -1
- package/dist_i18n/sl.d.ts +1 -0
- package/dist_i18n/sl.js +76 -3
- package/dist_i18n/sl.umd.cjs +1 -1
- package/dist_i18n/sr.d.ts +1 -0
- package/dist_i18n/sr.js +76 -3
- package/dist_i18n/sr.umd.cjs +1 -1
- package/dist_i18n/sv.d.ts +1 -0
- package/dist_i18n/sv.js +76 -3
- package/dist_i18n/sv.umd.cjs +1 -1
- package/dist_i18n/ta.d.ts +1 -0
- package/dist_i18n/ta.js +76 -3
- package/dist_i18n/ta.umd.cjs +1 -1
- package/dist_i18n/te.d.ts +1 -0
- package/dist_i18n/te.js +76 -3
- package/dist_i18n/te.umd.cjs +1 -1
- package/dist_i18n/th.d.ts +1 -0
- package/dist_i18n/th.js +76 -3
- package/dist_i18n/th.umd.cjs +1 -1
- package/dist_i18n/tr.d.ts +1 -0
- package/dist_i18n/tr.js +76 -3
- package/dist_i18n/tr.umd.cjs +1 -1
- package/dist_i18n/uk.d.ts +1 -0
- package/dist_i18n/uk.js +76 -3
- package/dist_i18n/uk.umd.cjs +1 -1
- package/dist_i18n/ur.d.ts +1 -0
- package/dist_i18n/ur.js +76 -3
- package/dist_i18n/ur.umd.cjs +1 -1
- package/dist_i18n/vi.d.ts +1 -0
- package/dist_i18n/vi.js +76 -3
- package/dist_i18n/vi.umd.cjs +1 -1
- package/dist_i18n/zh-cn.d.ts +1 -0
- package/dist_i18n/zh-cn.js +76 -3
- package/dist_i18n/zh-cn.umd.cjs +1 -1
- package/dist_i18n/zh-tw.d.ts +1 -0
- package/dist_i18n/zh-tw.js +76 -3
- package/dist_i18n/zh-tw.umd.cjs +1 -1
- package/package.json +13 -7
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
(function(N,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(N=typeof globalThis<"u"?globalThis:N||self,S(N.altcha={}))})(this,function(N){"use strict";var so=Object.defineProperty;var Ii=N=>{throw TypeError(N)};var uo=(N,S,G)=>S in N?so(N,S,{enumerable:!0,configurable:!0,writable:!0,value:G}):N[S]=G;var Ee=(N,S,G)=>uo(N,typeof S!="symbol"?S+"":S,G),Ri=(N,S,G)=>S.has(N)||Ii("Cannot "+G);var ce=(N,S,G)=>(Ri(N,S,"read from private field"),G?G.call(N):S.get(N)),Vr=(N,S,G)=>S.has(N)?Ii("Cannot add the same private member more than once"):S instanceof WeakSet?S.add(N):S.set(N,G),Mr=(N,S,G,Ft)=>(Ri(N,S,"write to private field"),Ft?Ft.call(N,G):S.set(N,G),G);var Bn,Ve,we;var S=typeof document<"u"?document.currentScript:null;const G="5";typeof window<"u"&&((Bn=window.__svelte??(window.__svelte={})).v??(Bn.v=new Set)).add(G);const Ft=1,$i=4,Ni=8,Si=16,Ti=1,Di=2,cr="[",Ur="[!",jr="]",st={},oe=Symbol(),Li="http://www.w3.org/1999/xhtml",qr=!1,pe=2,Br=4,Vt=8,dr=16,Te=32,Qe=64,Mt=128,_e=256,Ut=512,de=1024,De=2048,ut=4096,ft=8192,jt=16384,Pi=32768,hr=65536,Oi=1<<19,Hr=1<<20,xt=Symbol("$state"),Yr=Symbol("legacy props"),Fi=Symbol("");var Gr=Array.isArray,Vi=Array.prototype.indexOf,Mi=Array.from,qt=Object.keys,Bt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,Ui=Object.getOwnPropertyDescriptors,ji=Object.prototype,qi=Array.prototype,Zr=Object.getPrototypeOf;function Wr(e){for(var t=0;t<e.length;t++)e[t]()}function Bi(e,t,r=!1){return e===void 0?r?t():t:e}const Hi=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Et=[],Ct=[];function zr(){var e=Et;Et=[],Wr(e)}function Jr(){var e=Ct;Ct=[],Wr(e)}function Ht(e){Et.length===0&&queueMicrotask(zr),Et.push(e)}function Yi(e){Ct.length===0&&Hi(Jr),Ct.push(e)}function Kr(){Et.length>0&&zr(),Ct.length>0&&Jr()}function Xr(e){return e===this.v}function Gi(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function vr(e){return!Gi(e,this.v)}function Zi(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Wi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function zi(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ji(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ki(){throw new Error("https://svelte.dev/e/hydration_failed")}function Xi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Qi(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function el(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function tl(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function rl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let nl=!1;function Ce(e,t){var r={f:0,v:e,reactions:null,equals:Xr,rv:0,wv:0};return r}function se(e){return il(Ce(e))}function Qr(e,t=!1){const r=Ce(e);return t||(r.equals=vr),r}function il(e){return T!==null&&!be&&(T.f&pe)!==0&&(Ae===null?cl([e]):Ae.push(e)),e}function b(e,t){return T!==null&&!be&&An()&&(T.f&(pe|dr))!==0&&(Ae===null||!Ae.includes(e))&&rl(),ll(e,t)}function ll(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=cn(),en(e,De),L!==null&&(L.f&de)!==0&&(L.f&(Te|Qe))===0&&(Pe===null?dl([e]):Pe.push(e))),t}function en(e,t){var r=e.reactions;if(r!==null)for(var l=r.length,i=0;i<l;i++){var a=r[i],s=a.f;(s&De)===0&&(ke(a,t),(s&(de|_e))!==0&&((s&pe)!==0?en(a,ut):Qt(a)))}}function je(e){var t=pe|De,r=T!==null&&(T.f&pe)!==0?T:null;return L===null||r!==null&&(r.f&_e)!==0?t|=_e:L.f|=Hr,{ctx:ne,deps:null,effects:null,equals:Xr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function al(e){const t=je(e);return t.equals=vr,t}function tn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Fe(t[r])}}function ol(e){for(var t=e.parent;t!==null;){if((t.f&pe)===0)return t;t=t.parent}return null}function sl(e){var t,r=L;Ye(ol(e));try{tn(e),t=hn(e)}finally{Ye(r)}return t}function rn(e){var t=sl(e),r=(Ge||(e.f&_e)!==0)&&e.deps!==null?ut:de;ke(e,r),e.equals(t)||(e.v=t,e.wv=cn())}function Yt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let P=!1;function ct(e){P=e}let O;function qe(e){if(e===null)throw Yt(),st;return O=e}function dt(){return qe(Be(O))}function Z(e){if(P){if(Be(O)!==null)throw Yt(),st;O=e}}function ul(){for(var e=0,t=O;;){if(t.nodeType===8){var r=t.data;if(r===jr){if(e===0)return t;e-=1}else(r===cr||r===Ur)&&(e+=1)}var l=Be(t);t.remove(),t=l}}function M(e,t=null,r){if(typeof e!="object"||e===null||xt in e)return e;const l=Zr(e);if(l!==ji&&l!==qi)return e;var i=new Map,a=Gr(e),s=Ce(0);a&&i.set("length",Ce(e.length));var f;return new Proxy(e,{defineProperty(c,d,w){(!("value"in w)||w.configurable===!1||w.enumerable===!1||w.writable===!1)&&Qi();var v=i.get(d);return v===void 0?(v=Ce(w.value),i.set(d,v)):b(v,M(w.value,f)),!0},deleteProperty(c,d){var w=i.get(d);if(w===void 0)d in c&&i.set(d,Ce(oe));else{if(a&&typeof d=="string"){var v=i.get("length"),h=Number(d);Number.isInteger(h)&&h<v.v&&b(v,h)}b(w,oe),nn(s)}return!0},get(c,d,w){var k;if(d===xt)return e;var v=i.get(d),h=d in c;if(v===void 0&&(!h||(k=et(c,d))!=null&&k.writable)&&(v=Ce(M(h?c[d]:oe,f)),i.set(d,v)),v!==void 0){var p=o(v);return p===oe?void 0:p}return Reflect.get(c,d,w)},getOwnPropertyDescriptor(c,d){var w=Reflect.getOwnPropertyDescriptor(c,d);if(w&&"value"in w){var v=i.get(d);v&&(w.value=o(v))}else if(w===void 0){var h=i.get(d),p=h==null?void 0:h.v;if(h!==void 0&&p!==oe)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return w},has(c,d){var p;if(d===xt)return!0;var w=i.get(d),v=w!==void 0&&w.v!==oe||Reflect.has(c,d);if(w!==void 0||L!==null&&(!v||(p=et(c,d))!=null&&p.writable)){w===void 0&&(w=Ce(v?M(c[d],f):oe),i.set(d,w));var h=o(w);if(h===oe)return!1}return v},set(c,d,w,v){var ee;var h=i.get(d),p=d in c;if(a&&d==="length")for(var k=w;k<h.v;k+=1){var F=i.get(k+"");F!==void 0?b(F,oe):k in c&&(F=Ce(oe),i.set(k+"",F))}h===void 0?(!p||(ee=et(c,d))!=null&&ee.writable)&&(h=Ce(void 0),b(h,M(w,f)),i.set(d,h)):(p=h.v!==oe,b(h,M(w,f)));var U=Reflect.getOwnPropertyDescriptor(c,d);if(U!=null&&U.set&&U.set.call(v,w),!p){if(a&&typeof d=="string"){var ve=i.get("length"),ue=Number(d);Number.isInteger(ue)&&ue>=ve.v&&b(ve,ue+1)}nn(s)}return!0},ownKeys(c){o(s);var d=Reflect.ownKeys(c).filter(h=>{var p=i.get(h);return p===void 0||p.v!==oe});for(var[w,v]of i)v.v!==oe&&!(w in c)&&d.push(w);return d},setPrototypeOf(){el()}})}function nn(e,t=1){b(e,e.v+t)}var ln,an,on,sn;function gr(){if(ln===void 0){ln=window,an=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;on=et(t,"firstChild").get,sn=et(t,"nextSibling").get,e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0,Text.prototype.__t=void 0}}function Gt(e=""){return document.createTextNode(e)}function Le(e){return on.call(e)}function Be(e){return sn.call(e)}function W(e,t){if(!P)return Le(e);var r=Le(O);return r===null&&(r=O.appendChild(Gt())),qe(r),r}function At(e,t){if(!P){var r=Le(e);return r instanceof Comment&&r.data===""?Be(r):r}return O}function z(e,t=1,r=!1){let l=P?O:e;for(var i;t--;)i=l,l=Be(l);if(!P)return l;var a=l==null?void 0:l.nodeType;if(r&&a!==3){var s=Gt();return l===null?i==null||i.after(s):l.before(s),qe(s),s}return qe(l),l}function fl(e){e.textContent=""}let Zt=!1,Wt=!1,zt=null,tt=!1,_r=!1;function un(e){_r=e}let kt=[],fo=[],T=null,be=!1;function He(e){T=e}let L=null;function Ye(e){L=e}let Ae=null;function cl(e){Ae=e}let re=null,he=0,Pe=null;function dl(e){Pe=e}let fn=1,Jt=0,Ge=!1;function cn(){return++fn}function It(e){var v;var t=e.f;if((t&De)!==0)return!0;if((t&ut)!==0){var r=e.deps,l=(t&_e)!==0;if(r!==null){var i,a,s=(t&Ut)!==0,f=l&&L!==null&&!Ge,c=r.length;if(s||f){var d=e,w=d.parent;for(i=0;i<c;i++)a=r[i],(s||!((v=a==null?void 0:a.reactions)!=null&&v.includes(d)))&&(a.reactions??(a.reactions=[])).push(d);s&&(d.f^=Ut),f&&w!==null&&(w.f&_e)===0&&(d.f^=_e)}for(i=0;i<c;i++)if(a=r[i],It(a)&&rn(a),a.wv>e.wv)return!0}(!l||L!==null&&!Ge)&&ke(e,de)}return!1}function hl(e,t){for(var r=t;r!==null;){if((r.f&Mt)!==0)try{r.fn(e);return}catch{r.f^=Mt}r=r.parent}throw Zt=!1,e}function vl(e){return(e.f&jt)===0&&(e.parent===null||(e.parent.f&Mt)===0)}function Kt(e,t,r,l){if(Zt){if(r===null&&(Zt=!1),vl(t))throw e;return}r!==null&&(Zt=!0);{hl(e,t);return}}function dn(e,t,r=!0){var l=e.reactions;if(l!==null)for(var i=0;i<l.length;i++){var a=l[i];(a.f&pe)!==0?dn(a,t,!1):t===a&&(r?ke(a,De):(a.f&de)!==0&&ke(a,ut),Qt(a))}}function hn(e){var p;var t=re,r=he,l=Pe,i=T,a=Ge,s=Ae,f=ne,c=be,d=e.f;re=null,he=0,Pe=null,Ge=(d&_e)!==0&&(be||!tt||T===null),T=(d&(Te|Qe))===0?e:null,Ae=null,xn(e.ctx),be=!1,Jt++;try{var w=(0,e.fn)(),v=e.deps;if(re!==null){var h;if(Xt(e,he),v!==null&&he>0)for(v.length=he+re.length,h=0;h<re.length;h++)v[he+h]=re[h];else e.deps=v=re;if(!Ge)for(h=he;h<v.length;h++)((p=v[h]).reactions??(p.reactions=[])).push(e)}else v!==null&&he<v.length&&(Xt(e,he),v.length=he);if(An()&&Pe!==null&&!be&&v!==null&&(e.f&(pe|ut|De))===0)for(h=0;h<Pe.length;h++)dn(Pe[h],e);return i!==null&&Jt++,w}finally{re=t,he=r,Pe=l,T=i,Ge=a,Ae=s,xn(f),be=c}}function gl(e,t){let r=t.reactions;if(r!==null){var l=Vi.call(r,e);if(l!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[l]=r[i],r.pop())}}r===null&&(t.f&pe)!==0&&(re===null||!re.includes(t))&&(ke(t,ut),(t.f&(_e|Ut))===0&&(t.f^=Ut),tn(t),Xt(t,0))}function Xt(e,t){var r=e.deps;if(r!==null)for(var l=t;l<r.length;l++)gl(e,r[l])}function wr(e){var t=e.f;if((t&jt)===0){ke(e,de);var r=L,l=ne,i=tt;L=e,tt=!0;try{(t&dr)!==0?Al(e):_n(e),gn(e);var a=hn(e);e.teardown=typeof a=="function"?a:null,e.wv=fn;var s=e.deps,f;qr&&nl&&e.f&De}catch(c){Kt(c,e,r,l||e.ctx)}finally{tt=i,L=r}}}function _l(){try{Ji()}catch(e){if(zt!==null)Kt(e,zt,null);else throw e}}function vn(){var e=tt;try{var t=0;for(tt=!0;kt.length>0;){t++>1e3&&_l();var r=kt,l=r.length;kt=[];for(var i=0;i<l;i++){var a=ml(r[i]);wl(a)}}}finally{Wt=!1,tt=e,zt=null}}function wl(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var l=e[r];if((l.f&(jt|ft))===0)try{It(l)&&(wr(l),l.deps===null&&l.first===null&&l.nodes_start===null&&(l.teardown===null?wn(l):l.fn=null))}catch(i){Kt(i,l,null,l.ctx)}}}function Qt(e){Wt||(Wt=!0,queueMicrotask(vn));for(var t=zt=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Qe|Te))!==0){if((r&de)===0)return;t.f^=de}}kt.push(t)}function ml(e){for(var t=[],r=e;r!==null;){var l=r.f,i=(l&(Te|Qe))!==0,a=i&&(l&de)!==0;if(!a&&(l&ft)===0){if((l&Br)!==0)t.push(r);else if(i)r.f^=de;else{var s=T;try{T=r,It(r)&&wr(r)}catch(d){Kt(d,r,null,r.ctx)}finally{T=s}}var f=r.first;if(f!==null){r=f;continue}}var c=r.parent;for(r=r.next;r===null&&c!==null;)r=c.next,c=c.parent}return t}function C(e){var t;for(Kr();kt.length>0;)Wt=!0,vn(),Kr();return t}async function mr(){await Promise.resolve(),C()}function o(e){var t=e.f,r=(t&pe)!==0;if(T!==null&&!be){Ae!==null&&Ae.includes(e)&&tl();var l=T.deps;e.rv<Jt&&(e.rv=Jt,re===null&&l!==null&&l[he]===e?he++:re===null?re=[e]:(!Ge||!re.includes(e))&&re.push(e))}else if(r&&e.deps===null&&e.effects===null){var i=e,a=i.parent;a!==null&&(a.f&_e)===0&&(i.f^=_e)}return r&&(i=e,It(i)&&rn(i)),e.v}function ht(e){var t=be;try{return be=!0,e()}finally{be=t}}const pl=-7169;function ke(e,t){e.f=e.f&pl|t}function bl(e){L===null&&T===null&&zi(),T!==null&&(T.f&_e)!==0&&L===null&&Wi(),_r&&Zi()}function yl(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,l=!0){var i=L,a={ctx:ne,deps:null,nodes_start:null,nodes_end:null,f:e|De,first:null,fn:t,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(r)try{wr(a),a.f|=Pi}catch(c){throw Fe(a),c}else t!==null&&Qt(a);var s=r&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&(Hr|Mt))===0;if(!s&&l&&(i!==null&&yl(a,i),T!==null&&(T.f&pe)!==0)){var f=T;(f.effects??(f.effects=[])).push(a)}return a}function xl(e){const t=rt(Vt,null,!1);return ke(t,de),t.teardown=e,t}function pr(e){bl();var t=L!==null&&(L.f&Te)!==0&&ne!==null&&!ne.m;if(t){var r=ne;(r.e??(r.e=[])).push({fn:e,effect:L,reaction:T})}else{var l=br(e);return l}}function El(e){const t=rt(Qe,e,!0);return()=>{Fe(t)}}function Cl(e){const t=rt(Qe,e,!0);return(r={})=>new Promise(l=>{r.outro?Er(t,()=>{Fe(t),l(void 0)}):(Fe(t),l(void 0))})}function br(e){return rt(Br,e,!1)}function yr(e){return rt(Vt,e,!0)}function Oe(e,t=[],r=je){const l=t.map(r);return xr(()=>e(...l.map(o)))}function xr(e,t=0){return rt(Vt|dr|t,e,!0)}function er(e,t=!0){return rt(Vt|Te,e,!0,t)}function gn(e){var t=e.teardown;if(t!==null){const r=_r,l=T;un(!0),He(null);try{t.call(null)}finally{un(r),He(l)}}}function _n(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var l=r.next;(r.f&Qe)!==0?r.parent=null:Fe(r,t),r=l}}function Al(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Te)===0&&Fe(t),t=r}}function Fe(e,t=!0){var r=!1;if((t||(e.f&Oi)!==0)&&e.nodes_start!==null){for(var l=e.nodes_start,i=e.nodes_end;l!==null;){var a=l===i?null:Be(l);l.remove(),l=a}r=!0}_n(e,t&&!r),Xt(e,0),ke(e,jt);var s=e.transitions;if(s!==null)for(const c of s)c.stop();gn(e);var f=e.parent;f!==null&&f.first!==null&&wn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function wn(e){var t=e.parent,r=e.prev,l=e.next;r!==null&&(r.next=l),l!==null&&(l.prev=r),t!==null&&(t.first===e&&(t.first=l),t.last===e&&(t.last=r))}function Er(e,t){var r=[];mn(e,r,!0),kl(r,()=>{Fe(e),t&&t()})}function kl(e,t){var r=e.length;if(r>0){var l=()=>--r||t();for(var i of e)i.out(l)}else t()}function mn(e,t,r){if((e.f&ft)===0){if(e.f^=ft,e.transitions!==null)for(const s of e.transitions)(s.is_global||r)&&t.push(s);for(var l=e.first;l!==null;){var i=l.next,a=(l.f&hr)!==0||(l.f&Te)!==0;mn(l,t,a?r:!1),l=i}}}function pn(e){bn(e,!0)}function bn(e,t){if((e.f&ft)!==0){e.f^=ft,(e.f&de)===0&&(e.f^=de),It(e)&&(ke(e,De),Qt(e));for(var r=e.first;r!==null;){var l=r.next,i=(r.f&hr)!==0||(r.f&Te)!==0;bn(r,i?t:!1),r=l}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}function yn(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let ne=null;function xn(e){ne=e}function En(e,t=!1,r){ne={p:ne,c:null,e:null,m:!1,s:e,x:null,l:null}}function Cn(e){const t=ne;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var r=L,l=T;t.e=null;try{for(var i=0;i<s.length;i++){var a=s[i];Ye(a.effect),He(a.reaction),br(a.fn)}}finally{Ye(r),He(l)}}ne=t.p,t.m=!0}return e||{}}function An(){return!0}const Il=["touchstart","touchmove"];function Rl(e){return Il.includes(e)}function $l(e,t){if(t){const r=document.body;e.autofocus=!0,Ht(()=>{document.activeElement===r&&e.focus()})}}let kn=!1;function In(){kn||(kn=!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 Rn(e){var t=T,r=L;He(null),Ye(null);try{return e()}finally{He(t),Ye(r)}}function Nl(e,t,r,l=r){e.addEventListener(t,()=>Rn(r));const i=e.__on_r;i?e.__on_r=()=>{i(),l(!0)}:e.__on_r=()=>l(!0),In()}const $n=new Set,Cr=new Set;function Sl(e,t,r,l={}){function i(a){if(l.capture||Rt.call(t,a),!a.cancelBubble)return Rn(()=>r==null?void 0:r.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ht(()=>{t.addEventListener(e,i,l)}):t.addEventListener(e,i,l),i}function Ze(e,t,r,l,i){var a={capture:l,passive:i},s=Sl(e,t,r,a);(t===document.body||t===window||t===document)&&xl(()=>{t.removeEventListener(e,s,a)})}function Tl(e){for(var t=0;t<e.length;t++)$n.add(e[t]);for(var r of Cr)r(e)}function Rt(e){var ue;var t=this,r=t.ownerDocument,l=e.type,i=((ue=e.composedPath)==null?void 0:ue.call(e))||[],a=i[0]||e.target,s=0,f=e.__root;if(f){var c=i.indexOf(f);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=i.indexOf(t);if(d===-1)return;c<=d&&(s=c)}if(a=i[s]||e.target,a!==t){Bt(e,"currentTarget",{configurable:!0,get(){return a||r}});var w=T,v=L;He(null),Ye(null);try{for(var h,p=[];a!==null;){var k=a.assignedSlot||a.parentNode||a.host||null;try{var F=a["__"+l];if(F!=null&&(!a.disabled||e.target===a))if(Gr(F)){var[U,...ve]=F;U.apply(a,[e,...ve])}else F.call(a,e)}catch(ee){h?p.push(ee):h=ee}if(e.cancelBubble||k===t||k===null)break;a=k}if(h){for(let ee of p)queueMicrotask(()=>{throw ee});throw h}}finally{e.__root=t,delete e.currentTarget,He(w),Ye(v)}}}function Ar(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ie(e,t){var r=L;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function ye(e,t){var r=(t&Ti)!==0,l=(t&Di)!==0,i,a=!e.startsWith("<!>");return()=>{if(P)return Ie(O,null),O;i===void 0&&(i=Ar(a?e:"<!>"+e),r||(i=Le(i)));var s=l||an?document.importNode(i,!0):i.cloneNode(!0);if(r){var f=Le(s),c=s.lastChild;Ie(f,c)}else Ie(s,s);return s}}function tr(e,t,r="svg"){var l=!e.startsWith("<!>"),i=`<${r}>${l?e:"<!>"+e}</${r}>`,a;return()=>{if(P)return Ie(O,null),O;if(!a){var s=Ar(i),f=Le(s);a=Le(f)}var c=a.cloneNode(!0);return Ie(c,c),c}}function rr(){if(P)return Ie(O,null),O;var e=document.createDocumentFragment(),t=document.createComment(""),r=Gt();return e.append(t,r),Ie(t,r),e}function q(e,t){if(P){L.nodes_end=O,dt();return}e!==null&&e.before(t)}function Dl(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 Nn(e,t){return Sn(e,t)}function Ll(e,t){gr(),t.intro=t.intro??!1;const r=t.target,l=P,i=O;try{for(var a=Le(r);a&&(a.nodeType!==8||a.data!==cr);)a=Be(a);if(!a)throw st;ct(!0),qe(a),dt();const s=Sn(e,{...t,anchor:a});if(O===null||O.nodeType!==8||O.data!==jr)throw Yt(),st;return ct(!1),s}catch(s){if(s===st)return t.recover===!1&&Ki(),gr(),fl(r),ct(!1),Nn(e,t);throw s}finally{ct(l),qe(i)}}const vt=new Map;function Sn(e,{target:t,anchor:r,props:l={},events:i,context:a,intro:s=!0}){gr();var f=new Set,c=v=>{for(var h=0;h<v.length;h++){var p=v[h];if(!f.has(p)){f.add(p);var k=Rl(p);t.addEventListener(p,Rt,{passive:k});var F=vt.get(p);F===void 0?(document.addEventListener(p,Rt,{passive:k}),vt.set(p,1)):vt.set(p,F+1)}}};c(Mi($n)),Cr.add(c);var d=void 0,w=Cl(()=>{var v=r??t.appendChild(Gt());return er(()=>{if(a){En({});var h=ne;h.c=a}i&&(l.$$events=i),P&&Ie(v,null),d=e(v,l)||{},P&&(L.nodes_end=O),a&&Cn()}),()=>{var k;for(var h of f){t.removeEventListener(h,Rt);var p=vt.get(h);--p===0?(document.removeEventListener(h,Rt),vt.delete(h)):vt.set(h,p)}Cr.delete(c),v!==r&&((k=v.parentNode)==null||k.removeChild(v))}});return kr.set(d,w),d}let kr=new WeakMap;function Pl(e,t){const r=kr.get(e);return r?(kr.delete(e),r(t)):Promise.resolve()}function J(e,t,[r,l]=[0,0]){P&&r===0&&dt();var i=e,a=null,s=null,f=oe,c=r>0?hr:0,d=!1;const w=(h,p=!0)=>{d=!0,v(p,h)},v=(h,p)=>{if(f===(f=h))return;let k=!1;if(P&&l!==-1){if(r===0){const U=i.data;U===cr?l=0:U===Ur?l=1/0:(l=parseInt(U.substring(1)),l!==l&&(l=f?1/0:-1))}const F=l>r;!!f===F&&(i=ul(),qe(i),ct(!1),k=!0,l=-1)}f?(a?pn(a):p&&(a=er(()=>p(i))),s&&Er(s,()=>{s=null})):(s?pn(s):p&&(s=er(()=>p(i,[r+1,l]))),a&&Er(a,()=>{a=null})),k&&ct(!0)};xr(()=>{d=!1,t(w),d||v(null,null)},c),P&&(i=O)}function nt(e,t,r,l,i){var a=e,s="",f;xr(()=>{if(s===(s=t()??"")){P&&dt();return}f!==void 0&&(Fe(f),f=void 0),s!==""&&(f=er(()=>{if(P){O.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Be(c);if(c===null)throw Yt(),st;Ie(O,d),a=qe(c);return}var w=s+"",v=Ar(w);Ie(Le(v),v.lastChild),a.before(v)}))})}function Ol(e,t,r,l,i){var f;P&&dt();var a=(f=t.$$slots)==null?void 0:f[r],s=!1;a===!0&&(a=t.children,s=!0),a===void 0||a(e,s?()=>l:l)}function Fl(e,t){Ht(()=>{var r=e.getRootNode(),l=r.host?r:r.head??r.ownerDocument.head;if(!l.querySelector("#"+t.hash)){const i=document.createElement("style");i.id=t.hash,i.textContent=t.code,l.appendChild(i)}})}const Tn=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function Vl(e,t,r){var l=""+e;if(r){for(var i in r)if(r[i])l=l?l+" "+i:i;else if(l.length)for(var a=i.length,s=0;(s=l.indexOf(i,s))>=0;){var f=s+a;(s===0||Tn.includes(l[s-1]))&&(f===l.length||Tn.includes(l[f]))?l=(s===0?"":l.substring(0,s))+l.substring(f+1):s=f}}return l===""?null:l}function Ml(e,t,r,l,i,a){var s=e.__className;if(P||s!==r){var f=Vl(r,l,a);(!P||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=r}else if(a&&i!==a)for(var c in a){var d=!!a[c];(i==null||d!==!!i[c])&&e.classList.toggle(c,d)}return a}const Ul=Symbol("is custom element"),jl=Symbol("is html");function Dn(e){if(P){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var l=e.value;D(e,"value",null),e.value=l}if(e.hasAttribute("checked")){var i=e.checked;D(e,"checked",null),e.checked=i}}};e.__on_r=r,Yi(r),In()}}function ql(e,t){var r=Ln(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function D(e,t,r,l){var i=Ln(e);P&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[Fi]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Bl(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Ln(e){return e.__attributes??(e.__attributes={[Ul]:e.nodeName.includes("-"),[jl]:e.namespaceURI===Li})}var Pn=new Map;function Bl(e){var t=Pn.get(e.nodeName);if(t)return t;Pn.set(e.nodeName,t=[]);for(var r,l=e,i=Element.prototype;i!==l;){r=Ui(l);for(var a in r)r[a].set&&t.push(a);l=Zr(l)}return t}function Hl(e,t,r=t){Nl(e,"change",l=>{var i=l?e.defaultChecked:e.checked;r(i)}),(P&&e.defaultChecked!==e.checked||ht(t)==null)&&r(e.checked),yr(()=>{var l=t();e.checked=!!l})}function On(e,t){return e===t||(e==null?void 0:e[xt])===t}function nr(e={},t,r,l){return br(()=>{var i,a;return yr(()=>{i=a,a=[],ht(()=>{e!==r(...a)&&(t(e,...a),i&&On(r(...i),e)&&t(null,...i))})}),()=>{Ht(()=>{a&&On(r(...a),e)&&t(null,...a)})}}),e}function Fn(e){ne===null&&yn(),pr(()=>{const t=ht(e);if(typeof t=="function")return t})}function Yl(e){ne===null&&yn(),Fn(()=>()=>ht(e))}let ir=!1;function Gl(e){var t=ir;try{return ir=!1,[e(),ir]}finally{ir=t}}function A(e,t,r,l){var Re;var i=(r&Ft)!==0,a=!0,s=(r&Ni)!==0,f=(r&Si)!==0,c=!1,d;s?[d,c]=Gl(()=>e[t]):d=e[t];var w=xt in e||Yr in e,v=s&&(((Re=et(e,t))==null?void 0:Re.set)??(w&&t in e&&(B=>e[t]=B)))||void 0,h=l,p=!0,k=!1,F=()=>(k=!0,p&&(p=!1,f?h=ht(l):h=l),h);d===void 0&&l!==void 0&&(v&&a&&Xi(),d=F(),v&&v(d));var U;if(U=()=>{var B=e[t];return B===void 0?F():(p=!0,k=!1,B)},(r&$i)===0)return U;if(v){var ve=e.$$legacy;return function(B,ie){return arguments.length>0?((!ie||ve||c)&&v(ie?U():B),B):U()}}var ue=!1,ee=Qr(d),ge=je(()=>{var B=U(),ie=o(ee);return ue?(ue=!1,ie):ee.v=B});return i||(ge.equals=vr),function(B,ie){if(arguments.length>0){const We=ie?o(ge):s?M(B):B;return ge.equals(We)||(ue=!0,b(ee,We),k&&h!==void 0&&(h=We),ht(()=>o(ge))),B}return o(ge)}}function Zl(e){return new Wl(e)}class Wl{constructor(t){Vr(this,Ve);Vr(this,we);var a;var r=new Map,l=(s,f)=>{var c=Qr(f);return r.set(s,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(s,f){return o(r.get(f)??l(f,Reflect.get(s,f)))},has(s,f){return f===Yr?!0:(o(r.get(f)??l(f,Reflect.get(s,f))),Reflect.has(s,f))},set(s,f,c){return b(r.get(f)??l(f,c),c),Reflect.set(s,f,c)}});Mr(this,we,(t.hydrate?Ll:Nn)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((a=t==null?void 0:t.props)!=null&&a.$$host)||t.sync===!1)&&C(),Mr(this,Ve,i.$$events);for(const s of Object.keys(ce(this,we)))s==="$set"||s==="$destroy"||s==="$on"||Bt(this,s,{get(){return ce(this,we)[s]},set(f){ce(this,we)[s]=f},enumerable:!0});ce(this,we).$set=s=>{Object.assign(i,s)},ce(this,we).$destroy=()=>{Pl(ce(this,we))}}$set(t){ce(this,we).$set(t)}$on(t,r){ce(this,Ve)[t]=ce(this,Ve)[t]||[];const l=(...i)=>r.call(this,...i);return ce(this,Ve)[t].push(l),()=>{ce(this,Ve)[t]=ce(this,Ve)[t].filter(i=>i!==l)}}$destroy(){ce(this,we).$destroy()}}Ve=new WeakMap,we=new WeakMap;let Vn;typeof HTMLElement=="function"&&(Vn=class extends HTMLElement{constructor(t,r,l){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,l&&this.attachShadow({mode:"open"})}addEventListener(t,r,l){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const i=this.$$c.$on(t,r);this.$$l_u.set(r,i)}super.addEventListener(t,r,l)}removeEventListener(t,r,l){if(super.removeEventListener(t,r,l),this.$$c){const i=this.$$l_u.get(r);i&&(i(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return a=>{const s=document.createElement("slot");i!=="default"&&(s.name=i),q(a,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},l=zl(this);for(const i of this.$$s)i in l&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),r.default=!0):r[i]=t(i));for(const i of this.attributes){const a=this.$$g_p(i.name);a in this.$$d||(this.$$d[a]=lr(a,i.value,this.$$p_d,"toProp"))}for(const i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=Zl({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=El(()=>{yr(()=>{var i;this.$$r=!0;for(const a of qt(this.$$c)){if(!((i=this.$$p_d[a])!=null&&i.reflect))continue;this.$$d[a]=this.$$c[a];const s=lr(a,this.$$d[a],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,s)}this.$$r=!1})});for(const i in this.$$l)for(const a of this.$$l[i]){const s=this.$$c.$on(i,a);this.$$l_u.set(a,s)}this.$$l={}}}attributeChangedCallback(t,r,l){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=lr(t,l,this.$$p_d,"toProp"),(i=this.$$c)==null||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return qt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function lr(e,t,r,l){var a;const i=(a=r[e])==null?void 0:a.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!l||!r[e])return t;if(l==="toAttribute")switch(i){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(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function zl(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Jl(e,t,r,l,i,a){let s=class extends Vn{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return qt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return qt(t).forEach(f=>{Bt(s.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(c){var v;c=lr(f,c,t),this.$$d[f]=c;var d=this.$$c;if(d){var w=(v=et(d,f))==null?void 0:v.get;w?d[f]=c:d.$set({[f]:c})}}})}),l.forEach(f=>{Bt(s.prototype,f,{get(){var c;return(c=this.$$c)==null?void 0:c[f]}})}),e.element=s,s}const Mn=new TextEncoder;function Kl(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function Xl(e,t="SHA-256",r=1e5){const l=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const i=await Un(l,e,t);return{algorithm:t,challenge:i,salt:l,signature:""}}async function Un(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 Kl(await crypto.subtle.digest(r.toUpperCase(),Mn.encode(e+t)))}function Ql(e,t,r="SHA-256",l=1e6,i=0){const a=new AbortController,s=Date.now();return{promise:(async()=>{for(let c=i;c<=l;c+=1){if(a.signal.aborted)return null;if(await Un(t,c,r)===e)return{number:c,took:Date.now()-s}}return null})(),controller:a}}function jn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ea(e){const t=atob(e),r=new Uint8Array(t.length);for(let l=0;l<t.length;l++)r[l]=t.charCodeAt(l);return r}function ta(e,t=12){const r=new Uint8Array(t);for(let l=0;l<t;l++)r[l]=e%256,e=Math.floor(e/256);return r}async function ra(e,t="",r=1e6,l=0){const i="AES-GCM",a=new AbortController,s=Date.now(),f=async()=>{for(let w=l;w<=r;w+=1){if(a.signal.aborted||!c||!d)return null;try{const v=await crypto.subtle.decrypt({name:i,iv:ta(w)},c,d);if(v)return{clearText:new TextDecoder().decode(v),took:Date.now()-s}}catch{}}return null};let c=null,d=null;try{d=ea(e);const w=await crypto.subtle.digest("SHA-256",Mn.encode(t));c=await crypto.subtle.importKey("raw",w,i,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:a}}return{promise:f(),controller:a}}var x=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(x||{}),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||{register:(e,t)=>{globalThis.altchaI18n[e]=t}};const na={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.register("en",na);const Ir=(e,t)=>{let r=al(()=>Bi(t==null?void 0:t(),24));var l=oa();Oe(()=>{D(l,"width",o(r)),D(l,"height",o(r))}),q(e,l)};function ia(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function la(e,t){e.preventDefault(),t()}function aa(e,t,r,l,i,a,s,f){var c;[x.UNVERIFIED,x.ERROR,x.EXPIRED,x.CODE].includes(o(t))?r()!==!1&&((c=o(l))==null?void 0:c.reportValidity())===!1?b(i,!1):a()?s():f():b(i,!0)}var oa=tr('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-74x4nw"><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" class="svelte-74x4nw"></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" class="altcha-spinner svelte-74x4nw"></path></svg>'),sa=ye('<input type="hidden" class="svelte-74x4nw">'),ua=ye('<div class="svelte-74x4nw"><a target="_blank" class="altcha-logo svelte-74x4nw" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-74x4nw"><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" class="svelte-74x4nw"></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" class="svelte-74x4nw"></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" class="svelte-74x4nw"></path></svg></a></div>'),fa=tr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-74x4nw"><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" class="svelte-74x4nw"></path></svg>'),ca=tr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-74x4nw"><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" class="svelte-74x4nw"></path></svg>'),da=tr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-74x4nw"><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" class="svelte-74x4nw"></path></svg>'),ha=ye('<button type="button" class="altcha-code-challenge-audio svelte-74x4nw"><!></button>'),va=ye('<audio hidden autoplay class="svelte-74x4nw"><source class="svelte-74x4nw"></audio>'),ga=ye('<div class="altcha-code-challenge svelte-74x4nw" role="dialog"><div class="altcha-code-challenge-arrow svelte-74x4nw"></div> <form data-code-challenge-form="1" class="svelte-74x4nw"><img class="altcha-code-challenge-image svelte-74x4nw" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input svelte-74x4nw" required> <div class="altcha-code-challenge-buttons svelte-74x4nw"><div class="altcha-code-challenge-buttons-left svelte-74x4nw"><!> <button type="button" class="altcha-code-challenge-reload svelte-74x4nw"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-74x4nw"><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" class="svelte-74x4nw"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify svelte-74x4nw"><!> </button></div> <!></form></div>'),_a=ye('<div class="svelte-74x4nw"><!></div>'),wa=ye('<div class="svelte-74x4nw"><!></div>'),ma=ye('<div class="altcha-error svelte-74x4nw"><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" class="svelte-74x4nw"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-74x4nw"></path></svg> <!></div>'),pa=ye('<div class="altcha-footer svelte-74x4nw"><div class="svelte-74x4nw"><!></div></div>'),ba=ye('<div class="altcha-anchor-arrow svelte-74x4nw"></div>'),ya=ye('<!> <div class="altcha svelte-74x4nw"><div class="altcha-main svelte-74x4nw"><div><!> <input type="checkbox" class="svelte-74x4nw"></div> <label class="altcha-label svelte-74x4nw"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);const xa={hash:"svelte-74x4nw",code:`.altcha.svelte-74x4nw {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.svelte-74x4nw:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-74x4nw {background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999;}.altcha[data-floating=top].svelte-74x4nw .altcha-anchor-arrow:where(.svelte-74x4nw) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-74x4nw:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-74x4nw:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-74x4nw:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-74x4nw {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.svelte-74x4nw {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;position:relative;}.altcha-code-challenge.svelte-74x4nw {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, 0.2));padding:0.5rem;position:absolute;top:2.5rem;z-index:9999999;}.altcha-code-challenge.svelte-74x4nw > form:where(.svelte-74x4nw) {display:flex;flex-direction:column;gap:0.5rem;}.altcha-code-challenge-input.svelte-74x4nw {border:1px solid currentColor;border-radius:3px;box-sizing:border-box;outline:none;font-size:16px;padding:0.35rem;width:220px;}.altcha-code-challenge-input.svelte-74x4nw:focus {outline:2px solid color-mix(in srgb, var(--altcha-color-active, #1D1DC9) 20%, transparent);}.altcha-code-challenge-input.svelte-74x4nw:disabled {opacity:0.7;}.altcha-code-challenge-image.svelte-74x4nw {background-color:white;border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px;}.altcha-code-challenge-audio.svelte-74x4nw,
|
|
3
|
-
.altcha-code-challenge-reload.svelte-74x4nw {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:0.35rem;}.altcha-code-challenge-audio.svelte-74x4nw:disabled,
|
|
4
|
-
.altcha-code-challenge-reload.svelte-74x4nw:disabled {opacity:0.7;pointer-events:none;}.altcha-code-challenge-audio.svelte-74x4nw > :where(.svelte-74x4nw),
|
|
5
|
-
.altcha-code-challenge-reload.svelte-74x4nw > :where(.svelte-74x4nw) {height:20px;width:20px;}.altcha-code-challenge-buttons.svelte-74x4nw {display:flex;justify-content:space-between;}.altcha-code-challenge-buttons-left.svelte-74x4nw {display:flex;gap:0.25rem;}.altcha-code-challenge-verify.svelte-74x4nw {align-items:center;background:var(--altcha-color-active, #1D1DC9);border:0;border-radius:3px;color:white;cursor:pointer;display:flex;gap:0.5rem;font-size:100%;padding:0.35rem 1rem;}.altcha-code-challenge-verify.svelte-74x4nw:disabled {opacity:0.7;pointer-events:none;}.altcha-code-challenge-arrow.svelte-74x4nw {border:6px solid transparent;border-bottom-color:var(--altcha-color-border, currentColor);content:"";height:0;left:0.15rem;position:absolute;top:-12px;width:0;}.altcha[data-floating=top].svelte-74x4nw .altcha-code-challenge:where(.svelte-74x4nw) {top:-150px;}.altcha[data-floating=top].svelte-74x4nw .altcha-code-challenge-arrow:where(.svelte-74x4nw) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto;}.altcha-label.svelte-74x4nw {cursor:pointer;flex-grow:1;}.altcha-logo.svelte-74x4nw {color:currentColor;opacity:0.7;}.altcha-logo.svelte-74x4nw:hover {opacity:1;}.altcha-error.svelte-74x4nw {color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem;}.altcha-footer.svelte-74x4nw {align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.7;justify-content:end;padding:0.2rem 0.7rem;}.altcha-footer.svelte-74x4nw:hover {opacity:1;}.altcha-footer.svelte-74x4nw a {color:currentColor;}.altcha-checkbox.svelte-74x4nw {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-74x4nw input:where(.svelte-74x4nw) {width:18px;height:18px;margin:0;}.altcha-checkbox-verifying.svelte-74x4nw input:where(.svelte-74x4nw) {appearance:none;pointer-events:none;height:0;width:0;}.altcha-spinner.svelte-74x4nw {
|
|
6
|
-
animation: svelte-74x4nw-altcha-spinner 0.75s infinite linear;transform-origin:center;}
|
|
7
|
-
|
|
8
|
-
@keyframes svelte-74x4nw-altcha-spinner {
|
|
9
|
-
100% {
|
|
10
|
-
transform: rotate(360deg);
|
|
11
|
-
}
|
|
12
|
-
}`};function qn(e,t){var Ai,ki;En(t,!0),Fl(e,xa);let r=A(t,"auto",7,void 0),l=A(t,"blockspam",7,void 0),i=A(t,"challengeurl",7,void 0),a=A(t,"challengejson",7,void 0),s=A(t,"credentials",7,void 0),f=A(t,"customfetch",7,void 0),c=A(t,"debug",7,!1),d=A(t,"delay",7,0),w=A(t,"disableautofocus",7,!1),v=A(t,"expire",7,void 0),h=A(t,"floating",7,void 0),p=A(t,"floatinganchor",7,void 0),k=A(t,"floatingoffset",7,void 0),F=A(t,"floatingpersist",7,!1),U=A(t,"hidefooter",7,!1),ve=A(t,"hidelogo",7,!1),ue=A(t,"id",7,void 0),ee=A(t,"language",7,void 0),ge=A(t,"name",7,"altcha"),Re=A(t,"maxnumber",7,1e6),B=A(t,"mockerror",7,!1),ie=A(t,"obfuscated",7,void 0),We=A(t,"plugins",7,void 0),$t=A(t,"refetchonexpire",7,!0),it=A(t,"sentinel",7,void 0),$e=A(t,"spamfilter",7,!1),gt=A(t,"strings",7,void 0),me=A(t,"test",7,!1),le=A(t,"verifyurl",7,void 0),_t=A(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Nt=A(t,"workerurl",7,void 0);const Hn=["SHA-256","SHA-384","SHA-512"],Ea="https://altcha.org/",ze=(n,u)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:u}))},Yn=(ki=(Ai=document.documentElement.lang)==null?void 0:Ai.split("-"))==null?void 0:ki[0],Rr=je(()=>{var n;return i()&&new URL(i(),location.origin).host.endsWith(".altcha.org")&&!!((n=i())!=null&&n.includes("apiKey=ckey_"))}),$r=je(()=>a()?ai(a()):void 0),Ca=je(()=>gt()?ai(gt()):{}),V=je(()=>({...zn(),...o(Ca)})),Gn=je(()=>`${ue()||ge()}_checkbox_${Math.round(Math.random()*1e8)}`);let St=se(!1),Y=se(null),R=se(M(x.UNVERIFIED)),ae=se(void 0),Tt=se(null),Je=se(null),Nr=se(null),wt=se(null),j=se(null),lt=se(null),Ne=null,K=se(null),at=se(!1),Ke=[],Sr=se(!1),Me=se(null);pr(()=>{Fa(o(lt))}),pr(()=>{Va(o(R))}),Yl(()=>{Aa(),o(j)&&(o(j).removeEventListener("submit",ti),o(j).removeEventListener("reset",ri),o(j).removeEventListener("focusin",ei),b(j,null)),Ne&&(clearTimeout(Ne),Ne=null),document.removeEventListener("click",Xn),document.removeEventListener("scroll",Qn),window.removeEventListener("resize",li)}),Fn(()=>{var n;$("mounted","2.0.0-beta.8"),$("workers",_t()),$a(),$("plugins",Ke.length?Ke.map(u=>u.constructor.pluginName).join(", "):"none"),me()&&$("using test mode"),v()&&Tr(v()),r()!==void 0&&$("auto",r()),h()!==void 0&&si(h()),b(j,M((n=o(ae))==null?void 0:n.closest("form"))),o(j)&&(o(j).addEventListener("submit",ti,{capture:!0}),o(j).addEventListener("reset",ri),(r()==="onfocus"||F()==="focus")&&o(j).addEventListener("focusin",ei)),r()==="onload"&&(ie()?Dt():Ue()),o(Rr)&&(U()||ve())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{ze("load")})});function ar(n,u){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:u.number,salt:n.salt,signature:n.signature,test:me()?!0:void 0,took:u.took}))}function Aa(){for(const n of Ke)n.destroy()}function Zn(){i()&&$t()&&o(R)===x.VERIFIED?Ue():mt(x.EXPIRED,o(V).expired)}async function ka(){var n;if(B())throw $("mocking error"),new Error("Mocked error.");if(o($r))return $("using provided json data"),o($r);if(me())return $("generating test challenge",{test:me()}),Xl(typeof me()!="boolean"?+me():void 0);{if(!i()&&o(j)){const E=o(j).getAttribute("action");E!=null&&E.includes("/form/")&&i(E+"/altcha")}if(!i())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",i());const u={credentials:typeof s()=="boolean"?"include":s(),headers:$e()!==!1?{"x-altcha-spam-filter":"1"}:{}},g=await Wn()(i(),u);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"),_=await g.json(),I=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),y=I.get("expires")||I.get("expire");if(y){const E=new Date(+y*1e3),H=isNaN(E.getTime())?0:E.getTime()-Date.now();H>0&&Tr(H)}if(m)try{const E=JSON.parse(m);E&&typeof E=="object"&&(E.verifyurl&&!E.verifyurl.startsWith("javascript:")&&(E.verifyurl=Kn(E.verifyurl)),ci(E))}catch(E){$("unable to configure from X-Altcha-Config",E)}return _}}function Ia(n){var g,m;const u=(g=o(j))==null?void 0:g.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=u==null?void 0:u.value)==null?void 0:m.slice(u.value.indexOf("@")))||void 0}function Wn(){let n=fetch;if(f())if($("using customfetch"),typeof f()=="string"){if(n=globalThis[f()]||null,!n)throw new Error(`Custom fetch function not found: ${f()}`)}else n=f();return n}function zn(n=[ee()||"",document.documentElement.lang||"",...navigator.languages]){const u=Object.keys(globalThis.altchaI18n).map(m=>m.toLowerCase()),g=n.reduce((m,_)=>(_=_.toLowerCase(),m||(globalThis.altchaI18n[_]?_:null)||u.find(I=>_.split("-")[0]===I.split("-")[0])||null),null);return globalThis.altchaI18n[g||"en"]}function Ra(){return $e()==="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 $e()=="object"?$e():{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 Jn(n){var g;return[...((g=o(j))==null?void 0:g.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 I=_.name,y=_.value;return I&&y&&(m[I]=/\n/.test(y)?y.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
13
|
-
`):y),m},{})}function Kn(n,u){const g=new URL(i()||location.origin),m=new URL(n,g);if(m.search||(m.search=g.search),u)for(const _ in u)u[_]!==void 0&&u[_]!==null&&m.searchParams.set(_,u[_]);return m.toString()}function $a(){const n=We()!==void 0?We().split(","):void 0;for(const u of globalThis.altchaPlugins)(!n||n.includes(u.pluginName))&&Ke.push(new u({el:o(ae),clarify:Dt,dispatch:ze,getConfiguration:di,getFloatingAnchor:hi,getState:vi,log:$,reset:mt,solve:fi,setState:Se,setFloatingAnchor:_i,verify:Ue}))}function $(...n){(c()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ge()}]`,...n)}function Na(){b(K,M(Q.PAUSED))}function Sa(n){b(K,M(Q.ERROR))}function Ta(){b(K,M(Q.READY))}function Da(){b(K,M(Q.LOADING))}function La(){b(K,M(Q.PLAYING))}function Pa(){b(K,M(Q.PAUSED))}function Oa(n){var u;if(n.preventDefault(),n.stopPropagation(),o(Y)){const g=new FormData(n.target),m=String(g.get("code"));if((u=le())!=null&&u.startsWith("javascript:")){const _=le().replace(/^javascript:/,"");if($(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:o(Y).challenge,code:m,solution:o(Y).solution})}b(at,!0),oi(ar(o(Y).challenge,o(Y).solution),m).then(({reason:_,verified:I})=>{I?(b(Y,null),Se(x.VERIFIED),$("verified"),mr().then(()=>{var y;(y=o(Nr))==null||y.focus(),ze("verified",{payload:o(Me)})})):(mt(),b(lt,M(_||"Verification failed")))}).catch(_=>{b(Y,null),Se(x.ERROR,_),$("sentinel verification failed:",_)}).finally(()=>{b(at,!1)})}}function Xn(n){var g;const u=n.target;h()&&u&&!o(ae).contains(u)&&(o(R)===x.VERIFIED&&F()===!1||o(R)===x.VERIFIED&&F()==="focus"&&!((g=o(j))!=null&&g.matches(":focus-within"))||r()==="off"&&o(R)===x.UNVERIFIED)&&gi()}function Qn(){h()&&o(R)!==x.UNVERIFIED&&Lt()}function Fa(n){for(const u of Ke)typeof u.onErrorChange=="function"&&u.onErrorChange(o(lt))}function ei(n){o(R)===x.UNVERIFIED?Ue():h()&&F()==="focus"&&o(R)===x.VERIFIED&&Dr()}function ti(n){const u=n.target,g=n.submitter;u!=null&&u.hasAttribute("data-code-challenge-form")||(o(j)&&r()==="onsubmit"?o(R)===x.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ue().then(()=>{var _;g&&["INPUT","BUTTON"].includes(g.tagName)&&g.getAttribute("name")?g.click():(_=o(j))==null||_.requestSubmit()})):o(R)!==x.VERIFIED&&(n.preventDefault(),n.stopPropagation(),o(R)===x.VERIFYING&&ni()):o(j)&&h()&&r()==="off"&&o(R)===x.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Dr()))}function ri(){mt()}function ni(){o(R)===x.VERIFYING&&o(V).waitAlert&&alert(o(V).waitAlert)}function ii(){o(Je)?o(Je).paused?(o(Je).currentTime=0,o(Je).play()):o(Je).pause():(b(Sr,!0),requestAnimationFrame(()=>{var n;(n=o(Je))==null||n.play()}))}function Va(n){for(const u of Ke)typeof u.onStateChange=="function"&&u.onStateChange(o(R));h()&&o(R)!==x.UNVERIFIED&&requestAnimationFrame(()=>{Lt()}),b(St,o(R)===x.VERIFIED)}function li(){h()&&Lt()}function ai(n){return JSON.parse(n)}async function Ma(n){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",le());const u={payload:n};if($e()!==!1){const{blockedCountries:_,classifier:I,disableRules:y,email:E,expectedLanguages:H,expectedCountries:te,fields:fe,ipAddress:Xe,text:Pr,timeZone:ur}=Ra();u.blockedCountries=_,u.classifier=I,u.disableRules=y,u.email=E===!1?void 0:Ia(E),u.expectedCountries=te,u.expectedLanguages=H||(Yn?[Yn]:void 0),u.fields=fe===!1?void 0:Jn(fe),u.ipAddress=Xe===!1?void 0:Xe||"auto",u.text=Pr,u.timeZone=ur===!1?void 0:ur||jn()}const g=await Wn()(le(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(!g||!(g instanceof Response))throw new Error("Custom fetch function did not return a response.");if(g.status!==200)throw new Error(`Server responded with ${g.status}.`);const m=await g.json();if(m!=null&&m.payload&&b(Me,M(m.payload)),ze("serververification",m),l()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function oi(n,u){if(!le())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",le());const g={code:u,payload:n};it()&&(g.fields=it().fields?Jn():void 0,g.timeZone=it().timeZone?jn():void 0);const m=await fetch(le(),{body:JSON.stringify(g),headers:{"content-type":"application/json"},method:"POST"});if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const _=await m.json();return _!=null&&_.payload&&b(Me,M(_.payload)),ze("sentinelverification",_),_}function Tr(n){$("expire",n),Ne&&(clearTimeout(Ne),Ne=null),n<1?Zn():Ne=setTimeout(Zn,n)}function si(n){$("floating",n),h()!==n&&(o(ae).style.left="",o(ae).style.top=""),h(n===!0||n===""?"auto":n===!1||n==="false"?void 0:h()),h()?(r()||r("onsubmit"),document.addEventListener("scroll",Qn),document.addEventListener("click",Xn),window.addEventListener("resize",li)):r()==="onsubmit"&&r(void 0)}function ui(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(!Hn.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${Hn.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 fi(n){let u=null;if("Worker"in window){try{u=await Ua(n,n.maxNumber||n.maxnumber||Re())}catch(g){$(g)}if((u==null?void 0:u.number)!==void 0||"obfuscated"in n)return{data:n,solution:u}}if("obfuscated"in n){const g=await ra(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await g.promise}}return{data:n,solution:await Ql(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||Re()).promise}}async function Ua(n,u=typeof me()=="number"?me():n.maxNumber||n.maxnumber||Re(),g=Math.ceil(_t())){const m=[];g=Math.min(16,u,Math.max(1,g));for(let y=0;y<g;y++)m.push(altchaCreateWorker(Nt()));const _=Math.ceil(u/g),I=await Promise.all(m.map((y,E)=>{const H=E*_;return new Promise(te=>{y.addEventListener("message",fe=>{if(fe.data)for(const Xe of m)Xe!==y&&Xe.postMessage({type:"abort"});te(fe.data)}),y.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const y of m)y.terminate();return I.find(y=>!!y)||null}async function Dt(){if(!ie()){Se(x.ERROR);return}const n=Ke.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Se(x.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 ci(n){n.obfuscated!==void 0&&ie(n.obfuscated),n.auto!==void 0&&(r(n.auto),r()==="onload"&&(ie()?Dt():Ue())),n.blockspam!==void 0&&l(!!n.blockspam),n.customfetch!==void 0&&f(n.customfetch),n.floatinganchor!==void 0&&p(n.floatinganchor),n.delay!==void 0&&d(n.delay),n.floatingoffset!==void 0&&k(n.floatingoffset),n.floating!==void 0&&si(n.floating),n.expire!==void 0&&(Tr(n.expire),v(n.expire)),n.challenge&&(a(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),ui(o($r))),n.challengeurl!==void 0&&i(n.challengeurl),n.debug!==void 0&&c(!!n.debug),n.hidefooter!==void 0&&U(!!n.hidefooter),n.hidelogo!==void 0&&ve(!!n.hidelogo),n.language!==void 0&>(zn([n.language])),n.maxnumber!==void 0&&Re(+n.maxnumber),n.mockerror!==void 0&&B(!!n.mockerror),n.name!==void 0&&ge(n.name),n.refetchonexpire!==void 0&&$t(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&$e(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&>(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&me(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&le(n.verifyurl),n.workers!==void 0&&_t(+n.workers),n.workerurl!==void 0&&Nt(n.workerurl)}function di(){return{auto:r(),blockspam:l(),challengeurl:i(),debug:c(),delay:d(),expire:v(),floating:h(),floatinganchor:p(),floatingoffset:k(),hidefooter:U(),hidelogo:ve(),name:ge(),maxnumber:Re(),mockerror:B(),obfuscated:ie(),refetchonexpire:$t(),spamfilter:$e(),strings:o(V),test:me(),verifyurl:le(),workers:_t(),workerurl:Nt()}}function hi(){return o(wt)}function ja(n){return Ke.find(u=>u.constructor.pluginName===n)}function vi(){return o(R)}function gi(){o(ae).style.display="none"}function Lt(n=20){var u;if(o(ae))if(o(wt)||b(wt,M((p()?document.querySelector(p()):(u=o(j))==null?void 0:u.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||o(j))),o(wt)){const g=parseInt(k(),10)||12,m=o(wt).getBoundingClientRect(),_=o(ae).getBoundingClientRect(),I=document.documentElement.clientHeight,y=document.documentElement.clientWidth,E=h()==="auto"?m.bottom+_.height+g+n>I:h()==="top",H=Math.max(n,Math.min(y-n-_.width,m.left+m.width/2-_.width/2));if(E?o(ae).style.top=`${m.top-(_.height+g)}px`:o(ae).style.top=`${m.bottom+g}px`,o(ae).style.left=`${H}px`,o(ae).setAttribute("data-floating",E?"top":"bottom"),o(Tt)){const te=o(Tt).getBoundingClientRect();o(Tt).style.left=m.left-H+m.width/2-te.width/2+"px"}}else $("unable to find floating anchor element")}function mt(n=x.UNVERIFIED,u=null){Ne&&(clearTimeout(Ne),Ne=null),b(St,!1),b(Me,null),b(Y,null),b(Sr,!1),b(K,null),Se(n,u)}function _i(n){b(wt,M(n))}function Se(n,u=null){b(R,M(n)),b(lt,M(u)),ze("statechange",{payload:o(Me),state:o(R)})}function Dr(){o(ae).style.display="block",h()&&Lt()}async function Ue(){return mt(x.VERIFYING),await new Promise(n=>setTimeout(n,d()||0)),ka().then(n=>(ui(n),$("challenge",n),fi(n))).then(({data:n,solution:u})=>{var g;if($("solution",u),!u||n&&"challenge"in n&&!("clearText"in u))if((u==null?void 0:u.number)!==void 0&&"challenge"in n)if(le()&&"codeChallenge"in n)((g=document.activeElement)==null?void 0:g.tagName)==="INPUT"&&w()===!1&&document.activeElement.blur(),b(Y,M({challenge:n,solution:u}));else{if(le()&&it()!==void 0)return oi(ar(n,u));if(le())return Ma(ar(n,u));b(Me,M(ar(n,u))),$("payload",o(Me))}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(()=>{o(Y)?(Se(x.CODE),mr().then(()=>{ze("code",{codeChallenge:o(Y)})})):(Se(x.VERIFIED),$("verified"),mr().then(()=>{ze("verified",{payload:o(Me)})}))}).catch(n=>{$(n),Se(x.ERROR,n.message)})}var wi=ya(),mi=At(wi);Ol(mi,t,"default",{});var Pt=z(mi,2),Lr=W(Pt),or=W(Lr);let pi;var bi=W(or);{var qa=n=>{Ir(n)};J(bi,n=>{o(R)===x.VERIFYING&&n(qa)})}var ot=z(bi,2);Dn(ot),ot.__change=[aa,R,$e,j,St,ie,Dt,Ue],nr(ot,n=>b(Nr,n),()=>o(Nr)),Z(or);var sr=z(or,2),Ba=W(sr);{var Ha=n=>{var u=rr(),g=At(u);nt(g,()=>o(V).verified),q(n,u)},Ya=(n,u)=>{{var g=_=>{var I=rr(),y=At(I);nt(y,()=>o(V).verifying),q(_,I)},m=(_,I)=>{{var y=H=>{var te=rr(),fe=At(te);nt(fe,()=>o(V).verificationRequired),q(H,te)},E=H=>{var te=rr(),fe=At(te);nt(fe,()=>o(V).label),q(H,te)};J(_,H=>{o(R)===x.CODE?H(y):H(E,!1)},I)}};J(n,_=>{o(R)===x.VERIFYING?_(g):_(m,!1)},u)}};J(Ba,n=>{o(R)===x.VERIFIED?n(Ha):n(Ya,!1)})}Z(sr);var yi=z(sr,2);{var Ga=n=>{var u=sa();Dn(u),Oe(()=>{D(u,"name",ge()),ql(u,o(Me))}),q(n,u)};J(yi,n=>{o(R)===x.VERIFIED&&n(Ga)})}var xi=z(yi,2);{var Za=n=>{var u=ua(),g=W(u);D(g,"href",Ea),Z(u),Oe(()=>D(g,"aria-label",o(V).ariaLinkLabel)),q(n,u)};J(xi,n=>{(ve()!==!0||o(Rr))&&n(Za)})}var Wa=z(xi,2);{var za=n=>{var u=ga(),g=z(W(u),2),m=W(g),_=z(m,2);$l(_,!w()),_.__keydown=[ia,ii];var I=z(_,2),y=W(I),E=W(y);{var H=xe=>{var X=ha();X.__click=ii;var fr=W(X);{var Ot=pt=>{Ir(pt,()=>20)},ro=(pt,no)=>{{var io=bt=>{var Or=fa();q(bt,Or)},lo=(bt,Or)=>{{var ao=yt=>{var Fr=ca();q(yt,Fr)},oo=yt=>{var Fr=da();q(yt,Fr)};J(bt,yt=>{o(K)===Q.PLAYING?yt(ao):yt(oo,!1)},Or)}};J(pt,bt=>{o(K)===Q.ERROR?bt(io):bt(lo,!1)},no)}};J(fr,pt=>{o(K)===Q.LOADING?pt(Ot):pt(ro,!1)})}Z(X),Oe(()=>{D(X,"title",o(V).getAudioChallenge),X.disabled=o(K)===Q.LOADING||o(K)===Q.ERROR||o(at),D(X,"aria-label",o(K)===Q.LOADING?o(V).loading:o(V).getAudioChallenge)}),q(xe,X)};J(E,xe=>{o(Y).challenge.codeChallenge.audio&&xe(H)})}var te=z(E,2);te.__click=[la,Ue],Z(y);var fe=z(y,2),Xe=W(fe);{var Pr=xe=>{Ir(xe,()=>16)};J(Xe,xe=>{o(at)&&xe(Pr)})}var ur=z(Xe);Z(fe),Z(I);var eo=z(I,2);{var to=xe=>{var X=va(),fr=W(X);Z(X),nr(X,Ot=>b(Je,Ot),()=>o(Je)),Oe(Ot=>D(fr,"src",Ot),[()=>Kn(o(Y).challenge.codeChallenge.audio,{language:ee()})]),Ze("loadstart",X,Da),Ze("canplay",X,Ta),Ze("pause",X,Pa),Ze("playing",X,La),Ze("ended",X,Na),Ze("error",fr,Sa),q(xe,X)};J(eo,xe=>{o(Y).challenge.codeChallenge.audio&&o(Sr)&&xe(to)})}Z(g),Z(u),Oe(()=>{D(u,"aria-label",o(V).verificationRequired),D(m,"src",o(Y).challenge.codeChallenge.image),D(_,"minlength",o(Y).challenge.codeChallenge.length||1),D(_,"maxlength",o(Y).challenge.codeChallenge.length),D(_,"placeholder",o(V).enterCode),D(_,"aria-label",o(K)===Q.LOADING?o(V).loading:o(K)===Q.PLAYING?"":o(V).enterCodeAria),D(_,"aria-live",o(K)?"assertive":"polite"),D(_,"aria-busy",o(K)===Q.LOADING),_.disabled=o(at),D(te,"aria-label",o(V).reload),D(te,"title",o(V).reload),te.disabled=o(at),fe.disabled=o(at),D(fe,"aria-label",o(V).verify),Dl(ur,` ${o(V).verify??""}`)}),Ze("submit",g,Oa,!0),q(n,u)};J(Wa,n=>{var u;(u=o(Y))!=null&&u.challenge.codeChallenge&&n(za)})}Z(Lr);var Ei=z(Lr,2);{var Ja=n=>{var u=ma(),g=z(W(u),2);{var m=I=>{var y=_a(),E=W(y);nt(E,()=>o(V).expired),Z(y),Oe(()=>D(y,"title",o(lt))),q(I,y)},_=I=>{var y=wa(),E=W(y);nt(E,()=>o(V).error),Z(y),Oe(()=>D(y,"title",o(lt))),q(I,y)};J(g,I=>{o(R)===x.EXPIRED?I(m):I(_,!1)})}Z(u),q(n,u)};J(Ei,n=>{(o(lt)||o(R)===x.EXPIRED)&&n(Ja)})}var Ci=z(Ei,2);{var Ka=n=>{var u=pa(),g=W(u),m=W(g);nt(m,()=>o(V).footer),Z(g),Z(u),q(n,u)};J(Ci,n=>{o(V).footer&&(U()!==!0||o(Rr))&&n(Ka)})}var Xa=z(Ci,2);{var Qa=n=>{var u=ba();nr(u,g=>b(Tt,g),()=>o(Tt)),q(n,u)};J(Xa,n=>{h()&&n(Qa)})}return Z(Pt),nr(Pt,n=>b(ae,n),()=>o(ae)),Oe(n=>{D(Pt,"data-state",o(R)),D(Pt,"data-floating",h()),pi=Ml(or,1,"altcha-checkbox svelte-74x4nw",null,pi,n),D(ot,"id",o(Gn)),ot.required=r()!=="onsubmit"&&(!h()||r()!=="off"),D(sr,"for",o(Gn))},[()=>({"altcha-checkbox-verifying":o(R)===x.VERIFYING})]),Ze("invalid",ot,ni),Hl(ot,()=>o(St),n=>b(St,n)),q(e,wi),Cn({clarify:Dt,configure:ci,getConfiguration:di,getFloatingAnchor:hi,getPlugin:ja,getState:vi,hide:gi,repositionFloating:Lt,reset:mt,setFloatingAnchor:_i,setState:Se,show:Dr,verify:Ue,get auto(){return r()},set auto(n=void 0){r(n),C()},get blockspam(){return l()},set blockspam(n=void 0){l(n),C()},get challengeurl(){return i()},set challengeurl(n=void 0){i(n),C()},get challengejson(){return a()},set challengejson(n=void 0){a(n),C()},get credentials(){return s()},set credentials(n=void 0){s(n),C()},get customfetch(){return f()},set customfetch(n=void 0){f(n),C()},get debug(){return c()},set debug(n=!1){c(n),C()},get delay(){return d()},set delay(n=0){d(n),C()},get disableautofocus(){return w()},set disableautofocus(n=!1){w(n),C()},get expire(){return v()},set expire(n=void 0){v(n),C()},get floating(){return h()},set floating(n=void 0){h(n),C()},get floatinganchor(){return p()},set floatinganchor(n=void 0){p(n),C()},get floatingoffset(){return k()},set floatingoffset(n=void 0){k(n),C()},get floatingpersist(){return F()},set floatingpersist(n=!1){F(n),C()},get hidefooter(){return U()},set hidefooter(n=!1){U(n),C()},get hidelogo(){return ve()},set hidelogo(n=!1){ve(n),C()},get id(){return ue()},set id(n=void 0){ue(n),C()},get language(){return ee()},set language(n=void 0){ee(n),C()},get name(){return ge()},set name(n="altcha"){ge(n),C()},get maxnumber(){return Re()},set maxnumber(n=1e6){Re(n),C()},get mockerror(){return B()},set mockerror(n=!1){B(n),C()},get obfuscated(){return ie()},set obfuscated(n=void 0){ie(n),C()},get plugins(){return We()},set plugins(n=void 0){We(n),C()},get refetchonexpire(){return $t()},set refetchonexpire(n=!0){$t(n),C()},get sentinel(){return it()},set sentinel(n=void 0){it(n),C()},get spamfilter(){return $e()},set spamfilter(n=!1){$e(n),C()},get strings(){return gt()},set strings(n=void 0){gt(n),C()},get test(){return me()},set test(n=!1){me(n),C()},get verifyurl(){return le()},set verifyurl(n=void 0){le(n),C()},get workers(){return _t()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){_t(n),C()},get workerurl(){return Nt()},set workerurl(n=void 0){Nt(n),C()}})}Tl(["change","keydown","click"]),customElements.define("altcha-widget",Jl(qn,{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:S&&S.tagName.toUpperCase()==="SCRIPT"&&S.src||new URL("altcha.umd.cjs",document.baseURI).href)),N.Altcha=qn,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
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"})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'altcha/i18n/af';
|
package/dist_i18n/af.js
CHANGED
|
@@ -1,4 +1,77 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o = () => {
|
|
2
|
+
};
|
|
3
|
+
function g(e, i) {
|
|
4
|
+
return e != e ? i == i : e !== i || e !== null && typeof e == "object" || typeof e == "function";
|
|
5
|
+
}
|
|
6
|
+
let c = !1;
|
|
7
|
+
function d(e) {
|
|
8
|
+
var i = c;
|
|
9
|
+
try {
|
|
10
|
+
return c = !0, e();
|
|
11
|
+
} finally {
|
|
12
|
+
c = i;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function k(e, i, t) {
|
|
16
|
+
if (e == null)
|
|
17
|
+
return i(void 0), o;
|
|
18
|
+
const n = d(
|
|
19
|
+
() => e.subscribe(
|
|
20
|
+
i,
|
|
21
|
+
// @ts-expect-error
|
|
22
|
+
t
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
26
|
+
}
|
|
27
|
+
const a = [];
|
|
28
|
+
function p(e, i = o) {
|
|
29
|
+
let t = null;
|
|
30
|
+
const n = /* @__PURE__ */ new Set();
|
|
31
|
+
function l(s) {
|
|
32
|
+
if (g(e, s) && (e = s, t)) {
|
|
33
|
+
const u = !a.length;
|
|
34
|
+
for (const r of n)
|
|
35
|
+
r[1](), a.push(r, e);
|
|
36
|
+
if (u) {
|
|
37
|
+
for (let r = 0; r < a.length; r += 2)
|
|
38
|
+
a[r][0](a[r + 1]);
|
|
39
|
+
a.length = 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function b(s) {
|
|
44
|
+
l(s(
|
|
45
|
+
/** @type {T} */
|
|
46
|
+
e
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
function h(s, u = o) {
|
|
50
|
+
const r = [s, u];
|
|
51
|
+
return n.add(r), n.size === 1 && (t = i(l, b) || o), s(
|
|
52
|
+
/** @type {T} */
|
|
53
|
+
e
|
|
54
|
+
), () => {
|
|
55
|
+
n.delete(r), n.size === 0 && t && (t(), t = null);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return { set: l, update: b, subscribe: h };
|
|
59
|
+
}
|
|
60
|
+
function f(e) {
|
|
61
|
+
let i;
|
|
62
|
+
return k(e, (t) => i = t)(), i;
|
|
63
|
+
}
|
|
64
|
+
globalThis.altchaPlugins = globalThis.altchaPlugins || [];
|
|
65
|
+
globalThis.altchaI18n = globalThis.altchaI18n || {
|
|
66
|
+
get: (e) => f(globalThis.altchaI18n.store)[e],
|
|
67
|
+
set: (e, i) => {
|
|
68
|
+
Object.assign(f(globalThis.altchaI18n.store), {
|
|
69
|
+
[e]: i
|
|
70
|
+
}), globalThis.altchaI18n.store.set(f(globalThis.altchaI18n.store));
|
|
71
|
+
},
|
|
72
|
+
store: p({})
|
|
73
|
+
};
|
|
74
|
+
const T = {
|
|
2
75
|
ariaLinkLabel: "Besoek Altcha.org",
|
|
3
76
|
enterCode: "Voer kode in",
|
|
4
77
|
enterCodeAria: "Voer die kode in wat jy hoor. Druk Spasie om die klank af te speel.",
|
|
@@ -15,7 +88,7 @@ const e = {
|
|
|
15
88
|
verifying: "Verifieer...",
|
|
16
89
|
waitAlert: "Verifieer... wag asseblief."
|
|
17
90
|
};
|
|
18
|
-
globalThis.altchaI18n.
|
|
91
|
+
globalThis.altchaI18n.set("af", T);
|
|
19
92
|
export {
|
|
20
|
-
|
|
93
|
+
T as i18n
|
|
21
94
|
};
|
package/dist_i18n/af.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports):typeof define=="function"&&define.amd?define(["exports"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l["[name]"]={}))})(this,function(l){"use strict";const o=()=>{};function d(e,i){return e!=e?i==i:e!==i||e!==null&&typeof e=="object"||typeof e=="function"}let u=!1;function k(e){var i=u;try{return u=!0,e()}finally{u=i}}function p(e,i,n){if(e==null)return i(void 0),o;const r=k(()=>e.subscribe(i,n));return r.unsubscribe?()=>r.unsubscribe():r}const a=[];function T(e,i=o){let n=null;const r=new Set;function c(s){if(d(e,s)&&(e=s,n)){const b=!a.length;for(const t of r)t[1](),a.push(t,e);if(b){for(let t=0;t<a.length;t+=2)a[t][0](a[t+1]);a.length=0}}}function g(s){c(s(e))}function y(s,b=o){const t=[s,b];return r.add(t),r.size===1&&(n=i(c,g)||o),s(e),()=>{r.delete(t),r.size===0&&n&&(n(),n=null)}}return{set:c,update:g,subscribe:y}}function f(e){let i;return p(e,n=>i=n)(),i}globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>f(globalThis.altchaI18n.store)[e],set:(e,i)=>{Object.assign(f(globalThis.altchaI18n.store),{[e]:i}),globalThis.altchaI18n.store.set(f(globalThis.altchaI18n.store))},store:T({})};const h={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",h),l.i18n=h,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'altcha/i18n/all';
|