altcha 1.4.2 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +144 -156
  2. package/dist/altcha.d.ts +6 -0
  3. package/dist/altcha.js +1683 -1383
  4. package/dist/altcha.umd.cjs +10 -7
  5. package/dist_external/altcha.css +127 -13
  6. package/dist_external/altcha.d.ts +6 -0
  7. package/dist_external/altcha.js +1667 -1367
  8. package/dist_external/altcha.umd.cjs +9 -6
  9. package/dist_i18n/all.js +810 -0
  10. package/dist_i18n/all.umd.cjs +1 -0
  11. package/dist_i18n/americas.js +54 -0
  12. package/dist_i18n/americas.umd.cjs +1 -0
  13. package/dist_i18n/ar.js +21 -0
  14. package/dist_i18n/ar.umd.cjs +1 -0
  15. package/dist_i18n/asia.js +288 -0
  16. package/dist_i18n/asia.umd.cjs +1 -0
  17. package/dist_i18n/bg.js +21 -0
  18. package/dist_i18n/bg.umd.cjs +1 -0
  19. package/dist_i18n/bn.js +21 -0
  20. package/dist_i18n/bn.umd.cjs +1 -0
  21. package/dist_i18n/cs.js +21 -0
  22. package/dist_i18n/cs.umd.cjs +1 -0
  23. package/dist_i18n/da.js +21 -0
  24. package/dist_i18n/da.umd.cjs +1 -0
  25. package/dist_i18n/de.js +21 -0
  26. package/dist_i18n/de.umd.cjs +1 -0
  27. package/dist_i18n/el.js +21 -0
  28. package/dist_i18n/el.umd.cjs +1 -0
  29. package/dist_i18n/en.js +21 -0
  30. package/dist_i18n/en.umd.cjs +1 -0
  31. package/dist_i18n/es-419.js +21 -0
  32. package/dist_i18n/es-419.umd.cjs +1 -0
  33. package/dist_i18n/es-es.js +21 -0
  34. package/dist_i18n/es-es.umd.cjs +1 -0
  35. package/dist_i18n/et.js +21 -0
  36. package/dist_i18n/et.umd.cjs +1 -0
  37. package/dist_i18n/eu.js +21 -0
  38. package/dist_i18n/eu.umd.cjs +1 -0
  39. package/dist_i18n/europe.js +468 -0
  40. package/dist_i18n/europe.umd.cjs +1 -0
  41. package/dist_i18n/fi.js +21 -0
  42. package/dist_i18n/fi.umd.cjs +1 -0
  43. package/dist_i18n/fr-ca.js +21 -0
  44. package/dist_i18n/fr-ca.umd.cjs +1 -0
  45. package/dist_i18n/fr-fr.js +21 -0
  46. package/dist_i18n/fr-fr.umd.cjs +1 -0
  47. package/dist_i18n/ga.js +21 -0
  48. package/dist_i18n/ga.umd.cjs +1 -0
  49. package/dist_i18n/he.js +21 -0
  50. package/dist_i18n/he.umd.cjs +1 -0
  51. package/dist_i18n/hi.js +21 -0
  52. package/dist_i18n/hi.umd.cjs +1 -0
  53. package/dist_i18n/hr.js +21 -0
  54. package/dist_i18n/hr.umd.cjs +1 -0
  55. package/dist_i18n/hu.js +21 -0
  56. package/dist_i18n/hu.umd.cjs +1 -0
  57. package/dist_i18n/id.js +21 -0
  58. package/dist_i18n/id.umd.cjs +1 -0
  59. package/dist_i18n/it.js +21 -0
  60. package/dist_i18n/it.umd.cjs +1 -0
  61. package/dist_i18n/ja.js +21 -0
  62. package/dist_i18n/ja.umd.cjs +1 -0
  63. package/dist_i18n/ko.js +21 -0
  64. package/dist_i18n/ko.umd.cjs +1 -0
  65. package/dist_i18n/lt.js +21 -0
  66. package/dist_i18n/lt.umd.cjs +1 -0
  67. package/dist_i18n/lv.js +21 -0
  68. package/dist_i18n/lv.umd.cjs +1 -0
  69. package/dist_i18n/mr.js +21 -0
  70. package/dist_i18n/mr.umd.cjs +1 -0
  71. package/dist_i18n/mt.js +21 -0
  72. package/dist_i18n/mt.umd.cjs +1 -0
  73. package/dist_i18n/nl.js +21 -0
  74. package/dist_i18n/nl.umd.cjs +1 -0
  75. package/dist_i18n/pl.js +21 -0
  76. package/dist_i18n/pl.umd.cjs +1 -0
  77. package/dist_i18n/pt-br.js +21 -0
  78. package/dist_i18n/pt-br.umd.cjs +1 -0
  79. package/dist_i18n/pt-pt.js +21 -0
  80. package/dist_i18n/pt-pt.umd.cjs +1 -0
  81. package/dist_i18n/ro.js +21 -0
  82. package/dist_i18n/ro.umd.cjs +1 -0
  83. package/dist_i18n/ru.js +21 -0
  84. package/dist_i18n/ru.umd.cjs +1 -0
  85. package/dist_i18n/sk.js +21 -0
  86. package/dist_i18n/sk.umd.cjs +1 -0
  87. package/dist_i18n/sl.js +21 -0
  88. package/dist_i18n/sl.umd.cjs +1 -0
  89. package/dist_i18n/sv.js +21 -0
  90. package/dist_i18n/sv.umd.cjs +1 -0
  91. package/dist_i18n/ta.js +21 -0
  92. package/dist_i18n/ta.umd.cjs +1 -0
  93. package/dist_i18n/te.js +21 -0
  94. package/dist_i18n/te.umd.cjs +1 -0
  95. package/dist_i18n/th.js +21 -0
  96. package/dist_i18n/th.umd.cjs +1 -0
  97. package/dist_i18n/tr.js +21 -0
  98. package/dist_i18n/tr.umd.cjs +1 -0
  99. package/dist_i18n/uk.js +21 -0
  100. package/dist_i18n/uk.umd.cjs +1 -0
  101. package/dist_i18n/ur.js +21 -0
  102. package/dist_i18n/ur.umd.cjs +1 -0
  103. package/dist_i18n/vi.js +21 -0
  104. package/dist_i18n/vi.umd.cjs +1 -0
  105. package/dist_i18n/zh-cn.js +21 -0
  106. package/dist_i18n/zh-cn.umd.cjs +1 -0
  107. package/dist_i18n/zh-tw.js +21 -0
  108. package/dist_i18n/zh-tw.umd.cjs +1 -0
  109. package/dist_plugins/obfuscation.js +10 -10
  110. package/dist_plugins/obfuscation.umd.cjs +1 -1
  111. package/dist_plugins/upload.js +145 -133
  112. package/dist_plugins/upload.umd.cjs +4 -4
  113. package/package.json +12 -8
  114. package/postinstall.js +0 -10
