1import{b as m}from"./chunk-KOF6XHCZ.js";import{a as g}from"./chunk-44GFCFNC.js";import{Z as I,ba as S,d as h,vc as _}from"./chunk-MLBDNTY2.js";var O=(()=>{let a=class a{constructor(e,i){this.bpService=e,this.readerFontService=i,this.defaultLightThemeColor="#F4F4F4",this.defaultDarkThemeColor="#17131D",this.expandedAudioThemeColor="#211D27",this._IS_VISIBLE="IS_VISIBLE",this._IS_MATURE="IS_MATURE",this._IS_MINIFIED="IS_MINIFIED",this._IS_PLAYING="IS_PLAYING",this._VOLUME="VOLUME",this._PLAYBACK="PLAYBACK",this._PAGE_KEY="PAGE_KEY",this._STORY_KEY="STORY_KEY",this._TITLE="TITLE",this._LENGTH="LENGTH",this._EPISODE_TITLE="EPISODE_TITLE",this._SEEK_POSITION="SEEK_POSITION",this._AUDIO_EPISODE_KEY="AUDIO_EPISODE_KEY",this._MINIMIZED_BOTTOM="MINIMIZED_BOTTOM",this._AUTHOR_USER_KEY="AUTHOR_USER_KEY",this._BYTES="AUDIO_BYTES",this._ACCESS_MODE="AUDIO_ACCESS_MODE",this._SNAPSHOT_KEY="AUDIO_SNAPSHOT_KEY",this.chapterOrder=0,this.updateSubject=new h,this.update$=this.updateSubject.asObservable(),this.authChangedSubject=new h,this.authChanged$=this.authChangedSubject.asObservable(),this.singleSaleFulfilledSubject=ne
1w h,this.singleSaleFulfilled$=this.singleSaleFulfilledSubject.asObservable(),_(()=>{this.readerFontService.isDarkAppTheme(),this.syncThemeColor()})}get defaultThemeColor(){return this.readerFontService.isDarkAppTheme()?this.defaultDarkThemeColor:this.defaultLightThemeColor}clear(){this.audioEpisodeKey=null,this.episodeList=[],this.episodeListOpen=!1,this.length=null,this.seekPosition=null,this.episodeTitle=null,this.title=null,this.isVisible=null,this.pageKey=null,this.accessMode=null,this.snapshotKey=null,this.updateSubject.next(!0)}clearWithoutUpdate(){this.audioEpisodeKey=null,this.episodeList=[],this.episodeListOpen=!1,this.length=null,this.seekPosition=null,this.episodeTitle=null,this.title=null,this.pageKey=null,this.accessMode=null,this.snapshotKey=null,this.isVisible=null}reloadIfStoryIsOpen(e){this.isVisible&&this.storyKey===e&&this.updateSubject.next(!0)}notifySingleSaleFulfilled(e,i){this.singleSaleFulfilledSubject.next({StoryKey:e,MediaType:i})}setGrabArea(){var l,r,o;let e=document.getElementById("dragArea"),i=(r=(l=document.getElementById("audio-pane"))==null?void 0:l.nextElementSibling)==null?void 0:r.children;if(i){let s=i[1];if(s&&e){let t=((o=s==null?void 0:s.getBoundingClientRect())==null?void 0:o.y)||0;e.style.top=t+"px",e.style.height="32px",e.style.minHeight="32px",s.style.transition="top 0s"}}}get isVisible(){return localStorage.getItem(this._IS_VISIBLE)==="true"}set isVisible(e){var i,l;if(e?localStorage.setItem(this._IS_VISIBLE,e.toString()):localStorage.removeItem(this._IS_VISIBLE),e)setTimeout(()=>{this.setGrabArea()},500);else{this.setThemeColor(this.defaultThemeColor);let r=(l=(i=document.getElementById("audio-pane"))==null?void 0:i.nextElementSibling)==null?void 0:l.children;if(r){let o=r[1];o&&(o.style.transition="all 0.2s ease-in-out",o.style.top="unset")}}}get isMinified(){return localStorage.getItem(this._IS_MINIFIED)==="true"}set isMinified(e){var i,l,r,o;if(e?localStorage.setItem(this._IS_MINIFIED,e.toString()):localStorage.removeItem(this._IS_MINIFIED),e){let s=(o=(r=document.getElementById("audio-pane"))==null?void 0:r.nextElementSibling)==null?void 0:o.children;if(s){let t=s[1];t&&(t.style.transition="height 0.2s ease, min-height 0.2s ease, bottom 500ms ease-in-out",t.style.height="60px",t.style.minHeight="60px",t.style.top="unset",t.style.borderRadius="0",t.style.bottom="var(--audio-player-bottom-offset, 0px)",this.setThemeColor(this.defaultThemeColor))}}else{let s=(l=(i=document.getElementById("audio-pane"))==null?void 0:i.nextElementSibling)==null?void 0:l.children;if(s){let t=s[1];t&&(this.bpService.gtxs?(t.style.height="unset",t.style.top="unset",t.style.borderRadius="15px 15px 0 0",t.style.bottom="0"):(t.style.transition="all 0.2s ease-in-out",t.style.height="100dvh",t.style.minHeight="100dvh",t.style.top="0",t.style.borderRadius="0",t.style.bottom="unset",this.setThemeColor(this.expandedAudioThemeColor)),setTimeout(()=>{this.setGrabArea()},500))}}}get isPlaying(){return localStorage.getItem(this._IS_PLAYING)==="true"}set isPlaying(e){e?localStorage.setItem(this._IS_PLAYING,e.toString()):localStorage.removeItem(this._IS_PLAYING)}setThemeColor(e){var i;(i=document.querySelector('meta[name="theme-color"]'))==null||i.setAttribute("content",e)}syncThemeColor(){let e=this.isVisible&&!this.isMinified&&!this.bpService.gtxs;this.setThemeColor(e?this.expandedAudioThemeColor:this.defaultThemeColor)}get isMature(){return localStorage.getItem(this._IS_MATURE)==="true"}set isMature(e){e?localStorage.setItem(this._IS_MATURE,e.toString()):localStorage.removeItem(this._IS_MATURE)}get volume(){return+(localStorage.getItem(this._VOLUME)||100)}set volume(e){e?localStorage.setItem(this._VOLUME,e.toString()):localStorage.removeItem(this._VOLUME)}get playback(){return+(localStorage.getItem(this._PLAYBACK)||1)}set playback(e){e?localStorage.setItem(this._PLAYBACK,e.toString()):localStorage.removeItem(this._PLAYBACK)}get pageKey(){return localStorage.getItem(this._PAGE_KEY)}set pageKey(e){e?localStorage.setItem(this._PAGE_KEY,e):localStorage.removeItem(this._PAGE_KEY)}get storyKey(){return localStorage.getItem(this._STORY_KEY)}set storyKey(e){e?localStorage.setItem(this._STORY_KEY,e):localStorage.removeItem(this._STORY_KEY)}get authorUserKey(){return localStorage.getItem(this._AUTHOR_USER_KEY)}set authorUserKey(e){e?localStorage.setItem(this._AUTHOR_USER_KEY,e):localStorage.removeItem(this._AUTHOR_USER_KEY)}get bytes(){return+(localStorage.getItem(this._BYTES)||0)}set bytes(e){e?localStorage.setItem(this._BYTES,e==null?void 0:e.toString()):localStorage.removeItem(this._BYTES)}get accessMode(){return localStorage.getItem(this._ACCESS_MODE)}set accessMode(e){e?localStorage.setItem(this._ACCESS_MODE,e):localStorage.removeItem(this._ACCESS_MODE)}get snapshotKey(){return localStorage.getItem(this._SNAPSHOT_KEY)}set snapshotKey(e){e?localStorage.setItem(this._SNAPSHOT_KEY,e):localStorage.removeItem(this._SNAPSHOT_KEY)}get title(){return localStorage.getItem(this._TITLE)}set title(e){e?localStorage.setItem(this._TITLE,e):localStorage.removeItem(this._TITLE)}get episodeTitle(){return localStorage.getItem(this._EPISODE_TITLE)}set episodeTitle(e){e?localStorage.setItem(this._EPISODE_TITLE,e):localStorage.removeItem(this._EPISODE_TITLE)}get length(){return+(localStorage.getItem(this._LENGTH)||0)}set length(e){e?localStorage.setItem(this._LENGTH,e.toString()):localStorage.removeItem(this._LENGTH)}get seekPosition(){return+(localStorage.getItem(this._SEEK_POSITION)||0)}set seekPosition(e){e?localStorage.setItem(this._SEEK_POSITION,e.toString()):localStorage.removeItem(this._SEEK_POSITION)}get audioEpisodeKey(){return localStorage.getItem(this._AUDIO_EPISODE_KEY)}set audioEpisodeKey(e){this.audioEpisodeKey!==null&&this.audioEpisodeKey!==void 0&&this.audioEpisodeKey!==e&&(this.seekPosition=0),e?(localStorage.setItem(this._AUDIO_EPISODE_KEY,e),this.episodeList=[]):(localStorage.removeItem(this._AUDIO_EPISODE_KEY),this.episodeList=[])}get minimizedBottom(){return+(localStorage.getItem(this._MINIMIZED_BOTTOM)||0)}set minimizedBottom(e){e?localStorage.setItem(this._MINIMIZED_BOTTOM,e.toString()):localStorage.removeItem(this._MINIMIZED_BOTTOM)}};a.\u0275fac=function(i){return new(i||a)(S(g),S(m))},a.\u0275prov=I({token:a,factory:a.\u0275fac,providedIn:"root"});let n=a;return n})();export{O as a};
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.