1(()=>{"use strict";var e={},t={};function a(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,a),i.exports}function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}a.rv=()=>"1.4.9",a.ruid="[email protected]";class r{deleteCookie(e,t,a){let o=new Date;o.setTime(o.getTime()-1),document.cookie=e+"=0;expires="+o.toUTCString()+(null===t?"":";path="+t)+(null===a?"":";domain="+a)}addCookie(e,t,a,o,r=31536e7){let i=new Date;i.setTime(i.getTime()+r),document.cookie=e+"="+t+";expires="+i.toUTCString()+(null===a?"":";path="+a)+(null===o?"":";domain="+o)}static hasCookie(e){return RegExp("(?:^|;\\s*)"+escape(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=").test(document.cookie)}static getCookie(e){return e&&this.hasCookie(e)?unescape(document.cookie.replace(RegExp("(?:^|.*;\\s*)"+escape(e).replace(/[-.+*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"),"$1")):null}}class i{static isDarkMode(){return"dark"===document.documentElement.dataset.theme||"auto"===document.documentElement.dataset.theme&&window.matchMedia("(prefers-color-scheme: dark)").matches}static isAutoMode(){return"auto"===document.documentElement.dataset.theme}static save(e,t){let a=new r;e?a.addCookie(this.key,"dark","/",t):(a.deleteCookie(this.deprecatedKey,"/",t),a.deleteCookie(this.key,"/",t))}static update(e){let t=e?"dark":"light";document.documentElement.dataset.theme=t,document.querySelectorAll('iframe[data-sync-theme="true"]').forEach(e=>{let a=e.contentDocument;a&&a.documentElement&&(a.documentElement.dataset.theme=t)})}bind(e=".tw-account-dark-mode-toggle"){let t=document.querySelector(e);return t&&(this.toggle=t,i.isAutoMode()&&(t.disabled=!0),i.isDarkMode()&&(t.checked=!0),t.addEventListener("click",this.onClick)),this}unbind(){var e;return null==(e=this.toggle)||e.removeEventListener("click",this.onClick),this}constructor(){o(this,"toggle",null),o(this,"onClick",e=>{var t;if(e.target!==this.toggle||!this.toggle)return;let a=null!=(t=this.toggle.getAttribute("data-domain"))?t:"",o=this.toggle.checked;i.save(o,a),i.update(o)})}}o(i,"key","theme_color"),o(i,"deprecatedKey","dark_mode");class n{bind(e){e||"true"===document.body.dataset.fixHeader||(window.addEventListener("scroll",()=>{this.updateHeader()},{passive:!0}),this.updateHeader())}updateHeader(){let e=window.scrollY,t=e>this.height,a=e-this.prevScrollPosition;e<=0&&(this.floatingMode=!1),t&&(this.floatingMode=!0),t?window.setTimeout(()=>{document.body.dataset.headerAnimation="true"}):document.body.dataset.headerAnimation="false",document.body.dataset.headerFloating=this.floatingMode.toString(),this.floatingMode&&(a<-8?document.body.dataset.headerShown="true":a>0&&(document.body.dataset.headerShown="false")),this.prevScrollPosition=e}constructor(){o(this,"prevScrollPosition",-1),o(this,"locator",document.querySelector(".tw-global-header-locator")),o(this,"height",50),o(this,"floatingMode",!1)}}class d{bind(e,t){var a;if(t||null===e)return;this.userId=e;let o=document.querySelector(".tw-global-header-nav-item-notification");o.addEventListener("mouseenter",this.loadNotifications),null==(a=o.querySelector("a"))||a.addEventListener("focus",this.loadNotifications)}loadNotifications(){fetch("/"+this.userId+"/notificationdialog",{credentials:"include",cache:"no-store",mode:"cors"}).then(e=>{e.ok&&e.text().then(e=>{let t=document.querySelector(".tw-global-header-notification-list");t.innerHTML=e,t.querySelectorAll("time").forEach(function(e){new window.TwScripts.Main.LocalTimeConverter().convert(e)})})})}constructor(){o(this,"userId","")}}class s{bind(e){this.sidebarPopup=e;let t=document.querySelector(".tw-header-toggle-button"),a=document.querySelector(".tw-sidebar"),o=document.querySelector(".tw-sidebar-background"),r=document.querySelector(".tw-sidebar-close"),i=document.querySelector(".tw-sidebar-category-header"),n=document.querySelector(".tw-sidebar-pickup-navi-more");t&&a&&o&&(t.addEventListener("click",function(e){e.preventDefault(),document.body.dataset.showSidebar="true"===document.body.dataset.showSidebar?"false":"true"}),o.addEventListener("click",()=>{i&&"true"===i.dataset.isExpanded?this.setOpen(a,i):this.closeSidebar()}),i&&(i.addEventListener("click",()=>{this.setOpen(a,i)}),null==n||n.addEventListener("click",e=>{e.preventDefault(),this.setOpen(a,i)})),r&&r.addEventListener("click",this.closeSidebar))}
1setOpen(e,t){e.dataset.isShown="true"===e.dataset.isShown?"false":"true",e.dataset.isCategoryShown="true"===e.dataset.isCategoryShown?"false":"true",t.dataset.isExpanded="true"===t.dataset.isExpanded?"false":"true"}closeSidebar(){var e;document.body.dataset.showSidebar="false",null==(e=this.sidebarPopup)||e.close()}constructor(){o(this,"sidebarPopup",null)}}class l{bind(){let e=new window.TwScripts.Main.PopupFactory,t=new window.TwScripts.Main.PopupManager,a=window.matchMedia("(hover: hover) and (pointer: fine)").matches?"hover":"click";t.add(e.create("#tw-global-header-login-user",".tw-global-header-user-popup-locator",{trigger:a})),this.sidebarPopup=e.create(".tw-header-toggle-button",".tw-sidebar",{trigger:"click"}),t.add(this.sidebarPopup),t.add(e.create(".tw-global-header-nav-item-notification",".tw-global-header-notification-popup-locator",{trigger:a})),t.add(e.create(".tw-global-header-nav-item-login",".tw-global-header-login-popup-locator",{trigger:a})),t.add(e.create(".tw-global-header-nav-item-login",".tw-global-header-mobile-login-popup-locator",{trigger:a})),t.add(e.create(".tw-global-header-nav-item-detail",".tw-global-header-detail-popup-locator",{trigger:a})),t.add(e.create(".tw-global-header-nav-item-search",".tw-global-header-search-popup-locator",{trigger:a})),e.create(".tw-global-header-nav-item-broadcast-link","#tw-global-header-broadcast-locator",{trigger:"click"})}getSidebarPopup(){return this.sidebarPopup}constructor(){o(this,"sidebarPopup",null)}}class c{getItem(e,t){try{var a,o;return null!=(o=null==(a=this.storage)?void 0:a.getItem(e))?o:t}catch(e){return t}}getKeys(){try{return this.storage?Object.keys(this.storage):[]}catch(e){return[]}}getItemAsNumber(e,t){let a=parseFloat(this.getItem(e,String(t)));return isNaN(a)?t:a}getItemAsBoolean(e,t){return"1"===this.getItem(e,t?"1":"0")}setItem(e,t){try{var a;return null==(a=this.storage)||a.setItem(e,t),!0}catch(e){return!1}}setItemAsNumber(e,t){try{var a;return null==(a=this.storage)||a.setItem(e,t.toString()),!0}catch(e){return!1}}setItemAsBoolean(e,t){try{var a;return null==(a=this.storage)||a.setItem(e,t?"1":"0"),!0}catch(e){return!1}}removeItem(e){try{var t;return null==(t=this.storage)||t.removeItem(e),!0}catch(e){return!1}}constructor(e){o(this,"storage",null);try{this.storage=e()}catch(e){}}}let u=new c(()=>window.sessionStorage);class h{updateWithCache(){let e=this.dmCache.get();(!e||function(e,t=Date.now()){return t-e.updated>18e4}(e))&&window.setTimeout(()=>{this.update()},8e3),e&&this.updateDmCount(e.count)}update(){fetch(`${this.apiBaseUrl}/dm/total_unread_count`,{method:"GET",credentials:"include"}).then(e=>e.json().then(t=>{e.ok&&!t.is_restricted&&(this.dmCache.set(t.total_unread_count),this.updateDmCount(t.total_unread_count))}))}updateDmCount(e){let t=0===e?"":e.toString(),a=document.querySelector(".tw-global-header-nav-item-profile .tw-global-header-new-count");a&&(a.textContent=t);let o=document.querySelector(".tw-global-header-nav-item-profile-dm-count");o&&(o.textContent=t);let r=document.querySelector(".tw-header-toggle-button .tw-global-header-new-count");r&&(r.textContent=t);let i=document.querySelector(".tw-sidebar-menu .tw-sidebar-menu-dm-count");i&&(i.textContent=t)}constructor(e){o(this,"apiBaseUrl",void 0),o(this,"dmCache",void 0),this.apiBaseUrl=e,this.dmCache=new g}}let m="twicas/dm_count";class g{get(){let e=u.getItem(m,null);return e?JSON.parse(e):null}set(e,t=Date.now()){return u.setItem(m,JSON.stringify({count:e,updated:t}))}}let p=new c(()=>window.localStorage);class w{bind(){document.querySelectorAll(".tw-global-header-nav-item-broadcast-link").forEach(e=>{if("tool"!==p.getItem("twicas/broadcaster/default_mode","web"))return;let t=e.dataset.toolUrl;t&&(e.href=t)})}}class b{bind(){let e=document.querySelector(".tw-highlight-sheet"),t=document.querySelector(".tw-highlight-sheet-backdrop"),a=document.querySelector(".tw-highlight-sheet-iframe");if(!e||!t||!a)return;let o=document.querySelectorAll(".tw-global-header-open-highlight"),r=document.querySelectorAll(".tw-highlight-sheet-close");t.addEventListener("click",()=>{i()});let i=()=>{document.body.dataset.showHighlight="false",e.setAttribute("aria-hidden","true"),t.setAttribute("aria-hidden","true")};o.forEach(o=>{o.addEventListener("click",o=>
1{o.preventDefault(),document.body.dataset.showHighlight="true",a.src||(a.src=a.dataset.src||""),e.setAttribute("aria-hidden","false"),t.setAttribute("aria-hidden","false")})}),r.forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),i()})})}}new class{init(){let e=document.querySelector(".tw-global-header"),t=e.dataset.apiBaseUrl,a="true"===e.dataset.enableDm,o="true"===e.dataset.isMobile,r=e.dataset.userId;window.addEventListener("DOMContentLoaded",function(){new n().bind(o);let e=new l;e.bind(),new s().bind(e.getSidebarPopup()),r&&(new d().bind(r,o),t&&a&&new h(t).updateWithCache()),new w().bind(),new b().bind()}),new i().bind()}}().init()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.