@@ -1,11 +1,14 @@
1
- (function(k,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(k=typeof globalThis<"u"?globalThis:k||self,A(k.altcha={}))})(this,function(k){"use strict";var so=Object.defineProperty;var Gn=k=>{throw TypeError(k)};var fo=(k,A,U)=>A in k?so(k,A,{enumerable:!0,configurable:!0,writable:!0,value:U}):k[A]=U;var ce=(k,A,U)=>fo(k,typeof A!="symbol"?A+"":A,U),Jn=(k,A,U)=>A.has(k)||Gn("Cannot "+U);var K=(k,A,U)=>(Jn(k,A,"read from private field"),U?U.call(k):A.get(k)),ar=(k,A,U)=>A.has(k)?Gn("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(k):A.set(k,U),sr=(k,A,U,bt)=>(Jn(k,A,"write to private field"),bt?bt.call(k,U):A.set(k,U),U);var hn,xe,ie;const A=`(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
2
- `,U=typeof self<"u"&&self.Blob&&new Blob([A],{type:"text/javascript;charset=utf-8"});function bt(e){let t;try{if(t=U&&(self.URL||self.webkitURL).createObjectURL(U),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(A),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Kn="5";typeof window<"u"&&((hn=window.__svelte??(window.__svelte={})).v??(hn.v=new Set)).add(Kn);const Xn=1,Qn=4,ei=8,ti=16,ri=1,ni=2,Mt="[",fr="[!",ur="]",Be={},Y=Symbol(),ii="http://www.w3.org/1999/xhtml",cr=!1,ae=2,dr=4,yt=8,Ut=16,me=32,Pe=64,Et=128,re=256,xt=512,X=1024,pe=2048,qe=4096,He=8192,$t=16384,li=32768,jt=65536,oi=1<<19,vr=1<<20,lt=Symbol("$state"),hr=Symbol("legacy props"),ai=Symbol("");var gr=Array.isArray,si=Array.prototype.indexOf,fi=Array.from,kt=Object.keys,Ct=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,ui=Object.getOwnPropertyDescriptors,ci=Object.prototype,di=Array.prototype,_r=Object.getPrototypeOf;function mr(e){for(var t=0;t<e.length;t++)e[t]()}const vi=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let ot=[],at=[];function pr(){var e=ot;ot=[],mr(e)}function wr(){var e=at;at=[],mr(e)}function Vt(e){ot.length===0&&queueMicrotask(pr),ot.push(e)}function hi(e){at.length===0&&vi(wr),at.push(e)}function br(){ot.length>0&&pr(),at.length>0&&wr()}function yr(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 Er(e){return!gi(e,this.v)}function _i(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function mi(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function pi(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wi(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bi(){throw new Error("https://svelte.dev/e/hydration_failed")}function yi(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ei(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function xi(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function $i(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function ki(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Ci=!1;function de(e,t){var r={f:0,v:e,reactions:null,equals:yr,rv:0,wv:0};return r}function We(e){return Ai(de(e))}function xr(e,t=!1){const r=de(e);return t||(r.equals=Er),r}function Ai(e){return C!==null&&!fe&&(C.f&ae)!==0&&(ve===null?Li([e]):ve.push(e)),e}function O(e,t){return C!==null&&!fe&&Gr()&&(C.f&(ae|Ut))!==0&&(ve===null||!ve.includes(e))&&ki(),Ri(e,t)}function Ri(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=Pr(),$r(e,pe),S!==null&&(S.f&X)!==0&&(S.f&(me|Pe))===0&&(ye===null?Di([e]):ye.push(e))),t}function $r(e,t){var r=e.reactions;if(r!==null)for(var l=r.length,i=0;i<l;i++){var o=r[i],a=o.f;(a&pe)===0&&(he(o,t),(a&(X|re))!==0&&((a&ae)!==0?$r(o,qe):Dt(o)))}}function ze(e){var t=ae|pe,r=C!==null&&(C.f&ae)!==0?C:null;return S===null||r!==null&&(r.f&re)!==0?t|=re:S.f|=vr,{ctx:H,deps:null,effects:null,equals:yr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??S}}function kr(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Ee(t[r])}}function Ii(e){for(var t=e.parent;t!==null;){if((t.f&ae)===0)return t;t=t.parent}return null}function Si(e){var t,r=S;Re(Ii(e));try{kr(e),t=zr(e)}finally{Re(r)}return t}function Cr(e){var t=Si(e),r=(Ie||(e.f&re)!==0)&&e.deps!==null?qe:X;he(e,r),e.equals(t)||(e.v=t,e.wv=Pr())}function At(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let D=!1;function Ye(e){D=e}let z;function ke(e){if(e===null)throw At(),Be;return z=e}function Ze(){return ke(Ce(z))}function Q(e){if(D){if(Ce(z)!==null)throw At(),Be;z=e}}function Ti(){for(var e=0,t=z;;){if(t.nodeType===8){var r=t.data;if(r===ur){if(e===0)return t;e-=1}else(r===Mt||r===fr)&&(e+=1)}var l=Ce(t);t.remove(),t=l}}function se(e,t=null,r){if(typeof e!="object"||e===null||lt in e)return e;const l=_r(e);if(l!==ci&&l!==di)return e;var i=new Map,o=gr(e),a=de(0);o&&i.set("length",de(e.length));var f;return new Proxy(e,{defineProperty(s,c,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&Ei();var h=i.get(c);return h===void 0?(h=de(v.value),i.set(c,h)):O(h,se(v.value,f)),!0},deleteProperty(s,c){var v=i.get(c);if(v===void 0)c in s&&i.set(c,de(Y));else{if(o&&typeof c=="string"){var h=i.get("length"),g=Number(c);Number.isInteger(g)&&g<h.v&&O(h,g)}O(v,Y),Ar(a)}return!0},get(s,c,v){var b;if(c===lt)return e;var h=i.get(c),g=c in s;if(h===void 0&&(!g||(b=Oe(s,c))!=null&&b.writable)&&(h=de(se(g?s[c]:Y,f)),i.set(c,h)),h!==void 0){var m=d(h);return m===Y?void 0:m}return Reflect.get(s,c,v)},getOwnPropertyDescriptor(s,c){var v=Reflect.getOwnPropertyDescriptor(s,c);if(v&&"value"in v){var h=i.get(c);h&&(v.value=d(h))}else if(v===void 0){var g=i.get(c),m=g==null?void 0:g.v;if(g!==void 0&&m!==Y)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return v},has(s,c){var m;if(c===lt)return!0;var v=i.get(c),h=v!==void 0&&v.v!==Y||Reflect.has(s,c);if(v!==void 0||S!==null&&(!h||(m=Oe(s,c))!=null&&m.writable)){v===void 0&&(v=de(h?se(s[c],f):Y),i.set(c,v));var g=d(v);if(g===Y)return!1}return h},set(s,c,v,h){var V;var g=i.get(c),m=c in s;if(o&&c==="length")for(var b=v;b<g.v;b+=1){var L=i.get(b+"");L!==void 0?O(L,Y):b in s&&(L=de(Y),i.set(b+"",L))}g===void 0?(!m||(V=Oe(s,c))!=null&&V.writable)&&(g=de(void 0),O(g,se(v,f)),i.set(c,g)):(m=g.v!==Y,O(g,se(v,f)));var F=Reflect.getOwnPropertyDescriptor(s,c);if(F!=null&&F.set&&F.set.call(h,v),!m){if(o&&typeof c=="string"){var Z=i.get("length"),j=Number(c);Number.isInteger(j)&&j>=Z.v&&O(Z,j+1)}Ar(a)}return!0},ownKeys(s){d(a);var c=Reflect.ownKeys(s).filter(g=>{var m=i.get(g);return m===void 0||m.v!==Y});for(var[v,h]of i)h.v!==Y&&!(v in s)&&c.push(v);return c},setPrototypeOf(){xi()}})}function Ar(e,t=1){O(e,e.v+t)}var Rr,Ir,Sr,Tr;function Bt(){if(Rr===void 0){Rr=window,Ir=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;Sr=Oe(t,"firstChild").get,Tr=Oe(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 qt(e=""){return document.createTextNode(e)}function we(e){return Sr.call(e)}function Ce(e){return Tr.call(e)}function ee(e,t){if(!D)return we(e);var r=we(z);return r===null&&(r=z.appendChild(qt())),ke(r),r}function Nr(e,t){if(!D){var r=we(e);return r instanceof Comment&&r.data===""?Ce(r):r}return z}function be(e,t=1,r=!1){let l=D?z:e;for(var i;t--;)i=l,l=Ce(l);if(!D)return l;var o=l==null?void 0:l.nodeType;if(r&&o!==3){var a=qt();return l===null?i==null||i.after(a):l.before(a),ke(a),a}return ke(l),l}function Ni(e){e.textContent=""}let Rt=!1,It=!1,St=null,Fe=!1,Ht=!1;function Lr(e){Ht=e}let st=[],uo=[],C=null,fe=!1;function Ae(e){C=e}let S=null;function Re(e){S=e}let ve=null;function Li(e){ve=e}let q=null,te=0,ye=null;function Di(e){ye=e}let Dr=1,Tt=0,Ie=!1;function Pr(){return++Dr}function ft(e){var h;var t=e.f;if((t&pe)!==0)return!0;if((t&qe)!==0){var r=e.deps,l=(t&re)!==0;if(r!==null){var i,o,a=(t&xt)!==0,f=l&&S!==null&&!Ie,s=r.length;if(a||f){var c=e,v=c.parent;for(i=0;i<s;i++)o=r[i],(a||!((h=o==null?void 0:o.reactions)!=null&&h.includes(c)))&&(o.reactions??(o.reactions=[])).push(c);a&&(c.f^=xt),f&&v!==null&&(v.f&re)===0&&(c.f^=re)}for(i=0;i<s;i++)if(o=r[i],ft(o)&&Cr(o),o.wv>e.wv)return!0}(!l||S!==null&&!Ie)&&he(e,X)}return!1}function Pi(e,t){for(var r=t;r!==null;){if((r.f&Et)!==0)try{r.fn(e);return}catch{r.f^=Et}r=r.parent}throw Rt=!1,e}function Oi(e){return(e.f&$t)===0&&(e.parent===null||(e.parent.f&Et)===0)}function Nt(e,t,r,l){if(Rt){if(r===null&&(Rt=!1),Oi(t))throw e;return}r!==null&&(Rt=!0);{Pi(e,t);return}}function Or(e,t,r=!0){var l=e.reactions;if(l!==null)for(var i=0;i<l.length;i++){var o=l[i];(o.f&ae)!==0?Or(o,t,!1):t===o&&(r?he(o,pe):(o.f&X)!==0&&he(o,qe),Dt(o))}}function zr(e){var m;var t=q,r=te,l=ye,i=C,o=Ie,a=ve,f=H,s=fe,c=e.f;q=null,te=0,ye=null,Ie=(c&re)!==0&&(fe||!Fe||C===null),C=(c&(me|Pe))===0?e:null,ve=null,Wr(e.ctx),fe=!1,Tt++;try{var v=(0,e.fn)(),h=e.deps;if(q!==null){var g;if(Lt(e,te),h!==null&&te>0)for(h.length=te+q.length,g=0;g<q.length;g++)h[te+g]=q[g];else e.deps=h=q;if(!Ie)for(g=te;g<h.length;g++)((m=h[g]).reactions??(m.reactions=[])).push(e)}else h!==null&&te<h.length&&(Lt(e,te),h.length=te);if(Gr()&&ye!==null&&!fe&&h!==null&&(e.f&(ae|qe|pe))===0)for(g=0;g<ye.length;g++)Or(ye[g],e);return i!==null&&Tt++,v}finally{q=t,te=r,ye=l,C=i,Ie=o,ve=a,Wr(f),fe=s}}function zi(e,t){let r=t.reactions;if(r!==null){var l=si.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&ae)!==0&&(q===null||!q.includes(t))&&(he(t,qe),(t.f&(re|xt))===0&&(t.f^=xt),kr(t),Lt(t,0))}function Lt(e,t){var r=e.deps;if(r!==null)for(var l=t;l<r.length;l++)zi(e,r[l])}function Wt(e){var t=e.f;if((t&$t)===0){he(e,X);var r=S,l=H,i=Fe;S=e,Fe=!0;try{(t&Ut)!==0?Zi(e):Ur(e),Mr(e);var o=zr(e);e.teardown=typeof o=="function"?o:null,e.wv=Dr;var a=e.deps,f;cr&&Ci&&e.f&pe}catch(s){Nt(s,e,r,l||e.ctx)}finally{Fe=i,S=r}}}function Fi(){try{wi()}catch(e){if(St!==null)Nt(e,St,null);else throw e}}function Fr(){var e=Fe;try{var t=0;for(Fe=!0;st.length>0;){t++>1e3&&Fi();var r=st,l=r.length;st=[];for(var i=0;i<l;i++){var o=Ui(r[i]);Mi(o)}}}finally{It=!1,Fe=e,St=null}}function Mi(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var l=e[r];if((l.f&($t|He))===0)try{ft(l)&&(Wt(l),l.deps===null&&l.first===null&&l.nodes_start===null&&(l.teardown===null?jr(l):l.fn=null))}catch(i){Nt(i,l,null,l.ctx)}}}function Dt(e){It||(It=!0,queueMicrotask(Fr));for(var t=St=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Pe|me))!==0){if((r&X)===0)return;t.f^=X}}st.push(t)}function Ui(e){for(var t=[],r=e;r!==null;){var l=r.f,i=(l&(me|Pe))!==0,o=i&&(l&X)!==0;if(!o&&(l&He)===0){if((l&dr)!==0)t.push(r);else if(i)r.f^=X;else{var a=C;try{C=r,ft(r)&&Wt(r)}catch(c){Nt(c,r,null,r.ctx)}finally{C=a}}var f=r.first;if(f!==null){r=f;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function x(e){var t;for(br();st.length>0;)It=!0,Fr(),br();return t}async function ji(){await Promise.resolve(),x()}function d(e){var t=e.f,r=(t&ae)!==0;if(C!==null&&!fe){ve!==null&&ve.includes(e)&&$i();var l=C.deps;e.rv<Tt&&(e.rv=Tt,q===null&&l!==null&&l[te]===e?te++:q===null?q=[e]:(!Ie||!q.includes(e))&&q.push(e))}else if(r&&e.deps===null&&e.effects===null){var i=e,o=i.parent;o!==null&&(o.f&re)===0&&(i.f^=re)}return r&&(i=e,ft(i)&&Cr(i)),e.v}function Ge(e){var t=fe;try{return fe=!0,e()}finally{fe=t}}const Vi=-7169;function he(e,t){e.f=e.f&Vi|t}function Bi(e){S===null&&C===null&&pi(),C!==null&&(C.f&re)!==0&&S===null&&mi(),Ht&&_i()}function qi(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Me(e,t,r,l=!0){var i=S,o={ctx:H,deps:null,nodes_start:null,nodes_end:null,f:e|pe,first:null,fn:t,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Wt(o),o.f|=li}catch(s){throw Ee(o),s}else t!==null&&Dt(o);var a=r&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&(vr|Et))===0;if(!a&&l&&(i!==null&&qi(o,i),C!==null&&(C.f&ae)!==0)){var f=C;(f.effects??(f.effects=[])).push(o)}return o}function Hi(e){const t=Me(yt,null,!1);return he(t,X),t.teardown=e,t}function Yt(e){Bi();var t=S!==null&&(S.f&me)!==0&&H!==null&&!H.m;if(t){var r=H;(r.e??(r.e=[])).push({fn:e,effect:S,reaction:C})}else{var l=Zt(e);return l}}function Wi(e){const t=Me(Pe,e,!0);return()=>{Ee(t)}}function Yi(e){const t=Me(Pe,e,!0);return(r={})=>new Promise(l=>{r.outro?Kt(t,()=>{Ee(t),l(void 0)}):(Ee(t),l(void 0))})}function Zt(e){return Me(dr,e,!1)}function Gt(e){return Me(yt,e,!0)}function Je(e,t=[],r=ze){const l=t.map(r);return Jt(()=>e(...l.map(d)))}function Jt(e,t=0){return Me(yt|Ut|t,e,!0)}function Pt(e,t=!0){return Me(yt|me,e,!0,t)}function Mr(e){var t=e.teardown;if(t!==null){const r=Ht,l=C;Lr(!0),Ae(null);try{t.call(null)}finally{Lr(r),Ae(l)}}}function Ur(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var l=r.next;(r.f&Pe)!==0?r.parent=null:Ee(r,t),r=l}}function Zi(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&me)===0&&Ee(t),t=r}}function Ee(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 o=l===i?null:Ce(l);l.remove(),l=o}r=!0}Ur(e,t&&!r),Lt(e,0),he(e,$t);var a=e.transitions;if(a!==null)for(const s of a)s.stop();Mr(e);var f=e.parent;f!==null&&f.first!==null&&jr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function jr(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 Kt(e,t){var r=[];Vr(e,r,!0),Gi(r,()=>{Ee(e),t&&t()})}function Gi(e,t){var r=e.length;if(r>0){var l=()=>--r||t();for(var i of e)i.out(l)}else t()}function Vr(e,t,r){if((e.f&He)===0){if(e.f^=He,e.transitions!==null)for(const a of e.transitions)(a.is_global||r)&&t.push(a);for(var l=e.first;l!==null;){var i=l.next,o=(l.f&jt)!==0||(l.f&me)!==0;Vr(l,t,o?r:!1),l=i}}}function Br(e){qr(e,!0)}function qr(e,t){if((e.f&He)!==0){e.f^=He,(e.f&X)===0&&(e.f^=X),ft(e)&&(he(e,pe),Dt(e));for(var r=e.first;r!==null;){var l=r.next,i=(r.f&jt)!==0||(r.f&me)!==0;qr(r,i?t:!1),r=l}if(e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&o.in()}}function Hr(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let H=null;function Wr(e){H=e}function Yr(e,t=!1,r){H={p:H,c:null,e:null,m:!1,s:e,x:null,l:null}}function Zr(e){const t=H;if(t!==null){e!==void 0&&(t.x=e);const a=t.e;if(a!==null){var r=S,l=C;t.e=null;try{for(var i=0;i<a.length;i++){var o=a[i];Re(o.effect),Ae(o.reaction),Zt(o.fn)}}finally{Re(r),Ae(l)}}H=t.p,t.m=!0}return e||{}}function Gr(){return!0}const Ji=["touchstart","touchmove"];function Ki(e){return Ji.includes(e)}let Jr=!1;function Kr(){Jr||(Jr=!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 Xr(e){var t=C,r=S;Ae(null),Re(null);try{return e()}finally{Ae(t),Re(r)}}function Xi(e,t,r,l=r){e.addEventListener(t,()=>Xr(r));const i=e.__on_r;i?e.__on_r=()=>{i(),l(!0)}:e.__on_r=()=>l(!0),Kr()}const Qr=new Set,Xt=new Set;function Qi(e,t,r,l={}){function i(o){if(l.capture||ut.call(t,o),!o.cancelBubble)return Xr(()=>r==null?void 0:r.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Vt(()=>{t.addEventListener(e,i,l)}):t.addEventListener(e,i,l),i}function el(e,t,r,l,i){var o={capture:l,passive:i},a=Qi(e,t,r,o);(t===document.body||t===window||t===document)&&Hi(()=>{t.removeEventListener(e,a,o)})}function tl(e){for(var t=0;t<e.length;t++)Qr.add(e[t]);for(var r of Xt)r(e)}function ut(e){var j;var t=this,r=t.ownerDocument,l=e.type,i=((j=e.composedPath)==null?void 0:j.call(e))||[],o=i[0]||e.target,a=0,f=e.__root;if(f){var s=i.indexOf(f);if(s!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;s<=c&&(a=s)}if(o=i[a]||e.target,o!==t){Ct(e,"currentTarget",{configurable:!0,get(){return o||r}});var v=C,h=S;Ae(null),Re(null);try{for(var g,m=[];o!==null;){var b=o.assignedSlot||o.parentNode||o.host||null;try{var L=o["__"+l];if(L!=null&&(!o.disabled||e.target===o))if(gr(L)){var[F,...Z]=L;F.apply(o,[e,...Z])}else L.call(o,e)}catch(V){g?m.push(V):g=V}if(e.cancelBubble||b===t||b===null)break;o=b}if(g){for(let V of m)queueMicrotask(()=>{throw V});throw g}}finally{e.__root=t,delete e.currentTarget,Ae(v),Re(h)}}}function Qt(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Se(e,t){var r=S;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function ge(e,t){var r=(t&ri)!==0,l=(t&ni)!==0,i,o=!e.startsWith("<!>");return()=>{if(D)return Se(z,null),z;i===void 0&&(i=Qt(o?e:"<!>"+e),r||(i=we(i)));var a=l||Ir?document.importNode(i,!0):i.cloneNode(!0);if(r){var f=we(a),s=a.lastChild;Se(f,s)}else Se(a,a);return a}}function rl(e,t,r="svg"){var l=!e.startsWith("<!>"),i=`<${r}>${l?e:"<!>"+e}</${r}>`,o;return()=>{if(D)return Se(z,null),z;if(!o){var a=Qt(i),f=we(a);o=we(f)}var s=o.cloneNode(!0);return Se(s,s),s}}function ne(e,t){if(D){S.nodes_end=z,Ze();return}e!==null&&e.before(t)}function en(e,t){return tn(e,t)}function nl(e,t){Bt(),t.intro=t.intro??!1;const r=t.target,l=D,i=z;try{for(var o=we(r);o&&(o.nodeType!==8||o.data!==Mt);)o=Ce(o);if(!o)throw Be;Ye(!0),ke(o),Ze();const a=tn(e,{...t,anchor:o});if(z===null||z.nodeType!==8||z.data!==ur)throw At(),Be;return Ye(!1),a}catch(a){if(a===Be)return t.recover===!1&&bi(),Bt(),Ni(r),Ye(!1),en(e,t);throw a}finally{Ye(l),ke(i)}}const Ke=new Map;function tn(e,{target:t,anchor:r,props:l={},events:i,context:o,intro:a=!0}){Bt();var f=new Set,s=h=>{for(var g=0;g<h.length;g++){var m=h[g];if(!f.has(m)){f.add(m);var b=Ki(m);t.addEventListener(m,ut,{passive:b});var L=Ke.get(m);L===void 0?(document.addEventListener(m,ut,{passive:b}),Ke.set(m,1)):Ke.set(m,L+1)}}};s(fi(Qr)),Xt.add(s);var c=void 0,v=Yi(()=>{var h=r??t.appendChild(qt());return Pt(()=>{if(o){Yr({});var g=H;g.c=o}i&&(l.$$events=i),D&&Se(h,null),c=e(h,l)||{},D&&(S.nodes_end=z),o&&Zr()}),()=>{var b;for(var g of f){t.removeEventListener(g,ut);var m=Ke.get(g);--m===0?(document.removeEventListener(g,ut),Ke.delete(g)):Ke.set(g,m)}Xt.delete(s),h!==r&&((b=h.parentNode)==null||b.removeChild(h))}});return er.set(c,v),c}let er=new WeakMap;function il(e,t){const r=er.get(e);return r?(er.delete(e),r(t)):Promise.resolve()}function Te(e,t,[r,l]=[0,0]){D&&r===0&&Ze();var i=e,o=null,a=null,f=Y,s=r>0?jt:0,c=!1;const v=(g,m=!0)=>{c=!0,h(m,g)},h=(g,m)=>{if(f===(f=g))return;let b=!1;if(D&&l!==-1){if(r===0){const F=i.data;F===Mt?l=0:F===fr?l=1/0:(l=parseInt(F.substring(1)),l!==l&&(l=f?1/0:-1))}const L=l>r;!!f===L&&(i=Ti(),ke(i),Ye(!1),b=!0,l=-1)}f?(o?Br(o):m&&(o=Pt(()=>m(i))),a&&Kt(a,()=>{a=null})):(a?Br(a):m&&(a=Pt(()=>m(i,[r+1,l]))),o&&Kt(o,()=>{o=null})),b&&Ye(!0)};Jt(()=>{c=!1,t(v),c||h(null,null)},s),D&&(i=z)}function Xe(e,t,r,l,i){var o=e,a="",f;Jt(()=>{if(a===(a=t()??"")){D&&Ze();return}f!==void 0&&(Ee(f),f=void 0),a!==""&&(f=Pt(()=>{if(D){z.data;for(var s=Ze(),c=s;s!==null&&(s.nodeType!==8||s.data!=="");)c=s,s=Ce(s);if(s===null)throw At(),Be;Se(z,c),o=ke(s);return}var v=a+"",h=Qt(v);Se(we(h),h.lastChild),o.before(h)}))})}function ll(e,t,r,l,i){var f;D&&Ze();var o=(f=t.$$slots)==null?void 0:f[r],a=!1;o===!0&&(o=t.children,a=!0),o===void 0||o(e,a?()=>l:l)}function ol(e,t){Vt(()=>{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 rn=[...`
3
- \r\f \v\uFEFF`];function al(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 o=i.length,a=0;(a=l.indexOf(i,a))>=0;){var f=a+o;(a===0||rn.includes(l[a-1]))&&(f===l.length||rn.includes(l[f]))?l=(a===0?"":l.substring(0,a))+l.substring(f+1):a=f}}return l===""?null:l}function sl(e,t,r,l,i,o){var a=e.__className;if(D||a!==r){var f=al(r,l,o);(!D||f!==e.getAttribute("class"))&&(f==null?e.removeAttribute("class"):e.className=f),e.__className=r}else if(o&&i!==o)for(var s in o){var c=!!o[s];(i==null||c!==!!i[s])&&e.classList.toggle(s,c)}return o}const fl=Symbol("is custom element"),ul=Symbol("is html");function nn(e){if(D){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var l=e.value;ue(e,"value",null),e.value=l}if(e.hasAttribute("checked")){var i=e.checked;ue(e,"checked",null),e.checked=i}}};e.__on_r=r,hi(r),Kr()}}function cl(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 ue(e,t,r,l){var i=ln(e);D&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||i[t]!==(i[t]=r)&&(t==="loading"&&(e[ai]=r),r==null?e.removeAttribute(t):typeof r!="string"&&dl(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function ln(e){return e.__attributes??(e.__attributes={[fl]:e.nodeName.includes("-"),[ul]:e.namespaceURI===ii})}var on=new Map;function dl(e){var t=on.get(e.nodeName);if(t)return t;on.set(e.nodeName,t=[]);for(var r,l=e,i=Element.prototype;i!==l;){r=ui(l);for(var o in r)r[o].set&&t.push(o);l=_r(l)}return t}function vl(e,t,r=t){Xi(e,"change",l=>{var i=l?e.defaultChecked:e.checked;r(i)}),(D&&e.defaultChecked!==e.checked||Ge(t)==null)&&r(e.checked),Gt(()=>{var l=t();e.checked=!!l})}function an(e,t){return e===t||(e==null?void 0:e[lt])===t}function sn(e={},t,r,l){return Zt(()=>{var i,o;return Gt(()=>{i=o,o=[],Ge(()=>{e!==r(...o)&&(t(e,...o),i&&an(r(...i),e)&&t(null,...i))})}),()=>{Vt(()=>{o&&an(r(...o),e)&&t(null,...o)})}}),e}function fn(e){H===null&&Hr(),Yt(()=>{const t=Ge(e);if(typeof t=="function")return t})}function hl(e){H===null&&Hr(),fn(()=>()=>Ge(e))}let Ot=!1;function gl(e){var t=Ot;try{return Ot=!1,[e(),Ot]}finally{Ot=t}}function R(e,t,r,l){var Ue;var i=(r&Xn)!==0,o=!0,a=(r&ei)!==0,f=(r&ti)!==0,s=!1,c;a?[c,s]=gl(()=>e[t]):c=e[t];var v=lt in e||hr in e,h=a&&(((Ue=Oe(e,t))==null?void 0:Ue.set)??(v&&t in e&&(M=>e[t]=M)))||void 0,g=l,m=!0,b=!1,L=()=>(b=!0,m&&(m=!1,f?g=Ge(l):g=l),g);c===void 0&&l!==void 0&&(h&&o&&yi(),c=L(),h&&h(c));var F;if(F=()=>{var M=e[t];return M===void 0?L():(m=!0,b=!1,M)},(r&Qn)===0)return F;if(h){var Z=e.$$legacy;return function(M,B){return arguments.length>0?((!B||Z||s)&&h(B?F():M),M):F()}}var j=!1,V=xr(c),G=ze(()=>{var M=F(),B=d(V);return j?(j=!1,B):V.v=M});return i||(G.equals=Er),function(M,B){if(arguments.length>0){const $e=B?d(G):a?se(M):M;return G.equals($e)||(j=!0,O(V,$e),b&&g!==void 0&&(g=$e),Ge(()=>d(G))),M}return d(G)}}function _l(e){return new ml(e)}class ml{constructor(t){ar(this,xe);ar(this,ie);var o;var r=new Map,l=(a,f)=>{var s=xr(f);return r.set(a,s),s};const i=new Proxy({...t.props||{},$$events:{}},{get(a,f){return d(r.get(f)??l(f,Reflect.get(a,f)))},has(a,f){return f===hr?!0:(d(r.get(f)??l(f,Reflect.get(a,f))),Reflect.has(a,f))},set(a,f,s){return O(r.get(f)??l(f,s),s),Reflect.set(a,f,s)}});sr(this,ie,(t.hydrate?nl:en)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((o=t==null?void 0:t.props)!=null&&o.$$host)||t.sync===!1)&&x(),sr(this,xe,i.$$events);for(const a of Object.keys(K(this,ie)))a==="$set"||a==="$destroy"||a==="$on"||Ct(this,a,{get(){return K(this,ie)[a]},set(f){K(this,ie)[a]=f},enumerable:!0});K(this,ie).$set=a=>{Object.assign(i,a)},K(this,ie).$destroy=()=>{il(K(this,ie))}}$set(t){K(this,ie).$set(t)}$on(t,r){K(this,xe)[t]=K(this,xe)[t]||[];const l=(...i)=>r.call(this,...i);return K(this,xe)[t].push(l),()=>{K(this,xe)[t]=K(this,xe)[t].filter(i=>i!==l)}}$destroy(){K(this,ie).$destroy()}}xe=new WeakMap,ie=new WeakMap;let un;typeof HTMLElement=="function"&&(un=class extends HTMLElement{constructor(t,r,l){super();ce(this,"$$ctor");ce(this,"$$s");ce(this,"$$c");ce(this,"$$cn",!1);ce(this,"$$d",{});ce(this,"$$r",!1);ce(this,"$$p_d",{});ce(this,"$$l",{});ce(this,"$$l_u",new Map);ce(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 o=>{const a=document.createElement("slot");i!=="default"&&(a.name=i),ne(o,a)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},l=pl(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 o=this.$$g_p(i.name);o in this.$$d||(this.$$d[o]=zt(o,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=_l({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Wi(()=>{Gt(()=>{var i;this.$$r=!0;for(const o of kt(this.$$c)){if(!((i=this.$$p_d[o])!=null&&i.reflect))continue;this.$$d[o]=this.$$c[o];const a=zt(o,this.$$d[o],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[o].attribute||o):this.setAttribute(this.$$p_d[o].attribute||o,a)}this.$$r=!1})});for(const i in this.$$l)for(const o of this.$$l[i]){const a=this.$$c.$on(i,o);this.$$l_u.set(o,a)}this.$$l={}}}attributeChangedCallback(t,r,l){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=zt(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 kt(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function zt(e,t,r,l){var o;const i=(o=r[e])==null?void 0:o.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 pl(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function wl(e,t,r,l,i,o){let a=class extends un{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return kt(t).map(f=>(t[f].attribute||f).toLowerCase())}};return kt(t).forEach(f=>{Ct(a.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(s){var h;s=zt(f,s,t),this.$$d[f]=s;var c=this.$$c;if(c){var v=(h=Oe(c,f))==null?void 0:h.get;v?c[f]=s:c.$set({[f]:s})}}})}),l.forEach(f=>{Ct(a.prototype,f,{get(){var s;return(s=this.$$c)==null?void 0:s[f]}})}),e.element=a,a}const cn=new TextEncoder;function bl(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function yl(e,t="SHA-256",r=1e5){const l=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const i=await dn(l,e,t);return{algorithm:t,challenge:i,salt:l,signature:""}}async function dn(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 bl(await crypto.subtle.digest(r.toUpperCase(),cn.encode(e+t)))}function El(e,t,r="SHA-256",l=1e6,i=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let s=i;s<=l;s+=1){if(o.signal.aborted)return null;if(await dn(t,s,r)===e)return{number:s,took:Date.now()-a}}return null})(),controller:o}}function xl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function $l(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 kl(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 Cl(e,t="",r=1e6,l=0){const i="AES-GCM",o=new AbortController,a=Date.now(),f=async()=>{for(let v=l;v<=r;v+=1){if(o.signal.aborted||!s||!c)return null;try{const h=await crypto.subtle.decrypt({name:i,iv:kl(v)},s,c);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-a}}catch{}}return null};let s=null,c=null;try{c=$l(e);const v=await crypto.subtle.digest("SHA-256",cn.encode(t));s=await crypto.subtle.importKey("raw",v,i,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:f(),controller:o}}var w=(e=>(e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(w||{}),Al=rl('<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><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-ddsc3z"></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-ddsc3z"></path></svg>'),Rl=ge('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span> <input type="hidden" class="svelte-ddsc3z">',1),Il=ge('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span>'),Sl=ge('<label class="svelte-ddsc3z"><!></label>'),Tl=ge('<div class="svelte-ddsc3z"><a target="_blank" class="altcha-logo svelte-ddsc3z"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><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-ddsc3z"></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-ddsc3z"></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-ddsc3z"></path></svg></a></div>'),Nl=ge('<div class="svelte-ddsc3z"><!></div>'),Ll=ge('<div class="svelte-ddsc3z"><!></div>'),Dl=ge('<div class="altcha-error svelte-ddsc3z"><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" class="svelte-ddsc3z"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-ddsc3z"></path></svg> <!></div>'),Pl=ge('<div class="altcha-footer svelte-ddsc3z"><div class="svelte-ddsc3z"><!></div></div>'),Ol=ge('<div class="altcha-anchor-arrow svelte-ddsc3z"></div>'),zl=ge('<!> <div class="altcha svelte-ddsc3z"><div class="altcha-main svelte-ddsc3z"><!> <div><input type="checkbox" class="svelte-ddsc3z"></div> <div class="altcha-label svelte-ddsc3z"><!></div> <!></div> <!> <!> <!></div>',1);const Fl={hash:"svelte-ddsc3z",code:`.altcha.svelte-ddsc3z {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;text-align:left;}.altcha.svelte-ddsc3z:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z {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-ddsc3z .altcha-anchor-arrow:where(.svelte-ddsc3z) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-ddsc3z:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-ddsc3z:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-ddsc3z {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-ddsc3z {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;}.altcha-label.svelte-ddsc3z {flex-grow:1;}.altcha-label.svelte-ddsc3z label:where(.svelte-ddsc3z) {cursor:pointer;}.altcha-logo.svelte-ddsc3z {color:currentColor;opacity:0.3;}.altcha-logo.svelte-ddsc3z:hover {opacity:1;}.altcha-error.svelte-ddsc3z {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-ddsc3z {align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right;}.altcha-footer.svelte-ddsc3z:hover {opacity:1;}.altcha-footer.svelte-ddsc3z > :where(.svelte-ddsc3z):first-child {flex-grow:1;}.altcha-footer.svelte-ddsc3z a {color:currentColor;}.altcha-checkbox.svelte-ddsc3z {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-ddsc3z input:where(.svelte-ddsc3z) {width:18px;height:18px;margin:0;}.altcha-hidden.svelte-ddsc3z {display:none;}.altcha-spinner.svelte-ddsc3z {
4
- animation: svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center;}
1
+ (function(S,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):(S=typeof globalThis<"u"?globalThis:S||self,z(S.altcha={}))})(this,function(S){"use strict";var ua=Object.defineProperty;var Ao=S=>{throw TypeError(S)};var ca=(S,z,G)=>z in S?ua(S,z,{enumerable:!0,configurable:!0,writable:!0,value:G}):S[z]=G;var ke=(S,z,G)=>ca(S,typeof z!="symbol"?z+"":z,G),Ro=(S,z,G)=>z.has(S)||Ao("Cannot "+G);var ue=(S,z,G)=>(Ro(S,z,"read from private field"),G?G.call(S):z.get(S)),Or=(S,z,G)=>z.has(S)?Ao("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(S):z.set(S,G),Fr=(S,z,G,Ot)=>(Ro(S,z,"write to private field"),Ot?Ot.call(S,G):z.set(S,G),G);var jn,Oe,ge;const z=`(function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const s="AES-GCM",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",u,s,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t==="abort")i==null||i.abort(),i=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();
2
+ `,G=typeof self<"u"&&self.Blob&&new Blob([z],{type:"text/javascript;charset=utf-8"});function Ot(e){let t;try{if(t=G&&(self.URL||self.webkitURL).createObjectURL(G),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(z),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Io="5";typeof window<"u"&&((jn=window.__svelte??(window.__svelte={})).v??(jn.v=new Set)).add(Io);const $o=1,So=4,No=8,To=16,zo=1,Do=2,cr="[",Vr="[!",Mr="]",st={},le=Symbol(),Lo="http://www.w3.org/1999/xhtml",Ur=!1,me=2,jr=4,Ft=8,fr=16,Ne=32,et=64,Vt=128,ve=256,Mt=512,ce=1024,Te=2048,ut=4096,ct=8192,Ut=16384,Po=32768,dr=65536,Oo=1<<19,qr=1<<20,kt=Symbol("$state"),Br=Symbol("legacy props"),Fo=Symbol("");var Hr=Array.isArray,Vo=Array.prototype.indexOf,Mo=Array.from,jt=Object.keys,qt=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,Uo=Object.getOwnPropertyDescriptors,jo=Object.prototype,qo=Array.prototype,Yr=Object.getPrototypeOf;function Gr(e){for(var t=0;t<e.length;t++)e[t]()}function Bo(e,t,r=!1){return e===void 0?r?t():t:e}const Ho=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Et=[],Ct=[];function Wr(){var e=Et;Et=[],Gr(e)}function Zr(){var e=Ct;Ct=[],Gr(e)}function Bt(e){Et.length===0&&queueMicrotask(Wr),Et.push(e)}function Yo(e){Ct.length===0&&Ho(Zr),Ct.push(e)}function Jr(){Et.length>0&&Wr(),Ct.length>0&&Zr()}function Kr(e){return e===this.v}function Go(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function hr(e){return!Go(e,this.v)}function Wo(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zo(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Jo(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Ko(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Xo(){throw new Error("https://svelte.dev/e/hydration_failed")}function Qo(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function el(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function tl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function rl(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function nl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let ol=!1;function Ee(e,t){var r={f:0,v:e,reactions:null,equals:Kr,rv:0,wv:0};return r}function ie(e){return ll(Ee(e))}function Xr(e,t=!1){const r=Ee(e);return t||(r.equals=hr),r}function ll(e){return N!==null&&!pe&&(N.f&me)!==0&&(Ce===null?dl([e]):Ce.push(e)),e}function w(e,t){return N!==null&&!pe&&Cn()&&(N.f&(me|fr))!==0&&(Ce===null||!Ce.includes(e))&&nl(),il(e,t)}function il(e,t){return e.equals(t)||(e.v,e.v=t,e.wv=cn(),Qr(e,Te),D!==null&&(D.f&ce)!==0&&(D.f&(Ne|et))===0&&(De===null?hl([e]):De.push(e))),t}function Qr(e,t){var r=e.reactions;if(r!==null)for(var l=r.length,o=0;o<l;o++){var i=r[o],s=i.f;(s&Te)===0&&(xe(i,t),(s&(ce|ve))!==0&&((s&me)!==0?Qr(i,ut):Qt(i)))}}function Ue(e){var t=me|Te,r=N!==null&&(N.f&me)!==0?N:null;return D===null||r!==null&&(r.f&ve)!==0?t|=ve:D.f|=qr,{ctx:ne,deps:null,effects:null,equals:Kr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??D}}function al(e){const t=Ue(e);return t.equals=hr,t}function en(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Pe(t[r])}}function sl(e){for(var t=e.parent;t!==null;){if((t.f&me)===0)return t;t=t.parent}return null}function ul(e){var t,r=D;He(sl(e));try{en(e),t=dn(e)}finally{He(r)}return t}function tn(e){var t=ul(e),r=(Ye||(e.f&ve)!==0)&&e.deps!==null?ut:ce;xe(e,r),e.equals(t)||(e.v=t,e.wv=cn())}function Ht(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let L=!1;function ft(e){L=e}let P;function je(e){if(e===null)throw Ht(),st;return P=e}function dt(){return je(qe(P))}function W(e){if(L){if(qe(P)!==null)throw Ht(),st;P=e}}function cl(){for(var e=0,t=P;;){if(t.nodeType===8){var r=t.data;if(r===Mr){if(e===0)return t;e-=1}else(r===cr||r===Vr)&&(e+=1)}var l=qe(t);t.remove(),t=l}}function V(e,t=null,r){if(typeof e!="object"||e===null||kt in e)return e;const l=Yr(e);if(l!==jo&&l!==qo)return e;var o=new Map,i=Hr(e),s=Ee(0);i&&o.set("length",Ee(e.length));var c;return new Proxy(e,{defineProperty(f,d,_){(!("value"in _)||_.configurable===!1||_.enumerable===!1||_.writable===!1)&&el();var h=o.get(d);return h===void 0?(h=Ee(_.value),o.set(d,h)):w(h,V(_.value,c)),!0},deleteProperty(f,d){var _=o.get(d);if(_===void 0)d in f&&o.set(d,Ee(le));else{if(i&&typeof d=="string"){var h=o.get("length"),g=Number(d);Number.isInteger(g)&&g<h.v&&w(h,g)}w(_,le),rn(s)}return!0},get(f,d,_){var x;if(d===kt)return e;var h=o.get(d),g=d in f;if(h===void 0&&(!g||(x=tt(f,d))!=null&&x.writable)&&(h=Ee(V(g?f[d]:le,c)),o.set(d,h)),h!==void 0){var p=a(h);return p===le?void 0:p}return Reflect.get(f,d,_)},getOwnPropertyDescriptor(f,d){var _=Reflect.getOwnPropertyDescriptor(f,d);if(_&&"value"in _){var h=o.get(d);h&&(_.value=a(h))}else if(_===void 0){var g=o.get(d),p=g==null?void 0:g.v;if(g!==void 0&&p!==le)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return _},has(f,d){var p;if(d===kt)return!0;var _=o.get(d),h=_!==void 0&&_.v!==le||Reflect.has(f,d);if(_!==void 0||D!==null&&(!h||(p=tt(f,d))!=null&&p.writable)){_===void 0&&(_=Ee(h?V(f[d],c):le),o.set(d,_));var g=a(_);if(g===le)return!1}return h},set(f,d,_,h){var B;var g=o.get(d),p=d in f;if(i&&d==="length")for(var x=_;x<g.v;x+=1){var O=o.get(x+"");O!==void 0?w(O,le):x in f&&(O=Ee(le),o.set(x+"",O))}g===void 0?(!p||(B=tt(f,d))!=null&&B.writable)&&(g=Ee(void 0),w(g,V(_,c)),o.set(d,g)):(p=g.v!==le,w(g,V(_,c)));var M=Reflect.getOwnPropertyDescriptor(f,d);if(M!=null&&M.set&&M.set.call(h,_),!p){if(i&&typeof d=="string"){var Re=o.get("length"),ae=Number(d);Number.isInteger(ae)&&ae>=Re.v&&w(Re,ae+1)}rn(s)}return!0},ownKeys(f){a(s);var d=Reflect.ownKeys(f).filter(g=>{var p=o.get(g);return p===void 0||p.v!==le});for(var[_,h]of o)h.v!==le&&!(_ in f)&&d.push(_);return d},setPrototypeOf(){tl()}})}function rn(e,t=1){w(e,e.v+t)}var nn,on,ln,an;function vr(){if(nn===void 0){nn=window,on=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype;ln=tt(t,"firstChild").get,an=tt(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 Yt(e=""){return document.createTextNode(e)}function ze(e){return ln.call(e)}function qe(e){return an.call(e)}function Z(e,t){if(!L)return ze(e);var r=ze(P);return r===null&&(r=P.appendChild(Yt())),je(r),r}function xt(e,t){if(!L){var r=ze(e);return r instanceof Comment&&r.data===""?qe(r):r}return P}function J(e,t=1,r=!1){let l=L?P:e;for(var o;t--;)o=l,l=qe(l);if(!L)return l;var i=l==null?void 0:l.nodeType;if(r&&i!==3){var s=Yt();return l===null?o==null||o.after(s):l.before(s),je(s),s}return je(l),l}function fl(e){e.textContent=""}let Gt=!1,Wt=!1,Zt=null,rt=!1,gr=!1;function sn(e){gr=e}let At=[],fa=[],N=null,pe=!1;function Be(e){N=e}let D=null;function He(e){D=e}let Ce=null;function dl(e){Ce=e}let re=null,fe=0,De=null;function hl(e){De=e}let un=1,Jt=0,Ye=!1;function cn(){return++un}function Rt(e){var h;var t=e.f;if((t&Te)!==0)return!0;if((t&ut)!==0){var r=e.deps,l=(t&ve)!==0;if(r!==null){var o,i,s=(t&Mt)!==0,c=l&&D!==null&&!Ye,f=r.length;if(s||c){var d=e,_=d.parent;for(o=0;o<f;o++)i=r[o],(s||!((h=i==null?void 0:i.reactions)!=null&&h.includes(d)))&&(i.reactions??(i.reactions=[])).push(d);s&&(d.f^=Mt),c&&_!==null&&(_.f&ve)===0&&(d.f^=ve)}for(o=0;o<f;o++)if(i=r[o],Rt(i)&&tn(i),i.wv>e.wv)return!0}(!l||D!==null&&!Ye)&&xe(e,ce)}return!1}function vl(e,t){for(var r=t;r!==null;){if((r.f&Vt)!==0)try{r.fn(e);return}catch{r.f^=Vt}r=r.parent}throw Gt=!1,e}function gl(e){return(e.f&Ut)===0&&(e.parent===null||(e.parent.f&Vt)===0)}function Kt(e,t,r,l){if(Gt){if(r===null&&(Gt=!1),gl(t))throw e;return}r!==null&&(Gt=!0);{vl(e,t);return}}function fn(e,t,r=!0){var l=e.reactions;if(l!==null)for(var o=0;o<l.length;o++){var i=l[o];(i.f&me)!==0?fn(i,t,!1):t===i&&(r?xe(i,Te):(i.f&ce)!==0&&xe(i,ut),Qt(i))}}function dn(e){var p;var t=re,r=fe,l=De,o=N,i=Ye,s=Ce,c=ne,f=pe,d=e.f;re=null,fe=0,De=null,Ye=(d&ve)!==0&&(pe||!rt||N===null),N=(d&(Ne|et))===0?e:null,Ce=null,yn(e.ctx),pe=!1,Jt++;try{var _=(0,e.fn)(),h=e.deps;if(re!==null){var g;if(Xt(e,fe),h!==null&&fe>0)for(h.length=fe+re.length,g=0;g<re.length;g++)h[fe+g]=re[g];else e.deps=h=re;if(!Ye)for(g=fe;g<h.length;g++)((p=h[g]).reactions??(p.reactions=[])).push(e)}else h!==null&&fe<h.length&&(Xt(e,fe),h.length=fe);if(Cn()&&De!==null&&!pe&&h!==null&&(e.f&(me|ut|Te))===0)for(g=0;g<De.length;g++)fn(De[g],e);return o!==null&&Jt++,_}finally{re=t,fe=r,De=l,N=o,Ye=i,Ce=s,yn(c),pe=f}}function _l(e,t){let r=t.reactions;if(r!==null){var l=Vo.call(r,e);if(l!==-1){var o=r.length-1;o===0?r=t.reactions=null:(r[l]=r[o],r.pop())}}r===null&&(t.f&me)!==0&&(re===null||!re.includes(t))&&(xe(t,ut),(t.f&(ve|Mt))===0&&(t.f^=Mt),en(t),Xt(t,0))}function Xt(e,t){var r=e.deps;if(r!==null)for(var l=t;l<r.length;l++)_l(e,r[l])}function _r(e){var t=e.f;if((t&Ut)===0){xe(e,ce);var r=D,l=ne,o=rt;D=e,rt=!0;try{(t&fr)!==0?Al(e):gn(e),vn(e);var i=dn(e);e.teardown=typeof i=="function"?i:null,e.wv=un;var s=e.deps,c;Ur&&ol&&e.f&Te}catch(f){Kt(f,e,r,l||e.ctx)}finally{rt=o,D=r}}}function ml(){try{Ko()}catch(e){if(Zt!==null)Kt(e,Zt,null);else throw e}}function hn(){var e=rt;try{var t=0;for(rt=!0;At.length>0;){t++>1e3&&ml();var r=At,l=r.length;At=[];for(var o=0;o<l;o++){var i=bl(r[o]);pl(i)}}}finally{Wt=!1,rt=e,Zt=null}}function pl(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var l=e[r];if((l.f&(Ut|ct))===0)try{Rt(l)&&(_r(l),l.deps===null&&l.first===null&&l.nodes_start===null&&(l.teardown===null?_n(l):l.fn=null))}catch(o){Kt(o,l,null,l.ctx)}}}function Qt(e){Wt||(Wt=!0,queueMicrotask(hn));for(var t=Zt=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(et|Ne))!==0){if((r&ce)===0)return;t.f^=ce}}At.push(t)}function bl(e){for(var t=[],r=e;r!==null;){var l=r.f,o=(l&(Ne|et))!==0,i=o&&(l&ce)!==0;if(!i&&(l&ct)===0){if((l&jr)!==0)t.push(r);else if(o)r.f^=ce;else{var s=N;try{N=r,Rt(r)&&_r(r)}catch(d){Kt(d,r,null,r.ctx)}finally{N=s}}var c=r.first;if(c!==null){r=c;continue}}var f=r.parent;for(r=r.next;r===null&&f!==null;)r=f.next,f=f.parent}return t}function C(e){var t;for(Jr();At.length>0;)Wt=!0,hn(),Jr();return t}async function mr(){await Promise.resolve(),C()}function a(e){var t=e.f,r=(t&me)!==0;if(N!==null&&!pe){Ce!==null&&Ce.includes(e)&&rl();var l=N.deps;e.rv<Jt&&(e.rv=Jt,re===null&&l!==null&&l[fe]===e?fe++:re===null?re=[e]:(!Ye||!re.includes(e))&&re.push(e))}else if(r&&e.deps===null&&e.effects===null){var o=e,i=o.parent;i!==null&&(i.f&ve)===0&&(o.f^=ve)}return r&&(o=e,Rt(o)&&tn(o)),e.v}function ht(e){var t=pe;try{return pe=!0,e()}finally{pe=t}}const wl=-7169;function xe(e,t){e.f=e.f&wl|t}function yl(e){D===null&&N===null&&Jo(),N!==null&&(N.f&ve)!==0&&D===null&&Zo(),gr&&Wo()}function kl(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function nt(e,t,r,l=!0){var o=D,i={ctx:ne,deps:null,nodes_start:null,nodes_end:null,f:e|Te,first:null,fn:t,last:null,next:null,parent:o,prev:null,teardown:null,transitions:null,wv:0};if(r)try{_r(i),i.f|=Po}catch(f){throw Pe(i),f}else t!==null&&Qt(i);var s=r&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&(qr|Vt))===0;if(!s&&l&&(o!==null&&kl(i,o),N!==null&&(N.f&me)!==0)){var c=N;(c.effects??(c.effects=[])).push(i)}return i}function El(e){const t=nt(Ft,null,!1);return xe(t,ce),t.teardown=e,t}function pr(e){yl();var t=D!==null&&(D.f&Ne)!==0&&ne!==null&&!ne.m;if(t){var r=ne;(r.e??(r.e=[])).push({fn:e,effect:D,reaction:N})}else{var l=br(e);return l}}function Cl(e){const t=nt(et,e,!0);return()=>{Pe(t)}}function xl(e){const t=nt(et,e,!0);return(r={})=>new Promise(l=>{r.outro?kr(t,()=>{Pe(t),l(void 0)}):(Pe(t),l(void 0))})}function br(e){return nt(jr,e,!1)}function wr(e){return nt(Ft,e,!0)}function Le(e,t=[],r=Ue){const l=t.map(r);return yr(()=>e(...l.map(a)))}function yr(e,t=0){return nt(Ft|fr|t,e,!0)}function er(e,t=!0){return nt(Ft|Ne,e,!0,t)}function vn(e){var t=e.teardown;if(t!==null){const r=gr,l=N;sn(!0),Be(null);try{t.call(null)}finally{sn(r),Be(l)}}}function gn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var l=r.next;(r.f&et)!==0?r.parent=null:Pe(r,t),r=l}}function Al(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Ne)===0&&Pe(t),t=r}}function Pe(e,t=!0){var r=!1;if((t||(e.f&Oo)!==0)&&e.nodes_start!==null){for(var l=e.nodes_start,o=e.nodes_end;l!==null;){var i=l===o?null:qe(l);l.remove(),l=i}r=!0}gn(e,t&&!r),Xt(e,0),xe(e,Ut);var s=e.transitions;if(s!==null)for(const f of s)f.stop();vn(e);var c=e.parent;c!==null&&c.first!==null&&_n(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function _n(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 kr(e,t){var r=[];mn(e,r,!0),Rl(r,()=>{Pe(e),t&&t()})}function Rl(e,t){var r=e.length;if(r>0){var l=()=>--r||t();for(var o of e)o.out(l)}else t()}function mn(e,t,r){if((e.f&ct)===0){if(e.f^=ct,e.transitions!==null)for(const s of e.transitions)(s.is_global||r)&&t.push(s);for(var l=e.first;l!==null;){var o=l.next,i=(l.f&dr)!==0||(l.f&Ne)!==0;mn(l,t,i?r:!1),l=o}}}function pn(e){bn(e,!0)}function bn(e,t){if((e.f&ct)!==0){e.f^=ct,(e.f&ce)===0&&(e.f^=ce),Rt(e)&&(xe(e,Te),Qt(e));for(var r=e.first;r!==null;){var l=r.next,o=(r.f&dr)!==0||(r.f&Ne)!==0;bn(r,o?t:!1),r=l}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||t)&&i.in()}}function wn(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let ne=null;function yn(e){ne=e}function kn(e,t=!1,r){ne={p:ne,c:null,e:null,m:!1,s:e,x:null,l:null}}function En(e){const t=ne;if(t!==null){e!==void 0&&(t.x=e);const s=t.e;if(s!==null){var r=D,l=N;t.e=null;try{for(var o=0;o<s.length;o++){var i=s[o];He(i.effect),Be(i.reaction),br(i.fn)}}finally{He(r),Be(l)}}ne=t.p,t.m=!0}return e||{}}function Cn(){return!0}const Il=["touchstart","touchmove"];function $l(e){return Il.includes(e)}function Sl(e,t){{const r=document.body;e.autofocus=!0,Bt(()=>{document.activeElement===r&&e.focus()})}}let xn=!1;function An(){xn||(xn=!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=N,r=D;Be(null),He(null);try{return e()}finally{Be(t),He(r)}}function Nl(e,t,r,l=r){e.addEventListener(t,()=>Rn(r));const o=e.__on_r;o?e.__on_r=()=>{o(),l(!0)}:e.__on_r=()=>l(!0),An()}const In=new Set,Er=new Set;function Tl(e,t,r,l={}){function o(i){if(l.capture||It.call(t,i),!i.cancelBubble)return Rn(()=>r==null?void 0:r.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Bt(()=>{t.addEventListener(e,o,l)}):t.addEventListener(e,o,l),o}function Ge(e,t,r,l,o){var i={capture:l,passive:o},s=Tl(e,t,r,i);(t===document.body||t===window||t===document)&&El(()=>{t.removeEventListener(e,s,i)})}function zl(e){for(var t=0;t<e.length;t++)In.add(e[t]);for(var r of Er)r(e)}function It(e){var ae;var t=this,r=t.ownerDocument,l=e.type,o=((ae=e.composedPath)==null?void 0:ae.call(e))||[],i=o[0]||e.target,s=0,c=e.__root;if(c){var f=o.indexOf(c);if(f!==-1&&(t===document||t===window)){e.__root=t;return}var d=o.indexOf(t);if(d===-1)return;f<=d&&(s=f)}if(i=o[s]||e.target,i!==t){qt(e,"currentTarget",{configurable:!0,get(){return i||r}});var _=N,h=D;Be(null),He(null);try{for(var g,p=[];i!==null;){var x=i.assignedSlot||i.parentNode||i.host||null;try{var O=i["__"+l];if(O!=null&&(!i.disabled||e.target===i))if(Hr(O)){var[M,...Re]=O;M.apply(i,[e,...Re])}else O.call(i,e)}catch(B){g?p.push(B):g=B}if(e.cancelBubble||x===t||x===null)break;i=x}if(g){for(let B of p)queueMicrotask(()=>{throw B});throw g}}finally{e.__root=t,delete e.currentTarget,Be(_),He(h)}}}function Cr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ae(e,t){var r=D;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function be(e,t){var r=(t&zo)!==0,l=(t&Do)!==0,o,i=!e.startsWith("<!>");return()=>{if(L)return Ae(P,null),P;o===void 0&&(o=Cr(i?e:"<!>"+e),r||(o=ze(o)));var s=l||on?document.importNode(o,!0):o.cloneNode(!0);if(r){var c=ze(s),f=s.lastChild;Ae(c,f)}else Ae(s,s);return s}}function tr(e,t,r="svg"){var l=!e.startsWith("<!>"),o=`<${r}>${l?e:"<!>"+e}</${r}>`,i;return()=>{if(L)return Ae(P,null),P;if(!i){var s=Cr(o),c=ze(s);i=ze(c)}var f=i.cloneNode(!0);return Ae(f,f),f}}function rr(){if(L)return Ae(P,null),P;var e=document.createDocumentFragment(),t=document.createComment(""),r=Yt();return e.append(t,r),Ae(t,r),e}function q(e,t){if(L){D.nodes_end=P,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 $n(e,t){return Sn(e,t)}function Ll(e,t){vr(),t.intro=t.intro??!1;const r=t.target,l=L,o=P;try{for(var i=ze(r);i&&(i.nodeType!==8||i.data!==cr);)i=qe(i);if(!i)throw st;ft(!0),je(i),dt();const s=Sn(e,{...t,anchor:i});if(P===null||P.nodeType!==8||P.data!==Mr)throw Ht(),st;return ft(!1),s}catch(s){if(s===st)return t.recover===!1&&Xo(),vr(),fl(r),ft(!1),$n(e,t);throw s}finally{ft(l),je(o)}}const vt=new Map;function Sn(e,{target:t,anchor:r,props:l={},events:o,context:i,intro:s=!0}){vr();var c=new Set,f=h=>{for(var g=0;g<h.length;g++){var p=h[g];if(!c.has(p)){c.add(p);var x=$l(p);t.addEventListener(p,It,{passive:x});var O=vt.get(p);O===void 0?(document.addEventListener(p,It,{passive:x}),vt.set(p,1)):vt.set(p,O+1)}}};f(Mo(In)),Er.add(f);var d=void 0,_=xl(()=>{var h=r??t.appendChild(Yt());return er(()=>{if(i){kn({});var g=ne;g.c=i}o&&(l.$$events=o),L&&Ae(h,null),d=e(h,l)||{},L&&(D.nodes_end=P),i&&En()}),()=>{var x;for(var g of c){t.removeEventListener(g,It);var p=vt.get(g);--p===0?(document.removeEventListener(g,It),vt.delete(g)):vt.set(g,p)}Er.delete(f),h!==r&&((x=h.parentNode)==null||x.removeChild(h))}});return xr.set(d,_),d}let xr=new WeakMap;function Pl(e,t){const r=xr.get(e);return r?(xr.delete(e),r(t)):Promise.resolve()}function K(e,t,[r,l]=[0,0]){L&&r===0&&dt();var o=e,i=null,s=null,c=le,f=r>0?dr:0,d=!1;const _=(g,p=!0)=>{d=!0,h(p,g)},h=(g,p)=>{if(c===(c=g))return;let x=!1;if(L&&l!==-1){if(r===0){const M=o.data;M===cr?l=0:M===Vr?l=1/0:(l=parseInt(M.substring(1)),l!==l&&(l=c?1/0:-1))}const O=l>r;!!c===O&&(o=cl(),je(o),ft(!1),x=!0,l=-1)}c?(i?pn(i):p&&(i=er(()=>p(o))),s&&kr(s,()=>{s=null})):(s?pn(s):p&&(s=er(()=>p(o,[r+1,l]))),i&&kr(i,()=>{i=null})),x&&ft(!0)};yr(()=>{d=!1,t(_),d||h(null,null)},f),L&&(o=P)}function ot(e,t,r,l,o){var i=e,s="",c;yr(()=>{if(s===(s=t()??"")){L&&dt();return}c!==void 0&&(Pe(c),c=void 0),s!==""&&(c=er(()=>{if(L){P.data;for(var f=dt(),d=f;f!==null&&(f.nodeType!==8||f.data!=="");)d=f,f=qe(f);if(f===null)throw Ht(),st;Ae(P,d),i=je(f);return}var _=s+"",h=Cr(_);Ae(ze(h),h.lastChild),i.before(h)}))})}function Ol(e,t,r,l,o){var c;L&&dt();var i=(c=t.$$slots)==null?void 0:c[r],s=!1;i===!0&&(i=t.children,s=!0),i===void 0||i(e,s?()=>l:l)}function Fl(e,t){Bt(()=>{var r=e.getRootNode(),l=r.host?r:r.head??r.ownerDocument.head;if(!l.querySelector("#"+t.hash)){const o=document.createElement("style");o.id=t.hash,o.textContent=t.code,l.appendChild(o)}})}const Nn=[...`
3
+ \r\f \v\uFEFF`];function Vl(e,t,r){var l=""+e;if(r){for(var o in r)if(r[o])l=l?l+" "+o:o;else if(l.length)for(var i=o.length,s=0;(s=l.indexOf(o,s))>=0;){var c=s+i;(s===0||Nn.includes(l[s-1]))&&(c===l.length||Nn.includes(l[c]))?l=(s===0?"":l.substring(0,s))+l.substring(c+1):s=c}}return l===""?null:l}function Ml(e,t,r,l,o,i){var s=e.__className;if(L||s!==r){var c=Vl(r,l,i);(!L||c!==e.getAttribute("class"))&&(c==null?e.removeAttribute("class"):e.className=c),e.__className=r}else if(i&&o!==i)for(var f in i){var d=!!i[f];(o==null||d!==!!o[f])&&e.classList.toggle(f,d)}return i}const Ul=Symbol("is custom element"),jl=Symbol("is html");function Tn(e){if(L){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var l=e.value;I(e,"value",null),e.value=l}if(e.hasAttribute("checked")){var o=e.checked;I(e,"checked",null),e.checked=o}}};e.__on_r=r,Yo(r),An()}}function ql(e,t){var r=zn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function I(e,t,r,l){var o=zn(e);L&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=r)&&(t==="loading"&&(e[Fo]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Bl(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function zn(e){return e.__attributes??(e.__attributes={[Ul]:e.nodeName.includes("-"),[jl]:e.namespaceURI===Lo})}var Dn=new Map;function Bl(e){var t=Dn.get(e.nodeName);if(t)return t;Dn.set(e.nodeName,t=[]);for(var r,l=e,o=Element.prototype;o!==l;){r=Uo(l);for(var i in r)r[i].set&&t.push(i);l=Yr(l)}return t}function Hl(e,t,r=t){Nl(e,"change",l=>{var o=l?e.defaultChecked:e.checked;r(o)}),(L&&e.defaultChecked!==e.checked||ht(t)==null)&&r(e.checked),wr(()=>{var l=t();e.checked=!!l})}function Ln(e,t){return e===t||(e==null?void 0:e[kt])===t}function nr(e={},t,r,l){return br(()=>{var o,i;return wr(()=>{o=i,i=[],ht(()=>{e!==r(...i)&&(t(e,...i),o&&Ln(r(...o),e)&&t(null,...o))})}),()=>{Bt(()=>{i&&Ln(r(...i),e)&&t(null,...i)})}}),e}function Pn(e){ne===null&&wn(),pr(()=>{const t=ht(e);if(typeof t=="function")return t})}function Yl(e){ne===null&&wn(),Pn(()=>()=>ht(e))}let or=!1;function Gl(e){var t=or;try{return or=!1,[e(),or]}finally{or=t}}function A(e,t,r,l){var We;var o=(r&$o)!==0,i=!0,s=(r&No)!==0,c=(r&To)!==0,f=!1,d;s?[d,f]=Gl(()=>e[t]):d=e[t];var _=kt in e||Br in e,h=s&&(((We=tt(e,t))==null?void 0:We.set)??(_&&t in e&&(U=>e[t]=U)))||void 0,g=l,p=!0,x=!1,O=()=>(x=!0,p&&(p=!1,c?g=ht(l):g=l),g);d===void 0&&l!==void 0&&(h&&i&&Qo(),d=O(),h&&h(d));var M;if(M=()=>{var U=e[t];return U===void 0?O():(p=!0,x=!1,U)},(r&So)===0)return M;if(h){var Re=e.$$legacy;return function(U,we){return arguments.length>0?((!we||Re||f)&&h(we?M():U),U):M()}}var ae=!1,B=Xr(d),de=Ue(()=>{var U=M(),we=a(B);return ae?(ae=!1,we):B.v=U});return o||(de.equals=hr),function(U,we){if(arguments.length>0){const Fe=we?a(de):s?V(U):U;return de.equals(Fe)||(ae=!0,w(B,Fe),x&&g!==void 0&&(g=Fe),ht(()=>a(de))),U}return a(de)}}function Wl(e){return new Zl(e)}class Zl{constructor(t){Or(this,Oe);Or(this,ge);var i;var r=new Map,l=(s,c)=>{var f=Xr(c);return r.set(s,f),f};const o=new Proxy({...t.props||{},$$events:{}},{get(s,c){return a(r.get(c)??l(c,Reflect.get(s,c)))},has(s,c){return c===Br?!0:(a(r.get(c)??l(c,Reflect.get(s,c))),Reflect.has(s,c))},set(s,c,f){return w(r.get(c)??l(c,f),f),Reflect.set(s,c,f)}});Fr(this,ge,(t.hydrate?Ll:$n)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((i=t==null?void 0:t.props)!=null&&i.$$host)||t.sync===!1)&&C(),Fr(this,Oe,o.$$events);for(const s of Object.keys(ue(this,ge)))s==="$set"||s==="$destroy"||s==="$on"||qt(this,s,{get(){return ue(this,ge)[s]},set(c){ue(this,ge)[s]=c},enumerable:!0});ue(this,ge).$set=s=>{Object.assign(o,s)},ue(this,ge).$destroy=()=>{Pl(ue(this,ge))}}$set(t){ue(this,ge).$set(t)}$on(t,r){ue(this,Oe)[t]=ue(this,Oe)[t]||[];const l=(...o)=>r.call(this,...o);return ue(this,Oe)[t].push(l),()=>{ue(this,Oe)[t]=ue(this,Oe)[t].filter(o=>o!==l)}}$destroy(){ue(this,ge).$destroy()}}Oe=new WeakMap,ge=new WeakMap;let On;typeof HTMLElement=="function"&&(On=class extends HTMLElement{constructor(t,r,l){super();ke(this,"$$ctor");ke(this,"$$s");ke(this,"$$c");ke(this,"$$cn",!1);ke(this,"$$d",{});ke(this,"$$r",!1);ke(this,"$$p_d",{});ke(this,"$$l",{});ke(this,"$$l_u",new Map);ke(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 o=this.$$c.$on(t,r);this.$$l_u.set(r,o)}super.addEventListener(t,r,l)}removeEventListener(t,r,l){if(super.removeEventListener(t,r,l),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 i=>{const s=document.createElement("slot");o!=="default"&&(s.name=o),q(i,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},l=Jl(this);for(const o of this.$$s)o in l&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),r.default=!0):r[o]=t(o));for(const o of this.attributes){const i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=lr(i,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=Wl({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Cl(()=>{wr(()=>{var o;this.$$r=!0;for(const i of jt(this.$$c)){if(!((o=this.$$p_d[i])!=null&&o.reflect))continue;this.$$d[i]=this.$$c[i];const s=lr(i,this.$$d[i],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,s)}this.$$r=!1})});for(const o in this.$$l)for(const i of this.$$l[o]){const s=this.$$c.$on(o,i);this.$$l_u.set(i,s)}this.$$l={}}}attributeChangedCallback(t,r,l){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=lr(t,l,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 jt(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 i;const o=(i=r[e])==null?void 0:i.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!l||!r[e])return t;if(l==="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 Jl(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Kl(e,t,r,l,o,i){let s=class extends On{constructor(){super(e,r,o),this.$$p_d=t}static get observedAttributes(){return jt(t).map(c=>(t[c].attribute||c).toLowerCase())}};return jt(t).forEach(c=>{qt(s.prototype,c,{get(){return this.$$c&&c in this.$$c?this.$$c[c]:this.$$d[c]},set(f){var h;f=lr(c,f,t),this.$$d[c]=f;var d=this.$$c;if(d){var _=(h=tt(d,c))==null?void 0:h.get;_?d[c]=f:d.$set({[c]:f})}}})}),l.forEach(c=>{qt(s.prototype,c,{get(){var f;return(f=this.$$c)==null?void 0:f[c]}})}),e.element=s,s}const Fn=new TextEncoder;function Xl(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function Ql(e,t="SHA-256",r=1e5){const l=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await Vn(l,e,t);return{algorithm:t,challenge:o,salt:l,signature:""}}async function Vn(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 Xl(await crypto.subtle.digest(r.toUpperCase(),Fn.encode(e+t)))}function ei(e,t,r="SHA-256",l=1e6,o=0){const i=new AbortController,s=Date.now();return{promise:(async()=>{for(let f=o;f<=l;f+=1){if(i.signal.aborted)return null;if(await Vn(t,f,r)===e)return{number:f,took:Date.now()-s}}return null})(),controller:i}}function Mn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ti(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 ri(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 ni(e,t="",r=1e6,l=0){const o="AES-GCM",i=new AbortController,s=Date.now(),c=async()=>{for(let _=l;_<=r;_+=1){if(i.signal.aborted||!f||!d)return null;try{const h=await crypto.subtle.decrypt({name:o,iv:ri(_)},f,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-s}}catch{}}return null};let f=null,d=null;try{d=ti(e);const _=await crypto.subtle.digest("SHA-256",Fn.encode(t));f=await crypto.subtle.importKey("raw",_,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:i}}return{promise:c(),controller:i}}var k=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(k||{}),te=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(te||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{register:(e,t)=>{globalThis.altchaI18n[e]=t}};const oi={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",oi);const Ar=(e,t)=>{let r=al(()=>Bo(t==null?void 0:t(),24));var l=si();Le(()=>{I(l,"width",a(r)),I(l,"height",a(r))}),q(e,l)};function li(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function ii(e,t){e.preventDefault(),t()}function ai(e,t,r,l,o,i,s,c){var f;[k.UNVERIFIED,k.ERROR,k.EXPIRED,k.CODE].includes(a(t))?r()!==!1&&((f=a(l))==null?void 0:f.reportValidity())===!1?w(o,!1):i()?s():c():w(o,!0)}var si=tr('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-uo3tkz"><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-uo3tkz"></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-uo3tkz"></path></svg>'),ui=be('<input type="hidden" class="svelte-uo3tkz">'),ci=be('<div class="svelte-uo3tkz"><a target="_blank" class="altcha-logo svelte-uo3tkz" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-uo3tkz"><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-uo3tkz"></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-uo3tkz"></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-uo3tkz"></path></svg></a></div>'),fi=tr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-uo3tkz"><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-uo3tkz"></path></svg>'),di=tr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-uo3tkz"><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-uo3tkz"></path></svg>'),hi=tr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-uo3tkz"><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-uo3tkz"></path></svg>'),vi=be('<button type="button" class="altcha-code-challenge-audio svelte-uo3tkz"><!></button>'),gi=be('<audio hidden autoplay class="svelte-uo3tkz"><source class="svelte-uo3tkz"></audio>'),_i=be('<div class="altcha-code-challenge svelte-uo3tkz" role="dialog"><div class="altcha-code-challenge-arrow svelte-uo3tkz"></div> <form data-code-challenge-form="1" class="svelte-uo3tkz"><img class="altcha-code-challenge-image svelte-uo3tkz" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input svelte-uo3tkz" required> <div class="altcha-code-challenge-buttons svelte-uo3tkz"><div class="altcha-code-challenge-buttons-left svelte-uo3tkz"><!> <button type="button" class="altcha-code-challenge-reload svelte-uo3tkz"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="svelte-uo3tkz"><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-uo3tkz"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify svelte-uo3tkz"><!> </button></div> <!></form></div>'),mi=be('<div class="svelte-uo3tkz"><!></div>'),pi=be('<div class="svelte-uo3tkz"><!></div>'),bi=be('<div class="altcha-error svelte-uo3tkz"><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-uo3tkz"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-uo3tkz"></path></svg> <!></div>'),wi=be('<div class="altcha-footer svelte-uo3tkz"><div class="svelte-uo3tkz"><!></div></div>'),yi=be('<div class="altcha-anchor-arrow svelte-uo3tkz"></div>'),ki=be('<!> <div class="altcha svelte-uo3tkz"><div class="altcha-main svelte-uo3tkz"><div><!> <input type="checkbox" class="svelte-uo3tkz"></div> <label class="altcha-label svelte-uo3tkz"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);const Ei={hash:"svelte-uo3tkz",code:`.altcha.svelte-uo3tkz {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-uo3tkz:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-uo3tkz {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-uo3tkz .altcha-anchor-arrow:where(.svelte-uo3tkz) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-uo3tkz:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-uo3tkz:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-uo3tkz:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-uo3tkz {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-uo3tkz {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;position:relative;}.altcha-code-challenge.svelte-uo3tkz {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-uo3tkz > form:where(.svelte-uo3tkz) {display:flex;flex-direction:column;gap:0.5rem;}.altcha-code-challenge-input.svelte-uo3tkz {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-uo3tkz:focus {outline:2px solid rgba(0, 0, 250, 0.2);}.altcha-code-challenge-input.svelte-uo3tkz:disabled {opacity:0.7;}.altcha-code-challenge-image.svelte-uo3tkz {border:1px solid currentColor;border-radius:3px;box-sizing:border-box;object-fit:contain;height:50px;width:220px;}.altcha-code-challenge-audio.svelte-uo3tkz,
4
+ .altcha-code-challenge-reload.svelte-uo3tkz {background:#efefef;border:0;border-radius:3px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0.35rem;}.altcha-code-challenge-audio.svelte-uo3tkz:disabled,
5
+ .altcha-code-challenge-reload.svelte-uo3tkz:disabled {opacity:0.7;pointer-events:none;}.altcha-code-challenge-audio.svelte-uo3tkz > :where(.svelte-uo3tkz),
6
+ .altcha-code-challenge-reload.svelte-uo3tkz > :where(.svelte-uo3tkz) {height:20px;width:20px;}.altcha-code-challenge-buttons.svelte-uo3tkz {display:flex;justify-content:space-between;}.altcha-code-challenge-buttons-left.svelte-uo3tkz {display:flex;gap:0.25rem;}.altcha-code-challenge-verify.svelte-uo3tkz {align-items:center;background:blue;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-uo3tkz:disabled {opacity:0.7;pointer-events:none;}.altcha-code-challenge-arrow.svelte-uo3tkz {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-uo3tkz .altcha-code-challenge:where(.svelte-uo3tkz) {top:-150px;}.altcha[data-floating=top].svelte-uo3tkz .altcha-code-challenge-arrow:where(.svelte-uo3tkz) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, currentColor);bottom:-12px;top:auto;}.altcha-label.svelte-uo3tkz {cursor:pointer;flex-grow:1;}.altcha-logo.svelte-uo3tkz {color:currentColor;opacity:0.7;}.altcha-logo.svelte-uo3tkz:hover {opacity:1;}.altcha-error.svelte-uo3tkz {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-uo3tkz {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-uo3tkz:hover {opacity:1;}.altcha-footer.svelte-uo3tkz a {color:currentColor;}.altcha-checkbox.svelte-uo3tkz {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-uo3tkz input:where(.svelte-uo3tkz) {width:18px;height:18px;margin:0;}.altcha-checkbox-verifying.svelte-uo3tkz input:where(.svelte-uo3tkz) {appearance:none;pointer-events:none;height:0;width:0;}.altcha-spinner.svelte-uo3tkz {
7
+ animation: svelte-uo3tkz-altcha-spinner 0.75s infinite linear;transform-origin:center;}
5
8
 
6
- @keyframes svelte-ddsc3z-altcha-spinner {
9
+ @keyframes svelte-uo3tkz-altcha-spinner {
7
10
  100% {
8
11
  transform: rotate(360deg);
9
12
  }
10
- }`};function vn(e,t){var Wn,Yn;Yr(t,!0),ol(e,Fl);let r=R(t,"auto",7,void 0),l=R(t,"blockspam",7,void 0),i=R(t,"challengeurl",7,void 0),o=R(t,"challengejson",7,void 0),a=R(t,"customfetch",7,void 0),f=R(t,"debug",7,!1),s=R(t,"delay",7,0),c=R(t,"expire",7,void 0),v=R(t,"floating",7,void 0),h=R(t,"floatinganchor",7,void 0),g=R(t,"floatingoffset",7,void 0),m=R(t,"floatingpersist",7,!1),b=R(t,"hidefooter",7,!1),L=R(t,"hidelogo",7,!1),F=R(t,"id",7,void 0),Z=R(t,"name",7,"altcha"),j=R(t,"maxnumber",7,1e6),V=R(t,"mockerror",7,!1),G=R(t,"obfuscated",7,void 0),Ue=R(t,"plugins",7,void 0),M=R(t,"refetchonexpire",7,!0),B=R(t,"spamfilter",7,!1),$e=R(t,"strings",7,void 0),le=R(t,"test",7,!1),Ne=R(t,"verifyurl",7,void 0),Qe=R(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),ct=R(t,"workerurl",7,void 0);const gn=["SHA-256","SHA-384","SHA-512"],_n="Visit Altcha.org",mn="https://altcha.org/",dt=(n,u)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:u}))},pn=(Yn=(Wn=document.documentElement.lang)==null?void 0:Wn.split("-"))==null?void 0:Yn[0],tr=ze(()=>{var n;return i()&&new URL(i(),location.origin).host.endsWith(".altcha.org")&&!!((n=i())!=null&&n.includes("apiKey=ckey_"))}),rr=ze(()=>o()?Sn(o()):void 0),wn=ze(()=>$e()?Sn($e()):{}),oe=ze(()=>{var n;return{ariaLinkLabel:_n,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by <a href="${mn}" target="_blank" aria-label="${((n=d(wn))==null?void 0:n.ariaLinkLabel)||_n}">ALTCHA</a>`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...d(wn)}}),bn=ze(()=>F()||`${Z()}_checkbox`);let et=We(!1),I=We(se(w.UNVERIFIED)),W=We(void 0),vt=We(null),tt=null,p=null,rt=We(null),_e=null,Le=[],je=We(null);Yt(()=>{Wl(d(rt))}),Yt(()=>{Yl(d(I))}),hl(()=>{Ml(),p&&(p.removeEventListener("submit",Cn),p.removeEventListener("reset",An),p.removeEventListener("focusin",kn),p=null),_e&&(clearTimeout(_e),_e=null),document.removeEventListener("click",xn),document.removeEventListener("scroll",$n),window.removeEventListener("resize",In)}),fn(()=>{var n;T("mounted","1.4.2"),T("workers",Qe()),ql(),T("plugins",Le.length?Le.map(u=>u.constructor.pluginName).join(", "):"none"),le()&&T("using test mode"),c()&&nr(c()),r()!==void 0&&T("auto",r()),v()!==void 0&&Tn(v()),p=(n=d(W))==null?void 0:n.closest("form"),p&&(p.addEventListener("submit",Cn,{capture:!0}),p.addEventListener("reset",An),(r()==="onfocus"||m()==="focus")&&p.addEventListener("focusin",kn)),r()==="onload"&&(G()?ht():De()),d(tr)&&(b()||L())&&T("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{dt("load")})});function yn(n,u){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:u.number,salt:n.salt,signature:n.signature,test:le()?!0:void 0,took:u.took}))}function Ml(){for(const n of Le)n.destroy()}function En(){i()&&M()&&d(I)===w.VERIFIED?De():_t(w.EXPIRED,d(oe).expired)}async function Ul(){var n;if(V())throw T("mocking error"),new Error("Mocked error.");if(d(rr))return T("using provided json data"),d(rr);if(le())return T("generating test challenge",{test:le()}),yl(typeof le()!="boolean"?+le():void 0);{if(!i()&&p){const P=p.getAttribute("action");P!=null&&P.includes("/form/")&&i(P+"/altcha")}if(!i())throw new Error("Attribute challengeurl not set.");T("fetching challenge from",i());let u=null,_=null;if(a())if(T("using customfetch"),typeof a()=="string"){if(u=globalThis[a()]||null,!u)throw new Error(`Custom fetch function not found: ${a()}`)}else u=a();const E={headers:B()!==!1?{"x-altcha-spam-filter":"1"}:{}};if(u){if(_=await u(i(),E),!_||!(_ instanceof Response))throw new Error("Custom fetch function did not return a response.")}else _=await fetch(i(),E);if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const N=_.headers.get("X-Altcha-Config"),$=await _.json(),y=new URLSearchParams((n=$.salt.split("?"))==null?void 0:n[1]),J=y.get("expires")||y.get("expire");if(J){const P=new Date(+J*1e3),it=isNaN(P.getTime())?0:P.getTime()-Date.now();it>0&&nr(it)}if(N)try{const P=JSON.parse(N);P&&typeof P=="object"&&(P.verifyurl&&(P.verifyurl=new URL(P.verifyurl,new URL(i())).toString()),Dn(P))}catch(P){T("unable to configure from X-Altcha-Config",P)}return $}}function jl(n){var _;const u=p==null?void 0:p.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((_=u==null?void 0:u.value)==null?void 0:_.slice(u.value.indexOf("@")))||void 0}function Vl(){return B()==="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 B()=="object"?B():{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 Bl(n){return[...(p==null?void 0:p.querySelectorAll(n!=null&&n.length?n.map(_=>`input[name="${_}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((_,E)=>{const N=E.name,$=E.value;return N&&$&&(_[N]=/\n/.test($)?$.replace(new RegExp("(?<!\\r)\\n","g"),`\r
11
- `):$),_},{})}function ql(){const n=Ue()!==void 0?Ue().split(","):void 0;for(const u of globalThis.altchaPlugins)(!n||n.includes(u.pluginName))&&Le.push(new u({el:d(W),clarify:ht,dispatch:dt,getConfiguration:Pn,getFloatingAnchor:On,getState:zn,log:T,reset:_t,solve:Ln,setState:Ve,setFloatingAnchor:Mn,verify:De}))}function T(...n){(f()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${Z()}]`,...n)}function Hl(){[w.UNVERIFIED,w.ERROR,w.EXPIRED].includes(d(I))?B()!==!1&&(p==null?void 0:p.reportValidity())===!1?O(et,!1):G()?ht():De():O(et,!0)}function xn(n){const u=n.target;v()&&u&&!d(W).contains(u)&&(d(I)===w.VERIFIED&&m()===!1||d(I)===w.VERIFIED&&m()==="focus"&&!(p!=null&&p.matches(":focus-within"))||r()==="off"&&d(I)===w.UNVERIFIED)&&Fn()}function $n(){v()&&d(I)!==w.UNVERIFIED&&gt()}function Wl(n){for(const u of Le)typeof u.onErrorChange=="function"&&u.onErrorChange(d(rt))}function kn(n){d(I)===w.UNVERIFIED?De():v()&&m()==="focus"&&d(I)===w.VERIFIED&&ir()}function Cn(n){p&&r()==="onsubmit"?d(I)===w.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),De().then(()=>{p==null||p.requestSubmit()})):d(I)!==w.VERIFIED&&(n.preventDefault(),n.stopPropagation(),d(I)===w.VERIFYING&&Rn()):p&&v()&&r()==="off"&&d(I)===w.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),ir())}function An(){_t()}function Rn(){d(I)===w.VERIFYING&&d(oe).waitAlert&&alert(d(oe).waitAlert)}function Yl(n){for(const u of Le)typeof u.onStateChange=="function"&&u.onStateChange(d(I));v()&&d(I)!==w.UNVERIFIED&&requestAnimationFrame(()=>{gt()}),O(et,d(I)===w.VERIFIED)}function In(){v()&&gt()}function Sn(n){return JSON.parse(n)}async function Zl(n){if(!Ne())throw new Error("Attribute verifyurl not set.");T("requesting server verification from",Ne());const u={payload:n};if(B()!==!1){const{blockedCountries:N,classifier:$,disableRules:y,email:J,expectedLanguages:P,expectedCountries:it,fields:pt,ipAddress:wt,text:ao,timeZone:Zn}=Vl();u.blockedCountries=N,u.classifier=$,u.disableRules=y,u.email=J===!1?void 0:jl(J),u.expectedCountries=it,u.expectedLanguages=P||(pn?[pn]:void 0),u.fields=pt===!1?void 0:Bl(pt),u.ipAddress=wt===!1?void 0:wt||"auto",u.text=ao,u.timeZone=Zn===!1?void 0:Zn||xl()}const _=await fetch(Ne(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(_.status!==200)throw new Error(`Server responded with ${_.status}.`);const E=await _.json();if(E!=null&&E.payload&&O(je,se(E.payload)),dt("serververification",E),l()&&E.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}function nr(n){T("expire",n),_e&&(clearTimeout(_e),_e=null),n<1?En():_e=setTimeout(En,n)}function Tn(n){T("floating",n),v()!==n&&(d(W).style.left="",d(W).style.top=""),v(n===!0||n===""?"auto":n===!1||n==="false"?void 0:v()),v()?(r()||r("onsubmit"),document.addEventListener("scroll",$n),document.addEventListener("click",xn),window.addEventListener("resize",In)):r()==="onsubmit"&&r(void 0)}function Nn(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(!gn.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${gn.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 Ln(n){let u=null;if("Worker"in window){try{u=await Gl(n,n.maxNumber||n.maxnumber||j())}catch(_){T(_)}if((u==null?void 0:u.number)!==void 0||"obfuscated"in n)return{data:n,solution:u}}if("obfuscated"in n){const _=await Cl(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await _.promise}}return{data:n,solution:await El(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||j()).promise}}async function Gl(n,u=typeof le()=="number"?le():n.maxNumber||n.maxnumber||j(),_=Math.ceil(Qe())){const E=[];_=Math.min(16,u,Math.max(1,_));for(let y=0;y<_;y++)E.push(altchaCreateWorker(ct()));const N=Math.ceil(u/_),$=await Promise.all(E.map((y,J)=>{const P=J*N;return new Promise(it=>{y.addEventListener("message",pt=>{if(pt.data)for(const wt of E)wt!==y&&wt.postMessage({type:"abort"});it(pt.data)}),y.postMessage({payload:n,max:P+N,start:P,type:"work"})})}));for(const y of E)y.terminate();return $.find(y=>!!y)||null}async function ht(){if(!G()){Ve(w.ERROR);return}const n=Le.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Ve(w.ERROR),T("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function Dn(n){n.obfuscated!==void 0&&G(n.obfuscated),n.auto!==void 0&&(r(n.auto),r()==="onload"&&(G()?ht():De())),n.blockspam!==void 0&&l(!!n.blockspam),n.customfetch!==void 0&&a(n.customfetch),n.floatinganchor!==void 0&&h(n.floatinganchor),n.delay!==void 0&&s(n.delay),n.floatingoffset!==void 0&&g(n.floatingoffset),n.floating!==void 0&&Tn(n.floating),n.expire!==void 0&&(nr(n.expire),c(n.expire)),n.challenge&&(o(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),Nn(d(rr))),n.challengeurl!==void 0&&i(n.challengeurl),n.debug!==void 0&&f(!!n.debug),n.hidefooter!==void 0&&b(!!n.hidefooter),n.hidelogo!==void 0&&L(!!n.hidelogo),n.maxnumber!==void 0&&j(+n.maxnumber),n.mockerror!==void 0&&V(!!n.mockerror),n.name!==void 0&&Z(n.name),n.refetchonexpire!==void 0&&M(!!n.refetchonexpire),n.spamfilter!==void 0&&B(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&$e(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&le(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&Ne(n.verifyurl),n.workers!==void 0&&Qe(+n.workers),n.workerurl!==void 0&&ct(n.workerurl)}function Pn(){return{auto:r(),blockspam:l(),challengeurl:i(),debug:f(),delay:s(),expire:c(),floating:v(),floatinganchor:h(),floatingoffset:g(),hidefooter:b(),hidelogo:L(),name:Z(),maxnumber:j(),mockerror:V(),obfuscated:G(),refetchonexpire:M(),spamfilter:B(),strings:d(oe),test:le(),verifyurl:Ne(),workers:Qe(),workerurl:ct()}}function On(){return tt}function Jl(n){return Le.find(u=>u.constructor.pluginName===n)}function zn(){return d(I)}function Fn(){d(W).style.display="none"}function gt(n=20){if(d(W))if(tt||(tt=(h()?document.querySelector(h()):p==null?void 0:p.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||p),tt){const u=parseInt(g(),10)||12,_=tt.getBoundingClientRect(),E=d(W).getBoundingClientRect(),N=document.documentElement.clientHeight,$=document.documentElement.clientWidth,y=v()==="auto"?_.bottom+E.height+u+n>N:v()==="top",J=Math.max(n,Math.min($-n-E.width,_.left+_.width/2-E.width/2));if(y?d(W).style.top=`${_.top-(E.height+u)}px`:d(W).style.top=`${_.bottom+u}px`,d(W).style.left=`${J}px`,d(W).setAttribute("data-floating",y?"top":"bottom"),d(vt)){const P=d(vt).getBoundingClientRect();d(vt).style.left=_.left-J+_.width/2-P.width/2+"px"}}else T("unable to find floating anchor element")}function _t(n=w.UNVERIFIED,u=null){_e&&(clearTimeout(_e),_e=null),O(et,!1),O(je,null),Ve(n,u)}function Mn(n){tt=n}function Ve(n,u=null){O(I,se(n)),O(rt,se(u)),dt("statechange",{payload:d(je),state:d(I)})}function ir(){d(W).style.display="block",v()&&gt()}async function De(){return _t(w.VERIFYING),await new Promise(n=>setTimeout(n,s()||0)),Ul().then(n=>(Nn(n),T("challenge",n),Ln(n))).then(({data:n,solution:u})=>{if(T("solution",u),!u||n&&"challenge"in n&&!("clearText"in u))if((u==null?void 0:u.number)!==void 0&&"challenge"in n){if(Ne())return Zl(yn(n,u));O(je,se(yn(n,u))),T("payload",d(je))}else throw T("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{Ve(w.VERIFIED),T("verified"),ji().then(()=>{dt("verified",{payload:d(je)})})}).catch(n=>{T(n),Ve(w.ERROR,n.message)})}var Un=zl(),jn=Nr(Un);ll(jn,t,"default",{});var mt=be(jn,2),lr=ee(mt),Vn=ee(lr);{var Kl=n=>{var u=Al();ne(n,u)};Te(Vn,n=>{d(I)===w.VERIFYING&&n(Kl)})}var Ft=be(Vn,2);let Bn;var nt=ee(Ft);nn(nt),nt.__change=Hl,Q(Ft);var or=be(Ft,2),Xl=ee(or);{var Ql=n=>{var u=Rl(),_=Nr(u),E=ee(_);Xe(E,()=>d(oe).verified),Q(_);var N=be(_,2);nn(N),Je(()=>{ue(N,"name",Z()),cl(N,d(je))}),ne(n,u)},eo=(n,u)=>{{var _=N=>{var $=Il(),y=ee($);Xe(y,()=>d(oe).verifying),Q($),ne(N,$)},E=N=>{var $=Sl(),y=ee($);Xe(y,()=>d(oe).label),Q($),Je(()=>ue($,"for",d(bn))),ne(N,$)};Te(n,N=>{d(I)===w.VERIFYING?N(_):N(E,!1)},u)}};Te(Xl,n=>{d(I)===w.VERIFIED?n(Ql):n(eo,!1)})}Q(or);var to=be(or,2);{var ro=n=>{var u=Tl(),_=ee(u);ue(_,"href",mn),Q(u),Je(()=>ue(_,"aria-label",d(oe).ariaLinkLabel)),ne(n,u)};Te(to,n=>{(L()!==!0||d(tr))&&n(ro)})}Q(lr);var qn=be(lr,2);{var no=n=>{var u=Dl(),_=be(ee(u),2);{var E=$=>{var y=Nl(),J=ee(y);Xe(J,()=>d(oe).expired),Q(y),Je(()=>ue(y,"title",d(rt))),ne($,y)},N=$=>{var y=Ll(),J=ee(y);Xe(J,()=>d(oe).error),Q(y),Je(()=>ue(y,"title",d(rt))),ne($,y)};Te(_,$=>{d(I)===w.EXPIRED?$(E):$(N,!1)})}Q(u),ne(n,u)};Te(qn,n=>{(d(rt)||d(I)===w.EXPIRED)&&n(no)})}var Hn=be(qn,2);{var io=n=>{var u=Pl(),_=ee(u),E=ee(_);Xe(E,()=>d(oe).footer),Q(_),Q(u),ne(n,u)};Te(Hn,n=>{d(oe).footer&&(b()!==!0||d(tr))&&n(io)})}var lo=be(Hn,2);{var oo=n=>{var u=Ol();sn(u,_=>O(vt,_),()=>d(vt)),ne(n,u)};Te(lo,n=>{v()&&n(oo)})}return Q(mt),sn(mt,n=>O(W,n),()=>d(W)),Je(n=>{ue(mt,"data-state",d(I)),ue(mt,"data-floating",v()),Bn=sl(Ft,1,"altcha-checkbox svelte-ddsc3z",null,Bn,n),ue(nt,"id",d(bn)),nt.required=r()!=="onsubmit"&&(!v()||r()!=="off")},[()=>({"altcha-hidden":d(I)===w.VERIFYING})]),el("invalid",nt,Rn),vl(nt,()=>d(et),n=>O(et,n)),ne(e,Un),Zr({clarify:ht,configure:Dn,getConfiguration:Pn,getFloatingAnchor:On,getPlugin:Jl,getState:zn,hide:Fn,repositionFloating:gt,reset:_t,setFloatingAnchor:Mn,setState:Ve,show:ir,verify:De,get auto(){return r()},set auto(n=void 0){r(n),x()},get blockspam(){return l()},set blockspam(n=void 0){l(n),x()},get challengeurl(){return i()},set challengeurl(n=void 0){i(n),x()},get challengejson(){return o()},set challengejson(n=void 0){o(n),x()},get customfetch(){return a()},set customfetch(n=void 0){a(n),x()},get debug(){return f()},set debug(n=!1){f(n),x()},get delay(){return s()},set delay(n=0){s(n),x()},get expire(){return c()},set expire(n=void 0){c(n),x()},get floating(){return v()},set floating(n=void 0){v(n),x()},get floatinganchor(){return h()},set floatinganchor(n=void 0){h(n),x()},get floatingoffset(){return g()},set floatingoffset(n=void 0){g(n),x()},get floatingpersist(){return m()},set floatingpersist(n=!1){m(n),x()},get hidefooter(){return b()},set hidefooter(n=!1){b(n),x()},get hidelogo(){return L()},set hidelogo(n=!1){L(n),x()},get id(){return F()},set id(n=void 0){F(n),x()},get name(){return Z()},set name(n="altcha"){Z(n),x()},get maxnumber(){return j()},set maxnumber(n=1e6){j(n),x()},get mockerror(){return V()},set mockerror(n=!1){V(n),x()},get obfuscated(){return G()},set obfuscated(n=void 0){G(n),x()},get plugins(){return Ue()},set plugins(n=void 0){Ue(n),x()},get refetchonexpire(){return M()},set refetchonexpire(n=!0){M(n),x()},get spamfilter(){return B()},set spamfilter(n=!1){B(n),x()},get strings(){return $e()},set strings(n=void 0){$e(n),x()},get test(){return le()},set test(n=!1){le(n),x()},get verifyurl(){return Ne()},set verifyurl(n=void 0){Ne(n),x()},get workers(){return Qe()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){Qe(n),x()},get workerurl(){return ct()},set workerurl(n=void 0){ct(n),x()}})}tl(["change"]),customElements.define("altcha-widget",wl(vn,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},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:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},name:{},obfuscated:{},plugins:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new bt,globalThis.altchaPlugins=globalThis.altchaPlugins||[],k.Altcha=vn,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
13
+ }`};function Un(e,t){var Co,xo;kn(t,!0),Fl(e,Ei);let r=A(t,"auto",7,void 0),l=A(t,"blockspam",7,void 0),o=A(t,"challengeurl",7,void 0),i=A(t,"challengejson",7,void 0),s=A(t,"credentials",7,void 0),c=A(t,"customfetch",7,void 0),f=A(t,"debug",7,!1),d=A(t,"delay",7,0),_=A(t,"expire",7,void 0),h=A(t,"floating",7,void 0),g=A(t,"floatinganchor",7,void 0),p=A(t,"floatingoffset",7,void 0),x=A(t,"floatingpersist",7,!1),O=A(t,"hidefooter",7,!1),M=A(t,"hidelogo",7,!1),Re=A(t,"id",7,void 0),ae=A(t,"language",7,void 0),B=A(t,"name",7,"altcha"),de=A(t,"maxnumber",7,1e6),We=A(t,"mockerror",7,!1),U=A(t,"obfuscated",7,void 0),we=A(t,"plugins",7,void 0),Fe=A(t,"refetchonexpire",7,!0),lt=A(t,"sentinel",7,void 0),Ie=A(t,"spamfilter",7,!1),gt=A(t,"strings",7,void 0),_e=A(t,"test",7,!1),he=A(t,"verifyurl",7,void 0),_t=A(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),$t=A(t,"workerurl",7,void 0);const qn=["SHA-256","SHA-384","SHA-512"],Ci="https://altcha.org/",Ze=(n,u)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:u}))},Bn=(xo=(Co=document.documentElement.lang)==null?void 0:Co.split("-"))==null?void 0:xo[0],Rr=Ue(()=>{var n;return o()&&new URL(o(),location.origin).host.endsWith(".altcha.org")&&!!((n=o())!=null&&n.includes("apiKey=ckey_"))}),Ir=Ue(()=>i()?oo(i()):void 0),xi=Ue(()=>gt()?oo(gt()):{}),F=Ue(()=>({...Gn(),...a(xi)})),Hn=Ue(()=>Re()||`${B()}_checkbox_${Math.round(Math.random()*1e8)}`);let St=ie(!1),X=ie(null),R=ie(V(k.UNVERIFIED)),oe=ie(void 0),Nt=ie(null),Je=ie(null),$r=ie(null),mt=ie(null),j=ie(null),it=ie(null),$e=null,Q=ie(null),at=ie(!1),Ke=[],Sr=ie(!1),Ve=ie(null);pr(()=>{Fi(a(it))}),pr(()=>{Vi(a(R))}),Yl(()=>{Ai(),a(j)&&(a(j).removeEventListener("submit",Qn),a(j).removeEventListener("reset",eo),a(j).removeEventListener("focusin",Xn),w(j,null)),$e&&(clearTimeout($e),$e=null),document.removeEventListener("click",Jn),document.removeEventListener("scroll",Kn),window.removeEventListener("resize",no)}),Pn(()=>{var n;T("mounted","2.0.0-beta.2"),T("workers",_t()),Si(),T("plugins",Ke.length?Ke.map(u=>u.constructor.pluginName).join(", "):"none"),_e()&&T("using test mode"),_()&&Nr(_()),r()!==void 0&&T("auto",r()),h()!==void 0&&io(h()),w(j,V((n=a(oe))==null?void 0:n.closest("form"))),a(j)&&(a(j).addEventListener("submit",Qn,{capture:!0}),a(j).addEventListener("reset",eo),(r()==="onfocus"||x()==="focus")&&a(j).addEventListener("focusin",Xn)),r()==="onload"&&(U()?Tt():Me()),a(Rr)&&(O()||M())&&T("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ze("load")})});function ir(n,u){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:u.number,salt:n.salt,signature:n.signature,test:_e()?!0:void 0,took:u.took}))}function Ai(){for(const n of Ke)n.destroy()}function Yn(){o()&&Fe()&&a(R)===k.VERIFIED?Me():pt(k.EXPIRED,a(F).expired)}async function Ri(){var n;if(We())throw T("mocking error"),new Error("Mocked error.");if(a(Ir))return T("using provided json data"),a(Ir);if(_e())return T("generating test challenge",{test:_e()}),Ql(typeof _e()!="boolean"?+_e():void 0);{if(!o()&&a(j)){const E=a(j).getAttribute("action");E!=null&&E.includes("/form/")&&o(E+"/altcha")}if(!o())throw new Error("Attribute challengeurl not set.");T("fetching challenge from",o());let u=null,v=null;if(c())if(T("using customfetch"),typeof c()=="string"){if(u=globalThis[c()]||null,!u)throw new Error(`Custom fetch function not found: ${c()}`)}else u=c();const b={credentials:typeof s()=="boolean"?"include":s(),headers:Ie()!==!1?{"x-altcha-spam-filter":"1"}:{}};if(u){if(v=await u(o(),b),!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.")}else v=await fetch(o(),b);if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const m=v.headers.get("X-Altcha-Config"),$=await v.json(),y=new URLSearchParams((n=$.salt.split("?"))==null?void 0:n[1]),H=y.get("expires")||y.get("expire");if(H){const E=new Date(+H*1e3),Y=isNaN(E.getTime())?0:E.getTime()-Date.now();Y>0&&Nr(Y)}if(m)try{const E=JSON.parse(m);E&&typeof E=="object"&&(E.verifyurl&&(E.verifyurl=Zn(E.verifyurl)),uo(E))}catch(E){T("unable to configure from X-Altcha-Config",E)}return $}}function Ii(n){var v,b;const u=(v=a(j))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((b=u==null?void 0:u.value)==null?void 0:b.slice(u.value.indexOf("@")))||void 0}function Gn(n=[ae()||"",document.documentElement.lang||"",...navigator.languages]){const u=Object.keys(globalThis.altchaI18n).map(b=>b.toLowerCase()),v=n.reduce((b,m)=>(m=m.toLowerCase(),b||(globalThis.altchaI18n[m]?m:null)||u.find($=>m.split("-")[0]===$.split("-")[0])||null),null);return globalThis.altchaI18n[v||"en"]}function $i(){return Ie()==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof Ie()=="object"?Ie():{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function Wn(n){var v;return[...((v=a(j))==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,m)=>{const $=m.name,y=m.value;return $&&y&&(b[$]=/\n/.test(y)?y.replace(new RegExp("(?<!\\r)\\n","g"),`\r
14
+ `):y),b},{})}function Zn(n){const u=new URL(o()||location.origin),v=new URL(n,u);return v.search||(v.search=u.search),v.toString()}function Si(){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:a(oe),clarify:Tt,dispatch:Ze,getConfiguration:co,getFloatingAnchor:fo,getState:ho,log:T,reset:pt,solve:so,setState:Se,setFloatingAnchor:go,verify:Me}))}function T(...n){(f()||n.some(u=>u instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${B()}]`,...n)}function Ni(){w(Q,V(te.PAUSED))}function Ti(n){w(Q,V(te.ERROR))}function zi(){w(Q,V(te.READY))}function Di(){w(Q,V(te.LOADING))}function Li(){w(Q,V(te.PLAYING))}function Pi(){w(Q,V(te.PAUSED))}function Oi(n){if(n.preventDefault(),n.stopPropagation(),a(X)){const u=new FormData(n.target);w(at,!0),lo(ir(a(X).challenge,a(X).solution),String(u.get("code"))).then(({reason:v,verified:b})=>{b?(w(X,null),Se(k.VERIFIED),T("verified"),mr().then(()=>{var m;(m=a($r))==null||m.focus(),Ze("verified",{payload:a(Ve)})})):(pt(),w(it,V(v||"Verification failed")))}).catch(v=>{w(X,null),Se(k.ERROR,v),T("sentinel verification failed:",v)}).finally(()=>{w(at,!1)})}}function Jn(n){var v;const u=n.target;h()&&u&&!a(oe).contains(u)&&(a(R)===k.VERIFIED&&x()===!1||a(R)===k.VERIFIED&&x()==="focus"&&!((v=a(j))!=null&&v.matches(":focus-within"))||r()==="off"&&a(R)===k.UNVERIFIED)&&vo()}function Kn(){h()&&a(R)!==k.UNVERIFIED&&zt()}function Fi(n){for(const u of Ke)typeof u.onErrorChange=="function"&&u.onErrorChange(a(it))}function Xn(n){a(R)===k.UNVERIFIED?Me():h()&&x()==="focus"&&a(R)===k.VERIFIED&&Tr()}function Qn(n){const u=n.target,v=n.submitter;u!=null&&u.hasAttribute("data-code-challenge-form")||(a(j)&&r()==="onsubmit"?a(R)===k.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Me().then(()=>{var m;v&&["INPUT","BUTTON"].includes(v.tagName)&&v.getAttribute("name")?v.click():(m=a(j))==null||m.requestSubmit()})):a(R)!==k.VERIFIED&&(n.preventDefault(),n.stopPropagation(),a(R)===k.VERIFYING&&to()):a(j)&&h()&&r()==="off"&&a(R)===k.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Tr()))}function eo(){pt()}function to(){a(R)===k.VERIFYING&&a(F).waitAlert&&alert(a(F).waitAlert)}function ro(){a(Je)?a(Je).paused?(a(Je).currentTime=0,a(Je).play()):a(Je).pause():(w(Sr,!0),requestAnimationFrame(()=>{var n;(n=a(Je))==null||n.play()}))}function Vi(n){for(const u of Ke)typeof u.onStateChange=="function"&&u.onStateChange(a(R));h()&&a(R)!==k.UNVERIFIED&&requestAnimationFrame(()=>{zt()}),w(St,a(R)===k.VERIFIED)}function no(){h()&&zt()}function oo(n){return JSON.parse(n)}async function Mi(n){if(!he())throw new Error("Attribute verifyurl not set.");T("requesting server verification from",he());const u={payload:n};if(Ie()!==!1){const{blockedCountries:m,classifier:$,disableRules:y,email:H,expectedLanguages:E,expectedCountries:Y,fields:se,ipAddress:Qe,text:Dr,timeZone:sr}=$i();u.blockedCountries=m,u.classifier=$,u.disableRules=y,u.email=H===!1?void 0:Ii(H),u.expectedCountries=Y,u.expectedLanguages=E||(Bn?[Bn]:void 0),u.fields=se===!1?void 0:Wn(se),u.ipAddress=Qe===!1?void 0:Qe||"auto",u.text=Dr,u.timeZone=sr===!1?void 0:sr||Mn()}const v=await fetch(he(),{body:JSON.stringify(u),headers:{"content-type":"application/json"},method:"POST"});if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const b=await v.json();if(b!=null&&b.payload&&w(Ve,V(b.payload)),Ze("serververification",b),l()&&b.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function lo(n,u){if(!he())throw new Error("Attribute verifyurl not set.");T("requesting sentinel verification from",he());const v={code:u,payload:n};lt()&&(v.fields=lt().fields?Wn():void 0,v.timeZone=lt().timeZone?Mn():void 0);const b=await fetch(he(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(b.status!==200)throw new Error(`Server responded with ${b.status}.`);const m=await b.json();return m!=null&&m.payload&&w(Ve,V(m.payload)),Ze("sentinelverification",m),m}function Nr(n){T("expire",n),$e&&(clearTimeout($e),$e=null),n<1?Yn():$e=setTimeout(Yn,n)}function io(n){T("floating",n),h()!==n&&(a(oe).style.left="",a(oe).style.top=""),h(n===!0||n===""?"auto":n===!1||n==="false"?void 0:h()),h()?(r()||r("onsubmit"),document.addEventListener("scroll",Kn),document.addEventListener("click",Jn),window.addEventListener("resize",no)):r()==="onsubmit"&&r(void 0)}function ao(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(!qn.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${qn.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 so(n){let u=null;if("Worker"in window){try{u=await Ui(n,n.maxNumber||n.maxnumber||de())}catch(v){T(v)}if((u==null?void 0:u.number)!==void 0||"obfuscated"in n)return{data:n,solution:u}}if("obfuscated"in n){const v=await ni(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await ei(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||de()).promise}}async function Ui(n,u=typeof _e()=="number"?_e():n.maxNumber||n.maxnumber||de(),v=Math.ceil(_t())){const b=[];v=Math.min(16,u,Math.max(1,v));for(let y=0;y<v;y++)b.push(altchaCreateWorker($t()));const m=Math.ceil(u/v),$=await Promise.all(b.map((y,H)=>{const E=H*m;return new Promise(Y=>{y.addEventListener("message",se=>{if(se.data)for(const Qe of b)Qe!==y&&Qe.postMessage({type:"abort"});Y(se.data)}),y.postMessage({payload:n,max:E+m,start:E,type:"work"})})}));for(const y of b)y.terminate();return $.find(y=>!!y)||null}async function Tt(){if(!U()){Se(k.ERROR);return}const n=Ke.find(u=>u.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Se(k.ERROR),T("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function uo(n){n.obfuscated!==void 0&&U(n.obfuscated),n.auto!==void 0&&(r(n.auto),r()==="onload"&&(U()?Tt():Me())),n.blockspam!==void 0&&l(!!n.blockspam),n.customfetch!==void 0&&c(n.customfetch),n.floatinganchor!==void 0&&g(n.floatinganchor),n.delay!==void 0&&d(n.delay),n.floatingoffset!==void 0&&p(n.floatingoffset),n.floating!==void 0&&io(n.floating),n.expire!==void 0&&(Nr(n.expire),_(n.expire)),n.challenge&&(i(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),ao(a(Ir))),n.challengeurl!==void 0&&o(n.challengeurl),n.debug!==void 0&&f(!!n.debug),n.hidefooter!==void 0&&O(!!n.hidefooter),n.hidelogo!==void 0&&M(!!n.hidelogo),n.language!==void 0&&gt(Gn([n.language])),n.maxnumber!==void 0&&de(+n.maxnumber),n.mockerror!==void 0&&We(!!n.mockerror),n.name!==void 0&&B(n.name),n.refetchonexpire!==void 0&&Fe(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&lt(n.sentinel),n.spamfilter!==void 0&&Ie(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&gt(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&_e(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&he(n.verifyurl),n.workers!==void 0&&_t(+n.workers),n.workerurl!==void 0&&$t(n.workerurl)}function co(){return{auto:r(),blockspam:l(),challengeurl:o(),debug:f(),delay:d(),expire:_(),floating:h(),floatinganchor:g(),floatingoffset:p(),hidefooter:O(),hidelogo:M(),name:B(),maxnumber:de(),mockerror:We(),obfuscated:U(),refetchonexpire:Fe(),spamfilter:Ie(),strings:a(F),test:_e(),verifyurl:he(),workers:_t(),workerurl:$t()}}function fo(){return a(mt)}function ji(n){return Ke.find(u=>u.constructor.pluginName===n)}function ho(){return a(R)}function vo(){a(oe).style.display="none"}function zt(n=20){var u;if(a(oe))if(a(mt)||w(mt,V((g()?document.querySelector(g()):(u=a(j))==null?void 0:u.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||a(j))),a(mt)){const v=parseInt(p(),10)||12,b=a(mt).getBoundingClientRect(),m=a(oe).getBoundingClientRect(),$=document.documentElement.clientHeight,y=document.documentElement.clientWidth,H=h()==="auto"?b.bottom+m.height+v+n>$:h()==="top",E=Math.max(n,Math.min(y-n-m.width,b.left+b.width/2-m.width/2));if(H?a(oe).style.top=`${b.top-(m.height+v)}px`:a(oe).style.top=`${b.bottom+v}px`,a(oe).style.left=`${E}px`,a(oe).setAttribute("data-floating",H?"top":"bottom"),a(Nt)){const Y=a(Nt).getBoundingClientRect();a(Nt).style.left=b.left-E+b.width/2-Y.width/2+"px"}}else T("unable to find floating anchor element")}function pt(n=k.UNVERIFIED,u=null){$e&&(clearTimeout($e),$e=null),w(St,!1),w(Ve,null),w(X,null),w(Sr,!1),w(Q,null),Se(n,u)}function go(n){w(mt,V(n))}function Se(n,u=null){w(R,V(n)),w(it,V(u)),Ze("statechange",{payload:a(Ve),state:a(R)})}function Tr(){a(oe).style.display="block",h()&&zt()}async function Me(){return pt(k.VERIFYING),await new Promise(n=>setTimeout(n,d()||0)),Ri().then(n=>(ao(n),T("challenge",n),so(n))).then(({data:n,solution:u})=>{var v;if(T("solution",u),!u||n&&"challenge"in n&&!("clearText"in u))if((u==null?void 0:u.number)!==void 0&&"challenge"in n)if(he()&&"codeChallenge"in n)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&document.activeElement.blur(),w(X,V({challenge:n,solution:u}));else{if(he()&&lt()!==void 0)return lo(ir(n,u));if(he())return Mi(ir(n,u));w(Ve,V(ir(n,u))),T("payload",a(Ve))}else throw T("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{a(X)?(Se(k.CODE),mr().then(()=>{Ze("code",{codeChallenge:a(X)})})):(Se(k.VERIFIED),T("verified"),mr().then(()=>{Ze("verified",{payload:a(Ve)})}))}).catch(n=>{T(n),Se(k.ERROR,n.message)})}var _o=ki(),mo=xt(_o);Ol(mo,t,"default",{});var Dt=J(mo,2),zr=Z(Dt),ar=Z(zr);let po;var bo=Z(ar);{var qi=n=>{Ar(n)};K(bo,n=>{a(R)===k.VERIFYING&&n(qi)})}var Xe=J(bo,2);Tn(Xe),Xe.__change=[ai,R,Ie,j,St,U,Tt,Me],nr(Xe,n=>w($r,n),()=>a($r)),W(ar);var Lt=J(ar,2),Bi=Z(Lt);{var Hi=n=>{var u=rr(),v=xt(u);ot(v,()=>a(F).verified),q(n,u)},Yi=(n,u)=>{{var v=m=>{var $=rr(),y=xt($);ot(y,()=>a(F).verifying),q(m,$)},b=(m,$)=>{{var y=E=>{var Y=rr(),se=xt(Y);ot(se,()=>a(F).verificationRequired),q(E,Y)},H=E=>{var Y=rr(),se=xt(Y);ot(se,()=>a(F).label),q(E,Y)};K(m,E=>{a(R)===k.CODE?E(y):E(H,!1)},$)}};K(n,m=>{a(R)===k.VERIFYING?m(v):m(b,!1)},u)}};K(Bi,n=>{a(R)===k.VERIFIED?n(Hi):n(Yi,!1)})}W(Lt);var wo=J(Lt,2);{var Gi=n=>{var u=ui();Tn(u),Le(()=>{I(u,"name",B()),ql(u,a(Ve))}),q(n,u)};K(wo,n=>{a(R)===k.VERIFIED&&n(Gi)})}var yo=J(wo,2);{var Wi=n=>{var u=ci(),v=Z(u);I(v,"href",Ci),W(u),Le(()=>I(v,"aria-label",a(F).ariaLinkLabel)),q(n,u)};K(yo,n=>{(M()!==!0||a(Rr))&&n(Wi)})}var Zi=J(yo,2);{var Ji=n=>{var u=_i(),v=J(Z(u),2),b=Z(v),m=J(b,2);Sl(m),m.__keydown=[li,ro];var $=J(m,2),y=Z($),H=Z(y);{var E=ye=>{var ee=vi();ee.__click=ro;var ur=Z(ee);{var Pt=bt=>{Ar(bt,()=>20)},na=(bt,oa)=>{{var la=wt=>{var Lr=fi();q(wt,Lr)},ia=(wt,Lr)=>{{var aa=yt=>{var Pr=di();q(yt,Pr)},sa=yt=>{var Pr=hi();q(yt,Pr)};K(wt,yt=>{a(Q)===te.PLAYING?yt(aa):yt(sa,!1)},Lr)}};K(bt,wt=>{a(Q)===te.ERROR?wt(la):wt(ia,!1)},oa)}};K(ur,bt=>{a(Q)===te.LOADING?bt(Pt):bt(na,!1)})}W(ee),Le(()=>{I(ee,"title",a(F).getAudioChallenge),ee.disabled=a(Q)===te.LOADING||a(Q)===te.ERROR||a(at),I(ee,"aria-label",a(Q)===te.LOADING?a(F).loading:a(F).getAudioChallenge)}),q(ye,ee)};K(H,ye=>{a(X).challenge.codeChallenge.audio&&ye(E)})}var Y=J(H,2);Y.__click=[ii,Me],W(y);var se=J(y,2),Qe=Z(se);{var Dr=ye=>{Ar(ye,()=>16)};K(Qe,ye=>{a(at)&&ye(Dr)})}var sr=J(Qe);W(se),W($);var ta=J($,2);{var ra=ye=>{var ee=gi(),ur=Z(ee);W(ee),nr(ee,Pt=>w(Je,Pt),()=>a(Je)),Le(Pt=>I(ur,"src",Pt),[()=>Zn(a(X).challenge.codeChallenge.audio)]),Ge("loadstart",ee,Di),Ge("canplay",ee,zi),Ge("pause",ee,Pi),Ge("playing",ee,Li),Ge("ended",ee,Ni),Ge("error",ur,Ti),q(ye,ee)};K(ta,ye=>{a(X).challenge.codeChallenge.audio&&a(Sr)&&ye(ra)})}W(v),W(u),Le(()=>{I(u,"aria-label",a(F).verificationRequired),I(b,"src",a(X).challenge.codeChallenge.image),I(m,"minlength",a(X).challenge.codeChallenge.length||1),I(m,"maxlength",a(X).challenge.codeChallenge.length),I(m,"placeholder",a(F).enterCode),I(m,"aria-label",a(Q)===te.LOADING?a(F).loading:a(Q)===te.PLAYING?"":a(F).enterCodeAria),I(m,"aria-live",a(Q)?"assertive":"polite"),I(m,"aria-busy",a(Q)===te.LOADING),m.disabled=a(at),I(Y,"aria-label",a(F).reload),I(Y,"title",a(F).reload),Y.disabled=a(at),se.disabled=a(at),I(se,"aria-label",a(F).verify),Dl(sr,` ${a(F).verify??""}`)}),Ge("submit",v,Oi,!0),q(n,u)};K(Zi,n=>{var u;(u=a(X))!=null&&u.challenge.codeChallenge&&n(Ji)})}W(zr);var ko=J(zr,2);{var Ki=n=>{var u=bi(),v=J(Z(u),2);{var b=$=>{var y=mi(),H=Z(y);ot(H,()=>a(F).expired),W(y),Le(()=>I(y,"title",a(it))),q($,y)},m=$=>{var y=pi(),H=Z(y);ot(H,()=>a(F).error),W(y),Le(()=>I(y,"title",a(it))),q($,y)};K(v,$=>{a(R)===k.EXPIRED?$(b):$(m,!1)})}W(u),q(n,u)};K(ko,n=>{(a(it)||a(R)===k.EXPIRED)&&n(Ki)})}var Eo=J(ko,2);{var Xi=n=>{var u=wi(),v=Z(u),b=Z(v);ot(b,()=>a(F).footer),W(v),W(u),q(n,u)};K(Eo,n=>{a(F).footer&&(O()!==!0||a(Rr))&&n(Xi)})}var Qi=J(Eo,2);{var ea=n=>{var u=yi();nr(u,v=>w(Nt,v),()=>a(Nt)),q(n,u)};K(Qi,n=>{h()&&n(ea)})}return W(Dt),nr(Dt,n=>w(oe,n),()=>a(oe)),Le(n=>{var u;I(Dt,"data-state",a(R)),I(Dt,"data-floating",h()),po=Ml(ar,1,"altcha-checkbox svelte-uo3tkz",null,po,n),I(Xe,"id",a(Hn)),Xe.required=r()!=="onsubmit"&&(!h()||r()!=="off"),I(Xe,"aria-hidden",a(R)===k.VERIFYING),I(Lt,"for",a(Hn)),I(Lt,"aria-hidden",!!((u=a(X))!=null&&u.challenge.codeChallenge))},[()=>({"altcha-checkbox-verifying":a(R)===k.VERIFYING})]),Ge("invalid",Xe,to),Hl(Xe,()=>a(St),n=>w(St,n)),q(e,_o),En({clarify:Tt,configure:uo,getConfiguration:co,getFloatingAnchor:fo,getPlugin:ji,getState:ho,hide:vo,repositionFloating:zt,reset:pt,setFloatingAnchor:go,setState:Se,show:Tr,verify:Me,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 o()},set challengeurl(n=void 0){o(n),C()},get challengejson(){return i()},set challengejson(n=void 0){i(n),C()},get credentials(){return s()},set credentials(n=void 0){s(n),C()},get customfetch(){return c()},set customfetch(n=void 0){c(n),C()},get debug(){return f()},set debug(n=!1){f(n),C()},get delay(){return d()},set delay(n=0){d(n),C()},get expire(){return _()},set expire(n=void 0){_(n),C()},get floating(){return h()},set floating(n=void 0){h(n),C()},get floatinganchor(){return g()},set floatinganchor(n=void 0){g(n),C()},get floatingoffset(){return p()},set floatingoffset(n=void 0){p(n),C()},get floatingpersist(){return x()},set floatingpersist(n=!1){x(n),C()},get hidefooter(){return O()},set hidefooter(n=!1){O(n),C()},get hidelogo(){return M()},set hidelogo(n=!1){M(n),C()},get id(){return Re()},set id(n=void 0){Re(n),C()},get language(){return ae()},set language(n=void 0){ae(n),C()},get name(){return B()},set name(n="altcha"){B(n),C()},get maxnumber(){return de()},set maxnumber(n=1e6){de(n),C()},get mockerror(){return We()},set mockerror(n=!1){We(n),C()},get obfuscated(){return U()},set obfuscated(n=void 0){U(n),C()},get plugins(){return we()},set plugins(n=void 0){we(n),C()},get refetchonexpire(){return Fe()},set refetchonexpire(n=!0){Fe(n),C()},get sentinel(){return lt()},set sentinel(n=void 0){lt(n),C()},get spamfilter(){return Ie()},set spamfilter(n=!1){Ie(n),C()},get strings(){return gt()},set strings(n=void 0){gt(n),C()},get test(){return _e()},set test(n=!1){_e(n),C()},get verifyurl(){return he()},set verifyurl(n=void 0){he(n),C()},get workers(){return _t()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){_t(n),C()},get workerurl(){return $t()},set workerurl(n=void 0){$t(n),C()}})}zl(["change","keydown","click"]),customElements.define("altcha-widget",Kl(Un,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},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=>e?new Worker(new URL(e)):new Ot,S.Altcha=Un,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
@@ -8,7 +8,6 @@
8
8
  flex-direction: column;
9
9
  max-width: var(--altcha-max-width, 260px);
10
10
  position: relative;
11
- text-align: left;
12
11
  }
13
12
 
14
13
  .altcha:focus-within {
@@ -61,19 +60,135 @@
61
60
  display: flex;
62
61
  gap: 0.4rem;
63
62
  padding: 0.7rem;
63
+ position: relative;
64
64
  }
65
65
 
66
- .altcha-label {
67
- flex-grow: 1;
66
+ .altcha-code-challenge {
67
+ background: var(--altcha-color-base, white);
68
+ border: 1px solid var(--altcha-color-border-focus, currentColor);
69
+ border-radius: var(--altcha-border-radius, 3px);
70
+ filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.2));
71
+ padding: 0.5rem;
72
+ position: absolute;
73
+ top: 2.5rem;
74
+ z-index: 9999999;
75
+ }
76
+
77
+ .altcha-code-challenge > form {
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 0.5rem;
81
+ }
82
+
83
+ .altcha-code-challenge-input {
84
+ border: 1px solid currentColor;
85
+ border-radius: 3px;
86
+ box-sizing: border-box;
87
+ outline: none;
88
+ font-size: 16px;
89
+ padding: 0.35rem;
90
+ width: 220px;
91
+ }
92
+
93
+ .altcha-code-challenge-input:focus {
94
+ outline: 2px solid rgba(0, 0, 250, 0.2);
95
+ }
96
+
97
+ .altcha-code-challenge-input:disabled {
98
+ opacity: 0.7;
99
+ }
100
+
101
+ .altcha-code-challenge-image {
102
+ border: 1px solid currentColor;
103
+ border-radius: 3px;
104
+ box-sizing: border-box;
105
+ object-fit: contain;
106
+ height: 50px;
107
+ width: 220px;
108
+ }
109
+
110
+ .altcha-code-challenge-audio,
111
+ .altcha-code-challenge-reload {
112
+ background: #efefef;
113
+ border: 0;
114
+ border-radius: 3px;
115
+ cursor: pointer;
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ padding: 0.35rem;
120
+ }
121
+
122
+ .altcha-code-challenge-audio:disabled,
123
+ .altcha-code-challenge-reload:disabled {
124
+ opacity: 0.7;
125
+ pointer-events: none;
126
+ }
127
+
128
+ .altcha-code-challenge-audio > *,
129
+ .altcha-code-challenge-reload > * {
130
+ height: 20px;
131
+ width: 20px;
132
+ }
133
+
134
+ .altcha-code-challenge-buttons {
135
+ display: flex;
136
+ justify-content: space-between;
137
+ }
138
+
139
+ .altcha-code-challenge-buttons-left {
140
+ display: flex;
141
+ gap: 0.25rem;
142
+ }
143
+
144
+ .altcha-code-challenge-verify {
145
+ align-items: center;
146
+ background: blue;
147
+ border: 0;
148
+ border-radius: 3px;
149
+ color: white;
150
+ cursor: pointer;
151
+ display: flex;
152
+ gap: 0.5rem;
153
+ font-size: 100%;
154
+ padding: 0.35rem 1rem;
155
+ }
156
+
157
+ .altcha-code-challenge-verify:disabled {
158
+ opacity: 0.7;
159
+ pointer-events: none;
160
+ }
161
+
162
+ .altcha-code-challenge-arrow {
163
+ border: 6px solid transparent;
164
+ border-bottom-color: var(--altcha-color-border, currentColor);
165
+ content: '';
166
+ height: 0;
167
+ left: 0.15rem;
168
+ position: absolute;
169
+ top: -12px;
170
+ width: 0;
171
+ }
172
+
173
+ .altcha[data-floating="top"] .altcha-code-challenge {
174
+ top: -150px;
175
+ }
176
+
177
+ .altcha[data-floating="top"] .altcha-code-challenge-arrow {
178
+ border-bottom-color: transparent;
179
+ border-top-color: var(--altcha-color-border, currentColor);
180
+ bottom: -12px;
181
+ top: auto;
68
182
  }
69
183
 
70
- .altcha-label label {
184
+ .altcha-label {
71
185
  cursor: pointer;
186
+ flex-grow: 1;
72
187
  }
73
188
 
74
189
  .altcha-logo {
75
190
  color: currentColor;
76
- opacity: 0.3;
191
+ opacity: 0.7;
77
192
  }
78
193
 
79
194
  .altcha-logo:hover {
@@ -93,19 +208,15 @@
93
208
  background-color: var(--altcha-color-footer-bg, transparent);
94
209
  display: flex;
95
210
  font-size: 0.75rem;
96
- opacity: 0.4;
211
+ opacity: 0.7;
212
+ justify-content: end;
97
213
  padding: 0.2rem 0.7rem;
98
- text-align: right;
99
214
  }
100
215
 
101
216
  .altcha-footer:hover {
102
217
  opacity: 1;
103
218
  }
104
219
 
105
- .altcha-footer > *:first-child {
106
- flex-grow: 1;
107
- }
108
-
109
220
  .altcha-footer :global(a) {
110
221
  color: currentColor;
111
222
  }
@@ -123,8 +234,11 @@
123
234
  margin: 0;
124
235
  }
125
236
 
126
- .altcha-hidden {
127
- display: none;
237
+ .altcha-checkbox-verifying input {
238
+ appearance: none;
239
+ pointer-events: none;
240
+ height: 0;
241
+ width: 0;
128
242
  }
129
243
 
130
244
  .altcha-spinner {
@@ -5,6 +5,9 @@ declare module 'altcha';
5
5
  declare global {
6
6
  var altchaCreateWorker: (url?: string) => Worker;
7
7
  var altchaPlugins: any[];
8
+ var altchaI18n: Record<string, any> & {
9
+ register: (language: string, translation: Record<string, string>) => void;
10
+ };
8
11
 
9
12
  type AltchaState = 'error' | 'expired' | 'verified' | 'verifying' | 'unverified';
10
13
 
@@ -24,6 +27,7 @@ declare global {
24
27
  blockspam?: boolean;
25
28
  challengeurl?: string;
26
29
  challengejson?: string;
30
+ credentials?: 'omit' | 'same-origin' | 'include' | boolean | undefined;
27
31
  customfetch?: string | ((url: string, init?: RequestInit) => Promise<Response>);
28
32
  debug?: boolean;
29
33
  delay?: number;
@@ -35,6 +39,7 @@ declare global {
35
39
  hidefooter?: boolean;
36
40
  hidelogo?: boolean;
37
41
  id?: string;
42
+ language?: string;
38
43
  maxnumber?: number;
39
44
  mockerror?: boolean;
40
45
  name?: string;
@@ -48,6 +53,7 @@ declare global {
48
53
  onuploadprogress?: (ev: CustomEvent) => void;
49
54
  plugins?: string;
50
55
  refetchonexpire?: boolean;
56
+ /** @deprecated */
51
57
  spamfilter?: boolean | 'ipAddress';
52
58
  strings?: string;
53
59
  test?: boolean | number;