GameSentenceMiner 2.17.6__py3-none-any.whl → 2.18.0__py3-none-any.whl

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 (51) hide show
  1. GameSentenceMiner/ai/ai_prompting.py +51 -51
  2. GameSentenceMiner/anki.py +236 -152
  3. GameSentenceMiner/gametext.py +7 -4
  4. GameSentenceMiner/gsm.py +49 -10
  5. GameSentenceMiner/locales/en_us.json +7 -3
  6. GameSentenceMiner/locales/ja_jp.json +8 -4
  7. GameSentenceMiner/locales/zh_cn.json +8 -4
  8. GameSentenceMiner/obs.py +238 -59
  9. GameSentenceMiner/ocr/owocr_helper.py +1 -1
  10. GameSentenceMiner/tools/ss_selector.py +7 -8
  11. GameSentenceMiner/ui/__init__.py +0 -0
  12. GameSentenceMiner/ui/anki_confirmation.py +187 -0
  13. GameSentenceMiner/{config_gui.py → ui/config_gui.py} +102 -37
  14. GameSentenceMiner/ui/screenshot_selector.py +215 -0
  15. GameSentenceMiner/util/configuration.py +124 -22
  16. GameSentenceMiner/util/db.py +22 -13
  17. GameSentenceMiner/util/downloader/download_tools.py +2 -2
  18. GameSentenceMiner/util/ffmpeg.py +24 -30
  19. GameSentenceMiner/util/get_overlay_coords.py +34 -34
  20. GameSentenceMiner/util/gsm_utils.py +31 -1
  21. GameSentenceMiner/util/text_log.py +11 -9
  22. GameSentenceMiner/vad.py +31 -12
  23. GameSentenceMiner/web/database_api.py +742 -123
  24. GameSentenceMiner/web/static/css/dashboard-shared.css +241 -0
  25. GameSentenceMiner/web/static/css/kanji-grid.css +94 -2
  26. GameSentenceMiner/web/static/css/overview.css +850 -0
  27. GameSentenceMiner/web/static/css/popups-shared.css +126 -0
  28. GameSentenceMiner/web/static/css/shared.css +97 -0
  29. GameSentenceMiner/web/static/css/stats.css +192 -597
  30. GameSentenceMiner/web/static/js/anki_stats.js +6 -4
  31. GameSentenceMiner/web/static/js/database.js +209 -5
  32. GameSentenceMiner/web/static/js/goals.js +610 -0
  33. GameSentenceMiner/web/static/js/kanji-grid.js +267 -4
  34. GameSentenceMiner/web/static/js/overview.js +1176 -0
  35. GameSentenceMiner/web/static/js/shared.js +25 -0
  36. GameSentenceMiner/web/static/js/stats.js +154 -1459
  37. GameSentenceMiner/web/stats.py +2 -2
  38. GameSentenceMiner/web/templates/anki_stats.html +5 -0
  39. GameSentenceMiner/web/templates/components/navigation.html +3 -1
  40. GameSentenceMiner/web/templates/database.html +73 -1
  41. GameSentenceMiner/web/templates/goals.html +376 -0
  42. GameSentenceMiner/web/templates/index.html +13 -11
  43. GameSentenceMiner/web/templates/overview.html +416 -0
  44. GameSentenceMiner/web/templates/stats.html +46 -251
  45. GameSentenceMiner/web/texthooking_page.py +18 -0
  46. {gamesentenceminer-2.17.6.dist-info → gamesentenceminer-2.18.0.dist-info}/METADATA +5 -1
  47. {gamesentenceminer-2.17.6.dist-info → gamesentenceminer-2.18.0.dist-info}/RECORD +51 -41
  48. {gamesentenceminer-2.17.6.dist-info → gamesentenceminer-2.18.0.dist-info}/WHEEL +0 -0
  49. {gamesentenceminer-2.17.6.dist-info → gamesentenceminer-2.18.0.dist-info}/entry_points.txt +0 -0
  50. {gamesentenceminer-2.17.6.dist-info → gamesentenceminer-2.18.0.dist-info}/licenses/LICENSE +0 -0
  51. {gamesentenceminer-2.17.6.dist-info → gamesentenceminer-2.18.0.dist-info}/top_level.txt +0 -0
@@ -16,16 +16,18 @@
16
16
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
17
17
  <title>Texthooker UI</title>
18
18
  <script type="module" crossorigin>
19
- var qc=Object.defineProperty;var Xc=(e,n,t)=>n in e?qc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var eo=(e,n,t)=>(Xc(e,typeof n!="symbol"?n+"":n,t),t);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();function Ie(){}const Zc=e=>e;function Jc(e,n){for(const t in n)e[t]=n[t];return e}function Wu(e){return e()}function Ma(){return Object.create(null)}function Lt(e){e.forEach(Wu)}function wi(e){return typeof e=="function"}function Et(e,n){return e!=e?n==n:e!==n||e&&typeof e=="object"||typeof e=="function"}function Qc(e){return Object.keys(e).length===0}function ef(e,...n){if(e==null)return Ie;const t=e.subscribe(...n);return t.unsubscribe?()=>t.unsubscribe():t}function y(e,n,t){e.$$.on_destroy.push(ef(n,t))}function R(e,n,t){return e.set(t),n}function tf(e){return e&&wi(e.destroy)?e.destroy:Ie}const ju=typeof window<"u";let nf=ju?()=>window.performance.now():()=>Date.now(),Ms=ju?e=>requestAnimationFrame(e):Ie;const bi=new Set;function Bu(e){bi.forEach(n=>{n.c(e)||(bi.delete(n),n.f())}),bi.size!==0&&Ms(Bu)}function rf(e){let n;return bi.size===0&&Ms(Bu),{promise:new Promise(t=>{bi.add(n={c:e,f:t})}),abort(){bi.delete(n)}}}function f(e,n){e.appendChild(n)}function Uu(e){if(!e)return document;const n=e.getRootNode?e.getRootNode():e.ownerDocument;return n&&n.host?n:e.ownerDocument}function of(e){const n=g("style");return lf(Uu(e),n),n.sheet}function lf(e,n){return f(e.head||e,n),n.sheet}function F(e,n,t){e.insertBefore(n,t||null)}function V(e){e.parentNode&&e.parentNode.removeChild(e)}function g(e){return document.createElement(e)}function ws(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function ct(e){return document.createTextNode(e)}function w(){return ct(" ")}function Nn(){return ct("")}function P(e,n,t,r){return e.addEventListener(n,t,r),()=>e.removeEventListener(n,t,r)}function h(e,n,t){t==null?e.removeAttribute(n):e.getAttribute(n)!==t&&e.setAttribute(n,t)}function sf(e,n,t){const r=new Set;for(let i=0;i<e.length;i+=1)e[i].checked&&r.add(e[i].__value);return t||r.delete(n),Array.from(r)}function Ol(e){return e===""?null:+e}function af(e){return Array.from(e.childNodes)}function At(e,n){n=""+n,e.wholeText!==n&&(e.data=n)}function wt(e,n){e.value=n??""}function be(e,n,t,r){t===null?e.style.removeProperty(n):e.style.setProperty(n,t,r?"important":"")}function yi(e,n){for(let t=0;t<e.options.length;t+=1){const r=e.options[t];if(r.__value===n){r.selected=!0;return}}e.selectedIndex=-1}function uf(e){const n=e.querySelector(":checked")||e.options[0];return n&&n.__value}function q(e,n,t){e.classList[t?"add":"remove"](n)}function zu(e,n,{bubbles:t=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t,r,n),i}class Yu{constructor(n=!1){this.is_svg=!1,this.is_svg=n,this.e=this.n=null}c(n){this.h(n)}m(n,t,r=null){this.e||(this.is_svg?this.e=ws(t.nodeName):this.e=g(t.nodeName),this.t=t,this.c(n)),this.i(r)}h(n){this.e.innerHTML=n,this.n=Array.from(this.e.childNodes)}i(n){for(let t=0;t<this.n.length;t+=1)F(this.t,this.n[t],n)}p(n){this.d(),this.h(n),this.i(this.a)}d(){this.n.forEach(V)}}const Il=new Map;let Ml=0;function cf(e){let n=5381,t=e.length;for(;t--;)n=(n<<5)-n^e.charCodeAt(t);return n>>>0}function ff(e,n){const t={stylesheet:of(n),rules:{}};return Il.set(e,t),t}function hf(e,n,t,r,i,o,s,l=0){const a=16.666/r;let u=`{
20
- `;for(let I=0;I<=1;I+=a){const A=n+(t-n)*o(I);u+=I*100+`%{${s(A,1-A)}}
21
- `}const c=u+`100% {${s(t,1-t)}}
22
- }`,p=`__svelte_${cf(c)}_${l}`,b=Uu(e),{stylesheet:m,rules:k}=Il.get(b)||ff(b,e);k[p]||(k[p]=!0,m.insertRule(`@keyframes ${p} ${c}`,m.cssRules.length));const S=e.style.animation||"";return e.style.animation=`${S?`${S}, `:""}${p} ${r}ms linear ${i}ms 1 both`,Ml+=1,p}function $a(e,n){const t=(e.style.animation||"").split(", "),r=t.filter(n?o=>o.indexOf(n)<0:o=>o.indexOf("__svelte")===-1),i=t.length-r.length;i&&(e.style.animation=r.join(", "),Ml-=i,Ml||pf())}function pf(){Ms(()=>{Ml||(Il.forEach(e=>{const{ownerNode:n}=e.stylesheet;n&&V(n)}),Il.clear())})}let po;function lo(e){po=e}function $s(){if(!po)throw new Error("Function called outside component initialization");return po}function Yl(e){$s().$$.on_mount.push(e)}function Ku(e){$s().$$.on_destroy.push(e)}function zr(){const e=$s();return(n,t,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[n];if(i){const o=zu(n,t,{cancelable:r});return i.slice().forEach(s=>{s.call(e,o)}),!o.defaultPrevented}return!0}}function mo(e,n){const t=e.$$.callbacks[n.type];t&&t.slice().forEach(r=>r.call(this,n))}const no=[],mt=[],kl=[],ys=[],Gu=Promise.resolve();let ks=!1;function qu(){ks||(ks=!0,Gu.then(Xu))}function go(){return qu(),Gu}function Rr(e){kl.push(e)}function os(e){ys.push(e)}const ls=new Set;let ml=0;function Xu(){const e=po;do{for(;ml<no.length;){const n=no[ml];ml++,lo(n),df(n.$$)}for(lo(null),no.length=0,ml=0;mt.length;)mt.pop()();for(let n=0;n<kl.length;n+=1){const t=kl[n];ls.has(t)||(ls.add(t),t())}kl.length=0}while(no.length);for(;ys.length;)ys.pop()();ks=!1,ls.clear(),lo(e)}function df(e){if(e.fragment!==null){e.update(),Lt(e.before_update);const n=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,n),e.after_update.forEach(Rr)}}let to;function mf(){return to||(to=Promise.resolve(),to.then(()=>{to=null})),to}function Ha(e,n,t){e.dispatchEvent(zu(`${n?"intro":"outro"}${t}`))}const Sl=new Set;let Tr;function rt(){Tr={r:0,c:[],p:Tr}}function it(){Tr.r||Lt(Tr.c),Tr=Tr.p}function H(e,n){e&&e.i&&(Sl.delete(e),e.i(n))}function j(e,n,t,r){if(e&&e.o){if(Sl.has(e))return;Sl.add(e),Tr.c.push(()=>{Sl.delete(e),r&&(t&&e.d(1),r())}),e.o(n)}else r&&r()}const gf={duration:0};function Zu(e,n,t){const r={direction:"in"};let i=n(e,t,r),o=!1,s,l,a=0;function u(){s&&$a(e,s)}function c(){const{delay:b=0,duration:m=300,easing:k=Zc,tick:S=Ie,css:I}=i||gf;I&&(s=hf(e,0,1,m,b,k,I,a++)),S(0,1);const A=nf()+b,$=A+m;l&&l.abort(),o=!0,Rr(()=>Ha(e,!0,"start")),l=rf(x=>{if(o){if(x>=$)return S(1,0),Ha(e,!0,"end"),u(),o=!1;if(x>=A){const D=k((x-A)/m);S(D,1-D)}}return o})}let p=!1;return{start(){p||(p=!0,$a(e),wi(i)?(i=i(r),mf().then(c)):c())},invalidate(){p=!1},end(){o&&(u(),o=!1)}}}const Hs=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Kl(e,n){e.d(1),n.delete(e.key)}function Ns(e,n){j(e,1,1,()=>{n.delete(e.key)})}function Yr(e,n,t,r,i,o,s,l,a,u,c,p){let b=e.length,m=o.length,k=b;const S={};for(;k--;)S[e[k].key]=k;const I=[],A=new Map,$=new Map;for(k=m;k--;){const X=p(i,o,k),K=t(X);let B=s.get(K);B?r&&B.p(X,n):(B=u(K,X),B.c()),A.set(K,I[k]=B),K in S&&$.set(K,Math.abs(k-S[K]))}const x=new Set,D=new Set;function J(X){H(X,1),X.m(l,c),s.set(X.key,X),c=X.first,m--}for(;b&&m;){const X=I[m-1],K=e[b-1],B=X.key,E=K.key;X===K?(c=X.first,b--,m--):A.has(E)?!s.has(B)||x.has(B)?J(X):D.has(E)?b--:$.get(B)>$.get(E)?(D.add(B),J(X)):(x.add(E),b--):(a(K,s),b--)}for(;b--;){const X=e[b];A.has(X.key)||a(X,s)}for(;m;)J(I[m-1]);return I}function bf(e,n){const t={},r={},i={$$scope:1};let o=e.length;for(;o--;){const s=e[o],l=n[o];if(l){for(const a in s)a in l||(r[a]=1);for(const a in l)i[a]||(t[a]=l[a],i[a]=1);e[o]=l}else for(const a in s)i[a]=1}for(const s in r)s in t||(t[s]=void 0);return t}function vf(e){return typeof e=="object"&&e!==null?e:{}}function ss(e,n,t,r){const i=e.$$.props[n];i!==void 0&&(e.$$.bound[i]=t,r===void 0&&t(e.$$.ctx[i]))}function se(e){e&&e.c()}function ie(e,n,t,r){const{fragment:i,after_update:o}=e.$$;i&&i.m(n,t),r||Rr(()=>{const s=e.$$.on_mount.map(Wu).filter(wi);e.$$.on_destroy?e.$$.on_destroy.push(...s):Lt(s),e.$$.on_mount=[]}),o.forEach(Rr)}function oe(e,n){const t=e.$$;t.fragment!==null&&(Lt(t.on_destroy),t.fragment&&t.fragment.d(n),t.on_destroy=t.fragment=null,t.ctx=[])}function _f(e,n){e.$$.dirty[0]===-1&&(no.push(e),qu(),e.$$.dirty.fill(0)),e.$$.dirty[n/31|0]|=1<<n%31}function Bt(e,n,t,r,i,o,s,l=[-1]){const a=po;lo(e);const u=e.$$={fragment:null,ctx:[],props:o,update:Ie,not_equal:i,bound:Ma(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(a?a.$$.context:[])),callbacks:Ma(),dirty:l,skip_bound:!1,root:n.target||a.$$.root};s&&s(u.root);let c=!1;if(u.ctx=t?t(e,n.props||{},(p,b,...m)=>{const k=m.length?m[0]:b;return u.ctx&&i(u.ctx[p],u.ctx[p]=k)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](k),c&&_f(e,p)),b}):[],u.update(),c=!0,Lt(u.before_update),u.fragment=r?r(u.ctx):!1,n.target){if(n.hydrate){const p=af(n.target);u.fragment&&u.fragment.l(p),p.forEach(V)}else u.fragment&&u.fragment.c();n.intro&&H(e.$$.fragment),ie(e,n.target,n.anchor,n.customElement),Xu()}lo(a)}class Ut{$destroy(){oe(this,1),this.$destroy=Ie}$on(n,t){if(!wi(t))return Ie;const r=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return r.push(t),()=>{const i=r.indexOf(t);i!==-1&&r.splice(i,1)}}$set(n){this.$$set&&!Qc(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}var wf="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z",Ju="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",yf="M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z",Qu="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",kf="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",Sf="M21.4 7.5C22.2 8.3 22.2 9.6 21.4 10.3L18.6 13.1L10.8 5.3L13.6 2.5C14.4 1.7 15.7 1.7 16.4 2.5L18.2 4.3L21.2 1.3L22.6 2.7L19.6 5.7L21.4 7.5M15.6 13.3L14.2 11.9L11.4 14.7L9.3 12.6L12.1 9.8L10.7 8.4L7.9 11.2L6.4 9.8L3.6 12.6C2.8 13.4 2.8 14.7 3.6 15.4L5.4 17.2L1.4 21.2L2.8 22.6L6.8 18.6L8.6 20.4C9.4 21.2 10.7 21.2 11.4 20.4L14.2 17.6L12.8 16.2L15.6 13.3Z",Cf="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",Ss="M19,12V13.5A4,4 0 0,1 23,17.5C23,18.32 22.75,19.08 22.33,19.71L21.24,18.62C21.41,18.28 21.5,17.9 21.5,17.5A2.5,2.5 0 0,0 19,15V16.5L16.75,14.25L19,12M19,23V21.5A4,4 0 0,1 15,17.5C15,16.68 15.25,15.92 15.67,15.29L16.76,16.38C16.59,16.72 16.5,17.1 16.5,17.5A2.5,2.5 0 0,0 19,20V18.5L21.25,20.75L19,23M12,3C16.42,3 20,4.79 20,7C20,9.21 16.42,11 12,11C7.58,11 4,9.21 4,7C4,4.79 7.58,3 12,3M4,9C4,11.21 7.58,13 12,13C13.11,13 14.17,12.89 15.14,12.68C14.19,13.54 13.5,14.67 13.18,15.96L12,16C7.58,16 4,14.21 4,12V9M20,9V11H19.5L18.9,11.03C19.6,10.43 20,9.74 20,9M4,14C4,16.21 7.58,18 12,18L13,17.97C13.09,19.03 13.42,20 13.95,20.88L12,21C7.58,21 4,19.21 4,17V14Z",so="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",Lf="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8.46,11.88L9.87,10.47L12,12.59L14.12,10.47L15.53,11.88L13.41,14L15.53,16.12L14.12,17.53L12,15.41L9.88,17.53L8.47,16.12L10.59,14L8.46,11.88M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",Ef="M9,1V7H5L12,14L19,7H15V1H9M5,16V18H19V16H5M5,20V22H19V20H5Z",xf="M5,3A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5.5L18.5,3H17V9A1,1 0 0,1 16,10H8A1,1 0 0,1 7,9V3H5M12,4V9H15V4H12M7,12H17A1,1 0 0,1 18,13V19H6V13A1,1 0 0,1 7,12Z",tn="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",Pf="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",Af="M21 10V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.11 3.9 21 5 21H11V19.13L19.39 10.74C19.83 10.3 20.39 10.06 21 10M14 4.5L19.5 10H14V4.5M22.85 14.19L21.87 15.17L19.83 13.13L20.81 12.15C21 11.95 21.33 11.95 21.53 12.15L22.85 13.47C23.05 13.67 23.05 14 22.85 14.19M19.13 13.83L21.17 15.87L15.04 22H13V19.96L19.13 13.83Z",Tf="M14,19H18V5H14M6,19H10V5H6V19Z",Df="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Of="M8,5.14V19.14L19,12.14L8,5.14Z",ec="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",If="M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z",Mf="M15 3H9V1H15V3M12 18.5C12 19.77 12.37 20.94 13 21.94C12.67 22 12.34 22 12 22C7.03 22 3 17.97 3 13S7.03 4 12 4C14.12 4 16.07 4.74 17.62 6L19.04 4.56C19.55 5 20 5.46 20.45 5.97L19.03 7.39C20.16 8.81 20.87 10.57 21 12.5C20.22 12.18 19.38 12 18.5 12C14.91 12 12 14.91 12 18.5M13 7H11V14H13V7M23 18.5C23 21 21 23 18.5 23S14 21 14 18.5 16 14 18.5 14 23 16 23 18.5M20 21.08L15.92 17C15.65 17.42 15.5 17.94 15.5 18.5C15.5 20.16 16.84 21.5 18.5 21.5C19.06 21.5 19.58 21.35 20 21.08M21.5 18.5C21.5 16.84 20.16 15.5 18.5 15.5C17.94 15.5 17.42 15.65 17 15.92L21.08 20C21.35 19.58 21.5 19.06 21.5 18.5Z",$f="M15 3H9V1H15V3M19.39 10.74L11 19.13V21.94C6.5 21.44 3 17.63 3 13C3 8.03 7.03 4 12 4C14.12 4 16.07 4.74 17.62 6L19.04 4.56C19.55 5 20 5.46 20.45 5.97L19.03 7.39C19.67 8.19 20.17 9.11 20.5 10.1C20.1 10.21 19.71 10.42 19.39 10.74M13 7H11V14H13V7M13 19.96V22H15.04L21.17 15.88L19.13 13.83L13 19.96M22.85 13.47L21.53 12.15C21.33 11.95 21 11.95 20.81 12.15L19.83 13.13L21.87 15.17L22.85 14.19C23.05 14 23.05 13.67 22.85 13.47Z",Hf="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",Nf="M17 6H7C3.69 6 1 8.69 1 12S3.69 18 7 18H17C20.31 18 23 15.31 23 12S20.31 6 17 6M17 16H7C4.79 16 3 14.21 3 12S4.79 8 7 8H17C19.21 8 21 9.79 21 12S19.21 16 17 16M17 9C15.34 9 14 10.34 14 12S15.34 15 17 15 20 13.66 20 12 18.66 9 17 9Z",tc="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z",Rf="M18 2C17.1 2 16 3 16 4H8C8 3 6.9 2 6 2H2V11C2 12 3 13 4 13H6.2C6.6 15 7.9 16.7 11 17V19.08C8 19.54 8 22 8 22H16C16 22 16 19.54 13 19.08V17C16.1 16.7 17.4 15 17.8 13H20C21 13 22 12 22 11V2H18M6 11H4V4H6V11M20 11H18V4H20V11Z",Vf="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z",Ff="M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13",Na="M4,4H20V20H4V4M6,8V18H18V8H6Z",Ra="M4,8H8V4H20V16H16V20H4V8M16,8V14H18V6H10V8H16M6,12V18H14V12H6Z",Cs=function(e,n){return Cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},Cs(e,n)};function Rn(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Cs(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}function Wf(e,n,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(c){try{u(r.next(c))}catch(p){s(p)}}function a(c){try{u(r.throw(c))}catch(p){s(p)}}function u(c){c.done?o(c.value):i(c.value).then(l,a)}u((r=r.apply(e,n||[])).next())})}function nc(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(u){return function(c){return a([u,c])}}function a(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(t=0)),t;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=n.call(e,t)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function ki(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function ur(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),i,o=[],s;try{for(;(n===void 0||n-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return o}function Vr(e,n,t){if(t||arguments.length===2)for(var r=0,i=n.length,o;r<i;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function vi(e){return this instanceof vi?(this.v=e,this):new vi(e)}function jf(e,n,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(e,n||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(b){r[b]&&(i[b]=function(m){return new Promise(function(k,S){o.push([b,m,k,S])>1||l(b,m)})})}function l(b,m){try{a(r[b](m))}catch(k){p(o[0][3],k)}}function a(b){b.value instanceof vi?Promise.resolve(b.value.v).then(u,c):p(o[0][2],b)}function u(b){l("next",b)}function c(b){l("throw",b)}function p(b,m){b(m),o.shift(),o.length&&l(o[0][0],o[0][1])}}function Bf(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],t;return n?n.call(e):(e=typeof ki=="function"?ki(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=e[o]&&function(s){return new Promise(function(l,a){s=e[o](s),i(l,a,s.done,s.value)})}}function i(o,s,l,a){Promise.resolve(a).then(function(u){o({value:u,done:l})},s)}}function He(e){return typeof e=="function"}function rc(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var as=rc(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
19
+ var zc=Object.defineProperty;var Yc=(e,n,t)=>n in e?zc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Ji=(e,n,t)=>(Yc(e,typeof n!="symbol"?n+"":n,t),t);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();function Oe(){}const Kc=e=>e;function Gc(e,n){for(const t in n)e[t]=n[t];return e}function Nu(e){return e()}function Ta(){return Object.create(null)}function St(e){e.forEach(Nu)}function vi(e){return typeof e=="function"}function Ct(e,n){return e!=e?n==n:e!==n||e&&typeof e=="object"||typeof e=="function"}function qc(e){return Object.keys(e).length===0}function Xc(e,...n){if(e==null)return Oe;const t=e.subscribe(...n);return t.unsubscribe?()=>t.unsubscribe():t}function w(e,n,t){e.$$.on_destroy.push(Xc(n,t))}function R(e,n,t){return e.set(t),n}function Zc(e){return e&&vi(e.destroy)?e.destroy:Oe}const Ru=typeof window<"u";let Jc=Ru?()=>window.performance.now():()=>Date.now(),Ts=Ru?e=>requestAnimationFrame(e):Oe;const mi=new Set;function Vu(e){mi.forEach(n=>{n.c(e)||(mi.delete(n),n.f())}),mi.size!==0&&Ts(Vu)}function Qc(e){let n;return mi.size===0&&Ts(Vu),{promise:new Promise(t=>{mi.add(n={c:e,f:t})}),abort(){mi.delete(n)}}}function f(e,n){e.appendChild(n)}function Fu(e){if(!e)return document;const n=e.getRootNode?e.getRootNode():e.ownerDocument;return n&&n.host?n:e.ownerDocument}function ef(e){const n=g("style");return tf(Fu(e),n),n.sheet}function tf(e,n){return f(e.head||e,n),n.sheet}function F(e,n,t){e.insertBefore(n,t||null)}function V(e){e.parentNode&&e.parentNode.removeChild(e)}function g(e){return document.createElement(e)}function gs(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function at(e){return document.createTextNode(e)}function k(){return at(" ")}function Hn(){return at("")}function P(e,n,t,r){return e.addEventListener(n,t,r),()=>e.removeEventListener(n,t,r)}function h(e,n,t){t==null?e.removeAttribute(n):e.getAttribute(n)!==t&&e.setAttribute(n,t)}function nf(e,n,t){const r=new Set;for(let i=0;i<e.length;i+=1)e[i].checked&&r.add(e[i].__value);return t||r.delete(n),Array.from(r)}function Pl(e){return e===""?null:+e}function rf(e){return Array.from(e.childNodes)}function Tt(e,n){n=""+n,e.wholeText!==n&&(e.data=n)}function At(e,n){e.value=n??""}function be(e,n,t,r){t===null?e.style.removeProperty(n):e.style.setProperty(n,t,r?"important":"")}function _i(e,n){for(let t=0;t<e.options.length;t+=1){const r=e.options[t];if(r.__value===n){r.selected=!0;return}}e.selectedIndex=-1}function of(e){const n=e.querySelector(":checked")||e.options[0];return n&&n.__value}function G(e,n,t){e.classList[t?"add":"remove"](n)}function Wu(e,n,{bubbles:t=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t,r,n),i}class ju{constructor(n=!1){this.is_svg=!1,this.is_svg=n,this.e=this.n=null}c(n){this.h(n)}m(n,t,r=null){this.e||(this.is_svg?this.e=gs(t.nodeName):this.e=g(t.nodeName),this.t=t,this.c(n)),this.i(r)}h(n){this.e.innerHTML=n,this.n=Array.from(this.e.childNodes)}i(n){for(let t=0;t<this.n.length;t+=1)F(this.t,this.n[t],n)}p(n){this.d(),this.h(n),this.i(this.a)}d(){this.n.forEach(V)}}const Al=new Map;let Tl=0;function lf(e){let n=5381,t=e.length;for(;t--;)n=(n<<5)-n^e.charCodeAt(t);return n>>>0}function sf(e,n){const t={stylesheet:ef(n),rules:{}};return Al.set(e,t),t}function af(e,n,t,r,i,o,s,l=0){const u=16.666/r;let a=`{
20
+ `;for(let D=0;D<=1;D+=u){const T=n+(t-n)*o(D);a+=D*100+`%{${s(T,1-T)}}
21
+ `}const c=a+`100% {${s(t,1-t)}}
22
+ }`,p=`__svelte_${lf(c)}_${l}`,b=Fu(e),{stylesheet:d,rules:y}=Al.get(b)||sf(b,e);y[p]||(y[p]=!0,d.insertRule(`@keyframes ${p} ${c}`,d.cssRules.length));const S=e.style.animation||"";return e.style.animation=`${S?`${S}, `:""}${p} ${r}ms linear ${i}ms 1 both`,Tl+=1,p}function Da(e,n){const t=(e.style.animation||"").split(", "),r=t.filter(n?o=>o.indexOf(n)<0:o=>o.indexOf("__svelte")===-1),i=t.length-r.length;i&&(e.style.animation=r.join(", "),Tl-=i,Tl||uf())}function uf(){Ts(()=>{Tl||(Al.forEach(e=>{const{ownerNode:n}=e.stylesheet;n&&V(n)}),Al.clear())})}let fo;function io(e){fo=e}function Ds(){if(!fo)throw new Error("Function called outside component initialization");return fo}function jl(e){Ds().$$.on_mount.push(e)}function Bu(e){Ds().$$.on_destroy.push(e)}function Br(){const e=Ds();return(n,t,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[n];if(i){const o=Wu(n,t,{cancelable:r});return i.slice().forEach(s=>{s.call(e,o)}),!o.defaultPrevented}return!0}}function ho(e,n){const t=e.$$.callbacks[n.type];t&&t.slice().forEach(r=>r.call(this,n))}const eo=[],pt=[],vl=[],bs=[],Uu=Promise.resolve();let vs=!1;function zu(){vs||(vs=!0,Uu.then(Yu))}function po(){return zu(),Uu}function $r(e){vl.push(e)}function ts(e){bs.push(e)}const ns=new Set;let fl=0;function Yu(){const e=fo;do{for(;fl<eo.length;){const n=eo[fl];fl++,io(n),cf(n.$$)}for(io(null),eo.length=0,fl=0;pt.length;)pt.pop()();for(let n=0;n<vl.length;n+=1){const t=vl[n];ns.has(t)||(ns.add(t),t())}vl.length=0}while(eo.length);for(;bs.length;)bs.pop()();vs=!1,ns.clear(),io(e)}function cf(e){if(e.fragment!==null){e.update(),St(e.before_update);const n=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,n),e.after_update.forEach($r)}}let Qi;function ff(){return Qi||(Qi=Promise.resolve(),Qi.then(()=>{Qi=null})),Qi}function Oa(e,n,t){e.dispatchEvent(Wu(`${n?"intro":"outro"}${t}`))}const _l=new Set;let xr;function rt(){xr={r:0,c:[],p:xr}}function it(){xr.r||St(xr.c),xr=xr.p}function N(e,n){e&&e.i&&(_l.delete(e),e.i(n))}function W(e,n,t,r){if(e&&e.o){if(_l.has(e))return;_l.add(e),xr.c.push(()=>{_l.delete(e),r&&(t&&e.d(1),r())}),e.o(n)}else r&&r()}const hf={duration:0};function Ku(e,n,t){const r={direction:"in"};let i=n(e,t,r),o=!1,s,l,u=0;function a(){s&&Da(e,s)}function c(){const{delay:b=0,duration:d=300,easing:y=Kc,tick:S=Oe,css:D}=i||hf;D&&(s=af(e,0,1,d,b,y,D,u++)),S(0,1);const T=Jc()+b,I=T+d;l&&l.abort(),o=!0,$r(()=>Oa(e,!0,"start")),l=Qc(L=>{if(o){if(L>=I)return S(1,0),Oa(e,!0,"end"),a(),o=!1;if(L>=T){const H=y((L-T)/d);S(H,1-H)}}return o})}let p=!1;return{start(){p||(p=!0,Da(e),vi(i)?(i=i(r),ff().then(c)):c())},invalidate(){p=!1},end(){o&&(a(),o=!1)}}}const Os=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Bl(e,n){e.d(1),n.delete(e.key)}function Is(e,n){W(e,1,1,()=>{n.delete(e.key)})}function Ur(e,n,t,r,i,o,s,l,u,a,c,p){let b=e.length,d=o.length,y=b;const S={};for(;y--;)S[e[y].key]=y;const D=[],T=new Map,I=new Map;for(y=d;y--;){const Y=p(i,o,y),q=t(Y);let B=s.get(q);B?r&&B.p(Y,n):(B=a(q,Y),B.c()),T.set(q,D[y]=B),q in S&&I.set(q,Math.abs(y-S[q]))}const L=new Set,H=new Set;function J(Y){N(Y,1),Y.m(l,c),s.set(Y.key,Y),c=Y.first,d--}for(;b&&d;){const Y=D[d-1],q=e[b-1],B=Y.key,x=q.key;Y===q?(c=Y.first,b--,d--):T.has(x)?!s.has(B)||L.has(B)?J(Y):H.has(x)?b--:I.get(B)>I.get(x)?(H.add(B),J(Y)):(L.add(x),b--):(u(q,s),b--)}for(;b--;){const Y=e[b];T.has(Y.key)||u(Y,s)}for(;d;)J(D[d-1]);return D}function pf(e,n){const t={},r={},i={$$scope:1};let o=e.length;for(;o--;){const s=e[o],l=n[o];if(l){for(const u in s)u in l||(r[u]=1);for(const u in l)i[u]||(t[u]=l[u],i[u]=1);e[o]=l}else for(const u in s)i[u]=1}for(const s in r)s in t||(t[s]=void 0);return t}function df(e){return typeof e=="object"&&e!==null?e:{}}function rs(e,n,t,r){const i=e.$$.props[n];i!==void 0&&(e.$$.bound[i]=t,r===void 0&&t(e.$$.ctx[i]))}function le(e){e&&e.c()}function re(e,n,t,r){const{fragment:i,after_update:o}=e.$$;i&&i.m(n,t),r||$r(()=>{const s=e.$$.on_mount.map(Nu).filter(vi);e.$$.on_destroy?e.$$.on_destroy.push(...s):St(s),e.$$.on_mount=[]}),o.forEach($r)}function ie(e,n){const t=e.$$;t.fragment!==null&&(St(t.on_destroy),t.fragment&&t.fragment.d(n),t.on_destroy=t.fragment=null,t.ctx=[])}function mf(e,n){e.$$.dirty[0]===-1&&(eo.push(e),zu(),e.$$.dirty.fill(0)),e.$$.dirty[n/31|0]|=1<<n%31}function Ut(e,n,t,r,i,o,s,l=[-1]){const u=fo;io(e);const a=e.$$={fragment:null,ctx:[],props:o,update:Oe,not_equal:i,bound:Ta(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(u?u.$$.context:[])),callbacks:Ta(),dirty:l,skip_bound:!1,root:n.target||u.$$.root};s&&s(a.root);let c=!1;if(a.ctx=t?t(e,n.props||{},(p,b,...d)=>{const y=d.length?d[0]:b;return a.ctx&&i(a.ctx[p],a.ctx[p]=y)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](y),c&&mf(e,p)),b}):[],a.update(),c=!0,St(a.before_update),a.fragment=r?r(a.ctx):!1,n.target){if(n.hydrate){const p=rf(n.target);a.fragment&&a.fragment.l(p),p.forEach(V)}else a.fragment&&a.fragment.c();n.intro&&N(e.$$.fragment),re(e,n.target,n.anchor,n.customElement),Yu()}io(u)}class zt{$destroy(){ie(this,1),this.$destroy=Oe}$on(n,t){if(!vi(t))return Oe;const r=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return r.push(t),()=>{const i=r.indexOf(t);i!==-1&&r.splice(i,1)}}$set(n){this.$$set&&!qc(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}var gf="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z",Gu="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",bf="M22,21H2V3H4V19H6V10H10V19H12V6H16V19H18V14H22V21Z",qu="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",vf="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",_f="M21.4 7.5C22.2 8.3 22.2 9.6 21.4 10.3L18.6 13.1L10.8 5.3L13.6 2.5C14.4 1.7 15.7 1.7 16.4 2.5L18.2 4.3L21.2 1.3L22.6 2.7L19.6 5.7L21.4 7.5M15.6 13.3L14.2 11.9L11.4 14.7L9.3 12.6L12.1 9.8L10.7 8.4L7.9 11.2L6.4 9.8L3.6 12.6C2.8 13.4 2.8 14.7 3.6 15.4L5.4 17.2L1.4 21.2L2.8 22.6L6.8 18.6L8.6 20.4C9.4 21.2 10.7 21.2 11.4 20.4L14.2 17.6L12.8 16.2L15.6 13.3Z",wf="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",_s="M19,12V13.5A4,4 0 0,1 23,17.5C23,18.32 22.75,19.08 22.33,19.71L21.24,18.62C21.41,18.28 21.5,17.9 21.5,17.5A2.5,2.5 0 0,0 19,15V16.5L16.75,14.25L19,12M19,23V21.5A4,4 0 0,1 15,17.5C15,16.68 15.25,15.92 15.67,15.29L16.76,16.38C16.59,16.72 16.5,17.1 16.5,17.5A2.5,2.5 0 0,0 19,20V18.5L21.25,20.75L19,23M12,3C16.42,3 20,4.79 20,7C20,9.21 16.42,11 12,11C7.58,11 4,9.21 4,7C4,4.79 7.58,3 12,3M4,9C4,11.21 7.58,13 12,13C13.11,13 14.17,12.89 15.14,12.68C14.19,13.54 13.5,14.67 13.18,15.96L12,16C7.58,16 4,14.21 4,12V9M20,9V11H19.5L18.9,11.03C19.6,10.43 20,9.74 20,9M4,14C4,16.21 7.58,18 12,18L13,17.97C13.09,19.03 13.42,20 13.95,20.88L12,21C7.58,21 4,19.21 4,17V14Z",oo="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",kf="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8.46,11.88L9.87,10.47L12,12.59L14.12,10.47L15.53,11.88L13.41,14L15.53,16.12L14.12,17.53L12,15.41L9.88,17.53L8.47,16.12L10.59,14L8.46,11.88M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",yf="M9,1V7H5L12,14L19,7H15V1H9M5,16V18H19V16H5M5,20V22H19V20H5Z",Sf="M5,3A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5.5L18.5,3H17V9A1,1 0 0,1 16,10H8A1,1 0 0,1 7,9V3H5M12,4V9H15V4H12M7,12H17A1,1 0 0,1 18,13V19H6V13A1,1 0 0,1 7,12Z",Qt="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",Cf="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",Lf="M21 10V9L15 3H5C3.89 3 3 3.89 3 5V19C3 20.11 3.9 21 5 21H11V19.13L19.39 10.74C19.83 10.3 20.39 10.06 21 10M14 4.5L19.5 10H14V4.5M22.85 14.19L21.87 15.17L19.83 13.13L20.81 12.15C21 11.95 21.33 11.95 21.53 12.15L22.85 13.47C23.05 13.67 23.05 14 22.85 14.19M19.13 13.83L21.17 15.87L15.04 22H13V19.96L19.13 13.83Z",Ef="M14,19H18V5H14M6,19H10V5H6V19Z",xf="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Pf="M8,5.14V19.14L19,12.14L8,5.14Z",Xu="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Af="M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z",Tf="M15 3H9V1H15V3M12 18.5C12 19.77 12.37 20.94 13 21.94C12.67 22 12.34 22 12 22C7.03 22 3 17.97 3 13S7.03 4 12 4C14.12 4 16.07 4.74 17.62 6L19.04 4.56C19.55 5 20 5.46 20.45 5.97L19.03 7.39C20.16 8.81 20.87 10.57 21 12.5C20.22 12.18 19.38 12 18.5 12C14.91 12 12 14.91 12 18.5M13 7H11V14H13V7M23 18.5C23 21 21 23 18.5 23S14 21 14 18.5 16 14 18.5 14 23 16 23 18.5M20 21.08L15.92 17C15.65 17.42 15.5 17.94 15.5 18.5C15.5 20.16 16.84 21.5 18.5 21.5C19.06 21.5 19.58 21.35 20 21.08M21.5 18.5C21.5 16.84 20.16 15.5 18.5 15.5C17.94 15.5 17.42 15.65 17 15.92L21.08 20C21.35 19.58 21.5 19.06 21.5 18.5Z",Df="M15 3H9V1H15V3M19.39 10.74L11 19.13V21.94C6.5 21.44 3 17.63 3 13C3 8.03 7.03 4 12 4C14.12 4 16.07 4.74 17.62 6L19.04 4.56C19.55 5 20 5.46 20.45 5.97L19.03 7.39C19.67 8.19 20.17 9.11 20.5 10.1C20.1 10.21 19.71 10.42 19.39 10.74M13 7H11V14H13V7M13 19.96V22H15.04L21.17 15.88L19.13 13.83L13 19.96M22.85 13.47L21.53 12.15C21.33 11.95 21 11.95 20.81 12.15L19.83 13.13L21.87 15.17L22.85 14.19C23.05 14 23.05 13.67 22.85 13.47Z",Of="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",If="M17 6H7C3.69 6 1 8.69 1 12S3.69 18 7 18H17C20.31 18 23 15.31 23 12S20.31 6 17 6M17 16H7C4.79 16 3 14.21 3 12S4.79 8 7 8H17C19.21 8 21 9.79 21 12S19.21 16 17 16M17 9C15.34 9 14 10.34 14 12S15.34 15 17 15 20 13.66 20 12 18.66 9 17 9Z",Zu="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z",Mf="M18 2C17.1 2 16 3 16 4H8C8 3 6.9 2 6 2H2V11C2 12 3 13 4 13H6.2C6.6 15 7.9 16.7 11 17V19.08C8 19.54 8 22 8 22H16C16 22 16 19.54 13 19.08V17C16.1 16.7 17.4 15 17.8 13H20C21 13 22 12 22 11V2H18M6 11H4V4H6V11M20 11H18V4H20V11Z",$f="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z",Hf="M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13",Ia="M4,4H20V20H4V4M6,8V18H18V8H6Z",Ma="M4,8H8V4H20V16H16V20H4V8M16,8V14H18V6H10V8H16M6,12V18H14V12H6Z",ws=function(e,n){return ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},ws(e,n)};function Nn(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");ws(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}function Nf(e,n,t,r){function i(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function l(c){try{a(r.next(c))}catch(p){s(p)}}function u(c){try{a(r.throw(c))}catch(p){s(p)}}function a(c){c.done?o(c.value):i(c.value).then(l,u)}a((r=r.apply(e,n||[])).next())})}function Ju(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(a){return function(c){return u([a,c])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(t=0)),t;)try{if(r=1,i&&(o=a[0]&2?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[a[0]&2,o.value]),a[0]){case 0:case 1:o=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,i=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1],o=a;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(a);break}o[2]&&t.ops.pop(),t.trys.pop();continue}a=n.call(e,t)}catch(c){a=[6,c],i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function wi(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function lr(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),i,o=[],s;try{for(;(n===void 0||n-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return o}function Hr(e,n,t){if(t||arguments.length===2)for(var r=0,i=n.length,o;r<i;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function gi(e){return this instanceof gi?(this.v=e,this):new gi(e)}function Rf(e,n,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(e,n||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(b){r[b]&&(i[b]=function(d){return new Promise(function(y,S){o.push([b,d,y,S])>1||l(b,d)})})}function l(b,d){try{u(r[b](d))}catch(y){p(o[0][3],y)}}function u(b){b.value instanceof gi?Promise.resolve(b.value.v).then(a,c):p(o[0][2],b)}function a(b){l("next",b)}function c(b){l("throw",b)}function p(b,d){b(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function Vf(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],t;return n?n.call(e):(e=typeof wi=="function"?wi(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=e[o]&&function(s){return new Promise(function(l,u){s=e[o](s),i(l,u,s.done,s.value)})}}function i(o,s,l,u){Promise.resolve(u).then(function(a){o({value:a,done:l})},s)}}function He(e){return typeof e=="function"}function Qu(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var is=Qu(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
23
23
  `+t.map(function(r,i){return i+1+") "+r.toString()}).join(`
24
- `):"",this.name="UnsubscriptionError",this.errors=t}});function $l(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var Lo=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,r,i,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=ki(s),a=l.next();!a.done;a=l.next()){var u=a.value;u.remove(this)}}catch(S){n={error:S}}finally{try{a&&!a.done&&(t=l.return)&&t.call(l)}finally{if(n)throw n.error}}else s.remove(this);var c=this.initialTeardown;if(He(c))try{c()}catch(S){o=S instanceof as?S.errors:[S]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var b=ki(p),m=b.next();!m.done;m=b.next()){var k=m.value;try{Va(k)}catch(S){o=o??[],S instanceof as?o=Vr(Vr([],ur(o)),ur(S.errors)):o.push(S)}}}catch(S){r={error:S}}finally{try{m&&!m.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}}if(o)throw new as(o)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)Va(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&$l(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&$l(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}(),ic=Lo.EMPTY;function oc(e){return e instanceof Lo||e&&"closed"in e&&He(e.remove)&&He(e.add)&&He(e.unsubscribe)}function Va(e){He(e)?e():e.unsubscribe()}var Rs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ls={setTimeout:function(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=Ls.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,Vr([e,n],ur(t))):setTimeout.apply(void 0,Vr([e,n],ur(t)))},clearTimeout:function(e){var n=Ls.delegate;return((n==null?void 0:n.clearTimeout)||clearTimeout)(e)},delegate:void 0};function lc(e){Ls.setTimeout(function(){throw e})}function Es(){}var gl=null;function Cl(e){if(Rs.useDeprecatedSynchronousErrorHandling){var n=!gl;if(n&&(gl={errorThrown:!1,error:null}),e(),n){var t=gl,r=t.errorThrown,i=t.error;if(gl=null,r)throw i}}else e()}var Vs=function(e){Rn(n,e);function n(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,oc(t)&&t.add(r)):r.destination=Kf,r}return n.create=function(t,r,i){return new xs(t,r,i)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(Lo),Uf=Function.prototype.bind;function us(e,n){return Uf.call(e,n)}var zf=function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var t=this.partialObserver;if(t.next)try{t.next(n)}catch(r){bl(r)}},e.prototype.error=function(n){var t=this.partialObserver;if(t.error)try{t.error(n)}catch(r){bl(r)}else bl(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(t){bl(t)}},e}(),xs=function(e){Rn(n,e);function n(t,r,i){var o=e.call(this)||this,s;if(He(t)||!t)s={next:t??void 0,error:r??void 0,complete:i??void 0};else{var l;o&&Rs.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&us(t.next,l),error:t.error&&us(t.error,l),complete:t.complete&&us(t.complete,l)}):s=t}return o.destination=new zf(s),o}return n}(Vs);function bl(e){lc(e)}function Yf(e){throw e}var Kf={closed:!0,next:Es,error:Yf,complete:Es},Fs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Eo(e){return e}function Gf(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return sc(e)}function sc(e){return e.length===0?Eo:e.length===1?e[0]:function(t){return e.reduce(function(r,i){return i(r)},t)}}var Tt=function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(n,t,r){var i=this,o=Xf(n)?n:new xs(n,t,r);return Cl(function(){var s=i,l=s.operator,a=s.source;o.add(l?l.call(o,a):a?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(t){n.error(t)}},e.prototype.forEach=function(n,t){var r=this;return t=Fa(t),new t(function(i,o){var s=new xs({next:function(l){try{n(l)}catch(a){o(a),s.unsubscribe()}},error:o,complete:i});r.subscribe(s)})},e.prototype._subscribe=function(n){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(n)},e.prototype[Fs]=function(){return this},e.prototype.pipe=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return sc(n)(this)},e.prototype.toPromise=function(n){var t=this;return n=Fa(n),new n(function(r,i){var o;t.subscribe(function(s){return o=s},function(s){return i(s)},function(){return r(o)})})},e.create=function(n){return new e(n)},e}();function Fa(e){var n;return(n=e??Rs.Promise)!==null&&n!==void 0?n:Promise}function qf(e){return e&&He(e.next)&&He(e.error)&&He(e.complete)}function Xf(e){return e&&e instanceof Vs||qf(e)&&oc(e)}function Zf(e){return He(e==null?void 0:e.lift)}function Cn(e){return function(n){if(Zf(n))return n.lift(function(t){try{return e(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function sn(e,n,t,r,i){return new Jf(e,n,t,r,i)}var Jf=function(e){Rn(n,e);function n(t,r,i,o,s,l){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=l,a._next=r?function(u){try{r(u)}catch(c){t.error(c)}}:e.prototype._next,a._error=o?function(u){try{o(u)}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(u){t.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,a}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},n}(Vs),Qf=rc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ji=function(e){Rn(n,e);function n(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.prototype.lift=function(t){var r=new Wa(this,this);return r.operator=t,r},n.prototype._throwIfClosed=function(){if(this.closed)throw new Qf},n.prototype.next=function(t){var r=this;Cl(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var s=ki(r.currentObservers),l=s.next();!l.done;l=s.next()){var a=l.value;a.next(t)}}catch(u){i={error:u}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}}})},n.prototype.error=function(t){var r=this;Cl(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var i=r.observers;i.length;)i.shift().error(t)}})},n.prototype.complete=function(){var t=this;Cl(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},n.prototype._innerSubscribe=function(t){var r=this,i=this,o=i.hasError,s=i.isStopped,l=i.observers;return o||s?ic:(this.currentObservers=null,l.push(t),new Lo(function(){r.currentObservers=null,$l(l,t)}))},n.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,o=r.thrownError,s=r.isStopped;i?t.error(o):s&&t.complete()},n.prototype.asObservable=function(){var t=new Tt;return t.source=this,t},n.create=function(t,r){return new Wa(t,r)},n}(Tt),Wa=function(e){Rn(n,e);function n(t,r){var i=e.call(this)||this;return i.destination=t,i.source=r,i}return n.prototype.next=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,t)},n.prototype.error=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,t)},n.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},n.prototype._subscribe=function(t){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&i!==void 0?i:ic},n}(Ji),eh=function(e){Rn(n,e);function n(t){var r=e.call(this)||this;return r._value=t,r}return Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},n.prototype.getValue=function(){var t=this,r=t.hasError,i=t.thrownError,o=t._value;if(r)throw i;return this._throwIfClosed(),o},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Ji),ac={now:function(){return(ac.delegate||Date).now()},delegate:void 0},th=function(e){Rn(n,e);function n(t,r){return e.call(this)||this}return n.prototype.schedule=function(t,r){return this},n}(Lo),Hl={setInterval:function(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=Hl.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,Vr([e,n],ur(t))):setInterval.apply(void 0,Vr([e,n],ur(t)))},clearInterval:function(e){var n=Hl.delegate;return((n==null?void 0:n.clearInterval)||clearInterval)(e)},delegate:void 0},nh=function(e){Rn(n,e);function n(t,r){var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.pending=!1,i}return n.prototype.schedule=function(t,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=t;var o=this.id,s=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(s,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(s,this.id,r),this},n.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),Hl.setInterval(t.flush.bind(t,this),i)},n.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Hl.clearInterval(r)},n.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,r){var i=!1,o;try{this.work(t)}catch(s){i=!0,o=s||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,i=t.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,$l(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n}(th),ja=function(){function e(n,t){t===void 0&&(t=e.now),this.schedulerActionCtor=n,this.now=t}return e.prototype.schedule=function(n,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,n).schedule(r,t)},e.now=ac.now,e}(),rh=function(e){Rn(n,e);function n(t,r){r===void 0&&(r=ja.now);var i=e.call(this,t,r)||this;return i.actions=[],i._active=!1,i}return n.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}},n}(ja),Gl=new rh(nh),ih=Gl,oh=new Tt(function(e){return e.complete()});function uc(e){return e&&He(e.schedule)}function Ws(e){return e[e.length-1]}function lh(e){return He(Ws(e))?e.pop():void 0}function ql(e){return uc(Ws(e))?e.pop():void 0}function sh(e,n){return typeof Ws(e)=="number"?e.pop():n}var js=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function cc(e){return He(e==null?void 0:e.then)}function fc(e){return He(e[Fs])}function hc(e){return Symbol.asyncIterator&&He(e==null?void 0:e[Symbol.asyncIterator])}function pc(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ah(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dc=ah();function mc(e){return He(e==null?void 0:e[dc])}function gc(e){return jf(this,arguments,function(){var t,r,i,o;return nc(this,function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,vi(t.read())];case 3:return r=s.sent(),i=r.value,o=r.done,o?[4,vi(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,vi(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function bc(e){return He(e==null?void 0:e.getReader)}function Vn(e){if(e instanceof Tt)return e;if(e!=null){if(fc(e))return uh(e);if(js(e))return ch(e);if(cc(e))return fh(e);if(hc(e))return vc(e);if(mc(e))return hh(e);if(bc(e))return ph(e)}throw pc(e)}function uh(e){return new Tt(function(n){var t=e[Fs]();if(He(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ch(e){return new Tt(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function fh(e){return new Tt(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,lc)})}function hh(e){return new Tt(function(n){var t,r;try{for(var i=ki(e),o=i.next();!o.done;o=i.next()){var s=o.value;if(n.next(s),n.closed)return}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}n.complete()})}function vc(e){return new Tt(function(n){dh(e,n).catch(function(t){return n.error(t)})})}function ph(e){return vc(gc(e))}function dh(e,n){var t,r,i,o;return Wf(this,void 0,void 0,function(){var s,l;return nc(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=Bf(e),a.label=1;case 1:return[4,t.next()];case 2:if(r=a.sent(),!!r.done)return[3,4];if(s=r.value,n.next(s),n.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=a.sent(),i={error:l},[3,11];case 6:return a.trys.push([6,,9,10]),r&&!r.done&&(o=t.return)?[4,o.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}function In(e,n,t,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=n.schedule(function(){t(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function _c(e,n){return n===void 0&&(n=0),Cn(function(t,r){t.subscribe(sn(r,function(i){return In(r,e,function(){return r.next(i)},n)},function(){return In(r,e,function(){return r.complete()},n)},function(i){return In(r,e,function(){return r.error(i)},n)}))})}function wc(e,n){return n===void 0&&(n=0),Cn(function(t,r){r.add(e.schedule(function(){return t.subscribe(r)},n))})}function mh(e,n){return Vn(e).pipe(wc(n),_c(n))}function gh(e,n){return Vn(e).pipe(wc(n),_c(n))}function bh(e,n){return new Tt(function(t){var r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}function vh(e,n){return new Tt(function(t){var r;return In(t,n,function(){r=e[dc](),In(t,n,function(){var i,o,s;try{i=r.next(),o=i.value,s=i.done}catch(l){t.error(l);return}s?t.complete():t.next(o)},0,!0)}),function(){return He(r==null?void 0:r.return)&&r.return()}})}function yc(e,n){if(!e)throw new Error("Iterable cannot be null");return new Tt(function(t){In(t,n,function(){var r=e[Symbol.asyncIterator]();In(t,n,function(){r.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function _h(e,n){return yc(gc(e),n)}function wh(e,n){if(e!=null){if(fc(e))return mh(e,n);if(js(e))return bh(e,n);if(cc(e))return gh(e,n);if(hc(e))return yc(e,n);if(mc(e))return vh(e,n);if(bc(e))return _h(e,n)}throw pc(e)}function Xl(e,n){return n?wh(e,n):Vn(e)}function yh(e){return e instanceof Date&&!isNaN(e)}function Zl(e,n){return Cn(function(t,r){var i=0;t.subscribe(sn(r,function(o){r.next(e.call(n,o,i++))}))})}var kh=Array.isArray;function Sh(e,n){return kh(n)?e.apply(void 0,Vr([],ur(n))):e(n)}function kc(e){return Zl(function(n){return Sh(e,n)})}var Ch=Array.isArray,Lh=Object.getPrototypeOf,Eh=Object.prototype,xh=Object.keys;function Ph(e){if(e.length===1){var n=e[0];if(Ch(n))return{args:n,keys:null};if(Ah(n)){var t=xh(n);return{args:t.map(function(r){return n[r]}),keys:t}}}return{args:e,keys:null}}function Ah(e){return e&&typeof e=="object"&&Lh(e)===Eh}function Th(e,n){return e.reduce(function(t,r,i){return t[r]=n[i],t},{})}function Dh(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=ql(e),r=lh(e),i=Ph(e),o=i.args,s=i.keys;if(o.length===0)return Xl([],t);var l=new Tt(Oh(o,t,s?function(a){return Th(s,a)}:Eo));return r?l.pipe(kc(r)):l}function Oh(e,n,t){return t===void 0&&(t=Eo),function(r){Ba(n,function(){for(var i=e.length,o=new Array(i),s=i,l=i,a=function(c){Ba(n,function(){var p=Xl(e[c],n),b=!1;p.subscribe(sn(r,function(m){o[c]=m,b||(b=!0,l--),l||r.next(t(o.slice()))},function(){--s||r.complete()}))},r)},u=0;u<i;u++)a(u)},r)}}function Ba(e,n,t){e?In(t,e,n):n()}function Ih(e,n,t,r,i,o,s,l){var a=[],u=0,c=0,p=!1,b=function(){p&&!a.length&&!u&&n.complete()},m=function(S){return u<r?k(S):a.push(S)},k=function(S){o&&n.next(S),u++;var I=!1;Vn(t(S,c++)).subscribe(sn(n,function(A){i==null||i(A),o?m(A):n.next(A)},function(){I=!0},void 0,function(){if(I)try{u--;for(var A=function(){var $=a.shift();s?In(n,s,function(){return k($)}):k($)};a.length&&u<r;)A();b()}catch($){n.error($)}}))};return e.subscribe(sn(n,m,function(){p=!0,b()})),function(){l==null||l()}}function Bs(e,n,t){return t===void 0&&(t=1/0),He(n)?Bs(function(r,i){return Zl(function(o,s){return n(r,o,i,s)})(Vn(e(r,i)))},t):(typeof n=="number"&&(t=n),Cn(function(r,i){return Ih(r,i,e,t)}))}function Sc(e){return e===void 0&&(e=1/0),Bs(Eo,e)}function Mh(){return Sc(1)}function Ua(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Mh()(Xl(e,ql(e)))}var $h=["addListener","removeListener"],Hh=["addEventListener","removeEventListener"],Nh=["on","off"];function or(e,n,t,r){if(He(t)&&(r=t,t=void 0),r)return or(e,n,t).pipe(kc(r));var i=ur(Fh(e)?Hh.map(function(l){return function(a){return e[l](n,a,t)}}):Rh(e)?$h.map(za(e,n)):Vh(e)?Nh.map(za(e,n)):[],2),o=i[0],s=i[1];if(!o&&js(e))return Bs(function(l){return or(l,n,t)})(Vn(e));if(!o)throw new TypeError("Invalid event target");return new Tt(function(l){var a=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return l.next(1<u.length?u:u[0])};return o(a),function(){return s(a)}})}function za(e,n){return function(t){return function(r){return e[t](n,r)}}}function Rh(e){return He(e.addListener)&&He(e.removeListener)}function Vh(e){return He(e.on)&&He(e.off)}function Fh(e){return He(e.addEventListener)&&He(e.removeEventListener)}function Cc(e,n,t){e===void 0&&(e=0),t===void 0&&(t=ih);var r=-1;return n!=null&&(uc(n)?t=n:r=n),new Tt(function(i){var o=yh(e)?+e-t.now():e;o<0&&(o=0);var s=0;return t.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function Wh(e,n){return e===void 0&&(e=0),n===void 0&&(n=Gl),e<0&&(e=0),Cc(e,e,n)}function jh(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=ql(e),r=sh(e,1/0),i=e;return i.length?i.length===1?Vn(i[0]):Sc(r)(Xl(i,t)):oh}var bo=new Tt(Es);function Jl(e,n){return Cn(function(t,r){var i=0;t.subscribe(sn(r,function(o){return e.call(n,o,i++)&&r.next(o)}))})}function Us(e,n){return n===void 0&&(n=Gl),Cn(function(t,r){var i=null,o=null,s=null,l=function(){if(i){i.unsubscribe(),i=null;var u=o;o=null,r.next(u)}};function a(){var u=s+e,c=n.now();if(c<u){i=this.schedule(void 0,u-c),r.add(i);return}l()}t.subscribe(sn(r,function(u){o=u,s=n.now(),i||(i=n.schedule(a,e),r.add(i))},function(){l(),r.complete()},void 0,function(){o=i=null}))})}function Bh(e){return Jl(function(n,t){return e<=t})}function Uh(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=ql(e);return Cn(function(r,i){(t?Ua(e,r,t):Ua(e,r)).subscribe(i)})}function vo(e,n){return Cn(function(t,r){var i=null,o=0,s=!1,l=function(){return s&&!i&&r.complete()};t.subscribe(sn(r,function(a){i==null||i.unsubscribe();var u=0,c=o++;Vn(e(a,c)).subscribe(i=sn(r,function(p){return r.next(n?n(a,p,c,u++):p)},function(){i=null,l()}))},function(){s=!0,l()}))})}function tr(e,n,t){var r=He(e)||n||t?{next:e,error:n,complete:t}:e;return r?Cn(function(i,o){var s;(s=r.subscribe)===null||s===void 0||s.call(r);var l=!0;i.subscribe(sn(o,function(a){var u;(u=r.next)===null||u===void 0||u.call(r,a),o.next(a)},function(){var a;l=!1,(a=r.complete)===null||a===void 0||a.call(r),o.complete()},function(a){var u;l=!1,(u=r.error)===null||u===void 0||u.call(r,a),o.error(a)},function(){var a,u;l&&((a=r.unsubscribe)===null||a===void 0||a.call(r)),(u=r.finalize)===null||u===void 0||u.call(r)}))}):Eo}var Lc={leading:!0,trailing:!1};function zh(e,n){return n===void 0&&(n=Lc),Cn(function(t,r){var i=n.leading,o=n.trailing,s=!1,l=null,a=null,u=!1,c=function(){a==null||a.unsubscribe(),a=null,o&&(m(),u&&r.complete())},p=function(){a=null,u&&r.complete()},b=function(k){return a=Vn(e(k)).subscribe(sn(r,c,p))},m=function(){if(s){s=!1;var k=l;l=null,r.next(k),!u&&b(k)}};t.subscribe(sn(r,function(k){s=!0,l=k,!(a&&!a.closed)&&(i?m():b(k))},function(){u=!0,!(o&&s&&a&&!a.closed)&&r.complete()}))})}function Yh(e,n,t){n===void 0&&(n=Gl),t===void 0&&(t=Lc);var r=Cc(e,n);return zh(function(){return r},t)}function Kh(e){const n=e-1;return n*n*n+1}function Gh(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}function Ec(e,{delay:n=0,duration:t=400,easing:r=Kh,x:i=0,y:o=0,opacity:s=0}={}){const l=getComputedStyle(e),a=+l.opacity,u=l.transform==="none"?"":l.transform,c=a*(1-s);return{delay:n,duration:t,easing:r,css:(p,b)=>`
25
- transform: ${u} translate(${(1-p)*i}px, ${(1-p)*o}px);
26
- opacity: ${a-c*b}`}}var rn=(e=>(e.LIGHT="light",e.DARK="dark",e.CUPCAKE="cupcake",e.BUMBLEBEE="bumblebee",e.EMERALD="emerald",e.CORPORATE="corporate",e.SYNTHWAVE="synthwave",e.RETRO="retro",e.CYBERPUNK="cyberpunk",e.VALENTINE="valentine",e.HALLOWEEN="halloween",e.GARDEN="garden",e.FOREST="forest",e.AQUA="aqua",e.LOFI="lofi",e.PASTEL="pastel",e.FANTASY="fantasy",e.WIREFRAME="wireframe",e.BLACK="black",e.LUXURY="luxury",e.DRACULA="dracula",e.CMYK="cmyk",e.AUTUMN="autumn",e.BUSINESS="business",e.ACID="acid",e.LEMONADE="lemonade",e.NIGHT="night",e.COFFEE="coffee",e.WINTER="winter",e))(rn||{}),on=(e=>(e.OFF="Off",e.NOTO="Noto Serif JP",e.KLEE="Klee One",e.SHIPPORI="Shippori Mincho",e.ACKAISYO="Ackaisyo",e.CINECAPTION226="CineCaption226",e))(on||{}),nn=(e=>(e.SOCKET="socket",e.PASTE="paste",e.EXTERNAL="external",e.EDIT="edit",e.UNDO="undo",e.RESETCHECKBOXES="resetcheckboxes",e.TL="tl",e))(nn||{});const hi=[];function Ql(e,n=Ie){let t;const r=new Set;function i(l){if(Et(e,l)&&(e=l,t)){const a=!hi.length;for(const u of r)u[1](),hi.push(u,e);if(a){for(let u=0;u<hi.length;u+=2)hi[u][0](hi[u+1]);hi.length=0}}}function o(l){i(l(e))}function s(l,a=Ie){const u=[l,a];return r.add(u),r.size===1&&(t=n(i)||Ie),l(e),()=>{r.delete(u),r.size===0&&(t(),t=null)}}return{set:i,update:o,subscribe:s}}function qh(e){return e.set=e.next,e}function Kr(e){return qh(new eh(e))}function es(e,n){return(t,r,i)=>{const o=Xh()(t,r,e),s=Kr(o);let l=!0;return i&&i.subscribe(a=>l=a),s.pipe(Bh(1)).subscribe(a=>{l&&window.localStorage.setItem(t,n(a??r))}),s}}function Xh(){return(e,n,t)=>{const r=window.localStorage.getItem(e);return r?t(r):n}}function Le(){return es(e=>!!+e,e=>e?"1":"0")}function Fn(){return es(e=>+e,e=>`${e}`)}function Zh(e){return es(n=>JSON.parse(n||e),n=>JSON.stringify(n))}function xo(){return Zh("[]")}function cr(){return es(e=>e,e=>e)}const L={theme$:rn.BUSINESS,replacements$:[],windowTitle$:"",websocketUrl$:"ws://localhost:55001",secondaryWebsocketUrl$:"",fontSize$:32,characterMilestone$:0,onlineFont$:on.OFF,preventLastDuplicate$:0,maxLines$:0,maxPipLines$:1,afkTimer$:0,adjustTimerOnAfk$:!1,enableExternalClipboardMonitor$:!1,showPresetQuickSwitch$:!1,skipResetConfirmations$:!1,persistStats$:!0,persistNotes$:!0,persistLines$:!0,persistActionHistory$:!1,enablePaste$:!1,blockCopyOnPage$:!1,allowPasteDuringPause$:!1,allowNewLineDuringPause$:!0,autoStartTimerDuringPausePaste$:!1,autoStartTimerDuringPause$:!1,preventGlobalDuplicate$:!1,mergeEqualLineStarts$:!1,filterNonCJKLines:!1,flashOnMissedLine$:!0,displayVertical$:!1,reverseLineOrder$:!1,preserveWhitespace$:!0,removeAllWhitespace$:!1,showTimer$:!0,showSpeed$:!0,showCharacterCount$:!0,showLineCount$:!0,blurStats$:!1,enableLineAnimation$:!1,enableAfkBlur$:!1,enableAfkBlurRestart$:!1,continuousReconnect$:!0,showConnectionErrors$:!1,customCSS$:"",autoTranslateLines$:!1,blurAutoTranslatedLines$:!1},Or=cr()("bannou-texthooker-theme",L.theme$),_n=xo()("bannou-texthooker-settingPresets",[]),ln=xo()("bannou-texthooker-replacements",[]),_o=cr()("bannou-texthooker-windowTitle",L.windowTitle$),Mn=cr()("bannou-texthooker-websocketUrl",L.websocketUrl$),$n=cr()("bannou-texthooker-secondary-websocketUrl",L.secondaryWebsocketUrl$),Ir=Fn()("bannou-texthooker-fontSize",L.fontSize$),Mr=Fn()("bannou-texthooker-characterMilestone",L.characterMilestone$),Si=cr()("bannou-texthooker-onlineFont",L.onlineFont$),$r=Fn()("bannou-texthooker-preventLastDuplicate",L.preventLastDuplicate$),Dr=Fn()("bannou-texthooker-maxLines",L.maxLines$),Hr=Fn()("bannou-texthooker-maxPipLines",L.maxPipLines$),ar=Fn()("bannou-texthooker-afkTimer",L.afkTimer$),Ci=Le()("bannou-texthooker-adjustTimerOnAfk",L.adjustTimerOnAfk$),wo=Le()("bannou-texthooker-enableExternalClipboardMonitor",L.enableExternalClipboardMonitor$),yo=Le()("bannou-texthooker-showPresetQuickSwitch",L.showPresetQuickSwitch$),Li=Le()("bannou-texthooker-skipResetConfirmations",L.skipResetConfirmations$),Ei=Le()("bannou-texthooker-persistStats",L.persistStats$),xi=Le()("bannou-texthooker-persistNotes",L.persistNotes$),Pi=Le()("bannou-texthooker-persistLines",L.persistLines$),Ai=Le()("bannou-texthooker-persistActionHistory",L.persistActionHistory$),Ti=Le()("bannou-texthooker-enablePaste",L.enablePaste$),Di=Le()("bannou-texthooker-blockCopyOnPage",L.blockCopyOnPage$),Oi=Le()("bannou-texthooker-allowPasteDuringPause",L.allowPasteDuringPause$),Ii=Le()("bannou-texthooker-allowNewLineDuringPause",L.allowNewLineDuringPause$),Mi=Le()("bannou-texthooker-autoStartTimerDuringPausePaste",L.autoStartTimerDuringPausePaste$),$i=Le()("bannou-texthooker-autoStartTimerDuringPause",L.autoStartTimerDuringPause$),Fr=Le()("bannou-texthooker-preventGlobalDuplicate",L.preventGlobalDuplicate$),Hi=Le()("bannou-texthooker-mergeEqualLineStarts",L.mergeEqualLineStarts$),Ni=Le()("bannou-texthooker-filterNonCJKLines",L.mergeEqualLineStarts$),Ri=Le()("bannou-texthooker-flashOnMissedLine",L.flashOnMissedLine$),Wr=Le()("bannou-texthooker-displayVertical",L.displayVertical$),jr=Le()("bannou-texthooker-reverseLineOrder",L.reverseLineOrder$),Vi=Le()("bannou-texthooker-preserveWhitespace",L.preserveWhitespace$),Fi=Le()("bannou-texthooker-removeAllWhitespace",L.removeAllWhitespace$),Wi=Le()("bannou-texthooker-showTimer",L.showTimer$),ji=Le()("bannou-texthooker-showSpeed",L.showSpeed$),Bi=Le()("bannou-texthooker-showCharacterCount",L.showCharacterCount$),Ui=Le()("bannou-texthooker-showLineCount",L.showLineCount$),zi=Le()("bannou-texthooker-blurStats",L.blurStats$),Yi=Le()("bannou-texthooker-enableLineAnimation",L.enableLineAnimation$),Ki=Le()("bannou-texthooker-enableAfkBlur",L.enableAfkBlur$),Gi=Le()("bannou-texthooker-enableAfkBlurRestart",L.enableAfkBlurRestart$),Br=Le()("bannou-texthooker-continuousReconnect",L.continuousReconnect$),qi=Le()("bannou-texthooker-showConnectionErrors",L.showConnectionErrors$),Xi=cr()("bannou-texthooker-customCSS",L.customCSS$),wn=Fn()("bannou-texthooker-timeValue",0,Ei),Nl=Kr(!1),ko=cr()("bannou-texthooker-userNotes","",xi),zs=Kr(-1),Ys=Kr(-1),Ue=Kr(void 0),Rl=Kr(!1),lr=cr()("bannou-texthooker-lastSettingPreset",""),et=xo()("bannou-texthooker-lineData",[],Pi),Ll=xo()("bannou-texthooker-lineIDs",[]),Ur=Ql(new Map),nr=xo()("bannou-texthooker-actionHistory",[],Ai),Ps=Ql(void 0),Xt=Kr(!0),Nr=new Ji,ts=new Ji,ns=new Ji,El=Ql(!1),As=Ql([]),Vl=Le()("bannou-texthooker-autoTranslateLines",!1),Fl=Le()("bannou-texthooker-blurAutoTranslatedLines",!1),Ya=Fn()("bannou-texthooker-lastPipHeight",0),Ka=Fn()("bannou-texthooker-lastPipWidth",0);async function Jh(){if(!Li.getValue()){const{canceled:e}=await new Promise(n=>{Ue.next({icon:tn,message:"All Settings and Data will be reset",callback:n})});if(e)return}lr.next(""),_n.next([]),Xt.next(!0),wn.next(0),ko.next(""),et.next([]),nr.next([]),Ps.set(void 0),window.localStorage.removeItem("bannou-texthooker-timeValue"),window.localStorage.removeItem("bannou-texthooker-userNotes"),window.localStorage.removeItem("bannou-texthooker-lineData"),window.localStorage.removeItem("bannou-texthooker-actionHistory"),Or.next(L.theme$),ln.next(L.replacements$),_o.next(L.windowTitle$),Mn.next(L.websocketUrl$),$n.next(L.secondaryWebsocketUrl$),Ir.next(L.fontSize$),Mr.next(L.characterMilestone$),Si.next(L.onlineFont$),$r.next(L.preventLastDuplicate$),Hr.next(L.maxPipLines$),ar.next(L.afkTimer$),Ci.next(L.adjustTimerOnAfk$),wo.next(L.enableExternalClipboardMonitor$),yo.next(L.showPresetQuickSwitch$),Li.next(L.skipResetConfirmations$),Ei.next(L.persistStats$),xi.next(L.persistNotes$),Pi.next(L.persistLines$),Ai.next(L.persistActionHistory$),Ti.next(L.enablePaste$),Di.next(L.blockCopyOnPage$),Oi.next(L.allowPasteDuringPause$),Ii.next(L.allowNewLineDuringPause$),Mi.next(L.autoStartTimerDuringPausePaste$),$i.next(L.autoStartTimerDuringPause$),Fr.next(L.preventGlobalDuplicate$),Hi.next(L.mergeEqualLineStarts$),Ni.next(L.filterNonCJKLines),Ri.next(L.flashOnMissedLine$),Wr.next(L.displayVertical$),jr.next(L.reverseLineOrder$),Vi.next(L.preserveWhitespace$),Fi.next(L.removeAllWhitespace$),Wi.next(L.showTimer$),ji.next(L.showSpeed$),Bi.next(L.showCharacterCount$),Ui.next(L.showLineCount$),zi.next(L.blurStats$),Yi.next(L.enableLineAnimation$),Ki.next(L.enableAfkBlur$),Gi.next(L.enableAfkBlurRestart$),Br.next(L.continuousReconnect$),qi.next(L.showConnectionErrors$),Xi.next(L.customCSS$),Vl.next(L.autoTranslateLines$),Fl.next(L.blurAutoTranslatedLines$)}function jt(){}function rr(){return Gf(Zl(()=>""),Jl((e,n)=>!n))}function So(e,n,t,r,i="auto"){console.log(n),n&&setTimeout(()=>{t?r?n.scrollTo({top:0,left:n.scrollWidth,behavior:i}):e.scrollTo({top:-n.scrollHeight,left:0,behavior:i}):r?n.scrollTo({top:0,left:-n.scrollWidth,behavior:i}):e.scrollTo({top:n.scrollHeight+100,left:0,behavior:i}),i==="smooth"&&setTimeout(()=>So(e,n,t,r),250)})}function Qh(e){const n=Math.floor(e/3600),t=Math.floor((e-n*3600)/60),r=e-n*3600-t*60;return`${`${n}`.padStart(2,"0")}:${`${t}`.padStart(2,"0")}:${`${r}`.padStart(2,"0")}`}function ep(e){const[n,t,r]=e.split(":").map(i=>Number.parseInt(i,10));return n*60*60+t*60+r}function tp(){const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Array.prototype.map.call(e,(t,r)=>(t<16?"0":"")+t.toString(16)+(r%2&&r<10&&r>2?"-":"")).join("")}function xc(e,n){if(!e||!n.length)return e;let t=e;for(let r=0,{length:i}=n;r<i;r+=1){const o=n[r];t=t.replace(new RegExp(o.pattern,o.flags.join("")),o.replaces.replace(/\\t/gm," ").replace(/\\n/gm,`
27
- `))}return t}function Pc(e,n){const t=e.createTextNode(n||"");let r=e.getElementById("user-css");r?r.replaceChild(t,r.firstChild):(r=e.createElement("style"),r.id="user-css",r.appendChild(t),e.head.append(r))}function Ga(e,n){n?(e.body.style.filter="blur(8px)",e.body.style.pointerEvents="none"):(e.body.style.filter=null,e.body.style.pointerEvents="auto")}const Ac=`
28
- `;function np(e){let n,t,r,i;return{c(){n=ws("svg"),t=ws("path"),h(t,"d",e[1]),be(n,"width",e[2]),be(n,"height",e[3]),h(n,"viewBox","0 0 24 24"),h(n,"fill","currentColor"),h(n,"class",e[4])},m(o,s){F(o,n,s),f(n,t),e[7](n),r||(i=[P(n,"click",e[5]),P(n,"keyup",e[6])],r=!0)},p(o,[s]){s&2&&h(t,"d",o[1]),s&4&&be(n,"width",o[2]),s&8&&be(n,"height",o[3]),s&16&&h(n,"class",o[4])},i:Ie,o:Ie,d(o){o&&V(n),e[7](null),r=!1,Lt(i)}}}function rp(e,n,t){let{path:r}=n,{width:i="1.5rem"}=n,{height:o="1.5rem"}=n,{element:s=void 0}=n,{class:l=""}=n;function a(p){mo.call(this,e,p)}function u(p){mo.call(this,e,p)}function c(p){mt[p?"unshift":"push"](()=>{s=p,t(0,s)})}return e.$$set=p=>{"path"in p&&t(1,r=p.path),"width"in p&&t(2,i=p.width),"height"in p&&t(3,o=p.height),"element"in p&&t(0,s=p.element),"class"in p&&t(4,l=p.class)},[s,r,i,o,l,a,u,c]}class _e extends Ut{constructor(n){super(),Bt(this,n,rp,np,Et,{path:1,width:2,height:3,element:0,class:4})}}function qa(e){let n,t;return n=new _e({props:{path:e[1]}}),{c(){se(n.$$.fragment)},m(r,i){ie(n,r,i),t=!0},p(r,i){const o={};i&2&&(o.path=r[1]),n.$set(o)},i(r){t||(H(n.$$.fragment,r),t=!0)},o(r){j(n.$$.fragment,r),t=!1},d(r){oe(n,r)}}}function ip(e){let n;return{c(){n=ct(e[2])},m(t,r){F(t,n,r)},p(t,r){r&4&&At(n,t[2])},d(t){t&&V(n)}}}function op(e){let n,t=e[5]==="text"&&Xa(e);return{c(){n=g("div"),t&&t.c()},m(r,i){F(r,n,i),t&&t.m(n,null)},p(r,i){r[5]==="text"?t?t.p(r,i):(t=Xa(r),t.c(),t.m(n,null)):t&&(t.d(1),t=null)},d(r){r&&V(n),t&&t.d()}}}function Xa(e){let n,t,r;return{c(){n=g("input"),h(n,"type",e[5]),h(n,"class","input input-bordered h-8 ml-2"),n.value=e[0]},m(i,o){F(i,n,o),t||(r=P(n,"change",e[8]),t=!0)},p(i,o){o&32&&h(n,"type",i[5]),o&1&&n.value!==i[0]&&(n.value=i[0])},d(i){i&&V(n),t=!1,r()}}}function Za(e){let n,t,r;return{c(){n=g("button"),n.textContent="Cancel",h(n,"class","btn btn-sm btn-ghost")},m(i,o){F(i,n,o),t||(r=P(n,"click",e[9]),t=!0)},p:Ie,d(i){i&&V(n),t=!1,r()}}}function lp(e){let n,t,r,i,o,s,l,a,u,c,p,b,m=e[1]&&qa(e);function k($,x){return $[5]?op:ip}let S=k(e),I=S(e),A=e[4]&&Za(e);return{c(){n=g("div"),t=g("div"),r=g("div"),m&&m.c(),i=w(),o=g("span"),I.c(),s=w(),l=g("div"),A&&A.c(),a=w(),u=g("button"),u.textContent="Confirm",h(u,"class","btn btn-sm btn-primary"),h(l,"class","flex-none"),h(t,"class","alert shadow-lg max-w-xl"),q(t,"alert-info",e[3]==="info"),q(t,"alert-error",e[3]==="error"),h(n,"class","fixed top-12 flex justify-center w-full z-30")},m($,x){F($,n,x),f(n,t),f(t,r),m&&m.m(r,null),f(r,i),f(r,o),I.m(o,null),f(t,s),f(t,l),A&&A.m(l,null),f(l,a),f(l,u),c=!0,p||(b=P(u,"click",e[10]),p=!0)},p($,[x]){$[1]?m?(m.p($,x),x&2&&H(m,1)):(m=qa($),m.c(),H(m,1),m.m(r,i)):m&&(rt(),j(m,1,1,()=>{m=null}),it()),S===(S=k($))&&I?I.p($,x):(I.d(1),I=S($),I&&(I.c(),I.m(o,null))),$[4]?A?A.p($,x):(A=Za($),A.c(),A.m(l,a)):A&&(A.d(1),A=null),(!c||x&8)&&q(t,"alert-info",$[3]==="info"),(!c||x&8)&&q(t,"alert-error",$[3]==="error")},i($){c||(H(m),c=!0)},o($){j(m),c=!1},d($){$&&V(n),m&&m.d(),I.d(),A&&A.d(),p=!1,b()}}}function sp(e,n,t){let{icon:r}=n,{message:i}=n,{type:o="info"}=n,{showCancel:s=!0}=n,{askForData:l=""}=n,{dataValue:a}=n,{callback:u}=n;const c=zr();function p(k){const S=k.target;t(0,a=S.value)}const b=()=>{u==null||u({canceled:!0,data:a}),c("close")},m=()=>{u==null||u({canceled:!1,data:a}),c("close")};return e.$$set=k=>{"icon"in k&&t(1,r=k.icon),"message"in k&&t(2,i=k.message),"type"in k&&t(3,o=k.type),"showCancel"in k&&t(4,s=k.showCancel),"askForData"in k&&t(5,l=k.askForData),"dataValue"in k&&t(0,a=k.dataValue),"callback"in k&&t(6,u=k.callback)},[a,r,i,o,s,l,u,c,p,b,m]}class ap extends Ut{constructor(n){super(),Bt(this,n,sp,lp,Et,{icon:1,message:2,type:3,showCancel:4,askForData:5,dataValue:0,callback:6})}}function Ja(e){let n,t;const r=[e[0]];let i={};for(let o=0;o<r.length;o+=1)i=Jc(i,r[o]);return n=new ap({props:i}),n.$on("close",e[1]),{c(){se(n.$$.fragment)},m(o,s){ie(n,o,s),t=!0},p(o,s){const l=s&1?bf(r,[vf(o[0])]):{};n.$set(l)},i(o){t||(H(n.$$.fragment,o),t=!0)},o(o){j(n.$$.fragment,o),t=!1},d(o){oe(n,o)}}}function up(e){let n,t,r=e[0]&&Ja(e);return{c(){r&&r.c(),n=Nn()},m(i,o){r&&r.m(i,o),F(i,n,o),t=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&H(r,1)):(r=Ja(i),r.c(),H(r,1),r.m(n.parentNode,n)):r&&(rt(),j(r,1,1,()=>{r=null}),it())},i(i){t||(H(r),t=!0)},o(i){j(r),t=!1},d(i){r&&r.d(i),i&&V(n)}}}function cp(e,n,t){let r;y(e,Rl,a=>t(2,r=a));let i,o=[];const s=Ue.subscribe(a=>{!a||(a.message.includes("Lost Connection to")||a.message.includes("Unable to connect to"))&&((i==null?void 0:i.message)===a.message||o.find(u=>u.message===a.message))||(o.unshift(a),i||l())});function l(){t(0,i=o.pop()),R(Rl,r=!!i,r)}return Ku(()=>s==null?void 0:s.unsubscribe()),[i,l]}class fp extends Ut{constructor(n){super(),Bt(this,n,cp,up,Et,{})}}function Co(e){return window.location.port==="4173"||window.location.port==="5174"?"http://localhost:"+55e3+e:e}function Qa(e){let n,t,r,i,o;return{c(){n=g("input"),h(n,"type","checkbox"),h(n,"class","multi-line-checkbox svelte-i377rk"),h(n,"id",t="multi-line-checkbox-"+e[0].id),h(n,"aria-label",r=e[0].id)},m(s,l){F(s,n,l),i||(o=P(n,"change",e[18]),i=!0)},p(s,l){l&1&&t!==(t="multi-line-checkbox-"+s[0].id)&&h(n,"id",t),l&1&&r!==(r=s[0].id)&&h(n,"aria-label",r)},d(s){s&&V(n),i=!1,o()}}}function eu(e){let n,t,r,i,o=e[0].translation+"",s,l,a,u;return{c(){n=g("br"),t=w(),r=g("p"),i=g("i"),s=ct(o),h(r,"style",l="color: #888; padding-bottom: 16px; padding-top: 16px; width: 100%; "+(e[0].blurTranslation?"filter: blur(8px); transition: filter 0.2s;":"")),h(r,"class","svelte-i377rk"),q(r,"blur-translation",e[0].blurTranslation)},m(c,p){F(c,n,p),F(c,t,p),F(c,r,p),f(r,i),f(i,s),a||(u=[P(r,"mouseenter",function(){wi(e[0].blurTranslation?iu:void 0)&&(e[0].blurTranslation?iu:void 0).apply(this,arguments)}),P(r,"mouseleave",function(){wi(e[0].blurTranslation?ou:void 0)&&(e[0].blurTranslation?ou:void 0).apply(this,arguments)})],a=!0)},p(c,p){e=c,p&1&&o!==(o=e[0].translation+"")&&At(s,o),p&1&&l!==(l="color: #888; padding-bottom: 16px; padding-top: 16px; width: 100%; "+(e[0].blurTranslation?"filter: blur(8px); transition: filter 0.2s;":""))&&h(r,"style",l),p&1&&q(r,"blur-translation",e[0].blurTranslation)},d(c){c&&V(n),c&&V(t),c&&V(r),a=!1,Lt(u)}}}function tu(e){let n,t,r,i,o,s,l,a;return{c(){n=g("div"),t=g("button"),t.textContent="📷",r=w(),i=g("button"),i.textContent="🔊",o=w(),s=g("button"),s.textContent="🌐",h(t,"title","Screenshot"),be(t,"background-color","#333"),be(t,"color","#fff"),be(t,"border","1px solid #555"),be(t,"padding","6px 10px"),be(t,"font-size","10px"),be(t,"border-radius","4px"),be(t,"cursor","pointer"),be(t,"transition","background-color 0.3s"),h(t,"tabindex","-1"),h(t,"class","svelte-i377rk"),h(i,"title","Audio"),be(i,"background-color","#333"),be(i,"color","#fff"),be(i,"border","1px solid #555"),be(i,"padding","6px 10px"),be(i,"font-size","10px"),be(i,"border-radius","4px"),be(i,"cursor","pointer"),be(i,"transition","background-color 0.3s"),h(i,"tabindex","-1"),h(i,"class","svelte-i377rk"),h(s,"title","Translate"),be(s,"background-color","#333"),be(s,"color","#fff"),be(s,"border","1px solid #555"),be(s,"padding","6px 10px"),be(s,"font-size","10px"),be(s,"border-radius","4px"),be(s,"cursor","pointer"),be(s,"transition","background-color 0.3s"),h(s,"tabindex","-1"),h(s,"class","svelte-i377rk"),h(n,"class","textline-buttons unselectable svelte-i377rk")},m(u,c){F(u,n,c),f(n,t),f(n,r),f(n,i),f(n,o),f(n,s),l||(a=[P(t,"click",e[20]),P(i,"click",e[21]),P(s,"click",e[22])],l=!0)},p:Ie,d(u){u&&V(n),l=!1,Lt(a)}}}function nu(e){let n,t=e[7]&&e[7].includes(e[0].id),r,i,o=e[0].text+"",s,l,a,u,c=e[7]&&e[7].includes(e[0].id),p,b,m=t&&Qa(e),k=e[0].translation&&eu(e),S=c&&tu(e);return{c(){n=g("div"),m&&m.c(),r=w(),i=g("p"),s=ct(o),l=w(),k&&k.c(),u=w(),S&&S.c(),h(i,"class","my-2 cursor-pointer border-2 svelte-i377rk"),h(i,"contenteditable",e[4]),q(i,"py-4",!e[5]),q(i,"px-2",!e[5]),q(i,"py-2",e[5]),q(i,"px-4",e[5]),q(i,"border-transparent",!e[3]),q(i,"cursor-text",e[4]),q(i,"border-primary",e[3]),q(i,"border-accent-focus",e[4]),q(i,"whitespace-pre-wrap",e[8]),h(n,"class","textline2 svelte-i377rk")},m(I,A){F(I,n,A),m&&m.m(n,null),f(n,r),f(n,i),f(i,s),f(i,l),k&&k.m(i,null),e[19](i),f(n,u),S&&S.m(n,null),p||(b=[P(i,"dblclick",e[10]),P(i,"keyup",jt)],p=!0)},p(I,A){e=I,A&129&&(t=e[7]&&e[7].includes(e[0].id)),t?m?m.p(e,A):(m=Qa(e),m.c(),m.m(n,r)):m&&(m.d(1),m=null),A&1&&o!==(o=e[0].text+"")&&At(s,o),e[0].translation?k?k.p(e,A):(k=eu(e),k.c(),k.m(i,null)):k&&(k.d(1),k=null),A&16&&h(i,"contenteditable",e[4]),A&32&&q(i,"py-4",!e[5]),A&32&&q(i,"px-2",!e[5]),A&32&&q(i,"py-2",e[5]),A&32&&q(i,"px-4",e[5]),A&8&&q(i,"border-transparent",!e[3]),A&16&&q(i,"cursor-text",e[4]),A&8&&q(i,"border-primary",e[3]),A&16&&q(i,"border-accent-focus",e[4]),A&256&&q(i,"whitespace-pre-wrap",e[8]),A&129&&(c=e[7]&&e[7].includes(e[0].id)),c?S?S.p(e,A):(S=tu(e),S.c(),S.m(n,null)):S&&(S.d(1),S=null)},i(I){a||Rr(()=>{a=Zu(i,Ec,{x:e[5]?100:-100,duration:e[6]?250:0}),a.start()})},o:Ie,d(I){I&&V(n),m&&m.d(),k&&k.d(),e[19](null),S&&S.d(),p=!1,Lt(b)}}}function ru(e){let n,t,r,i,o,s=e[9].get(e[0].id)+"",l,a;return r=new _e({props:{class:e[1]?"":"mr-2",path:Rf}}),{c(){n=g("div"),t=g("div"),se(r.$$.fragment),i=w(),o=g("span"),l=ct(s),q(o,"mt-2",e[1]),h(t,"class","flex items-center"),h(n,"class","flex justify-center text-xs my-2 py-2 border-primary border-dashed milestone"),q(n,"border-x-2",e[1]),q(n,"border-y-2",!e[1]),q(n,"py-4",!e[5]),q(n,"px-2",!e[5]),q(n,"py-2",e[5]),q(n,"px-4",e[5])},m(u,c){F(u,n,c),f(n,t),ie(r,t,null),f(t,i),f(t,o),f(o,l),a=!0},p(u,c){const p={};c&2&&(p.class=u[1]?"":"mr-2"),r.$set(p),(!a||c&513)&&s!==(s=u[9].get(u[0].id)+"")&&At(l,s),(!a||c&2)&&q(o,"mt-2",u[1]),(!a||c&2)&&q(n,"border-x-2",u[1]),(!a||c&2)&&q(n,"border-y-2",!u[1]),(!a||c&32)&&q(n,"py-4",!u[5]),(!a||c&32)&&q(n,"px-2",!u[5]),(!a||c&32)&&q(n,"py-2",u[5]),(!a||c&32)&&q(n,"px-4",u[5])},i(u){a||(H(r.$$.fragment,u),a=!0)},o(u){j(r.$$.fragment,u),a=!1},d(u){u&&V(n),oe(r)}}}function hp(e){let n=e[0].text,t,r,i,o=e[9].has(e[0].id),s,l,a=nu(e),u=o&&ru(e);return{c(){a.c(),t=w(),r=new Yu(!1),i=w(),u&&u.c(),s=Nn(),r.a=i},m(c,p){a.m(c,p),F(c,t,p),r.m(Ac,c,p),F(c,i,p),u&&u.m(c,p),F(c,s,p),l=!0},p(c,[p]){p&1&&Et(n,n=c[0].text)?(rt(),j(a,1,1,Ie),it(),a=nu(c),a.c(),H(a,1),a.m(t.parentNode,t)):a.p(c,p),p&513&&(o=c[9].has(c[0].id)),o?u?(u.p(c,p),p&513&&H(u,1)):(u=ru(c),u.c(),H(u,1),u.m(s.parentNode,s)):u&&(rt(),j(u,1,1,()=>{u=null}),it())},i(c){l||(H(a),H(u),l=!0)},o(c){j(a),j(u),l=!1},d(c){a.d(c),c&&V(t),c&&r.d(),c&&V(i),u&&u.d(c),c&&V(s)}}}const iu=function(){this.style.filter="blur(0px)",this.style.transition="filter 0.3s"},ou=function(){this.style.filter="blur(8px)"};function pp(e,n,t){let r,i,o,s,l,a,u,c,p,b;y(e,Yi,T=>t(6,i=T)),y(e,jr,T=>t(24,o=T)),y(e,et,T=>t(25,s=T)),y(e,Fl,T=>t(26,l=T)),y(e,Vl,T=>t(27,a=T)),y(e,Ll,T=>t(7,u=T)),y(e,Wr,T=>t(1,c=T)),y(e,Vi,T=>t(8,p=T)),y(e,Ur,T=>t(9,b=T));let{line:m}=n,{index:k}=n,{isLast:S}=n,{pipWindow:I=void 0}=n;function A(){t(3,X=!1)}function $(T){return X||T.intersectsNode(D)?m.id:void 0}const x=zr();let D,J="",X=!1,K=!1;Yl(()=>{S&&(So(I||window,D.parentElement.parentElement,o,r,i?"smooth":"auto"),u&&u.includes(m.id)&&a&&U(m.id,"TL",l))}),Ku(()=>{document.removeEventListener("click",E,!1),x("edit",{inEdit:!1})});function B(T){var ee;I||((ee=window.getSelection())==null||ee.removeAllRanges(),T.ctrlKey||T.metaKey?X?(t(3,X=!1),x("deselected",m.id)):(t(3,X=!0),x("selected",m.id)):(J=D.innerText,t(4,K=!0),x("edit",{inEdit:!0}),document.addEventListener("click",E,!1),go().then(()=>{D.focus()})))}function E(T){const ee=T.target;D.contains(ee)||(t(4,K=!1),document.removeEventListener("click",E,!1),x("edit",{inEdit:!1,data:{originalText:J,newText:D.innerText,lineIndex:k,line:m}}))}async function W(T){try{const ee=await fetch(Co("/update_checkbox"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:T})});if(!ee.ok)throw new Error(`HTTP error! Status: ${ee.status}`)}catch(ee){console.error("Error updating checkbox:",ee)}}function U(T,ee,ce=!1){console.log(T);let Ye={TL:"/translate-line",Screenshot:"/get-screenshot",Audio:"/play-audio"}[ee]??"";fetch(Co(Ye),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:T,text:m.text})}).then(Se=>{if(!Se.ok)throw new Error(`HTTP error! Status: ${Se.status}`);return Se.json()}).then(Se=>{ee==="TL"&&(t(0,m.translation=Se.TL,m),ce?t(0,m.blurTranslation=!0,m):t(0,m.blurTranslation=!1,m),R(et,s[m.index]=m,s),So(I||window,D.parentElement.parentElement,o,r,i?"smooth":"auto")),console.log(`${ee} action completed for event ID: ${T}`,Se)}).catch(Se=>{console.error(`Error performing ${ee} action for event ID: ${T}`,Se)})}const Z=()=>W(m.id);function ve(T){mt[T?"unshift":"push"](()=>{D=T,t(2,D)})}const re=()=>U(m.id,"Screenshot"),z=()=>U(m.id,"Audio"),M=()=>U(m.id,"TL");return e.$$set=T=>{"line"in T&&t(0,m=T.line),"index"in T&&t(13,k=T.index),"isLast"in T&&t(14,S=T.isLast),"pipWindow"in T&&t(15,I=T.pipWindow)},e.$$.update=()=>{e.$$.dirty&32770&&t(5,r=!I&&c)},[m,c,D,X,K,r,i,u,p,b,B,W,U,k,S,I,A,$,Z,ve,re,z,M]}class Tc extends Ut{constructor(n){super(),Bt(this,n,pp,hp,Et,{line:0,index:13,isLast:14,pipWindow:15,deselect:16,getIdIfSelected:17})}get deselect(){return this.$$.ctx[16]}get getIdIfSelected(){return this.$$.ctx[17]}}function dp(e){let n,t,r,i,o,s,l,a;return r=new _e({props:{path:Qu}}),{c(){n=g("div"),t=g("div"),se(r.$$.fragment),i=w(),o=g("textarea"),h(t,"class","flex cursor-pointer items-end md:items-center"),h(n,"class","flex justify-end p-4"),h(o,"class","flex-1 overflow-auto ml-10 mr-2 mb-4 p-1 pb-2"),be(o,"resize","none"),o.value=e[0]},m(u,c){F(u,n,c),f(n,t),ie(r,t,null),F(u,i,c),F(u,o,c),s=!0,l||(a=[P(t,"click",e[3]),P(t,"keyup",jt),P(o,"blur",e[2])],l=!0)},p(u,[c]){(!s||c&1)&&(o.value=u[0])},i(u){s||(H(r.$$.fragment,u),s=!0)},o(u){j(r.$$.fragment,u),s=!1},d(u){u&&V(n),oe(r),u&&V(i),u&&V(o),l=!1,Lt(a)}}}function mp(e,n,t){let r,i;y(e,ko,l=>t(0,r=l)),y(e,Nl,l=>t(1,i=l));function o(l){R(ko,r=l.target.value,r)}return[r,i,o,()=>R(Nl,i=!1,i)]}class gp extends Ut{constructor(n){super(),Bt(this,n,mp,dp,Et,{})}}const{Map:Dc}=Hs;function lu(e,n,t){const r=e.slice();return r[62]=n[t],r}function su(e,n,t){const r=e.slice();return r[62]=n[t],r}function bp(e){let n,t,r,i,o,s=[],l=new Dc,a,u,c,p,b,m,k,S,I,A,$,x,D,J,X,K,B,E,W,U,Z,ve,re,z=e[2].length?e[2]:e[4];const M=T=>T[62].name;for(let T=0;T<z.length;T+=1){let ee=lu(e,z,T),ce=M(ee);l.set(ce,s[T]=au(ce,ee))}return c=new _e({props:{path:Cf}}),S=new _e({props:{path:Ss}}),D=new _e({props:{path:If}}),E=new _e({props:{path:so}}),{c(){n=g("details"),t=g("summary"),t.textContent="Presets",r=w(),i=g("div"),o=g("select");for(let T=0;T<s.length;T+=1)s[T].c();a=w(),u=g("div"),se(c.$$.fragment),p=w(),b=g("span"),b.textContent="Save",m=w(),k=g("div"),se(S.$$.fragment),I=w(),A=g("span"),A.textContent="Export/Import",$=w(),x=g("div"),se(D.$$.fragment),J=w(),X=g("span"),X.textContent="Reload",K=w(),B=g("div"),se(E.$$.fragment),W=w(),U=g("span"),U.textContent="Delete",h(o,"class","select flex-1 max-w-md"),h(b,"class","label-text"),h(u,"role","button"),h(u,"class","flex flex-col items-center hover:text-primary ml-3"),h(A,"class","label-text"),h(k,"role","button"),h(k,"class","flex flex-col items-center hover:text-primary ml-3"),h(X,"class","label-text"),h(x,"role","button"),h(x,"class","flex flex-col items-center hover:text-primary ml-3"),q(x,"invisible",!e[1]),h(U,"class","label-text"),h(B,"role","button"),h(B,"class","flex flex-col items-center hover:text-primary ml-3"),q(B,"invisible",!e[1]),h(i,"class","flex items-center justify-between mt-2"),h(n,"role","button"),h(n,"class","col-span-4 mb-2")},m(T,ee){F(T,n,ee),f(n,t),f(n,r),f(n,i),f(i,o);for(let ce=0;ce<s.length;ce+=1)s[ce].m(o,null);yi(o,e[1]),f(i,a),f(i,u),ie(c,u,null),f(u,p),f(u,b),f(i,m),f(i,k),ie(S,k,null),f(k,I),f(k,A),f(i,$),f(i,x),ie(D,x,null),f(x,J),f(x,X),f(i,K),f(i,B),ie(E,B,null),f(B,W),f(B,U),Z=!0,ve||(re=[P(o,"change",e[6]),P(u,"click",e[8]),P(u,"keyup",jt),P(k,"click",e[12]),P(k,"keyup",jt),P(x,"click",e[13]),P(x,"keyup",jt),P(B,"click",e[9]),P(B,"keyup",jt)],ve=!0)},p(T,ee){ee[0]&20&&(z=T[2].length?T[2]:T[4],s=Yr(s,ee,M,1,T,z,l,o,Kl,au,null,lu)),(!Z||ee[0]&22)&&yi(o,T[1]),(!Z||ee[0]&2)&&q(x,"invisible",!T[1]),(!Z||ee[0]&2)&&q(B,"invisible",!T[1])},i(T){Z||(H(c.$$.fragment,T),H(S.$$.fragment,T),H(D.$$.fragment,T),H(E.$$.fragment,T),Z=!0)},o(T){j(c.$$.fragment,T),j(S.$$.fragment,T),j(D.$$.fragment,T),j(E.$$.fragment,T),Z=!1},d(T){T&&V(n);for(let ee=0;ee<s.length;ee+=1)s[ee].d();oe(c),oe(S),oe(D),oe(E),ve=!1,Lt(re)}}}function vp(e){let n,t=[],r=new Dc,i,o,s=e[2].length?e[2]:e[4];const l=a=>a[62].name;for(let a=0;a<s.length;a+=1){let u=su(e,s,a),c=l(u);r.set(c,t[a]=uu(c,u))}return{c(){n=g("select");for(let a=0;a<t.length;a+=1)t[a].c();h(n,"class","w-48 hidden sm:block"),q(n,"sm:hidden",!e[3]||e[2].length<2)},m(a,u){F(a,n,u);for(let c=0;c<t.length;c+=1)t[c].m(n,null);yi(n,e[1]),i||(o=P(n,"change",e[6]),i=!0)},p(a,u){u[0]&20&&(s=a[2].length?a[2]:a[4],t=Yr(t,u,l,1,a,s,r,n,Kl,uu,null,su)),u[0]&22&&yi(n,a[1]),u[0]&12&&q(n,"sm:hidden",!a[3]||a[2].length<2)},i:Ie,o:Ie,d(a){a&&V(n);for(let u=0;u<t.length;u+=1)t[u].d();i=!1,o()}}}function au(e,n){let t,r=(n[62].name||"No Presets stored")+"",i,o,s;return{key:e,first:null,c(){t=g("option"),i=ct(r),o=w(),t.__value=s=n[62].name,t.value=t.__value,this.first=t},m(l,a){F(l,t,a),f(t,i),f(t,o)},p(l,a){n=l,a[0]&4&&r!==(r=(n[62].name||"No Presets stored")+"")&&At(i,r),a[0]&4&&s!==(s=n[62].name)&&(t.__value=s,t.value=t.__value)},d(l){l&&V(t)}}}function uu(e,n){let t,r=n[62].name+"",i,o,s;return{key:e,first:null,c(){t=g("option"),i=ct(r),o=w(),t.__value=s=n[62].name,t.value=t.__value,this.first=t},m(l,a){F(l,t,a),f(t,i),f(t,o)},p(l,a){n=l,a[0]&4&&r!==(r=n[62].name+"")&&At(i,r),a[0]&4&&s!==(s=n[62].name)&&(t.__value=s,t.value=t.__value)},d(l){l&&V(t)}}}function _p(e){let n,t,r,i;const o=[vp,bp],s=[];function l(a,u){return a[0]?0:1}return n=l(e),t=s[n]=o[n](e),{c(){t.c(),r=Nn()},m(a,u){s[n].m(a,u),F(a,r,u),i=!0},p(a,u){let c=n;n=l(a),n===c?s[n].p(a,u):(rt(),j(s[c],1,1,()=>{s[c]=null}),it(),t=s[n],t?t.p(a,u):(t=s[n]=o[n](a),t.c()),H(t,1),t.m(r.parentNode,r))},i(a){i||(H(t),i=!0)},o(a){j(t),i=!1},d(a){s[n].d(a),a&&V(r)}}}function wp(e,n,t){let r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$,x,D,J,X,K,B,E,W,U,Z,ve,re,z,M,T,ee,ce,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re,ze,Fe,we,Me,bt,he,ft,We,Ve;y(e,lr,_=>t(1,r=_)),y(e,_n,_=>t(2,i=_)),y(e,Ue,_=>t(14,o=_)),y(e,Li,_=>t(15,s=_)),y(e,Br,_=>t(16,l=_)),y(e,Ys,_=>t(17,a=_)),y(e,zs,_=>t(18,u=_)),y(e,Ur,_=>t(19,c=_)),y(e,Mr,_=>t(20,p=_)),y(e,Xi,_=>t(21,b=_)),y(e,qi,_=>t(22,m=_)),y(e,Gi,_=>t(23,k=_)),y(e,Ki,_=>t(24,S=_)),y(e,Yi,_=>t(25,I=_)),y(e,zi,_=>t(26,A=_)),y(e,Ui,_=>t(27,$=_)),y(e,Bi,_=>t(28,x=_)),y(e,ji,_=>t(29,D=_)),y(e,Wi,_=>t(30,J=_)),y(e,Fi,_=>t(31,X=_)),y(e,Vi,_=>t(32,K=_)),y(e,jr,_=>t(33,B=_)),y(e,Wr,_=>t(34,E=_)),y(e,Ri,_=>t(35,W=_)),y(e,Ni,_=>t(36,U=_)),y(e,Hi,_=>t(37,Z=_)),y(e,Fr,_=>t(38,ve=_)),y(e,$i,_=>t(39,re=_)),y(e,Mi,_=>t(40,z=_)),y(e,Ii,_=>t(41,M=_)),y(e,Oi,_=>t(42,T=_)),y(e,Di,_=>t(43,ee=_)),y(e,Ti,_=>t(44,ce=_)),y(e,Ai,_=>t(45,Ae=_)),y(e,Pi,_=>t(46,Ye=_)),y(e,xi,_=>t(47,Se=_)),y(e,Ei,_=>t(48,Ze=_)),y(e,yo,_=>t(3,Ke=_)),y(e,wo,_=>t(49,Ne=_)),y(e,Ci,_=>t(50,yt=_)),y(e,ar,_=>t(51,gt=_)),y(e,Hr,_=>t(52,Re=_)),y(e,Dr,_=>t(53,ze=_)),y(e,$r,_=>t(54,Fe=_)),y(e,Si,_=>t(55,we=_)),y(e,Ir,_=>t(56,Me=_)),y(e,$n,_=>t(57,bt=_)),y(e,Mn,_=>t(58,he=_)),y(e,_o,_=>t(59,ft=_)),y(e,ln,_=>t(60,We=_)),y(e,Or,_=>t(61,Ve=_));let{isQuickSwitch:ot=!1}=n;function vt(){return{theme$:Ve,replacements$:We,windowTitle$:ft,websocketUrl$:he,secondaryWebsocketUrl$:bt,fontSize$:Me,characterMilestone$:p,onlineFont$:we,preventLastDuplicate$:Fe,maxLines$:ze,maxPipLines$:Re,afkTimer$:gt,adjustTimerOnAfk$:yt,enableExternalClipboardMonitor$:Ne,showPresetQuickSwitch$:Ke,skipResetConfirmations$:s,persistStats$:Ze,persistNotes$:Se,persistLines$:Ye,persistActionHistory$:Ae,enablePaste$:ce,blockCopyOnPage$:ee,allowPasteDuringPause$:T,allowNewLineDuringPause$:M,autoStartTimerDuringPausePaste$:z,autoStartTimerDuringPause$:re,preventGlobalDuplicate$:ve,mergeEqualLineStarts$:Z,filterNonCJKLines:U,flashOnMissedLine$:W,displayVertical$:E,reverseLineOrder$:B,preserveWhitespace$:K,removeAllWhitespace$:X,showTimer$:J,showSpeed$:D,showCharacterCount$:x,showLineCount$:$,blurStats$:A,enableLineAnimation$:I,enableAfkBlur$:S,enableAfkBlurRestart$:k,continuousReconnect$:l,showConnectionErrors$:m,customCSS$:b}}function je(_,de=!0){Or.next(_.settings.theme$??L.theme$),ln.next(_.settings.replacements$??L.replacements$),_o.next(_.settings.windowTitle$??L.windowTitle$),Mn.next(_.settings.websocketUrl$??L.websocketUrl$),$n.next(_.settings.secondaryWebsocketUrl$??""),Ir.next(_.settings.fontSize$??L.fontSize$),Mr.next(_.settings.characterMilestone$??L.characterMilestone$),Si.next(_.settings.onlineFont$??L.onlineFont$),$r.next(_.settings.preventLastDuplicate$??L.preventLastDuplicate$),Dr.next(_.settings.maxLines$??L.maxLines$),Hr.next(_.settings.maxPipLines$??L.maxPipLines$),ar.next(_.settings.afkTimer$??L.afkTimer$),Ci.next(_.settings.adjustTimerOnAfk$??L.adjustTimerOnAfk$),wo.next(_.settings.enableExternalClipboardMonitor$??L.enableExternalClipboardMonitor$),yo.next(_.settings.showPresetQuickSwitch$??L.showPresetQuickSwitch$),Li.next(_.settings.skipResetConfirmations$??L.skipResetConfirmations$),Ei.next(_.settings.persistStats$??L.persistStats$),xi.next(_.settings.persistNotes$??L.persistNotes$),Pi.next(_.settings.persistLines$??L.persistLines$),Ai.next(_.settings.persistActionHistory$??L.persistActionHistory$),Ti.next(_.settings.enablePaste$??L.enablePaste$),Di.next(_.settings.blockCopyOnPage$??L.blockCopyOnPage$),Oi.next(_.settings.allowPasteDuringPause$??L.allowPasteDuringPause$),Ii.next(_.settings.allowNewLineDuringPause$??L.allowNewLineDuringPause$),Mi.next(_.settings.autoStartTimerDuringPausePaste$??L.autoStartTimerDuringPausePaste$),$i.next(_.settings.autoStartTimerDuringPause$??L.autoStartTimerDuringPause$),Fr.next(_.settings.preventGlobalDuplicate$??L.preventGlobalDuplicate$),Hi.next(_.settings.mergeEqualLineStarts$??L.mergeEqualLineStarts$),Ni.next(_.settings.filterNonCJKLines??L.filterNonCJKLines),Ri.next(_.settings.flashOnMissedLine$??L.flashOnMissedLine$),Wr.next(_.settings.displayVertical$??L.displayVertical$),jr.next(_.settings.reverseLineOrder$??L.reverseLineOrder$),Vi.next(_.settings.preserveWhitespace$??L.preserveWhitespace$),Fi.next(_.settings.removeAllWhitespace$??L.removeAllWhitespace$),Wi.next(_.settings.showTimer$??L.showTimer$),ji.next(_.settings.showSpeed$??L.showSpeed$),Bi.next(_.settings.showCharacterCount$??L.showCharacterCount$),Ui.next(_.settings.showLineCount$??L.showLineCount$),zi.next(_.settings.blurStats$??L.blurStats$),Yi.next(_.settings.enableLineAnimation$??L.enableLineAnimation$),Ki.next(_.settings.enableAfkBlur$??L.enableAfkBlur$),Gi.next(_.settings.enableAfkBlurRestart$??L.enableAfkBlurRestart$),Br.next(_.settings.continuousReconnect$??L.continuousReconnect$),qi.next(_.settings.showConnectionErrors$??L.showConnectionErrors$),Xi.next(_.settings.customCSS$??L.customCSS$),de&&R(lr,r=_.name,r),p===0&&R(Ur,c=new Map,c),go().then(()=>{Be("layoutChange"),u!==1&&l&&ts.next(),a!==1&&l&&ns.next()})}const ae=[{name:""}],Be=zr();function _t(_){const de=_.target;ke(de.selectedOptions[0].value)}function ke(_){const de=i.find(Ot=>Ot.name===_);de&&je(de)}async function ye(){const{canceled:_,data:de}=await new Promise(lt=>{R(Ue,o={icon:tn,askForData:"text",dataValue:r||"Preset Name",message:"",callback:lt},o)});if(_||!de)return;const Ot=i.findIndex(lt=>lt.name===de),Te={name:de,settings:vt()};Ot>-1?R(_n,i[Ot]=Te,i):R(_n,i=[...i,Te],i),R(lr,r=de,r)}async function kt(){if(!s){const{canceled:_}=await new Promise(de=>{R(Ue,o={icon:tn,message:"Preset will be deleted",callback:de},o)});if(_)return}R(_n,i=i.filter(_=>_.name!==r),i),R(lr,r="",r)}const Dt=_=>Be("exportImportPreset",_),Ee=()=>ke(r);return e.$$set=_=>{"isQuickSwitch"in _&&t(0,ot=_.isQuickSwitch)},[ot,r,i,Ke,ae,Be,_t,ke,ye,kt,vt,je,Dt,Ee]}class Oc extends Ut{constructor(n){super(),Bt(this,n,wp,_p,Et,{isQuickSwitch:0,getCurrentSettings:10,updateSettingsWithPreset:11},null,[-1,-1,-1])}get getCurrentSettings(){return this.$$.ctx[10]}get updateSettingsWithPreset(){return this.$$.ctx[11]}}function yp(e,n){const t=r=>{!r.defaultPrevented&&!e.contains(r.target)&&n(r)};return document.addEventListener("click",t,!0),{destroy(){document.removeEventListener("click",t,!0)}}}function cu(e,n,t){const r=e.slice();return r[22]=n[t],r}function fu(e){let n,t,r,i,o;return t=new _e({props:{path:xf}}),{c(){n=g("button"),se(t.$$.fragment),h(n,"title","Save"),h(n,"class","hover:text-primary")},m(s,l){F(s,n,l),ie(t,n,null),r=!0,i||(o=P(n,"click",e[10]),i=!0)},p:Ie,i(s){r||(H(t.$$.fragment,s),r=!0)},o(s){j(t.$$.fragment,s),r=!1},d(s){s&&V(n),oe(t),i=!1,o()}}}function hu(e,n){let t,r,i,o=n[22].label+"",s,l,a,u;return{key:e,first:null,c(){t=g("label"),r=g("input"),i=w(),s=ct(o),l=w(),h(r,"type","checkbox"),r.__value=n[22].value,r.value=r.__value,n[18][0].push(r),this.first=t},m(c,p){F(c,t,p),f(t,r),r.checked=~n[0].flags.indexOf(r.__value),f(t,i),f(t,s),f(t,l),a||(u=[P(r,"change",n[17]),P(r,"change",n[9])],a=!0)},p(c,p){n=c,p&1&&(r.checked=~n[0].flags.indexOf(r.__value))},d(c){c&&V(t),n[18][0].splice(n[18][0].indexOf(r),1),a=!1,Lt(u)}}}function kp(e){let n=(e[5]??"")+"",t,r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$=[],x=new Map,D,J,X,K,B=(e[4]||e[3])+"",E,W,U,Z=e[0].pattern&&fu(e);l=new _e({props:{path:Ju}}),c=new _e({props:{path:Pf}});let ve=e[7];const re=z=>z[22].value;for(let z=0;z<ve.length;z+=1){let M=cu(e,ve,z),T=re(M);x.set(T,$[z]=hu(T,M))}return{c(){t=ct(n),r=w(),i=g("div"),Z&&Z.c(),o=w(),s=g("button"),se(l.$$.fragment),a=w(),u=g("button"),se(c.$$.fragment),p=w(),b=g("div"),m=g("input"),k=w(),S=g("input"),I=w(),A=g("div");for(let z=0;z<$.length;z+=1)$[z].c();D=w(),J=g("textarea"),X=w(),K=g("div"),h(s,"title","Cancel"),h(s,"class","ml-2 hover:text-primary"),h(u,"title","Cancel"),h(u,"class","ml-2 hover:text-primary"),h(i,"class","flex justify-end my-2"),h(m,"placeholder","text pattern"),h(m,"class","w-full my-2"),h(S,"placeholder","replacement pattern"),h(S,"class","w-full my-2"),h(A,"class","flex justify-between my-4"),h(J,"name","test-value"),h(J,"placeholder","test value"),h(J,"class","w-full my-4"),h(J,"rows","3"),h(K,"class","whitespace-pre-wrap break-all")},m(z,M){F(z,t,M),F(z,r,M),F(z,i,M),Z&&Z.m(i,null),f(i,o),f(i,s),ie(l,s,null),f(i,a),f(i,u),ie(c,u,null),F(z,p,M),F(z,b,M),f(b,m),wt(m,e[0].pattern),e[15](m),f(b,k),f(b,S),wt(S,e[0].replaces),f(b,I),f(b,A);for(let T=0;T<$.length;T+=1)$[T].m(A,null);f(b,D),f(b,J),wt(J,e[2]),f(b,X),f(b,K),K.innerHTML=B,E=!0,W||(U=[P(s,"click",e[12]),P(u,"click",e[13]),P(m,"input",e[14]),P(m,"input",e[9]),P(S,"input",e[16]),P(S,"input",e[9]),P(J,"input",e[19]),P(J,"input",e[9])],W=!0)},p(z,[M]){(!E||M&32)&&n!==(n=(z[5]??"")+"")&&At(t,n),z[0].pattern?Z?(Z.p(z,M),M&1&&H(Z,1)):(Z=fu(z),Z.c(),H(Z,1),Z.m(i,o)):Z&&(rt(),j(Z,1,1,()=>{Z=null}),it()),M&1&&m.value!==z[0].pattern&&wt(m,z[0].pattern),M&1&&S.value!==z[0].replaces&&wt(S,z[0].replaces),M&641&&(ve=z[7],$=Yr($,M,re,1,z,ve,x,A,Kl,hu,null,cu)),M&4&&wt(J,z[2]),(!E||M&24)&&B!==(B=(z[4]||z[3])+"")&&(K.innerHTML=B)},i(z){E||(H(Z),H(l.$$.fragment,z),H(c.$$.fragment,z),E=!0)},o(z){j(Z),j(l.$$.fragment,z),j(c.$$.fragment,z),E=!1},d(z){z&&V(t),z&&V(r),z&&V(i),Z&&Z.d(),oe(l),oe(c),z&&V(p),z&&V(b),e[15](null);for(let M=0;M<$.length;M+=1)$[M].d();W=!1,Lt(U)}}}function Sp(e,n,t){let r,i;y(e,ln,E=>t(20,r=E));let{currentReplacement:o}=n;const s=zr(),l=new Ji,a=o?JSON.parse(JSON.stringify(o)):{pattern:"",replaces:"",flags:[],enabled:!0},u=[{label:"global",value:"g"},{label:"multiline",value:"m"},{label:"insensitive",value:"i"},{label:"unicode",value:"u"}],c=l.pipe(Us(500),tr(()=>{try{if(t(4,k=""),!a.pattern||!b)return;t(3,m=xc(b,[a]))}catch({message:E}){t(4,k=`Error: ${E}`)}}),rr());y(e,c,E=>t(5,i=E));let p,b="",m="",k="";function S(){p.setCustomValidity(k),l.next()}function I(){if(!o&&r.find(E=>E.pattern===a.pattern))return p.setCustomValidity("This pattern already exists"),p.reportValidity();o?R(ln,r=r.map(E=>E.pattern===o.pattern?a:E),r):R(ln,r=[...r,a],r),s("close")}const A=[[]],$=()=>s("close"),x=()=>window.open("https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#description","_blank");function D(){a.pattern=this.value,t(0,a)}function J(E){mt[E?"unshift":"push"](()=>{p=E,t(1,p)})}function X(){a.replaces=this.value,t(0,a)}function K(){a.flags=sf(A[0],this.__value,this.checked),t(0,a)}function B(){b=this.value,t(2,b)}return e.$$set=E=>{"currentReplacement"in E&&t(11,o=E.currentReplacement)},[a,p,b,m,k,i,s,u,c,S,I,o,$,x,D,J,X,K,A,B]}class Cp extends Ut{constructor(n){super(),Bt(this,n,Sp,kp,Et,{currentReplacement:11})}}function pu(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,r)}return t}function kn(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?pu(Object(t),!0).forEach(function(r){Lp(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pu(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function xl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xl=function(n){return typeof n}:xl=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xl(e)}function Lp(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Sn(){return Sn=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Sn.apply(this,arguments)}function Ep(e,n){if(e==null)return{};var t={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(n.indexOf(i)>=0)&&(t[i]=e[i]);return t}function xp(e,n){if(e==null)return{};var t=Ep(e,n),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}var Pp="1.15.2";function Hn(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Wn=Hn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Po=Hn(/Edge/i),du=Hn(/firefox/i),ao=Hn(/safari/i)&&!Hn(/chrome/i)&&!Hn(/android/i),Ic=Hn(/iP(ad|od|hone)/i),Mc=Hn(/chrome/i)&&Hn(/android/i),$c={capture:!1,passive:!1};function Oe(e,n,t){e.addEventListener(n,t,!Wn&&$c)}function Pe(e,n,t){e.removeEventListener(n,t,!Wn&&$c)}function Wl(e,n){if(n){if(n[0]===">"&&(n=n.substring(1)),e)try{if(e.matches)return e.matches(n);if(e.msMatchesSelector)return e.msMatchesSelector(n);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(n)}catch{return!1}return!1}}function Ap(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function fn(e,n,t,r){if(e){t=t||document;do{if(n!=null&&(n[0]===">"?e.parentNode===t&&Wl(e,n):Wl(e,n))||r&&e===t)return e;if(e===t)break}while(e=Ap(e))}return null}var mu=/\s+/g;function Pt(e,n,t){if(e&&n)if(e.classList)e.classList[t?"add":"remove"](n);else{var r=(" "+e.className+" ").replace(mu," ").replace(" "+n+" "," ");e.className=(r+(t?" "+n:"")).replace(mu," ")}}function fe(e,n,t){var r=e&&e.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),n===void 0?t:t[n];!(n in r)&&n.indexOf("webkit")===-1&&(n="-webkit-"+n),r[n]=t+(typeof t=="string"?"":"px")}}function _i(e,n){var t="";if(typeof e=="string")t=e;else do{var r=fe(e,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!n&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function Hc(e,n,t){if(e){var r=e.getElementsByTagName(n),i=0,o=r.length;if(t)for(;i<o;i++)t(r[i],i);return r}return[]}function yn(){var e=document.scrollingElement;return e||document.documentElement}function ut(e,n,t,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var o,s,l,a,u,c,p;if(e!==window&&e.parentNode&&e!==yn()?(o=e.getBoundingClientRect(),s=o.top,l=o.left,a=o.bottom,u=o.right,c=o.height,p=o.width):(s=0,l=0,a=window.innerHeight,u=window.innerWidth,c=window.innerHeight,p=window.innerWidth),(n||t)&&e!==window&&(i=i||e.parentNode,!Wn))do if(i&&i.getBoundingClientRect&&(fe(i,"transform")!=="none"||t&&fe(i,"position")!=="static")){var b=i.getBoundingClientRect();s-=b.top+parseInt(fe(i,"border-top-width")),l-=b.left+parseInt(fe(i,"border-left-width")),a=s+o.height,u=l+o.width;break}while(i=i.parentNode);if(r&&e!==window){var m=_i(i||e),k=m&&m.a,S=m&&m.d;m&&(s/=S,l/=k,p/=k,c/=S,a=s+c,u=l+p)}return{top:s,left:l,bottom:a,right:u,width:p,height:c}}}function gu(e,n,t){for(var r=sr(e,!0),i=ut(e)[n];r;){var o=ut(r)[t],s=void 0;if(t==="top"||t==="left"?s=i>=o:s=i<=o,!s)return r;if(r===yn())break;r=sr(r,!1)}return!1}function Zi(e,n,t,r){for(var i=0,o=0,s=e.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==ue.ghost&&(r||s[o]!==ue.dragged)&&fn(s[o],t.draggable,e,!1)){if(i===n)return s[o];i++}o++}return null}function Ks(e,n){for(var t=e.lastElementChild;t&&(t===ue.ghost||fe(t,"display")==="none"||n&&!Wl(t,n));)t=t.previousElementSibling;return t||null}function Wt(e,n){var t=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ue.clone&&(!n||Wl(e,n))&&t++;return t}function bu(e){var n=0,t=0,r=yn();if(e)do{var i=_i(e),o=i.a,s=i.d;n+=e.scrollLeft*o,t+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[n,t]}function Tp(e,n){for(var t in e)if(e.hasOwnProperty(t)){for(var r in n)if(n.hasOwnProperty(r)&&n[r]===e[t][r])return Number(t)}return-1}function sr(e,n){if(!e||!e.getBoundingClientRect)return yn();var t=e,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=fe(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return yn();if(r||n)return t;r=!0}}while(t=t.parentNode);return yn()}function Dp(e,n){if(e&&n)for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}function cs(e,n){return Math.round(e.top)===Math.round(n.top)&&Math.round(e.left)===Math.round(n.left)&&Math.round(e.height)===Math.round(n.height)&&Math.round(e.width)===Math.round(n.width)}var uo;function Nc(e,n){return function(){if(!uo){var t=arguments,r=this;t.length===1?e.call(r,t[0]):e.apply(r,t),uo=setTimeout(function(){uo=void 0},n)}}}function Op(){clearTimeout(uo),uo=void 0}function Rc(e,n,t){e.scrollLeft+=n,e.scrollTop+=t}function Vc(e){var n=window.Polymer,t=window.jQuery||window.Zepto;return n&&n.dom?n.dom(e).cloneNode(!0):t?t(e).clone(!0)[0]:e.cloneNode(!0)}function Fc(e,n,t){var r={};return Array.from(e.children).forEach(function(i){var o,s,l,a;if(!(!fn(i,n.draggable,e,!1)||i.animated||i===t)){var u=ut(i);r.left=Math.min((o=r.left)!==null&&o!==void 0?o:1/0,u.left),r.top=Math.min((s=r.top)!==null&&s!==void 0?s:1/0,u.top),r.right=Math.max((l=r.right)!==null&&l!==void 0?l:-1/0,u.right),r.bottom=Math.max((a=r.bottom)!==null&&a!==void 0?a:-1/0,u.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Zt="Sortable"+new Date().getTime();function Ip(){var e=[],n;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(fe(i,"display")==="none"||i===ue.ghost)){e.push({target:i,rect:ut(i)});var o=kn({},e[e.length-1].rect);if(i.thisAnimationDuration){var s=_i(i,!0);s&&(o.top-=s.f,o.left-=s.e)}i.fromRect=o}})}},addAnimationState:function(r){e.push(r)},removeAnimationState:function(r){e.splice(Tp(e,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(n),typeof r=="function"&&r();return}var o=!1,s=0;e.forEach(function(l){var a=0,u=l.target,c=u.fromRect,p=ut(u),b=u.prevFromRect,m=u.prevToRect,k=l.rect,S=_i(u,!0);S&&(p.top-=S.f,p.left-=S.e),u.toRect=p,u.thisAnimationDuration&&cs(b,p)&&!cs(c,p)&&(k.top-p.top)/(k.left-p.left)===(c.top-p.top)/(c.left-p.left)&&(a=$p(k,b,m,i.options)),cs(p,c)||(u.prevFromRect=c,u.prevToRect=p,a||(a=i.options.animation),i.animate(u,k,p,a)),a&&(o=!0,s=Math.max(s,a),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},a),u.thisAnimationDuration=a)}),clearTimeout(n),o?n=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,i,o,s){if(s){fe(r,"transition",""),fe(r,"transform","");var l=_i(this.el),a=l&&l.a,u=l&&l.d,c=(i.left-o.left)/(a||1),p=(i.top-o.top)/(u||1);r.animatingX=!!c,r.animatingY=!!p,fe(r,"transform","translate3d("+c+"px,"+p+"px,0)"),this.forRepaintDummy=Mp(r),fe(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),fe(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){fe(r,"transition",""),fe(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function Mp(e){return e.offsetWidth}function $p(e,n,t,r){return Math.sqrt(Math.pow(n.top-e.top,2)+Math.pow(n.left-e.left,2))/Math.sqrt(Math.pow(n.top-t.top,2)+Math.pow(n.left-t.left,2))*r.animation}var pi=[],fs={initializeByDefault:!0},Ao={mount:function(n){for(var t in fs)fs.hasOwnProperty(t)&&!(t in n)&&(n[t]=fs[t]);pi.forEach(function(r){if(r.pluginName===n.pluginName)throw"Sortable: Cannot mount plugin ".concat(n.pluginName," more than once")}),pi.push(n)},pluginEvent:function(n,t,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var o=n+"Global";pi.forEach(function(s){t[s.pluginName]&&(t[s.pluginName][o]&&t[s.pluginName][o](kn({sortable:t},r)),t.options[s.pluginName]&&t[s.pluginName][n]&&t[s.pluginName][n](kn({sortable:t},r)))})},initializePlugins:function(n,t,r,i){pi.forEach(function(l){var a=l.pluginName;if(!(!n.options[a]&&!l.initializeByDefault)){var u=new l(n,t,n.options);u.sortable=n,u.options=n.options,n[a]=u,Sn(r,u.defaults)}});for(var o in n.options)if(n.options.hasOwnProperty(o)){var s=this.modifyOption(n,o,n.options[o]);typeof s<"u"&&(n.options[o]=s)}},getEventProperties:function(n,t){var r={};return pi.forEach(function(i){typeof i.eventProperties=="function"&&Sn(r,i.eventProperties.call(t[i.pluginName],n))}),r},modifyOption:function(n,t,r){var i;return pi.forEach(function(o){n[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[t]=="function"&&(i=o.optionListeners[t].call(n[o.pluginName],r))}),i}};function Hp(e){var n=e.sortable,t=e.rootEl,r=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,a=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,p=e.newDraggableIndex,b=e.originalEvent,m=e.putSortable,k=e.extraEventProperties;if(n=n||t&&t[Zt],!!n){var S,I=n.options,A="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Wn&&!Po?S=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(S=document.createEvent("Event"),S.initEvent(r,!0,!0)),S.to=s||t,S.from=l||t,S.item=i||t,S.clone=o,S.oldIndex=a,S.newIndex=u,S.oldDraggableIndex=c,S.newDraggableIndex=p,S.originalEvent=b,S.pullMode=m?m.lastPutMode:void 0;var $=kn(kn({},k),Ao.getEventProperties(r,n));for(var x in $)S[x]=$[x];t&&t.dispatchEvent(S),I[A]&&I[A].call(n,S)}}var Np=["evt"],Ft=function(n,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=xp(r,Np);Ao.pluginEvent.bind(ue)(n,t,kn({dragEl:Y,parentEl:Qe,ghostEl:me,rootEl:qe,nextEl:Ar,lastDownEl:Pl,cloneEl:Xe,cloneHidden:ir,dragStarted:ro,putSortable:Ct,activeSortable:ue.active,originalEvent:i,oldIndex:gi,oldDraggableIndex:co,newIndex:qt,newDraggableIndex:er,hideGhostForTarget:Uc,unhideGhostForTarget:zc,cloneNowHidden:function(){ir=!0},cloneNowShown:function(){ir=!1},dispatchSortableEvent:function(l){$t({sortable:t,name:l,originalEvent:i})}},o))};function $t(e){Hp(kn({putSortable:Ct,cloneEl:Xe,targetEl:Y,rootEl:qe,oldIndex:gi,oldDraggableIndex:co,newIndex:qt,newDraggableIndex:er},e))}var Y,Qe,me,qe,Ar,Pl,Xe,ir,gi,qt,co,er,vl,Ct,mi=!1,jl=!1,Bl=[],xr,cn,hs,ps,vu,_u,ro,di,fo,ho=!1,_l=!1,Al,xt,ds=[],Ts=!1,Ul=[],rs=typeof document<"u",wl=Ic,wu=Po||Wn?"cssFloat":"float",Rp=rs&&!Mc&&!Ic&&"draggable"in document.createElement("div"),Wc=function(){if(rs){if(Wn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),jc=function(n,t){var r=fe(n),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=Zi(n,0,t),s=Zi(n,1,t),l=o&&fe(o),a=s&&fe(s),u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ut(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ut(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&l.float&&l.float!=="none"){var p=l.float==="left"?"left":"right";return s&&(a.clear==="both"||a.clear===p)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||u>=i&&r[wu]==="none"||s&&r[wu]==="none"&&u+c>i)?"vertical":"horizontal"},Vp=function(n,t,r){var i=r?n.left:n.top,o=r?n.right:n.bottom,s=r?n.width:n.height,l=r?t.left:t.top,a=r?t.right:t.bottom,u=r?t.width:t.height;return i===l||o===a||i+s/2===l+u/2},Fp=function(n,t){var r;return Bl.some(function(i){var o=i[Zt].options.emptyInsertThreshold;if(!(!o||Ks(i))){var s=ut(i),l=n>=s.left-o&&n<=s.right+o,a=t>=s.top-o&&t<=s.bottom+o;if(l&&a)return r=i}}),r},Bc=function(n){function t(o,s){return function(l,a,u,c){var p=l.options.group.name&&a.options.group.name&&l.options.group.name===a.options.group.name;if(o==null&&(s||p))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return t(o(l,a,u,c),s)(l,a,u,c);var b=(s?l:a).options.group.name;return o===!0||typeof o=="string"&&o===b||o.join&&o.indexOf(b)>-1}}var r={},i=n.group;(!i||xl(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,n.group=r},Uc=function(){!Wc&&me&&fe(me,"display","none")},zc=function(){!Wc&&me&&fe(me,"display","")};rs&&!Mc&&document.addEventListener("click",function(e){if(jl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),jl=!1,!1},!0);var Pr=function(n){if(Y){n=n.touches?n.touches[0]:n;var t=Fp(n.clientX,n.clientY);if(t){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[Zt]._onDragOver(r)}}},Wp=function(n){Y&&Y.parentNode[Zt]._isOutsideThisEl(n.target)};function ue(e,n){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=Sn({},n),e[Zt]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return jc(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,l){s.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ue.supportPointer!==!1&&"PointerEvent"in window&&!ao,emptyInsertThreshold:5};Ao.initializePlugins(this,e,t);for(var r in t)!(r in n)&&(n[r]=t[r]);Bc(n);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=n.forceFallback?!1:Rp,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?Oe(e,"pointerdown",this._onTapStart):(Oe(e,"mousedown",this._onTapStart),Oe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Oe(e,"dragover",this),Oe(e,"dragenter",this)),Bl.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),Sn(this,Ip())}ue.prototype={constructor:ue,_isOutsideThisEl:function(n){!this.el.contains(n)&&n!==this.el&&(di=null)},_getDirection:function(n,t){return typeof this.options.direction=="function"?this.options.direction.call(this,n,t,Y):this.options.direction},_onTapStart:function(n){if(n.cancelable){var t=this,r=this.el,i=this.options,o=i.preventOnFilter,s=n.type,l=n.touches&&n.touches[0]||n.pointerType&&n.pointerType==="touch"&&n,a=(l||n).target,u=n.target.shadowRoot&&(n.path&&n.path[0]||n.composedPath&&n.composedPath()[0])||a,c=i.filter;if(qp(r),!Y&&!(/mousedown|pointerdown/.test(s)&&n.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&ao&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=fn(a,i.draggable,r,!1),!(a&&a.animated)&&Pl!==a)){if(gi=Wt(a),co=Wt(a,i.draggable),typeof c=="function"){if(c.call(this,n,a,this)){$t({sortable:t,rootEl:u,name:"filter",targetEl:a,toEl:r,fromEl:r}),Ft("filter",t,{evt:n}),o&&n.cancelable&&n.preventDefault();return}}else if(c&&(c=c.split(",").some(function(p){if(p=fn(u,p.trim(),r,!1),p)return $t({sortable:t,rootEl:p,name:"filter",targetEl:a,fromEl:r,toEl:r}),Ft("filter",t,{evt:n}),!0}),c)){o&&n.cancelable&&n.preventDefault();return}i.handle&&!fn(u,i.handle,r,!1)||this._prepareDragStart(n,l,a)}}},_prepareDragStart:function(n,t,r){var i=this,o=i.el,s=i.options,l=o.ownerDocument,a;if(r&&!Y&&r.parentNode===o){var u=ut(r);if(qe=o,Y=r,Qe=Y.parentNode,Ar=Y.nextSibling,Pl=r,vl=s.group,ue.dragged=Y,xr={target:Y,clientX:(t||n).clientX,clientY:(t||n).clientY},vu=xr.clientX-u.left,_u=xr.clientY-u.top,this._lastX=(t||n).clientX,this._lastY=(t||n).clientY,Y.style["will-change"]="all",a=function(){if(Ft("delayEnded",i,{evt:n}),ue.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!du&&i.nativeDraggable&&(Y.draggable=!0),i._triggerDragStart(n,t),$t({sortable:i,name:"choose",originalEvent:n}),Pt(Y,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){Hc(Y,c.trim(),ms)}),Oe(l,"dragover",Pr),Oe(l,"mousemove",Pr),Oe(l,"touchmove",Pr),Oe(l,"mouseup",i._onDrop),Oe(l,"touchend",i._onDrop),Oe(l,"touchcancel",i._onDrop),du&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Y.draggable=!0),Ft("delayStart",this,{evt:n}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Po||Wn))){if(ue.eventCanceled){this._onDrop();return}Oe(l,"mouseup",i._disableDelayedDrag),Oe(l,"touchend",i._disableDelayedDrag),Oe(l,"touchcancel",i._disableDelayedDrag),Oe(l,"mousemove",i._delayedDragTouchMoveHandler),Oe(l,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Oe(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,s.delay)}else a()}},_delayedDragTouchMoveHandler:function(n){var t=n.touches?n.touches[0]:n;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Y&&ms(Y),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var n=this.el.ownerDocument;Pe(n,"mouseup",this._disableDelayedDrag),Pe(n,"touchend",this._disableDelayedDrag),Pe(n,"touchcancel",this._disableDelayedDrag),Pe(n,"mousemove",this._delayedDragTouchMoveHandler),Pe(n,"touchmove",this._delayedDragTouchMoveHandler),Pe(n,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(n,t){t=t||n.pointerType=="touch"&&n,!this.nativeDraggable||t?this.options.supportPointer?Oe(document,"pointermove",this._onTouchMove):t?Oe(document,"touchmove",this._onTouchMove):Oe(document,"mousemove",this._onTouchMove):(Oe(Y,"dragend",this),Oe(qe,"dragstart",this._onDragStart));try{document.selection?Tl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(n,t){if(mi=!1,qe&&Y){Ft("dragStarted",this,{evt:t}),this.nativeDraggable&&Oe(document,"dragover",Wp);var r=this.options;!n&&Pt(Y,r.dragClass,!1),Pt(Y,r.ghostClass,!0),ue.active=this,n&&this._appendGhost(),$t({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(cn){this._lastX=cn.clientX,this._lastY=cn.clientY,Uc();for(var n=document.elementFromPoint(cn.clientX,cn.clientY),t=n;n&&n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(cn.clientX,cn.clientY),n!==t);)t=n;if(Y.parentNode[Zt]._isOutsideThisEl(n),t)do{if(t[Zt]){var r=void 0;if(r=t[Zt]._onDragOver({clientX:cn.clientX,clientY:cn.clientY,target:n,rootEl:t}),r&&!this.options.dragoverBubble)break}n=t}while(t=t.parentNode);zc()}},_onTouchMove:function(n){if(xr){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,o=n.touches?n.touches[0]:n,s=me&&_i(me,!0),l=me&&s&&s.a,a=me&&s&&s.d,u=wl&&xt&&bu(xt),c=(o.clientX-xr.clientX+i.x)/(l||1)+(u?u[0]-ds[0]:0)/(l||1),p=(o.clientY-xr.clientY+i.y)/(a||1)+(u?u[1]-ds[1]:0)/(a||1);if(!ue.active&&!mi){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(n,!0)}if(me){s?(s.e+=c-(hs||0),s.f+=p-(ps||0)):s={a:1,b:0,c:0,d:1,e:c,f:p};var b="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");fe(me,"webkitTransform",b),fe(me,"mozTransform",b),fe(me,"msTransform",b),fe(me,"transform",b),hs=c,ps=p,cn=o}n.cancelable&&n.preventDefault()}},_appendGhost:function(){if(!me){var n=this.options.fallbackOnBody?document.body:qe,t=ut(Y,!0,wl,!0,n),r=this.options;if(wl){for(xt=n;fe(xt,"position")==="static"&&fe(xt,"transform")==="none"&&xt!==document;)xt=xt.parentNode;xt!==document.body&&xt!==document.documentElement?(xt===document&&(xt=yn()),t.top+=xt.scrollTop,t.left+=xt.scrollLeft):xt=yn(),ds=bu(xt)}me=Y.cloneNode(!0),Pt(me,r.ghostClass,!1),Pt(me,r.fallbackClass,!0),Pt(me,r.dragClass,!0),fe(me,"transition",""),fe(me,"transform",""),fe(me,"box-sizing","border-box"),fe(me,"margin",0),fe(me,"top",t.top),fe(me,"left",t.left),fe(me,"width",t.width),fe(me,"height",t.height),fe(me,"opacity","0.8"),fe(me,"position",wl?"absolute":"fixed"),fe(me,"zIndex","100000"),fe(me,"pointerEvents","none"),ue.ghost=me,n.appendChild(me),fe(me,"transform-origin",vu/parseInt(me.style.width)*100+"% "+_u/parseInt(me.style.height)*100+"%")}},_onDragStart:function(n,t){var r=this,i=n.dataTransfer,o=r.options;if(Ft("dragStart",this,{evt:n}),ue.eventCanceled){this._onDrop();return}Ft("setupClone",this),ue.eventCanceled||(Xe=Vc(Y),Xe.removeAttribute("id"),Xe.draggable=!1,Xe.style["will-change"]="",this._hideClone(),Pt(Xe,this.options.chosenClass,!1),ue.clone=Xe),r.cloneId=Tl(function(){Ft("clone",r),!ue.eventCanceled&&(r.options.removeCloneOnHide||qe.insertBefore(Xe,Y),r._hideClone(),$t({sortable:r,name:"clone"}))}),!t&&Pt(Y,o.dragClass,!0),t?(jl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(Pe(document,"mouseup",r._onDrop),Pe(document,"touchend",r._onDrop),Pe(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(r,i,Y)),Oe(document,"drop",r),fe(Y,"transform","translateZ(0)")),mi=!0,r._dragStartId=Tl(r._dragStarted.bind(r,t,n)),Oe(document,"selectstart",r),ro=!0,ao&&fe(document.body,"user-select","none")},_onDragOver:function(n){var t=this.el,r=n.target,i,o,s,l=this.options,a=l.group,u=ue.active,c=vl===a,p=l.sort,b=Ct||u,m,k=this,S=!1;if(Ts)return;function I(ee,ce){Ft(ee,k,kn({evt:n,isOwner:c,axis:m?"vertical":"horizontal",revert:s,dragRect:i,targetRect:o,canSort:p,fromSortable:b,target:r,completed:$,onMove:function(Ye,Se){return yl(qe,t,Y,i,Ye,ut(Ye),n,Se)},changed:x},ce))}function A(){I("dragOverAnimationCapture"),k.captureAnimationState(),k!==b&&b.captureAnimationState()}function $(ee){return I("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(k),k!==b&&(Pt(Y,Ct?Ct.options.ghostClass:u.options.ghostClass,!1),Pt(Y,l.ghostClass,!0)),Ct!==k&&k!==ue.active?Ct=k:k===ue.active&&Ct&&(Ct=null),b===k&&(k._ignoreWhileAnimating=r),k.animateAll(function(){I("dragOverAnimationComplete"),k._ignoreWhileAnimating=null}),k!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(r===Y&&!Y.animated||r===t&&!r.animated)&&(di=null),!l.dragoverBubble&&!n.rootEl&&r!==document&&(Y.parentNode[Zt]._isOutsideThisEl(n.target),!ee&&Pr(n)),!l.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),S=!0}function x(){qt=Wt(Y),er=Wt(Y,l.draggable),$t({sortable:k,name:"change",toEl:t,newIndex:qt,newDraggableIndex:er,originalEvent:n})}if(n.preventDefault!==void 0&&n.cancelable&&n.preventDefault(),r=fn(r,l.draggable,t,!0),I("dragOver"),ue.eventCanceled)return S;if(Y.contains(n.target)||r.animated&&r.animatingX&&r.animatingY||k._ignoreWhileAnimating===r)return $(!1);if(jl=!1,u&&!l.disabled&&(c?p||(s=Qe!==qe):Ct===this||(this.lastPutMode=vl.checkPull(this,u,Y,n))&&a.checkPut(this,u,Y,n))){if(m=this._getDirection(n,r)==="vertical",i=ut(Y),I("dragOverValid"),ue.eventCanceled)return S;if(s)return Qe=qe,A(),this._hideClone(),I("revert"),ue.eventCanceled||(Ar?qe.insertBefore(Y,Ar):qe.appendChild(Y)),$(!0);var D=Ks(t,l.draggable);if(!D||zp(n,m,this)&&!D.animated){if(D===Y)return $(!1);if(D&&t===n.target&&(r=D),r&&(o=ut(r)),yl(qe,t,Y,i,r,o,n,!!r)!==!1)return A(),D&&D.nextSibling?t.insertBefore(Y,D.nextSibling):t.appendChild(Y),Qe=t,x(),$(!0)}else if(D&&Up(n,m,this)){var J=Zi(t,0,l,!0);if(J===Y)return $(!1);if(r=J,o=ut(r),yl(qe,t,Y,i,r,o,n,!1)!==!1)return A(),t.insertBefore(Y,J),Qe=t,x(),$(!0)}else if(r.parentNode===t){o=ut(r);var X=0,K,B=Y.parentNode!==t,E=!Vp(Y.animated&&Y.toRect||i,r.animated&&r.toRect||o,m),W=m?"top":"left",U=gu(r,"top","top")||gu(Y,"top","top"),Z=U?U.scrollTop:void 0;di!==r&&(K=o[W],ho=!1,_l=!E&&l.invertSwap||B),X=Yp(n,r,o,m,E?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,_l,di===r);var ve;if(X!==0){var re=Wt(Y);do re-=X,ve=Qe.children[re];while(ve&&(fe(ve,"display")==="none"||ve===me))}if(X===0||ve===r)return $(!1);di=r,fo=X;var z=r.nextElementSibling,M=!1;M=X===1;var T=yl(qe,t,Y,i,r,o,n,M);if(T!==!1)return(T===1||T===-1)&&(M=T===1),Ts=!0,setTimeout(Bp,30),A(),M&&!z?t.appendChild(Y):r.parentNode.insertBefore(Y,M?z:r),U&&Rc(U,0,Z-U.scrollTop),Qe=Y.parentNode,K!==void 0&&!_l&&(Al=Math.abs(K-ut(r)[W])),x(),$(!0)}if(t.contains(Y))return $(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Pe(document,"mousemove",this._onTouchMove),Pe(document,"touchmove",this._onTouchMove),Pe(document,"pointermove",this._onTouchMove),Pe(document,"dragover",Pr),Pe(document,"mousemove",Pr),Pe(document,"touchmove",Pr)},_offUpEvents:function(){var n=this.el.ownerDocument;Pe(n,"mouseup",this._onDrop),Pe(n,"touchend",this._onDrop),Pe(n,"pointerup",this._onDrop),Pe(n,"touchcancel",this._onDrop),Pe(document,"selectstart",this)},_onDrop:function(n){var t=this.el,r=this.options;if(qt=Wt(Y),er=Wt(Y,r.draggable),Ft("drop",this,{evt:n}),Qe=Y&&Y.parentNode,qt=Wt(Y),er=Wt(Y,r.draggable),ue.eventCanceled){this._nulling();return}mi=!1,_l=!1,ho=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ds(this.cloneId),Ds(this._dragStartId),this.nativeDraggable&&(Pe(document,"drop",this),Pe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ao&&fe(document.body,"user-select",""),fe(Y,"transform",""),n&&(ro&&(n.cancelable&&n.preventDefault(),!r.dropBubble&&n.stopPropagation()),me&&me.parentNode&&me.parentNode.removeChild(me),(qe===Qe||Ct&&Ct.lastPutMode!=="clone")&&Xe&&Xe.parentNode&&Xe.parentNode.removeChild(Xe),Y&&(this.nativeDraggable&&Pe(Y,"dragend",this),ms(Y),Y.style["will-change"]="",ro&&!mi&&Pt(Y,Ct?Ct.options.ghostClass:this.options.ghostClass,!1),Pt(Y,this.options.chosenClass,!1),$t({sortable:this,name:"unchoose",toEl:Qe,newIndex:null,newDraggableIndex:null,originalEvent:n}),qe!==Qe?(qt>=0&&($t({rootEl:Qe,name:"add",toEl:Qe,fromEl:qe,originalEvent:n}),$t({sortable:this,name:"remove",toEl:Qe,originalEvent:n}),$t({rootEl:Qe,name:"sort",toEl:Qe,fromEl:qe,originalEvent:n}),$t({sortable:this,name:"sort",toEl:Qe,originalEvent:n})),Ct&&Ct.save()):qt!==gi&&qt>=0&&($t({sortable:this,name:"update",toEl:Qe,originalEvent:n}),$t({sortable:this,name:"sort",toEl:Qe,originalEvent:n})),ue.active&&((qt==null||qt===-1)&&(qt=gi,er=co),$t({sortable:this,name:"end",toEl:Qe,originalEvent:n}),this.save()))),this._nulling()},_nulling:function(){Ft("nulling",this),qe=Y=Qe=me=Ar=Xe=Pl=ir=xr=cn=ro=qt=er=gi=co=di=fo=Ct=vl=ue.dragged=ue.ghost=ue.clone=ue.active=null,Ul.forEach(function(n){n.checked=!0}),Ul.length=hs=ps=0},handleEvent:function(n){switch(n.type){case"drop":case"dragend":this._onDrop(n);break;case"dragenter":case"dragover":Y&&(this._onDragOver(n),jp(n));break;case"selectstart":n.preventDefault();break}},toArray:function(){for(var n=[],t,r=this.el.children,i=0,o=r.length,s=this.options;i<o;i++)t=r[i],fn(t,s.draggable,this.el,!1)&&n.push(t.getAttribute(s.dataIdAttr)||Gp(t));return n},sort:function(n,t){var r={},i=this.el;this.toArray().forEach(function(o,s){var l=i.children[s];fn(l,this.options.draggable,i,!1)&&(r[o]=l)},this),t&&this.captureAnimationState(),n.forEach(function(o){r[o]&&(i.removeChild(r[o]),i.appendChild(r[o]))}),t&&this.animateAll()},save:function(){var n=this.options.store;n&&n.set&&n.set(this)},closest:function(n,t){return fn(n,t||this.options.draggable,this.el,!1)},option:function(n,t){var r=this.options;if(t===void 0)return r[n];var i=Ao.modifyOption(this,n,t);typeof i<"u"?r[n]=i:r[n]=t,n==="group"&&Bc(r)},destroy:function(){Ft("destroy",this);var n=this.el;n[Zt]=null,Pe(n,"mousedown",this._onTapStart),Pe(n,"touchstart",this._onTapStart),Pe(n,"pointerdown",this._onTapStart),this.nativeDraggable&&(Pe(n,"dragover",this),Pe(n,"dragenter",this)),Array.prototype.forEach.call(n.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Bl.splice(Bl.indexOf(this.el),1),this.el=n=null},_hideClone:function(){if(!ir){if(Ft("hideClone",this),ue.eventCanceled)return;fe(Xe,"display","none"),this.options.removeCloneOnHide&&Xe.parentNode&&Xe.parentNode.removeChild(Xe),ir=!0}},_showClone:function(n){if(n.lastPutMode!=="clone"){this._hideClone();return}if(ir){if(Ft("showClone",this),ue.eventCanceled)return;Y.parentNode==qe&&!this.options.group.revertClone?qe.insertBefore(Xe,Y):Ar?qe.insertBefore(Xe,Ar):qe.appendChild(Xe),this.options.group.revertClone&&this.animate(Y,Xe),fe(Xe,"display",""),ir=!1}}};function jp(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function yl(e,n,t,r,i,o,s,l){var a,u=e[Zt],c=u.options.onMove,p;return window.CustomEvent&&!Wn&&!Po?a=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(a=document.createEvent("Event"),a.initEvent("move",!0,!0)),a.to=n,a.from=e,a.dragged=t,a.draggedRect=r,a.related=i||n,a.relatedRect=o||ut(n),a.willInsertAfter=l,a.originalEvent=s,e.dispatchEvent(a),c&&(p=c.call(u,a,s)),p}function ms(e){e.draggable=!1}function Bp(){Ts=!1}function Up(e,n,t){var r=ut(Zi(t.el,0,t.options,!0)),i=Fc(t.el,t.options,me),o=10;return n?e.clientX<i.left-o||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-o||e.clientY<r.bottom&&e.clientX<r.left}function zp(e,n,t){var r=ut(Ks(t.el,t.options.draggable)),i=Fc(t.el,t.options,me),o=10;return n?e.clientX>i.right+o||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+o||e.clientX>r.right&&e.clientY>r.top}function Yp(e,n,t,r,i,o,s,l){var a=r?e.clientY:e.clientX,u=r?t.height:t.width,c=r?t.top:t.left,p=r?t.bottom:t.right,b=!1;if(!s){if(l&&Al<u*i){if(!ho&&(fo===1?a>c+u*o/2:a<p-u*o/2)&&(ho=!0),ho)b=!0;else if(fo===1?a<c+Al:a>p-Al)return-fo}else if(a>c+u*(1-i)/2&&a<p-u*(1-i)/2)return Kp(n)}return b=b||s,b&&(a<c+u*o/2||a>p-u*o/2)?a>c+u/2?1:-1:0}function Kp(e){return Wt(Y)<Wt(e)?1:-1}function Gp(e){for(var n=e.tagName+e.className+e.src+e.href+e.textContent,t=n.length,r=0;t--;)r+=n.charCodeAt(t);return r.toString(36)}function qp(e){Ul.length=0;for(var n=e.getElementsByTagName("input"),t=n.length;t--;){var r=n[t];r.checked&&Ul.push(r)}}function Tl(e){return setTimeout(e,0)}function Ds(e){return clearTimeout(e)}rs&&Oe(document,"touchmove",function(e){(ue.active||mi)&&e.cancelable&&e.preventDefault()});ue.utils={on:Oe,off:Pe,css:fe,find:Hc,is:function(n,t){return!!fn(n,t,n,!1)},extend:Dp,throttle:Nc,closest:fn,toggleClass:Pt,clone:Vc,index:Wt,nextTick:Tl,cancelNextTick:Ds,detectDirection:jc,getChild:Zi};ue.get=function(e){return e[Zt]};ue.mount=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];n[0].constructor===Array&&(n=n[0]),n.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(ue.utils=kn(kn({},ue.utils),r.utils)),Ao.mount(r)})};ue.create=function(e,n){return new ue(e,n)};ue.version=Pp;var at=[],io,Os,Is=!1,gs,bs,zl,oo;function Xp(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this))}return e.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?Oe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Oe(document,"pointermove",this._handleFallbackAutoScroll):r.touches?Oe(document,"touchmove",this._handleFallbackAutoScroll):Oe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?Pe(document,"dragover",this._handleAutoScroll):(Pe(document,"pointermove",this._handleFallbackAutoScroll),Pe(document,"touchmove",this._handleFallbackAutoScroll),Pe(document,"mousemove",this._handleFallbackAutoScroll)),yu(),Dl(),Op()},nulling:function(){zl=Os=io=Is=oo=gs=bs=null,at.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var i=this,o=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,l=document.elementFromPoint(o,s);if(zl=t,r||this.options.forceAutoScrollFallback||Po||Wn||ao){vs(t,this.options,l,r);var a=sr(l,!0);Is&&(!oo||o!==gs||s!==bs)&&(oo&&yu(),oo=setInterval(function(){var u=sr(document.elementFromPoint(o,s),!0);u!==a&&(a=u,Dl()),vs(t,i.options,u,r)},10),gs=o,bs=s)}else{if(!this.options.bubbleScroll||sr(l,!0)===yn()){Dl();return}vs(t,this.options,sr(l,!1),!1)}}},Sn(e,{pluginName:"scroll",initializeByDefault:!0})}function Dl(){at.forEach(function(e){clearInterval(e.pid)}),at=[]}function yu(){clearInterval(oo)}var vs=Nc(function(e,n,t,r){if(n.scroll){var i=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=n.scrollSensitivity,l=n.scrollSpeed,a=yn(),u=!1,c;Os!==t&&(Os=t,Dl(),io=n.scroll,c=n.scrollFn,io===!0&&(io=sr(t,!0)));var p=0,b=io;do{var m=b,k=ut(m),S=k.top,I=k.bottom,A=k.left,$=k.right,x=k.width,D=k.height,J=void 0,X=void 0,K=m.scrollWidth,B=m.scrollHeight,E=fe(m),W=m.scrollLeft,U=m.scrollTop;m===a?(J=x<K&&(E.overflowX==="auto"||E.overflowX==="scroll"||E.overflowX==="visible"),X=D<B&&(E.overflowY==="auto"||E.overflowY==="scroll"||E.overflowY==="visible")):(J=x<K&&(E.overflowX==="auto"||E.overflowX==="scroll"),X=D<B&&(E.overflowY==="auto"||E.overflowY==="scroll"));var Z=J&&(Math.abs($-i)<=s&&W+x<K)-(Math.abs(A-i)<=s&&!!W),ve=X&&(Math.abs(I-o)<=s&&U+D<B)-(Math.abs(S-o)<=s&&!!U);if(!at[p])for(var re=0;re<=p;re++)at[re]||(at[re]={});(at[p].vx!=Z||at[p].vy!=ve||at[p].el!==m)&&(at[p].el=m,at[p].vx=Z,at[p].vy=ve,clearInterval(at[p].pid),(Z!=0||ve!=0)&&(u=!0,at[p].pid=setInterval(function(){r&&this.layer===0&&ue.active._onTouchMove(zl);var z=at[this.layer].vy?at[this.layer].vy*l:0,M=at[this.layer].vx?at[this.layer].vx*l:0;typeof c=="function"&&c.call(ue.dragged.parentNode[Zt],M,z,e,zl,at[this.layer].el)!=="continue"||Rc(at[this.layer].el,M,z)}.bind({layer:p}),24))),p++}while(n.bubbleScroll&&b!==a&&(b=sr(b,!1)));Is=u}},30),Yc=function(n){var t=n.originalEvent,r=n.putSortable,i=n.dragEl,o=n.activeSortable,s=n.dispatchSortableEvent,l=n.hideGhostForTarget,a=n.unhideGhostForTarget;if(t){var u=r||o;l();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,p=document.elementFromPoint(c.clientX,c.clientY);a(),u&&!u.el.contains(p)&&(s("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Gs(){}Gs.prototype={startIndex:null,dragStart:function(n){var t=n.oldDraggableIndex;this.startIndex=t},onSpill:function(n){var t=n.dragEl,r=n.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=Zi(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:Yc};Sn(Gs,{pluginName:"revertOnSpill"});function qs(){}qs.prototype={onSpill:function(n){var t=n.dragEl,r=n.putSortable,i=r||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:Yc};Sn(qs,{pluginName:"removeOnSpill"});var en;function Zp(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(t){var r=t.dragEl;en=r},dragOverValid:function(t){var r=t.completed,i=t.target,o=t.onMove,s=t.activeSortable,l=t.changed,a=t.cancel;if(s.options.swap){var u=this.sortable.el,c=this.options;if(i&&i!==u){var p=en;o(i)!==!1?(Pt(i,c.swapClass,!0),en=i):en=null,p&&p!==en&&Pt(p,c.swapClass,!1)}l(),r(!0),a()}},drop:function(t){var r=t.activeSortable,i=t.putSortable,o=t.dragEl,s=i||this.sortable,l=this.options;en&&Pt(en,l.swapClass,!1),en&&(l.swap||i&&i.options.swap)&&o!==en&&(s.captureAnimationState(),s!==r&&r.captureAnimationState(),Jp(o,en),s.animateAll(),s!==r&&r.animateAll())},nulling:function(){en=null}},Sn(e,{pluginName:"swap",eventProperties:function(){return{swapItem:en}}})}function Jp(e,n){var t=e.parentNode,r=n.parentNode,i,o;!t||!r||t.isEqualNode(n)||r.isEqualNode(e)||(i=Wt(e),o=Wt(n),t.isEqualNode(r)&&i<o&&o++,t.insertBefore(n,t.children[i]),r.insertBefore(e,r.children[o]))}ue.mount(new Xp);ue.mount(qs,Gs);function ku(e,n,t){const r=e.slice();return r[22]=n[t],r[23]=n,r[24]=t,r}function Su(e,n){let t,r,i=n[22].pattern+"",o,s,l,a,u,c,p,b,m,k,S,I,A,$,x;u=new _e({props:{path:Df,height:"1rem"}});function D(){return n[15](n[22])}b=new _e({props:{path:tc,height:"1rem"}});function J(){return n[16](n[22])}function X(){n[17].call(k,n[23],n[24])}return{key:e,first:null,c(){t=g("div"),r=g("div"),o=ct(i),s=w(),l=g("div"),a=g("button"),se(u.$$.fragment),c=w(),p=g("button"),se(b.$$.fragment),m=w(),k=g("input"),S=w(),h(r,"class","break-all"),h(a,"title","Edit"),h(a,"class","hover:text-primary"),h(p,"title","Remove"),h(p,"class","hover:text-primary"),h(k,"type","checkbox"),h(k,"class","ml-1"),h(l,"class","min-w-max ml-2"),h(t,"class","border my-2 p-2 flex items-center justify-between"),h(t,"data-id",I=n[22].pattern),this.first=t},m(K,B){F(K,t,B),f(t,r),f(r,o),f(t,s),f(t,l),f(l,a),ie(u,a,null),f(l,c),f(l,p),ie(b,p,null),f(l,m),f(l,k),k.checked=n[22].enabled,f(t,S),A=!0,$||(x=[P(a,"click",D),P(p,"click",J),P(k,"change",X),P(k,"change",n[6])],$=!0)},p(K,B){n=K,(!A||B&2)&&i!==(i=n[22].pattern+"")&&At(o,i),B&2&&(k.checked=n[22].enabled),(!A||B&2&&I!==(I=n[22].pattern))&&h(t,"data-id",I)},i(K){A||(H(u.$$.fragment,K),H(b.$$.fragment,K),A=!0)},o(K){j(u.$$.fragment,K),j(b.$$.fragment,K),A=!1},d(K){K&&V(t),oe(u),oe(b),$=!1,Lt(x)}}}function Qp(e){let n,t,r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$,x=[],D=new Map,J,X,K;r=new _e({props:{path:Ef}}),l=new _e({props:{path:ec}}),c=new _e({props:{path:Nf}}),m=new _e({props:{path:Hf}}),I=new _e({props:{path:tc}});let B=e[1];const E=W=>W[22].pattern;for(let W=0;W<B.length;W+=1){let U=ku(e,B,W),Z=E(U);D.set(Z,x[W]=Su(Z,U))}return{c(){n=g("div"),t=g("button"),se(r.$$.fragment),o=w(),s=g("button"),se(l.$$.fragment),a=w(),u=g("button"),se(c.$$.fragment),p=w(),b=g("button"),se(m.$$.fragment),k=w(),S=g("button"),se(I.$$.fragment),A=w(),$=g("div");for(let W=0;W<x.length;W+=1)x[W].c();h(t,"title","Apply to current lines"),t.disabled=i=!e[2],q(t,"hover:text-primary",e[2]),q(t,"cursor-not-allowed",!e[2]),h(s,"title","Add replacement"),h(s,"class","ml-2 hover:text-primary"),h(u,"title","Enable all"),h(u,"class","ml-2 hover:text-primary"),h(b,"title","Disable all"),h(b,"class","ml-2 hover:text-primary"),h(S,"title","Remove all"),h(S,"class","ml-2 hover:text-primary"),h(n,"class","flex justify-end my-2"),h($,"class","max-h-72 overflow-auto")},m(W,U){F(W,n,U),f(n,t),ie(r,t,null),f(n,o),f(n,s),ie(l,s,null),f(n,a),f(n,u),ie(c,u,null),f(n,p),f(n,b),ie(m,b,null),f(n,k),f(n,S),ie(I,S,null),F(W,A,U),F(W,$,U);for(let Z=0;Z<x.length;Z+=1)x[Z].m($,null);e[18]($),J=!0,X||(K=[P(t,"click",e[10]),P(s,"click",e[11]),P(u,"click",e[12]),P(b,"click",e[13]),P(S,"click",e[14])],X=!0)},p(W,[U]){(!J||U&4&&i!==(i=!W[2]))&&(t.disabled=i),(!J||U&4)&&q(t,"hover:text-primary",W[2]),(!J||U&4)&&q(t,"cursor-not-allowed",!W[2]),U&218&&(B=W[1],rt(),x=Yr(x,U,E,1,W,B,D,$,Ns,Su,null,ku),it())},i(W){if(!J){H(r.$$.fragment,W),H(l.$$.fragment,W),H(c.$$.fragment,W),H(m.$$.fragment,W),H(I.$$.fragment,W);for(let U=0;U<B.length;U+=1)H(x[U]);J=!0}},o(W){j(r.$$.fragment,W),j(l.$$.fragment,W),j(c.$$.fragment,W),j(m.$$.fragment,W),j(I.$$.fragment,W);for(let U=0;U<x.length;U+=1)j(x[U]);J=!1},d(W){W&&V(n),oe(r),oe(l),oe(c),oe(m),oe(I),W&&V(A),W&&V($);for(let U=0;U<x.length;U+=1)x[U].d();e[18](null),X=!1,Lt(K)}}}function e1(e,n,t){let r,i,o,s;y(e,ln,E=>t(3,i=E)),y(e,As,E=>t(8,o=E)),y(e,et,E=>t(9,s=E));const l=zr();let a,u,c=JSON.parse(JSON.stringify(i));Yl(()=>{try{ue.mount(new Zp)}catch{}return a=ue.create(u,{swap:!0,swapClass:"swap",animation:150,store:{get:k,set:b}}),()=>a==null?void 0:a.destroy()});function p(E){const W=S();t(1,c=W.map(U=>({...U,enabled:E}))),R(ln,i=c,i)}function b(){R(ln,i=S(),i)}function m(E){t(1,c=E),R(ln,i=E,i),a.sort(k(),!1)}function k(){return[...c.map(E=>E.pattern)]}function S(){const E=a.toArray();return c.slice().sort((W,U)=>E.indexOf(W.pattern)-E.indexOf(U.pattern))}const I=()=>l("applyReplacements"),A=()=>l("edit",void 0),$=()=>p(!0),x=()=>p(!1),D=()=>m([]),J=E=>l("edit",E),X=E=>m(i.filter(W=>W.pattern!==E.pattern));function K(E,W){E[W].enabled=this.checked,t(1,c)}function B(E){mt[E?"unshift":"push"](()=>{u=E,t(0,u)})}return e.$$.update=()=>{e.$$.dirty&768&&t(2,r=!!s.length&&!!o.length)},[u,c,r,i,l,p,b,m,o,s,I,A,$,x,D,J,X,K,B]}class t1 extends Ut{constructor(n){super(),Bt(this,n,e1,Qp,Et,{})}}function n1(e){let n,t,r,i,o,s,l,a;return r=new _e({props:{path:ec}}),{c(){n=g("div"),t=g("button"),se(r.$$.fragment),i=w(),o=g("div"),o.textContent="You have currently no replacements configured",h(t,"title","Add replacement"),h(t,"class","ml-2 hover:text-primary"),h(n,"class","flex justify-end my-2")},m(u,c){F(u,n,c),f(n,t),ie(r,t,null),F(u,i,c),F(u,o,c),s=!0,l||(a=P(t,"click",e[7]),l=!0)},p:Ie,i(u){s||(H(r.$$.fragment,u),s=!0)},o(u){j(r.$$.fragment,u),s=!1},d(u){u&&V(n),oe(r),u&&V(i),u&&V(o),l=!1,a()}}}function r1(e){let n=e[0],t,r,i=Cu(e);return{c(){i.c(),t=Nn()},m(o,s){i.m(o,s),F(o,t,s),r=!0},p(o,s){s&1&&Et(n,n=o[0])?(rt(),j(i,1,1,Ie),it(),i=Cu(o),i.c(),H(i,1),i.m(t.parentNode,t)):i.p(o,s)},i(o){r||(H(i),r=!0)},o(o){j(i),r=!1},d(o){o&&V(t),i.d(o)}}}function i1(e){let n,t;return n=new Cp({props:{currentReplacement:e[2]}}),n.$on("close",e[4]),{c(){se(n.$$.fragment)},m(r,i){ie(n,r,i),t=!0},p(r,i){const o={};i&4&&(o.currentReplacement=r[2]),n.$set(o)},i(r){t||(H(n.$$.fragment,r),t=!0)},o(r){j(n.$$.fragment,r),t=!1},d(r){oe(n,r)}}}function Cu(e){let n,t;return n=new t1({}),n.$on("edit",e[5]),n.$on("applyReplacements",e[6]),{c(){se(n.$$.fragment)},m(r,i){ie(n,r,i),t=!0},p:Ie,i(r){t||(H(n.$$.fragment,r),t=!0)},o(r){j(n.$$.fragment,r),t=!1},d(r){oe(n,r)}}}function o1(e){let n,t,r,i,o,s,l;const a=[i1,r1,n1],u=[];function c(p,b){return p[1]?0:p[3]?1:2}return o=c(e),s=u[o]=a[o](e),{c(){n=g("details"),t=g("summary"),t.textContent="Replacements",r=w(),i=g("div"),s.c(),h(i,"class","mb-8"),h(n,"class","col-span-4 mb-2 cursor-pointer max-w-lg")},m(p,b){F(p,n,b),f(n,t),f(n,r),f(n,i),u[o].m(i,null),l=!0},p(p,[b]){let m=o;o=c(p),o===m?u[o].p(p,b):(rt(),j(u[m],1,1,()=>{u[m]=null}),it(),s=u[o],s?s.p(p,b):(s=u[o]=a[o](p),s.c()),H(s,1),s.m(i,null))},i(p){l||(H(s),l=!0)},o(p){j(s),l=!1},d(p){p&&V(n),u[o].d()}}}function l1(e,n,t){let r,i;y(e,ln,b=>t(0,i=b));let o=!1,s;function l(b){t(1,o=!1)}const a=()=>{t(1,o=!1),t(2,s=void 0)},u=({detail:b})=>{t(2,s=b),t(1,o=!0)};function c(b){mo.call(this,e,b)}const p=()=>t(1,o=!0);return e.$$.update=()=>{e.$$.dirty&1&&t(3,r=!!i.length),e.$$.dirty&1&&l()},[i,o,s,r,a,u,c,p]}class s1 extends Ut{constructor(n){super(),Bt(this,n,l1,o1,Et,{})}}const{Map:a1,document:Lu}=Hs;function Eu(e,n,t){const r=e.slice();return r[156]=n[t],r}function xu(e){let n,t,r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$,x,D,J,X,K,B,E,W,U,Z,ve,re,z,M,T,ee,ce,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re,ze,Fe,we,Me,bt,he,ft,We,Ve,ot,vt,je,ae,Be,_t,ke,ye,kt,Dt,Ee,_,de,Ot,Te,lt,Ce,De,st,hn,pn,jn,ht,zt,Ht,Ge,xe,C,N,St,tt,Je=[],Jt=new a1,It,Nt,Qt,Yt,Gr,Bn,qr,Kt,Un,Ln,zn,Xr,Rt,Zr,Yn,Jr,an,Qr,Kn,ei,un,v,Q,ne,pe,ge,pt,dn,Gt,fr,ti,To,mn,Do,ni,Oo,gn,Io,ri,Mo,bn,$o,ii,Ho,vn,No,oi,Ro,En,Vo,li,Fo,xn,Wo,si,jo,Pn,Bo,ai,Uo,An,zo,ui,Yo,Tn,Ko,ci,Go,Dn,qo,fi,Xo,d,G,le,$e,nt,dt,Mt,hr,pr,Xs,Zo,Zs,dr,Js,Jo,Qs,Gn,ea,Qo,ta,qn,na,el,ra,mr,ia,tl,oa,Xn,la,nl,sa,gr,aa,rl,ua,br,ca,il,fa,vr,ha,ol,pa,_r,da,ll,ma,wr,ga,sl,ba,yr,va,al,_a,kr,wa,ul,ya,Sr,ka,cl,Sa,Zn,Ca,fl,La,Cr,Ea,hl,xa,Lr,Pa,pl,Aa,Er,Ta,Qi,Da,Jn,On,is,Oa;p=new _e({props:{path:$f}}),I=new _e({props:{path:Mf}}),J=new _e({props:{path:so}}),W=new _e({props:{path:so}}),z=new _e({props:{path:so}}),Ae=new _e({props:{path:Ss}}),Ne=new _e({props:{path:Ss}}),he=new _e({props:{class:"swap-on",path:Vf}}),We=new _e({props:{class:"swap-off",path:Ff}});let Gc={};Be=new Oc({props:Gc}),e[84](Be),Be.$on("layoutChange",e[85]),Be.$on("exportImportPreset",e[86]),ke=new s1({}),ke.$on("applyReplacements",e[87]);let dl=e[55];const Ia=O=>O[156];for(let O=0;O<dl.length;O+=1){let te=Eu(e,dl,O),Qn=Ia(te);Jt.set(Qn,Je[O]=Pu(Qn,te))}let Vt=e[1]&&Au(e);return{c(){n=g("input"),t=w(),r=g("input"),i=w(),o=g("input"),s=w(),l=g("div"),a=g("div"),u=g("div"),c=g("div"),se(p.$$.fragment),b=w(),m=g("span"),m.textContent="Set Timer",k=w(),S=g("div"),se(I.$$.fragment),A=w(),$=g("span"),$.textContent="Reset Timer",x=w(),D=g("div"),se(J.$$.fragment),X=w(),K=g("span"),K.textContent="Reset Lines",B=w(),E=g("div"),se(W.$$.fragment),U=w(),Z=g("span"),Z.textContent="Reset Data",ve=w(),re=g("div"),se(z.$$.fragment),M=w(),T=g("span"),T.textContent="Reset All",ee=w(),ce=g("div"),se(Ae.$$.fragment),Ye=w(),Se=g("span"),Se.textContent="Ex-/Import Data",Ze=w(),Ke=g("div"),se(Ne.$$.fragment),yt=w(),gt=g("span"),gt.textContent="Ex-/Import Settings",Re=w(),ze=g("div"),Fe=g("label"),we=g("input"),bt=w(),se(he.$$.fragment),ft=w(),se(We.$$.fragment),Ve=w(),ot=g("span"),ot.textContent="Theme",vt=w(),je=g("details"),je.innerHTML=`<summary>Links</summary>
24
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Dl(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var So=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,r,i,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=wi(s),u=l.next();!u.done;u=l.next()){var a=u.value;a.remove(this)}}catch(S){n={error:S}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(n)throw n.error}}else s.remove(this);var c=this.initialTeardown;if(He(c))try{c()}catch(S){o=S instanceof is?S.errors:[S]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var b=wi(p),d=b.next();!d.done;d=b.next()){var y=d.value;try{$a(y)}catch(S){o=o??[],S instanceof is?o=Hr(Hr([],lr(o)),lr(S.errors)):o.push(S)}}}catch(S){r={error:S}}finally{try{d&&!d.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}}if(o)throw new is(o)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)$a(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&Dl(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&Dl(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}(),ec=So.EMPTY;function tc(e){return e instanceof So||e&&"closed"in e&&He(e.remove)&&He(e.add)&&He(e.unsubscribe)}function $a(e){He(e)?e():e.unsubscribe()}var Ms={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ks={setTimeout:function(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=ks.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,Hr([e,n],lr(t))):setTimeout.apply(void 0,Hr([e,n],lr(t)))},clearTimeout:function(e){var n=ks.delegate;return((n==null?void 0:n.clearTimeout)||clearTimeout)(e)},delegate:void 0};function nc(e){ks.setTimeout(function(){throw e})}function ys(){}var hl=null;function wl(e){if(Ms.useDeprecatedSynchronousErrorHandling){var n=!hl;if(n&&(hl={errorThrown:!1,error:null}),e(),n){var t=hl,r=t.errorThrown,i=t.error;if(hl=null,r)throw i}}else e()}var $s=function(e){Nn(n,e);function n(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,tc(t)&&t.add(r)):r.destination=Bf,r}return n.create=function(t,r,i){return new Ss(t,r,i)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(So),Ff=Function.prototype.bind;function os(e,n){return Ff.call(e,n)}var Wf=function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var t=this.partialObserver;if(t.next)try{t.next(n)}catch(r){pl(r)}},e.prototype.error=function(n){var t=this.partialObserver;if(t.error)try{t.error(n)}catch(r){pl(r)}else pl(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(t){pl(t)}},e}(),Ss=function(e){Nn(n,e);function n(t,r,i){var o=e.call(this)||this,s;if(He(t)||!t)s={next:t??void 0,error:r??void 0,complete:i??void 0};else{var l;o&&Ms.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&os(t.next,l),error:t.error&&os(t.error,l),complete:t.complete&&os(t.complete,l)}):s=t}return o.destination=new Wf(s),o}return n}($s);function pl(e){nc(e)}function jf(e){throw e}var Bf={closed:!0,next:ys,error:jf,complete:ys},Hs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Co(e){return e}function Uf(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return rc(e)}function rc(e){return e.length===0?Co:e.length===1?e[0]:function(t){return e.reduce(function(r,i){return i(r)},t)}}var Dt=function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(n,t,r){var i=this,o=Yf(n)?n:new Ss(n,t,r);return wl(function(){var s=i,l=s.operator,u=s.source;o.add(l?l.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(t){n.error(t)}},e.prototype.forEach=function(n,t){var r=this;return t=Ha(t),new t(function(i,o){var s=new Ss({next:function(l){try{n(l)}catch(u){o(u),s.unsubscribe()}},error:o,complete:i});r.subscribe(s)})},e.prototype._subscribe=function(n){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(n)},e.prototype[Hs]=function(){return this},e.prototype.pipe=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return rc(n)(this)},e.prototype.toPromise=function(n){var t=this;return n=Ha(n),new n(function(r,i){var o;t.subscribe(function(s){return o=s},function(s){return i(s)},function(){return r(o)})})},e.create=function(n){return new e(n)},e}();function Ha(e){var n;return(n=e??Ms.Promise)!==null&&n!==void 0?n:Promise}function zf(e){return e&&He(e.next)&&He(e.error)&&He(e.complete)}function Yf(e){return e&&e instanceof $s||zf(e)&&tc(e)}function Kf(e){return He(e==null?void 0:e.lift)}function Cn(e){return function(n){if(Kf(n))return n.lift(function(t){try{return e(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function on(e,n,t,r,i){return new Gf(e,n,t,r,i)}var Gf=function(e){Nn(n,e);function n(t,r,i,o,s,l){var u=e.call(this,t)||this;return u.onFinalize=s,u.shouldUnsubscribe=l,u._next=r?function(a){try{r(a)}catch(c){t.error(c)}}:e.prototype._next,u._error=o?function(a){try{o(a)}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=i?function(){try{i()}catch(a){t.error(a)}finally{this.unsubscribe()}}:e.prototype._complete,u}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},n}($s),qf=Qu(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Xi=function(e){Nn(n,e);function n(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.prototype.lift=function(t){var r=new Na(this,this);return r.operator=t,r},n.prototype._throwIfClosed=function(){if(this.closed)throw new qf},n.prototype.next=function(t){var r=this;wl(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var s=wi(r.currentObservers),l=s.next();!l.done;l=s.next()){var u=l.value;u.next(t)}}catch(a){i={error:a}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}}})},n.prototype.error=function(t){var r=this;wl(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var i=r.observers;i.length;)i.shift().error(t)}})},n.prototype.complete=function(){var t=this;wl(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},n.prototype._innerSubscribe=function(t){var r=this,i=this,o=i.hasError,s=i.isStopped,l=i.observers;return o||s?ec:(this.currentObservers=null,l.push(t),new So(function(){r.currentObservers=null,Dl(l,t)}))},n.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,o=r.thrownError,s=r.isStopped;i?t.error(o):s&&t.complete()},n.prototype.asObservable=function(){var t=new Dt;return t.source=this,t},n.create=function(t,r){return new Na(t,r)},n}(Dt),Na=function(e){Nn(n,e);function n(t,r){var i=e.call(this)||this;return i.destination=t,i.source=r,i}return n.prototype.next=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,t)},n.prototype.error=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,t)},n.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},n.prototype._subscribe=function(t){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&i!==void 0?i:ec},n}(Xi),Xf=function(e){Nn(n,e);function n(t){var r=e.call(this)||this;return r._value=t,r}return Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},n.prototype.getValue=function(){var t=this,r=t.hasError,i=t.thrownError,o=t._value;if(r)throw i;return this._throwIfClosed(),o},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Xi),ic={now:function(){return(ic.delegate||Date).now()},delegate:void 0},Zf=function(e){Nn(n,e);function n(t,r){return e.call(this)||this}return n.prototype.schedule=function(t,r){return this},n}(So),Ol={setInterval:function(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=Ol.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,Hr([e,n],lr(t))):setInterval.apply(void 0,Hr([e,n],lr(t)))},clearInterval:function(e){var n=Ol.delegate;return((n==null?void 0:n.clearInterval)||clearInterval)(e)},delegate:void 0},Jf=function(e){Nn(n,e);function n(t,r){var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.pending=!1,i}return n.prototype.schedule=function(t,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=t;var o=this.id,s=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(s,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(s,this.id,r),this},n.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),Ol.setInterval(t.flush.bind(t,this),i)},n.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Ol.clearInterval(r)},n.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,r){var i=!1,o;try{this.work(t)}catch(s){i=!0,o=s||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,i=t.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Dl(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n}(Zf),Ra=function(){function e(n,t){t===void 0&&(t=e.now),this.schedulerActionCtor=n,this.now=t}return e.prototype.schedule=function(n,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,n).schedule(r,t)},e.now=ic.now,e}(),Qf=function(e){Nn(n,e);function n(t,r){r===void 0&&(r=Ra.now);var i=e.call(this,t,r)||this;return i.actions=[],i._active=!1,i}return n.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}},n}(Ra),Ul=new Qf(Jf),eh=Ul,th=new Dt(function(e){return e.complete()});function oc(e){return e&&He(e.schedule)}function Ns(e){return e[e.length-1]}function nh(e){return He(Ns(e))?e.pop():void 0}function zl(e){return oc(Ns(e))?e.pop():void 0}function rh(e,n){return typeof Ns(e)=="number"?e.pop():n}var Rs=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function lc(e){return He(e==null?void 0:e.then)}function sc(e){return He(e[Hs])}function ac(e){return Symbol.asyncIterator&&He(e==null?void 0:e[Symbol.asyncIterator])}function uc(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ih(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var cc=ih();function fc(e){return He(e==null?void 0:e[cc])}function hc(e){return Rf(this,arguments,function(){var t,r,i,o;return Ju(this,function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,gi(t.read())];case 3:return r=s.sent(),i=r.value,o=r.done,o?[4,gi(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,gi(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function pc(e){return He(e==null?void 0:e.getReader)}function Rn(e){if(e instanceof Dt)return e;if(e!=null){if(sc(e))return oh(e);if(Rs(e))return lh(e);if(lc(e))return sh(e);if(ac(e))return dc(e);if(fc(e))return ah(e);if(pc(e))return uh(e)}throw uc(e)}function oh(e){return new Dt(function(n){var t=e[Hs]();if(He(t.subscribe))return t.subscribe(n);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function lh(e){return new Dt(function(n){for(var t=0;t<e.length&&!n.closed;t++)n.next(e[t]);n.complete()})}function sh(e){return new Dt(function(n){e.then(function(t){n.closed||(n.next(t),n.complete())},function(t){return n.error(t)}).then(null,nc)})}function ah(e){return new Dt(function(n){var t,r;try{for(var i=wi(e),o=i.next();!o.done;o=i.next()){var s=o.value;if(n.next(s),n.closed)return}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}n.complete()})}function dc(e){return new Dt(function(n){ch(e,n).catch(function(t){return n.error(t)})})}function uh(e){return dc(hc(e))}function ch(e,n){var t,r,i,o;return Nf(this,void 0,void 0,function(){var s,l;return Ju(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),t=Vf(e),u.label=1;case 1:return[4,t.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(s=r.value,n.next(s),n.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=u.sent(),i={error:l},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=t.return)?[4,o.call(t)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}function In(e,n,t,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=n.schedule(function(){t(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function mc(e,n){return n===void 0&&(n=0),Cn(function(t,r){t.subscribe(on(r,function(i){return In(r,e,function(){return r.next(i)},n)},function(){return In(r,e,function(){return r.complete()},n)},function(i){return In(r,e,function(){return r.error(i)},n)}))})}function gc(e,n){return n===void 0&&(n=0),Cn(function(t,r){r.add(e.schedule(function(){return t.subscribe(r)},n))})}function fh(e,n){return Rn(e).pipe(gc(n),mc(n))}function hh(e,n){return Rn(e).pipe(gc(n),mc(n))}function ph(e,n){return new Dt(function(t){var r=0;return n.schedule(function(){r===e.length?t.complete():(t.next(e[r++]),t.closed||this.schedule())})})}function dh(e,n){return new Dt(function(t){var r;return In(t,n,function(){r=e[cc](),In(t,n,function(){var i,o,s;try{i=r.next(),o=i.value,s=i.done}catch(l){t.error(l);return}s?t.complete():t.next(o)},0,!0)}),function(){return He(r==null?void 0:r.return)&&r.return()}})}function bc(e,n){if(!e)throw new Error("Iterable cannot be null");return new Dt(function(t){In(t,n,function(){var r=e[Symbol.asyncIterator]();In(t,n,function(){r.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function mh(e,n){return bc(hc(e),n)}function gh(e,n){if(e!=null){if(sc(e))return fh(e,n);if(Rs(e))return ph(e,n);if(lc(e))return hh(e,n);if(ac(e))return bc(e,n);if(fc(e))return dh(e,n);if(pc(e))return mh(e,n)}throw uc(e)}function Yl(e,n){return n?gh(e,n):Rn(e)}function bh(e){return e instanceof Date&&!isNaN(e)}function Kl(e,n){return Cn(function(t,r){var i=0;t.subscribe(on(r,function(o){r.next(e.call(n,o,i++))}))})}var vh=Array.isArray;function _h(e,n){return vh(n)?e.apply(void 0,Hr([],lr(n))):e(n)}function vc(e){return Kl(function(n){return _h(e,n)})}var wh=Array.isArray,kh=Object.getPrototypeOf,yh=Object.prototype,Sh=Object.keys;function Ch(e){if(e.length===1){var n=e[0];if(wh(n))return{args:n,keys:null};if(Lh(n)){var t=Sh(n);return{args:t.map(function(r){return n[r]}),keys:t}}}return{args:e,keys:null}}function Lh(e){return e&&typeof e=="object"&&kh(e)===yh}function Eh(e,n){return e.reduce(function(t,r,i){return t[r]=n[i],t},{})}function xh(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=zl(e),r=nh(e),i=Ch(e),o=i.args,s=i.keys;if(o.length===0)return Yl([],t);var l=new Dt(Ph(o,t,s?function(u){return Eh(s,u)}:Co));return r?l.pipe(vc(r)):l}function Ph(e,n,t){return t===void 0&&(t=Co),function(r){Va(n,function(){for(var i=e.length,o=new Array(i),s=i,l=i,u=function(c){Va(n,function(){var p=Yl(e[c],n),b=!1;p.subscribe(on(r,function(d){o[c]=d,b||(b=!0,l--),l||r.next(t(o.slice()))},function(){--s||r.complete()}))},r)},a=0;a<i;a++)u(a)},r)}}function Va(e,n,t){e?In(t,e,n):n()}function Ah(e,n,t,r,i,o,s,l){var u=[],a=0,c=0,p=!1,b=function(){p&&!u.length&&!a&&n.complete()},d=function(S){return a<r?y(S):u.push(S)},y=function(S){o&&n.next(S),a++;var D=!1;Rn(t(S,c++)).subscribe(on(n,function(T){i==null||i(T),o?d(T):n.next(T)},function(){D=!0},void 0,function(){if(D)try{a--;for(var T=function(){var I=u.shift();s?In(n,s,function(){return y(I)}):y(I)};u.length&&a<r;)T();b()}catch(I){n.error(I)}}))};return e.subscribe(on(n,d,function(){p=!0,b()})),function(){l==null||l()}}function Vs(e,n,t){return t===void 0&&(t=1/0),He(n)?Vs(function(r,i){return Kl(function(o,s){return n(r,o,i,s)})(Rn(e(r,i)))},t):(typeof n=="number"&&(t=n),Cn(function(r,i){return Ah(r,i,e,t)}))}function _c(e){return e===void 0&&(e=1/0),Vs(Co,e)}function Th(){return _c(1)}function Fa(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Th()(Yl(e,zl(e)))}var Dh=["addListener","removeListener"],Oh=["addEventListener","removeEventListener"],Ih=["on","off"];function nr(e,n,t,r){if(He(t)&&(r=t,t=void 0),r)return nr(e,n,t).pipe(vc(r));var i=lr(Hh(e)?Oh.map(function(l){return function(u){return e[l](n,u,t)}}):Mh(e)?Dh.map(Wa(e,n)):$h(e)?Ih.map(Wa(e,n)):[],2),o=i[0],s=i[1];if(!o&&Rs(e))return Vs(function(l){return nr(l,n,t)})(Rn(e));if(!o)throw new TypeError("Invalid event target");return new Dt(function(l){var u=function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return l.next(1<a.length?a:a[0])};return o(u),function(){return s(u)}})}function Wa(e,n){return function(t){return function(r){return e[t](n,r)}}}function Mh(e){return He(e.addListener)&&He(e.removeListener)}function $h(e){return He(e.on)&&He(e.off)}function Hh(e){return He(e.addEventListener)&&He(e.removeEventListener)}function wc(e,n,t){e===void 0&&(e=0),t===void 0&&(t=eh);var r=-1;return n!=null&&(oc(n)?t=n:r=n),new Dt(function(i){var o=bh(e)?+e-t.now():e;o<0&&(o=0);var s=0;return t.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function Nh(e,n){return e===void 0&&(e=0),n===void 0&&(n=Ul),e<0&&(e=0),wc(e,e,n)}function Rh(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=zl(e),r=rh(e,1/0),i=e;return i.length?i.length===1?Rn(i[0]):_c(r)(Yl(i,t)):th}var mo=new Dt(ys);function Gl(e,n){return Cn(function(t,r){var i=0;t.subscribe(on(r,function(o){return e.call(n,o,i++)&&r.next(o)}))})}function Fs(e,n){return n===void 0&&(n=Ul),Cn(function(t,r){var i=null,o=null,s=null,l=function(){if(i){i.unsubscribe(),i=null;var a=o;o=null,r.next(a)}};function u(){var a=s+e,c=n.now();if(c<a){i=this.schedule(void 0,a-c),r.add(i);return}l()}t.subscribe(on(r,function(a){o=a,s=n.now(),i||(i=n.schedule(u,e),r.add(i))},function(){l(),r.complete()},void 0,function(){o=i=null}))})}function Vh(e){return Gl(function(n,t){return e<=t})}function Fh(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=zl(e);return Cn(function(r,i){(t?Fa(e,r,t):Fa(e,r)).subscribe(i)})}function go(e,n){return Cn(function(t,r){var i=null,o=0,s=!1,l=function(){return s&&!i&&r.complete()};t.subscribe(on(r,function(u){i==null||i.unsubscribe();var a=0,c=o++;Rn(e(u,c)).subscribe(i=on(r,function(p){return r.next(n?n(u,p,c,a++):p)},function(){i=null,l()}))},function(){s=!0,l()}))})}function Jn(e,n,t){var r=He(e)||n||t?{next:e,error:n,complete:t}:e;return r?Cn(function(i,o){var s;(s=r.subscribe)===null||s===void 0||s.call(r);var l=!0;i.subscribe(on(o,function(u){var a;(a=r.next)===null||a===void 0||a.call(r,u),o.next(u)},function(){var u;l=!1,(u=r.complete)===null||u===void 0||u.call(r),o.complete()},function(u){var a;l=!1,(a=r.error)===null||a===void 0||a.call(r,u),o.error(u)},function(){var u,a;l&&((u=r.unsubscribe)===null||u===void 0||u.call(r)),(a=r.finalize)===null||a===void 0||a.call(r)}))}):Co}var kc={leading:!0,trailing:!1};function Wh(e,n){return n===void 0&&(n=kc),Cn(function(t,r){var i=n.leading,o=n.trailing,s=!1,l=null,u=null,a=!1,c=function(){u==null||u.unsubscribe(),u=null,o&&(d(),a&&r.complete())},p=function(){u=null,a&&r.complete()},b=function(y){return u=Rn(e(y)).subscribe(on(r,c,p))},d=function(){if(s){s=!1;var y=l;l=null,r.next(y),!a&&b(y)}};t.subscribe(on(r,function(y){s=!0,l=y,!(u&&!u.closed)&&(i?d():b(y))},function(){a=!0,!(o&&s&&u&&!u.closed)&&r.complete()}))})}function jh(e,n,t){n===void 0&&(n=Ul),t===void 0&&(t=kc);var r=wc(e,n);return Wh(function(){return r},t)}function Bh(e){const n=e-1;return n*n*n+1}function Uh(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}function yc(e,{delay:n=0,duration:t=400,easing:r=Bh,x:i=0,y:o=0,opacity:s=0}={}){const l=getComputedStyle(e),u=+l.opacity,a=l.transform==="none"?"":l.transform,c=u*(1-s);return{delay:n,duration:t,easing:r,css:(p,b)=>`
25
+ transform: ${a} translate(${(1-p)*i}px, ${(1-p)*o}px);
26
+ opacity: ${u-c*b}`}}var tn=(e=>(e.LIGHT="light",e.DARK="dark",e.CUPCAKE="cupcake",e.BUMBLEBEE="bumblebee",e.EMERALD="emerald",e.CORPORATE="corporate",e.SYNTHWAVE="synthwave",e.RETRO="retro",e.CYBERPUNK="cyberpunk",e.VALENTINE="valentine",e.HALLOWEEN="halloween",e.GARDEN="garden",e.FOREST="forest",e.AQUA="aqua",e.LOFI="lofi",e.PASTEL="pastel",e.FANTASY="fantasy",e.WIREFRAME="wireframe",e.BLACK="black",e.LUXURY="luxury",e.DRACULA="dracula",e.CMYK="cmyk",e.AUTUMN="autumn",e.BUSINESS="business",e.ACID="acid",e.LEMONADE="lemonade",e.NIGHT="night",e.COFFEE="coffee",e.WINTER="winter",e))(tn||{}),nn=(e=>(e.OFF="Off",e.NOTO="Noto Serif JP",e.KLEE="Klee One",e.SHIPPORI="Shippori Mincho",e.ACKAISYO="Ackaisyo",e.CINECAPTION226="CineCaption226",e))(nn||{}),en=(e=>(e.SOCKET="socket",e.PASTE="paste",e.EXTERNAL="external",e.EDIT="edit",e.UNDO="undo",e.RESETCHECKBOXES="resetcheckboxes",e.TL="tl",e))(en||{});const ci=[];function ql(e,n=Oe){let t;const r=new Set;function i(l){if(Ct(e,l)&&(e=l,t)){const u=!ci.length;for(const a of r)a[1](),ci.push(a,e);if(u){for(let a=0;a<ci.length;a+=2)ci[a][0](ci[a+1]);ci.length=0}}}function o(l){i(l(e))}function s(l,u=Oe){const a=[l,u];return r.add(a),r.size===1&&(t=n(i)||Oe),l(e),()=>{r.delete(a),r.size===0&&(t(),t=null)}}return{set:i,update:o,subscribe:s}}function zh(e){return e.set=e.next,e}function zr(e){return zh(new Xf(e))}function Xl(e,n){return(t,r,i)=>{const o=Yh()(t,r,e),s=zr(o);let l=!0;return i&&i.subscribe(u=>l=u),s.pipe(Vh(1)).subscribe(u=>{l&&window.localStorage.setItem(t,n(u??r))}),s}}function Yh(){return(e,n,t)=>{const r=window.localStorage.getItem(e);return r?t(r):n}}function Ce(){return Xl(e=>!!+e,e=>e?"1":"0")}function Vn(){return Xl(e=>+e,e=>`${e}`)}function Kh(e){return Xl(n=>JSON.parse(n||e),n=>JSON.stringify(n))}function Lo(){return Kh("[]")}function sr(){return Xl(e=>e,e=>e)}const E={theme$:tn.BUSINESS,replacements$:[],windowTitle$:"",websocketUrl$:"ws://localhost:55001",secondaryWebsocketUrl$:"",fontSize$:32,characterMilestone$:0,onlineFont$:nn.OFF,preventLastDuplicate$:0,maxLines$:0,maxPipLines$:1,afkTimer$:0,adjustTimerOnAfk$:!1,enableExternalClipboardMonitor$:!1,showPresetQuickSwitch$:!1,skipResetConfirmations$:!1,persistStats$:!0,persistNotes$:!0,persistLines$:!0,persistActionHistory$:!1,enablePaste$:!1,blockCopyOnPage$:!1,allowPasteDuringPause$:!1,allowNewLineDuringPause$:!0,autoStartTimerDuringPausePaste$:!1,autoStartTimerDuringPause$:!1,preventGlobalDuplicate$:!1,mergeEqualLineStarts$:!1,filterNonCJKLines:!1,flashOnMissedLine$:!0,displayVertical$:!1,reverseLineOrder$:!1,preserveWhitespace$:!0,removeAllWhitespace$:!1,showTimer$:!0,showSpeed$:!0,showCharacterCount$:!0,showLineCount$:!0,blurStats$:!1,enableLineAnimation$:!1,enableAfkBlur$:!1,enableAfkBlurRestart$:!1,continuousReconnect$:!0,showConnectionErrors$:!1,customCSS$:"",autoTranslateLines$:!1,blurAutoTranslatedLines$:!1},Ar=sr()("bannou-texthooker-theme",E.theme$),_n=Lo()("bannou-texthooker-settingPresets",[]),rn=Lo()("bannou-texthooker-replacements",[]),bo=sr()("bannou-texthooker-windowTitle",E.windowTitle$),Mn=sr()("bannou-texthooker-websocketUrl",E.websocketUrl$),Nr=sr()("bannou-texthooker-secondary-websocketUrl",E.secondaryWebsocketUrl$),Tr=Vn()("bannou-texthooker-fontSize",E.fontSize$),Dr=Vn()("bannou-texthooker-characterMilestone",E.characterMilestone$),ki=sr()("bannou-texthooker-onlineFont",E.onlineFont$),Or=Vn()("bannou-texthooker-preventLastDuplicate",E.preventLastDuplicate$),Pr=Vn()("bannou-texthooker-maxLines",E.maxLines$),Ir=Vn()("bannou-texthooker-maxPipLines",E.maxPipLines$),or=Vn()("bannou-texthooker-afkTimer",E.afkTimer$),yi=Ce()("bannou-texthooker-adjustTimerOnAfk",E.adjustTimerOnAfk$),vo=Ce()("bannou-texthooker-enableExternalClipboardMonitor",E.enableExternalClipboardMonitor$),_o=Ce()("bannou-texthooker-showPresetQuickSwitch",E.showPresetQuickSwitch$),Si=Ce()("bannou-texthooker-skipResetConfirmations",E.skipResetConfirmations$),Ci=Ce()("bannou-texthooker-persistStats",E.persistStats$),Li=Ce()("bannou-texthooker-persistNotes",E.persistNotes$),Ei=Ce()("bannou-texthooker-persistLines",E.persistLines$),xi=Ce()("bannou-texthooker-persistActionHistory",E.persistActionHistory$),Pi=Ce()("bannou-texthooker-enablePaste",E.enablePaste$),Ai=Ce()("bannou-texthooker-blockCopyOnPage",E.blockCopyOnPage$),Ti=Ce()("bannou-texthooker-allowPasteDuringPause",E.allowPasteDuringPause$),Di=Ce()("bannou-texthooker-allowNewLineDuringPause",E.allowNewLineDuringPause$),Oi=Ce()("bannou-texthooker-autoStartTimerDuringPausePaste",E.autoStartTimerDuringPausePaste$),Ii=Ce()("bannou-texthooker-autoStartTimerDuringPause",E.autoStartTimerDuringPause$),Rr=Ce()("bannou-texthooker-preventGlobalDuplicate",E.preventGlobalDuplicate$),Mi=Ce()("bannou-texthooker-mergeEqualLineStarts",E.mergeEqualLineStarts$),$i=Ce()("bannou-texthooker-filterNonCJKLines",E.mergeEqualLineStarts$),Hi=Ce()("bannou-texthooker-flashOnMissedLine",E.flashOnMissedLine$),Vr=Ce()("bannou-texthooker-displayVertical",E.displayVertical$),Fr=Ce()("bannou-texthooker-reverseLineOrder",E.reverseLineOrder$),Ni=Ce()("bannou-texthooker-preserveWhitespace",E.preserveWhitespace$),Ri=Ce()("bannou-texthooker-removeAllWhitespace",E.removeAllWhitespace$),Vi=Ce()("bannou-texthooker-showTimer",E.showTimer$),Fi=Ce()("bannou-texthooker-showSpeed",E.showSpeed$),Wi=Ce()("bannou-texthooker-showCharacterCount",E.showCharacterCount$),ji=Ce()("bannou-texthooker-showLineCount",E.showLineCount$),Bi=Ce()("bannou-texthooker-blurStats",E.blurStats$),Ui=Ce()("bannou-texthooker-enableLineAnimation",E.enableLineAnimation$),zi=Ce()("bannou-texthooker-enableAfkBlur",E.enableAfkBlur$),Yi=Ce()("bannou-texthooker-enableAfkBlurRestart",E.enableAfkBlurRestart$),Wr=Ce()("bannou-texthooker-continuousReconnect",E.continuousReconnect$),Ki=Ce()("bannou-texthooker-showConnectionErrors",E.showConnectionErrors$),Gi=sr()("bannou-texthooker-customCSS",E.customCSS$),wn=Vn()("bannou-texthooker-timeValue",0,Ci),Il=zr(!1),wo=sr()("bannou-texthooker-userNotes","",Li),Ws=zr(-1),js=zr(-1),ze=zr(void 0),Ml=zr(!1),rr=sr()("bannou-texthooker-lastSettingPreset",""),Qe=Lo()("bannou-texthooker-lineData",[],Ei),kl=Lo()("bannou-texthooker-lineIDs",[]),jr=ql(new Map),Qn=Lo()("bannou-texthooker-actionHistory",[],xi),Cs=ql(void 0),qt=zr(!0),Mr=new Xi,Zl=new Xi,Jl=new Xi,yl=ql(!1),Ls=ql([]),$l=Ce()("bannou-texthooker-autoTranslateLines",!1),Hl=Ce()("bannou-texthooker-blurAutoTranslatedLines",!1),ja=Vn()("bannou-texthooker-lastPipHeight",0),Ba=Vn()("bannou-texthooker-lastPipWidth",0);async function Gh(){if(!Si.getValue()){const{canceled:e}=await new Promise(n=>{ze.next({icon:Qt,message:"All Settings and Data will be reset",callback:n})});if(e)return}rr.next(""),_n.next([]),qt.next(!0),wn.next(0),wo.next(""),Qe.next([]),Qn.next([]),Cs.set(void 0),window.localStorage.removeItem("bannou-texthooker-timeValue"),window.localStorage.removeItem("bannou-texthooker-userNotes"),window.localStorage.removeItem("bannou-texthooker-lineData"),window.localStorage.removeItem("bannou-texthooker-actionHistory"),Ar.next(E.theme$),rn.next(E.replacements$),bo.next(E.windowTitle$),Mn.next(E.websocketUrl$),Nr.next(E.secondaryWebsocketUrl$),Tr.next(E.fontSize$),Dr.next(E.characterMilestone$),ki.next(E.onlineFont$),Or.next(E.preventLastDuplicate$),Ir.next(E.maxPipLines$),or.next(E.afkTimer$),yi.next(E.adjustTimerOnAfk$),vo.next(E.enableExternalClipboardMonitor$),_o.next(E.showPresetQuickSwitch$),Si.next(E.skipResetConfirmations$),Ci.next(E.persistStats$),Li.next(E.persistNotes$),Ei.next(E.persistLines$),xi.next(E.persistActionHistory$),Pi.next(E.enablePaste$),Ai.next(E.blockCopyOnPage$),Ti.next(E.allowPasteDuringPause$),Di.next(E.allowNewLineDuringPause$),Oi.next(E.autoStartTimerDuringPausePaste$),Ii.next(E.autoStartTimerDuringPause$),Rr.next(E.preventGlobalDuplicate$),Mi.next(E.mergeEqualLineStarts$),$i.next(E.filterNonCJKLines),Hi.next(E.flashOnMissedLine$),Vr.next(E.displayVertical$),Fr.next(E.reverseLineOrder$),Ni.next(E.preserveWhitespace$),Ri.next(E.removeAllWhitespace$),Vi.next(E.showTimer$),Fi.next(E.showSpeed$),Wi.next(E.showCharacterCount$),ji.next(E.showLineCount$),Bi.next(E.blurStats$),Ui.next(E.enableLineAnimation$),zi.next(E.enableAfkBlur$),Yi.next(E.enableAfkBlurRestart$),Wr.next(E.continuousReconnect$),Ki.next(E.showConnectionErrors$),Gi.next(E.customCSS$),$l.next(E.autoTranslateLines$),Hl.next(E.blurAutoTranslatedLines$)}function Bt(){}function er(){return Uf(Kl(()=>""),Gl((e,n)=>!n))}function ko(e,n,t,r,i="auto"){console.log(n),n&&setTimeout(()=>{t?r?n.scrollTo({top:0,left:n.scrollWidth,behavior:i}):e.scrollTo({top:-n.scrollHeight,left:0,behavior:i}):r?n.scrollTo({top:0,left:-n.scrollWidth,behavior:i}):e.scrollTo({top:n.scrollHeight+100,left:0,behavior:i}),i==="smooth"&&setTimeout(()=>ko(e,n,t,r),250)})}function qh(e){const n=Math.floor(e/3600),t=Math.floor((e-n*3600)/60),r=e-n*3600-t*60;return`${`${n}`.padStart(2,"0")}:${`${t}`.padStart(2,"0")}:${`${r}`.padStart(2,"0")}`}function Xh(e){const[n,t,r]=e.split(":").map(i=>Number.parseInt(i,10));return n*60*60+t*60+r}function Zh(){const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Array.prototype.map.call(e,(t,r)=>(t<16?"0":"")+t.toString(16)+(r%2&&r<10&&r>2?"-":"")).join("")}function Sc(e,n){if(!e||!n.length)return e;let t=e;for(let r=0,{length:i}=n;r<i;r+=1){const o=n[r];t=t.replace(new RegExp(o.pattern,o.flags.join("")),o.replaces.replace(/\\t/gm," ").replace(/\\n/gm,`
27
+ `))}return t}function Cc(e,n){const t=e.createTextNode(n||"");let r=e.getElementById("user-css");r?r.replaceChild(t,r.firstChild):(r=e.createElement("style"),r.id="user-css",r.appendChild(t),e.head.append(r))}function Ua(e,n){n?(e.body.style.filter="blur(8px)",e.body.style.pointerEvents="none"):(e.body.style.filter=null,e.body.style.pointerEvents="auto")}const Lc=`
28
+ `;function Jh(e){let n,t,r,i;return{c(){n=gs("svg"),t=gs("path"),h(t,"d",e[1]),be(n,"width",e[2]),be(n,"height",e[3]),h(n,"viewBox","0 0 24 24"),h(n,"fill","currentColor"),h(n,"class",e[4])},m(o,s){F(o,n,s),f(n,t),e[7](n),r||(i=[P(n,"click",e[5]),P(n,"keyup",e[6])],r=!0)},p(o,[s]){s&2&&h(t,"d",o[1]),s&4&&be(n,"width",o[2]),s&8&&be(n,"height",o[3]),s&16&&h(n,"class",o[4])},i:Oe,o:Oe,d(o){o&&V(n),e[7](null),r=!1,St(i)}}}function Qh(e,n,t){let{path:r}=n,{width:i="1.5rem"}=n,{height:o="1.5rem"}=n,{element:s=void 0}=n,{class:l=""}=n;function u(p){ho.call(this,e,p)}function a(p){ho.call(this,e,p)}function c(p){pt[p?"unshift":"push"](()=>{s=p,t(0,s)})}return e.$$set=p=>{"path"in p&&t(1,r=p.path),"width"in p&&t(2,i=p.width),"height"in p&&t(3,o=p.height),"element"in p&&t(0,s=p.element),"class"in p&&t(4,l=p.class)},[s,r,i,o,l,u,a,c]}class _e extends zt{constructor(n){super(),Ut(this,n,Qh,Jh,Ct,{path:1,width:2,height:3,element:0,class:4})}}function za(e){let n,t;return n=new _e({props:{path:e[1]}}),{c(){le(n.$$.fragment)},m(r,i){re(n,r,i),t=!0},p(r,i){const o={};i&2&&(o.path=r[1]),n.$set(o)},i(r){t||(N(n.$$.fragment,r),t=!0)},o(r){W(n.$$.fragment,r),t=!1},d(r){ie(n,r)}}}function ep(e){let n;return{c(){n=at(e[2])},m(t,r){F(t,n,r)},p(t,r){r&4&&Tt(n,t[2])},d(t){t&&V(n)}}}function tp(e){let n,t=e[5]==="text"&&Ya(e);return{c(){n=g("div"),t&&t.c()},m(r,i){F(r,n,i),t&&t.m(n,null)},p(r,i){r[5]==="text"?t?t.p(r,i):(t=Ya(r),t.c(),t.m(n,null)):t&&(t.d(1),t=null)},d(r){r&&V(n),t&&t.d()}}}function Ya(e){let n,t,r;return{c(){n=g("input"),h(n,"type",e[5]),h(n,"class","input input-bordered h-8 ml-2"),n.value=e[0]},m(i,o){F(i,n,o),t||(r=P(n,"change",e[8]),t=!0)},p(i,o){o&32&&h(n,"type",i[5]),o&1&&n.value!==i[0]&&(n.value=i[0])},d(i){i&&V(n),t=!1,r()}}}function Ka(e){let n,t,r;return{c(){n=g("button"),n.textContent="Cancel",h(n,"class","btn btn-sm btn-ghost")},m(i,o){F(i,n,o),t||(r=P(n,"click",e[9]),t=!0)},p:Oe,d(i){i&&V(n),t=!1,r()}}}function np(e){let n,t,r,i,o,s,l,u,a,c,p,b,d=e[1]&&za(e);function y(I,L){return I[5]?tp:ep}let S=y(e),D=S(e),T=e[4]&&Ka(e);return{c(){n=g("div"),t=g("div"),r=g("div"),d&&d.c(),i=k(),o=g("span"),D.c(),s=k(),l=g("div"),T&&T.c(),u=k(),a=g("button"),a.textContent="Confirm",h(a,"class","btn btn-sm btn-primary"),h(l,"class","flex-none"),h(t,"class","alert shadow-lg max-w-xl"),G(t,"alert-info",e[3]==="info"),G(t,"alert-error",e[3]==="error"),h(n,"class","fixed top-12 flex justify-center w-full z-30")},m(I,L){F(I,n,L),f(n,t),f(t,r),d&&d.m(r,null),f(r,i),f(r,o),D.m(o,null),f(t,s),f(t,l),T&&T.m(l,null),f(l,u),f(l,a),c=!0,p||(b=P(a,"click",e[10]),p=!0)},p(I,[L]){I[1]?d?(d.p(I,L),L&2&&N(d,1)):(d=za(I),d.c(),N(d,1),d.m(r,i)):d&&(rt(),W(d,1,1,()=>{d=null}),it()),S===(S=y(I))&&D?D.p(I,L):(D.d(1),D=S(I),D&&(D.c(),D.m(o,null))),I[4]?T?T.p(I,L):(T=Ka(I),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!c||L&8)&&G(t,"alert-info",I[3]==="info"),(!c||L&8)&&G(t,"alert-error",I[3]==="error")},i(I){c||(N(d),c=!0)},o(I){W(d),c=!1},d(I){I&&V(n),d&&d.d(),D.d(),T&&T.d(),p=!1,b()}}}function rp(e,n,t){let{icon:r}=n,{message:i}=n,{type:o="info"}=n,{showCancel:s=!0}=n,{askForData:l=""}=n,{dataValue:u}=n,{callback:a}=n;const c=Br();function p(y){const S=y.target;t(0,u=S.value)}const b=()=>{a==null||a({canceled:!0,data:u}),c("close")},d=()=>{a==null||a({canceled:!1,data:u}),c("close")};return e.$$set=y=>{"icon"in y&&t(1,r=y.icon),"message"in y&&t(2,i=y.message),"type"in y&&t(3,o=y.type),"showCancel"in y&&t(4,s=y.showCancel),"askForData"in y&&t(5,l=y.askForData),"dataValue"in y&&t(0,u=y.dataValue),"callback"in y&&t(6,a=y.callback)},[u,r,i,o,s,l,a,c,p,b,d]}class ip extends zt{constructor(n){super(),Ut(this,n,rp,np,Ct,{icon:1,message:2,type:3,showCancel:4,askForData:5,dataValue:0,callback:6})}}function Ga(e){let n,t;const r=[e[0]];let i={};for(let o=0;o<r.length;o+=1)i=Gc(i,r[o]);return n=new ip({props:i}),n.$on("close",e[1]),{c(){le(n.$$.fragment)},m(o,s){re(n,o,s),t=!0},p(o,s){const l=s&1?pf(r,[df(o[0])]):{};n.$set(l)},i(o){t||(N(n.$$.fragment,o),t=!0)},o(o){W(n.$$.fragment,o),t=!1},d(o){ie(n,o)}}}function op(e){let n,t,r=e[0]&&Ga(e);return{c(){r&&r.c(),n=Hn()},m(i,o){r&&r.m(i,o),F(i,n,o),t=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&N(r,1)):(r=Ga(i),r.c(),N(r,1),r.m(n.parentNode,n)):r&&(rt(),W(r,1,1,()=>{r=null}),it())},i(i){t||(N(r),t=!0)},o(i){W(r),t=!1},d(i){r&&r.d(i),i&&V(n)}}}function lp(e,n,t){let r;w(e,Ml,u=>t(2,r=u));let i,o=[];const s=ze.subscribe(u=>{!u||(u.message.includes("Lost Connection to")||u.message.includes("Unable to connect to"))&&((i==null?void 0:i.message)===u.message||o.find(a=>a.message===u.message))||(o.unshift(u),i||l())});function l(){t(0,i=o.pop()),R(Ml,r=!!i,r)}return Bu(()=>s==null?void 0:s.unsubscribe()),[i,l]}class sp extends zt{constructor(n){super(),Ut(this,n,lp,op,Ct,{})}}function yo(e){return window.location.port==="4173"||window.location.port==="5174"?window.location.protocol+"//"+window.location.hostname+":55000"+e:e}function qa(e){let n,t,r,i,o;return{c(){n=g("input"),h(n,"type","checkbox"),h(n,"class","multi-line-checkbox svelte-i377rk"),h(n,"id",t="multi-line-checkbox-"+e[0].id),h(n,"aria-label",r=e[0].id)},m(s,l){F(s,n,l),i||(o=P(n,"change",e[18]),i=!0)},p(s,l){l&1&&t!==(t="multi-line-checkbox-"+s[0].id)&&h(n,"id",t),l&1&&r!==(r=s[0].id)&&h(n,"aria-label",r)},d(s){s&&V(n),i=!1,o()}}}function Xa(e){let n,t,r=e[0].translation+"",i,o,s,l;return{c(){n=g("p"),t=g("i"),i=at(r),h(n,"style",o="color: #888; padding-bottom: 16px; padding-top: 16px; width: 100%; "+(e[0].blurTranslation?"filter: blur(8px); transition: filter 0.2s;":"")),h(n,"class","svelte-i377rk"),G(n,"blur-translation",e[0].blurTranslation)},m(u,a){F(u,n,a),f(n,t),f(t,i),s||(l=[P(n,"mouseenter",function(){vi(e[0].blurTranslation?eu:void 0)&&(e[0].blurTranslation?eu:void 0).apply(this,arguments)}),P(n,"mouseleave",function(){vi(e[0].blurTranslation?tu:void 0)&&(e[0].blurTranslation?tu:void 0).apply(this,arguments)})],s=!0)},p(u,a){e=u,a&1&&r!==(r=e[0].translation+"")&&Tt(i,r),a&1&&o!==(o="color: #888; padding-bottom: 16px; padding-top: 16px; width: 100%; "+(e[0].blurTranslation?"filter: blur(8px); transition: filter 0.2s;":""))&&h(n,"style",o),a&1&&G(n,"blur-translation",e[0].blurTranslation)},d(u){u&&V(n),s=!1,St(l)}}}function Za(e){let n,t,r,i,o,s,l,u;return{c(){n=g("div"),t=g("button"),t.textContent="📷",r=k(),i=g("button"),i.textContent="🔊",o=k(),s=g("button"),s.textContent="🌐",h(t,"title","Screenshot"),be(t,"background-color","#333"),be(t,"color","#fff"),be(t,"border","1px solid #555"),be(t,"padding","6px 10px"),be(t,"font-size","10px"),be(t,"border-radius","4px"),be(t,"cursor","pointer"),be(t,"transition","background-color 0.3s"),h(t,"tabindex","-1"),h(t,"class","svelte-i377rk"),h(i,"title","Audio"),be(i,"background-color","#333"),be(i,"color","#fff"),be(i,"border","1px solid #555"),be(i,"padding","6px 10px"),be(i,"font-size","10px"),be(i,"border-radius","4px"),be(i,"cursor","pointer"),be(i,"transition","background-color 0.3s"),h(i,"tabindex","-1"),h(i,"class","svelte-i377rk"),h(s,"title","Translate"),be(s,"background-color","#333"),be(s,"color","#fff"),be(s,"border","1px solid #555"),be(s,"padding","6px 10px"),be(s,"font-size","10px"),be(s,"border-radius","4px"),be(s,"cursor","pointer"),be(s,"transition","background-color 0.3s"),h(s,"tabindex","-1"),h(s,"class","svelte-i377rk"),h(n,"class","textline-buttons unselectable svelte-i377rk")},m(a,c){F(a,n,c),f(n,t),f(n,r),f(n,i),f(n,o),f(n,s),l||(u=[P(t,"click",e[20]),P(i,"click",e[21]),P(s,"click",e[22])],l=!0)},p:Oe,d(a){a&&V(n),l=!1,St(u)}}}function Ja(e){let n,t=e[7]&&e[7].includes(e[0].id),r,i,o=e[0].text+"",s,l,u,a,c=e[7]&&e[7].includes(e[0].id),p,b,d=t&&qa(e),y=e[0].translation&&Xa(e),S=c&&Za(e);return{c(){n=g("div"),d&&d.c(),r=k(),i=g("p"),s=at(o),l=k(),y&&y.c(),a=k(),S&&S.c(),h(i,"class","my-2 cursor-pointer border-2 svelte-i377rk"),h(i,"contenteditable",e[4]),G(i,"py-4",!e[5]),G(i,"px-2",!e[5]),G(i,"py-2",e[5]),G(i,"px-4",e[5]),G(i,"border-transparent",!e[3]),G(i,"cursor-text",e[4]),G(i,"border-primary",e[3]),G(i,"border-accent-focus",e[4]),G(i,"whitespace-pre-wrap",e[8]),h(n,"class","textline2 svelte-i377rk")},m(D,T){F(D,n,T),d&&d.m(n,null),f(n,r),f(n,i),f(i,s),f(i,l),y&&y.m(i,null),e[19](i),f(n,a),S&&S.m(n,null),p||(b=[P(i,"dblclick",e[10]),P(i,"keyup",Bt)],p=!0)},p(D,T){e=D,T&129&&(t=e[7]&&e[7].includes(e[0].id)),t?d?d.p(e,T):(d=qa(e),d.c(),d.m(n,r)):d&&(d.d(1),d=null),T&1&&o!==(o=e[0].text+"")&&Tt(s,o),e[0].translation?y?y.p(e,T):(y=Xa(e),y.c(),y.m(i,null)):y&&(y.d(1),y=null),T&16&&h(i,"contenteditable",e[4]),T&32&&G(i,"py-4",!e[5]),T&32&&G(i,"px-2",!e[5]),T&32&&G(i,"py-2",e[5]),T&32&&G(i,"px-4",e[5]),T&8&&G(i,"border-transparent",!e[3]),T&16&&G(i,"cursor-text",e[4]),T&8&&G(i,"border-primary",e[3]),T&16&&G(i,"border-accent-focus",e[4]),T&256&&G(i,"whitespace-pre-wrap",e[8]),T&129&&(c=e[7]&&e[7].includes(e[0].id)),c?S?S.p(e,T):(S=Za(e),S.c(),S.m(n,null)):S&&(S.d(1),S=null)},i(D){u||$r(()=>{u=Ku(i,yc,{x:e[5]?100:-100,duration:e[6]?250:0}),u.start()})},o:Oe,d(D){D&&V(n),d&&d.d(),y&&y.d(),e[19](null),S&&S.d(),p=!1,St(b)}}}function Qa(e){let n,t,r,i,o,s=e[9].get(e[0].id)+"",l,u;return r=new _e({props:{class:e[1]?"":"mr-2",path:Mf}}),{c(){n=g("div"),t=g("div"),le(r.$$.fragment),i=k(),o=g("span"),l=at(s),G(o,"mt-2",e[1]),h(t,"class","flex items-center"),h(n,"class","flex justify-center text-xs my-2 py-2 border-primary border-dashed milestone"),G(n,"border-x-2",e[1]),G(n,"border-y-2",!e[1]),G(n,"py-4",!e[5]),G(n,"px-2",!e[5]),G(n,"py-2",e[5]),G(n,"px-4",e[5])},m(a,c){F(a,n,c),f(n,t),re(r,t,null),f(t,i),f(t,o),f(o,l),u=!0},p(a,c){const p={};c&2&&(p.class=a[1]?"":"mr-2"),r.$set(p),(!u||c&513)&&s!==(s=a[9].get(a[0].id)+"")&&Tt(l,s),(!u||c&2)&&G(o,"mt-2",a[1]),(!u||c&2)&&G(n,"border-x-2",a[1]),(!u||c&2)&&G(n,"border-y-2",!a[1]),(!u||c&32)&&G(n,"py-4",!a[5]),(!u||c&32)&&G(n,"px-2",!a[5]),(!u||c&32)&&G(n,"py-2",a[5]),(!u||c&32)&&G(n,"px-4",a[5])},i(a){u||(N(r.$$.fragment,a),u=!0)},o(a){W(r.$$.fragment,a),u=!1},d(a){a&&V(n),ie(r)}}}function ap(e){let n=e[0].text,t,r,i,o=e[9].has(e[0].id),s,l,u=Ja(e),a=o&&Qa(e);return{c(){u.c(),t=k(),r=new ju(!1),i=k(),a&&a.c(),s=Hn(),r.a=i},m(c,p){u.m(c,p),F(c,t,p),r.m(Lc,c,p),F(c,i,p),a&&a.m(c,p),F(c,s,p),l=!0},p(c,[p]){p&1&&Ct(n,n=c[0].text)?(rt(),W(u,1,1,Oe),it(),u=Ja(c),u.c(),N(u,1),u.m(t.parentNode,t)):u.p(c,p),p&513&&(o=c[9].has(c[0].id)),o?a?(a.p(c,p),p&513&&N(a,1)):(a=Qa(c),a.c(),N(a,1),a.m(s.parentNode,s)):a&&(rt(),W(a,1,1,()=>{a=null}),it())},i(c){l||(N(u),N(a),l=!0)},o(c){W(u),W(a),l=!1},d(c){u.d(c),c&&V(t),c&&r.d(),c&&V(i),a&&a.d(c),c&&V(s)}}}const eu=function(){this.style.filter="blur(0px)",this.style.transition="filter 0.3s"},tu=function(){this.style.filter="blur(8px)"};function up(e,n,t){let r,i,o,s,l,u,a,c,p,b;w(e,Ui,A=>t(6,i=A)),w(e,Fr,A=>t(24,o=A)),w(e,Qe,A=>t(25,s=A)),w(e,Hl,A=>t(26,l=A)),w(e,$l,A=>t(27,u=A)),w(e,kl,A=>t(7,a=A)),w(e,Vr,A=>t(1,c=A)),w(e,Ni,A=>t(8,p=A)),w(e,jr,A=>t(9,b=A));let{line:d}=n,{index:y}=n,{isLast:S}=n,{pipWindow:D=void 0}=n;function T(){t(3,Y=!1)}function I(A){return Y||A.intersectsNode(H)?d.id:void 0}const L=Br();let H,J="",Y=!1,q=!1;jl(()=>{S&&(ko(D||window,H.parentElement.parentElement,o,r,i?"smooth":"auto"),a&&a.includes(d.id)&&u&&U(d.id,"TL",l,S))}),Bu(()=>{document.removeEventListener("click",x,!1),L("edit",{inEdit:!1})});function B(A){var ee;D||((ee=window.getSelection())==null||ee.removeAllRanges(),A.ctrlKey||A.metaKey?Y?(t(3,Y=!1),L("deselected",d.id)):(t(3,Y=!0),L("selected",d.id)):(J=H.innerText,t(4,q=!0),L("edit",{inEdit:!0}),document.addEventListener("click",x,!1),po().then(()=>{H.focus()})))}function x(A){const ee=A.target;H.contains(ee)||(t(4,q=!1),document.removeEventListener("click",x,!1),L("edit",{inEdit:!1,data:{originalText:J,newText:H.innerText,lineIndex:y,line:d}}))}async function j(A){try{const ee=await fetch(yo("/update_checkbox"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A})});if(!ee.ok)throw new Error(`HTTP error! Status: ${ee.status}`)}catch(ee){console.error("Error updating checkbox:",ee)}}function U(A,ee,he=!1,xe=!1){console.log(A);let Ie={TL:"/translate-line",Screenshot:"/get-screenshot",Audio:"/play-audio"}[ee]??"";fetch(yo(Ie),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A,text:d.text})}).then(Te=>{if(!Te.ok)throw new Error(`HTTP error! Status: ${Te.status}`);return Te.json()}).then(Te=>{ee==="TL"&&(t(0,d.translation=Te.TL,d),he?t(0,d.blurTranslation=!0,d):t(0,d.blurTranslation=!1,d),d.text.endsWith(`
29
+ `)||t(0,d.text+=`
30
+ `,d),R(Qe,s[d.index]=d,s),xe&&ko(D||window,H.parentElement.parentElement,o,r,i?"smooth":"auto")),console.log(`${ee} action completed for event ID: ${A}`,Te)}).catch(Te=>{console.error(`Error performing ${ee} action for event ID: ${A}`,Te)})}const Z=()=>j(d.id);function ve(A){pt[A?"unshift":"push"](()=>{H=A,t(2,H)})}const se=()=>U(d.id,"Screenshot"),z=()=>U(d.id,"Audio"),O=()=>U(d.id,"TL");return e.$$set=A=>{"line"in A&&t(0,d=A.line),"index"in A&&t(13,y=A.index),"isLast"in A&&t(14,S=A.isLast),"pipWindow"in A&&t(15,D=A.pipWindow)},e.$$.update=()=>{e.$$.dirty&32770&&t(5,r=!D&&c)},[d,c,H,Y,q,r,i,a,p,b,B,j,U,y,S,D,T,I,Z,ve,se,z,O]}class Ec extends zt{constructor(n){super(),Ut(this,n,up,ap,Ct,{line:0,index:13,isLast:14,pipWindow:15,deselect:16,getIdIfSelected:17})}get deselect(){return this.$$.ctx[16]}get getIdIfSelected(){return this.$$.ctx[17]}}function cp(e){let n,t,r,i,o,s,l,u;return r=new _e({props:{path:qu}}),{c(){n=g("div"),t=g("div"),le(r.$$.fragment),i=k(),o=g("textarea"),h(t,"class","flex cursor-pointer items-end md:items-center"),h(n,"class","flex justify-end p-4"),h(o,"class","flex-1 overflow-auto ml-10 mr-2 mb-4 p-1 pb-2"),be(o,"resize","none"),o.value=e[0]},m(a,c){F(a,n,c),f(n,t),re(r,t,null),F(a,i,c),F(a,o,c),s=!0,l||(u=[P(t,"click",e[3]),P(t,"keyup",Bt),P(o,"blur",e[2])],l=!0)},p(a,[c]){(!s||c&1)&&(o.value=a[0])},i(a){s||(N(r.$$.fragment,a),s=!0)},o(a){W(r.$$.fragment,a),s=!1},d(a){a&&V(n),ie(r),a&&V(i),a&&V(o),l=!1,St(u)}}}function fp(e,n,t){let r,i;w(e,wo,l=>t(0,r=l)),w(e,Il,l=>t(1,i=l));function o(l){R(wo,r=l.target.value,r)}return[r,i,o,()=>R(Il,i=!1,i)]}class hp extends zt{constructor(n){super(),Ut(this,n,fp,cp,Ct,{})}}const{Map:xc}=Os;function nu(e,n,t){const r=e.slice();return r[62]=n[t],r}function ru(e,n,t){const r=e.slice();return r[62]=n[t],r}function pp(e){let n,t,r,i,o,s=[],l=new xc,u,a,c,p,b,d,y,S,D,T,I,L,H,J,Y,q,B,x,j,U,Z,ve,se,z=e[2].length?e[2]:e[4];const O=A=>A[62].name;for(let A=0;A<z.length;A+=1){let ee=nu(e,z,A),he=O(ee);l.set(he,s[A]=iu(he,ee))}return c=new _e({props:{path:wf}}),S=new _e({props:{path:_s}}),H=new _e({props:{path:Af}}),x=new _e({props:{path:oo}}),{c(){n=g("details"),t=g("summary"),t.textContent="Presets",r=k(),i=g("div"),o=g("select");for(let A=0;A<s.length;A+=1)s[A].c();u=k(),a=g("div"),le(c.$$.fragment),p=k(),b=g("span"),b.textContent="Save",d=k(),y=g("div"),le(S.$$.fragment),D=k(),T=g("span"),T.textContent="Export/Import",I=k(),L=g("div"),le(H.$$.fragment),J=k(),Y=g("span"),Y.textContent="Reload",q=k(),B=g("div"),le(x.$$.fragment),j=k(),U=g("span"),U.textContent="Delete",h(o,"class","select flex-1 max-w-md"),h(b,"class","label-text"),h(a,"role","button"),h(a,"class","flex flex-col items-center hover:text-primary ml-3"),h(T,"class","label-text"),h(y,"role","button"),h(y,"class","flex flex-col items-center hover:text-primary ml-3"),h(Y,"class","label-text"),h(L,"role","button"),h(L,"class","flex flex-col items-center hover:text-primary ml-3"),G(L,"invisible",!e[1]),h(U,"class","label-text"),h(B,"role","button"),h(B,"class","flex flex-col items-center hover:text-primary ml-3"),G(B,"invisible",!e[1]),h(i,"class","flex items-center justify-between mt-2"),h(n,"role","button"),h(n,"class","col-span-4 mb-2")},m(A,ee){F(A,n,ee),f(n,t),f(n,r),f(n,i),f(i,o);for(let he=0;he<s.length;he+=1)s[he].m(o,null);_i(o,e[1]),f(i,u),f(i,a),re(c,a,null),f(a,p),f(a,b),f(i,d),f(i,y),re(S,y,null),f(y,D),f(y,T),f(i,I),f(i,L),re(H,L,null),f(L,J),f(L,Y),f(i,q),f(i,B),re(x,B,null),f(B,j),f(B,U),Z=!0,ve||(se=[P(o,"change",e[6]),P(a,"click",e[8]),P(a,"keyup",Bt),P(y,"click",e[12]),P(y,"keyup",Bt),P(L,"click",e[13]),P(L,"keyup",Bt),P(B,"click",e[9]),P(B,"keyup",Bt)],ve=!0)},p(A,ee){ee[0]&20&&(z=A[2].length?A[2]:A[4],s=Ur(s,ee,O,1,A,z,l,o,Bl,iu,null,nu)),(!Z||ee[0]&22)&&_i(o,A[1]),(!Z||ee[0]&2)&&G(L,"invisible",!A[1]),(!Z||ee[0]&2)&&G(B,"invisible",!A[1])},i(A){Z||(N(c.$$.fragment,A),N(S.$$.fragment,A),N(H.$$.fragment,A),N(x.$$.fragment,A),Z=!0)},o(A){W(c.$$.fragment,A),W(S.$$.fragment,A),W(H.$$.fragment,A),W(x.$$.fragment,A),Z=!1},d(A){A&&V(n);for(let ee=0;ee<s.length;ee+=1)s[ee].d();ie(c),ie(S),ie(H),ie(x),ve=!1,St(se)}}}function dp(e){let n,t=[],r=new xc,i,o,s=e[2].length?e[2]:e[4];const l=u=>u[62].name;for(let u=0;u<s.length;u+=1){let a=ru(e,s,u),c=l(a);r.set(c,t[u]=ou(c,a))}return{c(){n=g("select");for(let u=0;u<t.length;u+=1)t[u].c();h(n,"class","w-48 hidden sm:block"),G(n,"sm:hidden",!e[3]||e[2].length<2)},m(u,a){F(u,n,a);for(let c=0;c<t.length;c+=1)t[c].m(n,null);_i(n,e[1]),i||(o=P(n,"change",e[6]),i=!0)},p(u,a){a[0]&20&&(s=u[2].length?u[2]:u[4],t=Ur(t,a,l,1,u,s,r,n,Bl,ou,null,ru)),a[0]&22&&_i(n,u[1]),a[0]&12&&G(n,"sm:hidden",!u[3]||u[2].length<2)},i:Oe,o:Oe,d(u){u&&V(n);for(let a=0;a<t.length;a+=1)t[a].d();i=!1,o()}}}function iu(e,n){let t,r=(n[62].name||"No Presets stored")+"",i,o,s;return{key:e,first:null,c(){t=g("option"),i=at(r),o=k(),t.__value=s=n[62].name,t.value=t.__value,this.first=t},m(l,u){F(l,t,u),f(t,i),f(t,o)},p(l,u){n=l,u[0]&4&&r!==(r=(n[62].name||"No Presets stored")+"")&&Tt(i,r),u[0]&4&&s!==(s=n[62].name)&&(t.__value=s,t.value=t.__value)},d(l){l&&V(t)}}}function ou(e,n){let t,r=n[62].name+"",i,o,s;return{key:e,first:null,c(){t=g("option"),i=at(r),o=k(),t.__value=s=n[62].name,t.value=t.__value,this.first=t},m(l,u){F(l,t,u),f(t,i),f(t,o)},p(l,u){n=l,u[0]&4&&r!==(r=n[62].name+"")&&Tt(i,r),u[0]&4&&s!==(s=n[62].name)&&(t.__value=s,t.value=t.__value)},d(l){l&&V(t)}}}function mp(e){let n,t,r,i;const o=[dp,pp],s=[];function l(u,a){return u[0]?0:1}return n=l(e),t=s[n]=o[n](e),{c(){t.c(),r=Hn()},m(u,a){s[n].m(u,a),F(u,r,a),i=!0},p(u,a){let c=n;n=l(u),n===c?s[n].p(u,a):(rt(),W(s[c],1,1,()=>{s[c]=null}),it(),t=s[n],t?t.p(u,a):(t=s[n]=o[n](u),t.c()),N(t,1),t.m(r.parentNode,r))},i(u){i||(N(t),i=!0)},o(u){W(t),i=!1},d(u){s[n].d(u),u&&V(r)}}}function gp(e,n,t){let r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I,L,H,J,Y,q,B,x,j,U,Z,ve,se,z,O,A,ee,he,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re,Ye,Fe,we,Me,mt,pe,ut,We,Ve;w(e,rr,_=>t(1,r=_)),w(e,_n,_=>t(2,i=_)),w(e,ze,_=>t(14,o=_)),w(e,Si,_=>t(15,s=_)),w(e,Wr,_=>t(16,l=_)),w(e,js,_=>t(17,u=_)),w(e,Ws,_=>t(18,a=_)),w(e,jr,_=>t(19,c=_)),w(e,Dr,_=>t(20,p=_)),w(e,Gi,_=>t(21,b=_)),w(e,Ki,_=>t(22,d=_)),w(e,Yi,_=>t(23,y=_)),w(e,zi,_=>t(24,S=_)),w(e,Ui,_=>t(25,D=_)),w(e,Bi,_=>t(26,T=_)),w(e,ji,_=>t(27,I=_)),w(e,Wi,_=>t(28,L=_)),w(e,Fi,_=>t(29,H=_)),w(e,Vi,_=>t(30,J=_)),w(e,Ri,_=>t(31,Y=_)),w(e,Ni,_=>t(32,q=_)),w(e,Fr,_=>t(33,B=_)),w(e,Vr,_=>t(34,x=_)),w(e,Hi,_=>t(35,j=_)),w(e,$i,_=>t(36,U=_)),w(e,Mi,_=>t(37,Z=_)),w(e,Rr,_=>t(38,ve=_)),w(e,Ii,_=>t(39,se=_)),w(e,Oi,_=>t(40,z=_)),w(e,Di,_=>t(41,O=_)),w(e,Ti,_=>t(42,A=_)),w(e,Ai,_=>t(43,ee=_)),w(e,Pi,_=>t(44,he=_)),w(e,xi,_=>t(45,xe=_)),w(e,Ei,_=>t(46,Xe=_)),w(e,Li,_=>t(47,Ie=_)),w(e,Ci,_=>t(48,Te=_)),w(e,_o,_=>t(3,Ke=_)),w(e,vo,_=>t(49,Ne=_)),w(e,yi,_=>t(50,_t=_)),w(e,or,_=>t(51,dt=_)),w(e,Ir,_=>t(52,Re=_)),w(e,Pr,_=>t(53,Ye=_)),w(e,Or,_=>t(54,Fe=_)),w(e,ki,_=>t(55,we=_)),w(e,Tr,_=>t(56,Me=_)),w(e,Nr,_=>t(57,mt=_)),w(e,Mn,_=>t(58,pe=_)),w(e,bo,_=>t(59,ut=_)),w(e,rn,_=>t(60,We=_)),w(e,Ar,_=>t(61,Ve=_));let{isQuickSwitch:ot=!1}=n;function gt(){return{theme$:Ve,replacements$:We,windowTitle$:ut,websocketUrl$:pe,secondaryWebsocketUrl$:mt,fontSize$:Me,characterMilestone$:p,onlineFont$:we,preventLastDuplicate$:Fe,maxLines$:Ye,maxPipLines$:Re,afkTimer$:dt,adjustTimerOnAfk$:_t,enableExternalClipboardMonitor$:Ne,showPresetQuickSwitch$:Ke,skipResetConfirmations$:s,persistStats$:Te,persistNotes$:Ie,persistLines$:Xe,persistActionHistory$:xe,enablePaste$:he,blockCopyOnPage$:ee,allowPasteDuringPause$:A,allowNewLineDuringPause$:O,autoStartTimerDuringPausePaste$:z,autoStartTimerDuringPause$:se,preventGlobalDuplicate$:ve,mergeEqualLineStarts$:Z,filterNonCJKLines:U,flashOnMissedLine$:j,displayVertical$:x,reverseLineOrder$:B,preserveWhitespace$:q,removeAllWhitespace$:Y,showTimer$:J,showSpeed$:H,showCharacterCount$:L,showLineCount$:I,blurStats$:T,enableLineAnimation$:D,enableAfkBlur$:S,enableAfkBlurRestart$:y,continuousReconnect$:l,showConnectionErrors$:d,customCSS$:b}}function je(_,ce=!0){Ar.next(_.settings.theme$??E.theme$),rn.next(_.settings.replacements$??E.replacements$),bo.next(_.settings.windowTitle$??E.windowTitle$),Mn.next(_.settings.websocketUrl$??E.websocketUrl$),Nr.next(_.settings.secondaryWebsocketUrl$??""),Tr.next(_.settings.fontSize$??E.fontSize$),Dr.next(_.settings.characterMilestone$??E.characterMilestone$),ki.next(_.settings.onlineFont$??E.onlineFont$),Or.next(_.settings.preventLastDuplicate$??E.preventLastDuplicate$),Pr.next(_.settings.maxLines$??E.maxLines$),Ir.next(_.settings.maxPipLines$??E.maxPipLines$),or.next(_.settings.afkTimer$??E.afkTimer$),yi.next(_.settings.adjustTimerOnAfk$??E.adjustTimerOnAfk$),vo.next(_.settings.enableExternalClipboardMonitor$??E.enableExternalClipboardMonitor$),_o.next(_.settings.showPresetQuickSwitch$??E.showPresetQuickSwitch$),Si.next(_.settings.skipResetConfirmations$??E.skipResetConfirmations$),Ci.next(_.settings.persistStats$??E.persistStats$),Li.next(_.settings.persistNotes$??E.persistNotes$),Ei.next(_.settings.persistLines$??E.persistLines$),xi.next(_.settings.persistActionHistory$??E.persistActionHistory$),Pi.next(_.settings.enablePaste$??E.enablePaste$),Ai.next(_.settings.blockCopyOnPage$??E.blockCopyOnPage$),Ti.next(_.settings.allowPasteDuringPause$??E.allowPasteDuringPause$),Di.next(_.settings.allowNewLineDuringPause$??E.allowNewLineDuringPause$),Oi.next(_.settings.autoStartTimerDuringPausePaste$??E.autoStartTimerDuringPausePaste$),Ii.next(_.settings.autoStartTimerDuringPause$??E.autoStartTimerDuringPause$),Rr.next(_.settings.preventGlobalDuplicate$??E.preventGlobalDuplicate$),Mi.next(_.settings.mergeEqualLineStarts$??E.mergeEqualLineStarts$),$i.next(_.settings.filterNonCJKLines??E.filterNonCJKLines),Hi.next(_.settings.flashOnMissedLine$??E.flashOnMissedLine$),Vr.next(_.settings.displayVertical$??E.displayVertical$),Fr.next(_.settings.reverseLineOrder$??E.reverseLineOrder$),Ni.next(_.settings.preserveWhitespace$??E.preserveWhitespace$),Ri.next(_.settings.removeAllWhitespace$??E.removeAllWhitespace$),Vi.next(_.settings.showTimer$??E.showTimer$),Fi.next(_.settings.showSpeed$??E.showSpeed$),Wi.next(_.settings.showCharacterCount$??E.showCharacterCount$),ji.next(_.settings.showLineCount$??E.showLineCount$),Bi.next(_.settings.blurStats$??E.blurStats$),Ui.next(_.settings.enableLineAnimation$??E.enableLineAnimation$),zi.next(_.settings.enableAfkBlur$??E.enableAfkBlur$),Yi.next(_.settings.enableAfkBlurRestart$??E.enableAfkBlurRestart$),Wr.next(_.settings.continuousReconnect$??E.continuousReconnect$),Ki.next(_.settings.showConnectionErrors$??E.showConnectionErrors$),Gi.next(_.settings.customCSS$??E.customCSS$),ce&&R(rr,r=_.name,r),p===0&&R(jr,c=new Map,c),po().then(()=>{Be("layoutChange"),a!==1&&l&&Zl.next(),u!==1&&l&&Jl.next()})}const ae=[{name:""}],Be=Br();function et(_){const ce=_.target;ke(ce.selectedOptions[0].value)}function ke(_){const ce=i.find(tt=>tt.name===_);ce&&je(ce)}async function Se(){const{canceled:_,data:ce}=await new Promise(bt=>{R(ze,o={icon:Qt,askForData:"text",dataValue:r||"Preset Name",message:"",callback:bt},o)});if(_||!ce)return;const tt=i.findIndex(bt=>bt.name===ce),Pe={name:ce,settings:gt()};tt>-1?R(_n,i[tt]=Pe,i):R(_n,i=[...i,Pe],i),R(rr,r=ce,r)}async function Lt(){if(!s){const{canceled:_}=await new Promise(ce=>{R(ze,o={icon:Qt,message:"Preset will be deleted",callback:ce},o)});if(_)return}R(_n,i=i.filter(_=>_.name!==r),i),R(rr,r="",r)}const Ht=_=>Be("exportImportPreset",_),ye=()=>ke(r);return e.$$set=_=>{"isQuickSwitch"in _&&t(0,ot=_.isQuickSwitch)},[ot,r,i,Ke,ae,Be,et,ke,Se,Lt,gt,je,Ht,ye]}class Pc extends zt{constructor(n){super(),Ut(this,n,gp,mp,Ct,{isQuickSwitch:0,getCurrentSettings:10,updateSettingsWithPreset:11},null,[-1,-1,-1])}get getCurrentSettings(){return this.$$.ctx[10]}get updateSettingsWithPreset(){return this.$$.ctx[11]}}function bp(e,n){const t=r=>{!r.defaultPrevented&&!e.contains(r.target)&&n(r)};return document.addEventListener("click",t,!0),{destroy(){document.removeEventListener("click",t,!0)}}}function lu(e,n,t){const r=e.slice();return r[22]=n[t],r}function su(e){let n,t,r,i,o;return t=new _e({props:{path:Sf}}),{c(){n=g("button"),le(t.$$.fragment),h(n,"title","Save"),h(n,"class","hover:text-primary")},m(s,l){F(s,n,l),re(t,n,null),r=!0,i||(o=P(n,"click",e[10]),i=!0)},p:Oe,i(s){r||(N(t.$$.fragment,s),r=!0)},o(s){W(t.$$.fragment,s),r=!1},d(s){s&&V(n),ie(t),i=!1,o()}}}function au(e,n){let t,r,i,o=n[22].label+"",s,l,u,a;return{key:e,first:null,c(){t=g("label"),r=g("input"),i=k(),s=at(o),l=k(),h(r,"type","checkbox"),r.__value=n[22].value,r.value=r.__value,n[18][0].push(r),this.first=t},m(c,p){F(c,t,p),f(t,r),r.checked=~n[0].flags.indexOf(r.__value),f(t,i),f(t,s),f(t,l),u||(a=[P(r,"change",n[17]),P(r,"change",n[9])],u=!0)},p(c,p){n=c,p&1&&(r.checked=~n[0].flags.indexOf(r.__value))},d(c){c&&V(t),n[18][0].splice(n[18][0].indexOf(r),1),u=!1,St(a)}}}function vp(e){let n=(e[5]??"")+"",t,r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I=[],L=new Map,H,J,Y,q,B=(e[4]||e[3])+"",x,j,U,Z=e[0].pattern&&su(e);l=new _e({props:{path:Gu}}),c=new _e({props:{path:Cf}});let ve=e[7];const se=z=>z[22].value;for(let z=0;z<ve.length;z+=1){let O=lu(e,ve,z),A=se(O);L.set(A,I[z]=au(A,O))}return{c(){t=at(n),r=k(),i=g("div"),Z&&Z.c(),o=k(),s=g("button"),le(l.$$.fragment),u=k(),a=g("button"),le(c.$$.fragment),p=k(),b=g("div"),d=g("input"),y=k(),S=g("input"),D=k(),T=g("div");for(let z=0;z<I.length;z+=1)I[z].c();H=k(),J=g("textarea"),Y=k(),q=g("div"),h(s,"title","Cancel"),h(s,"class","ml-2 hover:text-primary"),h(a,"title","Cancel"),h(a,"class","ml-2 hover:text-primary"),h(i,"class","flex justify-end my-2"),h(d,"placeholder","text pattern"),h(d,"class","w-full my-2"),h(S,"placeholder","replacement pattern"),h(S,"class","w-full my-2"),h(T,"class","flex justify-between my-4"),h(J,"name","test-value"),h(J,"placeholder","test value"),h(J,"class","w-full my-4"),h(J,"rows","3"),h(q,"class","whitespace-pre-wrap break-all")},m(z,O){F(z,t,O),F(z,r,O),F(z,i,O),Z&&Z.m(i,null),f(i,o),f(i,s),re(l,s,null),f(i,u),f(i,a),re(c,a,null),F(z,p,O),F(z,b,O),f(b,d),At(d,e[0].pattern),e[15](d),f(b,y),f(b,S),At(S,e[0].replaces),f(b,D),f(b,T);for(let A=0;A<I.length;A+=1)I[A].m(T,null);f(b,H),f(b,J),At(J,e[2]),f(b,Y),f(b,q),q.innerHTML=B,x=!0,j||(U=[P(s,"click",e[12]),P(a,"click",e[13]),P(d,"input",e[14]),P(d,"input",e[9]),P(S,"input",e[16]),P(S,"input",e[9]),P(J,"input",e[19]),P(J,"input",e[9])],j=!0)},p(z,[O]){(!x||O&32)&&n!==(n=(z[5]??"")+"")&&Tt(t,n),z[0].pattern?Z?(Z.p(z,O),O&1&&N(Z,1)):(Z=su(z),Z.c(),N(Z,1),Z.m(i,o)):Z&&(rt(),W(Z,1,1,()=>{Z=null}),it()),O&1&&d.value!==z[0].pattern&&At(d,z[0].pattern),O&1&&S.value!==z[0].replaces&&At(S,z[0].replaces),O&641&&(ve=z[7],I=Ur(I,O,se,1,z,ve,L,T,Bl,au,null,lu)),O&4&&At(J,z[2]),(!x||O&24)&&B!==(B=(z[4]||z[3])+"")&&(q.innerHTML=B)},i(z){x||(N(Z),N(l.$$.fragment,z),N(c.$$.fragment,z),x=!0)},o(z){W(Z),W(l.$$.fragment,z),W(c.$$.fragment,z),x=!1},d(z){z&&V(t),z&&V(r),z&&V(i),Z&&Z.d(),ie(l),ie(c),z&&V(p),z&&V(b),e[15](null);for(let O=0;O<I.length;O+=1)I[O].d();j=!1,St(U)}}}function _p(e,n,t){let r,i;w(e,rn,x=>t(20,r=x));let{currentReplacement:o}=n;const s=Br(),l=new Xi,u=o?JSON.parse(JSON.stringify(o)):{pattern:"",replaces:"",flags:[],enabled:!0},a=[{label:"global",value:"g"},{label:"multiline",value:"m"},{label:"insensitive",value:"i"},{label:"unicode",value:"u"}],c=l.pipe(Fs(500),Jn(()=>{try{if(t(4,y=""),!u.pattern||!b)return;t(3,d=Sc(b,[u]))}catch({message:x}){t(4,y=`Error: ${x}`)}}),er());w(e,c,x=>t(5,i=x));let p,b="",d="",y="";function S(){p.setCustomValidity(y),l.next()}function D(){if(!o&&r.find(x=>x.pattern===u.pattern))return p.setCustomValidity("This pattern already exists"),p.reportValidity();o?R(rn,r=r.map(x=>x.pattern===o.pattern?u:x),r):R(rn,r=[...r,u],r),s("close")}const T=[[]],I=()=>s("close"),L=()=>window.open("https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#description","_blank");function H(){u.pattern=this.value,t(0,u)}function J(x){pt[x?"unshift":"push"](()=>{p=x,t(1,p)})}function Y(){u.replaces=this.value,t(0,u)}function q(){u.flags=nf(T[0],this.__value,this.checked),t(0,u)}function B(){b=this.value,t(2,b)}return e.$$set=x=>{"currentReplacement"in x&&t(11,o=x.currentReplacement)},[u,p,b,d,y,i,s,a,c,S,D,o,I,L,H,J,Y,q,T,B]}class wp extends zt{constructor(n){super(),Ut(this,n,_p,vp,Ct,{currentReplacement:11})}}function uu(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,r)}return t}function yn(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?uu(Object(t),!0).forEach(function(r){kp(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uu(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function Sl(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Sl=function(n){return typeof n}:Sl=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Sl(e)}function kp(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Sn(){return Sn=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Sn.apply(this,arguments)}function yp(e,n){if(e==null)return{};var t={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(n.indexOf(i)>=0)&&(t[i]=e[i]);return t}function Sp(e,n){if(e==null)return{};var t=yp(e,n),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}var Cp="1.15.2";function $n(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Fn=$n(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Eo=$n(/Edge/i),cu=$n(/firefox/i),lo=$n(/safari/i)&&!$n(/chrome/i)&&!$n(/android/i),Ac=$n(/iP(ad|od|hone)/i),Tc=$n(/chrome/i)&&$n(/android/i),Dc={capture:!1,passive:!1};function De(e,n,t){e.addEventListener(n,t,!Fn&&Dc)}function Ee(e,n,t){e.removeEventListener(n,t,!Fn&&Dc)}function Nl(e,n){if(n){if(n[0]===">"&&(n=n.substring(1)),e)try{if(e.matches)return e.matches(n);if(e.msMatchesSelector)return e.msMatchesSelector(n);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(n)}catch{return!1}return!1}}function Lp(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function fn(e,n,t,r){if(e){t=t||document;do{if(n!=null&&(n[0]===">"?e.parentNode===t&&Nl(e,n):Nl(e,n))||r&&e===t)return e;if(e===t)break}while(e=Lp(e))}return null}var fu=/\s+/g;function Pt(e,n,t){if(e&&n)if(e.classList)e.classList[t?"add":"remove"](n);else{var r=(" "+e.className+" ").replace(fu," ").replace(" "+n+" "," ");e.className=(r+(t?" "+n:"")).replace(fu," ")}}function fe(e,n,t){var r=e&&e.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),n===void 0?t:t[n];!(n in r)&&n.indexOf("webkit")===-1&&(n="-webkit-"+n),r[n]=t+(typeof t=="string"?"":"px")}}function bi(e,n){var t="";if(typeof e=="string")t=e;else do{var r=fe(e,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!n&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function Oc(e,n,t){if(e){var r=e.getElementsByTagName(n),i=0,o=r.length;if(t)for(;i<o;i++)t(r[i],i);return r}return[]}function kn(){var e=document.scrollingElement;return e||document.documentElement}function st(e,n,t,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var o,s,l,u,a,c,p;if(e!==window&&e.parentNode&&e!==kn()?(o=e.getBoundingClientRect(),s=o.top,l=o.left,u=o.bottom,a=o.right,c=o.height,p=o.width):(s=0,l=0,u=window.innerHeight,a=window.innerWidth,c=window.innerHeight,p=window.innerWidth),(n||t)&&e!==window&&(i=i||e.parentNode,!Fn))do if(i&&i.getBoundingClientRect&&(fe(i,"transform")!=="none"||t&&fe(i,"position")!=="static")){var b=i.getBoundingClientRect();s-=b.top+parseInt(fe(i,"border-top-width")),l-=b.left+parseInt(fe(i,"border-left-width")),u=s+o.height,a=l+o.width;break}while(i=i.parentNode);if(r&&e!==window){var d=bi(i||e),y=d&&d.a,S=d&&d.d;d&&(s/=S,l/=y,p/=y,c/=S,u=s+c,a=l+p)}return{top:s,left:l,bottom:u,right:a,width:p,height:c}}}function hu(e,n,t){for(var r=ir(e,!0),i=st(e)[n];r;){var o=st(r)[t],s=void 0;if(t==="top"||t==="left"?s=i>=o:s=i<=o,!s)return r;if(r===kn())break;r=ir(r,!1)}return!1}function qi(e,n,t,r){for(var i=0,o=0,s=e.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==ue.ghost&&(r||s[o]!==ue.dragged)&&fn(s[o],t.draggable,e,!1)){if(i===n)return s[o];i++}o++}return null}function Bs(e,n){for(var t=e.lastElementChild;t&&(t===ue.ghost||fe(t,"display")==="none"||n&&!Nl(t,n));)t=t.previousElementSibling;return t||null}function jt(e,n){var t=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==ue.clone&&(!n||Nl(e,n))&&t++;return t}function pu(e){var n=0,t=0,r=kn();if(e)do{var i=bi(e),o=i.a,s=i.d;n+=e.scrollLeft*o,t+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[n,t]}function Ep(e,n){for(var t in e)if(e.hasOwnProperty(t)){for(var r in n)if(n.hasOwnProperty(r)&&n[r]===e[t][r])return Number(t)}return-1}function ir(e,n){if(!e||!e.getBoundingClientRect)return kn();var t=e,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=fe(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return kn();if(r||n)return t;r=!0}}while(t=t.parentNode);return kn()}function xp(e,n){if(e&&n)for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}function ls(e,n){return Math.round(e.top)===Math.round(n.top)&&Math.round(e.left)===Math.round(n.left)&&Math.round(e.height)===Math.round(n.height)&&Math.round(e.width)===Math.round(n.width)}var so;function Ic(e,n){return function(){if(!so){var t=arguments,r=this;t.length===1?e.call(r,t[0]):e.apply(r,t),so=setTimeout(function(){so=void 0},n)}}}function Pp(){clearTimeout(so),so=void 0}function Mc(e,n,t){e.scrollLeft+=n,e.scrollTop+=t}function $c(e){var n=window.Polymer,t=window.jQuery||window.Zepto;return n&&n.dom?n.dom(e).cloneNode(!0):t?t(e).clone(!0)[0]:e.cloneNode(!0)}function Hc(e,n,t){var r={};return Array.from(e.children).forEach(function(i){var o,s,l,u;if(!(!fn(i,n.draggable,e,!1)||i.animated||i===t)){var a=st(i);r.left=Math.min((o=r.left)!==null&&o!==void 0?o:1/0,a.left),r.top=Math.min((s=r.top)!==null&&s!==void 0?s:1/0,a.top),r.right=Math.max((l=r.right)!==null&&l!==void 0?l:-1/0,a.right),r.bottom=Math.max((u=r.bottom)!==null&&u!==void 0?u:-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Xt="Sortable"+new Date().getTime();function Ap(){var e=[],n;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(fe(i,"display")==="none"||i===ue.ghost)){e.push({target:i,rect:st(i)});var o=yn({},e[e.length-1].rect);if(i.thisAnimationDuration){var s=bi(i,!0);s&&(o.top-=s.f,o.left-=s.e)}i.fromRect=o}})}},addAnimationState:function(r){e.push(r)},removeAnimationState:function(r){e.splice(Ep(e,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(n),typeof r=="function"&&r();return}var o=!1,s=0;e.forEach(function(l){var u=0,a=l.target,c=a.fromRect,p=st(a),b=a.prevFromRect,d=a.prevToRect,y=l.rect,S=bi(a,!0);S&&(p.top-=S.f,p.left-=S.e),a.toRect=p,a.thisAnimationDuration&&ls(b,p)&&!ls(c,p)&&(y.top-p.top)/(y.left-p.left)===(c.top-p.top)/(c.left-p.left)&&(u=Dp(y,b,d,i.options)),ls(p,c)||(a.prevFromRect=c,a.prevToRect=p,u||(u=i.options.animation),i.animate(a,y,p,u)),u&&(o=!0,s=Math.max(s,u),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},u),a.thisAnimationDuration=u)}),clearTimeout(n),o?n=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,i,o,s){if(s){fe(r,"transition",""),fe(r,"transform","");var l=bi(this.el),u=l&&l.a,a=l&&l.d,c=(i.left-o.left)/(u||1),p=(i.top-o.top)/(a||1);r.animatingX=!!c,r.animatingY=!!p,fe(r,"transform","translate3d("+c+"px,"+p+"px,0)"),this.forRepaintDummy=Tp(r),fe(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),fe(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){fe(r,"transition",""),fe(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function Tp(e){return e.offsetWidth}function Dp(e,n,t,r){return Math.sqrt(Math.pow(n.top-e.top,2)+Math.pow(n.left-e.left,2))/Math.sqrt(Math.pow(n.top-t.top,2)+Math.pow(n.left-t.left,2))*r.animation}var fi=[],ss={initializeByDefault:!0},xo={mount:function(n){for(var t in ss)ss.hasOwnProperty(t)&&!(t in n)&&(n[t]=ss[t]);fi.forEach(function(r){if(r.pluginName===n.pluginName)throw"Sortable: Cannot mount plugin ".concat(n.pluginName," more than once")}),fi.push(n)},pluginEvent:function(n,t,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var o=n+"Global";fi.forEach(function(s){t[s.pluginName]&&(t[s.pluginName][o]&&t[s.pluginName][o](yn({sortable:t},r)),t.options[s.pluginName]&&t[s.pluginName][n]&&t[s.pluginName][n](yn({sortable:t},r)))})},initializePlugins:function(n,t,r,i){fi.forEach(function(l){var u=l.pluginName;if(!(!n.options[u]&&!l.initializeByDefault)){var a=new l(n,t,n.options);a.sortable=n,a.options=n.options,n[u]=a,Sn(r,a.defaults)}});for(var o in n.options)if(n.options.hasOwnProperty(o)){var s=this.modifyOption(n,o,n.options[o]);typeof s<"u"&&(n.options[o]=s)}},getEventProperties:function(n,t){var r={};return fi.forEach(function(i){typeof i.eventProperties=="function"&&Sn(r,i.eventProperties.call(t[i.pluginName],n))}),r},modifyOption:function(n,t,r){var i;return fi.forEach(function(o){n[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[t]=="function"&&(i=o.optionListeners[t].call(n[o.pluginName],r))}),i}};function Op(e){var n=e.sortable,t=e.rootEl,r=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,u=e.oldIndex,a=e.newIndex,c=e.oldDraggableIndex,p=e.newDraggableIndex,b=e.originalEvent,d=e.putSortable,y=e.extraEventProperties;if(n=n||t&&t[Xt],!!n){var S,D=n.options,T="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Fn&&!Eo?S=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(S=document.createEvent("Event"),S.initEvent(r,!0,!0)),S.to=s||t,S.from=l||t,S.item=i||t,S.clone=o,S.oldIndex=u,S.newIndex=a,S.oldDraggableIndex=c,S.newDraggableIndex=p,S.originalEvent=b,S.pullMode=d?d.lastPutMode:void 0;var I=yn(yn({},y),xo.getEventProperties(r,n));for(var L in I)S[L]=I[L];t&&t.dispatchEvent(S),D[T]&&D[T].call(n,S)}}var Ip=["evt"],Wt=function(n,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=Sp(r,Ip);xo.pluginEvent.bind(ue)(n,t,yn({dragEl:K,parentEl:Je,ghostEl:me,rootEl:qe,nextEl:Er,lastDownEl:Cl,cloneEl:Ze,cloneHidden:tr,dragStarted:to,putSortable:yt,activeSortable:ue.active,originalEvent:i,oldIndex:di,oldDraggableIndex:ao,newIndex:Gt,newDraggableIndex:Zn,hideGhostForTarget:Fc,unhideGhostForTarget:Wc,cloneNowHidden:function(){tr=!0},cloneNowShown:function(){tr=!1},dispatchSortableEvent:function(l){$t({sortable:t,name:l,originalEvent:i})}},o))};function $t(e){Op(yn({putSortable:yt,cloneEl:Ze,targetEl:K,rootEl:qe,oldIndex:di,oldDraggableIndex:ao,newIndex:Gt,newDraggableIndex:Zn},e))}var K,Je,me,qe,Er,Cl,Ze,tr,di,Gt,ao,Zn,dl,yt,pi=!1,Rl=!1,Vl=[],Cr,cn,as,us,du,mu,to,hi,uo,co=!1,ml=!1,Ll,xt,cs=[],Es=!1,Fl=[],Ql=typeof document<"u",gl=Ac,gu=Eo||Fn?"cssFloat":"float",Mp=Ql&&!Tc&&!Ac&&"draggable"in document.createElement("div"),Nc=function(){if(Ql){if(Fn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Rc=function(n,t){var r=fe(n),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=qi(n,0,t),s=qi(n,1,t),l=o&&fe(o),u=s&&fe(s),a=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+st(o).width,c=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+st(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&l.float&&l.float!=="none"){var p=l.float==="left"?"left":"right";return s&&(u.clear==="both"||u.clear===p)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||a>=i&&r[gu]==="none"||s&&r[gu]==="none"&&a+c>i)?"vertical":"horizontal"},$p=function(n,t,r){var i=r?n.left:n.top,o=r?n.right:n.bottom,s=r?n.width:n.height,l=r?t.left:t.top,u=r?t.right:t.bottom,a=r?t.width:t.height;return i===l||o===u||i+s/2===l+a/2},Hp=function(n,t){var r;return Vl.some(function(i){var o=i[Xt].options.emptyInsertThreshold;if(!(!o||Bs(i))){var s=st(i),l=n>=s.left-o&&n<=s.right+o,u=t>=s.top-o&&t<=s.bottom+o;if(l&&u)return r=i}}),r},Vc=function(n){function t(o,s){return function(l,u,a,c){var p=l.options.group.name&&u.options.group.name&&l.options.group.name===u.options.group.name;if(o==null&&(s||p))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return t(o(l,u,a,c),s)(l,u,a,c);var b=(s?l:u).options.group.name;return o===!0||typeof o=="string"&&o===b||o.join&&o.indexOf(b)>-1}}var r={},i=n.group;(!i||Sl(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,n.group=r},Fc=function(){!Nc&&me&&fe(me,"display","none")},Wc=function(){!Nc&&me&&fe(me,"display","")};Ql&&!Tc&&document.addEventListener("click",function(e){if(Rl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Rl=!1,!1},!0);var Lr=function(n){if(K){n=n.touches?n.touches[0]:n;var t=Hp(n.clientX,n.clientY);if(t){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[Xt]._onDragOver(r)}}},Np=function(n){K&&K.parentNode[Xt]._isOutsideThisEl(n.target)};function ue(e,n){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=Sn({},n),e[Xt]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Rc(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,l){s.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ue.supportPointer!==!1&&"PointerEvent"in window&&!lo,emptyInsertThreshold:5};xo.initializePlugins(this,e,t);for(var r in t)!(r in n)&&(n[r]=t[r]);Vc(n);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=n.forceFallback?!1:Mp,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?De(e,"pointerdown",this._onTapStart):(De(e,"mousedown",this._onTapStart),De(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(De(e,"dragover",this),De(e,"dragenter",this)),Vl.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),Sn(this,Ap())}ue.prototype={constructor:ue,_isOutsideThisEl:function(n){!this.el.contains(n)&&n!==this.el&&(hi=null)},_getDirection:function(n,t){return typeof this.options.direction=="function"?this.options.direction.call(this,n,t,K):this.options.direction},_onTapStart:function(n){if(n.cancelable){var t=this,r=this.el,i=this.options,o=i.preventOnFilter,s=n.type,l=n.touches&&n.touches[0]||n.pointerType&&n.pointerType==="touch"&&n,u=(l||n).target,a=n.target.shadowRoot&&(n.path&&n.path[0]||n.composedPath&&n.composedPath()[0])||u,c=i.filter;if(zp(r),!K&&!(/mousedown|pointerdown/.test(s)&&n.button!==0||i.disabled)&&!a.isContentEditable&&!(!this.nativeDraggable&&lo&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=fn(u,i.draggable,r,!1),!(u&&u.animated)&&Cl!==u)){if(di=jt(u),ao=jt(u,i.draggable),typeof c=="function"){if(c.call(this,n,u,this)){$t({sortable:t,rootEl:a,name:"filter",targetEl:u,toEl:r,fromEl:r}),Wt("filter",t,{evt:n}),o&&n.cancelable&&n.preventDefault();return}}else if(c&&(c=c.split(",").some(function(p){if(p=fn(a,p.trim(),r,!1),p)return $t({sortable:t,rootEl:p,name:"filter",targetEl:u,fromEl:r,toEl:r}),Wt("filter",t,{evt:n}),!0}),c)){o&&n.cancelable&&n.preventDefault();return}i.handle&&!fn(a,i.handle,r,!1)||this._prepareDragStart(n,l,u)}}},_prepareDragStart:function(n,t,r){var i=this,o=i.el,s=i.options,l=o.ownerDocument,u;if(r&&!K&&r.parentNode===o){var a=st(r);if(qe=o,K=r,Je=K.parentNode,Er=K.nextSibling,Cl=r,dl=s.group,ue.dragged=K,Cr={target:K,clientX:(t||n).clientX,clientY:(t||n).clientY},du=Cr.clientX-a.left,mu=Cr.clientY-a.top,this._lastX=(t||n).clientX,this._lastY=(t||n).clientY,K.style["will-change"]="all",u=function(){if(Wt("delayEnded",i,{evt:n}),ue.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!cu&&i.nativeDraggable&&(K.draggable=!0),i._triggerDragStart(n,t),$t({sortable:i,name:"choose",originalEvent:n}),Pt(K,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){Oc(K,c.trim(),fs)}),De(l,"dragover",Lr),De(l,"mousemove",Lr),De(l,"touchmove",Lr),De(l,"mouseup",i._onDrop),De(l,"touchend",i._onDrop),De(l,"touchcancel",i._onDrop),cu&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),Wt("delayStart",this,{evt:n}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Eo||Fn))){if(ue.eventCanceled){this._onDrop();return}De(l,"mouseup",i._disableDelayedDrag),De(l,"touchend",i._disableDelayedDrag),De(l,"touchcancel",i._disableDelayedDrag),De(l,"mousemove",i._delayedDragTouchMoveHandler),De(l,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&De(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(u,s.delay)}else u()}},_delayedDragTouchMoveHandler:function(n){var t=n.touches?n.touches[0]:n;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){K&&fs(K),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var n=this.el.ownerDocument;Ee(n,"mouseup",this._disableDelayedDrag),Ee(n,"touchend",this._disableDelayedDrag),Ee(n,"touchcancel",this._disableDelayedDrag),Ee(n,"mousemove",this._delayedDragTouchMoveHandler),Ee(n,"touchmove",this._delayedDragTouchMoveHandler),Ee(n,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(n,t){t=t||n.pointerType=="touch"&&n,!this.nativeDraggable||t?this.options.supportPointer?De(document,"pointermove",this._onTouchMove):t?De(document,"touchmove",this._onTouchMove):De(document,"mousemove",this._onTouchMove):(De(K,"dragend",this),De(qe,"dragstart",this._onDragStart));try{document.selection?El(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(n,t){if(pi=!1,qe&&K){Wt("dragStarted",this,{evt:t}),this.nativeDraggable&&De(document,"dragover",Np);var r=this.options;!n&&Pt(K,r.dragClass,!1),Pt(K,r.ghostClass,!0),ue.active=this,n&&this._appendGhost(),$t({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(cn){this._lastX=cn.clientX,this._lastY=cn.clientY,Fc();for(var n=document.elementFromPoint(cn.clientX,cn.clientY),t=n;n&&n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(cn.clientX,cn.clientY),n!==t);)t=n;if(K.parentNode[Xt]._isOutsideThisEl(n),t)do{if(t[Xt]){var r=void 0;if(r=t[Xt]._onDragOver({clientX:cn.clientX,clientY:cn.clientY,target:n,rootEl:t}),r&&!this.options.dragoverBubble)break}n=t}while(t=t.parentNode);Wc()}},_onTouchMove:function(n){if(Cr){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,o=n.touches?n.touches[0]:n,s=me&&bi(me,!0),l=me&&s&&s.a,u=me&&s&&s.d,a=gl&&xt&&pu(xt),c=(o.clientX-Cr.clientX+i.x)/(l||1)+(a?a[0]-cs[0]:0)/(l||1),p=(o.clientY-Cr.clientY+i.y)/(u||1)+(a?a[1]-cs[1]:0)/(u||1);if(!ue.active&&!pi){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(n,!0)}if(me){s?(s.e+=c-(as||0),s.f+=p-(us||0)):s={a:1,b:0,c:0,d:1,e:c,f:p};var b="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");fe(me,"webkitTransform",b),fe(me,"mozTransform",b),fe(me,"msTransform",b),fe(me,"transform",b),as=c,us=p,cn=o}n.cancelable&&n.preventDefault()}},_appendGhost:function(){if(!me){var n=this.options.fallbackOnBody?document.body:qe,t=st(K,!0,gl,!0,n),r=this.options;if(gl){for(xt=n;fe(xt,"position")==="static"&&fe(xt,"transform")==="none"&&xt!==document;)xt=xt.parentNode;xt!==document.body&&xt!==document.documentElement?(xt===document&&(xt=kn()),t.top+=xt.scrollTop,t.left+=xt.scrollLeft):xt=kn(),cs=pu(xt)}me=K.cloneNode(!0),Pt(me,r.ghostClass,!1),Pt(me,r.fallbackClass,!0),Pt(me,r.dragClass,!0),fe(me,"transition",""),fe(me,"transform",""),fe(me,"box-sizing","border-box"),fe(me,"margin",0),fe(me,"top",t.top),fe(me,"left",t.left),fe(me,"width",t.width),fe(me,"height",t.height),fe(me,"opacity","0.8"),fe(me,"position",gl?"absolute":"fixed"),fe(me,"zIndex","100000"),fe(me,"pointerEvents","none"),ue.ghost=me,n.appendChild(me),fe(me,"transform-origin",du/parseInt(me.style.width)*100+"% "+mu/parseInt(me.style.height)*100+"%")}},_onDragStart:function(n,t){var r=this,i=n.dataTransfer,o=r.options;if(Wt("dragStart",this,{evt:n}),ue.eventCanceled){this._onDrop();return}Wt("setupClone",this),ue.eventCanceled||(Ze=$c(K),Ze.removeAttribute("id"),Ze.draggable=!1,Ze.style["will-change"]="",this._hideClone(),Pt(Ze,this.options.chosenClass,!1),ue.clone=Ze),r.cloneId=El(function(){Wt("clone",r),!ue.eventCanceled&&(r.options.removeCloneOnHide||qe.insertBefore(Ze,K),r._hideClone(),$t({sortable:r,name:"clone"}))}),!t&&Pt(K,o.dragClass,!0),t?(Rl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(Ee(document,"mouseup",r._onDrop),Ee(document,"touchend",r._onDrop),Ee(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(r,i,K)),De(document,"drop",r),fe(K,"transform","translateZ(0)")),pi=!0,r._dragStartId=El(r._dragStarted.bind(r,t,n)),De(document,"selectstart",r),to=!0,lo&&fe(document.body,"user-select","none")},_onDragOver:function(n){var t=this.el,r=n.target,i,o,s,l=this.options,u=l.group,a=ue.active,c=dl===u,p=l.sort,b=yt||a,d,y=this,S=!1;if(Es)return;function D(ee,he){Wt(ee,y,yn({evt:n,isOwner:c,axis:d?"vertical":"horizontal",revert:s,dragRect:i,targetRect:o,canSort:p,fromSortable:b,target:r,completed:I,onMove:function(Xe,Ie){return bl(qe,t,K,i,Xe,st(Xe),n,Ie)},changed:L},he))}function T(){D("dragOverAnimationCapture"),y.captureAnimationState(),y!==b&&b.captureAnimationState()}function I(ee){return D("dragOverCompleted",{insertion:ee}),ee&&(c?a._hideClone():a._showClone(y),y!==b&&(Pt(K,yt?yt.options.ghostClass:a.options.ghostClass,!1),Pt(K,l.ghostClass,!0)),yt!==y&&y!==ue.active?yt=y:y===ue.active&&yt&&(yt=null),b===y&&(y._ignoreWhileAnimating=r),y.animateAll(function(){D("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(r===K&&!K.animated||r===t&&!r.animated)&&(hi=null),!l.dragoverBubble&&!n.rootEl&&r!==document&&(K.parentNode[Xt]._isOutsideThisEl(n.target),!ee&&Lr(n)),!l.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),S=!0}function L(){Gt=jt(K),Zn=jt(K,l.draggable),$t({sortable:y,name:"change",toEl:t,newIndex:Gt,newDraggableIndex:Zn,originalEvent:n})}if(n.preventDefault!==void 0&&n.cancelable&&n.preventDefault(),r=fn(r,l.draggable,t,!0),D("dragOver"),ue.eventCanceled)return S;if(K.contains(n.target)||r.animated&&r.animatingX&&r.animatingY||y._ignoreWhileAnimating===r)return I(!1);if(Rl=!1,a&&!l.disabled&&(c?p||(s=Je!==qe):yt===this||(this.lastPutMode=dl.checkPull(this,a,K,n))&&u.checkPut(this,a,K,n))){if(d=this._getDirection(n,r)==="vertical",i=st(K),D("dragOverValid"),ue.eventCanceled)return S;if(s)return Je=qe,T(),this._hideClone(),D("revert"),ue.eventCanceled||(Er?qe.insertBefore(K,Er):qe.appendChild(K)),I(!0);var H=Bs(t,l.draggable);if(!H||Wp(n,d,this)&&!H.animated){if(H===K)return I(!1);if(H&&t===n.target&&(r=H),r&&(o=st(r)),bl(qe,t,K,i,r,o,n,!!r)!==!1)return T(),H&&H.nextSibling?t.insertBefore(K,H.nextSibling):t.appendChild(K),Je=t,L(),I(!0)}else if(H&&Fp(n,d,this)){var J=qi(t,0,l,!0);if(J===K)return I(!1);if(r=J,o=st(r),bl(qe,t,K,i,r,o,n,!1)!==!1)return T(),t.insertBefore(K,J),Je=t,L(),I(!0)}else if(r.parentNode===t){o=st(r);var Y=0,q,B=K.parentNode!==t,x=!$p(K.animated&&K.toRect||i,r.animated&&r.toRect||o,d),j=d?"top":"left",U=hu(r,"top","top")||hu(K,"top","top"),Z=U?U.scrollTop:void 0;hi!==r&&(q=o[j],co=!1,ml=!x&&l.invertSwap||B),Y=jp(n,r,o,d,x?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,ml,hi===r);var ve;if(Y!==0){var se=jt(K);do se-=Y,ve=Je.children[se];while(ve&&(fe(ve,"display")==="none"||ve===me))}if(Y===0||ve===r)return I(!1);hi=r,uo=Y;var z=r.nextElementSibling,O=!1;O=Y===1;var A=bl(qe,t,K,i,r,o,n,O);if(A!==!1)return(A===1||A===-1)&&(O=A===1),Es=!0,setTimeout(Vp,30),T(),O&&!z?t.appendChild(K):r.parentNode.insertBefore(K,O?z:r),U&&Mc(U,0,Z-U.scrollTop),Je=K.parentNode,q!==void 0&&!ml&&(Ll=Math.abs(q-st(r)[j])),L(),I(!0)}if(t.contains(K))return I(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ee(document,"mousemove",this._onTouchMove),Ee(document,"touchmove",this._onTouchMove),Ee(document,"pointermove",this._onTouchMove),Ee(document,"dragover",Lr),Ee(document,"mousemove",Lr),Ee(document,"touchmove",Lr)},_offUpEvents:function(){var n=this.el.ownerDocument;Ee(n,"mouseup",this._onDrop),Ee(n,"touchend",this._onDrop),Ee(n,"pointerup",this._onDrop),Ee(n,"touchcancel",this._onDrop),Ee(document,"selectstart",this)},_onDrop:function(n){var t=this.el,r=this.options;if(Gt=jt(K),Zn=jt(K,r.draggable),Wt("drop",this,{evt:n}),Je=K&&K.parentNode,Gt=jt(K),Zn=jt(K,r.draggable),ue.eventCanceled){this._nulling();return}pi=!1,ml=!1,co=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),xs(this.cloneId),xs(this._dragStartId),this.nativeDraggable&&(Ee(document,"drop",this),Ee(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),lo&&fe(document.body,"user-select",""),fe(K,"transform",""),n&&(to&&(n.cancelable&&n.preventDefault(),!r.dropBubble&&n.stopPropagation()),me&&me.parentNode&&me.parentNode.removeChild(me),(qe===Je||yt&&yt.lastPutMode!=="clone")&&Ze&&Ze.parentNode&&Ze.parentNode.removeChild(Ze),K&&(this.nativeDraggable&&Ee(K,"dragend",this),fs(K),K.style["will-change"]="",to&&!pi&&Pt(K,yt?yt.options.ghostClass:this.options.ghostClass,!1),Pt(K,this.options.chosenClass,!1),$t({sortable:this,name:"unchoose",toEl:Je,newIndex:null,newDraggableIndex:null,originalEvent:n}),qe!==Je?(Gt>=0&&($t({rootEl:Je,name:"add",toEl:Je,fromEl:qe,originalEvent:n}),$t({sortable:this,name:"remove",toEl:Je,originalEvent:n}),$t({rootEl:Je,name:"sort",toEl:Je,fromEl:qe,originalEvent:n}),$t({sortable:this,name:"sort",toEl:Je,originalEvent:n})),yt&&yt.save()):Gt!==di&&Gt>=0&&($t({sortable:this,name:"update",toEl:Je,originalEvent:n}),$t({sortable:this,name:"sort",toEl:Je,originalEvent:n})),ue.active&&((Gt==null||Gt===-1)&&(Gt=di,Zn=ao),$t({sortable:this,name:"end",toEl:Je,originalEvent:n}),this.save()))),this._nulling()},_nulling:function(){Wt("nulling",this),qe=K=Je=me=Er=Ze=Cl=tr=Cr=cn=to=Gt=Zn=di=ao=hi=uo=yt=dl=ue.dragged=ue.ghost=ue.clone=ue.active=null,Fl.forEach(function(n){n.checked=!0}),Fl.length=as=us=0},handleEvent:function(n){switch(n.type){case"drop":case"dragend":this._onDrop(n);break;case"dragenter":case"dragover":K&&(this._onDragOver(n),Rp(n));break;case"selectstart":n.preventDefault();break}},toArray:function(){for(var n=[],t,r=this.el.children,i=0,o=r.length,s=this.options;i<o;i++)t=r[i],fn(t,s.draggable,this.el,!1)&&n.push(t.getAttribute(s.dataIdAttr)||Up(t));return n},sort:function(n,t){var r={},i=this.el;this.toArray().forEach(function(o,s){var l=i.children[s];fn(l,this.options.draggable,i,!1)&&(r[o]=l)},this),t&&this.captureAnimationState(),n.forEach(function(o){r[o]&&(i.removeChild(r[o]),i.appendChild(r[o]))}),t&&this.animateAll()},save:function(){var n=this.options.store;n&&n.set&&n.set(this)},closest:function(n,t){return fn(n,t||this.options.draggable,this.el,!1)},option:function(n,t){var r=this.options;if(t===void 0)return r[n];var i=xo.modifyOption(this,n,t);typeof i<"u"?r[n]=i:r[n]=t,n==="group"&&Vc(r)},destroy:function(){Wt("destroy",this);var n=this.el;n[Xt]=null,Ee(n,"mousedown",this._onTapStart),Ee(n,"touchstart",this._onTapStart),Ee(n,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ee(n,"dragover",this),Ee(n,"dragenter",this)),Array.prototype.forEach.call(n.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Vl.splice(Vl.indexOf(this.el),1),this.el=n=null},_hideClone:function(){if(!tr){if(Wt("hideClone",this),ue.eventCanceled)return;fe(Ze,"display","none"),this.options.removeCloneOnHide&&Ze.parentNode&&Ze.parentNode.removeChild(Ze),tr=!0}},_showClone:function(n){if(n.lastPutMode!=="clone"){this._hideClone();return}if(tr){if(Wt("showClone",this),ue.eventCanceled)return;K.parentNode==qe&&!this.options.group.revertClone?qe.insertBefore(Ze,K):Er?qe.insertBefore(Ze,Er):qe.appendChild(Ze),this.options.group.revertClone&&this.animate(K,Ze),fe(Ze,"display",""),tr=!1}}};function Rp(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function bl(e,n,t,r,i,o,s,l){var u,a=e[Xt],c=a.options.onMove,p;return window.CustomEvent&&!Fn&&!Eo?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=n,u.from=e,u.dragged=t,u.draggedRect=r,u.related=i||n,u.relatedRect=o||st(n),u.willInsertAfter=l,u.originalEvent=s,e.dispatchEvent(u),c&&(p=c.call(a,u,s)),p}function fs(e){e.draggable=!1}function Vp(){Es=!1}function Fp(e,n,t){var r=st(qi(t.el,0,t.options,!0)),i=Hc(t.el,t.options,me),o=10;return n?e.clientX<i.left-o||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-o||e.clientY<r.bottom&&e.clientX<r.left}function Wp(e,n,t){var r=st(Bs(t.el,t.options.draggable)),i=Hc(t.el,t.options,me),o=10;return n?e.clientX>i.right+o||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+o||e.clientX>r.right&&e.clientY>r.top}function jp(e,n,t,r,i,o,s,l){var u=r?e.clientY:e.clientX,a=r?t.height:t.width,c=r?t.top:t.left,p=r?t.bottom:t.right,b=!1;if(!s){if(l&&Ll<a*i){if(!co&&(uo===1?u>c+a*o/2:u<p-a*o/2)&&(co=!0),co)b=!0;else if(uo===1?u<c+Ll:u>p-Ll)return-uo}else if(u>c+a*(1-i)/2&&u<p-a*(1-i)/2)return Bp(n)}return b=b||s,b&&(u<c+a*o/2||u>p-a*o/2)?u>c+a/2?1:-1:0}function Bp(e){return jt(K)<jt(e)?1:-1}function Up(e){for(var n=e.tagName+e.className+e.src+e.href+e.textContent,t=n.length,r=0;t--;)r+=n.charCodeAt(t);return r.toString(36)}function zp(e){Fl.length=0;for(var n=e.getElementsByTagName("input"),t=n.length;t--;){var r=n[t];r.checked&&Fl.push(r)}}function El(e){return setTimeout(e,0)}function xs(e){return clearTimeout(e)}Ql&&De(document,"touchmove",function(e){(ue.active||pi)&&e.cancelable&&e.preventDefault()});ue.utils={on:De,off:Ee,css:fe,find:Oc,is:function(n,t){return!!fn(n,t,n,!1)},extend:xp,throttle:Ic,closest:fn,toggleClass:Pt,clone:$c,index:jt,nextTick:El,cancelNextTick:xs,detectDirection:Rc,getChild:qi};ue.get=function(e){return e[Xt]};ue.mount=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];n[0].constructor===Array&&(n=n[0]),n.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(ue.utils=yn(yn({},ue.utils),r.utils)),xo.mount(r)})};ue.create=function(e,n){return new ue(e,n)};ue.version=Cp;var lt=[],no,Ps,As=!1,hs,ps,Wl,ro;function Yp(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this))}return e.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?De(document,"dragover",this._handleAutoScroll):this.options.supportPointer?De(document,"pointermove",this._handleFallbackAutoScroll):r.touches?De(document,"touchmove",this._handleFallbackAutoScroll):De(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?Ee(document,"dragover",this._handleAutoScroll):(Ee(document,"pointermove",this._handleFallbackAutoScroll),Ee(document,"touchmove",this._handleFallbackAutoScroll),Ee(document,"mousemove",this._handleFallbackAutoScroll)),bu(),xl(),Pp()},nulling:function(){Wl=Ps=no=As=ro=hs=ps=null,lt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var i=this,o=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,l=document.elementFromPoint(o,s);if(Wl=t,r||this.options.forceAutoScrollFallback||Eo||Fn||lo){ds(t,this.options,l,r);var u=ir(l,!0);As&&(!ro||o!==hs||s!==ps)&&(ro&&bu(),ro=setInterval(function(){var a=ir(document.elementFromPoint(o,s),!0);a!==u&&(u=a,xl()),ds(t,i.options,a,r)},10),hs=o,ps=s)}else{if(!this.options.bubbleScroll||ir(l,!0)===kn()){xl();return}ds(t,this.options,ir(l,!1),!1)}}},Sn(e,{pluginName:"scroll",initializeByDefault:!0})}function xl(){lt.forEach(function(e){clearInterval(e.pid)}),lt=[]}function bu(){clearInterval(ro)}var ds=Ic(function(e,n,t,r){if(n.scroll){var i=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,s=n.scrollSensitivity,l=n.scrollSpeed,u=kn(),a=!1,c;Ps!==t&&(Ps=t,xl(),no=n.scroll,c=n.scrollFn,no===!0&&(no=ir(t,!0)));var p=0,b=no;do{var d=b,y=st(d),S=y.top,D=y.bottom,T=y.left,I=y.right,L=y.width,H=y.height,J=void 0,Y=void 0,q=d.scrollWidth,B=d.scrollHeight,x=fe(d),j=d.scrollLeft,U=d.scrollTop;d===u?(J=L<q&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),Y=H<B&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(J=L<q&&(x.overflowX==="auto"||x.overflowX==="scroll"),Y=H<B&&(x.overflowY==="auto"||x.overflowY==="scroll"));var Z=J&&(Math.abs(I-i)<=s&&j+L<q)-(Math.abs(T-i)<=s&&!!j),ve=Y&&(Math.abs(D-o)<=s&&U+H<B)-(Math.abs(S-o)<=s&&!!U);if(!lt[p])for(var se=0;se<=p;se++)lt[se]||(lt[se]={});(lt[p].vx!=Z||lt[p].vy!=ve||lt[p].el!==d)&&(lt[p].el=d,lt[p].vx=Z,lt[p].vy=ve,clearInterval(lt[p].pid),(Z!=0||ve!=0)&&(a=!0,lt[p].pid=setInterval(function(){r&&this.layer===0&&ue.active._onTouchMove(Wl);var z=lt[this.layer].vy?lt[this.layer].vy*l:0,O=lt[this.layer].vx?lt[this.layer].vx*l:0;typeof c=="function"&&c.call(ue.dragged.parentNode[Xt],O,z,e,Wl,lt[this.layer].el)!=="continue"||Mc(lt[this.layer].el,O,z)}.bind({layer:p}),24))),p++}while(n.bubbleScroll&&b!==u&&(b=ir(b,!1)));As=a}},30),jc=function(n){var t=n.originalEvent,r=n.putSortable,i=n.dragEl,o=n.activeSortable,s=n.dispatchSortableEvent,l=n.hideGhostForTarget,u=n.unhideGhostForTarget;if(t){var a=r||o;l();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,p=document.elementFromPoint(c.clientX,c.clientY);u(),a&&!a.el.contains(p)&&(s("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Us(){}Us.prototype={startIndex:null,dragStart:function(n){var t=n.oldDraggableIndex;this.startIndex=t},onSpill:function(n){var t=n.dragEl,r=n.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=qi(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:jc};Sn(Us,{pluginName:"revertOnSpill"});function zs(){}zs.prototype={onSpill:function(n){var t=n.dragEl,r=n.putSortable,i=r||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:jc};Sn(zs,{pluginName:"removeOnSpill"});var Jt;function Kp(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(t){var r=t.dragEl;Jt=r},dragOverValid:function(t){var r=t.completed,i=t.target,o=t.onMove,s=t.activeSortable,l=t.changed,u=t.cancel;if(s.options.swap){var a=this.sortable.el,c=this.options;if(i&&i!==a){var p=Jt;o(i)!==!1?(Pt(i,c.swapClass,!0),Jt=i):Jt=null,p&&p!==Jt&&Pt(p,c.swapClass,!1)}l(),r(!0),u()}},drop:function(t){var r=t.activeSortable,i=t.putSortable,o=t.dragEl,s=i||this.sortable,l=this.options;Jt&&Pt(Jt,l.swapClass,!1),Jt&&(l.swap||i&&i.options.swap)&&o!==Jt&&(s.captureAnimationState(),s!==r&&r.captureAnimationState(),Gp(o,Jt),s.animateAll(),s!==r&&r.animateAll())},nulling:function(){Jt=null}},Sn(e,{pluginName:"swap",eventProperties:function(){return{swapItem:Jt}}})}function Gp(e,n){var t=e.parentNode,r=n.parentNode,i,o;!t||!r||t.isEqualNode(n)||r.isEqualNode(e)||(i=jt(e),o=jt(n),t.isEqualNode(r)&&i<o&&o++,t.insertBefore(n,t.children[i]),r.insertBefore(e,r.children[o]))}ue.mount(new Yp);ue.mount(zs,Us);function vu(e,n,t){const r=e.slice();return r[22]=n[t],r[23]=n,r[24]=t,r}function _u(e,n){let t,r,i=n[22].pattern+"",o,s,l,u,a,c,p,b,d,y,S,D,T,I,L;a=new _e({props:{path:xf,height:"1rem"}});function H(){return n[15](n[22])}b=new _e({props:{path:Zu,height:"1rem"}});function J(){return n[16](n[22])}function Y(){n[17].call(y,n[23],n[24])}return{key:e,first:null,c(){t=g("div"),r=g("div"),o=at(i),s=k(),l=g("div"),u=g("button"),le(a.$$.fragment),c=k(),p=g("button"),le(b.$$.fragment),d=k(),y=g("input"),S=k(),h(r,"class","break-all"),h(u,"title","Edit"),h(u,"class","hover:text-primary"),h(p,"title","Remove"),h(p,"class","hover:text-primary"),h(y,"type","checkbox"),h(y,"class","ml-1"),h(l,"class","min-w-max ml-2"),h(t,"class","border my-2 p-2 flex items-center justify-between"),h(t,"data-id",D=n[22].pattern),this.first=t},m(q,B){F(q,t,B),f(t,r),f(r,o),f(t,s),f(t,l),f(l,u),re(a,u,null),f(l,c),f(l,p),re(b,p,null),f(l,d),f(l,y),y.checked=n[22].enabled,f(t,S),T=!0,I||(L=[P(u,"click",H),P(p,"click",J),P(y,"change",Y),P(y,"change",n[6])],I=!0)},p(q,B){n=q,(!T||B&2)&&i!==(i=n[22].pattern+"")&&Tt(o,i),B&2&&(y.checked=n[22].enabled),(!T||B&2&&D!==(D=n[22].pattern))&&h(t,"data-id",D)},i(q){T||(N(a.$$.fragment,q),N(b.$$.fragment,q),T=!0)},o(q){W(a.$$.fragment,q),W(b.$$.fragment,q),T=!1},d(q){q&&V(t),ie(a),ie(b),I=!1,St(L)}}}function qp(e){let n,t,r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I,L=[],H=new Map,J,Y,q;r=new _e({props:{path:yf}}),l=new _e({props:{path:Xu}}),c=new _e({props:{path:If}}),d=new _e({props:{path:Of}}),D=new _e({props:{path:Zu}});let B=e[1];const x=j=>j[22].pattern;for(let j=0;j<B.length;j+=1){let U=vu(e,B,j),Z=x(U);H.set(Z,L[j]=_u(Z,U))}return{c(){n=g("div"),t=g("button"),le(r.$$.fragment),o=k(),s=g("button"),le(l.$$.fragment),u=k(),a=g("button"),le(c.$$.fragment),p=k(),b=g("button"),le(d.$$.fragment),y=k(),S=g("button"),le(D.$$.fragment),T=k(),I=g("div");for(let j=0;j<L.length;j+=1)L[j].c();h(t,"title","Apply to current lines"),t.disabled=i=!e[2],G(t,"hover:text-primary",e[2]),G(t,"cursor-not-allowed",!e[2]),h(s,"title","Add replacement"),h(s,"class","ml-2 hover:text-primary"),h(a,"title","Enable all"),h(a,"class","ml-2 hover:text-primary"),h(b,"title","Disable all"),h(b,"class","ml-2 hover:text-primary"),h(S,"title","Remove all"),h(S,"class","ml-2 hover:text-primary"),h(n,"class","flex justify-end my-2"),h(I,"class","max-h-72 overflow-auto")},m(j,U){F(j,n,U),f(n,t),re(r,t,null),f(n,o),f(n,s),re(l,s,null),f(n,u),f(n,a),re(c,a,null),f(n,p),f(n,b),re(d,b,null),f(n,y),f(n,S),re(D,S,null),F(j,T,U),F(j,I,U);for(let Z=0;Z<L.length;Z+=1)L[Z].m(I,null);e[18](I),J=!0,Y||(q=[P(t,"click",e[10]),P(s,"click",e[11]),P(a,"click",e[12]),P(b,"click",e[13]),P(S,"click",e[14])],Y=!0)},p(j,[U]){(!J||U&4&&i!==(i=!j[2]))&&(t.disabled=i),(!J||U&4)&&G(t,"hover:text-primary",j[2]),(!J||U&4)&&G(t,"cursor-not-allowed",!j[2]),U&218&&(B=j[1],rt(),L=Ur(L,U,x,1,j,B,H,I,Is,_u,null,vu),it())},i(j){if(!J){N(r.$$.fragment,j),N(l.$$.fragment,j),N(c.$$.fragment,j),N(d.$$.fragment,j),N(D.$$.fragment,j);for(let U=0;U<B.length;U+=1)N(L[U]);J=!0}},o(j){W(r.$$.fragment,j),W(l.$$.fragment,j),W(c.$$.fragment,j),W(d.$$.fragment,j),W(D.$$.fragment,j);for(let U=0;U<L.length;U+=1)W(L[U]);J=!1},d(j){j&&V(n),ie(r),ie(l),ie(c),ie(d),ie(D),j&&V(T),j&&V(I);for(let U=0;U<L.length;U+=1)L[U].d();e[18](null),Y=!1,St(q)}}}function Xp(e,n,t){let r,i,o,s;w(e,rn,x=>t(3,i=x)),w(e,Ls,x=>t(8,o=x)),w(e,Qe,x=>t(9,s=x));const l=Br();let u,a,c=JSON.parse(JSON.stringify(i));jl(()=>{try{ue.mount(new Kp)}catch{}return u=ue.create(a,{swap:!0,swapClass:"swap",animation:150,store:{get:y,set:b}}),()=>u==null?void 0:u.destroy()});function p(x){const j=S();t(1,c=j.map(U=>({...U,enabled:x}))),R(rn,i=c,i)}function b(){R(rn,i=S(),i)}function d(x){t(1,c=x),R(rn,i=x,i),u.sort(y(),!1)}function y(){return[...c.map(x=>x.pattern)]}function S(){const x=u.toArray();return c.slice().sort((j,U)=>x.indexOf(j.pattern)-x.indexOf(U.pattern))}const D=()=>l("applyReplacements"),T=()=>l("edit",void 0),I=()=>p(!0),L=()=>p(!1),H=()=>d([]),J=x=>l("edit",x),Y=x=>d(i.filter(j=>j.pattern!==x.pattern));function q(x,j){x[j].enabled=this.checked,t(1,c)}function B(x){pt[x?"unshift":"push"](()=>{a=x,t(0,a)})}return e.$$.update=()=>{e.$$.dirty&768&&t(2,r=!!s.length&&!!o.length)},[a,c,r,i,l,p,b,d,o,s,D,T,I,L,H,J,Y,q,B]}class Zp extends zt{constructor(n){super(),Ut(this,n,Xp,qp,Ct,{})}}function Jp(e){let n,t,r,i,o,s,l,u;return r=new _e({props:{path:Xu}}),{c(){n=g("div"),t=g("button"),le(r.$$.fragment),i=k(),o=g("div"),o.textContent="You have currently no replacements configured",h(t,"title","Add replacement"),h(t,"class","ml-2 hover:text-primary"),h(n,"class","flex justify-end my-2")},m(a,c){F(a,n,c),f(n,t),re(r,t,null),F(a,i,c),F(a,o,c),s=!0,l||(u=P(t,"click",e[7]),l=!0)},p:Oe,i(a){s||(N(r.$$.fragment,a),s=!0)},o(a){W(r.$$.fragment,a),s=!1},d(a){a&&V(n),ie(r),a&&V(i),a&&V(o),l=!1,u()}}}function Qp(e){let n=e[0],t,r,i=wu(e);return{c(){i.c(),t=Hn()},m(o,s){i.m(o,s),F(o,t,s),r=!0},p(o,s){s&1&&Ct(n,n=o[0])?(rt(),W(i,1,1,Oe),it(),i=wu(o),i.c(),N(i,1),i.m(t.parentNode,t)):i.p(o,s)},i(o){r||(N(i),r=!0)},o(o){W(i),r=!1},d(o){o&&V(t),i.d(o)}}}function e1(e){let n,t;return n=new wp({props:{currentReplacement:e[2]}}),n.$on("close",e[4]),{c(){le(n.$$.fragment)},m(r,i){re(n,r,i),t=!0},p(r,i){const o={};i&4&&(o.currentReplacement=r[2]),n.$set(o)},i(r){t||(N(n.$$.fragment,r),t=!0)},o(r){W(n.$$.fragment,r),t=!1},d(r){ie(n,r)}}}function wu(e){let n,t;return n=new Zp({}),n.$on("edit",e[5]),n.$on("applyReplacements",e[6]),{c(){le(n.$$.fragment)},m(r,i){re(n,r,i),t=!0},p:Oe,i(r){t||(N(n.$$.fragment,r),t=!0)},o(r){W(n.$$.fragment,r),t=!1},d(r){ie(n,r)}}}function t1(e){let n,t,r,i,o,s,l;const u=[e1,Qp,Jp],a=[];function c(p,b){return p[1]?0:p[3]?1:2}return o=c(e),s=a[o]=u[o](e),{c(){n=g("details"),t=g("summary"),t.textContent="Replacements",r=k(),i=g("div"),s.c(),h(i,"class","mb-8"),h(n,"class","col-span-4 mb-2 cursor-pointer max-w-lg")},m(p,b){F(p,n,b),f(n,t),f(n,r),f(n,i),a[o].m(i,null),l=!0},p(p,[b]){let d=o;o=c(p),o===d?a[o].p(p,b):(rt(),W(a[d],1,1,()=>{a[d]=null}),it(),s=a[o],s?s.p(p,b):(s=a[o]=u[o](p),s.c()),N(s,1),s.m(i,null))},i(p){l||(N(s),l=!0)},o(p){W(s),l=!1},d(p){p&&V(n),a[o].d()}}}function n1(e,n,t){let r,i;w(e,rn,b=>t(0,i=b));let o=!1,s;function l(b){t(1,o=!1)}const u=()=>{t(1,o=!1),t(2,s=void 0)},a=({detail:b})=>{t(2,s=b),t(1,o=!0)};function c(b){ho.call(this,e,b)}const p=()=>t(1,o=!0);return e.$$.update=()=>{e.$$.dirty&1&&t(3,r=!!i.length),e.$$.dirty&1&&l()},[i,o,s,r,u,a,c,p]}class r1 extends zt{constructor(n){super(),Ut(this,n,n1,t1,Ct,{})}}const{Map:i1,document:ku}=Os;function yu(e,n,t){const r=e.slice();return r[155]=n[t],r}function Su(e){let n,t,r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I,L,H,J,Y,q,B,x,j,U,Z,ve,se,z,O,A,ee,he,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re,Ye,Fe,we,Me,mt,pe,ut,We,Ve,ot,gt,je,ae,Be,et,ke,Se,Lt,Ht,ye,_,ce,tt,Pe,bt,Ae,Ue,wt,hn,pn,Wn,vt,Yt,Ot,Ge,Le,C=[],M=new i1,kt,Et,ln,ct,It,Nt,Zt,Kt,Yr,Ln,dn,Kr,Rt,Gr,jn,qr,sn,Xr,Bn,Zr,an,Jr,Un,Qr,un,v,Q,ne,de,ge,ft,mn,Vt,ar,ei,Po,gn,Ao,ti,To,bn,Do,ni,Oo,vn,Io,ri,Mo,En,$o,ii,Ho,xn,No,oi,Ro,Pn,Vo,li,Fo,An,Wo,si,jo,Tn,Bo,ai,Uo,Dn,zo,ui,Yo,m,X,oe,$e,nt,ht,Mt,ur,cr,Ys,Ko,Ks,fr,Gs,Go,qs,zn,Xs,qo,Zs,Yn,Js,Xo,Qs,hr,ea,Zo,ta,Kn,na,Jo,ra,pr,ia,Qo,oa,dr,la,el,sa,mr,aa,tl,ua,gr,ca,nl,fa,br,ha,rl,pa,vr,da,il,ma,_r,ga,ol,ba,wr,va,ll,_a,Gn,wa,sl,ka,kr,ya,al,Sa,yr,Ca,ul,La,Sr,Ea,Zi,xa,qn,On,es,Pa;p=new _e({props:{path:Df}}),D=new _e({props:{path:Tf}}),J=new _e({props:{path:oo}}),j=new _e({props:{path:oo}}),z=new _e({props:{path:oo}}),xe=new _e({props:{path:_s}}),Ne=new _e({props:{path:_s}}),pe=new _e({props:{class:"swap-on",path:$f}}),We=new _e({props:{class:"swap-off",path:Hf}});let Uc={};Be=new Pc({props:Uc}),e[81](Be),Be.$on("layoutChange",e[82]),Be.$on("exportImportPreset",e[83]),ke=new r1({}),ke.$on("applyReplacements",e[84]);let cl=e[54];const Aa=$=>$[155];for(let $=0;$<cl.length;$+=1){let te=yu(e,cl,$),Xn=Aa(te);M.set(Xn,C[$]=Cu(Xn,te))}let Ft=e[1]&&Lu(e);return{c(){n=g("input"),t=k(),r=g("input"),i=k(),o=g("input"),s=k(),l=g("div"),u=g("div"),a=g("div"),c=g("div"),le(p.$$.fragment),b=k(),d=g("span"),d.textContent="Set Timer",y=k(),S=g("div"),le(D.$$.fragment),T=k(),I=g("span"),I.textContent="Reset Timer",L=k(),H=g("div"),le(J.$$.fragment),Y=k(),q=g("span"),q.textContent="Reset Lines",B=k(),x=g("div"),le(j.$$.fragment),U=k(),Z=g("span"),Z.textContent="Reset Data",ve=k(),se=g("div"),le(z.$$.fragment),O=k(),A=g("span"),A.textContent="Reset All",ee=k(),he=g("div"),le(xe.$$.fragment),Xe=k(),Ie=g("span"),Ie.textContent="Ex-/Import Data",Te=k(),Ke=g("div"),le(Ne.$$.fragment),_t=k(),dt=g("span"),dt.textContent="Ex-/Import Settings",Re=k(),Ye=g("div"),Fe=g("label"),we=g("input"),mt=k(),le(pe.$$.fragment),ut=k(),le(We.$$.fragment),Ve=k(),ot=g("span"),ot.textContent="Theme",gt=k(),je=g("details"),je.innerHTML=`<summary>Links</summary>
29
31
  <ul><li class="my-0.5 hover:text-primary"><a href="https://github.com/Renji-XD/texthooker-ui" target="_blank" rel="noreferrer">texthooker-ui Repository</a></li>
30
32
  <li class="my-0.5 hover:text-primary"><a href="https://github.com/Artikash/Textractor" target="_blank" rel="noreferrer">Textractor</a></li>
31
33
  <li class="my-0.5 hover:text-primary"><a href="https://github.com/kuroahna/textractor_websocket" target="_blank" rel="noreferrer">textractor-websocket Extension</a></li>
@@ -33,8 +35,8 @@ var qc=Object.defineProperty;var Xc=(e,n,t)=>n in e?qc(e,n,{enumerable:!0,config
33
35
  <li class="my-0.5 hover:text-primary"><a href="https://github.com/kuroahna/mpv_websocket" target="_blank" rel="noreferrer">mpv_websocket Plugin</a></li>
34
36
  <li class="my-0.5 hover:text-primary"><a href="https://github.com/0xDC00/agent" target="_blank" rel="noreferrer">Agent</a></li>
35
37
  <li class="my-0.5 hover:text-primary"><a href="https://github.com/kmltml/clipboard-inserter" target="_blank" rel="noreferrer">Clipboard Inserter</a></li>
36
- <li class="my-0.5 hover:text-primary"><a href="https://github.com/laplus-sadness/lap-clipboard-inserter" target="_blank" rel="noreferrer">lap-clipboard-inserter</a></li></ul>`,ae=w(),se(Be.$$.fragment),_t=w(),se(ke.$$.fragment),ye=w(),kt=g("span"),kt.textContent="Window Title",Dt=w(),Ee=g("input"),_=w(),de=g("span"),de.textContent="Primary Websocket",Ot=w(),Te=g("input"),lt=w(),Ce=g("span"),Ce.textContent="Secondary Websocket",De=w(),st=g("input"),hn=w(),pn=g("span"),pn.textContent="Font Size",jn=w(),ht=g("input"),zt=w(),Ht=g("span"),Ht.textContent="Character Milestone",Ge=w(),xe=g("input"),C=w(),N=g("span"),N.textContent="Online Font",St=w(),tt=g("select");for(let O=0;O<Je.length;O+=1)Je[O].c();It=w(),Nt=g("span"),Nt.textContent="Prevent Last Line Duplicate",Qt=w(),Yt=g("input"),Gr=w(),Bn=g("span"),Bn.textContent="Max lines",qr=w(),Kt=g("input"),Un=w(),Vt&&Vt.c(),Ln=w(),zn=g("span"),zn.textContent="AFK Timer (s)",Xr=w(),Rt=g("input"),Zr=w(),Yn=g("span"),Yn.textContent="Adjust Timer after AFK",Jr=w(),an=g("input"),Qr=w(),Kn=g("span"),Kn.textContent="Enable external Clipboard Monitor",ei=w(),un=g("input"),v=w(),Q=g("span"),Q.textContent="Show Preset Quick Switch",ne=w(),pe=g("input"),ge=w(),pt=g("span"),pt.textContent="Skip Reset Confirmations",dn=w(),Gt=g("input"),fr=w(),ti=g("span"),ti.textContent="Store Stats persistently",To=w(),mn=g("input"),Do=w(),ni=g("span"),ni.textContent="Store Notes persistently",Oo=w(),gn=g("input"),Io=w(),ri=g("span"),ri.textContent="Store Lines persistently",Mo=w(),bn=g("input"),$o=w(),ii=g("span"),ii.textContent="Store Action History persistently",Ho=w(),vn=g("input"),No=w(),oi=g("span"),oi.textContent="Enable Paste",Ro=w(),En=g("input"),Vo=w(),li=g("span"),li.textContent="Block Copy from Page",Fo=w(),xn=g("input"),Wo=w(),si=g("span"),si.textContent="Allow Paste during Pause",jo=w(),Pn=g("input"),Bo=w(),ai=g("span"),ai.textContent="Allow new Line during Pause",Uo=w(),An=g("input"),zo=w(),ui=g("span"),ui.textContent="Autostart Timer by Paste during Pause",Yo=w(),Tn=g("input"),Ko=w(),ci=g("span"),ci.textContent="Autostart Timer by Line during Pause",Go=w(),Dn=g("input"),qo=w(),fi=g("span"),fi.textContent="Prevent Global Duplicate",Xo=w(),d=g("input"),G=w(),le=g("span"),le.textContent="Merge equal Line Starts",$e=w(),nt=g("input"),dt=w(),Mt=g("span"),Mt.textContent="Filter lines without jp content",hr=w(),pr=g("input"),Xs=w(),Zo=g("span"),Zo.textContent="Flash on missed Line",Zs=w(),dr=g("input"),Js=w(),Jo=g("span"),Jo.textContent="Display Text vertically",Qs=w(),Gn=g("input"),ea=w(),Qo=g("span"),Qo.textContent="Reverse Line Order",ta=w(),qn=g("input"),na=w(),el=g("span"),el.textContent="Preserve Whitespace",ra=w(),mr=g("input"),ia=w(),tl=g("span"),tl.textContent="Remove all Whitespace",oa=w(),Xn=g("input"),la=w(),nl=g("span"),nl.textContent="Show Timer",sa=w(),gr=g("input"),aa=w(),rl=g("span"),rl.textContent="Show Speed",ua=w(),br=g("input"),ca=w(),il=g("span"),il.textContent="Show Character Count",fa=w(),vr=g("input"),ha=w(),ol=g("span"),ol.textContent="Show Line Count",pa=w(),_r=g("input"),da=w(),ll=g("span"),ll.textContent="Blur Stats",ma=w(),wr=g("input"),ga=w(),sl=g("span"),sl.textContent="Enable Line Animation",ba=w(),yr=g("input"),va=w(),al=g("span"),al.textContent="Enable AFK Blur",_a=w(),kr=g("input"),wa=w(),ul=g("span"),ul.textContent="Restart Timer after AFK Blur",ya=w(),Sr=g("input"),ka=w(),cl=g("span"),cl.textContent="Continuous Reconnect",Sa=w(),Zn=g("input"),Ca=w(),fl=g("span"),fl.textContent="Show Connection Errors",La=w(),Cr=g("input"),Ea=w(),hl=g("span"),hl.textContent="Auto Translate Lines:",xa=w(),Lr=g("input"),Pa=w(),pl=g("span"),pl.textContent="Blur Auto Translated Lines:",Aa=w(),Er=g("input"),Ta=w(),Qi=g("span"),Qi.textContent="Custom CSS",Da=w(),Jn=g("textarea"),h(n,"class","hidden"),h(n,"type","file"),h(r,"class","hidden"),h(r,"type","file"),h(o,"class","hidden"),h(o,"type","file"),h(m,"class","label-text"),h(c,"role","button"),h(c,"class","flex flex-col items-center hover:text-primary"),h($,"class","label-text"),h(S,"role","button"),h(S,"class","flex flex-col items-center hover:text-primary"),h(K,"class","label-text"),h(D,"role","button"),h(D,"class","flex flex-col items-center hover:text-primary"),h(Z,"class","label-text"),h(E,"role","button"),h(E,"class","flex flex-col items-center hover:text-primary"),h(T,"class","label-text"),h(re,"role","button"),h(re,"class","flex flex-col items-center hover:text-primary"),h(Se,"class","label-text"),h(ce,"role","button"),h(ce,"class","flex flex-col items-center hover:text-primary"),h(gt,"class","label-text"),h(Ke,"role","button"),h(Ke,"class","flex flex-col items-center hover:text-primary"),h(we,"type","checkbox"),we.checked=Me=e[6]===rn.BUSINESS,h(Fe,"class","swap swap-rotate"),h(ot,"class","label-text"),h(ze,"role","button"),h(ze,"class","flex flex-col items-center hover:text-primary"),h(u,"class","flex text-sm gap-x-5 min-[600px]:justify-between max-[600px]:flex-wrap max-[600px]:gap-y-5"),h(a,"class","mb-2"),be(a,"grid-column","1/5"),h(je,"role","button"),h(je,"class","col-span-4 mb-2"),h(kt,"class","label-text col-span-2"),h(Ee,"class","input input-bordered h-8 col-span-2"),h(de,"class","label-text col-span-2"),h(Te,"class","input input-bordered h-8 col-span-2"),h(Ce,"class","label-text col-span-2"),h(st,"class","input input-bordered h-8 col-span-2"),h(pn,"class","label-text col-span-2"),h(ht,"type","number"),h(ht,"class","input input-bordered h-8 col-span-2"),h(ht,"min","1"),h(Ht,"class","label-text col-span-2"),h(xe,"type","number"),h(xe,"class","input input-bordered h-8 col-span-2"),h(xe,"min","0"),xe.value=e[19],h(N,"class","label-text mr-4 col-span-2"),h(tt,"class","select col-span-2"),e[22]===void 0&&Rr(()=>e[94].call(tt)),h(Nt,"class","label-text col-span-2"),h(Yt,"type","number"),h(Yt,"class","input input-bordered h-8 col-span-2"),h(Yt,"min","0"),Yt.value=e[18],h(Bn,"class","label-text col-span-2"),h(Kt,"type","number"),h(Kt,"class","input input-bordered h-8 mb-2 col-span-2"),h(Kt,"min","0"),Kt.value=e[16],h(zn,"class","label-text col-span-2"),h(Rt,"type","number"),h(Rt,"class","input input-bordered h-8 mb-2 col-span-2"),h(Rt,"min","0"),h(Yn,"class","label-text"),h(an,"type","checkbox"),h(an,"class","checkbox checkbox-primary ml-2"),h(Kn,"class","label-text"),h(un,"type","checkbox"),h(un,"class","checkbox checkbox-primary ml-2"),h(Q,"class","label-text"),h(pe,"type","checkbox"),h(pe,"class","checkbox checkbox-primary ml-2"),h(pt,"class","label-text"),h(Gt,"type","checkbox"),h(Gt,"class","checkbox checkbox-primary ml-2"),h(ti,"class","label-text"),h(mn,"type","checkbox"),h(mn,"class","checkbox checkbox-primary ml-2"),h(ni,"class","label-text"),h(gn,"type","checkbox"),h(gn,"class","checkbox checkbox-primary ml-2"),h(ri,"class","label-text"),h(bn,"type","checkbox"),h(bn,"class","checkbox checkbox-primary ml-2"),h(ii,"class","label-text"),h(vn,"type","checkbox"),h(vn,"class","checkbox checkbox-primary ml-2"),h(oi,"class","label-text"),h(En,"type","checkbox"),h(En,"class","checkbox checkbox-primary ml-2"),h(li,"class","label-text"),h(xn,"type","checkbox"),h(xn,"class","checkbox checkbox-primary ml-2"),h(si,"class","label-text"),h(Pn,"type","checkbox"),h(Pn,"class","checkbox checkbox-primary ml-2"),h(ai,"class","label-text"),h(An,"type","checkbox"),h(An,"class","checkbox checkbox-primary ml-2"),h(ui,"class","label-text"),h(Tn,"type","checkbox"),h(Tn,"class","checkbox checkbox-primary ml-2"),h(ci,"class","label-text"),h(Dn,"type","checkbox"),h(Dn,"class","checkbox checkbox-primary ml-2"),h(fi,"class","label-text"),h(d,"type","checkbox"),h(d,"class","checkbox checkbox-primary ml-2"),h(le,"class","label-text"),h(nt,"type","checkbox"),h(nt,"class","checkbox checkbox-primary ml-2"),h(Mt,"class","label-text"),h(pr,"type","checkbox"),h(pr,"class","checkbox checkbox-primary ml-2"),h(Zo,"class","label-text"),h(dr,"type","checkbox"),h(dr,"class","checkbox checkbox-primary ml-2"),h(Jo,"class","label-text"),h(Gn,"type","checkbox"),h(Gn,"class","checkbox checkbox-primary ml-2"),h(Qo,"class","label-text"),h(qn,"type","checkbox"),h(qn,"class","checkbox checkbox-primary ml-2"),h(el,"class","label-text"),h(mr,"type","checkbox"),h(mr,"class","checkbox checkbox-primary ml-2"),h(tl,"class","label-text"),h(Xn,"type","checkbox"),h(Xn,"class","checkbox checkbox-primary ml-2"),h(nl,"class","label-text"),h(gr,"type","checkbox"),h(gr,"class","checkbox checkbox-primary ml-2"),h(rl,"class","label-text"),h(br,"type","checkbox"),h(br,"class","checkbox checkbox-primary ml-2"),h(il,"class","label-text"),h(vr,"type","checkbox"),h(vr,"class","checkbox checkbox-primary ml-2"),h(ol,"class","label-text"),h(_r,"type","checkbox"),h(_r,"class","checkbox checkbox-primary ml-2"),h(ll,"class","label-text"),h(wr,"type","checkbox"),h(wr,"class","checkbox checkbox-primary ml-2"),h(sl,"class","label-text"),h(yr,"type","checkbox"),h(yr,"class","checkbox checkbox-primary ml-2"),h(al,"class","label-text"),h(kr,"type","checkbox"),h(kr,"class","checkbox checkbox-primary ml-2"),h(ul,"class","label-text"),h(Sr,"type","checkbox"),h(Sr,"class","checkbox checkbox-primary ml-2"),h(cl,"class","label-text"),h(Zn,"type","checkbox"),h(Zn,"class","checkbox checkbox-primary ml-2"),h(fl,"class","label-text"),h(Cr,"type","checkbox"),h(Cr,"class","checkbox checkbox-primary ml-2"),h(hl,"class","label-text"),h(Lr,"type","checkbox"),h(Lr,"class","checkbox checkbox-primary ml-2"),h(pl,"class","label-text"),h(Er,"type","checkbox"),h(Er,"class","checkbox checkbox-primary ml-2"),h(Qi,"class","label-text"),be(Qi,"grid-column","1/5"),h(Jn,"class","p-1 min-h-[10rem] font-mono"),be(Jn,"grid-column","1/5"),h(Jn,"rows","5"),Jn.value=e[3],h(l,"class","flex flex-col max-[800px]:w-[90vw] min-[800px]:grid grid-cols-[max-content,auto,max-content,auto] gap-3 absolute overflow-auto h-[90vh] top-11 z-10 py-4 pr-8 pl-4 border bg-base-200 overscroll-contain")},m(O,te){F(O,n,te),e[77](n),F(O,t,te),F(O,r,te),e[78](r),F(O,i,te),F(O,o,te),e[79](o),F(O,s,te),F(O,l,te),f(l,a),f(a,u),f(u,c),ie(p,c,null),f(c,b),f(c,m),f(u,k),f(u,S),ie(I,S,null),f(S,A),f(S,$),f(u,x),f(u,D),ie(J,D,null),f(D,X),f(D,K),f(u,B),f(u,E),ie(W,E,null),f(E,U),f(E,Z),f(u,ve),f(u,re),ie(z,re,null),f(re,M),f(re,T),f(u,ee),f(u,ce),ie(Ae,ce,null),f(ce,Ye),f(ce,Se),f(u,Ze),f(u,Ke),ie(Ne,Ke,null),f(Ke,yt),f(Ke,gt),f(u,Re),f(u,ze),f(ze,Fe),f(Fe,we),f(Fe,bt),ie(he,Fe,null),f(Fe,ft),ie(We,Fe,null),f(ze,Ve),f(ze,ot),f(l,vt),f(l,je),f(l,ae),ie(Be,l,null),f(l,_t),ie(ke,l,null),f(l,ye),f(l,kt),f(l,Dt),f(l,Ee),wt(Ee,e[20]),f(l,_),f(l,de),f(l,Ot),f(l,Te),wt(Te,e[12]),f(l,lt),f(l,Ce),f(l,De),f(l,st),wt(st,e[11]),f(l,hn),f(l,pn),f(l,jn),f(l,ht),wt(ht,e[21]),f(l,zt),f(l,Ht),f(l,Ge),f(l,xe),f(l,C),f(l,N),f(l,St),f(l,tt);for(let Qn=0;Qn<Je.length;Qn+=1)Je[Qn].m(tt,null);yi(tt,e[22]),f(l,It),f(l,Nt),f(l,Qt),f(l,Yt),f(l,Gr),f(l,Bn),f(l,qr),f(l,Kt),f(l,Un),Vt&&Vt.m(l,null),f(l,Ln),f(l,zn),f(l,Xr),f(l,Rt),wt(Rt,e[23]),f(l,Zr),f(l,Yn),f(l,Jr),f(l,an),an.checked=e[24],f(l,Qr),f(l,Kn),f(l,ei),f(l,un),un.checked=e[5],f(l,v),f(l,Q),f(l,ne),f(l,pe),pe.checked=e[25],f(l,ge),f(l,pt),f(l,dn),f(l,Gt),Gt.checked=e[13],f(l,fr),f(l,ti),f(l,To),f(l,mn),mn.checked=e[26],f(l,Do),f(l,ni),f(l,Oo),f(l,gn),gn.checked=e[27],f(l,Io),f(l,ri),f(l,Mo),f(l,bn),bn.checked=e[28],f(l,$o),f(l,ii),f(l,Ho),f(l,vn),vn.checked=e[29],f(l,No),f(l,oi),f(l,Ro),f(l,En),En.checked=e[30],f(l,Vo),f(l,li),f(l,Fo),f(l,xn),xn.checked=e[31],f(l,Wo),f(l,si),f(l,jo),f(l,Pn),Pn.checked=e[32],f(l,Bo),f(l,ai),f(l,Uo),f(l,An),An.checked=e[33],f(l,zo),f(l,ui),f(l,Yo),f(l,Tn),Tn.checked=e[34],f(l,Ko),f(l,ci),f(l,Go),f(l,Dn),Dn.checked=e[35],f(l,qo),f(l,fi),f(l,Xo),f(l,d),d.checked=e[15],f(l,G),f(l,le),f(l,$e),f(l,nt),nt.checked=e[36],f(l,dt),f(l,Mt),f(l,hr),f(l,pr),pr.checked=e[37],f(l,Xs),f(l,Zo),f(l,Zs),f(l,dr),dr.checked=e[38],f(l,Js),f(l,Jo),f(l,Qs),f(l,Gn),Gn.checked=e[39],f(l,ea),f(l,Qo),f(l,ta),f(l,qn),qn.checked=e[40],f(l,na),f(l,el),f(l,ra),f(l,mr),mr.checked=e[41],f(l,ia),f(l,tl),f(l,oa),f(l,Xn),Xn.checked=e[14],f(l,la),f(l,nl),f(l,sa),f(l,gr),gr.checked=e[42],f(l,aa),f(l,rl),f(l,ua),f(l,br),br.checked=e[43],f(l,ca),f(l,il),f(l,fa),f(l,vr),vr.checked=e[44],f(l,ha),f(l,ol),f(l,pa),f(l,_r),_r.checked=e[45],f(l,da),f(l,ll),f(l,ma),f(l,wr),wr.checked=e[46],f(l,ga),f(l,sl),f(l,ba),f(l,yr),yr.checked=e[47],f(l,va),f(l,al),f(l,_a),f(l,kr),kr.checked=e[48],f(l,wa),f(l,ul),f(l,ya),f(l,Sr),Sr.checked=e[49],f(l,ka),f(l,cl),f(l,Sa),f(l,Zn),Zn.checked=e[50],f(l,Ca),f(l,fl),f(l,La),f(l,Cr),Cr.checked=e[51],f(l,Ea),f(l,hl),f(l,xa),f(l,Lr),Lr.checked=e[52],f(l,Pa),f(l,pl),f(l,Aa),f(l,Er),Er.checked=e[53],f(l,Ta),f(l,Qi),f(l,Da),f(l,Jn),On=!0,is||(Oa=[P(n,"change",e[63]),P(r,"change",e[64]),P(o,"change",e[65]),P(c,"click",e[58]),P(c,"keyup",jt),P(S,"click",e[59]),P(S,"keyup",jt),P(D,"click",e[80]),P(D,"keyup",jt),P(E,"click",e[81]),P(E,"keyup",jt),P(re,"click",Jh),P(re,"keyup",jt),P(ce,"click",e[60]),P(ce,"keyup",jt),P(Ke,"click",e[61]),P(Ke,"keyup",jt),P(we,"change",e[82]),P(ze,"click",e[83]),P(ze,"keyup",jt),P(Ee,"input",e[88]),P(Te,"input",e[89]),P(Te,"change",e[90]),P(st,"input",e[91]),P(st,"change",e[56]),P(ht,"input",e[92]),P(ht,"blur",e[93]),P(xe,"blur",e[67]),P(tt,"change",e[94]),P(Yt,"blur",e[68]),P(Kt,"blur",e[69]),P(Rt,"input",e[95]),P(Rt,"blur",e[96]),P(an,"change",e[97]),P(un,"change",e[98]),P(pe,"change",e[99]),P(Gt,"change",e[100]),P(mn,"change",e[101]),P(mn,"change",e[102]),P(gn,"change",e[103]),P(gn,"change",e[104]),P(bn,"change",e[105]),P(bn,"change",e[106]),P(vn,"change",e[107]),P(vn,"change",e[108]),P(En,"change",e[109]),P(xn,"change",e[110]),P(Pn,"change",e[111]),P(An,"change",e[112]),P(Tn,"change",e[113]),P(Dn,"change",e[114]),P(d,"change",e[115]),P(d,"change",e[71]),P(nt,"change",e[116]),P(pr,"change",e[117]),P(dr,"change",e[118]),P(Gn,"change",e[119]),P(Gn,"change",e[120]),P(qn,"change",e[121]),P(qn,"change",e[122]),P(mr,"change",e[123]),P(Xn,"change",e[124]),P(Xn,"change",e[72]),P(gr,"change",e[125]),P(br,"change",e[126]),P(vr,"change",e[127]),P(_r,"change",e[128]),P(wr,"change",e[129]),P(yr,"change",e[130]),P(kr,"change",e[131]),P(Sr,"change",e[132]),P(Zn,"change",e[133]),P(Zn,"change",e[134]),P(Cr,"change",e[135]),P(Lr,"change",e[136]),P(Er,"change",e[137]),P(Jn,"blur",e[73]),tf(yp.call(null,l,e[57]))],is=!0)},p(O,te){(!On||te[0]&64&&Me!==(Me=O[6]===rn.BUSINESS))&&(we.checked=Me);const Qn={};Be.$set(Qn),te[0]&1048576&&Ee.value!==O[20]&&wt(Ee,O[20]),te[0]&4096&&Te.value!==O[12]&&wt(Te,O[12]),te[0]&2048&&st.value!==O[11]&&wt(st,O[11]),te[0]&2097152&&Ol(ht.value)!==O[21]&&wt(ht,O[21]),(!On||te[0]&524288&&xe.value!==O[19])&&(xe.value=O[19]),te[1]&16777216&&(dl=O[55],Je=Yr(Je,te,Ia,1,O,dl,Jt,tt,Kl,Pu,null,Eu)),te[0]&4194304|te[1]&16777216&&yi(tt,O[22]),(!On||te[0]&262144&&Yt.value!==O[18])&&(Yt.value=O[18]),(!On||te[0]&65536&&Kt.value!==O[16])&&(Kt.value=O[16]),O[1]?Vt?Vt.p(O,te):(Vt=Au(O),Vt.c(),Vt.m(l,Ln)):Vt&&(Vt.d(1),Vt=null),te[0]&8388608&&Ol(Rt.value)!==O[23]&&wt(Rt,O[23]),te[0]&16777216&&(an.checked=O[24]),te[0]&32&&(un.checked=O[5]),te[0]&33554432&&(pe.checked=O[25]),te[0]&8192&&(Gt.checked=O[13]),te[0]&67108864&&(mn.checked=O[26]),te[0]&134217728&&(gn.checked=O[27]),te[0]&268435456&&(bn.checked=O[28]),te[0]&536870912&&(vn.checked=O[29]),te[0]&1073741824&&(En.checked=O[30]),te[1]&1&&(xn.checked=O[31]),te[1]&2&&(Pn.checked=O[32]),te[1]&4&&(An.checked=O[33]),te[1]&8&&(Tn.checked=O[34]),te[1]&16&&(Dn.checked=O[35]),te[0]&32768&&(d.checked=O[15]),te[1]&32&&(nt.checked=O[36]),te[1]&64&&(pr.checked=O[37]),te[1]&128&&(dr.checked=O[38]),te[1]&256&&(Gn.checked=O[39]),te[1]&512&&(qn.checked=O[40]),te[1]&1024&&(mr.checked=O[41]),te[0]&16384&&(Xn.checked=O[14]),te[1]&2048&&(gr.checked=O[42]),te[1]&4096&&(br.checked=O[43]),te[1]&8192&&(vr.checked=O[44]),te[1]&16384&&(_r.checked=O[45]),te[1]&32768&&(wr.checked=O[46]),te[1]&65536&&(yr.checked=O[47]),te[1]&131072&&(kr.checked=O[48]),te[1]&262144&&(Sr.checked=O[49]),te[1]&524288&&(Zn.checked=O[50]),te[1]&1048576&&(Cr.checked=O[51]),te[1]&2097152&&(Lr.checked=O[52]),te[1]&4194304&&(Er.checked=O[53]),(!On||te[0]&8)&&(Jn.value=O[3])},i(O){On||(H(p.$$.fragment,O),H(I.$$.fragment,O),H(J.$$.fragment,O),H(W.$$.fragment,O),H(z.$$.fragment,O),H(Ae.$$.fragment,O),H(Ne.$$.fragment,O),H(he.$$.fragment,O),H(We.$$.fragment,O),H(Be.$$.fragment,O),H(ke.$$.fragment,O),On=!0)},o(O){j(p.$$.fragment,O),j(I.$$.fragment,O),j(J.$$.fragment,O),j(W.$$.fragment,O),j(z.$$.fragment,O),j(Ae.$$.fragment,O),j(Ne.$$.fragment,O),j(he.$$.fragment,O),j(We.$$.fragment,O),j(Be.$$.fragment,O),j(ke.$$.fragment,O),On=!1},d(O){O&&V(n),e[77](null),O&&V(t),O&&V(r),e[78](null),O&&V(i),O&&V(o),e[79](null),O&&V(s),O&&V(l),oe(p),oe(I),oe(J),oe(W),oe(z),oe(Ae),oe(Ne),oe(he),oe(We),e[84](null),oe(Be),oe(ke);for(let te=0;te<Je.length;te+=1)Je[te].d();Vt&&Vt.d(),is=!1,Lt(Oa)}}}function Pu(e,n){let t,r=n[156]+"",i,o;return{key:e,first:null,c(){t=g("option"),i=ct(r),o=w(),t.__value=n[156],t.value=t.__value,this.first=t},m(s,l){F(s,t,l),f(t,i),f(t,o)},p(s,l){n=s},d(s){s&&V(t)}}}function Au(e){let n,t,r,i,o;return{c(){n=g("span"),n.textContent="Max lines (floating window)",t=w(),r=g("input"),h(n,"class","label-text col-span-2"),h(r,"type","number"),h(r,"class","input input-bordered h-8 mb-2 col-span-2"),h(r,"min","0"),r.value=e[17]},m(s,l){F(s,n,l),F(s,t,l),F(s,r,l),i||(o=P(r,"blur",e[70]),i=!0)},p(s,l){l[0]&131072&&r.value!==s[17]&&(r.value=s[17])},d(s){s&&V(n),s&&V(t),s&&V(r),i=!1,o()}}}function u1(e){let n,t,r,i;Lu.title=n=e[20]||"Texthooker UI";let o=e[0]&&xu(e);return{c(){t=w(),o&&o.c(),r=Nn()},m(s,l){F(s,t,l),o&&o.m(s,l),F(s,r,l),i=!0},p(s,l){(!i||l[0]&1048576)&&n!==(n=s[20]||"Texthooker UI")&&(Lu.title=n),s[0]?o?(o.p(s,l),l[0]&1&&H(o,1)):(o=xu(s),o.c(),H(o,1),o.m(r.parentNode,r)):o&&(rt(),j(o,1,1,()=>{o=null}),it())},i(s){i||(H(o),i=!0)},o(s){j(o),i=!1},d(s){s&&V(t),o&&o.d(s),s&&V(r)}}}function _s(e,n){const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n)],{type:"application/json"})),t.rel="noopener",t.download=e,setTimeout(()=>{URL.revokeObjectURL(t.href)},1e4),setTimeout(()=>{t.click()})}function c1(e,n,t){let r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$,x,D,J,X,K,B,E,W,U,Z,ve,re,z,M,T,ee,ce,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re,ze,Fe,we,Me,bt,he,ft,We,Ve,ot,vt,je,ae,Be,_t,ke;y(e,Ue,d=>t(139,o=d)),y(e,Li,d=>t(13,s=d)),y(e,Xi,d=>t(3,l=d)),y(e,et,d=>t(140,a=d)),y(e,Fi,d=>t(14,u=d)),y(e,Fr,d=>t(15,c=d)),y(e,Dr,d=>t(16,p=d)),y(e,Hr,d=>t(17,b=d)),y(e,$r,d=>t(18,m=d)),y(e,Mr,d=>t(19,k=d)),y(e,Ur,d=>t(141,S=d)),y(e,lr,d=>t(142,I=d)),y(e,_n,d=>t(143,A=d)),y(e,nr,d=>t(144,$=d)),y(e,ko,d=>t(145,x=d)),y(e,wn,d=>t(146,D=d)),y(e,Rl,d=>t(147,J=d)),y(e,El,d=>t(148,X=d)),y(e,$n,d=>t(76,K=d)),y(e,Mn,d=>t(4,B=d)),y(e,wo,d=>t(5,E=d)),y(e,Or,d=>t(6,W=d)),y(e,_o,d=>t(20,U=d)),y(e,Ir,d=>t(21,Z=d)),y(e,Si,d=>t(22,ve=d)),y(e,ar,d=>t(23,re=d)),y(e,Ci,d=>t(24,z=d)),y(e,yo,d=>t(25,M=d)),y(e,Ei,d=>t(26,T=d)),y(e,xi,d=>t(27,ee=d)),y(e,Pi,d=>t(28,ce=d)),y(e,Ai,d=>t(29,Ae=d)),y(e,Ti,d=>t(30,Ye=d)),y(e,Di,d=>t(31,Se=d)),y(e,Oi,d=>t(32,Ze=d)),y(e,Ii,d=>t(33,Ke=d)),y(e,Mi,d=>t(34,Ne=d)),y(e,$i,d=>t(35,yt=d)),y(e,Hi,d=>t(36,gt=d)),y(e,Ni,d=>t(37,Re=d)),y(e,Ri,d=>t(38,ze=d)),y(e,Wr,d=>t(39,Fe=d)),y(e,jr,d=>t(40,we=d)),y(e,Vi,d=>t(41,Me=d)),y(e,Wi,d=>t(42,bt=d)),y(e,ji,d=>t(43,he=d)),y(e,Bi,d=>t(44,ft=d)),y(e,Ui,d=>t(45,We=d)),y(e,zi,d=>t(46,Ve=d)),y(e,Yi,d=>t(47,ot=d)),y(e,Ki,d=>t(48,vt=d)),y(e,Gi,d=>t(49,je=d)),y(e,Br,d=>t(50,ae=d)),y(e,qi,d=>t(51,Be=d)),y(e,Vl,d=>t(52,_t=d)),y(e,Fl,d=>t(53,ke=d));let{selectedLineIds:ye}=n,{settingsOpen:kt}=n,{settingsElement:Dt}=n,{pipAvailable:Ee}=n;async function _(d){if(!s){const{canceled:G}=await new Promise(le=>{R(Ue,o={icon:tn,message:d?"All displayed and stored Lines will be cleared":"Clear stored Lines + set Timer to 00:00:00",callback:le},o)});if(G)return}R(et,a=[],a),t(74,ye=[]),window.localStorage.removeItem("bannou-texthooker-lineData"),d||R(wn,D=0,D)}const de=zr(),Ot=[on.OFF,on.NOTO,on.KLEE,on.SHIPPORI,on.ACKAISYO,on.CINECAPTION226];let Te,lt,Ce,De,st;function hn(d){const G=d.target;G.setCustomValidity(""),i===r?(G.setCustomValidity("Duplicate Websocket"),t(11,i=""),R($n,K="",K)):R($n,K=G.value,K),G.reportValidity()}function pn(d){d&&!st?go().then(()=>{st=new MutationObserver(jn),st.observe(document.body,{childList:!0})}):!d&&st&&(st.disconnect(),st=void 0)}function jn(d){for(let G=0,{length:le}=d;G<le;G+=1){const{addedNodes:$e}=d[G];for(let nt=0,{length:dt}=$e;nt<dt;nt+=1){const Mt=$e[G];(Mt==null?void 0:Mt.tagName)==="P"&&(Nr.next([Mt.textContent,nn.EXTERNAL,""]),Mt.remove())}}}function ht(d){const G=d.target;!X&&G!==Dt&&G.parentElement!==Dt&&G!==Te&&G!==lt&&G!==Ce&&!J&&t(0,kt=!1)}async function zt(){const{canceled:d,data:G}=await new Promise(le=>{R(Ue,o={icon:tn,askForData:"text",dataValue:"00:00:00",message:"New Time",callback:le},o)});if(!d){if(!/^[\d]{1,}:[\d]{1,2}:[\d]{1,2}$/.test(G))return new Promise(le=>{R(Ue,o={icon:Qu,type:"error",message:"Invalid Time value (x:xx:xx)",showCancel:!1,callback:le},o)});R(wn,D=ep(G),D)}}async function Ht(){if(!s){const{canceled:d}=await new Promise(G=>{R(Ue,o={icon:tn,message:"Timer will be set to 00:00:00",callback:G},o)});if(d)return}R(wn,D=0,D)}async function Ge(d){d.altKey?await Un(Te,"Existing Data will be overwritten"):_s("texthooker-ui_data.json",{"bannou-texthooker-timeValue":D,"bannou-texthooker-userNotes":x,"bannou-texthooker-lineData":a,"bannou-texthooker-actionHistory":$})}async function xe(d){d.altKey?await Un(lt,"Presets, Settings etc. will be overwritten"):_s("texthooker-ui_settings.json",{currentSettings:De.getCurrentSettings(),settingPresets:A,lastSettingsPreset:I})}async function C(d){if(d.altKey)await Un(Ce,"Preset will be overwritten or otherwise added");else if(I){const G=A.find(le=>le.name===I);G&&_s("texthooker-ui_preset.json",{name:G.name,settings:G.settings})}}async function N(){const d=await Ln(Te).catch(({message:G})=>{R(Ue,o={type:"error",message:G,showCancel:!1},o)});if(d){const G=Object.entries(d);for(let le=0,{length:$e}=G;le<$e;le+=1){const[nt,dt]=G[le];switch(nt){case"bannou-texthooker-timeValue":R(wn,D=dt,D);break;case"bannou-texthooker-userNotes":R(ko,x=dt,x);break;case"bannou-texthooker-lineData":R(et,a=dt,a);break;case"bannou-texthooker-actionHistory":R(nr,$=dt,$);break}}}t(7,Te.value=null,Te)}async function St(){const d=await Ln(lt).catch(({message:G})=>{R(Ue,o={type:"error",message:G,showCancel:!1},o)});d&&(R(_n,A=d.settingPresets||[],A),R(lr,I=d.lastSettingsPreset||"",I),d.currentSettings&&De.updateSettingsWithPreset({name:"",settings:d.currentSettings},!1)),t(8,lt.value=null,lt)}async function tt(){const d=await Ln(Ce).catch(({message:G})=>{R(Ue,o={type:"error",message:G,showCancel:!1},o)});if(d&&d.name&&d.settings){const G=A.findIndex(le=>le.name===d.name);G>-1?(R(_n,A[G]=d,A),R(_n,A=[...A],A)):R(_n,A=[...A,d],A),R(lr,I=d.name,I),De.updateSettingsWithPreset(d)}t(9,Ce.value=null,Ce)}async function Je(d,G,le){if(d)return;const{canceled:$e}=await new Promise(nt=>{R(Ue,o={icon:tn,message:G,callback:nt},o)});$e||window.localStorage.removeItem(le)}function Jt(d){const G=d.target,le=Number.parseInt(G.value||"0");!le||le<2?R(Mr,k=0,k):R(Mr,k=le,k),k===0&&R(Ur,S=new Map,S),G.value=`${k}`}function It(d){const G=d.target,le=Number.parseInt(G.value||"0"),$e=le!==m;!le||le<0?R($r,m=0,m):R($r,m=le,m),G.value=`${m}`,$e&&Nt()}async function Nt(){if(!m||a.length<2)return;const{canceled:d}=await new Promise(dt=>{R(Ue,o={icon:tn,message:"Apply to current lines",callback:dt},o)});if(d)return;const G=[],le=new Set,$e=new Set,nt=a.splice(-(m+1));for(let dt=0,{length:Mt}=nt;dt<Mt;dt+=1){const hr=nt[dt];le.has(hr.text)?$e.add(hr.id):(G.push(hr),le.add(hr.text))}R(et,a=[...a,...G],a),t(74,ye=ye.filter(dt=>!$e.has(dt)))}function Qt(d){const G=d.target,le=Number.parseInt(G.value||"0"),$e=le!==p;!le||le<0?R(Dr,p=0,p):R(Dr,p=le,p),G.value=`${p}`,$e&&Gr()}function Yt(d){const G=d.target,le=Number.parseInt(G.value||"0");!le||le<0?R(Hr,b=1,b):R(Hr,b=le,b),G.value=`${b}`}async function Gr(){const d=a.length-p;if(!p||d<1)return;const{canceled:G}=await new Promise(le=>{R(Ue,o={icon:tn,message:`This will remove the first ${d} line(s)`,callback:le},o)});G?R(Dr,p=0,p):de("maxLinesChange")}async function Bn(){if(!c||a.length<2)return;const{canceled:d}=await new Promise(G=>{R(Ue,o={icon:tn,message:"Apply to current lines",callback:G},o)});if(!d){const G=new Set,le=new Set;R(et,a=a.filter($e=>G.has($e.text)?(le.add($e.id),!1):(G.add($e.text),!0)),a),t(74,ye=ye.filter($e=>!le.has($e)))}}async function qr(){if(u){const{canceled:d}=await new Promise(G=>{R(Ue,o={icon:tn,message:"Apply to current Lines",callback:G},o)});d||R(et,a=a.map(G=>(G.text=G.text.replace(/\s/g,"").trim(),G)),a)}}function Kt(d){R(Xi,l=d.target.value,l)}async function Un(d,G){if(!s){const{canceled:le}=await new Promise($e=>{R(Ue,o={icon:tn,message:G,callback:$e},o)});if(le)return}d.click()}function Ln(d){return new Promise((G,le)=>{const[$e]=d.files,nt=new FileReader;if(!$e)return G();if(!$e.name.endsWith(".json"))return R(Ue,o={type:"error",message:"Expected json File",showCancel:!1},o),d.value=null,G();nt.addEventListener("loadend",dt=>{try{const Mt=JSON.parse(dt.target.result);G(Mt)}catch{le(new Error("Error parsing File"))}}),nt.addEventListener("error",()=>le(new Error("Failed to read File"))),nt.readAsText($e,"utf-8")})}async function zn(){try{const d=await fetch(Co("/get_websocket_port"));if(!d.ok)throw new Error("Failed to fetch websocket port");return(await d.json()).port}catch(d){return console.error("Error fetching websocket port:",d),null}}function Xr(d){mt[d?"unshift":"push"](()=>{Te=d,t(7,Te)})}function Rt(d){mt[d?"unshift":"push"](()=>{lt=d,t(8,lt)})}function Zr(d){mt[d?"unshift":"push"](()=>{Ce=d,t(9,Ce)})}const Yn=()=>_(!0),Jr=()=>_(!1),an=()=>R(Or,W=W===rn.BUSINESS?rn.GARDEN:rn.BUSINESS,W),Qr=()=>R(Or,W=W===rn.BUSINESS?rn.GARDEN:rn.BUSINESS,W);function Kn(d){mt[d?"unshift":"push"](()=>{De=d,t(10,De)})}function ei(d){mo.call(this,e,d)}const un=({detail:d})=>C(d);function v(d){mo.call(this,e,d)}function Q(){U=this.value,_o.set(U)}function ne(){r=this.value,t(12,r),t(4,B)}const pe=()=>R(Mn,B=r,B);function ge(){i=this.value,t(11,i),t(76,K)}function pt(){Z=Ol(this.value),Ir.set(Z)}const dn=()=>{(!Z||Z<1)&&R(Ir,Z=24,Z)};function Gt(){ve=uf(this),Si.set(ve),t(55,Ot)}function fr(){re=Ol(this.value),ar.set(re)}const ti=()=>{(re===null||re<0)&&R(ar,re=0,re)};function To(){z=this.checked,Ci.set(z)}function mn(){E=this.checked,wo.set(E)}function Do(){M=this.checked,yo.set(M)}function ni(){s=this.checked,Li.set(s)}function Oo(){T=this.checked,Ei.set(T)}const gn=()=>Je(T,"Clear stored stats","bannou-texthooker-timeValue");function Io(){ee=this.checked,xi.set(ee)}const ri=()=>Je(ee,"Clear stored notes","bannou-texthooker-userNotes");function Mo(){ce=this.checked,Pi.set(ce)}const bn=()=>Je(ce,"Clear stored lines","bannou-texthooker-lineData");function $o(){Ae=this.checked,Ai.set(Ae)}const ii=()=>Je(Ae,"Clear action history","bannou-texthooker-actionHistory");function Ho(){Ye=this.checked,Ti.set(Ye)}function vn(){Se=this.checked,Di.set(Se)}function No(){Ze=this.checked,Oi.set(Ze)}function oi(){Ke=this.checked,Ii.set(Ke)}function Ro(){Ne=this.checked,Mi.set(Ne)}function En(){yt=this.checked,$i.set(yt)}function Vo(){c=this.checked,Fr.set(c)}function li(){gt=this.checked,Hi.set(gt)}function Fo(){Re=this.checked,Ni.set(Re)}function xn(){ze=this.checked,Ri.set(ze)}function Wo(){Fe=this.checked,Wr.set(Fe)}const si=()=>de("layoutChange");function jo(){we=this.checked,jr.set(we)}const Pn=()=>de("layoutChange");function Bo(){Me=this.checked,Vi.set(Me)}function ai(){u=this.checked,Fi.set(u)}function Uo(){bt=this.checked,Wi.set(bt)}function An(){he=this.checked,ji.set(he)}function zo(){ft=this.checked,Bi.set(ft)}function ui(){We=this.checked,Ui.set(We)}function Yo(){Ve=this.checked,zi.set(Ve)}function Tn(){ot=this.checked,Yi.set(ot)}function Ko(){vt=this.checked,Ki.set(vt)}function ci(){je=this.checked,Gi.set(je)}function Go(){ae=this.checked,Br.set(ae)}const Dn=()=>{ts.next(),ns.next()};function qo(){Be=this.checked,qi.set(Be)}function fi(){_t=this.checked,Vl.set(_t)}function Xo(){ke=this.checked,Fl.set(ke)}return e.$$set=d=>{"selectedLineIds"in d&&t(74,ye=d.selectedLineIds),"settingsOpen"in d&&t(0,kt=d.settingsOpen),"settingsElement"in d&&t(75,Dt=d.settingsElement),"pipAvailable"in d&&t(1,Ee=d.pipAvailable)},e.$$.update=()=>{e.$$.dirty[0]&16&&zn().then(d=>{d&&B!==`ws://localhost:${d}`&&R(Mn,B=`ws://localhost:${d}`,B)}),e.$$.dirty[0]&16&&t(12,r=B),e.$$.dirty[2]&16384&&t(11,i=K),e.$$.dirty[0]&64&&(document.body.dataset.theme=W),e.$$.dirty[0]&32&&pn(E),e.$$.dirty[0]&8&&Pc(document,l)},[kt,Ee,_,l,B,E,W,Te,lt,Ce,De,i,r,s,u,c,p,b,m,k,U,Z,ve,re,z,M,T,ee,ce,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re,ze,Fe,we,Me,bt,he,ft,We,Ve,ot,vt,je,ae,Be,_t,ke,de,Ot,hn,ht,zt,Ht,Ge,xe,C,N,St,tt,Je,Jt,It,Qt,Yt,Bn,qr,Kt,ye,Dt,K,Xr,Rt,Zr,Yn,Jr,an,Qr,Kn,ei,un,v,Q,ne,pe,ge,pt,dn,Gt,fr,ti,To,mn,Do,ni,Oo,gn,Io,ri,Mo,bn,$o,ii,Ho,vn,No,oi,Ro,En,Vo,li,Fo,xn,Wo,si,jo,Pn,Bo,ai,Uo,An,zo,ui,Yo,Tn,Ko,ci,Go,Dn,qo,fi,Xo]}class f1 extends Ut{constructor(n){super(),Bt(this,n,c1,u1,Et,{selectedLineIds:74,settingsOpen:0,settingsElement:75,pipAvailable:1,handleReset:2},null,[-1,-1,-1,-1,-1,-1])}get handleReset(){return this.$$.ctx[2]}}class h1{constructor(n=!0){eo(this,"websocketUrl");eo(this,"socket");eo(this,"socketState");eo(this,"subscriptions",[]);this.socketState=n?zs:Ys,this.subscriptions.push((n?Mn:$n).subscribe(t=>{t!==this.websocketUrl&&(this.websocketUrl=t,this.reloadSocket())}),Br.pipe(vo(t=>t?(n?ts:ns).pipe(Jl(()=>{var r;return((r=this.socket)==null?void 0:r.readyState)===3})):bo)).subscribe(()=>this.reloadSocket()))}getCurrentUrl(){return this.websocketUrl}connect(){var n;if(!(((n=this.socket)==null?void 0:n.readyState)<2)){if(!this.websocketUrl){this.socketState.next(3);return}this.socketState.next(0);try{this.socket=new WebSocket(this.websocketUrl),this.socket.onopen=this.updateSocketState.bind(this),this.socket.onclose=this.updateSocketState.bind(this),this.socket.onmessage=this.handleMessage.bind(this)}catch{this.socketState.next(3)}}}disconnect(){var n;((n=this.socket)==null?void 0:n.readyState)===1&&this.socket.close(1e3,"User Request")}cleanUp(){this.disconnect();for(let n=0,{length:t}=this.subscriptions;n<t;n+=1)this.subscriptions[n].unsubscribe()}reloadSocket(){this.disconnect(),this.socket=void 0,this.connect()}updateSocketState(){this.socket&&this.socketState.next(this.socket.readyState)}handleMessage(n){var i,o,s,l;let t=n.data;try{if(((i=JSON.parse(n.data))==null?void 0:i.event)==="reset_checkboxes"){Nr.next(["",nn.RESETCHECKBOXES,""]);return}t=((o=JSON.parse(n.data))==null?void 0:o.sentence)||n.data}catch{}console.log(n.data);const r=((l=(s=JSON.parse(n.data))==null?void 0:s.data)==null?void 0:l.id)||"";Nr.next([t,nn.SOCKET,r])}}function p1(e){let n;return{c(){n=g("span"),h(n,"class","animate-ping relative inline-flex rounded-full h-3 w-3 mx-3 bg-primary")},m(t,r){F(t,n,r)},p:Ie,i:Ie,o:Ie,d(t){t&&V(n)}}}function d1(e){let n,t,r;return t=new _e({props:{path:Sf,class:"cursor-pointer mx-2"}}),t.$on("click",e[3]),{c(){n=g("div"),se(t.$$.fragment),h(n,"class","hover:text-primary"),h(n,"title",e[1]),q(n,"text-red-500",e[0]!==-1),q(n,"text-green-700",e[0]===1)},m(i,o){F(i,n,o),ie(t,n,null),r=!0},p(i,o){(!r||o&2)&&h(n,"title",i[1]),(!r||o&1)&&q(n,"text-red-500",i[0]!==-1),(!r||o&1)&&q(n,"text-green-700",i[0]===1)},i(i){r||(H(t.$$.fragment,i),r=!0)},o(i){j(t.$$.fragment,i),r=!1},d(i){i&&V(n),oe(t)}}}function m1(e){let n,t,r,i;const o=[d1,p1],s=[];function l(a,u){return a[0]!==0?0:1}return n=l(e),t=s[n]=o[n](e),{c(){t.c(),r=Nn()},m(a,u){s[n].m(a,u),F(a,r,u),i=!0},p(a,[u]){let c=n;n=l(a),n===c?s[n].p(a,u):(rt(),j(s[c],1,1,()=>{s[c]=null}),it(),t=s[n],t?t.p(a,u):(t=s[n]=o[n](a),t.c()),H(t,1),t.m(r.parentNode,r))},i(a){i||(H(t),i=!0)},o(a){j(t),i=!1},d(a){s[n].d(a),a&&V(r)}}}function g1(e,n,t){let r,i,o,s,l,a,u,c;y(e,$n,D=>t(9,o=D)),y(e,Mn,D=>t(10,s=D)),y(e,Xt,D=>t(11,l=D)),y(e,Ue,D=>t(12,a=D)),y(e,Br,D=>t(13,u=D)),y(e,qi,D=>t(14,c=D));let{isPrimary:p=!0}=n,b,m=!1,k=!1,S=!1,I=p?zs:Ys;y(e,I,D=>t(0,i=D)),Yl(()=>(x(),()=>{S=!0,b==null||b.cleanUp()}));function A(D){switch(D){case 0:t(5,k=!1),S=!1;break;case 1:m=!0,t(5,k=!0);break;case 3:const J=p?"primary":"secondary";c&&!S&&m&&(p?s:o)&&(k||!u)&&R(Ue,a={type:"error",message:k?`Lost Connection to ${J} Websocket`:`Unable to connect to ${J} Websocket`,showCancel:!1},a),R(Xt,l=!0,l),m=!0,t(5,k=!1),S||(p?ts:ns).next();break}t(1,r=$(k))}function $(D){return D?`Connected with ${p?s:o}`:"Not Connected"}async function x(){i===1&&b?(S=!0,b.disconnect()):(b=b||new h1(p),b.connect())}return e.$$set=D=>{"isPrimary"in D&&t(4,p=D.isPrimary)},e.$$.update=()=>{e.$$.dirty&32&&t(1,r=$(k)),e.$$.dirty&1&&A(i)},[i,r,I,x,p,k]}class Kc extends Ut{constructor(n){super(),Bt(this,n,g1,m1,Et,{isPrimary:4})}}function b1(e){let n,t,r,i,o;return{c(){n=g("div"),t=w(),r=g("div"),r.innerHTML=`<div role="status"><svg aria-hidden="true" class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"></path><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"></path></svg>
37
- <span class="sr-only">Loading...</span></div>`,i=w(),o=g("div"),h(n,"class","tap-highlight-transparent absolute inset-0 bg-black/[.3] z-20"),h(r,"class","fixed inset-0 flex h-full w-full items-center justify-center z-50")},m(s,l){F(s,n,l),F(s,t,l),F(s,r,l),F(s,i,l),F(s,o,l)},p:Ie,i:Ie,o:Ie,d(s){s&&V(n),s&&V(t),s&&V(r),s&&V(i),s&&V(o)}}}class v1 extends Ut{constructor(n){super(),Bt(this,n,null,b1,Et,{})}}function _1(e){let n=(e[2]??"")+"",t,r,i=(e[3]??"")+"",o,s,l,a,u,c,p;return{c(){t=ct(n),r=w(),o=ct(i),s=w(),l=g("div"),a=g("div"),u=ct(e[1]),h(l,"class","text-sm timer mr-1 sm:text-base sm:mr-2 svelte-1efsh80"),q(l,"blur",e[4])},m(b,m){F(b,t,m),F(b,r,m),F(b,o,m),F(b,s,m),F(b,l,m),f(l,a),f(a,u),e[17](l),c||(p=P(l,"pointerleave",e[7]),c=!0)},p(b,[m]){m&4&&n!==(n=(b[2]??"")+"")&&At(t,n),m&8&&i!==(i=(b[3]??"")+"")&&At(o,i),m&2&&At(u,b[1]),m&16&&q(l,"blur",b[4])},i:Ie,o:Ie,d(b){b&&V(t),b&&V(r),b&&V(o),b&&V(s),b&&V(l),e[17](null),c=!1,p()}}}const w1=/[^0-9A-Z○◯々-〇〻ぁ-ゖゝ-ゞァ-ヺー0-9A-Zヲ-ン\p{Radical}\p{Unified_Ideograph}]+/gimu;function y1(e){return e?k1(e.replace(w1,"")):0}function k1(e){return Array.from(e).length}function S1(e,n,t){let r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$;y(e,Bi,M=>t(10,r=M)),y(e,Ui,M=>t(11,i=M)),y(e,ji,M=>t(12,o=M)),y(e,Wi,M=>t(13,s=M)),y(e,wn,M=>t(14,l=M)),y(e,Xt,M=>t(20,a=M)),y(e,Gi,M=>t(21,u=M)),y(e,Ki,M=>t(22,c=M)),y(e,ar,M=>t(23,p=M)),y(e,Ci,M=>t(24,b=M)),y(e,et,M=>t(15,m=M)),y(e,Ur,M=>t(25,k=M)),y(e,Mr,M=>t(16,S=M)),y(e,zi,M=>t(4,$=M));let x=0,D=0;const J=zr(),X=Xt.pipe(vo(M=>M?(D=0,bo):(x=performance.now(),Wh(1e3))),tr(ve),rr());y(e,X,M=>t(2,I=M));const K=Dh([Xt,ar]).pipe(vo(([M,T])=>M||T<1?bo:jh(Nr,or(window,"pointermove"),or(document,"selectionchange")).pipe(Uh(!0),Yh(1e3),tr(()=>D=performance.now()+p*1e3),Us(p*1e3))),rr());y(e,K,M=>t(3,A=M));let B,E=0,W=0,U="";function Z(){const M=window.getSelection();M!=null&&M.toString()&&M.getRangeAt(0).intersectsNode(B)&&M.removeAllRanges()}function ve(){const M=D?Math.min(D,performance.now()):performance.now(),T=Math.round((M-x+Number.EPSILON)/1e3);D&&M>=D?(R(Xt,a=!0,a),b?R(wn,l=Math.max(0,l+T-p),l):R(wn,l+=T,l),c&&(J("afkBlur",!0),document.addEventListener("dblclick",ee=>{ee.stopPropagation(),window.getSelection().removeAllRanges(),J("afkBlur",!1),u&&R(Xt,a=!1,a)},{once:!0,capture:!1}))):(x=M,R(wn,l+=T,l))}function re(M,T,ee,ce){let Ae="";s&&(Ae+=Qh(M)),o&&(Ae+=` (${T}/h) `),r&&(Ae+=` ${ee}`),i&&(Ae+=r?" /":"",Ae+=` ${ce}`),t(1,U=Ae.replace(/[ ]+/g," ").trim())}function z(M){mt[M?"unshift":"push"](()=>{B=M,t(0,B)})}return e.$$.update=()=>{if(e.$$.dirty&116224&&(r||S>1)&&m){const M=new Map;let T=0,ee=S>1?S:0;for(let ce=0,{length:Ae}=m;ce<Ae;ce+=1)if(T+=y1(m[ce].text),ee&&T>=ee){let Ye=T,Se=ee;for(M.set(m[ce].id,`Milestone ${Se} (${T})`);Ye>=ee;)ee+=S}R(Ur,k=M,k),t(9,W=T),t(8,E=l?Math.ceil(3600*W/l):0)}e.$$.dirty&65280&&(l>-1&&(s||o||r||i)?re(l,E,W,m.length):t(1,U=""))},[B,U,I,A,$,X,K,Z,E,W,r,i,o,s,l,m,S,z]}class C1 extends Ut{constructor(n){super(),Bt(this,n,S1,_1,Et,{})}}const{window:L1}=Hs;function Tu(e,n,t){const r=e.slice();return r[106]=n[t],r[108]=t,r}function Du(e,n,t){const r=e.slice();return r[106]=n[t],r[109]=n,r[108]=t,r}function Ou(e){let n,t;return n=new v1({}),{c(){se(n.$$.fragment)},m(r,i){ie(n,r,i),t=!0},i(r){t||(H(n.$$.fragment,r),t=!0)},o(r){j(n.$$.fragment,r),t=!1},d(r){oe(n,r)}}}function Iu(e){let n,t;return n=new Kc({}),{c(){se(n.$$.fragment)},m(r,i){ie(n,r,i),t=!0},i(r){t||(H(n.$$.fragment,r),t=!0)},o(r){j(n.$$.fragment,r),t=!1},d(r){oe(n,r)}}}function Mu(e){let n,t;return n=new Kc({props:{isPrimary:!1}}),{c(){se(n.$$.fragment)},m(r,i){ie(n,r,i),t=!0},i(r){t||(H(n.$$.fragment,r),t=!0)},o(r){j(n.$$.fragment,r),t=!1},d(r){oe(n,r)}}}function E1(e){let n,t,r;return t=new _e({props:{path:Tf,width:e[13],height:e[13]}}),t.$on("click",e[55]),{c(){n=g("div"),se(t.$$.fragment),h(n,"role","button"),h(n,"title","Pause"),h(n,"class","mr-1 hover:text-primary sm:mr-2")},m(i,o){F(i,n,o),ie(t,n,null),r=!0},p(i,o){const s={};o[0]&8192&&(s.width=i[13]),o[0]&8192&&(s.height=i[13]),t.$set(s)},i(i){r||(H(t.$$.fragment,i),r=!0)},o(i){j(t.$$.fragment,i),r=!1},d(i){i&&V(n),oe(t)}}}function x1(e){let n,t,r;return t=new _e({props:{path:Of,width:e[13],height:e[13]}}),t.$on("click",e[54]),{c(){n=g("div"),se(t.$$.fragment),h(n,"role","button"),h(n,"title","Continue"),h(n,"class","mr-1 animate-[pulse_1.25s_cubic-bezier(0.4,0,0.6,1)_infinite] hover:text-primary sm:mr-2")},m(i,o){F(i,n,o),ie(t,n,null),r=!0},p(i,o){const s={};o[0]&8192&&(s.width=i[13]),o[0]&8192&&(s.height=i[13]),t.$set(s)},i(i){r||(H(t.$$.fragment,i),r=!0)},o(i){j(t.$$.fragment,i),r=!1},d(i){i&&V(n),oe(t)}}}function $u(e){let n,t,r,i,o,s;return t=new _e({props:{path:so,width:e[13],height:e[13]}}),t.$on("click",e[39]),o=new _e({props:{path:Ju,width:e[13],height:e[13]}}),o.$on("click",e[40]),{c(){n=g("div"),se(t.$$.fragment),r=w(),i=g("div"),se(o.$$.fragment),h(n,"role","button"),h(n,"title","Remove selected Lines"),h(n,"class","mr-1 hover:text-primary sm:mr-2"),h(i,"role","button"),h(i,"title","Deselect Lines"),h(i,"class","mr-1 hover:text-primary sm:mr-2")},m(l,a){F(l,n,a),ie(t,n,null),F(l,r,a),F(l,i,a),ie(o,i,null),s=!0},p(l,a){const u={};a[0]&8192&&(u.width=l[13]),a[0]&8192&&(u.height=l[13]),t.$set(u);const c={};a[0]&8192&&(c.width=l[13]),a[0]&8192&&(c.height=l[13]),o.$set(c)},i(l){s||(H(t.$$.fragment,l),H(o.$$.fragment,l),s=!0)},o(l){j(t.$$.fragment,l),j(o.$$.fragment,l),s=!1},d(l){l&&V(n),oe(t),l&&V(r),l&&V(i),oe(o)}}}function Hu(e){let n,t,r,i;return t=new _e({props:{width:e[13],height:e[13],path:e[1]?Na:Ra}}),t.$on("click",e[41]),{c(){n=g("div"),se(t.$$.fragment),h(n,"role","button"),h(n,"class","mr-1 hover:text-primary sm:mr-2"),h(n,"title",r=e[1]?"Close Floating Window":"Open Floating Window")},m(o,s){F(o,n,s),ie(t,n,null),i=!0},p(o,s){const l={};s[0]&8192&&(l.width=o[13]),s[0]&8192&&(l.height=o[13]),s[0]&2&&(l.path=o[1]?Na:Ra),t.$set(l),(!i||s[0]&2&&r!==(r=o[1]?"Close Floating Window":"Open Floating Window"))&&h(n,"title",r)},i(o){i||(H(t.$$.fragment,o),i=!0)},o(o){j(t.$$.fragment,o),i=!1},d(o){o&&V(n),oe(t)}}}function Nu(e,n){let t,r,i=n[108],o;const s=()=>n[66](r,i),l=()=>n[66](null,i);let a={line:n[106],index:n[108],isLast:n[3].length-1===n[108]};return r=new Tc({props:a}),s(),r.$on("selected",n[67]),r.$on("deselected",n[68]),r.$on("edit",n[44]),{key:e,first:null,c(){t=Nn(),se(r.$$.fragment),this.first=t},m(u,c){F(u,t,c),ie(r,u,c),o=!0},p(u,c){n=u,i!==n[108]&&(l(),i=n[108],s());const p={};c[0]&8&&(p.line=n[106]),c[0]&8&&(p.index=n[108]),c[0]&8&&(p.isLast=n[3].length-1===n[108]),r.$set(p)},i(u){o||(H(r.$$.fragment,u),o=!0)},o(u){j(r.$$.fragment,u),o=!1},d(u){u&&V(t),l(),oe(r,u)}}}function Ru(e){let n,t,r,i;return t=new gp({}),{c(){n=g("div"),se(t.$$.fragment),h(n,"class","bg-base-200 fixed top-0 right-0 z-[60] flex h-full w-full max-w-3xl flex-col justify-between")},m(o,s){F(o,n,s),ie(t,n,null),i=!0},p(o,s){},i(o){i||(H(t.$$.fragment,o),o&&(r||Rr(()=>{r=Zu(n,Ec,{x:100,duration:100,easing:Gh}),r.start()})),i=!0)},o(o){j(t.$$.fragment,o),i=!1},d(o){o&&V(n),oe(t)}}}function Vu(e){let n=[],t=new Map,r,i,o=e[12];const s=l=>l[106].id;for(let l=0;l<o.length;l+=1){let a=Tu(e,o,l),u=s(a);t.set(u,n[l]=Fu(u,a))}return{c(){for(let l=0;l<n.length;l+=1)n[l].c();r=Nn()},m(l,a){for(let u=0;u<n.length;u+=1)n[u].m(l,a);F(l,r,a),i=!0},p(l,a){a[0]&4098&&(o=l[12],rt(),n=Yr(n,a,s,1,l,o,t,r.parentNode,Ns,Fu,r,Tu),it())},i(l){if(!i){for(let a=0;a<o.length;a+=1)H(n[a]);i=!0}},o(l){for(let a=0;a<n.length;a+=1)j(n[a]);i=!1},d(l){for(let a=0;a<n.length;a+=1)n[a].d(l);l&&V(r)}}}function Fu(e,n){let t,r,i;return r=new Tc({props:{line:n[106],index:n[108],pipWindow:n[1],isLast:n[12].length-1===n[108]}}),{key:e,first:null,c(){t=Nn(),se(r.$$.fragment),this.first=t},m(o,s){F(o,t,s),ie(r,o,s),i=!0},p(o,s){n=o;const l={};s[0]&4096&&(l.line=n[106]),s[0]&4096&&(l.index=n[108]),s[0]&2&&(l.pipWindow=n[1]),s[0]&4096&&(l.isLast=n[12].length-1===n[108]),r.$set(l)},i(o){i||(H(r.$$.fragment,o),i=!0)},o(o){j(r.$$.fragment,o),i=!1},d(o){o&&V(t),oe(r,o)}}}function P1(e){let n=(e[21]??"")+"",t,r,i=(e[22]??"")+"",o,s,l=(e[23]??"")+"",a,u,c=(e[24]??"")+"",p,b,m=(e[25]??"")+"",k,S,I,A,$,x,D,J,X,K,B,E,W,U,Z,ve,re,z,M,T,ee,ce,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re,ze,Fe,we,Me,bt,he,ft,We,Ve=[],ot=new Map,vt,je,ae,Be,_t,ke,ye,kt,Dt,Ee=e[14]&&Ou();A=new fp({}),D=new C1({}),D.$on("afkBlur",e[42]);let _=e[26]&&Iu(),de=e[27]&&Mu();const Ot=[x1,E1],Te=[];function lt(C,N){return C[19]?0:1}B=lt(e),E=Te[B]=Ot[B](e),Z=new _e({props:{path:Lf,width:e[13],height:e[13]}}),Z.$on("click",e[38]),z=new _e({props:{path:wf,width:e[13],height:e[13]}}),z.$on("click",e[37]);let Ce=e[5].length&&$u(e);ce=new _e({props:{path:Af,width:e[13],height:e[13]}}),ce.$on("click",e[56]);let De=e[2]&&Hu(e);Ze=new _e({props:{path:yf,width:e[13],height:e[13]}}),Ze.$on("click",e[57]);function st(C){e[58](C)}let hn={class:"cursor-pointer mr-1 hover:text-primary md:mr-2",path:kf,width:e[13],height:e[13]};e[7]!==void 0&&(hn.element=e[7]),Ne=new _e({props:hn}),mt.push(()=>ss(Ne,"element",st,e[7])),Ne.$on("click",e[59]);function pn(C){e[60](C)}function jn(C){e[61](C)}let ht={settingsElement:e[7],pipAvailable:e[2]};e[8]!==void 0&&(ht.settingsOpen=e[8]),e[5]!==void 0&&(ht.selectedLineIds=e[5]),Re=new f1({props:ht}),mt.push(()=>ss(Re,"settingsOpen",pn,e[8])),mt.push(()=>ss(Re,"selectedLineIds",jn,e[5])),e[62](Re),Re.$on("applyReplacements",e[63]),Re.$on("layoutChange",e[43]),Re.$on("maxLinesChange",e[64]),Me=new Oc({props:{isQuickSwitch:!0}}),Me.$on("layoutChange",e[43]);let zt=e[3];const Ht=C=>C[106].id;for(let C=0;C<zt.length;C+=1){let N=Du(e,zt,C),St=Ht(N);ot.set(St,Ve[C]=Nu(St,N))}let Ge=e[20]&&Ru(),xe=e[1]&&Vu(e);return{c(){t=ct(n),r=w(),o=ct(i),s=w(),a=ct(l),u=w(),p=ct(c),b=w(),k=ct(m),S=w(),Ee&&Ee.c(),I=w(),se(A.$$.fragment),$=w(),x=g("header"),se(D.$$.fragment),J=w(),_&&_.c(),X=w(),de&&de.c(),K=w(),E.c(),W=w(),U=g("div"),se(Z.$$.fragment),ve=w(),re=g("div"),se(z.$$.fragment),M=w(),Ce&&Ce.c(),T=w(),ee=g("div"),se(ce.$$.fragment),Ae=w(),De&&De.c(),Ye=w(),Se=g("div"),se(Ze.$$.fragment),Ke=w(),se(Ne.$$.fragment),gt=w(),se(Re.$$.fragment),we=w(),se(Me.$$.fragment),bt=w(),he=g("main"),ft=new Yu(!1),We=w();for(let C=0;C<Ve.length;C+=1)Ve[C].c();vt=w(),je=g("div"),ae=g("input"),Be=w(),Ge&&Ge.c(),_t=w(),ke=g("div"),xe&&xe.c(),h(U,"role","button"),h(U,"title","Delete last Line"),h(U,"class","mr-1 hover:text-primary sm:mr-2"),q(U,"opacity-50",!e[3].length),q(U,"cursor-not-allowed",!e[3].length),q(U,"hover:text-primary",e[3].length),h(re,"role","button"),h(re,"title","Undo last Action"),h(re,"class","mr-1 hover:text-primary sm:mr-2"),q(re,"opacity-50",!e[15].length),q(re,"cursor-not-allowed",!e[15].length),q(re,"hover:text-primary",e[15].length),h(ee,"role","button"),h(ee,"title","Open Notes"),h(ee,"class","mr-1 hover:text-primary sm:mr-2"),h(Se,"role","button"),h(Se,"class","mr-1 hover:text-primary sm:mr-2"),h(Se,"title","Open Statistics Page"),h(x,"class","fixed top-0 right-0 flex justify-end items-center p-2 bg-base-100"),ft.a=We,h(he,"class","flex flex-col flex-1 break-all px-4 w-full h-full overflow-auto"),q(he,"py-16",!e[18]),q(he,"py-8",e[18]),q(he,"opacity-50",e[20]),q(he,"flex-col-reverse",e[17]),be(he,"font-size",`${e[28]}px`),be(he,"font-family",e[29]!==on.OFF?e[29]:void 0),be(he,"writing-mode",e[18]?"vertical-rl":"horizontal-tb"),h(ae,"type","text"),h(ae,"placeholder","TL"),h(ae,"class","w-8 h-6 text-xs p-1 border border-gray-300 rounded text-center bg-base-100"),h(ae,"title","Press Enter to translate a number of lines"),h(je,"class","fixed bottom-2 right-2 z-50"),h(ke,"id","pip-container"),h(ke,"class","flex flex-col flex-1 flex flex-col break-all px-4 w-full h-full overflow-auto"),q(ke,"flex-col-reverse",e[17]),q(ke,"hidden",!e[1]),be(ke,"font-size",`${e[28]}px`),be(ke,"font-family",e[29]!==on.OFF?e[29]:void 0)},m(C,N){F(C,t,N),F(C,r,N),F(C,o,N),F(C,s,N),F(C,a,N),F(C,u,N),F(C,p,N),F(C,b,N),F(C,k,N),F(C,S,N),Ee&&Ee.m(C,N),F(C,I,N),ie(A,C,N),F(C,$,N),F(C,x,N),ie(D,x,null),f(x,J),_&&_.m(x,null),f(x,X),de&&de.m(x,null),f(x,K),Te[B].m(x,null),f(x,W),f(x,U),ie(Z,U,null),f(x,ve),f(x,re),ie(z,re,null),f(x,M),Ce&&Ce.m(x,null),f(x,T),f(x,ee),ie(ce,ee,null),f(x,Ae),De&&De.m(x,null),f(x,Ye),f(x,Se),ie(Ze,Se,null),f(x,Ke),ie(Ne,x,null),f(x,gt),ie(Re,x,null),f(x,we),ie(Me,x,null),e[65](x),F(C,bt,N),F(C,he,N),ft.m(Ac,he),f(he,We);for(let St=0;St<Ve.length;St+=1)Ve[St].m(he,null);e[69](he),F(C,vt,N),F(C,je,N),f(je,ae),wt(ae,e[11]),F(C,Be,N),Ge&&Ge.m(C,N),F(C,_t,N),F(C,ke,N),xe&&xe.m(ke,null),e[72](ke),ye=!0,kt||(Dt=[P(L1,"keyup",e[36]),P(ae,"input",e[70]),P(ae,"keydown",e[71])],kt=!0)},p(C,N){(!ye||N[0]&2097152)&&n!==(n=(C[21]??"")+"")&&At(t,n),(!ye||N[0]&4194304)&&i!==(i=(C[22]??"")+"")&&At(o,i),(!ye||N[0]&8388608)&&l!==(l=(C[23]??"")+"")&&At(a,l),(!ye||N[0]&16777216)&&c!==(c=(C[24]??"")+"")&&At(p,c),(!ye||N[0]&33554432)&&m!==(m=(C[25]??"")+"")&&At(k,m),C[14]?Ee?N[0]&16384&&H(Ee,1):(Ee=Ou(),Ee.c(),H(Ee,1),Ee.m(I.parentNode,I)):Ee&&(rt(),j(Ee,1,1,()=>{Ee=null}),it()),C[26]?_?N[0]&67108864&&H(_,1):(_=Iu(),_.c(),H(_,1),_.m(x,X)):_&&(rt(),j(_,1,1,()=>{_=null}),it()),C[27]?de?N[0]&134217728&&H(de,1):(de=Mu(),de.c(),H(de,1),de.m(x,K)):de&&(rt(),j(de,1,1,()=>{de=null}),it());let St=B;B=lt(C),B===St?Te[B].p(C,N):(rt(),j(Te[St],1,1,()=>{Te[St]=null}),it(),E=Te[B],E?E.p(C,N):(E=Te[B]=Ot[B](C),E.c()),H(E,1),E.m(x,W));const tt={};N[0]&8192&&(tt.width=C[13]),N[0]&8192&&(tt.height=C[13]),Z.$set(tt),(!ye||N[0]&8)&&q(U,"opacity-50",!C[3].length),(!ye||N[0]&8)&&q(U,"cursor-not-allowed",!C[3].length),(!ye||N[0]&8)&&q(U,"hover:text-primary",C[3].length);const Je={};N[0]&8192&&(Je.width=C[13]),N[0]&8192&&(Je.height=C[13]),z.$set(Je),(!ye||N[0]&32768)&&q(re,"opacity-50",!C[15].length),(!ye||N[0]&32768)&&q(re,"cursor-not-allowed",!C[15].length),(!ye||N[0]&32768)&&q(re,"hover:text-primary",C[15].length),C[5].length?Ce?(Ce.p(C,N),N[0]&32&&H(Ce,1)):(Ce=$u(C),Ce.c(),H(Ce,1),Ce.m(x,T)):Ce&&(rt(),j(Ce,1,1,()=>{Ce=null}),it());const Jt={};N[0]&8192&&(Jt.width=C[13]),N[0]&8192&&(Jt.height=C[13]),ce.$set(Jt),C[2]?De?(De.p(C,N),N[0]&4&&H(De,1)):(De=Hu(C),De.c(),H(De,1),De.m(x,Ye)):De&&(rt(),j(De,1,1,()=>{De=null}),it());const It={};N[0]&8192&&(It.width=C[13]),N[0]&8192&&(It.height=C[13]),Ze.$set(It);const Nt={};N[0]&8192&&(Nt.width=C[13]),N[0]&8192&&(Nt.height=C[13]),!yt&&N[0]&128&&(yt=!0,Nt.element=C[7],os(()=>yt=!1)),Ne.$set(Nt);const Qt={};N[0]&128&&(Qt.settingsElement=C[7]),N[0]&4&&(Qt.pipAvailable=C[2]),!ze&&N[0]&256&&(ze=!0,Qt.settingsOpen=C[8],os(()=>ze=!1)),!Fe&&N[0]&32&&(Fe=!0,Qt.selectedLineIds=C[5],os(()=>Fe=!1)),Re.$set(Qt),N[0]&1064|N[1]&8192&&(zt=C[3],rt(),Ve=Yr(Ve,N,Ht,1,C,zt,ot,he,Ns,Nu,null,Du),it()),(!ye||N[0]&262144)&&q(he,"py-16",!C[18]),(!ye||N[0]&262144)&&q(he,"py-8",C[18]),(!ye||N[0]&1048576)&&q(he,"opacity-50",C[20]),(!ye||N[0]&131072)&&q(he,"flex-col-reverse",C[17]),N[0]&268435456&&be(he,"font-size",`${C[28]}px`),N[0]&536870912&&be(he,"font-family",C[29]!==on.OFF?C[29]:void 0),N[0]&262144&&be(he,"writing-mode",C[18]?"vertical-rl":"horizontal-tb"),N[0]&2048&&ae.value!==C[11]&&wt(ae,C[11]),C[20]?Ge?N[0]&1048576&&H(Ge,1):(Ge=Ru(),Ge.c(),H(Ge,1),Ge.m(_t.parentNode,_t)):Ge&&(rt(),j(Ge,1,1,()=>{Ge=null}),it()),C[1]?xe?(xe.p(C,N),N[0]&2&&H(xe,1)):(xe=Vu(C),xe.c(),H(xe,1),xe.m(ke,null)):xe&&(rt(),j(xe,1,1,()=>{xe=null}),it()),(!ye||N[0]&131072)&&q(ke,"flex-col-reverse",C[17]),(!ye||N[0]&2)&&q(ke,"hidden",!C[1]),N[0]&268435456&&be(ke,"font-size",`${C[28]}px`),N[0]&536870912&&be(ke,"font-family",C[29]!==on.OFF?C[29]:void 0)},i(C){if(!ye){H(Ee),H(A.$$.fragment,C),H(D.$$.fragment,C),H(_),H(de),H(E),H(Z.$$.fragment,C),H(z.$$.fragment,C),H(Ce),H(ce.$$.fragment,C),H(De),H(Ze.$$.fragment,C),H(Ne.$$.fragment,C),H(Re.$$.fragment,C),H(Me.$$.fragment,C);for(let N=0;N<zt.length;N+=1)H(Ve[N]);H(Ge),H(xe),ye=!0}},o(C){j(Ee),j(A.$$.fragment,C),j(D.$$.fragment,C),j(_),j(de),j(E),j(Z.$$.fragment,C),j(z.$$.fragment,C),j(Ce),j(ce.$$.fragment,C),j(De),j(Ze.$$.fragment,C),j(Ne.$$.fragment,C),j(Re.$$.fragment,C),j(Me.$$.fragment,C);for(let N=0;N<Ve.length;N+=1)j(Ve[N]);j(Ge),j(xe),ye=!1},d(C){C&&V(t),C&&V(r),C&&V(o),C&&V(s),C&&V(a),C&&V(u),C&&V(p),C&&V(b),C&&V(k),C&&V(S),Ee&&Ee.d(C),C&&V(I),oe(A,C),C&&V($),C&&V(x),oe(D),_&&_.d(),de&&de.d(),Te[B].d(),oe(Z),oe(z),Ce&&Ce.d(),oe(ce),De&&De.d(),oe(Ze),oe(Ne),e[62](null),oe(Re),oe(Me),e[65](null),C&&V(bt),C&&V(he);for(let N=0;N<Ve.length;N+=1)Ve[N].d();e[69](null),C&&V(vt),C&&V(je),C&&V(Be),Ge&&Ge.d(C),C&&V(_t),C&&V(ke),xe&&xe.d(),e[72](null),kt=!1,Lt(Dt)}}}const A1=/[\p{scx=Hira}\p{scx=Kana}\p{scx=Han}]/imu;function T1(e,n,t){let r,i,o,s,l,a,u,c,p,b,m,k,S,I,A,$,x,D,J,X,K,B,E,W,U,Z,ve,re,z,M,T,ee,ce,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re;y(e,Ll,v=>t(78,s=v)),y(e,Hi,v=>t(80,a=v)),y(e,El,v=>t(14,u=v)),y(e,et,v=>t(3,c=v)),y(e,Ue,v=>t(81,p=v)),y(e,Dr,v=>t(82,b=v)),y(e,nr,v=>t(15,m=v)),y(e,$r,v=>t(83,k=v)),y(e,Fr,v=>t(84,S=v)),y(e,Ni,v=>t(85,I=v)),y(e,Fi,v=>t(86,A=v)),y(e,As,v=>t(16,$=v)),y(e,Or,v=>t(50,x=v)),y(e,Ps,v=>t(87,D=v)),y(e,jr,v=>t(17,J=v)),y(e,Wr,v=>t(18,X=v)),y(e,Ka,v=>t(88,K=v)),y(e,Ya,v=>t(89,B=v)),y(e,Xt,v=>t(19,E=v)),y(e,Rl,v=>t(90,W=v)),y(e,Nl,v=>t(20,U=v)),y(e,Xi,v=>t(51,Z=v)),y(e,Hr,v=>t(52,ve=v)),y(e,ln,v=>t(53,re=v)),y(e,Ri,v=>t(91,z=v)),y(e,$i,v=>t(92,M=v)),y(e,Mi,v=>t(93,T=v)),y(e,Ii,v=>t(94,ee=v)),y(e,Oi,v=>t(95,ce=v)),y(e,Mn,v=>t(26,Ne=v)),y(e,$n,v=>t(27,yt=v)),y(e,Ir,v=>t(28,gt=v)),y(e,Si,v=>t(29,Re=v));let ze=!1,Fe,we=[],Me,bt,he=!1,ft,We=[],Ve=!1,ot=!1,vt=null,je,ae,Be;Te();const _t="wakeLock"in navigator,ke=Fr.pipe(Zl(v=>v?new Set(c.map(Q=>Q.text)):new Set));y(e,ke,v=>t(79,l=v));const ye=Nr.pipe(Jl(([v,Q,ne])=>{const pe=Q===nn.RESETCHECKBOXES,ge=Q===nn.PASTE,pt=!ge||!U&&!W&&!he&&!Ve,dn=ot&&Q===nn.EXTERNAL;return dn&&(ot=!1),pe?(lt(),!1):(!E||(ce||T)&&ge||(ee||M)&&!ge)&&pt&&!dn?(E&&(T&&ge||M&&!ge)&&R(Xt,E=!1,E),!0):(!dn&&pt&&z&&C(),!1)}),tr(v=>{const[Q]=v,ne=v.at(1)||nn.SOCKET,pe=N(Q,ne!==nn.TL),ge=v.at(2)||tp();ne!==nn.TL&&R(Ll,s=[...s,ge],s),pe&&R(et,c=Jt([...tt(1),{id:ge,text:pe}]),c)}),rr());y(e,ye,v=>t(22,Ye=v));const kt=Ti.pipe(vo(v=>v?or(document,"paste"):bo),tr(v=>Nr.next([v.clipboardData.getData("text/plain"),nn.PASTE,""])),rr());y(e,kt,v=>t(23,Se=v));const Dt=or(document,"visibilitychange").pipe(tr(()=>{_t&&vt!==null&&document.visibilityState==="visible"&&(vt=navigator.wakeLock.request("screen").then(v=>v).catch(v=>(console.error(`Unable to aquire screen lock: ${v.message}`),null)))}),rr());y(e,Dt,v=>t(21,Ae=v));const Ee=Di.pipe(vo(v=>(ot=!1,v?or(document,"copy"):bo)),tr(()=>ot=!0),rr());y(e,Ee,v=>t(24,Ze=v));const _=or(window,"resize").pipe(Us(500),tr(de),rr());y(e,_,v=>t(25,Ke=v)),Yl(()=>{de(),_t&&(vt=navigator.wakeLock.request("screen").then(v=>v).catch(v=>(console.error(`Unable to aquire screen lock: ${v.message}`),null)))});function de(){t(49,ze=window.matchMedia("(min-width: 640px)").matches),xe()}function Ot(v){var ne,pe;if(U||W||he||Ve)return;const Q=(ne=v.key||"")==null?void 0:ne.toLowerCase();if(Q==="delete"){if((pe=window.getSelection())!=null&&pe.toString().trim()){const ge=window.getSelection().getRangeAt(0);for(let pt=0,{length:dn}=We;pt<dn;pt+=1){const Gt=We[pt],fr=Gt==null?void 0:Gt.getIdIfSelected(ge);fr&&we.push(fr)}}we.length?st():v.altKey&&De()}else we.length&&Q==="escape"?hn():v.altKey&&Q==="a"?Fe.handleReset(!1):v.altKey&&Q==="q"?Fe.handleReset(!0):(v.ctrlKey||v.metaKey)&&Q===" "&&R(Xt,E=!E,E)}function Te(){setInterval(async()=>{try{const v=await fetch(Co("/get_ids"));if(!v.ok)throw new Error(`HTTP error! Status: ${v.status}`);R(Ll,s=await v.json(),s)}catch(v){console.error("Failed to fetch ids:",v)}},1e3)}function lt(){c.forEach(v=>{const Q=document.getElementById(`multi-line-checkbox-${v.id}`);Q&&typeof Q.checked=="boolean"?Q.checked=!1:console.warn(`Checkbox with ID 'multi-line-checkbox-${v.id}' not found or is not a valid checkbox element.`)})}async function Ce(){if(!m.length)return;const v=m.pop();let Q=v.pop();for(;Q;){const ne=N(Q.text,!1);if(ne){const{id:pe,index:ge}=Q;ge>c.length-1?c.push({id:pe,text:ne}):c[ge].id===pe?R(et,c[ge]={id:pe,text:ne},c):c.splice(ge,0,{id:pe,text:ne})}Q=v.pop()}await go(),R(et,c=Jt(tt()),c),nr.set(m)}function De(){if(!c.length)return;const[v]=c.splice(c.length-1,1);t(5,we=we.filter(Q=>Q!==v.id)),et.set(c),R(nr,m=[...m,[{...v,index:c.length}]],m),l.delete(v.text)}function st(){const v=new Set(we),Q=[];R(et,c=c.filter((ne,pe)=>{const ge=v.has(ne.id);return v.delete(ne.id),ge&&(Q.push({...ne,index:pe-Q.length}),l.delete(ne.text)),!ge}),c),t(5,we=v.size?[...v]:[]),Q.length&&R(nr,m=[...m,Q],m)}function hn(){var v;for(let Q=0,{length:ne}=We;Q<ne;Q+=1)(v=We[Q])==null||v.deselect();t(5,we=[])}async function pn(){if(ae)return ae.close();t(1,ae=await window.documentPictureInPicture.requestWindow(B>0&&K>0?{height:B,width:K,preferInitialWindowPlacement:!1}:{preferInitialWindowPlacement:!1}).catch(({message:v})=>{R(Ue,p={message:`Error opening floating window: ${v}`,showCancel:!1},p)})),ae&&(ae.document.body.appendChild(je),ae.addEventListener("pagehide",jn,{once:!0}),ae.addEventListener("resize",ht,!1),ae.addEventListener("blur",Ht,!1),ae.addEventListener("focus",Ht,!1),[...document.styleSheets].forEach(v=>{if(!(v.ownerNode instanceof Element&&v.ownerNode.id==="user-css"))try{const Q=[...v.cssRules].map(pe=>pe.cssText).join(""),ne=document.createElement("style");ne.textContent=Q,ae.document.head.appendChild(ne)}catch{const ne=document.createElement("link");ne.rel="stylesheet",ne.type=v.type,ne.media=v.media.toString(),ne.href=v.href,ae.document.head.appendChild(ne)}}))}function jn(){zt(),ae.removeEventListener("resize",ht,!1),ae.removeEventListener("blur",Ht,!1),ae.removeEventListener("focus",Ht,!1),t(1,ae=void 0)}function ht(){window.clearTimeout(Be),Be=window.setTimeout(zt,500)}function zt(){ae&&(R(Ya,B=ae.document.body.clientHeight,B),R(Ka,K=ae.document.body.clientWidth,K))}function Ht(v){v.type}function Ge({detail:v}){Ga(document,v),ae&&Ga(ae.document,v)}function xe(){So(window,ft,J,X),ae&&So(ae,je,J,!1)}function C(){clearTimeout(D),x===rn.GARDEN&&(Me.classList.add("bg-base-200"),Me.classList.remove("bg-base-100"),document.body.classList.add("bg-base-200")),document.body.classList.add("animate-[pulse_0.5s_cubic-bezier(0.4,0,0.6,1)_1]"),R(Ps,D=window.setTimeout(()=>{x===rn.GARDEN&&(Me.classList.add("bg-base-100"),Me.classList.remove("bg-base-200"),document.body.classList.remove("bg-base-200")),document.body.classList.remove("animate-[pulse_0.5s_cubic-bezier(0.4,0,0.6,1)_1]")},500),D)}function N(v,Q=!0){const ne=Q?xc(v,$):v;let pe=!0,ge=A?ne.replace(/\s/gm,"").trim():ne;return I&&!ge.match(A1)&&(ge=""),ge?S?(pe=!l.has(ge),l.add(ge)):k&&c.length&&(pe=c.slice(-k).every(pt=>pt.text!==ge)):pe=!1,pe?ge:void 0}function St(v){const{inEdit:Q,data:ne}=v.detail;if(ne&&ne.originalText!==ne.newText){const pe=N(ne.newText);R(et,c[ne.lineIndex]={id:ne.line.id,text:pe},c),pe?(R(nr,m=[...m,[{...ne.line,index:ne.lineIndex}]],m),l.delete(ne.originalText),l.add(pe)):go().then(()=>R(et,c[ne.lineIndex]={id:ne.line.id,text:ne.originalText},c))}Ve=Q}function tt(v=0){const Q=new Set,ne=b?c.length-b+v:0,pe=ne>0?c.filter((ge,pt)=>pt<ne?(Q.add(ge.id),l.delete(ge.text),!1):!0):c;return Q.size&&t(5,we=we.filter(ge=>!Q.has(ge))),pe}function Je(v){if(v){R(El,u=!0,u);try{for(let Q=0,{length:ne}=c;Q<ne;Q+=1){const pe=c[Q],ge=N(pe.text);ge&&ge!==pe.text&&(l.delete(pe.text),R(et,c[Q]={...pe,text:ge},c))}R(Ue,p={message:"Operation executed",showCancel:!1},p)}catch({message:Q}){R(Ue,p={type:"error",message:`An Error occured: ${Q}`,showCancel:!1},p)}R(et,c=Jt(tt()),c),R(El,u=!1,u)}}function Jt(v){if(!a||v.length<2)return v;const Q=v.length-1,ne=Q-1,pe=v[Q],ge=v[ne].text;return pe.text.startsWith(ge)&&(l.delete(ge),t(5,we=we.filter(pt=>pt!==v[ne].id)),v.splice(ne,2,pe)),v}let It="";async function Nt(){if(It.trim())try{let v=s;Number(It)<v.length&&(v=v.slice(-Number(It)));const Q=await fetch(Co("/translate-multiple"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:v})});if(Q.ok){const ne=await Q.text();Nr.next([ne,nn.TL,""])}}catch(v){console.error("Translation failed:",v)}}const Qt=()=>R(Xt,E=!1,E),Yt=()=>R(Xt,E=!0,E),Gr=()=>R(Nl,U=!0,U),Bn=()=>window.open("/stats","_blank");function qr(v){bt=v,t(7,bt)}const Kt=()=>t(8,he=!he);function Un(v){he=v,t(8,he)}function Ln(v){we=v,t(5,we)}function zn(v){mt[v?"unshift":"push"](()=>{Fe=v,t(4,Fe)})}const Xr=()=>Je(!!$.length),Rt=()=>R(et,c=tt(),c);function Zr(v){mt[v?"unshift":"push"](()=>{Me=v,t(6,Me)})}function Yn(v,Q){mt[v?"unshift":"push"](()=>{We[Q]=v,t(10,We)})}const Jr=({detail:v})=>{t(5,we=[...we,v])},an=({detail:v})=>{t(5,we=we.filter(Q=>Q!==v))};function Qr(v){mt[v?"unshift":"push"](()=>{ft=v,t(9,ft)})}function Kn(){It=this.value,t(11,It)}const ei=v=>v.key==="Enter"&&Nt();function un(v){mt[v?"unshift":"push"](()=>{je=v,t(0,je)})}return e.$$.update=()=>{e.$$.dirty[1]&262144&&t(13,r=ze?"1.5rem":"1.25rem"),e.$$.dirty[1]&4194304&&R(As,$=re.filter(v=>v.enabled),$),e.$$.dirty[0]&1&&t(2,i="documentPictureInPicture"in window&&!!je),e.$$.dirty[0]&12|e.$$.dirty[1]&2097152&&t(12,o=i&&c?c.slice(-ve):[]),e.$$.dirty[0]&2|e.$$.dirty[1]&1572864&&ae&&(t(1,ae.document.body.dataset.theme=x,ae),Pc(ae.document,Z))},[je,ae,i,c,Fe,we,Me,bt,he,ft,We,It,o,r,u,m,$,J,X,E,U,Ae,Ye,Se,Ze,Ke,Ne,yt,gt,Re,ke,ye,kt,Dt,Ee,_,Ot,Ce,De,st,hn,pn,Ge,xe,St,tt,Je,Nt,Te,ze,x,Z,ve,re,Qt,Yt,Gr,Bn,qr,Kt,Un,Ln,zn,Xr,Rt,Zr,Yn,Jr,an,Qr,Kn,ei,un]}class D1 extends Ut{constructor(n){super(),Bt(this,n,T1,P1,Et,{startIdPolling:48},null,[-1,-1,-1,-1])}get startIdPolling(){return this.$$.ctx[48]}}new D1({target:document.body});
38
+ <li class="my-0.5 hover:text-primary"><a href="https://github.com/laplus-sadness/lap-clipboard-inserter" target="_blank" rel="noreferrer">lap-clipboard-inserter</a></li></ul>`,ae=k(),le(Be.$$.fragment),et=k(),le(ke.$$.fragment),Se=k(),Lt=g("span"),Lt.textContent="Window Title",Ht=k(),ye=g("input"),_=k(),ce=g("span"),ce.textContent="Primary Websocket",tt=k(),Pe=g("input"),bt=k(),Ae=g("span"),Ae.textContent="Font Size",Ue=k(),wt=g("input"),hn=k(),pn=g("span"),pn.textContent="Character Milestone",Wn=k(),vt=g("input"),Yt=k(),Ot=g("span"),Ot.textContent="Online Font",Ge=k(),Le=g("select");for(let $=0;$<C.length;$+=1)C[$].c();kt=k(),Et=g("span"),Et.textContent="Prevent Last Line Duplicate",ln=k(),ct=g("input"),It=k(),Nt=g("span"),Nt.textContent="Max lines",Zt=k(),Kt=g("input"),Yr=k(),Ft&&Ft.c(),Ln=k(),dn=g("span"),dn.textContent="AFK Timer (s)",Kr=k(),Rt=g("input"),Gr=k(),jn=g("span"),jn.textContent="Adjust Timer after AFK",qr=k(),sn=g("input"),Xr=k(),Bn=g("span"),Bn.textContent="Enable external Clipboard Monitor",Zr=k(),an=g("input"),Jr=k(),Un=g("span"),Un.textContent="Show Preset Quick Switch",Qr=k(),un=g("input"),v=k(),Q=g("span"),Q.textContent="Skip Reset Confirmations",ne=k(),de=g("input"),ge=k(),ft=g("span"),ft.textContent="Store Stats persistently",mn=k(),Vt=g("input"),ar=k(),ei=g("span"),ei.textContent="Store Notes persistently",Po=k(),gn=g("input"),Ao=k(),ti=g("span"),ti.textContent="Store Lines persistently",To=k(),bn=g("input"),Do=k(),ni=g("span"),ni.textContent="Store Action History persistently",Oo=k(),vn=g("input"),Io=k(),ri=g("span"),ri.textContent="Enable Paste",Mo=k(),En=g("input"),$o=k(),ii=g("span"),ii.textContent="Block Copy from Page",Ho=k(),xn=g("input"),No=k(),oi=g("span"),oi.textContent="Allow Paste during Pause",Ro=k(),Pn=g("input"),Vo=k(),li=g("span"),li.textContent="Allow new Line during Pause",Fo=k(),An=g("input"),Wo=k(),si=g("span"),si.textContent="Autostart Timer by Paste during Pause",jo=k(),Tn=g("input"),Bo=k(),ai=g("span"),ai.textContent="Autostart Timer by Line during Pause",Uo=k(),Dn=g("input"),zo=k(),ui=g("span"),ui.textContent="Prevent Global Duplicate",Yo=k(),m=g("input"),X=k(),oe=g("span"),oe.textContent="Merge equal Line Starts",$e=k(),nt=g("input"),ht=k(),Mt=g("span"),Mt.textContent="Filter lines without jp content",ur=k(),cr=g("input"),Ys=k(),Ko=g("span"),Ko.textContent="Flash on missed Line",Ks=k(),fr=g("input"),Gs=k(),Go=g("span"),Go.textContent="Display Text vertically",qs=k(),zn=g("input"),Xs=k(),qo=g("span"),qo.textContent="Reverse Line Order",Zs=k(),Yn=g("input"),Js=k(),Xo=g("span"),Xo.textContent="Preserve Whitespace",Qs=k(),hr=g("input"),ea=k(),Zo=g("span"),Zo.textContent="Remove all Whitespace",ta=k(),Kn=g("input"),na=k(),Jo=g("span"),Jo.textContent="Show Timer",ra=k(),pr=g("input"),ia=k(),Qo=g("span"),Qo.textContent="Show Speed",oa=k(),dr=g("input"),la=k(),el=g("span"),el.textContent="Show Character Count",sa=k(),mr=g("input"),aa=k(),tl=g("span"),tl.textContent="Show Line Count",ua=k(),gr=g("input"),ca=k(),nl=g("span"),nl.textContent="Blur Stats",fa=k(),br=g("input"),ha=k(),rl=g("span"),rl.textContent="Enable Line Animation",pa=k(),vr=g("input"),da=k(),il=g("span"),il.textContent="Enable AFK Blur",ma=k(),_r=g("input"),ga=k(),ol=g("span"),ol.textContent="Restart Timer after AFK Blur",ba=k(),wr=g("input"),va=k(),ll=g("span"),ll.textContent="Continuous Reconnect",_a=k(),Gn=g("input"),wa=k(),sl=g("span"),sl.textContent="Show Connection Errors",ka=k(),kr=g("input"),ya=k(),al=g("span"),al.textContent="Auto Translate Lines:",Sa=k(),yr=g("input"),Ca=k(),ul=g("span"),ul.textContent="Blur Auto Translated Lines:",La=k(),Sr=g("input"),Ea=k(),Zi=g("span"),Zi.textContent="Custom CSS",xa=k(),qn=g("textarea"),h(n,"class","hidden"),h(n,"type","file"),h(r,"class","hidden"),h(r,"type","file"),h(o,"class","hidden"),h(o,"type","file"),h(d,"class","label-text"),h(c,"role","button"),h(c,"class","flex flex-col items-center hover:text-primary"),h(I,"class","label-text"),h(S,"role","button"),h(S,"class","flex flex-col items-center hover:text-primary"),h(q,"class","label-text"),h(H,"role","button"),h(H,"class","flex flex-col items-center hover:text-primary"),h(Z,"class","label-text"),h(x,"role","button"),h(x,"class","flex flex-col items-center hover:text-primary"),h(A,"class","label-text"),h(se,"role","button"),h(se,"class","flex flex-col items-center hover:text-primary"),h(Ie,"class","label-text"),h(he,"role","button"),h(he,"class","flex flex-col items-center hover:text-primary"),h(dt,"class","label-text"),h(Ke,"role","button"),h(Ke,"class","flex flex-col items-center hover:text-primary"),h(we,"type","checkbox"),we.checked=Me=e[6]===tn.BUSINESS,h(Fe,"class","swap swap-rotate"),h(ot,"class","label-text"),h(Ye,"role","button"),h(Ye,"class","flex flex-col items-center hover:text-primary"),h(a,"class","flex text-sm gap-x-5 min-[600px]:justify-between max-[600px]:flex-wrap max-[600px]:gap-y-5"),h(u,"class","mb-2"),be(u,"grid-column","1/5"),h(je,"role","button"),h(je,"class","col-span-4 mb-2"),h(Lt,"class","label-text col-span-2"),h(ye,"class","input input-bordered h-8 col-span-2"),h(ce,"class","label-text col-span-2"),h(Pe,"class","input input-bordered h-8 col-span-2"),h(Ae,"class","label-text col-span-2"),h(wt,"type","number"),h(wt,"class","input input-bordered h-8 col-span-2"),h(wt,"min","1"),h(pn,"class","label-text col-span-2"),h(vt,"type","number"),h(vt,"class","input input-bordered h-8 col-span-2"),h(vt,"min","0"),vt.value=e[18],h(Ot,"class","label-text mr-4 col-span-2"),h(Le,"class","select col-span-2"),e[21]===void 0&&$r(()=>e[90].call(Le)),h(Et,"class","label-text col-span-2"),h(ct,"type","number"),h(ct,"class","input input-bordered h-8 col-span-2"),h(ct,"min","0"),ct.value=e[17],h(Nt,"class","label-text col-span-2"),h(Kt,"type","number"),h(Kt,"class","input input-bordered h-8 mb-2 col-span-2"),h(Kt,"min","0"),Kt.value=e[15],h(dn,"class","label-text col-span-2"),h(Rt,"type","number"),h(Rt,"class","input input-bordered h-8 mb-2 col-span-2"),h(Rt,"min","0"),h(jn,"class","label-text"),h(sn,"type","checkbox"),h(sn,"class","checkbox checkbox-primary ml-2"),h(Bn,"class","label-text"),h(an,"type","checkbox"),h(an,"class","checkbox checkbox-primary ml-2"),h(Un,"class","label-text"),h(un,"type","checkbox"),h(un,"class","checkbox checkbox-primary ml-2"),h(Q,"class","label-text"),h(de,"type","checkbox"),h(de,"class","checkbox checkbox-primary ml-2"),h(ft,"class","label-text"),h(Vt,"type","checkbox"),h(Vt,"class","checkbox checkbox-primary ml-2"),h(ei,"class","label-text"),h(gn,"type","checkbox"),h(gn,"class","checkbox checkbox-primary ml-2"),h(ti,"class","label-text"),h(bn,"type","checkbox"),h(bn,"class","checkbox checkbox-primary ml-2"),h(ni,"class","label-text"),h(vn,"type","checkbox"),h(vn,"class","checkbox checkbox-primary ml-2"),h(ri,"class","label-text"),h(En,"type","checkbox"),h(En,"class","checkbox checkbox-primary ml-2"),h(ii,"class","label-text"),h(xn,"type","checkbox"),h(xn,"class","checkbox checkbox-primary ml-2"),h(oi,"class","label-text"),h(Pn,"type","checkbox"),h(Pn,"class","checkbox checkbox-primary ml-2"),h(li,"class","label-text"),h(An,"type","checkbox"),h(An,"class","checkbox checkbox-primary ml-2"),h(si,"class","label-text"),h(Tn,"type","checkbox"),h(Tn,"class","checkbox checkbox-primary ml-2"),h(ai,"class","label-text"),h(Dn,"type","checkbox"),h(Dn,"class","checkbox checkbox-primary ml-2"),h(ui,"class","label-text"),h(m,"type","checkbox"),h(m,"class","checkbox checkbox-primary ml-2"),h(oe,"class","label-text"),h(nt,"type","checkbox"),h(nt,"class","checkbox checkbox-primary ml-2"),h(Mt,"class","label-text"),h(cr,"type","checkbox"),h(cr,"class","checkbox checkbox-primary ml-2"),h(Ko,"class","label-text"),h(fr,"type","checkbox"),h(fr,"class","checkbox checkbox-primary ml-2"),h(Go,"class","label-text"),h(zn,"type","checkbox"),h(zn,"class","checkbox checkbox-primary ml-2"),h(qo,"class","label-text"),h(Yn,"type","checkbox"),h(Yn,"class","checkbox checkbox-primary ml-2"),h(Xo,"class","label-text"),h(hr,"type","checkbox"),h(hr,"class","checkbox checkbox-primary ml-2"),h(Zo,"class","label-text"),h(Kn,"type","checkbox"),h(Kn,"class","checkbox checkbox-primary ml-2"),h(Jo,"class","label-text"),h(pr,"type","checkbox"),h(pr,"class","checkbox checkbox-primary ml-2"),h(Qo,"class","label-text"),h(dr,"type","checkbox"),h(dr,"class","checkbox checkbox-primary ml-2"),h(el,"class","label-text"),h(mr,"type","checkbox"),h(mr,"class","checkbox checkbox-primary ml-2"),h(tl,"class","label-text"),h(gr,"type","checkbox"),h(gr,"class","checkbox checkbox-primary ml-2"),h(nl,"class","label-text"),h(br,"type","checkbox"),h(br,"class","checkbox checkbox-primary ml-2"),h(rl,"class","label-text"),h(vr,"type","checkbox"),h(vr,"class","checkbox checkbox-primary ml-2"),h(il,"class","label-text"),h(_r,"type","checkbox"),h(_r,"class","checkbox checkbox-primary ml-2"),h(ol,"class","label-text"),h(wr,"type","checkbox"),h(wr,"class","checkbox checkbox-primary ml-2"),h(ll,"class","label-text"),h(Gn,"type","checkbox"),h(Gn,"class","checkbox checkbox-primary ml-2"),h(sl,"class","label-text"),h(kr,"type","checkbox"),h(kr,"class","checkbox checkbox-primary ml-2"),h(al,"class","label-text"),h(yr,"type","checkbox"),h(yr,"class","checkbox checkbox-primary ml-2"),h(ul,"class","label-text"),h(Sr,"type","checkbox"),h(Sr,"class","checkbox checkbox-primary ml-2"),h(Zi,"class","label-text"),be(Zi,"grid-column","1/5"),h(qn,"class","p-1 min-h-[10rem] font-mono"),be(qn,"grid-column","1/5"),h(qn,"rows","5"),qn.value=e[3],h(l,"class","flex flex-col max-[800px]:w-[90vw] min-[800px]:grid grid-cols-[max-content,auto,max-content,auto] gap-3 absolute overflow-auto h-[90vh] top-11 z-10 py-4 pr-8 pl-4 border bg-base-200 overscroll-contain")},m($,te){F($,n,te),e[74](n),F($,t,te),F($,r,te),e[75](r),F($,i,te),F($,o,te),e[76](o),F($,s,te),F($,l,te),f(l,u),f(u,a),f(a,c),re(p,c,null),f(c,b),f(c,d),f(a,y),f(a,S),re(D,S,null),f(S,T),f(S,I),f(a,L),f(a,H),re(J,H,null),f(H,Y),f(H,q),f(a,B),f(a,x),re(j,x,null),f(x,U),f(x,Z),f(a,ve),f(a,se),re(z,se,null),f(se,O),f(se,A),f(a,ee),f(a,he),re(xe,he,null),f(he,Xe),f(he,Ie),f(a,Te),f(a,Ke),re(Ne,Ke,null),f(Ke,_t),f(Ke,dt),f(a,Re),f(a,Ye),f(Ye,Fe),f(Fe,we),f(Fe,mt),re(pe,Fe,null),f(Fe,ut),re(We,Fe,null),f(Ye,Ve),f(Ye,ot),f(l,gt),f(l,je),f(l,ae),re(Be,l,null),f(l,et),re(ke,l,null),f(l,Se),f(l,Lt),f(l,Ht),f(l,ye),At(ye,e[19]),f(l,_),f(l,ce),f(l,tt),f(l,Pe),At(Pe,e[11]),f(l,bt),f(l,Ae),f(l,Ue),f(l,wt),At(wt,e[20]),f(l,hn),f(l,pn),f(l,Wn),f(l,vt),f(l,Yt),f(l,Ot),f(l,Ge),f(l,Le);for(let Xn=0;Xn<C.length;Xn+=1)C[Xn].m(Le,null);_i(Le,e[21]),f(l,kt),f(l,Et),f(l,ln),f(l,ct),f(l,It),f(l,Nt),f(l,Zt),f(l,Kt),f(l,Yr),Ft&&Ft.m(l,null),f(l,Ln),f(l,dn),f(l,Kr),f(l,Rt),At(Rt,e[22]),f(l,Gr),f(l,jn),f(l,qr),f(l,sn),sn.checked=e[23],f(l,Xr),f(l,Bn),f(l,Zr),f(l,an),an.checked=e[5],f(l,Jr),f(l,Un),f(l,Qr),f(l,un),un.checked=e[24],f(l,v),f(l,Q),f(l,ne),f(l,de),de.checked=e[12],f(l,ge),f(l,ft),f(l,mn),f(l,Vt),Vt.checked=e[25],f(l,ar),f(l,ei),f(l,Po),f(l,gn),gn.checked=e[26],f(l,Ao),f(l,ti),f(l,To),f(l,bn),bn.checked=e[27],f(l,Do),f(l,ni),f(l,Oo),f(l,vn),vn.checked=e[28],f(l,Io),f(l,ri),f(l,Mo),f(l,En),En.checked=e[29],f(l,$o),f(l,ii),f(l,Ho),f(l,xn),xn.checked=e[30],f(l,No),f(l,oi),f(l,Ro),f(l,Pn),Pn.checked=e[31],f(l,Vo),f(l,li),f(l,Fo),f(l,An),An.checked=e[32],f(l,Wo),f(l,si),f(l,jo),f(l,Tn),Tn.checked=e[33],f(l,Bo),f(l,ai),f(l,Uo),f(l,Dn),Dn.checked=e[34],f(l,zo),f(l,ui),f(l,Yo),f(l,m),m.checked=e[14],f(l,X),f(l,oe),f(l,$e),f(l,nt),nt.checked=e[35],f(l,ht),f(l,Mt),f(l,ur),f(l,cr),cr.checked=e[36],f(l,Ys),f(l,Ko),f(l,Ks),f(l,fr),fr.checked=e[37],f(l,Gs),f(l,Go),f(l,qs),f(l,zn),zn.checked=e[38],f(l,Xs),f(l,qo),f(l,Zs),f(l,Yn),Yn.checked=e[39],f(l,Js),f(l,Xo),f(l,Qs),f(l,hr),hr.checked=e[40],f(l,ea),f(l,Zo),f(l,ta),f(l,Kn),Kn.checked=e[13],f(l,na),f(l,Jo),f(l,ra),f(l,pr),pr.checked=e[41],f(l,ia),f(l,Qo),f(l,oa),f(l,dr),dr.checked=e[42],f(l,la),f(l,el),f(l,sa),f(l,mr),mr.checked=e[43],f(l,aa),f(l,tl),f(l,ua),f(l,gr),gr.checked=e[44],f(l,ca),f(l,nl),f(l,fa),f(l,br),br.checked=e[45],f(l,ha),f(l,rl),f(l,pa),f(l,vr),vr.checked=e[46],f(l,da),f(l,il),f(l,ma),f(l,_r),_r.checked=e[47],f(l,ga),f(l,ol),f(l,ba),f(l,wr),wr.checked=e[48],f(l,va),f(l,ll),f(l,_a),f(l,Gn),Gn.checked=e[49],f(l,wa),f(l,sl),f(l,ka),f(l,kr),kr.checked=e[50],f(l,ya),f(l,al),f(l,Sa),f(l,yr),yr.checked=e[51],f(l,Ca),f(l,ul),f(l,La),f(l,Sr),Sr.checked=e[52],f(l,Ea),f(l,Zi),f(l,xa),f(l,qn),On=!0,es||(Pa=[P(n,"change",e[61]),P(r,"change",e[62]),P(o,"change",e[63]),P(c,"click",e[56]),P(c,"keyup",Bt),P(S,"click",e[57]),P(S,"keyup",Bt),P(H,"click",e[77]),P(H,"keyup",Bt),P(x,"click",e[78]),P(x,"keyup",Bt),P(se,"click",Gh),P(se,"keyup",Bt),P(he,"click",e[58]),P(he,"keyup",Bt),P(Ke,"click",e[59]),P(Ke,"keyup",Bt),P(we,"change",e[79]),P(Ye,"click",e[80]),P(Ye,"keyup",Bt),P(ye,"input",e[85]),P(Pe,"input",e[86]),P(Pe,"change",e[87]),P(wt,"input",e[88]),P(wt,"blur",e[89]),P(vt,"blur",e[65]),P(Le,"change",e[90]),P(ct,"blur",e[66]),P(Kt,"blur",e[67]),P(Rt,"input",e[91]),P(Rt,"blur",e[92]),P(sn,"change",e[93]),P(an,"change",e[94]),P(un,"change",e[95]),P(de,"change",e[96]),P(Vt,"change",e[97]),P(Vt,"change",e[98]),P(gn,"change",e[99]),P(gn,"change",e[100]),P(bn,"change",e[101]),P(bn,"change",e[102]),P(vn,"change",e[103]),P(vn,"change",e[104]),P(En,"change",e[105]),P(xn,"change",e[106]),P(Pn,"change",e[107]),P(An,"change",e[108]),P(Tn,"change",e[109]),P(Dn,"change",e[110]),P(m,"change",e[111]),P(m,"change",e[69]),P(nt,"change",e[112]),P(cr,"change",e[113]),P(fr,"change",e[114]),P(zn,"change",e[115]),P(zn,"change",e[116]),P(Yn,"change",e[117]),P(Yn,"change",e[118]),P(hr,"change",e[119]),P(Kn,"change",e[120]),P(Kn,"change",e[70]),P(pr,"change",e[121]),P(dr,"change",e[122]),P(mr,"change",e[123]),P(gr,"change",e[124]),P(br,"change",e[125]),P(vr,"change",e[126]),P(_r,"change",e[127]),P(wr,"change",e[128]),P(Gn,"change",e[129]),P(Gn,"change",e[130]),P(kr,"change",e[131]),P(yr,"change",e[132]),P(Sr,"change",e[133]),P(qn,"blur",e[71]),Zc(bp.call(null,l,e[55]))],es=!0)},p($,te){(!On||te[0]&64&&Me!==(Me=$[6]===tn.BUSINESS))&&(we.checked=Me);const Xn={};Be.$set(Xn),te[0]&524288&&ye.value!==$[19]&&At(ye,$[19]),te[0]&2048&&Pe.value!==$[11]&&At(Pe,$[11]),te[0]&1048576&&Pl(wt.value)!==$[20]&&At(wt,$[20]),(!On||te[0]&262144&&vt.value!==$[18])&&(vt.value=$[18]),te[1]&8388608&&(cl=$[54],C=Ur(C,te,Aa,1,$,cl,M,Le,Bl,Cu,null,yu)),te[0]&2097152|te[1]&8388608&&_i(Le,$[21]),(!On||te[0]&131072&&ct.value!==$[17])&&(ct.value=$[17]),(!On||te[0]&32768&&Kt.value!==$[15])&&(Kt.value=$[15]),$[1]?Ft?Ft.p($,te):(Ft=Lu($),Ft.c(),Ft.m(l,Ln)):Ft&&(Ft.d(1),Ft=null),te[0]&4194304&&Pl(Rt.value)!==$[22]&&At(Rt,$[22]),te[0]&8388608&&(sn.checked=$[23]),te[0]&32&&(an.checked=$[5]),te[0]&16777216&&(un.checked=$[24]),te[0]&4096&&(de.checked=$[12]),te[0]&33554432&&(Vt.checked=$[25]),te[0]&67108864&&(gn.checked=$[26]),te[0]&134217728&&(bn.checked=$[27]),te[0]&268435456&&(vn.checked=$[28]),te[0]&536870912&&(En.checked=$[29]),te[0]&1073741824&&(xn.checked=$[30]),te[1]&1&&(Pn.checked=$[31]),te[1]&2&&(An.checked=$[32]),te[1]&4&&(Tn.checked=$[33]),te[1]&8&&(Dn.checked=$[34]),te[0]&16384&&(m.checked=$[14]),te[1]&16&&(nt.checked=$[35]),te[1]&32&&(cr.checked=$[36]),te[1]&64&&(fr.checked=$[37]),te[1]&128&&(zn.checked=$[38]),te[1]&256&&(Yn.checked=$[39]),te[1]&512&&(hr.checked=$[40]),te[0]&8192&&(Kn.checked=$[13]),te[1]&1024&&(pr.checked=$[41]),te[1]&2048&&(dr.checked=$[42]),te[1]&4096&&(mr.checked=$[43]),te[1]&8192&&(gr.checked=$[44]),te[1]&16384&&(br.checked=$[45]),te[1]&32768&&(vr.checked=$[46]),te[1]&65536&&(_r.checked=$[47]),te[1]&131072&&(wr.checked=$[48]),te[1]&262144&&(Gn.checked=$[49]),te[1]&524288&&(kr.checked=$[50]),te[1]&1048576&&(yr.checked=$[51]),te[1]&2097152&&(Sr.checked=$[52]),(!On||te[0]&8)&&(qn.value=$[3])},i($){On||(N(p.$$.fragment,$),N(D.$$.fragment,$),N(J.$$.fragment,$),N(j.$$.fragment,$),N(z.$$.fragment,$),N(xe.$$.fragment,$),N(Ne.$$.fragment,$),N(pe.$$.fragment,$),N(We.$$.fragment,$),N(Be.$$.fragment,$),N(ke.$$.fragment,$),On=!0)},o($){W(p.$$.fragment,$),W(D.$$.fragment,$),W(J.$$.fragment,$),W(j.$$.fragment,$),W(z.$$.fragment,$),W(xe.$$.fragment,$),W(Ne.$$.fragment,$),W(pe.$$.fragment,$),W(We.$$.fragment,$),W(Be.$$.fragment,$),W(ke.$$.fragment,$),On=!1},d($){$&&V(n),e[74](null),$&&V(t),$&&V(r),e[75](null),$&&V(i),$&&V(o),e[76](null),$&&V(s),$&&V(l),ie(p),ie(D),ie(J),ie(j),ie(z),ie(xe),ie(Ne),ie(pe),ie(We),e[81](null),ie(Be),ie(ke);for(let te=0;te<C.length;te+=1)C[te].d();Ft&&Ft.d(),es=!1,St(Pa)}}}function Cu(e,n){let t,r=n[155]+"",i,o;return{key:e,first:null,c(){t=g("option"),i=at(r),o=k(),t.__value=n[155],t.value=t.__value,this.first=t},m(s,l){F(s,t,l),f(t,i),f(t,o)},p(s,l){n=s},d(s){s&&V(t)}}}function Lu(e){let n,t,r,i,o;return{c(){n=g("span"),n.textContent="Max lines (floating window)",t=k(),r=g("input"),h(n,"class","label-text col-span-2"),h(r,"type","number"),h(r,"class","input input-bordered h-8 mb-2 col-span-2"),h(r,"min","0"),r.value=e[16]},m(s,l){F(s,n,l),F(s,t,l),F(s,r,l),i||(o=P(r,"blur",e[68]),i=!0)},p(s,l){l[0]&65536&&r.value!==s[16]&&(r.value=s[16])},d(s){s&&V(n),s&&V(t),s&&V(r),i=!1,o()}}}function o1(e){let n,t,r,i;ku.title=n=e[19]||"Texthooker UI";let o=e[0]&&Su(e);return{c(){t=k(),o&&o.c(),r=Hn()},m(s,l){F(s,t,l),o&&o.m(s,l),F(s,r,l),i=!0},p(s,l){(!i||l[0]&524288)&&n!==(n=s[19]||"Texthooker UI")&&(ku.title=n),s[0]?o?(o.p(s,l),l[0]&1&&N(o,1)):(o=Su(s),o.c(),N(o,1),o.m(r.parentNode,r)):o&&(rt(),W(o,1,1,()=>{o=null}),it())},i(s){i||(N(o),i=!0)},o(s){W(o),i=!1},d(s){s&&V(t),o&&o.d(s),s&&V(r)}}}function ms(e,n){const t=document.createElement("a");t.href=URL.createObjectURL(new Blob([JSON.stringify(n)],{type:"application/json"})),t.rel="noopener",t.download=e,setTimeout(()=>{URL.revokeObjectURL(t.href)},1e4),setTimeout(()=>{t.click()})}function l1(e,n,t){let r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I,L,H,J,Y,q,B,x,j,U,Z,ve,se,z,O,A,ee,he,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re,Ye,Fe,we,Me,mt,pe,ut,We,Ve,ot,gt,je,ae,Be;w(e,ze,m=>t(136,i=m)),w(e,Si,m=>t(12,o=m)),w(e,Gi,m=>t(3,s=m)),w(e,Qe,m=>t(137,l=m)),w(e,Ri,m=>t(13,u=m)),w(e,Rr,m=>t(14,a=m)),w(e,Pr,m=>t(15,c=m)),w(e,Ir,m=>t(16,p=m)),w(e,Or,m=>t(17,b=m)),w(e,Dr,m=>t(18,d=m)),w(e,jr,m=>t(138,y=m)),w(e,rr,m=>t(139,S=m)),w(e,_n,m=>t(140,D=m)),w(e,Qn,m=>t(141,T=m)),w(e,wo,m=>t(142,I=m)),w(e,wn,m=>t(143,L=m)),w(e,Ml,m=>t(144,H=m)),w(e,yl,m=>t(145,J=m)),w(e,Nr,m=>t(146,m)),w(e,Mn,m=>t(4,Y=m)),w(e,vo,m=>t(5,q=m)),w(e,Ar,m=>t(6,B=m)),w(e,bo,m=>t(19,x=m)),w(e,Tr,m=>t(20,j=m)),w(e,ki,m=>t(21,U=m)),w(e,or,m=>t(22,Z=m)),w(e,yi,m=>t(23,ve=m)),w(e,_o,m=>t(24,se=m)),w(e,Ci,m=>t(25,z=m)),w(e,Li,m=>t(26,O=m)),w(e,Ei,m=>t(27,A=m)),w(e,xi,m=>t(28,ee=m)),w(e,Pi,m=>t(29,he=m)),w(e,Ai,m=>t(30,xe=m)),w(e,Ti,m=>t(31,Xe=m)),w(e,Di,m=>t(32,Ie=m)),w(e,Oi,m=>t(33,Te=m)),w(e,Ii,m=>t(34,Ke=m)),w(e,Mi,m=>t(35,Ne=m)),w(e,$i,m=>t(36,_t=m)),w(e,Hi,m=>t(37,dt=m)),w(e,Vr,m=>t(38,Re=m)),w(e,Fr,m=>t(39,Ye=m)),w(e,Ni,m=>t(40,Fe=m)),w(e,Vi,m=>t(41,we=m)),w(e,Fi,m=>t(42,Me=m)),w(e,Wi,m=>t(43,mt=m)),w(e,ji,m=>t(44,pe=m)),w(e,Bi,m=>t(45,ut=m)),w(e,Ui,m=>t(46,We=m)),w(e,zi,m=>t(47,Ve=m)),w(e,Yi,m=>t(48,ot=m)),w(e,Wr,m=>t(49,gt=m)),w(e,Ki,m=>t(50,je=m)),w(e,$l,m=>t(51,ae=m)),w(e,Hl,m=>t(52,Be=m));let{selectedLineIds:et}=n,{settingsOpen:ke}=n,{settingsElement:Se}=n,{pipAvailable:Lt}=n;async function Ht(m){if(!o){const{canceled:X}=await new Promise(oe=>{R(ze,i={icon:Qt,message:m?"All displayed and stored Lines will be cleared":"Clear stored Lines + set Timer to 00:00:00",callback:oe},i)});if(X)return}R(Qe,l=[],l),t(72,et=[]),window.localStorage.removeItem("bannou-texthooker-lineData"),m||R(wn,L=0,L)}const ye=Br(),_=[nn.OFF,nn.NOTO,nn.KLEE,nn.SHIPPORI,nn.ACKAISYO,nn.CINECAPTION226];let ce,tt,Pe,bt,Ae;function Ue(m){m&&!Ae?po().then(()=>{Ae=new MutationObserver(wt),Ae.observe(document.body,{childList:!0})}):!m&&Ae&&(Ae.disconnect(),Ae=void 0)}function wt(m){for(let X=0,{length:oe}=m;X<oe;X+=1){const{addedNodes:$e}=m[X];for(let nt=0,{length:ht}=$e;nt<ht;nt+=1){const Mt=$e[X];(Mt==null?void 0:Mt.tagName)==="P"&&(Mr.next([Mt.textContent,en.EXTERNAL,""]),Mt.remove())}}}function hn(m){const X=m.target;!J&&X!==Se&&X.parentElement!==Se&&X!==ce&&X!==tt&&X!==Pe&&!H&&t(0,ke=!1)}async function pn(){const{canceled:m,data:X}=await new Promise(oe=>{R(ze,i={icon:Qt,askForData:"text",dataValue:"00:00:00",message:"New Time",callback:oe},i)});if(!m){if(!/^[\d]{1,}:[\d]{1,2}:[\d]{1,2}$/.test(X))return new Promise(oe=>{R(ze,i={icon:qu,type:"error",message:"Invalid Time value (x:xx:xx)",showCancel:!1,callback:oe},i)});R(wn,L=Xh(X),L)}}async function Wn(){if(!o){const{canceled:m}=await new Promise(X=>{R(ze,i={icon:Qt,message:"Timer will be set to 00:00:00",callback:X},i)});if(m)return}R(wn,L=0,L)}async function vt(m){m.altKey?await Ln(ce,"Existing Data will be overwritten"):ms("texthooker-ui_data.json",{"bannou-texthooker-timeValue":L,"bannou-texthooker-userNotes":I,"bannou-texthooker-lineData":l,"bannou-texthooker-actionHistory":T})}async function Yt(m){m.altKey?await Ln(tt,"Presets, Settings etc. will be overwritten"):ms("texthooker-ui_settings.json",{currentSettings:bt.getCurrentSettings(),settingPresets:D,lastSettingsPreset:S})}async function Ot(m){if(m.altKey)await Ln(Pe,"Preset will be overwritten or otherwise added");else if(S){const X=D.find(oe=>oe.name===S);X&&ms("texthooker-ui_preset.json",{name:X.name,settings:X.settings})}}async function Ge(){const m=await dn(ce).catch(({message:X})=>{R(ze,i={type:"error",message:X,showCancel:!1},i)});if(m){const X=Object.entries(m);for(let oe=0,{length:$e}=X;oe<$e;oe+=1){const[nt,ht]=X[oe];switch(nt){case"bannou-texthooker-timeValue":R(wn,L=ht,L);break;case"bannou-texthooker-userNotes":R(wo,I=ht,I);break;case"bannou-texthooker-lineData":R(Qe,l=ht,l);break;case"bannou-texthooker-actionHistory":R(Qn,T=ht,T);break}}}t(7,ce.value=null,ce)}async function Le(){const m=await dn(tt).catch(({message:X})=>{R(ze,i={type:"error",message:X,showCancel:!1},i)});m&&(R(_n,D=m.settingPresets||[],D),R(rr,S=m.lastSettingsPreset||"",S),m.currentSettings&&bt.updateSettingsWithPreset({name:"",settings:m.currentSettings},!1)),t(8,tt.value=null,tt)}async function C(){const m=await dn(Pe).catch(({message:X})=>{R(ze,i={type:"error",message:X,showCancel:!1},i)});if(m&&m.name&&m.settings){const X=D.findIndex(oe=>oe.name===m.name);X>-1?(R(_n,D[X]=m,D),R(_n,D=[...D],D)):R(_n,D=[...D,m],D),R(rr,S=m.name,S),bt.updateSettingsWithPreset(m)}t(9,Pe.value=null,Pe)}async function M(m,X,oe){if(m)return;const{canceled:$e}=await new Promise(nt=>{R(ze,i={icon:Qt,message:X,callback:nt},i)});$e||window.localStorage.removeItem(oe)}function kt(m){const X=m.target,oe=Number.parseInt(X.value||"0");!oe||oe<2?R(Dr,d=0,d):R(Dr,d=oe,d),d===0&&R(jr,y=new Map,y),X.value=`${d}`}function Et(m){const X=m.target,oe=Number.parseInt(X.value||"0"),$e=oe!==b;!oe||oe<0?R(Or,b=0,b):R(Or,b=oe,b),X.value=`${b}`,$e&&ln()}async function ln(){if(!b||l.length<2)return;const{canceled:m}=await new Promise(ht=>{R(ze,i={icon:Qt,message:"Apply to current lines",callback:ht},i)});if(m)return;const X=[],oe=new Set,$e=new Set,nt=l.splice(-(b+1));for(let ht=0,{length:Mt}=nt;ht<Mt;ht+=1){const ur=nt[ht];oe.has(ur.text)?$e.add(ur.id):(X.push(ur),oe.add(ur.text))}R(Qe,l=[...l,...X],l),t(72,et=et.filter(ht=>!$e.has(ht)))}function ct(m){const X=m.target,oe=Number.parseInt(X.value||"0"),$e=oe!==c;!oe||oe<0?R(Pr,c=0,c):R(Pr,c=oe,c),X.value=`${c}`,$e&&Nt()}function It(m){const X=m.target,oe=Number.parseInt(X.value||"0");!oe||oe<0?R(Ir,p=1,p):R(Ir,p=oe,p),X.value=`${p}`}async function Nt(){const m=l.length-c;if(!c||m<1)return;const{canceled:X}=await new Promise(oe=>{R(ze,i={icon:Qt,message:`This will remove the first ${m} line(s)`,callback:oe},i)});X?R(Pr,c=0,c):ye("maxLinesChange")}async function Zt(){if(!a||l.length<2)return;const{canceled:m}=await new Promise(X=>{R(ze,i={icon:Qt,message:"Apply to current lines",callback:X},i)});if(!m){const X=new Set,oe=new Set;R(Qe,l=l.filter($e=>X.has($e.text)?(oe.add($e.id),!1):(X.add($e.text),!0)),l),t(72,et=et.filter($e=>!oe.has($e)))}}async function Kt(){if(u){const{canceled:m}=await new Promise(X=>{R(ze,i={icon:Qt,message:"Apply to current Lines",callback:X},i)});m||R(Qe,l=l.map(X=>(X.text=X.text.replace(/\s/g,"").trim(),X)),l)}}function Yr(m){R(Gi,s=m.target.value,s)}async function Ln(m,X){if(!o){const{canceled:oe}=await new Promise($e=>{R(ze,i={icon:Qt,message:X,callback:$e},i)});if(oe)return}m.click()}function dn(m){return new Promise((X,oe)=>{const[$e]=m.files,nt=new FileReader;if(!$e)return X();if(!$e.name.endsWith(".json"))return R(ze,i={type:"error",message:"Expected json File",showCancel:!1},i),m.value=null,X();nt.addEventListener("loadend",ht=>{try{const Mt=JSON.parse(ht.target.result);X(Mt)}catch{oe(new Error("Error parsing File"))}}),nt.addEventListener("error",()=>oe(new Error("Failed to read File"))),nt.readAsText($e,"utf-8")})}async function Kr(){try{const m=await fetch(yo("/get_websocket_port"));if(!m.ok)throw new Error("Failed to fetch websocket port");return(await m.json()).port}catch(m){return console.error("Error fetching websocket port:",m),null}}function Rt(m){pt[m?"unshift":"push"](()=>{ce=m,t(7,ce)})}function Gr(m){pt[m?"unshift":"push"](()=>{tt=m,t(8,tt)})}function jn(m){pt[m?"unshift":"push"](()=>{Pe=m,t(9,Pe)})}const qr=()=>Ht(!0),sn=()=>Ht(!1),Xr=()=>R(Ar,B=B===tn.BUSINESS?tn.GARDEN:tn.BUSINESS,B),Bn=()=>R(Ar,B=B===tn.BUSINESS?tn.GARDEN:tn.BUSINESS,B);function Zr(m){pt[m?"unshift":"push"](()=>{bt=m,t(10,bt)})}function an(m){ho.call(this,e,m)}const Jr=({detail:m})=>Ot(m);function Un(m){ho.call(this,e,m)}function Qr(){x=this.value,bo.set(x)}function un(){r=this.value,t(11,r),t(4,Y)}const v=()=>R(Mn,Y=r,Y);function Q(){j=Pl(this.value),Tr.set(j)}const ne=()=>{(!j||j<1)&&R(Tr,j=24,j)};function de(){U=of(this),ki.set(U),t(54,_)}function ge(){Z=Pl(this.value),or.set(Z)}const ft=()=>{(Z===null||Z<0)&&R(or,Z=0,Z)};function mn(){ve=this.checked,yi.set(ve)}function Vt(){q=this.checked,vo.set(q)}function ar(){se=this.checked,_o.set(se)}function ei(){o=this.checked,Si.set(o)}function Po(){z=this.checked,Ci.set(z)}const gn=()=>M(z,"Clear stored stats","bannou-texthooker-timeValue");function Ao(){O=this.checked,Li.set(O)}const ti=()=>M(O,"Clear stored notes","bannou-texthooker-userNotes");function To(){A=this.checked,Ei.set(A)}const bn=()=>M(A,"Clear stored lines","bannou-texthooker-lineData");function Do(){ee=this.checked,xi.set(ee)}const ni=()=>M(ee,"Clear action history","bannou-texthooker-actionHistory");function Oo(){he=this.checked,Pi.set(he)}function vn(){xe=this.checked,Ai.set(xe)}function Io(){Xe=this.checked,Ti.set(Xe)}function ri(){Ie=this.checked,Di.set(Ie)}function Mo(){Te=this.checked,Oi.set(Te)}function En(){Ke=this.checked,Ii.set(Ke)}function $o(){a=this.checked,Rr.set(a)}function ii(){Ne=this.checked,Mi.set(Ne)}function Ho(){_t=this.checked,$i.set(_t)}function xn(){dt=this.checked,Hi.set(dt)}function No(){Re=this.checked,Vr.set(Re)}const oi=()=>ye("layoutChange");function Ro(){Ye=this.checked,Fr.set(Ye)}const Pn=()=>ye("layoutChange");function Vo(){Fe=this.checked,Ni.set(Fe)}function li(){u=this.checked,Ri.set(u)}function Fo(){we=this.checked,Vi.set(we)}function An(){Me=this.checked,Fi.set(Me)}function Wo(){mt=this.checked,Wi.set(mt)}function si(){pe=this.checked,ji.set(pe)}function jo(){ut=this.checked,Bi.set(ut)}function Tn(){We=this.checked,Ui.set(We)}function Bo(){Ve=this.checked,zi.set(Ve)}function ai(){ot=this.checked,Yi.set(ot)}function Uo(){gt=this.checked,Wr.set(gt)}const Dn=()=>{Zl.next(),Jl.next()};function zo(){je=this.checked,Ki.set(je)}function ui(){ae=this.checked,$l.set(ae)}function Yo(){Be=this.checked,Hl.set(Be)}return e.$$set=m=>{"selectedLineIds"in m&&t(72,et=m.selectedLineIds),"settingsOpen"in m&&t(0,ke=m.settingsOpen),"settingsElement"in m&&t(73,Se=m.settingsElement),"pipAvailable"in m&&t(1,Lt=m.pipAvailable)},e.$$.update=()=>{e.$$.dirty[0]&16&&Kr().then(m=>{if(window.location.protocol==="https:")return;const X=window.location.hostname;m&&Y!==`ws://${X}:${m}`&&R(Mn,Y=`ws://${X}:${m}`,Y)}),e.$$.dirty[0]&16&&t(11,r=Y),e.$$.dirty[0]&64&&(document.body.dataset.theme=B),e.$$.dirty[0]&32&&Ue(q),e.$$.dirty[0]&8&&Cc(document,s)},[ke,Lt,Ht,s,Y,q,B,ce,tt,Pe,bt,r,o,u,a,c,p,b,d,x,j,U,Z,ve,se,z,O,A,ee,he,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re,Ye,Fe,we,Me,mt,pe,ut,We,Ve,ot,gt,je,ae,Be,ye,_,hn,pn,Wn,vt,Yt,Ot,Ge,Le,C,M,kt,Et,ct,It,Zt,Kt,Yr,et,Se,Rt,Gr,jn,qr,sn,Xr,Bn,Zr,an,Jr,Un,Qr,un,v,Q,ne,de,ge,ft,mn,Vt,ar,ei,Po,gn,Ao,ti,To,bn,Do,ni,Oo,vn,Io,ri,Mo,En,$o,ii,Ho,xn,No,oi,Ro,Pn,Vo,li,Fo,An,Wo,si,jo,Tn,Bo,ai,Uo,Dn,zo,ui,Yo]}class s1 extends zt{constructor(n){super(),Ut(this,n,l1,o1,Ct,{selectedLineIds:72,settingsOpen:0,settingsElement:73,pipAvailable:1,handleReset:2},null,[-1,-1,-1,-1,-1,-1])}get handleReset(){return this.$$.ctx[2]}}class a1{constructor(n=!0){Ji(this,"websocketUrl");Ji(this,"socket");Ji(this,"socketState");Ji(this,"subscriptions",[]);this.socketState=n?Ws:js,this.subscriptions.push((n?Mn:Nr).subscribe(t=>{t!==this.websocketUrl&&(this.websocketUrl=t,this.reloadSocket())}),Wr.pipe(go(t=>t?(n?Zl:Jl).pipe(Gl(()=>{var r;return((r=this.socket)==null?void 0:r.readyState)===3})):mo)).subscribe(()=>this.reloadSocket()))}getCurrentUrl(){return this.websocketUrl}connect(){var n;if(!(((n=this.socket)==null?void 0:n.readyState)<2)){if(!this.websocketUrl){this.socketState.next(3);return}this.socketState.next(0);try{this.socket=new WebSocket(this.websocketUrl),this.socket.onopen=this.updateSocketState.bind(this),this.socket.onclose=this.updateSocketState.bind(this),this.socket.onmessage=this.handleMessage.bind(this)}catch{this.socketState.next(3)}}}disconnect(){var n;((n=this.socket)==null?void 0:n.readyState)===1&&this.socket.close(1e3,"User Request")}cleanUp(){this.disconnect();for(let n=0,{length:t}=this.subscriptions;n<t;n+=1)this.subscriptions[n].unsubscribe()}reloadSocket(){this.disconnect(),this.socket=void 0,this.connect()}updateSocketState(){this.socket&&this.socketState.next(this.socket.readyState)}handleMessage(n){var i,o,s,l;let t=n.data;try{if(((i=JSON.parse(n.data))==null?void 0:i.event)==="reset_checkboxes"){Mr.next(["",en.RESETCHECKBOXES,""]);return}t=((o=JSON.parse(n.data))==null?void 0:o.sentence)||n.data}catch{}console.log(n.data);const r=((l=(s=JSON.parse(n.data))==null?void 0:s.data)==null?void 0:l.id)||"";Mr.next([t,en.SOCKET,r])}}function u1(e){let n;return{c(){n=g("span"),h(n,"class","animate-ping relative inline-flex rounded-full h-3 w-3 mx-3 bg-primary")},m(t,r){F(t,n,r)},p:Oe,i:Oe,o:Oe,d(t){t&&V(n)}}}function c1(e){let n,t,r;return t=new _e({props:{path:_f,class:"cursor-pointer mx-2"}}),t.$on("click",e[3]),{c(){n=g("div"),le(t.$$.fragment),h(n,"class","hover:text-primary"),h(n,"title",e[1]),G(n,"text-red-500",e[0]!==-1),G(n,"text-green-700",e[0]===1)},m(i,o){F(i,n,o),re(t,n,null),r=!0},p(i,o){(!r||o&2)&&h(n,"title",i[1]),(!r||o&1)&&G(n,"text-red-500",i[0]!==-1),(!r||o&1)&&G(n,"text-green-700",i[0]===1)},i(i){r||(N(t.$$.fragment,i),r=!0)},o(i){W(t.$$.fragment,i),r=!1},d(i){i&&V(n),ie(t)}}}function f1(e){let n,t,r,i;const o=[c1,u1],s=[];function l(u,a){return u[0]!==0?0:1}return n=l(e),t=s[n]=o[n](e),{c(){t.c(),r=Hn()},m(u,a){s[n].m(u,a),F(u,r,a),i=!0},p(u,[a]){let c=n;n=l(u),n===c?s[n].p(u,a):(rt(),W(s[c],1,1,()=>{s[c]=null}),it(),t=s[n],t?t.p(u,a):(t=s[n]=o[n](u),t.c()),N(t,1),t.m(r.parentNode,r))},i(u){i||(N(t),i=!0)},o(u){W(t),i=!1},d(u){s[n].d(u),u&&V(r)}}}function h1(e,n,t){let r,i,o,s,l,u,a,c;w(e,Nr,H=>t(9,o=H)),w(e,Mn,H=>t(10,s=H)),w(e,qt,H=>t(11,l=H)),w(e,ze,H=>t(12,u=H)),w(e,Wr,H=>t(13,a=H)),w(e,Ki,H=>t(14,c=H));let{isPrimary:p=!0}=n,b,d=!1,y=!1,S=!1,D=p?Ws:js;w(e,D,H=>t(0,i=H)),jl(()=>(L(),()=>{S=!0,b==null||b.cleanUp()}));function T(H){switch(H){case 0:t(5,y=!1),S=!1;break;case 1:d=!0,t(5,y=!0);break;case 3:const J=p?"primary":"secondary";c&&!S&&d&&(p?s:o)&&(y||!a)&&R(ze,u={type:"error",message:y?`Lost Connection to ${J} Websocket`:`Unable to connect to ${J} Websocket`,showCancel:!1},u),R(qt,l=!0,l),d=!0,t(5,y=!1),S||(p?Zl:Jl).next();break}t(1,r=I(y))}function I(H){return H?`Connected with ${p?s:o}`:"Not Connected"}async function L(){i===1&&b?(S=!0,b.disconnect()):(b=b||new a1(p),b.connect())}return e.$$set=H=>{"isPrimary"in H&&t(4,p=H.isPrimary)},e.$$.update=()=>{e.$$.dirty&32&&t(1,r=I(y)),e.$$.dirty&1&&T(i)},[i,r,D,L,p,y]}class Bc extends zt{constructor(n){super(),Ut(this,n,h1,f1,Ct,{isPrimary:4})}}function p1(e){let n,t,r,i,o;return{c(){n=g("div"),t=k(),r=g("div"),r.innerHTML=`<div role="status"><svg aria-hidden="true" class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"></path><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"></path></svg>
39
+ <span class="sr-only">Loading...</span></div>`,i=k(),o=g("div"),h(n,"class","tap-highlight-transparent absolute inset-0 bg-black/[.3] z-20"),h(r,"class","fixed inset-0 flex h-full w-full items-center justify-center z-50")},m(s,l){F(s,n,l),F(s,t,l),F(s,r,l),F(s,i,l),F(s,o,l)},p:Oe,i:Oe,o:Oe,d(s){s&&V(n),s&&V(t),s&&V(r),s&&V(i),s&&V(o)}}}class d1 extends zt{constructor(n){super(),Ut(this,n,null,p1,Ct,{})}}function m1(e){let n=(e[2]??"")+"",t,r,i=(e[3]??"")+"",o,s,l,u,a,c,p;return{c(){t=at(n),r=k(),o=at(i),s=k(),l=g("div"),u=g("div"),a=at(e[1]),h(l,"class","text-sm timer mr-1 sm:text-base sm:mr-2 svelte-1efsh80"),G(l,"blur",e[4])},m(b,d){F(b,t,d),F(b,r,d),F(b,o,d),F(b,s,d),F(b,l,d),f(l,u),f(u,a),e[17](l),c||(p=P(l,"pointerleave",e[7]),c=!0)},p(b,[d]){d&4&&n!==(n=(b[2]??"")+"")&&Tt(t,n),d&8&&i!==(i=(b[3]??"")+"")&&Tt(o,i),d&2&&Tt(a,b[1]),d&16&&G(l,"blur",b[4])},i:Oe,o:Oe,d(b){b&&V(t),b&&V(r),b&&V(o),b&&V(s),b&&V(l),e[17](null),c=!1,p()}}}const g1=/[^0-9A-Z○◯々-〇〻ぁ-ゖゝ-ゞァ-ヺー0-9A-Zヲ-ン\p{Radical}\p{Unified_Ideograph}]+/gimu;function b1(e){return e?v1(e.replace(g1,"")):0}function v1(e){return Array.from(e).length}function _1(e,n,t){let r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I;w(e,Wi,O=>t(10,r=O)),w(e,ji,O=>t(11,i=O)),w(e,Fi,O=>t(12,o=O)),w(e,Vi,O=>t(13,s=O)),w(e,wn,O=>t(14,l=O)),w(e,qt,O=>t(20,u=O)),w(e,Yi,O=>t(21,a=O)),w(e,zi,O=>t(22,c=O)),w(e,or,O=>t(23,p=O)),w(e,yi,O=>t(24,b=O)),w(e,Qe,O=>t(15,d=O)),w(e,jr,O=>t(25,y=O)),w(e,Dr,O=>t(16,S=O)),w(e,Bi,O=>t(4,I=O));let L=0,H=0;const J=Br(),Y=qt.pipe(go(O=>O?(H=0,mo):(L=performance.now(),Nh(1e3))),Jn(ve),er());w(e,Y,O=>t(2,D=O));const q=xh([qt,or]).pipe(go(([O,A])=>O||A<1?mo:Rh(Mr,nr(window,"pointermove"),nr(document,"selectionchange")).pipe(Fh(!0),jh(1e3),Jn(()=>H=performance.now()+p*1e3),Fs(p*1e3))),er());w(e,q,O=>t(3,T=O));let B,x=0,j=0,U="";function Z(){const O=window.getSelection();O!=null&&O.toString()&&O.getRangeAt(0).intersectsNode(B)&&O.removeAllRanges()}function ve(){const O=H?Math.min(H,performance.now()):performance.now(),A=Math.round((O-L+Number.EPSILON)/1e3);H&&O>=H?(R(qt,u=!0,u),b?R(wn,l=Math.max(0,l+A-p),l):R(wn,l+=A,l),c&&(J("afkBlur",!0),document.addEventListener("dblclick",ee=>{ee.stopPropagation(),window.getSelection().removeAllRanges(),J("afkBlur",!1),a&&R(qt,u=!1,u)},{once:!0,capture:!1}))):(L=O,R(wn,l+=A,l))}function se(O,A,ee,he){let xe="";s&&(xe+=qh(O)),o&&(xe+=` (${A}/h) `),r&&(xe+=` ${ee}`),i&&(xe+=r?" /":"",xe+=` ${he}`),t(1,U=xe.replace(/[ ]+/g," ").trim())}function z(O){pt[O?"unshift":"push"](()=>{B=O,t(0,B)})}return e.$$.update=()=>{if(e.$$.dirty&116224&&(r||S>1)&&d){const O=new Map;let A=0,ee=S>1?S:0;for(let he=0,{length:xe}=d;he<xe;he+=1)if(A+=b1(d[he].text),ee&&A>=ee){let Xe=A,Ie=ee;for(O.set(d[he].id,`Milestone ${Ie} (${A})`);Xe>=ee;)ee+=S}R(jr,y=O,y),t(9,j=A),t(8,x=l?Math.ceil(3600*j/l):0)}e.$$.dirty&65280&&(l>-1&&(s||o||r||i)?se(l,x,j,d.length):t(1,U=""))},[B,U,D,T,I,Y,q,Z,x,j,r,i,o,s,l,d,S,z]}class w1 extends zt{constructor(n){super(),Ut(this,n,_1,m1,Ct,{})}}const{window:k1}=Os;function Eu(e,n,t){const r=e.slice();return r[106]=n[t],r[108]=t,r}function xu(e,n,t){const r=e.slice();return r[106]=n[t],r[109]=n,r[108]=t,r}function Pu(e){let n,t;return n=new d1({}),{c(){le(n.$$.fragment)},m(r,i){re(n,r,i),t=!0},i(r){t||(N(n.$$.fragment,r),t=!0)},o(r){W(n.$$.fragment,r),t=!1},d(r){ie(n,r)}}}function Au(e){let n,t;return n=new Bc({}),{c(){le(n.$$.fragment)},m(r,i){re(n,r,i),t=!0},i(r){t||(N(n.$$.fragment,r),t=!0)},o(r){W(n.$$.fragment,r),t=!1},d(r){ie(n,r)}}}function Tu(e){let n,t;return n=new Bc({props:{isPrimary:!1}}),{c(){le(n.$$.fragment)},m(r,i){re(n,r,i),t=!0},i(r){t||(N(n.$$.fragment,r),t=!0)},o(r){W(n.$$.fragment,r),t=!1},d(r){ie(n,r)}}}function y1(e){let n,t,r;return t=new _e({props:{path:Ef,width:e[13],height:e[13]}}),t.$on("click",e[55]),{c(){n=g("div"),le(t.$$.fragment),h(n,"role","button"),h(n,"title","Pause"),h(n,"class","mr-1 hover:text-primary sm:mr-2")},m(i,o){F(i,n,o),re(t,n,null),r=!0},p(i,o){const s={};o[0]&8192&&(s.width=i[13]),o[0]&8192&&(s.height=i[13]),t.$set(s)},i(i){r||(N(t.$$.fragment,i),r=!0)},o(i){W(t.$$.fragment,i),r=!1},d(i){i&&V(n),ie(t)}}}function S1(e){let n,t,r;return t=new _e({props:{path:Pf,width:e[13],height:e[13]}}),t.$on("click",e[54]),{c(){n=g("div"),le(t.$$.fragment),h(n,"role","button"),h(n,"title","Continue"),h(n,"class","mr-1 animate-[pulse_1.25s_cubic-bezier(0.4,0,0.6,1)_infinite] hover:text-primary sm:mr-2")},m(i,o){F(i,n,o),re(t,n,null),r=!0},p(i,o){const s={};o[0]&8192&&(s.width=i[13]),o[0]&8192&&(s.height=i[13]),t.$set(s)},i(i){r||(N(t.$$.fragment,i),r=!0)},o(i){W(t.$$.fragment,i),r=!1},d(i){i&&V(n),ie(t)}}}function Du(e){let n,t,r,i,o,s;return t=new _e({props:{path:oo,width:e[13],height:e[13]}}),t.$on("click",e[39]),o=new _e({props:{path:Gu,width:e[13],height:e[13]}}),o.$on("click",e[40]),{c(){n=g("div"),le(t.$$.fragment),r=k(),i=g("div"),le(o.$$.fragment),h(n,"role","button"),h(n,"title","Remove selected Lines"),h(n,"class","mr-1 hover:text-primary sm:mr-2"),h(i,"role","button"),h(i,"title","Deselect Lines"),h(i,"class","mr-1 hover:text-primary sm:mr-2")},m(l,u){F(l,n,u),re(t,n,null),F(l,r,u),F(l,i,u),re(o,i,null),s=!0},p(l,u){const a={};u[0]&8192&&(a.width=l[13]),u[0]&8192&&(a.height=l[13]),t.$set(a);const c={};u[0]&8192&&(c.width=l[13]),u[0]&8192&&(c.height=l[13]),o.$set(c)},i(l){s||(N(t.$$.fragment,l),N(o.$$.fragment,l),s=!0)},o(l){W(t.$$.fragment,l),W(o.$$.fragment,l),s=!1},d(l){l&&V(n),ie(t),l&&V(r),l&&V(i),ie(o)}}}function Ou(e){let n,t,r,i;return t=new _e({props:{width:e[13],height:e[13],path:e[1]?Ia:Ma}}),t.$on("click",e[41]),{c(){n=g("div"),le(t.$$.fragment),h(n,"role","button"),h(n,"class","mr-1 hover:text-primary sm:mr-2"),h(n,"title",r=e[1]?"Close Floating Window":"Open Floating Window")},m(o,s){F(o,n,s),re(t,n,null),i=!0},p(o,s){const l={};s[0]&8192&&(l.width=o[13]),s[0]&8192&&(l.height=o[13]),s[0]&2&&(l.path=o[1]?Ia:Ma),t.$set(l),(!i||s[0]&2&&r!==(r=o[1]?"Close Floating Window":"Open Floating Window"))&&h(n,"title",r)},i(o){i||(N(t.$$.fragment,o),i=!0)},o(o){W(t.$$.fragment,o),i=!1},d(o){o&&V(n),ie(t)}}}function Iu(e,n){let t,r,i=n[108],o;const s=()=>n[66](r,i),l=()=>n[66](null,i);let u={line:n[106],index:n[108],isLast:n[3].length-1===n[108]};return r=new Ec({props:u}),s(),r.$on("selected",n[67]),r.$on("deselected",n[68]),r.$on("edit",n[44]),{key:e,first:null,c(){t=Hn(),le(r.$$.fragment),this.first=t},m(a,c){F(a,t,c),re(r,a,c),o=!0},p(a,c){n=a,i!==n[108]&&(l(),i=n[108],s());const p={};c[0]&8&&(p.line=n[106]),c[0]&8&&(p.index=n[108]),c[0]&8&&(p.isLast=n[3].length-1===n[108]),r.$set(p)},i(a){o||(N(r.$$.fragment,a),o=!0)},o(a){W(r.$$.fragment,a),o=!1},d(a){a&&V(t),l(),ie(r,a)}}}function Mu(e){let n,t,r,i;return t=new hp({}),{c(){n=g("div"),le(t.$$.fragment),h(n,"class","bg-base-200 fixed top-0 right-0 z-[60] flex h-full w-full max-w-3xl flex-col justify-between")},m(o,s){F(o,n,s),re(t,n,null),i=!0},p(o,s){},i(o){i||(N(t.$$.fragment,o),o&&(r||$r(()=>{r=Ku(n,yc,{x:100,duration:100,easing:Uh}),r.start()})),i=!0)},o(o){W(t.$$.fragment,o),i=!1},d(o){o&&V(n),ie(t)}}}function $u(e){let n=[],t=new Map,r,i,o=e[12];const s=l=>l[106].id;for(let l=0;l<o.length;l+=1){let u=Eu(e,o,l),a=s(u);t.set(a,n[l]=Hu(a,u))}return{c(){for(let l=0;l<n.length;l+=1)n[l].c();r=Hn()},m(l,u){for(let a=0;a<n.length;a+=1)n[a].m(l,u);F(l,r,u),i=!0},p(l,u){u[0]&4098&&(o=l[12],rt(),n=Ur(n,u,s,1,l,o,t,r.parentNode,Is,Hu,r,Eu),it())},i(l){if(!i){for(let u=0;u<o.length;u+=1)N(n[u]);i=!0}},o(l){for(let u=0;u<n.length;u+=1)W(n[u]);i=!1},d(l){for(let u=0;u<n.length;u+=1)n[u].d(l);l&&V(r)}}}function Hu(e,n){let t,r,i;return r=new Ec({props:{line:n[106],index:n[108],pipWindow:n[1],isLast:n[12].length-1===n[108]}}),{key:e,first:null,c(){t=Hn(),le(r.$$.fragment),this.first=t},m(o,s){F(o,t,s),re(r,o,s),i=!0},p(o,s){n=o;const l={};s[0]&4096&&(l.line=n[106]),s[0]&4096&&(l.index=n[108]),s[0]&2&&(l.pipWindow=n[1]),s[0]&4096&&(l.isLast=n[12].length-1===n[108]),r.$set(l)},i(o){i||(N(r.$$.fragment,o),i=!0)},o(o){W(r.$$.fragment,o),i=!1},d(o){o&&V(t),ie(r,o)}}}function C1(e){let n=(e[21]??"")+"",t,r,i=(e[22]??"")+"",o,s,l=(e[23]??"")+"",u,a,c=(e[24]??"")+"",p,b,d=(e[25]??"")+"",y,S,D,T,I,L,H,J,Y,q,B,x,j,U,Z,ve,se,z,O,A,ee,he,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re,Ye,Fe,we,Me,mt,pe,ut,We,Ve=[],ot=new Map,gt,je,ae,Be,et,ke,Se,Lt,Ht,ye=e[14]&&Pu();T=new sp({}),H=new w1({}),H.$on("afkBlur",e[42]);let _=e[26]&&Au(),ce=e[27]&&Tu();const tt=[S1,y1],Pe=[];function bt(C,M){return C[19]?0:1}B=bt(e),x=Pe[B]=tt[B](e),Z=new _e({props:{path:kf,width:e[13],height:e[13]}}),Z.$on("click",e[38]),z=new _e({props:{path:gf,width:e[13],height:e[13]}}),z.$on("click",e[37]);let Ae=e[5].length&&Du(e);he=new _e({props:{path:Lf,width:e[13],height:e[13]}}),he.$on("click",e[56]);let Ue=e[2]&&Ou(e);Te=new _e({props:{path:bf,width:e[13],height:e[13]}}),Te.$on("click",e[57]);function wt(C){e[58](C)}let hn={class:"cursor-pointer mr-1 hover:text-primary md:mr-2",path:vf,width:e[13],height:e[13]};e[7]!==void 0&&(hn.element=e[7]),Ne=new _e({props:hn}),pt.push(()=>rs(Ne,"element",wt,e[7])),Ne.$on("click",e[59]);function pn(C){e[60](C)}function Wn(C){e[61](C)}let vt={settingsElement:e[7],pipAvailable:e[2]};e[8]!==void 0&&(vt.settingsOpen=e[8]),e[5]!==void 0&&(vt.selectedLineIds=e[5]),Re=new s1({props:vt}),pt.push(()=>rs(Re,"settingsOpen",pn,e[8])),pt.push(()=>rs(Re,"selectedLineIds",Wn,e[5])),e[62](Re),Re.$on("applyReplacements",e[63]),Re.$on("layoutChange",e[43]),Re.$on("maxLinesChange",e[64]),Me=new Pc({props:{isQuickSwitch:!0}}),Me.$on("layoutChange",e[43]);let Yt=e[3];const Ot=C=>C[106].id;for(let C=0;C<Yt.length;C+=1){let M=xu(e,Yt,C),kt=Ot(M);ot.set(kt,Ve[C]=Iu(kt,M))}let Ge=e[20]&&Mu(),Le=e[1]&&$u(e);return{c(){t=at(n),r=k(),o=at(i),s=k(),u=at(l),a=k(),p=at(c),b=k(),y=at(d),S=k(),ye&&ye.c(),D=k(),le(T.$$.fragment),I=k(),L=g("header"),le(H.$$.fragment),J=k(),_&&_.c(),Y=k(),ce&&ce.c(),q=k(),x.c(),j=k(),U=g("div"),le(Z.$$.fragment),ve=k(),se=g("div"),le(z.$$.fragment),O=k(),Ae&&Ae.c(),A=k(),ee=g("div"),le(he.$$.fragment),xe=k(),Ue&&Ue.c(),Xe=k(),Ie=g("div"),le(Te.$$.fragment),Ke=k(),le(Ne.$$.fragment),dt=k(),le(Re.$$.fragment),we=k(),le(Me.$$.fragment),mt=k(),pe=g("main"),ut=new ju(!1),We=k();for(let C=0;C<Ve.length;C+=1)Ve[C].c();gt=k(),je=g("div"),ae=g("input"),Be=k(),Ge&&Ge.c(),et=k(),ke=g("div"),Le&&Le.c(),h(U,"role","button"),h(U,"title","Delete last Line"),h(U,"class","mr-1 hover:text-primary sm:mr-2"),G(U,"opacity-50",!e[3].length),G(U,"cursor-not-allowed",!e[3].length),G(U,"hover:text-primary",e[3].length),h(se,"role","button"),h(se,"title","Undo last Action"),h(se,"class","mr-1 hover:text-primary sm:mr-2"),G(se,"opacity-50",!e[15].length),G(se,"cursor-not-allowed",!e[15].length),G(se,"hover:text-primary",e[15].length),h(ee,"role","button"),h(ee,"title","Open Notes"),h(ee,"class","mr-1 hover:text-primary sm:mr-2"),h(Ie,"role","button"),h(Ie,"class","mr-1 hover:text-primary sm:mr-2"),h(Ie,"title","Open Statistics Page"),h(L,"class","fixed top-0 right-0 flex justify-end items-center p-2 bg-base-100"),ut.a=We,h(pe,"class","flex flex-col flex-1 break-all px-4 w-full h-full overflow-auto"),G(pe,"py-16",!e[18]),G(pe,"py-8",e[18]),G(pe,"opacity-50",e[20]),G(pe,"flex-col-reverse",e[17]),be(pe,"font-size",`${e[28]}px`),be(pe,"font-family",e[29]!==nn.OFF?e[29]:void 0),be(pe,"writing-mode",e[18]?"vertical-rl":"horizontal-tb"),h(ae,"type","text"),h(ae,"placeholder","TL"),h(ae,"class","w-8 h-6 text-xs p-1 border border-gray-300 rounded text-center bg-base-100"),h(ae,"title","Press Enter to translate a number of lines"),h(je,"class","fixed bottom-2 right-2 z-50"),h(ke,"id","pip-container"),h(ke,"class","flex flex-col flex-1 flex flex-col break-all px-4 w-full h-full overflow-auto"),G(ke,"flex-col-reverse",e[17]),G(ke,"hidden",!e[1]),be(ke,"font-size",`${e[28]}px`),be(ke,"font-family",e[29]!==nn.OFF?e[29]:void 0)},m(C,M){F(C,t,M),F(C,r,M),F(C,o,M),F(C,s,M),F(C,u,M),F(C,a,M),F(C,p,M),F(C,b,M),F(C,y,M),F(C,S,M),ye&&ye.m(C,M),F(C,D,M),re(T,C,M),F(C,I,M),F(C,L,M),re(H,L,null),f(L,J),_&&_.m(L,null),f(L,Y),ce&&ce.m(L,null),f(L,q),Pe[B].m(L,null),f(L,j),f(L,U),re(Z,U,null),f(L,ve),f(L,se),re(z,se,null),f(L,O),Ae&&Ae.m(L,null),f(L,A),f(L,ee),re(he,ee,null),f(L,xe),Ue&&Ue.m(L,null),f(L,Xe),f(L,Ie),re(Te,Ie,null),f(L,Ke),re(Ne,L,null),f(L,dt),re(Re,L,null),f(L,we),re(Me,L,null),e[65](L),F(C,mt,M),F(C,pe,M),ut.m(Lc,pe),f(pe,We);for(let kt=0;kt<Ve.length;kt+=1)Ve[kt].m(pe,null);e[69](pe),F(C,gt,M),F(C,je,M),f(je,ae),At(ae,e[11]),F(C,Be,M),Ge&&Ge.m(C,M),F(C,et,M),F(C,ke,M),Le&&Le.m(ke,null),e[72](ke),Se=!0,Lt||(Ht=[P(k1,"keyup",e[36]),P(ae,"input",e[70]),P(ae,"keydown",e[71])],Lt=!0)},p(C,M){(!Se||M[0]&2097152)&&n!==(n=(C[21]??"")+"")&&Tt(t,n),(!Se||M[0]&4194304)&&i!==(i=(C[22]??"")+"")&&Tt(o,i),(!Se||M[0]&8388608)&&l!==(l=(C[23]??"")+"")&&Tt(u,l),(!Se||M[0]&16777216)&&c!==(c=(C[24]??"")+"")&&Tt(p,c),(!Se||M[0]&33554432)&&d!==(d=(C[25]??"")+"")&&Tt(y,d),C[14]?ye?M[0]&16384&&N(ye,1):(ye=Pu(),ye.c(),N(ye,1),ye.m(D.parentNode,D)):ye&&(rt(),W(ye,1,1,()=>{ye=null}),it()),C[26]?_?M[0]&67108864&&N(_,1):(_=Au(),_.c(),N(_,1),_.m(L,Y)):_&&(rt(),W(_,1,1,()=>{_=null}),it()),C[27]?ce?M[0]&134217728&&N(ce,1):(ce=Tu(),ce.c(),N(ce,1),ce.m(L,q)):ce&&(rt(),W(ce,1,1,()=>{ce=null}),it());let kt=B;B=bt(C),B===kt?Pe[B].p(C,M):(rt(),W(Pe[kt],1,1,()=>{Pe[kt]=null}),it(),x=Pe[B],x?x.p(C,M):(x=Pe[B]=tt[B](C),x.c()),N(x,1),x.m(L,j));const Et={};M[0]&8192&&(Et.width=C[13]),M[0]&8192&&(Et.height=C[13]),Z.$set(Et),(!Se||M[0]&8)&&G(U,"opacity-50",!C[3].length),(!Se||M[0]&8)&&G(U,"cursor-not-allowed",!C[3].length),(!Se||M[0]&8)&&G(U,"hover:text-primary",C[3].length);const ln={};M[0]&8192&&(ln.width=C[13]),M[0]&8192&&(ln.height=C[13]),z.$set(ln),(!Se||M[0]&32768)&&G(se,"opacity-50",!C[15].length),(!Se||M[0]&32768)&&G(se,"cursor-not-allowed",!C[15].length),(!Se||M[0]&32768)&&G(se,"hover:text-primary",C[15].length),C[5].length?Ae?(Ae.p(C,M),M[0]&32&&N(Ae,1)):(Ae=Du(C),Ae.c(),N(Ae,1),Ae.m(L,A)):Ae&&(rt(),W(Ae,1,1,()=>{Ae=null}),it());const ct={};M[0]&8192&&(ct.width=C[13]),M[0]&8192&&(ct.height=C[13]),he.$set(ct),C[2]?Ue?(Ue.p(C,M),M[0]&4&&N(Ue,1)):(Ue=Ou(C),Ue.c(),N(Ue,1),Ue.m(L,Xe)):Ue&&(rt(),W(Ue,1,1,()=>{Ue=null}),it());const It={};M[0]&8192&&(It.width=C[13]),M[0]&8192&&(It.height=C[13]),Te.$set(It);const Nt={};M[0]&8192&&(Nt.width=C[13]),M[0]&8192&&(Nt.height=C[13]),!_t&&M[0]&128&&(_t=!0,Nt.element=C[7],ts(()=>_t=!1)),Ne.$set(Nt);const Zt={};M[0]&128&&(Zt.settingsElement=C[7]),M[0]&4&&(Zt.pipAvailable=C[2]),!Ye&&M[0]&256&&(Ye=!0,Zt.settingsOpen=C[8],ts(()=>Ye=!1)),!Fe&&M[0]&32&&(Fe=!0,Zt.selectedLineIds=C[5],ts(()=>Fe=!1)),Re.$set(Zt),M[0]&1064|M[1]&8192&&(Yt=C[3],rt(),Ve=Ur(Ve,M,Ot,1,C,Yt,ot,pe,Is,Iu,null,xu),it()),(!Se||M[0]&262144)&&G(pe,"py-16",!C[18]),(!Se||M[0]&262144)&&G(pe,"py-8",C[18]),(!Se||M[0]&1048576)&&G(pe,"opacity-50",C[20]),(!Se||M[0]&131072)&&G(pe,"flex-col-reverse",C[17]),M[0]&268435456&&be(pe,"font-size",`${C[28]}px`),M[0]&536870912&&be(pe,"font-family",C[29]!==nn.OFF?C[29]:void 0),M[0]&262144&&be(pe,"writing-mode",C[18]?"vertical-rl":"horizontal-tb"),M[0]&2048&&ae.value!==C[11]&&At(ae,C[11]),C[20]?Ge?M[0]&1048576&&N(Ge,1):(Ge=Mu(),Ge.c(),N(Ge,1),Ge.m(et.parentNode,et)):Ge&&(rt(),W(Ge,1,1,()=>{Ge=null}),it()),C[1]?Le?(Le.p(C,M),M[0]&2&&N(Le,1)):(Le=$u(C),Le.c(),N(Le,1),Le.m(ke,null)):Le&&(rt(),W(Le,1,1,()=>{Le=null}),it()),(!Se||M[0]&131072)&&G(ke,"flex-col-reverse",C[17]),(!Se||M[0]&2)&&G(ke,"hidden",!C[1]),M[0]&268435456&&be(ke,"font-size",`${C[28]}px`),M[0]&536870912&&be(ke,"font-family",C[29]!==nn.OFF?C[29]:void 0)},i(C){if(!Se){N(ye),N(T.$$.fragment,C),N(H.$$.fragment,C),N(_),N(ce),N(x),N(Z.$$.fragment,C),N(z.$$.fragment,C),N(Ae),N(he.$$.fragment,C),N(Ue),N(Te.$$.fragment,C),N(Ne.$$.fragment,C),N(Re.$$.fragment,C),N(Me.$$.fragment,C);for(let M=0;M<Yt.length;M+=1)N(Ve[M]);N(Ge),N(Le),Se=!0}},o(C){W(ye),W(T.$$.fragment,C),W(H.$$.fragment,C),W(_),W(ce),W(x),W(Z.$$.fragment,C),W(z.$$.fragment,C),W(Ae),W(he.$$.fragment,C),W(Ue),W(Te.$$.fragment,C),W(Ne.$$.fragment,C),W(Re.$$.fragment,C),W(Me.$$.fragment,C);for(let M=0;M<Ve.length;M+=1)W(Ve[M]);W(Ge),W(Le),Se=!1},d(C){C&&V(t),C&&V(r),C&&V(o),C&&V(s),C&&V(u),C&&V(a),C&&V(p),C&&V(b),C&&V(y),C&&V(S),ye&&ye.d(C),C&&V(D),ie(T,C),C&&V(I),C&&V(L),ie(H),_&&_.d(),ce&&ce.d(),Pe[B].d(),ie(Z),ie(z),Ae&&Ae.d(),ie(he),Ue&&Ue.d(),ie(Te),ie(Ne),e[62](null),ie(Re),ie(Me),e[65](null),C&&V(mt),C&&V(pe);for(let M=0;M<Ve.length;M+=1)Ve[M].d();e[69](null),C&&V(gt),C&&V(je),C&&V(Be),Ge&&Ge.d(C),C&&V(et),C&&V(ke),Le&&Le.d(),e[72](null),Lt=!1,St(Ht)}}}const L1=/[\p{scx=Hira}\p{scx=Kana}\p{scx=Han}]/imu;function E1(e,n,t){let r,i,o,s,l,u,a,c,p,b,d,y,S,D,T,I,L,H,J,Y,q,B,x,j,U,Z,ve,se,z,O,A,ee,he,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re;w(e,kl,v=>t(78,s=v)),w(e,Mi,v=>t(80,u=v)),w(e,yl,v=>t(14,a=v)),w(e,Qe,v=>t(3,c=v)),w(e,ze,v=>t(81,p=v)),w(e,Pr,v=>t(82,b=v)),w(e,Qn,v=>t(15,d=v)),w(e,Or,v=>t(83,y=v)),w(e,Rr,v=>t(84,S=v)),w(e,$i,v=>t(85,D=v)),w(e,Ri,v=>t(86,T=v)),w(e,Ls,v=>t(16,I=v)),w(e,Ar,v=>t(50,L=v)),w(e,Cs,v=>t(87,H=v)),w(e,Fr,v=>t(17,J=v)),w(e,Vr,v=>t(18,Y=v)),w(e,Ba,v=>t(88,q=v)),w(e,ja,v=>t(89,B=v)),w(e,qt,v=>t(19,x=v)),w(e,Ml,v=>t(90,j=v)),w(e,Il,v=>t(20,U=v)),w(e,Gi,v=>t(51,Z=v)),w(e,Ir,v=>t(52,ve=v)),w(e,rn,v=>t(53,se=v)),w(e,Hi,v=>t(91,z=v)),w(e,Ii,v=>t(92,O=v)),w(e,Oi,v=>t(93,A=v)),w(e,Di,v=>t(94,ee=v)),w(e,Ti,v=>t(95,he=v)),w(e,Mn,v=>t(26,Ne=v)),w(e,Nr,v=>t(27,_t=v)),w(e,Tr,v=>t(28,dt=v)),w(e,ki,v=>t(29,Re=v));let Ye=!1,Fe,we=[],Me,mt,pe=!1,ut,We=[],Ve=!1,ot=!1,gt=null,je,ae,Be;Pe();const et="wakeLock"in navigator,ke=Rr.pipe(Kl(v=>v?new Set(c.map(Q=>Q.text)):new Set));w(e,ke,v=>t(79,l=v));const Se=Mr.pipe(Gl(([v,Q,ne])=>{const de=Q===en.RESETCHECKBOXES,ge=Q===en.PASTE,ft=!ge||!U&&!j&&!pe&&!Ve,mn=ot&&Q===en.EXTERNAL;return mn&&(ot=!1),de?(bt(),!1):(!x||(he||A)&&ge||(ee||O)&&!ge)&&ft&&!mn?(x&&(A&&ge||O&&!ge)&&R(qt,x=!1,x),!0):(!mn&&ft&&z&&C(),!1)}),Jn(v=>{const[Q]=v,ne=v.at(1)||en.SOCKET,de=M(Q,ne!==en.TL),ge=v.at(2)||Zh();ne!==en.TL&&R(kl,s=[...s,ge],s),de&&R(Qe,c=ct([...Et(1),{id:ge,text:de}]),c)}),er());w(e,Se,v=>t(22,Xe=v));const Lt=Pi.pipe(go(v=>v?nr(document,"paste"):mo),Jn(v=>Mr.next([v.clipboardData.getData("text/plain"),en.PASTE,""])),er());w(e,Lt,v=>t(23,Ie=v));const Ht=nr(document,"visibilitychange").pipe(Jn(()=>{et&&gt!==null&&document.visibilityState==="visible"&&(gt=navigator.wakeLock.request("screen").then(v=>v).catch(v=>(console.error(`Unable to aquire screen lock: ${v.message}`),null)))}),er());w(e,Ht,v=>t(21,xe=v));const ye=Ai.pipe(go(v=>(ot=!1,v?nr(document,"copy"):mo)),Jn(()=>ot=!0),er());w(e,ye,v=>t(24,Te=v));const _=nr(window,"resize").pipe(Fs(500),Jn(ce),er());w(e,_,v=>t(25,Ke=v)),jl(()=>{ce(),et&&(gt=navigator.wakeLock.request("screen").then(v=>v).catch(v=>(console.error(`Unable to aquire screen lock: ${v.message}`),null)))});function ce(){t(49,Ye=window.matchMedia("(min-width: 640px)").matches),Le()}function tt(v){var ne,de;if(U||j||pe||Ve)return;const Q=(ne=v.key||"")==null?void 0:ne.toLowerCase();if(Q==="delete"){if((de=window.getSelection())!=null&&de.toString().trim()){const ge=window.getSelection().getRangeAt(0);for(let ft=0,{length:mn}=We;ft<mn;ft+=1){const Vt=We[ft],ar=Vt==null?void 0:Vt.getIdIfSelected(ge);ar&&we.push(ar)}}we.length?wt():v.altKey&&Ue()}else we.length&&Q==="escape"?hn():v.altKey&&Q==="a"?Fe.handleReset(!1):v.altKey&&Q==="q"?Fe.handleReset(!0):(v.ctrlKey||v.metaKey)&&Q===" "&&R(qt,x=!x,x)}function Pe(){setInterval(async()=>{try{const v=await fetch(yo("/get_ids"));if(!v.ok)throw new Error(`HTTP error! Status: ${v.status}`);R(kl,s=await v.json(),s)}catch(v){console.error("Failed to fetch ids:",v)}},1e3)}function bt(){c.forEach(v=>{const Q=document.getElementById(`multi-line-checkbox-${v.id}`);Q&&typeof Q.checked=="boolean"?Q.checked=!1:console.warn(`Checkbox with ID 'multi-line-checkbox-${v.id}' not found or is not a valid checkbox element.`)})}async function Ae(){if(!d.length)return;const v=d.pop();let Q=v.pop();for(;Q;){const ne=M(Q.text,!1);if(ne){const{id:de,index:ge}=Q;ge>c.length-1?c.push({id:de,text:ne}):c[ge].id===de?R(Qe,c[ge]={id:de,text:ne},c):c.splice(ge,0,{id:de,text:ne})}Q=v.pop()}await po(),R(Qe,c=ct(Et()),c),Qn.set(d)}function Ue(){if(!c.length)return;const[v]=c.splice(c.length-1,1);t(5,we=we.filter(Q=>Q!==v.id)),Qe.set(c),R(Qn,d=[...d,[{...v,index:c.length}]],d),l.delete(v.text)}function wt(){const v=new Set(we),Q=[];R(Qe,c=c.filter((ne,de)=>{const ge=v.has(ne.id);return v.delete(ne.id),ge&&(Q.push({...ne,index:de-Q.length}),l.delete(ne.text)),!ge}),c),t(5,we=v.size?[...v]:[]),Q.length&&R(Qn,d=[...d,Q],d)}function hn(){var v;for(let Q=0,{length:ne}=We;Q<ne;Q+=1)(v=We[Q])==null||v.deselect();t(5,we=[])}async function pn(){if(ae)return ae.close();t(1,ae=await window.documentPictureInPicture.requestWindow(B>0&&q>0?{height:B,width:q,preferInitialWindowPlacement:!1}:{preferInitialWindowPlacement:!1}).catch(({message:v})=>{R(ze,p={message:`Error opening floating window: ${v}`,showCancel:!1},p)})),ae&&(ae.document.body.appendChild(je),ae.addEventListener("pagehide",Wn,{once:!0}),ae.addEventListener("resize",vt,!1),ae.addEventListener("blur",Ot,!1),ae.addEventListener("focus",Ot,!1),[...document.styleSheets].forEach(v=>{if(!(v.ownerNode instanceof Element&&v.ownerNode.id==="user-css"))try{const Q=[...v.cssRules].map(de=>de.cssText).join(""),ne=document.createElement("style");ne.textContent=Q,ae.document.head.appendChild(ne)}catch{const ne=document.createElement("link");ne.rel="stylesheet",ne.type=v.type,ne.media=v.media.toString(),ne.href=v.href,ae.document.head.appendChild(ne)}}))}function Wn(){Yt(),ae.removeEventListener("resize",vt,!1),ae.removeEventListener("blur",Ot,!1),ae.removeEventListener("focus",Ot,!1),t(1,ae=void 0)}function vt(){window.clearTimeout(Be),Be=window.setTimeout(Yt,500)}function Yt(){ae&&(R(ja,B=ae.document.body.clientHeight,B),R(Ba,q=ae.document.body.clientWidth,q))}function Ot(v){v.type}function Ge({detail:v}){Ua(document,v),ae&&Ua(ae.document,v)}function Le(){ko(window,ut,J,Y),ae&&ko(ae,je,J,!1)}function C(){clearTimeout(H),L===tn.GARDEN&&(Me.classList.add("bg-base-200"),Me.classList.remove("bg-base-100"),document.body.classList.add("bg-base-200")),document.body.classList.add("animate-[pulse_0.5s_cubic-bezier(0.4,0,0.6,1)_1]"),R(Cs,H=window.setTimeout(()=>{L===tn.GARDEN&&(Me.classList.add("bg-base-100"),Me.classList.remove("bg-base-200"),document.body.classList.remove("bg-base-200")),document.body.classList.remove("animate-[pulse_0.5s_cubic-bezier(0.4,0,0.6,1)_1]")},500),H)}function M(v,Q=!0){const ne=Q?Sc(v,I):v;let de=!0,ge=T?ne.replace(/\s/gm,"").trim():ne;return D&&!ge.match(L1)&&(ge=""),ge?S?(de=!l.has(ge),l.add(ge)):y&&c.length&&(de=c.slice(-y).every(ft=>ft.text!==ge)):de=!1,de?ge:void 0}function kt(v){const{inEdit:Q,data:ne}=v.detail;if(ne&&ne.originalText!==ne.newText){const de=M(ne.newText);R(Qe,c[ne.lineIndex]={id:ne.line.id,text:de},c),de?(R(Qn,d=[...d,[{...ne.line,index:ne.lineIndex}]],d),l.delete(ne.originalText),l.add(de)):po().then(()=>R(Qe,c[ne.lineIndex]={id:ne.line.id,text:ne.originalText},c))}Ve=Q}function Et(v=0){const Q=new Set,ne=b?c.length-b+v:0,de=ne>0?c.filter((ge,ft)=>ft<ne?(Q.add(ge.id),l.delete(ge.text),!1):!0):c;return Q.size&&t(5,we=we.filter(ge=>!Q.has(ge))),de}function ln(v){if(v){R(yl,a=!0,a);try{for(let Q=0,{length:ne}=c;Q<ne;Q+=1){const de=c[Q],ge=M(de.text);ge&&ge!==de.text&&(l.delete(de.text),R(Qe,c[Q]={...de,text:ge},c))}R(ze,p={message:"Operation executed",showCancel:!1},p)}catch({message:Q}){R(ze,p={type:"error",message:`An Error occured: ${Q}`,showCancel:!1},p)}R(Qe,c=ct(Et()),c),R(yl,a=!1,a)}}function ct(v){if(!u||v.length<2)return v;const Q=v.length-1,ne=Q-1,de=v[Q],ge=v[ne].text;return de.text.startsWith(ge)&&(l.delete(ge),t(5,we=we.filter(ft=>ft!==v[ne].id)),v.splice(ne,2,de)),v}let It="";async function Nt(){if(It.trim())try{let v=s;Number(It)<v.length&&(v=v.slice(-Number(It)));const Q=await fetch(yo("/translate-multiple"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:v})});if(Q.ok){const ne=await Q.text();Mr.next([ne,en.TL,""])}}catch(v){console.error("Translation failed:",v)}}const Zt=()=>R(qt,x=!1,x),Kt=()=>R(qt,x=!0,x),Yr=()=>R(Il,U=!0,U),Ln=()=>window.open("/overview","_blank");function dn(v){mt=v,t(7,mt)}const Kr=()=>t(8,pe=!pe);function Rt(v){pe=v,t(8,pe)}function Gr(v){we=v,t(5,we)}function jn(v){pt[v?"unshift":"push"](()=>{Fe=v,t(4,Fe)})}const qr=()=>ln(!!I.length),sn=()=>R(Qe,c=Et(),c);function Xr(v){pt[v?"unshift":"push"](()=>{Me=v,t(6,Me)})}function Bn(v,Q){pt[v?"unshift":"push"](()=>{We[Q]=v,t(10,We)})}const Zr=({detail:v})=>{t(5,we=[...we,v])},an=({detail:v})=>{t(5,we=we.filter(Q=>Q!==v))};function Jr(v){pt[v?"unshift":"push"](()=>{ut=v,t(9,ut)})}function Un(){It=this.value,t(11,It)}const Qr=v=>v.key==="Enter"&&Nt();function un(v){pt[v?"unshift":"push"](()=>{je=v,t(0,je)})}return e.$$.update=()=>{e.$$.dirty[1]&262144&&t(13,r=Ye?"1.5rem":"1.25rem"),e.$$.dirty[1]&4194304&&R(Ls,I=se.filter(v=>v.enabled),I),e.$$.dirty[0]&1&&t(2,i="documentPictureInPicture"in window&&!!je),e.$$.dirty[0]&12|e.$$.dirty[1]&2097152&&t(12,o=i&&c?c.slice(-ve):[]),e.$$.dirty[0]&2|e.$$.dirty[1]&1572864&&ae&&(t(1,ae.document.body.dataset.theme=L,ae),Cc(ae.document,Z))},[je,ae,i,c,Fe,we,Me,mt,pe,ut,We,It,o,r,a,d,I,J,Y,x,U,xe,Xe,Ie,Te,Ke,Ne,_t,dt,Re,ke,Se,Lt,Ht,ye,_,tt,Ae,Ue,wt,hn,pn,Ge,Le,kt,Et,ln,Nt,Pe,Ye,L,Z,ve,se,Zt,Kt,Yr,Ln,dn,Kr,Rt,Gr,jn,qr,sn,Xr,Bn,Zr,an,Jr,Un,Qr,un]}class x1 extends zt{constructor(n){super(),Ut(this,n,E1,C1,Ct,{startIdPolling:48},null,[-1,-1,-1,-1])}get startIdPolling(){return this.$$.ctx[48]}}new x1({target:document.body});
38
40
 
39
41
  </script>
40
42
  <style>