gear-second 1.16.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -21,9 +21,9 @@
21
21
  `,he=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},zs=he(mu,[["styles",[vu]]]),bu=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"}));function yu({touchDevice:e}){const t=X(!1);let n=0;return ro("busy:touchDevice",e),ro("setBusyState",o=>{n+=o?1:-1;const i=n>0;t.value!=i&&(t.value=i)}),t}function pi(){const e=Vt("busy:touchDevice"),t=Vt("setBusyState");let n=!1;return Ft(()=>{n&&(t==null||t(!1))}),(o,{desktopOnly:i=!1}={})=>{i&&e||(n=o,t==null||t(o))}}const _u={class:"group-hover:bg-stone-100 group-hover:bg-opacity-20 duration-200 rounđe-full p-2 w-full h-full inline-flex justify-center items-center"},tt=ke({__name:"ButtonIcon",props:{disabled:{type:Boolean},href:{},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=pi();let r=!1;function s(){r||(r=!0,i(!0,{desktopOnly:!0}))}function l(){r&&(r=!1,i(!1,{desktopOnly:!0}))}function a(c){n.disabled?c.preventDefault():o("click",c)}return(c,u)=>st((O(),pe(mr(c.href?"a":"button"),Sn(c.href?{href:c.href}:{},{class:["w-10 h-10 max-w-full max-h-full rounded-full flex-shrink-0 focus:outline-none",{"cursor-default text-stone-400 hover:text-stone-400":c.disabled,"text-stone-100 hover:text-stone-100 group duration-200":!c.disabled,"bg-black bg-opacity-50":!c.transparent}],onClick:Ke(a,["stop"]),onMouseenter:s,onMouseleave:l}),{default:ie(()=>[Z("div",_u,[we(c.$slots,"default")])]),_:3},16,["class"])),[[U(ln),c.disabled?0:15]])}}),wu=Object.freeze(Object.defineProperty({__proto__:null,default:tt},Symbol.toStringTag,{value:"Module"})),xu={},Su={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},ku=[Z("path",{fill:"currentColor",d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"},null,-1)];function Cu(e,t){return O(),Y("svg",Su,ku)}const As=he(xu,[["render",Cu]]),Iu=Object.freeze(Object.defineProperty({__proto__:null,default:As},Symbol.toStringTag,{value:"Module"}));class Eu{constructor(){me(this,"listeners");this.listeners=[],this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.init()}init(){window.addEventListener("keydown",this.onKeyDown,{capture:!0}),window.addEventListener("keyup",this.onKeyUp,{capture:!0}),window.addEventListener("keypress",this.onKeyPress,{capture:!0})}dispose(){window.removeEventListener("keydown",this.onKeyDown,{capture:!0}),window.removeEventListener("keyup",this.onKeyUp,{capture:!0}),window.removeEventListener("keypress",this.onKeyPress,{capture:!0})}onKeyPress(t){t.stopImmediatePropagation(),t.stopPropagation()}onKeyDown(t){t.stopImmediatePropagation(),t.stopPropagation(),this.listeners.forEach(n=>{var o;return(o=n.onKeyDown)==null?void 0:o.call(n,t)})}onKeyUp(t){t.stopImmediatePropagation(),t.stopPropagation(),this.listeners.forEach(n=>{var o;return(o=n.onKeyUp)==null?void 0:o.call(n,t)})}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);n!==-1&&this.listeners.splice(n,1)}}function Tu(){const e=new Eu;return Ft(()=>e.dispose()),ro("keyController",e),e}function vo(e){const t=Vt("keyController");Re(()=>t.addListener(e)),Ft(()=>t.removeListener(e))}const $u={class:"flex w-full flex-shrink-0 justify-between items-center h-16 px-3"},Pu={class:"font-medium md:text-lg text-ellipsis overflow-hidden whitespace-nowrap px-3 select-text"},Ou={class:"overflow-auto px-6 md:px-8 lg:px-10 xl:px-12 pt-3 pb-12 flex-grow scrollbar-sm"},js=ke({__name:"BottomSheet",props:on({name:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Cn(e,"modelValue");vo({onKeyDown:o});const n=pi();fe(t,i=>n(i));function o(i){t.value&&i.key==="Escape"&&(t.value=!1,i.preventDefault())}return(i,r)=>(O(),Y("div",{class:Ee(["fixed inset-0 flex flex-col items-center justify-end select-none",{"!pointer-events-none":!t.value}]),onClick:r[3]||(r[3]=()=>t.value=!1)},[Q(rn,{name:"slide","enter-from-class":"opacity-0 translate-y-full","leave-to-class":"opacity-0 translate-y-full"},{default:ie(()=>[t.value?(O(),Y("div",{key:0,class:"inline-flex flex-col h-[30rem] w-full sm:w-[32rem] max-h-[80vh] bg-stone-800 bg-opacity-90 backdrop-blur-md rounded-t-xl max-w-full overflow-hidden duration-200",onClick:r[1]||(r[1]=Ke(()=>{},["stop"])),onWheelPassive:r[2]||(r[2]=Ke(()=>{},["stop"]))},[Z("div",$u,[Q(tt,{transparent:"",onClick:r[0]||(r[0]=()=>t.value=!1)},{default:ie(()=>[Q(As)]),_:1}),Z("div",Pu,Ge(i.name),1),we(i.$slots,"actions")]),Z("div",Ou,[we(i.$slots,"default")])],32)):ye("",!0)]),_:3})],2))}}),Mu=Object.freeze(Object.defineProperty({__proto__:null,default:js},Symbol.toStringTag,{value:"Module"})),Lu=["min","max","step"],zu={class:"flex-shrink-0"},hi=he(ke({__name:"InputPercentage",props:on({min:{},max:{},step:{},disabled:{type:Boolean},suffix:{}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=Cn(e,"modelValue"),n=se({get(){return t.value},set(o){t.value=+o}});return(o,i)=>(O(),Y("div",{class:Ee(["flex items-center gap-3 pl-1 py-1",{"pointer-events-none opacity-50":o.disabled}]),style:ze({"--percentage":`${(n.value-o.min)/(o.max-o.min)*100}%`})},[st(Z("input",{"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),type:"range",min:o.min,max:o.max,step:o.step??1,class:"flex-grow"},null,8,Lu),[[Uc,n.value]]),Z("p",zu,[we(o.$slots,"suffix")])],6))}}),[["styles",[`input[type=range]{--tw-bg-opacity:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#d6d3d1 var(--percentage),#78716c var(--percentage));background-color:rgb(120 113 108/var(--tw-bg-opacity));border-radius:2px;border-style:none;cursor:pointer;height:6px;opacity:.9;outline:2px solid transparent;outline-offset:2px}input[type=range]::-webkit-slider-thumb{--tw-border-opacity:1;--tw-bg-opacity:1;-webkit-appearance:none!important;background-color:rgb(214 211 209/var(--tw-bg-opacity));border-color:rgb(214 211 209/var(--tw-border-opacity));border-radius:2px;border-style:solid;border-width:2px;cursor:pointer;height:28px;transition-duration:.2s;width:16px}input[type=range]:hover{opacity:1}
22
22
  `]]]),Au=Object.freeze(Object.defineProperty({__proto__:null,default:hi},Symbol.toStringTag,{value:"Module"})),ju=["onClick","onKeyup"],Pn=ke({__name:"InputSelect",props:on({items:{}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=Cn(e,"modelValue"),o=X(null),i=X({width:"",left:""});Re(()=>{let s=!1;fe(n,l=>{var c;const a=(c=o.value)==null?void 0:c.children[l+1];a&&(i.value={width:a.offsetWidth+"px",left:a.offsetLeft+"px"},a.scrollIntoView({behavior:s?"smooth":"auto",block:"center",inline:"center"}),s=!0)},{immediate:!0})});function r(s){n.value=s}return(s,l)=>(O(),Y("div",{ref_key:"root",ref:o,class:"relative h-8 rounded-[2.5rem] inline-flex bg-black bg-opacity-90 p-1 text-sm overflow-auto max-w-full scrollbar-none leading-none",style:{}},[Z("div",{class:"bg-stone-400 h-6 rounded-2xl absolute top-1 pointer-events-none duration-200",style:ze(i.value)},null,4),(O(!0),Y(Ce,null,bn(t.items,(a,c)=>st((O(),Y("div",{key:c,tabindex:"0",class:Ee(["inline-flex justify-center items-center h-6 rounded-2xl px-3 cursor-pointer relative z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-stone-50 hover:bg-opacity-10 duration-200",{"text-stone-900":c==n.value,"text-stone-400":c!=n.value}]),onClick:()=>r(c),onKeyup:[gs(()=>r(c),["enter"]),gs(()=>r(c),["space"])]},[Ct(Ge(a),1)],42,ju)),[[U(ln),30]])),128))],512))}}),Du=Object.freeze(Object.defineProperty({__proto__:null,default:Pn},Symbol.toStringTag,{value:"Module"})),Ru={class:"flex items-center mb-8 last:mb-0"},Bu={class:"flex-grow overflow-hidden"},Yt=ke({__name:"TableField",props:{label:{},disabled:{type:Boolean}},setup(e){return(t,n)=>(O(),Y("div",Ru,[Z("div",{class:Ee(["flex-shrink-0 w-[4.8rem]",{"opacity-50":t.disabled}])},Ge(t.label),3),Z("div",Bu,[we(t.$slots,"default")])]))}}),Nu=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"})),Fu={},Vu={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Hu=[Z("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1)];function Wu(e,t){return O(),Y("svg",Vu,Hu)}const Ds=he(Fu,[["render",Wu]]),Ku=Object.freeze(Object.defineProperty({__proto__:null,default:Ds},Symbol.toStringTag,{value:"Module"})),qu={},Uu={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 36 36"},Yu=[Z("path",{fill:"currentColor",d:"m32.57 15.72l-3.35-1a11.65 11.65 0 0 0-.95-2.33l1.64-3.07a.61.61 0 0 0-.11-.72l-2.39-2.4a.61.61 0 0 0-.72-.11l-3.05 1.63a11.62 11.62 0 0 0-2.36-1l-1-3.31a.61.61 0 0 0-.59-.41h-3.38a.61.61 0 0 0-.58.43l-1 3.3a11.63 11.63 0 0 0-2.38 1l-3-1.62a.61.61 0 0 0-.72.11L6.2 8.59a.61.61 0 0 0-.11.72l1.62 3a11.63 11.63 0 0 0-1 2.37l-3.31 1a.61.61 0 0 0-.43.58v3.38a.61.61 0 0 0 .43.58l3.33 1a11.62 11.62 0 0 0 1 2.33l-1.64 3.14a.61.61 0 0 0 .11.72l2.39 2.39a.61.61 0 0 0 .72.11l3.09-1.65a11.65 11.65 0 0 0 2.3.94l1 3.37a.61.61 0 0 0 .58.43h3.38a.61.61 0 0 0 .58-.43l1-3.38a11.63 11.63 0 0 0 2.28-.94l3.11 1.66a.61.61 0 0 0 .72-.11l2.39-2.39a.61.61 0 0 0 .11-.72l-1.66-3.1a11.63 11.63 0 0 0 .95-2.29l3.37-1a.61.61 0 0 0 .43-.58v-3.41a.61.61 0 0 0-.37-.59ZM18 23.5a5.5 5.5 0 1 1 5.5-5.5a5.5 5.5 0 0 1-5.5 5.5Z",class:"clr-i-solid clr-i-solid-path-1"},null,-1),Z("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)];function Xu(e,t){return O(),Y("svg",Uu,Yu)}const Rs=he(qu,[["render",Xu]]),Zu=Object.freeze(Object.defineProperty({__proto__:null,default:Rs},Symbol.toStringTag,{value:"Module"}));function Gu(e){if(e)try{return JSON.parse(e)}catch{return}}function Qu(e){return String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}var ct=(e=>(e[e.vertical=0]="vertical",e[e.ltr=1]="ltr",e[e.rtl=2]="rtl",e))(ct||{}),Mt=(e=>(e[e.longStrip=0]="longStrip",e[e.single=1]="single",e[e.double=2]="double",e))(Mt||{});const Ju=.25,ed=5,td=.25,On=.2,Mn=5,nd=.05,od=0,id=4,Bs=5;function rd(e){var _,w,j,m,L,z,J;const{titleName:t,isWebtoon:n}=e,o=se(()=>t.value?Qu(t.value):location.hostname),i=X(sd(`tkr:${o.value}`)),r=y=>{i.value=y;const g=`tkr:${o.value}`;!y||!Object.keys(y).length?localStorage.removeItem(g):localStorage.setItem(g,JSON.stringify(y))},s=y=>{if(!i.value){r(y);return}const g={...i.value};Object.entries(y).forEach(([V,G])=>{G===void 0?delete g[V]:g[V]=G}),r(g)},l=X(((_=i.value)==null?void 0:_.style)??e.defaultStyle??Mt.longStrip),a=X(((w=i.value)==null?void 0:w.direction)??e.defaultDirection??ct.vertical),c=X((j=i.value)==null?void 0:j.gap),u=X(((m=i.value)==null?void 0:m.speed)??1),d=X(((L=i.value)==null?void 0:L.zoom)??1),p=X(((z=i.value)==null?void 0:z.breakFirst)??!1),x=X(((J=i.value)==null?void 0:J.autoNextSeconds)??Bs),R=se({get(){return n.value?Mt.longStrip:l.value},set:y=>{l.value=y,s({style:y}),y!==Mt.longStrip&&a.value===ct.vertical&&($.value=ct.rtl)}}),$=se({get:()=>n.value?ct.vertical:a.value,set:y=>{a.value=y,s({direction:y})}}),F=se({get:()=>c.value!==void 0?c.value:e.maybeWebtoon.value||R.value!==Mt.longStrip?0:1,set(y){c.value=y,s({gap:y})}}),C=se({get:()=>u.value,set(y){u.value=y,s({speed:y===1?void 0:y})}}),B=se({get:()=>d.value,set(y){d.value=y,s({zoom:y===1?void 0:y})}}),b=se({get:()=>p.value,set(y){p.value=y,s({breakFirst:y?!0:void 0})}}),M=se({get:()=>x.value,set(y){x.value=y,s({autoNextSeconds:y===Bs?void 0:y})}});return{direction:$,style:R,gap:F,speed:C,zoom:B,isLongStrip:se(()=>R.value===Mt.longStrip),isDouble:se(()=>R.value===Mt.double),isRTL:se(()=>$.value===ct.rtl),isVertical:se(()=>$.value===ct.vertical),breakFirst:b,autoNextSeconds:M}}function sd(e){const t=localStorage.getItem(e),n=Gu(t),o={};return n?(n.style!==void 0&&Object.values(Mt).includes(n.style)&&(o.style=n.style),n.direction!==void 0&&Object.values(ct).includes(n.direction)&&(o.direction=n.direction),n.gap!==void 0&&n.gap>=od&&n.gap<=id&&(o.gap=n.gap),n.speed!==void 0&&n.speed>=On&&n.speed<=Mn&&(o.speed=n.speed),n.zoom!==void 0&&n.zoom>=On&&n.zoom<=Mn&&(o.zoom=n.zoom),n.breakFirst===!0&&(o.breakFirst=!0),n.autoNextSeconds<=5&&n.autoNextSeconds>=-1&&(o.autoNextSeconds=n.autoNextSeconds),Object.keys(o).length?o:void 0):o}const Ns=ke({__name:"ButtonReaderSettings",props:{name:{},direction:{},readerStyle:{},gap:{},autoNextSeconds:{},speed:{},zoom:{},webtoon:{type:Boolean},disabled:{type:Boolean}},emits:["update:reader-style","update:direction","update:gap","update:autoNextSeconds","update:speed","update:zoom","help"],setup(e,{emit:t}){const n=e,o=t,i=X(!1),r=se(()=>n.name??location.hostname);vo({onKeyUp:a=>{a.key==="s"&&!a.metaKey&&!a.ctrlKey&&(i.value=!i.value)}});function s(a){o("update:zoom",Math.round(a)/100)}function l(){i.value=!1,o("help")}return(a,c)=>(O(),Y(Ce,null,[Q(tt,{title:"Reader settings (S)",disabled:a.disabled,onClick:c[0]||(c[0]=()=>i.value=!0)},{default:ie(()=>[Q(Rs)]),_:1},8,["disabled"]),Q(js,{modelValue:i.value,"onUpdate:modelValue":c[6]||(c[6]=u=>i.value=u),name:r.value},{actions:ie(()=>[Q(tt,{transparent:"",onClick:l},{default:ie(()=>[Q(Ds)]),_:1})]),default:ie(()=>[Q(Yt,{label:"Style"},{default:ie(()=>[Q(Pn,{"model-value":a.readerStyle,items:a.webtoon?["Long strip"]:["Long strip","Single page","Double page"],"onUpdate:modelValue":c[1]||(c[1]=u=>o("update:reader-style",u))},null,8,["model-value","items"])]),_:1}),Q(Yt,{label:"Direction"},{default:ie(()=>[Q(Pn,{"model-value":a.direction,items:a.webtoon?["Vertical"]:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":c[2]||(c[2]=u=>o("update:direction",u))},null,8,["model-value","items"])]),_:1}),Q(Yt,{label:"Gap"},{default:ie(()=>[Q(Pn,{"model-value":a.gap,items:["None","XS","SM","M","L","XL"],"onUpdate:modelValue":c[3]||(c[3]=u=>o("update:gap",u))},null,8,["model-value"])]),_:1}),Q(Yt,{label:"Auto Next"},{default:ie(()=>[Q(Pn,{"model-value":a.autoNextSeconds<0?0:a.autoNextSeconds,items:["None","1s","2s","3s","4s","5s"],"onUpdate:modelValue":c[4]||(c[4]=u=>o("update:autoNextSeconds",u===0?-1:u))},null,8,["model-value"])]),_:1}),Q(Yt,{label:"Speed"},{default:ie(()=>[Q(hi,{"model-value":a.speed,min:U(Ju),max:U(ed),step:U(td),suffix:"x","onUpdate:modelValue":c[5]||(c[5]=u=>o("update:speed",u))},{suffix:ie(()=>[Ct(Ge(a.speed.toFixed(2))+"x ",1)]),_:1},8,["model-value","min","max","step"])]),_:1}),Q(Yt,{label:"Zoom"},{default:ie(()=>[Q(hi,{"model-value":Math.ceil(a.zoom*100),min:U(On)*100,max:U(Mn)*100,step:U(nd)*100,"onUpdate:modelValue":s},{suffix:ie(()=>[Ct(Ge(Math.ceil(a.zoom*100))+"% ",1)]),_:1},8,["model-value","min","max","step"])]),_:1})]),_:1},8,["modelValue","name"])],64))}}),ld=Object.freeze(Object.defineProperty({__proto__:null,default:Ns},Symbol.toStringTag,{value:"Module"})),ad={},cd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ud=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("circle",{cx:"14",cy:"14",r:"12"}),Z("path",{d:"m23 23l7 7M9 12V9h3m4 0h3v3M9 16v3h3m7-3v3h-3"})],-1)];function dd(e,t){return O(),Y("svg",cd,ud)}const Fs=he(ad,[["render",dd]]),fd=Object.freeze(Object.defineProperty({__proto__:null,default:Fs},Symbol.toStringTag,{value:"Module"})),pd={class:"h-9 rounded-full inline-flex justify-between items-center bg-black bg-opacity-50 gap-1 py-2 px-3 pointer-events-auto hover:bg-stone-900 hover:bg-opacity-50 duration-200",title:"Reset zoom"},hd={class:"block w-4 h-4"},gd={class:"w-12"},Vs=ke({__name:"ButtonResetZoom",props:{zoom:{}},setup(e){return(t,n)=>(O(),Y("button",pd,[Z("div",hd,[Q(Fs)]),Z("div",gd,Ge(Math.ceil(t.zoom*100))+"%",1)]))}}),md=Object.freeze(Object.defineProperty({__proto__:null,default:Vs},Symbol.toStringTag,{value:"Module"}));async function an(e,t,n){const o=await n(()=>{e=0});if(o!==void 0)return o;if(!(e<=0))return await new Promise(i=>{setTimeout(async()=>{const r=await an(e-1,t,n);i(r)},t)})}const vd={},bd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},yd=[ac('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>',3)];function _d(e,t){return O(),Y("svg",bd,yd)}const Hs=he(vd,[["render",_d]]),wd=Object.freeze(Object.defineProperty({__proto__:null,default:Hs},Symbol.toStringTag,{value:"Module"})),xd={},Sd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},kd=[Z("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"},null,-1)];function Cd(e,t){return O(),Y("svg",Sd,kd)}const Ws=he(xd,[["render",Cd]]),Id=Object.freeze(Object.defineProperty({__proto__:null,default:Ws},Symbol.toStringTag,{value:"Module"})),Ed=["aria-hidden"],Td=["onClick"],$d={class:"inline-flex items-center justify-center w-full h-full px-4 rounded-full group-hover:bg-stone-100 group-hover:bg-opacity-20 duration-200"},Pd={class:"whitespace-nowrap"},gi=ke({__name:"ButtonDropdown",props:on({label:{},title:{},items:{},disabled:{type:Boolean},canLoadItems:{type:Boolean},loadItems:{type:Function}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:on(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=Cn(e,"modelValue"),r=X(null),s=X(!1),l=X(!1),a=X(!1),c=X(!1),u=X(!1),d={mounted:m=>{var L;(L=m.children[i.value])==null||L.scrollIntoView({behavior:"auto",block:"center",inline:"center"})}};vo({onKeyDown:C});const p=pi();async function x(){if(!n.items.length&&(s.value||await R(),!n.items.length)){s.value=!1;return}s.value=!s.value,p(s.value),s.value?($(),b(r.value)):setTimeout(M,250)}async function R(){l.value||n.items.length||!n.canLoadItems||!n.loadItems||(l.value=!0,await n.loadItems(),l.value=!1)}function $(){const m=r.value;if(m){const L=m.getBoundingClientRect(),z=L.x+L.width/2;a.value=L.y>window.innerHeight/2,c.value=z<window.innerWidth/3,u.value=z>window.innerWidth/3*2}}function F(m,L){x(),m!=i.value&&(i.value=m,o("select",m,L))}function C(m){s.value&&m.key==="Escape"&&(x(),m.preventDefault())}let B=[];function b(m){const L=window.getComputedStyle(m).zIndex,z=m.style.zIndex;(!L||!(+L>0))&&((!m.parentElement||m.parentElement.childElementCount>1)&&(m.style.zIndex="1",B.push({el:m,zIndex:z})),m.parentElement&&b(m.parentElement))}function M(){B.forEach(({el:m,zIndex:L})=>{m.style.zIndex=L??""}),B=[]}let _=!1;function w(){_||(_=!0,p(!0,{desktopOnly:!0}))}function j(){_&&(_=!1,p(!1,{desktopOnly:!0}))}return(m,L)=>(O(),Y("div",{ref_key:"root",ref:r,class:"select-none relative inline-flex"},[s.value?(O(),Y("div",{key:0,class:"fixed inset-0 bg-transparent",onClick:x})):ye("",!0),m.items.length?(O(),pe(rn,{key:1,name:"slide-fade","enter-from-class":"scale-y-90 opacity-0 pointer-events-none","leave-to-class":"scale-y-90 opacity-0 pointer-events-none"},{default:ie(()=>[s.value?st((O(),Y("ul",{key:0,ref:"list","aria-hidden":!s.value,class:Ee(["scrollbar-sm duration-150 delay-50 absolute w-40 max-h-[70vh] list-none bg-stone-800 bg-opacity-80 backdrop-blur-md rounded-lg overflow-auto",{"origin-bottom bottom-full -translate-y-1.5":a.value,"origin-top top-full translate-y-1.5":!a.value,"left-1/2 -ml-20 text-center":!c.value&&!u.value,"right-0 text-right":u.value}]),onWheelPassive:L[0]||(L[0]=Ke(()=>{},["stop"]))},[(O(!0),Y(Ce,null,bn(m.items,(z,J)=>st((O(),Y("li",{key:J,tabindex:"-1",class:Ee(["h-10 px-4 last:border-b-transparent cursor-pointer hover:bg-stone-100 hover:bg-opacity-10 duration-100",{"text-primary":J===i.value}]),onClick:y=>F(J,y)},[Z("div",{class:Ee(["h-full py-2",{"border-t-[1px] border-solid border-stone-400 border-opacity-30":J>0}])},[we(m.$slots,"item",{item:z},()=>[Ct(Ge(z),1)])],2)],10,Td)),[[U(ln),30]])),128))],42,Ed)),[[d]]):ye("",!0)]),_:3})):ye("",!0),st((O(),Y("button",Sn({type:"button",tabindex:"-1",class:["w-full h-10 max-h-full rounded-full bg-black bg-opacity-50 group duration-100",{"pointer-events-none text-stone-400":m.disabled||l.value}]},m.title?{title:m.title}:{},{onClick:Ke(x,["stop"]),onMouseenter:w,onMouseleave:j}),[Z("div",$d,[Z("span",Pd,Ge(m.label),1),m.items.length||m.canLoadItems?(O(),Y("span",{key:0,class:Ee(["w-4 h-4 flex ml-1 -mr-3 flex-shrink-0",{"rotate-180":a.value}]),"aria-hidden":"true"},[l.value?(O(),pe(Hs,{key:0})):(O(),pe(Ws,{key:1}))],2)):ye("",!0)])],16)),[[U(ln),30]])],512))}}),Od=Object.freeze(Object.defineProperty({__proto__:null,default:gi},Symbol.toStringTag,{value:"Module"})),Ks=ke({__name:"ChapterNav",props:{data:{},chapterSpec:{},touchDevice:{type:Boolean}},emits:["getHiddenChapters","chaptersDialogOpen"],setup(e,{emit:t}){const n=e,o=t;async function i(){const a=n.chapterSpec;if(!a)return;const{trigger:c,sel:u,label:d}=a;if(c&&(!u||!d)){await r(c);return}o("getHiddenChapters"),await an(50,50,()=>n.data.chapters.length?!0:void 0)}async function r(a){const c=document.querySelector(a);c&&(c instanceof HTMLDialogElement?c.showModal():c.click(),o("chaptersDialogOpen"))}function s(a,c){var u,d,p;(p=(d=(u=n.data)==null?void 0:u.chapters)==null?void 0:d[a])==null||p.select(l(c))}function l(a){return!n.touchDevice&&(a.ctrlKey||a.metaKey)}return(a,c)=>{var u;return O(),pe(gi,{modelValue:a.data.activeIndex,label:a.data.activeLabel,title:"Select chapter",items:a.data.chapters,"can-load-items":!!((u=a.chapterSpec)!=null&&u.trigger),"load-items":i,onSelect:s},{item:ie(({item:d})=>[Ct(Ge(d.label),1)]),_:1},8,["modelValue","label","items","can-load-items"])}}}),Md=Object.freeze(Object.defineProperty({__proto__:null,default:Ks},Symbol.toStringTag,{value:"Module"})),Ld={},zd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Ad=[Z("path",{fill:"currentColor",d:"M11.3 19.3q-.275-.275-.288-.7t.263-.7l4.9-4.9H5q-.425 0-.713-.288T4 12q0-.425.288-.713T5 11h11.175l-4.9-4.9q-.275-.275-.263-.7t.288-.7q.275-.275.7-.275t.7.275l6.6 6.6q.15.125.213.313t.062.387q0 .2-.062.375t-.213.325l-6.6 6.6q-.275.275-.7.275t-.7-.275Z"},null,-1)];function jd(e,t){return O(),Y("svg",zd,Ad)}const qs=he(Ld,[["render",jd]]),Dd=Object.freeze(Object.defineProperty({__proto__:null,default:qs},Symbol.toStringTag,{value:"Module"})),Us=ke({__name:"DirectionToast",props:{direction:{}},setup(e){const t=e,n=sessionStorage.getItem("tk:dir"),o=X(typeof n!="string"||+n!==t.direction),i=Ne(()=>o.value=!1,1250);fe(()=>t.direction,()=>{r(),o.value=!0,i()}),Re(()=>{r(),i();let s;const l=Es();fe(l,a=>{a!=="visible"?s=Date.now():Date.now()-s>7e3&&(o.value=!0,i())})});function r(){sessionStorage.setItem("tk:dir",t.direction+"")}return(s,l)=>(O(),pe(rn,{name:"slow-fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ie(()=>[o.value?(O(),Y("div",{key:0,class:Ee(["fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none w-28 h-24 p-4 bg-black bg-opacity-40 rounded-2xl duration-500",{"rotate-90":s.direction===U(ct).vertical,"rotate-180":s.direction===U(ct).rtl}])},[Q(qs)],2)):ye("",!0)]),_:1}))}}),Rd=Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"})),Bd=Z("div",{class:"fixed inset-0 bg-black bg-opacity-90"},null,-1),Ys=ke({__name:"HelpScreen",props:{touchDevice:{type:Boolean}},emits:["hide"],setup(e,{emit:t}){const n=e,o=t,i=X(null),r=X([]);Re(async()=>{const c=$s(i),u=Ne(()=>{s({width:c.width.value,height:c.height.value})},50);u(),fe(c.width,u),fe(c.height,u)});function s(c){var p;const u=(p=i.value)==null?void 0:p.parentElement;if(!u)return;const d=Array.from(u.querySelectorAll("#controls [title]"));d.length&&(r.value=l(d,c))}function l(c,u){const d=[],p=[];let x=0,R=0;const $=50,F=25;c.forEach(_=>{var z;const w=(z=_.getAttribute("title"))==null?void 0:z.trim(),j=_.getBoundingClientRect();if(!w||!j.height||!j.width)return;const m=Math.ceil((j.top-10)/$),L=Math.ceil((j.left-10)/$);p.push({isTour:!1,title:w,rect:j,fromX:L,toX:Math.max(L+1,Math.ceil((j.right+10)/$)),fromY:m,toY:Math.max(m+1,Math.ceil((j.bottom+10)/$))})}),p.forEach(_=>{for(let w=_.fromY;w<_.toY;w++){d[w]??(d[w]=[]);for(let j=_.fromX;j<_.toX;j++)d[w][j]=_;_.toY>x+1&&(x=_.toY-1),_.toX>R+1&&(R=_.toX-1)}});let C=R/2;p.forEach(_=>{_.isAlignRight=_.fromX>C});const B=(_,w)=>{d[w]??(d[w]=[]);const j=w>=_.toY;if(_.isTour)for(let m=_.fromX;m<_.toX;m++)delete d[_.fromY][m],_.fromY=w,_.toY=w+(j?1:-1),d[w][m]=_;else{const m=_.isAlignRight?_.fromX-3:_.fromX,L=m+3;_.helpItem={fromX:m,toX:L,fromY:w,toY:w+1,isTour:!0,isAlignRight:_.isAlignRight};for(let z=m;z<L;z++)d[w][z]=_.helpItem}},b=(_,w)=>{if(w>x||w<0)return!1;const j=w>=_.toY,m=d[w];if(!m)return B(_,w),!0;const L=m[_.fromX];if(L&&!L.isTour)return!1;if(L&&L.isTour)return b(L,j?w+1:w-1)?(B(_,w),!0):!1;if(!L){const z=_.isAlignRight?-1:1;return m[_.fromX+z]||m[_.fromX+z*2]?b(_,j?w+1:w-1):(B(_,w),!0)}return!1};p.forEach(_=>{if(!b(_,_.toY)){if(_.isAlignRight){const w=d[_.fromY]??[];if(!w.slice(_.fromX-3,_.fromX).filter(Boolean).length){const m=_.fromX-3,L=_.fromX;_.helpItem={isTour:!0,isAlignRight:!0,fromX:m,toX:L,fromY:_.fromY,toY:_.toY};for(let z=_.fromX-3;z<_.fromX;z++)w[z]=_.helpItem;return}}b(_,_.fromY-1)}});const M=[];return p.forEach(_=>{const{title:w,helpItem:j,rect:m,isAlignRight:L,fromX:z,fromY:J,toY:y}=_;if(!w||!j||!m)return;const g=j.fromY>=y,V=j.toY<=J;M.push({title:a(w),style:{top:g?`${m.bottom+(j.fromY-y)*$+F}px`:V?void 0:`${m.top+8}px`,bottom:V?`${u.height-m.top+(j.toY-J)*$+F}px`:void 0,left:L?void 0:`${m.left}px`,right:L?g?`${u.width-m.right}px`:`${u.width-m.right+m.width+F}px`:void 0},arrowStyle:{width:V||g?"2px":`${Math.abs(j.toX-z)*$+F-5}px`,height:V||g?`${(g?j.fromY-y:J-j.toY)*$+F}px`:"2px",top:g?`${m.bottom}px`:V?void 0:`${m.top+20}px`,bottom:V?`${u.height-m.top}px`:void 0,left:L?void 0:`${m.left+m.width/2}px`,right:L?g?`${u.width-m.right+m.width/2}px`:`${u.width-m.right+m.width}px`:void 0}})}),M}function a(c){return n.touchDevice?c.split("(")[0].trim():c}return(c,u)=>(O(),Y(Ce,null,[Bd,Z("div",{ref_key:"root",ref:i,class:"fixed inset-0 z-20 overscroll-contain select-none",onClick:u[0]||(u[0]=Ke(d=>o("hide"),["stop"]))},[(O(!0),Y(Ce,null,bn(r.value,d=>(O(),Y(Ce,{key:d.title},[Z("div",{class:"absolute",style:ze(d.style)},Ge(d.title),5),Z("div",{class:"absolute bg-stone-300 rounded-lg",style:ze(d.arrowStyle)},null,4)],64))),128))],512)],64))}}),Nd=Object.freeze(Object.defineProperty({__proto__:null,default:Ys},Symbol.toStringTag,{value:"Module"})),Xs=ke({__name:"PageNav",props:on({disabled:{type:Boolean},pages:{},totalImgs:{}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=Cn(e,"modelValue"),o=se(()=>t.pages.map(a=>a.map(({index:c})=>`${c+1}`).join("-"))),i=se(()=>{const a=n.value,c=t.pages.findIndex(u=>u.some(({index:d})=>d===a));return c===-1?t.pages.length-1:c}),r=se(()=>t.pages.length?`${o.value[i.value]}/${t.totalImgs}`:"--");function s(a){const c=t.pages[a][0].index;l(c)}function l(a){n.value=a}return(a,c)=>(O(),pe(gi,{"model-value":i.value,label:r.value,title:"Current page",items:o.value,disabled:a.disabled,"onUpdate:modelValue":s},null,8,["model-value","label","items","disabled"]))}}),Fd=Object.freeze(Object.defineProperty({__proto__:null,default:Xs},Symbol.toStringTag,{value:"Module"})),Vd={},Hd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Wd=[Z("path",{d:"M199.9 416h-63.8c-4.5 0-8.1-3.6-8.1-8V104c0-4.4 3.6-8 8.1-8h63.8c4.5 0 8.1 3.6 8.1 8v304c0 4.4-3.6 8-8.1 8z",fill:"currentColor"},null,-1),Z("path",{d:"M375.9 416h-63.8c-4.5 0-8.1-3.6-8.1-8V104c0-4.4 3.6-8 8.1-8h63.8c4.5 0 8.1 3.6 8.1 8v304c0 4.4-3.6 8-8.1 8z",fill:"currentColor"},null,-1)];function Kd(e,t){return O(),Y("svg",Hd,Wd)}const mi=he(Vd,[["render",Kd]]),qd=Object.freeze(Object.defineProperty({__proto__:null,default:mi},Symbol.toStringTag,{value:"Module"})),Ud={},Yd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Xd=[Z("path",{d:"M128 104.3v303.4c0 6.4 6.5 10.4 11.7 7.2l240.5-151.7c5.1-3.2 5.1-11.1 0-14.3L139.7 97.2c-5.2-3.3-11.7.7-11.7 7.1z",fill:"currentColor"},null,-1)];function Zd(e,t){return O(),Y("svg",Yd,Xd)}const vi=he(Ud,[["render",Zd]]),Gd=Object.freeze(Object.defineProperty({__proto__:null,default:vi},Symbol.toStringTag,{value:"Module"})),Zs=he(ke({__name:"PauseToast",props:{playing:{type:Boolean}},setup(e){const t=e,n=X(0);return fe(()=>t.playing,()=>{n.value=Date.now()}),(o,i)=>n.value?(O(),Y("div",{key:n.value,class:"animate-pause-fade fixed left-1/2 top-1/2 -mx-12 -my-12 pointer-events-none w-24 h-24 p-4 bg-black bg-opacity-40 rounded-full duration-500"},[o.playing?(O(),pe(vi,{key:0})):(O(),pe(mi,{key:1}))])):ye("",!0)}}),[["styles",[`.animate-pause-fade{animation:pause-fade .4s linear forwards;transform-origin:center}@keyframes pause-fade{0%{opacity:0;transform:scale(.3)}10%{opacity:1;transform:scale(.35)}55%{opacity:1;transform:scale(.65)}to{opacity:0;transform:scale(1)}}
23
23
  `]]]),Qd=Object.freeze(Object.defineProperty({__proto__:null,default:Zs},Symbol.toStringTag,{value:"Module"})),Gs=ke({__name:"GesturesContainer",props:{zoom:{},zooming:{type:Boolean},pageIndex:{},playController:{},rtl:{type:Boolean},horizontal:{type:Boolean},longStrip:{type:Boolean},touchDevice:{type:Boolean},busy:{type:Boolean}},emits:["update:zoom","update:zooming","dragEnd","click"],setup(e,{emit:t}){const n=e,o=t,i=X(null),r=X(Math.min(Mn,Math.max(On,n.zoom))),s=X(!1),l=X(!1),a={isZoomIn:!1,isZoomOut:!1,initial:void 0};fe(()=>n.zoom,g=>y(g)),Re(()=>{n.touchDevice?Ot(i,"touchstart",F):(Ot(i,"mousedown",p),Ot(window,"wheel",w))}),vo({onKeyDown:g=>{var V;if(!n.busy&&((V=i.value)==null||V.focus(),!(g.key==="Meta"||g.key==="Control")&&(g.ctrlKey||g.metaKey)))switch(g.key){case"0":y(1);break;case"-":y(r.value-.2),g.preventDefault();break;case"=":case"+":y(r.value+.2),g.preventDefault();break}},onKeyUp:g=>{n.zooming&&!(g.ctrlKey||g.metaKey)&&L()}});function c(g){l.value!==g&&(l.value=g,g?n.playController.pause():(o("dragEnd"),n.playController.resume()))}let u={x:0,y:0},d={x:0,y:0};function p(g){g.button===0&&(u={x:g.clientX,y:g.clientY},d={x:i.value.scrollLeft,y:i.value.scrollTop},window.addEventListener("mousemove",x),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",x),setTimeout(()=>c(!1))},{once:!0}),g.preventDefault(),g.stopPropagation())}function x(g){c(!0);const V=g.clientX-u.x,G=g.clientY-u.y,re=i.value;re.scrollLeft=d.x-V,re.scrollTop=d.y-G}let R={distance:0,zoom:r.value,x:0,y:0},$=!1;function F(g){n.busy||($=g.touches.length===2,$&&(o("update:zooming",!0),c(!0),g.stopPropagation(),g.preventDefault(),R={distance:j(g),zoom:r.value,x:(g.touches[0].clientX+g.touches[1].clientX)/2,y:(g.touches[0].clientY+g.touches[1].clientY)/2}),($||n.longStrip&&n.playController.isPlaying.value)&&window.addEventListener("touchend",C,{once:!0}))}function C(){if($=!1,n.zooming){c(!1),L();return}if(!l.value)return;const g=Ne(()=>{c(!1),i.value.removeEventListener("scroll",G)},200),V=setTimeout(g,200);i.value.addEventListener("scroll",G);function G(){clearTimeout(V),g()}}function B(g){if(!(!$&&!(n.longStrip&&n.playController.isPlaying.value))&&(c(!0),n.zooming)){g.stopPropagation(),g.preventDefault();const G=j(g)/R.distance;J(Math.ceil(G*R.zoom*100)/100,R)}}const b=Ne(()=>s.value=!1,100);let M=!1;const _=Ne(()=>{M=!1},30);function w(g){if(n.busy)return;let V=n.zooming;if(M||(M=!0,V=g.ctrlKey||g.metaKey,V&&o("update:zooming",!0)),_(),V){g.stopPropagation(),g.preventDefault();const G=Math.ceil((r.value+g.deltaY*-.01)*100)/100;J(G,{x:g.clientX,y:g.clientY});return}n.horizontal&&(s.value||(s.value=!0),b(),g.deltaY&&(i.value&&(i.value.scrollLeft+=g.deltaY*(n.rtl?-1:1)),g.stopPropagation()))}function j(g){return Math.hypot(g.touches[0].clientX-g.touches[1].clientX,g.touches[0].clientY-g.touches[1].clientY)}function m(g){!l.value&&!n.zooming&&o("click",g)}function L(){o("update:zooming",!1),a.initial=void 0,a.isZoomIn=!1,a.isZoomOut=!1}function z(){if(a.initial)return;const g=i.value;if(!g)return;const V=g.querySelector(`[data-index="${n.pageIndex}"],[data-index2="${n.pageIndex}"]`)??void 0;V&&(a.initial={el:V,rect:V.getBoundingClientRect()})}function J(g,V){if(a.isZoomIn=a.isZoomIn||!a.isZoomOut&&g>1,a.isZoomIn&&g<1){y(1,V);return}if(a.isZoomOut=a.isZoomOut||!a.isZoomIn&&g<1,a.isZoomOut&&g>1){y(1,V);return}y(g,V)}async function y(g,V){const G=i.value,re=Math.min(Mn,Math.max(On,g));if(!G||r.value===re)return;z();const{initial:I}=a;if(!I)return;const K=(V==null?void 0:V.x)??G.clientWidth/2,le=(V==null?void 0:V.y)??G.clientHeight/2;r.value=re,o("update:zoom",re),await ht();const{el:ue,rect:be}=I,_e=ue.offsetWidth/be.width,Ue=ue.offsetHeight/be.height;G.scrollLeft=ue.offsetLeft-be.left*_e+K*(_e-1),G.scrollTop=ue.offsetTop-be.top*Ue+le*(Ue-1)}return(g,V)=>(O(),Y("div",{ref_key:"root",ref:i,tabindex:"0",class:Ee(["w-full h-full overflow-auto scrollbar-none overscroll-contain scrollbar-none focus:outline-none touch-pan-x touch-pan-y",{"!snap-none":!g.longStrip&&(l.value||s.value||g.zooming),"cursor-grabbing":!g.touchDevice&&l.value,"overflow-hidden":g.zooming}]),style:ze({"font-size":`${r.value}px`}),onClick:Ke(m,["stop"]),onTouchmoveCapture:Ke(B,["stop"])},[we(g.$slots,"default")],38))}}),Jd=Object.freeze(Object.defineProperty({__proto__:null,default:Gs},Symbol.toStringTag,{value:"Module"})),ef=`.loading-indicator{display:inline-block;height:80px;position:relative;width:80px}.loading-indicator:after,.loading-indicator:before{animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border:4px solid #b85c38;border-radius:9999px;content:"";display:block;opacity:1;position:absolute}.loading-indicator:after{animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:36px;opacity:0;top:36px;width:0}4.9%{height:0;left:36px;opacity:0;top:36px;width:0}5%{height:0;left:36px;opacity:1;top:36px;width:0}to{height:72px;left:0;opacity:0;top:0;width:72px}}
24
- `,tf={},nf={class:"loading-indicator"};function of(e,t){return O(),Y("div",nf)}const bi=he(tf,[["render",of],["styles",[ef]]]),rf=Object.freeze(Object.defineProperty({__proto__:null,default:bi},Symbol.toStringTag,{value:"Module"}));function yi(e,t){return(e==null?void 0:e.querySelector(`[data-index="${t}"],[data-index2="${t}"]`))??void 0}const sf=["data-index"],lf={key:0,class:"img img--loading"},af=["src"],cf=["data-index"],Qs=he(ke({__name:"ReaderBody",props:{page:{},pageIndex:{},direction:{},isLongStrip:{type:Boolean},isVertical:{type:Boolean},isDouble:{type:Boolean},isRTL:{type:Boolean},pages:{},totalImgs:{},gap:{},zoom:{},zooming:{type:Boolean},spaceTop:{},touchDevice:{type:Boolean},playController:{},busy:{type:Boolean},idle:{type:Boolean},hasNext:{type:Boolean}},emits:["ready","update:zoom","update:zooming","update:playing","dragEnd","click","end","prev","next"],setup(e,{emit:t}){const n=e,o=t,i=Is(),r=X(null),s=Ls(),l=X(n.pageIndex),a=se(()=>{const{width:C,height:B}=s,b=n.isLongStrip?n.isVertical?C.value:B.value:Math.min(C.value,B.value);return Math.min(4,Math.max(1,Math.ceil(b/400-1)))*n.gap}),c=X(n.isLongStrip?{min:n.pageIndex-1,max:n.pageIndex}:x()),u=se(()=>{const{min:C,max:B}=c.value,b={};for(let M=C;M<=B;M++)b[M]=!0;return b}),d=se(()=>{const{width:{value:C},height:{value:B}}=s;return n.pages.map(b=>{var y;const M=b.some(g=>{var V;return(V=g.img)==null?void 0:V.isLoading}),_=b.map(g=>g.index),w={isLoading:M,indexes:_,visible:!1};if(M||_[_.length-1]<l.value)return w;const j=b.map(({img:g})=>g).filter(Boolean);if(!j.length||(w.srcs=j.map(({src:g})=>g),j.every(g=>g.hasError)))return w;const L=(y=j.find(g=>!g.hasError))==null?void 0:y.size,z=j.reduce((g,V)=>{var G;return g+(((G=V.size)==null?void 0:G.width)??L.width)},0),J=j.reduce((g,V)=>{var G;return g+(((G=V.size)==null?void 0:G.height)??L.height)},0)/j.length;return n.isLongStrip&&n.isVertical||!n.isLongStrip&&C/z<B/J?(w.width=Math.min(C,z),w.height=J*(w.width/z)):(w.height=Math.min(B,J),w.width=z*(w.height/J)),w})}),p=se(()=>{const C=n.isVertical?"width":"height";return d.value.map(B=>B[C]).filter(Boolean).sort((B,b)=>b-B)[0]});Re(()=>{const C=yi(i.value,n.pageIndex);C==null||C.scrollIntoView({behavior:"instant",block:"start"});let B,b=!1;Ea(()=>{B!==n.page&&(B=n.page,M(),b||(b=!0,ht(()=>o("ready"))))});async function M(){if(!n.isLongStrip){c.value=x();return}const _=Math.floor(n.page),w=yi(i.value,_);if(!w)return;const j=+R(w).getAttribute("data-index"),m=+$(w).getAttribute("data-index");(j!==c.value.min||m!==c.value.max)&&(c.value={min:j,max:m}),j<l.value&&(l.value=j)}});function x(){const{pageIndex:C}=n,B=n.isDouble?2:1;return{min:C-B,max:C+B}}function R(C){const B=C.previousElementSibling;if(!B)return C;const b=B.getBoundingClientRect();return(n.isVertical?b.y+b.height>-(s.height.value*.5):n.isRTL?b.x<s.width.value*1.5:b.x+b.width>-(s.width.value*.5))?R(B):C}function $(C){const B=C.nextElementSibling;if(!B)return C;const b=B.getBoundingClientRect();return(n.isVertical?b.y<s.height.value*1.5:n.isRTL?b.x+b.width>-(s.width.value*.5):b.x<s.width.value*1.5)?$(B):C}function F(C){if(!n.isLongStrip){const B=n.isVertical?s.height.value:s.width.value,M=(n.isVertical?C.clientY:n.isRTL?B-C.clientX:C.clientX)/B;if(M<=.2&&n.pageIndex>0){o("prev");return}else if(M>=.8){o("next");return}}o("click")}return(C,B)=>(O(),pe(Gs,{zoom:C.zoom,zooming:C.zooming,"page-index":C.pageIndex,class:Ee(["rbod",{"rbod--touch":C.touchDevice,"rbod--long-strip":C.isLongStrip,"rbod--paging":!C.isLongStrip,"rbod--vertical":C.isVertical,"rbod--rtl":C.isRTL,"rbod--idle":C.idle,"rbod--first":!C.isLongStrip&&C.pageIndex===0,"rbod--last":!C.isLongStrip&&C.pageIndex===C.totalImgs&&!C.hasNext,"rbod--1page":d.value.length===1}]),"play-controller":C.playController,horizontal:!C.isVertical,rtl:C.isRTL,"touch-device":C.touchDevice,busy:C.busy,"long-strip":C.isLongStrip,style:ze({"--gap":`${a.value}em`,"--space-top":(C.spaceTop||0)+"px","--screen-width-em":U(s).width.value+"em","--screen-height-em":U(s).height.value+"em",...C.isLongStrip?{"--max-size-em":p.value+"em"}:{}}),"onUpdate:zoom":B[0]||(B[0]=b=>o("update:zoom",b)),"onUpdate:zooming":B[1]||(B[1]=b=>o("update:zooming",b)),onDragEnd:B[2]||(B[2]=()=>o("dragEnd")),onClick:F},{default:ie(()=>[(O(!0),Y(Ce,null,bn(d.value,b=>{var M;return O(),Y("div",Sn({key:C.direction+"_"+b.indexes[0],"data-index":b.indexes[0]},b.indexes.length>1?{"data-index2":b.indexes[1]}:{}),[!((M=b.srcs)!=null&&M.length)||b.isLoading?(O(),Y("div",lf,[u.value[b.indexes[0]]?(O(),pe(bi,{key:0})):ye("",!0)])):b.srcs.length==1?(O(),pe(mr(u.value[b.indexes[0]]?"img":"div"),Sn({key:1,class:"img"},u.value[b.indexes[0]]?{src:b.srcs[0]}:{},{style:{width:b.width!==void 0?b.width+"em":"",height:b.height!==void 0?b.height+"em":""}}),null,16,["style"])):(O(),Y("div",{key:2,class:Ee(["img img--double",{"flex-row-reverse":C.isRTL}]),style:ze({width:b.width!==void 0?b.width+"em":"",height:b.height!==void 0?b.height+"em":""})},[b.indexes.some(_=>u.value[_])?(O(!0),Y(Ce,{key:0},bn(b.srcs,_=>(O(),Y("div",{key:_},[Z("img",{src:_},null,8,af)]))),128)):ye("",!0)],6))],16,sf)}),128)),Z("div",{ref_key:"autoNextEl",ref:r,class:"last","data-index":C.totalImgs},[we(C.$slots,"end")],8,cf)]),_:3},8,["zoom","zooming","page-index","play-controller","horizontal","rtl","touch-device","busy","long-strip","class","style"]))}}),[["styles",[`.rbod{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:1024px){.rbod{transform:none}}.rbod--rtl{flex-direction:row-reverse}.rbod.rbod--vertical>div{padding:calc(var(--gap)/2) 0}.rbod:not(.rbod--vertical){align-items:center;display:flex;height:100%;justify-content:flex-start}.rbod:not(.rbod--vertical)>div{padding:0 calc(var(--gap)/2)}.rbod--long-strip.rbod--vertical.rbod--1page>div:first-child{min-height:100vh}.rbod--long-strip.rbod--vertical>div:first-child{margin-top:var(--space-top);padding-top:0}.rbod--long-strip.rbod--vertical>div:last-child{padding-bottom:0}.rbod--long-strip.rbod--vertical>div{width:var(--max-size-em)}.rbod--long-strip.rbod--vertical .img--loading{height:75vh;max-width:100%;width:100vw}.rbod--long-strip.rbod--vertical .last{height:100vh}.rbod--long-strip:not(.rbod--vertical).rbod--1page>div:first-child{min-width:100vw}.rbod--long-strip:not(.rbod--vertical)>div{align-items:center;display:flex;height:var(--max-size-em)}.rbod--long-strip:not(.rbod--vertical) .img--loading{height:100vh;max-height:100%;max-width:100vw;width:680px}.rbod--long-strip:not(.rbod--vertical) .last{width:100vw}.rbod--long-strip>div>img{flex-shrink:0;margin:auto}.rbod--paging:not(.rbod--touch):after,.rbod--paging:not(.rbod--touch):before{content:"";cursor:pointer;display:block;position:fixed;z-index:10}.rbod--paging.rbod--first:before,.rbod--paging.rbod--last:after{cursor:default}.rbod--paging.rbod--idle:after,.rbod--paging.rbod--idle:before{cursor:none}.rbod--paging>div{align-items:center;display:grid;justify-content:center;min-height:100vh;min-width:100vw;scroll-snap-align:center;scroll-snap-stop:always}.rbod--paging.rbod--vertical{--tw-scroll-snap-strictness:mandatory;scroll-snap-type:y var(--tw-scroll-snap-strictness)}.rbod--paging.rbod--vertical:after,.rbod--paging.rbod--vertical:before{height:20vw;left:0;right:0}.rbod--paging.rbod--vertical:before{top:0}.rbod--paging.rbod--vertical:after{bottom:0}.rbod--paging.rbod--vertical>div{width:var(--screen-width-em)}.rbod--paging:not(.rbod--vertical){--tw-scroll-snap-strictness:mandatory;scroll-snap-type:x var(--tw-scroll-snap-strictness)}.rbod--paging:not(.rbod--vertical).rbod--rtl:before{right:0}.rbod--paging:not(.rbod--vertical).rbod--rtl:after,.rbod--paging:not(.rbod--vertical):not(.rbod--rtl):before{left:0}.rbod--paging:not(.rbod--vertical):not(.rbod--rtl):after{right:0}.rbod--paging:not(.rbod--vertical):after,.rbod--paging:not(.rbod--vertical):before{bottom:0;top:0;width:20vw}.rbod--paging:not(.rbod--vertical)>div{height:var(--screen-height-em)}.rbod--paging .img--loading{height:100vh;width:100vw}.rbod--paging .img--double{align-items:center;display:flex;gap:var(--gap);justify-content:center}.rbod--paging .img--double div{display:flex;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod--paging .img--double div img{flex-shrink:0;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.rbod>div{flex-shrink:0;margin:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod .img{--tw-bg-opacity:1!important;background-color:rgb(41 37 36/var(--tw-bg-opacity))!important;margin:auto!important;-o-object-fit:contain!important;object-fit:contain!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.rbod .img--loading{align-items:center;display:flex;justify-content:center}
24
+ `,tf={},nf={class:"loading-indicator"};function of(e,t){return O(),Y("div",nf)}const bi=he(tf,[["render",of],["styles",[ef]]]),rf=Object.freeze(Object.defineProperty({__proto__:null,default:bi},Symbol.toStringTag,{value:"Module"}));function yi(e,t){return(e==null?void 0:e.querySelector(`[data-index="${t}"],[data-index2="${t}"]`))??void 0}const sf=["data-index"],lf={key:0,class:"img img--loading"},af=["src"],cf=["data-index"],Qs=he(ke({__name:"ReaderBody",props:{page:{},pageIndex:{},direction:{},isLongStrip:{type:Boolean},isVertical:{type:Boolean},isDouble:{type:Boolean},isRTL:{type:Boolean},pages:{},totalImgs:{},gap:{},zoom:{},zooming:{type:Boolean},spaceTop:{},touchDevice:{type:Boolean},playController:{},busy:{type:Boolean},idle:{type:Boolean},hasNext:{type:Boolean}},emits:["ready","update:zoom","update:zooming","update:playing","dragEnd","click","end","prev","next"],setup(e,{emit:t}){const n=e,o=t,i=Is(),r=X(null),s=Ls(),l=X(n.pageIndex),a=se(()=>{const{width:C,height:B}=s,b=n.isLongStrip?n.isVertical?C.value:B.value:Math.min(C.value,B.value);return Math.min(4,Math.max(1,Math.ceil(b/400-1)))*n.gap}),c=X(n.isLongStrip?{min:n.pageIndex-1,max:n.pageIndex}:x()),u=se(()=>{const{min:C,max:B}=c.value,b={};for(let M=C;M<=B;M++)b[M]=!0;return b}),d=se(()=>{const{width:{value:C},height:{value:B}}=s;return n.pages.map(b=>{var y;const M=b.some(g=>{var V;return(V=g.img)==null?void 0:V.isLoading}),_=b.map(g=>g.index),w={isLoading:M,indexes:_,visible:!1};if(M||_[_.length-1]<l.value)return w;const j=b.map(({img:g})=>g).filter(Boolean);if(!j.length||(w.srcs=j.map(({src:g})=>g),j.every(g=>g.hasError)))return w;const L=(y=j.find(g=>!g.hasError))==null?void 0:y.size,z=j.reduce((g,V)=>{var G;return g+(((G=V.size)==null?void 0:G.width)??L.width)},0),J=j.reduce((g,V)=>{var G;return g+(((G=V.size)==null?void 0:G.height)??L.height)},0)/j.length;return n.isLongStrip&&n.isVertical||!n.isLongStrip&&C/z<B/J?(w.width=Math.min(C,z),w.height=J*(w.width/z)):(w.height=Math.min(B,J),w.width=z*(w.height/J)),w})}),p=se(()=>{const C=n.isVertical?"width":"height";return d.value.map(B=>B[C]).filter(Boolean).sort((B,b)=>b-B)[0]});Re(()=>{const C=yi(i.value,n.pageIndex);C==null||C.scrollIntoView({behavior:"instant",block:"start"});let B,b=!1;Ea(()=>{B!==n.page&&(B=n.page,M(),b||(b=!0,ht(()=>o("ready"))))});async function M(){if(!n.isLongStrip){c.value=x();return}const _=Math.floor(n.page),w=yi(i.value,_);if(!w)return;const j=+R(w).getAttribute("data-index"),m=+$(w).getAttribute("data-index");(j!==c.value.min||m!==c.value.max)&&(c.value={min:j,max:m}),j<l.value&&(l.value=j)}});function x(){const{pageIndex:C}=n,B=n.isDouble?2:1;return{min:C-B,max:C+B}}function R(C){const B=C.previousElementSibling;if(!B)return C;const b=B.getBoundingClientRect();return(n.isVertical?b.y+b.height>-(s.height.value*.5):n.isRTL?b.x<s.width.value*1.5:b.x+b.width>-(s.width.value*.5))?R(B):C}function $(C){const B=C.nextElementSibling;if(!B)return C;const b=B.getBoundingClientRect();return(n.isVertical?b.y<s.height.value*2:n.isRTL?b.x+b.width>-(s.width.value*.5):b.x<s.width.value*1.5)?$(B):C}function F(C){if(!n.isLongStrip){const B=n.isVertical?s.height.value:s.width.value,M=(n.isVertical?C.clientY:n.isRTL?B-C.clientX:C.clientX)/B;if(M<=.2&&n.pageIndex>0){o("prev");return}else if(M>=.8){o("next");return}}o("click")}return(C,B)=>(O(),pe(Gs,{zoom:C.zoom,zooming:C.zooming,"page-index":C.pageIndex,class:Ee(["rbod",{"rbod--touch":C.touchDevice,"rbod--long-strip":C.isLongStrip,"rbod--paging":!C.isLongStrip,"rbod--vertical":C.isVertical,"rbod--rtl":C.isRTL,"rbod--idle":C.idle,"rbod--first":!C.isLongStrip&&C.pageIndex===0,"rbod--last":!C.isLongStrip&&C.pageIndex===C.totalImgs&&!C.hasNext,"rbod--1page":d.value.length===1}]),"play-controller":C.playController,horizontal:!C.isVertical,rtl:C.isRTL,"touch-device":C.touchDevice,busy:C.busy,"long-strip":C.isLongStrip,style:ze({"--gap":`${a.value}em`,"--space-top":(C.spaceTop||0)+"px","--screen-width-em":U(s).width.value+"em","--screen-height-em":U(s).height.value+"em",...C.isLongStrip?{"--max-size-em":p.value+"em"}:{}}),"onUpdate:zoom":B[0]||(B[0]=b=>o("update:zoom",b)),"onUpdate:zooming":B[1]||(B[1]=b=>o("update:zooming",b)),onDragEnd:B[2]||(B[2]=()=>o("dragEnd")),onClick:F},{default:ie(()=>[(O(!0),Y(Ce,null,bn(d.value,b=>{var M;return O(),Y("div",Sn({key:C.direction+"_"+b.indexes[0],"data-index":b.indexes[0]},b.indexes.length>1?{"data-index2":b.indexes[1]}:{}),[!((M=b.srcs)!=null&&M.length)||b.isLoading?(O(),Y("div",lf,[u.value[b.indexes[0]]?(O(),pe(bi,{key:0})):ye("",!0)])):b.srcs.length==1?(O(),pe(mr(u.value[b.indexes[0]]?"img":"div"),Sn({key:1,class:"img"},u.value[b.indexes[0]]?{src:b.srcs[0]}:{},{style:{width:b.width!==void 0?b.width+"em":"",height:b.height!==void 0?b.height+"em":""}}),null,16,["style"])):(O(),Y("div",{key:2,class:Ee(["img img--double",{"flex-row-reverse":C.isRTL}]),style:ze({width:b.width!==void 0?b.width+"em":"",height:b.height!==void 0?b.height+"em":""})},[b.indexes.some(_=>u.value[_])?(O(!0),Y(Ce,{key:0},bn(b.srcs,_=>(O(),Y("div",{key:_},[Z("img",{src:_},null,8,af)]))),128)):ye("",!0)],6))],16,sf)}),128)),Z("div",{ref_key:"autoNextEl",ref:r,class:"last","data-index":C.totalImgs},[we(C.$slots,"end")],8,cf)]),_:3},8,["zoom","zooming","page-index","play-controller","horizontal","rtl","touch-device","busy","long-strip","class","style"]))}}),[["styles",[`.rbod{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:1024px){.rbod{transform:none}}.rbod--rtl{flex-direction:row-reverse}.rbod.rbod--vertical>div{padding:calc(var(--gap)/2) 0}.rbod:not(.rbod--vertical){align-items:center;display:flex;height:100%;justify-content:flex-start}.rbod:not(.rbod--vertical)>div{padding:0 calc(var(--gap)/2)}.rbod--long-strip.rbod--vertical.rbod--1page>div:first-child{min-height:100vh}.rbod--long-strip.rbod--vertical>div:first-child{margin-top:var(--space-top);padding-top:0}.rbod--long-strip.rbod--vertical>div:last-child{padding-bottom:0}.rbod--long-strip.rbod--vertical>div{width:var(--max-size-em)}.rbod--long-strip.rbod--vertical .img--loading{height:75vh;max-width:100%;width:100vw}.rbod--long-strip.rbod--vertical .last{height:100vh}.rbod--long-strip:not(.rbod--vertical).rbod--1page>div:first-child{min-width:100vw}.rbod--long-strip:not(.rbod--vertical)>div{align-items:center;display:flex;height:var(--max-size-em)}.rbod--long-strip:not(.rbod--vertical) .img--loading{height:100vh;max-height:100%;max-width:100vw;width:680px}.rbod--long-strip:not(.rbod--vertical) .last{width:100vw}.rbod--long-strip>div>img{flex-shrink:0;margin:auto}.rbod--paging:not(.rbod--touch):after,.rbod--paging:not(.rbod--touch):before{content:"";cursor:pointer;display:block;position:fixed;z-index:10}.rbod--paging.rbod--first:before,.rbod--paging.rbod--last:after{cursor:default}.rbod--paging.rbod--idle:after,.rbod--paging.rbod--idle:before{cursor:none}.rbod--paging>div{align-items:center;display:grid;justify-content:center;min-height:100vh;min-width:100vw;scroll-snap-align:center;scroll-snap-stop:always}.rbod--paging.rbod--vertical{--tw-scroll-snap-strictness:mandatory;scroll-snap-type:y var(--tw-scroll-snap-strictness)}.rbod--paging.rbod--vertical:after,.rbod--paging.rbod--vertical:before{height:20vw;left:0;right:0}.rbod--paging.rbod--vertical:before{top:0}.rbod--paging.rbod--vertical:after{bottom:0}.rbod--paging.rbod--vertical>div{width:var(--screen-width-em)}.rbod--paging:not(.rbod--vertical){--tw-scroll-snap-strictness:mandatory;scroll-snap-type:x var(--tw-scroll-snap-strictness)}.rbod--paging:not(.rbod--vertical).rbod--rtl:before{right:0}.rbod--paging:not(.rbod--vertical).rbod--rtl:after,.rbod--paging:not(.rbod--vertical):not(.rbod--rtl):before{left:0}.rbod--paging:not(.rbod--vertical):not(.rbod--rtl):after{right:0}.rbod--paging:not(.rbod--vertical):after,.rbod--paging:not(.rbod--vertical):before{bottom:0;top:0;width:20vw}.rbod--paging:not(.rbod--vertical)>div{height:var(--screen-height-em)}.rbod--paging .img--loading{height:100vh;width:100vw}.rbod--paging .img--double{align-items:center;display:flex;gap:var(--gap);justify-content:center}.rbod--paging .img--double div{display:flex;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod--paging .img--double div img{flex-shrink:0;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.rbod>div{flex-shrink:0;margin:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod .img{--tw-bg-opacity:1!important;background-color:rgb(255 255 255/var(--tw-bg-opacity))!important;margin:auto!important;-o-object-fit:contain!important;object-fit:contain!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.rbod .img--loading{align-items:center;display:flex;justify-content:center}
25
25
  `]]]),uf=Object.freeze(Object.defineProperty({__proto__:null,default:Qs},Symbol.toStringTag,{value:"Module"})),df={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},ff={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},pf={class:"flex justify-between items-end"},hf={class:"inline-block children-pointer-events-auto w-1/3"},gf={class:"inline-flex justify-center children-pointer-events-auto w-1/3"},mf={class:"inline-flex flex-col items-end gap-4 children-pointer-events-auto w-1/3"},vf={class:"inline-block z-20 relative"},bf={key:1,class:"fixed left-0 right-0 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3 flex justify-center pointer-events-none children-pointer-events-auto"},Js=he(ke({__name:"ReaderLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},fullScreen:{type:Boolean},zooming:{type:Boolean},rtl:{type:Boolean},spaceTop:{}},setup(e){const t={mounted:n=>n.showModal(),beforeUnmount:n=>n.close()};return(n,o)=>st((O(),Y("dialog",df,[Z("div",{id:"reader-layout",class:Ee({"cursor-none":n.idle,"cursor-default":!n.idle,"bg-black":n.immediate||!n.loading,"opacity-0":!n.immediate&&n.loading,"duration-200 transition-colors":!n.immediate})},[n.loading&&n.immediate?(O(),Y("div",ff,[Q(bi)])):ye("",!0),we(n.$slots,"default"),Z("div",{id:"controls",class:Ee(["fixed pointer-events-none cursor-auto transition-opacity duration-100 ease-linear left-0 top-0 w-screen h-screen flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3",{"opacity-100 z-20":!n.fullScreen,"opacity-0 -z-10":n.fullScreen}])},[Z("div",{class:"flex gap-1 items-center children-pointer-events-auto relative z-30 flex-shrink-0 2xs:gap-3",style:ze({paddingTop:`${n.spaceTop||0}px`})},[we(n.$slots,"back"),we(n.$slots,"exit"),we(n.$slots,"chapter-nav")],4),Z("div",pf,[Z("div",hf,[we(n.$slots,"page-nav")]),Z("div",gf,[n.fullScreen&&n.zooming?ye("",!0):we(n.$slots,"reset-zoom",{key:0})]),Z("div",mf,[we(n.$slots,"entry"),Z("div",vf,[we(n.$slots,"settings")]),we(n.$slots,"full-screen"),we(n.$slots,"play"),we(n.$slots,"break-first")])]),Z("div",{class:Ee(["fixed pointer-events-none left-0 right-0 bottom-0",{"flex justify-end":n.rtl}])},[we(n.$slots,"progress")],2)],2),n.fullScreen&&n.zooming?(O(),Y("div",bf,[we(n.$slots,"reset-zoom")])):ye("",!0)],2)])),[[t]])}}),[["styles",[`#reader-layout{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity));direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%}
26
26
  `]]]),yf=Object.freeze(Object.defineProperty({__proto__:null,default:Js},Symbol.toStringTag,{value:"Module"})),el=he(ke({__name:"ReaderTour",emits:["hide"],setup(e,{emit:t}){const n=t,o=X(null),i=X(0),r=X([]),s=se(()=>r.value[i.value]),l=ws(a,500);Re(()=>{const d=$s(o),p=Ne(()=>c({width:d.width.value,height:d.height.value}),50);p(),fe(d.width,p),fe(d.height,p)});function a(){i.value>=r.value.length-1?n("hide"):i.value++}function c(d){const p=u();r.value=p.map(({rect:x,text:R})=>{const $=x.top<d.height-x.bottom,F=x.left<d.width-x.right;return{text:R,style:{left:`${x.left}px`,top:`${x.top}px`,width:`${x.width}px`,height:`${x.height}px`},textStyle:{left:F?`${x.left-12}px`:void 0,right:F?void 0:`${d.width-x.left}px`,top:$?`${x.bottom+12}px`:`${x.top+20}px`,textAlign:$?void 0:"right",transform:$?void 0:"translateY(-50%)"}}}),i.value>=r.value.length&&(i.value=r.value.length-1)}function u(){var x;const d=(x=o.value)==null?void 0:x.parentElement;if(!d)return[];const p=[];return d.querySelectorAll("[data-tour]").forEach(R=>{var C;const $=(C=R.getAttribute("data-tour"))==null?void 0:C.trim();if(!($!=null&&$.length))return;const F=R.getBoundingClientRect();p.push({rect:F,text:$})}),p}return(d,p)=>{var x,R;return O(),Y(Ce,null,[Z("div",{class:Ee(["fixed inset-0 bg-black bg-opacity-50 duration-500",{"opacity-0":!s.value,"opacity-100":!!s.value}])},null,2),Z("div",{ref_key:"root",ref:o,class:"tour",onClick:p[0]||(p[0]=Ke((...$)=>U(l)&&U(l)(...$),["stop"]))},[s.value?(O(),Y("div",{key:i.value,class:"tour__target",style:ze(s.value.style)},null,4)):ye("",!0),(O(),Y("div",{key:i.value,class:"tour__text",style:ze((x=s.value)==null?void 0:x.textStyle)},Ge(((R=s.value)==null?void 0:R.text)??""),5))],512)],64)}}}),[["styles",[`.tour{height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:20}.tour__target{--tw-border-opacity:1;animation:tour-target-anim .5s forwards;border-color:rgb(120 113 108/var(--tw-border-opacity));border-radius:9999px;border-width:2px;box-shadow:0 0 0 99999px #000000e6}.tour__target,.tour__text{position:absolute}.tour__text{animation:tour-text-anim 1s forwards,tour-text-bounce .75s ease-in-out infinite alternate;max-width:320px;padding-left:12px;padding-right:12px;transition-duration:1s}@keyframes tour-target-anim{0%{--tw-border-opacity:0;opacity:0;transform:scale(3)}to{--tw-border-opacity:1;opacity:.9;transform:scale(1)}}@keyframes tour-text-anim{0%{opacity:0}to{opacity:1}}@keyframes tour-text-bounce{0%{margin-top:0}to{margin-top:10px}}
27
- `]]]),_f=Object.freeze(Object.defineProperty({__proto__:null,default:el},Symbol.toStringTag,{value:"Module"})),wf={},xf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Sf=[Z("path",{fill:"currentColor",d:"m10.875 19.3l-6.6-6.6q-.15-.15-.213-.325T4 12q0-.2.063-.375t.212-.325l6.6-6.6q.275-.275.688-.287t.712.287q.3.275.313.688T12.3 6.1L7.4 11h11.175q.425 0 .713.288t.287.712q0 .425-.287.713t-.713.287H7.4l4.9 4.9q.275.275.288.7t-.288.7q-.275.3-.7.3t-.725-.3Z"},null,-1)];function kf(e,t){return O(),Y("svg",xf,Sf)}const tl=he(wf,[["render",kf]]),Cf=Object.freeze(Object.defineProperty({__proto__:null,default:tl},Symbol.toStringTag,{value:"Module"})),If={},Ef={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Tf=[Z("path",{fill:"currentColor",d:"M6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h6v2H7v12.95l5-2.15l5 2.15V11h2v8.475q0 .55-.45.838t-.95.087L12 18l-5.6 2.4ZM7 5h6h-6Zm11 4q-.425 0-.713-.287T17 8V7h-1q-.425 0-.713-.288T15 6q0-.425.288-.713T16 5h1V4q0-.425.288-.713T18 3q.425 0 .713.288T19 4v1h1q.425 0 .713.288T21 6q0 .425-.288.713T20 7h-1v1q0 .425-.288.713T18 9Z"},null,-1)];function $f(e,t){return O(),Y("svg",Ef,Tf)}const nl=he(If,[["render",$f]]),Pf=Object.freeze(Object.defineProperty({__proto__:null,default:nl},Symbol.toStringTag,{value:"Module"})),Of={},Mf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Lf=[Z("path",{fill:"currentColor",d:"M17.825 8.575q-.2 0-.375-.062t-.325-.213L15.7 6.875q-.3-.3-.3-.712t.3-.688q.275-.3.7-.3t.7.275l.725.725l2.825-2.85q.3-.3.7-.3t.725.3q.275.3.275.725t-.275.7l-3.55 3.55q-.15.15-.325.213t-.375.062ZM6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h7q-.5.75-.75 1.438T13 6q0 1.8 1.137 3.175T17 10.9q.575.075 1 .075t1-.075v8.575q0 .55-.45.838t-.95.087L12 18l-5.6 2.4Z"},null,-1)];function zf(e,t){return O(),Y("svg",Mf,Lf)}const ol=he(Of,[["render",zf]]),Af=Object.freeze(Object.defineProperty({__proto__:null,default:ol},Symbol.toStringTag,{value:"Module"})),jf={},Df={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Rf=[Z("path",{fill:"currentColor",d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"},null,-1)];function Bf(e,t){return O(),Y("svg",Df,Rf)}const il=he(jf,[["render",Bf]]),Nf=Object.freeze(Object.defineProperty({__proto__:null,default:il},Symbol.toStringTag,{value:"Module"})),Ff={},Vf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Hf=[Z("path",{fill:"currentColor",d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"},null,-1)];function Wf(e,t){return O(),Y("svg",Vf,Hf)}const rl=he(Ff,[["render",Wf]]),Kf=Object.freeze(Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"})),qf={},Uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 56"},Yf=[Z("path",{fill:"currentColor",d:"M29.84 49.574h12.398c4.899 0 7.336-2.437 7.336-7.265V13.69c0-4.828-2.437-7.265-7.336-7.265H29.84Zm-16.055 0h12.398V6.426H13.785c-4.875 0-7.36 2.414-7.36 7.265V42.31c0 4.851 2.485 7.265 7.36 7.265"},null,-1)];function Xf(e,t){return O(),Y("svg",Uf,Yf)}const sl=he(qf,[["render",Xf]]),Zf=Object.freeze(Object.defineProperty({__proto__:null,default:sl},Symbol.toStringTag,{value:"Module"})),Gf={},Qf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Jf=[Z("g",{fill:"none"},[Z("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),Z("path",{fill:"currentColor",d:"M8 3v18H5a2 2 0 0 1-1.995-1.85L3 19V5a2 2 0 0 1 1.85-1.995L5 3zm11 0a2 2 0 0 1 1.995 1.85L21 5v14a2 2 0 0 1-1.85 1.995L19 21h-9V3z"})],-1)];function ep(e,t){return O(),Y("svg",Qf,Jf)}const ll=he(Gf,[["render",ep]]),tp=Object.freeze(Object.defineProperty({__proto__:null,default:ll},Symbol.toStringTag,{value:"Module"})),np={},op={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},ip=[Z("path",{fill:"currentColor",d:"M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM6 14v4h4v2H4v-6h2Zm14 0v6h-6v-2h4v-4h2Z"},null,-1)];function rp(e,t){return O(),Y("svg",op,ip)}const al=he(np,[["render",rp]]),sp=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"})),lp={},ap={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},cp=[Z("path",{fill:"currentColor",d:"M14 20v-6h6v2h-4v4h-2Zm-6 0v-4H4v-2h6v6H8Zm12-10h-6V4h2v4h4v2Zm-10 0H4V8h4V4h2v6Z"},null,-1)];function up(e,t){return O(),Y("svg",ap,cp)}const cl=he(lp,[["render",up]]),dp=Object.freeze(Object.defineProperty({__proto__:null,default:cl},Symbol.toStringTag,{value:"Module"})),fp={},pp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},hp=[Z("path",{fill:"currentColor",d:"M16.5 16V8l-4 4l4 4ZM5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm3-2V5H5v14h3Zm2 0h9V5h-9v14Zm-2 0H5h3Z"},null,-1)];function gp(e,t){return O(),Y("svg",pp,hp)}const ul=he(fp,[["render",gp]]),mp=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"}));function cn(e=0){return new Promise(t=>setTimeout(t,e))}function dl(e){return new Promise(t=>{const n=o=>{if(!o)return t(void 0);const i=URL.createObjectURL(o);t(i)};e.toBlob(n,"image/jpeg",1)})}async function vp(e,t){if(!t.startsWith("blob:"))return t;if(!e.naturalWidth||!e.naturalHeight)return;const o=document.createElement("canvas"),i=o.getContext("2d"),r=e.naturalWidth,s=e.naturalHeight;return o.width=r,o.height=s,i==null||i.drawImage(e,0,0,r,s),await dl(o)}function bo(e){const t=e.getAttributeNames(),n=t.indexOf("src");n!==-1&&(t.splice(n,1),t.push("src"));for(const o of t){if(o==="srcset"||o!=="data-url"&&o!=="data-original"&&!o.includes("src"))continue;const i=e.getAttribute(o);if(i)return o==="src"&&e.naturalWidth&&e.naturalWidth<200?void 0:i.replace(/(\n|\t)/g," ").trim()}}async function bp(e,t){return(t==null?void 0:t.src)===e&&t.naturalWidth&&t.naturalHeight?{width:t.naturalWidth,height:t.naturalHeight}:await new Promise(n=>{const o=new Image,i=setInterval(()=>{const{naturalWidth:r,naturalHeight:s}=o;s&&r&&(n({width:r,height:s}),clearInterval(i))},20);o.onerror=()=>{n(void 0),clearInterval(i)},o.src=e})}class yp{constructor({isIOS:t,onDownloaded:n,onDownloadError:o}){me(this,"reactiveResults",dn({}));me(this,"isIOS");me(this,"tkLoadId",Date.now());me(this,"isMounted",!0);me(this,"onDisposeCallbacks",[]);me(this,"onDownloaded");me(this,"onDownloadError");this.isIOS=t,this.onDownloaded=n,this.onDownloadError=o}dispose(){this.isMounted=!1,this.onDisposeCallbacks.forEach(t=>t()),this.onDisposeCallbacks=[],this.onDownloaded=()=>{}}async download(t){var l;if(!this.isMounted)return;const n=t.el;let o=t.computedSrc;if(!n&&!o)return;const i=n instanceof HTMLImageElement,r=n instanceof HTMLCanvasElement;if(n){if(n._tkLoadId===this.tkLoadId)return;if(n._tkLoadId=this.tkLoadId,i){const a=()=>this.onImgElLoaded(t,n,!0),c=()=>this.onImgElLoaded(t,n,!1);n.addEventListener("load",a),n.addEventListener("error",c),this.onDisposeCallbacks.push(()=>{n.removeEventListener("load",a),n.removeEventListener("error",c)})}}if(i&&!o){if(o=bo(n),!o)return;n._tkSrc=o}else if(r&&!o){if(o=await dl(n),!o)return;n._tkSrc=o}if(!o||!this.isMounted)return;const s=i&&o.startsWith("blob:");s&&!n.complete||((l=this.reactiveResults)[o]??(l[o]={src:o,isLoading:!0,hasError:!1}),s&&this.isIOS&&await cn(300),await this.downloadSrc(t))}async onImgElLoaded(t,n,o){var r;if(!this.isMounted)return;const i=bo(n);if(i&&!(!i.startsWith("blob:")&&t.computedSrc===i)){if(n._tkSrc=i,!o){this.reactiveResults[i]={src:i,isLoading:!1,hasError:!0},this.onDownloadError();return}(r=this.reactiveResults)[i]??(r[i]={src:i,isLoading:!0,hasError:!1}),this.downloadSrc(t)}}async downloadSrc(t){const n=t.computedSrc;if(!n)return;const o=t.el instanceof HTMLImageElement?t.el:void 0,i=o?await vp(o,n):n;if(!i||!this.isMounted)return;const r=await bp(i,o);this.isMounted&&(this.reactiveResults[n]={src:i,size:r,isLoading:!1,hasError:!r,invalid:!!r&&(r.width<200||r.height<200)},r?this.onDownloaded(t,r):this.onDownloadError())}}const _p=3;class wp{constructor({getItems:t,getActiveIndex:n,isCompleted:o,callback:i}){me(this,"isQueueStarted",!1);me(this,"debouncedEnqueue");me(this,"concurrentCount",0);me(this,"getItems");me(this,"getActiveIndex");me(this,"isCompleted");me(this,"callback");me(this,"activeIndex",0);me(this,"completedItems");me(this,"isMounted",!0);this.getItems=t,this.getActiveIndex=n,this.isCompleted=o,this.callback=i,this.debouncedEnqueue=Ne(this.enqueue.bind(this),50)}dispose(){this.isMounted=!1}run(){this.isQueueStarted?this.debouncedEnqueue():(this.isQueueStarted=!0,this.enqueue())}get canEnqueue(){return this.concurrentCount<_p&&this.isMounted}async enqueue(){if(!this.canEnqueue)return;const t=this.getItems();if(t===this.completedItems)return;this.completedItems=void 0;const n=this.resetActiveIndex(),o=Math.max(0,Math.min(t.length-1,n-1)),i=[];for(let r=o;r<t.length;r++){if(!this.canEnqueue)return;i.push(await this.invokeItemCallback(r,r==t.length-1))}for(let r=o-1;r>=0;r--){if(!this.canEnqueue)return;i.push(await this.invokeItemCallback(r,r==0))}this.getItems()===t&&i.filter(Boolean).length==t.length&&(this.completedItems=t)}async invokeItemCallback(t,n){const o=this.getItems()[t];return o?this.isCompleted(o)?!0:(this.concurrentCount++,this.callback(o).then(()=>{this.concurrentCount=Math.max(0,this.concurrentCount-1),n||this.debouncedEnqueue()}),await cn(),!1):!1}resetActiveIndex(){const t=this.getActiveIndex();return t<this.activeIndex&&(this.concurrentCount=Math.max(0,this.concurrentCount-Math.abs(t-this.activeIndex))),this.activeIndex=t,t}}class Xt{constructor(t,n,o){this.src=t,this.el=n,this.parentEl=o}get computedSrc(){var t;return this.src??((t=this.el)==null?void 0:t._tkSrc)}}class fl{constructor(){me(this,"elsPool",new Map)}check(t){if(!t||t===document.body)return!0;const n=this.elsPool.get(t);if(n!==void 0)return n;const o=getComputedStyle(t);if(!(o.display!=="none"&&+(o.opacity??"1")>.1))return this.elsPool.set(t,!1),!1;const r=this.check(t.parentElement);return this.elsPool.set(t,r),r}}function _i(e){const t=e.tagName.toLowerCase();if(t==="option"){const n=e.parentElement;if(n.tagName.toLowerCase()!=="select")return;n.value=e.getAttribute("value")||"",n.dispatchEvent(new Event("change"));return}return t==="a"&&e.addEventListener("click",n=>n.preventDefault(),{once:!0}),e.click()}async function xp(e){const{lstrip:t,lstripBtn:n}=e||{};if(!t||!n||!!document.querySelector(t))return!1;const i=await an(50,30,()=>document.querySelector(n));return i?(_i(i),await cn(),!0):!1}class Sp{constructor({spec:t,onChanged:n}){me(this,"spec");me(this,"onChanged");me(this,"rawImages",[]);me(this,"isMounted",!0);me(this,"loadRawImagesTs");me(this,"disconnectObservers");this.spec=t,this.onChanged=n,this.init()}dispose(){var t;this.isMounted=!1,(t=this.disconnectObservers)==null||t.call(this),this.disconnectObservers=void 0,this.onChanged=()=>{}}init(){var s;let t;const n=Ne(()=>{t&&this.loadRawImages(t)},100),o=new MutationObserver(n),i=(s=this.spec)!=null&&s.imgDivs?void 0:(()=>{let l=window.innerWidth;return new ResizeObserver(Ne(()=>{const a=window.innerWidth;if(a!==l){l=a;return}n()},50))})();this.disconnectObservers=async()=>{o.disconnect(),i==null||i.disconnect()};let r=!1;this.loadContentEl(l=>{t!==l&&(t=l,o.disconnect(),i==null||i.disconnect(),o.observe(t,{childList:!0,subtree:!0}),i==null||i.observe(t),r?n():(r=!0,this.loadRawImages(t)))})}setRawImages(t){let n=!1;const o=t.map((i,r)=>{const s=this.rawImages[r];return s&&s.el===i.el&&s.parentEl===i.parentEl&&s.src===i.src?s:(n=!0,i)});(n||!o.length)&&(this.rawImages=o,this.onChanged(t))}async loadContentEl(t){var l;const n=await xp(this.spec),o=(l=this.spec)==null?void 0:l.content;if(!o){t(document.body);return}let i=await an(n?100:1,10,()=>{for(const a of o.split(",")){const c=document.querySelector(a);if(c)return c}});if(!i)return;t(i);let r=0;const s=async()=>{if(this.isMounted&&!(i!=null&&i.isConnected)){if(r=0,i=await an(50,20,()=>{const a=document.querySelector(o);return a!=null&&a.isConnected&&a!==i?a:void 0}),!i)return;t(i)}!this.isMounted||++r>=10||setTimeout(s,200)};setTimeout(s,200)}async loadRawImages(t){var r;if(!this.isMounted||!t.isConnected)return;const n=Date.now();this.loadRawImagesTs=n;const o=(r=this.spec)==null?void 0:r.imgDivs,i=o?await kp(t,o):pl(t);this.loadRawImagesTs!==n||!t.isConnected||!this.isMounted||this.setRawImages(i)}}async function kp(e,t){const n=Array.from(e.querySelectorAll(t));if(!n.length)return pl(e);const o=new fl;return n.map(r=>{const s=Array.from(r.querySelectorAll("img,canvas"));for(const l of s)if(o.check(l)){if(l instanceof HTMLCanvasElement){if(hl(l))return new Xt(void 0,l,r)}else if(l instanceof HTMLImageElement&&gl(l)){const a=bo(l);return new Xt(a,l,r)}}return new Xt(void 0,void 0,r)})}function pl(e){const t=[],n={},o=new fl;return Array.from(e.querySelectorAll("img,canvas")).forEach(r=>{if(o.check(r)){if(r instanceof HTMLCanvasElement)hl(r)&&t.push(new Xt(void 0,r));else if(r instanceof HTMLImageElement&&gl(r)){const s=bo(r);if(s){const l=n[s];if(l!==void 0&&l!==-1){t.splice(l,1);return}n[s]=t.length}t.push(new Xt(s,r))}}}),t}function hl(e){return e.isConnected&&ml(e.width,e.height)}function gl(e){if(!e.isConnected)return!1;const t=e.getBoundingClientRect();return!t.width||!t.height||ml(t.width,t.height)}function ml(e,t){return e>=130&&t>=130&&(e>=200||t>=200)}const wi="mp-scroll-container";class xi{constructor(){me(this,"unmountedCallbacks",new Map)}dispose(){for(const t of this.unmountedCallbacks.values())t()}scrollTo({rawImages:t,page:n,skipIfVisible:o,isScrollDown:i,fallbackScrollEl:r}){const s=Math.floor(n),l=t[Math.min(t.length-1,s)];if(!l)return;const a=l.el??l.parentEl??document.querySelector(`img[src^="${l.computedSrc}"]`);if(!a)return;const c=a.getBoundingClientRect();if(o&&c.top<=0&&c.top+c.height>0)return;const u=xi.getScrollable(a,r);if(!u)return;const{el:d,top:p}=u;r!==document.documentElement&&!d.classList.contains(wi)&&(d.classList.add(wi),this.unmountedCallbacks.has(d)||this.unmountedCallbacks.set(d,()=>{d.classList.remove(wi)}));const x=n>=t.length?c.height:i?Math.max(0,c.height-window.innerHeight+100):n%1*c.height,R={top:p+x,behavior:"instant"};d.scrollTo(R),d===document.body&&document.documentElement.scrollTo(R)}static getScrollable(t,n){const o=(i,r)=>{if(!i)return;const{offsetTop:s,offsetParent:l}=i;if(l&&s&&r.set(l,Math.max(r.get(l)??0,s)),!(i===n||i.scrollHeight-i.clientHeight>=10&&window.getComputedStyle(i).overflow!=="visible"))return o(i.parentElement,r);let c=0;return r.forEach((u,d)=>{c+=d===l?u-s:u}),{el:i,top:c}};return o(t,new Map)}}function vl(e){var t,n;for(let o=0;o<e.length;o++){const i=((t=e[o])==null?void 0:t.el)??((n=e[o])==null?void 0:n.parentEl),r=i==null?void 0:i.getBoundingClientRect();if(!r||r.bottom<=0)continue;const s=r.top;return o+(s>=0?0:-s/r.height)}return 0}function Cp(e){if(document.documentElement.scrollTop<700)return 0;const n=Array.from(document.querySelectorAll("img[src]")).filter(o=>e.includes(o.src)).map(o=>new Xt(void 0,o));return vl(n)}function Ip(e){var $,F,C,B;const t=X(($=e.raw.value)==null?void 0:$.isWebtoon),n=X((F=e.raw.value)==null?void 0:F.isWebtoon);let o=!1;const i=e.touchDevice&&!navigator.userAgent.toLowerCase().includes("android"),r=((B=(C=e.raw.value)==null?void 0:C.imgs)==null?void 0:B.filter(Boolean))??[];let s=e.isAutoShow!==!1?e.page.value:r.length?Cp(r):void 0,l=r.map(b=>new Xt(b)),a,c;const u=new yp({isIOS:i,onDownloaded(b,M){let _=l.indexOf(b);if(_===-1){const w=b.computedSrc;_=l.findIndex(j=>j.computedSrc===w)}if(_!==-1){if(M&&!t.value&&_>Math.min(1,l.length-3)&&_<Math.max(l.length-2,3)){const w=M.height/M.width,j=w>2||w<.5,m=w>1.6||w<.6;t.value!==j&&(t.value=j),n.value!==m&&(n.value=m)}x()}},onDownloadError(){c||t.value!==void 0||(c=setTimeout(()=>{c=void 0,t.value===void 0&&e.onError("Failed to load images")},3e3))}}),d=new wp({getItems:()=>l,getActiveIndex:()=>Math.floor(e.page.value),isCompleted:b=>{const M=b.computedSrc;return!!(M&&u.reactiveResults[M])},callback:b=>u.download(b)}),p=new xi;if(r.length)d.run();else{let b=!1;a=new Sp({spec:e.spec,async onChanged(M){var _;if(l=M,!e.raw.value&&!M.length){e.onError("no_img");return}(_=e.spec)!=null&&_.imgDivs&&!b&&e.isAutoShow!==!1&&e.page.value&&(b=!0,p.scrollTo({rawImages:M,page:e.page.value,skipIfVisible:!0,fallbackScrollEl:i?document.body:document.documentElement}),await cn(1)),s===void 0&&e.isAutoShow===!1&&(s=vl(M)),d.run()}})}Ko(()=>{u.dispose(),d.dispose(),a==null||a.dispose(),c&&clearTimeout(c),p.dispose(),o&&p.scrollTo({rawImages:l,page:e.page.value,fallbackScrollEl:document.documentElement})});function x(){var w,j,m;if(o||t.value===void 0||s===void 0)return;const b=Math.max(0,Math.min(s,l.length)),M=Math.min(Math.floor(b),l.length-1);if(M>=1){if(!((w=l[M])==null?void 0:w.computedSrc)){e.isAutoShow&&p.scrollTo({rawImages:l,page:M,fallbackScrollEl:i?document.body:document.documentElement});return}for(let z=M;z<l.length;z++){const J=(j=l[z])==null?void 0:j.computedSrc;if(!J)return;const y=u.reactiveResults[J];if(!y)return;if(!y.invalid){if(!y.size&&!y.hasError)return;break}}for(let z=M-1;z>=0;z--){const J=(m=l[z])==null?void 0:m.computedSrc;if(!J)break;const y=u.reactiveResults[J];if(!y)return;if(!y.invalid){if(!y.size&&!y.hasError)return;break}}}if(o)return;o=!0,e.onReady(b);let _=!0;fe(()=>Math.floor(e.page.value),(L,z)=>{L===z&&!_||(p.scrollTo({rawImages:l,page:L,isScrollDown:z===void 0||L>z||l.length===1,skipIfVisible:_&&l.length>1,fallbackScrollEl:i?document.body:document.documentElement}),_=!1,z??(z=-1),d.run())},{immediate:!0})}return{asyncImgs:se(()=>{Object.values(u.reactiveResults);const b=[];return l.forEach(M=>{const _=M.computedSrc,w=_?u.reactiveResults[_]:void 0;(_&&!(w!=null&&w.invalid)||M.parentEl)&&b.push(w)}),b}),isWebtoon:se(()=>t.value??!1),maybeWebtoon:se(()=>n.value??!1)}}function Ep(e,t,n){return se(()=>t.value?bl(e.value,n.value):e.value.map((o,i)=>[{img:o,index:i}]))}function bl(e,t,n=0){if(e.length===0)return[];const o=e.slice(0,2),i=o.some(s=>(s==null?void 0:s.size)&&s.size.width>s.size.height),r=i||t?[o[0]]:o;return[r.map((s,l)=>({img:s,index:n+l})),...bl(e.slice(r.length),t&&i,n+r.length)]}function Tp(e,t){const n=sessionStorage.getItem("tk:page:path");n!==location.pathname&&(sessionStorage.setItem("tk:page:path",location.pathname),n&&sessionStorage.removeItem("tk:page"));const o=X(t&&e>0?Math.max(0,e):+(sessionStorage.getItem("tk:page")??"0")||e);return se({get:()=>o.value,set:i=>{o.value=i,sessionStorage.setItem("tk:page",i+"")}})}function $p(){sessionStorage.removeItem("tk:page"),sessionStorage.removeItem("tk:page:path")}const Si=40;function Pp({page:e,direction:t,style:n,isLongStrip:o,isVertical:i,isRTL:r,spaceTop:s,scrollEl:l,isWebtoon:a,interferePlayer:c,onChangedPage:u,onInitialized:d,onFinished:p}){let x=!1,R=!1,$=!1,F;const C=Ne(L,300),B=ws(()=>{L(),C()},300),b=Ne(w,50);async function M(){j(e.value,{smooth:!1,ensureLastImgVisibility:!0})}function _(){var I;R=!0,d(),z(),(I=l.value)==null||I.addEventListener("scroll",B),setTimeout(()=>{const{width:K,height:le}=Ls();fe(K,()=>{i.value&&b()}),fe(le,()=>{i.value||b()}),fe(n,w),fe(t,w)},300)}async function w(){if(!R||x)return;x=!0,await ht();const I=e.value;if(y()===I){x=!1;return}j(I)}function j(I,{smooth:K,ensureLastImgVisibility:le=!1}={smooth:!1}){const ue=l.value;if(!ue)return;x=!0;const be=async()=>{await ht(),x=!1,R||_()},_e=Math.floor(I),Ue=yi(ue,_e);if(!Ue){be();return}c(async()=>{await m(ue,!o.value&&K,async()=>{await re(ue,Ue,{smooth:K,page:I,ensureLastImgVisibility:le})}),await be()})}async function m(I,K,le){K&&I.style.setProperty("scroll-snap-type","none"),await le(),K&&I.style.removeProperty("scroll-snap-type")}function L(){if(x)return;const I=y();I!==void 0&&I!==e.value&&u(I),z()}function z(){$||!$&&J()&&($=!0,p())}function J(){const I=l.value;if(!I)return!1;const K=o.value?a.value?3:!i.value&&I.clientWidth>I.clientHeight?2.25:2.5:2;return i.value?I.scrollHeight-I.scrollTop<I.clientHeight*K:I.scrollWidth-(r.value?-I.scrollLeft:I.scrollLeft)<I.clientWidth*K}function y(){const I=g();return I?(+I.getAttribute("data-index")||0)+(o.value?V(I):0):void 0}function g(){var K;if(F??(F=l.value.getRootNode()),!F)return;const I=(K=F.elementsFromPoint)==null?void 0:K.call(F,i.value||!o.value?window.innerWidth/2:r.value?window.innerWidth-Si:Si,i.value&&o.value?s.value||Si:window.innerHeight/2);if(I)for(let le=0;le<I.length;le++){const ue=I[le];if(ue.hasAttribute("data-index"))return ue;if(ue===l.value)break}}function V(I){const K=I.getBoundingClientRect();return i.value?Math.abs(K.top-s.value)/K.height:r.value?Math.max(0,K.right-l.value.clientWidth)/K.width:Math.abs(K.left)/K.width}let G=!1;async function re(I,K,le){if(G)return;const ue=K.getBoundingClientRect();if(!o.value){if(i.value){if(ue.top<=0&&ue.bottom>=I.clientHeight)return}else if(ue.left<=0&&ue.right>=I.clientWidth)return}G=!0;const be=i.value?I.scrollTop:I.scrollLeft,_e=le.page,Ue=o.value?_e%1:0,mt=await an(30,10,async()=>{await cn();let Oe;if(!(K.offsetHeight<10))return o.value?i.value?Oe=K.offsetTop+Ue*K.offsetHeight-s.value:r.value?Oe=K.offsetLeft-I.clientWidth+K.offsetWidth-Ue*K.offsetWidth:Oe=K.offsetLeft+Ue*K.offsetWidth:i.value?Oe=K.offsetTop+(ue.top>0?0:ue.height-I.clientHeight):Oe=K.offsetLeft+(ue.left>0?0:ue.width-I.clientWidth),_e>.5&&Math.abs(Oe)<100?void 0:Oe})??0,Lt=le.ensureLastImgVisibility?i.value?Math.min(mt,I.scrollHeight-I.clientHeight*2):r.value?Math.max(mt,-(I.scrollWidth-I.clientWidth*2)):Math.min(mt,I.scrollWidth-I.clientWidth*2):mt;if(!le.smooth){i.value?I.scrollTop=Lt:I.scrollLeft=Lt,G=!1;return}const Ye=Lt-be,vt=30;let Xe=0;return new Promise(Oe=>{(function ut(){const zt=Op(Xe,be,Ye,vt);i.value?I.scrollTop=zt:I.scrollLeft=zt,Xe++,Xe<=vt?requestAnimationFrame(ut):(Oe(),G=!1)})()})}return{init:M,goToPage:j}}function Op(e,t,n,o){return n*(Math.pow(e/o-1,3)+1)+t}function Mp({autoPlay:e,touchDevice:t,scrollEl:n,isVertical:o,isRTL:i,isLongStrip:r,speed:s}){const l=sessionStorage.getItem("tk:playing"),a=X(typeof l=="string"?l==="true":e),c=se({get:()=>a.value,set:m=>{a.value=m,sessionStorage.setItem("tk:playing",m?"true":"false")}}),u=X(!1);let d,p;const x=Ne(w,100),R=Ne(()=>{u.value=!0},t?2e3:1e3),$=()=>setTimeout(()=>{u.value=!1,R()},30);$(),t||Ot(window,"mousemove",$);const F=Es();Re(()=>{fe(F,m=>{c.value&&(m==="visible"?w():p==null||p())}),fe(s,()=>C()),fe(r,m=>{m||b()})}),Ft(b);async function C(m){c.value&&(p==null||p()),m&&(await ht(),await m()),c.value&&x()}function B(){c.value?b():M()}function b(){c.value&&(c.value=!1,p==null||p(),$())}function M(){!c.value&&r.value&&(c.value=!0,w(),$())}function _(){p==null||p()}function w(){const m=n.value;if(!c.value||!m)return;const L=o.value?m.scrollHeight-m.clientHeight:m.scrollWidth-m.clientWidth,z=j();if(L<=z){b();return}p=()=>{d=Date.now(),p=void 0};const J=Date.now();d=J;const y=.05*s.value,g=o.value?"scrollTop":"scrollLeft";let V=Date.now(),G=0;const re=()=>{if(d!==J)return;const I=Date.now(),K=I-V;V=I;const le=y*K+G;le>=1?(G=le%1,m[g]+=(le-G)*(i.value?-1:1)):G=le,setTimeout(re,1)};re()}function j(){const m=n.value;return o.value?m.scrollTop:i.value?-m.scrollLeft:m.scrollLeft}return{isPlaying:c,isIdle:u,toggle:B,play:M,pause:_,resume:w,stop:b,interfere:C,awake:$}}function Lp({raw:e,spec:t,siteMeta:n}){var z,J,y;const{vol:o,inferVol:i,chap:r,title:s,slug:l,basePath:a}=e,c=t==null?void 0:t.chapter;let u=-1;const d=c&&c.sel&&!c.url?document.querySelectorAll(c.sel):void 0;async function p(g,V){if(g.slug)x(g.slug,V);else if(g.elIndex!==void 0&&d&&d[g.elIndex]){let G=null;c!=null&&c.trigger&&(G=document.querySelector(c.trigger)),G&&(G.click(),await new Promise(re=>setTimeout(()=>re(),50))),_i(d[g.elIndex]),G&&G.click()}}function x(g,V){const G=zp(a,g,(n==null?void 0:n.trailing)??!0);V?window.open(G,"_blank","noopener"):location.href=G}function R(g){const V=b[g];return V?G=>p(V,G):void 0}function $(g,V,G){if(g){const re=document.querySelector(g);re&&_i(re);return}V&&x(V,G)}const F=o??i,C=c==null?void 0:c.url,B=((z=s.chapters)==null?void 0:z.filter(g=>g.slug||!C&&g.elIndex!==void 0))??[],b=B.length>1?B:[],M=(J=e.prev)==null?void 0:J.slug,_=(y=e.next)==null?void 0:y.slug,{prevBtn:w,nextBtn:j}=t??{};let m=M||w&&!b.length?g=>$(w,M,g):void 0,L=_||j&&!b.length?g=>$(j,_,g):void 0;if(b.length){if(C&&(u=b.findIndex(g=>g.slug===e.slug)),u===-1&&(u=b.findIndex(g=>(g.vol??g.inferVol)===F&&g.chap===r)),C&&u===-1&&(u=b.findIndex(g=>g.slug&&l.startsWith(`${g.slug}-`)&&l.length-g.slug.length>3)),u!==-1)m??(m=R(u+1)),L??(L=R(u-1));else if(!M&&!_){const g=b.findIndex(V=>{const G=V.vol??V.inferVol;return F===void 0||G===void 0||F===G?V.chap<r:G<F});g!==-1?(m=R(g),L=R(g-1)):L=R(b.length-1)}}return{activeIndex:u,activeLabel:yl({vol:o,chap:r}),prev:m,next:L,chapters:b.map(g=>({label:yl(g),select:V=>p(g,V)}))}}function yl({vol:e,chap:t}){return e==null?`Ch.${t}`:`Vol.${e} ch.${t}`}function zp(e,t,n){const o=!t||t.includes("//")||t.startsWith("/")?t:"/"+[...e.split("/"),...t.split("/")].filter(Boolean).join("/"),[i,r]=(o.includes("//")?o:location.origin+o).split("?");return[i.endsWith("/")===n?i:n?i+"/":i.substring(0,-1),r].filter(Boolean).join("?")}const Ap={key:0,class:"ml-auto inline-flex gap-[1px] scale-95 origin-right"},_l=he(ke({inheritAttrs:!1,__name:"App",props:{immediate:{type:Boolean},raw:{},spec:{},siteMeta:{},page:{},spaceTop:{},fullScreen:{type:Boolean},touchDevice:{type:Boolean},entryId:{},autoPlay:{type:Boolean},readerStyle:{},direction:{},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},onPressedBack:{type:Function}},emits:["error","ready","pageChanged","fullScreenChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters"],setup(e,{emit:t}){const n=e,o=t;let i=!1,r;const s=X(!1),l=X(!1),a=yu({touchDevice:n.touchDevice}),c=Tp(n.page,n.isAutoShow),u=se(()=>n.spaceTop??0),{asyncImgs:d,isWebtoon:p,maybeWebtoon:x}=Ip({raw:se(()=>n.raw),spec:n.spec,page:c,touchDevice:n.touchDevice,isAutoShow:n.isAutoShow,spaceTop:u,async onReady(v){mt(v),s.value=!0},onError:()=>{o("error"),D()}}),{direction:R,style:$,isRTL:F,isDouble:C,isVertical:B,isLongStrip:b,gap:M,speed:_,zoom:w,breakFirst:j,autoNextSeconds:m}=rd({titleName:se(()=>{var v;return(v=n.raw)==null?void 0:v.title.name}),isWebtoon:p,maybeWebtoon:x,defaultStyle:n.readerStyle,defaultDirection:n.direction}),L=X(!1),z=Ep(d,C,j),J=se(()=>c.value>=d.value.length),y=se(()=>n.raw?Lp({raw:n.raw,spec:n.spec,siteMeta:n.siteMeta}):void 0),g=X(null),V=Is(),G=X(!1),re=X(!1),I=Mp({autoPlay:!n.tourEnabled&&n.autoPlay,touchDevice:n.touchDevice,scrollEl:se(()=>{var v;return(v=g.value)==null?void 0:v.$el}),speed:_,isRTL:F,isVertical:B,isLongStrip:b}),K=se(()=>!n.touchDevice&&I.isIdle.value&&!a.value&&!L.value),le=se({get(){return w.value},set(v){I.interfere(()=>{w.value=v})}}),ue=Pp({page:c,style:$,direction:R,isLongStrip:b,isVertical:B,isRTL:F,spaceTop:u,isWebtoon:p,scrollEl:se(()=>{var v;return(v=g.value)==null?void 0:v.$el}),interferePlayer:v=>I.interfere(v),onChangedPage:mt,onInitialized(){o("ready"),l.value=!0,r=Lt()},onFinished:()=>o("finished")}),be=se(()=>Math.floor(c.value)),_e=()=>I.interfere(()=>cn(100));Tu().addListener({onKeyDown:v=>{if(n.tourEnabled)return;const k=b.value&&B.value,q=b.value&&!B.value,te=!b.value&&B.value,ge=!b.value&&!B.value;switch(v.key){case" ":v.preventDefault(),b.value?(ee(!1),I.toggle()):N();break;case"ArrowUp":case"PageUp":k?_e():te&&be.value!==0&&(v.preventDefault(),S());break;case"ArrowDown":case"PageDown":k?_e():te&&!J.value&&(v.preventDefault(),E());break;case"ArrowLeft":q?_e():ge?(v.preventDefault(),f()):B.value&&Oe();break;case"ArrowRight":q?_e():ge?(v.preventDefault(),h()):B.value&&Xe();break}},onKeyUp:v=>{switch(v.key){case"b":j.value=!j.value;break;case"f":H();break;case"t":A();break;case"h":ee();break}}}),Ot("fullscreenchange",()=>{G.value=!!document.fullscreenElement}),fe(I.isPlaying,v=>{v||N(!1),o("playingChanged",v)}),fe(I.isIdle,v=>{I.isPlaying.value&&N(v)}),fe(a,v=>{!v&&I.isIdle.value?I.awake():v&&n.fullScreen&&N()});function mt(v){if(c.value===v)return;const k=d.value.length;if(v<0||v>=k+1)return;const q=Math.floor(v*100)/100;if(q===c.value)return;const te=c.value;c.value=q,o("pageChanged",q),v>=k?(N(!1),I.stop()):v<.01&&te>v?(N(!1),I.awake()):i||(b.value?r!==void 0&&Lt()-r>300&&N(!0):Math.abs(te-v)===1&&N(!0))}function Lt(){var k;const v=(k=g.value)==null?void 0:k.$el;return v?B.value?v.scrollTop:F.value?-v.scrollLeft:v.scrollLeft:0}function Ye(){!n.touchDevice&&!b.value&&ue.goToPage(be.value,{smooth:!0})}function vt(){if(I.isPlaying.value){!n.fullScreen||!n.touchDevice?I.stop():I.awake();return}N()}function Xe(v=!1){var k,q;(q=(k=y.value)==null?void 0:k.next)==null||q.call(k,v)}function Oe(v=!1){var k,q;(q=(k=y.value)==null?void 0:k.prev)==null||q.call(k,v)}function ut(v){F.value?Xe(At(v)):Oe(At(v))}function zt(v){F.value?Oe(At(v)):Xe(At(v))}function At(v){return!n.touchDevice&&(v.ctrlKey||v.metaKey)}function f(){F.value?E():S()}function h(){F.value?S():E()}function S(){var q;const v=z.value,k=J.value?v[v.length-1][0].index:(q=v[T()-1])==null?void 0:q[0].index;k!==void 0?ue.goToPage(k):Oe()}function E(){var v,k;if(J.value)Xe();else{const q=((k=(v=z.value[T()+1])==null?void 0:v[0])==null?void 0:k.index)??d.value.length;ue.goToPage(q)}}function T(){const v=be.value,k=z.value.findIndex(q=>q.some(({index:te})=>te===v));return k===-1?z.value.length-1:k}function D(){$p(),o("dispose")}async function N(v){if(a.value&&!n.fullScreen)return;const k=typeof v=="boolean"?v:!n.fullScreen;k!==n.fullScreen&&(i=!0,o("fullScreenChanged",k),k&&setTimeout(()=>{n.fullScreen&&a.value&&o("fullScreenChanged",!1)},100))}function A(){n.entryId?W():P()}function H(){var v,k;document.fullscreenElement?document.exitFullscreen():(k=(v=V.value)==null?void 0:v.querySelector("#reader-layout"))==null||k.requestFullscreen()}function P(){I.stop(),o("addEntry")}function W(){I.stop(),o("openEntry",n.entryId)}function ee(v){re.value!==v&&(re.value=!re.value,re.value&&I.isPlaying.value&&I.stop())}return(v,k)=>v.immediate||s.value?(O(),pe(Js,{key:0,loading:!l.value,immediate:!!v.immediate,"full-screen":!!v.fullScreen,zooming:L.value,idle:K.value,"space-top":u.value,rtl:U(F),onClick:k[15]||(k[15]=Ke(()=>{},["stop"]))},Cr({settings:ie(()=>{var q;return[Q(Ns,{"reader-style":U($),"onUpdate:readerStyle":k[6]||(k[6]=te=>Ie($)?$.value=te:null),direction:U(R),"onUpdate:direction":k[7]||(k[7]=te=>Ie(R)?R.value=te:null),gap:U(M),"onUpdate:gap":k[8]||(k[8]=te=>Ie(M)?M.value=te:null),speed:U(_),"onUpdate:speed":k[9]||(k[9]=te=>Ie(_)?_.value=te:null),zoom:le.value,"onUpdate:zoom":k[10]||(k[10]=te=>le.value=te),"auto-next-seconds":U(m),"onUpdate:autoNextSeconds":k[11]||(k[11]=te=>Ie(m)?m.value=te:null),name:(q=v.raw)==null?void 0:q.title.name,webtoon:U(p),disabled:!s.value,onHelp:ee},null,8,["reader-style","direction","gap","speed","zoom","auto-next-seconds","name","webtoon","disabled"])]}),"reset-zoom":ie(()=>[Q(rn,{name:"fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ie(()=>[L.value||U(w)!==1?(O(),pe(Vs,{key:0,zoom:le.value,onClick:k[14]||(k[14]=Ke(()=>le.value=1,["stop"])),class:"duration-200"},null,8,["zoom"])):ye("",!0)]),_:1})]),progress:ie(()=>[Z("div",{class:"h-0.5 rounded-t-sm max-w-full bg-orange-500 duration-500",style:ze({width:`${U(c)/(U(d).length-1)*100}%`})},null,4)]),default:ie(()=>{var q;return[s.value?(O(),pe(Qs,{key:0,ref_key:"body",ref:g,zoom:le.value,"onUpdate:zoom":k[0]||(k[0]=te=>le.value=te),zooming:L.value,"onUpdate:zooming":k[1]||(k[1]=te=>L.value=te),page:U(c),"page-index":be.value,pages:U(z),"total-imgs":U(d).length,direction:U(R),gap:U(M),"is-long-strip":U(b),isRTL:U(F),"is-double":U(C),"is-vertical":U(B),"space-top":u.value,busy:U(a),idle:K.value,"play-controller":U(I),"touch-device":v.touchDevice,"has-next":!!((q=y.value)!=null&&q.next),onReady:U(ue).init,onPrev:S,onNext:E,onClick:vt,onDragEnd:Ye,onWheelPassive:k[2]||(k[2]=()=>U(I).interfere())},Cr({_:2},[s.value&&U(d).length?{name:"end",fn:ie(()=>{var te;return[Q(zs,{"has-next":!!((te=y.value)!=null&&te.next),seconds:U(m),onNext:Xe,onHide:D},null,8,["has-next","seconds"])]}),key:"0"}:void 0]),1032,["zoom","zooming","page","page-index","pages","total-imgs","direction","gap","is-long-strip","isRTL","is-double","is-vertical","space-top","busy","idle","play-controller","touch-device","has-next","onReady"])):ye("",!0),l.value&&!J.value&&!v.tourEnabled?(O(),pe(Us,{key:1,direction:U(R)},null,8,["direction"])):ye("",!0),l.value&&!J.value?(O(),pe(Zs,{key:2,playing:!!U(I).isPlaying.value},null,8,["playing"])):ye("",!0),re.value?(O(),pe(Ys,{key:3,"touch-device":v.touchDevice,onHide:ee},null,8,["touch-device"])):ye("",!0),v.tourEnabled?(O(),pe(el,{key:4,onHide:k[3]||(k[3]=()=>o("tourEnabledChanged",!1))})):ye("",!0)]}),_:2},[v.raw||v.onPressedBack?{name:"back",fn:ie(()=>[Q(tt,{href:v.onPressedBack||!v.raw?"#":v.raw.title.url,title:"Back to manga",onClick:v.onPressedBack},{default:ie(()=>[Q(tl)]),_:1},8,["href","onClick"])]),key:"0"}:void 0,v.touchDevice?void 0:{name:"exit",fn:ie(()=>[Q(tt,{title:"Hide reader","data-tour":"You have entered reader mode, press here to return to the original page",onClick:D},{default:ie(()=>[Q(ul)]),_:1})]),key:"1"},y.value?{name:"chapter-nav",fn:ie(()=>{var q;return[Q(Ks,{"touch-device":v.touchDevice,"chapter-spec":(q=v.spec)==null?void 0:q.chapter,data:y.value,onGetHiddenChapters:k[4]||(k[4]=()=>o("getHiddenChapters")),onChaptersDialogOpen:k[5]||(k[5]=()=>N(!0))},null,8,["touch-device","chapter-spec","data"]),y.value.next||y.value.prev?(O(),Y("div",Ap,[Q(tt,{title:`${U(F)?"Next":"Prev"} chapter (←)`,disabled:U(F)?!y.value.next:!y.value.prev,class:"!rounded-r-none",onClick:ut},{default:ie(()=>[Q(il)]),_:1},8,["title","disabled"]),Q(tt,{title:`${U(F)?"Prev":"Next"} chapter (→)`,disabled:U(F)?!y.value.prev:!y.value.next,class:"!rounded-l-none",onClick:zt},{default:ie(()=>[Q(rl)]),_:1},8,["title","disabled"])])):ye("",!0)]}),key:"2"}:void 0,U(z).length?{name:"page-nav",fn:ie(()=>[Q(Xs,{"model-value":be.value,disabled:!l.value,pages:U(z),"total-imgs":U(d).length,"onUpdate:modelValue":U(ue).goToPage},null,8,["model-value","disabled","pages","total-imgs","onUpdate:modelValue"])]),key:"3"}:void 0,v.raw?{name:"entry",fn:ie(()=>[Q(tt,{title:v.entryId?"View entry (T)":"Add to library (T)","data-tour":"Prress here to add to your collection",onClick:A},{default:ie(()=>[v.entryId?(O(),pe(ol,{key:0})):(O(),pe(nl,{key:1}))]),_:1},8,["title"])]),key:"4"}:void 0,v.touchDevice?void 0:{name:"full-screen",fn:ie(()=>[Q(tt,{title:`${G.value?"Exit":"Enter"} fullscreen (F)`,onClick:H},{default:ie(()=>[G.value?(O(),pe(cl,{key:0})):(O(),pe(al,{key:1}))]),_:1},8,["title"])]),key:"5"},U(b)?{name:"play",fn:ie(()=>[Q(tt,{"data-tour":"Press here to play like a video",title:`${U(I).isPlaying.value?"Pause":"Play"} (Space)`,disabled:!l.value,onClick:k[12]||(k[12]=()=>U(I).toggle())},{default:ie(()=>[U(I).isPlaying.value?(O(),pe(mi,{key:0})):(O(),pe(vi,{key:1}))]),_:1},8,["title","disabled"])]),key:"6"}:void 0,U(C)?{name:"break-first",fn:ie(()=>[Q(tt,{title:"Break 1st page (B)","data-tour":"Press here to separate the first page from double-page mode",disabled:!l.value,onClick:k[13]||(k[13]=()=>j.value=!U(j))},{default:ie(()=>[U(j)?(O(),pe(ll,{key:0})):(O(),pe(sl,{key:1}))]),_:1},8,["disabled"])]),key:"7"}:void 0]),1032,["loading","immediate","full-screen","zooming","idle","space-top","rtl"])):ye("",!0)}}),[["styles",[`/*! tailwindcss v3.4.0 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Helvetica,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{-webkit-tap-highlight-color:rgba(0,0,0,0)!important}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:none;border-style:none;cursor:pointer;outline:2px solid transparent;outline-offset:2px;white-space:nowrap}button[disabled]{cursor:default!important}svg{height:100%;width:100%}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{width:100%!important}.container{width:100%}@media (min-width:300px){.\\!container{max-width:300px!important}.container{max-width:300px}}@media (min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-sm{scrollbar-color:#777 transparent;scrollbar-width:thin}.scrollbar-sm::-webkit-scrollbar{background-color:transparent;height:4px;width:4px}.scrollbar-sm::-webkit-scrollbar-track{background:transparent}.scrollbar-sm::-webkit-scrollbar-thumb{background-color:#777;border-radius:2px}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.top-0{top:0}.top-1{top:4px}.top-1\\/2{top:50%}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.m-0{margin:0}.m-auto{margin:auto}.-mx-12{margin-left:-48px;margin-right:-48px}.-my-12{margin-bottom:-48px;margin-top:-48px}.-ml-20{margin-left:-80px}.-mr-3{margin-right:-12px}.mb-8{margin-bottom:32px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-0{height:0}.h-0\\.5{height:2px}.h-1{height:4px}.h-1\\.5{height:6px}.h-10{height:40px}.h-12{height:48px}.h-16{height:64px}.h-20{height:80px}.h-24{height:96px}.h-4{height:16px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[101\\%\\]{height:101%}.h-\\[30rem\\]{height:480px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[70vh\\]{max-height:70vh}.max-h-\\[80vh\\]{max-height:80vh}.max-h-full{max-height:100%}.max-h-none{max-height:none}.w-1{width:4px}.w-1\\/3{width:33.333333%}.w-10{width:40px}.w-12{width:48px}.w-20{width:80px}.w-24{width:96px}.w-28{width:112px}.w-4{width:16px}.w-40{width:160px}.w-\\[4\\.8rem\\]{width:76.8px}.w-full{width:100%}.w-screen{width:100vw}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-xs{max-width:320px}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-right{transform-origin:right}.origin-top{transform-origin:top}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1{--tw-translate-y:-4px}.-translate-y-1\\.5{--tw-translate-y:-6px}.-translate-y-1\\.5,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.translate-y-0{--tw-translate-y:0px}.translate-y-0,.translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1{--tw-translate-y:4px}.translate-y-1\\.5{--tw-translate-y:6px}.translate-y-1\\.5,.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-95,.scale-y-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-90{--tw-scale-y:.9}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-grabbing{cursor:grabbing}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.touch-pan-x{--tw-pan-x:pan-x}.touch-pan-x,.touch-pan-y{touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-pan-y{--tw-pan-y:pan-y}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize{resize:both}.\\!snap-none{scroll-snap-type:none!important}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.gap-\\[1px\\]{gap:1px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overscroll-contain{overscroll-behavior:contain}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:4px}.rounded-2xl{border-radius:16px}.rounded-\\[2\\.5rem\\]{border-radius:40px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-sm{border-radius:2px}.\\!rounded-l-none{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.\\!rounded-r-none{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.rounded-t-sm{border-top-left-radius:2px;border-top-right-radius:2px}.rounded-t-xl{border-top-left-radius:12px;border-top-right-radius:12px}.border{border-width:1px}.border-2{border-width:2px}.border-t-\\[1px\\]{border-top-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-stone-300{--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity))}.border-stone-400{--tw-border-opacity:1;border-color:rgb(168 162 158/var(--tw-border-opacity))}.border-stone-600{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity))}.border-opacity-30{--tw-border-opacity:.3}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-orange-500{--tw-bg-opacity:1;background-color:rgb(249 115 22/var(--tw-bg-opacity))}.bg-stone-300{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity))}.bg-stone-400{--tw-bg-opacity:1;background-color:rgb(168 162 158/var(--tw-bg-opacity))}.bg-stone-600{--tw-bg-opacity:1;background-color:rgb(87 83 78/var(--tw-bg-opacity))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-opacity-40{--tw-bg-opacity:.4}.bg-opacity-50{--tw-bg-opacity:.5}.bg-opacity-80{--tw-bg-opacity:.8}.bg-opacity-90{--tw-bg-opacity:.9}.bg-none{background-image:none}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-2{padding:8px}.p-4{padding:16px}.p-6{padding:24px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-6{padding-left:24px;padding-right:24px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.pb-12{padding-bottom:48px}.pb-6{padding-bottom:24px}.pl-1{padding-left:4px}.pt-3{padding-top:12px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-sans{font-family:Helvetica,sans-serif}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.font-medium{font-weight:500}.lowercase{text-transform:lowercase}.leading-none{line-height:1}.text-primary{--tw-text-opacity:1;color:rgb(184 92 56/var(--tw-text-opacity))}.text-stone-100{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity))}.text-stone-900{--tw-text-opacity:1;color:rgb(28 25 23/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-90{opacity:.9}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.children-pointer-events-auto>*{pointer-events:auto}.last\\:mb-0:last-child{margin-bottom:0}.last\\:border-b-transparent:last-child{border-bottom-color:transparent}@media (hover:hover) and (pointer:fine){.hover\\:bg-stone-100:hover{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity))}.hover\\:bg-stone-300:hover{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity))}.hover\\:bg-stone-50:hover{--tw-bg-opacity:1;background-color:rgb(250 250 249/var(--tw-bg-opacity))}.hover\\:bg-stone-900:hover{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity:.1}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:.5}.hover\\:text-stone-100:hover{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity))}.hover\\:text-stone-400:hover{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity))}}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline-primary:focus{outline-color:#b85c38}@media (hover:hover) and (pointer:fine){.group:hover .group-hover\\:bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity))}.group:hover .group-hover\\:bg-opacity-20{--tw-bg-opacity:.2}}@media (min-width:300px){.\\32xs\\:gap-3{gap:12px}}@media (min-width:640px){.sm\\:w-\\[32rem\\]{width:512px}.sm\\:p-3{padding:12px}}@media (min-width:768px){.md\\:px-8{padding-left:32px;padding-right:32px}.md\\:pb-5{padding-bottom:20px}.md\\:text-lg{font-size:18px;line-height:28px}}@media (min-width:1024px){.lg\\:px-10{padding-left:40px;padding-right:40px}.lg\\:pb-3{padding-bottom:12px}}@media (min-width:1280px){.xl\\:px-12{padding-left:48px;padding-right:48px}}
27
+ `]]]),_f=Object.freeze(Object.defineProperty({__proto__:null,default:el},Symbol.toStringTag,{value:"Module"})),wf={},xf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Sf=[Z("path",{fill:"currentColor",d:"m10.875 19.3l-6.6-6.6q-.15-.15-.213-.325T4 12q0-.2.063-.375t.212-.325l6.6-6.6q.275-.275.688-.287t.712.287q.3.275.313.688T12.3 6.1L7.4 11h11.175q.425 0 .713.288t.287.712q0 .425-.287.713t-.713.287H7.4l4.9 4.9q.275.275.288.7t-.288.7q-.275.3-.7.3t-.725-.3Z"},null,-1)];function kf(e,t){return O(),Y("svg",xf,Sf)}const tl=he(wf,[["render",kf]]),Cf=Object.freeze(Object.defineProperty({__proto__:null,default:tl},Symbol.toStringTag,{value:"Module"})),If={},Ef={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Tf=[Z("path",{fill:"currentColor",d:"M6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h6v2H7v12.95l5-2.15l5 2.15V11h2v8.475q0 .55-.45.838t-.95.087L12 18l-5.6 2.4ZM7 5h6h-6Zm11 4q-.425 0-.713-.287T17 8V7h-1q-.425 0-.713-.288T15 6q0-.425.288-.713T16 5h1V4q0-.425.288-.713T18 3q.425 0 .713.288T19 4v1h1q.425 0 .713.288T21 6q0 .425-.288.713T20 7h-1v1q0 .425-.288.713T18 9Z"},null,-1)];function $f(e,t){return O(),Y("svg",Ef,Tf)}const nl=he(If,[["render",$f]]),Pf=Object.freeze(Object.defineProperty({__proto__:null,default:nl},Symbol.toStringTag,{value:"Module"})),Of={},Mf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Lf=[Z("path",{fill:"currentColor",d:"M17.825 8.575q-.2 0-.375-.062t-.325-.213L15.7 6.875q-.3-.3-.3-.712t.3-.688q.275-.3.7-.3t.7.275l.725.725l2.825-2.85q.3-.3.7-.3t.725.3q.275.3.275.725t-.275.7l-3.55 3.55q-.15.15-.325.213t-.375.062ZM6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h7q-.5.75-.75 1.438T13 6q0 1.8 1.137 3.175T17 10.9q.575.075 1 .075t1-.075v8.575q0 .55-.45.838t-.95.087L12 18l-5.6 2.4Z"},null,-1)];function zf(e,t){return O(),Y("svg",Mf,Lf)}const ol=he(Of,[["render",zf]]),Af=Object.freeze(Object.defineProperty({__proto__:null,default:ol},Symbol.toStringTag,{value:"Module"})),jf={},Df={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Rf=[Z("path",{fill:"currentColor",d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"},null,-1)];function Bf(e,t){return O(),Y("svg",Df,Rf)}const il=he(jf,[["render",Bf]]),Nf=Object.freeze(Object.defineProperty({__proto__:null,default:il},Symbol.toStringTag,{value:"Module"})),Ff={},Vf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Hf=[Z("path",{fill:"currentColor",d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"},null,-1)];function Wf(e,t){return O(),Y("svg",Vf,Hf)}const rl=he(Ff,[["render",Wf]]),Kf=Object.freeze(Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"})),qf={},Uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 56"},Yf=[Z("path",{fill:"currentColor",d:"M29.84 49.574h12.398c4.899 0 7.336-2.437 7.336-7.265V13.69c0-4.828-2.437-7.265-7.336-7.265H29.84Zm-16.055 0h12.398V6.426H13.785c-4.875 0-7.36 2.414-7.36 7.265V42.31c0 4.851 2.485 7.265 7.36 7.265"},null,-1)];function Xf(e,t){return O(),Y("svg",Uf,Yf)}const sl=he(qf,[["render",Xf]]),Zf=Object.freeze(Object.defineProperty({__proto__:null,default:sl},Symbol.toStringTag,{value:"Module"})),Gf={},Qf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Jf=[Z("g",{fill:"none"},[Z("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),Z("path",{fill:"currentColor",d:"M8 3v18H5a2 2 0 0 1-1.995-1.85L3 19V5a2 2 0 0 1 1.85-1.995L5 3zm11 0a2 2 0 0 1 1.995 1.85L21 5v14a2 2 0 0 1-1.85 1.995L19 21h-9V3z"})],-1)];function ep(e,t){return O(),Y("svg",Qf,Jf)}const ll=he(Gf,[["render",ep]]),tp=Object.freeze(Object.defineProperty({__proto__:null,default:ll},Symbol.toStringTag,{value:"Module"})),np={},op={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},ip=[Z("path",{fill:"currentColor",d:"M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM6 14v4h4v2H4v-6h2Zm14 0v6h-6v-2h4v-4h2Z"},null,-1)];function rp(e,t){return O(),Y("svg",op,ip)}const al=he(np,[["render",rp]]),sp=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"})),lp={},ap={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},cp=[Z("path",{fill:"currentColor",d:"M14 20v-6h6v2h-4v4h-2Zm-6 0v-4H4v-2h6v6H8Zm12-10h-6V4h2v4h4v2Zm-10 0H4V8h4V4h2v6Z"},null,-1)];function up(e,t){return O(),Y("svg",ap,cp)}const cl=he(lp,[["render",up]]),dp=Object.freeze(Object.defineProperty({__proto__:null,default:cl},Symbol.toStringTag,{value:"Module"})),fp={},pp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},hp=[Z("path",{fill:"currentColor",d:"M16.5 16V8l-4 4l4 4ZM5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm3-2V5H5v14h3Zm2 0h9V5h-9v14Zm-2 0H5h3Z"},null,-1)];function gp(e,t){return O(),Y("svg",pp,hp)}const ul=he(fp,[["render",gp]]),mp=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"}));function cn(e=0){return new Promise(t=>setTimeout(t,e))}function dl(e){return new Promise(t=>{const n=o=>{if(!o)return t(void 0);const i=URL.createObjectURL(o);t(i)};e.toBlob(n,"image/jpeg",1)})}async function vp(e,t){if(!t.startsWith("blob:"))return t;if(!e.naturalWidth||!e.naturalHeight)return;const o=document.createElement("canvas"),i=o.getContext("2d"),r=e.naturalWidth,s=e.naturalHeight;return o.width=r,o.height=s,i==null||i.drawImage(e,0,0,r,s),await dl(o)}function bo(e){const t=e.getAttributeNames(),n=t.indexOf("src");n!==-1&&(t.splice(n,1),t.push("src"));for(const o of t){if(o==="srcset"||o!=="data-url"&&o!=="data-original"&&!o.includes("src"))continue;const i=e.getAttribute(o);if(i)return o==="src"&&e.naturalWidth&&e.naturalWidth<200?void 0:i.replace(/(\n|\t)/g," ").trim()}}async function bp(e,t){return(t==null?void 0:t.src)===e&&t.naturalWidth&&t.naturalHeight?{width:t.naturalWidth,height:t.naturalHeight}:await new Promise(n=>{const o=new Image,i=setInterval(()=>{const{naturalWidth:r,naturalHeight:s}=o;s&&r&&(n({width:r,height:s}),clearInterval(i))},20);o.onerror=()=>{n(void 0),clearInterval(i)},o.src=e})}class yp{constructor({isIOS:t,onDownloaded:n,onDownloadError:o}){me(this,"reactiveResults",dn({}));me(this,"isIOS");me(this,"tkLoadId",Date.now());me(this,"isMounted",!0);me(this,"onDisposeCallbacks",[]);me(this,"onDownloaded");me(this,"onDownloadError");this.isIOS=t,this.onDownloaded=n,this.onDownloadError=o}dispose(){this.isMounted=!1,this.onDisposeCallbacks.forEach(t=>t()),this.onDisposeCallbacks=[],this.onDownloaded=()=>{}}async download(t){var l;if(!this.isMounted)return;const n=t.el;let o=t.computedSrc;if(!n&&!o)return;const i=n instanceof HTMLImageElement,r=n instanceof HTMLCanvasElement;if(n){if(n._tkLoadId===this.tkLoadId)return;if(n._tkLoadId=this.tkLoadId,i){const a=()=>this.onImgElLoaded(t,n,!0),c=()=>this.onImgElLoaded(t,n,!1);n.addEventListener("load",a),n.addEventListener("error",c),this.onDisposeCallbacks.push(()=>{n.removeEventListener("load",a),n.removeEventListener("error",c)})}}if(i&&!o){if(o=bo(n),!o)return;n._tkSrc=o}else if(r&&!o){if(o=await dl(n),!o)return;n._tkSrc=o}if(!o||!this.isMounted)return;const s=i&&o.startsWith("blob:");s&&!n.complete||((l=this.reactiveResults)[o]??(l[o]={src:o,isLoading:!0,hasError:!1}),s&&this.isIOS&&await cn(300),await this.downloadSrc(t))}async onImgElLoaded(t,n,o){var r;if(!this.isMounted)return;const i=bo(n);if(i&&!(!i.startsWith("blob:")&&t.computedSrc===i)){if(n._tkSrc=i,!o){this.reactiveResults[i]={src:i,isLoading:!1,hasError:!0},this.onDownloadError();return}(r=this.reactiveResults)[i]??(r[i]={src:i,isLoading:!0,hasError:!1}),this.downloadSrc(t)}}async downloadSrc(t){const n=t.computedSrc;if(!n)return;const o=t.el instanceof HTMLImageElement?t.el:void 0,i=o?await vp(o,n):n;if(!i||!this.isMounted)return;const r=await bp(i,o);this.isMounted&&(this.reactiveResults[n]={src:i,size:r,isLoading:!1,hasError:!r,invalid:!!r&&(r.width<200||r.height<200)},r?this.onDownloaded(t,r):this.onDownloadError())}}const _p=3;class wp{constructor({getItems:t,getActiveIndex:n,isCompleted:o,callback:i}){me(this,"isQueueStarted",!1);me(this,"debouncedEnqueue");me(this,"concurrentCount",0);me(this,"getItems");me(this,"getActiveIndex");me(this,"isCompleted");me(this,"callback");me(this,"activeIndex",0);me(this,"completedItems");me(this,"isMounted",!0);this.getItems=t,this.getActiveIndex=n,this.isCompleted=o,this.callback=i,this.debouncedEnqueue=Ne(this.enqueue.bind(this),50)}dispose(){this.isMounted=!1}run(){this.isQueueStarted?this.debouncedEnqueue():(this.isQueueStarted=!0,this.enqueue())}get canEnqueue(){return this.concurrentCount<_p&&this.isMounted}async enqueue(){if(!this.canEnqueue)return;const t=this.getItems();if(t===this.completedItems)return;this.completedItems=void 0;const n=this.resetActiveIndex(),o=Math.max(0,Math.min(t.length-1,n-1)),i=[];for(let r=o;r<t.length;r++){if(!this.canEnqueue)return;i.push(await this.invokeItemCallback(r,r==t.length-1))}for(let r=o-1;r>=0;r--){if(!this.canEnqueue)return;i.push(await this.invokeItemCallback(r,r==0))}this.getItems()===t&&i.filter(Boolean).length==t.length&&(this.completedItems=t)}async invokeItemCallback(t,n){const o=this.getItems()[t];return o?this.isCompleted(o)?!0:(this.concurrentCount++,this.callback(o).then(()=>{this.concurrentCount=Math.max(0,this.concurrentCount-1),n||this.debouncedEnqueue()}),await cn(),!1):!1}resetActiveIndex(){const t=this.getActiveIndex();return t<this.activeIndex&&(this.concurrentCount=Math.max(0,this.concurrentCount-Math.abs(t-this.activeIndex))),this.activeIndex=t,t}}class Xt{constructor(t,n,o){this.src=t,this.el=n,this.parentEl=o}get computedSrc(){var t;return this.src??((t=this.el)==null?void 0:t._tkSrc)}}class fl{constructor(){me(this,"elsPool",new Map)}check(t){if(!t||t===document.body)return!0;const n=this.elsPool.get(t);if(n!==void 0)return n;const o=getComputedStyle(t);if(!(o.display!=="none"&&+(o.opacity??"1")>.1))return this.elsPool.set(t,!1),!1;const r=this.check(t.parentElement);return this.elsPool.set(t,r),r}}function _i(e){const t=e.tagName.toLowerCase();if(t==="option"){const n=e.parentElement;if(n.tagName.toLowerCase()!=="select")return;n.value=e.getAttribute("value")||"",n.dispatchEvent(new Event("change"));return}return t==="a"&&e.addEventListener("click",n=>n.preventDefault(),{once:!0}),e.click()}async function xp(e){const{lstrip:t,lstripBtn:n}=e||{};if(!t||!n||!!document.querySelector(t))return!1;const i=await an(50,30,()=>document.querySelector(n));return i?(_i(i),await cn(),!0):!1}class Sp{constructor({spec:t,onChanged:n}){me(this,"spec");me(this,"onChanged");me(this,"rawImages",[]);me(this,"isMounted",!0);me(this,"loadRawImagesTs");me(this,"disconnectObservers");this.spec=t,this.onChanged=n,this.init()}dispose(){var t;this.isMounted=!1,(t=this.disconnectObservers)==null||t.call(this),this.disconnectObservers=void 0,this.onChanged=()=>{}}init(){var s;let t;const n=Ne(()=>{t&&this.loadRawImages(t)},100),o=new MutationObserver(n),i=(s=this.spec)!=null&&s.imgDivs?void 0:(()=>{let l=window.innerWidth;return new ResizeObserver(Ne(()=>{const a=window.innerWidth;if(a!==l){l=a;return}n()},50))})();this.disconnectObservers=async()=>{o.disconnect(),i==null||i.disconnect()};let r=!1;this.loadContentEl(l=>{t!==l&&(t=l,o.disconnect(),i==null||i.disconnect(),o.observe(t,{childList:!0,subtree:!0}),i==null||i.observe(t),r?n():(r=!0,this.loadRawImages(t)))})}setRawImages(t){let n=!1;const o=t.map((i,r)=>{const s=this.rawImages[r];return s&&s.el===i.el&&s.parentEl===i.parentEl&&s.src===i.src?s:(n=!0,i)});(n||!o.length)&&(this.rawImages=o,this.onChanged(t))}async loadContentEl(t){var l;const n=await xp(this.spec),o=(l=this.spec)==null?void 0:l.content;if(!o){t(document.body);return}let i=await an(n?100:1,10,()=>{for(const a of o.split(",")){const c=document.querySelector(a);if(c)return c}});if(!i)return;t(i);let r=0;const s=async()=>{if(this.isMounted&&!(i!=null&&i.isConnected)){if(r=0,i=await an(50,20,()=>{const a=document.querySelector(o);return a!=null&&a.isConnected&&a!==i?a:void 0}),!i)return;t(i)}!this.isMounted||++r>=10||setTimeout(s,200)};setTimeout(s,200)}async loadRawImages(t){var r;if(!this.isMounted||!t.isConnected)return;const n=Date.now();this.loadRawImagesTs=n;const o=(r=this.spec)==null?void 0:r.imgDivs,i=o?await kp(t,o):pl(t);this.loadRawImagesTs!==n||!t.isConnected||!this.isMounted||this.setRawImages(i)}}async function kp(e,t){const n=Array.from(e.querySelectorAll(t));if(!n.length)return pl(e);const o=new fl;return n.map(r=>{const s=Array.from(r.querySelectorAll("img,canvas"));for(const l of s)if(o.check(l)){if(l instanceof HTMLCanvasElement){if(hl(l))return new Xt(void 0,l,r)}else if(l instanceof HTMLImageElement&&gl(l)){const a=bo(l);return new Xt(a,l,r)}}return new Xt(void 0,void 0,r)})}function pl(e){const t=[],n={},o=new fl;return Array.from(e.querySelectorAll("img,canvas")).forEach(r=>{if(o.check(r)){if(r instanceof HTMLCanvasElement)hl(r)&&t.push(new Xt(void 0,r));else if(r instanceof HTMLImageElement&&gl(r)){const s=bo(r);if(s){const l=n[s];if(l!==void 0&&l!==-1){t.splice(l,1);return}n[s]=t.length}t.push(new Xt(s,r))}}}),t}function hl(e){return e.isConnected&&ml(e.width,e.height)}function gl(e){if(!e.isConnected)return!1;const t=e.getBoundingClientRect();return!t.width||!t.height||ml(t.width,t.height)}function ml(e,t){return e>=130&&t>=130&&(e>=200||t>=200)}const wi="mp-scroll-container";class xi{constructor(){me(this,"unmountedCallbacks",new Map)}dispose(){for(const t of this.unmountedCallbacks.values())t()}scrollTo({rawImages:t,page:n,skipIfVisible:o,isScrollDown:i,fallbackScrollEl:r}){const s=Math.floor(n),l=t[Math.min(t.length-1,s)];if(!l)return;const a=l.el??l.parentEl??document.querySelector(`img[src^="${l.computedSrc}"]`);if(!a)return;const c=a.getBoundingClientRect();if(o&&c.top<=0&&c.top+c.height>0)return;const u=xi.getScrollable(a,r);if(!u)return;const{el:d,top:p}=u;r!==document.documentElement&&!d.classList.contains(wi)&&(d.classList.add(wi),this.unmountedCallbacks.has(d)||this.unmountedCallbacks.set(d,()=>{d.classList.remove(wi)}));const x=n>=t.length?c.height:i?Math.max(0,c.height-window.innerHeight+100):n%1*c.height,R={top:p+x,behavior:"instant"};d.scrollTo(R),d===document.body&&document.documentElement.scrollTo(R)}static getScrollable(t,n){const o=(i,r)=>{if(!i)return;const{offsetTop:s,offsetParent:l}=i;if(l&&s&&r.set(l,Math.max(r.get(l)??0,s)),!(i===n||i.scrollHeight-i.clientHeight>=10&&window.getComputedStyle(i).overflow!=="visible"))return o(i.parentElement,r);let c=0;return r.forEach((u,d)=>{c+=d===l?u-s:u}),{el:i,top:c}};return o(t,new Map)}}function vl(e){var t,n;for(let o=0;o<e.length;o++){const i=((t=e[o])==null?void 0:t.el)??((n=e[o])==null?void 0:n.parentEl),r=i==null?void 0:i.getBoundingClientRect();if(!r||r.bottom<=0)continue;const s=r.top;return o+(s>=0?0:-s/r.height)}return 0}function Cp(e){if(document.documentElement.scrollTop<700)return 0;const n=Array.from(document.querySelectorAll("img[src]")).filter(o=>e.includes(o.src)).map(o=>new Xt(void 0,o));return vl(n)}function Ip(e){var $,F,C,B;const t=X(($=e.raw.value)==null?void 0:$.isWebtoon),n=X((F=e.raw.value)==null?void 0:F.isWebtoon);let o=!1;const i=e.touchDevice&&!navigator.userAgent.toLowerCase().includes("android"),r=((B=(C=e.raw.value)==null?void 0:C.imgs)==null?void 0:B.filter(Boolean))??[];let s=e.isAutoShow!==!1?e.page.value:r.length?Cp(r):void 0,l=r.map(b=>new Xt(b)),a,c;const u=new yp({isIOS:i,onDownloaded(b,M){let _=l.indexOf(b);if(_===-1){const w=b.computedSrc;_=l.findIndex(j=>j.computedSrc===w)}if(_!==-1){if(M&&!t.value&&_>Math.min(1,l.length-3)&&_<Math.max(l.length-2,3)){const w=M.height/M.width,j=w>2||w<.5,m=w>1.6||w<.6;t.value!==j&&(t.value=j),n.value!==m&&(n.value=m)}x()}},onDownloadError(){c||t.value!==void 0||(c=setTimeout(()=>{c=void 0,t.value===void 0&&e.onError("Failed to load images")},3e3))}}),d=new wp({getItems:()=>l,getActiveIndex:()=>Math.floor(e.page.value),isCompleted:b=>{const M=b.computedSrc;return!!(M&&u.reactiveResults[M])},callback:b=>u.download(b)}),p=new xi;if(r.length)d.run();else{let b=!1;a=new Sp({spec:e.spec,async onChanged(M){var _;if(l=M,!e.raw.value&&!M.length){e.onError("no_img");return}(_=e.spec)!=null&&_.imgDivs&&!b&&e.isAutoShow!==!1&&e.page.value&&(b=!0,p.scrollTo({rawImages:M,page:e.page.value,skipIfVisible:!0,fallbackScrollEl:i?document.body:document.documentElement}),await cn(1)),s===void 0&&e.isAutoShow===!1&&(s=vl(M)),d.run()}})}Ko(()=>{u.dispose(),d.dispose(),a==null||a.dispose(),c&&clearTimeout(c),p.dispose(),o&&p.scrollTo({rawImages:l,page:e.page.value,fallbackScrollEl:document.documentElement})});function x(){var w,j,m;if(o||t.value===void 0||s===void 0)return;const b=Math.max(0,Math.min(s,l.length)),M=Math.min(Math.floor(b),l.length-1);if(M>=1){if(!((w=l[M])==null?void 0:w.computedSrc)){e.isAutoShow&&p.scrollTo({rawImages:l,page:M,fallbackScrollEl:i?document.body:document.documentElement});return}for(let z=M;z<l.length;z++){const J=(j=l[z])==null?void 0:j.computedSrc;if(!J)return;const y=u.reactiveResults[J];if(!y)return;if(!y.invalid){if(!y.size&&!y.hasError)return;break}}for(let z=M-1;z>=0;z--){const J=(m=l[z])==null?void 0:m.computedSrc;if(!J)break;const y=u.reactiveResults[J];if(!y)return;if(!y.invalid){if(!y.size&&!y.hasError)return;break}}}if(o)return;o=!0,e.onReady(b);let _=!0;fe(()=>Math.floor(e.page.value),(L,z)=>{L===z&&!_||(p.scrollTo({rawImages:l,page:L,isScrollDown:z===void 0||L>z||l.length===1,skipIfVisible:_&&l.length>1,fallbackScrollEl:i?document.body:document.documentElement}),_=!1,z??(z=-1),d.run())},{immediate:!0})}return{asyncImgs:se(()=>{Object.values(u.reactiveResults);const b=[];return l.forEach(M=>{const _=M.computedSrc,w=_?u.reactiveResults[_]:void 0;(_&&!(w!=null&&w.invalid)||M.parentEl)&&b.push(w)}),b}),isWebtoon:se(()=>t.value??!1),maybeWebtoon:se(()=>n.value??!1)}}function Ep(e,t,n){return se(()=>t.value?bl(e.value,n.value):e.value.map((o,i)=>[{img:o,index:i}]))}function bl(e,t,n=0){if(e.length===0)return[];const o=e.slice(0,2),i=o.some(s=>(s==null?void 0:s.size)&&s.size.width>s.size.height),r=i||t?[o[0]]:o;return[r.map((s,l)=>({img:s,index:n+l})),...bl(e.slice(r.length),t&&i,n+r.length)]}function Tp(e,t){const n=sessionStorage.getItem("tk:page:path");n!==location.pathname&&(sessionStorage.setItem("tk:page:path",location.pathname),n&&sessionStorage.removeItem("tk:page"));const o=X(t&&e>0?Math.max(0,e):+(sessionStorage.getItem("tk:page")??"0")||e);return se({get:()=>o.value,set:i=>{o.value=i,sessionStorage.setItem("tk:page",i+"")}})}function $p(){sessionStorage.removeItem("tk:page"),sessionStorage.removeItem("tk:page:path")}const Si=40;function Pp({page:e,direction:t,style:n,isLongStrip:o,isVertical:i,isRTL:r,spaceTop:s,scrollEl:l,isWebtoon:a,interferePlayer:c,onChangedPage:u,onInitialized:d,onFinished:p}){let x=!1,R=!1,$=!1,F;const C=Ne(L,300),B=ws(()=>{L(),C()},300),b=Ne(w,50);async function M(){j(e.value,{smooth:!1,ensureLastImgVisibility:!0})}function _(){var I;R=!0,d(),z(),(I=l.value)==null||I.addEventListener("scroll",B),setTimeout(()=>{const{width:K,height:le}=Ls();fe(K,()=>{i.value&&b()}),fe(le,()=>{i.value||b()}),fe(n,w),fe(t,w)},300)}async function w(){if(!R||x)return;x=!0,await ht();const I=e.value;if(y()===I){x=!1;return}j(I)}function j(I,{smooth:K,ensureLastImgVisibility:le=!1}={smooth:!1}){const ue=l.value;if(!ue)return;x=!0;const be=async()=>{await ht(),x=!1,R||_()},_e=Math.floor(I),Ue=yi(ue,_e);if(!Ue){be();return}c(async()=>{await m(ue,!o.value&&K,async()=>{await re(ue,Ue,{smooth:K,page:I,ensureLastImgVisibility:le})}),await be()})}async function m(I,K,le){K&&I.style.setProperty("scroll-snap-type","none"),await le(),K&&I.style.removeProperty("scroll-snap-type")}function L(){if(x)return;const I=y();I!==void 0&&I!==e.value&&u(I),z()}function z(){$||!$&&J()&&($=!0,p())}function J(){const I=l.value;if(!I)return!1;const K=o.value?a.value?3:!i.value&&I.clientWidth>I.clientHeight?2.25:2.5:2;return i.value?I.scrollHeight-I.scrollTop<I.clientHeight*K:I.scrollWidth-(r.value?-I.scrollLeft:I.scrollLeft)<I.clientWidth*K}function y(){const I=g();return I?(+I.getAttribute("data-index")||0)+(o.value?V(I):0):void 0}function g(){var K;if(F??(F=l.value.getRootNode()),!F)return;const I=(K=F.elementsFromPoint)==null?void 0:K.call(F,i.value||!o.value?window.innerWidth/2:r.value?window.innerWidth-Si:Si,i.value&&o.value?s.value||Si:window.innerHeight/2);if(I)for(let le=0;le<I.length;le++){const ue=I[le];if(ue.hasAttribute("data-index"))return ue;if(ue===l.value)break}}function V(I){const K=I.getBoundingClientRect();return i.value?Math.abs(K.top-s.value)/K.height:r.value?Math.max(0,K.right-l.value.clientWidth)/K.width:Math.abs(K.left)/K.width}let G=!1;async function re(I,K,le){if(G)return;const ue=K.getBoundingClientRect();if(!o.value){if(i.value){if(ue.top<=0&&ue.bottom>=I.clientHeight)return}else if(ue.left<=0&&ue.right>=I.clientWidth)return}G=!0;const be=i.value?I.scrollTop:I.scrollLeft,_e=le.page,Ue=o.value?_e%1:0,mt=await an(30,10,async()=>{await cn();let Oe;if(!(K.offsetHeight<10))return o.value?i.value?Oe=K.offsetTop+Ue*K.offsetHeight-s.value:r.value?Oe=K.offsetLeft-I.clientWidth+K.offsetWidth-Ue*K.offsetWidth:Oe=K.offsetLeft+Ue*K.offsetWidth:i.value?Oe=K.offsetTop+(ue.top>0?0:ue.height-I.clientHeight):Oe=K.offsetLeft+(ue.left>0?0:ue.width-I.clientWidth),_e>.5&&Math.abs(Oe)<100?void 0:Oe})??0,Lt=le.ensureLastImgVisibility?i.value?Math.min(mt,I.scrollHeight-I.clientHeight*2):r.value?Math.max(mt,-(I.scrollWidth-I.clientWidth*2)):Math.min(mt,I.scrollWidth-I.clientWidth*2):mt;if(!le.smooth){i.value?I.scrollTop=Lt:I.scrollLeft=Lt,G=!1;return}const Ye=Lt-be,vt=30;let Xe=0;return new Promise(Oe=>{(function ut(){const zt=Op(Xe,be,Ye,vt);i.value?I.scrollTop=zt:I.scrollLeft=zt,Xe++,Xe<=vt?requestAnimationFrame(ut):(Oe(),G=!1)})()})}return{init:M,goToPage:j}}function Op(e,t,n,o){return n*(Math.pow(e/o-1,3)+1)+t}function Mp({autoPlay:e,touchDevice:t,scrollEl:n,isVertical:o,isRTL:i,isLongStrip:r,speed:s}){const l=sessionStorage.getItem("tk:playing"),a=X(typeof l=="string"?l==="true":e),c=se({get:()=>a.value,set:m=>{a.value=m,sessionStorage.setItem("tk:playing",m?"true":"false")}}),u=X(!1);let d,p;const x=Ne(w,100),R=Ne(()=>{u.value=!0},t?2e3:1e3),$=()=>setTimeout(()=>{u.value=!1,R()},30);$(),t||Ot(window,"mousemove",$);const F=Es();Re(()=>{fe(F,m=>{c.value&&(m==="visible"?w():p==null||p())}),fe(s,()=>C()),fe(r,m=>{m||b()})}),Ft(b);async function C(m){c.value&&(p==null||p()),m&&(await ht(),await m()),c.value&&x()}function B(){c.value?b():M()}function b(){c.value&&(c.value=!1,p==null||p(),$())}function M(){!c.value&&r.value&&(c.value=!0,w(),$())}function _(){p==null||p()}function w(){const m=n.value;if(!c.value||!m)return;const L=o.value?m.scrollHeight-m.clientHeight:m.scrollWidth-m.clientWidth,z=j();if(L<=z){b();return}p=()=>{d=Date.now(),p=void 0};const J=Date.now();d=J;const y=.05*s.value,g=o.value?"scrollTop":"scrollLeft";let V=Date.now(),G=0;const re=()=>{if(d!==J)return;const I=Date.now(),K=I-V;V=I;const le=y*K+G;le>=1?(G=le%1,m[g]+=(le-G)*(i.value?-1:1)):G=le,setTimeout(re,1)};re()}function j(){const m=n.value;return o.value?m.scrollTop:i.value?-m.scrollLeft:m.scrollLeft}return{isPlaying:c,isIdle:u,toggle:B,play:M,pause:_,resume:w,stop:b,interfere:C,awake:$}}function Lp({raw:e,spec:t,siteMeta:n}){var z,J,y;const{vol:o,inferVol:i,chap:r,title:s,slug:l,basePath:a}=e,c=t==null?void 0:t.chapter;let u=-1;const d=c&&c.sel&&!c.url?document.querySelectorAll(c.sel):void 0;async function p(g,V){if(g.slug)x(g.slug,V);else if(g.elIndex!==void 0&&d&&d[g.elIndex]){let G=null;c!=null&&c.trigger&&(G=document.querySelector(c.trigger)),G&&(G.click(),await new Promise(re=>setTimeout(()=>re(),50))),_i(d[g.elIndex]),G&&G.click()}}function x(g,V){const G=zp(a,g,(n==null?void 0:n.trailing)??!0);V?window.open(G,"_blank","noopener"):location.href=G}function R(g){const V=b[g];return V?G=>p(V,G):void 0}function $(g,V,G){if(g){const re=document.querySelector(g);re&&_i(re);return}V&&x(V,G)}const F=o??i,C=c==null?void 0:c.url,B=((z=s.chapters)==null?void 0:z.filter(g=>g.slug||!C&&g.elIndex!==void 0))??[],b=B.length>1?B:[],M=(J=e.prev)==null?void 0:J.slug,_=(y=e.next)==null?void 0:y.slug,{prevBtn:w,nextBtn:j}=t??{};let m=M||w&&!b.length?g=>$(w,M,g):void 0,L=_||j&&!b.length?g=>$(j,_,g):void 0;if(b.length){if(C&&(u=b.findIndex(g=>g.slug===e.slug)),u===-1&&(u=b.findIndex(g=>(g.vol??g.inferVol)===F&&g.chap===r)),C&&u===-1&&(u=b.findIndex(g=>g.slug&&l.startsWith(`${g.slug}-`)&&l.length-g.slug.length>3)),u!==-1)m??(m=R(u+1)),L??(L=R(u-1));else if(!M&&!_){const g=b.findIndex(V=>{const G=V.vol??V.inferVol;return F===void 0||G===void 0||F===G?V.chap<r:G<F});g!==-1?(m=R(g),L=R(g-1)):L=R(b.length-1)}}return{activeIndex:u,activeLabel:yl({vol:o,chap:r}),prev:m,next:L,chapters:b.map(g=>({label:yl(g),select:V=>p(g,V)}))}}function yl({vol:e,chap:t}){return e==null?`Ch.${t}`:`Vol.${e} ch.${t}`}function zp(e,t,n){const o=!t||t.includes("//")||t.startsWith("/")?t:"/"+[...e.split("/"),...t.split("/")].filter(Boolean).join("/"),[i,r]=(o.includes("//")?o:location.origin+o).split("?");return[i.endsWith("/")===n?i:n?i+"/":i.substring(0,-1),r].filter(Boolean).join("?")}const Ap={key:0,class:"ml-auto inline-flex gap-[1px] scale-95 origin-right"},_l=he(ke({inheritAttrs:!1,__name:"App",props:{immediate:{type:Boolean},raw:{},spec:{},siteMeta:{},page:{},spaceTop:{},fullScreen:{type:Boolean},touchDevice:{type:Boolean},entryId:{},autoPlay:{type:Boolean},readerStyle:{},direction:{},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},onPressedBack:{type:Function}},emits:["error","ready","pageChanged","fullScreenChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters"],setup(e,{emit:t}){const n=e,o=t;let i=!1,r;const s=X(!1),l=X(!1),a=yu({touchDevice:n.touchDevice}),c=Tp(n.page,n.isAutoShow),u=se(()=>n.spaceTop??0),{asyncImgs:d,isWebtoon:p,maybeWebtoon:x}=Ip({raw:se(()=>n.raw),spec:n.spec,page:c,touchDevice:n.touchDevice,isAutoShow:n.isAutoShow,spaceTop:u,async onReady(v){mt(v),s.value=!0},onError:()=>{o("error"),D()}}),{direction:R,style:$,isRTL:F,isDouble:C,isVertical:B,isLongStrip:b,gap:M,speed:_,zoom:w,breakFirst:j,autoNextSeconds:m}=rd({titleName:se(()=>{var v;return(v=n.raw)==null?void 0:v.title.name}),isWebtoon:p,maybeWebtoon:x,defaultStyle:n.readerStyle,defaultDirection:n.direction}),L=X(!1),z=Ep(d,C,j),J=se(()=>c.value>=d.value.length),y=se(()=>n.raw?Lp({raw:n.raw,spec:n.spec,siteMeta:n.siteMeta}):void 0),g=X(null),V=Is(),G=X(!1),re=X(!1),I=Mp({autoPlay:!n.tourEnabled&&n.autoPlay,touchDevice:n.touchDevice,scrollEl:se(()=>{var v;return(v=g.value)==null?void 0:v.$el}),speed:_,isRTL:F,isVertical:B,isLongStrip:b}),K=se(()=>!n.touchDevice&&I.isIdle.value&&!a.value&&!L.value),le=se({get(){return w.value},set(v){I.interfere(()=>{w.value=v})}}),ue=Pp({page:c,style:$,direction:R,isLongStrip:b,isVertical:B,isRTL:F,spaceTop:u,isWebtoon:p,scrollEl:se(()=>{var v;return(v=g.value)==null?void 0:v.$el}),interferePlayer:v=>I.interfere(v),onChangedPage:mt,onInitialized(){o("ready"),l.value=!0,r=Lt()},onFinished:()=>o("finished")}),be=se(()=>Math.floor(c.value)),_e=()=>I.interfere(()=>cn(100));Tu().addListener({onKeyDown:v=>{if(n.tourEnabled)return;const k=b.value&&B.value,q=b.value&&!B.value,te=!b.value&&B.value,ge=!b.value&&!B.value;switch(v.key){case" ":v.preventDefault(),b.value?(ee(!1),I.toggle()):N();break;case"ArrowUp":case"PageUp":k?_e():te&&be.value!==0&&(v.preventDefault(),S());break;case"ArrowDown":case"PageDown":k?_e():te&&!J.value&&(v.preventDefault(),E());break;case"ArrowLeft":q?_e():ge?(v.preventDefault(),f()):B.value&&Oe();break;case"ArrowRight":q?_e():ge?(v.preventDefault(),h()):B.value&&Xe();break}},onKeyUp:v=>{switch(v.key){case"b":j.value=!j.value;break;case"f":H();break;case"t":A();break;case"h":ee();break}}}),Ot("fullscreenchange",()=>{G.value=!!document.fullscreenElement}),fe(I.isPlaying,v=>{v||N(!1),o("playingChanged",v)}),fe(I.isIdle,v=>{I.isPlaying.value&&N(v)}),fe(a,v=>{!v&&I.isIdle.value?I.awake():v&&n.fullScreen&&N()});function mt(v){if(c.value===v)return;const k=d.value.length;if(v<0||v>=k+1)return;const q=Math.floor(v*100)/100;if(q===c.value)return;const te=c.value;c.value=q,o("pageChanged",q),v>=k?(N(!1),I.stop()):v<.01&&te>v?(N(!1),I.awake()):i||(b.value?r!==void 0&&Lt()-r>300&&N(!0):Math.abs(te-v)===1&&N(!0))}function Lt(){var k;const v=(k=g.value)==null?void 0:k.$el;return v?B.value?v.scrollTop:F.value?-v.scrollLeft:v.scrollLeft:0}function Ye(){!n.touchDevice&&!b.value&&ue.goToPage(be.value,{smooth:!0})}function vt(){if(I.isPlaying.value){!n.fullScreen||!n.touchDevice?I.stop():I.awake();return}N()}function Xe(v=!1){var k,q;(q=(k=y.value)==null?void 0:k.next)==null||q.call(k,v)}function Oe(v=!1){var k,q;(q=(k=y.value)==null?void 0:k.prev)==null||q.call(k,v)}function ut(v){F.value?Xe(At(v)):Oe(At(v))}function zt(v){F.value?Oe(At(v)):Xe(At(v))}function At(v){return!n.touchDevice&&(v.ctrlKey||v.metaKey)}function f(){F.value?E():S()}function h(){F.value?S():E()}function S(){var q;const v=z.value,k=J.value?v[v.length-1][0].index:(q=v[T()-1])==null?void 0:q[0].index;k!==void 0?ue.goToPage(k):Oe()}function E(){var v,k;if(J.value)Xe();else{const q=((k=(v=z.value[T()+1])==null?void 0:v[0])==null?void 0:k.index)??d.value.length;ue.goToPage(q)}}function T(){const v=be.value,k=z.value.findIndex(q=>q.some(({index:te})=>te===v));return k===-1?z.value.length-1:k}function D(){$p(),o("dispose")}async function N(v){if(a.value&&!n.fullScreen)return;const k=typeof v=="boolean"?v:!n.fullScreen;k!==n.fullScreen&&(i=!0,o("fullScreenChanged",k),k&&setTimeout(()=>{n.fullScreen&&a.value&&o("fullScreenChanged",!1)},100))}function A(){n.entryId?W():P()}function H(){var v,k;document.fullscreenElement?document.exitFullscreen():(k=(v=V.value)==null?void 0:v.querySelector("#reader-layout"))==null||k.requestFullscreen()}function P(){I.stop(),o("addEntry")}function W(){I.stop(),o("openEntry",n.entryId)}function ee(v){re.value!==v&&(re.value=!re.value,re.value&&I.isPlaying.value&&I.stop())}return(v,k)=>v.immediate||s.value?(O(),pe(Js,{key:0,loading:!l.value,immediate:!!v.immediate,"full-screen":!!v.fullScreen,zooming:L.value,idle:K.value,"space-top":u.value,rtl:U(F),onClick:k[15]||(k[15]=Ke(()=>{},["stop"]))},Cr({settings:ie(()=>{var q;return[Q(Ns,{"reader-style":U($),"onUpdate:readerStyle":k[6]||(k[6]=te=>Ie($)?$.value=te:null),direction:U(R),"onUpdate:direction":k[7]||(k[7]=te=>Ie(R)?R.value=te:null),gap:U(M),"onUpdate:gap":k[8]||(k[8]=te=>Ie(M)?M.value=te:null),speed:U(_),"onUpdate:speed":k[9]||(k[9]=te=>Ie(_)?_.value=te:null),zoom:le.value,"onUpdate:zoom":k[10]||(k[10]=te=>le.value=te),"auto-next-seconds":U(m),"onUpdate:autoNextSeconds":k[11]||(k[11]=te=>Ie(m)?m.value=te:null),name:(q=v.raw)==null?void 0:q.title.name,webtoon:U(p),disabled:!s.value,onHelp:ee},null,8,["reader-style","direction","gap","speed","zoom","auto-next-seconds","name","webtoon","disabled"])]}),"reset-zoom":ie(()=>[Q(rn,{name:"fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ie(()=>[L.value||U(w)!==1?(O(),pe(Vs,{key:0,zoom:le.value,onClick:k[14]||(k[14]=Ke(()=>le.value=1,["stop"])),class:"duration-200"},null,8,["zoom"])):ye("",!0)]),_:1})]),progress:ie(()=>[Z("div",{class:"h-0.5 rounded-t-sm max-w-full bg-orange-500 duration-500",style:ze({width:`${U(c)/(U(d).length-1)*100}%`})},null,4)]),default:ie(()=>{var q;return[s.value?(O(),pe(Qs,{key:0,ref_key:"body",ref:g,zoom:le.value,"onUpdate:zoom":k[0]||(k[0]=te=>le.value=te),zooming:L.value,"onUpdate:zooming":k[1]||(k[1]=te=>L.value=te),page:U(c),"page-index":be.value,pages:U(z),"total-imgs":U(d).length,direction:U(R),gap:U(M),"is-long-strip":U(b),isRTL:U(F),"is-double":U(C),"is-vertical":U(B),"space-top":u.value,busy:U(a),idle:K.value,"play-controller":U(I),"touch-device":v.touchDevice,"has-next":!!((q=y.value)!=null&&q.next),onReady:U(ue).init,onPrev:S,onNext:E,onClick:vt,onDragEnd:Ye,onWheelPassive:k[2]||(k[2]=()=>U(I).interfere())},Cr({_:2},[s.value&&U(d).length?{name:"end",fn:ie(()=>{var te;return[Q(zs,{"has-next":!!((te=y.value)!=null&&te.next),seconds:U(m),onNext:Xe,onHide:D},null,8,["has-next","seconds"])]}),key:"0"}:void 0]),1032,["zoom","zooming","page","page-index","pages","total-imgs","direction","gap","is-long-strip","isRTL","is-double","is-vertical","space-top","busy","idle","play-controller","touch-device","has-next","onReady"])):ye("",!0),l.value&&!J.value&&!v.tourEnabled?(O(),pe(Us,{key:1,direction:U(R)},null,8,["direction"])):ye("",!0),l.value&&!J.value?(O(),pe(Zs,{key:2,playing:!!U(I).isPlaying.value},null,8,["playing"])):ye("",!0),re.value?(O(),pe(Ys,{key:3,"touch-device":v.touchDevice,onHide:ee},null,8,["touch-device"])):ye("",!0),v.tourEnabled?(O(),pe(el,{key:4,onHide:k[3]||(k[3]=()=>o("tourEnabledChanged",!1))})):ye("",!0)]}),_:2},[v.raw||v.onPressedBack?{name:"back",fn:ie(()=>[Q(tt,{href:v.onPressedBack||!v.raw?"#":v.raw.title.url,title:"Back to manga",onClick:v.onPressedBack},{default:ie(()=>[Q(tl)]),_:1},8,["href","onClick"])]),key:"0"}:void 0,v.touchDevice?void 0:{name:"exit",fn:ie(()=>[Q(tt,{title:"Hide reader","data-tour":"You have entered reader mode, press here to return to the original page",onClick:D},{default:ie(()=>[Q(ul)]),_:1})]),key:"1"},y.value?{name:"chapter-nav",fn:ie(()=>{var q;return[Q(Ks,{"touch-device":v.touchDevice,"chapter-spec":(q=v.spec)==null?void 0:q.chapter,data:y.value,onGetHiddenChapters:k[4]||(k[4]=()=>o("getHiddenChapters")),onChaptersDialogOpen:k[5]||(k[5]=()=>N(!0))},null,8,["touch-device","chapter-spec","data"]),y.value.next||y.value.prev?(O(),Y("div",Ap,[Q(tt,{title:`${U(F)?"Next":"Prev"} chapter (←)`,disabled:U(F)?!y.value.next:!y.value.prev,class:"!rounded-r-none",onClick:ut},{default:ie(()=>[Q(il)]),_:1},8,["title","disabled"]),Q(tt,{title:`${U(F)?"Prev":"Next"} chapter (→)`,disabled:U(F)?!y.value.prev:!y.value.next,class:"!rounded-l-none",onClick:zt},{default:ie(()=>[Q(rl)]),_:1},8,["title","disabled"])])):ye("",!0)]}),key:"2"}:void 0,U(z).length?{name:"page-nav",fn:ie(()=>[Q(Xs,{"model-value":be.value,disabled:!l.value,pages:U(z),"total-imgs":U(d).length,"onUpdate:modelValue":U(ue).goToPage},null,8,["model-value","disabled","pages","total-imgs","onUpdate:modelValue"])]),key:"3"}:void 0,v.raw?{name:"entry",fn:ie(()=>[Q(tt,{title:v.entryId?"View entry (T)":"Add to library (T)","data-tour":"Prress here to add to your collection",onClick:A},{default:ie(()=>[v.entryId?(O(),pe(ol,{key:0})):(O(),pe(nl,{key:1}))]),_:1},8,["title"])]),key:"4"}:void 0,v.touchDevice?void 0:{name:"full-screen",fn:ie(()=>[Q(tt,{title:`${G.value?"Exit":"Enter"} fullscreen (F)`,onClick:H},{default:ie(()=>[G.value?(O(),pe(cl,{key:0})):(O(),pe(al,{key:1}))]),_:1},8,["title"])]),key:"5"},U(b)?{name:"play",fn:ie(()=>[Q(tt,{"data-tour":"Press here to play like a video",title:`${U(I).isPlaying.value?"Pause":"Play"} (Space)`,disabled:!l.value,onClick:k[12]||(k[12]=()=>U(I).toggle())},{default:ie(()=>[U(I).isPlaying.value?(O(),pe(mi,{key:0})):(O(),pe(vi,{key:1}))]),_:1},8,["title","disabled"])]),key:"6"}:void 0,U(C)?{name:"break-first",fn:ie(()=>[Q(tt,{title:"Break 1st page (B)","data-tour":"Press here to separate the first page from double-page mode",disabled:!l.value,onClick:k[13]||(k[13]=()=>j.value=!U(j))},{default:ie(()=>[U(j)?(O(),pe(ll,{key:0})):(O(),pe(sl,{key:1}))]),_:1},8,["disabled"])]),key:"7"}:void 0]),1032,["loading","immediate","full-screen","zooming","idle","space-top","rtl"])):ye("",!0)}}),[["styles",[`/*! tailwindcss v3.4.0 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Helvetica,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*{-webkit-tap-highlight-color:rgba(0,0,0,0)!important}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:none;border-style:none;cursor:pointer;outline:2px solid transparent;outline-offset:2px;white-space:nowrap}button[disabled]{cursor:default!important}svg{height:100%;width:100%}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.\\!container{width:100%!important}.container{width:100%}@media (min-width:300px){.\\!container{max-width:300px!important}.container{max-width:300px}}@media (min-width:640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-sm{scrollbar-color:#777 transparent;scrollbar-width:thin}.scrollbar-sm::-webkit-scrollbar{background-color:transparent;height:4px;width:4px}.scrollbar-sm::-webkit-scrollbar-track{background:transparent}.scrollbar-sm::-webkit-scrollbar-thumb{background-color:#777;border-radius:2px}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.top-0{top:0}.top-1{top:4px}.top-1\\/2{top:50%}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.m-0{margin:0}.m-auto{margin:auto}.-mx-12{margin-left:-48px;margin-right:-48px}.-my-12{margin-bottom:-48px;margin-top:-48px}.-ml-20{margin-left:-80px}.-mr-3{margin-right:-12px}.mb-8{margin-bottom:32px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-0{height:0}.h-0\\.5{height:2px}.h-1{height:4px}.h-1\\.5{height:6px}.h-10{height:40px}.h-12{height:48px}.h-16{height:64px}.h-20{height:80px}.h-24{height:96px}.h-4{height:16px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[101\\%\\]{height:101%}.h-\\[30rem\\]{height:480px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[70vh\\]{max-height:70vh}.max-h-\\[80vh\\]{max-height:80vh}.max-h-full{max-height:100%}.max-h-none{max-height:none}.w-1{width:4px}.w-1\\/3{width:33.333333%}.w-10{width:40px}.w-12{width:48px}.w-20{width:80px}.w-24{width:96px}.w-28{width:112px}.w-4{width:16px}.w-40{width:160px}.w-\\[4\\.8rem\\]{width:76.8px}.w-full{width:100%}.w-screen{width:100vw}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-xs{max-width:320px}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-right{transform-origin:right}.origin-top{transform-origin:top}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1{--tw-translate-y:-4px}.-translate-y-1\\.5{--tw-translate-y:-6px}.-translate-y-1\\.5,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.translate-y-0{--tw-translate-y:0px}.translate-y-0,.translate-y-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1{--tw-translate-y:4px}.translate-y-1\\.5{--tw-translate-y:6px}.translate-y-1\\.5,.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-95,.scale-y-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-90{--tw-scale-y:.9}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-grabbing{cursor:grabbing}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.touch-pan-x{--tw-pan-x:pan-x}.touch-pan-x,.touch-pan-y{touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-pan-y{--tw-pan-y:pan-y}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize{resize:both}.\\!snap-none{scroll-snap-type:none!important}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.gap-\\[1px\\]{gap:1px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overscroll-contain{overscroll-behavior:contain}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:4px}.rounded-2xl{border-radius:16px}.rounded-\\[2\\.5rem\\]{border-radius:40px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-sm{border-radius:2px}.\\!rounded-l-none{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.\\!rounded-r-none{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.rounded-t-sm{border-top-left-radius:2px;border-top-right-radius:2px}.rounded-t-xl{border-top-left-radius:12px;border-top-right-radius:12px}.border{border-width:1px}.border-2{border-width:2px}.border-t-\\[1px\\]{border-top-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-stone-300{--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity))}.border-stone-400{--tw-border-opacity:1;border-color:rgb(168 162 158/var(--tw-border-opacity))}.border-stone-600{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity))}.border-opacity-30{--tw-border-opacity:.3}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-orange-500{--tw-bg-opacity:1;background-color:rgb(249 115 22/var(--tw-bg-opacity))}.bg-stone-300{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity))}.bg-stone-400{--tw-bg-opacity:1;background-color:rgb(168 162 158/var(--tw-bg-opacity))}.bg-stone-600{--tw-bg-opacity:1;background-color:rgb(87 83 78/var(--tw-bg-opacity))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-40{--tw-bg-opacity:.4}.bg-opacity-50{--tw-bg-opacity:.5}.bg-opacity-80{--tw-bg-opacity:.8}.bg-opacity-90{--tw-bg-opacity:.9}.bg-none{background-image:none}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:4px}.p-2{padding:8px}.p-4{padding:16px}.p-6{padding:24px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-6{padding-left:24px;padding-right:24px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.pb-12{padding-bottom:48px}.pb-6{padding-bottom:24px}.pl-1{padding-left:4px}.pt-3{padding-top:12px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-sans{font-family:Helvetica,sans-serif}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.font-medium{font-weight:500}.lowercase{text-transform:lowercase}.leading-none{line-height:1}.text-primary{--tw-text-opacity:1;color:rgb(184 92 56/var(--tw-text-opacity))}.text-stone-100{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity))}.text-stone-900{--tw-text-opacity:1;color:rgb(28 25 23/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-90{opacity:.9}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}.children-pointer-events-auto>*{pointer-events:auto}.last\\:mb-0:last-child{margin-bottom:0}.last\\:border-b-transparent:last-child{border-bottom-color:transparent}@media (hover:hover) and (pointer:fine){.hover\\:bg-stone-100:hover{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity))}.hover\\:bg-stone-300:hover{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity))}.hover\\:bg-stone-50:hover{--tw-bg-opacity:1;background-color:rgb(250 250 249/var(--tw-bg-opacity))}.hover\\:bg-stone-900:hover{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity:.1}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:.5}.hover\\:text-stone-100:hover{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity))}.hover\\:text-stone-400:hover{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity))}}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline-primary:focus{outline-color:#b85c38}@media (hover:hover) and (pointer:fine){.group:hover .group-hover\\:bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity))}.group:hover .group-hover\\:bg-opacity-20{--tw-bg-opacity:.2}}@media (min-width:300px){.\\32xs\\:gap-3{gap:12px}}@media (min-width:640px){.sm\\:w-\\[32rem\\]{width:512px}.sm\\:p-3{padding:12px}}@media (min-width:768px){.md\\:px-8{padding-left:32px;padding-right:32px}.md\\:pb-5{padding-bottom:20px}.md\\:text-lg{font-size:18px;line-height:28px}}@media (min-width:1024px){.lg\\:px-10{padding-left:40px;padding-right:40px}.lg\\:pb-3{padding-bottom:12px}}@media (min-width:1280px){.xl\\:px-12{padding-left:48px;padding-right:48px}}
28
28
  `]]]),jp=Object.freeze(Object.defineProperty({__proto__:null,default:_l},Symbol.toStringTag,{value:"Module"})),Dp=Object.freeze(Object.defineProperty({__proto__:null,default:ke({__name:"IntersectionWrapper",emits:["visible"],setup(e,{emit:t}){const n=t,o=X(null),i=X(!1);return Re(async()=>{await ht();let r=!1;fi(o,s=>{const l=s.some(a=>a.isIntersecting);l!==i.value&&(i.value=l),l&&!r&&n("visible")})}),(r,s)=>(O(),Y("div",{ref_key:"root",ref:o},[we(r.$slots,"default",{visible:i.value})],512))}})},Symbol.toStringTag,{value:"Module"})),Rp={},Bp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Np=[Z("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46s46-20.595 46-46s-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1)];function Fp(e,t){return O(),Y("svg",Bp,Np)}const Vp=Object.freeze(Object.defineProperty({__proto__:null,default:he(Rp,[["render",Fp]])},Symbol.toStringTag,{value:"Module"})),Hp=`gear-second{height:0!important;opacity:0!important;pointer-events:none!important;width:0!important;z-index:-10!important}html.gear-second,html.gear-second *{scroll-behavior:auto!important;scrollbar-width:none!important}html.gear-second ::-webkit-scrollbar,html.gear-second::-webkit-scrollbar{display:none!important}html.gear-second body{touch-action:pan-x pan-y!important}html.gear-second body .m-content #progress-bar{display:none!important}html.gear-second body :not(dialog[open]){visibility:hidden!important}.mp-scroll-container{max-height:100vh!important;overflow:hidden!important}html:has(body.mp-scroll-container){overflow:auto!important}
29
29
  `;function Wp(){const e=document.getElementById("mp-download-container");if(!e)return;e.style.setProperty("display","none");const t=JSON.parse(e.getAttribute("data-value"));t.imgs=Array.from(e.children).map(n=>n.src)}const Zt="gear-second",ki={immediate:void 0,raw:void 0,spec:void 0,page:0,spaceTop:void 0,fullScreen:void 0,touchDevice:void 0,entryId:void 0,autoPlay:void 0,readerStyle:void 0,direction:void 0,isAutoShow:void 0,tourEnabled:void 0,onError:void 0,onDispose:void 0,onFullScreenChanged:void 0,onPageChanged:void 0,onOpenEntry:void 0,onAddEntry:void 0,onFinished:void 0,onPressedBack:void 0},qe={promise:void 0,data:dn({...ki})};async function Kp(e){return qe.promise?(qe.data.raw=e.raw,await qe.promise):(qe.promise=new Promise(t=>{let n=!1,o=!1,i,r,s=0;const l=!!e.spaceTop||!!e.isAutoShow&&!!e.page,a=()=>{n||(n=!0,clearInterval(i),i=void 0,r!=null&&r.isConnected&&document.body.removeChild(r),document.documentElement.classList.remove(Zt),Object.assign(qe.data,ki),qe.promise=void 0)},c=Ne(p=>{var x;return!n&&((x=e.onPageChanged)==null?void 0:x.call(e,p))},300);Object.assign(qe.data,ki,e,{immediate:l,onReady(){l||(u(),document.documentElement.classList.add(Zt))},onError(){var p,x;a(),o?((p=e.onDispose)==null||p.call(e),(x=e.onError)==null||x.call(e)):d()},onDispose:()=>{var p;a(),(p=e==null?void 0:e.onDispose)==null||p.call(e)},onFullScreenChanged:p=>{var x;qe.data.fullScreen=p,(x=e.onFullScreenChanged)==null||x.call(e,p)},onPageChanged:p=>{qe.data.page=p,!(s>=p)&&(s=p,c(p))},onTourEnabledChanged:p=>{qe.data.tourEnabled=p}}),qp().then(()=>{if(n){d();return}r=document.createElement(Zt),l?(document.documentElement.classList.add(Zt),document.body.appendChild(r),setTimeout(u)):document.body.appendChild(r);let p=0;i=setInterval(()=>{if(++p===30||n){clearInterval(i),i=void 0;return}r.isConnected||(document.documentElement.classList.add(Zt),document.body.appendChild(r))},100)});function u(){o||(o=!0,t({triggerDoubleTap(){},triggerTouchStart(){},updateArgs(p){Object.assign(qe.data,p)},dispose:a}))}function d(){o||t(void 0)}}),await qe.promise)}async function qp(){if(window.customElements.get(Zt))return;const e=document.createElement("style"),t=Hp;e.appendChild(document.createTextNode(t)),document.head.appendChild(e);const n=Wc({styles:[await Up()],data:()=>({readerData:qe.data}),render(){return Jr(_l,this.readerData)}});window.customElements.define(Zt,n)}async function Up(){const e=Object.assign({"./App.vue":jp,"./components/AutoNext.vue":bu,"./components/BottomSheet.vue":Mu,"./components/ButtonDropdown.vue":Od,"./components/ButtonIcon.vue":wu,"./components/ButtonReaderSettings.vue":ld,"./components/ButtonResetZoom.vue":md,"./components/ChapterNav.vue":Md,"./components/DirectionToast.vue":Rd,"./components/GesturesContainer.vue":Jd,"./components/HelpScreen.vue":Nd,"./components/InputPercentage.vue":Au,"./components/InputSelect.vue":Du,"./components/IntersectionWrapper.vue":Dp,"./components/LoadingIndicator.vue":rf,"./components/PageNav.vue":Fd,"./components/PauseToast.vue":Qd,"./components/ReaderBody.vue":uf,"./components/ReaderLayout.vue":yf,"./components/ReaderTour.vue":_f,"./components/TableField.vue":Nu,"./components/icons/IconBack.vue":Cf,"./components/icons/IconBookmarkNew.vue":Pf,"./components/icons/IconBookmarked.vue":Af,"./components/icons/IconChevronLeft.vue":Nf,"./components/icons/IconChevronRight.vue":Kf,"./components/icons/IconClose.vue":Iu,"./components/icons/IconDouble.vue":Zf,"./components/icons/IconDoubleSkip.vue":tp,"./components/icons/IconExclamationCircle.vue":Vp,"./components/icons/IconFullscreen.vue":sp,"./components/icons/IconFullscreenExit.vue":dp,"./components/icons/IconHelp.vue":Ku,"./components/icons/IconLoading.vue":wd,"./components/icons/IconNext.vue":Dd,"./components/icons/IconPause.vue":qd,"./components/icons/IconPlay.vue":Gd,"./components/icons/IconReaderExit.vue":mp,"./components/icons/IconSettings.vue":Zu,"./components/icons/IconTriangle.vue":Id,"./components/icons/IconZoom.vue":fd}),t=[];for(const n in e){const o=e[n];t.push(o.default.styles)}return t.join("")}Fe.default=Kp,Fe.readOffline=Wp,Object.defineProperties(Fe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gear-second",
3
3
  "author": "endyquang",
4
- "version": "1.16.0",
4
+ "version": "1.16.1",
5
5
  "license": "UNLICENSED",
6
6
  "description": "MP manga reader",
7
7
  "main": "index.js",