1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ecqNV_fk.js","./RyvkHnHM.js","./DL0Xpu2v.js","./CEIykhXW.js","./DLNpcykF.js","./CCIbnOLw.js","./FC47SwYL.js","./DrPVW_0W.js","./DY3Yz_TZ.js","./DeLRz3wp.js","./Bdv2xjB9.js","./Dv7KG4Yv.js","./DnR8d07b.js","./FXANGjSJ.js","./1fs1yw9t.js","./FreeBookBadge.CetYG1Ek.css","./Dh-bUwi5.js","./aNgHloq4.js","./CyQlvIzm.js","./D6TUFIVa.js","./VKQS5tGV.js","./Dlx19IXY.js","./DhbthPdZ.js","./DkGN16LQ.js","./RegistrationForm.DEzsd8BT.css","./ZNLnhvWg.js","./FlowTest.s8bVvPU_.css","./CGpusghW.js","./DmyPMF8k.js","./okUcf8VI.js","./w3YMHgno.js","./BuFaxK6E.js","./Drawer.Bmo6NqTA.css","./DU95hI5u.js","./CTDcLk3P.js","./CNNG57e1.js","./Dwb3cLGQ.js","./CsFO-zxd.js","./BJgICJEx.js","./DDKgkpNe.js","./B97mBF-E.js","./QXh77cg8.js","./DY0h6voj.js"])))=>i.map(i=>d[i]); 2import{d as Ue,v as Ge,s as Qe,O as He,a as Ye,X as qe,B as p,K as Z,N as Je,c as m,af as ee,y as Ke,ae as We,e as Xe,b as Ze,J as et,f as y,o as a,m as i,h as u,g as n,i as e,q as x,k as h,H as te,p as v,a3 as z,Q as tt,R as ot,F as N,l as oe,S as se,_ as k,L as st,M as nt}from"#entry";import{_ as at}from"./fnBSBj-d.js";import{_ as rt}from"./B3Y6HB5n.js";import lt from"./VKQS5tGV.js";import{_ as it}from"./CX2wJD0K.js";import{_ as ct}from"./BanusdPp.js";import{i as ut}from"./DY3Yz_TZ.js";import{Q as dt}from"./ClC12Qld.js";import{u as pt}from"./BJgICJEx.js";import{u as mt}from"./Drrfhr9B.js";import{u as _t}from"./CCIbnOLw.js";import{u as ft}from"./ZNLnhvWg.js";import{u as ht}from"./DL0Xpu2v.js";import{a as vt,b as xt,u as kt}from"./FXANGjSJ.js";import{u as P}from"./DrcgtIqi.js";import{u as gt}from"./1fs1yw9t.js";import{u as bt,d as yt,a as wt,b as E,c as Ct}from"./DHJAwKkp.js";import"./Dlx19IXY.js";import"./Dv7KG4Yv.js";import"./Bdv2xjB9.js";import"./FC47SwYL.js";import"./DrPVW_0W.js";import"./DLNpcykF.js";const $t=x(()=>k(()=>import("./ecqNV_fk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url).then(s=>s.default||s)),At=x(()=>k(()=>import("./DeLRz3wp.js"),__vite__mapDeps([9,10,3,11,12,13,8,14,5,6,7,15]),import.meta.url).then(s=>s.default||s)),Lt=x(()=>k(()=>import("./Dh-bUwi5.js"),__vite__mapDeps([16,10,3,12,13,8,14,5,6,7,17,18,19,20,21,22,23,24,25,26]),import.meta.url).then(s=>s.default||s)),Et=x(()=>k(()=>import("./CGpusghW.js"),__vite__mapDeps([27,17,18,3,19,20,21,10,22,12,5,6,7,8,13,14,23,24,28,2,4,29,30,31,32,33,34,35,36,37,38]),import.meta.url).then(s=>s.default||s)),Bt=x(()=>k(()=>import("./DDKgkpNe.js"),__vite__mapDeps([39,40,3]),import.meta.url).then(s=>s.default||s)),Rt=x(()=>k(()=>import("./QXh77cg8.js"),__vite__mapDeps([41,42,10,3]),import.meta.url).then(s=>s.default||s)),St={class:"container py-8 max-md:py-6"},Mt={class:"page-content book-chapter flex flex-col gap-8 max-md:gap-6"},zt={class:"grid grid-cols-[1fr_176px] gap-8 max-lg:grid-cols-1"},Nt={class:"text-3xl font-bold mb-8 max-md:text-2xl"},Pt={key:4,class:"flex justify-center"},Dt={class:"flex gap-6 w-full max-w-lg max-md:gap-3 justify-center items-center"},Ft={class:"relative max-lg:hidden"},Ot=["href"],Tt={class:"grid grid-cols-2 max-md:grid-cols-1 gap-x-4 chapter-list"},It={class:"truncate text-nowrap"},Vt={class:"flex gap-5 max-md:gap-3 overflow-auto scrollbar-hidden"},jt=Ue({__name:"chapter-[order]",async setup(s){let _,w;const{user:D,getOTT:ne}=Ge(),{getAuthBookLink:ae}=pt(),F=st(),{slug:C,order:re}=Qe().params,{getLinkToApp:O}=mt(),le=He(),{isMobile:ie}=Ye(),{funnelAvailable:ce,secondStepAvailable:ue}=_t(),{isMysteryBoxActive:de}=ft(),{canShowPaywall:T}=ht(),{pendingGift:I,claimGift:pe,showAddedNotification:me}=vt(),{setReadingContext:_e}=xt(),{$toast:fe}=qe(),g=p(parseInt(re));isNaN(g.value)&&(g.value=1),g.value<2&&([_,w]=Z(()=>se(`/books/${C}`)),await _,w());const[he,ve,xe]=([_,w]=Z(()=>Promise.all([P(`/novels/${C}/chapters/${g.value}`),P(`/novels/${C}/chapters/${g.value}/next`),P(`/novels/${C}/similar`)])),_=await _,w(),_),{data:V,error:ke,status:Ut,refresh:ge}=he,{data:be,error:Gt,status:Qt}=ve,{data:ye,status:Ht}=xe;if(ke.value?.statusCode===404)throw Je({statusCode:404,statusMessage:"Page Not Found"});const o=V.value?.data.book,t=m(()=>V.value?.data.chapter);ee(()=>{t.value&&_e({bookId:o.id,chapterId:t.value.id,chapterNumber:t.value.order})});const f=be.value?.data,j=f[0]??null,B=p(ye.value?.data),U=m(()=>!T.value&&(ce(t.value.is_free??!1,j?.is_free??!0)||de.value)),G=m(()=>typeof o.uploaded_by=="string"),we=m(()=>!ut(t.value)),Q=m(()=>!T.value&&ue(t.value.is_free??!1)),b=m(()=>t.value.order-1),d=m(()=>f[0]?f[0].order:null),Ce=m(()=>{let c=[];if(t.value.order>=2){const r=b.value<2?`/books/${o.slug}`:`/books/${o.slug}/chapter-${b.value}`;c.push({rel:"prev",href:F.public.siteURL+r})}if(d.value){const r=`/books/${o.slug}/chapter-${d.value}`;c.push({rel:"next",href:F.public.siteURL+r})}return c}),$=o?.genres?o.genres[0]:null,R=p(null),H=p(!1),Y=()=>{if(R.value){const c=R.value.getBoundingClientRect();H.value=ie&&c.top<50&&c.bottom>600}},q=p(!1),J=p(null),$e=p(D.value?.uuid||null),Ae=async()=>{q.value=!0;try{if(D.value){const c=await ne();J.value=c.data.token}window.location.href=ae(o?.id,t.value.id,J.value,$e.value)}catch{fe.warning("Something went wrong.")}finally{q.value=!1}},{setSkipContext:Le}=gt(),{markIntent:S,initAntiSkip:Ee,isVisible:K}=kt();ee(()=>Le(o,t.value,f)),Ee();const Be=()=>{ge()},Re=async()=>
2{pe(),d.value&&(await se(`/books/${o.slug}/chapter-${d.value}`),window.scrollTo(0,0)),me()};Ke(()=>{window.addEventListener("scroll",Y)}),We(()=>{window.removeEventListener("scroll",Y)});const W=p([]);W.value=[{link:"/genres/all-novels",label:"Novels"},{link:`/genres/${$?.slug}-novels`,label:$?.name},{link:`/books/${o?.slug}`,label:o?.title},{label:t.value?.title}];const A=`${o.title} - ${t.value.title}`,L=`Read ${t.value.title} of ${o.title} on FictionMe`;return Xe({link:Ce}),Ze({titleTemplate:"%s â Read on FictionMe",title:A,description:L,ogTitle:A,ogDescription:L,twitterTitle:A,twitterDescription:L}),bt([yt({itemListElement:[E({position:1,name:"Novels",item:"/genres/all-novels"}),E({position:2,name:$?.name,item:`/genres/${$?.slug}-novels`}),E({position:3,name:o.title,item:`/books/${o.slug}`}),E({position:4,name:t.value.title})]}),wt({headline:A,description:L,inLanguage:"en",image:o.cover,publisher:Ct({name:"FictionMe",url:"https://fictionme.net"}),...we.value?{isAccessibleForFree:!1}:{}})]),(c,r)=>{const Se=$t,Me=at,ze=rt,Ne=At,Pe=Lt,De=Et,M=et("router-link"),Fe=ot,Oe=lt,X=Bt,Te=it,Ie=Rt,Ve=ct;return a(),y(N,null,[e(Q)?(a(),i(Se,{key:0,class:"mb-8"})):u("",!0),n("div",St,[n("div",Mt,[h(Me,{breadcrumbs:e(W)},null,8,["breadcrumbs"]),n("div",zt,[n("div",{ref_key:"chapterBlock",ref:R,class:"min-w-0"},[n("h1",Nt,te(e(t).title),1),e(t)?(a(),i(ze,{key:0,chapter:e(t),"book-id":e(o).id,class:"mb-8"},null,8,["chapter","book-id"])):u("",!0),e(I)&&!e(K)&&(e(t).is_free||e(t).is_purchased)?(a(),i(Ne,{key:e(t).id,"gifted-book":e(I).book,class:"mb-8",onClaim:Re},null,8,["gifted-book"])):u("",!0),e(U)&&!e(K)?(a(),i(Pe,{key:2,chapter:e(t),"next-chapter":e(j),"book-id":e(o).id,"free-fallback":!1},null,8,["chapter","next-chapter","book-id"])):!e(t).is_free&&!e(t).is_purchased?(a(),i(De,{key:3,"book-id":e(o).id,"chapter-id":e(t).id,"chapter-number":e(t).order,coins:e(t).coins,onChapterUnlocked:Be},null,8,["book-id","chapter-id","chapter-number","coins"])):u("",!0),e(U)?u("",!0):(a(),y("div",Pt,[n("div",Dt,[e(t).order>=2?(a(),i(M,{key:0,to:e(b)<2?`/books/${e(o).slug}`:`/books/${e(o).slug}/chapter-${e(b)}`,onClick:r[0]||(r[0]=l=>e(S)(e(b),l)),class:z([e(d)?"lg:flex-1":"","flex items-center py-3 px-8 max-md:px-4 justify-center text-xl max-md:text-xl border-2 border-primary text-center rounded-xl text-violet-800 dark:text-violet-500 dark:hover:text-violet-600"])},{default:v(()=>[r[2]||(r[2]=n("svg",{class:"w-5 h-5 lg:mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)),n("span",{class:z(e(d)?"max-md:hidden":"")},"Previous Chapter",2)]),_:1},8,["to","class"])):u("",!0),e(d)?(a(),i(M,{key:1,to:`/books/${e(o).slug}/chapter-${e(d)}`,onClick:r[1]||(r[1]=l=>e(S)(e(d),l)),class:"flex flex-1 items-center py-3 px-8 max-md:px-4 bg-fm-gradient hover:bg-fm-gradient-active text-center justify-center rounded-xl !text-white text-xl max-md:text-xl"},{default:v(()=>[...r[3]||(r[3]=[n("span",null,"Next Chapter",-1),n("svg",{class:"w-5 h-5 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])]),_:1},8,["to"])):u("",!0)])]))],512),n("div",Ft,[n("a",{href:e(O)(e(o).id,e(G)),target:"_blank",rel:"nofollow",class:z(["sticky flex gap-4 flex-col py-6 px-4 shadow hover:shadow-md rounded-xl dark:border-zinc-700 dark:bg-zinc-800 dark:border-[1px] items-center justify-center dark:!text-gray-200 !text-zinc-900",e(Q)?"top-[151px]":"top-24"])},[r[4]||(r[4]=n("p",{class:"text-center font-semibold"}," Scan the QR code to download FictionMe App and unlock more chapters! ",-1)),h(Fe,null,{default:v(()=>[h(dt,{class:"text-primary",value:e(O)(e(o).id,e(G)),foreground:e(le).preference===e(tt).MODE_LIGHT?"#6A2AD5":"#A051FA",background:"transparent",level:"M","render-as":"svg"},null,8,["value","foreground"])]),_:1})],10,Ot)])]),e(f).length>0?(a(),i(X,{key:0,title:"Your Next Chapters"},{default:v(()=>[n("ul",Tt,[(a(!0),y(N,null,oe(e(f),l=>(a(),y("li",{key:l.id},[h(M,{to:`/books/${e(o).slug}/chapter-${l.order}`,onClick:je=>e(S)(l.order,je),class:"flex justify-between gap-1 rounded-xl"},{default:v(()=>
2[n("span",It,te(l.title),1),!l.is_free&&!l.is_purchased?(a(),i(Oe,{key:0,name:"fm:lock",class:"text-gray-400"})):u("",!0)]),_:2},1032,["to","onClick"])]))),128))])]),_:1})):u("",!0),e(B)&&e(B).length>0?(a(),i(X,{key:1,title:"You might like"},{default:v(()=>[n("div",Vt,[(a(!0),y(N,null,oe(e(B),l=>(a(),i(Te,{book:l,key:l.id},null,8,["book"]))),128))])]),_:1})):u("",!0),h(Ie),h(Ve,{show:e(H),onClicked:Ae},null,8,["show"])])])],64)}}}),vo=nt(jt,[["__scopeId","data-v-09677751"]]);export{vo as default};
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.