From c3f3636125316f93a41a12478d00d32bcb3678a7 Mon Sep 17 00:00:00 2001 From: Constantin Piber Date: Thu, 25 Jul 2024 23:17:38 +0200 Subject: [PATCH] Updates --- index.html | 2 +- main-40130754dc439b49f270.css | 47 +++++++++++++++++++++++++++++++++++ main-40130754dc439b49f270.js | 1 + 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 main-40130754dc439b49f270.css create mode 100644 main-40130754dc439b49f270.js diff --git a/index.html b/index.html index 4163dc6..34cae13 100644 --- a/index.html +++ b/index.html @@ -17,4 +17,4 @@ l.pathname.slice(0, -1) + decoded + l.hash ); } - }(window.location)) \ No newline at end of file + }(window.location)) \ No newline at end of file diff --git a/main-40130754dc439b49f270.css b/main-40130754dc439b49f270.css new file mode 100644 index 0000000..b6a1829 --- /dev/null +++ b/main-40130754dc439b49f270.css @@ -0,0 +1,47 @@ +.column-card.svelte-12n6e3q{padding:10px 18px;border:1px dashed lightgray;border-radius:8px;display:grid;grid-template-columns:150px auto;grid-gap:10px;gap:10px;align-items:baseline + }@media screen and (max-width: 600px){.column-card.svelte-12n6e3q{grid-template-columns:100%;padding:6px 8px}.column-card.svelte-12n6e3q>p:not(:last-child){margin-bottom:1em}}@media screen and (max-width: 400px){.column-card.svelte-12n6e3q{margin:0 -5px + }}.column-card.svelte-12n6e3q>*{margin:0} +@keyframes svelte-1tapr9t-slide{0%{left:0}100%{left:1em}}label.svelte-1tapr9t{display:block} +@keyframes svelte-5v9ihf-slide{0%{left:0}100%{left:1em}}.warning.svelte-5v9ihf.svelte-5v9ihf{color:#f2b400 + }.warning.svelte-5v9ihf.svelte-5v9ihf::before{content:'\26a0';margin-right:0.5em}.field.svelte-5v9ihf.svelte-5v9ihf{display:block;padding-top:0.7em}.field.svelte-5v9ihf input.svelte-5v9ihf:not([type="checkbox"]),.field.svelte-5v9ihf textarea.svelte-5v9ihf{display:block;width:100%;max-width:100%;box-sizing:border-box}.small.svelte-5v9ihf.svelte-5v9ihf{font-size:0.8em}.settings.svelte-5v9ihf.svelte-5v9ihf{margin:1em 0}.error.svelte-5v9ihf.svelte-5v9ihf{color:#e32636} +@keyframes svelte-m4i2yw-slide{0%{left:0}100%{left:1em}}.error.svelte-m4i2yw{color:#e32636 + }.error.svelte-m4i2yw::before{content:'\26a0';margin-right:0.5em}.error.svelte-m4i2yw{display:block;margin:0.2em 0} +@keyframes svelte-w1n7v1-slide{0%{left:0}100%{left:1em}}.loading.svelte-w1n7v1{font-style:italic;margin:0}.loading-container.svelte-w1n7v1{display:flex;grid-gap:10px;gap:10px}.loading-slider.svelte-w1n7v1{position:absolute;display:block;animation:0.7s ease-in-out infinite alternate svelte-w1n7v1-slide}.loading-slider-container.svelte-w1n7v1{position:relative;flex:0 0 2em} +@keyframes svelte-ardw9p-slide{0%{left:0}100%{left:1em}}.valid.svelte-ardw9p.svelte-ardw9p{color:#34b334 + }.valid.svelte-ardw9p.svelte-ardw9p::before{content:'\1f44d';margin-right:0.5em}.warning.svelte-ardw9p.svelte-ardw9p{color:#f2b400 + }.warning.svelte-ardw9p.svelte-ardw9p::before{content:'\26a0';margin-right:0.5em}.logs.svelte-ardw9p.svelte-ardw9p{margin:1em 0}.logs.svelte-ardw9p p.svelte-ardw9p{margin:0} +@keyframes svelte-1rrnlr6-slide{0%{left:0}100%{left:1em}}.valid.svelte-1rrnlr6.svelte-1rrnlr6{color:#34b334 + }.valid.svelte-1rrnlr6.svelte-1rrnlr6::before{content:'\1f44d';margin-right:0.5em}.chapters.svelte-1rrnlr6.svelte-1rrnlr6{margin:1em 0}.chapters.svelte-1rrnlr6 p.svelte-1rrnlr6{margin:0} +@keyframes svelte-tsai6h-slide{0%{left:0}100%{left:1em}}.valid.svelte-tsai6h{color:#34b334 + }.valid.svelte-tsai6h::before{content:'\1f44d';margin-right:0.5em} +.controls.svelte-1ahjj8t svg{height:0.8em}.control-disabled.svelte-1ahjj8t{opacity:0.7;cursor:inherit}.up.svelte-1ahjj8t{display:inline-flex;align-items:baseline;grid-gap:2px;gap:2px;padding:2px 5px;background-color:lightgray;border:1px dotted gray;border-radius:4px;text-decoration:none}.up.svelte-1ahjj8t:hover{border:1px solid gray}.down.svelte-1ahjj8t{display:inline-flex;align-items:baseline;grid-gap:2px;gap:2px;padding:2px 5px;background-color:lightgray;border:1px dotted gray;border-radius:4px;text-decoration:none}.down.svelte-1ahjj8t:hover{border:1px solid gray}.down.svelte-1ahjj8t svg{transform:rotate(180deg);margin:auto 0}.remove.svelte-1ahjj8t{color:#e32636 + }.remove.svelte-1ahjj8t:hover{color:hsl(354.92063492063494, 77.1428571429%, 31.9607843137%)} +:first-child>.chapter.svelte-13pfiuq.svelte-13pfiuq{border-top-left-radius:2px;border-top-right-radius:2px}:last-child>.chapter.svelte-13pfiuq.svelte-13pfiuq{border-bottom-left-radius:2px;border-bottom-right-radius:2px}:not(:first-child)>.chapter.svelte-13pfiuq.svelte-13pfiuq{margin-top:-1px}.chapter.svelte-13pfiuq.svelte-13pfiuq{border-radius:2px}:not(:first-child)>.chapter.svelte-13pfiuq.svelte-13pfiuq{margin-top:1em}:not(:last-child)>.chapter.svelte-13pfiuq.svelte-13pfiuq{margin-bottom:1em}.edit.svelte-13pfiuq input.svelte-13pfiuq:not([type="checkbox"]),.edit.svelte-13pfiuq textarea.svelte-13pfiuq,.edit.svelte-13pfiuq label.svelte-13pfiuq{display:block;width:100%;box-sizing:border-box}.edit.svelte-13pfiuq textarea{min-height:100px;height:350px}.edit.svelte-13pfiuq label.svelte-13pfiuq{cursor:pointer}.field.svelte-13pfiuq.svelte-13pfiuq{display:grid;grid-template-columns:min-content 1fr;grid-gap:4px;gap:4px + }@media screen and (max-width: 950px){.field.svelte-13pfiuq.svelte-13pfiuq{margin-top:0.4em}.field.svelte-13pfiuq.svelte-13pfiuq,.chapter.svelte-13pfiuq:not(.open) .field.svelte-13pfiuq{grid-template-columns:1fr}}.field.svelte-13pfiuq span.svelte-13pfiuq{margin:0.4em 1px}.field.svelte-13pfiuq .label.svelte-13pfiuq{overflow:hidden;transition:opacity 0.2s ease-in-out;opacity:1;width:60px;transition:width 0.2s ease-in-out + }.field.svelte-13pfiuq .label.svelte-13pfiuq::after{content:':'}@media screen and (max-width: 950px){.field.svelte-13pfiuq .label.svelte-13pfiuq{position:absolute;margin-top:-0.5em;padding-left:3px;font-size:0.8em;opacity:0.8 + }.field.svelte-13pfiuq .label.svelte-13pfiuq::after{content:''}}.field.svelte-13pfiuq .svelte-13pfiuq:not(.label){border-bottom:1px solid currentColor}.back.svelte-13pfiuq svg{height:0.65em}.back.svelte-13pfiuq a.svelte-13pfiuq{text-decoration:none;color:inherit + }.back.svelte-13pfiuq a.svelte-13pfiuq:hover,.back.svelte-13pfiuq a.svelte-13pfiuq:active,.back.svelte-13pfiuq a.svelte-13pfiuq:focus{text-decoration:underline}.url.svelte-13pfiuq.svelte-13pfiuq{word-break:break-word} +.chapter.svelte-1ltngm7.svelte-1ltngm7{border:1px dotted lightgray;margin:0;cursor:move + }.chapter.svelte-1ltngm7.svelte-1ltngm7:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.chapter.svelte-1ltngm7.svelte-1ltngm7:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.chapter.svelte-1ltngm7.svelte-1ltngm7:not(:first-child){margin-top:-1px}.chapter.svelte-1ltngm7 .more.svelte-1ltngm7{transition:height 0.1s ease-in-out, padding 0.1s ease-in-out;height:0;padding:0 0.5em;overflow:hidden}.chapter.svelte-1ltngm7:not([draggable]#dnd-action-dragged-el):hover .more.svelte-1ltngm7,.chapter.svelte-1ltngm7:not([draggable]#dnd-action-dragged-el):active .more.svelte-1ltngm7,.chapter.svelte-1ltngm7:not([draggable]#dnd-action-dragged-el):focus .more.svelte-1ltngm7{transition:height 0.1s ease-in-out 0.2s, padding 0.1s ease-in-out 0.2s;height:1.5em;padding:0.4em 0.5em}.preview.svelte-1ltngm7.svelte-1ltngm7{display:grid;grid-template-columns:2fr 3fr;grid-gap:5px;gap:5px;align-items:center;overflow:hidden + }.preview.empty.svelte-1ltngm7.svelte-1ltngm7{grid-template-columns:1fr}.preview.svelte-1ltngm7 .title.svelte-1ltngm7{position:relative;border-bottom:1px solid rgba(0,0,0,0)}.preview.svelte-1ltngm7 .title.svelte-1ltngm7,.preview.svelte-1ltngm7 .content.svelte-1ltngm7{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0.4em 0.5em}@media screen and (max-width: 950px){.preview.svelte-1ltngm7.svelte-1ltngm7{grid-template-columns:1fr}.preview.svelte-1ltngm7 .content.svelte-1ltngm7{display:none}} +.edit.svelte-1pemcjw{display:block;width:100%;box-sizing:border-box;border-bottom:1px solid currentColor} +.list.svelte-zxr0xc.svelte-zxr0xc{margin:1em 0;position:relative}.list.svelte-zxr0xc .hide.svelte-zxr0xc{display:none}.list.svelte-zxr0xc .float.svelte-zxr0xc{position:absolute;top:0;left:0;right:0;background-color:white;z-index:1}.chapters.svelte-zxr0xc.svelte-zxr0xc{position:relative + }@media(any-pointer: coarse), (any-hover: none){.chapters.svelte-zxr0xc.svelte-zxr0xc::after{content:'touch scroll area';background-color:red;opacity:0;position:absolute;top:0;bottom:0;right:0;width:35px}}nav.svelte-zxr0xc.svelte-zxr0xc{margin:8px 6px 2px;text-align:center}nav.svelte-zxr0xc a.svelte-zxr0xc{margin:0 0.2em;text-decoration:none}nav.svelte-zxr0xc a[disabled="true"].svelte-zxr0xc{opacity:0.6;pointer-events:none}nav.svelte-zxr0xc .current.svelte-zxr0xc{opacity:0.6;text-decoration:underline}.remove.svelte-zxr0xc.svelte-zxr0xc{color:#e32636 + }.remove.svelte-zxr0xc.svelte-zxr0xc:hover{color:hsl(354.92063492063494, 77.1428571429%, 31.9607843137%)} +.list.svelte-1hsynpq{margin:1em 0}.spacer.svelte-1hsynpq{display:inline-block;width:1.5em}.no-margin.svelte-1hsynpq{margin:0}.chapter-list.svelte-1hsynpq{margin-top:.5em;display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:2px 10px;gap:2px 10px + }@media screen and (max-width: 950px){.chapter-list.svelte-1hsynpq{grid-template-columns:1fr 1fr + }}@media screen and (max-width: 600px){.chapter-list.svelte-1hsynpq{grid-template-columns:1fr + }} +.form.svelte-ovxj9s p.svelte-ovxj9s{display:flex;grid-gap:6px;gap:6px;margin:0}.search.svelte-ovxj9s.svelte-ovxj9s,input[type="file"].svelte-ovxj9s.svelte-ovxj9s{width:100%;box-sizing:border-box}.submit.svelte-ovxj9s.svelte-ovxj9s{min-width:60px;flex-shrink:0}.error.svelte-ovxj9s.svelte-ovxj9s{color:#e32636}.spaceabove.svelte-ovxj9s.svelte-ovxj9s{margin-top:2em}form.svelte-ovxj9s.svelte-ovxj9s{position:relative}.search-results.svelte-ovxj9s.svelte-ovxj9s{position:absolute;left:0;right:0;background-color:white;border:1px solid black;border-radius:3px;padding:4px 8px;margin-top:-0.5em;z-index:1;max-height:15em;overflow:auto}.search-results.svelte-ovxj9s .result.svelte-ovxj9s{display:block;text-decoration:none;color:inherit;border-bottom:1px dotted transparent + }.search-results.svelte-ovxj9s .result.svelte-ovxj9s:hover,.search-results.svelte-ovxj9s .result.svelte-ovxj9s:active,.search-results.svelte-ovxj9s .result.svelte-ovxj9s:focus{border-bottom-color:gray}.overlay.svelte-ovxj9s.svelte-ovxj9s{content:'';position:absolute;background-color:white;opacity:0.6;left:0;right:0;top:0;bottom:0}.overlay-wrapper.svelte-ovxj9s.svelte-ovxj9s{position:relative}textarea.svelte-ovxj9s.svelte-ovxj9s{display:block;width:100%;max-width:100%;box-sizing:border-box}p.small.svelte-ovxj9s.svelte-ovxj9s{margin:0}.mode-select.svelte-ovxj9s input.svelte-ovxj9s{opacity:0;width:1;height:1;position:absolute;left:-10px}.mode-select.svelte-ovxj9s label.svelte-ovxj9s{display:inline-block;padding:8px;border-bottom:2px hidden black;cursor:pointer + }.mode-select.svelte-ovxj9s label.svelte-ovxj9s:hover{border-bottom-style:solid;border-bottom-color:rgba(10, 10, 10, 0.6)}.mode-select.svelte-ovxj9s label.selected.svelte-ovxj9s{border-bottom-style:solid;border-bottom-color:black}.mode.svelte-ovxj9s.svelte-ovxj9s{border:0.5px solid rgba(20, 20, 20, 0.3);padding:14px 8px} +@keyframes svelte-1mwdlru-slide{0%{left:0}100%{left:1em}}.info.svelte-1mwdlru{color:#b3e5fc + }.info.svelte-1mwdlru::before{content:'\2139';margin-right:0.5em}.alert.svelte-1mwdlru{padding:8px 16px;border-radius:6px;border:1px solid}.alert.info.svelte-1mwdlru{border-color:rgb(143, 183, 202);color:black;background-color:rgb(194, 234, 253)} +header.svelte-ntsh7z.svelte-ntsh7z{margin-bottom:2.5rem}header.svelte-ntsh7z>.svelte-ntsh7z:first-child{margin-top:0}.small.svelte-ntsh7z.svelte-ntsh7z{font-size:0.45em;vertical-align:text-top} +footer.svelte-1f8pws6.svelte-1f8pws6{margin-top:3rem}footer.svelte-1f8pws6>.svelte-1f8pws6:last-child{margin-bottom:0}input.svelte-1f8pws6.svelte-1f8pws6{height:0.9em} +h1,h2,h3,h4,h5,h6{font-weight:normal}h1{font-size:2.2rem}h2{font-size:1.5rem}html{font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif}body{max-width:1100px;margin:12px auto;padding:0 8px;overflow:scroll;position:relative +}@media screen and (max-width: 600px){body{padding:0 2px +}}button:not(:disabled),input[type="submit"]:not(:disabled){cursor:pointer}a,a[href^="#"],a[href^="#"]:visited{color:#0048ba}.fatal-error{color:white;background-color:red;border-radius:5px;margin:10px;padding:6px 12px}.fatal-error h1{margin-top:0}.small{font-size:0.8em}.App.svelte-ibaoy7.svelte-ibaoy7{position:relative;padding:14px 18px;border:1px solid gray;border-top:none;border-bottom:none + }@media screen and (max-width: 600px){.App.svelte-ibaoy7.svelte-ibaoy7{padding:10px + }}.mainnav.svelte-ibaoy7.svelte-ibaoy7{position:absolute;top:-0.2em;left:18px;right:18px;font-size:0.8rem;display:flex}.mainnav.svelte-ibaoy7 svg{height:0.65em}.mainnav.svelte-ibaoy7 a.svelte-ibaoy7{text-decoration:none;color:inherit + }.mainnav.svelte-ibaoy7 a.svelte-ibaoy7:hover,.mainnav.svelte-ibaoy7 a.svelte-ibaoy7:active,.mainnav.svelte-ibaoy7 a.svelte-ibaoy7:focus{text-decoration:underline}.mainnav.svelte-ibaoy7 .settingslink.svelte-ibaoy7{margin-left:auto}.mainnav.svelte-ibaoy7 .settingslink.svelte-ibaoy7 svg{height:1.2em} diff --git a/main-40130754dc439b49f270.js b/main-40130754dc439b49f270.js new file mode 100644 index 0000000..66e7adc --- /dev/null +++ b/main-40130754dc439b49f270.js @@ -0,0 +1 @@ +(()=>{var e,t,n,r,o,s={4785:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(){return function e(t,n,r){var o,s,l=window,i="application/octet-stream",c=r||i,a=t,u=!n&&!r&&a,d=document.createElement("a"),p=function(e){return String(e)},f=l.Blob||l.MozBlob||l.WebKitBlob||p,h=n||"download";if(f=f.call?f.bind(l):Blob,"true"===String(this)&&(c=(a=[a,c])[0],a=a[1]),u&&u.length<2048&&(h=u.split("/").pop().split("?")[0],d.href=u,-1!==d.href.indexOf(u))){var m=new XMLHttpRequest;return m.open("GET",u,!0),m.responseType="blob",m.onload=function(t){e(t.target.response,h,i)},setTimeout((function(){m.send()}),0),m}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(a)){if(!(a.length>2096103.424&&f!==p))return navigator.msSaveBlob?navigator.msSaveBlob(b(a),h):y(a);c=(a=b(a)).type||i}else if(/([\x80-\xff])/.test(a)){for(var g=0,v=new Uint8Array(a.length),$=v.length;g<$;++g)v[g]=a.charCodeAt(g);a=new f([v],{type:c})}function b(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),o=r.length,s=0,l=new Uint8Array(o);s{if(!n){var s=1/0;for(u=0;u=o)&&Object.keys(i.O).every((e=>i.O[e](n[c])))?n.splice(c--,1):(l=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},i.F={},i.E=e=>{Object.keys(i.F).map((t=>{i.F[t](e)}))},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);i.r(o);var s={};t=t||[null,n({}),n([]),n(n)];for(var l=2&r&&e;"object"==typeof l&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach((t=>s[t]=()=>e[t]));return s.default=()=>e,i.d(o,s),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,n)=>(i.f[n](e,t),t)),[])),i.u=e=>e+"-"+{483:"fefd040803c093fe8d27",845:"74c785c44477a9538d2c"}[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o="hfy-epub:",i.l=(e,t,n,s)=>{if(r[e])r[e].push(t);else{var l,c;if(void 0!==n)for(var a=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(f);var o=r[e];if(delete r[e],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),c&&document.head.appendChild(l)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.p="/hfy-epub/",(()=>{var e={179:0};i.f.j=(t,n)=>{var r=i.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var s=i.p+i.u(t),l=new Error;i.l(s,(n=>{if(i.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+s+")",l.name="ChunkLoadError",l.type=o,l.request=s,r[1](l)}}),"chunk-"+t,t)}},i.F.j=t=>{if(!i.o(e,t)||void 0===e[t]){e[t]=null;var n=document.createElement("link");i.nc&&n.setAttribute("nonce",i.nc),n.rel="prefetch",n.as="script",n.href=i.p+i.u(t),document.head.appendChild(n)}},i.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[s,l,c]=n,a=0;if(s.some((t=>0!==e[t]))){for(r in l)i.o(l,r)&&(i.m[r]=l[r]);if(c)var u=c(i)}for(t&&t(n);a{i.E(845),i.E(483)}),5);var c={};(()=>{"use strict";function e(){}const t=e=>e;function n(e){return e()}function r(){return Object.create(null)}function o(e){e.forEach(n)}function s(e){return"function"==typeof e}function l(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function c(e){return 0===Object.keys(e).length}function a(t,n,r){t.$$.on_destroy.push(function(t,...n){if(null==t)return e;const r=t.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(n,r))}function u(e,t,n,r){if(e){const o=d(e,t,n,r);return e[0](o)}}function d(e,t,n,r){return e[1]&&r?function(e,t){for(const n in t)e[n]=t[n];return e}(n.ctx.slice(),e[1](r(t))):n.ctx}function p(e,t,n,r){if(e[2]&&r){const o=e[2](r(n));if(void 0===t.dirty)return o;if("object"==typeof o){const e=[],n=Math.max(t.dirty.length,o.length);for(let r=0;r32){const t=[],n=e.ctx.length/32;for(let e=0;ewindow.performance.now():()=>Date.now(),$=g?e=>requestAnimationFrame(e):e;const b=new Set;function y(e){b.forEach((t=>{t.c(e)||(b.delete(t),t.f())})),0!==b.size&&$(y)}let w=!1;function x(e,t){e.appendChild(t)}function k(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function E(e){const t=O("style");return function(e,t){x(e.head||e,t)}(k(e),t),t.sheet}function S(e,t,n){e.insertBefore(t,n||null)}function C(e){e.parentNode.removeChild(e)}function T(e,t){for(let n=0;ne.removeEventListener(t,n,r)}function F(e){return function(t){return t.preventDefault(),e.call(this,t)}}function j(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function R(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function U(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function I(e,t){e.value=null==t?"":t}function M(e,t,n){e.classList[n?"add":"remove"](t)}function P(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,r,t),o}const H=new Map;let z,B=0;function G(e,t,n,r,o,s,l,i=0){const c=16.666/r;let a="{\n";for(let e=0;e<=1;e+=c){const r=t+(n-t)*s(e);a+=100*e+`%{${l(r,1-r)}}\n`}const u=a+`100% {${l(n,1-n)}}\n}`,d=`__svelte_${function(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}(u)}_${i}`,p=k(e),{stylesheet:f,rules:h}=H.get(p)||function(e,t){const n={stylesheet:E(t),rules:{}};return H.set(e,n),n}(p,e);h[d]||(h[d]=!0,f.insertRule(`@keyframes ${d} ${u}`,f.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${d} ${r}ms linear ${o}ms 1 both`,B+=1,d}function q(e){z=e}function W(){if(!z)throw new Error("Function called outside component initialization");return z}function X(e){W().$$.on_mount.push(e)}function Y(e){W().$$.on_destroy.push(e)}function K(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e.call(this,t)))}const V=[],J=[],Z=[],Q=[],ee=Promise.resolve();let te=!1;function ne(e){Z.push(e)}function re(e){Q.push(e)}const oe=new Set;let se,le=0;function ie(){const e=z;do{for(;le{ue.delete(e),r&&(n&&e.d(1),r())})),e.o(t)}else r&&r()}const ge={duration:0};function ve(n,r,l,i){let c=r(n,l),a=i?0:1,u=null,d=null,p=null;function f(){p&&function(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),o=n.length-r.length;o&&(e.style.animation=r.join(", "),B-=o,B||$((()=>{B||(H.forEach((e=>{const{stylesheet:t}=e;let n=t.cssRules.length;for(;n--;)t.deleteRule(n);e.rules={}})),H.clear())})))}(n,p)}function h(e,t){const n=e.b-a;return t*=Math.abs(n),{a,b:e.b,d:n,duration:t,start:e.start,end:e.start+t,group:e.group}}function m(r){const{delay:s=0,duration:l=300,easing:i=t,tick:m=e,css:g}=c||ge,w={start:v()+s,b:r};r||(w.group=de,de.r+=1),u||d?d=w:(g&&(f(),p=G(n,a,r,l,s,i,g)),r&&m(0,1),u=h(w,l),ne((()=>ae(n,r,"start"))),function(e){let t;0===b.size&&$(y),new Promise((n=>{b.add(t={c:e,f:n})}))}((e=>{if(d&&e>d.start&&(u=h(d,l),d=null,ae(n,u.b,"start"),g&&(f(),p=G(n,a,u.b,u.duration,0,i,c.css))),u)if(e>=u.end)m(a=u.b,1-a),ae(n,u.b,"end"),d||(u.b?f():--u.group.r||o(u.group.c)),u=null;else if(e>=u.start){const t=e-u.start;a=u.a+u.d*i(t/u.duration),m(a,1-a)}return!(!u&&!d)})))}return{run(e){s(c)?(se||(se=Promise.resolve(),se.then((()=>{se=null}))),se).then((()=>{c=c(),m(e)})):m(e)},end(){f(),u=d=null}}}function $e(e,t){const n=t.token={};function r(e,r,o,s){if(t.token!==n)return;t.resolved=s;let l=t.ctx;void 0!==o&&(l=l.slice(),l[o]=s);const i=e&&(t.current=e)(l);let c=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==r&&e&&(pe(),me(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),fe())})):t.block.d(1),i.c(),he(i,1),i.m(t.mount(),t.anchor),c=!0),t.block=i,t.blocks&&(t.blocks[r]=i),c&&ie()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=W();if(e.then((e=>{q(n),r(t.then,1,t.value,e),q(null)}),(e=>{if(q(n),r(t.catch,2,t.error,e),q(null),!t.hasCatch)throw e})),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}var o}function be(e,t,n){const r=t.slice(),{resolved:o}=e;e.current===e.then&&(r[e.value]=o),e.current===e.catch&&(r[e.error]=o),e.block.p(r,n)}function ye(e,t){e.d(1),t.delete(e.key)}function we(e,t){me(e,1,1,(()=>{t.delete(e.key)}))}function xe(e,t,n,r,o,s,l,i,c,a,u,d){let p=e.length,f=s.length,h=p;const m={};for(;h--;)m[e[h].key]=h;const g=[],v=new Map,$=new Map;for(h=f;h--;){const e=d(o,s,h),i=n(e);let c=l.get(i);c?r&&c.p(e,t):(c=a(i,e),c.c()),v.set(i,g[h]=c),i in m&&$.set(i,Math.abs(h-m[i]))}const b=new Set,y=new Set;function w(e){he(e,1),e.m(i,u),l.set(e.key,e),u=e.first,f--}for(;p&&f;){const t=g[f-1],n=e[p-1],r=t.key,o=n.key;t===n?(u=t.first,p--,f--):v.has(o)?!l.has(r)||b.has(r)?w(t):y.has(o)?p--:$.get(r)>$.get(o)?(y.add(r),w(t)):(b.add(o),p--):(c(n,l),p--)}for(;p--;){const t=e[p];v.has(t.key)||c(t,l)}for(;f;)w(g[f-1]);return g}let ke;function Ee(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Se(e){e&&e.c()}function Ce(e,t,r,l){const{fragment:i,on_mount:c,on_destroy:a,after_update:u}=e.$$;i&&i.m(t,r),l||ne((()=>{const t=c.map(n).filter(s);a?a.push(...t):o(t),e.$$.on_mount=[]})),u.forEach(ne)}function Te(e,t){const n=e.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Oe(t,n,s,l,i,c,a,u=[-1]){const d=z;q(t);const p=t.$$={fragment:null,ctx:null,props:c,update:e,not_equal:i,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(d?d.$$.context:[])),callbacks:r(),dirty:u,skip_bound:!1,root:n.target||d.$$.root};a&&a(p.root);let f=!1;if(p.ctx=s?s(t,n.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return p.ctx&&i(p.ctx[e],p.ctx[e]=o)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](o),f&&function(e,t){-1===e.$$.dirty[0]&&(V.push(e),te||(te=!0,ee.then(ie)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!c(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}});class Le{$destroy(){Te(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){this.$$set&&!c(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function De(e){let t,n,r,o;const l=e[2].default,i=u(l,e,e[1],null);return{c(){t=O("form"),i&&i.c(),R(t,"class","column-card svelte-12n6e3q")},m(l,c){S(l,t,c),i&&i.m(t,null),n=!0,r||(o=N(t,"submit",F((function(){s(e[0])&&e[0].apply(this,arguments)}))),r=!0)},p(t,[r]){e=t,i&&i.p&&(!n||2&r)&&f(i,l,e,e[1],n?p(l,e[1],r,null):h(e[1]),null)},i(e){n||(he(i,e),n=!0)},o(e){me(i,e),n=!1},d(e){e&&C(t),i&&i.d(e),r=!1,o()}}}function Ae(e,t,n){let{$$slots:r={},$$scope:o}=t,{onSubmit:s}=t;return e.$$set=e=>{"onSubmit"in e&&n(0,s=e.onSubmit),"$$scope"in e&&n(1,o=e.$$scope)},[s,o,r]}const _e=class extends Le{constructor(e){super(),Oe(this,e,Ae,De,l,{onSubmit:0})}};function Ne(e,t,n){const r=e.slice();return r[4]=t[n],r}function Fe(e,t){let n,r,o,s,l,i,c,a,u=t[4].label+"";function d(){return t[3](t[4])}return{key:e,first:null,c(){n=O("label"),r=O("input"),l=A(),i=D(u),R(r,"type","radio"),R(r,"name",t[2]),r.value=o=t[4].value,r.checked=s=t[0]===t[4].value,R(n,"class","svelte-1tapr9t"),this.first=n},m(e,t){S(e,n,t),x(n,r),x(n,l),x(n,i),c||(a=N(r,"click",d),c=!0)},p(e,n){t=e,4&n&&R(r,"name",t[2]),2&n&&o!==(o=t[4].value)&&(r.value=o),3&n&&s!==(s=t[0]===t[4].value)&&(r.checked=s),2&n&&u!==(u=t[4].label+"")&&U(i,u)},d(e){e&&C(n),c=!1,a()}}}function je(t){let n,r=[],o=new Map,s=t[1];const l=e=>e[4].value;for(let e=0;e{"options"in e&&n(1,r=e.options),"selected"in e&&n(0,o=e.selected),"name"in e&&n(2,s=e.name)},[o,r,s,e=>n(0,o=e.value)]}const Ue=class extends Le{constructor(e){super(),Oe(this,e,Re,je,l,{options:1,selected:0,name:2})}},Ie=[];function Me(t,n=e){let r;const o=new Set;function s(e){if(l(t,e)&&(t=e,r)){const e=!Ie.length;for(const e of o)e[1](),Ie.push(e,t);if(e){for(let e=0;e{o.delete(c),0===o.size&&(r(),r=null)}}}}var Pe,He;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.REGEXP=1]="REGEXP",e[e.FUNCTION=2]="FUNCTION"}(Pe||(Pe={})),function(e){e[e.NONE=0]="NONE",e[e.REGEXP=1]="REGEXP",e[e.SELECTOR=2]="SELECTOR",e[e.FUNCTION=3]="FUNCTION"}(He||(He={}));const ze={useTiny:!0,nextLink:Pe.DEFAULT,nextLinkRegex:'href="([^"]+)"[^>]*>\\s*Next',nextLinkFn:'return "https://www.reddit.com/r/HFY/comments/f94rak/oc_pthok_eats_an_ice_cream_cone/"',transform:He.NONE,transformRegex:".md",transformSelector:"",transformFn:'title = "P\'Thok Eats an Ice Cream Cone"\nhtml = "https://www.reddit.com/r/HFY/comments/f94rak/oc_pthok_eats_an_ice_cream_cone/"'},Be=Me(ze),Ge=e=>{const t=new Function("sandbox",`with (sandbox) {${e}}`),n=Object.create(null);n.console={log:console.log,table:console.table,error:console.error,assert:console.assert};const r=new Proxy(n,{has:qe,get:We});return e=>(Object.defineProperties(r,e),{proxy:r,ret:t(r)})};function qe(e,t){return!0}function We(e,t){if(t!==Symbol.unscopables)return e[t]}function Xe(e){let t,n,r,o,s,l,i,c,a,u;return{c(){t=O("label"),n=D("Function: "),r=O("span"),r.textContent="Only input code you trust!",o=A(),s=O("textarea"),i=A(),c=O("span"),c.innerHTML="Globals document and html are available; Must produce the url as return",R(r,"class","small warning svelte-5v9ihf"),R(s,"rows","5"),R(s,"placeholder",l=ze.nextLinkFn),R(s,"class","svelte-5v9ihf"),R(c,"class","small svelte-5v9ihf"),R(t,"class","field svelte-5v9ihf")},m(l,d){S(l,t,d),x(t,n),x(t,r),x(t,o),x(t,s),I(s,e[0].nextLinkFn),x(t,i),x(t,c),a||(u=N(s,"input",e[7]),a=!0)},p(e,t){1&t&&I(s,e[0].nextLinkFn)},d(e){e&&C(t),a=!1,u()}}}function Ye(e){let t,n,r,o,s,l,i,c;return{c(){t=O("label"),n=D("Regex:\n "),r=O("input"),s=A(),l=O("span"),l.textContent="Must produce the url in the first group",R(r,"type","text"),R(r,"placeholder",o=ze.nextLinkRegex),R(r,"class","svelte-5v9ihf"),R(l,"class","small svelte-5v9ihf"),R(t,"class","field svelte-5v9ihf")},m(o,a){S(o,t,a),x(t,n),x(t,r),I(r,e[0].nextLinkRegex),x(t,s),x(t,l),i||(c=N(r,"input",e[6]),i=!0)},p(e,t){1&t&&r.value!==e[0].nextLinkRegex&&I(r,e[0].nextLinkRegex)},d(e){e&&C(t),i=!1,c()}}}function Ke(t){let n;return{c(){n=O("span"),n.textContent='Finds a "First" link, with fallback to other links that aren\'t "Previous" or "Index" or "First"',R(n,"class","small svelte-5v9ihf")},m(e,t){S(e,n,t)},p:e,d(e){e&&C(n)}}}function Ve(e){let t,n,r,o,s,l,i,c,a,u;return{c(){t=O("label"),n=D("Function: "),r=O("span"),r.textContent="Only input code you trust!",o=A(),s=O("textarea"),i=A(),c=O("span"),c.innerHTML="Globals document, html, title and url are available; Modify the latter three to transform",R(r,"class","small warning svelte-5v9ihf"),R(s,"rows","5"),R(s,"placeholder",l=ze.transformFn),R(s,"class","svelte-5v9ihf"),R(c,"class","small svelte-5v9ihf"),R(t,"class","field svelte-5v9ihf")},m(l,d){S(l,t,d),x(t,n),x(t,r),x(t,o),x(t,s),I(s,e[0].transformFn),x(t,i),x(t,c),a||(u=N(s,"input",e[11]),a=!0)},p(e,t){1&t&&I(s,e[0].transformFn)},d(e){e&&C(t),a=!1,u()}}}function Je(e){let t,n,r,o,s,l;return{c(){t=O("label"),n=D("Selector:\n "),r=O("input"),R(r,"type","text"),R(r,"placeholder",o=ze.transformSelector),R(r,"class","svelte-5v9ihf"),R(t,"class","field svelte-5v9ihf")},m(o,i){S(o,t,i),x(t,n),x(t,r),I(r,e[0].transformSelector),s||(l=N(r,"input",e[10]),s=!0)},p(e,t){1&t&&r.value!==e[0].transformSelector&&I(r,e[0].transformSelector)},d(e){e&&C(t),s=!1,l()}}}function Ze(e){let t,n,r,o,s,l,i,c;return{c(){t=O("label"),n=D("Regex:\n "),r=O("input"),s=A(),l=O("span"),l.textContent="Must produce the new html in the first group",R(r,"type","text"),R(r,"placeholder",o=ze.transformRegex),R(r,"class","svelte-5v9ihf"),R(l,"class","small svelte-5v9ihf"),R(t,"class","field svelte-5v9ihf")},m(o,a){S(o,t,a),x(t,n),x(t,r),I(r,e[0].transformRegex),x(t,s),x(t,l),i||(c=N(r,"input",e[9]),i=!0)},p(e,t){1&t&&r.value!==e[0].transformRegex&&I(r,e[0].transformRegex)},d(e){e&&C(t),i=!1,c()}}}function Qe(e){let t,n,r,o,s,l,i,c,a,u,d,p,f,h,m,g,v,$,b,y,w,k,E,T,L,_,F;function j(t){e[5](t)}let U={options:[{value:Pe.DEFAULT,label:"Default"},{value:Pe.REGEXP,label:"Regex"},{value:Pe.FUNCTION,label:"Function"}],name:"radio-next-type"};function I(e,t){return e[0].nextLink===Pe.DEFAULT?Ke:e[0].nextLink===Pe.REGEXP?Ye:e[0].nextLink===Pe.FUNCTION?Xe:void 0}void 0!==e[0].nextLink&&(U.selected=e[0].nextLink),f=new Ue({props:U}),J.push((()=>Ee(f,"selected",j)));let M=I(e),P=M&&M(e);function H(t){e[8](t)}let z={options:[{value:He.NONE,label:"No transform"},{value:He.REGEXP,label:"Regex"},{value:He.SELECTOR,label:"Query-Selector"},{value:He.FUNCTION,label:"Function"}],name:"radio-transform"};function B(e,t){return e[0].transform===He.REGEXP?Ze:e[0].transform===He.SELECTOR?Je:e[0].transform===He.FUNCTION?Ve:void 0}void 0!==e[0].transform&&(z.selected=e[0].transform),k=new Ue({props:z}),J.push((()=>Ee(k,"selected",H)));let G=B(e),q=G&&G(e);return{c(){t=O("h3"),t.textContent="Editor",n=A(),r=O("div"),o=O("label"),s=O("input"),l=D("\n Use TinyMCE, a powerful HTML editor, for editing chapters"),i=A(),c=O("h3"),c.textContent="Next chapter",a=A(),u=O("div"),d=O("p"),d.textContent="Specify how next chapter links are extracted.",p=A(),Se(f.$$.fragment),m=A(),P&&P.c(),g=A(),v=O("h3"),v.textContent="Chapter transform",$=A(),b=O("div"),y=O("p"),y.textContent="Automatically transform chapter contents.",w=A(),Se(k.$$.fragment),T=A(),q&&q.c(),R(s,"type","checkbox"),R(s,"class","svelte-5v9ihf"),R(o,"class","field svelte-5v9ihf")},m(h,E){S(h,t,E),S(h,n,E),S(h,r,E),x(r,o),x(o,s),s.checked=e[0].useTiny,x(o,l),S(h,i,E),S(h,c,E),S(h,a,E),S(h,u,E),x(u,d),x(u,p),Ce(f,u,null),x(u,m),P&&P.m(u,null),S(h,g,E),S(h,v,E),S(h,$,E),S(h,b,E),x(b,y),x(b,w),Ce(k,b,null),x(b,T),q&&q.m(b,null),L=!0,_||(F=N(s,"change",e[4]),_=!0)},p(e,t){1&t&&(s.checked=e[0].useTiny);const n={};!h&&1&t&&(h=!0,n.selected=e[0].nextLink,re((()=>h=!1))),f.$set(n),M===(M=I(e))&&P?P.p(e,t):(P&&P.d(1),P=M&&M(e),P&&(P.c(),P.m(u,null)));const r={};!E&&1&t&&(E=!0,r.selected=e[0].transform,re((()=>E=!1))),k.$set(r),G===(G=B(e))&&q?q.p(e,t):(q&&q.d(1),q=G&&G(e),q&&(q.c(),q.m(b,null)))},i(e){L||(he(f.$$.fragment,e),he(k.$$.fragment,e),L=!0)},o(e){me(f.$$.fragment,e),me(k.$$.fragment,e),L=!1},d(e){e&&C(t),e&&C(n),e&&C(r),e&&C(i),e&&C(c),e&&C(a),e&&C(u),Te(f),P&&P.d(),e&&C(g),e&&C(v),e&&C($),e&&C(b),Te(k),q&&q.d(),_=!1,F()}}}function et(e){let t,n,r,o;return{c(){t=O("span"),n=D("Transform Function invalid: "),r=O("code"),o=D(e[3]),R(t,"class","small error svelte-5v9ihf")},m(e,s){S(e,t,s),x(t,n),x(t,r),x(r,o)},p(e,t){8&t&&U(o,e[3])},d(e){e&&C(t)}}}function tt(e){let t,n,r,o;return{c(){t=O("span"),n=D("Transform Selector invalid: "),r=O("code"),o=D(e[3]),R(t,"class","small error svelte-5v9ihf")},m(e,s){S(e,t,s),x(t,n),x(t,r),x(r,o)},p(e,t){8&t&&U(o,e[3])},d(e){e&&C(t)}}}function nt(e){let t,n,r,o;return{c(){t=O("span"),n=D("Transform Regex invalid: "),r=O("code"),o=D(e[3]),R(t,"class","small error svelte-5v9ihf")},m(e,s){S(e,t,s),x(t,n),x(t,r),x(r,o)},p(e,t){8&t&&U(o,e[3])},d(e){e&&C(t)}}}function rt(e){let t,n,r,o;return{c(){t=O("span"),n=D("Chapter Function invalid: "),r=O("code"),o=D(e[2]),R(t,"class","small error svelte-5v9ihf")},m(e,s){S(e,t,s),x(t,n),x(t,r),x(r,o)},p(e,t){4&t&&U(o,e[2])},d(e){e&&C(t)}}}function ot(e){let t,n,r,o;return{c(){t=O("span"),n=D("Chapter Regex invalid: "),r=O("code"),o=D(e[2]),R(t,"class","small error svelte-5v9ihf")},m(e,s){S(e,t,s),x(t,n),x(t,r),x(r,o)},p(e,t){4&t&&U(o,e[2])},d(e){e&&C(t)}}}function st(e){let t,n,r,o,s,l,i,c,a,u;function d(e,t){return e[1]&&e[0].nextLink===Pe.REGEXP&&e[2]?ot:e[1]&&e[0].nextLink===Pe.FUNCTION&&e[2]?rt:e[1]&&e[0].transform===He.REGEXP&&e[3]?nt:e[1]&&e[0].transform===He.SELECTOR&&e[3]?tt:e[1]&&e[0].transform===He.FUNCTION&&e[3]?et:void 0}n=new _e({props:{$$slots:{default:[Qe]},$$scope:{ctx:e}}});let p=d(e),f=p&&p(e);return{c(){t=O("div"),Se(n.$$.fragment),r=A(),o=O("button"),s=D("Save"),l=A(),f&&f.c(),i=_(),R(t,"class","settings svelte-5v9ihf"),R(o,"type","submit"),o.disabled=e[1]},m(d,p){S(d,t,p),Ce(n,t,null),S(d,r,p),S(d,o,p),x(o,s),S(d,l,p),f&&f.m(d,p),S(d,i,p),c=!0,a||(u=N(o,"click",e[12]),a=!0)},p(e,[t]){const r={};262145&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r),(!c||2&t)&&(o.disabled=e[1]),p===(p=d(e))&&f?f.p(e,t):(f&&f.d(1),f=p&&p(e),f&&(f.c(),f.m(i.parentNode,i)))},i(e){c||(he(n.$$.fragment,e),c=!0)},o(e){me(n.$$.fragment,e),c=!1},d(e){e&&C(t),Te(n),e&&C(r),e&&C(o),e&&C(l),f&&f.d(e),e&&C(i),a=!1,u()}}}function lt(e,t,n){let r;a(e,Be,(e=>n(13,r=e)));const o=Object.assign({},r),s=Object.assign({},r),l=(e,t)=>{if(!e.trim().length)return{error:"Must specify a regular expression",disableSave:!0};try{return new RegExp(e,"i"),{error:void 0,disableSave:t}}catch(e){return{error:e,disableSave:!0}}},i=(e,t)=>{if(!e.trim().length)return{error:"Must specify a function",disableSave:!0};try{return Ge(e),{error:void 0,disableSave:t}}catch(e){return{error:e,disableSave:!0}}};let c,u,d=!1;return X((()=>n(1,d=!0))),e.$$.update=()=>{1&e.$$.dirty&&n(1,d=o.nextLink===s.nextLink&&o.nextLinkRegex===s.nextLinkRegex&&o.nextLinkFn===s.nextLinkFn&&o.transform===s.transform&&o.transformRegex===s.transformRegex&&o.transformSelector===s.transformSelector&&o.transformFn===s.transformFn&&o.useTiny===s.useTiny),3&e.$$.dirty&&o.nextLink===Pe.REGEXP&&n(1,({disableSave:d,error:c}=l(o.nextLinkRegex,d)),d,(n(2,c),n(0,o),n(1,d))),3&e.$$.dirty&&o.nextLink===Pe.FUNCTION&&n(1,({disableSave:d,error:c}=i(o.nextLinkFn,d)),d,(n(2,c),n(0,o),n(1,d))),3&e.$$.dirty&&o.transform===He.REGEXP&&n(1,({disableSave:d,error:u}=l(o.transformRegex,d)),d,(n(3,u),n(0,o),n(1,d))),3&e.$$.dirty&&o.transform===He.SELECTOR&&n(1,({disableSave:d,error:u}=((e,t)=>{if(!e.trim().length)return{error:"Must specify a selector",disableSave:!0};try{return document.querySelector(e),{error:void 0,disableSave:t}}catch(e){return{error:e,disableSave:!0}}})(o.transformSelector,d)),d,(n(3,u),n(0,o),n(1,d))),3&e.$$.dirty&&o.transform===He.FUNCTION&&n(1,({disableSave:d,error:u}=i(o.transformFn,d)),d,(n(3,u),n(0,o),n(1,d)))},[o,d,c,u,function(){o.useTiny=this.checked,n(0,o)},function(t){e.$$.not_equal(o.nextLink,t)&&(o.nextLink=t,n(0,o))},function(){o.nextLinkRegex=this.value,n(0,o)},function(){o.nextLinkFn=this.value,n(0,o)},function(t){e.$$.not_equal(o.transform,t)&&(o.transform=t,n(0,o))},function(){o.transformRegex=this.value,n(0,o)},function(){o.transformSelector=this.value,n(0,o)},function(){o.transformFn=this.value,n(0,o)},()=>{Be.set(o),n(1,d=!0)}]}const it=class extends Le{constructor(e){super(),Oe(this,e,lt,st,l,{})}};var ct=i(4785),at=i.n(ct);function ut(e){let t,n,r;return{c(){t=O("a"),t.textContent="Back to Search",R(t,"href","#search"),R(t,"class","small")},m(o,l){S(o,t,l),n||(r=N(t,"click",F((function(){s(e[0])&&e[0].apply(this,arguments)}))),n=!0)},p(t,n){e=t},d(e){e&&C(t),n=!1,r()}}}function dt(t){let n,r=t[0]&&ut(t);return{c(){r&&r.c(),n=_()},m(e,t){r&&r.m(e,t),S(e,n,t)},p(e,[t]){e[0]?r?r.p(e,t):(r=ut(e),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(e){r&&r.d(e),e&&C(n)}}}function pt(e,t,n){let{backToSearch:r}=t;return e.$$set=e=>{"backToSearch"in e&&n(0,r=e.backToSearch)},[r]}const ft=class extends Le{constructor(e){super(),Oe(this,e,pt,dt,l,{backToSearch:0})}};function ht(e,t,n){const r=e.slice();return r[4]=t[n],r}function mt(t){let n,r,o,s,l=t[4]?": ":"",i=(t[4].message||t[4])+"";return{c(){n=O("span"),r=D("Sorry, can't process that"),o=D(l),s=D(i),R(n,"class","error svelte-m4i2yw")},m(e,t){S(e,n,t),x(n,r),x(n,o),x(n,s)},p:e,d(e){e&&C(n)}}}function gt(e){let t,n,r;return{c(){t=O("button"),t.textContent="Retry"},m(o,l){S(o,t,l),n||(r=N(t,"click",(function(){s(e[0])&&e[0].apply(this,arguments)})),n=!0)},p(t,n){e=t},d(e){e&&C(t),n=!1,r()}}}function vt(e){let t,n,r;return{c(){t=O("a"),t.textContent="back",R(t,"href","#back")},m(o,l){S(o,t,l),n||(r=N(t,"click",F((function(){s(e[1])&&e[1].apply(this,arguments)}))),n=!0)},p(t,n){e=t},d(e){e&&C(t),n=!1,r()}}}function $t(t){let n,r,o,s,l=t[2],i=[];for(let e=0;e{"error"in e&&n(3,r=e.error),"retry"in e&&n(0,o=e.retry),"back"in e&&n(1,s=e.back)},[o,s,l,r]}const yt=class extends Le{constructor(e){super(),Oe(this,e,bt,$t,l,{error:3,retry:0,back:1})}};function wt(e){let t,n,r,o,s;const l=e[1].default,i=u(l,e,e[0],null),c=i||function(e){let t;return{c(){t=D("Loading...")},m(e,n){S(e,t,n)},d(e){e&&C(t)}}}();return{c(){t=O("div"),n=O("div"),n.innerHTML='',r=A(),o=O("p"),c&&c.c(),R(n,"class","loading-slider-container svelte-w1n7v1"),R(o,"class","loading svelte-w1n7v1"),R(t,"class","loading-container svelte-w1n7v1")},m(e,l){S(e,t,l),x(t,n),x(t,r),x(t,o),c&&c.m(o,null),s=!0},p(e,[t]){i&&i.p&&(!s||1&t)&&f(i,l,e,e[0],s?p(l,e[0],t,null):h(e[0]),null)},i(e){s||(he(c,e),s=!0)},o(e){me(c,e),s=!1},d(e){e&&C(t),c&&c.d(e)}}}function xt(e,t,n){let{$$slots:r={},$$scope:o}=t;return e.$$set=e=>{"$$scope"in e&&n(0,o=e.$$scope)},[o,r]}const kt=class extends Le{constructor(e){super(),Oe(this,e,xt,wt,l,{})}};let Et=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),"");const St=async(e,t)=>{const n="undefined"!=typeof AbortController?new AbortController:{},r=setTimeout((()=>n.abort&&n.abort()),t);try{return await fetch(e,{signal:n.signal})}finally{clearTimeout(r)}},Ct=async(e,t=1e4,n=3)=>{for(let r=0;r{const o=new URL(e,t);for(let e=0;e(e instanceof URL||(e=new URL(e)),e.hostname="www.reddit.com",e.pathname.endsWith("/")?e.pathname=`${e.pathname.slice(0,e.pathname.length-1)}.json`:e.pathname.endsWith(".json")||(e.pathname+=".json"),e.protocol="https",e.search="",e.hash="",e.toString()),Dt=e=>{const t=new URL(e);return("reddit.com"===t.host||t.host.match(/\.reddit\.com$/))&&e.match(".json$")?e.slice(0,-5).replace("https://api","https://www"):e},At=(()=>{const e=new DOMParser;return t=>e.parseFromString(t,"text/html").documentElement.textContent})(),_t=(()=>{const e=new DOMParser;return t=>e.parseFromString(t,"text/html")})();function Nt(e){return"string"==typeof e||e instanceof String}function Ft(e,{delay:t=0,duration:n=200,prop:r="height",easing:o=Ot}={}){const s=getComputedStyle(e)[r];if(!Nt(s)||!s.endsWith("px"))throw new Error(`invalid property '${r}' does not return pixels`);const l=+s.slice(0,-2);return{delay:t,duration:n,easing:o,css:e=>`overflow: hidden; ${r}: ${e*l}px`}}const jt=/(?:https?:\/\/(?:[^.]+\.)?reddit\.com)?\/r\/([^\/]+)\/comments\/.+/i,Rt=/href="((?:https?:\/\/(?:[^.]+\.)?reddit\.com)?\/r\/([^\/]+)\/comments\/[^"]+)"[^>]*>\s*([^<]+)/gim,Ut=/href="([^"]+)"[^>]*>\s*(.+)<\/a>/gim,It=/^https?:\/\/(?:[^.]+\.)?reddit\.com\/r\/hfy\/wiki\/series\//i,Mt=async e=>{const t=await Ct(new URL("https://www.reddit.com/r/hfy/wiki/series.json")),n=await t.json();if(!t.ok)throw n.message;const r=[...n.data.content_md.matchAll(/\[([^\]]+)\]\s*\(((?:https?:\/\/(?:[^.]+\.)?reddit\.com)?\/r\/hfy\/wiki\/series\/[^)]+)\)\s*(?:\[\*([^\]]+)\*\])?/gim)].map((e=>({title:e[1],author:e[3],url:Lt(e[2].startsWith("http")?e[2]:`https://www.reddit.com${e[2]}`)})));if(!e)return r;const o=e.toLowerCase();return r.filter((e=>-1!==e.title.toLowerCase().indexOf(o)))},Pt=/^https?:\/\/(?:[^.]+\.)?reddit\.com\/r\/([^/]+)\/comments\//i,Ht=e=>({id:e[0].data.children[0].data.id,title:e[0].data.children[0].data.title,content:At(e[0].data.children[0].data.selftext_html),apiUrl:Lt(e[0].data.children[0].data.url),displayUrl:e[0].data.children[0].data.url,needsFetching:!1});var zt;!function(e){e[e.HFY_SERIES=0]="HFY_SERIES",e[e.POST=1]="POST",e[e.GENERIC=2]="GENERIC",e[e.SEARCH=3]="SEARCH"}(zt||(zt={}));const Bt=new DOMParser,Gt=(e,t)=>e===zt.GENERIC?t:Lt(t),qt=(e,t)=>e.type===zt.GENERIC?t.text():t.json(),Wt=(e,t,n)=>{switch(e){case zt.POST:case zt.HFY_SERIES:return Ht(t);case zt.GENERIC:return((e,t)=>{const n=_t(e);return{id:Et(),apiUrl:t,displayUrl:t,title:n.title,content:n.body.innerHTML,needsFetching:!1}})(t,n)}throw new Error(`Getting data from source type \`${zt[e]}\` not supported, this should never happen`)};let Xt,Yt;const Kt=(e,t)=>{switch(e.nextLink){case Pe.DEFAULT:return(e=>{const t=e.match(/href="([^"]+)"[^>]*>\s*Next/i);if(t)return t[1];const n=[...e.matchAll(Rt)].reverse().find((e=>{const t=e[3].toLowerCase();return!t.startsWith("first")&&!t.startsWith("prev")&&!t.startsWith("index")}));if(n)return n[1];const r=[...e.matchAll(Ut)],o=r.find((e=>-1!==e[2].toLowerCase().indexOf("next")));if(o)return o[1];const s=r.reverse().find((e=>{const t=e[2].toLowerCase();return!t.startsWith("first")&&!t.startsWith("prev")&&!t.startsWith("index")}));return s?s[1]:void 0})(t);case Pe.REGEXP:return(e=>{const t=e.match(Xt);if(t&&t.length>1)return t[1]})(t);case Pe.FUNCTION:return(e=>{let t;return Yt({document:{get:()=>t=null!=t?t:Bt.parseFromString(e,"text/html"),configurable:!0},html:{writable:!1,value:e,configurable:!0}}).ret})(t)}};let Vt;const Jt=e=>{const t=e.match(Vt);return t&&t.length>1&&(e=t[1]),e};let Zt;const Qt=(e,t)=>{switch(e.transform){case He.NONE:return Object.assign(Object.assign({},t),{transformedContent:t.content});case He.REGEXP:return Object.assign(Object.assign({},t),{transformedContent:Jt(t.content||"")});case He.SELECTOR:return Object.assign(Object.assign({},t),{transformedContent:(n=e.transformSelector,r=t.content||"",null===(o=Bt.parseFromString(r,"text/html").querySelector(n))||void 0===o?void 0:o.innerHTML)});case He.FUNCTION:return(e=>{let t;const n={document:{get:()=>t=null!=t?t:Bt.parseFromString(e.content||"","text/html"),configurable:!0},title:{writable:!0,value:e.title,configurable:!0},html:{writable:!0,value:e.content,configurable:!0},url:{writable:!0,value:e.displayUrl,configurable:!0}},{proxy:r}=Zt(n);return Object.assign(Object.assign({},e),{title:Nt(r.title)?r.title:e.title,transformedContent:Nt(r.html)?r.html:e.content,displayUrl:Nt(r.url)?r.url:e.displayUrl})})(t)}var n,r,o},en=(e,t)=>t.map(Qt.bind(null,e));var tn;Be.subscribe((e=>{Xt=new RegExp(e.nextLinkRegex,"i"),Yt=Ge(e.nextLinkFn),Vt=new RegExp(e.transformRegex,"i"),Zt=Ge(e.transformFn)})),function(e){e[e.INPUT=0]="INPUT",e[e.SEARCH=1]="SEARCH",e[e.BOOK_DATA=2]="BOOK_DATA",e[e.EDIT_DATA=3]="EDIT_DATA",e[e.FIND_CHAPTERS=4]="FIND_CHAPTERS",e[e.DOWNLOAD_CHAPTERS=5]="DOWNLOAD_CHAPTERS",e[e.RESULT=6]="RESULT",e[e.SETTINGS=7]="SETTINGS",e[e._404=8]="_404"}(tn||(tn={}));const nn=e=>e===tn.INPUT?i.p:`${i.p}${tn[e].toLowerCase().replace(/_/g,"-")}`;class rn{dump(){return[]}}class on extends rn{constructor(){super(...arguments),this.stage=tn.INPUT}next(e){const t=(e=>{try{return new URL(e),(e=>!!e.match(It))(e)?zt.HFY_SERIES:(e=>!!e.match(Pt))(e)?zt.POST:zt.GENERIC}catch(e){}return zt.SEARCH})(e);return console.debug("Input",e,"resulted in type",t),$n.update((n=>Object.assign(Object.assign({},n),{search:e,series:t!==zt.SEARCH?{url:Gt(t,e),type:t}:n.series}))),bn.update((()=>{})),t===zt.SEARCH?hn(sn):hn(ln)}fromList(e){const t=e.split("\n");return $n.update((e=>Object.assign(Object.assign({},e),{series:{url:t[0],type:zt.GENERIC}}))),bn.update((()=>({author:"unknown",title:"unknown",chapters:t.map(((e,t)=>({apiUrl:e,id:Et(),title:`Chapter ${t}`,displayUrl:e})))}))),hn(ln)}fromJSON({series:e,bookData:t}){return $n.update((t=>Object.assign(Object.assign({},t),{series:e}))),bn.update((()=>t)),hn(ln)}}class sn extends rn{constructor(){super(...arguments),this.stage=tn.SEARCH}next(e){return $n.update((t=>Object.assign(Object.assign({},t),{series:e}))),bn.update((()=>{})),hn(ln)}}class ln extends rn{constructor(e){super(),this.newChapters=e,this.stage=tn.BOOK_DATA}next(){return hn(dn)}edit(){return hn(cn)}findMore(){return hn(an)}downloadAll(){return hn(un)}dump(){return[this.newChapters]}}class cn extends rn{constructor(){super(...arguments),this.stage=tn.EDIT_DATA,this.needsSaving=!0}next(e){return bn.update((()=>e)),hn(ln)}}class an extends rn{constructor(){super(...arguments),this.stage=tn.FIND_CHAPTERS,this.needsSaving=!0}next(e,t){return bn.update((()=>e)),hn(ln,t)}}class un extends rn{constructor(){super(...arguments),this.stage=tn.DOWNLOAD_CHAPTERS,this.needsSaving=!0}next(e){return bn.update((()=>e)),hn(ln)}}class dn extends rn{constructor(){super(...arguments),this.stage=tn.RESULT}next(){return hn(ln)}}class pn extends rn{constructor(){super(...arguments),this.stage=tn.SETTINGS}next(){return gn()}}const fn={[tn.INPUT]:on,[tn.SEARCH]:sn,[tn.BOOK_DATA]:ln,[tn.EDIT_DATA]:cn,[tn.FIND_CHAPTERS]:an,[tn.DOWNLOAD_CHAPTERS]:un,[tn.RESULT]:dn,[tn.SETTINGS]:pn,[tn._404]:class extends rn{constructor(){super(...arguments),this.stage=tn._404}next(){return gn()}}};function hn(e,...t){$n.update((n=>{const r=new e(...t);r.from=n.stage;const o=r.dump();try{r.stage===tn.SETTINGS?history.pushState({data:o,search:n.search,series:n.series},"",nn(r.stage)):history.replaceState({data:o,search:n.search,series:n.series},"",nn(r.stage))}catch(e){console.error("Data too large! Caution, forwards/backwards won't work as expected!"),o.length>0&&(o[0]=void 0),r.stage===tn.SETTINGS?history.pushState({data:o,search:n.search,series:n.series},"",nn(r.stage)):history.replaceState({data:o,search:n.search,series:n.series},"",nn(r.stage))}return Object.assign(Object.assign({},n),{stage:r,lastBookData:e.usesBookData?r.bookData:n.lastBookData})}))}function mn(e,{data:t,search:n,series:r}={}){t=t||[],$n.update((o=>{try{const s=new fn[e](...t);return s.stage===o.stage.stage?o:(s.from=o.stage,Object.assign(Object.assign({},o),{search:n,series:r,stage:s}))}catch(r){return console.group("Failed to update page"),console.error(r),console.log("Parameters:",e,t,n),console.groupEnd(),history.pushState({data:[],search:o.search,series:o.series},"","/"),o}}))}function gn(){history.back()}function vn(e,t){return!!e&&e.stage===t}const $n=Me({stage:new on}),bn=Me(void 0),yn=new RegExp("^"+i.p.replace("/","/")),wn=()=>{const e=location.pathname.replace(yn,"").split("/")[0]||"";if(e.length>60)return;if(""===e)return mn(tn.INPUT);const t=e.toUpperCase().replace(/-/g,"_"),n=(()=>{try{return JSON.parse(localStorage.getItem("state"))}catch(e){return}})(),r=Object.assign(Object.assign({},n),history.state||{});return t in tn?mn(tn[t],r):mn(tn._404)};function xn(e,t,n){const r=e.slice();return r[9]=t[n][0],r[10]=t[n][1],r}function kn(e,t,n){const r=e.slice();return r[9]=t[n][0],r[10]=t[n][1],r}function En(e){let t,n,r,o,l,i,c,a;return t=new yt({props:{error:e[16],retry:e[7]}}),l=new ft({props:{backToSearch:e[1]}}),{c(){Se(t.$$.fragment),n=A(),r=O("button"),r.textContent="Back to book",o=A(),Se(l.$$.fragment)},m(u,d){Ce(t,u,d),S(u,n,d),S(u,r,d),S(u,o,d),Ce(l,u,d),i=!0,c||(a=N(r,"click",(function(){s(e[0].next.bind(e[0]))&&e[0].next.bind(e[0]).apply(this,arguments)})),c=!0)},p(n,r){e=n;const o={};8&r&&(o.error=e[16]),8&r&&(o.retry=e[7]),t.$set(o);const s={};2&r&&(s.backToSearch=e[1]),l.$set(s)},i(e){i||(he(t.$$.fragment,e),he(l.$$.fragment,e),i=!0)},o(e){me(t.$$.fragment,e),me(l.$$.fragment,e),i=!1},d(e){Te(t,e),e&&C(n),e&&C(r),e&&C(o),Te(l,e),c=!1,a()}}}function Sn(e){let t,n,r,l,i,c,a,u,d,p,f,h,m=e[2].find(Nn);function g(){return e[6](e[13])}a=new ft({props:{backToSearch:e[1]}});let v=m&&Cn(e);return{c(){t=O("h3"),t.textContent="Your e-book is ready!",n=A(),r=O("button"),r.textContent="Download",l=A(),i=O("button"),i.textContent="Back to book",c=A(),Se(a.$$.fragment),u=A(),v&&v.c(),d=_(),R(t,"class","valid svelte-ardw9p")},m(o,m){S(o,t,m),S(o,n,m),S(o,r,m),S(o,l,m),S(o,i,m),S(o,c,m),Ce(a,o,m),S(o,u,m),v&&v.m(o,m),S(o,d,m),p=!0,f||(h=[N(r,"click",g),N(i,"click",(function(){s(e[0].next.bind(e[0]))&&e[0].next.bind(e[0]).apply(this,arguments)}))],f=!0)},p(t,n){e=t;const r={};2&n&&(r.backToSearch=e[1]),a.$set(r),4&n&&(m=e[2].find(Nn)),m?v?v.p(e,n):(v=Cn(e),v.c(),v.m(d.parentNode,d)):v&&(v.d(1),v=null)},i(e){p||(he(a.$$.fragment,e),p=!0)},o(e){me(a.$$.fragment,e),p=!1},d(e){e&&C(t),e&&C(n),e&&C(r),e&&C(l),e&&C(i),e&&C(c),Te(a,e),e&&C(u),v&&v.d(e),e&&C(d),f=!1,o(h)}}}function Cn(e){let t,n=e[2],r=[];for(let t=0;tt.parentNode,o.anchor=t,r=!0},p(t,[r]){e=t,o.ctx=e,8&r&&n!==(n=e[3])&&$e(n,o)||be(o,e,r)},i(e){r||(he(o.block),r=!0)},o(e){for(let e=0;e<3;e+=1)me(o.blocks[e]);r=!1},d(e){e&&C(t),o.block.d(e),o.token=null,o=null}}}const Nn=([e])=>"warn"===e;function Fn(e,t,n){let r;a(e,bn,(e=>n(4,r=e)));let{stage:o}=t,{backToSearch:s}=t;const l=Promise.all([i.e(845),i.e(483)]).then(i.t.bind(i,9845,23));let c=[];const u=async()=>{n(2,c=[]);const{default:e}=await l;return await e({title:At(r.title),author:At(r.author),ignoreFailedDownloads:!0,verbose:(e,t,...r)=>{c.push([e,t]),n(2,c)}},r.chapters.map((e=>({title:At(e.title),content:e.transformedContent,url:e.displayUrl}))))};let d=u();return e.$$set=e=>{"stage"in e&&n(0,o=e.stage),"backToSearch"in e&&n(1,s=e.backToSearch)},[o,s,c,d,r,u,e=>at()(e,`${At(r.author)} - ${At(r.title)}.epub`,"application/epub+zip"),()=>n(3,d=u())]}const jn=class extends Le{constructor(e){super(),Oe(this,e,Fn,_n,l,{stage:0,backToSearch:1})}};function Rn(e,t,n){const r=e.slice();return r[12]=t[n],r}function Un(e,t,n){const r=e.slice();return r[12]=t[n],r}function In(t){return{c:e,m:e,p:e,i:e,o:e,d:e}}function Mn(e){let t,n,r,o,s,l=!e[3].length&&Pn(e),i=e[1],c=[];for(let t=0;t{a=null})),fe())},i(e){s||(he(a),s=!0)},o(e){me(a),s=!1},d(e){l&&l.d(e),e&&C(t),e&&C(n),T(c,e),e&&C(r),a&&a.d(e),e&&C(o)}}}function Pn(e){let t,n=e[0].next(e[15])+"";return{c(){t=D(n)},m(e,n){S(e,t,n)},p(e,r){17&r&&n!==(n=e[0].next(e[15])+"")&&U(t,n)},d(e){e&&C(t)}}}function Hn(e){let t,n,r=e[12].title+"";return{c(){t=O("p"),n=D(r),R(t,"class","valid small svelte-1rrnlr6")},m(e,r){S(e,t,r),x(t,n)},p(e,t){2&t&&r!==(r=e[12].title+"")&&U(n,r)},d(e){e&&C(t)}}}function zn(e){let t,n=e[12]&&!0===e[12].new&&Hn(e);return{c(){n&&n.c(),t=_()},m(e,r){n&&n.m(e,r),S(e,t,r)},p(e,r){e[12]&&!0===e[12].new?n?n.p(e,r):(n=Hn(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&C(t)}}}function Bn(t){let n,r,o=t[3],s=Gn(t);return{c(){s.c(),n=_()},m(e,t){s.m(e,t),S(e,n,t),r=!0},p(t,r){8&r&&l(o,o=t[3])?(pe(),me(s,1,1,e),fe(),s=Gn(t),s.c(),he(s,1),s.m(n.parentNode,n)):s.p(t,r)},i(e){r||(he(s),r=!0)},o(e){me(s),r=!1},d(e){e&&C(n),s.d(e)}}}function Gn(e){let t,n;return t=new yt({props:{error:e[3],retry:e[8],back:e[9]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.error=e[3]),16&n&&(r.retry=e[8]),35&n&&(r.back=e[9]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function qn(e){let t,n,r,o,s,l,i,c,a,u,d;t=new kt({props:{$$slots:{default:[Wn]},$$scope:{ctx:e}}});let p=e[1],f=[];for(let t=0;t{h=null})),fe())},i(e){a||(he(t.$$.fragment,e),he(h),a=!0)},o(e){me(t.$$.fragment,e),me(h),a=!1},d(e){Te(t,e),e&&C(n),e&&C(r),e&&C(s),e&&C(l),T(f,e),e&&C(i),h&&h.d(e),e&&C(c),u=!1,d()}}}function Wn(e){let t;return{c(){t=D("Please wait, fetching chapters...")},m(e,n){S(e,t,n)},d(e){e&&C(t)}}}function Xn(e){let t,n,r=e[12].title+"";return{c(){t=O("p"),n=D(r),R(t,"class","valid small svelte-1rrnlr6")},m(e,r){S(e,t,r),x(t,n)},p(e,t){2&t&&r!==(r=e[12].title+"")&&U(n,r)},d(e){e&&C(t)}}}function Yn(e){let t,n=e[12]&&!0===e[12].new&&Xn(e);return{c(){n&&n.c(),t=_()},m(e,r){n&&n.m(e,r),S(e,t,r)},p(e,r){e[12]&&!0===e[12].new?n?n.p(e,r):(n=Xn(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&C(t)}}}function Kn(t){let n,r,o=t[3],s=Vn(t);return{c(){s.c(),n=_()},m(e,t){s.m(e,t),S(e,n,t),r=!0},p(t,r){8&r&&l(o,o=t[3])?(pe(),me(s,1,1,e),fe(),s=Vn(t),s.c(),he(s,1),s.m(n.parentNode,n)):s.p(t,r)},i(e){r||(he(s),r=!0)},o(e){me(s),r=!1},d(e){e&&C(n),s.d(e)}}}function Vn(e){let t,n;return t=new yt({props:{error:e[3]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.error=e[3]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function Jn(e){let t,n,r,o={ctx:e,current:null,token:null,hasCatch:!1,pending:qn,then:Mn,catch:In,value:15,blocks:[,,,]};return $e(n=e[4],o),{c(){t=_(),o.block.c()},m(e,n){S(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,r=!0},p(t,[r]){e=t,o.ctx=e,16&r&&n!==(n=e[4])&&$e(n,o)||be(o,e,r)},i(e){r||(he(o.block),r=!0)},o(e){for(let e=0;e<3;e+=1)me(o.blocks[e]);r=!1},d(e){e&&C(t),o.block.d(e),o.token=null,o=null}}}function Zn(e,t,n){let r,o,s;a(e,bn,(e=>n(5,r=e))),a(e,$n,(e=>n(10,o=e))),a(e,Be,(e=>n(11,s=e)));let{stage:l}=t,i=[...r.chapters.map((e=>Object.assign(Object.assign({},e),{new:!1})))],c=!1,u=[];const d=async()=>{let e,t=i;for(n(1,i=new Array(i.length)),n(3,u=[]),e=0;e{var c,a;if(n(1,i[l+e]=Object.assign({},t[l+e]),i),!1!==r.needsFetching)try{const t=await Tt(r.apiUrl,new URL(o.series.url).origin),u=await qt(o.series,t);if(!t.ok)throw""+(null!==(a=null!==(c=u.message)&&void 0!==c?c:t.statusText)&&void 0!==a?a:t.status);n(1,i[l+e]=Object.assign(Object.assign({},Qt(s,Wt(o.series.type,u,r.apiUrl))),{new:!0}),i),n(1,i)}catch(e){u.push(e),n(3,u)}})));for(;e{"stage"in e&&n(0,l=e.stage)},[l,i,c,u,p,r,d,()=>n(2,c=!0),()=>n(4,p=d()),()=>l.next({...r,chapters:i})]}const Qn=class extends Le{constructor(e){super(),Oe(this,e,Zn,Jn,l,{stage:0})}};function er(e,t,n){const r=e.slice();return r[15]=t[n],r}function tr(e){let t,n;return t=new yt({props:{error:e[19],retry:e[10],back:e[11]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};16&n&&(r.error=e[19]),16&n&&(r.retry=e[10]),71&n&&(r.back=e[11]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function nr(t){let n,r=t[0].next(t[18],t[1].length)+"";return{c(){n=D(r)},m(e,t){S(e,n,t)},p(e,t){19&t&&r!==(r=e[0].next(e[18],e[1].length)+"")&&U(n,r)},i:e,o:e,d(e){e&&C(n)}}}function rr(e){let t,n,r,l,i,c,a,u,d,p;t=new kt({props:{$$slots:{default:[or]},$$scope:{ctx:e}}});let f=e[1],h=[];for(let t=0;tt.parentNode,o.anchor=t,r=!0},p(t,[r]){e=t,o.ctx=e,16&r&&n!==(n=e[4])&&$e(n,o)||be(o,e,r)},i(e){r||(he(o.block),r=!0)},o(e){for(let e=0;e<3;e+=1)me(o.blocks[e]);r=!1},d(e){e&&C(t),o.block.d(e),o.token=null,o=null}}}function ir(e,t,n){let r,o,s;a(e,bn,(e=>n(6,r=e))),a(e,$n,(e=>n(12,o=e))),a(e,Be,(e=>n(13,s=e)));let l,{stage:i}=t,c=[],u=!1;const d=async()=>{var e,t,i,a,d;for(n(2,l=r.chapters.map((e=>Object.assign({},e))));!u;){let r=l[l.length-1];if(!1!==r.needsFetching){const n=await Tt(r.apiUrl,new URL(o.series.url).origin),i=await qt(o.series,n);if(!n.ok)throw""+(null!==(t=null!==(e=i.message)&&void 0!==e?e:n.statusText)&&void 0!==t?t:n.status);l.splice(-1,1,r=Qt(s,Wt(o.series.type,i,r.apiUrl)))}let u=Kt(s,null!==(i=r.transformedContent)&&void 0!==i?i:"");if(u||(u=Kt(s,r.content)),!u)break;const p=Gt(o.series.type,u);if(l.find((e=>e.apiUrl===p)))break;c.push({from:r.title,url:u}),n(1,c);const f=await Tt(p,new URL(o.series.url).origin),h=await qt(o.series,f);if(!f.ok)throw""+(null!==(d=null!==(a=h.message)&&void 0!==a?a:f.statusText)&&void 0!==d?d:f.status);l.push(Qt(s,Wt(o.series.type,h,p)))}return Object.assign(Object.assign({},r),{chapters:l})};let p=d(),f=!0;function h(){const e=document.documentElement.scrollHeight-document.documentElement.scrollTop;n(5,f=Math.abs(document.documentElement.clientHeight-e)<1)}return window.addEventListener("scroll",h),Y((()=>{window.removeEventListener("scroll",h)})),e.$$set=e=>{"stage"in e&&n(0,i=e.stage)},[i,c,l,u,p,f,r,d,(e,t)=>({update:({scroll:e})=>{e&&document.querySelector("footer").scrollIntoView()}}),()=>n(3,u=!0),()=>n(4,p=d()),()=>i.next({...r,chapters:l},c.length)]}const cr=class extends Le{constructor(e){super(),Oe(this,e,ir,lr,l,{stage:0})}};function ar(e,t,n){e.dispatchEvent(new CustomEvent("finalize",{detail:{items:t,info:n}}))}function ur(e,t,n){e.dispatchEvent(new CustomEvent("consider",{detail:{items:t,info:n}}))}const dr="draggedEntered",pr="draggedLeft",fr="draggedOverIndex",hr="draggedLeftDocument",mr="leftForAnother",gr="outsideOfAny";function vr(e,t,n){e.dispatchEvent(new CustomEvent(dr,{detail:{indexObj:t,draggedEl:n}}))}function $r(e,t,n){e.dispatchEvent(new CustomEvent(pr,{detail:{draggedEl:t,type:mr,theOtherDz:n}}))}function br(e,t,n){e.dispatchEvent(new CustomEvent(fr,{detail:{indexObj:t,draggedEl:n}}))}const yr="dragStarted",wr="droppedIntoZone",xr="droppedIntoAnother",kr="pointer",Er="keyboard",Sr="data-is-dnd-shadow-item",Cr="id:dnd-shadow-placeholder-0000";let Tr="id",Or=0;function Lr(){Or++}function Dr(){if(0===Or)throw new Error("Bug! trying to decrement when there are no dropzones");Or--}const Ar="undefined"==typeof window;let _r;function Nr(e){let t;const n=e.getBoundingClientRect(),r=getComputedStyle(e),o=r.transform;if(o){let s,l,i,c;if(o.startsWith("matrix3d("))t=o.slice(9,-1).split(/, /),s=+t[0],l=+t[5],i=+t[12],c=+t[13];else{if(!o.startsWith("matrix("))return n;t=o.slice(7,-1).split(/, /),s=+t[0],l=+t[3],i=+t[4],c=+t[5]}const a=r.transformOrigin,u=n.x-i-(1-s)*parseFloat(a),d=n.y-c-(1-l)*parseFloat(a.slice(a.indexOf(" ")+1)),p=s?n.width/s:e.offsetWidth,f=l?n.height/l:e.offsetHeight;return{x:u,y:d,width:p,height:f,top:d,right:u+p,bottom:d+f,left:u}}return n}function Fr(e){const t=Nr(e);return{top:t.top+window.scrollY,bottom:t.bottom+window.scrollY,left:t.left+window.scrollX,right:t.right+window.scrollX}}function jr(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,bottom:t.bottom+window.scrollY,left:t.left+window.scrollX,right:t.right+window.scrollX}}function Rr(e){return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Ur(e,t){return e.y<=t.bottom&&e.y>=t.top&&e.x>=t.left&&e.x<=t.right}function Ir(e){return Rr(jr(e))}function Mr(e,t){return Ur(Ir(e),Fr(t))}function Pr(){_r=new Map}function Hr(e){_r.delete(e)}function zr(e,t){if(!Mr(e,t))return null;const n=t.children;if(0===n.length)return{index:0,isProximityBased:!0};const r=function(e){const t=Array.from(e.children).findIndex((e=>e.getAttribute(Sr)));if(t>=0)return _r.has(e)||_r.set(e,new Map),_r.get(e).set(t,Fr(e.children[t])),t}(t);for(let o=0;on(t))))}function r(e){return 25-e}return t(),{scrollIfNeeded:function(o,s){if(!s)return!1;const l=function(e,t){const n=jr(t);return Ur(e,n)?{top:e.y-n.top,bottom:n.bottom-e.y,left:e.x-n.left,right:Math.min(n.right,document.documentElement.clientWidth)-e.x}:null}(o,s);if(null===l)return t(),!1;const i=!!e.directionObj;let[c,a]=[!1,!1];return s.scrollHeight>s.clientHeight&&(l.bottom<25?(c=!0,e.directionObj={x:0,y:1},e.stepPx=r(l.bottom)):l.top<25&&(c=!0,e.directionObj={x:0,y:-1},e.stepPx=r(l.top)),!i&&c)||s.scrollWidth>s.clientWidth&&(l.right<25?(a=!0,e.directionObj={x:1,y:0},e.stepPx=r(l.right)):l.left<25&&(a=!0,e.directionObj={x:-1,y:0},e.stepPx=r(l.left)),!i&&a)?(n(s),!0):(t(),!1)},resetScrolling:t}}function Gr(e){return JSON.stringify(e,null,2)}function qr(e){if(!e)throw new Error("cannot get depth of a falsy node");return Wr(e,0)}function Wr(e,t=0){return e.parentElement?Wr(e.parentElement,t+1):t-1}Pr();const{scrollIfNeeded:Xr,resetScrolling:Yr}=Br();let Kr,Vr;function Jr(e){const t=e.touches?e.touches[0]:e;Vr={x:t.clientX,y:t.clientY}}const{scrollIfNeeded:Zr,resetScrolling:Qr}=Br();let eo;function to(){Vr&&Zr(Vr,document.documentElement)&&Pr(),eo=window.setTimeout(to,300)}function no(e){return`${e} 0.2s ease`}function ro(e,t,n,r,o){const s=t.getBoundingClientRect(),l=e.getBoundingClientRect(),i=s.width-l.width,c=s.height-l.height;if(i||c){const t={left:(n-l.left)/l.width,top:(r-l.top)/l.height};e.style.height=`${s.height}px`,e.style.width=`${s.width}px`,e.style.left=parseFloat(e.style.left)-t.left*i+"px",e.style.top=parseFloat(e.style.top)-t.top*c+"px"}oo(t,e),o()}function oo(e,t){const n=window.getComputedStyle(e);Array.from(n).filter((e=>e.startsWith("background")||e.startsWith("padding")||e.startsWith("font")||e.startsWith("text")||e.startsWith("align")||e.startsWith("justify")||e.startsWith("display")||e.startsWith("flex")||e.startsWith("border")||"opacity"===e||"color"===e||"list-style-type"===e)).forEach((e=>t.style.setProperty(e,n.getPropertyValue(e),n.getPropertyPriority(e))))}function so(e,t){e.draggable=!1,e.ondragstart=()=>!1,t?(e.style.userSelect="",e.style.WebkitUserSelect="",e.style.cursor=""):(e.style.userSelect="none",e.style.WebkitUserSelect="none",e.style.cursor="grab")}function lo(e){e.style.display="none",e.style.position="fixed",e.style.zIndex="-5"}function io(e,t=(()=>{}),n=(()=>[])){e.forEach((e=>{const r=t(e);Object.keys(r).forEach((t=>{e.style[t]=r[t]})),n(e).forEach((t=>e.classList.add(t)))}))}function co(e,t=(()=>{}),n=(()=>[])){e.forEach((e=>{const r=t(e);Object.keys(r).forEach((t=>{e.style[t]=""})),n(e).forEach((t=>e.classList.contains(t)&&e.classList.remove(t)))}))}const ao={outline:"rgba(255, 255, 102, 0.7) solid 2px"};let uo,po,fo,ho,mo,go,vo,$o,bo,yo,wo,xo=!1,ko=!1,Eo=!1,So=[];const Co=new Map,To=new Map,Oo=new WeakMap;function Lo(e,t){Co.get(t).delete(e),Dr(),0===Co.get(t).size&&Co.delete(t)}function Do(){window.addEventListener("mousemove",Jr),window.addEventListener("touchmove",Jr),to();const e=Co.get(ho);for(const t of e)t.addEventListener(dr,_o),t.addEventListener(pr,No),t.addEventListener(fr,Fo);window.addEventListener(hr,Ro);const t=Math.max(100,...Array.from(e.keys()).map((e=>To.get(e).dropAnimationDurationMs)));!function(e,t,n=200){let r,o,s,l=!1;const i=Array.from(t).sort(((e,t)=>qr(t)-qr(e)));!function t(){const c=Ir(e),a=Xr(c,r);if(!a&&s&&Math.abs(s.x-c.x)<10&&Math.abs(s.y-c.y)<10)return void(Kr=window.setTimeout(t,n));if(function(e){const t=jr(e);return t.right<0||t.left>document.documentElement.scrollWidth||t.bottom<0||t.top>document.documentElement.scrollHeight}(e))return void function(e){window.dispatchEvent(new CustomEvent(hr,{detail:{draggedEl:e}}))}(e);s=c;let u=!1;for(const t of i){a&&Hr(r);const n=zr(e,t);if(null===n)continue;const{index:s}=n;u=!0,t!==r?(r&&$r(r,e,t),vr(t,n,e),r=t):s!==o&&(br(t,n,e),o=s);break}!u&&l&&r?(function(e,t){e.dispatchEvent(new CustomEvent(pr,{detail:{draggedEl:t,type:gr}}))}(r,e),r=void 0,o=void 0,l=!1):l=!0,Kr=window.setTimeout(t,n)}()}(po,e,1.07*t)}function Ao(e){return e.findIndex((e=>!!e.isDndShadowItem&&e.id!==Cr))}function _o(e){let{items:t,dropFromOthersDisabled:n}=To.get(e.currentTarget);if(n&&e.currentTarget!==mo)return;if(Eo=!1,t=t.filter((e=>e.id!==vo.id)),mo!==e.currentTarget){const e=To.get(mo).items.filter((e=>!e.isDndShadowItem));ur(mo,e,{trigger:"dragEnteredAnother",id:fo.id,source:kr})}else{const e=function(e){return e.findIndex((e=>e.id===Cr))}(t);-1!==e&&t.splice(e,1)}const{index:r,isProximityBased:o}=e.detail.indexObj,s=o&&r===e.currentTarget.children.length-1?r+1:r;$o=e.currentTarget,t.splice(s,0,vo),ur(e.currentTarget,t,{trigger:"draggedEntered",id:fo.id,source:kr})}function No(e){if(!xo)return;const{items:t,dropFromOthersDisabled:n}=To.get(e.currentTarget);if(n&&e.currentTarget!==mo&&e.currentTarget!==$o)return;const r=Ao(t),o=t.splice(r,1)[0];$o=void 0;const{type:s,theOtherDz:l}=e.detail;if(s===gr||s===mr&&l!==mo&&To.get(l).dropFromOthersDisabled){Eo=!0,$o=mo;const e=To.get(mo).items;e.splice(go,0,o),ur(mo,e,{trigger:"draggedLeftAll",id:fo.id,source:kr})}ur(e.currentTarget,t,{trigger:"draggedLeft",id:fo.id,source:kr})}function Fo(e){const{items:t,dropFromOthersDisabled:n}=To.get(e.currentTarget);if(n&&e.currentTarget!==mo)return;Eo=!1;const{index:r}=e.detail.indexObj,o=Ao(t);t.splice(o,1),t.splice(r,0,vo),ur(e.currentTarget,t,{trigger:"draggedOverIndex",id:fo.id,source:kr})}function jo(e){e.preventDefault();const t=e.touches?e.touches[0]:e;yo={x:t.clientX,y:t.clientY},po.style.transform=`translate3d(${yo.x-bo.x}px, ${yo.y-bo.y}px, 0)`}function Ro(){ko=!0,window.removeEventListener("mousemove",jo),window.removeEventListener("touchmove",jo),window.removeEventListener("mouseup",Ro),window.removeEventListener("touchend",Ro),function(){window.removeEventListener("mousemove",Jr),window.removeEventListener("touchmove",Jr),Vr=void 0,window.clearTimeout(eo),Qr();const e=Co.get(ho);for(const t of e)t.removeEventListener(dr,_o),t.removeEventListener(pr,No),t.removeEventListener(fr,Fo);window.removeEventListener(hr,Ro),clearTimeout(Kr),Yr(),Pr()}(),function(e){e.style.cursor="grab"}(po),$o||($o=mo);let{items:e,type:t}=To.get($o);co(Co.get(t),(e=>To.get(e).dropTargetStyle),(e=>To.get(e).dropTargetClasses));let n=Ao(e);-1===n&&(n=go),e=e.map((e=>e.isDndShadowItem?fo:e)),function(e,t){const n=Nr($o.children[e]),r=n.left-parseFloat(po.style.left),o=n.top-parseFloat(po.style.top),{dropAnimationDurationMs:s}=To.get($o),l=`transform ${s}ms ease`;po.style.transition=po.style.transition?po.style.transition+","+l:l,po.style.transform=`translate3d(${r}px, ${o}px, 0)`,window.setTimeout(t,s)}(n,(function(){var t;wo(),ar($o,e,{trigger:Eo?"droppedOutsideOfAny":wr,id:fo.id,source:kr}),$o!==mo&&ar(mo,To.get(mo).items,{trigger:xr,id:fo.id,source:kr}),(t=$o.children[n]).style.visibility="",t.removeAttribute(Sr),po.remove(),uo.remove(),So.length&&(So.forEach((({dz:e,destroy:t})=>{t(),e.remove()})),So=[]),po=void 0,uo=void 0,fo=void 0,ho=void 0,mo=void 0,go=void 0,vo=void 0,$o=void 0,bo=void 0,yo=void 0,xo=!1,ko=!1,wo=void 0,Eo=!1}))}const Uo={DND_ZONE_ACTIVE:"dnd-zone-active",DND_ZONE_DRAG_DISABLED:"dnd-zone-drag-disabled"},Io={[Uo.DND_ZONE_ACTIVE]:"Tab to one the items and press space-bar or enter to start dragging it",[Uo.DND_ZONE_DRAG_DISABLED]:"This is a disabled drag and drop list"};let Mo;function Po(){Mo||(Mo=document.createElement("div"),Mo.id="dnd-action-aria-alert",Mo.style.position="fixed",Mo.style.bottom="0",Mo.style.left="0",Mo.style.zIndex="-5",Mo.style.opacity="0",Mo.style.height="0",Mo.style.width="0",Mo.setAttribute("role","alert"),document.body.prepend(Mo),Object.entries(Io).forEach((([e,t])=>document.body.prepend(function(e,t){const n=document.createElement("div");return n.id=e,n.innerHTML=`

${t}

`,n.style.display="none",n.style.position="fixed",n.style.zIndex="-5",n}(e,t)))))}function Ho(e){if(Ar)return;Mo||Po(),Mo.innerHTML="";const t=document.createTextNode(e);Mo.appendChild(t),Mo.style.display="none",Mo.style.display="inline"}const zo={outline:"rgba(255, 255, 102, 0.7) solid 2px"};let Bo,Go,qo,Wo,Xo=!1,Yo="",Ko="";const Vo=new WeakSet,Jo=new WeakMap,Zo=new WeakMap,Qo=new Map,es=new Map,ts=new Map;let ns;function rs(e,t){Go===e&&cs(),ts.get(t).delete(e),Dr(),0===ts.get(t).size&&ts.delete(t),0===ts.size&&(window.removeEventListener("keydown",os),window.removeEventListener("click",ss),ns=void 0,!Ar&&Mo&&(Object.keys(Io).forEach((e=>document.getElementById(e)?.remove())),Mo.remove(),Mo=void 0))}function os(e){Xo&&"Escape"===e.key&&cs()}function ss(){Xo&&(Vo.has(document.activeElement)||cs())}function ls(e){if(!Xo)return;const t=e.currentTarget;if(t===Go)return;Yo=t.getAttribute("aria-label")||"";const{items:n}=es.get(Go),r=n.find((e=>e.id===Wo)),o=n.indexOf(r),s=n.splice(o,1)[0],{items:l,autoAriaDisabled:i}=es.get(t);t.getBoundingClientRect().tope(es.get(t))))}function cs(e=!0){es.get(Go).autoAriaDisabled||Ho(`Stopped dragging item ${Ko}`),Vo.has(document.activeElement)&&document.activeElement.blur(),e&&ur(Go,es.get(Go).items,{trigger:"dragStopped",id:Wo,source:Er}),co(ts.get(Bo),(e=>es.get(e).dropTargetStyle),(e=>es.get(e).dropTargetClasses)),qo=null,Wo=null,Ko="",Bo=null,Go=null,Yo="",Xo=!1,is()}function as(e,t){const n={items:void 0,type:void 0,dragDisabled:!1,zoneTabIndex:0,dropFromOthersDisabled:!1,dropTargetStyle:zo,dropTargetClasses:[],autoAriaDisabled:!1};function r(e,t,n){e.length<=1||e.splice(n,1,e.splice(t,1,e[n])[0])}function o(t){switch(t.key){case"Enter":case" ":if((void 0!==t.target.disabled||t.target.href||t.target.isContentEditable)&&!Vo.has(t.target))return;t.preventDefault(),t.stopPropagation(),Xo?cs():s(t);break;case"ArrowDown":case"ArrowRight":{if(!Xo)return;t.preventDefault(),t.stopPropagation();const{items:o}=es.get(e),s=Array.from(e.children),l=s.indexOf(t.currentTarget);l0&&(n.autoAriaDisabled||Ho(`Moved item ${Ko} to position ${s} in the list ${Yo}`),r(o,s,s-1),ar(e,o,{trigger:wr,id:Wo,source:Er}));break}}}function s(t){(function(t){const{items:n}=es.get(e),r=Array.from(e.children),o=r.indexOf(t);qo=t,qo.tabIndex=0,Wo=n[o].id,Ko=r[o].getAttribute("aria-label")||""})(t.currentTarget),Go=e,Bo=n.type,Xo=!0;const r=Array.from(ts.get(n.type)).filter((e=>e===Go||!es.get(e).dropFromOthersDisabled));if(io(r,(e=>es.get(e).dropTargetStyle),(e=>es.get(e).dropTargetClasses)),!n.autoAriaDisabled){let e=`Started dragging item ${Ko}. Use the arrow keys to move it within its list ${Yo}`;r.length>1&&(e+=", or tab to another list in order to move the item into it"),Ho(e)}ur(e,es.get(e).items,{trigger:yr,id:Wo,source:Er}),is()}function l(e){Xo&&e.currentTarget!==qo&&(e.stopPropagation(),cs(!1),s(e))}function i({items:t=[],type:r="--any--",dragDisabled:s=!1,zoneTabIndex:i=0,dropFromOthersDisabled:c=!1,dropTargetStyle:a=zo,dropTargetClasses:u=[],autoAriaDisabled:d=!1}){var p,f;n.items=[...t],n.dragDisabled=s,n.dropFromOthersDisabled=c,n.zoneTabIndex=i,n.dropTargetStyle=a,n.dropTargetClasses=u,n.autoAriaDisabled=d,n.type&&r!==n.type&&rs(e,n.type),n.type=r,p=e,f=r,0===ts.size&&(ns=Ar?null:("complete"===document.readyState?Po():window.addEventListener("DOMContentLoaded",Po),{...Uo}),window.addEventListener("keydown",os),window.addEventListener("click",ss)),ts.has(f)||ts.set(f,new Set),ts.get(f).has(p)||(ts.get(f).add(p),Lr()),d||(e.setAttribute("aria-disabled",s),e.setAttribute("role","list"),e.setAttribute("aria-describedby",s?ns.DND_ZONE_DRAG_DISABLED:ns.DND_ZONE_ACTIVE)),es.set(e,n),e.tabIndex=Xo?e===Go||qo.contains(e)||n.dropFromOthersDisabled||Go&&n.type!==es.get(Go).type?-1:0:n.zoneTabIndex,e.addEventListener("focus",ls);for(let t=0;t{i(e)},destroy:()=>{rs(e,n.type),es.delete(e),Qo.delete(e)}};return Qo.set(e,c),c}function us(e,t){ds(t);const n=function(e,t){let n=!1;const r={items:void 0,type:void 0,flipDurationMs:0,dragDisabled:!1,morphDisabled:!1,dropFromOthersDisabled:!1,dropTargetStyle:ao,dropTargetClasses:[],transformDraggedElement:()=>{},centreDraggedOnCursor:!1};let o=new Map;function s(){window.removeEventListener("mousemove",i),window.removeEventListener("touchmove",i),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}function l(){s(),uo=void 0,bo=void 0,yo=void 0}function i(e){e.preventDefault();const t=e.touches?e.touches[0]:e;yo={x:t.clientX,y:t.clientY},(Math.abs(yo.x-bo.x)>=3||Math.abs(yo.y-bo.y)>=3)&&(s(),function(){xo=!0;const e=o.get(uo);go=e,mo=uo.parentElement;const t=mo.getRootNode(),n=t.body||t,{items:s,type:l,centreDraggedOnCursor:i}=r;fo={...s[e]},ho=l,vo={...fo,isDndShadowItem:!0};const c={...vo,[Tr]:Cr};po=function(e,t){const n=e.getBoundingClientRect(),r=function(e){const t=e.cloneNode(!0),n=[],r="SELECT"===e.tagName,o=r?[e]:[...e.querySelectorAll("select")];for(const e of o)n.push(e.value);if(o.length<=0)return t;const s=r?[t]:[...t.querySelectorAll("select")];for(let e=0;e{r.style.top=`${o}px`,r.style.left=`${s}px`}),0)}return r.style.margin="0",r.style.boxSizing="border-box",r.style.height=`${n.height}px`,r.style.width=`${n.width}px`,r.style.transition=`${no("top")}, ${no("left")}, ${no("background-color")}, ${no("opacity")}, ${no("color")} `,window.setTimeout((()=>r.style.transition+=`, ${no("width")}, ${no("height")}`),0),r.style.zIndex="9999",r.style.cursor="grabbing",r}(uo,i&&yo),window.requestAnimationFrame((function e(){po.parentElement?window.requestAnimationFrame(e):(n.appendChild(po),po.focus(),Do(),lo(uo),n.appendChild(uo))})),io(Array.from(Co.get(r.type)).filter((e=>e===mo||!To.get(e).dropFromOthersDisabled)),(e=>To.get(e).dropTargetStyle),(e=>To.get(e).dropTargetClasses)),s.splice(e,1,c),wo=function(e){const t=e.style.minHeight;e.style.minHeight=window.getComputedStyle(e).getPropertyValue("height");const n=e.style.minWidth;return e.style.minWidth=window.getComputedStyle(e).getPropertyValue("width"),function(){e.style.minHeight=t,e.style.minWidth=n}}(mo),ur(mo,s,{trigger:yr,id:fo.id,source:kr}),window.addEventListener("mousemove",jo,{passive:!1}),window.addEventListener("touchmove",jo,{passive:!1,capture:!1}),window.addEventListener("mouseup",Ro,{passive:!1}),window.addEventListener("touchend",Ro,{passive:!1})}())}function c(e){if(e.target!==e.currentTarget&&(void 0!==e.target.value||e.target.isContentEditable))return;if(e.button)return;if(xo)return;e.stopPropagation();const t=e.touches?e.touches[0]:e;bo={x:t.clientX,y:t.clientY},yo={...bo},uo=e.currentTarget,window.addEventListener("mousemove",i,{passive:!1}),window.addEventListener("touchmove",i,{passive:!1,capture:!1}),window.addEventListener("mouseup",l,{passive:!1}),window.addEventListener("touchend",l,{passive:!1})}function a({items:t,flipDurationMs:s=0,type:l="--any--",dragDisabled:i=!1,morphDisabled:a=!1,dropFromOthersDisabled:u=!1,dropTargetStyle:d=ao,dropTargetClasses:p=[],transformDraggedElement:f=(()=>{}),centreDraggedOnCursor:h=!1}){var m,g;function v(e,t){return To.get(e)?To.get(e)[t]:r[t]}r.dropAnimationDurationMs=s,r.type&&l!==r.type&&Lo(e,r.type),r.type=l,m=e,g=l,Co.has(g)||Co.set(g,new Set),Co.get(g).has(m)||(Co.get(g).add(m),Lr()),r.items=[...t],r.dragDisabled=i,r.morphDisabled=a,r.transformDraggedElement=f,r.centreDraggedOnCursor=h,!n||!xo||ko||function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!{}.hasOwnProperty.call(t,n)||t[n]!==e[n])return!1;return!0}(d,r.dropTargetStyle)&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;nr.dropTargetStyle),(()=>p)),io([e],(()=>d),(()=>p))),r.dropTargetStyle=d,r.dropTargetClasses=[...p],n&&xo&&r.dropFromOthersDisabled!==u&&(u?co([e],(e=>v(e,"dropTargetStyle")),(e=>v(e,"dropTargetClasses"))):io([e],(e=>v(e,"dropTargetStyle")),(e=>v(e,"dropTargetClasses")))),r.dropFromOthersDisabled=u,To.set(e,r);const $=Ao(r.items);for(let t=0;tr.transformDraggedElement(po,fo,t))),(b=s).style.visibility="hidden",b.setAttribute(Sr,"true"))}var b}return a(t),{update:e=>{a(e)},destroy:()=>{function t(){Lo(e,To.get(e).type),To.delete(e)}var n,r;xo?(n=e,r=t,So.push({dz:n,destroy:r}),window.requestAnimationFrame((()=>{lo(n),document.body.appendChild(n)}))):t()}}}(e,t),r=as(e,t);return{update:e=>{ds(e),n.update(e),r.update(e)},destroy:()=>{n.destroy(),r.destroy()}}}function ds(e){const{items:t,flipDurationMs:n,type:r,dragDisabled:o,morphDisabled:s,dropFromOthersDisabled:l,zoneTabIndex:i,dropTargetStyle:c,dropTargetClasses:a,transformDraggedElement:u,autoAriaDisabled:d,centreDraggedOnCursor:p,...f}=e;if(Object.keys(f).length>0&&console.warn("dndzone will ignore unknown options",f),!t)throw new Error("no 'items' key provided to dndzone");const h=t.find((e=>!{}.hasOwnProperty.call(e,Tr)));if(h)throw new Error(`missing 'id' property for item ${Gr(h)}`);if(a&&!Array.isArray(a))throw new Error(`dropTargetClasses should be an array but instead it is a ${typeof a}, ${Gr(a)}`);if(i&&(m=i,isNaN(m)||(0|(g=parseFloat(m)))!==g))throw new Error(`zoneTabIndex should be a number but instead it is a ${typeof i}, ${Gr(i)}`);var m,g}function ps(e,{delay:n=0,duration:r=400,easing:o=t}={}){const s=+getComputedStyle(e).opacity;return{delay:n,duration:r,easing:o,css:e=>"opacity: "+e*s}}function fs(e,{delay:t=0,duration:n=400,easing:r=Ot,x:o=0,y:s=0,opacity:l=0}={}){const i=getComputedStyle(e),c=+i.opacity,a="none"===i.transform?"":i.transform,u=c*(1-l);return{delay:t,duration:n,easing:r,css:(e,t)=>`\n\t\t\ttransform: ${a} translate(${(1-e)*o}px, ${(1-e)*s}px);\n\t\t\topacity: ${c-u*t}`}}const hs=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"];function ms(e){let t;return{c(){var n,r;t=O("textarea"),R(t,"id",e[0]),n=t,r="visibility",null==="hidden"?n.style.removeProperty(r):n.style.setProperty(r,"hidden","")},m(n,r){S(n,t,r),e[18](t)},p(e,n){1&n&&R(t,"id",e[0])},d(n){n&&C(t),e[18](null)}}}function gs(e){let t;return{c(){t=O("div"),R(t,"id",e[0])},m(n,r){S(n,t,r),e[17](t)},p(e,n){1&n&&R(t,"id",e[0])},d(n){n&&C(t),e[17](null)}}}function vs(t){let n;function r(e,t){return e[1]?gs:ms}let o=r(t),s=o(t);return{c(){n=O("div"),s.c(),R(n,"class",t[2])},m(e,r){S(e,n,r),s.m(n,null),t[19](n)},p(e,[t]){o===(o=r(e))&&s?s.p(e,t):(s.d(1),s=o(e),s&&(s.c(),s.m(n,null))),4&t&&R(n,"class",e[2])},i:e,o:e,d(e){e&&C(n),s.d(),t[19](null)}}}const $s=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let bs=(()=>{let e={listeners:[],scriptId:$s("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,r)=>{e.scriptLoaded?r():(e.listeners.push(r),e.injected||((t,n,r,o)=>{e.injected=!0;const s=n.createElement("script");s.referrerPolicy="origin",s.type="application/javascript",s.src=r,s.onload=()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0},n.head&&n.head.appendChild(s)})(e.scriptId,t,n))}}})();function ys(e,t,n){var r;let o,s,l,{id:c=$s("tinymce-svelte")}=t,{inline:a}=t,{disabled:u=!1}=t,{apiKey:d="no-api-key"}=t,{channel:p="6"}=t,{scriptSrc:f}=t,{conf:h={}}=t,{modelEvents:m="change input undo redo"}=t,{value:g=""}=t,{text:v=""}=t,{cssClass:$="tinymce-wrapper"}=t,b="",y=u;const w=function(){const e=W();return(t,n,{cancelable:r=!1}={})=>{const o=e.$$.callbacks[t];if(o){const s=P(t,n,{cancelable:r});return o.slice().forEach((t=>{t.call(e,s)})),!s.defaultPrevented}return!0}}(),x=()=>{const e="undefined"!=typeof window?window:i.g;return e&&e.tinymce?e.tinymce:null},k=()=>{const e=Object.assign(Object.assign({},h),{target:s,inline:void 0!==a?a:void 0!==h.inline&&h.inline,readonly:u,setup:e=>{n(14,l=e),e.on("init",(()=>{e.setContent(g),e.on(m,(()=>{n(15,b=e.getContent()),b!==g&&(n(5,g=b),n(6,v=e.getContent({format:"text"})))}))})),((e,t)=>{hs.forEach((n=>{e.on(n,(r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})}))}))})(e,w),"function"==typeof h.setup&&h.setup(e)}});n(4,s.style.visibility="",s),x().init(e)};return X((()=>{if(null!==x())setTimeout(k,0);else{const e=f||`https://cdn.tiny.cloud/1/${d}/tinymce/${p}/tinymce.min.js`;bs.load(o.ownerDocument,e,(()=>{k()}))}})),Y((()=>{var e;l&&(null===(e=x())||void 0===e||e.remove(l))})),e.$$set=e=>{"id"in e&&n(0,c=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,u=e.disabled),"apiKey"in e&&n(8,d=e.apiKey),"channel"in e&&n(9,p=e.channel),"scriptSrc"in e&&n(10,f=e.scriptSrc),"conf"in e&&n(11,h=e.conf),"modelEvents"in e&&n(12,m=e.modelEvents),"value"in e&&n(5,g=e.value),"text"in e&&n(6,v=e.text),"cssClass"in e&&n(2,$=e.cssClass)},e.$$.update=()=>{123040&e.$$.dirty&&(l&&b!==g&&(l.setContent(g),n(6,v=l.getContent({format:"text"}))),l&&u!==y&&(n(16,y=u),"function"==typeof(null===n(13,r=l.mode)||void 0===r?void 0:r.set)?l.mode.set(u?"readonly":"design"):l.setMode(u?"readonly":"design")))},[c,a,$,o,s,g,v,u,d,p,f,h,m,r,l,b,y,function(e){J[e?"unshift":"push"]((()=>{s=e,n(4,s)}))},function(e){J[e?"unshift":"push"]((()=>{s=e,n(4,s)}))},function(e){J[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}const ws=class extends Le{constructor(e){super(),Oe(this,e,ys,vs,l,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}};function xs(t){let n,r,o;return{c(){n=L("svg"),r=L("g"),o=L("path"),R(o,"d","M38,52a2,2,0,0,1-1.41-.59l-24-24a2,2,0,0,1,0-2.82l24-24a2,2,0,0,1,2.82,0,2,2,0,0,1,0,2.82L16.83,26,39.41,48.59A2,2,0,0,1,38,52Z"),R(n,"version","1.1"),R(n,"xmlns","http://www.w3.org/2000/svg"),R(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),R(n,"x","0px"),R(n,"y","0px"),R(n,"viewBox","0 0 52 52"),R(n,"xml:space","preserve")},m(e,t){S(e,n,t),x(n,r),x(r,o)},p:e,i:e,o:e,d(e){e&&C(n)}}}const ks=class extends Le{constructor(e){super(),Oe(this,e,null,xs,l,{})}};function Es(t){let n,r;return{c(){n=L("svg"),r=L("polygon"),R(r,"points","0,490 490,490 245,0"),R(n,"version","1.1"),R(n,"xmlns","http://www.w3.org/2000/svg"),R(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),R(n,"x","0px"),R(n,"y","0px"),R(n,"viewBox","0 0 490 490"),R(n,"xml:space","preserve")},m(e,t){S(e,n,t),x(n,r)},p:e,i:e,o:e,d(e){e&&C(n)}}}const Ss=class extends Le{constructor(e){super(),Oe(this,e,null,Es,l,{})}};function Cs(e){let t,n,r,l,i,c,a,u,d,p,f,h,m;return r=new Ss({}),a=new Ss({}),{c(){t=O("div"),n=O("a"),Se(r.$$.fragment),l=D(" move up"),i=A(),c=O("a"),Se(a.$$.fragment),u=D(" move down"),d=A(),p=O("a"),p.textContent="remove",R(n,"href","#up"),R(n,"class","small up svelte-1ahjj8t"),M(n,"control-disabled",!e[0]),R(c,"href","#dowm"),R(c,"class","small down svelte-1ahjj8t"),M(c,"control-disabled",!e[1]),R(p,"href","#remove"),R(p,"class","small remove svelte-1ahjj8t"),M(p,"control-disabled",!e[2]),R(t,"class","controls svelte-1ahjj8t")},m(o,g){S(o,t,g),x(t,n),Ce(r,n,null),x(n,l),x(t,i),x(t,c),Ce(a,c,null),x(c,u),x(t,d),x(t,p),f=!0,h||(m=[N(n,"click",j(F((function(){s(e[0])&&e[0].apply(this,arguments)})))),N(c,"click",j(F((function(){s(e[1])&&e[1].apply(this,arguments)})))),N(p,"click",j(F((function(){s(e[2])&&e[2].apply(this,arguments)}))))],h=!0)},p(t,[r]){e=t,1&r&&M(n,"control-disabled",!e[0]),2&r&&M(c,"control-disabled",!e[1]),4&r&&M(p,"control-disabled",!e[2])},i(e){f||(he(r.$$.fragment,e),he(a.$$.fragment,e),f=!0)},o(e){me(r.$$.fragment,e),me(a.$$.fragment,e),f=!1},d(e){e&&C(t),Te(r),Te(a),h=!1,o(m)}}}function Ts(e,t,n){let{moveUp:r}=t,{moveDown:o}=t,{remove:s}=t;return e.$$set=e=>{"moveUp"in e&&n(0,r=e.moveUp),"moveDown"in e&&n(1,o=e.moveDown),"remove"in e&&n(2,s=e.remove)},[r,o,s]}const Os=class extends Le{constructor(e){super(),Oe(this,e,Ts,Cs,l,{moveUp:0,moveDown:1,remove:2})}};function Ls(e){let t,n,r,s,l,i;return{c(){t=O("div"),n=O("span"),n.textContent="URL",r=A(),s=O("span"),R(n,"class","label svelte-13pfiuq"),R(s,"class","url svelte-13pfiuq"),R(s,"aria-label","URL"),R(s,"contenteditable",""),void 0===e[3]&&ne((()=>e[14].call(s))),R(t,"class","field svelte-13pfiuq")},m(o,c){S(o,t,c),x(t,n),x(t,r),x(t,s),void 0!==e[3]&&(s.innerHTML=e[3]),l||(i=[N(s,"input",e[14]),N(s,"keydown",e[11])],l=!0)},p(e,t){8&t&&e[3]!==s.innerHTML&&(s.innerHTML=e[3])},d(e){e&&C(t),l=!1,o(i)}}}function Ds(t){let n,r,o,s;return{c(){n=O("textarea"),n.disabled=r=t[2]&&t[4],R(n,"class","svelte-13pfiuq")},m(e,r){S(e,n,r),I(n,t[1]),o||(s=N(n,"input",t[16]),o=!0)},p(e,t){20&t&&r!==(r=e[2]&&e[4])&&(n.disabled=r),2&t&&I(n,e[1])},i:e,o:e,d(e){e&&C(n),o=!1,s()}}}function As(e){let t,n,r;function o(t){e[15](t)}let s={disabled:e[2]&&e[4],apiKey:"okcf1pz4foebbixgcdydveaavknj41e62etldhxguuyug0v3",conf:e[12]};return void 0!==e[1]&&(s.value=e[1]),t=new ws({props:s}),J.push((()=>Ee(t,"value",o))),{c(){Se(t.$$.fragment)},m(e,n){Ce(t,e,n),r=!0},p(e,r){const o={};20&r&&(o.disabled=e[2]&&e[4]),!n&&2&r&&(n=!0,o.value=e[1],re((()=>n=!1))),t.$set(o)},i(e){r||(he(t.$$.fragment,e),r=!0)},o(e){me(t.$$.fragment,e),r=!1},d(e){Te(t,e)}}}function _s(e){let t,n,r,o,s;return{c(){t=O("label"),n=O("input"),r=D(" Fetch contents"),R(n,"type","checkbox"),R(n,"class","svelte-13pfiuq"),R(t,"class","svelte-13pfiuq")},m(l,i){S(l,t,i),x(t,n),n.checked=e[2],x(t,r),o||(s=N(n,"change",e[17]),o=!0)},p(e,t){4&t&&(n.checked=e[2])},d(e){e&&C(t),o=!1,s()}}}function Ns(e){let t,n,r,o;return r=new Os({props:{moveUp:e[6],moveDown:e[7],remove:e[8]}}),{c(){t=O("span"),n=A(),Se(r.$$.fragment)},m(e,s){S(e,t,s),S(e,n,s),Ce(r,e,s),o=!0},p(e,t){const n={};64&t&&(n.moveUp=e[6]),128&t&&(n.moveDown=e[7]),256&t&&(n.remove=e[8]),r.$set(n)},i(e){o||(he(r.$$.fragment,e),o=!0)},o(e){me(r.$$.fragment,e),o=!1},d(e){e&&C(t),e&&C(n),Te(r,e)}}}function Fs(e){let t,n,r,l,i,c,a,u,d,p,f,h,m,g,v,$,b,y,w,k;r=new ks({});let E=void 0!==e[3]&&Ls(e);const T=[As,Ds],L=[];function j(e,t){return e[10].useTiny?0:1}m=j(e),g=L[m]=T[m](e);let U=e[4]&&_s(e),I=!e[9]&&Ns(e);return{c(){t=O("h3"),n=O("a"),Se(r.$$.fragment),l=D(" back"),i=A(),c=O("div"),a=O("div"),u=O("span"),u.textContent="Title",d=A(),p=O("span"),f=A(),E&&E.c(),h=A(),g.c(),v=A(),U&&U.c(),$=A(),I&&I.c(),b=_(),R(n,"href","#home"),R(n,"class","homelink svelte-13pfiuq"),R(t,"class","back svelte-13pfiuq"),R(u,"class","label svelte-13pfiuq"),R(p,"class","title svelte-13pfiuq"),R(p,"aria-label","Title"),R(p,"contenteditable",""),void 0===e[0]&&ne((()=>e[13].call(p))),R(a,"class","field svelte-13pfiuq"),R(c,"class","chapter edit svelte-13pfiuq")},m(o,g){S(o,t,g),x(t,n),Ce(r,n,null),x(n,l),S(o,i,g),S(o,c,g),x(c,a),x(a,u),x(a,d),x(a,p),void 0!==e[0]&&(p.innerHTML=e[0]),x(c,f),E&&E.m(c,null),x(c,h),L[m].m(c,null),x(c,v),U&&U.m(c,null),S(o,$,g),I&&I.m(o,g),S(o,b,g),y=!0,w||(k=[N(n,"click",F((function(){s(e[5])&&e[5].apply(this,arguments)}))),N(p,"input",e[13]),N(p,"keydown",e[11])],w=!0)},p(t,n){e=t,1&n&&e[0]!==p.innerHTML&&(p.innerHTML=e[0]),void 0!==e[3]?E?E.p(e,n):(E=Ls(e),E.c(),E.m(c,h)):E&&(E.d(1),E=null);let r=m;m=j(e),m===r?L[m].p(e,n):(pe(),me(L[r],1,1,(()=>{L[r]=null})),fe(),g=L[m],g?g.p(e,n):(g=L[m]=T[m](e),g.c()),he(g,1),g.m(c,v)),e[4]?U?U.p(e,n):(U=_s(e),U.c(),U.m(c,null)):U&&(U.d(1),U=null),e[9]?I&&(pe(),me(I,1,1,(()=>{I=null})),fe()):I?(I.p(e,n),512&n&&he(I,1)):(I=Ns(e),I.c(),he(I,1),I.m(b.parentNode,b))},i(e){y||(he(r.$$.fragment,e),he(g),he(I),y=!0)},o(e){me(r.$$.fragment,e),me(g),me(I),y=!1},d(e){e&&C(t),Te(r),e&&C(i),e&&C(c),E&&E.d(),L[m].d(),U&&U.d(),e&&C($),I&&I.d(e),e&&C(b),w=!1,o(k)}}}function js(e){let t,n;return t=new _e({props:{onSubmit:e[5],$$slots:{default:[Fs]},$$scope:{ctx:e}}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,[n]){const r={};32&n&&(r.onSubmit=e[5]),264191&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function Rs(e,t,n){let r;a(e,Be,(e=>n(10,r=e)));let{title:o}=t,{content:s}=t,{needsFetching:l}=t,{url:i}=t,{canFetch:c=!1}=t,{close:u}=t,{moveUp:d}=t,{moveDown:p}=t,{remove:f}=t,{hideControls:h=!1}=t;return l=null==l||l,s=null!=s?s:"",e.$$set=e=>{"title"in e&&n(0,o=e.title),"content"in e&&n(1,s=e.content),"needsFetching"in e&&n(2,l=e.needsFetching),"url"in e&&n(3,i=e.url),"canFetch"in e&&n(4,c=e.canFetch),"close"in e&&n(5,u=e.close),"moveUp"in e&&n(6,d=e.moveUp),"moveDown"in e&&n(7,p=e.moveDown),"remove"in e&&n(8,f=e.remove),"hideControls"in e&&n(9,h=e.hideControls)},e.$$.update=()=>{1&e.$$.dirty&&n(0,o=o.replace(/<[^>]*>/g,""))},[o,s,l,i,c,u,d,p,f,h,r,e=>{"Enter"!==e.key&&13!==e.keyCode||e.preventDefault()},{plugins:"code",toolbar:"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | code"},function(){o=this.innerHTML,n(0,o)},function(){i=this.innerHTML,n(3,i)},function(e){s=e,n(1,s)},function(){s=this.value,n(1,s)},function(){l=this.checked,n(2,l)}]}const Us=class extends Le{constructor(e){super(),Oe(this,e,Rs,js,l,{title:0,content:1,needsFetching:2,url:3,canFetch:4,close:5,moveUp:6,moveDown:7,remove:8,hideControls:9})}};function Is(e){let t,n;return{c(){t=O("span"),n=D(e[5]),R(t,"class","content svelte-1ltngm7")},m(e,r){S(e,t,r),x(t,n)},p(e,t){32&t&&U(n,e[5])},d(e){e&&C(t)}}}function Ms(e){let t,n,r,l,i,c,a,u,d,p,f,h=!e[6]&&Is(e);return u=new Os({props:{moveUp:e[2],moveDown:e[3],remove:e[4]}}),{c(){t=O("div"),n=O("div"),r=O("span"),l=D(e[0]),i=A(),h&&h.c(),c=A(),a=O("div"),Se(u.$$.fragment),R(r,"class","title svelte-1ltngm7"),R(r,"aria-label","Title"),R(n,"class","preview svelte-1ltngm7"),M(n,"empty",e[6]),R(a,"class","more svelte-1ltngm7"),R(t,"class","chapter svelte-1ltngm7"),R(t,"tabindex","0"),R(t,"title",e[0])},m(o,m){S(o,t,m),x(t,n),x(n,r),x(r,l),x(n,i),h&&h.m(n,null),x(t,c),x(t,a),Ce(u,a,null),d=!0,p||(f=[N(t,"click",(function(){s(e[1])&&e[1].apply(this,arguments)})),N(t,"contextmenu",F(e[8]))],p=!0)},p(r,[o]){e=r,(!d||1&o)&&U(l,e[0]),e[6]?h&&(h.d(1),h=null):h?h.p(e,o):(h=Is(e),h.c(),h.m(n,null)),64&o&&M(n,"empty",e[6]);const s={};4&o&&(s.moveUp=e[2]),8&o&&(s.moveDown=e[3]),16&o&&(s.remove=e[4]),u.$set(s),(!d||1&o)&&R(t,"title",e[0])},i(e){d||(he(u.$$.fragment,e),d=!0)},o(e){me(u.$$.fragment,e),d=!1},d(e){e&&C(t),h&&h.d(),Te(u),p=!1,o(f)}}}function Ps(e,t,n){let r,{title:o}=t,{content:s}=t,{select:l}=t,{moveUp:i}=t,{moveDown:c}=t,{remove:a}=t;s=null!=s?s:"";let u="";return e.$$set=e=>{"title"in e&&n(0,o=e.title),"content"in e&&n(7,s=e.content),"select"in e&&n(1,l=e.select),"moveUp"in e&&n(2,i=e.moveUp),"moveDown"in e&&n(3,c=e.moveDown),"remove"in e&&n(4,a=e.remove)},e.$$.update=()=>{128&e.$$.dirty&&n(6,r=!s||!s.trim().length),128&e.$$.dirty&&setTimeout((()=>n(5,u=At(s||""))),0)},[o,l,i,c,a,u,r,s,function(t){K.call(this,e,t)}]}const Hs=class extends Le{constructor(e){super(),Oe(this,e,Ps,Ms,l,{title:0,content:7,select:1,moveUp:2,moveDown:3,remove:4})}};function zs(e){let t,n,r;return{c(){t=O("span"),R(t,"class","edit svelte-1pemcjw"),R(t,"contenteditable",""),void 0===e[0]&&ne((()=>e[7].call(t)))},m(o,s){S(o,t,s),void 0!==e[0]&&(t.innerHTML=e[0]),n||(r=N(t,"input",e[7]),n=!0)},p(e,n){1&n&&e[0]!==t.innerHTML&&(t.innerHTML=e[0])},d(e){e&&C(t),n=!1,r()}}}function Bs(e){let t,n,r,o=At(e[0])+"";return{c(){t=O("a"),n=D(o),R(t,"href",r=Dt(e[3])),R(t,"target","_blank")},m(e,r){S(e,t,r),x(t,n)},p(e,s){1&s&&o!==(o=At(e[0])+"")&&U(n,o),8&s&&r!==(r=Dt(e[3]))&&R(t,"href",r)},d(e){e&&C(t)}}}function Gs(e){let t,n,r;return{c(){t=O("span"),R(t,"class","edit svelte-1pemcjw"),R(t,"contenteditable",""),void 0===e[1]&&ne((()=>e[8].call(t)))},m(o,s){S(o,t,s),void 0!==e[1]&&(t.innerHTML=e[1]),n||(r=N(t,"input",e[8]),n=!0)},p(e,n){2&n&&e[1]!==t.innerHTML&&(t.innerHTML=e[1])},d(e){e&&C(t),n=!1,r()}}}function qs(e){let t,n=At(e[1])+"";return{c(){t=D(n)},m(e,n){S(e,t,n)},p(e,r){2&r&&n!==(n=At(e[1])+"")&&U(t,n)},d(e){e&&C(t)}}}function Ws(e){let t,n,r,o;const s=e[6].default,l=u(s,e,e[9],null);return{c(){t=O("h3"),t.textContent="Chapters",n=A(),r=O("div"),l&&l.c()},m(e,s){S(e,t,s),S(e,n,s),S(e,r,s),l&&l.m(r,null),o=!0},p(e,t){l&&l.p&&(!o||512&t)&&f(l,s,e,e[9],o?p(s,e[9],t,null):h(e[9]),null)},i(e){o||(he(l,e),o=!0)},o(e){me(l,e),o=!1},d(e){e&&C(t),e&&C(n),e&&C(r),l&&l.d(e)}}}function Xs(e){let t,n,r,o,s,l,i,c,a,u;function d(e,t){return e[2]?zs:Bs}let p=d(e),f=p(e);function h(e,t){return e[2]?Gs:qs}let m=h(e),g=m(e),v=e[5].default&&Ws(e);return{c(){t=O("h3"),t.textContent="Title",n=A(),r=O("p"),f.c(),o=A(),s=O("h3"),s.textContent="Author",l=A(),i=O("p"),g.c(),c=A(),v&&v.c(),a=_()},m(e,d){S(e,t,d),S(e,n,d),S(e,r,d),f.m(r,null),S(e,o,d),S(e,s,d),S(e,l,d),S(e,i,d),g.m(i,null),S(e,c,d),v&&v.m(e,d),S(e,a,d),u=!0},p(e,t){p===(p=d(e))&&f?f.p(e,t):(f.d(1),f=p(e),f&&(f.c(),f.m(r,null))),m===(m=h(e))&&g?g.p(e,t):(g.d(1),g=m(e),g&&(g.c(),g.m(i,null))),e[5].default?v?(v.p(e,t),32&t&&he(v,1)):(v=Ws(e),v.c(),he(v,1),v.m(a.parentNode,a)):v&&(pe(),me(v,1,1,(()=>{v=null})),fe())},i(e){u||(he(v),u=!0)},o(e){me(v),u=!1},d(e){e&&C(t),e&&C(n),e&&C(r),f.d(),e&&C(o),e&&C(s),e&&C(l),e&&C(i),g.d(),e&&C(c),v&&v.d(e),e&&C(a)}}}function Ys(e){let t,n;return t=new _e({props:{onSubmit:e[4],$$slots:{default:[Xs]},$$scope:{ctx:e}}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,[n]){const r={};16&n&&(r.onSubmit=e[4]),559&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function Ks(e,t,n){let{$$slots:r={},$$scope:o}=t;const s=function(e){const t={};for(const n in e)t[n]=!0;return t}(r);let{edit:l=!1}=t,{title:i}=t,{author:c}=t,{url:a=""}=t,{onSubmit:u}=t;return e.$$set=e=>{"edit"in e&&n(2,l=e.edit),"title"in e&&n(0,i=e.title),"author"in e&&n(1,c=e.author),"url"in e&&n(3,a=e.url),"onSubmit"in e&&n(4,u=e.onSubmit),"$$scope"in e&&n(9,o=e.$$scope)},[i,c,l,a,u,s,r,function(){i=this.innerHTML,n(0,i)},function(){c=this.innerHTML,n(1,c)},o]}const Vs=class extends Le{constructor(e){super(),Oe(this,e,Ks,Ys,l,{edit:2,title:0,author:1,url:3,onSubmit:4})}};function Js(e,t,n){const r=e.slice();return r[49]=t[n],r}function Zs(e,t,n){const r=e.slice();return r[52]=t[n],r[54]=n,r}function Qs(e,t){let n,r,o;function s(){return t[20](t[54])}return r=new Hs({props:{title:t[52].title,content:t[52].transformedContent,select:s,moveUp:(t[2]>0||t[54]>0)&&t[14].bind(null,t[13](t[54])),moveDown:(t[2]0||t[54]>0)&&t[14].bind(null,t[13](t[54]))),268&n[0]&&(o.moveDown=(t[2]=e[3]),R(t,"class","svelte-zxr0xc")},m(o,l){S(o,t,l),x(t,n),x(n,r),x(t,i),g&&g.m(t,null),x(t,c);for(let e=0;e<$.length;e+=1)$[e].m(t,null);x(t,a),b&&b.m(t,null),x(t,u),x(t,d),x(d,p),h||(m=[N(n,"click",F((function(){s(e[17].bind(null,e[2]-1))&&e[17].bind(null,e[2]-1).apply(this,arguments)}))),N(d,"click",F((function(){s(e[17].bind(null,e[2]+1))&&e[17].bind(null,e[2]+1).apply(this,arguments)})))],h=!0)},p(r,o){if(e=r,4&o[0]&&l!==(l=e[2]<=0)&&R(n,"disabled",l),null!==e[7].pre?g?g.p(e,o):(g=tl(e),g.c(),g.m(t,c)):g&&(g.d(1),g=null),131204&o[0]){let n;for(v=e[7].pages,n=0;n=e[3])&&R(d,"disabled",f)},d(e){e&&C(t),g&&g.d(),T($,e),b&&b.d(),h=!1,o(m)}}}function tl(e){let t,n,r,o,l,i,c=e[7].pre+"";return{c(){t=O("a"),n=D(c),o=D("\n ."),R(t,"class","small svelte-zxr0xc"),R(t,"href",r=`#page ${e[7].pre}`),R(t,"role","navigation")},m(r,c){S(r,t,c),x(t,n),S(r,o,c),l||(i=N(t,"click",F((function(){s(e[17].bind(null,e[7].pre-1))&&e[17].bind(null,e[7].pre-1).apply(this,arguments)}))),l=!0)},p(o,s){e=o,128&s[0]&&c!==(c=e[7].pre+"")&&U(n,c),128&s[0]&&r!==(r=`#page ${e[7].pre}`)&&R(t,"href",r)},d(e){e&&C(t),e&&C(o),l=!1,i()}}}function nl(e){let t,n,r,o,l,i=e[49]+1+"";return{c(){t=O("a"),n=D(i),R(t,"class","small svelte-zxr0xc"),R(t,"href",r=`#page ${e[49]+1}`),R(t,"role","navigation"),M(t,"current",e[49]==e[2])},m(r,i){S(r,t,i),x(t,n),o||(l=N(t,"click",F((function(){s(e[17].bind(null,e[49]))&&e[17].bind(null,e[49]).apply(this,arguments)}))),o=!0)},p(o,s){e=o,128&s[0]&&i!==(i=e[49]+1+"")&&U(n,i),128&s[0]&&r!==(r=`#page ${e[49]+1}`)&&R(t,"href",r),132&s[0]&&M(t,"current",e[49]==e[2])},d(e){e&&C(t),o=!1,l()}}}function rl(e){let t,n,r,o,l,i,c=e[7].post+"";return{c(){t=D(".\n "),n=O("a"),r=D(c),R(n,"class","small svelte-zxr0xc"),R(n,"href",o=`#page ${e[7].post}`),R(n,"role","navigation")},m(o,c){S(o,t,c),S(o,n,c),x(n,r),l||(i=N(n,"click",F((function(){s(e[17].bind(null,e[7].post-1))&&e[17].bind(null,e[7].post-1).apply(this,arguments)}))),l=!0)},p(t,s){e=t,128&s[0]&&c!==(c=e[7].post+"")&&U(r,c),128&s[0]&&o!==(o=`#page ${e[7].post}`)&&R(n,"href",o)},d(e){e&&C(t),e&&C(n),l=!1,i()}}}function ol(e){let t,n,r,l,i,c,a,u,d,p,f=[],h=new Map,g=e[8];const v=e=>e[52].id;for(let t=0;t0&&el(e);return{c(){t=O("div");for(let e=0;e0?$?$.p(e,r):($=el(e),$.c(),$.m(l.parentNode,l)):$&&($.d(1),$=null)},i(e){if(!u){for(let e=0;e0||e[4]>0)&&e[14].bind(null,e[4]),moveDown:(e[2]Ee(n,"title",p))),J.push((()=>Ee(n,"content",f))),J.push((()=>Ee(n,"needsFetching",h))),J.push((()=>Ee(n,"url",m))),{c(){t=O("div"),Se(n.$$.fragment),R(t,"class","svelte-zxr0xc"),M(t,"float",e[11])},m(r,o){S(r,t,o),Ce(n,t,null),a=!0,u||(d=[N(t,"introend",e[31]),N(t,"outrostart",e[32]),N(t,"outroend",e[33])],u=!0)},p(e,o){const c={};32&o[0]&&(c.canFetch=!!e[5].apiUrl),48&o[0]&&(c.close=e[26]),20&o[0]&&(c.moveUp=(e[2]>0||e[4]>0)&&e[14].bind(null,e[4])),284&o[0]&&(c.moveDown=(e[2]r=!1))),!s&&32&o[0]&&(s=!0,c.content=e[5].transformedContent,re((()=>s=!1))),!l&&32&o[0]&&(l=!0,c.needsFetching=e[5].needsFetching,re((()=>l=!1))),!i&&32&o[0]&&(i=!0,c.url=e[5].displayUrl,re((()=>i=!1))),n.$set(c),2048&o[0]&&M(t,"float",e[11])},i(e){a||(he(n.$$.fragment,e),e&&ne((()=>{c||(c=ve(t,fs,{x:50,duration:200},!0)),c.run(1)})),a=!0)},o(e){me(n.$$.fragment,e),e&&(c||(c=ve(t,fs,{x:50,duration:200},!1)),c.run(0)),a=!1},d(e){e&&C(t),Te(n),e&&c&&c.end(),u=!1,o(d)}}}function ll(e){let t,n,r,s,l,i,c,a,u,d;function p(t){e[35](t)}function f(t){e[36](t)}function h(t){e[37](t)}function m(t){e[38](t)}let g={canFetch:!!e[6].apiUrl,hideControls:!0,close:e[34]};return void 0!==e[6].title&&(g.title=e[6].title),void 0!==e[6].transformedContent&&(g.content=e[6].transformedContent),void 0!==e[6].needsFetching&&(g.needsFetching=e[6].needsFetching),void 0!==e[6].displayUrl&&(g.url=e[6].displayUrl),n=new Us({props:g}),J.push((()=>Ee(n,"title",p))),J.push((()=>Ee(n,"content",f))),J.push((()=>Ee(n,"needsFetching",h))),J.push((()=>Ee(n,"url",m))),{c(){t=O("div"),Se(n.$$.fragment),R(t,"class","svelte-zxr0xc"),M(t,"float",e[11])},m(r,o){S(r,t,o),Ce(n,t,null),a=!0,u||(d=[N(t,"introend",e[39]),N(t,"outrostart",e[40]),N(t,"outroend",e[41])],u=!0)},p(e,o){const c={};64&o[0]&&(c.canFetch=!!e[6].apiUrl),578&o[0]&&(c.close=e[34]),!r&&64&o[0]&&(r=!0,c.title=e[6].title,re((()=>r=!1))),!s&&64&o[0]&&(s=!0,c.content=e[6].transformedContent,re((()=>s=!1))),!l&&64&o[0]&&(l=!0,c.needsFetching=e[6].needsFetching,re((()=>l=!1))),!i&&64&o[0]&&(i=!0,c.url=e[6].displayUrl,re((()=>i=!1))),n.$set(c),2048&o[0]&&M(t,"float",e[11])},i(e){a||(he(n.$$.fragment,e),e&&ne((()=>{c||(c=ve(t,fs,{x:50,duration:200},!0)),c.run(1)})),a=!0)},o(e){me(n.$$.fragment,e),e&&(c||(c=ve(t,fs,{x:50,duration:200},!1)),c.run(0)),a=!1},d(e){e&&C(t),Te(n),e&&c&&c.end(),u=!1,o(d)}}}function il(e){let t,n,r,s,l,i,c,a,u,d,p,f,h,m,g;function v(t){e[24](t)}function $(t){e[25](t)}let b={edit:!0,onSubmit:e[23],$$slots:{default:[ol]},$$scope:{ctx:e}};void 0!==e[1].title&&(b.title=e[1].title),void 0!==e[1].author&&(b.author=e[1].author),s=new Vs({props:b}),J.push((()=>Ee(s,"title",v))),J.push((()=>Ee(s,"author",$)));let y=e[4]>=0&&sl(e),w=e[9]&&ll(e);return{c(){t=D("You are editing:\n\n"),n=O("div"),r=O("div"),Se(s.$$.fragment),c=A(),y&&y.c(),a=A(),w&&w.c(),u=A(),d=O("button"),d.textContent="Save",p=A(),f=O("a"),f.textContent="Cancel",R(r,"class","svelte-zxr0xc"),M(r,"hide",e[10]),R(n,"class","list svelte-zxr0xc"),R(d,"type","submit"),R(f,"href","#cancel"),R(f,"class","small")},m(o,l){S(o,t,l),S(o,n,l),x(n,r),Ce(s,r,null),x(n,c),y&&y.m(n,null),x(n,a),w&&w.m(n,null),S(o,u,l),S(o,d,l),S(o,p,l),S(o,f,l),h=!0,m||(g=[N(d,"click",e[42]),N(f,"click",F(e[43]))],m=!0)},p(e,t){const o={};3&t[0]&&(o.onSubmit=e[23]),990&t[0]|16777216&t[1]&&(o.$$scope={dirty:t,ctx:e}),!l&&2&t[0]&&(l=!0,o.title=e[1].title,re((()=>l=!1))),!i&&2&t[0]&&(i=!0,o.author=e[1].author,re((()=>i=!1))),s.$set(o),1024&t[0]&&M(r,"hide",e[10]),e[4]>=0?y?(y.p(e,t),16&t[0]&&he(y,1)):(y=sl(e),y.c(),he(y,1),y.m(n,a)):y&&(pe(),me(y,1,1,(()=>{y=null})),fe()),e[9]?w?(w.p(e,t),512&t[0]&&he(w,1)):(w=ll(e),w.c(),he(w,1),w.m(n,null)):w&&(pe(),me(w,1,1,(()=>{w=null})),fe())},i(e){h||(he(s.$$.fragment,e),he(y),he(w),h=!0)},o(e){me(s.$$.fragment,e),me(y),me(w),h=!1},d(e){e&&C(t),e&&C(n),Te(s),y&&y.d(),w&&w.d(),e&&C(u),e&&C(d),e&&C(p),e&&C(f),m=!1,o(g)}}}const cl=50,al=200;function ul(e,t,n){let r,o;a(e,$n,(e=>n(45,r=e))),a(e,bn,(e=>n(46,o=e)));let{stage:s}=t;const l=(i=o,Object.assign(Object.assign({},i),{chapters:i.chapters.map((e=>Object.assign({},e)))}));var i;const c=o;let u,d,p,f,h,m=0,g=-1,v=!1;const $=e=>e+cl*m,b=e=>{e.displayUrl&&(r.series.type===zt.GENERIC?e.apiUrl=e.displayUrl:e.apiUrl=Lt(e.displayUrl))};let y={pre:null,pages:[],post:null},w=!1,x=!0;return e.$$set=e=>{"stage"in e&&n(0,s=e.stage)},e.$$.update=()=>{2&e.$$.dirty[0]&&n(3,d=Math.ceil(c.chapters.length/cl-1)),6&e.$$.dirty[0]&&n(8,p=c.chapters.slice(m*cl,(m+1)*cl)),18&e.$$.dirty[0]&&n(5,f=g>=0?c.chapters[g]:void 0),140&e.$$.dirty[0]&&(n(7,y.pages=((e,t)=>{const n=new Array(t-e+1);for(let r=e;r<=t;r++)n[r-e]=r;return n})(Math.max(0,m-3),Math.min(d,m+3)),y),n(7,y.pre=0!==y.pages[0]?1:null,y),n(7,y.post=y.pages[y.pages.length-1]!==d?d+1:null,y)),32&e.$$.dirty[0]&&f&&b(f),64&e.$$.dirty[0]&&h&&b(h)},[s,c,m,d,g,f,h,y,p,v,w,x,l,$,e=>{e<1||(e===g&&n(4,--g),c.chapters.splice(e-1,2,c.chapters[e],c.chapters[e-1]),n(1,c))},e=>{e>=c.chapters.length||(e===g&&n(4,++g),c.chapters.splice(e,2,c.chapters[e+1],c.chapters[e]),n(1,c))},e=>{n(4,g=-1),c.chapters.splice(e,1),n(1,c)},e=>{if(m==e){const t=prompt("New page:",""+(m+1)),n=+t;null!==t&&!isNaN(n)&&n>0&&n<=d+1&&(e=n-1)}u=Math.sign(e-m),n(2,m=e)},e=>{(e=>{c.chapters.splice(m*cl,cl,...e.detail.items),n(1,c)})(e)},b,e=>n(4,g=$(e)),()=>{n(9,v=!0),n(6,h={id:Et(),title:"",apiUrl:"",displayUrl:""})},()=>n(1,c.chapters=[],c),()=>s.next(c),function(t){e.$$.not_equal(c.title,t)&&(c.title=t,n(1,c))},function(t){e.$$.not_equal(c.author,t)&&(c.author=t,n(1,c))},()=>{b(f),n(4,g=-1)},function(t){e.$$.not_equal(f.title,t)&&(f.title=t,n(5,f),n(4,g),n(1,c))},function(t){e.$$.not_equal(f.transformedContent,t)&&(f.transformedContent=t,n(5,f),n(4,g),n(1,c))},function(t){e.$$.not_equal(f.needsFetching,t)&&(f.needsFetching=t,n(5,f),n(4,g),n(1,c))},function(t){e.$$.not_equal(f.displayUrl,t)&&(f.displayUrl=t,n(5,f),n(4,g),n(1,c))},()=>{n(10,w=!0),n(11,x=!1)},()=>{n(11,x=!0)},()=>{n(10,w=!1)},()=>{b(h),c.chapters.push(h),n(1,c),n(9,v=!1)},function(t){e.$$.not_equal(h.title,t)&&(h.title=t,n(6,h))},function(t){e.$$.not_equal(h.transformedContent,t)&&(h.transformedContent=t,n(6,h))},function(t){e.$$.not_equal(h.needsFetching,t)&&(h.needsFetching=t,n(6,h))},function(t){e.$$.not_equal(h.displayUrl,t)&&(h.displayUrl=t,n(6,h))},()=>{n(10,w=!0),n(11,x=!1)},()=>{n(11,x=!0)},()=>{n(10,w=!1)},()=>s.next(c),()=>s.next(l)]}const dl=class extends Le{constructor(e){super(),Oe(this,e,ul,il,l,{stage:0},null,[-1,-1])}};function pl(e,t,n){const r=e.slice();return r[19]=t[n],r}function fl(e){let t,n,r,o;return t=new yt({props:{error:e[22],retry:e[14]}}),r=new ft({props:{backToSearch:e[2]}}),{c(){Se(t.$$.fragment),n=A(),Se(r.$$.fragment)},m(e,s){Ce(t,e,s),S(e,n,s),Ce(r,e,s),o=!0},p(e,n){const o={};16&n&&(o.error=e[22]),16&n&&(o.retry=e[14]),t.$set(o);const s={};4&n&&(s.backToSearch=e[2]),r.$set(s)},i(e){o||(he(t.$$.fragment,e),he(r.$$.fragment,e),o=!0)},o(e){me(t.$$.fragment,e),me(r.$$.fragment,e),o=!1},d(e){Te(t,e),e&&C(n),Te(r,e)}}}function hl(e){let t,n,r,s,l,i,c,a,u,d,p,f,h,m;function g(e,t){return 16&t&&(l=null),null==l&&(l=!!e[18].chapters.find(Cl)),l?xl:wl}r=new Vs({props:{title:e[18].title,author:e[18].author,url:e[1].url,$$slots:{default:[yl]},$$scope:{ctx:e}}});let v=g(e,-1),$=v(e);return p=new ft({props:{backToSearch:e[2]}}),{c(){t=D("Got the following series:\n\n "),n=O("div"),Se(r.$$.fragment),s=A(),$.c(),i=A(),c=O("button"),c.textContent="Edit book",a=A(),u=O("button"),u.textContent="Export",d=A(),Se(p.$$.fragment),R(n,"class","list svelte-1hsynpq")},m(o,l){S(o,t,l),S(o,n,l),Ce(r,n,null),S(o,s,l),$.m(o,l),S(o,i,l),S(o,c,l),S(o,a,l),S(o,u,l),S(o,d,l),Ce(p,o,l),f=!0,h||(m=[N(c,"click",e[12]),N(u,"click",e[13])],h=!0)},p(e,t){const n={};16&t&&(n.title=e[18].title),16&t&&(n.author=e[18].author),2&t&&(n.url=e[1].url),8388633&t&&(n.$$scope={dirty:t,ctx:e}),r.$set(n),v===(v=g(e,t))&&$?$.p(e,t):($.d(1),$=v(e),$&&($.c(),$.m(i.parentNode,i)));const o={};4&t&&(o.backToSearch=e[2]),p.$set(o)},i(e){f||(he(r.$$.fragment,e),he(p.$$.fragment,e),f=!0)},o(e){me(r.$$.fragment,e),me(p.$$.fragment,e),f=!1},d(e){e&&C(t),e&&C(n),Te(r),e&&C(s),$.d(e),e&&C(i),e&&C(c),e&&C(a),e&&C(u),e&&C(d),Te(p,e),h=!1,o(m)}}}function ml(e){let t;return{c(){t=D("hide")},m(e,n){S(e,t,n)},d(e){e&&C(t)}}}function gl(e){let t;return{c(){t=D("show")},m(e,n){S(e,t,n)},d(e){e&&C(t)}}}function vl(e){let t,n,r,o,s,l,i=e[0].newChapters+"";return{c(){t=O("span"),n=D("Found "),r=D(i),o=D(" new")},m(i,c){S(i,t,c),x(t,n),x(t,r),x(t,o),s||(l=N(t,"click",e[9]),s=!0)},p(e,t){1&t&&i!==(i=e[0].newChapters+"")&&U(r,i)},d(e){e&&C(t),s=!1,l()}}}function $l(e){let t,n,r,o=[],s=new Map,l=e[18].chapters;const i=e=>e[19].id;for(let t=0;t{n||(n=ve(t,Ft,{},!0)),n.run(1)})),r=!0)},o(e){n||(n=ve(t,Ft,{},!1)),n.run(0),r=!1},d(e){e&&C(t);for(let e=0;e{k=null})),fe())},i(e){h||(he(k),h=!0)},o(e){me(k),h=!1},d(e){e&&C(t),y.d(),w&&w.d(),e&&C(p),k&&k.d(e),e&&C(f),m=!1,o(g)}}}function wl(t){let n,r,o;return{c(){n=O("button"),n.textContent="Generate EPUB"},m(e,s){S(e,n,s),r||(o=N(n,"click",t[11]),r=!0)},p:e,d(e){e&&C(n),r=!1,o()}}}function xl(t){let n,r,o;return{c(){n=O("button"),n.textContent="Fetch chapter contents"},m(e,s){S(e,n,s),r||(o=N(n,"click",t[10]),r=!0)},p:e,d(e){e&&C(n),r=!1,o()}}}function kl(e){let t,n;return t=new kt({props:{$$slots:{default:[El]},$$scope:{ctx:e}}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};8388608&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function El(e){let t;return{c(){t=D("Please wait, fetching data...")},m(e,n){S(e,t,n)},d(e){e&&C(t)}}}function Sl(e){let t,n,r,o={ctx:e,current:null,token:null,hasCatch:!0,pending:kl,then:hl,catch:fl,value:18,error:22,blocks:[,,,]};return $e(n=e[4],o),{c(){t=_(),o.block.c()},m(e,n){S(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,r=!0},p(t,[r]){e=t,o.ctx=e,16&r&&n!==(n=e[4])&&$e(n,o)||be(o,e,r)},i(e){r||(he(o.block),r=!0)},o(e){for(let e=0;e<3;e+=1)me(o.blocks[e]);r=!1},d(e){e&&C(t),o.block.d(e),o.token=null,o=null}}}const Cl=e=>!1!==e.needsFetching&&e.apiUrl;function Tl(e,t,n){let r,o,s;a(e,bn,(e=>n(15,r=e))),a(e,$n,(e=>n(16,o=e))),a(e,Be,(e=>n(17,s=e)));let{stage:l}=t,{series:i}=t,{backToSearch:c}=t,u=!1;const d=()=>r?Promise.resolve(r):(async e=>{var t,n,r;const o=await Ct(new URL(e.url)),s=await qt(e,o);if(!o.ok)throw""+(null!==(n=null!==(t=s.message)&&void 0!==t?t:o.statusText)&&void 0!==n?n:o.status);const l=((e,t)=>{switch(e){case zt.HFY_SERIES:return(({data:{content_md:e,content_html:t}})=>{var n,r,o;const s=(new DOMParser).parseFromString(At(t),"text/html").querySelectorAll("a[href]");return{author:null===(n=e.match(/\[\*\*(?:Author\s*[-:]\s*)?([^*\]]+)\*\*\]|A Story By \[(?:\*\*)?([^\]]+?)(?:\*\*)?\]/i).slice(1).find(Boolean))||void 0===n?void 0:n.trim(),title:null===(o=null===(r=e.match(/##?\s*\*\*(.+)\*\*/))||void 0===r?void 0:r[1])||void 0===o?void 0:o.trim(),chapters:Array.from(s).filter((e=>e.getAttribute("href").match(jt))).map((e=>{const t=e.getAttribute("href").startsWith("http")?e.getAttribute("href"):`https://www.reddit.com${e.getAttribute("href")}`;return{id:Et(),title:e.textContent.trim(),apiUrl:Lt(t),displayUrl:t}}))}})(t);case zt.POST:return(e=>({author:e[0].data.children[0].data.author,title:e[0].data.children[0].data.title,chapters:[Ht(e)]}))(t);case zt.GENERIC:return(e=>{const t=_t(e);return{title:t.title,author:"unknown",chapters:Array.from(t.querySelectorAll("ul a, ol a")).map((e=>({displayUrl:e.href,apiUrl:e.href,id:Et(),title:e.innerHTML})))}})(t)}throw new Error(`Getting data from source type \`${zt[e]}\` not supported, this should never happen`)})(e.type,s);if(!(null===(r=null==l?void 0:l.chapters)||void 0===r?void 0:r.length))throw new Error("No chapters found");return l})(i).then((e=>{const t=Object.assign(Object.assign({},e),{chapters:en(s,e.chapters)});return bn.update((()=>t)),t}));let p=d();const f=()=>{const e=JSON.stringify({bookData:r,series:o.series});at()(new Blob([e]),`${At(r.author)} - ${At(r.title)}.json`,"application/json")};return e.$$set=e=>{"stage"in e&&n(0,l=e.stage),"series"in e&&n(1,i=e.series),"backToSearch"in e&&n(2,c=e.backToSearch)},[l,i,c,u,p,d,f,()=>n(3,u=!u),()=>l.findMore(),()=>n(0,l.newChapters=void 0,l),()=>l.downloadAll(),()=>l.next(),()=>l.edit(),()=>f(),()=>n(4,p=d())]}const Ol=class extends Le{constructor(e){super(),Oe(this,e,Tl,Sl,l,{stage:0,series:1,backToSearch:2})}};function Ll(e,t,n){const r=e.slice();return r[7]=t[n],r}function Dl(e){let t,n;return t=new yt({props:{error:e[10],retry:e[5]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.error=e[10]),4&n&&(r.retry=e[5]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function Al(t){let n,r,o,s,l,i,c,a,u=t[6],d=[];for(let e=0;et.parentNode,o.anchor=t,r=!0},p(t,[r]){e=t,o.ctx=e,4&r&&n!==(n=e[2])&&$e(n,o)||be(o,e,r)},i(e){r||(he(o.block),r=!0)},o(e){for(let e=0;e<3;e+=1)me(o.blocks[e]);r=!1},d(e){e&&C(t),o.block.d(e),o.token=null,o=null}}}function Ul(e,t,n){let{stage:r}=t,{search:o}=t;const s=()=>Mt(o).then((e=>{if(!e.length)throw new Error(`No series matched input \`${o}\``);return e}));let l=s();return e.$$set=e=>{"stage"in e&&n(0,r=e.stage),"search"in e&&n(1,o=e.search)},[r,o,l,s,e=>r.next({url:e.url,type:zt.HFY_SERIES}),()=>n(2,l=s())]}const Il=class extends Le{constructor(e){super(),Oe(this,e,Ul,Rl,l,{stage:0,search:1})}};function Ml(e,t,n){const r=e.slice();return r[9]=t[n],r}function Pl(t){let n,r,s,l,i,c,a,u,d,p,f;return{c(){n=O("form"),r=O("p"),s=D("Import:\n "),l=O("input"),i=A(),c=O("input"),u=A(),d=O("p"),d.textContent="Please only upload genuine backups, as there is no schema checking currently.",R(l,"id","upload"),R(l,"type","file"),R(l,"accept","application/json,*.json"),R(l,"name","files"),R(l,"size","30"),l.disabled=t[7],R(l,"class","svelte-ovxj9s"),R(c,"type","submit"),c.value="Go",R(c,"class","submit svelte-ovxj9s"),c.disabled=a=void 0===t[6]||t[7],R(r,"class","svelte-ovxj9s"),R(d,"class","small svelte-ovxj9s"),R(n,"class","form svelte-ovxj9s"),R(n,"enctype","multipart/form-data")},m(e,o){S(e,n,o),x(n,r),x(r,s),x(r,l),x(r,i),x(r,c),x(n,u),x(n,d),p||(f=[N(l,"change",t[25]),N(n,"submit",F(t[26]))],p=!0)},p(e,t){128&t&&(l.disabled=e[7]),192&t&&a!==(a=void 0===e[6]||e[7])&&(c.disabled=a)},i:e,o:e,d(e){e&&C(n),p=!1,o(f)}}}function Hl(t){let n,r,s,l,i,c,a,u,d,p,f,h;return{c(){n=O("form"),r=O("p"),r.textContent="Enter list of URLs:",s=A(),l=O("textarea"),i=A(),c=O("p"),c.textContent="One URL per line",a=A(),u=O("p"),d=O("input"),R(r,"class","svelte-ovxj9s"),R(l,"rows","5"),R(l,"placeholder",t[10]),l.disabled=t[7],R(l,"class","svelte-ovxj9s"),R(c,"class","small svelte-ovxj9s"),R(d,"type","submit"),d.value="Go",R(d,"class","submit svelte-ovxj9s"),d.disabled=p=void 0===t[4]||!t[4].trim().length||t[7],R(u,"class","svelte-ovxj9s"),R(n,"class","form svelte-ovxj9s")},m(e,o){S(e,n,o),x(n,r),x(n,s),x(n,l),I(l,t[4]),x(n,i),x(n,c),x(n,a),x(n,u),x(u,d),f||(h=[N(l,"input",t[23]),N(n,"submit",F(t[24]))],f=!0)},p(e,t){128&t&&(l.disabled=e[7]),16&t&&I(l,e[4]),144&t&&p!==(p=void 0===e[4]||!e[4].trim().length||e[7])&&(d.disabled=p)},i:e,o:e,d(e){e&&C(n),f=!1,o(h)}}}function zl(e){let t,n,r,s,l,i,c,a,u,d,p,f,h,m,g,v,$,b,y=void 0!==e[0]&&!e[0].trim().length,w=e[3]&&Bl(e),k=y&&Yl(),E=e[3]&&Kl();return{c(){t=O("form"),n=O("p"),r=D("Search:\n "),s=O("input"),l=A(),i=O("input"),a=A(),w&&w.c(),u=A(),k&&k.c(),d=A(),p=O("div"),E&&E.c(),f=A(),h=O("p"),h.textContent="You can:",m=A(),g=O("ul"),g.innerHTML='
  • Search for a series title on the r/HFY wiki
  • \n
  • Enter a series link to the r/HFY wiki
  • \n
  • Enter a link to any reddit post, or other link (see CORS)
  • ',R(s,"class","search svelte-ovxj9s"),R(s,"placeholder","Search or URL..."),s.disabled=e[7],R(i,"type","submit"),i.value="Go",R(i,"class","submit svelte-ovxj9s"),i.disabled=c=void 0===e[0]||!e[0].trim().length||e[7],R(n,"class","svelte-ovxj9s"),R(t,"class","form svelte-ovxj9s"),R(h,"class","spaceabove svelte-ovxj9s"),R(p,"class","overlay-wrapper svelte-ovxj9s")},m(o,c){S(o,t,c),x(t,n),x(n,r),x(n,s),I(s,e[0]),x(n,l),x(n,i),x(t,a),w&&w.m(t,null),e[22](t),S(o,u,c),k&&k.m(o,c),S(o,d,c),S(o,p,c),E&&E.m(p,null),x(p,f),x(p,h),x(p,m),x(p,g),v=!0,$||(b=[N(s,"input",e[19]),N(s,"keyup",e[13]),N(s,"blur",e[11]),N(s,"click",e[13]),N(t,"submit",F(e[21]))],$=!0)},p(e,n){(!v||128&n)&&(s.disabled=e[7]),1&n&&s.value!==e[0]&&I(s,e[0]),(!v||129&n&&c!==(c=void 0===e[0]||!e[0].trim().length||e[7]))&&(i.disabled=c),e[3]?w?w.p(e,n):(w=Bl(e),w.c(),w.m(t,null)):w&&(w.d(1),w=null),1&n&&(y=void 0!==e[0]&&!e[0].trim().length),y?k||(k=Yl(),k.c(),k.m(d.parentNode,d)):k&&(k.d(1),k=null),e[3]?E?8&n&&he(E,1):(E=Kl(),E.c(),he(E,1),E.m(p,f)):E&&(pe(),me(E,1,1,(()=>{E=null})),fe())},i(e){v||(he(E),v=!0)},o(e){me(E),v=!1},d(n){n&&C(t),w&&w.d(),e[22](null),n&&C(u),k&&k.d(n),n&&C(d),n&&C(p),E&&E.d(),$=!1,o(b)}}}function Bl(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Xl,then:ql,catch:Gl,value:27};return $e(n=e[12](e[9],e[0]),r),{c(){t=_(),r.block.c()},m(e,n){S(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t},p(t,o){e=t,r.ctx=e,513&o&&n!==(n=e[12](e[9],e[0]))&&$e(n,r)||be(r,e,o)},d(e){e&&C(t),r.block.d(e),r.token=null,r=null}}}function Gl(t){return{c:e,m:e,p:e,d:e}}function ql(e){let t,n=e[27],r=[];for(let t=0;t{n||(n=ve(t,ps,{duration:100},!0)),n.run(1)})),r=!0)},o(e){n||(n=ve(t,ps,{duration:100},!1)),n.run(0),r=!1},d(e){e&&C(t),e&&n&&n.end()}}}function Vl(e){let t,n,r,s,l,i,c,a,u,d,p,f,h,m,g,v,$,b,y;const w=[zl,Hl,Pl],k=[];function E(e,t){return e[5]==e[2].Search?0:e[5]==e[2].List?1:e[5]==e[2].Import?2:-1}return~(g=E(e))&&(v=k[g]=w[g](e)),{c(){t=O("div"),n=O("label"),r=O("input"),s=D("Search"),l=A(),i=O("label"),c=O("input"),a=D("URLs"),u=A(),d=O("label"),p=O("input"),f=D("Import"),h=A(),m=O("div"),v&&v.c(),R(r,"type","radio"),R(r,"name","mode"),r.__value="search",r.value=r.__value,R(r,"class","svelte-ovxj9s"),e[16][0].push(r),R(n,"class","svelte-ovxj9s"),M(n,"selected",e[5]==e[2].Search),R(c,"type","radio"),R(c,"name","mode"),c.__value="list",c.value=c.__value,R(c,"class","svelte-ovxj9s"),e[16][0].push(c),R(i,"class","svelte-ovxj9s"),M(i,"selected",e[5]==e[2].List),R(p,"type","radio"),R(p,"name","mode"),p.__value="import",p.value=p.__value,R(p,"class","svelte-ovxj9s"),e[16][0].push(p),R(d,"class","svelte-ovxj9s"),M(d,"selected",e[5]==e[2].Import),R(t,"class","mode-select svelte-ovxj9s"),R(m,"class","mode svelte-ovxj9s")},m(o,v){S(o,t,v),x(t,n),x(n,r),r.checked=r.__value===e[5],x(n,s),x(t,l),x(t,i),x(i,c),c.checked=c.__value===e[5],x(i,a),x(t,u),x(t,d),x(d,p),p.checked=p.__value===e[5],x(d,f),S(o,h,v),S(o,m,v),~g&&k[g].m(m,null),$=!0,b||(y=[N(r,"change",e[15]),N(c,"change",e[17]),N(p,"change",e[18])],b=!0)},p(e,[t]){32&t&&(r.checked=r.__value===e[5]),36&t&&M(n,"selected",e[5]==e[2].Search),32&t&&(c.checked=c.__value===e[5]),36&t&&M(i,"selected",e[5]==e[2].List),32&t&&(p.checked=p.__value===e[5]),36&t&&M(d,"selected",e[5]==e[2].Import);let o=g;g=E(e),g===o?~g&&k[g].p(e,t):(v&&(pe(),me(k[o],1,1,(()=>{k[o]=null})),fe()),~g?(v=k[g],v?v.p(e,t):(v=k[g]=w[g](e),v.c()),he(v,1),v.m(m,null)):v=null)},i(e){$||(he(v),$=!0)},o(e){me(v),$=!1},d(n){n&&C(t),e[16][0].splice(e[16][0].indexOf(r),1),e[16][0].splice(e[16][0].indexOf(c),1),e[16][0].splice(e[16][0].indexOf(p),1),n&&C(h),n&&C(m),~g&&k[g].d(),b=!1,o(y)}}}function Jl(e,t,n){let{stage:r}=t,{search:o}=t;var s;let l;!function(e){e.Search="search",e.List="list",e.Import="import"}(s||(s={}));let i,c,a,u=!1,d=s.Search,p=!1;const f=()=>{n(9,l=l||Mt().finally(f)),n(3,u=!!l&&!!o)},h=async()=>{n(7,p=!0);const e=new FileReader,t=new Promise(((t,n)=>{e.onload=t,e.onerror=n}));return e.readAsText(c),await t,n(7,p=!1),JSON.parse(e.result)};return e.$$set=e=>{"stage"in e&&n(1,r=e.stage),"search"in e&&n(0,o=e.search)},[o,r,s,u,i,d,c,p,a,l,"https://example.com/chapter1\nhttps://example.com/chapter2",e=>n(3,u=!!a&&a.contains(e.relatedTarget)),async(e,t)=>{if(!e)return[];const r=await e,o=t.toLowerCase(),s=r.filter((e=>-1!==e.title.toLowerCase().indexOf(o)));return s.length||n(3,u=!1),s},f,h,function(){d=this.__value,n(5,d)},[[]],function(){d=this.__value,n(5,d)},function(){d=this.__value,n(5,d)},function(){o=this.value,n(0,o)},e=>r.next(e.url),()=>r.next(o||""),function(e){J[e?"unshift":"push"]((()=>{a=e,n(8,a)}))},function(){i=this.value,n(4,i)},()=>r.fromList(i||""),e=>n(6,c=e.currentTarget.files[0]),async()=>r.fromJSON(await h())]}const Zl=class extends Le{constructor(e){super(),Oe(this,e,Jl,Vl,l,{stage:1,search:0})}};function Ql(t){let n,r,o,s;return{c(){n=L("svg"),r=L("g"),o=L("path"),s=L("path"),R(o,"d","M173.145,73.91c-0.413-2.722-2.29-4.993-4.881-5.912l-13.727-4.881c-0.812-2.3-1.733-4.536-2.754-6.699l6.247-13.146\n\t\tc1.179-2.479,0.899-5.411-0.729-7.628c-5.265-7.161-11.556-13.452-18.698-18.693c-2.219-1.629-5.141-1.906-7.625-0.724\n\t\tl-13.138,6.242c-2.163-1.021-4.402-1.94-6.704-2.752l-4.883-13.729c-0.919-2.586-3.184-4.458-5.9-4.876\n\t\tc-9.65-1.483-16.792-1.483-26.457,0c-2.713,0.418-4.981,2.29-5.9,4.876l-4.883,13.729c-2.302,0.812-4.541,1.731-6.702,2.752\n\t\tl-13.143-6.242c-2.479-1.181-5.406-0.904-7.623,0.724c-7.142,5.241-13.433,11.532-18.698,18.693\n\t\tc-1.629,2.217-1.908,5.148-0.729,7.628l6.247,13.146c-1.021,2.159-1.94,4.4-2.754,6.699L5.982,68.003\n\t\tc-2.589,0.919-4.463,3.189-4.879,5.907c-0.749,4.92-1.099,9.115-1.099,13.219c0,4.098,0.35,8.299,1.099,13.219\n\t\tc0.413,2.722,2.29,4.993,4.881,5.912l13.727,4.881c0.814,2.304,1.736,4.541,2.754,6.704l-6.247,13.141\n\t\tc-1.179,2.479-0.899,5.411,0.727,7.623c5.258,7.156,11.549,13.447,18.7,18.698c2.217,1.629,5.144,1.911,7.625,0.724l13.138-6.242\n\t\tc2.163,1.021,4.402,1.94,6.704,2.752l4.883,13.729c0.919,2.586,3.184,4.458,5.9,4.876c4.828,0.744,9.154,1.104,13.228,1.104\n\t\tc4.074,0,8.401-0.36,13.228-1.104c2.715-0.418,4.981-2.29,5.9-4.876l4.883-13.729c2.302-0.812,4.541-1.731,6.704-2.752\n\t\tl13.138,6.242c2.484,1.186,5.411,0.904,7.628-0.724c7.159-5.26,13.45-11.551,18.698-18.698c1.626-2.212,1.906-5.144,0.727-7.623\n\t\tl-6.247-13.141c1.021-2.163,1.942-4.405,2.754-6.704l13.727-4.881c2.591-0.919,4.468-3.189,4.881-5.912\n\t\tc0.749-4.92,1.099-9.12,1.099-13.219S173.894,78.829,173.145,73.91z M158.949,93.72l-12.878,4.58\n\t\tc-2.251,0.797-3.982,2.625-4.66,4.92c-1.15,3.889-2.664,7.569-4.504,10.943c-1.142,2.1-1.213,4.619-0.187,6.777l5.841,12.285\n\t\tc-2.822,3.389-5.943,6.515-9.337,9.334l-12.283-5.834c-2.161-1.036-4.672-0.953-6.775,0.185c-3.379,1.838-7.061,3.35-10.953,4.502\n\t\tc-2.29,0.676-4.118,2.406-4.917,4.657l-4.582,12.883c-4.677,0.476-8.503,0.476-13.18,0l-4.582-12.883\n\t\tc-0.8-2.246-2.628-3.982-4.917-4.657c-3.894-1.152-7.579-2.664-10.953-4.502c-2.103-1.147-4.619-1.22-6.775-0.185l-12.283,5.839\n\t\tc-3.391-2.825-6.512-5.946-9.337-9.339l5.841-12.285c1.026-2.159,0.955-4.677-0.187-6.777c-1.835-3.364-3.35-7.049-4.504-10.948\n\t\tc-0.678-2.29-2.411-4.118-4.66-4.915l-12.878-4.58c-0.243-2.343-0.36-4.502-0.36-6.592s0.117-4.244,0.36-6.587l12.881-4.584\n\t\tc2.248-0.797,3.979-2.625,4.657-4.915c1.152-3.889,2.667-7.574,4.504-10.953c1.142-2.095,1.213-4.619,0.187-6.772l-5.841-12.285\n\t\tc2.827-3.393,5.948-6.519,9.337-9.339l12.288,5.839c2.151,1.036,4.677,0.953,6.775-0.185c3.372-1.838,7.054-3.35,10.948-4.502\n\t\tc2.29-0.676,4.118-2.411,4.917-4.657l4.582-12.883c4.633-0.481,8.466-0.481,13.18,0l4.582,12.883\n\t\tc0.8,2.246,2.628,3.982,4.917,4.657c3.894,1.152,7.579,2.664,10.953,4.502c2.103,1.147,4.614,1.22,6.775,0.185l12.283-5.839\n\t\tc3.389,2.82,6.51,5.946,9.337,9.339l-5.841,12.285c-1.026,2.154-0.955,4.677,0.187,6.772c1.843,3.389,3.357,7.069,4.504,10.948\n\t\tc0.678,2.295,2.409,4.123,4.66,4.92l12.878,4.58c0.243,2.343,0.36,4.502,0.36,6.592S159.192,91.377,158.949,93.72z"),R(s,"d","M87.124,50.802c-19.062,0-34.571,15.508-34.571,34.571s15.508,34.571,34.571,34.571s34.571-15.508,34.571-34.571\n\t\tS106.186,50.802,87.124,50.802z M87.124,105.009c-10.827,0-19.636-8.809-19.636-19.636s8.809-19.636,19.636-19.636\n\t\ts19.636,8.809,19.636,19.636S97.951,105.009,87.124,105.009z"),R(n,"version","1.1"),R(n,"xmlns","http://www.w3.org/2000/svg"),R(n,"xmlns:xlink","http://www.w3.org/1999/xlink"),R(n,"x","0px"),R(n,"y","0px"),R(n,"viewBox","0 0 174.248 174.248"),R(n,"xml:space","preserve")},m(e,t){S(e,n,t),x(n,r),x(r,o),x(r,s)},p:e,i:e,o:e,d(e){e&&C(n)}}}const ei=class extends Le{constructor(e){super(),Oe(this,e,null,Ql,l,{})}};function ti(e){let t,n;const r=e[1].default,o=u(r,e,e[0],null);return{c(){t=O("p"),o&&o.c(),R(t,"class","info alert svelte-1mwdlru")},m(e,r){S(e,t,r),o&&o.m(t,null),n=!0},p(e,[t]){o&&o.p&&(!n||1&t)&&f(o,r,e,e[0],n?p(r,e[0],t,null):h(e[0]),null)},i(e){n||(he(o,e),n=!0)},o(e){me(o,e),n=!1},d(e){e&&C(t),o&&o.d(e)}}}function ni(e,t,n){let{$$slots:r={},$$scope:o}=t;return e.$$set=e=>{"$$scope"in e&&n(0,o=e.$$scope)},[o,r]}const ri=class extends Le{constructor(e){super(),Oe(this,e,ni,ti,l,{})}};function oi(t){let n,r,o;return{c(){n=D("Due to "),r=O("a"),r.textContent="recent API changes on reddit",o=D(', creating ebooks has become limited. If you run into a "Too many requests" error, please wait 10 minutes before trying again.'),R(r,"href","https://www.redditinc.com/blog/apifacts"),R(r,"target","_blank"),R(r,"class","svelte-ntsh7z")},m(e,t){S(e,n,t),S(e,r,t),S(e,o,t)},p:e,d(e){e&&C(n),e&&C(r),e&&C(o)}}}function si(t){let n,r,o,s,l;return{c(){n=D("When generating an ebook via URL, please be aware of "),r=O("code"),r.textContent="NetworkError",o=D("s, see "),s=O("a"),s.textContent="CORS",l=D("."),R(r,"class","svelte-ntsh7z"),R(s,"href","https://github.com/cpiber/hfy-epub/blob/master/docs/other/cors.md"),R(s,"target","_blank"),R(s,"class","svelte-ntsh7z")},m(e,t){S(e,n,t),S(e,r,t),S(e,o,t),S(e,s,t),S(e,l,t)},p:e,d(e){e&&C(n),e&&C(r),e&&C(o),e&&C(s),e&&C(l)}}}function li(e){let t,n,r,o,s,l,i;return o=new ri({props:{$$slots:{default:[oi]},$$scope:{ctx:e}}}),l=new ri({props:{$$slots:{default:[si]},$$scope:{ctx:e}}}),{c(){t=O("header"),n=O("h1"),n.innerHTML='r/HFY epub generator Help',r=A(),Se(o.$$.fragment),s=A(),Se(l.$$.fragment),R(n,"class","svelte-ntsh7z"),R(t,"class","svelte-ntsh7z")},m(e,c){S(e,t,c),x(t,n),x(t,r),Ce(o,t,null),x(t,s),Ce(l,t,null),i=!0},p(e,[t]){const n={};1&t&&(n.$$scope={dirty:t,ctx:e}),o.$set(n);const r={};1&t&&(r.$$scope={dirty:t,ctx:e}),l.$set(r)},i(e){i||(he(o.$$.fragment,e),he(l.$$.fragment,e),i=!0)},o(e){me(o.$$.fragment,e),me(l.$$.fragment,e),i=!1},d(e){e&&C(t),Te(o),Te(l)}}}const ii=class extends Le{constructor(e){super(),Oe(this,e,null,li,l,{})}};function ci(t){let n,r,o,s,l,i,c,a;return{c(){n=O("p"),r=D("This website ("),o=O("a"),o.textContent="https://cpiber.github.io/hfy-epub",s=D(") does not, and will not, collect any data from its users.\n Any actions taken on this page are purely in the user's browser; there is no server-side component.\n No data is ever sent away.\n For collecting the chapter data, this site contacts "),l=O("code"),l.textContent="www.reddit.com",i=D(" only. The book is generated in the browser."),R(o,"href","https://cpiber.github.io/hfy-epub"),R(o,"target","_blank"),R(n,"class","small svelte-1f8pws6")},m(e,t){S(e,n,t),x(n,r),x(n,o),x(n,s),x(n,l),x(n,i),a=!0},p:e,i(e){a||(ne((()=>{c||(c=ve(n,Ft,{},!0)),c.run(1)})),a=!0)},o(e){c||(c=ve(n,Ft,{},!1)),c.run(0),a=!1},d(e){e&&C(n),e&&c&&c.end()}}}function ai(e){let t,n,r,o,s;return{c(){t=O("label"),n=O("input"),r=D(" Use TinyMCE chapter editor"),R(n,"type","checkbox"),R(n,"aria-label","use TinyMCE editor"),R(n,"class","svelte-1f8pws6"),R(t,"class","small svelte-1f8pws6")},m(l,i){S(l,t,i),x(t,n),n.checked=e[2].useTiny,x(t,r),o||(s=N(n,"change",e[4]),o=!0)},p(e,t){4&t&&(n.checked=e[2].useTiny)},d(e){e&&C(t),o=!1,s()}}}function ui(e){let t,n,r,o,s,l,i,c,a,u,d,p,f,h,m,g,v=!vn(e[1].stage,tn.SETTINGS),$=e[0]&&ci(),b=v&&ai(e);return{c(){t=O("footer"),n=O("p"),r=D("Made by "),o=O("a"),o.textContent="@cpiber",s=D(".\n Source Code & bug tracker: "),l=O("a"),l.textContent="cpiber/hfy-epub",i=D(".\n \n Version "),c=D("0.3.1"),a=D(".\n "),u=O("a"),u.textContent="Privacy",d=D("."),p=A(),$&&$.c(),f=A(),b&&b.c(),R(o,"href","https://github.com/cpiber"),R(o,"target","_blank"),R(l,"href","https://github.com/cpiber/hfy-epub"),R(l,"target","_blank"),R(u,"href","#privacy"),R(n,"class","small svelte-1f8pws6"),R(t,"class","svelte-1f8pws6")},m(v,y){S(v,t,y),x(t,n),x(n,r),x(n,o),x(n,s),x(n,l),x(n,i),x(n,c),x(n,a),x(n,u),x(n,d),x(t,p),$&&$.m(t,null),x(t,f),b&&b.m(t,null),h=!0,m||(g=N(u,"click",F(e[3])),m=!0)},p(e,[n]){e[0]?$?($.p(e,n),1&n&&he($,1)):($=ci(),$.c(),he($,1),$.m(t,f)):$&&(pe(),me($,1,1,(()=>{$=null})),fe()),2&n&&(v=!vn(e[1].stage,tn.SETTINGS)),v?b?b.p(e,n):(b=ai(e),b.c(),b.m(t,null)):b&&(b.d(1),b=null)},i(e){h||(he($),h=!0)},o(e){me($),h=!1},d(e){e&&C(t),$&&$.d(),b&&b.d(),m=!1,g()}}}function di(e,t,n){let r,o;a(e,$n,(e=>n(1,r=e))),a(e,Be,(e=>n(2,o=e)));let s=!1;return[s,r,o,()=>n(0,s=!s),function(){o.useTiny=this.checked,Be.set(o)}]}const pi=class extends Le{constructor(e){super(),Oe(this,e,di,ui,l,{})}};function fi(t){let n,r,o,s,l,i;return r=new ks({}),{c(){n=O("a"),Se(r.$$.fragment),o=D(" home"),R(n,"href","#home"),R(n,"class","homelink svelte-ibaoy7")},m(e,c){S(e,n,c),Ce(r,n,null),x(n,o),s=!0,l||(i=N(n,"click",F(t[6])),l=!0)},p:e,i(e){s||(he(r.$$.fragment,e),s=!0)},o(e){me(r.$$.fragment,e),s=!1},d(e){e&&C(n),Te(r),l=!1,i()}}}function hi(t){let n,r,o,s,l;return r=new ei({}),{c(){n=O("a"),Se(r.$$.fragment),R(n,"href","#settings"),R(n,"class","settingslink svelte-ibaoy7")},m(e,i){S(e,n,i),Ce(r,n,null),o=!0,s||(l=N(n,"click",F(t[3])),s=!0)},p:e,i(e){o||(he(r.$$.fragment,e),o=!0)},o(e){me(r.$$.fragment,e),o=!1},d(e){e&&C(n),Te(r),s=!1,l()}}}function mi(t){let n,r,o,s,l,i;return r=new ks({}),{c(){n=O("a"),Se(r.$$.fragment),o=D(" back"),R(n,"href","#home"),R(n,"class","homelink svelte-ibaoy7")},m(e,c){S(e,n,c),Ce(r,n,null),x(n,o),s=!0,l||(i=N(n,"click",F(t[7])),l=!0)},p:e,i(e){s||(he(r.$$.fragment,e),s=!0)},o(e){me(r.$$.fragment,e),s=!1},d(e){e&&C(n),Te(r),l=!1,i()}}}function gi(t){let n,r,o;return{c(){n=O("h2"),n.textContent="Page not found",r=A(),o=O("p"),o.textContent="Sorry, the requested page could not be found"},m(e,t){S(e,n,t),S(e,r,t),S(e,o,t)},p:e,i:e,o:e,d(e){e&&C(n),e&&C(r),e&&C(o)}}}function vi(t){let n,r;return n=new it({}),{c(){Se(n.$$.fragment)},m(e,t){Ce(n,e,t),r=!0},p:e,i(e){r||(he(n.$$.fragment,e),r=!0)},o(e){me(n.$$.fragment,e),r=!1},d(e){Te(n,e)}}}function $i(e){let t,n;return t=new jn({props:{stage:e[0],backToSearch:e[2]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),4&n&&(r.backToSearch=e[2]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function bi(e){let t,n;return t=new Qn({props:{stage:e[0]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function yi(e){let t,n;return t=new cr({props:{stage:e[0]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function wi(e){let t,n;return t=new dl({props:{stage:e[0]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function xi(e){let t,n;return t=new Ol({props:{stage:e[0],series:e[1].series,backToSearch:e[2]}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),2&n&&(r.series=e[1].series),4&n&&(r.backToSearch=e[2]),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function ki(e){let t,n;return t=new Il({props:{stage:e[0],search:e[1].search}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),2&n&&(r.search=e[1].search),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function Ei(e){let t,n;return t=new Zl({props:{stage:e[0],search:e[1].search}}),{c(){Se(t.$$.fragment)},m(e,r){Ce(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.stage=e[0]),2&n&&(r.search=e[1].search),t.$set(r)},i(e){n||(he(t.$$.fragment,e),n=!0)},o(e){me(t.$$.fragment,e),n=!1},d(e){Te(t,e)}}}function Si(e){let t,n,r,o,s,l,i,c,a,u,d,p,f,h,m,g,v,$,b,y,w,k,E,T,L=!vn(e[0],tn.INPUT)&&!vn(e[0],tn.SETTINGS),D=L&&fi(e);const _=[mi,hi],N=[];function F(e,t){return 1&t&&(o=null),null==o&&(o=!!vn(e[0],tn.SETTINGS)),o?0:1}s=F(e,-1),l=N[s]=_[s](e),c=new ii({});const j=[Ei,ki,xi,wi,yi,bi,$i,vi,gi],U=[];function I(e,t){return 1&t&&(d=null),1&t&&(p=null),1&t&&(f=null),1&t&&(h=null),1&t&&(m=null),1&t&&(g=null),1&t&&(v=null),1&t&&($=null),1&t&&(b=null),null==d&&(d=!!vn(e[0],tn.INPUT)),d?0:(null==p&&(p=!!vn(e[0],tn.SEARCH)),p?1:(null==f&&(f=!!vn(e[0],tn.BOOK_DATA)),f?2:(null==h&&(h=!!vn(e[0],tn.EDIT_DATA)),h?3:(null==m&&(m=!!vn(e[0],tn.FIND_CHAPTERS)),m?4:(null==g&&(g=!!vn(e[0],tn.DOWNLOAD_CHAPTERS)),g?5:(null==v&&(v=!!vn(e[0],tn.RESULT)),v?6:(null==$&&($=!!vn(e[0],tn.SETTINGS)),$?7:(null==b&&(b=!!vn(e[0],tn._404)),b?8:-1))))))))}return~(y=I(e,-1))&&(w=U[y]=j[y](e)),E=new pi({}),{c(){t=O("div"),n=O("nav"),D&&D.c(),r=A(),l.c(),i=A(),Se(c.$$.fragment),a=A(),u=O("main"),w&&w.c(),k=A(),Se(E.$$.fragment),R(n,"class","mainnav svelte-ibaoy7"),R(u,"class","App-main"),R(t,"class","App svelte-ibaoy7")},m(e,o){S(e,t,o),x(t,n),D&&D.m(n,null),x(n,r),N[s].m(n,null),x(t,i),Ce(c,t,null),x(t,a),x(t,u),~y&&U[y].m(u,null),x(t,k),Ce(E,t,null),T=!0},p(e,[t]){1&t&&(L=!vn(e[0],tn.INPUT)&&!vn(e[0],tn.SETTINGS)),L?D?(D.p(e,t),1&t&&he(D,1)):(D=fi(e),D.c(),he(D,1),D.m(n,r)):D&&(pe(),me(D,1,1,(()=>{D=null})),fe());let o=s;s=F(e,t),s===o?N[s].p(e,t):(pe(),me(N[o],1,1,(()=>{N[o]=null})),fe(),l=N[s],l?l.p(e,t):(l=N[s]=_[s](e),l.c()),he(l,1),l.m(n,null));let i=y;y=I(e,t),y===i?~y&&U[y].p(e,t):(w&&(pe(),me(U[i],1,1,(()=>{U[i]=null})),fe()),~y?(w=U[y],w?w.p(e,t):(w=U[y]=j[y](e),w.c()),he(w,1),w.m(u,null)):w=null)},i(e){T||(he(D),he(l),he(c.$$.fragment,e),he(w),he(E.$$.fragment,e),T=!0)},o(e){me(D),me(l),me(c.$$.fragment,e),me(w),me(E.$$.fragment,e),T=!1},d(e){e&&C(t),D&&D.d(),N[s].d(),Te(c),~y&&U[y].d(),Te(E)}}}function Ci(e,t,n){let r,o,s,l,i;return a(e,bn,(e=>n(4,s=e))),a(e,$n,(e=>n(1,l=e))),a(e,Be,(e=>n(5,i=e))),e.$$.update=()=>{if(2&e.$$.dirty&&n(0,r=l.stage),1&e.$$.dirty&&n(2,o=vn(r.from,tn.SEARCH)?()=>hn(sn):void 0),e.$$.dirty,e.$$.dirty,e.$$.dirty,32&e.$$.dirty&&localStorage.setItem("config",JSON.stringify(i)),2&e.$$.dirty&&localStorage.setItem("state",JSON.stringify({data:l.stage.dump(),search:l.search,series:l.series})),16&e.$$.dirty)try{localStorage.setItem("book",JSON.stringify(s))}catch(e){localStorage.removeItem("book"),console.error("Data too large! Caution, reloading won't work as expected!")}},[r,l,o,()=>{r.needsSaving&&!confirm("Unsaved changes. Continue?")||hn(pn)},s,i,()=>hn(on),()=>r.next()]}(()=>{try{const e=JSON.parse(localStorage.getItem("config"));Be.set((e=>{if(!e||""+e!="[object Object]")return ze;const t=Object.keys(e),n=Object.keys(ze);for(const r of n)t.includes(r)||(e[r]=ze[r]),typeof ze[r]!=typeof e[r]&&(e[r]=ze[r]);return e})(e))}catch(e){}})(),(()=>{try{const e=JSON.parse(localStorage.getItem("book"));bn.update((()=>e))}catch(e){}})(),window.removeEventListener("popstate",wn),window.addEventListener("popstate",wn),wn();const Ti=class extends Le{constructor(e){super(),Oe(this,e,Ci,Si,l,{})}};let Oi;try{Oi=new Ti({target:document.body})}catch(e){const t=document.createElement("div");t.className="fatal-error",t.ariaLabel="error",t.appendChild(document.createElement("h1")).textContent="Something went wrong:",t.appendChild(document.createElement("code")).textContent=e,document.body.appendChild(t)}})(),c=i.O(c)})(); \ No newline at end of file