From 3d82c66c980d0899796efe4ba69680dd303471e4 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:57:55 +0200 Subject: [PATCH] Add fcnt shortcode for tooltips --- ACTIONS.md | 3 +- DOCUMENTATION.md | 14 +++++ includes/functions/_setup-roles.php | 8 ++- includes/functions/_setup-shortcodes.php | 64 ++++++++++++++++++++ includes/functions/hooks/_general_hooks.php | 23 +++++++ js/application.min.js | 3 +- js/complete.min.js | 8 +-- repo/assets/fcnt_example.jpg | Bin 0 -> 42322 bytes src/js/application.js | 22 ++++++- src/scss/common/_formatting.scss | 14 ++++- src/scss/common/_setup.scss | 4 +- 11 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 repo/assets/fcnt_example.jpg diff --git a/ACTIONS.md b/ACTIONS.md index 6fb5c324..87ad7f89 100644 --- a/ACTIONS.md +++ b/ACTIONS.md @@ -601,7 +601,8 @@ Fires outside the `#site` container and before the `wp_footer` hook, near the en * $breadcrumbs (array) – Array of breadcrumb tuples with label (0) and link (1). **Hooked Actions:** -* `fictioneer_output_modals( $args )` – Render modals based on login status and page type. Priority 10. +* `fictioneer_output_modals( $args )` – Renders modal HTML based on login status and page type. Priority 10. +* `fictioneer_render_tooltip_dialog_modal_html()` – Renders dialog HTML for the tooltip modal. Priority 10. * `fictioneer_mu_registration_start( $args )` – Start of the wrapper HTML for wp-signup/wp-activate. Priority 999. --- diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 1cd5cbdb..52d7d1b2 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1427,6 +1427,20 @@ Renders the theme sidebar (not displayed anywhere by default). Requires the "Dis [fictioneer_sidebar name="other-sidebar"] ``` +### Tooltip (Modal) + +Includes a tooltip modal for the wrapped content, indicated by a dotted underline. Just omit the shortcode block and write it directly into the text. You can format words or phrases inside the tooltip content as \***bold**\* or \_*italic*\_, and escape the special characters with a prefixed `$` sign (WP sanitized backslashes). This shortcode also works if your role lacks the shortcode capability. + +``` +[fcnt content="This is a note."]note[/fcnt] +``` + +``` +[fcnt header="Are you dense?" content="This _typically_ refers to forms that are either literal *skeletons* or the underlying bearing $*structure* of objects."]skeletal shapes[/fcnt] +``` + +![Showcase](repo/assets/fcnt_example.jpg?raw=true) + ## Elementor If you have the Elementor plugin installed, consider using the [Fictioneer 002 Elementor Control](https://github.com/Tetrakern/fictioneer/blob/main/INSTALLATION.md#recommended-must-use-plugins) plugin if you only need it for the Canvas page templates. If you have the Pro version and want to use the theme builder, this may not be an option, but you can customize the following locations: `header`, `footer`, `nav_bar`, `nav_menu`, `mobile_nav_menu`, `story_header`, and `page_background`. diff --git a/includes/functions/_setup-roles.php b/includes/functions/_setup-roles.php index 88f89349..321741db 100644 --- a/includes/functions/_setup-roles.php +++ b/includes/functions/_setup-roles.php @@ -1005,6 +1005,7 @@ if ( ! current_user_can( 'manage_options' ) ) { * Exempts shortcodes from being removed by strip_shortcodes() * * @since 5.14.0 + * @since 5.25.0 - Allowed 'fcnt' shortcode to pass. * * @param array $tags_to_remove Tags to be removed. * @@ -1013,11 +1014,16 @@ if ( ! current_user_can( 'manage_options' ) ) { function fictioneer_exempt_shortcodes_from_removal( $tags_to_remove ) { - // Remove shortcodes from tags + // Remove 'fictioneer_fa' shortcode from tags if ( ( $key = array_search( 'fictioneer_fa', $tags_to_remove ) ) !== false ) { unset( $tags_to_remove[ $key ] ); } + // Remove 'fcnt' shortcode from tags + if ( ( $key = array_search( 'fcnt', $tags_to_remove ) ) !== false ) { + unset( $tags_to_remove[ $key ] ); + } + // Continue filter return $tags_to_remove; } diff --git a/includes/functions/_setup-shortcodes.php b/includes/functions/_setup-shortcodes.php index 55ecc1c4..6761abcf 100644 --- a/includes/functions/_setup-shortcodes.php +++ b/includes/functions/_setup-shortcodes.php @@ -2311,3 +2311,67 @@ function fictioneer_shortcode_sidebar( $attr ) { if ( ! get_option( 'fictioneer_disable_all_widgets' ) ) { add_shortcode( 'fictioneer_sidebar', 'fictioneer_shortcode_sidebar' ); } + +// ============================================================================= +// TOOLTIP SHORTCODE +// ============================================================================= + +/** + * Shortcode to add tooltip modal + * + * @since 5.25.0 + * + * @param string $atts['header'] Optional. Header of the tooltip. + * @param string $atts['content'] Content of the tooltip. + * + * @return string The shortcode HTML. + */ + +function fictioneer_shortcode_tooltip( $atts, $content = null ) { + // Setup + $data = ''; + $attributes = shortcode_atts( + array( 'header' => '', 'content' => '' ), + $atts, + 'fcnt' + ); + + // Sanitize + $modal_header = trim( wp_kses_post( $attributes['header'] ) ); + $modal_header = esc_attr( $modal_header ); + + $modal_content = trim( wp_kses_post( $attributes['content'] ) ); + $modal_content = esc_attr( $modal_content ); + + // Tooltip content? + if ( empty( $modal_content ) ) { + return $content; + } + + // Escaped markdown (WP strips slashes, so we use $ as escape character) + $modal_content = str_replace( '$*', '$ESCAPED_ASTERISK$', $modal_content ); + $modal_content = str_replace( '$_', '$ESCAPED_UNDERSCORE$', $modal_content ); + + // Convert _text_ to text + $modal_content = preg_replace( '/_(.*?)_/', '$1', $modal_content ); + + // Convert *text* to text + $modal_content = preg_replace( '/\*(.*?)\*/', '$1', $modal_content ); + + // Cleanup + $modal_content = str_replace( '$ESCAPED_ASTERISK$', '*', $modal_content ); + $modal_content = str_replace( '$ESCAPED_UNDERSCORE$', '_', $modal_content ); + + // Build attributes + if ( ! empty( $modal_header ) ) { + $data .= 'data-dialog-header="' . esc_attr( $modal_header ) . '" '; + } + + $data .= 'data-dialog-content="' . esc_attr( $modal_content ) . '"'; + $title = _x( 'Click to see note', 'Tooltip shortcode.', 'fictioneer' ); + + // Return HTML + return '' . + $content . ''; +} +add_shortcode( 'fcnt', 'fictioneer_shortcode_tooltip' ); diff --git a/includes/functions/hooks/_general_hooks.php b/includes/functions/hooks/_general_hooks.php index 54cd03e4..1070fb55 100644 --- a/includes/functions/hooks/_general_hooks.php +++ b/includes/functions/hooks/_general_hooks.php @@ -1208,3 +1208,26 @@ function fictioneer_cleanup_discord_meta() { } } add_action( 'wp_head', 'fictioneer_cleanup_discord_meta' ); + +// ============================================================================= +// TOOLTIP DIALOG +// ============================================================================= + +/** + * Outputs the HTML for the tooltip dialog modal + * + * @since 5.25.0 + */ + +function fictioneer_render_tooltip_dialog_modal_html() { + // Start HTML ---> ?> + +
+ +
+
+
+
+ ul");function fcn_cleanupWebStorage(e=!1){const t=["fcnProfileAvatar","fcnBookshelfContent"];e||t.push("fcnChapterBookmarks"),t.forEach((e=>localStorage.removeItem(e)));const n=["loggedIn","follows","reminders","checkmarks","bookmarks","fingerprint"],o=fcn_parseJSON(localStorage.getItem("fcnUserData"));o&&(n.forEach((e=>o[e]=!1)),localStorage.setItem("fcnUserData",JSON.stringify(o)));const s=fcn_parseJSON(localStorage.getItem("fcnAuth"));s?.loggedIn&&localStorage.removeItem("fcnAuth")}function fcn_prepareLogin(){localStorage.removeItem("fcnUserData"),localStorage.removeItem("fcnAuth")}function fcn_cleanupGuestView(){fcn_isLoggedIn=!1,fcn_theBody.classList.remove("logged-in","is-admin","is-moderator","is-editor","is-author"),_$$$("fictioneer-ajax-nonce")?.remove(),_$$(".only-moderators, .only-admins, .only-authors, .only-editors, .chapter-group__list-item-checkmark").forEach((e=>{e.remove()}))}function fcn_ajaxAuth(){let e=!1,t=fcn_parseJSON(localStorage.getItem("fcnAuth"))??!1;if(fcn_isLoggedIn&&!t?.loggedIn&&(localStorage.removeItem("fcnAuth"),t=!1),t){fcn_addNonceHTML(t.nonceHtml);const n=new CustomEvent("fcnAuthReady",{detail:{nonceHtml:t.nonceHtml,nonce:t.nonce,loggedIn:t.loggedIn,isAdmin:t.isAdmin,isModerator:t.isModerator,isAuthor:t.isAuthor,isEditor:t.isEditor},bubbles:!0,cancelable:!1});if(document.dispatchEvent(n),e=!0,fcn_ajaxLimitThreshold{if(t.success){fcn_addNonceHTML(t.data.nonceHtml);const n={lastLoaded:Date.now(),nonceHtml:t.data.nonceHtml,nonce:t.data.nonce,loggedIn:t.data.loggedIn,isAdmin:t.data.isAdmin,isModerator:t.data.isModerator,isAuthor:t.data.isAuthor,isEditor:t.data.isEditor};if(!e){const e=new CustomEvent("fcnAuthReady",{detail:n,bubbles:!0,cancelable:!1});document.dispatchEvent(e)}localStorage.setItem("fcnAuth",JSON.stringify(n))}else{fcn_cleanupGuestView();const e=new Event("fcnAuthFailed");document.dispatchEvent(e)}})).catch((()=>{localStorage.removeItem("fcnAuth"),fcn_cleanupGuestView();const e=new Event("fcnAuthError");document.dispatchEvent(e)}))}function fcn_addNonceHTML(e){_$$$("fictioneer-ajax-nonce")?.remove(),fcn_theBody.appendChild(fcn_html`${e}`)}function fcn_setLoggedInState(e){fcn_isLoggedIn=e.loggedIn,fcn_theBody.classList.add("logged-in"),fcn_theBody.classList.toggle("is-admin",e.isAdmin),fcn_theBody.classList.toggle("is-moderator",e.isModerator),fcn_theBody.classList.toggle("is-author",e.isAuthor),fcn_theBody.classList.toggle("is-editor",e.isEditor);const t=['label[for="modal-login-toggle"]',"#modal-login-toggle","#login-modal"];e.isAdmin||(t.push(".only-admins"),e.isModerator||t.push(".only-moderators"),e.isAuthor||t.push(".only-authors"),e.isEditor||t.push(".only-editors")),_$$(t.join(", ")).forEach((e=>e.remove())),fcn_getProfileImage(),fcn_fetchUserData()}function fcn_loadEmbed(e){e.target.parentNode.querySelectorAll("iframe, script")[0].src=e.target.dataset.src,e.target.parentElement.querySelector(".embed-logo")?.remove(),e.target.remove()}function fcn_appendTermMenu(e,t){const n=_$$$(`term-submenu-${e}`);if(!n)return;const o=n.content.cloneNode(!0);t.classList.add("menu-item-has-children"),t.querySelector('[href="#"]').addEventListener("click",(e=>{e.preventDefault()})),t.appendChild(o)}fcn_chapterList&&(fcn_chapterList=fcn_chapterList.cloneNode(!0),_$$$("story-chapter-list").remove(),fcn_chapterList.querySelector(`[data-id="${fcn_chapterList.dataset.currentId}"]`)?.classList.add("current-chapter")),fcn_isLoggedIn||fcn_theRoot.dataset.ajaxAuth||(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView()),"function"==typeof fcn_removeQueryArgs&&fcn_removeQueryArgs(),_$("#wp-admin-bar-logout a")?.addEventListener("click",(()=>{fcn_cleanupWebStorage()})),_$$(".subscriber-login, .oauth-login-link, [data-prepare-login]").forEach((e=>{e.addEventListener("click",(()=>{fcn_prepareLogin()}))})),document.addEventListener("DOMContentLoaded",(()=>{fcn_theRoot.dataset.ajaxAuth&&fcn_ajaxAuth()})),!fcn_isLoggedIn&&fcn_theRoot.dataset.ajaxAuth&&document.addEventListener("fcnAuthReady",(e=>{e.detail.loggedIn?fcn_setLoggedInState(e.detail):(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView())})),fcn_bindEventToAnimationFrame("scroll","scroll.rAF"),fcn_bindEventToAnimationFrame("resize","resize.rAF"),fcn_theBody.addEventListener("click",(e=>{const t=e.target.closest(".toggle-last-clicked");if(t&&(!["BUTTON","A","INPUT","SELECT"].includes(e.target.tagName)||e.target.classList.contains("toggle-last-clicked")))return fcn_toggleLastClicked?.(t),"function"==typeof fcn_popupPosition&&fcn_popupPosition(),void e.stopPropagation();const n=e.target.closest(".page-numbers.dots:not(button)");if(n)return void fcn_jumpPage(n);const o=e.target.closest(".spoiler");if(o)return void o.classList.toggle("_open");e.target.closest(".oauth-login-link, .subscriber-login, [data-prepare-login]")&&fcn_prepareLogin();const s=e.target.closest("[data-click]"),a=s?.dataset.click;if(a)switch(a){case"copy-to-clipboard":s.select(),fcn_copyToClipboard(s.value,s.dataset.message);break;case"reset-consent":fcn_deleteCookie("fcn_cookie_consent"),location.reload();break;case"clear-cookies":fcn_deleteAllCookies(),alert(s.dataset.message);break;case"logout":fcn_cleanupWebStorage();break;case"card-toggle-follow":fcn_isLoggedIn?fcn_toggleFollow(s.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-reminder":fcn_isLoggedIn?fcn_toggleReminder(s.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-checkmarks":fcn_isLoggedIn?(fcn_toggleCheckmark(parseInt(s.dataset.storyId),s.dataset.type,parseInt(s.dataset.chapterId),null,s.dataset.mode),fcn_updateCheckmarksView()):_$$$("modal-login-toggle")?.click();break;case"toggle-obfuscation":s.closest("[data-obfuscation-target]").classList.toggle("_obfuscated")}})),fcn_theBody.addEventListener("change",(e=>{const t=e.target.closest('[type="checkbox"]');if(!t)return;const n=t.name,o=n?_$$(`label[for="${n}"]`):[],s=t.checked;t.closest("[aria-checked]")?.setAttribute("aria-checked",s),o.forEach((e=>{e.closest("[aria-checked]")?.setAttribute("aria-checked",s)}))})),_$$(".iframe-consent, .twitter-consent").forEach((e=>{e.onclick=e=>{fcn_loadEmbed(e)}})),document.addEventListener("DOMContentLoaded",(()=>{const e=_$("#menu-navigation > .menu-item"),t=_$$$("full-navigation");e&&t&&e.offsetHeight{fcn_appendTermMenu("category",e)})),_$$(".main-navigation .trigger-term-menu-tags").forEach((e=>{fcn_appendTermMenu("post_tag",e)})),_$$(".main-navigation .trigger-term-menu-genres").forEach((e=>{fcn_appendTermMenu("fcn_genre",e)})),_$$(".main-navigation .trigger-term-menu-fandoms").forEach((e=>{fcn_appendTermMenu("fcn_fandom",e)})),_$$(".main-navigation .trigger-term-menu-characters").forEach((e=>{fcn_appendTermMenu("fcn_character",e)})),_$$(".main-navigation .trigger-term-menu-warnings").forEach((e=>{fcn_appendTermMenu("fcn_content_warning",e)}))}));var fcn_lastScrollTop=0;function fcn_scrollDirection(){if(fcn_theSite.classList.contains("transformed-scroll"))return;const e="hidden"!==window.getComputedStyle(document.documentElement).overflow?window.scrollY??document.documentElement.scrollTop:fcn_theBody.scrollTop??1;fcn_theBody.classList.toggle("scrolled-to-top",0===e),e>fcn_lastScrollTop&&Math.abs(fcn_lastScrollTop-e)>=10?(fcn_theBody.classList.add("scrolling-down"),fcn_theBody.classList.remove("scrolling-up"),fcn_lastScrollTop=Math.max(e,0)):e=50&&(fcn_theBody.classList.add("scrolling-up"),fcn_theBody.classList.remove("scrolling-down"),fcn_lastScrollTop=Math.max(e,0))}function fcn_observe(e,t,n={}){const o=_$(e);if(!o)return null;new IntersectionObserver((e=>t(e[0])),n).observe(o)}function fcn_dragElement(e){const t=e.querySelector(".drag-anchor")??e;let n,o;function s(t){t.preventDefault(),e.style.top=e.offsetTop-(o-t.clientY)+"px",e.style.left=e.offsetLeft-(n-t.clientX)+"px",n=t.clientX,o=t.clientY}function a(){t.onmouseup=null,t.onmousemove=null}t.onmousedown=function(e){e.preventDefault(),n=e.clientX,o=e.clientY,t.onmousemove=s,t.onmouseup=a}}function fcn_showNotification(e,t=3,n="base"){const o=_$("#notifications"),s=document.createElement("div");s.innerHTML=e,s.classList.add("notifications__message",`_${n}`),s.style.opacity=1,s.style.transitionDelay=`${t}s`,o.prepend(s),s.addEventListener("transitionend",(e=>{"opacity"===e.propertyName&&o.removeChild(e.target)})),s.addEventListener("click",(e=>{o.removeChild(e.currentTarget)})),setTimeout((()=>{s.style.opacity=0}),100)}if(window.addEventListener("scroll.rAF",fcn_throttle(fcn_scrollDirection,200)),fcn_scrollDirection(),document.addEventListener("DOMContentLoaded",(()=>{fcn_observe(".main-observer",(e=>{fcn_theBody.classList.toggle("is-inside-main",e.intersectionRatio<1&&e.boundingClientRect.top<=0)}),{threshold:[1]}),fcn_observe(".chapter-end",(e=>{fcn_theBody.classList.toggle("is-end-of-chapter",e.isIntersecting||e.boundingClientRect.top<0)}),{root:null,threshold:0}),fcn_observe("#nav-observer-sticky",(e=>{_$$$("full-navigation").classList.toggle("is-sticky",e.intersectionRatio<1)}),{threshold:[1]})})),_$$(".modal__header.drag-anchor").forEach((e=>{fcn_dragElement(e.closest(".modal__wrapper"))})),fcn_urlParams){switch(fcn_urlParams.failure&&console.error("Failure:",fcn_urlParams.failure),fcn_urlParams.failure){case"oauth_email_taken":fcn_showNotification(fictioneer_tl.notification.oauthEmailTaken,5,"warning");break;case"oauth_already_linked":fcn_showNotification(fictioneer_tl.notification.oauthAccountAlreadyLinked,5,"warning")}if("oauth_new"===fcn_urlParams.success)fcn_showNotification(fictioneer_tl.notification.oauthNew,10);else fcn_urlParams.success?.startsWith("oauth_merged_")&&fcn_showNotification(fictioneer_tl.notification.oauthAccountLinked,3,"success");if(fcn_urlParams["fictioneer-notice"]){let e="1"===fcn_urlParams.failure?"warning":"base";e="1"===fcn_urlParams.success?"success":e,fcn_showNotification(fcn_sanitizeHTML(fcn_urlParams["fictioneer-notice"]),3,e)}}const fcn_settingMinimal=_$$$("site-setting-minimal"),fcn_settingChapterProgressBar=_$$$("site-setting-chapter-progress-bar"),fcn_settingHueRotateRange=_$$$("site-setting-hue-rotate-range"),fcn_settingHueRotateText=_$$$("site-setting-hue-rotate-text"),fcn_settingHueRotateReset=_$$$("site-setting-hue-rotate-reset"),fcn_settingDarkenRanges=_$$(".setting-darken-range"),fcn_settingDarkenTexts=_$$(".setting-darken-text"),fcn_settingDarkenResets=_$$(".setting-darken-reset"),fcn_settingSaturationRanges=_$$(".setting-saturation-range"),fcn_settingSaturationTexts=_$$(".setting-saturation-text"),fcn_settingSaturationResets=_$$(".setting-saturation-reset"),fcn_settingFontLightnessRanges=_$$(".setting-font-lightness-range"),fcn_settingFontLightnessTexts=_$$(".setting-font-lightness-text"),fcn_settingFontLightnessResets=_$$(".setting-font-lightness-reset"),fcn_settingEvents=["nav-sticky","background-textures","polygons","covers","text-shadows","minimal","chapter-progress-bar"];var fcn_siteSettings=fcn_getSiteSettings();function fcn_updateSiteSetting(e,t,n){e.checked=n,fcn_siteSettings[t]=n,fcn_applySiteSettings(fcn_siteSettings)}function fcn_toggleLightMode(){fcn_setLightMode(!(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault))}function fcn_setLightMode(e,t=!1){localStorage.setItem("fcnLightmode",e),fcn_theRoot.dataset.mode=e?"light":"dark",_$$(".toggle-light-mode").forEach((t=>{t.closest("[aria-checked]")?.setAttribute("aria-checked",e)})),t||fcn_updateThemeColor()}function fcn_updateFontWeight(){const e="default"!=fcn_siteSettings["font-weight"];_$$(".site-setting-font-weight").forEach((e=>{e.value=fcn_siteSettings["font-weight"]})),_$$(".font-weight-reset").forEach((t=>{t.classList.toggle("_modified",e)}))}function fcn_resetFontWeight(){fcn_siteSettings["font-weight"]="default",fcn_theRoot.dataset.fontWeight="default",fcn_applySiteSettings(fcn_siteSettings)}function fcn_updateHueRotate(e){e=fcn_clamp(0,360,e??0),fcn_settingHueRotateText.value=e,fcn_settingHueRotateRange.value=e,fcn_settingHueRotateReset.classList.toggle("_modified",0!=e),fcn_theRoot.style.setProperty("--hue-rotate",`(${e}deg + var(--hue-offset))`),fcn_siteSettings["hue-rotate"]=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setHueRotate(){fcn_updateHueRotate(this.value)}function fcn_updateDarken(e=null){e=fcn_clamp(-1,1,e??fcn_siteSettings.darken),e=Math.round(100*(e+Number.EPSILON))/100,fcn_settingDarkenResets.forEach((t=>{t.classList.toggle("_modified",0!=e)})),fcn_settingDarkenRanges.forEach((t=>{t.value=e})),fcn_settingDarkenTexts.forEach((t=>{t.value=parseInt(100*e)}));const t=e>=0?1+e**2:1-e**2;fcn_theRoot.style.setProperty("--darken",`(${t} + var(--lightness-offset))`),fcn_siteSettings.darken=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setDarkenFromRange(){fcn_updateDarken(this.value)}function fcn_setDarkenFromText(){"-"!=this.value&&""!=this.value&&fcn_updateDarken((parseInt(this.value)??0)/100)}function fcn_updateSaturation(e=null){e=fcn_clamp(-1,1,e??fcn_siteSettings.saturation),fcn_settingSaturationResets.forEach((t=>{t.classList.toggle("_modified",0!=e)})),fcn_settingSaturationRanges.forEach((t=>{t.value=e})),fcn_settingSaturationTexts.forEach((t=>{t.value=parseInt(100*e)}));const t=e>=0?1+e**2:1-e**2;fcn_theRoot.style.setProperty("--saturation",`(${t} + var(--saturation-offset))`),fcn_siteSettings.saturation=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setSaturationFromRange(){fcn_updateSaturation(this.value)}function fcn_setSaturationFromText(){"-"!=this.value&&""!=this.value&&fcn_updateSaturation((parseInt(this.value)??0)/100)}function fcn_updateFontLightness(e=null){e=fcn_clamp(-1,1,e??fcn_siteSettings["font-lightness"]??1),fcn_settingFontLightnessResets.forEach((t=>{t.classList.toggle("_modified",0!=e)})),fcn_settingFontLightnessRanges.forEach((t=>{t.value=e})),fcn_settingFontLightnessTexts.forEach((t=>{t.value=parseInt(100*e)}));const t=e>=0?1+e**2:1-e**2;fcn_theRoot.style.setProperty("--font-lightness",`(${t} + var(--font-lightness-offset))`),fcn_siteSettings["font-lightness"]=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setFontLightnessFromRange(){fcn_updateFontLightness(this.value)}function fcn_setFontLightnessFromText(){"-"!=this.value&&""!=this.value&&fcn_updateFontLightness((parseInt(this.value)??0)/100)}function fcn_defaultSiteSettings(){return{"nav-sticky":!0,"background-textures":!0,polygons:!0,covers:!0,"text-shadows":!1,minimal:!1,"chapter-progress-bar":!0,"site-theme":"default","font-weight":"default",darken:0,saturation:0,"font-saturation":0,"font-lightness":0,"hue-rotate":0}}function fcn_getSiteSettings(){const e=fcn_parseJSON(localStorage.getItem("fcnSiteSettings"))??fcn_defaultSiteSettings();return fcn_setSiteSettings(e),e}function fcn_setSiteSettings(e=null){"object"==typeof(e=e||fcn_siteSettings)&&(fcn_siteSettings=e,localStorage.setItem("fcnSiteSettings",JSON.stringify(e)))}function fcn_applySiteSettings(e){e="object"!=typeof e?fcn_defaultSiteSettings():e,Object.entries(e).forEach((e=>{const t=_$$$(`site-setting-${e[0]}`);switch(t&&(t.checked=e[1]),e[0]){case"minimal":fcn_theRoot.classList.toggle("minimal",e[1]);break;case"darken":fcn_updateDarken();break;case"saturation":fcn_updateSaturation();break;case"font-saturation":break;case"font-lightness":fcn_updateFontLightness();break;case"hue-rotate":fcn_updateHueRotate(e[1]);break;case"font-weight":fcn_updateFontWeight();break;default:fcn_theRoot.classList.toggle(`no-${e[0]}`,!e[1])}})),fcn_setSiteSettings(e)}function fcn_updateSiteTheme(e){fcn_siteSettings["site-theme"]=e,fcn_theRoot.dataset.theme=e,_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=e),fcn_applySiteSettings(fcn_siteSettings),fcn_updateThemeColor()}function fcn_resetSiteTheme(){fcn_updateSiteTheme("default"),_$$(".site-setting-site-theme").forEach((e=>{e.value="default"}))}function fcn_jumpPage(e){if(fcn_theRoot.dataset.disablePageJump)return;const t=parseInt(window.prompt(fictioneer_tl.notification.enterPageNumber));if(t>0){const n=e.nextElementSibling.getAttribute("href"),o=["page=","paged=","comment-page-","pg="];for(const e of o)if(n.includes(e))return void(window.location.href=n.replace(new RegExp(`${e}\\d+`),e+t));window.location.href=n.replace(/page\/\d+/,`page/${t}`)}}fcn_settingEvents.forEach((e=>{_$$$(`site-setting-${e}`)?.addEventListener("change",(t=>{fcn_updateSiteSetting(t.currentTarget,e,t.currentTarget.checked)}))})),fcn_setLightMode(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault,!0),_$$(".toggle-light-mode").forEach((e=>{e.onclick=()=>fcn_toggleLightMode()})),_$$(".font-weight-reset").forEach((e=>{e.addEventListener("click",fcn_resetFontWeight)})),_$$(".site-setting-font-weight").forEach((e=>{e.onchange=e=>{fcn_siteSettings["font-weight"]=e.target.value,fcn_theRoot.dataset.fontWeight=e.target.value,fcn_applySiteSettings(fcn_siteSettings),fcn_updateFontWeight()}})),fcn_settingHueRotateReset?.addEventListener("click",(()=>{fcn_updateHueRotate(0)})),fcn_settingHueRotateRange?.addEventListener("input",fcn_throttle(fcn_setHueRotate,1e3/24)),fcn_settingHueRotateText?.addEventListener("input",fcn_setHueRotate),fcn_settingDarkenResets.forEach((e=>{e.addEventListener("click",(()=>{fcn_updateDarken(0)}))})),fcn_settingDarkenRanges.forEach((e=>{e.addEventListener("input",fcn_throttle(fcn_setDarkenFromRange,1e3/24))})),fcn_settingDarkenTexts.forEach((e=>{e.addEventListener("input",fcn_setDarkenFromText)})),fcn_settingSaturationResets.forEach((e=>{e.addEventListener("click",(()=>{fcn_updateSaturation(0)}))})),fcn_settingSaturationRanges.forEach((e=>{e.addEventListener("input",fcn_throttle(fcn_setSaturationFromRange,1e3/24))})),fcn_settingSaturationTexts.forEach((e=>{e.addEventListener("input",fcn_setSaturationFromText)})),fcn_settingFontLightnessResets.forEach((e=>{e.addEventListener("click",(()=>{fcn_updateFontLightness(0)}))})),fcn_settingFontLightnessRanges.forEach((e=>{e.addEventListener("input",fcn_throttle(fcn_setFontLightnessFromRange,1e3/24))})),fcn_settingFontLightnessTexts.forEach((e=>{e.addEventListener("input",fcn_setFontLightnessFromText)})),fcn_applySiteSettings(fcn_siteSettings),_$$(".site-setting-site-theme").forEach((e=>{e.value=fcn_siteSettings["site-theme"]?fcn_siteSettings["site-theme"]:"default",_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=e.value),e.addEventListener("change",(e=>{fcn_updateSiteTheme(e.target.value)}))})),_$$$("site-setting-theme-reset")?.addEventListener("click",fcn_resetSiteTheme),fcn_updateThemeColor();const fcn_cardListMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.length>0&&("function"==typeof fcn_updateFollowsView&&fcn_updateFollowsView(),"function"==typeof fcn_updateCheckmarksView&&fcn_updateCheckmarksView(),"function"==typeof fcn_updateRemindersView&&fcn_updateRemindersView())}))}));function fcn_revealCommentImage(e){const t=e.parentElement.querySelector("img");t.src=t.dataset.src,e.remove()}function fcn_contactFormSubmit(e){const t=e.closest("form"),n=new FormData(t),o={action:"fictioneer_ajax_submit_contact_form"};if(t.reportValidity()&&(e.disabled=!0,e.innerHTML=e.dataset.disabled,!(Date.now(){n.success?(t.querySelector("textarea").value="",e.innerHTML=e.dataset.done,fcn_showNotification(n.data.success,3,"success")):n.data.error&&(e.disabled=!1,e.innerHTML=e.dataset.enabled,fcn_showNotification(n.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),e.disabled=!1,e.innerHTML=e.dataset.enabled)})).then((()=>{t.classList.remove("ajax-in-progress")}))}}_$$(".card-list:not(._no-mutation-observer)").forEach((e=>fcn_cardListMutationObserver.observe(e,{childList:!0,subtree:!0}))),_$$(".chapter-group__name").forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.closest(".chapter-group"),n=t.querySelector(".chapter-group__list"),o=!t.classList.contains("_closed");_$(".main__background")?.classList.add("will-change"),n.style.height=`${n.scrollHeight}px`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.classList.toggle("_closed",o),n.style.height=o?"0":`${n.scrollHeight}px`}))}))}))})),_$$(".chapter-group__list").forEach((e=>{e.addEventListener("transitionend",(t=>{e.style.height="",e.querySelectorAll("a, button, label, input:not([hidden])").forEach((t=>{t.tabIndex=e.parentElement.classList.contains("_closed")?"-1":"0"})),_$(".main__background")?.classList.remove("will-change")}))})),_$(".fictioneer-comments")?.addEventListener("click",(e=>{e.target?.classList.contains("consent-button")&&fcn_revealCommentImage(e.target)})),_$$(".fcn-contact-form").forEach((e=>{e.querySelector(".fcn-contact-form__submit").addEventListener("click",(e=>{fcn_contactFormSubmit(e.currentTarget)}))})),fcn_theBody.querySelectorAll(".modal-toggle").forEach((e=>{e.addEventListener("change",(e=>{if(e.currentTarget.checked){const t=e.currentTarget.nextElementSibling.querySelector('[tabindex="0"]');t?.focus(),t?.blur()}else fcn_theBody.classList.contains("user-is-tabbing")&&fcn_theSite.querySelector(`label[for="${e.currentTarget.id}"]`)?.focus()}))})),_$$('[data-click-action*="open-dialog-modal"]').forEach((e=>{e.addEventListener("click",(e=>{document.querySelector(e.currentTarget.dataset.clickTarget).showModal()}))})),_$$('[data-click-action*="close-dialog-modal"]').forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),e.target.closest("dialog").close()}))})),_$$("dialog").forEach((e=>{e.addEventListener("mousedown",(e=>{"dialog"===e.target.tagName.toLowerCase()&&(e.preventDefault(),e.target.close())}))})),fcn_theBody.addEventListener("keydown",(e=>{let t=document.activeElement.closest('[tabindex="0"]:not(a, input, button, select)');if(["BUTTON","A","INPUT","SELECT"].includes(document.activeElement.tagName)&&(t=null),t&&(32!=e.keyCode&&13!=e.keyCode||(e.preventDefault(),t.click())),27==e.keyCode){_$$(".modal-toggle:checked").forEach((e=>{e.checked=!1,e.dispatchEvent(new Event("change"))}));const e=_$(".lightbox.show");if(e)return void e.querySelector(".lightbox__close").click();const t=_$(".selected-paragraph #button-close-paragraph-tools");if(t)return void t.click();const n=_$("#tts-interface:not(.hidden)");if(n){if(n.classList.contains("playing")){const e=_$$$("button-tts-pause");e?.click(),e?.focus(),e?.blur()}else _$$$("button-tts-stop").click();return}}}));class FCN_KeywordInput{constructor(e){this.input=e,this.operator=e.closest(".keyword-input").querySelector(".keyword-input__operator input"),this.inputWrapper=e.closest(".keyword-input__input-wrapper"),this.block=e.closest(".keyword-input"),this.form=this.block.closest(".search-form"),this.collection=this.block.querySelector(".keyword-input__collection"),this.suggestionList=this.block.querySelector(".keyword-input__suggestion-list"),this.tabSuggestion=this.block.querySelector(".keyword-input__tab-suggestion"),this.allowText=this.form.querySelector(".allow-list")?.innerText??"{}",this.allowList=JSON.parse(this.allowText),this.hints=this.block.querySelector(".keyword-input__hints"),this.noHint=this.block.querySelector(".keyword-input__no-suggestions"),this.keywords=this.collection.value.length>0?this.collection.value.split(","):[],this.bindEvents(),this.resize(),this.filterSuggestions()}resize(){const e=this.tabSuggestion.innerText.length>0?this.tabSuggestion.innerText.length:this.input.value.length;this.input.style.width=.88*e+2+"ch"}reset(){this.keywords=[],this.block.querySelectorAll(".node").forEach((e=>{e.remove()})),this.block.querySelectorAll(".keyword-input__operator > input").forEach((e=>{e.checked=!1})),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}encode(e){const t=(new TextEncoder).encode(e.toLowerCase());return btoa(String.fromCharCode.apply(null,t))}filterSuggestions(){const e=this.input.value.toLowerCase();let t=0,n="";""==e?this.suggestionList.querySelectorAll(".keyword-button").forEach((e=>{e.hidden=!0})):this.suggestionList.querySelectorAll(".keyword-button").forEach((o=>{const s=o.innerText.toLowerCase();s.includes(e)&&this.keywords.indexOf(s)<0?(o.hidden=!1,t++,""==n&&s.startsWith(e)&&(n=s)):o.hidden=!0})),this.hints.querySelectorAll(".keyword-button").forEach((e=>{this.keywords.indexOf(e.value.toLowerCase())>-1?e.hidden=!0:e.hidden=!1})),this.tabSuggestion.innerHTML=n,this.hints.hidden=!(""==e),this.noHint.hidden=!(""!=e&&t<1)}addNode(e=null,t=null){const n=e??this.input.value.replace(",","");let o=this.allowList[this.encode(n)];if("authors"!=this.collection.name&&"ex_authors"!=this.collection.name||!t||(o=this.allowList[this.encode(n)+`_${t.value}`]),!o||this.keywords.indexOf(o)>-1)return;this.keywords.push(o);const s=document.createElement("div");s.innerHTML=`${n}`,s.classList.add("node"),s.dataset.value=o,this.inputWrapper.parentNode.insertBefore(s,this.inputWrapper),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}removeNodeByValue(e){this.block.querySelector(`[data-value="${e}"]`)?.remove(),this.keywords=this.keywords.filter((t=>t!=e)),this.updateCollection(),this.filterSuggestions(),this.resize()}updateCollection(){this.collection.value=this.keywords.join(","),this.block.classList.toggle("_empty",""===this.collection.value),this.form.querySelector(".search-form__current").innerHTML=""}bindEvents(){this.input.addEventListener("input",(e=>{e.currentTarget.value.includes(",")&&this.addNode(),this.block.classList.toggle("_empty",""===e.currentTarget.value&&""===this.collection.value),this.filterSuggestions(),this.resize()})),this.input.addEventListener("keydown",(e=>{9!=e.keyCode&&13!=e.keyCode||""!=this.tabSuggestion.innerText&&(e.preventDefault(),this.input.value=this.tabSuggestion.innerText,this.addNode()),27==e.keyCode&&(this.input.value="",this.tabSuggestion.innerHTML="",document.activeElement.blur()),8==e.keyCode&&""==this.input.value&&this.keywords.length>0&&this.removeNodeByValue(this.keywords.slice(-1))})),this.input.addEventListener("blur",(()=>{const e=this.allowList[this.encode(this.input.value)];this.blurTimeout=e?setTimeout((()=>{this.addNode()}),150):setTimeout((()=>{this.input.value="",this.tabSuggestion.innerHTML="",this.filterSuggestions(),this.resize()}),150)})),this.block.addEventListener("click",(e=>{e.target.closest(".node-delete")&&(e.preventDefault(),this.removeNodeByValue(e.target.closest(".node").dataset.value))})),this.block.querySelectorAll(".keyword-button").forEach((e=>{e.addEventListener("click",(e=>{clearTimeout(this.blurTimeout),this.addNode(e.currentTarget.innerText,e.currentTarget)}))}))}}function fcn_resetSearchForm(e,t,n){n.forEach((e=>e.reset())),t.querySelectorAll("input, select").forEach((e=>{e.value=e.dataset.default??e.value})),t.querySelector(".search-form__current").innerHTML="",fcn_showNotification(e.dataset.reset,2)}function fcn_handleTabInput(e){9==e.keyCode&&(fcn_theBody.classList.add("user-is-tabbing"),window.removeEventListener("keydown",fcn_handleTabInput),window.addEventListener("mousedown",fcn_handleMouseInput))}function fcn_handleMouseInput(){fcn_theBody.classList.remove("user-is-tabbing"),window.removeEventListener("mousedown",fcn_handleMouseInput),window.addEventListener("keydown",fcn_handleTabInput)}function fcn_popupPosition(){_$$(".popup-menu-toggle.last-clicked .popup-menu:not(._fixed-position)").forEach((e=>{if("none"===window.getComputedStyle(e).display)return;const t=fcn_detectScreenCollision(e);t&&0===t.length||(t.includes("top")?(e.classList.remove("_top"),e.classList.add("_bottom")):t.includes("bottom")&&(e.classList.remove("_bottom"),e.classList.add("_top")),e.closest("._fixed-horizontal")||(t.includes("left")?(e.classList.remove("_center","_justify-right"),e.classList.add("_justify-left")):t.includes("right")&&(e.classList.remove("_center","_justify-left"),e.classList.add("_justify-right"))))}))}function fcn_markCurrentMenuItem(){_$$(`.menu-item > [data-nav-object-id="${fcn_theBody.dataset.postId}"]`).forEach((e=>{e.setAttribute("aria-current","page"),e.closest(".menu-item").classList.add("current-menu-item")}))}function fcn_showAgeConfirmationModal(){const e=_$(".story__article, .chapter__article")?.dataset.ageRating;if(!fcn_theRoot.dataset.ageConfirmation&&e&&"adult"!==e)return void _$$$("age-confirmation-modal")?.remove();const t=_$$$("age-confirmation-leave");fcn_theRoot.classList.add("age-modal-open"),_$$$("age-confirmation-modal").classList.add("_open"),_$$$("age-confirmation-confirm")?.addEventListener("click",(e=>{fcn_theRoot.classList.remove("age-modal-open"),e.currentTarget.closest(".modal").remove(),localStorage.setItem("fcnAgeConfirmation","1")})),t?.addEventListener("click",(()=>{window.location.href=t.dataset.redirect??"https://search.brave.com/",localStorage.removeItem("fcnAgeConfirmation")}))}_$$(".search-form").forEach((e=>{if(e.classList.contains("_simple"))return;const t=[];e.querySelectorAll(".keyword-input__input").forEach((e=>{t.push(new FCN_KeywordInput(e))})),e.querySelector(".allow-list")?.remove(),e.addEventListener("change",(t=>{t.target.classList.contains("search-form__advanced-control")||t.target.classList.contains("search-form__string")||(e.querySelector(".search-form__current").innerHTML="")})),e.querySelectorAll(".reset").forEach((n=>{n.addEventListener("click",(()=>{fcn_resetSearchForm(n,e,t)}))}))})),_$$(".search-form__advanced-toggle").forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.closest("form");t.dataset.advanced="true"==t.dataset.advanced?"false":"true"}))})),window.addEventListener("keydown",fcn_handleTabInput),window.addEventListener("scroll.rAF",fcn_throttle(fcn_popupPosition,250)),_$$(".modal-toggle").forEach((e=>{e.addEventListener("change",(e=>{const t=_$$$(e.currentTarget.dataset.target);t.classList.toggle("_open",e.currentTarget.checked),t.hidden=!e.currentTarget.checked;const n=t.querySelector(".close");n?.focus(),n?.blur()}))})),fcn_theBody.addEventListener("click",(e=>{const t=e.target.closest("[href]"),n=t?.getAttribute("href");if(!t||"A"===!t.tagName||!n.startsWith("#")||n.length<2||"#respond"===n)return;const o=n.replace("#",""),s=_$$(`[name="${o}"], [id="${o}"]`)[0],a=t.closest(".comment._story-comment");a&&(window.location.href=a.querySelector(".fictioneer-comment__link").href+n),s&&(e.preventDefault(),s.scrollIntoView({behavior:"smooth",block:t.dataset?.block??"start"}))})),fcn_markCurrentMenuItem(),_$$$("age-confirmation-modal")&&"1"!==localStorage.getItem("fcnAgeConfirmation")&&!fcn_isSearchEngineCrawler()?setTimeout((()=>{fcn_showAgeConfirmationModal()}),2500):_$$$("age-confirmation-modal")?.remove(),document.addEventListener("DOMContentLoaded",(()=>{_$$(".splide:not(.no-auto-splide, .is-initialized)").forEach((e=>{"undefined"!=typeof Splide&&new Splide(e).mount()}))})); \ No newline at end of file +const fcn_theSite=_$$$("site"),fcn_theBody=_$("body"),fcn_theRoot=document.documentElement,fcn_inlineStorage=_$$$("inline-storage").dataset,fcn_urlParams=Object.fromEntries(new URLSearchParams(window.location.search).entries()),fcn_pageLoadTimestamp=Date.now(),fcn_ajaxLimitThreshold=Date.now()-parseInt(fictioneer_ajax.ttl);var fcn_isLoggedIn=fcn_theBody.classList.contains("logged-in"),fcn_chapterList=_$("#story-chapter-list > ul");function fcn_cleanupWebStorage(e=!1){const t=["fcnProfileAvatar","fcnBookshelfContent"];e||t.push("fcnChapterBookmarks"),t.forEach((e=>localStorage.removeItem(e)));const n=["loggedIn","follows","reminders","checkmarks","bookmarks","fingerprint"],o=fcn_parseJSON(localStorage.getItem("fcnUserData"));o&&(n.forEach((e=>o[e]=!1)),localStorage.setItem("fcnUserData",JSON.stringify(o)));const s=fcn_parseJSON(localStorage.getItem("fcnAuth"));s?.loggedIn&&localStorage.removeItem("fcnAuth")}function fcn_prepareLogin(){localStorage.removeItem("fcnUserData"),localStorage.removeItem("fcnAuth")}function fcn_cleanupGuestView(){fcn_isLoggedIn=!1,fcn_theBody.classList.remove("logged-in","is-admin","is-moderator","is-editor","is-author"),_$$$("fictioneer-ajax-nonce")?.remove(),_$$(".only-moderators, .only-admins, .only-authors, .only-editors, .chapter-group__list-item-checkmark").forEach((e=>{e.remove()}))}function fcn_ajaxAuth(){let e=!1,t=fcn_parseJSON(localStorage.getItem("fcnAuth"))??!1;if(fcn_isLoggedIn&&!t?.loggedIn&&(localStorage.removeItem("fcnAuth"),t=!1),t){fcn_addNonceHTML(t.nonceHtml);const n=new CustomEvent("fcnAuthReady",{detail:{nonceHtml:t.nonceHtml,nonce:t.nonce,loggedIn:t.loggedIn,isAdmin:t.isAdmin,isModerator:t.isModerator,isAuthor:t.isAuthor,isEditor:t.isEditor},bubbles:!0,cancelable:!1});if(document.dispatchEvent(n),e=!0,fcn_ajaxLimitThreshold{if(t.success){fcn_addNonceHTML(t.data.nonceHtml);const n={lastLoaded:Date.now(),nonceHtml:t.data.nonceHtml,nonce:t.data.nonce,loggedIn:t.data.loggedIn,isAdmin:t.data.isAdmin,isModerator:t.data.isModerator,isAuthor:t.data.isAuthor,isEditor:t.data.isEditor};if(!e){const e=new CustomEvent("fcnAuthReady",{detail:n,bubbles:!0,cancelable:!1});document.dispatchEvent(e)}localStorage.setItem("fcnAuth",JSON.stringify(n))}else{fcn_cleanupGuestView();const e=new Event("fcnAuthFailed");document.dispatchEvent(e)}})).catch((()=>{localStorage.removeItem("fcnAuth"),fcn_cleanupGuestView();const e=new Event("fcnAuthError");document.dispatchEvent(e)}))}function fcn_addNonceHTML(e){_$$$("fictioneer-ajax-nonce")?.remove(),fcn_theBody.appendChild(fcn_html`${e}`)}function fcn_setLoggedInState(e){fcn_isLoggedIn=e.loggedIn,fcn_theBody.classList.add("logged-in"),fcn_theBody.classList.toggle("is-admin",e.isAdmin),fcn_theBody.classList.toggle("is-moderator",e.isModerator),fcn_theBody.classList.toggle("is-author",e.isAuthor),fcn_theBody.classList.toggle("is-editor",e.isEditor);const t=['label[for="modal-login-toggle"]',"#modal-login-toggle","#login-modal"];e.isAdmin||(t.push(".only-admins"),e.isModerator||t.push(".only-moderators"),e.isAuthor||t.push(".only-authors"),e.isEditor||t.push(".only-editors")),_$$(t.join(", ")).forEach((e=>e.remove())),fcn_getProfileImage(),fcn_fetchUserData()}function fcn_loadEmbed(e){e.target.parentNode.querySelectorAll("iframe, script")[0].src=e.target.dataset.src,e.target.parentElement.querySelector(".embed-logo")?.remove(),e.target.remove()}function fcn_appendTermMenu(e,t){const n=_$$$(`term-submenu-${e}`);if(!n)return;const o=n.content.cloneNode(!0);t.classList.add("menu-item-has-children"),t.querySelector('[href="#"]').addEventListener("click",(e=>{e.preventDefault()})),t.appendChild(o)}fcn_chapterList&&(fcn_chapterList=fcn_chapterList.cloneNode(!0),_$$$("story-chapter-list").remove(),fcn_chapterList.querySelector(`[data-id="${fcn_chapterList.dataset.currentId}"]`)?.classList.add("current-chapter")),fcn_isLoggedIn||fcn_theRoot.dataset.ajaxAuth||(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView()),"function"==typeof fcn_removeQueryArgs&&fcn_removeQueryArgs(),_$("#wp-admin-bar-logout a")?.addEventListener("click",(()=>{fcn_cleanupWebStorage()})),_$$(".subscriber-login, .oauth-login-link, [data-prepare-login]").forEach((e=>{e.addEventListener("click",(()=>{fcn_prepareLogin()}))})),document.addEventListener("DOMContentLoaded",(()=>{fcn_theRoot.dataset.ajaxAuth&&fcn_ajaxAuth()})),!fcn_isLoggedIn&&fcn_theRoot.dataset.ajaxAuth&&document.addEventListener("fcnAuthReady",(e=>{e.detail.loggedIn?fcn_setLoggedInState(e.detail):(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView())})),fcn_bindEventToAnimationFrame("scroll","scroll.rAF"),fcn_bindEventToAnimationFrame("resize","resize.rAF"),fcn_theBody.addEventListener("click",(e=>{const t=e.target.closest(".toggle-last-clicked");if(t&&(!["BUTTON","A","INPUT","SELECT"].includes(e.target.tagName)||e.target.classList.contains("toggle-last-clicked")))return fcn_toggleLastClicked?.(t),"function"==typeof fcn_popupPosition&&fcn_popupPosition(),void e.stopPropagation();const n=e.target.closest(".page-numbers.dots:not(button)");if(n)return void fcn_jumpPage(n);const o=e.target.closest(".spoiler");if(o)return void o.classList.toggle("_open");e.target.closest(".oauth-login-link, .subscriber-login, [data-prepare-login]")&&fcn_prepareLogin();const s=e.target.closest("[data-click]"),a=s?.dataset.click;if(a)switch(a){case"copy-to-clipboard":s.select(),fcn_copyToClipboard(s.value,s.dataset.message);break;case"reset-consent":fcn_deleteCookie("fcn_cookie_consent"),location.reload();break;case"clear-cookies":fcn_deleteAllCookies(),alert(s.dataset.message);break;case"logout":fcn_cleanupWebStorage();break;case"card-toggle-follow":fcn_isLoggedIn?fcn_toggleFollow(s.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-reminder":fcn_isLoggedIn?fcn_toggleReminder(s.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-checkmarks":fcn_isLoggedIn?(fcn_toggleCheckmark(parseInt(s.dataset.storyId),s.dataset.type,parseInt(s.dataset.chapterId),null,s.dataset.mode),fcn_updateCheckmarksView()):_$$$("modal-login-toggle")?.click();break;case"toggle-obfuscation":s.closest("[data-obfuscation-target]").classList.toggle("_obfuscated")}})),fcn_theBody.addEventListener("change",(e=>{const t=e.target.closest('[type="checkbox"]');if(!t)return;const n=t.name,o=n?_$$(`label[for="${n}"]`):[],s=t.checked;t.closest("[aria-checked]")?.setAttribute("aria-checked",s),o.forEach((e=>{e.closest("[aria-checked]")?.setAttribute("aria-checked",s)}))})),_$$(".iframe-consent, .twitter-consent").forEach((e=>{e.onclick=e=>{fcn_loadEmbed(e)}})),document.addEventListener("DOMContentLoaded",(()=>{const e=_$("#menu-navigation > .menu-item"),t=_$$$("full-navigation");e&&t&&e.offsetHeight{fcn_appendTermMenu("category",e)})),_$$(".main-navigation .trigger-term-menu-tags").forEach((e=>{fcn_appendTermMenu("post_tag",e)})),_$$(".main-navigation .trigger-term-menu-genres").forEach((e=>{fcn_appendTermMenu("fcn_genre",e)})),_$$(".main-navigation .trigger-term-menu-fandoms").forEach((e=>{fcn_appendTermMenu("fcn_fandom",e)})),_$$(".main-navigation .trigger-term-menu-characters").forEach((e=>{fcn_appendTermMenu("fcn_character",e)})),_$$(".main-navigation .trigger-term-menu-warnings").forEach((e=>{fcn_appendTermMenu("fcn_content_warning",e)}))}));var fcn_lastScrollTop=0;function fcn_scrollDirection(){if(fcn_theSite.classList.contains("transformed-scroll"))return;const e="hidden"!==window.getComputedStyle(document.documentElement).overflow?window.scrollY??document.documentElement.scrollTop:fcn_theBody.scrollTop??1;fcn_theBody.classList.toggle("scrolled-to-top",0===e),e>fcn_lastScrollTop&&Math.abs(fcn_lastScrollTop-e)>=10?(fcn_theBody.classList.add("scrolling-down"),fcn_theBody.classList.remove("scrolling-up"),fcn_lastScrollTop=Math.max(e,0)):e=50&&(fcn_theBody.classList.add("scrolling-up"),fcn_theBody.classList.remove("scrolling-down"),fcn_lastScrollTop=Math.max(e,0))}function fcn_observe(e,t,n={}){const o=_$(e);if(!o)return null;new IntersectionObserver((e=>t(e[0])),n).observe(o)}function fcn_dragElement(e){const t=e.querySelector(".drag-anchor")??e;let n,o;function s(t){t.preventDefault(),e.style.top=e.offsetTop-(o-t.clientY)+"px",e.style.left=e.offsetLeft-(n-t.clientX)+"px",n=t.clientX,o=t.clientY}function a(){t.onmouseup=null,t.onmousemove=null}t.onmousedown=function(e){e.preventDefault(),n=e.clientX,o=e.clientY,t.onmousemove=s,t.onmouseup=a}}function fcn_showNotification(e,t=3,n="base"){const o=_$("#notifications"),s=document.createElement("div");s.innerHTML=e,s.classList.add("notifications__message",`_${n}`),s.style.opacity=1,s.style.transitionDelay=`${t}s`,o.prepend(s),s.addEventListener("transitionend",(e=>{"opacity"===e.propertyName&&o.removeChild(e.target)})),s.addEventListener("click",(e=>{o.removeChild(e.currentTarget)})),setTimeout((()=>{s.style.opacity=0}),100)}if(window.addEventListener("scroll.rAF",fcn_throttle(fcn_scrollDirection,200)),fcn_scrollDirection(),document.addEventListener("DOMContentLoaded",(()=>{fcn_observe(".main-observer",(e=>{fcn_theBody.classList.toggle("is-inside-main",e.intersectionRatio<1&&e.boundingClientRect.top<=0)}),{threshold:[1]}),fcn_observe(".chapter-end",(e=>{fcn_theBody.classList.toggle("is-end-of-chapter",e.isIntersecting||e.boundingClientRect.top<0)}),{root:null,threshold:0}),fcn_observe("#nav-observer-sticky",(e=>{_$$$("full-navigation").classList.toggle("is-sticky",e.intersectionRatio<1)}),{threshold:[1]})})),_$$(".modal__header.drag-anchor").forEach((e=>{fcn_dragElement(e.closest(".modal__wrapper"))})),fcn_urlParams){switch(fcn_urlParams.failure&&console.error("Failure:",fcn_urlParams.failure),fcn_urlParams.failure){case"oauth_email_taken":fcn_showNotification(fictioneer_tl.notification.oauthEmailTaken,5,"warning");break;case"oauth_already_linked":fcn_showNotification(fictioneer_tl.notification.oauthAccountAlreadyLinked,5,"warning")}if("oauth_new"===fcn_urlParams.success)fcn_showNotification(fictioneer_tl.notification.oauthNew,10);else fcn_urlParams.success?.startsWith("oauth_merged_")&&fcn_showNotification(fictioneer_tl.notification.oauthAccountLinked,3,"success");if(fcn_urlParams["fictioneer-notice"]){let e="1"===fcn_urlParams.failure?"warning":"base";e="1"===fcn_urlParams.success?"success":e,fcn_showNotification(fcn_sanitizeHTML(fcn_urlParams["fictioneer-notice"]),3,e)}}const fcn_settingMinimal=_$$$("site-setting-minimal"),fcn_settingChapterProgressBar=_$$$("site-setting-chapter-progress-bar"),fcn_settingHueRotateRange=_$$$("site-setting-hue-rotate-range"),fcn_settingHueRotateText=_$$$("site-setting-hue-rotate-text"),fcn_settingHueRotateReset=_$$$("site-setting-hue-rotate-reset"),fcn_settingDarkenRanges=_$$(".setting-darken-range"),fcn_settingDarkenTexts=_$$(".setting-darken-text"),fcn_settingDarkenResets=_$$(".setting-darken-reset"),fcn_settingSaturationRanges=_$$(".setting-saturation-range"),fcn_settingSaturationTexts=_$$(".setting-saturation-text"),fcn_settingSaturationResets=_$$(".setting-saturation-reset"),fcn_settingFontLightnessRanges=_$$(".setting-font-lightness-range"),fcn_settingFontLightnessTexts=_$$(".setting-font-lightness-text"),fcn_settingFontLightnessResets=_$$(".setting-font-lightness-reset"),fcn_settingEvents=["nav-sticky","background-textures","polygons","covers","text-shadows","minimal","chapter-progress-bar"];var fcn_siteSettings=fcn_getSiteSettings();function fcn_updateSiteSetting(e,t,n){e.checked=n,fcn_siteSettings[t]=n,fcn_applySiteSettings(fcn_siteSettings)}function fcn_toggleLightMode(){fcn_setLightMode(!(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault))}function fcn_setLightMode(e,t=!1){localStorage.setItem("fcnLightmode",e),fcn_theRoot.dataset.mode=e?"light":"dark",_$$(".toggle-light-mode").forEach((t=>{t.closest("[aria-checked]")?.setAttribute("aria-checked",e)})),t||fcn_updateThemeColor()}function fcn_updateFontWeight(){const e="default"!=fcn_siteSettings["font-weight"];_$$(".site-setting-font-weight").forEach((e=>{e.value=fcn_siteSettings["font-weight"]})),_$$(".font-weight-reset").forEach((t=>{t.classList.toggle("_modified",e)}))}function fcn_resetFontWeight(){fcn_siteSettings["font-weight"]="default",fcn_theRoot.dataset.fontWeight="default",fcn_applySiteSettings(fcn_siteSettings)}function fcn_updateHueRotate(e){e=fcn_clamp(0,360,e??0),fcn_settingHueRotateText.value=e,fcn_settingHueRotateRange.value=e,fcn_settingHueRotateReset.classList.toggle("_modified",0!=e),fcn_theRoot.style.setProperty("--hue-rotate",`(${e}deg + var(--hue-offset))`),fcn_siteSettings["hue-rotate"]=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setHueRotate(){fcn_updateHueRotate(this.value)}function fcn_updateDarken(e=null){e=fcn_clamp(-1,1,e??fcn_siteSettings.darken),e=Math.round(100*(e+Number.EPSILON))/100,fcn_settingDarkenResets.forEach((t=>{t.classList.toggle("_modified",0!=e)})),fcn_settingDarkenRanges.forEach((t=>{t.value=e})),fcn_settingDarkenTexts.forEach((t=>{t.value=parseInt(100*e)}));const t=e>=0?1+e**2:1-e**2;fcn_theRoot.style.setProperty("--darken",`(${t} + var(--lightness-offset))`),fcn_siteSettings.darken=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setDarkenFromRange(){fcn_updateDarken(this.value)}function fcn_setDarkenFromText(){"-"!=this.value&&""!=this.value&&fcn_updateDarken((parseInt(this.value)??0)/100)}function fcn_updateSaturation(e=null){e=fcn_clamp(-1,1,e??fcn_siteSettings.saturation),fcn_settingSaturationResets.forEach((t=>{t.classList.toggle("_modified",0!=e)})),fcn_settingSaturationRanges.forEach((t=>{t.value=e})),fcn_settingSaturationTexts.forEach((t=>{t.value=parseInt(100*e)}));const t=e>=0?1+e**2:1-e**2;fcn_theRoot.style.setProperty("--saturation",`(${t} + var(--saturation-offset))`),fcn_siteSettings.saturation=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setSaturationFromRange(){fcn_updateSaturation(this.value)}function fcn_setSaturationFromText(){"-"!=this.value&&""!=this.value&&fcn_updateSaturation((parseInt(this.value)??0)/100)}function fcn_updateFontLightness(e=null){e=fcn_clamp(-1,1,e??fcn_siteSettings["font-lightness"]??1),fcn_settingFontLightnessResets.forEach((t=>{t.classList.toggle("_modified",0!=e)})),fcn_settingFontLightnessRanges.forEach((t=>{t.value=e})),fcn_settingFontLightnessTexts.forEach((t=>{t.value=parseInt(100*e)}));const t=e>=0?1+e**2:1-e**2;fcn_theRoot.style.setProperty("--font-lightness",`(${t} + var(--font-lightness-offset))`),fcn_siteSettings["font-lightness"]=e,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setFontLightnessFromRange(){fcn_updateFontLightness(this.value)}function fcn_setFontLightnessFromText(){"-"!=this.value&&""!=this.value&&fcn_updateFontLightness((parseInt(this.value)??0)/100)}function fcn_defaultSiteSettings(){return{"nav-sticky":!0,"background-textures":!0,polygons:!0,covers:!0,"text-shadows":!1,minimal:!1,"chapter-progress-bar":!0,"site-theme":"default","font-weight":"default",darken:0,saturation:0,"font-saturation":0,"font-lightness":0,"hue-rotate":0}}function fcn_getSiteSettings(){const e=fcn_parseJSON(localStorage.getItem("fcnSiteSettings"))??fcn_defaultSiteSettings();return fcn_setSiteSettings(e),e}function fcn_setSiteSettings(e=null){"object"==typeof(e=e||fcn_siteSettings)&&(fcn_siteSettings=e,localStorage.setItem("fcnSiteSettings",JSON.stringify(e)))}function fcn_applySiteSettings(e){e="object"!=typeof e?fcn_defaultSiteSettings():e,Object.entries(e).forEach((e=>{const t=_$$$(`site-setting-${e[0]}`);switch(t&&(t.checked=e[1]),e[0]){case"minimal":fcn_theRoot.classList.toggle("minimal",e[1]);break;case"darken":fcn_updateDarken();break;case"saturation":fcn_updateSaturation();break;case"font-saturation":break;case"font-lightness":fcn_updateFontLightness();break;case"hue-rotate":fcn_updateHueRotate(e[1]);break;case"font-weight":fcn_updateFontWeight();break;default:fcn_theRoot.classList.toggle(`no-${e[0]}`,!e[1])}})),fcn_setSiteSettings(e)}function fcn_updateSiteTheme(e){fcn_siteSettings["site-theme"]=e,fcn_theRoot.dataset.theme=e,_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=e),fcn_applySiteSettings(fcn_siteSettings),fcn_updateThemeColor()}function fcn_resetSiteTheme(){fcn_updateSiteTheme("default"),_$$(".site-setting-site-theme").forEach((e=>{e.value="default"}))}function fcn_jumpPage(e){if(fcn_theRoot.dataset.disablePageJump)return;const t=parseInt(window.prompt(fictioneer_tl.notification.enterPageNumber));if(t>0){const n=e.nextElementSibling.getAttribute("href"),o=["page=","paged=","comment-page-","pg="];for(const e of o)if(n.includes(e))return void(window.location.href=n.replace(new RegExp(`${e}\\d+`),e+t));window.location.href=n.replace(/page\/\d+/,`page/${t}`)}}fcn_settingEvents.forEach((e=>{_$$$(`site-setting-${e}`)?.addEventListener("change",(t=>{fcn_updateSiteSetting(t.currentTarget,e,t.currentTarget.checked)}))})),fcn_setLightMode(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault,!0),_$$(".toggle-light-mode").forEach((e=>{e.onclick=()=>fcn_toggleLightMode()})),_$$(".font-weight-reset").forEach((e=>{e.addEventListener("click",fcn_resetFontWeight)})),_$$(".site-setting-font-weight").forEach((e=>{e.onchange=e=>{fcn_siteSettings["font-weight"]=e.target.value,fcn_theRoot.dataset.fontWeight=e.target.value,fcn_applySiteSettings(fcn_siteSettings),fcn_updateFontWeight()}})),fcn_settingHueRotateReset?.addEventListener("click",(()=>{fcn_updateHueRotate(0)})),fcn_settingHueRotateRange?.addEventListener("input",fcn_throttle(fcn_setHueRotate,1e3/24)),fcn_settingHueRotateText?.addEventListener("input",fcn_setHueRotate),fcn_settingDarkenResets.forEach((e=>{e.addEventListener("click",(()=>{fcn_updateDarken(0)}))})),fcn_settingDarkenRanges.forEach((e=>{e.addEventListener("input",fcn_throttle(fcn_setDarkenFromRange,1e3/24))})),fcn_settingDarkenTexts.forEach((e=>{e.addEventListener("input",fcn_setDarkenFromText)})),fcn_settingSaturationResets.forEach((e=>{e.addEventListener("click",(()=>{fcn_updateSaturation(0)}))})),fcn_settingSaturationRanges.forEach((e=>{e.addEventListener("input",fcn_throttle(fcn_setSaturationFromRange,1e3/24))})),fcn_settingSaturationTexts.forEach((e=>{e.addEventListener("input",fcn_setSaturationFromText)})),fcn_settingFontLightnessResets.forEach((e=>{e.addEventListener("click",(()=>{fcn_updateFontLightness(0)}))})),fcn_settingFontLightnessRanges.forEach((e=>{e.addEventListener("input",fcn_throttle(fcn_setFontLightnessFromRange,1e3/24))})),fcn_settingFontLightnessTexts.forEach((e=>{e.addEventListener("input",fcn_setFontLightnessFromText)})),fcn_applySiteSettings(fcn_siteSettings),_$$(".site-setting-site-theme").forEach((e=>{e.value=fcn_siteSettings["site-theme"]?fcn_siteSettings["site-theme"]:"default",_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=e.value),e.addEventListener("change",(e=>{fcn_updateSiteTheme(e.target.value)}))})),_$$$("site-setting-theme-reset")?.addEventListener("click",fcn_resetSiteTheme),fcn_updateThemeColor();const fcn_cardListMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.length>0&&("function"==typeof fcn_updateFollowsView&&fcn_updateFollowsView(),"function"==typeof fcn_updateCheckmarksView&&fcn_updateCheckmarksView(),"function"==typeof fcn_updateRemindersView&&fcn_updateRemindersView())}))}));function fcn_revealCommentImage(e){const t=e.parentElement.querySelector("img");t.src=t.dataset.src,e.remove()}function fcn_contactFormSubmit(e){const t=e.closest("form"),n=new FormData(t),o={action:"fictioneer_ajax_submit_contact_form"};if(t.reportValidity()&&(e.disabled=!0,e.innerHTML=e.dataset.disabled,!(Date.now(){n.success?(t.querySelector("textarea").value="",e.innerHTML=e.dataset.done,fcn_showNotification(n.data.success,3,"success")):n.data.error&&(e.disabled=!1,e.innerHTML=e.dataset.enabled,fcn_showNotification(n.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),e.disabled=!1,e.innerHTML=e.dataset.enabled)})).then((()=>{t.classList.remove("ajax-in-progress")}))}}_$$(".card-list:not(._no-mutation-observer)").forEach((e=>fcn_cardListMutationObserver.observe(e,{childList:!0,subtree:!0}))),_$$(".chapter-group__name").forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.closest(".chapter-group"),n=t.querySelector(".chapter-group__list"),o=!t.classList.contains("_closed");_$(".main__background")?.classList.add("will-change"),n.style.height=`${n.scrollHeight}px`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.classList.toggle("_closed",o),n.style.height=o?"0":`${n.scrollHeight}px`}))}))}))})),_$$(".chapter-group__list").forEach((e=>{e.addEventListener("transitionend",(t=>{e.style.height="",e.querySelectorAll("a, button, label, input:not([hidden])").forEach((t=>{t.tabIndex=e.parentElement.classList.contains("_closed")?"-1":"0"})),_$(".main__background")?.classList.remove("will-change")}))})),_$(".fictioneer-comments")?.addEventListener("click",(e=>{e.target?.classList.contains("consent-button")&&fcn_revealCommentImage(e.target)})),_$$(".fcn-contact-form").forEach((e=>{e.querySelector(".fcn-contact-form__submit").addEventListener("click",(e=>{fcn_contactFormSubmit(e.currentTarget)}))})),fcn_theBody.querySelectorAll(".modal-toggle").forEach((e=>{e.addEventListener("change",(e=>{if(e.currentTarget.checked){const t=e.currentTarget.nextElementSibling.querySelector('[tabindex="0"]');t?.focus(),t?.blur()}else fcn_theBody.classList.contains("user-is-tabbing")&&fcn_theSite.querySelector(`label[for="${e.currentTarget.id}"]`)?.focus()}))})),_$$('[data-click-action*="open-dialog-modal"]').forEach((e=>{e.addEventListener("click",(e=>{document.querySelector(e.currentTarget.dataset.clickTarget).showModal()}))})),_$$('[data-click-action*="close-dialog-modal"], button[formmethod="dialog"][value="cancel"]').forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),e.target.closest("dialog").close()}))})),_$$("dialog").forEach((e=>{e.addEventListener("mousedown",(e=>{"dialog"===e.target.tagName.toLowerCase()&&(e.preventDefault(),e.target.close())}))})),_$(".content-section")?.addEventListener("click",(e=>{if(e.target.closest('[data-click-action*="open-tooltip-modal"]')&&!window.getSelection().toString()){const t=_$$$("fictioneer-tooltip-dialog"),n=e.target.dataset.dialogHeader,o=e.target.dataset.dialogContent;o.length>200&&(t.style="--modal-width: 400px;"),n&&(t.querySelector('[data-finder="tooltip-dialog-header"]').innerHTML=n),t.querySelector('[data-finder="tooltip-dialog-content"]').innerHTML=o,t.showModal()}})),fcn_theBody.addEventListener("keydown",(e=>{let t=document.activeElement.closest('[tabindex="0"]:not(a, input, button, select)');if(["BUTTON","A","INPUT","SELECT"].includes(document.activeElement.tagName)&&(t=null),t&&(32!=e.keyCode&&13!=e.keyCode||(e.preventDefault(),t.click())),27==e.keyCode){_$$(".modal-toggle:checked").forEach((e=>{e.checked=!1,e.dispatchEvent(new Event("change"))}));const e=_$(".lightbox.show");if(e)return void e.querySelector(".lightbox__close").click();const t=_$(".selected-paragraph #button-close-paragraph-tools");if(t)return void t.click();const n=_$("#tts-interface:not(.hidden)");if(n){if(n.classList.contains("playing")){const e=_$$$("button-tts-pause");e?.click(),e?.focus(),e?.blur()}else _$$$("button-tts-stop").click();return}}}));class FCN_KeywordInput{constructor(e){this.input=e,this.operator=e.closest(".keyword-input").querySelector(".keyword-input__operator input"),this.inputWrapper=e.closest(".keyword-input__input-wrapper"),this.block=e.closest(".keyword-input"),this.form=this.block.closest(".search-form"),this.collection=this.block.querySelector(".keyword-input__collection"),this.suggestionList=this.block.querySelector(".keyword-input__suggestion-list"),this.tabSuggestion=this.block.querySelector(".keyword-input__tab-suggestion"),this.allowText=this.form.querySelector(".allow-list")?.innerText??"{}",this.allowList=JSON.parse(this.allowText),this.hints=this.block.querySelector(".keyword-input__hints"),this.noHint=this.block.querySelector(".keyword-input__no-suggestions"),this.keywords=this.collection.value.length>0?this.collection.value.split(","):[],this.bindEvents(),this.resize(),this.filterSuggestions()}resize(){const e=this.tabSuggestion.innerText.length>0?this.tabSuggestion.innerText.length:this.input.value.length;this.input.style.width=.88*e+2+"ch"}reset(){this.keywords=[],this.block.querySelectorAll(".node").forEach((e=>{e.remove()})),this.block.querySelectorAll(".keyword-input__operator > input").forEach((e=>{e.checked=!1})),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}encode(e){const t=(new TextEncoder).encode(e.toLowerCase());return btoa(String.fromCharCode.apply(null,t))}filterSuggestions(){const e=this.input.value.toLowerCase();let t=0,n="";""==e?this.suggestionList.querySelectorAll(".keyword-button").forEach((e=>{e.hidden=!0})):this.suggestionList.querySelectorAll(".keyword-button").forEach((o=>{const s=o.innerText.toLowerCase();s.includes(e)&&this.keywords.indexOf(s)<0?(o.hidden=!1,t++,""==n&&s.startsWith(e)&&(n=s)):o.hidden=!0})),this.hints.querySelectorAll(".keyword-button").forEach((e=>{this.keywords.indexOf(e.value.toLowerCase())>-1?e.hidden=!0:e.hidden=!1})),this.tabSuggestion.innerHTML=n,this.hints.hidden=!(""==e),this.noHint.hidden=!(""!=e&&t<1)}addNode(e=null,t=null){const n=e??this.input.value.replace(",","");let o=this.allowList[this.encode(n)];if("authors"!=this.collection.name&&"ex_authors"!=this.collection.name||!t||(o=this.allowList[this.encode(n)+`_${t.value}`]),!o||this.keywords.indexOf(o)>-1)return;this.keywords.push(o);const s=document.createElement("div");s.innerHTML=`${n}`,s.classList.add("node"),s.dataset.value=o,this.inputWrapper.parentNode.insertBefore(s,this.inputWrapper),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}removeNodeByValue(e){this.block.querySelector(`[data-value="${e}"]`)?.remove(),this.keywords=this.keywords.filter((t=>t!=e)),this.updateCollection(),this.filterSuggestions(),this.resize()}updateCollection(){this.collection.value=this.keywords.join(","),this.block.classList.toggle("_empty",""===this.collection.value),this.form.querySelector(".search-form__current").innerHTML=""}bindEvents(){this.input.addEventListener("input",(e=>{e.currentTarget.value.includes(",")&&this.addNode(),this.block.classList.toggle("_empty",""===e.currentTarget.value&&""===this.collection.value),this.filterSuggestions(),this.resize()})),this.input.addEventListener("keydown",(e=>{9!=e.keyCode&&13!=e.keyCode||""!=this.tabSuggestion.innerText&&(e.preventDefault(),this.input.value=this.tabSuggestion.innerText,this.addNode()),27==e.keyCode&&(this.input.value="",this.tabSuggestion.innerHTML="",document.activeElement.blur()),8==e.keyCode&&""==this.input.value&&this.keywords.length>0&&this.removeNodeByValue(this.keywords.slice(-1))})),this.input.addEventListener("blur",(()=>{const e=this.allowList[this.encode(this.input.value)];this.blurTimeout=e?setTimeout((()=>{this.addNode()}),150):setTimeout((()=>{this.input.value="",this.tabSuggestion.innerHTML="",this.filterSuggestions(),this.resize()}),150)})),this.block.addEventListener("click",(e=>{e.target.closest(".node-delete")&&(e.preventDefault(),this.removeNodeByValue(e.target.closest(".node").dataset.value))})),this.block.querySelectorAll(".keyword-button").forEach((e=>{e.addEventListener("click",(e=>{clearTimeout(this.blurTimeout),this.addNode(e.currentTarget.innerText,e.currentTarget)}))}))}}function fcn_resetSearchForm(e,t,n){n.forEach((e=>e.reset())),t.querySelectorAll("input, select").forEach((e=>{e.value=e.dataset.default??e.value})),t.querySelector(".search-form__current").innerHTML="",fcn_showNotification(e.dataset.reset,2)}function fcn_handleTabInput(e){9==e.keyCode&&(fcn_theBody.classList.add("user-is-tabbing"),window.removeEventListener("keydown",fcn_handleTabInput),window.addEventListener("mousedown",fcn_handleMouseInput))}function fcn_handleMouseInput(){fcn_theBody.classList.remove("user-is-tabbing"),window.removeEventListener("mousedown",fcn_handleMouseInput),window.addEventListener("keydown",fcn_handleTabInput)}function fcn_popupPosition(){_$$(".popup-menu-toggle.last-clicked .popup-menu:not(._fixed-position)").forEach((e=>{if("none"===window.getComputedStyle(e).display)return;const t=fcn_detectScreenCollision(e);t&&0===t.length||(t.includes("top")?(e.classList.remove("_top"),e.classList.add("_bottom")):t.includes("bottom")&&(e.classList.remove("_bottom"),e.classList.add("_top")),e.closest("._fixed-horizontal")||(t.includes("left")?(e.classList.remove("_center","_justify-right"),e.classList.add("_justify-left")):t.includes("right")&&(e.classList.remove("_center","_justify-left"),e.classList.add("_justify-right"))))}))}function fcn_markCurrentMenuItem(){_$$(`.menu-item > [data-nav-object-id="${fcn_theBody.dataset.postId}"]`).forEach((e=>{e.setAttribute("aria-current","page"),e.closest(".menu-item").classList.add("current-menu-item")}))}function fcn_showAgeConfirmationModal(){const e=_$(".story__article, .chapter__article")?.dataset.ageRating;if(!fcn_theRoot.dataset.ageConfirmation&&e&&"adult"!==e)return void _$$$("age-confirmation-modal")?.remove();const t=_$$$("age-confirmation-leave");fcn_theRoot.classList.add("age-modal-open"),_$$$("age-confirmation-modal").classList.add("_open"),_$$$("age-confirmation-confirm")?.addEventListener("click",(e=>{fcn_theRoot.classList.remove("age-modal-open"),e.currentTarget.closest(".modal").remove(),localStorage.setItem("fcnAgeConfirmation","1")})),t?.addEventListener("click",(()=>{window.location.href=t.dataset.redirect??"https://search.brave.com/",localStorage.removeItem("fcnAgeConfirmation")}))}_$$(".search-form").forEach((e=>{if(e.classList.contains("_simple"))return;const t=[];e.querySelectorAll(".keyword-input__input").forEach((e=>{t.push(new FCN_KeywordInput(e))})),e.querySelector(".allow-list")?.remove(),e.addEventListener("change",(t=>{t.target.classList.contains("search-form__advanced-control")||t.target.classList.contains("search-form__string")||(e.querySelector(".search-form__current").innerHTML="")})),e.querySelectorAll(".reset").forEach((n=>{n.addEventListener("click",(()=>{fcn_resetSearchForm(n,e,t)}))}))})),_$$(".search-form__advanced-toggle").forEach((e=>{e.addEventListener("click",(e=>{const t=e.currentTarget.closest("form");t.dataset.advanced="true"==t.dataset.advanced?"false":"true"}))})),window.addEventListener("keydown",fcn_handleTabInput),window.addEventListener("scroll.rAF",fcn_throttle(fcn_popupPosition,250)),_$$(".modal-toggle").forEach((e=>{e.addEventListener("change",(e=>{const t=_$$$(e.currentTarget.dataset.target);t.classList.toggle("_open",e.currentTarget.checked),t.hidden=!e.currentTarget.checked;const n=t.querySelector(".close");n?.focus(),n?.blur()}))})),fcn_theBody.addEventListener("click",(e=>{const t=e.target.closest("[href]"),n=t?.getAttribute("href");if(!t||"A"===!t.tagName||!n.startsWith("#")||n.length<2||"#respond"===n)return;const o=n.replace("#",""),s=_$$(`[name="${o}"], [id="${o}"]`)[0],a=t.closest(".comment._story-comment");a&&(window.location.href=a.querySelector(".fictioneer-comment__link").href+n),s&&(e.preventDefault(),s.scrollIntoView({behavior:"smooth",block:t.dataset?.block??"start"}))})),fcn_markCurrentMenuItem(),_$$$("age-confirmation-modal")&&"1"!==localStorage.getItem("fcnAgeConfirmation")&&!fcn_isSearchEngineCrawler()?setTimeout((()=>{fcn_showAgeConfirmationModal()}),2500):_$$$("age-confirmation-modal")?.remove(), +document.addEventListener("DOMContentLoaded",(()=>{_$$(".splide:not(.no-auto-splide, .is-initialized)").forEach((e=>{"undefined"!=typeof Splide&&new Splide(e).mount()}))})); \ No newline at end of file diff --git a/js/complete.min.js b/js/complete.min.js index 6dc0eb4f..a7d7251b 100644 --- a/js/complete.min.js +++ b/js/complete.min.js @@ -1,6 +1,6 @@ -const _$=document.querySelector.bind(document),_$$=document.querySelectorAll.bind(document),_$$$=document.getElementById.bind(document);async function fcn_ajaxPost(t={},e=null,n={}){e&&!e.startsWith("http")&&(e=fictioneer_ajax.rest_url+e),e=e||fictioneer_ajax.ajax_url;let a={"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"};a={...a,...n},t={nonce:fcn_getNonce(),...t};const o=await fetch(e,{method:"POST",credentials:"same-origin",headers:a,mode:"same-origin",body:new URLSearchParams(t)});return o.ok?o.json():Promise.reject(o)}async function fcn_ajaxGet(t={},e=null,n={}){e&&!e.startsWith("http")&&(e=fictioneer_ajax.rest_url+e),e=e||fictioneer_ajax.ajax_url,e=fcn_buildUrl(t={nonce:fcn_getNonce(),...t},e);let a={"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"};a={...a,...n};const o=await fetch(e,{method:"GET",credentials:"same-origin",headers:a,mode:"same-origin"});return o.ok?o.json():Promise.reject(o)}function fcn_evaluateAsBoolean(t,e=!1){if(void 0===t)return e;if("boolean"==typeof t)return t;if(t instanceof HTMLInputElement&&"checkbox"===t.getAttribute("type"))return t.checked;t instanceof HTMLElement&&(t.hasAttribute("value")?t=t.value:t.hasAttribute("data-value")&&(t=t.dataset.value));const n=String(t),a=parseInt(t);return"true"===n||"1"===n||1===a||"false"!==n&&"0"!==n&&0!==a&&e}function fcn_copyToClipboard(t,e=!1){e=e||fictioneer_tl.notification.copiedToClipboard,navigator.clipboard&&(navigator.clipboard.writeText(t),e&&fcn_showNotification(e,2))}function fcn_parseJSON(t){if(null==t||"string"!=typeof t)return null;try{return JSON.parse(t)}catch(t){return null}}function fcn_removeItemOnce(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),t}function fcn_clamp(t,e,n){return Math.min(Math.max(n,t),e)}function fcn_updateThemeColor(t=!1){const e=fcn_siteSettings.darken?fcn_siteSettings.darken:0,n=fcn_siteSettings.saturation?fcn_siteSettings.saturation:0,a=fcn_siteSettings["hue-rotate"]?fcn_siteSettings["hue-rotate"]:0,o=e>=0?1+e**2:1-e**2,c=n>=0?1+n**2:1-n**2;let s=getComputedStyle(document.documentElement).getPropertyValue("--theme-color-base").trim().split(" ");s=`hsl(${(parseInt(s[0])+a)%360}deg ${(parseInt(s[1])*c).toFixed(2)}% ${(parseInt(s[2])*o).toFixed(2)}%)`,_$("meta[name=theme-color]").setAttribute("content",t||s)}function fcn_offset(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}}function fcn_throttle(t,e,n){var a,o,c,s=null,i=0;n||(n={});var r=function(){i=!1===n.leading?0:Date.now(),s=null,c=t.apply(a,o),s||(a=o=null)};return function(){var l=Date.now();i||!1!==n.leading||(i=l);var f=e-(l-i);return a=this,o=arguments,f<=0||f>e?(s&&(clearTimeout(s),s=null),i=l,c=t.apply(a,o),s||(a=o=null)):s||!1===n.trailing||(s=setTimeout(r,f)),c}}var fcn_lastClicked,fcn_animFrameEvents=new Map;function fcn_bindEventToAnimationFrame(t,e,n=window){n.addEventListener(t,(function(){fcn_animFrameEvents.get(e)||(fcn_animFrameEvents.set(e,!0),requestAnimationFrame((()=>{n.dispatchEvent(new CustomEvent(e)),fcn_animFrameEvents.set(e,!1)})))}))}function fcn_toggleLastClicked(t){const e=!t.classList.contains("last-clicked");t.classList.toggle("last-clicked",e),t.closest(".watch-last-clicked")?.classList.toggle("has-last-clicked",e),fcn_lastClicked&&fcn_lastClicked!=t&&fcn_removeLastClick(fcn_lastClicked),fcn_lastClicked=t}function fcn_removeLastClick(t){t.closest(".watch-last-clicked")?.classList.remove("has-last-clicked"),t.classList.remove("last-clicked"),fcn_lastClicked=null}function fcn_cleanTextSelectionFromButtons(t){return t=(t=(t=(t=(t=(t=t.replace(/[\r\n]{2,}/g,"__$__")).replace(new RegExp("(__Bookmark|__Quote|__Link)","g"),"")).replace(new RegExp("(__Bookmark|__Quote|__TTS|__Link)","g"),"")).replace(new RegExp("(__Bookmark|__Quote|__Suggestion|__TTS|__Link)","g"),"")).replace(new RegExp("(__Bookmark|__Quote|__Suggestion|__Link)","g"),"")).replace(/[__$]{1,}/g,"\n\n").replace(/^[\r\n]+|[\r\n]+$/g,"")}function fcn_deleteCookie(t){document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function fcn_deleteAllCookies(){localStorage.clear(),document.cookie.split(";").forEach((t=>{document.cookie=t.replace(/^ +/,"").replace(/=.*/,"=;expires="+(new Date).toUTCString()+";path=/")}))}function fcn_setCookie(t,e,n=30){const a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3);const o="expires="+a.toUTCString();document.cookie=t+"="+encodeURIComponent(e)+";"+o+";SameSite=Strict;path=/"}function fcn_getCookie(t){const e=t+"=",n=document.cookie.split(";");for(var a=0;a{e.searchParams.append(n,t[n])})),e}function fcn_buildErrorNotice(t,e=!1,n=!0){console.error("Error Message",t);const a=document.createElement("div");let o=t;return e&&(a.id=e),a.classList="notice _warning","object"==typeof t&&(o="",t.status&&(o=`${t.status}: `),t.statusText&&(o+=t.statusText),o||(o="Unknown error.")),a.innerHTML=`
${n?fcn_sanitizeHTML(o):o}
`,a}function fcn_sanitizeHTML(t){const e=document.createElement("div");return e.innerText=t instanceof HTMLElement?t.innerHTML:t,e.innerHTML}function fcn_detectScreenCollision(t){const e=t.getBoundingClientRect(),n=window.innerHeight??document.documentElement.clientHeight,a=window.innerWidth??document.documentElement.clientWidth,o=(t.closest(".popup-menu-toggle")?.clientHeight??32)+16,c=n-e.bottom,s=[];return e.top<=50&&c>50+o&&s.push("top"),e.bottom>=n-50&&e.top>50+o&&s.push("bottom"),e.left<=10&&s.push("left"),e.right>=a-10&&s.push("right"),s}function fcn_scrollTo(t,e=64){window.scrollTo({top:t.getBoundingClientRect().top+window.scrollY-e,behavior:"smooth"})}function fcn_html(...t){const e=document.createElement("template");return e.innerHTML=String.raw(...t).trim(),e.content.firstChild}function fcn_splitList(t,e=","){if(!t||""===t.trim())return[];let n=t.replace(/\r?\n|\r/g,"").split(e);return n=n.map((t=>t.trim())).filter((t=>t.length>0)),n}function fcn_isSearchEngineCrawler(){const t=navigator.userAgent.toLowerCase();return["googlebot","bingbot","slurp","duckduckbot","baiduspider","yandexbot","sogou","exabot","facebot","ia_archiver"].some((e=>t.includes(e)))}_$("body").addEventListener("click",(t=>{const e=t.target.closest(".toggle-last-clicked");!["BUTTON","A"].includes(t.target.tagName)&&e||null!==t.target.closest(".escape-last-click")||fcn_lastClicked&&e!=fcn_lastClicked&&fcn_removeLastClick(fcn_lastClicked)})),_$("body").addEventListener("keydown",(t=>{27==t.keyCode&&fcn_lastClicked&&(fcn_removeLastClick(fcn_lastClicked),document.activeElement?.blur())})),_$$$("full-navigation")?.addEventListener("mouseover",(()=>{fcn_lastClicked&&(fcn_removeLastClick(fcn_lastClicked),document.activeElement?.blur())}));const fcn_theSite=_$$$("site"),fcn_theBody=_$("body"),fcn_theRoot=document.documentElement,fcn_inlineStorage=_$$$("inline-storage").dataset,fcn_urlParams=Object.fromEntries(new URLSearchParams(window.location.search).entries()),fcn_pageLoadTimestamp=Date.now(),fcn_ajaxLimitThreshold=Date.now()-parseInt(fictioneer_ajax.ttl);var fcn_isLoggedIn=fcn_theBody.classList.contains("logged-in"),fcn_chapterList=_$("#story-chapter-list > ul");function fcn_cleanupWebStorage(t=!1){const e=["fcnProfileAvatar","fcnBookshelfContent"];t||e.push("fcnChapterBookmarks"),e.forEach((t=>localStorage.removeItem(t)));const n=["loggedIn","follows","reminders","checkmarks","bookmarks","fingerprint"],a=fcn_parseJSON(localStorage.getItem("fcnUserData"));a&&(n.forEach((t=>a[t]=!1)),localStorage.setItem("fcnUserData",JSON.stringify(a)));const o=fcn_parseJSON(localStorage.getItem("fcnAuth"));o?.loggedIn&&localStorage.removeItem("fcnAuth")}function fcn_prepareLogin(){localStorage.removeItem("fcnUserData"),localStorage.removeItem("fcnAuth")}function fcn_cleanupGuestView(){fcn_isLoggedIn=!1,fcn_theBody.classList.remove("logged-in","is-admin","is-moderator","is-editor","is-author"),_$$$("fictioneer-ajax-nonce")?.remove(),_$$(".only-moderators, .only-admins, .only-authors, .only-editors, .chapter-group__list-item-checkmark").forEach((t=>{t.remove()}))}function fcn_ajaxAuth(){let t=!1,e=fcn_parseJSON(localStorage.getItem("fcnAuth"))??!1;if(fcn_isLoggedIn&&!e?.loggedIn&&(localStorage.removeItem("fcnAuth"),e=!1),e){fcn_addNonceHTML(e.nonceHtml);const n=new CustomEvent("fcnAuthReady",{detail:{nonceHtml:e.nonceHtml,nonce:e.nonce,loggedIn:e.loggedIn,isAdmin:e.isAdmin,isModerator:e.isModerator,isAuthor:e.isAuthor,isEditor:e.isEditor},bubbles:!0,cancelable:!1});if(document.dispatchEvent(n),t=!0,fcn_ajaxLimitThreshold{if(e.success){fcn_addNonceHTML(e.data.nonceHtml);const n={lastLoaded:Date.now(),nonceHtml:e.data.nonceHtml,nonce:e.data.nonce,loggedIn:e.data.loggedIn,isAdmin:e.data.isAdmin,isModerator:e.data.isModerator,isAuthor:e.data.isAuthor,isEditor:e.data.isEditor};if(!t){const t=new CustomEvent("fcnAuthReady",{detail:n,bubbles:!0,cancelable:!1});document.dispatchEvent(t)}localStorage.setItem("fcnAuth",JSON.stringify(n))}else{fcn_cleanupGuestView();const t=new Event("fcnAuthFailed");document.dispatchEvent(t)}})).catch((()=>{localStorage.removeItem("fcnAuth"),fcn_cleanupGuestView();const t=new Event("fcnAuthError");document.dispatchEvent(t)}))}function fcn_addNonceHTML(t){_$$$("fictioneer-ajax-nonce")?.remove(),fcn_theBody.appendChild(fcn_html`${t}`)}function fcn_setLoggedInState(t){fcn_isLoggedIn=t.loggedIn,fcn_theBody.classList.add("logged-in"),fcn_theBody.classList.toggle("is-admin",t.isAdmin),fcn_theBody.classList.toggle("is-moderator",t.isModerator),fcn_theBody.classList.toggle("is-author",t.isAuthor),fcn_theBody.classList.toggle("is-editor",t.isEditor);const e=['label[for="modal-login-toggle"]',"#modal-login-toggle","#login-modal"];t.isAdmin||(e.push(".only-admins"),t.isModerator||e.push(".only-moderators"),t.isAuthor||e.push(".only-authors"),t.isEditor||e.push(".only-editors")),_$$(e.join(", ")).forEach((t=>t.remove())),fcn_getProfileImage(),fcn_fetchUserData()}function fcn_loadEmbed(t){t.target.parentNode.querySelectorAll("iframe, script")[0].src=t.target.dataset.src,t.target.parentElement.querySelector(".embed-logo")?.remove(),t.target.remove()}function fcn_appendTermMenu(t,e){const n=_$$$(`term-submenu-${t}`);if(!n)return;const a=n.content.cloneNode(!0);e.classList.add("menu-item-has-children"),e.querySelector('[href="#"]').addEventListener("click",(t=>{t.preventDefault()})),e.appendChild(a)}fcn_chapterList&&(fcn_chapterList=fcn_chapterList.cloneNode(!0),_$$$("story-chapter-list").remove(),fcn_chapterList.querySelector(`[data-id="${fcn_chapterList.dataset.currentId}"]`)?.classList.add("current-chapter")),fcn_isLoggedIn||fcn_theRoot.dataset.ajaxAuth||(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView()),"function"==typeof fcn_removeQueryArgs&&fcn_removeQueryArgs(),_$("#wp-admin-bar-logout a")?.addEventListener("click",(()=>{fcn_cleanupWebStorage()})),_$$(".subscriber-login, .oauth-login-link, [data-prepare-login]").forEach((t=>{t.addEventListener("click",(()=>{fcn_prepareLogin()}))})),document.addEventListener("DOMContentLoaded",(()=>{fcn_theRoot.dataset.ajaxAuth&&fcn_ajaxAuth()})),!fcn_isLoggedIn&&fcn_theRoot.dataset.ajaxAuth&&document.addEventListener("fcnAuthReady",(t=>{t.detail.loggedIn?fcn_setLoggedInState(t.detail):(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView())})),fcn_bindEventToAnimationFrame("scroll","scroll.rAF"),fcn_bindEventToAnimationFrame("resize","resize.rAF"),fcn_theBody.addEventListener("click",(t=>{const e=t.target.closest(".toggle-last-clicked");if(e&&(!["BUTTON","A","INPUT","SELECT"].includes(t.target.tagName)||t.target.classList.contains("toggle-last-clicked")))return fcn_toggleLastClicked?.(e),"function"==typeof fcn_popupPosition&&fcn_popupPosition(),void t.stopPropagation();const n=t.target.closest(".page-numbers.dots:not(button)");if(n)return void fcn_jumpPage(n);const a=t.target.closest(".spoiler");if(a)return void a.classList.toggle("_open");t.target.closest(".oauth-login-link, .subscriber-login, [data-prepare-login]")&&fcn_prepareLogin();const o=t.target.closest("[data-click]"),c=o?.dataset.click;if(c)switch(c){case"copy-to-clipboard":o.select(),fcn_copyToClipboard(o.value,o.dataset.message);break;case"reset-consent":fcn_deleteCookie("fcn_cookie_consent"),location.reload();break;case"clear-cookies":fcn_deleteAllCookies(),alert(o.dataset.message);break;case"logout":fcn_cleanupWebStorage();break;case"card-toggle-follow":fcn_isLoggedIn?fcn_toggleFollow(o.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-reminder":fcn_isLoggedIn?fcn_toggleReminder(o.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-checkmarks":fcn_isLoggedIn?(fcn_toggleCheckmark(parseInt(o.dataset.storyId),o.dataset.type,parseInt(o.dataset.chapterId),null,o.dataset.mode),fcn_updateCheckmarksView()):_$$$("modal-login-toggle")?.click();break;case"toggle-obfuscation":o.closest("[data-obfuscation-target]").classList.toggle("_obfuscated")}})),fcn_theBody.addEventListener("change",(t=>{const e=t.target.closest('[type="checkbox"]');if(!e)return;const n=e.name,a=n?_$$(`label[for="${n}"]`):[],o=e.checked;e.closest("[aria-checked]")?.setAttribute("aria-checked",o),a.forEach((t=>{t.closest("[aria-checked]")?.setAttribute("aria-checked",o)}))})),_$$(".iframe-consent, .twitter-consent").forEach((t=>{t.onclick=t=>{fcn_loadEmbed(t)}})),document.addEventListener("DOMContentLoaded",(()=>{const t=_$("#menu-navigation > .menu-item"),e=_$$$("full-navigation");t&&e&&t.offsetHeight{fcn_appendTermMenu("category",t)})),_$$(".main-navigation .trigger-term-menu-tags").forEach((t=>{fcn_appendTermMenu("post_tag",t)})),_$$(".main-navigation .trigger-term-menu-genres").forEach((t=>{fcn_appendTermMenu("fcn_genre",t)})),_$$(".main-navigation .trigger-term-menu-fandoms").forEach((t=>{fcn_appendTermMenu("fcn_fandom",t)})),_$$(".main-navigation .trigger-term-menu-characters").forEach((t=>{fcn_appendTermMenu("fcn_character",t)})),_$$(".main-navigation .trigger-term-menu-warnings").forEach((t=>{fcn_appendTermMenu("fcn_content_warning",t)}))}));var fcn_lastScrollTop=0;function fcn_scrollDirection(){if(fcn_theSite.classList.contains("transformed-scroll"))return;const t="hidden"!==window.getComputedStyle(document.documentElement).overflow?window.scrollY??document.documentElement.scrollTop:fcn_theBody.scrollTop??1;fcn_theBody.classList.toggle("scrolled-to-top",0===t),t>fcn_lastScrollTop&&Math.abs(fcn_lastScrollTop-t)>=10?(fcn_theBody.classList.add("scrolling-down"),fcn_theBody.classList.remove("scrolling-up"),fcn_lastScrollTop=Math.max(t,0)):t=50&&(fcn_theBody.classList.add("scrolling-up"),fcn_theBody.classList.remove("scrolling-down"),fcn_lastScrollTop=Math.max(t,0))}function fcn_observe(t,e,n={}){const a=_$(t);if(!a)return null;new IntersectionObserver((t=>e(t[0])),n).observe(a)}function fcn_dragElement(t){const e=t.querySelector(".drag-anchor")??t;let n,a;function o(e){e.preventDefault(),t.style.top=t.offsetTop-(a-e.clientY)+"px",t.style.left=t.offsetLeft-(n-e.clientX)+"px",n=e.clientX,a=e.clientY}function c(){e.onmouseup=null,e.onmousemove=null}e.onmousedown=function(t){t.preventDefault(),n=t.clientX,a=t.clientY,e.onmousemove=o,e.onmouseup=c}}function fcn_showNotification(t,e=3,n="base"){const a=_$("#notifications"),o=document.createElement("div");o.innerHTML=t,o.classList.add("notifications__message",`_${n}`),o.style.opacity=1,o.style.transitionDelay=`${e}s`,a.prepend(o),o.addEventListener("transitionend",(t=>{"opacity"===t.propertyName&&a.removeChild(t.target)})),o.addEventListener("click",(t=>{a.removeChild(t.currentTarget)})),setTimeout((()=>{o.style.opacity=0}),100)}if(window.addEventListener("scroll.rAF",fcn_throttle(fcn_scrollDirection,200)),fcn_scrollDirection(),document.addEventListener("DOMContentLoaded",(()=>{fcn_observe(".main-observer",(t=>{fcn_theBody.classList.toggle("is-inside-main",t.intersectionRatio<1&&t.boundingClientRect.top<=0)}),{threshold:[1]}),fcn_observe(".chapter-end",(t=>{fcn_theBody.classList.toggle("is-end-of-chapter",t.isIntersecting||t.boundingClientRect.top<0)}),{root:null,threshold:0}),fcn_observe("#nav-observer-sticky",(t=>{_$$$("full-navigation").classList.toggle("is-sticky",t.intersectionRatio<1)}),{threshold:[1]})})),_$$(".modal__header.drag-anchor").forEach((t=>{fcn_dragElement(t.closest(".modal__wrapper"))})),fcn_urlParams){switch(fcn_urlParams.failure&&console.error("Failure:",fcn_urlParams.failure),fcn_urlParams.failure){case"oauth_email_taken":fcn_showNotification(fictioneer_tl.notification.oauthEmailTaken,5,"warning");break;case"oauth_already_linked":fcn_showNotification(fictioneer_tl.notification.oauthAccountAlreadyLinked,5,"warning")}if("oauth_new"===fcn_urlParams.success)fcn_showNotification(fictioneer_tl.notification.oauthNew,10);else fcn_urlParams.success?.startsWith("oauth_merged_")&&fcn_showNotification(fictioneer_tl.notification.oauthAccountLinked,3,"success");if(fcn_urlParams["fictioneer-notice"]){let t="1"===fcn_urlParams.failure?"warning":"base";t="1"===fcn_urlParams.success?"success":t,fcn_showNotification(fcn_sanitizeHTML(fcn_urlParams["fictioneer-notice"]),3,t)}}const fcn_settingMinimal=_$$$("site-setting-minimal"),fcn_settingChapterProgressBar=_$$$("site-setting-chapter-progress-bar"),fcn_settingHueRotateRange=_$$$("site-setting-hue-rotate-range"),fcn_settingHueRotateText=_$$$("site-setting-hue-rotate-text"),fcn_settingHueRotateReset=_$$$("site-setting-hue-rotate-reset"),fcn_settingDarkenRanges=_$$(".setting-darken-range"),fcn_settingDarkenTexts=_$$(".setting-darken-text"),fcn_settingDarkenResets=_$$(".setting-darken-reset"),fcn_settingSaturationRanges=_$$(".setting-saturation-range"),fcn_settingSaturationTexts=_$$(".setting-saturation-text"),fcn_settingSaturationResets=_$$(".setting-saturation-reset"),fcn_settingFontLightnessRanges=_$$(".setting-font-lightness-range"),fcn_settingFontLightnessTexts=_$$(".setting-font-lightness-text"),fcn_settingFontLightnessResets=_$$(".setting-font-lightness-reset"),fcn_settingEvents=["nav-sticky","background-textures","polygons","covers","text-shadows","minimal","chapter-progress-bar"];var fcn_siteSettings=fcn_getSiteSettings();function fcn_updateSiteSetting(t,e,n){t.checked=n,fcn_siteSettings[e]=n,fcn_applySiteSettings(fcn_siteSettings)}function fcn_toggleLightMode(){fcn_setLightMode(!(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault))}function fcn_setLightMode(t,e=!1){localStorage.setItem("fcnLightmode",t),fcn_theRoot.dataset.mode=t?"light":"dark",_$$(".toggle-light-mode").forEach((e=>{e.closest("[aria-checked]")?.setAttribute("aria-checked",t)})),e||fcn_updateThemeColor()}function fcn_updateFontWeight(){const t="default"!=fcn_siteSettings["font-weight"];_$$(".site-setting-font-weight").forEach((t=>{t.value=fcn_siteSettings["font-weight"]})),_$$(".font-weight-reset").forEach((e=>{e.classList.toggle("_modified",t)}))}function fcn_resetFontWeight(){fcn_siteSettings["font-weight"]="default",fcn_theRoot.dataset.fontWeight="default",fcn_applySiteSettings(fcn_siteSettings)}function fcn_updateHueRotate(t){t=fcn_clamp(0,360,t??0),fcn_settingHueRotateText.value=t,fcn_settingHueRotateRange.value=t,fcn_settingHueRotateReset.classList.toggle("_modified",0!=t),fcn_theRoot.style.setProperty("--hue-rotate",`(${t}deg + var(--hue-offset))`),fcn_siteSettings["hue-rotate"]=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setHueRotate(){fcn_updateHueRotate(this.value)}function fcn_updateDarken(t=null){t=fcn_clamp(-1,1,t??fcn_siteSettings.darken),t=Math.round(100*(t+Number.EPSILON))/100,fcn_settingDarkenResets.forEach((e=>{e.classList.toggle("_modified",0!=t)})),fcn_settingDarkenRanges.forEach((e=>{e.value=t})),fcn_settingDarkenTexts.forEach((e=>{e.value=parseInt(100*t)}));const e=t>=0?1+t**2:1-t**2;fcn_theRoot.style.setProperty("--darken",`(${e} + var(--lightness-offset))`),fcn_siteSettings.darken=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setDarkenFromRange(){fcn_updateDarken(this.value)}function fcn_setDarkenFromText(){"-"!=this.value&&""!=this.value&&fcn_updateDarken((parseInt(this.value)??0)/100)}function fcn_updateSaturation(t=null){t=fcn_clamp(-1,1,t??fcn_siteSettings.saturation),fcn_settingSaturationResets.forEach((e=>{e.classList.toggle("_modified",0!=t)})),fcn_settingSaturationRanges.forEach((e=>{e.value=t})),fcn_settingSaturationTexts.forEach((e=>{e.value=parseInt(100*t)}));const e=t>=0?1+t**2:1-t**2;fcn_theRoot.style.setProperty("--saturation",`(${e} + var(--saturation-offset))`),fcn_siteSettings.saturation=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setSaturationFromRange(){fcn_updateSaturation(this.value)}function fcn_setSaturationFromText(){"-"!=this.value&&""!=this.value&&fcn_updateSaturation((parseInt(this.value)??0)/100)}function fcn_updateFontLightness(t=null){t=fcn_clamp(-1,1,t??fcn_siteSettings["font-lightness"]??1),fcn_settingFontLightnessResets.forEach((e=>{e.classList.toggle("_modified",0!=t)})),fcn_settingFontLightnessRanges.forEach((e=>{e.value=t})),fcn_settingFontLightnessTexts.forEach((e=>{e.value=parseInt(100*t)}));const e=t>=0?1+t**2:1-t**2;fcn_theRoot.style.setProperty("--font-lightness",`(${e} + var(--font-lightness-offset))`),fcn_siteSettings["font-lightness"]=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setFontLightnessFromRange(){fcn_updateFontLightness(this.value)}function fcn_setFontLightnessFromText(){"-"!=this.value&&""!=this.value&&fcn_updateFontLightness((parseInt(this.value)??0)/100)}function fcn_defaultSiteSettings(){return{"nav-sticky":!0,"background-textures":!0,polygons:!0,covers:!0,"text-shadows":!1,minimal:!1,"chapter-progress-bar":!0,"site-theme":"default","font-weight":"default",darken:0,saturation:0,"font-saturation":0,"font-lightness":0,"hue-rotate":0}}function fcn_getSiteSettings(){const t=fcn_parseJSON(localStorage.getItem("fcnSiteSettings"))??fcn_defaultSiteSettings();return fcn_setSiteSettings(t),t}function fcn_setSiteSettings(t=null){"object"==typeof(t=t||fcn_siteSettings)&&(fcn_siteSettings=t,localStorage.setItem("fcnSiteSettings",JSON.stringify(t)))}function fcn_applySiteSettings(t){t="object"!=typeof t?fcn_defaultSiteSettings():t,Object.entries(t).forEach((t=>{const e=_$$$(`site-setting-${t[0]}`);switch(e&&(e.checked=t[1]),t[0]){case"minimal":fcn_theRoot.classList.toggle("minimal",t[1]);break;case"darken":fcn_updateDarken();break;case"saturation":fcn_updateSaturation();break;case"font-saturation":break;case"font-lightness":fcn_updateFontLightness();break;case"hue-rotate":fcn_updateHueRotate(t[1]);break;case"font-weight":fcn_updateFontWeight();break;default:fcn_theRoot.classList.toggle(`no-${t[0]}`,!t[1])}})),fcn_setSiteSettings(t)}function fcn_updateSiteTheme(t){fcn_siteSettings["site-theme"]=t,fcn_theRoot.dataset.theme=t,_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=t),fcn_applySiteSettings(fcn_siteSettings),fcn_updateThemeColor()}function fcn_resetSiteTheme(){fcn_updateSiteTheme("default"),_$$(".site-setting-site-theme").forEach((t=>{t.value="default"}))}function fcn_jumpPage(t){if(fcn_theRoot.dataset.disablePageJump)return;const e=parseInt(window.prompt(fictioneer_tl.notification.enterPageNumber));if(e>0){const n=t.nextElementSibling.getAttribute("href"),a=["page=","paged=","comment-page-","pg="];for(const t of a)if(n.includes(t))return void(window.location.href=n.replace(new RegExp(`${t}\\d+`),t+e));window.location.href=n.replace(/page\/\d+/,`page/${e}`)}}fcn_settingEvents.forEach((t=>{_$$$(`site-setting-${t}`)?.addEventListener("change",(e=>{fcn_updateSiteSetting(e.currentTarget,t,e.currentTarget.checked)}))})),fcn_setLightMode(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault,!0),_$$(".toggle-light-mode").forEach((t=>{t.onclick=()=>fcn_toggleLightMode()})),_$$(".font-weight-reset").forEach((t=>{t.addEventListener("click",fcn_resetFontWeight)})),_$$(".site-setting-font-weight").forEach((t=>{t.onchange=t=>{fcn_siteSettings["font-weight"]=t.target.value,fcn_theRoot.dataset.fontWeight=t.target.value,fcn_applySiteSettings(fcn_siteSettings),fcn_updateFontWeight()}})),fcn_settingHueRotateReset?.addEventListener("click",(()=>{fcn_updateHueRotate(0)})),fcn_settingHueRotateRange?.addEventListener("input",fcn_throttle(fcn_setHueRotate,1e3/24)),fcn_settingHueRotateText?.addEventListener("input",fcn_setHueRotate),fcn_settingDarkenResets.forEach((t=>{t.addEventListener("click",(()=>{fcn_updateDarken(0)}))})),fcn_settingDarkenRanges.forEach((t=>{t.addEventListener("input",fcn_throttle(fcn_setDarkenFromRange,1e3/24))})),fcn_settingDarkenTexts.forEach((t=>{t.addEventListener("input",fcn_setDarkenFromText)})),fcn_settingSaturationResets.forEach((t=>{t.addEventListener("click",(()=>{fcn_updateSaturation(0)}))})),fcn_settingSaturationRanges.forEach((t=>{t.addEventListener("input",fcn_throttle(fcn_setSaturationFromRange,1e3/24))})),fcn_settingSaturationTexts.forEach((t=>{t.addEventListener("input",fcn_setSaturationFromText)})),fcn_settingFontLightnessResets.forEach((t=>{t.addEventListener("click",(()=>{fcn_updateFontLightness(0)}))})),fcn_settingFontLightnessRanges.forEach((t=>{t.addEventListener("input",fcn_throttle(fcn_setFontLightnessFromRange,1e3/24))})),fcn_settingFontLightnessTexts.forEach((t=>{t.addEventListener("input",fcn_setFontLightnessFromText)})),fcn_applySiteSettings(fcn_siteSettings),_$$(".site-setting-site-theme").forEach((t=>{t.value=fcn_siteSettings["site-theme"]?fcn_siteSettings["site-theme"]:"default",_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=t.value),t.addEventListener("change",(t=>{fcn_updateSiteTheme(t.target.value)}))})),_$$$("site-setting-theme-reset")?.addEventListener("click",fcn_resetSiteTheme),fcn_updateThemeColor();const fcn_cardListMutationObserver=new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.length>0&&("function"==typeof fcn_updateFollowsView&&fcn_updateFollowsView(),"function"==typeof fcn_updateCheckmarksView&&fcn_updateCheckmarksView(),"function"==typeof fcn_updateRemindersView&&fcn_updateRemindersView())}))}));function fcn_revealCommentImage(t){const e=t.parentElement.querySelector("img");e.src=e.dataset.src,t.remove()}function fcn_contactFormSubmit(t){const e=t.closest("form"),n=new FormData(e),a={action:"fictioneer_ajax_submit_contact_form"};if(e.reportValidity()&&(t.disabled=!0,t.innerHTML=t.dataset.disabled,!(Date.now(){n.success?(e.querySelector("textarea").value="",t.innerHTML=t.dataset.done,fcn_showNotification(n.data.success,3,"success")):n.data.error&&(t.disabled=!1,t.innerHTML=t.dataset.enabled,fcn_showNotification(n.data.error,5,"warning"))})).catch((e=>{e.status&&e.statusText&&(fcn_showNotification(`${e.status}: ${e.statusText}`,5,"warning"),t.disabled=!1,t.innerHTML=t.dataset.enabled)})).then((()=>{e.classList.remove("ajax-in-progress")}))}}_$$(".card-list:not(._no-mutation-observer)").forEach((t=>fcn_cardListMutationObserver.observe(t,{childList:!0,subtree:!0}))),_$$(".chapter-group__name").forEach((t=>{t.addEventListener("click",(t=>{const e=t.currentTarget.closest(".chapter-group"),n=e.querySelector(".chapter-group__list"),a=!e.classList.contains("_closed");_$(".main__background")?.classList.add("will-change"),n.style.height=`${n.scrollHeight}px`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{e.classList.toggle("_closed",a),n.style.height=a?"0":`${n.scrollHeight}px`}))}))}))})),_$$(".chapter-group__list").forEach((t=>{t.addEventListener("transitionend",(e=>{t.style.height="",t.querySelectorAll("a, button, label, input:not([hidden])").forEach((e=>{e.tabIndex=t.parentElement.classList.contains("_closed")?"-1":"0"})),_$(".main__background")?.classList.remove("will-change")}))})),_$(".fictioneer-comments")?.addEventListener("click",(t=>{t.target?.classList.contains("consent-button")&&fcn_revealCommentImage(t.target)})),_$$(".fcn-contact-form").forEach((t=>{t.querySelector(".fcn-contact-form__submit").addEventListener("click",(t=>{fcn_contactFormSubmit(t.currentTarget)}))})),fcn_theBody.querySelectorAll(".modal-toggle").forEach((t=>{t.addEventListener("change",(t=>{if(t.currentTarget.checked){const e=t.currentTarget.nextElementSibling.querySelector('[tabindex="0"]');e?.focus(),e?.blur()}else fcn_theBody.classList.contains("user-is-tabbing")&&fcn_theSite.querySelector(`label[for="${t.currentTarget.id}"]`)?.focus()}))})),_$$('[data-click-action*="open-dialog-modal"]').forEach((t=>{t.addEventListener("click",(t=>{document.querySelector(t.currentTarget.dataset.clickTarget).showModal()}))})),_$$('[data-click-action*="close-dialog-modal"]').forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),t.target.closest("dialog").close()}))})),_$$("dialog").forEach((t=>{t.addEventListener("mousedown",(t=>{"dialog"===t.target.tagName.toLowerCase()&&(t.preventDefault(),t.target.close())}))})),fcn_theBody.addEventListener("keydown",(t=>{let e=document.activeElement.closest('[tabindex="0"]:not(a, input, button, select)');if(["BUTTON","A","INPUT","SELECT"].includes(document.activeElement.tagName)&&(e=null),e&&(32!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),e.click())),27==t.keyCode){_$$(".modal-toggle:checked").forEach((t=>{t.checked=!1,t.dispatchEvent(new Event("change"))}));const t=_$(".lightbox.show");if(t)return void t.querySelector(".lightbox__close").click();const e=_$(".selected-paragraph #button-close-paragraph-tools");if(e)return void e.click();const n=_$("#tts-interface:not(.hidden)");if(n){if(n.classList.contains("playing")){const t=_$$$("button-tts-pause");t?.click(),t?.focus(),t?.blur()}else _$$$("button-tts-stop").click();return}}}));class FCN_KeywordInput{constructor(t){this.input=t,this.operator=t.closest(".keyword-input").querySelector(".keyword-input__operator input"),this.inputWrapper=t.closest(".keyword-input__input-wrapper"),this.block=t.closest(".keyword-input"),this.form=this.block.closest(".search-form"),this.collection=this.block.querySelector(".keyword-input__collection"),this.suggestionList=this.block.querySelector(".keyword-input__suggestion-list"),this.tabSuggestion=this.block.querySelector(".keyword-input__tab-suggestion"),this.allowText=this.form.querySelector(".allow-list")?.innerText??"{}",this.allowList=JSON.parse(this.allowText),this.hints=this.block.querySelector(".keyword-input__hints"),this.noHint=this.block.querySelector(".keyword-input__no-suggestions"),this.keywords=this.collection.value.length>0?this.collection.value.split(","):[],this.bindEvents(),this.resize(),this.filterSuggestions()}resize(){const t=this.tabSuggestion.innerText.length>0?this.tabSuggestion.innerText.length:this.input.value.length;this.input.style.width=.88*t+2+"ch"}reset(){this.keywords=[],this.block.querySelectorAll(".node").forEach((t=>{t.remove()})),this.block.querySelectorAll(".keyword-input__operator > input").forEach((t=>{t.checked=!1})),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}encode(t){const e=(new TextEncoder).encode(t.toLowerCase());return btoa(String.fromCharCode.apply(null,e))}filterSuggestions(){const t=this.input.value.toLowerCase();let e=0,n="" -;""==t?this.suggestionList.querySelectorAll(".keyword-button").forEach((t=>{t.hidden=!0})):this.suggestionList.querySelectorAll(".keyword-button").forEach((a=>{const o=a.innerText.toLowerCase();o.includes(t)&&this.keywords.indexOf(o)<0?(a.hidden=!1,e++,""==n&&o.startsWith(t)&&(n=o)):a.hidden=!0})),this.hints.querySelectorAll(".keyword-button").forEach((t=>{this.keywords.indexOf(t.value.toLowerCase())>-1?t.hidden=!0:t.hidden=!1})),this.tabSuggestion.innerHTML=n,this.hints.hidden=!(""==t),this.noHint.hidden=!(""!=t&&e<1)}addNode(t=null,e=null){const n=t??this.input.value.replace(",","");let a=this.allowList[this.encode(n)];if("authors"!=this.collection.name&&"ex_authors"!=this.collection.name||!e||(a=this.allowList[this.encode(n)+`_${e.value}`]),!a||this.keywords.indexOf(a)>-1)return;this.keywords.push(a);const o=document.createElement("div");o.innerHTML=`${n}`,o.classList.add("node"),o.dataset.value=a,this.inputWrapper.parentNode.insertBefore(o,this.inputWrapper),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}removeNodeByValue(t){this.block.querySelector(`[data-value="${t}"]`)?.remove(),this.keywords=this.keywords.filter((e=>e!=t)),this.updateCollection(),this.filterSuggestions(),this.resize()}updateCollection(){this.collection.value=this.keywords.join(","),this.block.classList.toggle("_empty",""===this.collection.value),this.form.querySelector(".search-form__current").innerHTML=""}bindEvents(){this.input.addEventListener("input",(t=>{t.currentTarget.value.includes(",")&&this.addNode(),this.block.classList.toggle("_empty",""===t.currentTarget.value&&""===this.collection.value),this.filterSuggestions(),this.resize()})),this.input.addEventListener("keydown",(t=>{9!=t.keyCode&&13!=t.keyCode||""!=this.tabSuggestion.innerText&&(t.preventDefault(),this.input.value=this.tabSuggestion.innerText,this.addNode()),27==t.keyCode&&(this.input.value="",this.tabSuggestion.innerHTML="",document.activeElement.blur()),8==t.keyCode&&""==this.input.value&&this.keywords.length>0&&this.removeNodeByValue(this.keywords.slice(-1))})),this.input.addEventListener("blur",(()=>{const t=this.allowList[this.encode(this.input.value)];this.blurTimeout=t?setTimeout((()=>{this.addNode()}),150):setTimeout((()=>{this.input.value="",this.tabSuggestion.innerHTML="",this.filterSuggestions(),this.resize()}),150)})),this.block.addEventListener("click",(t=>{t.target.closest(".node-delete")&&(t.preventDefault(),this.removeNodeByValue(t.target.closest(".node").dataset.value))})),this.block.querySelectorAll(".keyword-button").forEach((t=>{t.addEventListener("click",(t=>{clearTimeout(this.blurTimeout),this.addNode(t.currentTarget.innerText,t.currentTarget)}))}))}}function fcn_resetSearchForm(t,e,n){n.forEach((t=>t.reset())),e.querySelectorAll("input, select").forEach((t=>{t.value=t.dataset.default??t.value})),e.querySelector(".search-form__current").innerHTML="",fcn_showNotification(t.dataset.reset,2)}function fcn_handleTabInput(t){9==t.keyCode&&(fcn_theBody.classList.add("user-is-tabbing"),window.removeEventListener("keydown",fcn_handleTabInput),window.addEventListener("mousedown",fcn_handleMouseInput))}function fcn_handleMouseInput(){fcn_theBody.classList.remove("user-is-tabbing"),window.removeEventListener("mousedown",fcn_handleMouseInput),window.addEventListener("keydown",fcn_handleTabInput)}function fcn_popupPosition(){_$$(".popup-menu-toggle.last-clicked .popup-menu:not(._fixed-position)").forEach((t=>{if("none"===window.getComputedStyle(t).display)return;const e=fcn_detectScreenCollision(t);e&&0===e.length||(e.includes("top")?(t.classList.remove("_top"),t.classList.add("_bottom")):e.includes("bottom")&&(t.classList.remove("_bottom"),t.classList.add("_top")),t.closest("._fixed-horizontal")||(e.includes("left")?(t.classList.remove("_center","_justify-right"),t.classList.add("_justify-left")):e.includes("right")&&(t.classList.remove("_center","_justify-left"),t.classList.add("_justify-right"))))}))}function fcn_markCurrentMenuItem(){_$$(`.menu-item > [data-nav-object-id="${fcn_theBody.dataset.postId}"]`).forEach((t=>{t.setAttribute("aria-current","page"),t.closest(".menu-item").classList.add("current-menu-item")}))}function fcn_showAgeConfirmationModal(){const t=_$(".story__article, .chapter__article")?.dataset.ageRating;if(!fcn_theRoot.dataset.ageConfirmation&&t&&"adult"!==t)return void _$$$("age-confirmation-modal")?.remove();const e=_$$$("age-confirmation-leave");fcn_theRoot.classList.add("age-modal-open"),_$$$("age-confirmation-modal").classList.add("_open"),_$$$("age-confirmation-confirm")?.addEventListener("click",(t=>{fcn_theRoot.classList.remove("age-modal-open"),t.currentTarget.closest(".modal").remove(),localStorage.setItem("fcnAgeConfirmation","1")})),e?.addEventListener("click",(()=>{window.location.href=e.dataset.redirect??"https://search.brave.com/",localStorage.removeItem("fcnAgeConfirmation")}))}function fcn_showLightbox(t){const e=_$$$("fictioneer-lightbox"),n=_$(".lightbox__content");let a=!1,o=null;if(n.innerHTML="",t.classList.add("lightbox-last-trigger"),"IMG"==t.tagName?(o=t.cloneNode(),a=!0):t.href&&(o=document.createElement("img"),o.src=t.href,a=!0),a&&o){["class","style","height","width"].forEach((t=>o.removeAttribute(t))),n.appendChild(o),e.classList.add("show");const t=e.querySelector(".lightbox__close");t?.focus(),t?.blur()}}function fcn_toggleMobileMenu(t){_$(".mobile-menu._advanced-mobile-menu")?fcn_toggleAdvancedMobileMenu(t):fcn_toggleSimpleMobileMenu(t)}function fcn_toggleSimpleMobileMenu(t){t?(fcn_theBody.classList.add("mobile-menu-open","scrolling-down"),fcn_theBody.classList.remove("scrolling-up")):(fcn_theBody.classList.remove("mobile-menu-open"),fcn_closeMobileFrames(),fcn_openMobileFrame("main"),_$$$("mobile-menu-toggle").checked=!1)}function fcn_toggleAdvancedMobileMenu(t){const e=_$$$("wpadminbar")?.offsetHeight??0,n=window.scrollY,a=fcn_theSite.scrollTop;t?(fcn_theBody.classList.add("mobile-menu-open","scrolling-down","scrolled-to-top"),fcn_theBody.classList.remove("scrolling-up"),fcn_theSite.classList.add("transformed-scroll","transformed-site"),fcn_theSite.scrollTop=n-e,fcn_updateThemeColor()):(fcn_theSite.classList.remove("transformed-site","transformed-scroll"),fcn_theBody.classList.remove("mobile-menu-open"),fcn_updateThemeColor(),fcn_closeMobileFrames(),fcn_openMobileFrame("main"),fcn_theRoot.style.scrollBehavior="auto",window.scroll(0,a+e),fcn_theRoot.style.scrollBehavior="",_$$$("mobile-menu-toggle").checked=!1,"function"==typeof fcn_trackProgress&&fcn_trackProgress())}function fcn_setupMobileJumpButton(t,e){const n=_$(t);n&&n.addEventListener("click",(()=>{fcn_toggleMobileMenu(!1),setTimeout((()=>{const t=e();t&&fcn_scrollTo(t)}),200)}))}function fcn_openMobileFrame(t){fcn_closeMobileFrames(),_$(`.mobile-menu__frame[data-frame="${t}"]`)?.classList.add("_active")}function fcn_closeMobileFrames(){_$$(".mobile-menu__frame._active").forEach((t=>{t.classList.remove("_active")}));const t=_$(".mobile-menu__bookmarks-panel");t&&(t.dataset.editing="false")}function fcn_appendChapterList(){const t=_$$$("mobile-menu-chapters-list");fcn_chapterList&&!t.hasChildNodes()&&t.appendChild(fcn_chapterList.cloneNode(!0))}_$$(".search-form").forEach((t=>{if(t.classList.contains("_simple"))return;const e=[];t.querySelectorAll(".keyword-input__input").forEach((t=>{e.push(new FCN_KeywordInput(t))})),t.querySelector(".allow-list")?.remove(),t.addEventListener("change",(e=>{e.target.classList.contains("search-form__advanced-control")||e.target.classList.contains("search-form__string")||(t.querySelector(".search-form__current").innerHTML="")})),t.querySelectorAll(".reset").forEach((n=>{n.addEventListener("click",(()=>{fcn_resetSearchForm(n,t,e)}))}))})),_$$(".search-form__advanced-toggle").forEach((t=>{t.addEventListener("click",(t=>{const e=t.currentTarget.closest("form");e.dataset.advanced="true"==e.dataset.advanced?"false":"true"}))})),window.addEventListener("keydown",fcn_handleTabInput),window.addEventListener("scroll.rAF",fcn_throttle(fcn_popupPosition,250)),_$$(".modal-toggle").forEach((t=>{t.addEventListener("change",(t=>{const e=_$$$(t.currentTarget.dataset.target);e.classList.toggle("_open",t.currentTarget.checked),e.hidden=!t.currentTarget.checked;const n=e.querySelector(".close");n?.focus(),n?.blur()}))})),fcn_theBody.addEventListener("click",(t=>{const e=t.target.closest("[href]"),n=e?.getAttribute("href");if(!e||"A"===!e.tagName||!n.startsWith("#")||n.length<2||"#respond"===n)return;const a=n.replace("#",""),o=_$$(`[name="${a}"], [id="${a}"]`)[0],c=e.closest(".comment._story-comment");c&&(window.location.href=c.querySelector(".fictioneer-comment__link").href+n),o&&(t.preventDefault(),o.scrollIntoView({behavior:"smooth",block:e.dataset?.block??"start"}))})),fcn_markCurrentMenuItem(),_$$$("age-confirmation-modal")&&"1"!==localStorage.getItem("fcnAgeConfirmation")&&!fcn_isSearchEngineCrawler()?setTimeout((()=>{fcn_showAgeConfirmationModal()}),2500):_$$$("age-confirmation-modal")?.remove(),document.addEventListener("DOMContentLoaded",(()=>{_$$(".splide:not(.no-auto-splide, .is-initialized)").forEach((t=>{"undefined"!=typeof Splide&&new Splide(t).mount()}))})),fcn_theBody.addEventListener("click",(t=>{const e=t.target.closest("[data-lightbox]:not(.no-auto-lightbox)");e&&(t.preventDefault(),fcn_showLightbox(e))})),fcn_theBody.addEventListener("keydown",(t=>{const e=t.target.closest("[data-lightbox]:not(.no-auto-lightbox)");e&&(32!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),fcn_showLightbox(e)))})),document.querySelectorAll(".lightbox__close, .lightbox").forEach((t=>{t.addEventListener("click",(t=>{if("IMG"!=t.target.tagName){_$$$("fictioneer-lightbox").classList.remove("show");const t=_$(".lightbox-last-trigger");t?.focus(),t?.blur(),t?.classList.remove("lightbox-last-trigger")}}))})),_$$$("mobile-menu-toggle")?.addEventListener("change",(t=>{fcn_toggleMobileMenu(t.currentTarget.checked)})),fcn_theSite.addEventListener("click",(t=>{fcn_theBody.classList.contains("mobile-menu-open")&&(t.preventDefault(),fcn_toggleMobileMenu(!1))})),fcn_setupMobileJumpButton("#mobile-menu-comment-jump",(()=>_$$$("comments"))),fcn_setupMobileJumpButton("#mobile-menu-bookmark-jump",(()=>_$(`[data-paragraph-id="${fcn_bookmarks.data[_$("article").id]["paragraph-id"]}"]`))),_$$(".button-change-lightness").forEach((t=>{t.addEventListener("click",(t=>{fcn_updateDarken(fcn_siteSettings.darken+parseFloat(t.currentTarget.value))}))})),_$$(".mobile-menu__frame-button").forEach((t=>{t.addEventListener("click",(t=>{fcn_openMobileFrame(t.currentTarget.dataset.frameTarget)}))})),_$$(".mobile-menu__back-button").forEach((t=>{t.addEventListener("click",(()=>{fcn_openMobileFrame("main")}))})),_$('.mobile-menu__frame-button[data-frame-target="chapters"]')?.addEventListener("click",(()=>{fcn_appendChapterList()}),{once:!0}),_$$$("micro-menu-label-open-chapter-list")?.addEventListener("click",(()=>{fcn_appendChapterList(),fcn_openMobileFrame("chapters")})),_$$$("button-mobile-menu-toggle-bookmarks-edit")?.addEventListener("click",(t=>{const e=t.currentTarget.closest(".mobile-menu__bookmarks-panel");e.dataset.editing="false"==e.dataset.editing?"true":"false"})),_$('.mobile-menu__frame-button[data-frame-target="bookmarks"]')?.addEventListener("click",(()=>{fcn_setMobileMenuBookmarks()}),{once:!0});const fcn_consentBanner=_$$$("consent-banner");function fcn_loadConsentBanner(){fcn_consentBanner.classList.remove("hidden"),fcn_consentBanner.hidden=!1,_$$$("consent-accept-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","full"),fcn_consentBanner.classList.add("hidden"),fcn_consentBanner.hidden=!0})),_$$$("consent-reject-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","necessary"),fcn_consentBanner.classList.add("hidden"),fcn_consentBanner.hidden=!0}))}fcn_consentBanner&&""===(fcn_getCookie("fcn_cookie_consent")??"")&&!fcn_isSearchEngineCrawler()?setTimeout((()=>{fcn_loadConsentBanner()}),4e3):fcn_consentBanner.remove();const fcn_chapterFormatting=_$(".chapter-formatting");var fcn_formatting=fcn_getFormatting();const fcn_paragraphTools=_$$$("paragraph-tools");var fcn_lastSelectedParagraphId,fcn_bookmarkColor="none";function fcn_toggleParagraphTools(t=!1,e=null){e&&e.classList.contains("spoiler")&&!e.classList.contains("_open")||(_$$$(`paragraph-${fcn_lastSelectedParagraphId}`)?.classList.remove("selected-paragraph"),t&&fcn_formatting["show-paragraph-tools"]?(fcn_lastSelectedParagraphId=t,e.classList.add("selected-paragraph"),e.classList.contains("is-wrapped")||(e.innerHTML=`${e.innerHTML}`,e.classList.add("is-wrapped")),e.append(fcn_paragraphTools)):fcn_lastSelectedParagraphId=null)}function fcn_touchParagraph(t){if(t.target.classList.contains("spoiler")||t.target.closest(".popup-menu-toggle, .skip-tools, a, button, label, input, textarea")||!t.target.closest("p")?.textContent.trim().length)return;if(!t.target.closest("p")?.parentElement?.classList.contains("chapter-formatting"))return;if(t.target.closest(".hidden, .inside-epub"))return;if(""!=window.getSelection().toString())return;const e=t.target.closest("p[data-paragraph-id]");if(t.target.closest(".tts-interface, .paragraph-tools__actions"))return;if(!e)return void fcn_toggleParagraphTools(!1);let n=!!e.dataset.paragraphId&&e.dataset.paragraphId;n=n!=fcn_lastSelectedParagraphId&&n;const a=(new Date).getTime();e.addEventListener("mouseup",(()=>{(new Date).getTime()<=a+300&&fcn_toggleParagraphTools(n,e)}),{once:!0})}function fcn_getQuote(t){const e=fcn_cleanTextSelectionFromButtons(window.getSelection().toString()),n=`[anchor]${t.target.closest("p[data-paragraph-id]").id}[/anchor]`;let a=t.target.closest("p[data-paragraph-id]").querySelector(".paragraph-inner").innerText,o="[…] ",c=" […]";if(a.length>16&&e.replace(/\s/g,"").length){const t=Math.ceil(.25*e.length),n=a.substring(0,t+1),s=a.substring(a.length-t,a.length);e.startsWith(n)&&(o=""),e.endsWith(s)&&(c=""),a=`${o}${e}${c}`}a=`${a} ${n}`,fcn_addQuoteToStack(a),fcn_showNotification(fictioneer_tl.notification.quoteAppendedToComment)}function fcn_addQuoteToStack(t){const e=_$(fictioneer_comments.form_selector??"#comment");e?"TEXTAREA"==e.tagName?(e.value+=`\n[quote]${t}[/quote]\n`,fcn_textareaAdjust(_$("textarea#comment"))):"DIV"==e.tagName&&(e.innerHTML+=`\n[quote]${t}[/quote]\n`):fcn_commentStack?.push(`\n[quote]${t}[/quote]\n`)}function fcn_openFullscreen(){document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen()}function fcn_closeFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}function fcn_getFormatting(){let t=fcn_parseJSON(localStorage.getItem("fcnChapterFormatting"))??fcn_defaultFormatting();return Object.keys(t).length<15&&(t=fcn_defaultFormatting()),t.timestamp<1651164557584&&(t=fcn_defaultFormatting(),t.timestamp=Date.now()),fcn_setFormatting(t),t}function fcn_defaultFormatting(){return{"font-saturation":0,"font-color":fictioneer_font_colors[0].css,"font-name":fictioneer_fonts[0].css,"font-size":100,"letter-spacing":0,"line-height":1.7,"paragraph-spacing":1.5,"site-width":fcn_theRoot.dataset.siteWidthDefault??"960",indent:!0,"show-sensitive-content":!0,"show-chapter-notes":!0,justify:!1,"show-comments":!0,"show-paragraph-tools":!0,timestamp:1664797604825,...JSON.parse(fcn_theRoot.dataset.defaultFormatting??"{}")}}function fcn_setFormatting(t){"object"==typeof t&&(fcn_formatting=t,localStorage.setItem("fcnChapterFormatting",JSON.stringify(t)))}function fcn_updateToggle(t,e,n,a={}){a={save:!0,...a};const o=fcn_evaluateAsBoolean(t,!0),c=_$(e);if(c&&(c.checked=o,c.closest("label").setAttribute("aria-checked",o)),a.toggleClass&&fcn_chapterFormatting.classList.toggle(a.toggleClass,a.invertClass?!o:o),a.sensitiveContent){const t=_$$$("inline-sensitive-content-toggle");t?.classList.toggle("hide-sensitive",!o),t?.setAttribute("aria-checked",!o)}a.notes&&_$$(".chapter-note-hideable").forEach((t=>{t.classList.toggle("hidden",!o)})),a.comments&&_$$(".chapter-comments-hideable").forEach((t=>{t.classList.toggle("hidden",!o)})),fcn_formatting[n]=o,a.save&&fcn_setFormatting(fcn_formatting)}document.addEventListener("click",(t=>{fcn_paragraphTools?.closest("p")?.contains(t.target)||fcn_toggleParagraphTools(!1)})),fcn_paragraphTools&&(document.addEventListener("mousedown",(t=>{fcn_touchParagraph(t)})),_$$$("button-close-paragraph-tools").onclick=t=>{fcn_toggleParagraphTools(!1)},_$$$("button-get-link").onclick=t=>{fcn_copyToClipboard(`${location.host}${location.pathname}#${t.target.closest("p[data-paragraph-id]").id}`,fictioneer_tl.notification.linkCopiedToClipboard)},_$$$("button-comment-stack")?.addEventListener("click",(t=>{fcn_getQuote(t)})),_$$(".paragraph-tools__bookmark-colors > div").forEach((t=>{t.onclick=t=>{fcn_bookmarkColor=t.target.dataset.color}})),_$$$("button-set-bookmark")?.addEventListener("click",(t=>{fcn_toggleBookmark(t.target.closest("p[data-paragraph-id]").dataset.paragraphId,fcn_bookmarkColor),window.matchMedia("(min-width: 1024px)").matches&&fcn_toggleParagraphTools(!1),fcn_bookmarkColor="none"}))),_$$(".open-fullscreen").forEach((t=>{t.addEventListener("click",(()=>{fcn_openFullscreen()}))})),_$$(".close-fullscreen").forEach((t=>{t.addEventListener("click",(()=>{fcn_closeFullscreen()}))})),(()=>{"use strict";const t=_$$$("reader-settings-font-size-text"),e=_$$$("reader-settings-font-size-range"),n=_$$$("reader-settings-font-size-reset");function a(a,o=!0){a=fcn_clamp(50,200,a??100),t.value=a,e.value=a,n.classList.toggle("_modified",100!=a),_$$(".resize-font").forEach((t=>{t.style.fontSize=`${a}%`})),fcn_formatting["font-size"]=a,o&&fcn_setFormatting(fcn_formatting)}function o(){a(this.value)}function c(){a(parseFloat(fcn_formatting["font-size"])+parseFloat(this.dataset.modifier))}n&&(_$$$("reset-font")?.addEventListener("click",(()=>{a(100)})),n?.addEventListener("click",(()=>{a(100)})),e?.addEventListener("input",fcn_throttle(o,1e3/24)),t?.addEventListener("input",o),_$$$("increase-font")?.addEventListener("click",c),_$$$("decrease-font")?.addEventListener("click",c),a(fcn_formatting["font-size"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-font-color-reset"),e=_$$$("reader-settings-font-color-select");function n(n,a=!0){n=fcn_clamp(0,fictioneer_font_colors.length-1,n),t.classList.toggle("_modified",n>0),e.value=n,fcn_chapterFormatting.style.setProperty("--text-chapter",fictioneer_font_colors[n].css),fcn_formatting["font-color"]=fictioneer_font_colors[n].css,a&&fcn_setFormatting(fcn_formatting)}t&&(t.onclick=()=>{n(0)},e.onchange=t=>{n(t.target.value)},_$$(".font-color-stepper").forEach((t=>{t.addEventListener("click",(t=>{!function(t=1){let a=(e.selectedIndex+parseInt(t))%fictioneer_font_colors.length;a=a<0?fictioneer_font_colors.length-1:a,n(a)}(t.currentTarget.value)}))})),n(fictioneer_font_colors.findIndex((t=>t.css==fcn_formatting["font-color"])),!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-font-reset"),e=_$$$("reader-settings-font-select");function n(a,o=!0){a=fcn_clamp(0,fictioneer_fonts.length-1,a);let c=fictioneer_fonts[a].css;fictioneer_fonts[a].alt&&(c=`${c}, ${fictioneer_fonts[a].alt}`),a<0?n(0):(t.classList.toggle("_modified",a>0),e.value=a,_$$(".chapter-font-family").forEach((t=>{t.style.fontFamily=""===c?"var(--ff-system)":c+", var(--ff-system)"})),fcn_formatting["font-name"]=fictioneer_fonts[a].css,o&&fcn_setFormatting(fcn_formatting))}t&&(t.onclick=()=>{n(0)},e.onchange=t=>{n(t.target.value)},_$$(".font-stepper").forEach((t=>{t.addEventListener("click",(t=>{!function(t=1){let a=(e.selectedIndex+parseInt(t))%fictioneer_fonts.length;a=a<0?fictioneer_fonts.length-1:a,n(a)}(t.currentTarget.value)}))})),n(fictioneer_fonts.findIndex((t=>t.css==fcn_formatting["font-name"])),!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-font-saturation-text"),e=_$$$("reader-settings-font-saturation-range"),n=_$$$("reader-settings-font-saturation-reset");function a(a,o=!0){a=fcn_clamp(-1,1,a??0),t.value=parseInt(100*a),e.value=a,n.classList.toggle("_modified",0!=a),fcn_chapterFormatting.style.setProperty("--font-saturation",`(${a>=0?1+a**2:1-a**2} + var(--font-saturation-offset))`),fcn_formatting["font-saturation"]=a,o&&fcn_setFormatting(fcn_formatting)}n&&(n?.addEventListener("click",(()=>{a(0)})),e?.addEventListener("input",fcn_throttle((function(){a(this.value)}),1e3/24)),t?.addEventListener("input",(function(){a(parseInt(this.value)/100)})),a(fcn_formatting["font-saturation"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-letter-spacing-text"),e=_$$$("reader-settings-letter-spacing-range"),n=_$$$("reader-settings-letter-spacing-reset"),a=fcn_defaultFormatting()["letter-spacing"];function o(o,c=!0){o=fcn_clamp(-.1,.2,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),fcn_chapterFormatting.style.letterSpacing=`calc(${o}em + var(--font-letter-spacing-base))`,fcn_formatting["letter-spacing"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["letter-spacing"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-paragraph-spacing-text"),e=_$$$("reader-settings-paragraph-spacing-range"),n=_$$$("reader-settings-paragraph-spacing-reset"),a=fcn_defaultFormatting()["paragraph-spacing"];function o(o,c=!0){o=fcn_clamp(0,3,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),fcn_chapterFormatting.style.setProperty("--paragraph-spacing",`${o}em`),fcn_formatting["paragraph-spacing"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["paragraph-spacing"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-line-height-text"),e=_$$$("reader-settings-line-height-range"),n=_$$$("reader-settings-line-height-reset"),a=fcn_defaultFormatting()["line-height"];function o(o,c=!0){o=fcn_clamp(.8,3,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),fcn_chapterFormatting.style.lineHeight=`${o}`,fcn_formatting["line-height"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["line-height"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-site-width-text"),e=_$$$("reader-settings-site-width-range"),n=_$$$("reader-settings-site-width-reset"),a=fcn_defaultFormatting()["site-width"];function o(o,c=!0){const s=_$("main");o=fcn_clamp(640,1920,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),s.style.setProperty("--site-width",`${o}px`),s.classList.toggle("_default-width",o==fcn_theRoot.dataset.siteWidthDefault),s.classList.toggle("_below-1024",o<1024&&o>=768),s.classList.toggle("_below-768",o<768&&o>640),s.classList.toggle("_640-and-below",o<=640),fcn_formatting["site-width"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["site-width"],!1))})(),_$$("#reader-settings-indent-toggle").forEach((t=>{const e={invertClass:!0,toggleClass:"no-indent"},n="indent";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-justify-toggle").forEach((t=>{const e={toggleClass:"justify"},n="justify";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-paragraph-tools-toggle").forEach((t=>{const e="show-paragraph-tools";t.onclick=n=>{fcn_updateToggle(n.currentTarget.checked,`#${t.id}`,e)},fcn_updateToggle(fcn_formatting[e],`#${t.id}`,e,{save:!1})})),_$$("#reader-settings-chapter-notes-toggle").forEach((t=>{const e={notes:!0},n="show-chapter-notes";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-comments-toggle").forEach((t=>{const e={comments:!0},n="show-comments";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-sensitive-content-toggle").forEach((t=>{const e={toggleClass:"hide-sensitive",invertClass:!0,sensitiveContent:!0},n="show-sensitive-content";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})}));const fcn_progressBar=_$(".progress__bar"),fcn_chapterContent=_$$$("chapter-content");var fcn_chapterCheckmarkUpdated=!1;function fcn_trackProgress(){fcn_chapterContent&&(fcn_readingProgress(),window.addEventListener("scroll.rAF",fcn_throttle(fcn_readingProgress,1e3/48)))}function fcn_readingProgress(){if(fcn_settingMinimal.checked||!fcn_settingChapterProgressBar.checked)return;const t=fcn_chapterContent.getBoundingClientRect(),e=t.height,n=window.innerHeight,a=e-t.bottom-Math.max(t.top,0)+n;let o=100*a/e;if(fcn_theBody.classList.toggle("hasProgressBar",!(o<0||a>e+500)),o=fcn_clamp(0,100,o),fcn_progressBar.style.width=`${o}%`,o>=100&&!fcn_chapterCheckmarkUpdated&&fcn_isLoggedIn){const t=_$$$("inline-storage")?.dataset.storyId;if(fcn_chapterCheckmarkUpdated=!0,!t||"function"!=typeof fcn_toggleCheckmark)return;fcn_toggleCheckmark(t,"progress",parseInt(fcn_inlineStorage.postId),null,"set")}}_$("article:not(._password)")&&fcn_trackProgress(),_$$(".chapter-list-popup-toggle").forEach((t=>{t.addEventListener("click",(()=>{t.querySelector('[data-target="popup-chapter-list"]')?.appendChild(fcn_chapterList.cloneNode(!0))}),{once:!0})}));const fcn_chapterKeyboardNavigation=t=>{if(["INPUT","TEXTAREA","SELECT","OPTION"].includes(t.target.tagName)||t.target.isContentEditable)return;let e=null;"ArrowLeft"===t.code?e=_$("a.button._navigation._prev"):"ArrowRight"===t.code&&(e=_$("a.button._navigation._next")),e&&e.href&&(window.location.href=e+"#start")};if(document.addEventListener("keydown",fcn_chapterKeyboardNavigation),"#start"===window.location.hash){history.replaceState(null,document.title,window.location.pathname);const t=_$(".chapter__article");t&&fcn_scrollTo(t,128)}var diff_match_patch=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff=function(t,e){this[0]=t,this[1]=e},diff_match_patch.Diff.prototype.length=2,diff_match_patch.Diff.prototype.toString=function(){return this[0]+","+this[1]},diff_match_patch.prototype.diff_main=function(t,e,n,a){if(void 0===a&&(a=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout),null==t||null==e)throw Error("Null input. (diff_main)");if(t==e)return t?[new diff_match_patch.Diff(DIFF_EQUAL,t)]:[];void 0===n&&(n=!0);var o=n,c=this.diff_commonPrefix(t,e);n=t.substring(0,c),t=t.substring(c),e=e.substring(c),c=this.diff_commonSuffix(t,e);var s=t.substring(t.length-c);return t=t.substring(0,t.length-c),e=e.substring(0,e.length-c),t=this.diff_compute_(t,e,o,a),n&&t.unshift(new diff_match_patch.Diff(DIFF_EQUAL,n)),s&&t.push(new diff_match_patch.Diff(DIFF_EQUAL,s)),this.diff_cleanupMerge(t),t},diff_match_patch.prototype.diff_compute_=function(t,e,n,a){if(!t)return[new diff_match_patch.Diff(DIFF_INSERT,e)];if(!e)return[new diff_match_patch.Diff(DIFF_DELETE,t)];var o=t.length>e.length?t:e,c=t.length>e.length?e:t,s=o.indexOf(c);return-1!=s?(n=[new diff_match_patch.Diff(DIFF_INSERT,o.substring(0,s)),new diff_match_patch.Diff(DIFF_EQUAL,c),new diff_match_patch.Diff(DIFF_INSERT,o.substring(s+c.length))],t.length>e.length&&(n[0][0]=n[2][0]=DIFF_DELETE),n):1==c.length?[new diff_match_patch.Diff(DIFF_DELETE,t),new diff_match_patch.Diff(DIFF_INSERT,e)]:(o=this.diff_halfMatch_(t,e))?(e=o[1],c=o[3],t=o[4],o=this.diff_main(o[0],o[2],n,a),n=this.diff_main(e,c,n,a),o.concat([new diff_match_patch.Diff(DIFF_EQUAL,t)],n)):n&&100n);g++){for(var m=-g+d;m<=g-_;m+=2){for(var p=c+m,k=m==-g||m!=g&&i[p-1]a)_+=2;else if(b>o)d+=2;else if(f&&(0<=(p=c+l-m)&&p=v)return this.diff_bisectSplit_(t,e,k,b,n)}}for(m=-g+u;m<=g-h;m+=2){for(p=c+m,k=(v=m==-g||m!=g&&r[p-1]a)h+=2;else if(k>o)u+=2;else if(!f&&(0<=(p=c+l-m)&&p=(v=a-v))))return this.diff_bisectSplit_(t,e,k,b,n)}}return[new diff_match_patch.Diff(DIFF_DELETE,t),new diff_match_patch.Diff(DIFF_INSERT,e)]},diff_match_patch.prototype.diff_bisectSplit_=function(t,e,n,a,o){var c=t.substring(0,n),s=e.substring(0,a);return t=t.substring(n),e=e.substring(a),c=this.diff_main(c,s,!1,o),o=this.diff_main(t,e,!1,o),c.concat(o)},diff_match_patch.prototype.diff_linesToChars_=function(t,e){function n(t){for(var e="",n=0,s=-1,i=a.length;sa?t=t.substring(n-a):n=t.length?[a,o,s,i,f]:null}if(0>=this.Diff_Timeout)return null;var a=t.length>e.length?t:e,o=t.length>e.length?e:t;if(4>a.length||2*o.lengtha[4].length?s:a:s,t.length>e.length){a=s[0],o=s[1];var i=s[2],r=s[3]}else i=s[0],r=s[1],a=s[2],o=s[3];return[a,o,i,r,s[4]]},diff_match_patch.prototype.diff_cleanupSemantic=function(t){for(var e=!1,n=[],a=0,o=null,c=0,s=0,i=0,r=0,l=0;c=(o=this.diff_commonOverlap_(n,e))?(a>=e.length/2||a>=n.length/2)&&(t.splice(c,0,new diff_match_patch.Diff(DIFF_EQUAL,n.substring(0,a))),t[c-1][1]=e.substring(0,e.length-a),t[c+1][1]=n.substring(a),c++):(o>=e.length/2||o>=n.length/2)&&(t.splice(c,0,new diff_match_patch.Diff(DIFF_EQUAL,e.substring(0,o))),t[c-1][0]=DIFF_INSERT,t[c-1][1]=n.substring(0,n.length-o),t[c+1][0]=DIFF_DELETE,t[c+1][1]=e.substring(o),c++),c++),c++},diff_match_patch.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var n=t.charAt(t.length-1),a=e.charAt(0),o=n.match(diff_match_patch.nonAlphaNumericRegex_),c=a.match(diff_match_patch.nonAlphaNumericRegex_),s=o&&n.match(diff_match_patch.whitespaceRegex_),i=c&&a.match(diff_match_patch.whitespaceRegex_);n=s&&n.match(diff_match_patch.linebreakRegex_),a=i&&a.match(diff_match_patch.linebreakRegex_);var r=n&&t.match(diff_match_patch.blanklineEndRegex_),l=a&&e.match(diff_match_patch.blanklineStartRegex_);return r||l?5:n||a?4:o&&!s&&i?3:s||i?2:o||c?1:0}for(var n=1;n=l&&(l=f,s=a,i=o,r=c)}t[n-1][1]!=s&&(s?t[n-1][1]=s:(t.splice(n-1,1),n--),t[n][1]=i,r?t[n+1][1]=r:(t.splice(n+1,1),n--))}n++}},diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,diff_match_patch.whitespaceRegex_=/\s/,diff_match_patch.linebreakRegex_=/[\r\n]/,diff_match_patch.blanklineEndRegex_=/\n\r?\n$/,diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/,diff_match_patch.prototype.diff_cleanupEfficiency=function(t){for(var e=!1,n=[],a=0,o=null,c=0,s=!1,i=!1,r=!1,l=!1;ce));n++)c=a,s=o;return t.length!=n&&t[n][0]===DIFF_DELETE?s:s+(e-c)},diff_match_patch.prototype.diff_prettyHtml=function(t){for(var e=[],n=/&/g,a=//g,c=/\n/g,s=0;s");switch(i){case DIFF_INSERT:e[s]=''+r+"";break;case DIFF_DELETE:e[s]=''+r+"";break;case DIFF_EQUAL:e[s]=""+r+""}}return e.join("")},diff_match_patch.prototype.diff_text1=function(t){for(var e=[],n=0;nthis.Match_MaxBits)throw Error("Pattern too long for this browser.");var o=this.match_alphabet_(e),c=this,s=this.Match_Threshold,i=t.indexOf(e,n);-1!=i&&(s=Math.min(a(0,i),s),-1!=(i=t.lastIndexOf(e,n+e.length))&&(s=Math.min(a(0,i),s)));var r=1<=l;h--){var g=o[t.charAt(h-1)];if(f[h]=0===u?(f[h+1]<<1|1)&g:(f[h+1]<<1|1)&g|(d[h+1]|d[h])<<1|1|d[h+1],f[h]&r&&(g=a(u,h-1))<=s){if(s=g,!((i=h-1)>n))break;l=Math.max(1,2*n-i)}}if(a(u+1,n)>s)break;d=f}return i},diff_match_patch.prototype.match_alphabet_=function(t){for(var e={},n=0;n=2*this.Patch_Margin&&o&&(this.patch_addContext_(t,i),n.push(t),t=new diff_match_patch.patch_obj,o=0,i=a,c=s)}l!==DIFF_INSERT&&(c+=f.length),l!==DIFF_DELETE&&(s+=f.length)}return o&&(this.patch_addContext_(t,i),n.push(t)),n},diff_match_patch.prototype.patch_deepCopy=function(t){for(var e=[],n=0;nthis.Match_MaxBits){var l=this.match_main(e,i.substring(0,this.Match_MaxBits),s);-1!=l&&(-1==(r=this.match_main(e,i.substring(i.length-this.Match_MaxBits),s+i.length-this.Match_MaxBits))||l>=r)&&(l=-1)}else l=this.match_main(e,i,s);if(-1==l)o[c]=!1,a-=t[c].length2-t[c].length1;else if(o[c]=!0,a=l-s,i==(s=-1==r?e.substring(l,l+i.length):e.substring(l,r+this.Match_MaxBits)))e=e.substring(0,l)+this.diff_text2(t[c].diffs)+e.substring(l+i.length);else if(s=this.diff_main(i,s,!1),i.length>this.Match_MaxBits&&this.diff_levenshtein(s)/i.length>this.Patch_DeleteThreshold)o[c]=!1;else{var f;for(this.diff_cleanupSemanticLossless(s),i=0,r=0;ro[0][1].length){var c=e-o[0][1].length;o[0][1]=n.substring(o[0][1].length)+o[0][1],a.start1-=c,a.start2-=c,a.length1+=c,a.length2+=c}return 0==(o=(a=t[t.length-1]).diffs).length||o[o.length-1][0]!=DIFF_EQUAL?(o.push(new diff_match_patch.Diff(DIFF_EQUAL,n)),a.length1+=e,a.length2+=e):e>o[o.length-1][1].length&&(c=e-o[o.length-1][1].length,o[o.length-1][1]+=n.substring(0,c),a.length1+=c,a.length2+=c),n},diff_match_patch.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,n=0;n2*e?(i.length1+=l.length,o+=l.length,r=!1,i.diffs.push(new diff_match_patch.Diff(s,l)),a.diffs.shift()):(l=l.substring(0,e-i.length1-this.Patch_Margin),i.length1+=l.length,o+=l.length,s===DIFF_EQUAL?(i.length2+=l.length,c+=l.length):r=!1,i.diffs.push(new diff_match_patch.Diff(s,l)),l==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(l.length))}s=(s=this.diff_text2(i.diffs)).substring(s.length-this.Patch_Margin),""!==(l=this.diff_text1(a.diffs).substring(0,this.Patch_Margin))&&(i.length1+=l.length,i.length2+=l.length,0!==i.diffs.length&&i.diffs[i.diffs.length-1][0]===DIFF_EQUAL?i.diffs[i.diffs.length-1][1]+=l:i.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL,l))),r||t.splice(++n,0,i)}}},diff_match_patch.prototype.patch_toText=function(t){for(var e=[],n=0;n/g,c=/\n/g,s=0;s");switch(i){case 1:e[s]=`${r}`;break;case-1:e[s]=`${r}`;break;case 0:e[s]=`${r}`}}return e.join("")};class FCN_Suggestion{constructor(){this.toggle=_$$$("suggestions-modal-toggle"),this.tools=_$$$("selection-tools"),this.button=_$$$("button-add-suggestion"),this.toolsButton=_$$$("button-tools-add-suggestion"),this.reset=_$$$("button-suggestion-reset"),this.submit=_$$$("button-suggestion-submit"),this.current=_$$$("suggestions-modal-original"),this.input=_$$$("suggestions-modal-input"),this.output=_$$$("suggestions-modal-diff"),this.chapter=_$(".chapter__article"),this.text="",this.original="",this.latest="",this.paragraph=null,this.dmp=new diff_match_patch,this.bindEvents()}getCaretCoordinates(){let t=0,e=0;if(void 0!==window.getSelection){const n=window.getSelection();if(0!==n.rangeCount){let a=n.getRangeAt(0).cloneRange().getClientRects();a=a[a.length-1],a&&(t=a.right+window.scrollX,e=a.bottom+window.scrollY)}}return{x:t,y:e}}getClosestParagraph(){const t=window.getSelection();return t.rangeCount?t.getRangeAt(0).startContainer.parentNode.closest("p"):null}showTools(t,e){const n=document.documentElement.offsetWidth/2+this.tools.offsetWidth,a=_$$$("wpadminbar")?_$$$("wpadminbar").offsetHeight:0;this.tools.style.transform=e>n?"translate(-100%)":"translate(0)",this.tools.style.top=t+4-a+"px",this.tools.style.left=`${e}px`,this.tools.classList.remove("invisible")}hideTools(){this.tools.style.top="0",this.tools.style.left="-1000px",this.tools.classList.add("invisible")}textSelection(){return fcn_cleanTextSelectionFromButtons(window.getSelection().toString())}clearSelection(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}getDiff(t,e){const n=this.dmp.diff_main(t,e);return this.dmp.diff_cleanupEfficiency(n),this.dmp.fcn_prettyHtml(n)}toggleTools(t){fcn_theSite.classList.contains("transformed-site")||window.getSelection().rangeCount<1||!window.getSelection().getRangeAt(0).startContainer.parentNode.closest(".content-section")||setTimeout((()=>{if(t.text=t.textSelection().replaceAll("\n\n","\n"),""!==t.text){const e=t.getCaretCoordinates();t.showTools(e.y,e.x)}else t.hideTools()}),10)}toggleViaParagraphTools(t){fcn_theSite.classList.contains("transformed-site")||(t.text=_$(".selected-paragraph").querySelector(".paragraph-inner").innerText,t.showModal(t))}resizeInput(){this.input.style.height="auto",this.input.style.height=`${fcn_clamp(32,108,this.input.scrollHeight+4)}px`}showModal(t){fcn_lastSelectedParagraphId&&fcn_toggleParagraphTools(!1),t.original=t.text,t.current.innerHTML=t.text.replaceAll("\n","
"),t.input.value=t.text,t.output.innerHTML=t.getDiff(t.original,t.text),t.paragraph=t.getClosestParagraph(),t.toggle.click(),t.toggle.checked=!0,t.clearSelection(),t.hideTools(),t.resizeInput(),t.input.focus()}editSuggestion(t){t.resizeInput(),t.output.innerHTML=t.getDiff(t.original,t.input.value)}resetSuggestion(t){t.input.value=t.original,t.resizeInput(),t.output.innerHTML=t.getDiff(t.original,t.original)}submitSuggestion(t){const e=_$(fictioneer_comments.form_selector??"#comment"),n=t.paragraph?.id??null;let a=t.output.innerHTML;[["¶","¶\n"],["
","\n"],["","[ins]"],["","[/ins]"],["","[del]"],["","[/del]"]].forEach((([t,e])=>{a=a.replaceAll(t,e)})),t.latest=`\n[quote]${a} [anchor]${n}[/anchor][/quote]\n`,e?"TEXTAREA"==e.tagName?(e.value+=t.latest,fcn_textareaAdjust(_$("textarea#comment"))):"DIV"==e.tagName&&(e.innerHTML+=t.latest):fcn_commentStack?.push(t.latest),t.toggle.click(),t.toggle.checked=!1,fcn_showNotification(fictioneer_tl.notification.suggestionAppendedToComment)}bindEvents(){this.chapter?.addEventListener("mouseup",this.toggleTools.bind(null,this)),this.button?.addEventListener("click",this.showModal.bind(null,this)),this.toolsButton?.addEventListener("click",this.toggleViaParagraphTools.bind(null,this)),this.input?.addEventListener("input",this.editSuggestion.bind(null,this)),this.reset?.addEventListener("click",this.resetSuggestion.bind(null,this)),this.submit?.addEventListener("click",this.submitSuggestion.bind(null,this))}}const fcn_suggestions=_$(".chapter__article")&&_$(".comment-section")&&_$$$("selection-tools")?new FCN_Suggestion:null;fcn_suggestions&&document.addEventListener("click",(function(t){t.target.closest(".content-section")||fcn_suggestions.hideTools()}));const fcn_ttsInterface=_$$$("tts-interface");var fcn_utter,fcn_synth,fcn_ttsStack=[],fcn_currentReadingId=-1,fcn_ttsPauseTimestamp=-1,fcn_ttsCurrentText="",fcn_ttsSettings=fcn_getTTSsettings(),fcn_voices=[];if("undefined"!=typeof speechSynthesis&&fcn_ttsInterface){fcn_synth=window.speechSynthesis,(fcn_utter=new SpeechSynthesisUtterance).lang=fcn_theRoot.lang;const t=setTimeout((()=>{fcn_setupTTS()}),2e3);"onvoiceschanged"in speechSynthesis&&fcn_synth.addEventListener("voiceschanged",(()=>{fcn_setupTTS(),clearTimeout(t)}),{once:!0})}function fcn_setupTTS(){fcn_voices.length>0||(fcn_setUpVoices(),fcn_updateVolume(fcn_ttsSettings.volume),fcn_updatePitch(fcn_ttsSettings.pitch),fcn_updateRate(fcn_ttsSettings.rate))}function fcn_setTTSsettings(t){fcn_ttsSettings=t,localStorage.setItem("ttsSettings",JSON.stringify(t))}function fcn_getTTSsettings(){const t=fcn_parseJSON(localStorage.getItem("ttsSettings"))??{};return fcn_setTTSsettings(t),t}function fcn_setUpVoices(){const t=fcn_synth.getVoices(),e=_$$$("tts-voice-select");if(!e)return;let n=0;for(let a=0;a{fcn_updateVoice(t.currentTarget.value)})),fcn_updateVoice(fcn_ttsSettings.voice))}function fcn_updateVoice(t){if(isNaN(t)||void 0===fcn_voices[t]){let e=fcn_voices.findIndex((t=>"Samantha"===t.name&&("en-US"===t.lang||"en_US"===t.lang)));e<0&&(e=fcn_voices.findIndex((t=>"en-US"===t.lang||"en_US"===t.lang))),t=e>-1?e:0}fcn_utter.voice=fcn_voices[t],_$$$("tts-voice-select").value=t,fcn_ttsSettings.voice=t,fcn_setTTSsettings(fcn_ttsSettings)}function fcn_updateVolume(t){t=fcn_clamp(0,100,t=isNaN(t)?100:parseInt(t)),_$$$("tts-volume-range").value=t,_$$$("tts-volume-text").value=t,_$$$("tts-volume-reset").classList.toggle("_modified",100!=t),fcn_ttsSettings.volume=t,fcn_setTTSsettings(fcn_ttsSettings),fcn_utter.volume=t/100}function fcn_updatePitch(t){t=fcn_clamp(.2,1.8,t=isNaN(t)?1:parseFloat(t)),_$$$("tts-pitch-range").value=t,_$$$("tts-pitch-text").value=t,_$$$("tts-pitch-reset").classList.toggle("_modified",1!=t),fcn_ttsSettings.pitch=t,fcn_setTTSsettings(fcn_ttsSettings),fcn_utter.pitch=t}function fcn_updateRate(t){t=fcn_clamp(.2,1.8,t=isNaN(t)?1:parseFloat(t)),_$$$("tts-rate-range").value=t,_$$$("tts-rate-text").value=t,_$$$("tts-rate-reset").classList.toggle("_modified",1!=t),fcn_ttsSettings.rate=t,fcn_setTTSsettings(fcn_ttsSettings),fcn_utter.rate=t}function fcn_readTextStack(){const t=_$(".current-reading");if(0===fcn_ttsStack.length)return fcn_ttsInterface.classList.add("ended"),t&&t.classList.remove("current-reading"),fcn_currentReadingId=-1,void(fcn_ttsCurrentText="");const e=fcn_ttsStack.shift();fcn_ttsCurrentText=e[1],fcn_currentReadingId!=e[0]&&(fcn_currentReadingId=e[0],t&&t.classList.remove("current-reading"),_$$$(fcn_currentReadingId).classList.add("current-reading")),fcn_utter.text=fcn_ttsCurrentText,fcn_utter.addEventListener("end",fcn_readTextStack,{once:!0}),fcn_synth.speak(fcn_utter)}"undefined"!=typeof speechSynthesis&&fcn_ttsInterface&&(_$$$("button-tts-set").addEventListener("click",(t=>{fcn_ttsStack=[],fcn_currentReadingId=-1;const e=_$(".chapter-formatting")?.classList.contains("hide-sensitive")??!1?"sensitive-content":"sensitive-alternative",n=_$$$("button-tts-play"),a=new RegExp(fcn_ttsInterface.dataset.regex,"gm");fcn_synth.speaking&&fcn_utter.removeEventListener("end",fcn_readTextStack),fcn_synth.cancel();const o=new Set(["P","H1","H2","H3","H4","H5","H6"]),c=["skip-tts","inside-epub",e];let s=t.target.closest("p[data-paragraph-id]");for(fcn_ttsStack.push(s);s=s.nextElementSibling;)o.has(s.tagName)&&!c.some((t=>s.classList.contains(t)))&&fcn_ttsStack.push(s);fcn_ttsStack=fcn_ttsStack.flatMap((t=>{const e=[],n=t.querySelector(".paragraph-inner");return(n?n.textContent:t.textContent).replace(a,"$1|").split("|").forEach((n=>{const a=n.trim();a.length>0&&e.push([t.id,a])})),e})),fcn_readTextStack(),fcn_theBody.classList.add("tts-open"),fcn_ttsInterface.classList.remove("hidden","ended","paused"),fcn_ttsInterface.classList.add("playing"),n.focus(),n.blur()})),_$$$("button-tts-stop")?.addEventListener("click",(()=>{const t=_$(".current-reading");fcn_ttsInterface.classList.add("hidden","ended"),fcn_ttsInterface.classList.remove("playing","paused"),fcn_theBody.classList.remove("tts-open"),t&&t.classList.remove("current-reading"),fcn_ttsStack=[],fcn_currentReadingId=-1,fcn_utter.removeEventListener("end",fcn_readTextStack),fcn_synth.cancel()})),_$$$("button-tts-play")?.addEventListener("click",(()=>{fcn_synth.resume(),-1!==fcn_ttsPauseTimestamp&&Date.now()-fcn_ttsPauseTimestamp>1e4&&(fcn_ttsStack.unshift([fcn_currentReadingId,fcn_ttsCurrentText]),fcn_synth.cancel(),fcn_readTextStack(),fcn_ttsPauseTimestamp=-1),fcn_ttsInterface.classList.add("playing"),fcn_ttsInterface.classList.remove("paused")})),_$$$("button-tts-pause")?.addEventListener("click",(()=>{fcn_synth.pause(),fcn_ttsPauseTimestamp=Date.now(),fcn_ttsInterface.classList.remove("playing"),fcn_ttsInterface.classList.add("paused")})),_$$$("button-tts-skip")?.addEventListener("click",(()=>{fcn_utter.removeEventListener("end",fcn_readTextStack),fcn_synth.cancel(),fcn_readTextStack(),fcn_ttsInterface.classList.remove("paused"),fcn_ttsInterface.classList.add("playing")})),_$$$("button-tts-scroll")?.addEventListener("click",(()=>{fcn_scrollTo(_$(`p[id="${fcn_currentReadingId}"]`),128)})),_$$("#tts-volume-range, #tts-volume-text").forEach((t=>{t.addEventListener("input",(t=>{fcn_updateVolume(t.target.value)}))})),_$$$("tts-volume-reset")?.addEventListener("click",(()=>{fcn_updateVolume(100)})),_$$("#tts-pitch-range, #tts-pitch-text").forEach((t=>{t.addEventListener("input",(t=>{fcn_updatePitch(t.target.value)}))})),_$$$("tts-pitch-reset")?.addEventListener("click",(()=>{fcn_updatePitch(1)})),_$$("#tts-rate-range, #tts-rate-text").forEach((t=>{t.addEventListener("input",(t=>{fcn_updateRate(t.target.value)}))})),_$$$("tts-rate-reset")?.addEventListener("click",(()=>{fcn_updateRate(1)})),window.addEventListener("beforeunload",(()=>{fcn_synth.cancel()})));var fcn_storyCommentPage=1,fcn_storySettings=fcn_getStorySettings();function fcn_cleanUpActions(){_$$(".story__actions > *").forEach((t=>{const e=window.getComputedStyle(t);"none"!==e.display&&"hidden"!==e.visibility||t.remove()}))}function fcn_getStorySettings(){let t=fcn_parseJSON(localStorage.getItem("fcnStorySettings"))??fcn_defaultStorySettings();return t.timestamp<1674770712849&&(t=fcn_defaultStorySettings(),t.timestamp=Date.now()),fcn_setStorySettings(t),t}function fcn_defaultStorySettings(){return{view:"list",order:"asc",timestamp:1674770712849}}function fcn_setStorySettings(t){"object"==typeof t&&(fcn_storySettings=t,localStorage.setItem("fcnStorySettings",JSON.stringify(t)))}function fcn_applyStorySettings(){"object"==typeof fcn_storySettings&&(_$$("[data-view]").forEach((t=>{t.dataset.view="grid"==fcn_storySettings.view?"grid":"list"})),_$$("[data-order]").forEach((t=>{t.dataset.order="desc"==fcn_storySettings.order?"desc":"asc"})))}fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_cleanUpActions()})):document.addEventListener("DOMContentLoaded",(()=>{fcn_cleanUpActions()})),fcn_applyStorySettings();var fcn_isToggling=!1;function fcn_toggleStoryTab(t){const e=t.closest(".story");e.querySelectorAll(".story__tab-target._current, .story__tabs ._current").forEach((t=>{t.classList.remove("_current")})),e.querySelectorAll(`[data-finder="${t.dataset.target}"]`).forEach((t=>{t.classList.add("_current")})),e.querySelector(".story__tabs").dataset.current=t.dataset.target,t.classList.add("_current")}function fcn_loadStoryComments(t){let e;_$(".load-more-list-item").remove(),_$(".comments-loading-placeholder").classList.remove("hidden"),fcn_ajaxGet({post_id:t.dataset.storyId??fcn_inlineStorage.postId,page:fcn_storyCommentPage},"get_story_comments").then((t=>{t.success?(_$(".fictioneer-comments__list > ul").innerHTML+=t.data.html,fcn_storyCommentPage++):t.data?.error&&(e=fcn_buildErrorNotice(t.data.error))})).catch((t=>{e=fcn_buildErrorNotice(t)})).then((()=>{_$(".comments-loading-placeholder").remove(),e&&_$(".fictioneer-comments__list > ul").appendChild(e)}))}function fcn_startEpubDownload(t,e=0){e>3?t.classList.remove("ajax-in-progress"):fcn_ajaxGet({action:"fictioneer_ajax_download_epub",story_id:t.dataset.storyId}).then((n=>{n.success?(window.location.href=t.href,setTimeout((()=>{t.classList.remove("ajax-in-progress")}),2e3)):setTimeout((()=>{fcn_startEpubDownload(t,e+1)}),2e3)})).catch((e=>{t.classList.remove("ajax-in-progress"),e.status&&e.statusText&&fcn_showNotification(`${e.status}: ${e.statusText}`,5,"warning")}))}function fcn_replaceProfileImage(t,e){const n=t.querySelector(".user-icon");if(n){const a=document.createElement("img");a.classList.add("user-profile-image"),a.src=e,n.remove(),t.appendChild(a)}}function fcn_setProfileImage(t,e=!0){t&&fcn_isValidUrl(t)&&(e&&localStorage.setItem("fcnProfileAvatar",t),_$$("a.subscriber-profile")?.forEach((e=>{fcn_replaceProfileImage(e,t)})),!1===fcn_getUserData().loggedIn&&fcn_prepareLogin())}function fcn_getProfileImage(){let t=localStorage.getItem("fcnProfileAvatar");fcn_isLoggedIn?(fcn_isValidUrl(t)||(t=!1),t?fcn_setProfileImage(t):fcn_getUserAvatar()):localStorage.removeItem("fcnProfileAvatar")}function fcn_getUserAvatar(){fcn_ajaxGet({action:"fictioneer_ajax_get_avatar",fcn_fast_ajax:1}).then((t=>{t.success&&fcn_setProfileImage(t.data.url)})).catch((()=>{fcn_theRoot.dataset.defaultAvatar&&fcn_setProfileImage(fcn_theRoot.dataset.defaultAvatar,!1)}))}function fcn_getUserData(){return fcn_parseJSON(localStorage.getItem("fcnUserData"))??{lastLoaded:0,timestamp:0,loggedIn:"pending",follows:!1,reminders:!1,checkmarks:!1,bookmarks:{},fingerprint:!1}}function fcn_setUserData(t){localStorage.setItem("fcnUserData",JSON.stringify(t))}function fcn_fetchUserData(){let t=fcn_getUserData();if(fcn_isLoggedIn&&!1===t.loggedIn&&(fcn_prepareLogin(),t=fcn_getUserData()),fcn_ajaxLimitThreshold{if(t.success){let e=fcn_getUserData();e=t.data,e.lastLoaded=Date.now(),fcn_setUserData(e);const n=new CustomEvent("fcnUserDataReady",{detail:{data:t.data,time:new Date},bubbles:!0,cancelable:!1});document.dispatchEvent(n)}else{const e=fcn_getUserData();e.lastLoaded=Date.now(),e.loggedIn=!1,fcn_setUserData(e);const n=new CustomEvent("fcnUserDataFailed",{detail:{response:t,time:new Date},bubbles:!0,cancelable:!1});document.dispatchEvent(n)}})).catch((t=>{localStorage.removeItem("fcnUserData");const e=new CustomEvent("fcnUserDataError",{detail:{error:t,time:new Date},bubbles:!0,cancelable:!1});document.dispatchEvent(e)}))}function fcn_unsetOauth(t){const e=prompt(t.dataset.warning);if(!e||e.toLowerCase()!=t.dataset.confirm.toLowerCase())return;const n=_$$$(`oauth-${t.dataset.channel}`);n.classList.add("ajax-in-progress"),fcn_ajaxPost(payload={action:"fictioneer_ajax_unset_my_oauth",nonce:t.dataset.nonce,channel:t.dataset.channel,id:t.dataset.id}).then((t=>{t.success?(n.classList.remove("_connected"), -n.classList.add("_disconnected"),n.querySelector("button").remove(),fcn_showNotification(n.dataset.unset)):(n.style.background="var(--notice-warning-background)",fcn_showNotification(t.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(n.style.background="var(--notice-warning-background)",fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"))})).then((()=>{n.classList.remove("ajax-in-progress")}))}function fcn_deleteMyAccount(t){if(_$$$("button-delete-my-account").hasAttribute("disabled"))return;const e=prompt(t.dataset.warning);e&&e.toLowerCase()==t.dataset.confirm.toLowerCase()&&(_$$$("button-delete-my-account").setAttribute("disabled",!0),fcn_ajaxPost({action:"fictioneer_ajax_delete_my_account",nonce:t.dataset.nonce,id:t.dataset.id}).then((t=>{t.success?(localStorage.removeItem("fcnAuth"),localStorage.removeItem("fcnProfileAvatar"),location.reload()):(fcn_showNotification(t.data.error,5,"warning"),_$$$("button-delete-my-account").innerHTML=t.data.button)})).catch((t=>{t.status&&t.statusText&&(fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),_$$$("button-delete-my-account").innerHTML=response.data.button)})))}_$$('[data-click-action*="toggle-chapter-order"]').forEach((t=>{t.addEventListener("click",(t=>{fcn_isToggling||(fcn_isToggling=!0,setTimeout((()=>fcn_isToggling=!1),50),fcn_storySettings.order="asc"===t.currentTarget.dataset.order?"desc":"asc",fcn_setStorySettings(fcn_storySettings),fcn_applyStorySettings())}))})),_$$('[data-click-action*="toggle-chapter-view"]').forEach((t=>{t.addEventListener("click",(t=>{fcn_isToggling||(fcn_isToggling=!0,setTimeout((()=>fcn_isToggling=!1),50),fcn_storySettings.view="list"===t.currentTarget.dataset.view?"grid":"list",fcn_setStorySettings(fcn_storySettings),fcn_applyStorySettings())}))})),_$$(".chapter-group__folding-toggle").forEach((t=>{t.addEventListener("click",(t=>{const e=t.currentTarget.closest(".chapter-group[data-folded]");e&&(e.dataset.folded="true"==e.dataset.folded?"false":"true")}))})),_$$(".tabs__item").forEach((t=>{t.addEventListener("click",(t=>{fcn_toggleStoryTab(t.currentTarget)}))})),_$(".comment-section")?.addEventListener("click",(t=>{t.target?.classList.contains("load-more-comments-button")&&fcn_loadStoryComments(t.target)})),_$$('[data-action="download-epub"]').forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),t.currentTarget.classList.contains("ajax-in-progress")||(t.currentTarget.classList.add("ajax-in-progress"),fcn_startEpubDownload(t.currentTarget))}))})),document.addEventListener("DOMContentLoaded",(()=>{fcn_isLoggedIn&&!fcn_theRoot.dataset.ajaxAuth&&fcn_getProfileImage()})),fcn_theRoot.dataset.ajaxAuth&&document.addEventListener("fcnAuthReady",(()=>{fcn_getProfileImage()})),fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_fetchUserData()})):document.addEventListener("DOMContentLoaded",(()=>{fcn_isLoggedIn&&fcn_fetchUserData()})),_$$(".button-unset-oauth").forEach((t=>{t.addEventListener("click",(t=>{fcn_unsetOauth(t.currentTarget)}))})),_$$$("button-delete-my-account")?.addEventListener("click",(t=>{fcn_deleteMyAccount(t.currentTarget)}));const fcn_profileDataTranslations=_$$$("profile-data-translations")?.dataset;function fcn_dataDeletionPrompt(t){const e=prompt(t.dataset.warning);return!(!e||e.toLowerCase()!=t.dataset.confirm.toLowerCase())}function fcn_clearData(t,e){const n=t.closest(".card");localStorage.removeItem("fcnBookshelfContent"),n.classList.add("ajax-in-progress"),t.remove(),fcn_ajaxPost({action:e,fcn_fast_ajax:1,nonce:t.dataset.nonce}).then((t=>{t.success?n.querySelector(".card__content").innerHTML=t.data.success:fcn_showNotification(t.data.error,10,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,10,"warning")})).then((()=>{n.classList.remove("ajax-in-progress")}))}_$(".button-clear-comments")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comments")})),_$(".button-clear-comment-subscriptions")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comment_subscriptions")})),_$(".button-clear-checkmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.checkmarks={data:{},updated:Date.now()},fcn_setUserData(e),fcn_updateCheckmarksView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_checkmarks",!0)})),_$(".button-clear-reminders")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.reminders={data:{}},fcn_setUserData(e),fcn_updateRemindersView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_reminders",!0)})),_$(".button-clear-follows")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.follows={data:{}},fcn_setUserData(e),fcn_updateFollowsView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_follows",!0)})),_$(".button-clear-bookmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.bookmarks="{}",fcn_setUserData(e),fcn_bookmarks.data={},t.currentTarget.closest(".card").querySelector(".card__content").innerHTML=fcn_profileDataTranslations.clearedSuccess,fcn_setBookmarks(fcn_bookmarks)}));const fcn_jumpToBookmarkButtons=_$$(".button--bookmark"),fcn_mobileBookmarkJump=_$$$("mobile-menu-bookmark-jump"),fcn_mobileBookmarkList=_$(".mobile-menu__bookmark-list"),fcn_bookmarksSmallCardBlock=_$(".bookmarks-block"),fcn_bookmarksSmallCardTemplate=_$(".bookmark-small-card-template");var fcn_bookmarks,fcn_userBookmarksTimeout;function fcn_initializeLocalBookmarks(){fcn_setBookmarks(fcn_bookmarks=fcn_getBookmarks(),!0),fcn_updateBookmarksView()}function fcn_initializeUserBookmarks(t){fcn_setBookmarks(JSON.parse(t.detail.data.bookmarks),!0),fcn_updateBookmarksView()}function fcn_getBookmarks(){let t=fcn_parseJSON(localStorage.getItem("fcnChapterBookmarks"))??{data:{}};return Array.isArray(t.data)&&0===t.data.length&&(t.data={}),t=fcn_fixBookmarks(t),!t||Object.keys(t).length<1?{data:{}}:t}function fcn_fixBookmarks(t){const e={};for(const n in t.data)if(n.startsWith("ch-")){const a=fcn_fixBookmarksNode(t.data[n]);a&&(e[n]=a)}return{data:e}}function fcn_fixBookmarksNode(t){const e={},n={"paragraph-id":"",progress:0,date:"",color:"",chapter:"",link:"",thumb:"",image:"",story:"",content:""};for(const a in n){if(typeof t[a]!=typeof n[a])return null;e[a]=t[a]}const a=new Date(e.date);return a&&"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a)||(e.date=(new Date).toISOString()),("number"!=typeof e.progress||e.progress<0)&&(e.progress=0),e}function fcn_setBookmarks(t,e=!1){if("object"==typeof t){if(fcn_bookmarks=t,localStorage.setItem("fcnChapterBookmarks",JSON.stringify(t)),fcn_isLoggedIn){const e=fcn_getUserData();e&&(e.bookmarks=JSON.stringify(t),fcn_setUserData(e))}e||fcn_saveUserBookmarks(t)}}function fcn_updateBookmarksView(){if(!fcn_bookmarks||!fcn_bookmarks.data)return;const t=_$(".profile-bookmarks-stats"),e=Object.keys(fcn_bookmarks.data).length;t&&(t.innerHTML=t.innerHTML.replace("%s",e)),e>0&&_$$(".icon-menu-bookmarks").forEach((t=>{t.classList.remove("hidden")})),fcn_showBookmarkCards(),fcn_showChapterBookmark()}function fcn_saveUserBookmarks(t){fcn_isLoggedIn&&(clearTimeout(fcn_userBookmarksTimeout),t=fcn_fixBookmarks(t),fcn_userBookmarksTimeout=setTimeout((()=>{fcn_ajaxPost({action:"fictioneer_ajax_save_bookmarks",fcn_fast_ajax:1,bookmarks:JSON.stringify(t)}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,3,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,3,"warning")}))}),fictioneer_ajax.post_debounce_rate))}function fcn_toggleBookmark(t,e="none"){fcn_bookmarks=fcn_getBookmarks();const n=_$(".chapter__article"),a=_$(".current-bookmark");if(!n)return;const o=fcn_bookmarks.data[n.id];if(o&&o["paragraph-id"]==t&&a)"none"!=e&&e!=o.color?(_$(".current-bookmark").dataset.bookmarkColor=e,o.color=e):fcn_removeBookmark(n.id);else{Object.keys(fcn_bookmarks.data).length>=50&&fcn_removeBookmark(Object.keys(fcn_bookmarks.data)[0]);const o=_$(`[data-paragraph-id="${t}"]`),c=_$$$("chapter-bookmark-data").dataset;fcn_bookmarks.data[n.id]={"paragraph-id":t,progress:100*(fcn_offset(o).top-fcn_offset(o.parentElement).top)/o.parentElement.clientHeight,date:(new Date).toISOString(),color:e,chapter:c.title.trim(),link:c.link,thumb:c.thumb,image:c.image,story:c.storyTitle.trim(),content:o.querySelector("span").innerHTML.substring(0,128)+"…"},fcn_jumpToBookmarkButtons.forEach((t=>{t.classList.remove("hidden")})),fcn_mobileBookmarkJump?.removeAttribute("hidden"),a?.classList.remove("current-bookmark"),o.classList.add("current-bookmark"),o.setAttribute("data-bookmark-color",e)}fcn_setMobileMenuBookmarks(),fcn_setBookmarks(fcn_bookmarks)}function fcn_showChapterBookmark(){_$(".current-bookmark")?.classList.remove("current-bookmark");const t=_$(".chapter__article");if(!t||!fcn_bookmarks.data[t.id])return;const e=fcn_bookmarks.data[t.id]["paragraph-id"],n=_$(`[data-paragraph-id="${e}"]`),a=fcn_bookmarks.data[t.id].color??"none";e&&n&&(fcn_jumpToBookmarkButtons.forEach((t=>{t.classList.remove("hidden")})),fcn_mobileBookmarkJump?.removeAttribute("hidden"),n.classList.add("current-bookmark"),n.setAttribute("data-bookmark-color",a))}function fcn_setMobileMenuBookmarks(){fcn_mobileBookmarkList.innerHTML="";const t=Object.entries(fcn_bookmarks.data),e=_$("#mobile-bookmark-template");if(t.length>0){const n=document.createDocumentFragment();t.forEach((([t,{color:a,progress:o,link:c,chapter:s,"paragraph-id":i}])=>{const r=e.content.cloneNode(!0),l=r.querySelector(".mobile-menu__bookmark");l.classList.add(`bookmark-${t}`),l.dataset.color=a,r.querySelector(".mobile-menu__bookmark-progress > div > div").style.width=`${o.toFixed(1)}%`,r.querySelector(".mobile-menu__bookmark a").href=`${c}#paragraph-${i}`,r.querySelector(".mobile-menu__bookmark a span").innerText=s,r.querySelector(".mobile-menu-bookmark-delete-button").setAttribute("data-bookmark-id",t),n.appendChild(r)})),fcn_mobileBookmarkList.appendChild(n),fcn_bookmarkDeleteHandler(_$$(".mobile-menu-bookmark-delete-button"))}else{const t=document.createElement("li");t.classList.add("no-bookmarks"),t.textContent=fcn_mobileBookmarkList.dataset.empty,fcn_mobileBookmarkList.appendChild(t)}}function fcn_showBookmarkCards(){if(!fcn_bookmarks||!fcn_bookmarksSmallCardBlock||!fcn_bookmarksSmallCardTemplate||Object.keys(fcn_bookmarks.data).length<1||_$(".bookmark-card"))return;fcn_bookmarksSmallCardBlock.classList.remove("hidden"),_$(".bookmarks-block__no-bookmarks")?.remove(),_$$(".show-if-bookmarks").forEach((t=>t.classList.remove("hidden")));let t=parseInt(fcn_bookmarksSmallCardBlock.dataset.count);const e=document.createDocumentFragment();Object.entries(fcn_bookmarks.data).sort(((t,e)=>new Date(e[1].date)-new Date(t[1].date))).forEach((([n,{color:a,progress:o,link:c,chapter:s,"paragraph-id":i,date:r,image:l,thumb:f,content:d}])=>{if(0==t)return;t--;const _=fcn_bookmarksSmallCardTemplate.content.cloneNode(!0),u=new Date(r).toLocaleDateString(navigator.language??"en-US",{year:"2-digit",month:"short",day:"numeric"});l&&_.querySelector(".bookmark-card__image")?(_.querySelector(".bookmark-card__image").href=l,_.querySelector(".bookmark-card__image img").src=f):_.querySelector(".bookmark-card__image")?.remove(),_.querySelector(".bookmark-card__excerpt").innerHTML+=d,_.querySelector(".bookmark-card").classList.add(`bookmark-${n}`),_.querySelector(".bookmark-card").dataset.color=a,_.querySelector(".bookmark-card__title > a").href=`${c}#paragraph-${i}`,_.querySelector(".bookmark-card__title > a").innerText=s,_.querySelector(".bookmark-card__percentage").innerText=`${o.toFixed(1)} %`,_.querySelector(".bookmark-card__progress").style.width=`calc(${o.toFixed(1)}% - var(--bookmark-progress-offset, 0px))`,_.querySelector("time").innerText=u,_.querySelector(".button-delete-bookmark").setAttribute("data-bookmark-id",n),e.appendChild(_)})),fcn_bookmarksSmallCardBlock.querySelector("ul").appendChild(e),fcn_bookmarkDeleteHandler(_$$(".button-delete-bookmark"))}function fcn_bookmarkDeleteHandler(t){("object"==typeof t?t:[t]).forEach((t=>{t.addEventListener("click",(t=>{fcn_removeBookmark(t.currentTarget.dataset.bookmarkId),fcn_setBookmarks(fcn_bookmarks),Object.keys(fcn_bookmarks.data).length<1&&(_$(".bookmarks-block")?.classList.add("hidden"),_$$(".show-if-bookmarks").forEach((t=>{t.classList.add("hidden")})))}))}))}function fcn_removeBookmark(t){const e=_$(".chapter__article"),n=_$(".current-bookmark");delete fcn_bookmarks.data[t],e&&e.id==t&&(fcn_jumpToBookmarkButtons.forEach((t=>{t.classList.add("hidden")})),fcn_mobileBookmarkJump?.setAttribute("hidden",!0),n&&(n.classList.remove("current-bookmark"),n.removeAttribute("data-bookmark-color"))),_$$(`.bookmark-${t}`)?.forEach((t=>{t.remove()}))}fcn_initializeLocalBookmarks(),document.addEventListener("fcnUserDataReady",(t=>{fcn_initializeUserBookmarks(t)})),fcn_jumpToBookmarkButtons.forEach((t=>{t.addEventListener("click",(()=>{_$(`[data-paragraph-id="${fcn_bookmarks.data[_$("article").id]["paragraph-id"]}"]`).scrollIntoView({behavior:"smooth"})}))}));const fcn_followsMenuItem=_$$$("follow-menu-button");var fcn_userFollowsTimeout,fcn_follows,fcn_checkmarks,fcn_userCheckmarksTimeout,fcn_userRemindersTimeout,fcn_reminders;function fcn_initializeFollows(t){const e=t.detail.data.follows;!1!==e&&(Array.isArray(e.data)&&0===e.data.length&&(e.data={}),fcn_follows=e,fcn_updateFollowsView(),localStorage.removeItem("fcnBookshelfContent"))}function fcn_toggleFollow(t){const e=fcn_getUserData();if(fcn_follows&&e.follows){if(localStorage.removeItem("fcnBookshelfContent"),JSON.stringify(fcn_follows.data[t])!==JSON.stringify(e.follows.data[t]))return fcn_follows=e.follows,fcn_showNotification(fictioneer_tl.notification.followsResynchronized),void fcn_updateFollowsView();fcn_follows.data[t]?delete fcn_follows.data[t]:fcn_follows.data[t]={story_id:parseInt(t),timestamp:Date.now()},e.follows.data[t]=fcn_follows.data[t],e.lastLoaded=0,fcn_setUserData(e),fcn_updateFollowsView(),clearTimeout(fcn_userFollowsTimeout),fcn_userFollowsTimeout=setTimeout((()=>{fcn_ajaxPost({action:"fictioneer_ajax_toggle_follow",fcn_fast_ajax:1,story_id:t,set:!!fcn_follows.data[t]}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{429===t.status?fcn_showNotification(fictioneer_tl.notification.slowDown,3,"warning"):t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}),fictioneer_ajax.post_debounce_rate)}}function fcn_updateFollowsView(){const t=fcn_getUserData();if(!fcn_follows||!t.follows)return;_$$(".button-follow-story").forEach((t=>{t.classList.toggle("_followed",!!fcn_follows?.data[t.dataset.storyId])})),_$$(".card").forEach((t=>{t.classList.toggle("has-follow",!!fcn_follows?.data[t.dataset.storyId])}));const e=parseInt(fcn_follows.new)>0;_$$(".mark-follows-read, .follows-alert-number, .mobile-menu-button").forEach((t=>{t.classList.toggle("_new",e),e>0&&(t.dataset.newCount=fcn_follows.new)}))}function fcn_setupFollowsHTML(){fcn_followsMenuItem.classList.contains("_loaded")||fcn_ajaxGet({action:"fictioneer_ajax_get_follows_notifications",fcn_fast_ajax:1}).then((t=>{if(t.data.html){const e=_$$$("follow-menu-scroll");e&&(e.innerHTML=t.data.html);const n=_$$$("mobile-menu-follows-list");n&&(n.innerHTML=t.data.html),!1===fcn_getUserData().loggedIn&&(fcn_prepareLogin(),fcn_fetchUserData())}})).catch((t=>{429===t.status?fcn_showNotification(fictioneer_tl.notification.slowDown,3,"warning"):t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),_$$$("follow-menu-scroll")?.remove(),_$$$("mobile-menu-follows-list")?.remove()})).then((()=>{fcn_followsMenuItem.classList.add("_loaded")}))}function fcn_markFollowsRead(){if(!fcn_followsMenuItem.classList.contains("_new")||!fcn_followsMenuItem.classList.contains("_loaded"))return;_$$(".mark-follows-read, .follows-alert-number, .follow-item, .mobile-menu-button").forEach((t=>{t.classList.remove("_new")}));const t=fcn_getUserData();t.new=0,t.lastLoaded=0,fcn_setUserData(t),fcn_ajaxPost({action:"fictioneer_ajax_mark_follows_read",fcn_fast_ajax:1}).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}function fcn_initializeCheckmarks(t){const e=t.detail.data.checkmarks;!1!==e&&(Array.isArray(e.data)&&0===e.data.length&&(e.data={}),fcn_checkmarks=e,fcn_updateCheckmarksView(),localStorage.removeItem("fcnBookshelfContent"),_$$("button.checkmark").forEach((t=>{t.addEventListener("click",(t=>{fcn_clickCheckmark(t.currentTarget)}))})))}function fcn_toggleCheckmark(t,e,n=null,a=null,o="toggle"){const c=fcn_getUserData();if(fcn_checkmarks&&c.checkmarks){if(localStorage.removeItem("fcnBookshelfContent"),"toggle"===o&&JSON.stringify(fcn_checkmarks.data[t])!==JSON.stringify(c.checkmarks.data[t]))return fcn_checkmarks=c.checkmarks,fcn_showNotification(fictioneer_tl.notification.checkmarksResynchronized),void fcn_updateCheckmarksView();if(fcn_checkmarks.data[t]||(fcn_checkmarks.data[t]=[]),c.checkmarks.data[t]||(c.checkmarks.data[t]=[]),n&&"progress"===e&&!fcn_checkmarks.data[t].includes(n)&&fcn_checkmarks.data[t].push(n),n&&"chapter"===e)if(!fcn_checkmarks.data[t].includes(n)&&"unset"!==o||"set"===o)fcn_checkmarks.data[t].push(n),a&&(a.classList.add("marked"),a.setAttribute("aria-checked",!0));else{fcn_removeItemOnce(fcn_checkmarks.data[t],n),a&&(a.classList.remove("marked"),a.setAttribute("aria-checked",!1)),fcn_removeItemOnce(fcn_checkmarks.data[t],t);const e=_$('button[data-type="story"]');e&&(e.classList.remove("marked"),e.setAttribute("aria-checked",!1))}if("story"===e){const e=(fcn_checkmarks.data[t].includes(t)||"unset"===o)&&"set"!==o;fcn_checkmarks.data[t]=[],e||(_$$("button.checkmark").forEach((e=>{fcn_checkmarks.data[t].push(parseInt(e.dataset.id))})),fcn_checkmarks.data[t].includes(t)||fcn_checkmarks.data[t].push(t))}fcn_checkmarks.data[t]=fcn_checkmarks.data[t].filter(((t,e,n)=>n.indexOf(t)==e)),c.checkmarks.data[t]=fcn_checkmarks.data[t],c.lastLoaded=0,fcn_setUserData(c),fcn_updateCheckmarksView(),clearTimeout(fcn_userCheckmarksTimeout),fcn_userCheckmarksTimeout=setTimeout((()=>{fcn_updateCheckmarks(t,fcn_checkmarks.data[t])}),fictioneer_ajax.post_debounce_rate)}}function fcn_clickCheckmark(t){fcn_toggleCheckmark(parseInt(t.dataset.storyId),t.dataset.type,parseInt(t.dataset.id),t)}function fcn_updateCheckmarks(t,e=null){fcn_ajaxPost({action:"fictioneer_ajax_set_checkmark",fcn_fast_ajax:1,story_id:t,update:(e=e||fcn_getUserData().checkmarks.data[t]).join(" ")}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,3,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}function fcn_updateCheckmarksView(){const t=fcn_getUserData(),e=t.checkmarks;if(!e)return;const n=parseInt(fcn_inlineStorage.storyId);if(n){const a=e.data[n]&&e.data[n].includes(n);if(a){let a=!1;_$$("button.checkmark").forEach((t=>{const o=parseInt(t.dataset.id);e.data[n].includes(o)||(e.data[n].push(o),a=!0)})),a&&(t.checkmarks=e,fcn_setUserData(t),fcn_updateCheckmarks(n,e.data[n]))}_$$$("ribbon-read")?.classList.toggle("hidden",!a)}_$$("button.checkmark").forEach((t=>{const n=parseInt(t.dataset.storyId);if(e.data[n]){const a=e.data[n].includes(parseInt(t.dataset.id));t.classList.toggle("marked",a),t.setAttribute("aria-checked",a)}})),_$$(".card").forEach((t=>{const n=parseInt(t.dataset.storyId),a=e.data[n]&&(e.data[n].includes(parseInt(t.dataset.checkId))||e.data[n].includes(n));t.classList.toggle("has-checkmark",1==a)}))}function fcn_initializeReminders(t){const e=t.detail.data.reminders;!1!==e&&(Array.isArray(e.data)&&0===e.data.length&&(e.data={}),fcn_reminders=e,fcn_updateRemindersView(),localStorage.removeItem("fcnBookshelfContent"))}function fcn_toggleReminder(t){const e=fcn_getUserData();if(fcn_reminders&&e.reminders){if(localStorage.removeItem("fcnBookshelfContent"),JSON.stringify(fcn_reminders.data[t])!==JSON.stringify(e.reminders.data[t]))return fcn_reminders=e.reminders,fcn_showNotification(fictioneer_tl.notification.remindersResynchronized),void fcn_updateRemindersView();fcn_reminders.data[t]?delete fcn_reminders.data[t]:fcn_reminders.data[t]={story_id:parseInt(t),timestamp:Date.now()},e.reminders.data[t]=fcn_reminders.data[t],e.lastLoaded=0,fcn_setUserData(e),fcn_updateRemindersView(),clearTimeout(fcn_userRemindersTimeout),fcn_userRemindersTimeout=setTimeout((()=>{fcn_ajaxPost({action:"fictioneer_ajax_toggle_reminder",fcn_fast_ajax:1,story_id:t,set:!!fcn_reminders.data[t]}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{429===t.status?fcn_showNotification(fictioneer_tl.notification.slowDown,3,"warning"):t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}),fictioneer_ajax.post_debounce_rate)}}function fcn_updateRemindersView(){const t=fcn_getUserData();fcn_reminders&&t.reminders&&(_$$(".button-read-later").forEach((t=>{t.classList.toggle("_remembered",!!fcn_reminders.data[t.dataset.storyId])})),_$$(".card").forEach((t=>{t.classList.toggle("has-reminder",!!fcn_reminders.data[t.dataset.storyId])})))}function fcn_addJSTrap(){const t=document.querySelector(".comment-form");t&&t.appendChild(fcn_html` +const _$=document.querySelector.bind(document),_$$=document.querySelectorAll.bind(document),_$$$=document.getElementById.bind(document);async function fcn_ajaxPost(t={},e=null,n={}){e&&!e.startsWith("http")&&(e=fictioneer_ajax.rest_url+e),e=e||fictioneer_ajax.ajax_url;let a={"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"};a={...a,...n},t={nonce:fcn_getNonce(),...t};const o=await fetch(e,{method:"POST",credentials:"same-origin",headers:a,mode:"same-origin",body:new URLSearchParams(t)});return o.ok?o.json():Promise.reject(o)}async function fcn_ajaxGet(t={},e=null,n={}){e&&!e.startsWith("http")&&(e=fictioneer_ajax.rest_url+e),e=e||fictioneer_ajax.ajax_url,e=fcn_buildUrl(t={nonce:fcn_getNonce(),...t},e);let a={"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"};a={...a,...n};const o=await fetch(e,{method:"GET",credentials:"same-origin",headers:a,mode:"same-origin"});return o.ok?o.json():Promise.reject(o)}function fcn_evaluateAsBoolean(t,e=!1){if(void 0===t)return e;if("boolean"==typeof t)return t;if(t instanceof HTMLInputElement&&"checkbox"===t.getAttribute("type"))return t.checked;t instanceof HTMLElement&&(t.hasAttribute("value")?t=t.value:t.hasAttribute("data-value")&&(t=t.dataset.value));const n=String(t),a=parseInt(t);return"true"===n||"1"===n||1===a||"false"!==n&&"0"!==n&&0!==a&&e}function fcn_copyToClipboard(t,e=!1){e=e||fictioneer_tl.notification.copiedToClipboard,navigator.clipboard&&(navigator.clipboard.writeText(t),e&&fcn_showNotification(e,2))}function fcn_parseJSON(t){if(null==t||"string"!=typeof t)return null;try{return JSON.parse(t)}catch(t){return null}}function fcn_removeItemOnce(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),t}function fcn_clamp(t,e,n){return Math.min(Math.max(n,t),e)}function fcn_updateThemeColor(t=!1){const e=fcn_siteSettings.darken?fcn_siteSettings.darken:0,n=fcn_siteSettings.saturation?fcn_siteSettings.saturation:0,a=fcn_siteSettings["hue-rotate"]?fcn_siteSettings["hue-rotate"]:0,o=e>=0?1+e**2:1-e**2,c=n>=0?1+n**2:1-n**2;let s=getComputedStyle(document.documentElement).getPropertyValue("--theme-color-base").trim().split(" ");s=`hsl(${(parseInt(s[0])+a)%360}deg ${(parseInt(s[1])*c).toFixed(2)}% ${(parseInt(s[2])*o).toFixed(2)}%)`,_$("meta[name=theme-color]").setAttribute("content",t||s)}function fcn_offset(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX}}function fcn_throttle(t,e,n){var a,o,c,s=null,i=0;n||(n={});var r=function(){i=!1===n.leading?0:Date.now(),s=null,c=t.apply(a,o),s||(a=o=null)};return function(){var l=Date.now();i||!1!==n.leading||(i=l);var f=e-(l-i);return a=this,o=arguments,f<=0||f>e?(s&&(clearTimeout(s),s=null),i=l,c=t.apply(a,o),s||(a=o=null)):s||!1===n.trailing||(s=setTimeout(r,f)),c}}var fcn_lastClicked,fcn_animFrameEvents=new Map;function fcn_bindEventToAnimationFrame(t,e,n=window){n.addEventListener(t,(function(){fcn_animFrameEvents.get(e)||(fcn_animFrameEvents.set(e,!0),requestAnimationFrame((()=>{n.dispatchEvent(new CustomEvent(e)),fcn_animFrameEvents.set(e,!1)})))}))}function fcn_toggleLastClicked(t){const e=!t.classList.contains("last-clicked");t.classList.toggle("last-clicked",e),t.closest(".watch-last-clicked")?.classList.toggle("has-last-clicked",e),fcn_lastClicked&&fcn_lastClicked!=t&&fcn_removeLastClick(fcn_lastClicked),fcn_lastClicked=t}function fcn_removeLastClick(t){t.closest(".watch-last-clicked")?.classList.remove("has-last-clicked"),t.classList.remove("last-clicked"),fcn_lastClicked=null}function fcn_cleanTextSelectionFromButtons(t){return t=(t=(t=(t=(t=(t=t.replace(/[\r\n]{2,}/g,"__$__")).replace(new RegExp("(__Bookmark|__Quote|__Link)","g"),"")).replace(new RegExp("(__Bookmark|__Quote|__TTS|__Link)","g"),"")).replace(new RegExp("(__Bookmark|__Quote|__Suggestion|__TTS|__Link)","g"),"")).replace(new RegExp("(__Bookmark|__Quote|__Suggestion|__Link)","g"),"")).replace(/[__$]{1,}/g,"\n\n").replace(/^[\r\n]+|[\r\n]+$/g,"")}function fcn_deleteCookie(t){document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function fcn_deleteAllCookies(){localStorage.clear(),document.cookie.split(";").forEach((t=>{document.cookie=t.replace(/^ +/,"").replace(/=.*/,"=;expires="+(new Date).toUTCString()+";path=/")}))}function fcn_setCookie(t,e,n=30){const a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3);const o="expires="+a.toUTCString();document.cookie=t+"="+encodeURIComponent(e)+";"+o+";SameSite=Strict;path=/"}function fcn_getCookie(t){const e=t+"=",n=document.cookie.split(";");for(var a=0;a{e.searchParams.append(n,t[n])})),e}function fcn_buildErrorNotice(t,e=!1,n=!0){console.error("Error Message",t);const a=document.createElement("div");let o=t;return e&&(a.id=e),a.classList="notice _warning","object"==typeof t&&(o="",t.status&&(o=`${t.status}: `),t.statusText&&(o+=t.statusText),o||(o="Unknown error.")),a.innerHTML=`
${n?fcn_sanitizeHTML(o):o}
`,a}function fcn_sanitizeHTML(t){const e=document.createElement("div");return e.innerText=t instanceof HTMLElement?t.innerHTML:t,e.innerHTML}function fcn_detectScreenCollision(t){const e=t.getBoundingClientRect(),n=window.innerHeight??document.documentElement.clientHeight,a=window.innerWidth??document.documentElement.clientWidth,o=(t.closest(".popup-menu-toggle")?.clientHeight??32)+16,c=n-e.bottom,s=[];return e.top<=50&&c>50+o&&s.push("top"),e.bottom>=n-50&&e.top>50+o&&s.push("bottom"),e.left<=10&&s.push("left"),e.right>=a-10&&s.push("right"),s}function fcn_scrollTo(t,e=64){window.scrollTo({top:t.getBoundingClientRect().top+window.scrollY-e,behavior:"smooth"})}function fcn_html(...t){const e=document.createElement("template");return e.innerHTML=String.raw(...t).trim(),e.content.firstChild}function fcn_splitList(t,e=","){if(!t||""===t.trim())return[];let n=t.replace(/\r?\n|\r/g,"").split(e);return n=n.map((t=>t.trim())).filter((t=>t.length>0)),n}function fcn_isSearchEngineCrawler(){const t=navigator.userAgent.toLowerCase();return["googlebot","bingbot","slurp","duckduckbot","baiduspider","yandexbot","sogou","exabot","facebot","ia_archiver"].some((e=>t.includes(e)))}_$("body").addEventListener("click",(t=>{const e=t.target.closest(".toggle-last-clicked");!["BUTTON","A"].includes(t.target.tagName)&&e||null!==t.target.closest(".escape-last-click")||fcn_lastClicked&&e!=fcn_lastClicked&&fcn_removeLastClick(fcn_lastClicked)})),_$("body").addEventListener("keydown",(t=>{27==t.keyCode&&fcn_lastClicked&&(fcn_removeLastClick(fcn_lastClicked),document.activeElement?.blur())})),_$$$("full-navigation")?.addEventListener("mouseover",(()=>{fcn_lastClicked&&(fcn_removeLastClick(fcn_lastClicked),document.activeElement?.blur())}));const fcn_theSite=_$$$("site"),fcn_theBody=_$("body"),fcn_theRoot=document.documentElement,fcn_inlineStorage=_$$$("inline-storage").dataset,fcn_urlParams=Object.fromEntries(new URLSearchParams(window.location.search).entries()),fcn_pageLoadTimestamp=Date.now(),fcn_ajaxLimitThreshold=Date.now()-parseInt(fictioneer_ajax.ttl);var fcn_isLoggedIn=fcn_theBody.classList.contains("logged-in"),fcn_chapterList=_$("#story-chapter-list > ul");function fcn_cleanupWebStorage(t=!1){const e=["fcnProfileAvatar","fcnBookshelfContent"];t||e.push("fcnChapterBookmarks"),e.forEach((t=>localStorage.removeItem(t)));const n=["loggedIn","follows","reminders","checkmarks","bookmarks","fingerprint"],a=fcn_parseJSON(localStorage.getItem("fcnUserData"));a&&(n.forEach((t=>a[t]=!1)),localStorage.setItem("fcnUserData",JSON.stringify(a)));const o=fcn_parseJSON(localStorage.getItem("fcnAuth"));o?.loggedIn&&localStorage.removeItem("fcnAuth")}function fcn_prepareLogin(){localStorage.removeItem("fcnUserData"),localStorage.removeItem("fcnAuth")}function fcn_cleanupGuestView(){fcn_isLoggedIn=!1,fcn_theBody.classList.remove("logged-in","is-admin","is-moderator","is-editor","is-author"),_$$$("fictioneer-ajax-nonce")?.remove(),_$$(".only-moderators, .only-admins, .only-authors, .only-editors, .chapter-group__list-item-checkmark").forEach((t=>{t.remove()}))}function fcn_ajaxAuth(){let t=!1,e=fcn_parseJSON(localStorage.getItem("fcnAuth"))??!1;if(fcn_isLoggedIn&&!e?.loggedIn&&(localStorage.removeItem("fcnAuth"),e=!1),e){fcn_addNonceHTML(e.nonceHtml);const n=new CustomEvent("fcnAuthReady",{detail:{nonceHtml:e.nonceHtml,nonce:e.nonce,loggedIn:e.loggedIn,isAdmin:e.isAdmin,isModerator:e.isModerator,isAuthor:e.isAuthor,isEditor:e.isEditor},bubbles:!0,cancelable:!1});if(document.dispatchEvent(n),t=!0,fcn_ajaxLimitThreshold{if(e.success){fcn_addNonceHTML(e.data.nonceHtml);const n={lastLoaded:Date.now(),nonceHtml:e.data.nonceHtml,nonce:e.data.nonce,loggedIn:e.data.loggedIn,isAdmin:e.data.isAdmin,isModerator:e.data.isModerator,isAuthor:e.data.isAuthor,isEditor:e.data.isEditor};if(!t){const t=new CustomEvent("fcnAuthReady",{detail:n,bubbles:!0,cancelable:!1});document.dispatchEvent(t)}localStorage.setItem("fcnAuth",JSON.stringify(n))}else{fcn_cleanupGuestView();const t=new Event("fcnAuthFailed");document.dispatchEvent(t)}})).catch((()=>{localStorage.removeItem("fcnAuth"),fcn_cleanupGuestView();const t=new Event("fcnAuthError");document.dispatchEvent(t)}))}function fcn_addNonceHTML(t){_$$$("fictioneer-ajax-nonce")?.remove(),fcn_theBody.appendChild(fcn_html`${t}`)}function fcn_setLoggedInState(t){fcn_isLoggedIn=t.loggedIn,fcn_theBody.classList.add("logged-in"),fcn_theBody.classList.toggle("is-admin",t.isAdmin),fcn_theBody.classList.toggle("is-moderator",t.isModerator),fcn_theBody.classList.toggle("is-author",t.isAuthor),fcn_theBody.classList.toggle("is-editor",t.isEditor);const e=['label[for="modal-login-toggle"]',"#modal-login-toggle","#login-modal"];t.isAdmin||(e.push(".only-admins"),t.isModerator||e.push(".only-moderators"),t.isAuthor||e.push(".only-authors"),t.isEditor||e.push(".only-editors")),_$$(e.join(", ")).forEach((t=>t.remove())),fcn_getProfileImage(),fcn_fetchUserData()}function fcn_loadEmbed(t){t.target.parentNode.querySelectorAll("iframe, script")[0].src=t.target.dataset.src,t.target.parentElement.querySelector(".embed-logo")?.remove(),t.target.remove()}function fcn_appendTermMenu(t,e){const n=_$$$(`term-submenu-${t}`);if(!n)return;const a=n.content.cloneNode(!0);e.classList.add("menu-item-has-children"),e.querySelector('[href="#"]').addEventListener("click",(t=>{t.preventDefault()})),e.appendChild(a)}fcn_chapterList&&(fcn_chapterList=fcn_chapterList.cloneNode(!0),_$$$("story-chapter-list").remove(),fcn_chapterList.querySelector(`[data-id="${fcn_chapterList.dataset.currentId}"]`)?.classList.add("current-chapter")),fcn_isLoggedIn||fcn_theRoot.dataset.ajaxAuth||(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView()),"function"==typeof fcn_removeQueryArgs&&fcn_removeQueryArgs(),_$("#wp-admin-bar-logout a")?.addEventListener("click",(()=>{fcn_cleanupWebStorage()})),_$$(".subscriber-login, .oauth-login-link, [data-prepare-login]").forEach((t=>{t.addEventListener("click",(()=>{fcn_prepareLogin()}))})),document.addEventListener("DOMContentLoaded",(()=>{fcn_theRoot.dataset.ajaxAuth&&fcn_ajaxAuth()})),!fcn_isLoggedIn&&fcn_theRoot.dataset.ajaxAuth&&document.addEventListener("fcnAuthReady",(t=>{t.detail.loggedIn?fcn_setLoggedInState(t.detail):(fcn_cleanupWebStorage(!0),fcn_cleanupGuestView())})),fcn_bindEventToAnimationFrame("scroll","scroll.rAF"),fcn_bindEventToAnimationFrame("resize","resize.rAF"),fcn_theBody.addEventListener("click",(t=>{const e=t.target.closest(".toggle-last-clicked");if(e&&(!["BUTTON","A","INPUT","SELECT"].includes(t.target.tagName)||t.target.classList.contains("toggle-last-clicked")))return fcn_toggleLastClicked?.(e),"function"==typeof fcn_popupPosition&&fcn_popupPosition(),void t.stopPropagation();const n=t.target.closest(".page-numbers.dots:not(button)");if(n)return void fcn_jumpPage(n);const a=t.target.closest(".spoiler");if(a)return void a.classList.toggle("_open");t.target.closest(".oauth-login-link, .subscriber-login, [data-prepare-login]")&&fcn_prepareLogin();const o=t.target.closest("[data-click]"),c=o?.dataset.click;if(c)switch(c){case"copy-to-clipboard":o.select(),fcn_copyToClipboard(o.value,o.dataset.message);break;case"reset-consent":fcn_deleteCookie("fcn_cookie_consent"),location.reload();break;case"clear-cookies":fcn_deleteAllCookies(),alert(o.dataset.message);break;case"logout":fcn_cleanupWebStorage();break;case"card-toggle-follow":fcn_isLoggedIn?fcn_toggleFollow(o.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-reminder":fcn_isLoggedIn?fcn_toggleReminder(o.dataset.storyId):_$$$("modal-login-toggle")?.click();break;case"card-toggle-checkmarks":fcn_isLoggedIn?(fcn_toggleCheckmark(parseInt(o.dataset.storyId),o.dataset.type,parseInt(o.dataset.chapterId),null,o.dataset.mode),fcn_updateCheckmarksView()):_$$$("modal-login-toggle")?.click();break;case"toggle-obfuscation":o.closest("[data-obfuscation-target]").classList.toggle("_obfuscated")}})),fcn_theBody.addEventListener("change",(t=>{const e=t.target.closest('[type="checkbox"]');if(!e)return;const n=e.name,a=n?_$$(`label[for="${n}"]`):[],o=e.checked;e.closest("[aria-checked]")?.setAttribute("aria-checked",o),a.forEach((t=>{t.closest("[aria-checked]")?.setAttribute("aria-checked",o)}))})),_$$(".iframe-consent, .twitter-consent").forEach((t=>{t.onclick=t=>{fcn_loadEmbed(t)}})),document.addEventListener("DOMContentLoaded",(()=>{const t=_$("#menu-navigation > .menu-item"),e=_$$$("full-navigation");t&&e&&t.offsetHeight{fcn_appendTermMenu("category",t)})),_$$(".main-navigation .trigger-term-menu-tags").forEach((t=>{fcn_appendTermMenu("post_tag",t)})),_$$(".main-navigation .trigger-term-menu-genres").forEach((t=>{fcn_appendTermMenu("fcn_genre",t)})),_$$(".main-navigation .trigger-term-menu-fandoms").forEach((t=>{fcn_appendTermMenu("fcn_fandom",t)})),_$$(".main-navigation .trigger-term-menu-characters").forEach((t=>{fcn_appendTermMenu("fcn_character",t)})),_$$(".main-navigation .trigger-term-menu-warnings").forEach((t=>{fcn_appendTermMenu("fcn_content_warning",t)}))}));var fcn_lastScrollTop=0;function fcn_scrollDirection(){if(fcn_theSite.classList.contains("transformed-scroll"))return;const t="hidden"!==window.getComputedStyle(document.documentElement).overflow?window.scrollY??document.documentElement.scrollTop:fcn_theBody.scrollTop??1;fcn_theBody.classList.toggle("scrolled-to-top",0===t),t>fcn_lastScrollTop&&Math.abs(fcn_lastScrollTop-t)>=10?(fcn_theBody.classList.add("scrolling-down"),fcn_theBody.classList.remove("scrolling-up"),fcn_lastScrollTop=Math.max(t,0)):t=50&&(fcn_theBody.classList.add("scrolling-up"),fcn_theBody.classList.remove("scrolling-down"),fcn_lastScrollTop=Math.max(t,0))}function fcn_observe(t,e,n={}){const a=_$(t);if(!a)return null;new IntersectionObserver((t=>e(t[0])),n).observe(a)}function fcn_dragElement(t){const e=t.querySelector(".drag-anchor")??t;let n,a;function o(e){e.preventDefault(),t.style.top=t.offsetTop-(a-e.clientY)+"px",t.style.left=t.offsetLeft-(n-e.clientX)+"px",n=e.clientX,a=e.clientY}function c(){e.onmouseup=null,e.onmousemove=null}e.onmousedown=function(t){t.preventDefault(),n=t.clientX,a=t.clientY,e.onmousemove=o,e.onmouseup=c}}function fcn_showNotification(t,e=3,n="base"){const a=_$("#notifications"),o=document.createElement("div");o.innerHTML=t,o.classList.add("notifications__message",`_${n}`),o.style.opacity=1,o.style.transitionDelay=`${e}s`,a.prepend(o),o.addEventListener("transitionend",(t=>{"opacity"===t.propertyName&&a.removeChild(t.target)})),o.addEventListener("click",(t=>{a.removeChild(t.currentTarget)})),setTimeout((()=>{o.style.opacity=0}),100)}if(window.addEventListener("scroll.rAF",fcn_throttle(fcn_scrollDirection,200)),fcn_scrollDirection(),document.addEventListener("DOMContentLoaded",(()=>{fcn_observe(".main-observer",(t=>{fcn_theBody.classList.toggle("is-inside-main",t.intersectionRatio<1&&t.boundingClientRect.top<=0)}),{threshold:[1]}),fcn_observe(".chapter-end",(t=>{fcn_theBody.classList.toggle("is-end-of-chapter",t.isIntersecting||t.boundingClientRect.top<0)}),{root:null,threshold:0}),fcn_observe("#nav-observer-sticky",(t=>{_$$$("full-navigation").classList.toggle("is-sticky",t.intersectionRatio<1)}),{threshold:[1]})})),_$$(".modal__header.drag-anchor").forEach((t=>{fcn_dragElement(t.closest(".modal__wrapper"))})),fcn_urlParams){switch(fcn_urlParams.failure&&console.error("Failure:",fcn_urlParams.failure),fcn_urlParams.failure){case"oauth_email_taken":fcn_showNotification(fictioneer_tl.notification.oauthEmailTaken,5,"warning");break;case"oauth_already_linked":fcn_showNotification(fictioneer_tl.notification.oauthAccountAlreadyLinked,5,"warning")}if("oauth_new"===fcn_urlParams.success)fcn_showNotification(fictioneer_tl.notification.oauthNew,10);else fcn_urlParams.success?.startsWith("oauth_merged_")&&fcn_showNotification(fictioneer_tl.notification.oauthAccountLinked,3,"success");if(fcn_urlParams["fictioneer-notice"]){let t="1"===fcn_urlParams.failure?"warning":"base";t="1"===fcn_urlParams.success?"success":t,fcn_showNotification(fcn_sanitizeHTML(fcn_urlParams["fictioneer-notice"]),3,t)}}const fcn_settingMinimal=_$$$("site-setting-minimal"),fcn_settingChapterProgressBar=_$$$("site-setting-chapter-progress-bar"),fcn_settingHueRotateRange=_$$$("site-setting-hue-rotate-range"),fcn_settingHueRotateText=_$$$("site-setting-hue-rotate-text"),fcn_settingHueRotateReset=_$$$("site-setting-hue-rotate-reset"),fcn_settingDarkenRanges=_$$(".setting-darken-range"),fcn_settingDarkenTexts=_$$(".setting-darken-text"),fcn_settingDarkenResets=_$$(".setting-darken-reset"),fcn_settingSaturationRanges=_$$(".setting-saturation-range"),fcn_settingSaturationTexts=_$$(".setting-saturation-text"),fcn_settingSaturationResets=_$$(".setting-saturation-reset"),fcn_settingFontLightnessRanges=_$$(".setting-font-lightness-range"),fcn_settingFontLightnessTexts=_$$(".setting-font-lightness-text"),fcn_settingFontLightnessResets=_$$(".setting-font-lightness-reset"),fcn_settingEvents=["nav-sticky","background-textures","polygons","covers","text-shadows","minimal","chapter-progress-bar"];var fcn_siteSettings=fcn_getSiteSettings();function fcn_updateSiteSetting(t,e,n){t.checked=n,fcn_siteSettings[e]=n,fcn_applySiteSettings(fcn_siteSettings)}function fcn_toggleLightMode(){fcn_setLightMode(!(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault))}function fcn_setLightMode(t,e=!1){localStorage.setItem("fcnLightmode",t),fcn_theRoot.dataset.mode=t?"light":"dark",_$$(".toggle-light-mode").forEach((e=>{e.closest("[aria-checked]")?.setAttribute("aria-checked",t)})),e||fcn_updateThemeColor()}function fcn_updateFontWeight(){const t="default"!=fcn_siteSettings["font-weight"];_$$(".site-setting-font-weight").forEach((t=>{t.value=fcn_siteSettings["font-weight"]})),_$$(".font-weight-reset").forEach((e=>{e.classList.toggle("_modified",t)}))}function fcn_resetFontWeight(){fcn_siteSettings["font-weight"]="default",fcn_theRoot.dataset.fontWeight="default",fcn_applySiteSettings(fcn_siteSettings)}function fcn_updateHueRotate(t){t=fcn_clamp(0,360,t??0),fcn_settingHueRotateText.value=t,fcn_settingHueRotateRange.value=t,fcn_settingHueRotateReset.classList.toggle("_modified",0!=t),fcn_theRoot.style.setProperty("--hue-rotate",`(${t}deg + var(--hue-offset))`),fcn_siteSettings["hue-rotate"]=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setHueRotate(){fcn_updateHueRotate(this.value)}function fcn_updateDarken(t=null){t=fcn_clamp(-1,1,t??fcn_siteSettings.darken),t=Math.round(100*(t+Number.EPSILON))/100,fcn_settingDarkenResets.forEach((e=>{e.classList.toggle("_modified",0!=t)})),fcn_settingDarkenRanges.forEach((e=>{e.value=t})),fcn_settingDarkenTexts.forEach((e=>{e.value=parseInt(100*t)}));const e=t>=0?1+t**2:1-t**2;fcn_theRoot.style.setProperty("--darken",`(${e} + var(--lightness-offset))`),fcn_siteSettings.darken=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setDarkenFromRange(){fcn_updateDarken(this.value)}function fcn_setDarkenFromText(){"-"!=this.value&&""!=this.value&&fcn_updateDarken((parseInt(this.value)??0)/100)}function fcn_updateSaturation(t=null){t=fcn_clamp(-1,1,t??fcn_siteSettings.saturation),fcn_settingSaturationResets.forEach((e=>{e.classList.toggle("_modified",0!=t)})),fcn_settingSaturationRanges.forEach((e=>{e.value=t})),fcn_settingSaturationTexts.forEach((e=>{e.value=parseInt(100*t)}));const e=t>=0?1+t**2:1-t**2;fcn_theRoot.style.setProperty("--saturation",`(${e} + var(--saturation-offset))`),fcn_siteSettings.saturation=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setSaturationFromRange(){fcn_updateSaturation(this.value)}function fcn_setSaturationFromText(){"-"!=this.value&&""!=this.value&&fcn_updateSaturation((parseInt(this.value)??0)/100)}function fcn_updateFontLightness(t=null){t=fcn_clamp(-1,1,t??fcn_siteSettings["font-lightness"]??1),fcn_settingFontLightnessResets.forEach((e=>{e.classList.toggle("_modified",0!=t)})),fcn_settingFontLightnessRanges.forEach((e=>{e.value=t})),fcn_settingFontLightnessTexts.forEach((e=>{e.value=parseInt(100*t)}));const e=t>=0?1+t**2:1-t**2;fcn_theRoot.style.setProperty("--font-lightness",`(${e} + var(--font-lightness-offset))`),fcn_siteSettings["font-lightness"]=t,fcn_setSiteSettings(),fcn_updateThemeColor()}function fcn_setFontLightnessFromRange(){fcn_updateFontLightness(this.value)}function fcn_setFontLightnessFromText(){"-"!=this.value&&""!=this.value&&fcn_updateFontLightness((parseInt(this.value)??0)/100)}function fcn_defaultSiteSettings(){return{"nav-sticky":!0,"background-textures":!0,polygons:!0,covers:!0,"text-shadows":!1,minimal:!1,"chapter-progress-bar":!0,"site-theme":"default","font-weight":"default",darken:0,saturation:0,"font-saturation":0,"font-lightness":0,"hue-rotate":0}}function fcn_getSiteSettings(){const t=fcn_parseJSON(localStorage.getItem("fcnSiteSettings"))??fcn_defaultSiteSettings();return fcn_setSiteSettings(t),t}function fcn_setSiteSettings(t=null){"object"==typeof(t=t||fcn_siteSettings)&&(fcn_siteSettings=t,localStorage.setItem("fcnSiteSettings",JSON.stringify(t)))}function fcn_applySiteSettings(t){t="object"!=typeof t?fcn_defaultSiteSettings():t,Object.entries(t).forEach((t=>{const e=_$$$(`site-setting-${t[0]}`);switch(e&&(e.checked=t[1]),t[0]){case"minimal":fcn_theRoot.classList.toggle("minimal",t[1]);break;case"darken":fcn_updateDarken();break;case"saturation":fcn_updateSaturation();break;case"font-saturation":break;case"font-lightness":fcn_updateFontLightness();break;case"hue-rotate":fcn_updateHueRotate(t[1]);break;case"font-weight":fcn_updateFontWeight();break;default:fcn_theRoot.classList.toggle(`no-${t[0]}`,!t[1])}})),fcn_setSiteSettings(t)}function fcn_updateSiteTheme(t){fcn_siteSettings["site-theme"]=t,fcn_theRoot.dataset.theme=t,_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=t),fcn_applySiteSettings(fcn_siteSettings),fcn_updateThemeColor()}function fcn_resetSiteTheme(){fcn_updateSiteTheme("default"),_$$(".site-setting-site-theme").forEach((t=>{t.value="default"}))}function fcn_jumpPage(t){if(fcn_theRoot.dataset.disablePageJump)return;const e=parseInt(window.prompt(fictioneer_tl.notification.enterPageNumber));if(e>0){const n=t.nextElementSibling.getAttribute("href"),a=["page=","paged=","comment-page-","pg="];for(const t of a)if(n.includes(t))return void(window.location.href=n.replace(new RegExp(`${t}\\d+`),t+e));window.location.href=n.replace(/page\/\d+/,`page/${e}`)}}fcn_settingEvents.forEach((t=>{_$$$(`site-setting-${t}`)?.addEventListener("change",(e=>{fcn_updateSiteSetting(e.currentTarget,t,e.currentTarget.checked)}))})),fcn_setLightMode(localStorage.getItem("fcnLightmode")?"true"==localStorage.getItem("fcnLightmode"):"light"==fcn_theRoot.dataset.modeDefault,!0),_$$(".toggle-light-mode").forEach((t=>{t.onclick=()=>fcn_toggleLightMode()})),_$$(".font-weight-reset").forEach((t=>{t.addEventListener("click",fcn_resetFontWeight)})),_$$(".site-setting-font-weight").forEach((t=>{t.onchange=t=>{fcn_siteSettings["font-weight"]=t.target.value,fcn_theRoot.dataset.fontWeight=t.target.value,fcn_applySiteSettings(fcn_siteSettings),fcn_updateFontWeight()}})),fcn_settingHueRotateReset?.addEventListener("click",(()=>{fcn_updateHueRotate(0)})),fcn_settingHueRotateRange?.addEventListener("input",fcn_throttle(fcn_setHueRotate,1e3/24)),fcn_settingHueRotateText?.addEventListener("input",fcn_setHueRotate),fcn_settingDarkenResets.forEach((t=>{t.addEventListener("click",(()=>{fcn_updateDarken(0)}))})),fcn_settingDarkenRanges.forEach((t=>{t.addEventListener("input",fcn_throttle(fcn_setDarkenFromRange,1e3/24))})),fcn_settingDarkenTexts.forEach((t=>{t.addEventListener("input",fcn_setDarkenFromText)})),fcn_settingSaturationResets.forEach((t=>{t.addEventListener("click",(()=>{fcn_updateSaturation(0)}))})),fcn_settingSaturationRanges.forEach((t=>{t.addEventListener("input",fcn_throttle(fcn_setSaturationFromRange,1e3/24))})),fcn_settingSaturationTexts.forEach((t=>{t.addEventListener("input",fcn_setSaturationFromText)})),fcn_settingFontLightnessResets.forEach((t=>{t.addEventListener("click",(()=>{fcn_updateFontLightness(0)}))})),fcn_settingFontLightnessRanges.forEach((t=>{t.addEventListener("input",fcn_throttle(fcn_setFontLightnessFromRange,1e3/24))})),fcn_settingFontLightnessTexts.forEach((t=>{t.addEventListener("input",fcn_setFontLightnessFromText)})),fcn_applySiteSettings(fcn_siteSettings),_$$(".site-setting-site-theme").forEach((t=>{t.value=fcn_siteSettings["site-theme"]?fcn_siteSettings["site-theme"]:"default",_$$$("site-setting-theme-reset").classList.toggle("_modified","default"!=t.value),t.addEventListener("change",(t=>{fcn_updateSiteTheme(t.target.value)}))})),_$$$("site-setting-theme-reset")?.addEventListener("click",fcn_resetSiteTheme),fcn_updateThemeColor();const fcn_cardListMutationObserver=new MutationObserver((t=>{t.forEach((t=>{t.addedNodes.length>0&&("function"==typeof fcn_updateFollowsView&&fcn_updateFollowsView(),"function"==typeof fcn_updateCheckmarksView&&fcn_updateCheckmarksView(),"function"==typeof fcn_updateRemindersView&&fcn_updateRemindersView())}))}));function fcn_revealCommentImage(t){const e=t.parentElement.querySelector("img");e.src=e.dataset.src,t.remove()}function fcn_contactFormSubmit(t){const e=t.closest("form"),n=new FormData(e),a={action:"fictioneer_ajax_submit_contact_form"};if(e.reportValidity()&&(t.disabled=!0,t.innerHTML=t.dataset.disabled,!(Date.now(){n.success?(e.querySelector("textarea").value="",t.innerHTML=t.dataset.done,fcn_showNotification(n.data.success,3,"success")):n.data.error&&(t.disabled=!1,t.innerHTML=t.dataset.enabled,fcn_showNotification(n.data.error,5,"warning"))})).catch((e=>{e.status&&e.statusText&&(fcn_showNotification(`${e.status}: ${e.statusText}`,5,"warning"),t.disabled=!1,t.innerHTML=t.dataset.enabled)})).then((()=>{e.classList.remove("ajax-in-progress")}))}}_$$(".card-list:not(._no-mutation-observer)").forEach((t=>fcn_cardListMutationObserver.observe(t,{childList:!0,subtree:!0}))),_$$(".chapter-group__name").forEach((t=>{t.addEventListener("click",(t=>{const e=t.currentTarget.closest(".chapter-group"),n=e.querySelector(".chapter-group__list"),a=!e.classList.contains("_closed");_$(".main__background")?.classList.add("will-change"),n.style.height=`${n.scrollHeight}px`,requestAnimationFrame((()=>{requestAnimationFrame((()=>{e.classList.toggle("_closed",a),n.style.height=a?"0":`${n.scrollHeight}px`}))}))}))})),_$$(".chapter-group__list").forEach((t=>{t.addEventListener("transitionend",(e=>{t.style.height="",t.querySelectorAll("a, button, label, input:not([hidden])").forEach((e=>{e.tabIndex=t.parentElement.classList.contains("_closed")?"-1":"0"})),_$(".main__background")?.classList.remove("will-change")}))})),_$(".fictioneer-comments")?.addEventListener("click",(t=>{t.target?.classList.contains("consent-button")&&fcn_revealCommentImage(t.target)})),_$$(".fcn-contact-form").forEach((t=>{t.querySelector(".fcn-contact-form__submit").addEventListener("click",(t=>{fcn_contactFormSubmit(t.currentTarget)}))})),fcn_theBody.querySelectorAll(".modal-toggle").forEach((t=>{t.addEventListener("change",(t=>{if(t.currentTarget.checked){const e=t.currentTarget.nextElementSibling.querySelector('[tabindex="0"]');e?.focus(),e?.blur()}else fcn_theBody.classList.contains("user-is-tabbing")&&fcn_theSite.querySelector(`label[for="${t.currentTarget.id}"]`)?.focus()}))})),_$$('[data-click-action*="open-dialog-modal"]').forEach((t=>{t.addEventListener("click",(t=>{document.querySelector(t.currentTarget.dataset.clickTarget).showModal()}))})),_$$('[data-click-action*="close-dialog-modal"], button[formmethod="dialog"][value="cancel"]').forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),t.target.closest("dialog").close()}))})),_$$("dialog").forEach((t=>{t.addEventListener("mousedown",(t=>{"dialog"===t.target.tagName.toLowerCase()&&(t.preventDefault(),t.target.close())}))})),_$(".content-section")?.addEventListener("click",(t=>{if(t.target.closest('[data-click-action*="open-tooltip-modal"]')&&!window.getSelection().toString()){const e=_$$$("fictioneer-tooltip-dialog"),n=t.target.dataset.dialogHeader,a=t.target.dataset.dialogContent;a.length>200&&(e.style="--modal-width: 400px;"),n&&(e.querySelector('[data-finder="tooltip-dialog-header"]').innerHTML=n),e.querySelector('[data-finder="tooltip-dialog-content"]').innerHTML=a,e.showModal()}})),fcn_theBody.addEventListener("keydown",(t=>{let e=document.activeElement.closest('[tabindex="0"]:not(a, input, button, select)');if(["BUTTON","A","INPUT","SELECT"].includes(document.activeElement.tagName)&&(e=null),e&&(32!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),e.click())),27==t.keyCode){_$$(".modal-toggle:checked").forEach((t=>{t.checked=!1,t.dispatchEvent(new Event("change"))}));const t=_$(".lightbox.show");if(t)return void t.querySelector(".lightbox__close").click();const e=_$(".selected-paragraph #button-close-paragraph-tools");if(e)return void e.click();const n=_$("#tts-interface:not(.hidden)");if(n){if(n.classList.contains("playing")){const t=_$$$("button-tts-pause");t?.click(),t?.focus(),t?.blur()}else _$$$("button-tts-stop").click();return}}}));class FCN_KeywordInput{constructor(t){this.input=t,this.operator=t.closest(".keyword-input").querySelector(".keyword-input__operator input"),this.inputWrapper=t.closest(".keyword-input__input-wrapper"),this.block=t.closest(".keyword-input"),this.form=this.block.closest(".search-form"),this.collection=this.block.querySelector(".keyword-input__collection"),this.suggestionList=this.block.querySelector(".keyword-input__suggestion-list"),this.tabSuggestion=this.block.querySelector(".keyword-input__tab-suggestion"),this.allowText=this.form.querySelector(".allow-list")?.innerText??"{}",this.allowList=JSON.parse(this.allowText),this.hints=this.block.querySelector(".keyword-input__hints"),this.noHint=this.block.querySelector(".keyword-input__no-suggestions"),this.keywords=this.collection.value.length>0?this.collection.value.split(","):[],this.bindEvents(),this.resize(),this.filterSuggestions()}resize(){ +const t=this.tabSuggestion.innerText.length>0?this.tabSuggestion.innerText.length:this.input.value.length;this.input.style.width=.88*t+2+"ch"}reset(){this.keywords=[],this.block.querySelectorAll(".node").forEach((t=>{t.remove()})),this.block.querySelectorAll(".keyword-input__operator > input").forEach((t=>{t.checked=!1})),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}encode(t){const e=(new TextEncoder).encode(t.toLowerCase());return btoa(String.fromCharCode.apply(null,e))}filterSuggestions(){const t=this.input.value.toLowerCase();let e=0,n="";""==t?this.suggestionList.querySelectorAll(".keyword-button").forEach((t=>{t.hidden=!0})):this.suggestionList.querySelectorAll(".keyword-button").forEach((a=>{const o=a.innerText.toLowerCase();o.includes(t)&&this.keywords.indexOf(o)<0?(a.hidden=!1,e++,""==n&&o.startsWith(t)&&(n=o)):a.hidden=!0})),this.hints.querySelectorAll(".keyword-button").forEach((t=>{this.keywords.indexOf(t.value.toLowerCase())>-1?t.hidden=!0:t.hidden=!1})),this.tabSuggestion.innerHTML=n,this.hints.hidden=!(""==t),this.noHint.hidden=!(""!=t&&e<1)}addNode(t=null,e=null){const n=t??this.input.value.replace(",","");let a=this.allowList[this.encode(n)];if("authors"!=this.collection.name&&"ex_authors"!=this.collection.name||!e||(a=this.allowList[this.encode(n)+`_${e.value}`]),!a||this.keywords.indexOf(a)>-1)return;this.keywords.push(a);const o=document.createElement("div");o.innerHTML=`${n}`,o.classList.add("node"),o.dataset.value=a,this.inputWrapper.parentNode.insertBefore(o,this.inputWrapper),this.input.value="",this.updateCollection(),this.filterSuggestions(),this.resize()}removeNodeByValue(t){this.block.querySelector(`[data-value="${t}"]`)?.remove(),this.keywords=this.keywords.filter((e=>e!=t)),this.updateCollection(),this.filterSuggestions(),this.resize()}updateCollection(){this.collection.value=this.keywords.join(","),this.block.classList.toggle("_empty",""===this.collection.value),this.form.querySelector(".search-form__current").innerHTML=""}bindEvents(){this.input.addEventListener("input",(t=>{t.currentTarget.value.includes(",")&&this.addNode(),this.block.classList.toggle("_empty",""===t.currentTarget.value&&""===this.collection.value),this.filterSuggestions(),this.resize()})),this.input.addEventListener("keydown",(t=>{9!=t.keyCode&&13!=t.keyCode||""!=this.tabSuggestion.innerText&&(t.preventDefault(),this.input.value=this.tabSuggestion.innerText,this.addNode()),27==t.keyCode&&(this.input.value="",this.tabSuggestion.innerHTML="",document.activeElement.blur()),8==t.keyCode&&""==this.input.value&&this.keywords.length>0&&this.removeNodeByValue(this.keywords.slice(-1))})),this.input.addEventListener("blur",(()=>{const t=this.allowList[this.encode(this.input.value)];this.blurTimeout=t?setTimeout((()=>{this.addNode()}),150):setTimeout((()=>{this.input.value="",this.tabSuggestion.innerHTML="",this.filterSuggestions(),this.resize()}),150)})),this.block.addEventListener("click",(t=>{t.target.closest(".node-delete")&&(t.preventDefault(),this.removeNodeByValue(t.target.closest(".node").dataset.value))})),this.block.querySelectorAll(".keyword-button").forEach((t=>{t.addEventListener("click",(t=>{clearTimeout(this.blurTimeout),this.addNode(t.currentTarget.innerText,t.currentTarget)}))}))}}function fcn_resetSearchForm(t,e,n){n.forEach((t=>t.reset())),e.querySelectorAll("input, select").forEach((t=>{t.value=t.dataset.default??t.value})),e.querySelector(".search-form__current").innerHTML="",fcn_showNotification(t.dataset.reset,2)}function fcn_handleTabInput(t){9==t.keyCode&&(fcn_theBody.classList.add("user-is-tabbing"),window.removeEventListener("keydown",fcn_handleTabInput),window.addEventListener("mousedown",fcn_handleMouseInput))}function fcn_handleMouseInput(){fcn_theBody.classList.remove("user-is-tabbing"),window.removeEventListener("mousedown",fcn_handleMouseInput),window.addEventListener("keydown",fcn_handleTabInput)}function fcn_popupPosition(){_$$(".popup-menu-toggle.last-clicked .popup-menu:not(._fixed-position)").forEach((t=>{if("none"===window.getComputedStyle(t).display)return;const e=fcn_detectScreenCollision(t);e&&0===e.length||(e.includes("top")?(t.classList.remove("_top"),t.classList.add("_bottom")):e.includes("bottom")&&(t.classList.remove("_bottom"),t.classList.add("_top")),t.closest("._fixed-horizontal")||(e.includes("left")?(t.classList.remove("_center","_justify-right"),t.classList.add("_justify-left")):e.includes("right")&&(t.classList.remove("_center","_justify-left"),t.classList.add("_justify-right"))))}))}function fcn_markCurrentMenuItem(){_$$(`.menu-item > [data-nav-object-id="${fcn_theBody.dataset.postId}"]`).forEach((t=>{t.setAttribute("aria-current","page"),t.closest(".menu-item").classList.add("current-menu-item")}))}function fcn_showAgeConfirmationModal(){const t=_$(".story__article, .chapter__article")?.dataset.ageRating;if(!fcn_theRoot.dataset.ageConfirmation&&t&&"adult"!==t)return void _$$$("age-confirmation-modal")?.remove();const e=_$$$("age-confirmation-leave");fcn_theRoot.classList.add("age-modal-open"),_$$$("age-confirmation-modal").classList.add("_open"),_$$$("age-confirmation-confirm")?.addEventListener("click",(t=>{fcn_theRoot.classList.remove("age-modal-open"),t.currentTarget.closest(".modal").remove(),localStorage.setItem("fcnAgeConfirmation","1")})),e?.addEventListener("click",(()=>{window.location.href=e.dataset.redirect??"https://search.brave.com/",localStorage.removeItem("fcnAgeConfirmation")}))}function fcn_showLightbox(t){const e=_$$$("fictioneer-lightbox"),n=_$(".lightbox__content");let a=!1,o=null;if(n.innerHTML="",t.classList.add("lightbox-last-trigger"),"IMG"==t.tagName?(o=t.cloneNode(),a=!0):t.href&&(o=document.createElement("img"),o.src=t.href,a=!0),a&&o){["class","style","height","width"].forEach((t=>o.removeAttribute(t))),n.appendChild(o),e.classList.add("show");const t=e.querySelector(".lightbox__close");t?.focus(),t?.blur()}}function fcn_toggleMobileMenu(t){_$(".mobile-menu._advanced-mobile-menu")?fcn_toggleAdvancedMobileMenu(t):fcn_toggleSimpleMobileMenu(t)}function fcn_toggleSimpleMobileMenu(t){t?(fcn_theBody.classList.add("mobile-menu-open","scrolling-down"),fcn_theBody.classList.remove("scrolling-up")):(fcn_theBody.classList.remove("mobile-menu-open"),fcn_closeMobileFrames(),fcn_openMobileFrame("main"),_$$$("mobile-menu-toggle").checked=!1)}function fcn_toggleAdvancedMobileMenu(t){const e=_$$$("wpadminbar")?.offsetHeight??0,n=window.scrollY,a=fcn_theSite.scrollTop;t?(fcn_theBody.classList.add("mobile-menu-open","scrolling-down","scrolled-to-top"),fcn_theBody.classList.remove("scrolling-up"),fcn_theSite.classList.add("transformed-scroll","transformed-site"),fcn_theSite.scrollTop=n-e,fcn_updateThemeColor()):(fcn_theSite.classList.remove("transformed-site","transformed-scroll"),fcn_theBody.classList.remove("mobile-menu-open"),fcn_updateThemeColor(),fcn_closeMobileFrames(),fcn_openMobileFrame("main"),fcn_theRoot.style.scrollBehavior="auto",window.scroll(0,a+e),fcn_theRoot.style.scrollBehavior="",_$$$("mobile-menu-toggle").checked=!1,"function"==typeof fcn_trackProgress&&fcn_trackProgress())}function fcn_setupMobileJumpButton(t,e){const n=_$(t);n&&n.addEventListener("click",(()=>{fcn_toggleMobileMenu(!1),setTimeout((()=>{const t=e();t&&fcn_scrollTo(t)}),200)}))}function fcn_openMobileFrame(t){fcn_closeMobileFrames(),_$(`.mobile-menu__frame[data-frame="${t}"]`)?.classList.add("_active")}function fcn_closeMobileFrames(){_$$(".mobile-menu__frame._active").forEach((t=>{t.classList.remove("_active")}));const t=_$(".mobile-menu__bookmarks-panel");t&&(t.dataset.editing="false")}function fcn_appendChapterList(){const t=_$$$("mobile-menu-chapters-list");fcn_chapterList&&!t.hasChildNodes()&&t.appendChild(fcn_chapterList.cloneNode(!0))}_$$(".search-form").forEach((t=>{if(t.classList.contains("_simple"))return;const e=[];t.querySelectorAll(".keyword-input__input").forEach((t=>{e.push(new FCN_KeywordInput(t))})),t.querySelector(".allow-list")?.remove(),t.addEventListener("change",(e=>{e.target.classList.contains("search-form__advanced-control")||e.target.classList.contains("search-form__string")||(t.querySelector(".search-form__current").innerHTML="")})),t.querySelectorAll(".reset").forEach((n=>{n.addEventListener("click",(()=>{fcn_resetSearchForm(n,t,e)}))}))})),_$$(".search-form__advanced-toggle").forEach((t=>{t.addEventListener("click",(t=>{const e=t.currentTarget.closest("form");e.dataset.advanced="true"==e.dataset.advanced?"false":"true"}))})),window.addEventListener("keydown",fcn_handleTabInput),window.addEventListener("scroll.rAF",fcn_throttle(fcn_popupPosition,250)),_$$(".modal-toggle").forEach((t=>{t.addEventListener("change",(t=>{const e=_$$$(t.currentTarget.dataset.target);e.classList.toggle("_open",t.currentTarget.checked),e.hidden=!t.currentTarget.checked;const n=e.querySelector(".close");n?.focus(),n?.blur()}))})),fcn_theBody.addEventListener("click",(t=>{const e=t.target.closest("[href]"),n=e?.getAttribute("href");if(!e||"A"===!e.tagName||!n.startsWith("#")||n.length<2||"#respond"===n)return;const a=n.replace("#",""),o=_$$(`[name="${a}"], [id="${a}"]`)[0],c=e.closest(".comment._story-comment");c&&(window.location.href=c.querySelector(".fictioneer-comment__link").href+n),o&&(t.preventDefault(),o.scrollIntoView({behavior:"smooth",block:e.dataset?.block??"start"}))})),fcn_markCurrentMenuItem(),_$$$("age-confirmation-modal")&&"1"!==localStorage.getItem("fcnAgeConfirmation")&&!fcn_isSearchEngineCrawler()?setTimeout((()=>{fcn_showAgeConfirmationModal()}),2500):_$$$("age-confirmation-modal")?.remove(),document.addEventListener("DOMContentLoaded",(()=>{_$$(".splide:not(.no-auto-splide, .is-initialized)").forEach((t=>{"undefined"!=typeof Splide&&new Splide(t).mount()}))})),fcn_theBody.addEventListener("click",(t=>{const e=t.target.closest("[data-lightbox]:not(.no-auto-lightbox)");e&&(t.preventDefault(),fcn_showLightbox(e))})),fcn_theBody.addEventListener("keydown",(t=>{const e=t.target.closest("[data-lightbox]:not(.no-auto-lightbox)");e&&(32!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),fcn_showLightbox(e)))})),document.querySelectorAll(".lightbox__close, .lightbox").forEach((t=>{t.addEventListener("click",(t=>{if("IMG"!=t.target.tagName){_$$$("fictioneer-lightbox").classList.remove("show");const t=_$(".lightbox-last-trigger");t?.focus(),t?.blur(),t?.classList.remove("lightbox-last-trigger")}}))})),_$$$("mobile-menu-toggle")?.addEventListener("change",(t=>{fcn_toggleMobileMenu(t.currentTarget.checked)})),fcn_theSite.addEventListener("click",(t=>{fcn_theBody.classList.contains("mobile-menu-open")&&(t.preventDefault(),fcn_toggleMobileMenu(!1))})),fcn_setupMobileJumpButton("#mobile-menu-comment-jump",(()=>_$$$("comments"))),fcn_setupMobileJumpButton("#mobile-menu-bookmark-jump",(()=>_$(`[data-paragraph-id="${fcn_bookmarks.data[_$("article").id]["paragraph-id"]}"]`))),_$$(".button-change-lightness").forEach((t=>{t.addEventListener("click",(t=>{fcn_updateDarken(fcn_siteSettings.darken+parseFloat(t.currentTarget.value))}))})),_$$(".mobile-menu__frame-button").forEach((t=>{t.addEventListener("click",(t=>{fcn_openMobileFrame(t.currentTarget.dataset.frameTarget)}))})),_$$(".mobile-menu__back-button").forEach((t=>{t.addEventListener("click",(()=>{fcn_openMobileFrame("main")}))})),_$('.mobile-menu__frame-button[data-frame-target="chapters"]')?.addEventListener("click",(()=>{fcn_appendChapterList()}),{once:!0}),_$$$("micro-menu-label-open-chapter-list")?.addEventListener("click",(()=>{fcn_appendChapterList(),fcn_openMobileFrame("chapters")})),_$$$("button-mobile-menu-toggle-bookmarks-edit")?.addEventListener("click",(t=>{const e=t.currentTarget.closest(".mobile-menu__bookmarks-panel");e.dataset.editing="false"==e.dataset.editing?"true":"false"})),_$('.mobile-menu__frame-button[data-frame-target="bookmarks"]')?.addEventListener("click",(()=>{fcn_setMobileMenuBookmarks()}),{once:!0});const fcn_consentBanner=_$$$("consent-banner");function fcn_loadConsentBanner(){fcn_consentBanner.classList.remove("hidden"),fcn_consentBanner.hidden=!1,_$$$("consent-accept-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","full"),fcn_consentBanner.classList.add("hidden"),fcn_consentBanner.hidden=!0})),_$$$("consent-reject-button")?.addEventListener("click",(()=>{fcn_setCookie("fcn_cookie_consent","necessary"),fcn_consentBanner.classList.add("hidden"),fcn_consentBanner.hidden=!0}))}fcn_consentBanner&&""===(fcn_getCookie("fcn_cookie_consent")??"")&&!fcn_isSearchEngineCrawler()?setTimeout((()=>{fcn_loadConsentBanner()}),4e3):fcn_consentBanner.remove();const fcn_chapterFormatting=_$(".chapter-formatting");var fcn_formatting=fcn_getFormatting();const fcn_paragraphTools=_$$$("paragraph-tools");var fcn_lastSelectedParagraphId,fcn_bookmarkColor="none";function fcn_toggleParagraphTools(t=!1,e=null){e&&e.classList.contains("spoiler")&&!e.classList.contains("_open")||(_$$$(`paragraph-${fcn_lastSelectedParagraphId}`)?.classList.remove("selected-paragraph"),t&&fcn_formatting["show-paragraph-tools"]?(fcn_lastSelectedParagraphId=t,e.classList.add("selected-paragraph"),e.classList.contains("is-wrapped")||(e.innerHTML=`${e.innerHTML}`,e.classList.add("is-wrapped")),e.append(fcn_paragraphTools)):fcn_lastSelectedParagraphId=null)}function fcn_touchParagraph(t){if(t.target.classList.contains("spoiler")||t.target.closest(".popup-menu-toggle, .skip-tools, a, button, label, input, textarea")||!t.target.closest("p")?.textContent.trim().length)return;if(!t.target.closest("p")?.parentElement?.classList.contains("chapter-formatting"))return;if(t.target.closest(".hidden, .inside-epub"))return;if(""!=window.getSelection().toString())return;const e=t.target.closest("p[data-paragraph-id]");if(t.target.closest(".tts-interface, .paragraph-tools__actions"))return;if(!e)return void fcn_toggleParagraphTools(!1);let n=!!e.dataset.paragraphId&&e.dataset.paragraphId;n=n!=fcn_lastSelectedParagraphId&&n;const a=(new Date).getTime();e.addEventListener("mouseup",(()=>{(new Date).getTime()<=a+300&&fcn_toggleParagraphTools(n,e)}),{once:!0})}function fcn_getQuote(t){const e=fcn_cleanTextSelectionFromButtons(window.getSelection().toString()),n=`[anchor]${t.target.closest("p[data-paragraph-id]").id}[/anchor]`;let a=t.target.closest("p[data-paragraph-id]").querySelector(".paragraph-inner").innerText,o="[…] ",c=" […]";if(a.length>16&&e.replace(/\s/g,"").length){const t=Math.ceil(.25*e.length),n=a.substring(0,t+1),s=a.substring(a.length-t,a.length);e.startsWith(n)&&(o=""),e.endsWith(s)&&(c=""),a=`${o}${e}${c}`}a=`${a} ${n}`,fcn_addQuoteToStack(a),fcn_showNotification(fictioneer_tl.notification.quoteAppendedToComment)}function fcn_addQuoteToStack(t){const e=_$(fictioneer_comments.form_selector??"#comment");e?"TEXTAREA"==e.tagName?(e.value+=`\n[quote]${t}[/quote]\n`,fcn_textareaAdjust(_$("textarea#comment"))):"DIV"==e.tagName&&(e.innerHTML+=`\n[quote]${t}[/quote]\n`):fcn_commentStack?.push(`\n[quote]${t}[/quote]\n`)}function fcn_openFullscreen(){document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen()}function fcn_closeFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}function fcn_getFormatting(){let t=fcn_parseJSON(localStorage.getItem("fcnChapterFormatting"))??fcn_defaultFormatting();return Object.keys(t).length<15&&(t=fcn_defaultFormatting()),t.timestamp<1651164557584&&(t=fcn_defaultFormatting(),t.timestamp=Date.now()),fcn_setFormatting(t),t}function fcn_defaultFormatting(){return{"font-saturation":0,"font-color":fictioneer_font_colors[0].css,"font-name":fictioneer_fonts[0].css,"font-size":100,"letter-spacing":0,"line-height":1.7,"paragraph-spacing":1.5,"site-width":fcn_theRoot.dataset.siteWidthDefault??"960",indent:!0,"show-sensitive-content":!0,"show-chapter-notes":!0,justify:!1,"show-comments":!0,"show-paragraph-tools":!0,timestamp:1664797604825,...JSON.parse(fcn_theRoot.dataset.defaultFormatting??"{}")}}function fcn_setFormatting(t){"object"==typeof t&&(fcn_formatting=t,localStorage.setItem("fcnChapterFormatting",JSON.stringify(t)))}function fcn_updateToggle(t,e,n,a={}){a={save:!0,...a};const o=fcn_evaluateAsBoolean(t,!0),c=_$(e);if(c&&(c.checked=o,c.closest("label").setAttribute("aria-checked",o)),a.toggleClass&&fcn_chapterFormatting.classList.toggle(a.toggleClass,a.invertClass?!o:o),a.sensitiveContent){const t=_$$$("inline-sensitive-content-toggle");t?.classList.toggle("hide-sensitive",!o),t?.setAttribute("aria-checked",!o)}a.notes&&_$$(".chapter-note-hideable").forEach((t=>{t.classList.toggle("hidden",!o)})),a.comments&&_$$(".chapter-comments-hideable").forEach((t=>{t.classList.toggle("hidden",!o)})),fcn_formatting[n]=o,a.save&&fcn_setFormatting(fcn_formatting)}document.addEventListener("click",(t=>{fcn_paragraphTools?.closest("p")?.contains(t.target)||fcn_toggleParagraphTools(!1)})),fcn_paragraphTools&&(document.addEventListener("mousedown",(t=>{fcn_touchParagraph(t)})),_$$$("button-close-paragraph-tools").onclick=t=>{fcn_toggleParagraphTools(!1)},_$$$("button-get-link").onclick=t=>{fcn_copyToClipboard(`${location.host}${location.pathname}#${t.target.closest("p[data-paragraph-id]").id}`,fictioneer_tl.notification.linkCopiedToClipboard)},_$$$("button-comment-stack")?.addEventListener("click",(t=>{fcn_getQuote(t)})),_$$(".paragraph-tools__bookmark-colors > div").forEach((t=>{t.onclick=t=>{fcn_bookmarkColor=t.target.dataset.color}})),_$$$("button-set-bookmark")?.addEventListener("click",(t=>{fcn_toggleBookmark(t.target.closest("p[data-paragraph-id]").dataset.paragraphId,fcn_bookmarkColor),window.matchMedia("(min-width: 1024px)").matches&&fcn_toggleParagraphTools(!1),fcn_bookmarkColor="none"}))),_$$(".open-fullscreen").forEach((t=>{t.addEventListener("click",(()=>{fcn_openFullscreen()}))})),_$$(".close-fullscreen").forEach((t=>{t.addEventListener("click",(()=>{fcn_closeFullscreen()}))})),(()=>{"use strict";const t=_$$$("reader-settings-font-size-text"),e=_$$$("reader-settings-font-size-range"),n=_$$$("reader-settings-font-size-reset");function a(a,o=!0){a=fcn_clamp(50,200,a??100),t.value=a,e.value=a,n.classList.toggle("_modified",100!=a),_$$(".resize-font").forEach((t=>{t.style.fontSize=`${a}%`})),fcn_formatting["font-size"]=a,o&&fcn_setFormatting(fcn_formatting)}function o(){a(this.value)}function c(){a(parseFloat(fcn_formatting["font-size"])+parseFloat(this.dataset.modifier))}n&&(_$$$("reset-font")?.addEventListener("click",(()=>{a(100)})),n?.addEventListener("click",(()=>{a(100)})),e?.addEventListener("input",fcn_throttle(o,1e3/24)),t?.addEventListener("input",o),_$$$("increase-font")?.addEventListener("click",c),_$$$("decrease-font")?.addEventListener("click",c),a(fcn_formatting["font-size"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-font-color-reset"),e=_$$$("reader-settings-font-color-select");function n(n,a=!0){n=fcn_clamp(0,fictioneer_font_colors.length-1,n),t.classList.toggle("_modified",n>0),e.value=n,fcn_chapterFormatting.style.setProperty("--text-chapter",fictioneer_font_colors[n].css),fcn_formatting["font-color"]=fictioneer_font_colors[n].css,a&&fcn_setFormatting(fcn_formatting)}t&&(t.onclick=()=>{n(0)},e.onchange=t=>{n(t.target.value)},_$$(".font-color-stepper").forEach((t=>{t.addEventListener("click",(t=>{!function(t=1){let a=(e.selectedIndex+parseInt(t))%fictioneer_font_colors.length;a=a<0?fictioneer_font_colors.length-1:a,n(a)}(t.currentTarget.value)}))})),n(fictioneer_font_colors.findIndex((t=>t.css==fcn_formatting["font-color"])),!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-font-reset"),e=_$$$("reader-settings-font-select");function n(a,o=!0){a=fcn_clamp(0,fictioneer_fonts.length-1,a);let c=fictioneer_fonts[a].css;fictioneer_fonts[a].alt&&(c=`${c}, ${fictioneer_fonts[a].alt}`),a<0?n(0):(t.classList.toggle("_modified",a>0),e.value=a,_$$(".chapter-font-family").forEach((t=>{t.style.fontFamily=""===c?"var(--ff-system)":c+", var(--ff-system)"})),fcn_formatting["font-name"]=fictioneer_fonts[a].css,o&&fcn_setFormatting(fcn_formatting))}t&&(t.onclick=()=>{n(0)},e.onchange=t=>{n(t.target.value)},_$$(".font-stepper").forEach((t=>{t.addEventListener("click",(t=>{!function(t=1){let a=(e.selectedIndex+parseInt(t))%fictioneer_fonts.length;a=a<0?fictioneer_fonts.length-1:a,n(a)}(t.currentTarget.value)}))})),n(fictioneer_fonts.findIndex((t=>t.css==fcn_formatting["font-name"])),!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-font-saturation-text"),e=_$$$("reader-settings-font-saturation-range"),n=_$$$("reader-settings-font-saturation-reset");function a(a,o=!0){a=fcn_clamp(-1,1,a??0),t.value=parseInt(100*a),e.value=a,n.classList.toggle("_modified",0!=a),fcn_chapterFormatting.style.setProperty("--font-saturation",`(${a>=0?1+a**2:1-a**2} + var(--font-saturation-offset))`),fcn_formatting["font-saturation"]=a,o&&fcn_setFormatting(fcn_formatting)}n&&(n?.addEventListener("click",(()=>{a(0)})),e?.addEventListener("input",fcn_throttle((function(){a(this.value)}),1e3/24)),t?.addEventListener("input",(function(){a(parseInt(this.value)/100)})),a(fcn_formatting["font-saturation"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-letter-spacing-text"),e=_$$$("reader-settings-letter-spacing-range"),n=_$$$("reader-settings-letter-spacing-reset"),a=fcn_defaultFormatting()["letter-spacing"];function o(o,c=!0){o=fcn_clamp(-.1,.2,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),fcn_chapterFormatting.style.letterSpacing=`calc(${o}em + var(--font-letter-spacing-base))`,fcn_formatting["letter-spacing"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["letter-spacing"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-paragraph-spacing-text"),e=_$$$("reader-settings-paragraph-spacing-range"),n=_$$$("reader-settings-paragraph-spacing-reset"),a=fcn_defaultFormatting()["paragraph-spacing"];function o(o,c=!0){o=fcn_clamp(0,3,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),fcn_chapterFormatting.style.setProperty("--paragraph-spacing",`${o}em`),fcn_formatting["paragraph-spacing"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["paragraph-spacing"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-line-height-text"),e=_$$$("reader-settings-line-height-range"),n=_$$$("reader-settings-line-height-reset"),a=fcn_defaultFormatting()["line-height"];function o(o,c=!0){o=fcn_clamp(.8,3,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),fcn_chapterFormatting.style.lineHeight=`${o}`,fcn_formatting["line-height"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["line-height"],!1))})(),(()=>{"use strict";const t=_$$$("reader-settings-site-width-text"),e=_$$$("reader-settings-site-width-range"),n=_$$$("reader-settings-site-width-reset"),a=fcn_defaultFormatting()["site-width"];function o(o,c=!0){const s=_$("main");o=fcn_clamp(640,1920,o??a),t.value=o,e.value=o,n.classList.toggle("_modified",o!=a),s.style.setProperty("--site-width",`${o}px`),s.classList.toggle("_default-width",o==fcn_theRoot.dataset.siteWidthDefault),s.classList.toggle("_below-1024",o<1024&&o>=768),s.classList.toggle("_below-768",o<768&&o>640),s.classList.toggle("_640-and-below",o<=640),fcn_formatting["site-width"]=o,c&&fcn_setFormatting(fcn_formatting)}function c(){o(this.value)}n&&(n?.addEventListener("click",(()=>{o(a)})),e?.addEventListener("input",fcn_throttle(c,1e3/24)),t?.addEventListener("input",c),o(fcn_formatting["site-width"],!1))})(),_$$("#reader-settings-indent-toggle").forEach((t=>{const e={invertClass:!0,toggleClass:"no-indent"},n="indent";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-justify-toggle").forEach((t=>{const e={toggleClass:"justify"},n="justify";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-paragraph-tools-toggle").forEach((t=>{const e="show-paragraph-tools";t.onclick=n=>{fcn_updateToggle(n.currentTarget.checked,`#${t.id}`,e)},fcn_updateToggle(fcn_formatting[e],`#${t.id}`,e,{save:!1})})),_$$("#reader-settings-chapter-notes-toggle").forEach((t=>{const e={notes:!0},n="show-chapter-notes";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-comments-toggle").forEach((t=>{const e={comments:!0},n="show-comments";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})})),_$$("#reader-settings-sensitive-content-toggle").forEach((t=>{const e={toggleClass:"hide-sensitive",invertClass:!0,sensitiveContent:!0},n="show-sensitive-content";t.onclick=a=>{fcn_updateToggle(a.currentTarget.checked,`#${t.id}`,n,e)},fcn_updateToggle(fcn_formatting[n],`#${t.id}`,n,{save:!1,...e})}));const fcn_progressBar=_$(".progress__bar"),fcn_chapterContent=_$$$("chapter-content");var fcn_chapterCheckmarkUpdated=!1;function fcn_trackProgress(){fcn_chapterContent&&(fcn_readingProgress(),window.addEventListener("scroll.rAF",fcn_throttle(fcn_readingProgress,1e3/48)))}function fcn_readingProgress(){if(fcn_settingMinimal.checked||!fcn_settingChapterProgressBar.checked)return;const t=fcn_chapterContent.getBoundingClientRect(),e=t.height,n=window.innerHeight,a=e-t.bottom-Math.max(t.top,0)+n;let o=100*a/e;if(fcn_theBody.classList.toggle("hasProgressBar",!(o<0||a>e+500)),o=fcn_clamp(0,100,o),fcn_progressBar.style.width=`${o}%`,o>=100&&!fcn_chapterCheckmarkUpdated&&fcn_isLoggedIn){const t=_$$$("inline-storage")?.dataset.storyId;if(fcn_chapterCheckmarkUpdated=!0,!t||"function"!=typeof fcn_toggleCheckmark)return;fcn_toggleCheckmark(t,"progress",parseInt(fcn_inlineStorage.postId),null,"set")}}_$("article:not(._password)")&&fcn_trackProgress(),_$$(".chapter-list-popup-toggle").forEach((t=>{t.addEventListener("click",(()=>{t.querySelector('[data-target="popup-chapter-list"]')?.appendChild(fcn_chapterList.cloneNode(!0))}),{once:!0})}));const fcn_chapterKeyboardNavigation=t=>{if(["INPUT","TEXTAREA","SELECT","OPTION"].includes(t.target.tagName)||t.target.isContentEditable)return;let e=null;"ArrowLeft"===t.code?e=_$("a.button._navigation._prev"):"ArrowRight"===t.code&&(e=_$("a.button._navigation._next")),e&&e.href&&(window.location.href=e+"#start")};if(document.addEventListener("keydown",fcn_chapterKeyboardNavigation),"#start"===window.location.hash){history.replaceState(null,document.title,window.location.pathname);const t=_$(".chapter__article");t&&fcn_scrollTo(t,128)}var diff_match_patch=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff=function(t,e){this[0]=t,this[1]=e},diff_match_patch.Diff.prototype.length=2,diff_match_patch.Diff.prototype.toString=function(){return this[0]+","+this[1]},diff_match_patch.prototype.diff_main=function(t,e,n,a){if(void 0===a&&(a=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout),null==t||null==e)throw Error("Null input. (diff_main)");if(t==e)return t?[new diff_match_patch.Diff(DIFF_EQUAL,t)]:[];void 0===n&&(n=!0);var o=n,c=this.diff_commonPrefix(t,e);n=t.substring(0,c),t=t.substring(c),e=e.substring(c),c=this.diff_commonSuffix(t,e);var s=t.substring(t.length-c);return t=t.substring(0,t.length-c),e=e.substring(0,e.length-c),t=this.diff_compute_(t,e,o,a),n&&t.unshift(new diff_match_patch.Diff(DIFF_EQUAL,n)),s&&t.push(new diff_match_patch.Diff(DIFF_EQUAL,s)),this.diff_cleanupMerge(t),t},diff_match_patch.prototype.diff_compute_=function(t,e,n,a){if(!t)return[new diff_match_patch.Diff(DIFF_INSERT,e)];if(!e)return[new diff_match_patch.Diff(DIFF_DELETE,t)];var o=t.length>e.length?t:e,c=t.length>e.length?e:t,s=o.indexOf(c);return-1!=s?(n=[new diff_match_patch.Diff(DIFF_INSERT,o.substring(0,s)),new diff_match_patch.Diff(DIFF_EQUAL,c),new diff_match_patch.Diff(DIFF_INSERT,o.substring(s+c.length))],t.length>e.length&&(n[0][0]=n[2][0]=DIFF_DELETE),n):1==c.length?[new diff_match_patch.Diff(DIFF_DELETE,t),new diff_match_patch.Diff(DIFF_INSERT,e)]:(o=this.diff_halfMatch_(t,e))?(e=o[1],c=o[3],t=o[4],o=this.diff_main(o[0],o[2],n,a),n=this.diff_main(e,c,n,a),o.concat([new diff_match_patch.Diff(DIFF_EQUAL,t)],n)):n&&100n);g++){for(var m=-g+d;m<=g-_;m+=2){for(var p=c+m,k=m==-g||m!=g&&i[p-1]a)_+=2;else if(b>o)d+=2;else if(f&&(0<=(p=c+l-m)&&p=v)return this.diff_bisectSplit_(t,e,k,b,n)}}for(m=-g+u;m<=g-h;m+=2){for(p=c+m,k=(v=m==-g||m!=g&&r[p-1]a)h+=2;else if(k>o)u+=2;else if(!f&&(0<=(p=c+l-m)&&p=(v=a-v))))return this.diff_bisectSplit_(t,e,k,b,n)}}return[new diff_match_patch.Diff(DIFF_DELETE,t),new diff_match_patch.Diff(DIFF_INSERT,e)]},diff_match_patch.prototype.diff_bisectSplit_=function(t,e,n,a,o){var c=t.substring(0,n),s=e.substring(0,a);return t=t.substring(n),e=e.substring(a),c=this.diff_main(c,s,!1,o),o=this.diff_main(t,e,!1,o),c.concat(o)},diff_match_patch.prototype.diff_linesToChars_=function(t,e){function n(t){for(var e="",n=0,s=-1,i=a.length;sa?t=t.substring(n-a):n=t.length?[a,o,s,i,f]:null}if(0>=this.Diff_Timeout)return null;var a=t.length>e.length?t:e,o=t.length>e.length?e:t;if(4>a.length||2*o.lengtha[4].length?s:a:s,t.length>e.length){a=s[0],o=s[1];var i=s[2],r=s[3]}else i=s[0],r=s[1],a=s[2],o=s[3];return[a,o,i,r,s[4]]},diff_match_patch.prototype.diff_cleanupSemantic=function(t){for(var e=!1,n=[],a=0,o=null,c=0,s=0,i=0,r=0,l=0;c=(o=this.diff_commonOverlap_(n,e))?(a>=e.length/2||a>=n.length/2)&&(t.splice(c,0,new diff_match_patch.Diff(DIFF_EQUAL,n.substring(0,a))),t[c-1][1]=e.substring(0,e.length-a),t[c+1][1]=n.substring(a),c++):(o>=e.length/2||o>=n.length/2)&&(t.splice(c,0,new diff_match_patch.Diff(DIFF_EQUAL,e.substring(0,o))),t[c-1][0]=DIFF_INSERT,t[c-1][1]=n.substring(0,n.length-o),t[c+1][0]=DIFF_DELETE,t[c+1][1]=e.substring(o),c++),c++),c++},diff_match_patch.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var n=t.charAt(t.length-1),a=e.charAt(0),o=n.match(diff_match_patch.nonAlphaNumericRegex_),c=a.match(diff_match_patch.nonAlphaNumericRegex_),s=o&&n.match(diff_match_patch.whitespaceRegex_),i=c&&a.match(diff_match_patch.whitespaceRegex_);n=s&&n.match(diff_match_patch.linebreakRegex_),a=i&&a.match(diff_match_patch.linebreakRegex_);var r=n&&t.match(diff_match_patch.blanklineEndRegex_),l=a&&e.match(diff_match_patch.blanklineStartRegex_);return r||l?5:n||a?4:o&&!s&&i?3:s||i?2:o||c?1:0}for(var n=1;n=l&&(l=f,s=a,i=o,r=c)}t[n-1][1]!=s&&(s?t[n-1][1]=s:(t.splice(n-1,1),n--),t[n][1]=i,r?t[n+1][1]=r:(t.splice(n+1,1),n--))}n++}},diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,diff_match_patch.whitespaceRegex_=/\s/,diff_match_patch.linebreakRegex_=/[\r\n]/,diff_match_patch.blanklineEndRegex_=/\n\r?\n$/,diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/,diff_match_patch.prototype.diff_cleanupEfficiency=function(t){for(var e=!1,n=[],a=0,o=null,c=0,s=!1,i=!1,r=!1,l=!1;ce));n++)c=a,s=o;return t.length!=n&&t[n][0]===DIFF_DELETE?s:s+(e-c)},diff_match_patch.prototype.diff_prettyHtml=function(t){for(var e=[],n=/&/g,a=//g,c=/\n/g,s=0;s");switch(i){case DIFF_INSERT:e[s]=''+r+"";break;case DIFF_DELETE:e[s]=''+r+"";break;case DIFF_EQUAL:e[s]=""+r+""}}return e.join("")},diff_match_patch.prototype.diff_text1=function(t){for(var e=[],n=0;nthis.Match_MaxBits)throw Error("Pattern too long for this browser.");var o=this.match_alphabet_(e),c=this,s=this.Match_Threshold,i=t.indexOf(e,n);-1!=i&&(s=Math.min(a(0,i),s),-1!=(i=t.lastIndexOf(e,n+e.length))&&(s=Math.min(a(0,i),s)));var r=1<=l;h--){var g=o[t.charAt(h-1)];if(f[h]=0===u?(f[h+1]<<1|1)&g:(f[h+1]<<1|1)&g|(d[h+1]|d[h])<<1|1|d[h+1],f[h]&r&&(g=a(u,h-1))<=s){if(s=g,!((i=h-1)>n))break;l=Math.max(1,2*n-i)}}if(a(u+1,n)>s)break;d=f}return i},diff_match_patch.prototype.match_alphabet_=function(t){for(var e={},n=0;n=2*this.Patch_Margin&&o&&(this.patch_addContext_(t,i),n.push(t),t=new diff_match_patch.patch_obj,o=0,i=a,c=s)}l!==DIFF_INSERT&&(c+=f.length),l!==DIFF_DELETE&&(s+=f.length)}return o&&(this.patch_addContext_(t,i),n.push(t)),n},diff_match_patch.prototype.patch_deepCopy=function(t){for(var e=[],n=0;nthis.Match_MaxBits){var l=this.match_main(e,i.substring(0,this.Match_MaxBits),s);-1!=l&&(-1==(r=this.match_main(e,i.substring(i.length-this.Match_MaxBits),s+i.length-this.Match_MaxBits))||l>=r)&&(l=-1)}else l=this.match_main(e,i,s);if(-1==l)o[c]=!1,a-=t[c].length2-t[c].length1;else if(o[c]=!0,a=l-s,i==(s=-1==r?e.substring(l,l+i.length):e.substring(l,r+this.Match_MaxBits)))e=e.substring(0,l)+this.diff_text2(t[c].diffs)+e.substring(l+i.length);else if(s=this.diff_main(i,s,!1),i.length>this.Match_MaxBits&&this.diff_levenshtein(s)/i.length>this.Patch_DeleteThreshold)o[c]=!1;else{var f;for(this.diff_cleanupSemanticLossless(s),i=0,r=0;ro[0][1].length){var c=e-o[0][1].length;o[0][1]=n.substring(o[0][1].length)+o[0][1],a.start1-=c,a.start2-=c,a.length1+=c,a.length2+=c}return 0==(o=(a=t[t.length-1]).diffs).length||o[o.length-1][0]!=DIFF_EQUAL?(o.push(new diff_match_patch.Diff(DIFF_EQUAL,n)),a.length1+=e,a.length2+=e):e>o[o.length-1][1].length&&(c=e-o[o.length-1][1].length,o[o.length-1][1]+=n.substring(0,c),a.length1+=c,a.length2+=c),n},diff_match_patch.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,n=0;n2*e?(i.length1+=l.length,o+=l.length,r=!1,i.diffs.push(new diff_match_patch.Diff(s,l)),a.diffs.shift()):(l=l.substring(0,e-i.length1-this.Patch_Margin),i.length1+=l.length,o+=l.length,s===DIFF_EQUAL?(i.length2+=l.length,c+=l.length):r=!1,i.diffs.push(new diff_match_patch.Diff(s,l)),l==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(l.length))}s=(s=this.diff_text2(i.diffs)).substring(s.length-this.Patch_Margin),""!==(l=this.diff_text1(a.diffs).substring(0,this.Patch_Margin))&&(i.length1+=l.length,i.length2+=l.length,0!==i.diffs.length&&i.diffs[i.diffs.length-1][0]===DIFF_EQUAL?i.diffs[i.diffs.length-1][1]+=l:i.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL,l))),r||t.splice(++n,0,i)}}},diff_match_patch.prototype.patch_toText=function(t){for(var e=[],n=0;n/g,c=/\n/g,s=0;s");switch(i){case 1:e[s]=`${r}`;break;case-1:e[s]=`${r}`;break;case 0:e[s]=`${r}`}}return e.join("")};class FCN_Suggestion{constructor(){this.toggle=_$$$("suggestions-modal-toggle"),this.tools=_$$$("selection-tools"),this.button=_$$$("button-add-suggestion"),this.toolsButton=_$$$("button-tools-add-suggestion"),this.reset=_$$$("button-suggestion-reset"),this.submit=_$$$("button-suggestion-submit"),this.current=_$$$("suggestions-modal-original"),this.input=_$$$("suggestions-modal-input"),this.output=_$$$("suggestions-modal-diff"),this.chapter=_$(".chapter__article"),this.text="",this.original="",this.latest="",this.paragraph=null,this.dmp=new diff_match_patch,this.bindEvents()}getCaretCoordinates(){let t=0,e=0;if(void 0!==window.getSelection){const n=window.getSelection();if(0!==n.rangeCount){let a=n.getRangeAt(0).cloneRange().getClientRects();a=a[a.length-1],a&&(t=a.right+window.scrollX,e=a.bottom+window.scrollY)}}return{x:t,y:e}}getClosestParagraph(){const t=window.getSelection();return t.rangeCount?t.getRangeAt(0).startContainer.parentNode.closest("p"):null}showTools(t,e){const n=document.documentElement.offsetWidth/2+this.tools.offsetWidth,a=_$$$("wpadminbar")?_$$$("wpadminbar").offsetHeight:0;this.tools.style.transform=e>n?"translate(-100%)":"translate(0)",this.tools.style.top=t+4-a+"px",this.tools.style.left=`${e}px`,this.tools.classList.remove("invisible")}hideTools(){this.tools.style.top="0",this.tools.style.left="-1000px",this.tools.classList.add("invisible")}textSelection(){return fcn_cleanTextSelectionFromButtons(window.getSelection().toString())}clearSelection(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}getDiff(t,e){const n=this.dmp.diff_main(t,e);return this.dmp.diff_cleanupEfficiency(n),this.dmp.fcn_prettyHtml(n)}toggleTools(t){fcn_theSite.classList.contains("transformed-site")||window.getSelection().rangeCount<1||!window.getSelection().getRangeAt(0).startContainer.parentNode.closest(".content-section")||setTimeout((()=>{if(t.text=t.textSelection().replaceAll("\n\n","\n"),""!==t.text){const e=t.getCaretCoordinates();t.showTools(e.y,e.x)}else t.hideTools()}),10)}toggleViaParagraphTools(t){fcn_theSite.classList.contains("transformed-site")||(t.text=_$(".selected-paragraph").querySelector(".paragraph-inner").innerText,t.showModal(t))}resizeInput(){this.input.style.height="auto",this.input.style.height=`${fcn_clamp(32,108,this.input.scrollHeight+4)}px`}showModal(t){fcn_lastSelectedParagraphId&&fcn_toggleParagraphTools(!1),t.original=t.text,t.current.innerHTML=t.text.replaceAll("\n","
"),t.input.value=t.text,t.output.innerHTML=t.getDiff(t.original,t.text),t.paragraph=t.getClosestParagraph(),t.toggle.click(),t.toggle.checked=!0,t.clearSelection(),t.hideTools(),t.resizeInput(),t.input.focus()}editSuggestion(t){t.resizeInput(),t.output.innerHTML=t.getDiff(t.original,t.input.value)}resetSuggestion(t){t.input.value=t.original,t.resizeInput(),t.output.innerHTML=t.getDiff(t.original,t.original)}submitSuggestion(t){const e=_$(fictioneer_comments.form_selector??"#comment"),n=t.paragraph?.id??null;let a=t.output.innerHTML;[["¶","¶\n"],["
","\n"],["","[ins]"],["","[/ins]"],["","[del]"],["","[/del]"]].forEach((([t,e])=>{a=a.replaceAll(t,e)})),t.latest=`\n[quote]${a} [anchor]${n}[/anchor][/quote]\n`,e?"TEXTAREA"==e.tagName?(e.value+=t.latest,fcn_textareaAdjust(_$("textarea#comment"))):"DIV"==e.tagName&&(e.innerHTML+=t.latest):fcn_commentStack?.push(t.latest),t.toggle.click(),t.toggle.checked=!1,fcn_showNotification(fictioneer_tl.notification.suggestionAppendedToComment)}bindEvents(){this.chapter?.addEventListener("mouseup",this.toggleTools.bind(null,this)),this.button?.addEventListener("click",this.showModal.bind(null,this)),this.toolsButton?.addEventListener("click",this.toggleViaParagraphTools.bind(null,this)),this.input?.addEventListener("input",this.editSuggestion.bind(null,this)),this.reset?.addEventListener("click",this.resetSuggestion.bind(null,this)),this.submit?.addEventListener("click",this.submitSuggestion.bind(null,this))}}const fcn_suggestions=_$(".chapter__article")&&_$(".comment-section")&&_$$$("selection-tools")?new FCN_Suggestion:null;fcn_suggestions&&document.addEventListener("click",(function(t){t.target.closest(".content-section")||fcn_suggestions.hideTools()}));const fcn_ttsInterface=_$$$("tts-interface");var fcn_utter,fcn_synth,fcn_ttsStack=[],fcn_currentReadingId=-1,fcn_ttsPauseTimestamp=-1,fcn_ttsCurrentText="",fcn_ttsSettings=fcn_getTTSsettings(),fcn_voices=[];if("undefined"!=typeof speechSynthesis&&fcn_ttsInterface){fcn_synth=window.speechSynthesis,(fcn_utter=new SpeechSynthesisUtterance).lang=fcn_theRoot.lang;const t=setTimeout((()=>{fcn_setupTTS()}),2e3);"onvoiceschanged"in speechSynthesis&&fcn_synth.addEventListener("voiceschanged",(()=>{fcn_setupTTS(),clearTimeout(t)}),{once:!0})}function fcn_setupTTS(){fcn_voices.length>0||(fcn_setUpVoices(),fcn_updateVolume(fcn_ttsSettings.volume),fcn_updatePitch(fcn_ttsSettings.pitch),fcn_updateRate(fcn_ttsSettings.rate))}function fcn_setTTSsettings(t){fcn_ttsSettings=t,localStorage.setItem("ttsSettings",JSON.stringify(t))}function fcn_getTTSsettings(){const t=fcn_parseJSON(localStorage.getItem("ttsSettings"))??{};return fcn_setTTSsettings(t),t}function fcn_setUpVoices(){const t=fcn_synth.getVoices(),e=_$$$("tts-voice-select");if(!e)return;let n=0;for(let a=0;a{fcn_updateVoice(t.currentTarget.value)})),fcn_updateVoice(fcn_ttsSettings.voice))}function fcn_updateVoice(t){if(isNaN(t)||void 0===fcn_voices[t]){let e=fcn_voices.findIndex((t=>"Samantha"===t.name&&("en-US"===t.lang||"en_US"===t.lang)));e<0&&(e=fcn_voices.findIndex((t=>"en-US"===t.lang||"en_US"===t.lang))),t=e>-1?e:0}fcn_utter.voice=fcn_voices[t],_$$$("tts-voice-select").value=t,fcn_ttsSettings.voice=t,fcn_setTTSsettings(fcn_ttsSettings)}function fcn_updateVolume(t){t=fcn_clamp(0,100,t=isNaN(t)?100:parseInt(t)),_$$$("tts-volume-range").value=t,_$$$("tts-volume-text").value=t,_$$$("tts-volume-reset").classList.toggle("_modified",100!=t),fcn_ttsSettings.volume=t,fcn_setTTSsettings(fcn_ttsSettings),fcn_utter.volume=t/100}function fcn_updatePitch(t){t=fcn_clamp(.2,1.8,t=isNaN(t)?1:parseFloat(t)),_$$$("tts-pitch-range").value=t,_$$$("tts-pitch-text").value=t,_$$$("tts-pitch-reset").classList.toggle("_modified",1!=t),fcn_ttsSettings.pitch=t,fcn_setTTSsettings(fcn_ttsSettings),fcn_utter.pitch=t}function fcn_updateRate(t){t=fcn_clamp(.2,1.8,t=isNaN(t)?1:parseFloat(t)),_$$$("tts-rate-range").value=t,_$$$("tts-rate-text").value=t,_$$$("tts-rate-reset").classList.toggle("_modified",1!=t),fcn_ttsSettings.rate=t,fcn_setTTSsettings(fcn_ttsSettings),fcn_utter.rate=t}function fcn_readTextStack(){const t=_$(".current-reading");if(0===fcn_ttsStack.length)return fcn_ttsInterface.classList.add("ended"),t&&t.classList.remove("current-reading"),fcn_currentReadingId=-1,void(fcn_ttsCurrentText="");const e=fcn_ttsStack.shift();fcn_ttsCurrentText=e[1],fcn_currentReadingId!=e[0]&&(fcn_currentReadingId=e[0],t&&t.classList.remove("current-reading"),_$$$(fcn_currentReadingId).classList.add("current-reading")),fcn_utter.text=fcn_ttsCurrentText,fcn_utter.addEventListener("end",fcn_readTextStack,{once:!0}),fcn_synth.speak(fcn_utter)}"undefined"!=typeof speechSynthesis&&fcn_ttsInterface&&(_$$$("button-tts-set").addEventListener("click",(t=>{fcn_ttsStack=[],fcn_currentReadingId=-1;const e=_$(".chapter-formatting")?.classList.contains("hide-sensitive")??!1?"sensitive-content":"sensitive-alternative",n=_$$$("button-tts-play"),a=new RegExp(fcn_ttsInterface.dataset.regex,"gm");fcn_synth.speaking&&fcn_utter.removeEventListener("end",fcn_readTextStack),fcn_synth.cancel();const o=new Set(["P","H1","H2","H3","H4","H5","H6"]),c=["skip-tts","inside-epub",e];let s=t.target.closest("p[data-paragraph-id]");for(fcn_ttsStack.push(s);s=s.nextElementSibling;)o.has(s.tagName)&&!c.some((t=>s.classList.contains(t)))&&fcn_ttsStack.push(s);fcn_ttsStack=fcn_ttsStack.flatMap((t=>{const e=[],n=t.querySelector(".paragraph-inner");return(n?n.textContent:t.textContent).replace(a,"$1|").split("|").forEach((n=>{const a=n.trim();a.length>0&&e.push([t.id,a])})),e})),fcn_readTextStack(),fcn_theBody.classList.add("tts-open"),fcn_ttsInterface.classList.remove("hidden","ended","paused"),fcn_ttsInterface.classList.add("playing"),n.focus(),n.blur()})),_$$$("button-tts-stop")?.addEventListener("click",(()=>{const t=_$(".current-reading");fcn_ttsInterface.classList.add("hidden","ended"),fcn_ttsInterface.classList.remove("playing","paused"),fcn_theBody.classList.remove("tts-open"),t&&t.classList.remove("current-reading"),fcn_ttsStack=[],fcn_currentReadingId=-1,fcn_utter.removeEventListener("end",fcn_readTextStack),fcn_synth.cancel()})),_$$$("button-tts-play")?.addEventListener("click",(()=>{fcn_synth.resume(),-1!==fcn_ttsPauseTimestamp&&Date.now()-fcn_ttsPauseTimestamp>1e4&&(fcn_ttsStack.unshift([fcn_currentReadingId,fcn_ttsCurrentText]),fcn_synth.cancel(),fcn_readTextStack(),fcn_ttsPauseTimestamp=-1),fcn_ttsInterface.classList.add("playing"),fcn_ttsInterface.classList.remove("paused")})),_$$$("button-tts-pause")?.addEventListener("click",(()=>{fcn_synth.pause(),fcn_ttsPauseTimestamp=Date.now(),fcn_ttsInterface.classList.remove("playing"),fcn_ttsInterface.classList.add("paused")})),_$$$("button-tts-skip")?.addEventListener("click",(()=>{fcn_utter.removeEventListener("end",fcn_readTextStack),fcn_synth.cancel(),fcn_readTextStack(),fcn_ttsInterface.classList.remove("paused"),fcn_ttsInterface.classList.add("playing")})),_$$$("button-tts-scroll")?.addEventListener("click",(()=>{fcn_scrollTo(_$(`p[id="${fcn_currentReadingId}"]`),128)})),_$$("#tts-volume-range, #tts-volume-text").forEach((t=>{t.addEventListener("input",(t=>{fcn_updateVolume(t.target.value)}))})),_$$$("tts-volume-reset")?.addEventListener("click",(()=>{fcn_updateVolume(100)})),_$$("#tts-pitch-range, #tts-pitch-text").forEach((t=>{t.addEventListener("input",(t=>{fcn_updatePitch(t.target.value)}))})),_$$$("tts-pitch-reset")?.addEventListener("click",(()=>{fcn_updatePitch(1)})),_$$("#tts-rate-range, #tts-rate-text").forEach((t=>{t.addEventListener("input",(t=>{fcn_updateRate(t.target.value)}))})),_$$$("tts-rate-reset")?.addEventListener("click",(()=>{fcn_updateRate(1)})),window.addEventListener("beforeunload",(()=>{fcn_synth.cancel()})));var fcn_storyCommentPage=1,fcn_storySettings=fcn_getStorySettings();function fcn_cleanUpActions(){_$$(".story__actions > *").forEach((t=>{const e=window.getComputedStyle(t);"none"!==e.display&&"hidden"!==e.visibility||t.remove()}))}function fcn_getStorySettings(){let t=fcn_parseJSON(localStorage.getItem("fcnStorySettings"))??fcn_defaultStorySettings();return t.timestamp<1674770712849&&(t=fcn_defaultStorySettings(),t.timestamp=Date.now()),fcn_setStorySettings(t),t}function fcn_defaultStorySettings(){return{view:"list",order:"asc",timestamp:1674770712849}}function fcn_setStorySettings(t){"object"==typeof t&&(fcn_storySettings=t,localStorage.setItem("fcnStorySettings",JSON.stringify(t)))}function fcn_applyStorySettings(){"object"==typeof fcn_storySettings&&(_$$("[data-view]").forEach((t=>{t.dataset.view="grid"==fcn_storySettings.view?"grid":"list"})),_$$("[data-order]").forEach((t=>{t.dataset.order="desc"==fcn_storySettings.order?"desc":"asc"})))}fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_cleanUpActions()})):document.addEventListener("DOMContentLoaded",(()=>{fcn_cleanUpActions()})),fcn_applyStorySettings();var fcn_isToggling=!1;function fcn_toggleStoryTab(t){const e=t.closest(".story");e.querySelectorAll(".story__tab-target._current, .story__tabs ._current").forEach((t=>{t.classList.remove("_current")})),e.querySelectorAll(`[data-finder="${t.dataset.target}"]`).forEach((t=>{t.classList.add("_current")})),e.querySelector(".story__tabs").dataset.current=t.dataset.target,t.classList.add("_current")}function fcn_loadStoryComments(t){let e;_$(".load-more-list-item").remove(),_$(".comments-loading-placeholder").classList.remove("hidden"),fcn_ajaxGet({post_id:t.dataset.storyId??fcn_inlineStorage.postId,page:fcn_storyCommentPage},"get_story_comments").then((t=>{t.success?(_$(".fictioneer-comments__list > ul").innerHTML+=t.data.html,fcn_storyCommentPage++):t.data?.error&&(e=fcn_buildErrorNotice(t.data.error))})).catch((t=>{e=fcn_buildErrorNotice(t)})).then((()=>{_$(".comments-loading-placeholder").remove(),e&&_$(".fictioneer-comments__list > ul").appendChild(e)}))}function fcn_startEpubDownload(t,e=0){e>3?t.classList.remove("ajax-in-progress"):fcn_ajaxGet({action:"fictioneer_ajax_download_epub",story_id:t.dataset.storyId}).then((n=>{n.success?(window.location.href=t.href,setTimeout((()=>{t.classList.remove("ajax-in-progress")}),2e3)):setTimeout((()=>{fcn_startEpubDownload(t,e+1)}),2e3)})).catch((e=>{t.classList.remove("ajax-in-progress"),e.status&&e.statusText&&fcn_showNotification(`${e.status}: ${e.statusText}`,5,"warning")}))}function fcn_replaceProfileImage(t,e){const n=t.querySelector(".user-icon");if(n){const a=document.createElement("img");a.classList.add("user-profile-image"),a.src=e,n.remove(),t.appendChild(a)}}function fcn_setProfileImage(t,e=!0){t&&fcn_isValidUrl(t)&&(e&&localStorage.setItem("fcnProfileAvatar",t),_$$("a.subscriber-profile")?.forEach((e=>{fcn_replaceProfileImage(e,t)})),!1===fcn_getUserData().loggedIn&&fcn_prepareLogin())}function fcn_getProfileImage(){let t=localStorage.getItem("fcnProfileAvatar");fcn_isLoggedIn?(fcn_isValidUrl(t)||(t=!1),t?fcn_setProfileImage(t):fcn_getUserAvatar()):localStorage.removeItem("fcnProfileAvatar")}function fcn_getUserAvatar(){fcn_ajaxGet({action:"fictioneer_ajax_get_avatar",fcn_fast_ajax:1}).then((t=>{t.success&&fcn_setProfileImage(t.data.url)})).catch((()=>{fcn_theRoot.dataset.defaultAvatar&&fcn_setProfileImage(fcn_theRoot.dataset.defaultAvatar,!1)}))}function fcn_getUserData(){return fcn_parseJSON(localStorage.getItem("fcnUserData"))??{lastLoaded:0,timestamp:0,loggedIn:"pending",follows:!1,reminders:!1,checkmarks:!1,bookmarks:{},fingerprint:!1}}function fcn_setUserData(t){localStorage.setItem("fcnUserData",JSON.stringify(t))}function fcn_fetchUserData(){let t=fcn_getUserData();if(fcn_isLoggedIn&&!1===t.loggedIn&&(fcn_prepareLogin(),t=fcn_getUserData()),fcn_ajaxLimitThreshold{if(t.success){let e=fcn_getUserData();e=t.data,e.lastLoaded=Date.now(),fcn_setUserData(e);const n=new CustomEvent("fcnUserDataReady",{detail:{data:t.data,time:new Date},bubbles:!0,cancelable:!1});document.dispatchEvent(n)}else{const e=fcn_getUserData();e.lastLoaded=Date.now(),e.loggedIn=!1,fcn_setUserData(e);const n=new CustomEvent("fcnUserDataFailed",{detail:{response:t,time:new Date},bubbles:!0,cancelable:!1}) +;document.dispatchEvent(n)}})).catch((t=>{localStorage.removeItem("fcnUserData");const e=new CustomEvent("fcnUserDataError",{detail:{error:t,time:new Date},bubbles:!0,cancelable:!1});document.dispatchEvent(e)}))}function fcn_unsetOauth(t){const e=prompt(t.dataset.warning);if(!e||e.toLowerCase()!=t.dataset.confirm.toLowerCase())return;const n=_$$$(`oauth-${t.dataset.channel}`);n.classList.add("ajax-in-progress"),fcn_ajaxPost(payload={action:"fictioneer_ajax_unset_my_oauth",nonce:t.dataset.nonce,channel:t.dataset.channel,id:t.dataset.id}).then((t=>{t.success?(n.classList.remove("_connected"),n.classList.add("_disconnected"),n.querySelector("button").remove(),fcn_showNotification(n.dataset.unset)):(n.style.background="var(--notice-warning-background)",fcn_showNotification(t.data.error,5,"warning"))})).catch((t=>{t.status&&t.statusText&&(n.style.background="var(--notice-warning-background)",fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"))})).then((()=>{n.classList.remove("ajax-in-progress")}))}function fcn_deleteMyAccount(t){if(_$$$("button-delete-my-account").hasAttribute("disabled"))return;const e=prompt(t.dataset.warning);e&&e.toLowerCase()==t.dataset.confirm.toLowerCase()&&(_$$$("button-delete-my-account").setAttribute("disabled",!0),fcn_ajaxPost({action:"fictioneer_ajax_delete_my_account",nonce:t.dataset.nonce,id:t.dataset.id}).then((t=>{t.success?(localStorage.removeItem("fcnAuth"),localStorage.removeItem("fcnProfileAvatar"),location.reload()):(fcn_showNotification(t.data.error,5,"warning"),_$$$("button-delete-my-account").innerHTML=t.data.button)})).catch((t=>{t.status&&t.statusText&&(fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),_$$$("button-delete-my-account").innerHTML=response.data.button)})))}_$$('[data-click-action*="toggle-chapter-order"]').forEach((t=>{t.addEventListener("click",(t=>{fcn_isToggling||(fcn_isToggling=!0,setTimeout((()=>fcn_isToggling=!1),50),fcn_storySettings.order="asc"===t.currentTarget.dataset.order?"desc":"asc",fcn_setStorySettings(fcn_storySettings),fcn_applyStorySettings())}))})),_$$('[data-click-action*="toggle-chapter-view"]').forEach((t=>{t.addEventListener("click",(t=>{fcn_isToggling||(fcn_isToggling=!0,setTimeout((()=>fcn_isToggling=!1),50),fcn_storySettings.view="list"===t.currentTarget.dataset.view?"grid":"list",fcn_setStorySettings(fcn_storySettings),fcn_applyStorySettings())}))})),_$$(".chapter-group__folding-toggle").forEach((t=>{t.addEventListener("click",(t=>{const e=t.currentTarget.closest(".chapter-group[data-folded]");e&&(e.dataset.folded="true"==e.dataset.folded?"false":"true")}))})),_$$(".tabs__item").forEach((t=>{t.addEventListener("click",(t=>{fcn_toggleStoryTab(t.currentTarget)}))})),_$(".comment-section")?.addEventListener("click",(t=>{t.target?.classList.contains("load-more-comments-button")&&fcn_loadStoryComments(t.target)})),_$$('[data-action="download-epub"]').forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),t.currentTarget.classList.contains("ajax-in-progress")||(t.currentTarget.classList.add("ajax-in-progress"),fcn_startEpubDownload(t.currentTarget))}))})),document.addEventListener("DOMContentLoaded",(()=>{fcn_isLoggedIn&&!fcn_theRoot.dataset.ajaxAuth&&fcn_getProfileImage()})),fcn_theRoot.dataset.ajaxAuth&&document.addEventListener("fcnAuthReady",(()=>{fcn_getProfileImage()})),fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_fetchUserData()})):document.addEventListener("DOMContentLoaded",(()=>{fcn_isLoggedIn&&fcn_fetchUserData()})),_$$(".button-unset-oauth").forEach((t=>{t.addEventListener("click",(t=>{fcn_unsetOauth(t.currentTarget)}))})),_$$$("button-delete-my-account")?.addEventListener("click",(t=>{fcn_deleteMyAccount(t.currentTarget)}));const fcn_profileDataTranslations=_$$$("profile-data-translations")?.dataset;function fcn_dataDeletionPrompt(t){const e=prompt(t.dataset.warning);return!(!e||e.toLowerCase()!=t.dataset.confirm.toLowerCase())}function fcn_clearData(t,e){const n=t.closest(".card");localStorage.removeItem("fcnBookshelfContent"),n.classList.add("ajax-in-progress"),t.remove(),fcn_ajaxPost({action:e,fcn_fast_ajax:1,nonce:t.dataset.nonce}).then((t=>{t.success?n.querySelector(".card__content").innerHTML=t.data.success:fcn_showNotification(t.data.error,10,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,10,"warning")})).then((()=>{n.classList.remove("ajax-in-progress")}))}_$(".button-clear-comments")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comments")})),_$(".button-clear-comment-subscriptions")?.addEventListener("click",(t=>{fcn_dataDeletionPrompt(t.currentTarget)&&fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_comment_subscriptions")})),_$(".button-clear-checkmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.checkmarks={data:{},updated:Date.now()},fcn_setUserData(e),fcn_updateCheckmarksView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_checkmarks",!0)})),_$(".button-clear-reminders")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.reminders={data:{}},fcn_setUserData(e),fcn_updateRemindersView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_reminders",!0)})),_$(".button-clear-follows")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.follows={data:{}},fcn_setUserData(e),fcn_updateFollowsView(),fcn_clearData(t.currentTarget,"fictioneer_ajax_clear_my_follows",!0)})),_$(".button-clear-bookmarks")?.addEventListener("click",(t=>{if(!fcn_dataDeletionPrompt(t.currentTarget))return;const e=fcn_getUserData();e.bookmarks="{}",fcn_setUserData(e),fcn_bookmarks.data={},t.currentTarget.closest(".card").querySelector(".card__content").innerHTML=fcn_profileDataTranslations.clearedSuccess,fcn_setBookmarks(fcn_bookmarks)}));const fcn_jumpToBookmarkButtons=_$$(".button--bookmark"),fcn_mobileBookmarkJump=_$$$("mobile-menu-bookmark-jump"),fcn_mobileBookmarkList=_$(".mobile-menu__bookmark-list"),fcn_bookmarksSmallCardBlock=_$(".bookmarks-block"),fcn_bookmarksSmallCardTemplate=_$(".bookmark-small-card-template");var fcn_bookmarks,fcn_userBookmarksTimeout;function fcn_initializeLocalBookmarks(){fcn_setBookmarks(fcn_bookmarks=fcn_getBookmarks(),!0),fcn_updateBookmarksView()}function fcn_initializeUserBookmarks(t){fcn_setBookmarks(JSON.parse(t.detail.data.bookmarks),!0),fcn_updateBookmarksView()}function fcn_getBookmarks(){let t=fcn_parseJSON(localStorage.getItem("fcnChapterBookmarks"))??{data:{}};return Array.isArray(t.data)&&0===t.data.length&&(t.data={}),t=fcn_fixBookmarks(t),!t||Object.keys(t).length<1?{data:{}}:t}function fcn_fixBookmarks(t){const e={};for(const n in t.data)if(n.startsWith("ch-")){const a=fcn_fixBookmarksNode(t.data[n]);a&&(e[n]=a)}return{data:e}}function fcn_fixBookmarksNode(t){const e={},n={"paragraph-id":"",progress:0,date:"",color:"",chapter:"",link:"",thumb:"",image:"",story:"",content:""};for(const a in n){if(typeof t[a]!=typeof n[a])return null;e[a]=t[a]}const a=new Date(e.date);return a&&"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a)||(e.date=(new Date).toISOString()),("number"!=typeof e.progress||e.progress<0)&&(e.progress=0),e}function fcn_setBookmarks(t,e=!1){if("object"==typeof t){if(fcn_bookmarks=t,localStorage.setItem("fcnChapterBookmarks",JSON.stringify(t)),fcn_isLoggedIn){const e=fcn_getUserData();e&&(e.bookmarks=JSON.stringify(t),fcn_setUserData(e))}e||fcn_saveUserBookmarks(t)}}function fcn_updateBookmarksView(){if(!fcn_bookmarks||!fcn_bookmarks.data)return;const t=_$(".profile-bookmarks-stats"),e=Object.keys(fcn_bookmarks.data).length;t&&(t.innerHTML=t.innerHTML.replace("%s",e)),e>0&&_$$(".icon-menu-bookmarks").forEach((t=>{t.classList.remove("hidden")})),fcn_showBookmarkCards(),fcn_showChapterBookmark()}function fcn_saveUserBookmarks(t){fcn_isLoggedIn&&(clearTimeout(fcn_userBookmarksTimeout),t=fcn_fixBookmarks(t),fcn_userBookmarksTimeout=setTimeout((()=>{fcn_ajaxPost({action:"fictioneer_ajax_save_bookmarks",fcn_fast_ajax:1,bookmarks:JSON.stringify(t)}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,3,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,3,"warning")}))}),fictioneer_ajax.post_debounce_rate))}function fcn_toggleBookmark(t,e="none"){fcn_bookmarks=fcn_getBookmarks();const n=_$(".chapter__article"),a=_$(".current-bookmark");if(!n)return;const o=fcn_bookmarks.data[n.id];if(o&&o["paragraph-id"]==t&&a)"none"!=e&&e!=o.color?(_$(".current-bookmark").dataset.bookmarkColor=e,o.color=e):fcn_removeBookmark(n.id);else{Object.keys(fcn_bookmarks.data).length>=50&&fcn_removeBookmark(Object.keys(fcn_bookmarks.data)[0]);const o=_$(`[data-paragraph-id="${t}"]`),c=_$$$("chapter-bookmark-data").dataset;fcn_bookmarks.data[n.id]={"paragraph-id":t,progress:100*(fcn_offset(o).top-fcn_offset(o.parentElement).top)/o.parentElement.clientHeight,date:(new Date).toISOString(),color:e,chapter:c.title.trim(),link:c.link,thumb:c.thumb,image:c.image,story:c.storyTitle.trim(),content:o.querySelector("span").innerHTML.substring(0,128)+"…"},fcn_jumpToBookmarkButtons.forEach((t=>{t.classList.remove("hidden")})),fcn_mobileBookmarkJump?.removeAttribute("hidden"),a?.classList.remove("current-bookmark"),o.classList.add("current-bookmark"),o.setAttribute("data-bookmark-color",e)}fcn_setMobileMenuBookmarks(),fcn_setBookmarks(fcn_bookmarks)}function fcn_showChapterBookmark(){_$(".current-bookmark")?.classList.remove("current-bookmark");const t=_$(".chapter__article");if(!t||!fcn_bookmarks.data[t.id])return;const e=fcn_bookmarks.data[t.id]["paragraph-id"],n=_$(`[data-paragraph-id="${e}"]`),a=fcn_bookmarks.data[t.id].color??"none";e&&n&&(fcn_jumpToBookmarkButtons.forEach((t=>{t.classList.remove("hidden")})),fcn_mobileBookmarkJump?.removeAttribute("hidden"),n.classList.add("current-bookmark"),n.setAttribute("data-bookmark-color",a))}function fcn_setMobileMenuBookmarks(){fcn_mobileBookmarkList.innerHTML="";const t=Object.entries(fcn_bookmarks.data),e=_$("#mobile-bookmark-template");if(t.length>0){const n=document.createDocumentFragment();t.forEach((([t,{color:a,progress:o,link:c,chapter:s,"paragraph-id":i}])=>{const r=e.content.cloneNode(!0),l=r.querySelector(".mobile-menu__bookmark");l.classList.add(`bookmark-${t}`),l.dataset.color=a,r.querySelector(".mobile-menu__bookmark-progress > div > div").style.width=`${o.toFixed(1)}%`,r.querySelector(".mobile-menu__bookmark a").href=`${c}#paragraph-${i}`,r.querySelector(".mobile-menu__bookmark a span").innerText=s,r.querySelector(".mobile-menu-bookmark-delete-button").setAttribute("data-bookmark-id",t),n.appendChild(r)})),fcn_mobileBookmarkList.appendChild(n),fcn_bookmarkDeleteHandler(_$$(".mobile-menu-bookmark-delete-button"))}else{const t=document.createElement("li");t.classList.add("no-bookmarks"),t.textContent=fcn_mobileBookmarkList.dataset.empty,fcn_mobileBookmarkList.appendChild(t)}}function fcn_showBookmarkCards(){if(!fcn_bookmarks||!fcn_bookmarksSmallCardBlock||!fcn_bookmarksSmallCardTemplate||Object.keys(fcn_bookmarks.data).length<1||_$(".bookmark-card"))return;fcn_bookmarksSmallCardBlock.classList.remove("hidden"),_$(".bookmarks-block__no-bookmarks")?.remove(),_$$(".show-if-bookmarks").forEach((t=>t.classList.remove("hidden")));let t=parseInt(fcn_bookmarksSmallCardBlock.dataset.count);const e=document.createDocumentFragment();Object.entries(fcn_bookmarks.data).sort(((t,e)=>new Date(e[1].date)-new Date(t[1].date))).forEach((([n,{color:a,progress:o,link:c,chapter:s,"paragraph-id":i,date:r,image:l,thumb:f,content:d}])=>{if(0==t)return;t--;const _=fcn_bookmarksSmallCardTemplate.content.cloneNode(!0),u=new Date(r).toLocaleDateString(navigator.language??"en-US",{year:"2-digit",month:"short",day:"numeric"});l&&_.querySelector(".bookmark-card__image")?(_.querySelector(".bookmark-card__image").href=l,_.querySelector(".bookmark-card__image img").src=f):_.querySelector(".bookmark-card__image")?.remove(),_.querySelector(".bookmark-card__excerpt").innerHTML+=d,_.querySelector(".bookmark-card").classList.add(`bookmark-${n}`),_.querySelector(".bookmark-card").dataset.color=a,_.querySelector(".bookmark-card__title > a").href=`${c}#paragraph-${i}`,_.querySelector(".bookmark-card__title > a").innerText=s,_.querySelector(".bookmark-card__percentage").innerText=`${o.toFixed(1)} %`,_.querySelector(".bookmark-card__progress").style.width=`calc(${o.toFixed(1)}% - var(--bookmark-progress-offset, 0px))`,_.querySelector("time").innerText=u,_.querySelector(".button-delete-bookmark").setAttribute("data-bookmark-id",n),e.appendChild(_)})),fcn_bookmarksSmallCardBlock.querySelector("ul").appendChild(e),fcn_bookmarkDeleteHandler(_$$(".button-delete-bookmark"))}function fcn_bookmarkDeleteHandler(t){("object"==typeof t?t:[t]).forEach((t=>{t.addEventListener("click",(t=>{fcn_removeBookmark(t.currentTarget.dataset.bookmarkId),fcn_setBookmarks(fcn_bookmarks),Object.keys(fcn_bookmarks.data).length<1&&(_$(".bookmarks-block")?.classList.add("hidden"),_$$(".show-if-bookmarks").forEach((t=>{t.classList.add("hidden")})))}))}))}function fcn_removeBookmark(t){const e=_$(".chapter__article"),n=_$(".current-bookmark");delete fcn_bookmarks.data[t],e&&e.id==t&&(fcn_jumpToBookmarkButtons.forEach((t=>{t.classList.add("hidden")})),fcn_mobileBookmarkJump?.setAttribute("hidden",!0),n&&(n.classList.remove("current-bookmark"),n.removeAttribute("data-bookmark-color"))),_$$(`.bookmark-${t}`)?.forEach((t=>{t.remove()}))}fcn_initializeLocalBookmarks(),document.addEventListener("fcnUserDataReady",(t=>{fcn_initializeUserBookmarks(t)})),fcn_jumpToBookmarkButtons.forEach((t=>{t.addEventListener("click",(()=>{_$(`[data-paragraph-id="${fcn_bookmarks.data[_$("article").id]["paragraph-id"]}"]`).scrollIntoView({behavior:"smooth"})}))}));const fcn_followsMenuItem=_$$$("follow-menu-button");var fcn_userFollowsTimeout,fcn_follows,fcn_checkmarks,fcn_userCheckmarksTimeout,fcn_userRemindersTimeout,fcn_reminders;function fcn_initializeFollows(t){const e=t.detail.data.follows;!1!==e&&(Array.isArray(e.data)&&0===e.data.length&&(e.data={}),fcn_follows=e,fcn_updateFollowsView(),localStorage.removeItem("fcnBookshelfContent"))}function fcn_toggleFollow(t){const e=fcn_getUserData();if(fcn_follows&&e.follows){if(localStorage.removeItem("fcnBookshelfContent"),JSON.stringify(fcn_follows.data[t])!==JSON.stringify(e.follows.data[t]))return fcn_follows=e.follows,fcn_showNotification(fictioneer_tl.notification.followsResynchronized),void fcn_updateFollowsView();fcn_follows.data[t]?delete fcn_follows.data[t]:fcn_follows.data[t]={story_id:parseInt(t),timestamp:Date.now()},e.follows.data[t]=fcn_follows.data[t],e.lastLoaded=0,fcn_setUserData(e),fcn_updateFollowsView(),clearTimeout(fcn_userFollowsTimeout),fcn_userFollowsTimeout=setTimeout((()=>{fcn_ajaxPost({action:"fictioneer_ajax_toggle_follow",fcn_fast_ajax:1,story_id:t,set:!!fcn_follows.data[t]}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{429===t.status?fcn_showNotification(fictioneer_tl.notification.slowDown,3,"warning"):t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}),fictioneer_ajax.post_debounce_rate)}}function fcn_updateFollowsView(){const t=fcn_getUserData();if(!fcn_follows||!t.follows)return;_$$(".button-follow-story").forEach((t=>{t.classList.toggle("_followed",!!fcn_follows?.data[t.dataset.storyId])})),_$$(".card").forEach((t=>{t.classList.toggle("has-follow",!!fcn_follows?.data[t.dataset.storyId])}));const e=parseInt(fcn_follows.new)>0;_$$(".mark-follows-read, .follows-alert-number, .mobile-menu-button").forEach((t=>{t.classList.toggle("_new",e),e>0&&(t.dataset.newCount=fcn_follows.new)}))}function fcn_setupFollowsHTML(){fcn_followsMenuItem.classList.contains("_loaded")||fcn_ajaxGet({action:"fictioneer_ajax_get_follows_notifications",fcn_fast_ajax:1}).then((t=>{if(t.data.html){const e=_$$$("follow-menu-scroll");e&&(e.innerHTML=t.data.html);const n=_$$$("mobile-menu-follows-list");n&&(n.innerHTML=t.data.html),!1===fcn_getUserData().loggedIn&&(fcn_prepareLogin(),fcn_fetchUserData())}})).catch((t=>{429===t.status?fcn_showNotification(fictioneer_tl.notification.slowDown,3,"warning"):t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"),_$$$("follow-menu-scroll")?.remove(),_$$$("mobile-menu-follows-list")?.remove()})).then((()=>{fcn_followsMenuItem.classList.add("_loaded")}))}function fcn_markFollowsRead(){if(!fcn_followsMenuItem.classList.contains("_new")||!fcn_followsMenuItem.classList.contains("_loaded"))return;_$$(".mark-follows-read, .follows-alert-number, .follow-item, .mobile-menu-button").forEach((t=>{t.classList.remove("_new")}));const t=fcn_getUserData();t.new=0,t.lastLoaded=0,fcn_setUserData(t),fcn_ajaxPost({action:"fictioneer_ajax_mark_follows_read",fcn_fast_ajax:1}).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}function fcn_initializeCheckmarks(t){const e=t.detail.data.checkmarks;!1!==e&&(Array.isArray(e.data)&&0===e.data.length&&(e.data={}),fcn_checkmarks=e,fcn_updateCheckmarksView(),localStorage.removeItem("fcnBookshelfContent"),_$$("button.checkmark").forEach((t=>{t.addEventListener("click",(t=>{fcn_clickCheckmark(t.currentTarget)}))})))}function fcn_toggleCheckmark(t,e,n=null,a=null,o="toggle"){const c=fcn_getUserData();if(fcn_checkmarks&&c.checkmarks){if(localStorage.removeItem("fcnBookshelfContent"),"toggle"===o&&JSON.stringify(fcn_checkmarks.data[t])!==JSON.stringify(c.checkmarks.data[t]))return fcn_checkmarks=c.checkmarks,fcn_showNotification(fictioneer_tl.notification.checkmarksResynchronized),void fcn_updateCheckmarksView();if(fcn_checkmarks.data[t]||(fcn_checkmarks.data[t]=[]),c.checkmarks.data[t]||(c.checkmarks.data[t]=[]),n&&"progress"===e&&!fcn_checkmarks.data[t].includes(n)&&fcn_checkmarks.data[t].push(n),n&&"chapter"===e)if(!fcn_checkmarks.data[t].includes(n)&&"unset"!==o||"set"===o)fcn_checkmarks.data[t].push(n),a&&(a.classList.add("marked"),a.setAttribute("aria-checked",!0));else{fcn_removeItemOnce(fcn_checkmarks.data[t],n),a&&(a.classList.remove("marked"),a.setAttribute("aria-checked",!1)),fcn_removeItemOnce(fcn_checkmarks.data[t],t);const e=_$('button[data-type="story"]');e&&(e.classList.remove("marked"),e.setAttribute("aria-checked",!1))}if("story"===e){const e=(fcn_checkmarks.data[t].includes(t)||"unset"===o)&&"set"!==o;fcn_checkmarks.data[t]=[],e||(_$$("button.checkmark").forEach((e=>{fcn_checkmarks.data[t].push(parseInt(e.dataset.id))})),fcn_checkmarks.data[t].includes(t)||fcn_checkmarks.data[t].push(t))}fcn_checkmarks.data[t]=fcn_checkmarks.data[t].filter(((t,e,n)=>n.indexOf(t)==e)),c.checkmarks.data[t]=fcn_checkmarks.data[t],c.lastLoaded=0,fcn_setUserData(c),fcn_updateCheckmarksView(),clearTimeout(fcn_userCheckmarksTimeout),fcn_userCheckmarksTimeout=setTimeout((()=>{fcn_updateCheckmarks(t,fcn_checkmarks.data[t])}),fictioneer_ajax.post_debounce_rate)}}function fcn_clickCheckmark(t){fcn_toggleCheckmark(parseInt(t.dataset.storyId),t.dataset.type,parseInt(t.dataset.id),t)}function fcn_updateCheckmarks(t,e=null){fcn_ajaxPost({action:"fictioneer_ajax_set_checkmark",fcn_fast_ajax:1,story_id:t,update:(e=e||fcn_getUserData().checkmarks.data[t]).join(" ")}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,3,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}function fcn_updateCheckmarksView(){const t=fcn_getUserData(),e=t.checkmarks;if(!e)return;const n=parseInt(fcn_inlineStorage.storyId);if(n){const a=e.data[n]&&e.data[n].includes(n);if(a){let a=!1;_$$("button.checkmark").forEach((t=>{const o=parseInt(t.dataset.id);e.data[n].includes(o)||(e.data[n].push(o),a=!0)})),a&&(t.checkmarks=e,fcn_setUserData(t),fcn_updateCheckmarks(n,e.data[n]))}_$$$("ribbon-read")?.classList.toggle("hidden",!a)}_$$("button.checkmark").forEach((t=>{const n=parseInt(t.dataset.storyId);if(e.data[n]){const a=e.data[n].includes(parseInt(t.dataset.id));t.classList.toggle("marked",a),t.setAttribute("aria-checked",a)}})),_$$(".card").forEach((t=>{const n=parseInt(t.dataset.storyId),a=e.data[n]&&(e.data[n].includes(parseInt(t.dataset.checkId))||e.data[n].includes(n));t.classList.toggle("has-checkmark",1==a)}))}function fcn_initializeReminders(t){const e=t.detail.data.reminders;!1!==e&&(Array.isArray(e.data)&&0===e.data.length&&(e.data={}),fcn_reminders=e,fcn_updateRemindersView(),localStorage.removeItem("fcnBookshelfContent"))}function fcn_toggleReminder(t){const e=fcn_getUserData();if(fcn_reminders&&e.reminders){if(localStorage.removeItem("fcnBookshelfContent"),JSON.stringify(fcn_reminders.data[t])!==JSON.stringify(e.reminders.data[t]))return fcn_reminders=e.reminders,fcn_showNotification(fictioneer_tl.notification.remindersResynchronized),void fcn_updateRemindersView();fcn_reminders.data[t]?delete fcn_reminders.data[t]:fcn_reminders.data[t]={story_id:parseInt(t),timestamp:Date.now()},e.reminders.data[t]=fcn_reminders.data[t],e.lastLoaded=0,fcn_setUserData(e),fcn_updateRemindersView(),clearTimeout(fcn_userRemindersTimeout),fcn_userRemindersTimeout=setTimeout((()=>{fcn_ajaxPost({action:"fictioneer_ajax_toggle_reminder",fcn_fast_ajax:1,story_id:t,set:!!fcn_reminders.data[t]}).then((t=>{t.data.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{429===t.status?fcn_showNotification(fictioneer_tl.notification.slowDown,3,"warning"):t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")}))}),fictioneer_ajax.post_debounce_rate)}}function fcn_updateRemindersView(){const t=fcn_getUserData();fcn_reminders&&t.reminders&&(_$$(".button-read-later").forEach((t=>{t.classList.toggle("_remembered",!!fcn_reminders.data[t.dataset.storyId])})),_$$(".card").forEach((t=>{t.classList.toggle("has-reminder",!!fcn_reminders.data[t.dataset.storyId])})))}function fcn_addJSTrap(){const t=document.querySelector(".comment-form");t&&t.appendChild(fcn_html` `)}function fcn_moderateComment(t,e){const n=_$$$(`comment-${t}`),a=n.querySelector(".mod-menu-toggle-icon");n.classList.contains("ajax-in-progress")||(n.classList.add("ajax-in-progress"),"trash"!=e&&"spam"!=e||(n.style.height=n.clientHeight+"px"),fcn_ajaxPost({action:"fictioneer_ajax_moderate_comment",operation:e,id:t,fcn_fast_comment_ajax:1}).then((t=>{if(t.success)switch(t.data.operation){case"sticky":n.classList.add("_sticky");break;case"unsticky":n.classList.remove("_sticky");break;case"approve":n.classList.remove("_unapproved");break;case"unapprove":n.classList.add("_unapproved");break;case"open":n.classList.remove("_closed");break;case"close":n.classList.add("_closed");break;case"trash":case"spam":n.style.cssText="overflow: hidden; height: 0; margin: 0; opacity: 0;"}else a.classList="fa-solid fa-triangle-exclamation mod-menu-toggle-icon",a.style.color="var(--notice-warning-background)",n.querySelector(".popup-menu-toggle").style.opacity="1",t.data.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{a.classList="fa-solid fa-triangle-exclamation mod-menu-toggle-icon",a.style.color="var(--notice-warning-background)",n.querySelector(".popup-menu-toggle").style.opacity="1",t.status&&t.statusText?fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning"):t&&fcn_showNotification(t,5,"warning")})).then((()=>{n.classList.remove("ajax-in-progress"),fcn_lastClicked?.classList.remove("last-clicked"),fcn_lastClicked=null})))}function fcn_addCommentMouseleaveEvents(){_$$(".fictioneer-comment__container").forEach((t=>{t.addEventListener("mouseleave",(t=>{fcn_lastClicked?.classList.remove("last-clicked"),fcn_lastClicked=null,t.stopPropagation()}))}))}function fcn_flagComment(t){if(!fcn_isLoggedIn)return;const e=t.closest(".fictioneer-comment"),n=e.querySelector(".fictioneer-report-comment-button");e.classList.contains("ajax-in-progress")||(e.classList.add("ajax-in-progress"),fcn_ajaxPost({action:"fictioneer_ajax_report_comment",id:e.dataset.id,dubious:n.classList.contains("_dubious"),fcn_fast_comment_ajax:1}).then((t=>{t.success?(n.classList.toggle("on",t.data.flagged),n.classList.remove("_dubious"),t.data.resync&&fcn_showNotification(t.data.resync)):t.data?.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")})).then((()=>{e.classList.remove("ajax-in-progress")})))}function fcn_revealCommentFormInputs(t){t.closest("form").querySelectorAll(".fictioneer-respond__form-actions, .fictioneer-respond__form-bottom").forEach((t=>{t.classList.remove("hidden")}))}function fcn_addCommentFormEvents(){_$(fictioneer_comments.form_selector??"#comment")?.addEventListener("focus",(t=>{fcn_revealCommentFormInputs(t.currentTarget)}),{once:!0})}function fcn_textareaAdjust(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function fcn_wrapInTag(t,e,n={}){const a=n.href?' href="'+n.href+'" target="_blank" rel="nofollow noreferrer noopener"':"",o=n.shortcode?["[","]"]:["<",">"],c=t.selectionStart,s=t.selectionEnd,i=o[0]+e+a+o[1],r=o[0]+"/"+e+o[1],l=i+t.value.substring(c,s)+r;t.value=t.value.substring(0,c)+l+t.value.substring(s,t.value.length),t.setSelectionRange(c+i.length,s+i.length),t.focus()}function fcn_bindAJAXCommentSubmit(){fcn_theRoot.dataset.ajaxSubmit&&_$$$("commentform")?.addEventListener("submit",(t=>{if(t.preventDefault(),Date.now()1,c.classList.toggle("_error",!u),r&&(h=r.checked,r.classList.toggle("_error",!h)),i&&i.value.length>0&&(_=/\S+@\S+\.\S+/.test(i.value),i.classList.toggle("_error",!_)),!u||!h||!_)return!1;e.classList.add("ajax-in-progress"),o.disabled=!0,o.value=o.dataset.disabled;const g={action:"fictioneer_ajax_submit_comment",content:c.value,depth:f?parseInt(f.dataset.depth)+1:1,fcn_fast_comment_ajax:1,...a};i?.value&&(g.email=i?.value),s?.value&&(g.author=s?.value),fcn_ajaxPost(g).then((t=>{if(_$$$("comment-submit-error-notice")?.remove(),t.success&&t.data?.comment){let e=_$(".commentlist"),n="insertBefore";if(e&&!f&&e.firstElementChild){let t=null;if(e.firstElementChild.classList.contains("_sticky"))for(t=e.firstElementChild,e=t,n="insertAfter";t.nextElementSibling&&t.nextElementSibling.classList.contains("_sticky");)t=e.nextElementSibling,e=t}if(e||(e=document.createElement("ol"),e.classList="fictioneer-comments__list commentlist",_$$$("comments").appendChild(e),n="append"),f&&(e=f.querySelector(".children"),n="append",!e)){const t=document.createElement("ol");f.appendChild(t),e=t}let a=document.createElement("div");switch(a.innerHTML=t.data.comment,a=a.firstChild,n){case"append":e.appendChild(a);break;case"insertBefore":e.insertBefore(a,e.firstChild);break;case"insertAfter":e.nextSibling?e.parentNode.insertBefore(a,e.nextSibling):e.parentNode.appendChild(a)}fcn_addCommentMouseleaveEvents(),"0"!=_$$$("comment_parent").value&&_$$$("cancel-comment-reply-link").click(),c.value="",c.style.height="";const o=window.location.protocol+"//"+window.location.host+window.location.pathname;let s="";t.data.commentcode&&(s+=`?commentcode=${t.data.commentcode}`),"desc"!=d&&(s+=s.length>1?`&corder=${d}`:`?corder=${d}`),history.pushState({path:o},"",o+s+`#comment-${t.data.comment_id}`),a.scrollIntoView({behavior:"smooth"})}else e.insertBefore(fcn_buildErrorNotice(t.data?.error??fictioneer_tl.notification.error,"comment-submit-error-notice",!1),e.firstChild)})).catch((t=>{_$$$("comment-submit-error-notice")?.remove(),e.insertBefore(fcn_buildErrorNotice(`${t.status}: ${t.statusText}`,"comment-submit-error-notice"),e.firstChild)})).then((()=>{e.classList.remove("ajax-in-progress"),o.disabled=!1,o.value=o.dataset.enabled}))}))}document.addEventListener("fcnUserDataReady",(t=>{fcn_initializeFollows(t)})),fcn_followsMenuItem?.addEventListener("mouseover",(()=>{fcn_setupFollowsHTML()}),{once:!0}),fcn_followsMenuItem?.addEventListener("focus",(()=>{fcn_setupFollowsHTML()}),{once:!0}),_$('.mobile-menu__frame-button[data-frame-target="follows"]')?.addEventListener("click",(()=>{fcn_setupFollowsHTML()}),{once:!0}),_$$(".button-follow-story").forEach((t=>{t.addEventListener("click",(t=>{fcn_toggleFollow(t.currentTarget.dataset.storyId)}))})),_$$(".mark-follows-read").forEach((t=>{t.addEventListener("click",(()=>{fcn_markFollowsRead()}))})),document.addEventListener("fcnUserDataReady",(t=>{fcn_initializeCheckmarks(t)})),document.addEventListener("fcnUserDataReady",(t=>{fcn_initializeReminders(t)})),_$$(".button-read-later").forEach((t=>{t.addEventListener("click",(t=>{fcn_toggleReminder(t.currentTarget.dataset.storyId)}))})),document.addEventListener("fcnUserDataReady",(()=>{fcn_getUserData().fingerprint==fcn_theRoot.dataset.authorFingerprint&&fcn_theBody.classList.add("is-post-author")})),fcn_addJSTrap(),fcn_addCommentMouseleaveEvents(),fcn_addCommentFormEvents(),_$(".comment-section")?.addEventListener("click",(t=>{const e=t.target.closest("[data-bbcode]");e&&fcn_wrapInTag(_$(fictioneer_comments.form_selector??"#comment"),e.dataset.bbcode,{shortcode:!0})})),_$(".comment-section")?.addEventListener("keydown",(t=>{if(_$(".fictioneer-comment-toolbar")&&"TEXTAREA"===document.activeElement.tagName&&(t.ctrlKey||t.metaKey)){const e=t.key.toLowerCase();if(["b","i","s","q","h","l"].includes(e)){t.preventDefault();const n={q:"quote",h:"spoiler",l:"link"};fcn_wrapInTag(document.activeElement,n[e]||e,{shortcode:!0})}}})),fcn_bindAJAXCommentSubmit();const fcn_commentEditActionsTemplate=_$(".comment-edit-actions-template");var fcn_commentEditUndos={};function fcn_triggerInlineCommentEdit(t){const e=t.closest(".fictioneer-comment");if(e){const t=e.querySelector(".fictioneer-comment__content"),n=e.querySelector(".fictioneer-comment__edit"),a=e.querySelector(".comment-inline-edit-content");n.appendChild(fcn_commentEditActionsTemplate.content.cloneNode(!0)),fcn_commentEditUndos[e.id]=a.value,e.classList.add("_editing"),t.hidden=!0,n.hidden=!1,a.style.height=`${a.scrollHeight}px`}}function fcn_submitInlineCommentEdit(t){const e=t.closest(".fictioneer-comment"),n=e.querySelector(".fictioneer-comment__edit"),a=e.querySelector(".comment-inline-edit-content").value;let o=e.querySelector(".fictioneer-comment__edit-note");a!=fcn_commentEditUndos[e.id]?e&&(n.classList.add("ajax-in-progress"),t.innerHTML=t.dataset.disabled,t.disabled=!0,fcn_ajaxPost({action:"fictioneer_ajax_edit_comment",comment_id:e.id.replace("comment-",""),content:a,fcn_fast_comment_ajax:1}).then((t=>{if(t.success){const n=e.querySelector(".fictioneer-comment__content");n.innerHTML=t.data.content,fcn_restoreComment(e,!1,t.data.raw),o||(o=document.createElement("div")),o.classList.add("fictioneer-comment__edit-note"),o.innerHTML=t.data.edited,n.parentNode.appendChild(o)}else fcn_restoreComment(e,!0),t.data?.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{fcn_restoreComment(e,!0),t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")})).then((()=>{n.classList.remove("ajax-in-progress"),t.innerHTML=t.dataset.enabled,t.disabled=!1}))):fcn_restoreComment(e,!0)}function fcn_cancelInlineCommentEdit(t){const e=t.closest(".fictioneer-comment");e&&fcn_restoreComment(e,!0)}function fcn_restoreComment(t,e=!1,n=null){t.querySelector(".fictioneer-comment__content").hidden=!1,t.querySelector(".fictioneer-comment__edit").hidden=!0,t.querySelector(".fictioneer-comment__edit-actions")?.remove(),t.classList.remove("_editing"),e&&fcn_commentEditUndos[t.id]?t.querySelector(".comment-inline-edit-content").value=fcn_commentEditUndos[t.id]:n&&(t.querySelector(".comment-inline-edit-content").value=n)}function fcn_revealEditButton(){let t=parseInt(fcn_theRoot.dataset.editTime);t&&(t=t>0?6e4*t:t,_$$(".fictioneer-comment[data-fingerprint]").forEach((e=>{if(fcn_matchFingerprint(e.dataset.fingerprint)){if(t>0&&parseInt(e.dataset.timestamp)+t{if(fcn_matchFingerprint(t.dataset.fingerprint)){const e=t.querySelector(".fictioneer-comment__delete");e&&(e.hidden=!1)}}))}function fcn_deleteMyComment(t){if(!fcn_isLoggedIn)return;const e=prompt(t.dataset.dialogMessage);if(!e||e.toLowerCase()!=t.dataset.dialogConfirm.toLowerCase())return;const n=t.closest(".fictioneer-comment");n.classList.contains("ajax-in-progress")||(n.classList.add("ajax-in-progress"),fcn_ajaxPost({action:"fictioneer_ajax_delete_my_comment",comment_id:n.dataset.id,fcn_fast_comment_ajax:1}).then((t=>{t.success?(n.classList.add("_deleted"),n.querySelector(".fictioneer-comment__container").innerHTML=t.data.html):t.data.error&&fcn_showNotification(t.data.error,5,"warning")})).catch((t=>{t.status&&t.statusText&&fcn_showNotification(`${t.status}: ${t.statusText}`,5,"warning")})).then((()=>{n.classList.remove("ajax-in-progress")})))}document.addEventListener("fcnUserDataReady",(()=>{fcn_revealEditButton()})),document.addEventListener("fcnUserDataReady",(()=>{fcn_revealDeleteButton()}));const fcn_ajaxCommentForm=_$$$("ajax-comment-form-target");function fcn_setupCommentFormObserver(){const t=new IntersectionObserver((([e])=>{e.isIntersecting&&(fcn_getCommentForm(),t.disconnect())}),{rootMargin:"450px",threshold:1});t.observe(fcn_ajaxCommentForm)}function fcn_getCommentForm(){let t;fcn_ajaxGet({action:"fictioneer_ajax_get_comment_form",post_id:_$$$("comments").dataset.postId,fcn_fast_comment_ajax:1}).then((e=>{if(e.success){const t=document.createElement("div");t.innerHTML=e.data.html;const n=t.querySelector("#comment_post_ID"),a=t.querySelector("#cancel-comment-reply-link"),o=t.querySelector(".logout-link");n&&(n.value=e.data.postId),a&&(a.href="#respond"),o&&(o.href=_$$$("comments").dataset.logoutUrl),fcn_ajaxCommentForm.innerHTML=t.innerHTML,t.remove(),fcn_applyCommentStack(),fcn_addCommentFormEvents(),fcn_theRoot.dataset.ajaxSubmit&&fcn_bindAJAXCommentSubmit(),fcn_addNonceHTML(e.data.nonceHtml),fcn_addJSTrap()}else t=fcn_buildErrorNotice(e.data.error)})).catch((e=>{t=fcn_buildErrorNotice(e)})).then((()=>{fcn_ajaxCommentForm.classList.remove("comments-skeleton"),t&&(fcn_ajaxCommentForm.innerHTML="",fcn_ajaxCommentForm.appendChild(t))}))}fcn_ajaxCommentForm&&(fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_setupCommentFormObserver()})):fcn_setupCommentFormObserver());var fcn_commentStack=[];function fcn_applyCommentStack(t=null){(t=t??_$(fictioneer_comments.form_selector??"#comment"))&&("TEXTAREA"==t.tagName?(fcn_commentStack.forEach((e=>{t.value+=e})),fcn_textareaAdjust(t)):"DIV"==t.tagName&&fcn_commentStack.forEach((e=>{t.innerHTML+=e})),fcn_commentStack=[])}_$(".fictioneer-comments")?.addEventListener("click",(t=>{const e=t.target.closest("[data-click]");if(e)switch(e?.dataset.click){case"submit-inline-comment-edit":fcn_submitInlineCommentEdit(e);break;case"cancel-inline-comment-edit":fcn_cancelInlineCommentEdit(e);break;case"trigger-inline-comment-edit":fcn_triggerInlineCommentEdit(e);break;case"delete-my-comment":fcn_deleteMyComment(e);break;case"flag-comment":fcn_flagComment(e);break;case"ajax-mod-action":fcn_moderateComment(e.dataset.id,e.dataset.action)}})),_$(".fictioneer-comments")?.addEventListener("input",(t=>{t.target.matches(".adaptive-textarea")&&fcn_textareaAdjust(t.target),t.target.closest('[name="fictioneer-private-comment-toggle"]')&&_$$$("respond")?.classList.toggle("_private",t.currentTarget.checked)}));const fcn_commentSection=_$("#comments[data-ajax-comments]");function fcn_getCommentSection(t=null,e=null,n=null,a=!1){if(!fcn_commentSection)return;let o,c="",s=_$(fictioneer_comments.form_selector??"#comment");if(s&&(c=s.value),fcn_commentSection.classList.contains("ajax-in-progress"))return;if(fcn_commentSection.classList.add("ajax-in-progress"),e||(e=fcn_urlParams.pg??1),n||(n=n??fcn_commentSection.dataset.order??"desc"),!fcn_commentSection)return;const i={action:"fictioneer_ajax_get_comment_section",post_id:t??fcn_commentSection.dataset.postId,page:parseInt(e),corder:n,fcn_fast_comment_ajax:1};fcn_urlParams.commentcode&&(i.commentcode=fcn_urlParams.commentcode),fcn_ajaxGet(i).then((t=>{if(t.success){e=t.data.page,fcn_commentSection.dataset.page=e;const o=document.createElement("div");if(o.innerHTML=t.data.html,o.querySelector("#comment_post_ID")){o.querySelector("#comment_post_ID").value=t.data.postId,o.querySelector("#cancel-comment-reply-link").href="#respond";const e=o.querySelector(".logout-link");e&&(e.href=fcn_commentSection.dataset.logoutUrl)}fcn_commentSection.innerHTML=o.innerHTML,o.remove(),s=_$(fictioneer_comments.form_selector??"#comment"),s&&!t.data.disabled&&(s.value=c,fcn_applyCommentStack(s)),fcn_addCommentMouseleaveEvents(),fcn_addCommentFormEvents(),fcn_bindAJAXCommentSubmit(),fcn_addJSTrap(),fcn_revealEditButton(),fcn_revealDeleteButton();const i=location.hash.includes("#comment")?location.hash:".respond",r=document.querySelector(i)??_$$$("respond");a&&r.scrollIntoView({behavior:"smooth"});const l=window.location.protocol+"//"+window.location.host+window.location.pathname;let f="";fcn_urlParams.commentcode&&(f+=`?commentcode=${fcn_urlParams.commentcode}`),e>1&&(f+=f.length>1?`&pg=${e}`:`?pg=${e}`),"desc"!=n&&(f+=f.length>1?`&corder=${n}`:`?corder=${n}`),window.history.pushState({path:l},"",l+f+location.hash)}else o=fcn_buildErrorNotice(t.data.error)})).catch((t=>{o=fcn_buildErrorNotice(t)})).then((()=>{fcn_commentSection.classList.remove("ajax-in-progress"),o&&(fcn_commentSection.innerHTML="",fcn_commentSection.appendChild(o))}))}function fcn_reloadCommentsPage(t=null){fcn_getCommentSection(null,t,null,!0)}function fcn_jumpToCommentPage(){const t=parseInt(window.prompt(fictioneer_tl.notification.enterPageNumber));t>0&&fcn_reloadCommentsPage(t)}var fct_commentSectionObserver;function fcn_setupCommentSectionObserver(){fct_commentSectionObserver=new IntersectionObserver((([t])=>{t.isIntersecting&&(fcn_getCommentSection(),fct_commentSectionObserver.disconnect())}),{rootMargin:"450px",threshold:1}),fcn_commentSection&&fct_commentSectionObserver.observe(fcn_commentSection)}function fcn_loadCommentEarly(){fcn_commentSection&&location.hash.includes("#comment")&&(_$(fictioneer_comments.form_selector??"#comment")||(fct_commentSectionObserver.disconnect(),fcn_reloadCommentsPage()))}function fcn_toggleCommentOrder(t){const e=t.closest(".fictioneer-comments"),n="desc"==e.dataset.order;e.dataset.order=n?"asc":"desc",t.classList.toggle("_on",!n),t.classList.toggle("_off",n),fcn_reloadCommentsPage(e.dataset.page)}fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_setupCommentSectionObserver()})):fcn_setupCommentSectionObserver(),fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_loadCommentEarly()})):fcn_loadCommentEarly(),_$(".fictioneer-comments")?.addEventListener("click",(t=>{if(t.target.closest("button[data-page-jump]"))return void fcn_jumpToCommentPage();const e=t.target.closest("button[data-page]");if(e)return void fcn_reloadCommentsPage(e.dataset.page);const n=t.target.closest("button[data-toggle-order]");n&&fcn_toggleCommentOrder(n)}));const fcn_bookshelfTarget=_$$$("ajax-bookshelf-target");function fcn_getBookshelfContent(){return fcn_parseJSON(localStorage.getItem("fcnBookshelfContent"))??{html:{},count:{}}}function fcn_updateBookshelfView(t=null,e=null,n=null,a=!1){let o=fcn_getBookshelfContent();const c=(t=t??fcn_bookshelfTarget.dataset.action)+(e=e??fcn_bookshelfTarget.dataset.page)+(n=n??fcn_bookshelfTarget.dataset.order);if(!o.timestamp||o.timestamp+6e4{n.success?(c.timestamp=Date.now(),c.html[o]=n.data.html,c.count[t]=n.data.count,localStorage.setItem("fcnBookshelfContent",JSON.stringify(c)),fcn_bookshelfTarget.innerHTML=n.data.html,fcn_bookshelfTarget.dataset.page=e,_$(".item-number").innerHTML=`(${n.data.count})`):(fcn_bookshelfTarget.innerHTML="",fcn_bookshelfTarget.appendChild(fcn_buildErrorNotice(n.data.error)))})).catch((t=>{_$(".item-number").innerHTML="",fcn_bookshelfTarget.innerHTML="",fcn_bookshelfTarget.appendChild(fcn_buildErrorNotice(`${t.status}: ${t.statusText}`))})).then((()=>{fcn_bookshelfTarget.classList.remove("ajax-in-progress"),a&&_$$$("main").scrollIntoView({behavior:"smooth"})}))}fcn_bookshelfTarget&&(fcn_theRoot.dataset.ajaxAuth?document.addEventListener("fcnAuthReady",(()=>{fcn_updateBookshelfView()})):fcn_updateBookshelfView()),_$(".bookshelf__list")?.addEventListener("click",(t=>{const e=t.target.closest(".page-numbers[data-page]");e&&fcn_browseBookshelfPage(e.dataset.page)})); \ No newline at end of file diff --git a/repo/assets/fcnt_example.jpg b/repo/assets/fcnt_example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..726cd63a13c05184ef49163f004b018c50534b48 GIT binary patch literal 42322 zcmdqIWmp_rw;;I6?Pg1c)&@Zj$5(zrWA&bjj5cbi*SA65>b+rR5CL(3k_|8`0sY`+66#^ zhfsxshk_snK%zlFp+UU%0GQqogoJ|lgX_Nr7+45sI4DT?x6FUcek+E6gnC^Byn}jc zf(nKDmQnYwZT=73AtXwxiwUgg{bvfZW!lLQ_IdO& zip@EiQIm3Z%!qFKCtXgKCR@$Ol%)2wvP@!~^LBf?@+$y|F+`%+J|u>BzCdLHubRLn z>{vr(I6pLRhvBx8r%B^ug$%Y+RBhFjhq?}vh6YDcLzzsO!Q#UIt}v4yF@{p8mnBdk(=P0 z2LE(o1*gGw+PJ<$Yy-X+f@`vkOyvxdLngX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$Y%d?hZ_6vU zutj`15;6bErV2J?b9~6I!Vu0S^?Wj5t8ff2U!gs2>b&;-~5~TKl9Xv3jhEB literal 0 HcmV?d00001 diff --git a/src/js/application.js b/src/js/application.js index d74fb394..fca26f2e 100644 --- a/src/js/application.js +++ b/src/js/application.js @@ -1607,7 +1607,7 @@ _$$('[data-click-action*="open-dialog-modal"]').forEach(element => { }); // Close dialog modal -_$$('[data-click-action*="close-dialog-modal"]').forEach(element => { +_$$('[data-click-action*="close-dialog-modal"], button[formmethod="dialog"][value="cancel"]').forEach(element => { element.addEventListener('click', event => { event.preventDefault(); event.target.closest('dialog').close(); @@ -1624,6 +1624,26 @@ _$$('dialog').forEach(element => { }); }); +// Open tooltip modal +_$('.content-section')?.addEventListener('click', event => { + if (event.target.closest('[data-click-action*="open-tooltip-modal"]') && !window.getSelection().toString()) { + const modal = _$$$('fictioneer-tooltip-dialog'); + const header = event.target.dataset.dialogHeader; + const content = event.target.dataset.dialogContent; + + if (content.length > 200) { + modal.style = '--modal-width: 400px;'; + } + + if (header) { + modal.querySelector('[data-finder="tooltip-dialog-header"]').innerHTML = header; + } + + modal.querySelector('[data-finder="tooltip-dialog-content"]').innerHTML = content; + modal.showModal(); + } +}); + // ============================================================================= // KEYBOARD INPUTS // ============================================================================= diff --git a/src/scss/common/_formatting.scss b/src/scss/common/_formatting.scss index 4983092a..bfea9060 100644 --- a/src/scss/common/_formatting.scss +++ b/src/scss/common/_formatting.scss @@ -62,8 +62,8 @@ img { } } -p a:not(.wp-element-button), -.content-section :is(.wp-block-table, .wp-block-pullquote, .wp-block-list) a:not(.wp-element-button), +p a:not(.wp-element-button, .modal-tooltip), +.content-section :is(.wp-block-table, .wp-block-pullquote, .wp-block-list) a:not(.wp-element-button, .modal-tooltip), .link { color: var(--inline-link-color); border-bottom: var(--inline-link-color-border); @@ -83,6 +83,16 @@ p a:not(.wp-element-button), } } +a.modal-tooltip { + cursor: help; + text-decoration: underline var(--fg-900) dotted 1px; + text-underline-offset: 0.15em; + + &:hover { + text-decoration-color: currentColor; + } +} + .esc-link a:not(.link) { color: inherit; diff --git a/src/scss/common/_setup.scss b/src/scss/common/_setup.scss index 3533e9b2..8de4548a 100644 --- a/src/scss/common/_setup.scss +++ b/src/scss/common/_setup.scss @@ -80,11 +80,11 @@ article { contain: layout style; // Improve performance } -:root a:where(:not(.wp-element-button)):is(a) { +:root a:where(:not(.wp-element-button, .modal-tooltip)):is(a) { text-decoration: none; // WP bullshit } -a:where(:not(.button, .wp-element-button)) { +a:where(:not(.button, .wp-element-button, .modal-tooltip)) { cursor: pointer; color: var(--layout-link-color); text-decoration: none;