gear-second 2.1.0 → 2.1.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.
- package/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* @vue/runtime-dom v3.5.24
|
|
18
18
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
19
|
* @license MIT
|
|
20
|
-
**/let xi;const Ss=typeof window<"u"&&window.trustedTypes;if(Ss)try{xi=Ss.createPolicy("vue",{createHTML:e=>e})}catch{}const ks=xi?e=>xi.createHTML(e):e=>e,Kc="http://www.w3.org/2000/svg",Uc="http://www.w3.org/1998/Math/MathML",zt=typeof document<"u"?document:null,Cs=zt&&zt.createElement("template"),qc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?zt.createElementNS(Kc,e):t==="mathml"?zt.createElementNS(Uc,e):n?zt.createElement(e,{is:n}):zt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>zt.createTextNode(e),createComment:e=>zt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{Cs.innerHTML=ks(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Cs.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ft="transition",Rn="animation",Nn=Symbol("_vtc"),Ts={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Zc=Ee({},Mr,Ts),Eo=(e=>(e.displayName="Transition",e.props=Zc,e))((e,{slots:t})=>_s(Ha,Yc(e),t)),Qt=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},Is=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function Yc(e){const t={};for(const k in e)k in Ts||(t[k]=e[k]);if(e.css===!1)return t;const{name:n="v",type:o,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:u=s,appearToClass:c=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,y=Xc(i),x=y&&y[0],L=y&&y[1],{onBeforeEnter:N,onEnter:Z,onEnterCancelled:O,onLeave:w,onLeaveCancelled:g,onBeforeAppear:S=N,onAppear:D=Z,onAppearCancelled:B=O}=t,C=(k,E,Y,te)=>{k._enterCancelled=te,en(k,E?c:l),en(k,E?u:s),Y&&Y()},H=(k,E)=>{k._isLeaving=!1,en(k,f),en(k,h),en(k,p),E&&E()},X=k=>(E,Y)=>{const te=k?D:Z,K=()=>C(E,k,Y);Qt(te,[E,K]),Ms(()=>{en(E,k?a:r),Lt(E,k?c:l),Is(te)||Es(E,o,x,K)})};return Ee(t,{onBeforeEnter(k){Qt(N,[k]),Lt(k,r),Lt(k,s)},onBeforeAppear(k){Qt(S,[k]),Lt(k,a),Lt(k,u)},onEnter:X(!1),onAppear:X(!0),onLeave(k,E){k._isLeaving=!0;const Y=()=>H(k,E);Lt(k,f),k._enterCancelled?(Lt(k,p),Os(k)):(Os(k),Lt(k,p)),Ms(()=>{k._isLeaving&&(en(k,f),Lt(k,h),Is(w)||Es(k,o,L,Y))}),Qt(w,[k,Y])},onEnterCancelled(k){C(k,!1,void 0,!0),Qt(O,[k])},onAppearCancelled(k){C(k,!0,void 0,!0),Qt(B,[k])},onLeaveCancelled(k){H(k),Qt(g,[k])}})}function Xc(e){if(e==null)return null;if(_e(e))return[_i(e.enter),_i(e.leave)];{const t=_i(e);return[t,t]}}function _i(e){return Ko(e)}function Lt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Nn]||(e[Nn]=new Set)).add(t)}function en(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Nn];n&&(n.delete(t),n.size||(e[Nn]=void 0))}function Ms(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Gc=0;function Es(e,t,n,o){const i=e._endId=++Gc,r=()=>{i===e._endId&&o()};if(n!=null)return setTimeout(r,n);const{type:s,timeout:l,propCount:a}=Jc(e,t);if(!s)return o();const u=s+"end";let c=0;const f=()=>{e.removeEventListener(u,p),r()},p=h=>{h.target===e&&++c>=a&&f()};setTimeout(()=>{c<a&&f()},l+1),e.addEventListener(u,p)}function Jc(e,t){const n=window.getComputedStyle(e),o=y=>(n[y]||"").split(", "),i=o(`${Ft}Delay`),r=o(`${Ft}Duration`),s=Ps(i,r),l=o(`${Rn}Delay`),a=o(`${Rn}Duration`),u=Ps(l,a);let c=null,f=0,p=0;t===Ft?s>0&&(c=Ft,f=s,p=r.length):t===Rn?u>0&&(c=Rn,f=u,p=a.length):(f=Math.max(s,u),c=f>0?s>u?Ft:Rn:null,p=c?c===Ft?r.length:a.length:0);const h=c===Ft&&/\b(?:transform|all)(?:,|$)/.test(o(`${Ft}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:h}}function Ps(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>$s(n)+$s(e[o])))}function $s(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Os(e){return(e?e.ownerDocument:document).body.offsetHeight}function Qc(e,t,n){const o=e[Nn];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Po=Symbol("_vod"),As=Symbol("_vsh"),eu={name:"show",beforeMount(e,{value:t},{transition:n}){e[Po]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Vn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Vn(e,!0),o.enter(e)):o.leave(e,()=>{Vn(e,!1)}):Vn(e,t))},beforeUnmount(e,{value:t}){Vn(e,t)}};function Vn(e,t){e.style.display=t?e[Po]:"none",e[As]=!t}const tu=Symbol(""),nu=/(?:^|;)\s*display\s*:/;function ou(e,t,n){const o=e.style,i=Pe(n);let r=!1;if(n&&!i){if(t)if(Pe(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&$o(o,l,"")}else for(const s in t)n[s]==null&&$o(o,s,"");for(const s in n)s==="display"&&(r=!0),$o(o,s,n[s])}else if(i){if(t!==n){const s=o[tu];s&&(n+=";"+s),o.cssText=n,r=nu.test(n)}}else t&&e.removeAttribute("style");Po in e&&(e[Po]=r?o.display:"",e[As]&&(o.display="none"))}const zs=/\s*!important$/;function $o(e,t,n){if(ie(n))n.forEach(o=>$o(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=iu(e,t);zs.test(n)?e.setProperty(Ye(o),n.replace(zs,""),"important"):e[o]=n}}const Ls=["Webkit","Moz","ms"],Si={};function iu(e,t){const n=Si[t];if(n)return n;let o=Re(t);if(o!=="filter"&&o in e)return Si[t]=o;o=Gn(o);for(let i=0;i<Ls.length;i++){const r=Ls[i]+o;if(r in e)return Si[t]=r}return t}const Ds="http://www.w3.org/1999/xlink";function js(e,t,n,o,i,r=na(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ds,t.slice(6,t.length)):e.setAttributeNS(Ds,t,n):n==null||r&&!Gi(n)?e.removeAttribute(t):e.setAttribute(t,r?"":Tt(n)?String(n):n)}function Bs(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ks(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Gi(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function hn(e,t,n,o){e.addEventListener(t,n,o)}function ru(e,t,n,o){e.removeEventListener(t,n,o)}const Rs=Symbol("_vei");function su(e,t,n,o,i=null){const r=e[Rs]||(e[Rs]={}),s=r[t];if(o&&s)s.value=o;else{const[l,a]=lu(t);if(o){const u=r[t]=uu(o,i);hn(e,l,u,a)}else s&&(ru(e,l,s,a),r[t]=void 0)}}const Ns=/(?:Once|Passive|Capture)$/;function lu(e){let t;if(Ns.test(e)){t={};let o;for(;o=e.match(Ns);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ye(e.slice(2)),t]}let ki=0;const au=Promise.resolve(),cu=()=>ki||(au.then(()=>ki=0),ki=Date.now());function uu(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;mt(fu(o,n.value),t,5,[o])};return n.value=e,n.attached=cu(),n}function fu(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const Vs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,du=(e,t,n,o,i,r)=>{const s=i==="svg";t==="class"?Qc(e,o,s):t==="style"?ou(e,n,o):qn(t)?No(t)||su(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pu(e,t,o,s))?(Bs(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&js(e,t,o,s,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Pe(o))?Bs(e,Re(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),js(e,t,o,s))};function pu(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Vs(t)&&ce(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Vs(t)&&Pe(n)?!1:t in e}const Fs={};function hu(e,t,n){let o=Ce(e,t);Yn(o)&&(o=Ee({},o,t));class i extends Ci{constructor(s){super(o,s,n)}}return i.def=o,i}const gu=typeof HTMLElement<"u"?HTMLElement:class{};class Ci extends gu{constructor(t,n={},o=Ys){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&o!==Ys?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Ee({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof Ci){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,i=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:s}=o;let l;if(r&&!ie(r))for(const a in r){const u=r[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=Ko(this._props[a])),(l||(l=Object.create(null)))[Re(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(s),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)ve(this,o)||Object.defineProperty(this,o,{get:()=>G(n[o])})}_resolveProps(t){const{props:n}=t,o=ie(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&o.includes(i)&&this._setProp(i,this[i]);for(const i of o.map(Re))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(r){this._setProp(i,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Fs;const i=Re(t);n&&this._numberProps&&this._numberProps[i]&&(o=Ko(o)),this._setProp(i,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,i=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Fs?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),i&&this._instance&&this._update(),o)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(Ye(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ye(t),n+""):n||this.removeAttribute(Ye(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),_u(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=J(this._def,Ee(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const i=(r,s)=>{this.dispatchEvent(new CustomEvent(r,Yn(s[0])?Ee({detail:s},s[0]):{detail:s}))};o.emit=(r,...s)=>{i(r,s),Ye(r)!==r&&i(Ye(r),s)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce;for(let i=t.length-1;i>=0;i--){const r=document.createElement("style");o&&r.setAttribute("nonce",o),r.textContent=t[i],this.shadowRoot.prepend(r)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const i=t[o],r=i.getAttribute("name")||"default",s=this._slots[r],l=i.parentNode;if(s)for(const a of s){if(n&&a.nodeType===1){const u=n+"-s",c=document.createTreeWalker(a,1);a.setAttribute(u,"");let f;for(;f=c.nextNode();)f.setAttribute(u,"")}l.insertBefore(a,i)}else for(;i.firstChild;)l.insertBefore(i.firstChild,i);l.removeChild(i)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const i=o.querySelectorAll("slot");for(let r=0;r<i.length;r++)n.add(i[r])}return Array.from(n)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){}}const Hs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?n=>Jn(t,n):t};function mu(e){e.target.composing=!0}function Ws(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ti=Symbol("_assign");function Ks(e,t,n){return t&&(e=e.trim()),n&&(e=Wo(e)),e}const vu={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Ti]=Hs(i);const r=o||i.props&&i.props.type==="number";hn(e,t?"change":"input",s=>{s.target.composing||e[Ti](Ks(e.value,n,r))}),(n||r)&&hn(e,"change",()=>{e.value=Ks(e.value,n,r)}),t||(hn(e,"compositionstart",mu),hn(e,"compositionend",Ws),hn(e,"change",Ws))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Ti]=Hs(s),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?Wo(e.value):e.value,a=t??"";l!==a&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===a)||(e.value=a))}},bu=["ctrl","shift","alt","meta"],yu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>bu.some(n=>e[`${n}Key`]&&!t.includes(n))},We=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(i,...r)=>{for(let s=0;s<t.length;s++){const l=yu[t[s]];if(l&&l(i,t))return}return e(i,...r)})},wu={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Us=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=i=>{if(!("key"in i))return;const r=Ye(i.key);if(t.some(s=>s===r||wu[s]===r))return e(i)})},xu=Ee({patchProp:du},qc);let qs;function Zs(){return qs||(qs=gc(xu))}const _u=(...e)=>{Zs().render(...e)},Ys=(...e)=>{const t=Zs().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=ku(o);if(!i)return;const r=t._component;!ce(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,Su(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function Su(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ku(e){return Pe(e)?document.querySelector(e):e}function Ii(e,t){return qo()?(ia(e,t),!0):!1}const Mi=new WeakMap,Cu=(...e)=>{var t;const n=e[0],o=(t=Jt())===null||t===void 0?void 0:t.proxy,i=o??qo();if(i==null&&!Zr())throw new Error("injectLocal must be called in setup");return i&&Mi.has(i)&&n in Mi.get(i)?Mi.get(i)[n]:At(...e)},Xs=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Tu=e=>e!=null,Iu=Object.prototype.toString,Mu=e=>Iu.call(e)==="[object Object]",tn=()=>{};function Gs(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}function Eu(e,t={}){let n,o,i=tn;const r=a=>{clearTimeout(a),i(),i=tn};let s;return a=>{const u=gt(e),c=gt(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(o&&(r(o),o=void 0),Promise.resolve(a())):new Promise((f,p)=>{i=t.rejectOnCancel?p:f,s=a,c&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,f(s())},c)),n=setTimeout(()=>{o&&r(o),o=void 0,f(a())},u)})}}function Pu(...e){let t=0,n,o=!0,i=tn,r,s,l,a,u;!Oe(e[0])&&typeof e[0]=="object"?{delay:s,trailing:l=!0,leading:a=!0,rejectOnCancel:u=!1}=e[0]:[s,l=!0,a=!0,u=!1]=e;const c=()=>{n&&(clearTimeout(n),n=void 0,i(),i=tn)};return p=>{const h=gt(s),y=Date.now()-t,x=()=>r=p();return c(),h<=0?(t=Date.now(),x()):(y>h?(t=Date.now(),(a||!o)&&x()):l&&(r=new Promise((L,N)=>{i=u?N:L,n=setTimeout(()=>{t=Date.now(),o=!0,L(x()),c()},Math.max(0,h-y))})),!a&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,r)}}function Js(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function Fn(e){return Array.isArray(e)?e:[e]}function $u(e){return Jt()}function nt(e,t=200,n={}){return Gs(Eu(t,n),e)}function Qs(e,t=200,n=!1,o=!0,i=!1){return Gs(Pu(t,n,o,i),e)}function el(e,t=!0,n){$u()?Qe(e,n):t?e():Pt(e)}function Ou(e,t,n){return pe(e,t,{...n,immediate:!0})}const gn=Xs?window:void 0,Au=Xs?window.document:void 0;function kt(e){var t;const n=gt(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Dt(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,a,u,c)=>(l.addEventListener(a,u,c),()=>l.removeEventListener(a,u,c)),i=Q(()=>{const l=Fn(gt(e[0])).filter(a=>a!=null);return l.every(a=>typeof a!="string")?l:void 0}),r=Ou(()=>{var l,a;return[(l=(a=i.value)===null||a===void 0?void 0:a.map(u=>kt(u)))!==null&&l!==void 0?l:[gn].filter(u=>u!=null),Fn(gt(i.value?e[1]:e[0])),Fn(G(i.value?e[2]:e[1])),gt(i.value?e[3]:e[2])]},([l,a,u,c])=>{if(n(),!(l!=null&&l.length)||!(a!=null&&a.length)||!(u!=null&&u.length))return;const f=Mu(c)?{...c}:c;t.push(...l.flatMap(p=>a.flatMap(h=>u.map(y=>o(p,h,y,f)))))},{flush:"post"}),s=()=>{r(),n()};return Ii(n),s}function zu(){const e=ht(!1),t=Jt();return t&&Qe(()=>{e.value=!0},t),e}function Ei(e){const t=zu();return Q(()=>(t.value,!!e()))}const Lu=Symbol("vueuse-ssr-width");function Du(){const e=Zr()?Cu(Lu,null):null;return typeof e=="number"?e:void 0}function ju(e,t={}){const{window:n=gn,ssrWidth:o=Du()}=t,i=Ei(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),r=ht(typeof o=="number"),s=ht(),l=ht(!1),a=u=>{l.value=u.matches};return ls(()=>{if(r.value){r.value=!i.value,l.value=gt(e).split(",").some(u=>{const c=u.includes("not all"),f=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),p=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let h=!!(f||p);return f&&h&&(h=o>=Js(f[1])),p&&h&&(h=o<=Js(p[1])),c?!h:h});return}i.value&&(s.value=n.matchMedia(gt(e)),l.value=s.value.matches)}),Dt(s,"change",a,{passive:!0}),Q(()=>l.value)}function Pi(e={}){const{document:t=Au}=e;if(!t)return ht("visible");const n=ht(t.visibilityState);return Dt(t,"visibilitychange",()=>{n.value=t.visibilityState},{passive:!0}),n}function Bu(e,t,n={}){const{window:o=gn,...i}=n;let r;const s=Ei(()=>o&&"ResizeObserver"in o),l=()=>{r&&(r.disconnect(),r=void 0)},a=pe(Q(()=>{const c=gt(e);return Array.isArray(c)?c.map(f=>kt(f)):[kt(c)]}),c=>{if(l(),s.value&&o){r=new ResizeObserver(t);for(const f of c)f&&r.observe(f,i)}},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Ii(u),{isSupported:s,stop:u}}function tl(e,t={width:0,height:0},n={}){const{window:o=gn,box:i="content-box"}=n,r=Q(()=>{var f;return(f=kt(e))===null||f===void 0||(f=f.namespaceURI)===null||f===void 0?void 0:f.includes("svg")}),s=ht(t.width),l=ht(t.height),{stop:a}=Bu(e,([f])=>{const p=i==="border-box"?f.borderBoxSize:i==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(o&&r.value){const h=kt(e);if(h){const y=h.getBoundingClientRect();s.value=y.width,l.value=y.height}}else if(p){const h=Fn(p);s.value=h.reduce((y,{inlineSize:x})=>y+x,0),l.value=h.reduce((y,{blockSize:x})=>y+x,0)}else s.value=f.contentRect.width,l.value=f.contentRect.height},n);el(()=>{const f=kt(e);f&&(s.value="offsetWidth"in f?f.offsetWidth:t.width,l.value="offsetHeight"in f?f.offsetHeight:t.height)});const u=pe(()=>kt(e),f=>{s.value=f?t.width:0,l.value=f?t.height:0});function c(){a(),u()}return{width:s,height:l,stop:c}}function $i(e,t,n={}){const{root:o,rootMargin:i="0px",threshold:r=0,window:s=gn,immediate:l=!0}=n,a=Ei(()=>s&&"IntersectionObserver"in s),u=Q(()=>Fn(gt(e)).map(kt).filter(Tu));let c=tn;const f=ht(l),p=a.value?pe(()=>[u.value,kt(o),f.value],([y,x])=>{if(c(),!f.value||!y.length)return;const L=new IntersectionObserver(t,{root:kt(x),rootMargin:i,threshold:r});y.forEach(N=>N&&L.observe(N)),c=()=>{L.disconnect(),c=tn}},{immediate:l,flush:"post"}):tn,h=()=>{c(),p(),f.value=!1};return Ii(h),{isSupported:a,isActive:f,pause(){c(),f.value=!1},resume(){f.value=!0},stop:h}}function Oo(e={}){const{window:t=gn,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:r=!0,type:s="inner"}=e,l=ht(n),a=ht(o),u=()=>{if(t)if(s==="outer")l.value=t.outerWidth,a.value=t.outerHeight;else if(s==="visual"&&t.visualViewport){const{width:f,height:p,scale:h}=t.visualViewport;l.value=Math.round(f*h),a.value=Math.round(p*h)}else r?(l.value=t.innerWidth,a.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,a.value=t.document.documentElement.clientHeight)};u(),el(u);const c={passive:!0};return Dt("resize",u,c),t&&s==="visual"&&t.visualViewport&&Dt(t.visualViewport,"resize",u,c),i&&pe(ju("(orientation: portrait)"),()=>u()),{width:l,height:a}}function Ru(e){On("hapticFeedback",e)}function Oi(){return At("hapticFeedback")}const Nu=(e,t)=>{const n=+(e.getAttribute("data-ripple")??0);if(!n)return;const o=document.createElement("span");let i=1,r=.65;const s=setInterval(a,20);l();function l(){o.style.position="absolute",o.style.height="5px",o.style.width="5px",o.style.borderRadius="100%",o.style.backgroundColor="#f2f2f2",o.style.left=`${t.currentTarget.clientWidth/2}px`,o.style.top=`${t.currentTarget.clientHeight/2}px`,t.currentTarget.appendChild(o)}function a(){const u=+n||50;i<=u?(i++,r-=.65/u,o.style.transform=`scale(${i})`,o.style.opacity=`${r}`):(o.remove(),clearInterval(s))}},mn={mounted:(e,t)=>{e.style.position="relative",e.style.overflow="hidden",e.setAttribute("data-ripple",t.value),e.addEventListener("click",n=>Nu(e,n))},updated:(e,t)=>{e.setAttribute("data-ripple",t.value)}},Vu={class:"inline-flex p-6 gap-6 text-base text-stone-300 select-none"},Fu={key:0,class:"inline-block rounded-full relative w-28 h-12 overflow-hidden"},Hu={class:"absolute bottom-0 left-0 right-0 flex justify-center pb-7 md:pb-6 lg:pb-4"},Wu=Ce({__name:"AutoNext",props:{hasNext:{type:Boolean},offlineMode:{type:Boolean},seconds:{type:Number}},emits:["next","hide"],setup(e,{emit:t}){const n=e,o=t,i=re(null),r=re(null),s=re(!1),l=re(!1),a=re(n.seconds),u=re(n.seconds<=0),c=re(n.seconds),f=Oi();Qe(()=>{let y;$i(r,x=>{l.value=x.some(L=>L.isIntersecting),u.value=n.seconds<=0,a.value=n.seconds,c.value=n.seconds,y&&(clearInterval(y),y=void 0),!(!l.value||u.value)&&(y=setInterval(()=>{a.value-=1,a.value<=0&&(clearInterval(y),y=void 0,o("next"))},1e3))}),$i(i,x=>{s.value=x.some(L=>L.isIntersecting)}),qt(()=>y&&clearInterval(y))});function p(){o("next"),f()}function h(){o("hide")}return(y,x)=>(P(),W("div",{ref_key:"root",ref:i,class:"h-full w-full flex justify-center items-center relative"},[xt(q("div",Vu,[e.hasNext?(P(),W("div",Fu,[l.value?(P(),W("div",{key:0,class:"absolute left-0 top-0 bottom-0 h-full bg-stone-600 bg-opacity-50",style:De(u.value?{}:{animation:`auto-next ${c.value}s linear forwards`})},null,4)):$e("",!0),xt((P(),W("button",{ref_key:"nextButton",ref:r,class:"bg-transparent rounded-full h-full w-full border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:We(p,["stop"])},[pn(Je(u.value?"Next":`Next in ${a.value}`),1)])),[[G(mn)]])])):$e("",!0),xt((P(),W("button",{class:"rounded-full px-6 h-12 bg-transparent border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:We(h,["stop"])},[pn(Je(e.offlineMode?"Close":"Hide"),1)])),[[G(mn)]])],512),[[eu,s.value||!e.hasNext]]),q("div",Hu,[Te(y.$slots,"bottom-center")])],512))}}),Ku=".animate-auto-next{animation:auto-next 5s linear forwards}@keyframes auto-next{0%{width:0}to{width:100%}}",be=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},nl=be(Wu,[["styles",[Ku]]]),Uu=Object.freeze(Object.defineProperty({__proto__:null,default:nl},Symbol.toStringTag,{value:"Module"}));function qu({touchDevice:e}){const t=re(!1);let n=0;return On("busy:touchDevice",e),On("setBusyState",o=>{n+=o?1:-1;const i=n>0;t.value!=i&&(t.value=i)}),t}function Ao(){const e=At("busy:touchDevice"),t=At("setBusyState");let n=!1;return qt(()=>{n&&(t==null||t(!1))}),(o,{desktopOnly:i=!1}={})=>{i&&e||(n=o,t==null||t(o))}}const Zu={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 gap-2 text-base"},Ai=Ce({__name:"BaseButton",props:{disabled:{type:Boolean},href:{type:String},transparent:{type:Boolean},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=Ao(),r=Oi();let s=!1;function l(){s||(s=!0,i(!0,{desktopOnly:!0}))}function a(){s&&(s=!1,i(!1,{desktopOnly:!0}))}function u(c){n.disabled?c.preventDefault():(o("click",c),n.enableHapticFeedback&&r())}return(c,f)=>xt((P(),me(Rr(e.href?"a":"button"),Dn(e.href?{href:e.href}:{},{class:["h-10 max-w-full max-h-full rounded-full flex-shrink-0 focus:outline-none outline-none",{"cursor-default text-stone-400 hover:text-stone-400":e.disabled,"text-stone-100 hover:text-stone-100 group duration-200":!e.disabled,"bg-black bg-opacity-50":!e.transparent}],onClick:We(u,["stop"]),onMouseenter:l,onMouseleave:a}),{default:ue(()=>[q("div",Zu,[Te(c.$slots,"default")])]),_:3},16,["class"])),[[G(mn),e.disabled?0:15]])}}),Yu=Object.freeze(Object.defineProperty({__proto__:null,default:Ai},Symbol.toStringTag,{value:"Module"})),ct=Ce({__name:"ButtonIcon",props:{disabled:{type:Boolean},href:{type:String},transparent:{type:Boolean},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return(o,i)=>(P(),me(Ai,{class:"w-10",disabled:e.disabled,href:e.href,transparent:e.transparent,"enable-haptic-feedback":e.enableHapticFeedback,onClick:i[0]||(i[0]=r=>n("click",r))},{default:ue(()=>[Te(o.$slots,"default")]),_:3},8,["disabled","href","transparent","enable-haptic-feedback"]))}}),Xu=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),Gu={},Ju={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Qu(e,t){return P(),W("svg",Ju,[...t[0]||(t[0]=[q("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)])])}const ol=be(Gu,[["render",Qu]]),ef=Object.freeze(Object.defineProperty({__proto__:null,default:ol},Symbol.toStringTag,{value:"Module"}));class tf{constructor(){ze(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 nf(){const e=new tf;return qt(()=>e.dispose()),On("keyController",e),e}function zo(e){const t=At("keyController");Qe(()=>t.addListener(e)),qt(()=>t.removeListener(e))}const of={class:"flex w-full flex-shrink-0 justify-between items-center h-16 px-3"},rf={class:"font-medium md:text-lg text-ellipsis overflow-hidden whitespace-nowrap px-3 select-text"},sf={class:"overflow-auto px-6 md:px-8 lg:px-10 xl:px-12 pt-3 pb-12 flex-grow scrollbar-sm",style:{"max-height":"calc(100% - 4rem)"}},il=Ce({__name:"BottomSheet",props:Rt({name:{type:String}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=dn(e,"modelValue");zo({onKeyDown:o});const n=Ao();pe(t,i=>n(i));function o(i){t.value&&i.key==="Escape"&&(t.value=!1,i.preventDefault())}return(i,r)=>(P(),W("div",{class:ye(["fixed inset-0 flex flex-col items-center justify-end select-none",{"!pointer-events-none":!t.value}]),onClick:r[4]||(r[4]=()=>t.value=!1)},[J(Eo,{name:"slide","enter-from-class":"opacity-0 translate-y-full","leave-to-class":"opacity-0 translate-y-full"},{default:ue(()=>[t.value?(P(),W("div",{key:0,class:"w-full sm:w-[32rem] max-h-[80vh] bg-stone-900 bg-opacity-90 backdrop-blur-md rounded-t-xl max-w-full overflow-hidden duration-200",onClick:r[1]||(r[1]=We(()=>{},["stop"])),onWheelPassive:r[2]||(r[2]=We(()=>{},["stop"])),onTouchmove:r[3]||(r[3]=We(()=>{},["stop"]))},[q("div",of,[J(ct,{transparent:"",onClick:r[0]||(r[0]=()=>t.value=!1)},{default:ue(()=>[J(ol)]),_:1}),q("div",rf,Je(e.name),1),Te(i.$slots,"actions")]),q("div",sf,[Te(i.$slots,"default")])],32)):$e("",!0)]),_:3})],2))}}),lf=Object.freeze(Object.defineProperty({__proto__:null,default:il},Symbol.toStringTag,{value:"Module"})),af=["min","max","step"],cf={class:"flex-shrink-0 w-12 inline-block text-right"},zi=be(Ce({__name:"InputPercentage",props:Rt({min:{type:Number},max:{type:Number},step:{type:Number},presets:{type:Array},format:{type:Function}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=dn(e,"modelValue"),n=Q({get(){return t.value},set(o){t.value=+o}});return(o,i)=>(P(),W("div",{class:"flex items-center gap-3 pl-1",style:De({"--percentage":`${(n.value-e.min)/(e.max-e.min)*100}%`})},[xt(q("input",{"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),type:"range",min:e.min,max:e.max,step:e.step??1,class:"flex-grow"},null,8,af),[[vu,n.value]]),q("span",cf,Je(e.format(t.value)),1)],4))}}),[["styles",["input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#fb8252 var(--percentage),#5a5552 var(--percentage));border-radius:9999px;border-style:none;cursor:pointer;height:4px;opacity:.9;--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none!important;border-radius:9999px;border-style:solid;border-width:2px;cursor:pointer;height:20px;width:20px;--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));transition-duration:.2s}input[type=range]:hover{opacity:1}"]]]),uf=Object.freeze(Object.defineProperty({__proto__:null,default:zi},Symbol.toStringTag,{value:"Module"})),ff={ref:"root",class:"flex text-sm flex-wrap gap-2 leading-none"},df=["onClick","onKeyup"],Lo=Ce({__name:"InputSelect",props:Rt({items:{type:Array}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=dn(e,"modelValue");function o(i){i!==n.value&&(n.value=i)}return(i,r)=>(P(),W("div",ff,[(P(!0),W(Ie,null,Zt(t.items,(s,l)=>xt((P(),W("div",{key:l,tabindex:"0",class:ye(["inline-flex justify-center items-center h-7 rounded-full px-3 cursor-pointer z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-opacity-80 duration-200",{"bg-primary":l==n.value,"bg-stone-600 bg-opacity-50":l!=n.value}]),onClick:()=>o(l),onKeyup:[Us(()=>o(l),["enter"]),Us(()=>o(l),["space"])]},[pn(Je(s),1)],42,df)),[[G(mn),30]])),128))],512))}}),pf=Object.freeze(Object.defineProperty({__proto__:null,default:Lo},Symbol.toStringTag,{value:"Module"})),hf={class:"sm:flex items-center mb-5 sm:mb-8 last:mb-0"},gf={class:"flex-grow"},vn=Ce({__name:"TableField",props:{label:{type:String},disabled:{type:Boolean}},setup(e){return(t,n)=>(P(),W("div",hf,[q("div",{class:ye(["flex-shrink-0 w-[4.8rem] mb-2 sm:mb-0 whitespace-nowrap",{"opacity-50":e.disabled}])},Je(e.label),3),q("div",gf,[Te(t.$slots,"default")])]))}}),mf=Object.freeze(Object.defineProperty({__proto__:null,default:vn},Symbol.toStringTag,{value:"Module"})),vf={},bf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"};function yf(e,t){return P(),W("svg",bf,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M14 8.25a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5m0 8a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M11.75 22a2.25 2.25 0 1 0 4.5 0a2.25 2.25 0 0 0-4.5 0"},null,-1)])])}const rl=be(vf,[["render",yf]]),wf=Object.freeze(Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"})),xf={},_f={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 36 36"};function Sf(e,t){return P(),W("svg",_f,[...t[0]||(t[0]=[q("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),q("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)])])}const sl=be(xf,[["render",Sf]]),kf=Object.freeze(Object.defineProperty({__proto__:null,default:sl},Symbol.toStringTag,{value:"Module"}));function Cf(e){if(e)try{return JSON.parse(e)}catch{return}}function Tf(e){return String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}var ut=(e=>(e[e.vertical=0]="vertical",e[e.ltr=1]="ltr",e[e.rtl=2]="rtl",e))(ut||{}),Ht=(e=>(e[e.longStrip=0]="longStrip",e[e.single=1]="single",e[e.double=2]="double",e))(Ht||{});const ll=.25,al=5,If=.25,Do=.2,jo=5,Mf=.05,Ef=0,Pf=5;function $f(e){var O,w,g,S,D,B;const{titleName:t,isWebtoon:n}=e,o=Q(()=>t.value?Tf(t.value):location.hostname),i=re(Of(`tkr:${o.value}`)),r=C=>{i.value=C;const H=`tkr:${o.value}`;!C||!Object.keys(C).length?localStorage.removeItem(H):localStorage.setItem(H,JSON.stringify(C))},s=C=>{if(!i.value){r(C);return}const H={...i.value};Object.entries(C).forEach(([X,k])=>{k===void 0?delete H[X]:H[X]=k}),r(H)},l=re((O=i.value)==null?void 0:O.style),a=re((w=i.value)==null?void 0:w.direction),u=re((g=i.value)==null?void 0:g.gap),c=re((S=i.value)==null?void 0:S.speed),f=re(((D=i.value)==null?void 0:D.zoom)??1),p=re(((B=i.value)==null?void 0:B.breakFirst)??!1),h=Q({get(){return n.value?Ht.longStrip:l.value??e.defaultStyle.value??Ht.longStrip},set:C=>{if(l.value===C)return;const H=h.value===Ht.longStrip,X=C===Ht.longStrip;l.value=C,s({style:C}),H!==X&&(y.value=X?ut.vertical:ut.rtl)}}),y=Q({get(){return n.value?ut.vertical:a.value??e.defaultDirection.value??ut.vertical},set:C=>{a.value=C,s({direction:C})}}),x=Q({get:()=>u.value??e.defaultGap.value??0,set(C){u.value=C,s({gap:C})}}),L=Q({get:()=>c.value??e.defaultSpeed.value??1,set(C){c.value=C,s({speed:C===1?void 0:C})}}),N=Q({get:()=>f.value,set(C){f.value=C,s({zoom:C===1?void 0:C})}}),Z=Q({get:()=>p.value,set(C){p.value=C,s({breakFirst:C?!0:void 0})}});return{direction:y,style:h,gap:x,speed:L,zoom:N,isLongStrip:Q(()=>h.value===Ht.longStrip),isDouble:Q(()=>h.value===Ht.double),isRTL:Q(()=>y.value===ut.rtl),isVertical:Q(()=>y.value===ut.vertical),breakFirst:Z}}function Of(e){const t=localStorage.getItem(e),n=Cf(t||void 0),o={};return n?(n.style!==void 0&&Object.values(Ht).includes(n.style)&&(o.style=n.style),n.direction!==void 0&&Object.values(ut).includes(n.direction)&&(o.direction=n.direction),n.gap!==void 0&&n.gap>=Ef&&n.gap<=Pf&&(o.gap=n.gap),n.speed!==void 0&&n.speed>=ll&&n.speed<=al&&(o.speed=n.speed),n.zoom!==void 0&&n.zoom>=Do&&n.zoom<=jo&&(o.zoom=n.zoom),n.breakFirst===!0&&(o.breakFirst=!0),Object.keys(o).length?o:void 0):o}const cl=Ce({__name:"ButtonReaderSettings",props:{name:{type:String},direction:{type:Number},readerStyle:{type:Number},gap:{type:Number},speed:{type:Number},zoom:{type:Number},webtoon:{type:Boolean},disabled:{type:Boolean}},emits:["update:reader-style","update:direction","update:gap","update:speed","update:zoom","more"],setup(e,{emit:t}){const n=e,o=t,i=re(!1),r=Q(()=>["Long strip",n.webtoon?void 0:"Single page",n.webtoon?void 0:"Double page"].filter(Boolean)),s=Q(()=>n.name??location.hostname);zo({onKeyUp:u=>{u.key==="s"&&!u.metaKey&&!u.ctrlKey&&(i.value=!i.value)}});function l(u){o("update:zoom",Math.round(u)/100)}function a(){i.value=!1,o("more")}return(u,c)=>(P(),W(Ie,null,[J(ct,{title:"Reader preferences (S)",disabled:e.disabled,onClick:c[0]||(c[0]=()=>i.value=!0)},{default:ue(()=>[J(sl)]),_:1},8,["disabled"]),J(il,{modelValue:i.value,"onUpdate:modelValue":c[5]||(c[5]=f=>i.value=f),name:s.value},{actions:ue(()=>[J(ct,{transparent:"",onClick:a},{default:ue(()=>[J(rl)]),_:1})]),default:ue(()=>[J(vn,{label:"Style"},{default:ue(()=>[J(Lo,{"model-value":e.readerStyle,items:r.value,"onUpdate:modelValue":c[1]||(c[1]=f=>o("update:reader-style",f))},null,8,["model-value","items"])]),_:1}),J(vn,{label:"Direction"},{default:ue(()=>[J(Lo,{"model-value":e.direction,items:e.webtoon?["Vertical"]:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":c[2]||(c[2]=f=>o("update:direction",f))},null,8,["model-value","items"])]),_:1}),J(vn,{label:"Gap"},{default:ue(()=>[J(Lo,{"model-value":e.gap,items:["None","1px","2px","3px","4px","5px"],"onUpdate:modelValue":c[3]||(c[3]=f=>o("update:gap",f))},null,8,["model-value"])]),_:1}),J(vn,{label:"Speed"},{default:ue(()=>[J(zi,{"model-value":e.speed,min:G(ll),max:G(al),step:G(If),presets:[1,1.25,1.5,2,2.5,3,4,5].reverse(),format:f=>`${f.toFixed(2)}x`,"onUpdate:modelValue":c[4]||(c[4]=f=>o("update:speed",f))},null,8,["model-value","min","max","step","presets","format"])]),_:1}),J(vn,{label:"Zoom"},{default:ue(()=>[J(zi,{"model-value":Math.ceil(e.zoom*100),min:G(Do)*100,max:G(jo)*100,step:G(Mf)*100,presets:[20,25,50,75,100,125,150,200,250,500].reverse(),format:f=>`${Math.ceil(f)}%`,"onUpdate:modelValue":l},null,8,["model-value","min","max","step","presets","format"])]),_:1})]),_:1},8,["modelValue","name"])],64))}}),Af=Object.freeze(Object.defineProperty({__proto__:null,default:cl},Symbol.toStringTag,{value:"Module"})),zf={},Lf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"};function Df(e,t){return P(),W("svg",Lf,[...t[0]||(t[0]=[q("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[q("circle",{cx:"14",cy:"14",r:"12"}),q("path",{d:"m23 23l7 7M9 12V9h3m4 0h3v3M9 16v3h3m7-3v3h-3"})],-1)])])}const ul=be(zf,[["render",Df]]),jf=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"})),Bf={class:"block w-4 h-4"},Rf={class:"w-12"},fl=Ce({__name:"ButtonResetZoom",props:{zoom:{type:Number}},emits:["click"],setup(e,{emit:t}){const n=t;function o(i){n("click",i)}return(i,r)=>(P(),W("button",{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",onClick:We(o,["stop"])},[q("div",Bf,[J(ul)]),q("div",Rf,Je(Math.ceil(e.zoom*100))+"%",1)]))}}),Nf=Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"}));async function bn(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 bn(e-1,t,n);i(r)},t)})}const Vf={},Ff={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Hf(e,t){return P(),W("svg",Ff,[...t[0]||(t[0]=[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)])])}const dl=be(Vf,[["render",Hf]]),Wf=Object.freeze(Object.defineProperty({__proto__:null,default:dl},Symbol.toStringTag,{value:"Module"})),Kf={},Uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function qf(e,t){return P(),W("svg",Uf,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"},null,-1)])])}const pl=be(Kf,[["render",qf]]),Zf=Object.freeze(Object.defineProperty({__proto__:null,default:pl},Symbol.toStringTag,{value:"Module"})),Yf=["aria-hidden"],Xf=["onClick"],hl=Ce({__name:"DropdownMenu",props:Rt({items:{type:Array},enableHapticFeedback:{type:Boolean}},{modelValue:{type:Number,required:!1},modelModifiers:{}}),emits:Rt(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=dn(e,"modelValue"),r=re(null),s=re(!1),l=re(!1),a=re(!1),u=re(!1),c={mounted:w=>{var g;i.value&&((g=w.children[i.value])==null||g.scrollIntoView({behavior:"auto",block:"center",inline:"center"}))}};zo({onKeyDown:L});const f=Ao(),p=Oi();async function h(w){s.value=w??!s.value,f(s.value),s.value?(y(),Z(r.value)):setTimeout(O,250)}function y(){const w=r.value;if(w){const g=w.getBoundingClientRect(),S=g.x+g.width/2;l.value=g.y>window.innerHeight/2,a.value=S<window.innerWidth/3,u.value=S>window.innerWidth/3*2}}function x(w,g){h(),w!=i.value&&(i.value=w,o("select",w,g),n.enableHapticFeedback&&p())}function L(w){s.value&&w.key==="Escape"&&(h(),w.preventDefault())}let N=[];function Z(w){const g=window.getComputedStyle(w).zIndex,S=w.style.zIndex;(!g||!(+g>0))&&((!w.parentElement||w.parentElement.childElementCount>1)&&(w.style.zIndex="1",N.push({el:w,zIndex:S})),w.parentElement&&Z(w.parentElement))}function O(){N.forEach(({el:w,zIndex:g})=>{w.style.zIndex=g??""}),N=[]}return(w,g)=>(P(),W("div",{ref_key:"root",ref:r,class:"select-none relative inline-flex"},[s.value?(P(),W("div",{key:0,class:"fixed inset-0 bg-transparent",onClick:g[0]||(g[0]=()=>h())})):$e("",!0),e.items.length?(P(),me(Eo,{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:ue(()=>[s.value?xt((P(),W("ul",{key:0,ref:"list","aria-hidden":!s.value,class:ye(["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":l.value,"origin-top top-full translate-y-1.5":!l.value,"left-1/2 -ml-20 text-center":!a.value&&!u.value,"right-0 text-right":u.value}]),onWheelPassive:g[1]||(g[1]=We(()=>{},["stop"])),onTouchmove:g[2]||(g[2]=We(()=>{},["stop"]))},[(P(!0),W(Ie,null,Zt(e.items,(S,D)=>xt((P(),W("li",{key:D,tabindex:"-1",class:ye(["h-10 px-4 last:border-b-transparent cursor-pointer hover:bg-stone-100 hover:bg-opacity-10 duration-100",{"text-textPrimary":D===i.value}]),onClick:B=>x(D,B)},[q("div",{class:ye(["h-full py-2",{"border-t-[1px] border-solid border-stone-400 border-opacity-30":D>0}])},[Te(w.$slots,"item",{item:S},()=>[pn(Je(S),1)])],2)],10,Xf)),[[G(mn),30]])),128))],42,Yf)),[[c]]):$e("",!0)]),_:3})):$e("",!0),Te(w.$slots,"default",{toggle:h,isOpen:s.value,isAlignTop:l.value})],512))}}),Gf=Object.freeze(Object.defineProperty({__proto__:null,default:hl},Symbol.toStringTag,{value:"Module"})),Jf=["onClick"],Qf={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"},ed={class:"whitespace-nowrap"},Li=Ce({__name:"ButtonDropdown",props:Rt({label:{type:String},title:{type:String},items:{type:Array},disabled:{type:Boolean},canLoadItems:{type:Boolean},loadItems:{type:Function},enableHapticFeedback:{type:Boolean}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:Rt(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=dn(e,"modelValue"),r=re(!1),s=Ao();async function l(p,h){if(!n.items.length&&(p||await a(),!n.items.length)){h(!1);return}h()}async function a(){r.value||n.items.length||!n.canLoadItems||!n.loadItems||(r.value=!0,await n.loadItems(),r.value=!1)}let u=!1;function c(){u||(u=!0,s(!0,{desktopOnly:!0}))}function f(){u&&(u=!1,s(!1,{desktopOnly:!0}))}return(p,h)=>(P(),me(hl,{modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=y=>i.value=y),items:e.items,"enable-haptic-feedback":e.enableHapticFeedback,onSelect:h[1]||(h[1]=(y,x)=>o("select",y,x))},bo({default:ue(({toggle:y,isOpen:x,isAlignTop:L})=>[xt((P(),W("button",Dn({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":e.disabled||r.value}]},e.title?{title:e.title}:{},{onClick:We(()=>l(x,y),["stop"]),onMouseenter:c,onMouseleave:f}),[q("div",Qf,[q("span",ed,Je(e.label),1),e.items.length||e.canLoadItems?(P(),W("span",{key:0,class:ye(["w-4 h-4 flex ml-1 -mr-3 flex-shrink-0",{"rotate-180":L}]),"aria-hidden":"true"},[r.value?(P(),me(dl,{key:0})):(P(),me(pl,{key:1}))],2)):$e("",!0)])],16,Jf)),[[G(mn),30]])]),_:2},[p.$slots.item?{name:"item",fn:ue(({item:y})=>[Te(p.$slots,"item",{item:y})]),key:"0"}:void 0]),1032,["modelValue","items","enable-haptic-feedback"]))}}),td=Object.freeze(Object.defineProperty({__proto__:null,default:Li},Symbol.toStringTag,{value:"Module"})),gl=Ce({__name:"ChapterNav",props:{data:{type:Object},chapterSpec:{type:Object},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:u,sel:c,label:f}=a;if(u&&(!c||!f)){await r(u);return}o("getHiddenChapters"),await bn(50,50,()=>n.data.chapters.length?!0:void 0)}async function r(a){const u=document.querySelector(a);u&&(u instanceof HTMLDialogElement?u.showModal():u.click(),o("chaptersDialogOpen"))}function s(a,u){var c,f,p;(p=(f=(c=n.data)==null?void 0:c.chapters)==null?void 0:f[a])==null||p.select(l(u))}function l(a){return!n.touchDevice&&(a.ctrlKey||a.metaKey)}return(a,u)=>{var c;return P(),me(Li,{modelValue:e.data.activeIndex,label:e.data.activeLabel,title:"Select chapter",items:e.data.chapters,"can-load-items":!!((c=e.chapterSpec)!=null&&c.trigger),"load-items":i,"enable-haptic-feedback":"",onSelect:s},{item:ue(({item:f})=>[pn(Je(f.label),1)]),_:1},8,["modelValue","label","items","can-load-items"])}}}),nd=Object.freeze(Object.defineProperty({__proto__:null,default:gl},Symbol.toStringTag,{value:"Module"})),od={},id={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function rd(e,t){return P(),W("svg",id,[...t[0]||(t[0]=[q("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)])])}const Hn=be(od,[["render",rd]]),sd=Object.freeze(Object.defineProperty({__proto__:null,default:Hn},Symbol.toStringTag,{value:"Module"}));var Di=(e=>(e[e.none=0]="none",e[e.lShape=1]="lShape",e[e.kindleIsh=2]="kindleIsh",e[e.edge=3]="edge",e[e.rightAndLeft=4]="rightAndLeft",e))(Di||{});const ml={0:{prevZones:[],nextZones:[]},1:{prevZones:[0,1,2,3],nextZones:[8,7,6,5]},2:{prevZones:[6,3],nextZones:[8,7,5,4]},3:{prevZones:[7],nextZones:[5,0,2,3,6,8]},4:{prevZones:[3,0,6],nextZones:[5,2,8]}},vl=Ce({__name:"DirectionToast",props:{direction:{type:Number},tapZone:{type:Number}},setup(e){const t=e,n=sessionStorage.getItem("tk:dir"),o=re(typeof n!="string"||+n!==t.direction),i=nt(()=>o.value=!1,1500),{width:r,height:s}=Oo(),l=Q(()=>Math.min(1.25,Math.max(.75,Math.round(r.value/s.value*100)/100))),a=Q(()=>l.value>=1),u=Q(()=>t.direction===ut.vertical),c=Q(()=>t.direction===ut.rtl),f=Q(()=>{if(!t.tapZone)return;const{prevZones:h,nextZones:y}=ml[t.tapZone];return Array.from({length:9},(x,L)=>{const N=h.includes(L),Z=!N&&y.includes(L);return{isPrev:N,isNext:Z,hasArrow:L===h[0]||L===y[0]}})});pe(()=>t.direction,()=>{p(),o.value=!0,i()}),Qe(()=>{p(),i();let h;pe(Pi(),x=>{x!=="visible"?h=Date.now():Date.now()-h>7e3&&(o.value=!0,i())})});function p(){sessionStorage.setItem("tk:dir",t.direction+"")}return(h,y)=>(P(),me(Eo,{name:"slow-fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ue(()=>[o.value?(P(),W("div",{key:0,class:ye(["fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none p-2 bg-black bg-opacity-40 rounded-2xl",{"w-28":a.value,"h-28":!a.value}]),style:De({"aspect-ratio":l.value})},[e.tapZone===G(Di).none?(P(),W("div",{key:0,class:ye(["inline-block absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-14 h-14",{"rotate-90":e.direction===G(ut).vertical,"rotate-180":e.direction===G(ut).rtl}])},[J(Hn)],2)):f.value?(P(),W("div",{key:2,class:ye(["w-full h-full overflow-hidden rounded-xl flex flex-wrap",{"flex-row-reverse":c.value}])},[(P(!0),W(Ie,null,Zt(f.value,(x,L)=>(P(),W("div",{key:`zone-${L}`,class:ye(["w-1/3 h-1/3 flex justify-center items-center p-0.5",{"bg-stone-100":x.isPrev||x.isNext,"bg-opacity-50":x.isPrev}])},[x.hasArrow?(P(),W("span",{key:0,class:ye(["w-full inline-block transform text-stone-800",{"rotate-180":c.value?x.isNext:x.isPrev}])},[J(Hn)],2)):$e("",!0)],2))),128))],2)):(P(),W("div",{key:1,class:ye(["w-full h-full overflow-hidden rounded-xl flex flex-nowrap",{"flex-col":u.value}])},[q("div",{class:ye(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":!c.value}])},[q("span",{class:ye(["w-4 h-4 inline-block transform text-stone-800",{"-rotate-90":u.value,"rotate-180":!u.value}])},[J(Hn)],2)],2),y[0]||(y[0]=q("div",{class:"flex-grow w-full h-full"},null,-1)),y[1]||(y[1]=q("div",{class:"flex-grow w-full h-full"},null,-1)),q("div",{class:ye(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":c.value}])},[q("span",{class:ye(["w-4 h-4 inline-block text-stone-800",{"transform rotate-90":u.value}])},[J(Hn)],2)],2)],2))],6)):$e("",!0)]),_:1}))}}),ld=Object.freeze(Object.defineProperty({__proto__:null,default:vl},Symbol.toStringTag,{value:"Module"})),bl=Ce({__name:"HelpScreen",props:{touchDevice:{type:Boolean}},emits:["hide"],setup(e,{emit:t}){const n=e,o=t,i=re(null),r=re([]);Qe(async()=>{const u=tl(i),c=nt(()=>{s({width:u.width.value,height:u.height.value})},50);c(),pe(u.width,c),pe(u.height,c)});function s(u){var p;const c=(p=i.value)==null?void 0:p.parentElement;if(!c)return;const f=Array.from(c.querySelectorAll("#controls [title]"));f.length&&(r.value=l(f,u))}function l(u,c){const f=[],p=[];let h=0,y=0;const x=50,L=25;u.forEach(g=>{var H;const S=(H=g.getAttribute("title"))==null?void 0:H.trim(),D=g.getBoundingClientRect();if(!S||!D.height||!D.width)return;const B=Math.ceil((D.top-10)/x),C=Math.ceil((D.left-10)/x);p.push({isTour:!1,title:S,rect:D,fromX:C,toX:Math.max(C+1,Math.ceil((D.right+10)/x)),fromY:B,toY:Math.max(B+1,Math.ceil((D.bottom+10)/x))})}),p.forEach(g=>{for(let S=g.fromY;S<g.toY;S++){f[S]??(f[S]=[]);for(let D=g.fromX;D<g.toX;D++)f[S][D]=g;g.toY>h+1&&(h=g.toY-1),g.toX>y+1&&(y=g.toX-1)}});let N=y/2;p.forEach(g=>{g.isAlignRight=g.fromX>N});const Z=(g,S)=>{f[S]??(f[S]=[]);const D=S>=g.toY;if(g.isTour)for(let B=g.fromX;B<g.toX;B++)delete f[g.fromY][B],g.fromY=S,g.toY=S+(D?1:-1),f[S][B]=g;else{const B=g.isAlignRight?g.fromX-3:g.fromX,C=B+3;g.helpItem={fromX:B,toX:C,fromY:S,toY:S+1,isTour:!0,isAlignRight:g.isAlignRight};for(let H=B;H<C;H++)f[S][H]=g.helpItem}},O=(g,S)=>{if(S>h||S<0)return!1;const D=S>=g.toY,B=f[S];if(!B)return Z(g,S),!0;const C=B[g.fromX];if(C&&!C.isTour)return!1;if(C&&C.isTour)return O(C,D?S+1:S-1)?(Z(g,S),!0):!1;if(!C){const H=g.isAlignRight?-1:1;return B[g.fromX+H]||B[g.fromX+H*2]?O(g,D?S+1:S-1):(Z(g,S),!0)}return!1};p.forEach(g=>{if(!O(g,g.toY)){if(g.isAlignRight){const S=f[g.fromY]??[];if(!S.slice(g.fromX-3,g.fromX).filter(Boolean).length){const B=g.fromX-3,C=g.fromX;g.helpItem={isTour:!0,isAlignRight:!0,fromX:B,toX:C,fromY:g.fromY,toY:g.toY};for(let H=g.fromX-3;H<g.fromX;H++)S[H]=g.helpItem;return}}O(g,g.fromY-1)}});const w=[];return p.forEach(g=>{const{title:S,helpItem:D,rect:B,isAlignRight:C,fromX:H,fromY:X,toY:k}=g;if(!S||!D||!B)return;const E=D.fromY>=k,Y=D.toY<=X;w.push({title:a(S),style:{top:E?`${B.bottom+(D.fromY-k)*x+L}px`:Y?void 0:`${B.top+8}px`,bottom:Y?`${c.height-B.top+(D.toY-X)*x+L}px`:void 0,left:C?void 0:`${B.left}px`,right:C?E?`${c.width-B.right}px`:`${c.width-B.right+B.width+L}px`:void 0},arrowStyle:{width:Y||E?"2px":`${Math.abs(D.toX-H)*x+L-5}px`,height:Y||E?`${(E?D.fromY-k:X-D.toY)*x+L}px`:"2px",top:E?`${B.bottom}px`:Y?void 0:`${B.top+20}px`,bottom:Y?`${c.height-B.top}px`:void 0,left:C?void 0:`${B.left+B.width/2}px`,right:C?E?`${c.width-B.right+B.width/2}px`:`${c.width-B.right+B.width}px`:void 0}})}),w}function a(u){return n.touchDevice?u.split("(")[0].trim():u}return(u,c)=>(P(),W(Ie,null,[c[1]||(c[1]=q("div",{class:"fixed inset-0 bg-black bg-opacity-90"},null,-1)),q("div",{ref_key:"root",ref:i,class:"fixed inset-0 z-20 overscroll-contain select-none",onClick:c[0]||(c[0]=We(f=>o("hide"),["stop"]))},[(P(!0),W(Ie,null,Zt(r.value,f=>(P(),W(Ie,{key:f.title},[q("div",{class:"absolute",style:De(f.style)},Je(f.title),5),q("div",{class:"absolute bg-stone-300 rounded-lg",style:De(f.arrowStyle)},null,4)],64))),128))],512)],64))}}),ad=Object.freeze(Object.defineProperty({__proto__:null,default:bl},Symbol.toStringTag,{value:"Module"})),yl=Ce({__name:"PageNav",props:Rt({disabled:{type:Boolean},pages:{type:Array},totalImgs:{type:Number}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=dn(e,"modelValue"),o=Q(()=>t.pages.map(a=>a.map(({index:u})=>`${u+1}`).join("-"))),i=Q(()=>{const a=n.value,u=t.pages.findIndex(c=>c.some(({index:f})=>f===a));return u===-1?t.pages.length-1:u}),r=Q(()=>t.pages.length?`${o.value[i.value]}/${t.totalImgs}`:"--");function s(a){const u=t.pages[a][0].index;l(u)}function l(a){n.value=a}return(a,u)=>(P(),me(Li,{"model-value":i.value,label:r.value,title:"Current page",items:o.value,disabled:e.disabled,"onUpdate:modelValue":s},null,8,["model-value","label","items","disabled"]))}}),cd=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"})),ud={},fd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function dd(e,t){return P(),W("svg",fd,[...t[0]||(t[0]=[q("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),q("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)])])}const ji=be(ud,[["render",dd]]),pd=Object.freeze(Object.defineProperty({__proto__:null,default:ji},Symbol.toStringTag,{value:"Module"})),hd={},gd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function md(e,t){return P(),W("svg",gd,[...t[0]||(t[0]=[q("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)])])}const Bi=be(hd,[["render",md]]),vd=Object.freeze(Object.defineProperty({__proto__:null,default:Bi},Symbol.toStringTag,{value:"Module"})),wl=be(Ce({__name:"PauseToast",props:{playing:{type:Boolean}},setup(e){const t=e,n=re(0);return pe(()=>t.playing,()=>{n.value=Date.now()}),(o,i)=>n.value?(P(),W("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"},[e.playing?(P(),me(Bi,{key:0})):(P(),me(ji,{key:1}))])):$e("",!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)}}"]]]),bd=Object.freeze(Object.defineProperty({__proto__:null,default:wl},Symbol.toStringTag,{value:"Module"})),yd=30,xl=be(Ce({__name:"ProgressBar",props:{value:{type:Number},total:{type:Number},longStrip:{type:Boolean},height:{type:Number},rtl:{type:Boolean}},setup(e){const t=e,n=Q(()=>Math.floor(t.value)+1),o=Q(()=>`${Math.max(2,Math.min(10,t.height))}px`),i=Oo().width,r=Q(()=>i.value/t.total>=yd);return(s,l)=>(P(),W("div",{class:ye(["rprog",{"rprog--rtl":e.rtl}]),style:De({height:o.value})},[r.value?(P(!0),W(Ie,{key:0},Zt(e.total,a=>(P(),W("span",{key:a,class:ye(["rprog__item",{"rprog__item--active":n.value===a}]),style:De(!e.longStrip||n.value!==a?{}:{"--portion":`${e.value%1*100}%`})},null,6))),128)):(P(),W("div",{key:1,style:De({width:`${e.value/e.total*100}%`}),class:"h-full bg-textPrimary bg-opacity-80"},null,4))],6))}}),[["styles",['.rprog{--portion:100%;display:flex;width:100%}.rprog--rtl,.rprog--rtl .rprog__item{flex-direction:row-reverse}.rprog__item{display:inline-flex;flex-grow:1;flex-shrink:0;height:100%}.rprog__item:first-child:before{display:none}.rprog__item--active:before,.rprog__item:has(~.rprog__item--active):before{background-color:rgb(0 0 0/var(--tw-bg-opacity,1));content:"";display:block;flex-shrink:0;height:100%;width:1px;--tw-bg-opacity:.25}.rprog__item--active:after,.rprog__item:has(~.rprog__item--active):after{background-color:rgb(251 130 82/var(--tw-bg-opacity,1));content:"";display:block;height:100%;--tw-bg-opacity:.8;width:var(--portion)}']]]),wd=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"})),_l=Ce({__name:"GesturesContainer",props:{spaceTop:{type:Number},fullScreen:{type:Boolean},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},pageIndex:{type:Number},playController:{type:Object},rtl:{type:Boolean},horizontal:{type:Boolean},longStrip:{type:Boolean},touchDevice:{type:Boolean},busy:{type:Boolean}},emits:["update:zoom","update:zooming","dragEnd","click","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=re(null),s=re(Math.min(jo,Math.max(Do,o.zoom))),l=re(!1),a=re(!1),u={isZoomIn:!1,isZoomOut:!1,initial:void 0};t({rootEl:r}),pe(()=>o.zoom,v=>K(v)),Qe(()=>{o.touchDevice?Dt(r,"touchstart",N):(Dt(r,"mousedown",h),Dt(window,"wheel",D))}),zo({onKeyDown:v=>{var b;if(!o.busy&&((b=r.value)==null||b.focus(),!(v.key==="Meta"||v.key==="Control")&&(v.ctrlKey||v.metaKey)))switch(v.key){case"0":K(1);break;case"-":K(s.value-.2),v.preventDefault();break;case"=":case"+":K(s.value+.2),v.preventDefault();break}},onKeyUp:v=>{o.zooming&&!(v.ctrlKey||v.metaKey)&&E()}});function c(v){a.value!==v&&(a.value=v,v?o.playController.pause():(i("dragEnd"),o.playController.resume()))}let f={x:0,y:0},p={x:0,y:0};function h(v){if(v.button!==0)return;const b=r.value;b&&(f={x:v.clientX,y:v.clientY},p={x:b.scrollLeft,y:b.scrollTop},window.addEventListener("mousemove",y),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",y),setTimeout(()=>c(!1))},{once:!0}),v.preventDefault(),v.stopPropagation())}function y(v){const b=v.clientX-f.x,j=v.clientY-f.y;if(!a.value&&Math.abs(b)<.5&&Math.abs(j)<.5)return;c(!0);const ee=r.value;ee&&(ee.scrollLeft=p.x-b,ee.scrollTop=p.y-j)}let x={distance:0,zoom:s.value,x:0,y:0},L=!1;function N(v){o.busy||(L=o.pinchToZoome&&v.touches.length===2,L&&(i("update:zooming",!0),c(!0),v.stopPropagation(),v.preventDefault(),x={distance:B(v),zoom:s.value,x:(v.touches[0].clientX+v.touches[1].clientX)/2,y:(v.touches[0].clientY+v.touches[1].clientY)/2}),(L||o.longStrip&&o.playController.isPlaying.value)&&window.addEventListener("touchend",Z,{once:!0}))}function Z(){var ee;if(L=!1,o.zooming){c(!1),E();return}if(!a.value)return;const v=nt(()=>{var le;c(!1),(le=r.value)==null||le.removeEventListener("scroll",j)},200),b=setTimeout(v,200);(ee=r.value)==null||ee.addEventListener("scroll",j);function j(){clearTimeout(b),v()}}function O(v){if(!L&&!(o.longStrip&&o.playController.isPlaying.value)||(c(!0),!o.zooming)||(v.stopPropagation(),v.preventDefault(),v.touches.length<2))return;const j=B(v)/x.distance;te(Math.ceil(j*x.zoom*100)/100,x)}const w=nt(()=>l.value=!1,100);let g=!1;const S=nt(()=>{g=!1},30);function D(v){if(o.busy)return;let b=o.zooming;if(g||(g=!0,b=v.ctrlKey||v.metaKey,b&&i("update:zooming",!0)),S(),b){v.stopPropagation(),v.preventDefault();const j=Math.ceil((s.value+v.deltaY*-.01)*100)/100;te(j,{x:v.clientX,y:v.clientY});return}o.horizontal&&(l.value||(l.value=!0),w(),v.deltaY&&(r.value&&(r.value.scrollLeft+=v.deltaY*(o.rtl?-1:1)),v.stopPropagation()))}function B(v){return Math.hypot(v.touches[0].clientX-v.touches[1].clientX,v.touches[0].clientY-v.touches[1].clientY)}const C={x:0,y:0,ts:0};function H(v){if(a.value||o.zooming)return;const b=r.value;if(!b||X(b,v)||(i("click"),o.playController.isPlaying.value))return;const{clientX:j,clientY:ee}=v,{x:le,y:we,ts:ke}=C;C.x=j,C.y=ee,C.ts=new Date().getTime();const xe=C.ts-ke;xe>250||xe<10||Math.abs(le-j)>40||Math.abs(we-ee)>40||(C.ts=0,C.x=0,C.y=0,k(j,ee))}function X(v,b){if(o.playController.isPlaying.value)return!1;const j=o.tapZone;if(j===Di.none)return!1;const ee=o.fullScreen?0:o.spaceTop,le=v.clientHeight-ee,we=Math.max(0,b.clientY-ee),ke=o.horizontal?v.clientWidth:le;let xe=!1,Le=!1;if(j){const{prevZones:Ae,nextZones:Ke}=ml[o.tapZone],it=Math.floor(we/le*3);let ft=Math.floor(b.clientX/v.clientWidth*3);o.rtl&&(ft=2-ft);const Me=it*3+ft;xe=Ae.includes(Me),Le=!xe&&Ke.includes(Me)}else{const Ke=(o.horizontal?o.rtl?ke-b.clientX:b.clientX:we)/ke,it=o.horizontal?.2:.15;xe=Ke<=it&&o.pageIndex>0,Le=!xe&&Ke>=1-it}if(!xe&&!Le)return!1;if(o.longStrip){const Ae=(xe?-1:1)*.75*ke;o.horizontal?v.scrollLeft=v.scrollLeft+(o.rtl?-1:1)*Ae:v.scrollTop=Math.max(0,v.scrollTop+Ae)}else xe?i("prev"):Le&&i("next");return!0}async function k(v,b){const j=s.value===1?2:1;await K(j,{x:v,y:b}),E()}function E(){i("update:zooming",!1),u.initial=void 0,u.isZoomIn=!1,u.isZoomOut=!1}function Y(){if(u.initial)return;const v=r.value;if(!v)return;const b=v.querySelector(`[data-index="${o.pageIndex}"],[data-index2="${o.pageIndex}"]`)??void 0;b&&(u.initial={el:b,rect:b.getBoundingClientRect()})}function te(v,b){if(u.isZoomIn=u.isZoomIn||!u.isZoomOut&&v>1,u.isZoomIn&&v<1){K(1,b);return}if(u.isZoomOut=u.isZoomOut||!u.isZoomIn&&v<1,u.isZoomOut&&v>1){K(1,b);return}K(v,b)}async function K(v,b){const j=r.value,ee=Math.min(jo,Math.max(Do,v));if(!j||s.value===ee)return;Y();const{initial:le}=u;if(!le)return;const we=(b==null?void 0:b.x)??j.clientWidth/2,ke=(b==null?void 0:b.y)??j.clientHeight/2;s.value=ee,i("update:zoom",ee),await Pt();const{el:xe,rect:Le}=le,Ae=xe.offsetWidth/Le.width,Ke=xe.offsetHeight/Le.height;j.scrollLeft=xe.offsetLeft-Le.left*Ae+we*(Ae-1),j.scrollTop=xe.offsetTop-Le.top*Ke+ke*(Ke-1)}return(v,b)=>(P(),W("div",{ref_key:"rootEl",ref:r,tabindex:"0",class:ye(["w-full h-full overflow-auto scrollbar-none overscroll-contain scrollbar-none focus:outline-none touch-pan-x touch-pan-y",{"!snap-none":!e.longStrip&&(a.value||l.value||e.zooming),"cursor-grabbing":!e.touchDevice&&a.value,"overflow-hidden":e.zooming}]),style:De({"font-size":`${s.value}px`}),onClick:We(H,["stop"]),onTouchmoveCapture:We(O,["stop"])},[Te(v.$slots,"default")],38))}}),xd=Object.freeze(Object.defineProperty({__proto__:null,default:_l},Symbol.toStringTag,{value:"Module"})),_d='.loading-indicator{display:inline-block;height:80px;position:relative;width:80px}.loading-indicator:after,.loading-indicator:before{border-radius:9999px;border-style:solid;border-width:4px;box-sizing:border-box;display:block;position:absolute;--tw-border-opacity:1;animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border-color:rgb(184 92 56/var(--tw-border-opacity,1));content:"";opacity:1}.loading-indicator:after{animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:40px;opacity:0;top:40px;width:0}4.9%{height:8px;left:36px;opacity:0;top:36px;width:8px}5%{height:8px;left:36px;opacity:1;top:36px;width:8px}to{height:80px;left:0;opacity:0;top:0;width:80px}}',Sd={},kd={class:"loading-indicator"};function Cd(e,t){return P(),W("div",kd)}const Ri=be(Sd,[["render",Cd],["styles",[_d]]]),Td=Object.freeze(Object.defineProperty({__proto__:null,default:Ri},Symbol.toStringTag,{value:"Module"}));function Ni(e,t){return(e==null?void 0:e.querySelector(`[data-index="${t}"],[data-index2="${t}"]`))??void 0}const Id=["data-index"],Md={key:0,class:"img img--loading"},Ed=["src"],Pd=["data-index"],Sl=be(Ce({__name:"ReaderBody",props:{page:{type:Number},pageIndex:{type:Number},direction:{type:Number},isLongStrip:{type:Boolean},isVertical:{type:Boolean},isDouble:{type:Boolean},isRTL:{type:Boolean},pages:{type:Array},totalImgs:{type:Number},gap:{type:Number},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},playController:{type:Object},busy:{type:Boolean},fullScreen:{type:Boolean}},emits:["ready","update:zoom","update:zooming","update:playing","dragEnd","click","end","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=re(null),s=Q(()=>{var O;return(O=r.value)==null?void 0:O.rootEl});t({rootEl:s});const l=Oo(),a=Q(()=>{const{width:O,height:w}=l,g=o.isLongStrip?o.isVertical?O.value:w.value:Math.min(O.value,w.value);return Math.min(4,Math.max(1,Math.ceil(g/400-1)))*o.gap}),u=re(o.isLongStrip?{min:o.pageIndex-1,max:o.pageIndex}:x()),c=Q(()=>{const{min:O,max:w}=u.value,g={};for(let S=O;S<=w;S++)g[S]=!0;return g}),f=re(h()),p=Z(()=>{f.value=h()},100);pe(l.width,p),pe(l.height,p),pe(()=>o.pages,p),pe(()=>o.isLongStrip,p),pe(()=>o.isVertical,p);function h(){const O=l.width.value,w=l.height.value,{pages:g,isLongStrip:S,isVertical:D}=o;return g.map(B=>{var v;const C=B.some(b=>{var j;return(j=b.img)==null?void 0:j.isLoading}),H=B.map(b=>b.index),X={isLoading:C,indexes:H,visible:!1};if(C)return X;const k=B.map(({img:b})=>b).filter(Boolean);if(!k.length||(X.srcs=k.map(({src:b})=>b),k.every(b=>b.hasError)))return X;const Y=(v=k.find(b=>!b.hasError))==null?void 0:v.size;if(!Y)return X;const te=k.reduce((b,j)=>{var ee;return b+(((ee=j.size)==null?void 0:ee.width)??Y.width)},0),K=k.reduce((b,j)=>{var ee;return b+(((ee=j.size)==null?void 0:ee.height)??Y.height)},0)/k.length;return S&&D||!S&&O/te<w/K?(X.width=Math.min(O,te),X.height=K*(X.width/te)):(X.height=Math.min(w,K),X.width=te*(X.height/K)),X})}const y=Q(()=>{const O=o.isVertical?"width":"height";return f.value.map(w=>w[O]).filter(Boolean).sort((w,g)=>g-w)[0]});Qe(()=>{const O=Ni(s.value,o.pageIndex);O==null||O.scrollIntoView({behavior:"instant",block:"start"});let w,g=!1;ls(()=>{w!==o.pageIndex&&(w=o.pageIndex,S(),g||(g=!0,Pt(()=>i("ready"))))});async function S(){if(!o.isLongStrip){u.value=x();return}const D=Math.floor(o.page),B=Ni(s.value,D);if(!B)return;const C=+L(B).getAttribute("data-index"),H=+N(B).getAttribute("data-index");(C!==u.value.min||H!==u.value.max)&&(u.value={min:C,max:H})}});function x(){const{pageIndex:O}=o;return{min:O-(o.isDouble?5:3),max:O+(o.isDouble?6:3)}}function L(O,w=0){const g=O.previousElementSibling;if(!g)return O;const S=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?S>l.height.value*1.5:o.isRTL?S>l.width.value*2.5:S>l.width.value*1.5)?g:L(g,S)}function N(O,w=0){const g=O.nextElementSibling;if(!g)return O;const S=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?S>l.height.value*3.5:o.isRTL?S>l.width.value*1.5:S>l.width.value*2.5)?g:N(g,S)}function Z(O,w){let g;return()=>{g||(g??(g=setTimeout(()=>{g=void 0,O()},w)))}}return(O,w)=>(P(),me(_l,{ref_key:"gestureContainer",ref:r,"space-top":e.spaceTop,"full-screen":e.fullScreen,zoom:e.zoom,zooming:e.zooming,"pinch-to-zoome":e.pinchToZoome,"tap-zone":e.tapZone,"page-index":e.pageIndex,class:ye(["rbod",{"rbod--long-strip":e.isLongStrip,"rbod--paging":!e.isLongStrip,"rbod--vertical":e.isVertical,"rbod--rtl":e.isRTL,"rbod--1page":f.value.length===1}]),"play-controller":e.playController,horizontal:!e.isVertical,rtl:e.isRTL,"touch-device":e.touchDevice,busy:e.busy,"long-strip":e.isLongStrip,style:De({"--gap":`${a.value}em`,"--space-top":`${e.spaceTop}px`,"--screen-width-em":G(l).width.value+"em","--screen-height-em":G(l).height.value+"em",...e.isLongStrip?{"--max-size-em":y.value+"em"}:{}}),"onUpdate:zoom":w[0]||(w[0]=g=>i("update:zoom",g)),"onUpdate:zooming":w[1]||(w[1]=g=>i("update:zooming",g)),onDragEnd:w[2]||(w[2]=()=>i("dragEnd")),onClick:w[3]||(w[3]=()=>i("click")),onPrev:w[4]||(w[4]=()=>i("prev")),onNext:w[5]||(w[5]=()=>i("next"))},{default:ue(()=>[(P(!0),W(Ie,null,Zt(f.value,g=>{var S;return P(),W("div",Dn({key:e.direction+"_"+g.indexes[0],"data-index":g.indexes[0]},{ref_for:!0},g.indexes.length>1?{"data-index2":g.indexes[1]}:{}),[!((S=g.srcs)!=null&&S.length)||g.isLoading?(P(),W("div",Md,[c.value[g.indexes[0]]?(P(),me(Ri,{key:0})):$e("",!0)])):g.srcs.length==1?(P(),me(Rr(c.value[g.indexes[0]]?"img":"div"),Dn({key:1,class:"img"},{ref_for:!0},c.value[g.indexes[0]]?{src:g.srcs[0]}:{},{style:{width:g.width!==void 0?g.width+"em":"",height:g.height!==void 0?g.height+"em":""}}),null,16,["style"])):(P(),W("div",{key:2,class:ye(["img img--double",{"flex-row-reverse":e.isRTL}]),style:De({width:g.width!==void 0?g.width+a.value+"em":"",height:g.height!==void 0?g.height+"em":""})},[g.indexes.some(D=>c.value[D])?(P(!0),W(Ie,{key:0},Zt(g.srcs,D=>(P(),W("div",{key:D},[q("img",{src:D},null,8,Ed)]))),128)):$e("",!0)],6))],16,Id)}),128)),q("div",{class:"last","data-index":e.totalImgs},[Te(O.$slots,"end")],8,Pd)]),_:3},8,["space-top","full-screen","zoom","zooming","pinch-to-zoome","tap-zone","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;width:100%}.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: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>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{scroll-snap-type:y var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging.rbod--vertical>div{width:var(--screen-width-em)}.rbod--paging:not(.rbod--vertical){scroll-snap-type:x var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging:not(.rbod--vertical)>div{height:var(--screen-height-em)}.rbod--paging .img--loading{height:100%;width:100%}.rbod--paging .img.img--double{align-items:center;background-color:transparent;display:flex;gap:var(--gap);justify-content:center}.rbod--paging .img.img--double div{display:flex;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rbod--paging .img.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}.rbod .img,.rbod>div{margin:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod .img{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));-o-object-fit:contain;object-fit:contain}.rbod .img--loading{align-items:center;background-color:transparent;display:flex;justify-content:center}"]]]),$d=Object.freeze(Object.defineProperty({__proto__:null,default:Sl},Symbol.toStringTag,{value:"Module"})),Od={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},Ad={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},zd={class:"flex justify-between items-end"},Ld={class:"inline-block children-pointer-events-auto"},Dd={class:"inline-flex flex-col items-end gap-4 children-pointer-events-auto"},jd={class:"inline-block z-20 relative"},Bd={key:1,class:"fixed inline-block left-1/2 -translate-x-1/2 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3"},kl=be(Ce({__name:"ReaderLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},fullScreen:{type:Boolean},zooming:{type:Boolean},rtl:{type:Boolean},spaceTop:{type:null}},setup(e,{expose:t}){const n={mounted:i=>i.showModal(),beforeUnmount:i=>i.close()},o=re(null);return t({rootEl:o}),(i,r)=>xt((P(),W("dialog",Od,[q("div",{ref_key:"rootEl",ref:o,id:"reader-layout",class:ye({"cursor-none":e.idle,"cursor-default":!e.idle,"bg-black":e.immediate||!e.loading,"opacity-0":!e.immediate&&e.loading,"duration-200 transition-colors":!e.immediate})},[e.loading&&e.immediate?(P(),W("div",Ad,[J(Ri)])):$e("",!0),Te(i.$slots,"default"),q("div",{id:"controls",class:ye(["fixed pointer-events-none cursor-auto left-0 top-0 w-full h-full flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3",{"opacity-100 z-20":!e.fullScreen,"opacity-0 -z-10":e.fullScreen}])},[q("div",{class:"flex gap-1 items-center children-pointer-events-auto relative z-30 flex-shrink-0 2xs:gap-3",style:De({paddingTop:`${e.spaceTop||0}px`})},[Te(i.$slots,"back"),Te(i.$slots,"exit"),Te(i.$slots,"chapter-nav")],4),q("div",zd,[q("div",Ld,[Te(i.$slots,"page-nav")]),q("div",Dd,[Te(i.$slots,"entry"),q("div",jd,[Te(i.$slots,"settings")]),Te(i.$slots,"full-screen"),Te(i.$slots,"play"),Te(i.$slots,"break-first")])]),q("div",{class:ye(["fixed pointer-events-none left-0 right-0 bottom-0",{"flex justify-end":e.rtl}])},[Te(i.$slots,"progress")],2)],2),!e.fullScreen||e.zooming?(P(),W("div",Bd,[Te(i.$slots,"reset-zoom")])):$e("",!0)],2)])),[[n]])}}),[["styles",["#reader-layout{direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%;--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}"]]]),Rd=Object.freeze(Object.defineProperty({__proto__:null,default:kl},Symbol.toStringTag,{value:"Module"})),Cl=be(Ce({__name:"ReaderTour",emits:["hide"],setup(e,{emit:t}){const n=t,o=re(null),i=re(0),r=re([]),s=Q(()=>r.value[i.value]),l=Qs(a,500);Qe(()=>{const f=tl(o),p=nt(()=>u({width:f.width.value,height:f.height.value}),50);p(),pe(f.width,p),pe(f.height,p)});function a(){i.value>=r.value.length-1?n("hide"):i.value++}function u(f){const p=c();r.value=p.map(({rect:h,text:y})=>{const x=h.top<f.height-h.bottom,L=h.left<f.width-h.right;return{text:y,style:{left:`${h.left}px`,top:`${h.top}px`,width:`${h.width}px`,height:`${h.height}px`},textStyle:{left:L?`${h.left-12}px`:void 0,right:L?void 0:`${f.width-h.left}px`,top:x?`${h.bottom+12}px`:`${h.top+20}px`,textAlign:x?void 0:"right",transform:x?void 0:"translateY(-50%)"}}}),i.value>=r.value.length&&(i.value=r.value.length-1)}function c(){var h;const f=(h=o.value)==null?void 0:h.parentElement;if(!f)return[];const p=[];return f.querySelectorAll("[data-tour]").forEach(y=>{var N;const x=(N=y.getAttribute("data-tour"))==null?void 0:N.trim();if(!(x!=null&&x.length))return;const L=y.getBoundingClientRect();p.push({rect:L,text:x})}),p}return(f,p)=>{var h,y;return P(),W(Ie,null,[q("div",{class:ye(["fixed inset-0 bg-black bg-opacity-50 duration-500",{"opacity-0":!s.value,"opacity-100":!!s.value}])},null,2),q("div",{ref_key:"root",ref:o,class:"tour",onClick:p[0]||(p[0]=We((...x)=>G(l)&&G(l)(...x),["stop"]))},[s.value?(P(),W("div",{key:i.value,class:"tour__target",style:De(s.value.style)},null,4)):$e("",!0),(P(),W("div",{key:i.value,class:"tour__text",style:De((h=s.value)==null?void 0:h.textStyle)},Je(((y=s.value)==null?void 0:y.text)??""),5))],512)],64)}}}),[["styles",[".tour{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:20}.tour__target{border-radius:9999px;border-width:2px;--tw-border-opacity:1;animation:tour-target-anim .5s forwards;border-color:rgb(120 113 108/var(--tw-border-opacity,1));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%{transform:scale(3);--tw-border-opacity:0;opacity:0}to{transform:scale(1);--tw-border-opacity:1;opacity:.9}}@keyframes tour-text-anim{0%{opacity:0}to{opacity:1}}@keyframes tour-text-bounce{0%{margin-top:0}to{margin-top:10px}}"]]]),Nd=Object.freeze(Object.defineProperty({__proto__:null,default:Cl},Symbol.toStringTag,{value:"Module"})),Vd={},Fd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Hd(e,t){return P(),W("svg",Fd,[...t[0]||(t[0]=[q("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)])])}const Tl=be(Vd,[["render",Hd]]),Wd=Object.freeze(Object.defineProperty({__proto__:null,default:Tl},Symbol.toStringTag,{value:"Module"})),Kd={},Ud={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function qd(e,t){return P(),W("svg",Ud,[...t[0]||(t[0]=[q("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)])])}const Il=be(Kd,[["render",qd]]),Zd=Object.freeze(Object.defineProperty({__proto__:null,default:Il},Symbol.toStringTag,{value:"Module"})),Yd={},Xd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Gd(e,t){return P(),W("svg",Xd,[...t[0]||(t[0]=[q("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)])])}const Ml=be(Yd,[["render",Gd]]),Jd=Object.freeze(Object.defineProperty({__proto__:null,default:Ml},Symbol.toStringTag,{value:"Module"})),Qd={},ep={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function tp(e,t){return P(),W("svg",ep,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"},null,-1)])])}const El=be(Qd,[["render",tp]]),np=Object.freeze(Object.defineProperty({__proto__:null,default:El},Symbol.toStringTag,{value:"Module"})),op={},ip={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function rp(e,t){return P(),W("svg",ip,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"},null,-1)])])}const Pl=be(op,[["render",rp]]),sp=Object.freeze(Object.defineProperty({__proto__:null,default:Pl},Symbol.toStringTag,{value:"Module"})),lp={},ap={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 56"};function cp(e,t){return P(),W("svg",ap,[...t[0]||(t[0]=[q("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)])])}const $l=be(lp,[["render",cp]]),up=Object.freeze(Object.defineProperty({__proto__:null,default:$l},Symbol.toStringTag,{value:"Module"})),fp={},dp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function pp(e,t){return P(),W("svg",dp,[...t[0]||(t[0]=[q("g",{fill:"none"},[q("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"}),q("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)])])}const Ol=be(fp,[["render",pp]]),hp=Object.freeze(Object.defineProperty({__proto__:null,default:Ol},Symbol.toStringTag,{value:"Module"})),gp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function vp(e,t){return P(),W("svg",mp,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM6 14v4h4v2H4v-6h2Zm14 0v6h-6v-2h4v-4h2Z"},null,-1)])])}const Al=be(gp,[["render",vp]]),bp=Object.freeze(Object.defineProperty({__proto__:null,default:Al},Symbol.toStringTag,{value:"Module"})),yp={},wp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function xp(e,t){return P(),W("svg",wp,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M14 20v-6h6v2h-4v4h-2Zm-6 0v-4H4v-2h6v6H8Zm12-10h-6V4h2v4h4v2Zm-10 0H4V8h4V4h2v6Z"},null,-1)])])}const zl=be(yp,[["render",xp]]),_p=Object.freeze(Object.defineProperty({__proto__:null,default:zl},Symbol.toStringTag,{value:"Module"})),Sp={},kp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Cp(e,t){return P(),W("svg",kp,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M19 12.998h-6v6h-2v-6H5v-2h6v-6h2v6h6z"},null,-1)])])}const Ll=be(Sp,[["render",Cp]]),Tp=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),Ip={},Mp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Ep(e,t){return P(),W("svg",Mp,[...t[0]||(t[0]=[q("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)])])}const Dl=be(Ip,[["render",Ep]]),Pp=Object.freeze(Object.defineProperty({__proto__:null,default:Dl},Symbol.toStringTag,{value:"Module"}));function Wn(e=0){return new Promise(t=>setTimeout(t,e))}function jl(e){const t=async(n,o)=>{var i;if(!n.toBlob){if(o)return;const r=n.cloneNode(),s=(i=r.getContext)==null?void 0:i.call(r,"2d");if(!s)return;try{s.drawImage(e,0,0)}catch{return}return t(r,!0)}return await new Promise(r=>{const s=l=>{if(!l)return r(void 0);const a=URL.createObjectURL(l);r(a)};try{n.toBlob(s,"image/jpeg",1)}catch{r(void 0)}})};return t(e,!1)}let Bo;async function $p(e,t){if(Bo||!t.startsWith("blob:"))return t;if(Bo===void 0){try{if((await fetch(t)).ok)return Bo=!0,t}catch{}Bo=!1}e.complete||await new Promise(a=>{let u=0;const c=setInterval(()=>{e.complete?(a(),clearInterval(c)):++u>=30&&a()},100)});const o=e.naturalWidth,i=e.naturalHeight;if(!o||!i)return;const r=document.createElement("canvas"),s=r.getContext("2d");return r.width=o,r.height=i,s==null||s.drawImage(e,0,0,o,i),await jl(r)}function Op(e){const t=new Set,n=e.getAttributeNames(),o=n.indexOf("src"),i=o!==-1;i&&(n.splice(o,1),n.push("src"));for(const r of n){if(r==="srcset"||i&&r===":src"||r!=="data-url"&&r!=="data-original"&&!r.includes("src"))continue;const s=e.getAttribute(r);s&&(r==="src"&&e.naturalWidth&&e.naturalWidth<200||t.add(s.replace(/(\n|\t)/g," ").trim()))}return Array.from(t)}function Vi(e,t){return e>=75&&t>=50&&(e>=200||t>=200)}class Ap{constructor({onChanged:t}){ze(this,"isMounted",!0);ze(this,"elsDisposeCallbacksMap",new Map);ze(this,"onChanged");this.onChanged=t}dispose(){this.isMounted=!1,this.elsDisposeCallbacksMap.forEach(t=>t()),this.elsDisposeCallbacksMap=new Map,this.onChanged=()=>{}}async download(t){if(!this.isMounted)return;const n=t.el,o=!!n&&n instanceof HTMLImageElement,i=n?o?Op(n):[await jl(n)].filter(Boolean):[t.src].filter(Boolean);if(!(!n&&!i.length||!this.isMounted)){if(n&&!this.elsDisposeCallbacksMap.has(n))if(o){let r=i.slice(-1)[0];const s=new MutationObserver(l=>{l.some(u=>{if(u.attributeName!=="src")return!1;const c=r;return r=n.getAttribute("src"),!!r&&c!==r})&&this.download(t)});s.observe(n,{attributes:!0}),this.elsDisposeCallbacksMap.set(n,()=>s.disconnect())}else{const r=n.getContext("2d");if(r){const s=r.drawImage.bind(r),l=r.putImageData.bind(r),a=(u,c,f)=>(setTimeout(()=>this.download(t),100),u.apply(c,f));try{r.drawImage=new Proxy(s,{apply:a}),r.putImageData=new Proxy(l,{apply:a})}catch{}this.elsDisposeCallbacksMap.set(n,()=>{try{r.drawImage=s,r.putImageData=l}catch{}})}}i.length&&(this.onChanged(t,{src:i[0],isLoading:!0,hasError:!1}),await this.downloadRawImage(t,i))}}async downloadRawImage(t,n){const o=t.el instanceof HTMLImageElement?t.el:void 0;for(let i=0;i<n.length;i++){const r=n[i],s=o?await $p(o,r):r;if(!s||!this.isMounted)return;const l=await zp(s,o,a=>{this.isMounted&&this.onChanged(t,{src:s,size:a,isLoading:!1,hasError:!1})});if(l.ok||!this.isMounted)return;i===n.length-1&&this.onChanged(t,{src:s,isLoading:!1,hasError:!!l.error,invalid:!!l.invalid,size:l.size})}}}async function zp(e,t,n){return(t==null?void 0:t.src)===e&&t.naturalWidth&&t.naturalHeight?(n({width:t.naturalWidth,height:t.naturalHeight}),t.complete?{ok:!0}:new Promise(o=>{t.addEventListener("load",()=>o({ok:!0}),{once:!0})})):await new Promise(o=>{const i=new Image,r=setInterval(()=>{const{naturalWidth:s,naturalHeight:l}=i;if(l&&s){const a={width:s,height:l};Vi(s,l)?n(a):o({invalid:!0,size:a}),clearInterval(r)}},20);i.onerror=()=>{o({error:!0}),clearInterval(r)},i.onload=()=>setTimeout(()=>o({ok:!0}),25),i.src=e})}const Lp=3;class Dp{constructor(t){ze(this,"download");ze(this,"threads");ze(this,"completedItems");ze(this,"promisesMap",new Map);this.download=t.download}dispose(){var t;(t=this.threads)==null||t.dispose(),this.threads=void 0,this.completedItems=void 0}run({activeIndex:t,items:n}){var r;if(this.completedItems===n)return;this.completedItems=void 0,(r=this.threads)==null||r.dispose();let o=Math.max(0,t-1),i=!0;this.threads=new jp(Lp,()=>{const s=n[o];if(!s){this.completedItems=n;return}i&&o===n.length-1?(i=!1,o=t-2):i?o++:o--;const l=s.src??s.el;if(l){const u=this.promisesMap.get(l);if(u)return u}const a=this.download(s);return l&&this.promisesMap.set(l,a),a}),this.threads.exec()}}class jp{constructor(t,n){ze(this,"isDisposed",!1);this.limit=t,this.getNext=n}dispose(){this.isDisposed=!0}exec(){for(let t=0;t<this.limit;t++)this.next()}async next(){if(this.isDisposed)return;const t=this.getNext();t&&(await t,await Wn(20),this.next())}}class Bl{constructor(){ze(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 Bp(e,t){let n=[t??document.documentElement];const o=e.split("->");for(let i=0;i<o.length;i++){const r=o[i];n=n.map(s=>Array.from((s.shadowRoot??s).querySelectorAll(r))).flat()}return n}function Kn(e,t){if(e instanceof HTMLOptionElement){const n=e.parentElement instanceof HTMLOptGroupElement?e.parentElement.parentElement:e.parentElement;if(!n||!(n instanceof HTMLSelectElement))return;const o=e.getAttribute("value")||"";if(n.value===o)return;n.value=o,n.dispatchEvent(new Event("change"));return}e instanceof HTMLAnchorElement&&(t==null?void 0:t.preventDefault)!==!1&&e.addEventListener("click",n=>n.preventDefault(),{once:!0}),e.click(),e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0})),e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0}))}async function Rp(e){const{lstrip:t,lstripBtn:n}=e||{};if(!t||!n||!!document.querySelector(t))return!1;const i=n.split(";");for(const r of i)if(!await Np(r.trim()))return!1;return!0}async function Np(e){const t=await bn(50,30,()=>document.querySelector(e));return t?(Kn(t),await Wn(),!0):!1}class Vp{constructor({spec:t,onChanged:n}){ze(this,"spec");ze(this,"onChanged");ze(this,"rawImages",[]);ze(this,"isMounted",!0);ze(this,"loadRawImagesTs");ze(this,"imgListenersMap",new Map);ze(this,"disconnectObservers");ze(this,"contentEl");ze(this,"reloadRawImages",nt(()=>{this.contentEl&&this.loadRawImages(this.contentEl)},100));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 i;const t=new MutationObserver(this.reloadRawImages),n=(i=this.spec)!=null&&i.imgDivs?void 0:(()=>{let r=window.innerWidth;return new ResizeObserver(nt(()=>{const s=window.innerWidth;if(s!==r){r=s;return}this.reloadRawImages()},50))})();this.disconnectObservers=async()=>{t.disconnect(),n==null||n.disconnect()};let o=!1;this.loadContentEl(r=>{this.contentEl!==r&&(this.contentEl=r,t.disconnect(),n==null||n.disconnect(),t.observe(this.contentEl,{childList:!0,subtree:!0}),n==null||n.observe(this.contentEl),o?this.reloadRawImages():(o=!0,this.loadRawImages(this.contentEl)))})}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 Rp(this.spec),o=(l=this.spec)==null?void 0:l.content;if(!o){t(document.body);return}let i=await bn(n?100:1,10,()=>{for(const a of o.split(",")){const u=document.querySelector(a);if(u)return u}});if(!i)return;t(i);let r=0;const s=async()=>{if(this.isMounted&&!(i!=null&&i.isConnected)){if(r=0,i=await bn(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 this.loadFromImgDivs(t,o):this.loadFromContentEl(t);this.loadRawImagesTs!==n||!t.isConnected||!this.isMounted||this.setRawImages(i)}async loadFromImgDivs(t,n){const o=Bp(n,t);if(!o.length)return this.loadFromContentEl(t);const i=new Bl;return o.map(s=>{const l=Array.from(s.querySelectorAll("img,canvas"));for(const a of l)if(i.check(a)){if(a instanceof HTMLCanvasElement){if(Rl(a))return{el:a,parentEl:s}}else if(a instanceof HTMLImageElement&&Nl(a))return{el:a,parentEl:s}}return{parentEl:s}})}loadFromContentEl(t){const n=[],o={},i=new Bl;return Array.from(t.querySelectorAll("img,canvas")).forEach(s=>{if(!i.check(s)){this.observeInvalidImgEl(s);return}if(s instanceof HTMLCanvasElement)Rl(s)&&n.push({el:s});else if(s instanceof HTMLImageElement)if(Nl(s)){const l=s.getAttribute("src");if(l){const a=o[l];if(a!==void 0&&a!==-1){n.splice(a,1);return}o[l]=n.length}n.push({el:s})}else this.observeInvalidImgEl(s)}),n}observeInvalidImgEl(t){if(!(t instanceof HTMLImageElement)||this.imgListenersMap.has(t))return;const n=()=>{t.removeEventListener("load",n),this.imgListenersMap.delete(t),this.reloadRawImages()};this.imgListenersMap.set(t,n),t.addEventListener("load",n)}}function Rl(e){return e.isConnected&&Vi(e.width,e.height)}function Nl(e){if(!e.isConnected)return!1;const t=e.getBoundingClientRect();return!t.width||!t.height||Vi(t.width,t.height)}const Ro="mp-scroll-container";class Fi{constructor(){ze(this,"scrollEl")}dispose(){var t;(t=this.scrollEl)==null||t.classList.remove(Ro)}scrollTo({rawImages:t,page:n,skipIfVisible:o,isScrollDown:i,isScrollExact:r,fallbackScrollEl:s}){var L;const l=Math.floor(n),a=t[Math.min(t.length-1,l)];if(!a)return;const u=a.el??a.parentEl??(a.src?document.querySelector(`img[src^="${a.src}"]`):void 0);if(!u)return;const c=u.getBoundingClientRect();if(o&&c.top<=0&&c.top+c.height>0)return;const f=Fi.getScrollable(u,s);if(!f)return;const{el:p,top:h}=f;s!==document.documentElement&&!p.classList.contains(Ro)&&(p!==this.scrollEl&&((L=this.scrollEl)==null||L.classList.remove(Ro),this.scrollEl=p),p.classList.add(Ro));const y=n>=t.length?c.height:r?n%1*c.height:i?Math.max(0,c.height-window.innerHeight/2):-window.innerHeight/2,x={top:h+y,behavior:"instant"};p.scrollTo(x),p!==document.documentElement&&document.documentElement.scrollTo(x)}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 u=0;return r.forEach((c,f)=>{u+=f===l?c-s:c}),{el:i,top:u}};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 Fp(e){if(document.documentElement.scrollTop<700)return 0;const n=Array.from(document.querySelectorAll("img[src]")).filter(o=>e.includes(o.src)).map(o=>({el:o}));return Vl(n)}function Hp(e){var C,H,X;const t=(C=e.raw.value)==null?void 0:C.isWebtoon,n=re(t===!1),o=re(t);let i=!1;const r=e.touchDevice&&!navigator.userAgent.toLowerCase().includes("android"),s=((X=(H=e.raw.value)==null?void 0:H.imgs)==null?void 0:X.filter(Boolean))??[];let l=e.isAutoShow!==!1?e.page.value:s.length?Fp(s):void 0,a=s.map(k=>({src:k})),u,c;const f=new Map,p=({src:k,el:E})=>{const Y=E??k;return Y?f.get(Y):void 0},h=re(s.map(k=>({src:k,isLoading:!0,hasError:!1}))),y=()=>{const k=[];a.forEach(E=>{const{src:Y,el:te}=E,K=te??Y,v=K?f.get(K):void 0;(K&&!(v!=null&&v.invalid)||E.parentEl)&&k.push(v)}),h.value=k};let x=setTimeout(e.onTimeout,2e4);const L=()=>{x&&(clearTimeout(x),x=void 0)};let N=0,Z=0;const O=4,w=new Ap({onChanged(k,E){const Y=k.el??k.src;if(!Y||(f.set(Y,E),y(),E.isLoading))return;if(E.hasError){if(c||o.value!==void 0)return;c=setTimeout(()=>{c=void 0,o.value===void 0&&e.onError("Failed to load images")},3e3);return}const{size:te,invalid:K}=E;if(!(!te||K)){if(!o.value&&Z<O){const v=i?a:a.filter(({el:ke,src:xe})=>xe||!(ke&&ke instanceof HTMLImageElement&&!f.has(ke)));let b=v.indexOf(k);if(i&&b>4||b===-1&&(k.el&&(b=v.findIndex(ke=>ke.el===k.el)),b===-1))return;const j=b>Math.min(1,v.length-3)&&b<Math.max(v.length-2,3),ee=te.width/te.height;ee>2&&N++;const le=ee<.5||N>=O,we=!le&&.65<ee&&ee<.75;we&&Z++,o.value!==le&&(j||le)&&(o.value=le),j&&n.value!=we&&(n.value=!0),o.value===void 0&&we&&Z===O&&(o.value=!1)}B()}}}),g=new Dp({download:async k=>{!(k.el&&f.has(k.el))&&!(k.src&&f.has(k.src))&&await w.download(k)}}),S=()=>{g.run({items:a,activeIndex:Math.min(a.length-1,Math.floor(e.page.value))})},D=new Fi;if(s.length)S();else{let k=!1;u=new Vp({spec:e.spec,async onChanged(E){var Y;if(a=E,y(),!e.raw.value&&!E.length){e.onError("no_img");return}(Y=e.spec)!=null&&Y.imgDivs&&!k&&e.isAutoShow!==!1&&e.page.value&&(k=!0,D.scrollTo({rawImages:E,page:e.page.value,skipIfVisible:!0,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0}),await Wn(1)),l===void 0&&e.isAutoShow===!1&&(l=Vl(E)),S()}})}ui(()=>{w.dispose(),g.dispose(),u==null||u.dispose(),c&&clearTimeout(c),D.dispose(),i&&D.scrollTo({rawImages:a,page:e.page.value,fallbackScrollEl:document.documentElement,isScrollExact:!0})});function B(){if(i||o.value===void 0||l===void 0)return;const k=Math.max(0,Math.min(l,a.length)),E=Math.min(Math.floor(k),a.length-1);if(E>=1){const te=a[E];if(!te||!p(te)){e.isAutoShow&&D.scrollTo({rawImages:a,page:E,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0});return}for(let K=E;K<a.length;K++){const v=p(a[K]);if(!v)return;if(!v.invalid){if(!v.size&&!v.hasError)return;break}}for(let K=E-1;K>=0;K--){const{src:v,el:b}=a[K],j=b??v;if(!j)break;const ee=f.get(j);if(!ee)return;if(!ee.invalid){if(!ee.size&&!ee.hasError)return;break}}}if(i)return;i=!0,L(),e.onReady(k);let Y=!0;pe(()=>Math.floor(e.page.value),(te,K)=>{te===K&&!Y||(D.scrollTo({rawImages:a,page:te,isScrollDown:K===void 0||te>K||a.length===1,skipIfVisible:Y&&a.length>1,fallbackScrollEl:r?document.body:document.documentElement}),Y=!1,K??(K=-1),S())},{immediate:!0})}return{asyncImgs:Q(()=>h.value),isWebtoon:Q(()=>o.value??!1),isManga:Q(()=>n.value)}}function Wp(e,t,n){return Q(()=>t.value?Fl(e.value,n.value):e.value.map((o,i)=>[{img:o,index:i}]))}function Fl(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})),...Fl(e.slice(r.length),t&&i,n+r.length)]}function Kp(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=re(t&&e>0?Math.max(0,e):+(sessionStorage.getItem("tk:page")??"0")||e);return Q({get:()=>o.value,set:i=>{o.value=i,sessionStorage.setItem("tk:page",i+"")}})}function Up(){sessionStorage.removeItem("tk:page"),sessionStorage.removeItem("tk:page:path")}const Hi=40;function qp({page:e,totalImgs:t,direction:n,style:o,isLongStrip:i,isVertical:r,isRTL:s,spaceTop:l,scrollEl:a,isWebtoon:u,interferePlayer:c,onChangedPage:f,onInitialized:p,onFinished:h}){let y=!1,x=!1,L=!1,N;const Z=nt(H,300),O=Qs(()=>{H(),Z()},300),w=b=>(D(b),nt(D,50)(b));async function g(){B(e.value,{smooth:!1,ensureLastImgVisibility:!0})}function S(){var b;x=!0,p(),X(),(b=a.value)==null||b.addEventListener("scroll",O),setTimeout(()=>{const{width:j,height:ee}=Oo();pe(j,()=>{r.value&&w(e.value)}),pe(ee,()=>{r.value||w(e.value)}),pe(o,()=>w(e.value)),pe(n,()=>w(e.value)),/iPad|iPhone|iPod/.test(navigator.userAgent)&&pe(t,()=>{s.value&&w(e.value)})},300)}async function D(b){if(!(!x||y)){if(y=!0,await Pt(),E()===b){y=!1;return}B(b)}}function B(b,{smooth:j,ensureLastImgVisibility:ee=!1}={smooth:!1}){const le=a.value;if(!le)return;y=!0;const we=async()=>{await Pt(),y=!1,x||S()},ke=Math.floor(b),xe=Ni(le,ke);if(!xe){we();return}c(async()=>{await C(le,!i.value&&j,async()=>{await v(le,xe,{smooth:j,page:b,ensureLastImgVisibility:ee})}),await we()})}async function C(b,j,ee){j&&b.style.setProperty("scroll-snap-type","none"),await ee(),j&&b.style.removeProperty("scroll-snap-type")}function H(){if(y)return;const b=E();b!==void 0&&b!==e.value&&f(b),X()}function X(){L||!L&&k()&&(L=!0,h())}function k(){const b=a.value;if(!b)return!1;const j=i.value?u.value?3:!r.value&&b.clientWidth>b.clientHeight?2.25:2.5:2;return r.value?b.scrollHeight-b.scrollTop<b.clientHeight*j:b.scrollWidth-(s.value?-b.scrollLeft:b.scrollLeft)<b.clientWidth*j}function E(){const b=Y();return b?(+b.getAttribute("data-index")||0)+(i.value?te(b):0):void 0}function Y(){var j;if(N??(N=a.value.getRootNode()),!N)return;const b=(j=N.elementsFromPoint)==null?void 0:j.call(N,r.value||!i.value?window.innerWidth/2:s.value?window.innerWidth-Hi:Hi,r.value&&i.value?l.value||Hi:window.innerHeight/2);if(b)for(let ee=0;ee<b.length;ee++){const le=b[ee];if(le.hasAttribute("data-index"))return le;if(le===a.value)break}}function te(b){const j=b.getBoundingClientRect();return r.value?Math.abs(j.top-l.value)/j.height:s.value?Math.max(0,j.right-a.value.clientWidth)/j.width:Math.abs(j.left)/j.width}let K=!1;async function v(b,j,ee){if(K)return;const le=j.getBoundingClientRect();if(!i.value){if(r.value){if(le.top<=0&&le.bottom>=b.clientHeight)return}else if(le.left<=0&&le.right>=b.clientWidth)return}K=!0;const we=r.value?b.scrollTop:b.scrollLeft,ke=ee.page,xe=i.value?ke%1:0,Le=await bn(30,10,async()=>{await Wn();let Me;if(!(j.offsetHeight<10))return i.value?r.value?Me=j.offsetTop+xe*j.offsetHeight-l.value:s.value?Me=j.offsetLeft-b.clientWidth+j.offsetWidth-xe*j.offsetWidth:Me=j.offsetLeft+xe*j.offsetWidth:r.value?Me=j.offsetTop+(le.top>0?0:le.height-b.clientHeight):Me=j.offsetLeft+(le.left>0?0:le.width-b.clientWidth),ke>.5&&Math.abs(Me)<100?void 0:Me})??0,Ae=ee.ensureLastImgVisibility?r.value?Math.min(Le,b.scrollHeight-b.clientHeight*2):s.value?Math.max(Le,-(b.scrollWidth-b.clientWidth*2)):Math.min(Le,b.scrollWidth-b.clientWidth*2):Le;if(!ee.smooth){r.value?b.scrollTop=Ae:b.scrollLeft=Ae,K=!1;return}const Ke=Ae-we,it=30;let ft=0;return new Promise(Me=>{(function on(){const d=Zp(ft,we,Ke,it);r.value?b.scrollTop=d:b.scrollLeft=d,ft++,ft<=it?requestAnimationFrame(on):(Me(),K=!1)})()})}return{init:g,goToPage:B}}function Zp(e,t,n,o){return n*(Math.pow(e/o-1,3)+1)+t}function Yp({autoPlay:e,touchDevice:t,scrollEl:n,isVertical:o,isRTL:i,isLongStrip:r,speed:s}){const l=re(e||sessionStorage.getItem("tk:playing")==="true"),a=Q({get:()=>l.value,set:S=>{l.value=S,sessionStorage.setItem("tk:playing",S?"true":"false")}}),u=re(!1);let c,f;const p=nt(w,100),h=nt(()=>{u.value=!0},t?2e3:1e3),y=()=>setTimeout(()=>{u.value=!1,h()},30);y(),t||Dt(window,"mousemove",y),Qe(()=>{t||pe(Pi(),D=>{a.value&&(D==="visible"?w():f==null||f())}),pe(s,()=>x()),pe(r,S=>{S||N()})}),qt(N);async function x(S){a.value&&(f==null||f()),S&&(await Pt(),await S()),a.value&&p()}function L(){a.value?N():Z()}function N(){a.value&&(a.value=!1,f==null||f(),y())}function Z(){!a.value&&r.value&&(a.value=!0,w(),y())}function O(){f==null||f()}function w(){const S=n.value;if(!a.value||!S)return;const D=o.value?S.scrollHeight-S.clientHeight:S.scrollWidth-S.clientWidth,B=g();if(D<=B){N();return}f=()=>{c=Date.now(),f=void 0};const C=Date.now();c=C;const H=.1*s.value,X=o.value?"scrollTop":"scrollLeft";let k=Date.now(),E=0;const Y=()=>{if(c!==C)return;const te=Date.now(),K=te-k;k=te;const v=H*K+E;v>=1?(E=v%1,S[X]+=(v-E)*(i.value?-1:1)):E=v,setTimeout(Y,1)};Y()}function g(){const S=n.value;return o.value?S.scrollTop:i.value?-S.scrollLeft:S.scrollLeft}return{isPlaying:a,isIdle:u,toggle:L,play:Z,pause:O,resume:w,stop:N,interfere:x,awake:y}}function Xp({raw:e,spec:t,siteMeta:n,onSelect:o}){var H,X,k;const{vol:i,inferVol:r,chap:s,title:l,slug:a,basePath:u}=e,c=t==null?void 0:t.chapter;let f=-1;async function p(E,Y){if(o){o({...E});return}if(E.slug){h(E.slug,Y);return}if(E.elIndex===void 0||!(c!=null&&c.sel))return;let te=null;document.querySelector(c.sel)||(c!=null&&c.trigger&&(te=document.querySelector(c.trigger)),te&&(Kn(te),await new Promise(v=>setTimeout(()=>v(),50))));const K=c&&c.sel&&!c.url?document.querySelectorAll(c.sel):void 0;K!=null&&K[E.elIndex]&&(Kn(K[E.elIndex]),te&&document.querySelector(c.sel)&&Kn(te))}function h(E,Y){const te=Gp(u,E,(n==null?void 0:n.trailing)??!0);Y?window.open(te,"_blank","noopener"):location.href=te}function y(E){const Y=O[E];return Y?te=>p(Y,te):void 0}function x(E,Y,te){if(Y)h(Y,te);else if(E){const K=document.querySelector(E);K&&Kn(K,{preventDefault:!1})}}const L=i??r,N=c==null?void 0:c.url,Z=((H=l.chapters)==null?void 0:H.filter(E=>E.slug||!N&&E.elIndex!==void 0))??[],O=Z.length>1?Z:[],w=(X=e.prev)==null?void 0:X.slug,g=(k=e.next)==null?void 0:k.slug,S=t!=null&&t.prev&&typeof t.prev!="string"?t.prev.sel??t.prevBtn:t==null?void 0:t.prevBtn,D=t!=null&&t.next&&typeof t.next!="string"?t.next.sel??t.nextBtn:t==null?void 0:t.nextBtn;let B=w||S&&!O.length&&document.body.querySelector(S)?E=>x(S,w,E):void 0,C=g||D&&!O.length&&document.body.querySelector(D)?E=>x(D,g,E):void 0;if(O.length){if(N&&(f=O.findIndex(E=>E.slug===e.slug)),f===-1&&(f=O.findIndex(E=>(E.vol??E.inferVol)===L&&E.chap===s)),N&&f===-1&&(f=O.findIndex(E=>E.slug&&a.startsWith(`${E.slug}-`)&&a.length-E.slug.length>3)),f!==-1)B??(B=y(f+1)),C??(C=y(f-1));else if(!w&&!g){const E=O.findIndex(Y=>{const te=Y.vol??Y.inferVol;return L===void 0||te===void 0||L===te?Y.chap<s:te<L});E!==-1?(B=y(E),C=y(E-1)):C=y(O.length-1)}}return{activeIndex:f,activeLabel:Hl({vol:i,chap:s}),prev:B,next:C,chapters:O.map(E=>({label:Hl(E),select:Y=>p(E,Y)}))}}function Hl({vol:e,chap:t}){return e==null?`Ch.${t}`:`Vol.${e} ch.${t}`}function Gp(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("?")}function Jp(e){return e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e)):e}var Un=(e=>(e[e.never=0]="never",e[e.move=1]="move",e[e.firstMove=2]="firstMove",e[e.onLoad=3]="onLoad",e))(Un||{});const Qp={class:"flex justify-center items-center gap-1 pl-1 pr-2 h-full"},eh={key:0,class:"ml-auto inline-flex gap-[1px] scale-95 origin-right"},Wl=be(Ce({inheritAttrs:!1,__name:"App",props:{immediate:{type:Boolean},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},fullScreen:{type:Boolean},touchDevice:{type:Boolean},entryId:{type:String},autoPlay:{type:Boolean},readerStyle:{type:Number},direction:{type:Number},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean},autoNextSeconds:{type:Number},defaultSpeed:{type:Number},defaultGap:{type:Number},hideControlsEvent:{type:Number},progressSize:{type:Number},pinchToZoom:{type:Boolean},tapZone:{type:Number}},emits:["error","crash","ready","pageChanged","fullScreenChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences"],setup(e,{emit:t}){const n=e,o=t;let i=!1;jr((T,I,se)=>{if(!i){i=!0;const Ue=`(2.1.0) ${(I==null?void 0:I.$options.name)??(I==null?void 0:I.$options.__name)??(I==null?void 0:I.$options.__file)}.${se}: ${Jp(T)}`;o("crash",Ue)}return!1});let r=!1,s;const l=re(!1),a=re(!1),u=qu({touchDevice:n.touchDevice}),c=Kp(n.page,n.isAutoShow),f=Q(()=>n.immediate||l.value?n.spaceTop??0:0),{asyncImgs:p,isWebtoon:h}=Hp({raw:Q(()=>n.raw),spec:n.spec,page:c,touchDevice:n.touchDevice,isAutoShow:n.isAutoShow,async onReady(T){Le(T),l.value=!0},onError:()=>{o("error"),R()},onTimeout:()=>o("timeout")}),{direction:y,style:x,isRTL:L,isDouble:N,isVertical:Z,isLongStrip:O,gap:w,speed:g,zoom:S,breakFirst:D}=$f({isWebtoon:h,titleName:Q(()=>{var T;return(T=n.raw)==null?void 0:T.title.name}),defaultStyle:Q(()=>n.readerStyle),defaultDirection:Q(()=>n.direction),defaultGap:Q(()=>n.defaultGap),defaultSpeed:Q(()=>n.defaultSpeed)}),B=re(!1),C=Wp(p,N,D),H=Q(()=>p.value.length),X=Q(()=>c.value>=H.value),k=Q(()=>n.raw?Xp({raw:n.raw,spec:n.spec,siteMeta:n.siteMeta,onSelect:n.offlineMode?T=>o("selectChapter",T):void 0}):void 0),E=re(null),Y=re(null),te=re(!1),K=re(!1),v=Yp({autoPlay:!n.tourEnabled&&n.autoPlay,touchDevice:n.touchDevice,scrollEl:Q(()=>{var T;return(T=E.value)==null?void 0:T.rootEl}),speed:g,isRTL:L,isVertical:Z,isLongStrip:O}),b=Q(()=>!n.touchDevice&&v.isIdle.value&&!u.value&&!B.value),j=Q({get(){return S.value},set(T){v.interfere(()=>{S.value=T})}}),ee=qp({page:c,totalImgs:H,style:x,direction:y,isLongStrip:O,isVertical:Z,isRTL:L,spaceTop:f,isWebtoon:h,scrollEl:Q(()=>{var T;return(T=E.value)==null?void 0:T.rootEl}),interferePlayer:T=>v.interfere(T),onChangedPage:Le,onInitialized(){o("ready"),a.value=!0,s=Ae(),n.hideControlsEvent===Un.onLoad&&M(!0)},onFinished:()=>o("finished")}),le=Q(()=>Math.floor(c.value)),we=Q(()=>O.value?c.value:N.value?V():Math.floor(c.value)),ke=()=>v.interfere(()=>Wn(100));nf().addListener({onKeyDown:T=>{if(n.tourEnabled)return;const I=O.value&&Z.value,se=O.value&&!Z.value,ge=!O.value&&Z.value,Ue=!O.value&&!Z.value;switch(T.key){case" ":T.preventDefault(),O.value?(de(!1),v.toggle()):M();break;case"ArrowUp":case"PageUp":I?ke():ge&&le.value!==0&&(T.preventDefault(),$());break;case"ArrowDown":case"PageDown":I?ke():ge&&!X.value&&(T.preventDefault(),F());break;case"ArrowLeft":se?ke():Ue?(T.preventDefault(),z()):Z.value&&on();break;case"ArrowRight":se?ke():Ue?(T.preventDefault(),A()):Z.value&&Me();break;case"Escape":T.preventDefault();break}},onKeyUp:T=>{switch(T.key){case"b":D.value=!D.value;break;case"f":U();break;case"t":ne();break;case"h":de();break}}}),Ru(()=>o("hapticFeedback")),Dt("fullscreenchange",()=>{te.value=!!document.fullscreenElement}),n.touchDevice&&pe(Pi(),I=>{I==="hidden"&&(v.isPlaying.value?v.stop():n.fullScreen&&M(!1))}),pe(v.isPlaying,T=>{T||M(!1),o("playingChanged",T)}),pe(v.isIdle,T=>{v.isPlaying.value&&M(T)}),pe(u,T=>{!T&&v.isIdle.value?v.awake():T&&n.fullScreen&&M()});function Le(T){if(c.value===T)return;const I=p.value.length;if(T<0||T>=I+1)return;const se=Math.floor(T*100)/100;if(se===c.value)return;const ge=c.value;if(c.value=se,o("pageChanged",se),T>=I){M(!1),v.stop();return}if(T<.01&&ge>T){M(!1),v.awake();return}const rt=n.hideControlsEvent??Un.firstMove;if(!r&&rt===Un.firstMove){(O.value?s!==void 0&&Math.abs(Ae()-s)>300:Math.abs(ge-T)>=1)&&M(!0);return}!v.isPlaying.value&&rt===Un.move&&M(!0)}function Ae(){var I;const T=(I=E.value)==null?void 0:I.rootEl;return T?Z.value?T.scrollTop:L.value?-T.scrollLeft:T.scrollLeft:0}function Ke(){!n.touchDevice&&!O.value&&ee.goToPage(le.value,{smooth:!0})}function it(){if(v.isPlaying.value){!n.fullScreen||!n.touchDevice?v.stop():v.awake();return}M()}function ft(T){n.offlineMode&&(T.preventDefault(),o("pressedBack"))}function Me(T=!1){var I,se;(se=(I=k.value)==null?void 0:I.next)==null||se.call(I,T)}function on(T=!1){var I,se;(se=(I=k.value)==null?void 0:I.prev)==null||se.call(I,T)}function d(T){L.value?Me(_(T)):on(_(T))}function m(T){L.value?on(_(T)):Me(_(T))}function _(T){return!n.touchDevice&&(T.ctrlKey||T.metaKey)}function z(){L.value?F():$()}function A(){L.value?$():F()}function $(){var se;const T=C.value,I=X.value?T[T.length-1][0].index:(se=T[V()-1])==null?void 0:se[0].index;I!==void 0?ee.goToPage(I):on()}function F(){var T,I;if(X.value)Me();else{const se=((I=(T=C.value[V()+1])==null?void 0:T[0])==null?void 0:I.index)??p.value.length;ee.goToPage(se)}}function V(){const T=le.value,I=C.value.findIndex(se=>se.some(({index:ge})=>ge===T));return I===-1?C.value.length-1:I}function R(){if(n.offlineMode){o("pressedBack");return}Up(),o("dispose")}async function M(T){if(u.value&&!n.fullScreen)return;const I=typeof T=="boolean"?T:!n.fullScreen;I!==n.fullScreen&&(r=!0,o("fullScreenChanged",I),I&&setTimeout(()=>{n.fullScreen&&u.value&&o("fullScreenChanged",!1)},100))}function ne(){n.entryId?ae():oe()}function U(){var T,I;document.fullscreenElement?document.exitFullscreen():(I=(T=Y.value)==null?void 0:T.rootEl)==null||I.requestFullscreen()}function oe(){v.stop(),o("addEntry")}function ae(){v.stop(),o("openEntry",n.entryId)}function de(T){K.value!==T&&(K.value=!K.value,K.value&&v.isPlaying.value&&v.stop())}return(T,I)=>e.immediate||l.value?(P(),me(kl,{key:0,ref_key:"root",ref:Y,loading:!a.value,immediate:!!e.immediate,"full-screen":!!e.fullScreen,zooming:B.value,idle:b.value,"space-top":f.value,rtl:G(L),onClick:I[15]||(I[15]=We(()=>{},["stop"]))},bo({settings:ue(()=>{var se;return[J(cl,{"reader-style":G(x),"onUpdate:readerStyle":I[6]||(I[6]=ge=>Oe(x)?x.value=ge:null),direction:G(y),"onUpdate:direction":I[7]||(I[7]=ge=>Oe(y)?y.value=ge:null),gap:G(w),"onUpdate:gap":I[8]||(I[8]=ge=>Oe(w)?w.value=ge:null),speed:G(g),"onUpdate:speed":I[9]||(I[9]=ge=>Oe(g)?g.value=ge:null),zoom:j.value,"onUpdate:zoom":I[10]||(I[10]=ge=>j.value=ge),name:(se=e.raw)==null?void 0:se.title.name,webtoon:G(h),disabled:!l.value,onMore:I[11]||(I[11]=()=>o("openDefaultPreferences"))},null,8,["reader-style","direction","gap","speed","zoom","name","webtoon","disabled"])]}),"reset-zoom":ue(()=>[J(Eo,{name:"fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ue(()=>[B.value||G(S)!==1?(P(),me(fl,{key:0,zoom:j.value,onClick:I[14]||(I[14]=We(()=>j.value=1,["stop"])),class:"duration-200"},null,8,["zoom"])):$e("",!0)]),_:1})]),default:ue(()=>[l.value?(P(),me(Sl,{key:0,ref_key:"body",ref:E,zoom:j.value,"onUpdate:zoom":I[0]||(I[0]=se=>j.value=se),zooming:B.value,"onUpdate:zooming":I[1]||(I[1]=se=>B.value=se),page:G(c),"page-index":le.value,pages:G(C),"total-imgs":G(p).length,direction:G(y),gap:G(w),"is-long-strip":G(O),isRTL:G(L),"is-double":G(N),"is-vertical":G(Z),"space-top":f.value||0,busy:G(u),"play-controller":G(v),"touch-device":e.touchDevice,"pinch-to-zoome":e.pinchToZoom??!0,"tap-zone":e.tapZone,"full-screen":!!e.fullScreen,onReady:G(ee).init,onPrev:$,onNext:F,onClick:it,onDragEnd:Ke,onWheelPassive:I[2]||(I[2]=()=>G(v).interfere())},bo({_:2},[l.value&&G(p).length?{name:"end",fn:ue(()=>{var se;return[J(nl,{"has-next":!!((se=k.value)!=null&&se.next),"offline-mode":!!e.offlineMode,seconds:e.autoNextSeconds??5,onNext:Me,onHide:R},bo({_:2},[G(S)===1&&!e.entryId&&e.raw&&!e.offlineMode?{name:"bottom-center",fn:ue(()=>[J(Ai,{class:"bg-primary w-min !h-9 !bg-opacity-100",onClick:ne},{default:ue(()=>[q("div",Qp,[J(Ll,{class:"flex-shrink-0 w-auto"}),I[16]||(I[16]=q("span",{class:"text-sm"},"Add to library",-1))])]),_:1})]),key:"0"}:void 0]),1032,["has-next","offline-mode","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","play-controller","touch-device","pinch-to-zoome","tap-zone","full-screen","onReady"])):$e("",!0),a.value&&!X.value&&!e.tourEnabled?(P(),me(vl,{key:1,direction:G(y),"tap-zone":e.tapZone},null,8,["direction","tap-zone"])):$e("",!0),a.value&&!X.value?(P(),me(wl,{key:2,playing:!!G(v).isPlaying.value},null,8,["playing"])):$e("",!0),K.value?(P(),me(bl,{key:3,"touch-device":e.touchDevice,onHide:de},null,8,["touch-device"])):$e("",!0),e.tourEnabled?(P(),me(Cl,{key:4,onHide:I[3]||(I[3]=()=>o("tourEnabledChanged",!1))})):$e("",!0)]),_:2},[e.raw||e.offlineMode?{name:"back",fn:ue(()=>[J(ct,{href:e.offlineMode||!e.raw?"#":e.raw.title.url,title:"Back to manga","enable-haptic-feedback":"",onClick:ft},{default:ue(()=>[J(Tl)]),_:1},8,["href"])]),key:"0"}:void 0,!e.touchDevice&&!e.offlineMode?{name:"exit",fn:ue(()=>[J(ct,{title:"Hide reader","data-tour":"You have entered reader mode, press here to return to the original page",onClick:R},{default:ue(()=>[J(Dl)]),_:1})]),key:"1"}:void 0,k.value?{name:"chapter-nav",fn:ue(()=>{var se;return[J(gl,{"touch-device":e.touchDevice,"chapter-spec":(se=e.spec)==null?void 0:se.chapter,data:k.value,onGetHiddenChapters:I[4]||(I[4]=()=>o("getHiddenChapters")),onChaptersDialogOpen:I[5]||(I[5]=()=>M(!0))},null,8,["touch-device","chapter-spec","data"]),k.value.next||k.value.prev?(P(),W("div",eh,[J(ct,{title:`${G(L)?"Next":"Prev"} chapter (←)`,disabled:G(L)?!k.value.next:!k.value.prev,class:"!rounded-r-none","enable-haptic-feedback":"",onClick:d},{default:ue(()=>[J(El)]),_:1},8,["title","disabled"]),J(ct,{title:`${G(L)?"Prev":"Next"} chapter (→)`,disabled:G(L)?!k.value.prev:!k.value.next,class:"!rounded-l-none","enable-haptic-feedback":"",onClick:m},{default:ue(()=>[J(Pl)]),_:1},8,["title","disabled"])])):$e("",!0)]}),key:"2"}:void 0,G(C).length?{name:"page-nav",fn:ue(()=>[J(yl,{"model-value":le.value,disabled:!a.value,pages:G(C),"total-imgs":G(p).length,"onUpdate:modelValue":G(ee).goToPage},null,8,["model-value","disabled","pages","total-imgs","onUpdate:modelValue"])]),key:"3"}:void 0,!e.offlineMode&&e.raw?{name:"entry",fn:ue(()=>[J(ct,{title:e.entryId?"View entry (T)":"Add to library (T)","data-tour":"Prress here to add to your collection",onClick:ne},{default:ue(()=>[e.entryId?(P(),me(Ml,{key:0})):(P(),me(Il,{key:1}))]),_:1},8,["title"])]),key:"4"}:void 0,e.touchDevice?void 0:{name:"full-screen",fn:ue(()=>[J(ct,{title:`${te.value?"Exit":"Enter"} fullscreen (F)`,onClick:U},{default:ue(()=>[te.value?(P(),me(zl,{key:0})):(P(),me(Al,{key:1}))]),_:1},8,["title"])]),key:"5"},G(O)?{name:"play",fn:ue(()=>[J(ct,{"data-tour":"Press here to play like a video",title:`${G(v).isPlaying.value?"Pause":"Play"} (Space)`,disabled:!a.value,onClick:I[12]||(I[12]=()=>G(v).toggle())},{default:ue(()=>[G(v).isPlaying.value?(P(),me(ji,{key:0})):(P(),me(Bi,{key:1}))]),_:1},8,["title","disabled"])]),key:"6"}:void 0,G(N)?{name:"break-first",fn:ue(()=>[J(ct,{title:"Break 1st page (B)","data-tour":"Press here to separate the first page from double-page mode",disabled:!a.value,onClick:I[13]||(I[13]=()=>D.value=!G(D))},{default:ue(()=>[G(D)?(P(),me(Ol,{key:0})):(P(),me($l,{key:1}))]),_:1},8,["disabled"])]),key:"7"}:void 0,e.progressSize!==0&&!X.value?{name:"progress",fn:ue(()=>[J(xl,{value:we.value,total:G(C).length,"long-strip":G(O),height:e.progressSize??2,rtl:G(L)},null,8,["value","total","long-strip","height","rtl"])]),key:"8"}:void 0]),1032,["loading","immediate","full-screen","zooming","idle","space-top","rtl"])):$e("",!0)}}),[["styles",['*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}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-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;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{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-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]:where(:not([hidden=until-found])){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%}.container,svg{width:100%}@media (min-width:300px){.container{max-width:300px}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.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}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\\/2{left:50%}.left-10{left:40px}.left-9{left:36px}.right-0{right:0}.top-0{top:0}.top-1\\/2{top:50%}.top-10{top:40px}.top-9{top:36px}.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-2{margin-bottom:8px}.mb-5{margin-bottom:20px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.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-9{height:36px!important}.h-0{height:0}.h-1{height:4px}.h-1\\/3{height:33.333333%}.h-10{height:40px}.h-12{height:48px}.h-14{height:56px}.h-16{height:64px}.h-2{height:8px}.h-20{height:80px}.h-24{height:96px}.h-28{height:112px}.h-4{height:16px}.h-5{height:20px}.h-7{height:28px}.h-9{height:36px}.h-\\[101\\%\\]{height:101%}.h-full{height:100%}.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-0{width:0}.w-1{width:4px}.w-1\\/3{width:33.333333%}.w-10{width:40px}.w-12{width:48px}.w-14{width:56px}.w-2{width:8px}.w-20{width:80px}.w-24{width:96px}.w-28{width:112px}.w-4{width:16px}.w-40{width:160px}.w-5{width:20px}.w-\\[4\\.8rem\\]{width:76.8px}.w-auto{width:auto}.w-full{width:100%}.w-min{width:-moz-min-content;width:min-content}.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\\.5{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\\.5{--tw-translate-y:-6px}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.translate-y-0{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-0{--tw-translate-y:0px}.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-90{--tw-rotate:-90deg}.-rotate-90,.rotate-180{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-180{--tw-rotate:180deg}.rotate-90{--tw-rotate:90deg}.rotate-90,.scale-95{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-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-y-90{--tw-scale-y:.9}.scale-y-90,.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}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.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-2{gap:8px}.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-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-xl{border-radius:12px}.\\!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-xl{border-top-left-radius:12px;border-top-right-radius:12px}.border-2{border-width:2px}.border-4{border-width:4px}.border-t-\\[1px\\]{border-top-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-stone-400{--tw-border-opacity:1;border-color:rgb(168 162 158/var(--tw-border-opacity,1))}.border-stone-600{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity,1))}.border-textPrimary{--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1))}.border-opacity-30{--tw-border-opacity:.3}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(184 92 56/var(--tw-bg-opacity,1))}.bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.bg-stone-300{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.bg-stone-600{--tw-bg-opacity:1;background-color:rgb(87 83 78/var(--tw-bg-opacity,1))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity,1))}.bg-stone-900{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.bg-textPrimary{--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.\\!bg-opacity-100{--tw-bg-opacity:1!important}.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-0\\.5{padding:2px}.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-2{padding-bottom:8px;padding-top:8px}.pb-12{padding-bottom:48px}.pb-6{padding-bottom:24px}.pb-7{padding-bottom:28px}.pl-1{padding-left:4px}.pr-2{padding-right:8px}.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}.font-normal{font-weight:400}.lowercase{text-transform:lowercase}.leading-none{line-height:1}.text-stone-100{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity,1))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity,1))}.text-stone-800{--tw-text-opacity:1;color:rgb(41 37 36/var(--tw-text-opacity,1))}.text-textPrimary{--tw-text-opacity:1;color:rgb(251 130 82/var(--tw-text-opacity,1))}.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)}.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)}.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,1))}.hover\\:bg-stone-300:hover{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.hover\\:bg-stone-900:hover{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity:.1}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:.5}.hover\\:bg-opacity-80:hover{--tw-bg-opacity:.8}.hover\\:text-stone-100:hover{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}.hover\\:text-stone-400:hover{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity,1))}}.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,1))}.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\\:mb-0{margin-bottom:0}.sm\\:mb-8{margin-bottom:32px}.sm\\:flex{display:flex}.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\\:pb-6{padding-bottom:24px}.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}.lg\\:pb-4{padding-bottom:16px}}@media (min-width:1280px){.xl\\:px-12{padding-left:48px;padding-right:48px}}']]]),th=Object.freeze(Object.defineProperty({__proto__:null,default:Wl},Symbol.toStringTag,{value:"Module"})),nh=Object.freeze(Object.defineProperty({__proto__:null,default:Ce({__name:"IntersectionWrapper",emits:["visible"],setup(e,{emit:t}){const n=t,o=re(null),i=re(!1);return Qe(async()=>{await Pt(),$i(o,r=>{const s=r.some(l=>l.isIntersecting);s!==i.value&&(i.value=s),s&&n("visible")})}),(r,s)=>(P(),W("div",{ref_key:"root",ref:o},[Te(r.$slots,"default",{visible:i.value})],512))}})},Symbol.toStringTag,{value:"Module"})),oh={},ih={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function rh(e,t){return P(),W("svg",ih,[...t[0]||(t[0]=[q("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)])])}const sh=Object.freeze(Object.defineProperty({__proto__:null,default:be(oh,[["render",rh]])},Symbol.toStringTag,{value:"Module"})),lh={},ah={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function ch(e,t){return P(),W("svg",ah,[...t[0]||(t[0]=[q("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)])])}const uh=Object.freeze(Object.defineProperty({__proto__:null,default:be(lh,[["render",ch]])},Symbol.toStringTag,{value:"Module"})),fh="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]),html.gear-second>body~*{visibility:hidden!important}html.gear-second>body~*{display:none!important;height:0!important;left:100%!important;max-height:0!important;max-width:0!important;opacity:0!important;pointer-events:none!important;top:100%!important;width:0!important}.mp-scroll-container{max-height:100vh!important;overflow:hidden!important}html:has(body.mp-scroll-container){overflow:auto!important}",nn="gear-second",Wi={immediate:void 0,raw:void 0,spec:void 0,siteMeta: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,offlineMode:void 0,autoNextSeconds:void 0,defaultGap:void 0,progressSize:void 0,hideControlsEvent:void 0,pinchToZoom:void 0,tapZone:void 0,onError:void 0,onCrash:void 0,onDispose:void 0,onFullScreenChanged:void 0,onPageChanged:void 0,onOpenEntry:void 0,onAddEntry:void 0,onFinished:void 0,onHapticFeedback:void 0,onPressedBack:void 0,onSelectChapter:void 0,onTimeout:void 0,onOpenDefaultPreferences:void 0},ot={promise:void 0,data:ro({...Wi})};async function dh(e){return ot.promise?(ot.data.raw=e.raw,await ot.promise):(ot.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(nn),Object.assign(ot.data,Wi),ot.promise=void 0)},u=nt(p=>{var h;return!n&&((h=e.onPageChanged)==null?void 0:h.call(e,p))},300);Object.assign(ot.data,Wi,e,{immediate:l,onReady(){l||(c(),document.documentElement.classList.add(nn))},onError(){var p,h;a(),o?((p=e.onDispose)==null||p.call(e),(h=e.onError)==null||h.call(e)):f()},onDispose:()=>{var p;a(),(p=e==null?void 0:e.onDispose)==null||p.call(e)},onFullScreenChanged:p=>{var h;ot.data.fullScreen=p,(h=e.onFullScreenChanged)==null||h.call(e,p)},onPageChanged:p=>{ot.data.page=p,!(s>=p)&&(s=p,u(p))},onTourEnabledChanged:p=>{ot.data.tourEnabled=p}}),ph().then(()=>{if(n){f();return}r=document.createElement(nn),l?(document.documentElement.classList.add(nn),document.body.appendChild(r),setTimeout(c)):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(nn),document.body.appendChild(r))},100)});function c(){o||(o=!0,t({updateArgs(p){Object.assign(ot.data,p)},dispose:a}))}function f(){o||t(void 0)}}),await ot.promise)}async function ph(){if(window.customElements.get(nn))return;const e=document.createElement("style"),t=fh;e.appendChild(document.createTextNode(t)),document.head.appendChild(e);const n=hu({styles:[await hh()],data:()=>({readerData:ot.data}),render(){return _s(Wl,this.readerData)}});window.customElements.define(nn,n)}async function hh(){const e=Object.assign({"./App.vue":th,"./components/AutoNext.vue":Uu,"./components/BaseButton.vue":Yu,"./components/BottomSheet.vue":lf,"./components/ButtonDropdown.vue":td,"./components/ButtonIcon.vue":Xu,"./components/ButtonReaderSettings.vue":Af,"./components/ButtonResetZoom.vue":Nf,"./components/ChapterNav.vue":nd,"./components/DirectionToast.vue":ld,"./components/DropdownMenu.vue":Gf,"./components/GesturesContainer.vue":xd,"./components/HelpScreen.vue":ad,"./components/InputPercentage.vue":uf,"./components/InputSelect.vue":pf,"./components/IntersectionWrapper.vue":nh,"./components/LoadingIndicator.vue":Td,"./components/PageNav.vue":cd,"./components/PauseToast.vue":bd,"./components/ProgressBar.vue":wd,"./components/ReaderBody.vue":$d,"./components/ReaderLayout.vue":Rd,"./components/ReaderTour.vue":Nd,"./components/TableField.vue":mf,"./components/icons/IconBack.vue":Wd,"./components/icons/IconBookmarkNew.vue":Zd,"./components/icons/IconBookmarked.vue":Jd,"./components/icons/IconChevronLeft.vue":np,"./components/icons/IconChevronRight.vue":sp,"./components/icons/IconClose.vue":ef,"./components/icons/IconDouble.vue":up,"./components/icons/IconDoubleSkip.vue":hp,"./components/icons/IconExclamationCircle.vue":sh,"./components/icons/IconFullscreen.vue":bp,"./components/icons/IconFullscreenExit.vue":_p,"./components/icons/IconHelp.vue":uh,"./components/icons/IconLoading.vue":Wf,"./components/icons/IconMoreVert.vue":wf,"./components/icons/IconNext.vue":sd,"./components/icons/IconPause.vue":pd,"./components/icons/IconPlay.vue":vd,"./components/icons/IconPlus.vue":Tp,"./components/icons/IconReaderExit.vue":Pp,"./components/icons/IconSettings.vue":kf,"./components/icons/IconTriangle.vue":Zf,"./components/icons/IconZoom.vue":jf}),t=[];for(const n in e){const o=e[n];t.push(o.default.styles)}return t.join("")}return dh});
|
|
20
|
+
**/let xi;const Ss=typeof window<"u"&&window.trustedTypes;if(Ss)try{xi=Ss.createPolicy("vue",{createHTML:e=>e})}catch{}const ks=xi?e=>xi.createHTML(e):e=>e,Kc="http://www.w3.org/2000/svg",Uc="http://www.w3.org/1998/Math/MathML",zt=typeof document<"u"?document:null,Cs=zt&&zt.createElement("template"),qc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?zt.createElementNS(Kc,e):t==="mathml"?zt.createElementNS(Uc,e):n?zt.createElement(e,{is:n}):zt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>zt.createTextNode(e),createComment:e=>zt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>zt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{Cs.innerHTML=ks(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Cs.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ft="transition",Rn="animation",Nn=Symbol("_vtc"),Ts={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Zc=Ee({},Mr,Ts),Eo=(e=>(e.displayName="Transition",e.props=Zc,e))((e,{slots:t})=>_s(Ha,Yc(e),t)),Qt=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},Is=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function Yc(e){const t={};for(const k in e)k in Ts||(t[k]=e[k]);if(e.css===!1)return t;const{name:n="v",type:o,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:u=s,appearToClass:c=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,y=Xc(i),x=y&&y[0],L=y&&y[1],{onBeforeEnter:N,onEnter:Z,onEnterCancelled:O,onLeave:w,onLeaveCancelled:g,onBeforeAppear:S=N,onAppear:D=Z,onAppearCancelled:B=O}=t,C=(k,E,Y,te)=>{k._enterCancelled=te,en(k,E?c:l),en(k,E?u:s),Y&&Y()},H=(k,E)=>{k._isLeaving=!1,en(k,f),en(k,h),en(k,p),E&&E()},X=k=>(E,Y)=>{const te=k?D:Z,K=()=>C(E,k,Y);Qt(te,[E,K]),Ms(()=>{en(E,k?a:r),Lt(E,k?c:l),Is(te)||Es(E,o,x,K)})};return Ee(t,{onBeforeEnter(k){Qt(N,[k]),Lt(k,r),Lt(k,s)},onBeforeAppear(k){Qt(S,[k]),Lt(k,a),Lt(k,u)},onEnter:X(!1),onAppear:X(!0),onLeave(k,E){k._isLeaving=!0;const Y=()=>H(k,E);Lt(k,f),k._enterCancelled?(Lt(k,p),Os(k)):(Os(k),Lt(k,p)),Ms(()=>{k._isLeaving&&(en(k,f),Lt(k,h),Is(w)||Es(k,o,L,Y))}),Qt(w,[k,Y])},onEnterCancelled(k){C(k,!1,void 0,!0),Qt(O,[k])},onAppearCancelled(k){C(k,!0,void 0,!0),Qt(B,[k])},onLeaveCancelled(k){H(k),Qt(g,[k])}})}function Xc(e){if(e==null)return null;if(_e(e))return[_i(e.enter),_i(e.leave)];{const t=_i(e);return[t,t]}}function _i(e){return Ko(e)}function Lt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Nn]||(e[Nn]=new Set)).add(t)}function en(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Nn];n&&(n.delete(t),n.size||(e[Nn]=void 0))}function Ms(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Gc=0;function Es(e,t,n,o){const i=e._endId=++Gc,r=()=>{i===e._endId&&o()};if(n!=null)return setTimeout(r,n);const{type:s,timeout:l,propCount:a}=Jc(e,t);if(!s)return o();const u=s+"end";let c=0;const f=()=>{e.removeEventListener(u,p),r()},p=h=>{h.target===e&&++c>=a&&f()};setTimeout(()=>{c<a&&f()},l+1),e.addEventListener(u,p)}function Jc(e,t){const n=window.getComputedStyle(e),o=y=>(n[y]||"").split(", "),i=o(`${Ft}Delay`),r=o(`${Ft}Duration`),s=Ps(i,r),l=o(`${Rn}Delay`),a=o(`${Rn}Duration`),u=Ps(l,a);let c=null,f=0,p=0;t===Ft?s>0&&(c=Ft,f=s,p=r.length):t===Rn?u>0&&(c=Rn,f=u,p=a.length):(f=Math.max(s,u),c=f>0?s>u?Ft:Rn:null,p=c?c===Ft?r.length:a.length:0);const h=c===Ft&&/\b(?:transform|all)(?:,|$)/.test(o(`${Ft}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:h}}function Ps(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>$s(n)+$s(e[o])))}function $s(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Os(e){return(e?e.ownerDocument:document).body.offsetHeight}function Qc(e,t,n){const o=e[Nn];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Po=Symbol("_vod"),As=Symbol("_vsh"),eu={name:"show",beforeMount(e,{value:t},{transition:n}){e[Po]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Vn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Vn(e,!0),o.enter(e)):o.leave(e,()=>{Vn(e,!1)}):Vn(e,t))},beforeUnmount(e,{value:t}){Vn(e,t)}};function Vn(e,t){e.style.display=t?e[Po]:"none",e[As]=!t}const tu=Symbol(""),nu=/(?:^|;)\s*display\s*:/;function ou(e,t,n){const o=e.style,i=Pe(n);let r=!1;if(n&&!i){if(t)if(Pe(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&$o(o,l,"")}else for(const s in t)n[s]==null&&$o(o,s,"");for(const s in n)s==="display"&&(r=!0),$o(o,s,n[s])}else if(i){if(t!==n){const s=o[tu];s&&(n+=";"+s),o.cssText=n,r=nu.test(n)}}else t&&e.removeAttribute("style");Po in e&&(e[Po]=r?o.display:"",e[As]&&(o.display="none"))}const zs=/\s*!important$/;function $o(e,t,n){if(ie(n))n.forEach(o=>$o(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=iu(e,t);zs.test(n)?e.setProperty(Ye(o),n.replace(zs,""),"important"):e[o]=n}}const Ls=["Webkit","Moz","ms"],Si={};function iu(e,t){const n=Si[t];if(n)return n;let o=Re(t);if(o!=="filter"&&o in e)return Si[t]=o;o=Gn(o);for(let i=0;i<Ls.length;i++){const r=Ls[i]+o;if(r in e)return Si[t]=r}return t}const Ds="http://www.w3.org/1999/xlink";function js(e,t,n,o,i,r=na(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ds,t.slice(6,t.length)):e.setAttributeNS(Ds,t,n):n==null||r&&!Gi(n)?e.removeAttribute(t):e.setAttribute(t,r?"":Tt(n)?String(n):n)}function Bs(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ks(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Gi(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function hn(e,t,n,o){e.addEventListener(t,n,o)}function ru(e,t,n,o){e.removeEventListener(t,n,o)}const Rs=Symbol("_vei");function su(e,t,n,o,i=null){const r=e[Rs]||(e[Rs]={}),s=r[t];if(o&&s)s.value=o;else{const[l,a]=lu(t);if(o){const u=r[t]=uu(o,i);hn(e,l,u,a)}else s&&(ru(e,l,s,a),r[t]=void 0)}}const Ns=/(?:Once|Passive|Capture)$/;function lu(e){let t;if(Ns.test(e)){t={};let o;for(;o=e.match(Ns);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ye(e.slice(2)),t]}let ki=0;const au=Promise.resolve(),cu=()=>ki||(au.then(()=>ki=0),ki=Date.now());function uu(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;mt(fu(o,n.value),t,5,[o])};return n.value=e,n.attached=cu(),n}function fu(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const Vs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,du=(e,t,n,o,i,r)=>{const s=i==="svg";t==="class"?Qc(e,o,s):t==="style"?ou(e,n,o):qn(t)?No(t)||su(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pu(e,t,o,s))?(Bs(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&js(e,t,o,s,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Pe(o))?Bs(e,Re(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),js(e,t,o,s))};function pu(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Vs(t)&&ce(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Vs(t)&&Pe(n)?!1:t in e}const Fs={};function hu(e,t,n){let o=Ce(e,t);Yn(o)&&(o=Ee({},o,t));class i extends Ci{constructor(s){super(o,s,n)}}return i.def=o,i}const gu=typeof HTMLElement<"u"?HTMLElement:class{};class Ci extends gu{constructor(t,n={},o=Ys){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&o!==Ys?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Ee({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof Ci){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,i=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:s}=o;let l;if(r&&!ie(r))for(const a in r){const u=r[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=Ko(this._props[a])),(l||(l=Object.create(null)))[Re(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(s),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)ve(this,o)||Object.defineProperty(this,o,{get:()=>G(n[o])})}_resolveProps(t){const{props:n}=t,o=ie(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&o.includes(i)&&this._setProp(i,this[i]);for(const i of o.map(Re))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(r){this._setProp(i,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Fs;const i=Re(t);n&&this._numberProps&&this._numberProps[i]&&(o=Ko(o)),this._setProp(i,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,i=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Fs?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),i&&this._instance&&this._update(),o)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(Ye(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ye(t),n+""):n||this.removeAttribute(Ye(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),_u(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=J(this._def,Ee(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const i=(r,s)=>{this.dispatchEvent(new CustomEvent(r,Yn(s[0])?Ee({detail:s},s[0]):{detail:s}))};o.emit=(r,...s)=>{i(r,s),Ye(r)!==r&&i(Ye(r),s)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce;for(let i=t.length-1;i>=0;i--){const r=document.createElement("style");o&&r.setAttribute("nonce",o),r.textContent=t[i],this.shadowRoot.prepend(r)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const i=t[o],r=i.getAttribute("name")||"default",s=this._slots[r],l=i.parentNode;if(s)for(const a of s){if(n&&a.nodeType===1){const u=n+"-s",c=document.createTreeWalker(a,1);a.setAttribute(u,"");let f;for(;f=c.nextNode();)f.setAttribute(u,"")}l.insertBefore(a,i)}else for(;i.firstChild;)l.insertBefore(i.firstChild,i);l.removeChild(i)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const i=o.querySelectorAll("slot");for(let r=0;r<i.length;r++)n.add(i[r])}return Array.from(n)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){}}const Hs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?n=>Jn(t,n):t};function mu(e){e.target.composing=!0}function Ws(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ti=Symbol("_assign");function Ks(e,t,n){return t&&(e=e.trim()),n&&(e=Wo(e)),e}const vu={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Ti]=Hs(i);const r=o||i.props&&i.props.type==="number";hn(e,t?"change":"input",s=>{s.target.composing||e[Ti](Ks(e.value,n,r))}),(n||r)&&hn(e,"change",()=>{e.value=Ks(e.value,n,r)}),t||(hn(e,"compositionstart",mu),hn(e,"compositionend",Ws),hn(e,"change",Ws))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Ti]=Hs(s),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?Wo(e.value):e.value,a=t??"";l!==a&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===a)||(e.value=a))}},bu=["ctrl","shift","alt","meta"],yu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>bu.some(n=>e[`${n}Key`]&&!t.includes(n))},We=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(i,...r)=>{for(let s=0;s<t.length;s++){const l=yu[t[s]];if(l&&l(i,t))return}return e(i,...r)})},wu={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Us=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=i=>{if(!("key"in i))return;const r=Ye(i.key);if(t.some(s=>s===r||wu[s]===r))return e(i)})},xu=Ee({patchProp:du},qc);let qs;function Zs(){return qs||(qs=gc(xu))}const _u=(...e)=>{Zs().render(...e)},Ys=(...e)=>{const t=Zs().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=ku(o);if(!i)return;const r=t._component;!ce(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,Su(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function Su(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ku(e){return Pe(e)?document.querySelector(e):e}function Ii(e,t){return qo()?(ia(e,t),!0):!1}const Mi=new WeakMap,Cu=(...e)=>{var t;const n=e[0],o=(t=Jt())===null||t===void 0?void 0:t.proxy,i=o??qo();if(i==null&&!Zr())throw new Error("injectLocal must be called in setup");return i&&Mi.has(i)&&n in Mi.get(i)?Mi.get(i)[n]:At(...e)},Xs=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Tu=e=>e!=null,Iu=Object.prototype.toString,Mu=e=>Iu.call(e)==="[object Object]",tn=()=>{};function Gs(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}function Eu(e,t={}){let n,o,i=tn;const r=a=>{clearTimeout(a),i(),i=tn};let s;return a=>{const u=gt(e),c=gt(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(o&&(r(o),o=void 0),Promise.resolve(a())):new Promise((f,p)=>{i=t.rejectOnCancel?p:f,s=a,c&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,f(s())},c)),n=setTimeout(()=>{o&&r(o),o=void 0,f(a())},u)})}}function Pu(...e){let t=0,n,o=!0,i=tn,r,s,l,a,u;!Oe(e[0])&&typeof e[0]=="object"?{delay:s,trailing:l=!0,leading:a=!0,rejectOnCancel:u=!1}=e[0]:[s,l=!0,a=!0,u=!1]=e;const c=()=>{n&&(clearTimeout(n),n=void 0,i(),i=tn)};return p=>{const h=gt(s),y=Date.now()-t,x=()=>r=p();return c(),h<=0?(t=Date.now(),x()):(y>h?(t=Date.now(),(a||!o)&&x()):l&&(r=new Promise((L,N)=>{i=u?N:L,n=setTimeout(()=>{t=Date.now(),o=!0,L(x()),c()},Math.max(0,h-y))})),!a&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,r)}}function Js(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function Fn(e){return Array.isArray(e)?e:[e]}function $u(e){return Jt()}function nt(e,t=200,n={}){return Gs(Eu(t,n),e)}function Qs(e,t=200,n=!1,o=!0,i=!1){return Gs(Pu(t,n,o,i),e)}function el(e,t=!0,n){$u()?Qe(e,n):t?e():Pt(e)}function Ou(e,t,n){return pe(e,t,{...n,immediate:!0})}const gn=Xs?window:void 0,Au=Xs?window.document:void 0;function kt(e){var t;const n=gt(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function Dt(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,a,u,c)=>(l.addEventListener(a,u,c),()=>l.removeEventListener(a,u,c)),i=Q(()=>{const l=Fn(gt(e[0])).filter(a=>a!=null);return l.every(a=>typeof a!="string")?l:void 0}),r=Ou(()=>{var l,a;return[(l=(a=i.value)===null||a===void 0?void 0:a.map(u=>kt(u)))!==null&&l!==void 0?l:[gn].filter(u=>u!=null),Fn(gt(i.value?e[1]:e[0])),Fn(G(i.value?e[2]:e[1])),gt(i.value?e[3]:e[2])]},([l,a,u,c])=>{if(n(),!(l!=null&&l.length)||!(a!=null&&a.length)||!(u!=null&&u.length))return;const f=Mu(c)?{...c}:c;t.push(...l.flatMap(p=>a.flatMap(h=>u.map(y=>o(p,h,y,f)))))},{flush:"post"}),s=()=>{r(),n()};return Ii(n),s}function zu(){const e=ht(!1),t=Jt();return t&&Qe(()=>{e.value=!0},t),e}function Ei(e){const t=zu();return Q(()=>(t.value,!!e()))}const Lu=Symbol("vueuse-ssr-width");function Du(){const e=Zr()?Cu(Lu,null):null;return typeof e=="number"?e:void 0}function ju(e,t={}){const{window:n=gn,ssrWidth:o=Du()}=t,i=Ei(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),r=ht(typeof o=="number"),s=ht(),l=ht(!1),a=u=>{l.value=u.matches};return ls(()=>{if(r.value){r.value=!i.value,l.value=gt(e).split(",").some(u=>{const c=u.includes("not all"),f=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),p=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let h=!!(f||p);return f&&h&&(h=o>=Js(f[1])),p&&h&&(h=o<=Js(p[1])),c?!h:h});return}i.value&&(s.value=n.matchMedia(gt(e)),l.value=s.value.matches)}),Dt(s,"change",a,{passive:!0}),Q(()=>l.value)}function Pi(e={}){const{document:t=Au}=e;if(!t)return ht("visible");const n=ht(t.visibilityState);return Dt(t,"visibilitychange",()=>{n.value=t.visibilityState},{passive:!0}),n}function Bu(e,t,n={}){const{window:o=gn,...i}=n;let r;const s=Ei(()=>o&&"ResizeObserver"in o),l=()=>{r&&(r.disconnect(),r=void 0)},a=pe(Q(()=>{const c=gt(e);return Array.isArray(c)?c.map(f=>kt(f)):[kt(c)]}),c=>{if(l(),s.value&&o){r=new ResizeObserver(t);for(const f of c)f&&r.observe(f,i)}},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Ii(u),{isSupported:s,stop:u}}function tl(e,t={width:0,height:0},n={}){const{window:o=gn,box:i="content-box"}=n,r=Q(()=>{var f;return(f=kt(e))===null||f===void 0||(f=f.namespaceURI)===null||f===void 0?void 0:f.includes("svg")}),s=ht(t.width),l=ht(t.height),{stop:a}=Bu(e,([f])=>{const p=i==="border-box"?f.borderBoxSize:i==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(o&&r.value){const h=kt(e);if(h){const y=h.getBoundingClientRect();s.value=y.width,l.value=y.height}}else if(p){const h=Fn(p);s.value=h.reduce((y,{inlineSize:x})=>y+x,0),l.value=h.reduce((y,{blockSize:x})=>y+x,0)}else s.value=f.contentRect.width,l.value=f.contentRect.height},n);el(()=>{const f=kt(e);f&&(s.value="offsetWidth"in f?f.offsetWidth:t.width,l.value="offsetHeight"in f?f.offsetHeight:t.height)});const u=pe(()=>kt(e),f=>{s.value=f?t.width:0,l.value=f?t.height:0});function c(){a(),u()}return{width:s,height:l,stop:c}}function $i(e,t,n={}){const{root:o,rootMargin:i="0px",threshold:r=0,window:s=gn,immediate:l=!0}=n,a=Ei(()=>s&&"IntersectionObserver"in s),u=Q(()=>Fn(gt(e)).map(kt).filter(Tu));let c=tn;const f=ht(l),p=a.value?pe(()=>[u.value,kt(o),f.value],([y,x])=>{if(c(),!f.value||!y.length)return;const L=new IntersectionObserver(t,{root:kt(x),rootMargin:i,threshold:r});y.forEach(N=>N&&L.observe(N)),c=()=>{L.disconnect(),c=tn}},{immediate:l,flush:"post"}):tn,h=()=>{c(),p(),f.value=!1};return Ii(h),{isSupported:a,isActive:f,pause(){c(),f.value=!1},resume(){f.value=!0},stop:h}}function Oo(e={}){const{window:t=gn,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:r=!0,type:s="inner"}=e,l=ht(n),a=ht(o),u=()=>{if(t)if(s==="outer")l.value=t.outerWidth,a.value=t.outerHeight;else if(s==="visual"&&t.visualViewport){const{width:f,height:p,scale:h}=t.visualViewport;l.value=Math.round(f*h),a.value=Math.round(p*h)}else r?(l.value=t.innerWidth,a.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,a.value=t.document.documentElement.clientHeight)};u(),el(u);const c={passive:!0};return Dt("resize",u,c),t&&s==="visual"&&t.visualViewport&&Dt(t.visualViewport,"resize",u,c),i&&pe(ju("(orientation: portrait)"),()=>u()),{width:l,height:a}}function Ru(e){On("hapticFeedback",e)}function Oi(){return At("hapticFeedback")}const Nu=(e,t)=>{const n=+(e.getAttribute("data-ripple")??0);if(!n)return;const o=document.createElement("span");let i=1,r=.65;const s=setInterval(a,20);l();function l(){o.style.position="absolute",o.style.height="5px",o.style.width="5px",o.style.borderRadius="100%",o.style.backgroundColor="#f2f2f2",o.style.left=`${t.currentTarget.clientWidth/2}px`,o.style.top=`${t.currentTarget.clientHeight/2}px`,t.currentTarget.appendChild(o)}function a(){const u=+n||50;i<=u?(i++,r-=.65/u,o.style.transform=`scale(${i})`,o.style.opacity=`${r}`):(o.remove(),clearInterval(s))}},mn={mounted:(e,t)=>{e.style.position="relative",e.style.overflow="hidden",e.setAttribute("data-ripple",t.value),e.addEventListener("click",n=>Nu(e,n))},updated:(e,t)=>{e.setAttribute("data-ripple",t.value)}},Vu={class:"inline-flex p-6 gap-6 text-base text-stone-300 select-none"},Fu={key:0,class:"inline-block rounded-full relative w-28 h-12 overflow-hidden"},Hu={class:"absolute bottom-0 left-0 right-0 flex justify-center pb-7 md:pb-6 lg:pb-4"},Wu=Ce({__name:"AutoNext",props:{hasNext:{type:Boolean},offlineMode:{type:Boolean},seconds:{type:Number}},emits:["next","hide"],setup(e,{emit:t}){const n=e,o=t,i=re(null),r=re(null),s=re(!1),l=re(!1),a=re(n.seconds),u=re(n.seconds<=0),c=re(n.seconds),f=Oi();Qe(()=>{let y;$i(r,x=>{l.value=x.some(L=>L.isIntersecting),u.value=n.seconds<=0,a.value=n.seconds,c.value=n.seconds,y&&(clearInterval(y),y=void 0),!(!l.value||u.value)&&(y=setInterval(()=>{a.value-=1,a.value<=0&&(clearInterval(y),y=void 0,o("next"))},1e3))}),$i(i,x=>{s.value=x.some(L=>L.isIntersecting)}),qt(()=>y&&clearInterval(y))});function p(){o("next"),f()}function h(){o("hide")}return(y,x)=>(P(),W("div",{ref_key:"root",ref:i,class:"h-full w-full flex justify-center items-center relative"},[xt(q("div",Vu,[e.hasNext?(P(),W("div",Fu,[l.value?(P(),W("div",{key:0,class:"absolute left-0 top-0 bottom-0 h-full bg-stone-600 bg-opacity-50",style:De(u.value?{}:{animation:`auto-next ${c.value}s linear forwards`})},null,4)):$e("",!0),xt((P(),W("button",{ref_key:"nextButton",ref:r,class:"bg-transparent rounded-full h-full w-full border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:We(p,["stop"])},[pn(Je(u.value?"Next":`Next in ${a.value}`),1)])),[[G(mn)]])])):$e("",!0),xt((P(),W("button",{class:"rounded-full px-6 h-12 bg-transparent border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:We(h,["stop"])},[pn(Je(e.offlineMode?"Close":"Hide"),1)])),[[G(mn)]])],512),[[eu,s.value||!e.hasNext]]),q("div",Hu,[Te(y.$slots,"bottom-center")])],512))}}),Ku=".animate-auto-next{animation:auto-next 5s linear forwards}@keyframes auto-next{0%{width:0}to{width:100%}}",be=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},nl=be(Wu,[["styles",[Ku]]]),Uu=Object.freeze(Object.defineProperty({__proto__:null,default:nl},Symbol.toStringTag,{value:"Module"}));function qu({touchDevice:e}){const t=re(!1);let n=0;return On("busy:touchDevice",e),On("setBusyState",o=>{n+=o?1:-1;const i=n>0;t.value!=i&&(t.value=i)}),t}function Ao(){const e=At("busy:touchDevice"),t=At("setBusyState");let n=!1;return qt(()=>{n&&(t==null||t(!1))}),(o,{desktopOnly:i=!1}={})=>{i&&e||(n=o,t==null||t(o))}}const Zu={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 gap-2 text-base"},Ai=Ce({__name:"BaseButton",props:{disabled:{type:Boolean},href:{type:String},transparent:{type:Boolean},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=Ao(),r=Oi();let s=!1;function l(){s||(s=!0,i(!0,{desktopOnly:!0}))}function a(){s&&(s=!1,i(!1,{desktopOnly:!0}))}function u(c){n.disabled?c.preventDefault():(o("click",c),n.enableHapticFeedback&&r())}return(c,f)=>xt((P(),me(Rr(e.href?"a":"button"),Dn(e.href?{href:e.href}:{},{class:["h-10 max-w-full max-h-full rounded-full flex-shrink-0 focus:outline-none outline-none",{"cursor-default text-stone-400 hover:text-stone-400":e.disabled,"text-stone-100 hover:text-stone-100 group duration-200":!e.disabled,"bg-black bg-opacity-50":!e.transparent}],onClick:We(u,["stop"]),onMouseenter:l,onMouseleave:a}),{default:ue(()=>[q("div",Zu,[Te(c.$slots,"default")])]),_:3},16,["class"])),[[G(mn),e.disabled?0:15]])}}),Yu=Object.freeze(Object.defineProperty({__proto__:null,default:Ai},Symbol.toStringTag,{value:"Module"})),ct=Ce({__name:"ButtonIcon",props:{disabled:{type:Boolean},href:{type:String},transparent:{type:Boolean},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return(o,i)=>(P(),me(Ai,{class:"w-10",disabled:e.disabled,href:e.href,transparent:e.transparent,"enable-haptic-feedback":e.enableHapticFeedback,onClick:i[0]||(i[0]=r=>n("click",r))},{default:ue(()=>[Te(o.$slots,"default")]),_:3},8,["disabled","href","transparent","enable-haptic-feedback"]))}}),Xu=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),Gu={},Ju={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Qu(e,t){return P(),W("svg",Ju,[...t[0]||(t[0]=[q("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)])])}const ol=be(Gu,[["render",Qu]]),ef=Object.freeze(Object.defineProperty({__proto__:null,default:ol},Symbol.toStringTag,{value:"Module"}));class tf{constructor(){ze(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 nf(){const e=new tf;return qt(()=>e.dispose()),On("keyController",e),e}function zo(e){const t=At("keyController");Qe(()=>t.addListener(e)),qt(()=>t.removeListener(e))}const of={class:"flex w-full flex-shrink-0 justify-between items-center h-16 px-3"},rf={class:"font-medium md:text-lg text-ellipsis overflow-hidden whitespace-nowrap px-3 select-text"},sf={class:"overflow-auto px-6 md:px-8 lg:px-10 xl:px-12 pt-3 pb-12 flex-grow scrollbar-sm",style:{"max-height":"calc(100% - 4rem)"}},il=Ce({__name:"BottomSheet",props:Rt({name:{type:String}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=dn(e,"modelValue");zo({onKeyDown:o});const n=Ao();pe(t,i=>n(i));function o(i){t.value&&i.key==="Escape"&&(t.value=!1,i.preventDefault())}return(i,r)=>(P(),W("div",{class:ye(["fixed inset-0 flex flex-col items-center justify-end select-none",{"!pointer-events-none":!t.value}]),onClick:r[4]||(r[4]=()=>t.value=!1)},[J(Eo,{name:"slide","enter-from-class":"opacity-0 translate-y-full","leave-to-class":"opacity-0 translate-y-full"},{default:ue(()=>[t.value?(P(),W("div",{key:0,class:"w-full sm:w-[32rem] max-h-[80vh] bg-stone-900 bg-opacity-90 backdrop-blur-md rounded-t-xl max-w-full overflow-hidden duration-200",onClick:r[1]||(r[1]=We(()=>{},["stop"])),onWheelPassive:r[2]||(r[2]=We(()=>{},["stop"])),onTouchmove:r[3]||(r[3]=We(()=>{},["stop"]))},[q("div",of,[J(ct,{transparent:"",onClick:r[0]||(r[0]=()=>t.value=!1)},{default:ue(()=>[J(ol)]),_:1}),q("div",rf,Je(e.name),1),Te(i.$slots,"actions")]),q("div",sf,[Te(i.$slots,"default")])],32)):$e("",!0)]),_:3})],2))}}),lf=Object.freeze(Object.defineProperty({__proto__:null,default:il},Symbol.toStringTag,{value:"Module"})),af=["min","max","step"],cf={class:"flex-shrink-0 w-12 inline-block text-right"},zi=be(Ce({__name:"InputPercentage",props:Rt({min:{type:Number},max:{type:Number},step:{type:Number},presets:{type:Array},format:{type:Function}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=dn(e,"modelValue"),n=Q({get(){return t.value},set(o){t.value=+o}});return(o,i)=>(P(),W("div",{class:"flex items-center gap-3 pl-1",style:De({"--percentage":`${(n.value-e.min)/(e.max-e.min)*100}%`})},[xt(q("input",{"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),type:"range",min:e.min,max:e.max,step:e.step??1,class:"flex-grow"},null,8,af),[[vu,n.value]]),q("span",cf,Je(e.format(t.value)),1)],4))}}),[["styles",["input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#fb8252 var(--percentage),#5a5552 var(--percentage));border-radius:9999px;border-style:none;cursor:pointer;height:4px;opacity:.9;--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none!important;border-radius:9999px;border-style:solid;border-width:2px;cursor:pointer;height:20px;width:20px;--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));transition-duration:.2s}input[type=range]:hover{opacity:1}"]]]),uf=Object.freeze(Object.defineProperty({__proto__:null,default:zi},Symbol.toStringTag,{value:"Module"})),ff={ref:"root",class:"flex text-sm flex-wrap gap-2 leading-none"},df=["onClick","onKeyup"],Lo=Ce({__name:"InputSelect",props:Rt({items:{type:Array}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=dn(e,"modelValue");function o(i){i!==n.value&&(n.value=i)}return(i,r)=>(P(),W("div",ff,[(P(!0),W(Ie,null,Zt(t.items,(s,l)=>xt((P(),W("div",{key:l,tabindex:"0",class:ye(["inline-flex justify-center items-center rounded-full px-3 py-1.5 cursor-pointer z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-opacity-80 duration-200",{"bg-primary":l==n.value,"bg-stone-600 bg-opacity-50":l!=n.value}]),onClick:()=>o(l),onKeyup:[Us(()=>o(l),["enter"]),Us(()=>o(l),["space"])]},[pn(Je(s),1)],42,df)),[[G(mn),30]])),128))],512))}}),pf=Object.freeze(Object.defineProperty({__proto__:null,default:Lo},Symbol.toStringTag,{value:"Module"})),hf={class:"sm:flex items-center mb-5 sm:mb-8 last:mb-0"},gf={class:"flex-grow"},vn=Ce({__name:"TableField",props:{label:{type:String},disabled:{type:Boolean}},setup(e){return(t,n)=>(P(),W("div",hf,[q("div",{class:ye(["flex-shrink-0 w-[4.8rem] mb-2 sm:mb-0 whitespace-nowrap",{"opacity-50":e.disabled}])},Je(e.label),3),q("div",gf,[Te(t.$slots,"default")])]))}}),mf=Object.freeze(Object.defineProperty({__proto__:null,default:vn},Symbol.toStringTag,{value:"Module"})),vf={},bf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"};function yf(e,t){return P(),W("svg",bf,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M14 8.25a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5m0 8a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M11.75 22a2.25 2.25 0 1 0 4.5 0a2.25 2.25 0 0 0-4.5 0"},null,-1)])])}const rl=be(vf,[["render",yf]]),wf=Object.freeze(Object.defineProperty({__proto__:null,default:rl},Symbol.toStringTag,{value:"Module"})),xf={},_f={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 36 36"};function Sf(e,t){return P(),W("svg",_f,[...t[0]||(t[0]=[q("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),q("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)])])}const sl=be(xf,[["render",Sf]]),kf=Object.freeze(Object.defineProperty({__proto__:null,default:sl},Symbol.toStringTag,{value:"Module"}));function Cf(e){if(e)try{return JSON.parse(e)}catch{return}}function Tf(e){return String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}var ut=(e=>(e[e.vertical=0]="vertical",e[e.ltr=1]="ltr",e[e.rtl=2]="rtl",e))(ut||{}),Ht=(e=>(e[e.longStrip=0]="longStrip",e[e.single=1]="single",e[e.double=2]="double",e))(Ht||{});const ll=.25,al=5,If=.25,Do=.2,jo=5,Mf=.05,Ef=0,Pf=5;function $f(e){var O,w,g,S,D,B;const{titleName:t,isWebtoon:n}=e,o=Q(()=>t.value?Tf(t.value):location.hostname),i=re(Of(`tkr:${o.value}`)),r=C=>{i.value=C;const H=`tkr:${o.value}`;!C||!Object.keys(C).length?localStorage.removeItem(H):localStorage.setItem(H,JSON.stringify(C))},s=C=>{if(!i.value){r(C);return}const H={...i.value};Object.entries(C).forEach(([X,k])=>{k===void 0?delete H[X]:H[X]=k}),r(H)},l=re((O=i.value)==null?void 0:O.style),a=re((w=i.value)==null?void 0:w.direction),u=re((g=i.value)==null?void 0:g.gap),c=re((S=i.value)==null?void 0:S.speed),f=re(((D=i.value)==null?void 0:D.zoom)??1),p=re(((B=i.value)==null?void 0:B.breakFirst)??!1),h=Q({get(){return n.value?Ht.longStrip:l.value??e.defaultStyle.value??Ht.longStrip},set:C=>{if(l.value===C)return;const H=h.value===Ht.longStrip,X=C===Ht.longStrip;l.value=C,s({style:C}),H!==X&&(y.value=X?ut.vertical:ut.rtl)}}),y=Q({get(){return n.value?ut.vertical:a.value??e.defaultDirection.value??ut.vertical},set:C=>{a.value=C,s({direction:C})}}),x=Q({get:()=>u.value??e.defaultGap.value??0,set(C){u.value=C,s({gap:C})}}),L=Q({get:()=>c.value??e.defaultSpeed.value??1,set(C){c.value=C,s({speed:C===1?void 0:C})}}),N=Q({get:()=>f.value,set(C){f.value=C,s({zoom:C===1?void 0:C})}}),Z=Q({get:()=>p.value,set(C){p.value=C,s({breakFirst:C?!0:void 0})}});return{direction:y,style:h,gap:x,speed:L,zoom:N,isLongStrip:Q(()=>h.value===Ht.longStrip),isDouble:Q(()=>h.value===Ht.double),isRTL:Q(()=>y.value===ut.rtl),isVertical:Q(()=>y.value===ut.vertical),breakFirst:Z}}function Of(e){const t=localStorage.getItem(e),n=Cf(t||void 0),o={};return n?(n.style!==void 0&&Object.values(Ht).includes(n.style)&&(o.style=n.style),n.direction!==void 0&&Object.values(ut).includes(n.direction)&&(o.direction=n.direction),n.gap!==void 0&&n.gap>=Ef&&n.gap<=Pf&&(o.gap=n.gap),n.speed!==void 0&&n.speed>=ll&&n.speed<=al&&(o.speed=n.speed),n.zoom!==void 0&&n.zoom>=Do&&n.zoom<=jo&&(o.zoom=n.zoom),n.breakFirst===!0&&(o.breakFirst=!0),Object.keys(o).length?o:void 0):o}const cl=Ce({__name:"ButtonReaderSettings",props:{name:{type:String},direction:{type:Number},readerStyle:{type:Number},gap:{type:Number},speed:{type:Number},zoom:{type:Number},webtoon:{type:Boolean},disabled:{type:Boolean}},emits:["update:reader-style","update:direction","update:gap","update:speed","update:zoom","more"],setup(e,{emit:t}){const n=e,o=t,i=re(!1),r=Q(()=>["Long strip",n.webtoon?void 0:"Single page",n.webtoon?void 0:"Double page"].filter(Boolean)),s=Q(()=>n.name??location.hostname);zo({onKeyUp:u=>{u.key==="s"&&!u.metaKey&&!u.ctrlKey&&(i.value=!i.value)}});function l(u){o("update:zoom",Math.round(u)/100)}function a(){o("more")}return(u,c)=>(P(),W(Ie,null,[J(ct,{title:"Reader preferences (S)",disabled:e.disabled,onClick:c[0]||(c[0]=()=>i.value=!0)},{default:ue(()=>[J(sl)]),_:1},8,["disabled"]),J(il,{modelValue:i.value,"onUpdate:modelValue":c[5]||(c[5]=f=>i.value=f),name:s.value},{actions:ue(()=>[J(ct,{transparent:"",onClick:a},{default:ue(()=>[J(rl)]),_:1})]),default:ue(()=>[J(vn,{label:"Style"},{default:ue(()=>[J(Lo,{"model-value":e.readerStyle,items:r.value,"onUpdate:modelValue":c[1]||(c[1]=f=>o("update:reader-style",f))},null,8,["model-value","items"])]),_:1}),J(vn,{label:"Direction"},{default:ue(()=>[J(Lo,{"model-value":e.direction,items:e.webtoon?["Vertical"]:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":c[2]||(c[2]=f=>o("update:direction",f))},null,8,["model-value","items"])]),_:1}),J(vn,{label:"Gap"},{default:ue(()=>[J(Lo,{"model-value":e.gap,items:["None","1px","2px","3px","4px","5px"],"onUpdate:modelValue":c[3]||(c[3]=f=>o("update:gap",f))},null,8,["model-value"])]),_:1}),J(vn,{label:"Speed"},{default:ue(()=>[J(zi,{"model-value":e.speed,min:G(ll),max:G(al),step:G(If),presets:[1,1.25,1.5,2,2.5,3,4,5].reverse(),format:f=>`${f.toFixed(2)}x`,"onUpdate:modelValue":c[4]||(c[4]=f=>o("update:speed",f))},null,8,["model-value","min","max","step","presets","format"])]),_:1}),J(vn,{label:"Zoom"},{default:ue(()=>[J(zi,{"model-value":Math.ceil(e.zoom*100),min:G(Do)*100,max:G(jo)*100,step:G(Mf)*100,presets:[20,25,50,75,100,125,150,200,250,500].reverse(),format:f=>`${Math.ceil(f)}%`,"onUpdate:modelValue":l},null,8,["model-value","min","max","step","presets","format"])]),_:1})]),_:1},8,["modelValue","name"])],64))}}),Af=Object.freeze(Object.defineProperty({__proto__:null,default:cl},Symbol.toStringTag,{value:"Module"})),zf={},Lf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"};function Df(e,t){return P(),W("svg",Lf,[...t[0]||(t[0]=[q("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[q("circle",{cx:"14",cy:"14",r:"12"}),q("path",{d:"m23 23l7 7M9 12V9h3m4 0h3v3M9 16v3h3m7-3v3h-3"})],-1)])])}const ul=be(zf,[["render",Df]]),jf=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"})),Bf={class:"block w-4 h-4"},Rf={class:"w-12"},fl=Ce({__name:"ButtonResetZoom",props:{zoom:{type:Number}},emits:["click"],setup(e,{emit:t}){const n=t;function o(i){n("click",i)}return(i,r)=>(P(),W("button",{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",onClick:We(o,["stop"])},[q("div",Bf,[J(ul)]),q("div",Rf,Je(Math.ceil(e.zoom*100))+"%",1)]))}}),Nf=Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"}));async function bn(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 bn(e-1,t,n);i(r)},t)})}const Vf={},Ff={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Hf(e,t){return P(),W("svg",Ff,[...t[0]||(t[0]=[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)])])}const dl=be(Vf,[["render",Hf]]),Wf=Object.freeze(Object.defineProperty({__proto__:null,default:dl},Symbol.toStringTag,{value:"Module"})),Kf={},Uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function qf(e,t){return P(),W("svg",Uf,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"},null,-1)])])}const pl=be(Kf,[["render",qf]]),Zf=Object.freeze(Object.defineProperty({__proto__:null,default:pl},Symbol.toStringTag,{value:"Module"})),Yf=["aria-hidden"],Xf=["onClick"],hl=Ce({__name:"DropdownMenu",props:Rt({items:{type:Array},enableHapticFeedback:{type:Boolean}},{modelValue:{type:Number,required:!1},modelModifiers:{}}),emits:Rt(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=dn(e,"modelValue"),r=re(null),s=re(!1),l=re(!1),a=re(!1),u=re(!1),c={mounted:w=>{var g;i.value&&((g=w.children[i.value])==null||g.scrollIntoView({behavior:"auto",block:"center",inline:"center"}))}};zo({onKeyDown:L});const f=Ao(),p=Oi();async function h(w){s.value=w??!s.value,f(s.value),s.value?(y(),Z(r.value)):setTimeout(O,250)}function y(){const w=r.value;if(w){const g=w.getBoundingClientRect(),S=g.x+g.width/2;l.value=g.y>window.innerHeight/2,a.value=S<window.innerWidth/3,u.value=S>window.innerWidth/3*2}}function x(w,g){h(),w!=i.value&&(i.value=w,o("select",w,g),n.enableHapticFeedback&&p())}function L(w){s.value&&w.key==="Escape"&&(h(),w.preventDefault())}let N=[];function Z(w){const g=window.getComputedStyle(w).zIndex,S=w.style.zIndex;(!g||!(+g>0))&&((!w.parentElement||w.parentElement.childElementCount>1)&&(w.style.zIndex="1",N.push({el:w,zIndex:S})),w.parentElement&&Z(w.parentElement))}function O(){N.forEach(({el:w,zIndex:g})=>{w.style.zIndex=g??""}),N=[]}return(w,g)=>(P(),W("div",{ref_key:"root",ref:r,class:"select-none relative inline-flex"},[s.value?(P(),W("div",{key:0,class:"fixed inset-0 bg-transparent",onClick:g[0]||(g[0]=()=>h())})):$e("",!0),e.items.length?(P(),me(Eo,{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:ue(()=>[s.value?xt((P(),W("ul",{key:0,ref:"list","aria-hidden":!s.value,class:ye(["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":l.value,"origin-top top-full translate-y-1.5":!l.value,"left-1/2 -ml-20 text-center":!a.value&&!u.value,"right-0 text-right":u.value}]),onWheelPassive:g[1]||(g[1]=We(()=>{},["stop"])),onTouchmove:g[2]||(g[2]=We(()=>{},["stop"]))},[(P(!0),W(Ie,null,Zt(e.items,(S,D)=>xt((P(),W("li",{key:D,tabindex:"-1",class:ye(["h-10 px-4 last:border-b-transparent cursor-pointer hover:bg-stone-100 hover:bg-opacity-10 duration-100",{"text-textPrimary":D===i.value}]),onClick:B=>x(D,B)},[q("div",{class:ye(["h-full py-2",{"border-t-[1px] border-solid border-stone-400 border-opacity-30":D>0}])},[Te(w.$slots,"item",{item:S},()=>[pn(Je(S),1)])],2)],10,Xf)),[[G(mn),30]])),128))],42,Yf)),[[c]]):$e("",!0)]),_:3})):$e("",!0),Te(w.$slots,"default",{toggle:h,isOpen:s.value,isAlignTop:l.value})],512))}}),Gf=Object.freeze(Object.defineProperty({__proto__:null,default:hl},Symbol.toStringTag,{value:"Module"})),Jf=["onClick"],Qf={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"},ed={class:"whitespace-nowrap"},Li=Ce({__name:"ButtonDropdown",props:Rt({label:{type:String},title:{type:String},items:{type:Array},disabled:{type:Boolean},canLoadItems:{type:Boolean},loadItems:{type:Function},enableHapticFeedback:{type:Boolean}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:Rt(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=dn(e,"modelValue"),r=re(!1),s=Ao();async function l(p,h){if(!n.items.length&&(p||await a(),!n.items.length)){h(!1);return}h()}async function a(){r.value||n.items.length||!n.canLoadItems||!n.loadItems||(r.value=!0,await n.loadItems(),r.value=!1)}let u=!1;function c(){u||(u=!0,s(!0,{desktopOnly:!0}))}function f(){u&&(u=!1,s(!1,{desktopOnly:!0}))}return(p,h)=>(P(),me(hl,{modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=y=>i.value=y),items:e.items,"enable-haptic-feedback":e.enableHapticFeedback,onSelect:h[1]||(h[1]=(y,x)=>o("select",y,x))},bo({default:ue(({toggle:y,isOpen:x,isAlignTop:L})=>[xt((P(),W("button",Dn({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":e.disabled||r.value}]},e.title?{title:e.title}:{},{onClick:We(()=>l(x,y),["stop"]),onMouseenter:c,onMouseleave:f}),[q("div",Qf,[q("span",ed,Je(e.label),1),e.items.length||e.canLoadItems?(P(),W("span",{key:0,class:ye(["w-4 h-4 flex ml-1 -mr-3 flex-shrink-0",{"rotate-180":L}]),"aria-hidden":"true"},[r.value?(P(),me(dl,{key:0})):(P(),me(pl,{key:1}))],2)):$e("",!0)])],16,Jf)),[[G(mn),30]])]),_:2},[p.$slots.item?{name:"item",fn:ue(({item:y})=>[Te(p.$slots,"item",{item:y})]),key:"0"}:void 0]),1032,["modelValue","items","enable-haptic-feedback"]))}}),td=Object.freeze(Object.defineProperty({__proto__:null,default:Li},Symbol.toStringTag,{value:"Module"})),gl=Ce({__name:"ChapterNav",props:{data:{type:Object},chapterSpec:{type:Object},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:u,sel:c,label:f}=a;if(u&&(!c||!f)){await r(u);return}o("getHiddenChapters"),await bn(50,50,()=>n.data.chapters.length?!0:void 0)}async function r(a){const u=document.querySelector(a);u&&(u instanceof HTMLDialogElement?u.showModal():u.click(),o("chaptersDialogOpen"))}function s(a,u){var c,f,p;(p=(f=(c=n.data)==null?void 0:c.chapters)==null?void 0:f[a])==null||p.select(l(u))}function l(a){return!n.touchDevice&&(a.ctrlKey||a.metaKey)}return(a,u)=>{var c;return P(),me(Li,{modelValue:e.data.activeIndex,label:e.data.activeLabel,title:"Select chapter",items:e.data.chapters,"can-load-items":!!((c=e.chapterSpec)!=null&&c.trigger),"load-items":i,"enable-haptic-feedback":"",onSelect:s},{item:ue(({item:f})=>[pn(Je(f.label),1)]),_:1},8,["modelValue","label","items","can-load-items"])}}}),nd=Object.freeze(Object.defineProperty({__proto__:null,default:gl},Symbol.toStringTag,{value:"Module"})),od={},id={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function rd(e,t){return P(),W("svg",id,[...t[0]||(t[0]=[q("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)])])}const Hn=be(od,[["render",rd]]),sd=Object.freeze(Object.defineProperty({__proto__:null,default:Hn},Symbol.toStringTag,{value:"Module"}));var Di=(e=>(e[e.none=0]="none",e[e.lShape=1]="lShape",e[e.kindleIsh=2]="kindleIsh",e[e.edge=3]="edge",e[e.rightAndLeft=4]="rightAndLeft",e))(Di||{});const ml={0:{prevZones:[],nextZones:[]},1:{prevZones:[0,1,2,3],nextZones:[8,7,6,5]},2:{prevZones:[6,3],nextZones:[8,7,5,4]},3:{prevZones:[7],nextZones:[5,0,2,3,6,8]},4:{prevZones:[3,0,6],nextZones:[5,2,8]}},vl=Ce({__name:"DirectionToast",props:{direction:{type:Number},tapZone:{type:Number}},setup(e){const t=e,n=sessionStorage.getItem("tk:dir"),o=re(typeof n!="string"||+n!==t.direction),i=nt(()=>o.value=!1,1500),{width:r,height:s}=Oo(),l=Q(()=>Math.min(1.25,Math.max(.75,Math.round(r.value/s.value*100)/100))),a=Q(()=>l.value>=1),u=Q(()=>t.direction===ut.vertical),c=Q(()=>t.direction===ut.rtl),f=Q(()=>{if(!t.tapZone)return;const{prevZones:h,nextZones:y}=ml[t.tapZone];return Array.from({length:9},(x,L)=>{const N=h.includes(L),Z=!N&&y.includes(L);return{isPrev:N,isNext:Z,hasArrow:L===h[0]||L===y[0]}})});pe(()=>t.direction,()=>{p(),o.value=!0,i()}),Qe(()=>{p(),i();let h;pe(Pi(),x=>{x!=="visible"?h=Date.now():Date.now()-h>7e3&&(o.value=!0,i())})});function p(){sessionStorage.setItem("tk:dir",t.direction+"")}return(h,y)=>(P(),me(Eo,{name:"slow-fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ue(()=>[o.value?(P(),W("div",{key:0,class:ye(["fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none p-2 bg-black bg-opacity-40 rounded-2xl",{"w-28":a.value,"h-28":!a.value}]),style:De({"aspect-ratio":l.value})},[e.tapZone===G(Di).none?(P(),W("div",{key:0,class:ye(["inline-block absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-14 h-14",{"rotate-90":e.direction===G(ut).vertical,"rotate-180":e.direction===G(ut).rtl}])},[J(Hn)],2)):f.value?(P(),W("div",{key:2,class:ye(["w-full h-full overflow-hidden rounded-xl flex flex-wrap",{"flex-row-reverse":c.value}])},[(P(!0),W(Ie,null,Zt(f.value,(x,L)=>(P(),W("div",{key:`zone-${L}`,class:ye(["w-1/3 h-1/3 flex justify-center items-center p-0.5",{"bg-stone-100":x.isPrev||x.isNext,"bg-opacity-50":x.isPrev}])},[x.hasArrow?(P(),W("span",{key:0,class:ye(["w-full inline-block transform text-stone-800",{"rotate-180":c.value?x.isNext:x.isPrev}])},[J(Hn)],2)):$e("",!0)],2))),128))],2)):(P(),W("div",{key:1,class:ye(["w-full h-full overflow-hidden rounded-xl flex flex-nowrap",{"flex-col":u.value}])},[q("div",{class:ye(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":!c.value}])},[q("span",{class:ye(["w-4 h-4 inline-block transform text-stone-800",{"-rotate-90":u.value,"rotate-180":!u.value}])},[J(Hn)],2)],2),y[0]||(y[0]=q("div",{class:"flex-grow w-full h-full"},null,-1)),y[1]||(y[1]=q("div",{class:"flex-grow w-full h-full"},null,-1)),q("div",{class:ye(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":c.value}])},[q("span",{class:ye(["w-4 h-4 inline-block text-stone-800",{"transform rotate-90":u.value}])},[J(Hn)],2)],2)],2))],6)):$e("",!0)]),_:1}))}}),ld=Object.freeze(Object.defineProperty({__proto__:null,default:vl},Symbol.toStringTag,{value:"Module"})),bl=Ce({__name:"HelpScreen",props:{touchDevice:{type:Boolean}},emits:["hide"],setup(e,{emit:t}){const n=e,o=t,i=re(null),r=re([]);Qe(async()=>{const u=tl(i),c=nt(()=>{s({width:u.width.value,height:u.height.value})},50);c(),pe(u.width,c),pe(u.height,c)});function s(u){var p;const c=(p=i.value)==null?void 0:p.parentElement;if(!c)return;const f=Array.from(c.querySelectorAll("#controls [title]"));f.length&&(r.value=l(f,u))}function l(u,c){const f=[],p=[];let h=0,y=0;const x=50,L=25;u.forEach(g=>{var H;const S=(H=g.getAttribute("title"))==null?void 0:H.trim(),D=g.getBoundingClientRect();if(!S||!D.height||!D.width)return;const B=Math.ceil((D.top-10)/x),C=Math.ceil((D.left-10)/x);p.push({isTour:!1,title:S,rect:D,fromX:C,toX:Math.max(C+1,Math.ceil((D.right+10)/x)),fromY:B,toY:Math.max(B+1,Math.ceil((D.bottom+10)/x))})}),p.forEach(g=>{for(let S=g.fromY;S<g.toY;S++){f[S]??(f[S]=[]);for(let D=g.fromX;D<g.toX;D++)f[S][D]=g;g.toY>h+1&&(h=g.toY-1),g.toX>y+1&&(y=g.toX-1)}});let N=y/2;p.forEach(g=>{g.isAlignRight=g.fromX>N});const Z=(g,S)=>{f[S]??(f[S]=[]);const D=S>=g.toY;if(g.isTour)for(let B=g.fromX;B<g.toX;B++)delete f[g.fromY][B],g.fromY=S,g.toY=S+(D?1:-1),f[S][B]=g;else{const B=g.isAlignRight?g.fromX-3:g.fromX,C=B+3;g.helpItem={fromX:B,toX:C,fromY:S,toY:S+1,isTour:!0,isAlignRight:g.isAlignRight};for(let H=B;H<C;H++)f[S][H]=g.helpItem}},O=(g,S)=>{if(S>h||S<0)return!1;const D=S>=g.toY,B=f[S];if(!B)return Z(g,S),!0;const C=B[g.fromX];if(C&&!C.isTour)return!1;if(C&&C.isTour)return O(C,D?S+1:S-1)?(Z(g,S),!0):!1;if(!C){const H=g.isAlignRight?-1:1;return B[g.fromX+H]||B[g.fromX+H*2]?O(g,D?S+1:S-1):(Z(g,S),!0)}return!1};p.forEach(g=>{if(!O(g,g.toY)){if(g.isAlignRight){const S=f[g.fromY]??[];if(!S.slice(g.fromX-3,g.fromX).filter(Boolean).length){const B=g.fromX-3,C=g.fromX;g.helpItem={isTour:!0,isAlignRight:!0,fromX:B,toX:C,fromY:g.fromY,toY:g.toY};for(let H=g.fromX-3;H<g.fromX;H++)S[H]=g.helpItem;return}}O(g,g.fromY-1)}});const w=[];return p.forEach(g=>{const{title:S,helpItem:D,rect:B,isAlignRight:C,fromX:H,fromY:X,toY:k}=g;if(!S||!D||!B)return;const E=D.fromY>=k,Y=D.toY<=X;w.push({title:a(S),style:{top:E?`${B.bottom+(D.fromY-k)*x+L}px`:Y?void 0:`${B.top+8}px`,bottom:Y?`${c.height-B.top+(D.toY-X)*x+L}px`:void 0,left:C?void 0:`${B.left}px`,right:C?E?`${c.width-B.right}px`:`${c.width-B.right+B.width+L}px`:void 0},arrowStyle:{width:Y||E?"2px":`${Math.abs(D.toX-H)*x+L-5}px`,height:Y||E?`${(E?D.fromY-k:X-D.toY)*x+L}px`:"2px",top:E?`${B.bottom}px`:Y?void 0:`${B.top+20}px`,bottom:Y?`${c.height-B.top}px`:void 0,left:C?void 0:`${B.left+B.width/2}px`,right:C?E?`${c.width-B.right+B.width/2}px`:`${c.width-B.right+B.width}px`:void 0}})}),w}function a(u){return n.touchDevice?u.split("(")[0].trim():u}return(u,c)=>(P(),W(Ie,null,[c[1]||(c[1]=q("div",{class:"fixed inset-0 bg-black bg-opacity-90"},null,-1)),q("div",{ref_key:"root",ref:i,class:"fixed inset-0 z-20 overscroll-contain select-none",onClick:c[0]||(c[0]=We(f=>o("hide"),["stop"]))},[(P(!0),W(Ie,null,Zt(r.value,f=>(P(),W(Ie,{key:f.title},[q("div",{class:"absolute",style:De(f.style)},Je(f.title),5),q("div",{class:"absolute bg-stone-300 rounded-lg",style:De(f.arrowStyle)},null,4)],64))),128))],512)],64))}}),ad=Object.freeze(Object.defineProperty({__proto__:null,default:bl},Symbol.toStringTag,{value:"Module"})),yl=Ce({__name:"PageNav",props:Rt({disabled:{type:Boolean},pages:{type:Array},totalImgs:{type:Number}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=dn(e,"modelValue"),o=Q(()=>t.pages.map(a=>a.map(({index:u})=>`${u+1}`).join("-"))),i=Q(()=>{const a=n.value,u=t.pages.findIndex(c=>c.some(({index:f})=>f===a));return u===-1?t.pages.length-1:u}),r=Q(()=>t.pages.length?`${o.value[i.value]}/${t.totalImgs}`:"--");function s(a){const u=t.pages[a][0].index;l(u)}function l(a){n.value=a}return(a,u)=>(P(),me(Li,{"model-value":i.value,label:r.value,title:"Current page",items:o.value,disabled:e.disabled,"onUpdate:modelValue":s},null,8,["model-value","label","items","disabled"]))}}),cd=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"})),ud={},fd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function dd(e,t){return P(),W("svg",fd,[...t[0]||(t[0]=[q("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),q("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)])])}const ji=be(ud,[["render",dd]]),pd=Object.freeze(Object.defineProperty({__proto__:null,default:ji},Symbol.toStringTag,{value:"Module"})),hd={},gd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function md(e,t){return P(),W("svg",gd,[...t[0]||(t[0]=[q("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)])])}const Bi=be(hd,[["render",md]]),vd=Object.freeze(Object.defineProperty({__proto__:null,default:Bi},Symbol.toStringTag,{value:"Module"})),wl=be(Ce({__name:"PauseToast",props:{playing:{type:Boolean}},setup(e){const t=e,n=re(0);return pe(()=>t.playing,()=>{n.value=Date.now()}),(o,i)=>n.value?(P(),W("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"},[e.playing?(P(),me(Bi,{key:0})):(P(),me(ji,{key:1}))])):$e("",!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)}}"]]]),bd=Object.freeze(Object.defineProperty({__proto__:null,default:wl},Symbol.toStringTag,{value:"Module"})),yd=30,xl=be(Ce({__name:"ProgressBar",props:{value:{type:Number},total:{type:Number},longStrip:{type:Boolean},height:{type:Number},rtl:{type:Boolean}},setup(e){const t=e,n=Q(()=>Math.floor(t.value)+1),o=Q(()=>`${Math.max(2,Math.min(10,t.height))}px`),i=Oo().width,r=Q(()=>i.value/t.total>=yd);return(s,l)=>(P(),W("div",{class:ye(["rprog",{"rprog--rtl":e.rtl}]),style:De({height:o.value})},[r.value?(P(!0),W(Ie,{key:0},Zt(e.total,a=>(P(),W("span",{key:a,class:ye(["rprog__item",{"rprog__item--active":n.value===a}]),style:De(!e.longStrip||n.value!==a?{}:{"--portion":`${e.value%1*100}%`})},null,6))),128)):(P(),W("div",{key:1,style:De({width:`${e.value/e.total*100}%`}),class:"h-full bg-textPrimary bg-opacity-80"},null,4))],6))}}),[["styles",['.rprog{--portion:100%;display:flex;width:100%}.rprog--rtl,.rprog--rtl .rprog__item{flex-direction:row-reverse}.rprog__item{display:inline-flex;flex-grow:1;flex-shrink:0;height:100%}.rprog__item:first-child:before{display:none}.rprog__item--active:before,.rprog__item:has(~.rprog__item--active):before{background-color:rgb(0 0 0/var(--tw-bg-opacity,1));content:"";display:block;flex-shrink:0;height:100%;width:1px;--tw-bg-opacity:.25}.rprog__item--active:after,.rprog__item:has(~.rprog__item--active):after{background-color:rgb(251 130 82/var(--tw-bg-opacity,1));content:"";display:block;height:100%;--tw-bg-opacity:.8;width:var(--portion)}']]]),wd=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"})),_l=Ce({__name:"GesturesContainer",props:{spaceTop:{type:Number},fullScreen:{type:Boolean},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},pageIndex:{type:Number},playController:{type:Object},rtl:{type:Boolean},horizontal:{type:Boolean},longStrip:{type:Boolean},touchDevice:{type:Boolean},busy:{type:Boolean}},emits:["update:zoom","update:zooming","dragEnd","click","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=re(null),s=re(Math.min(jo,Math.max(Do,o.zoom))),l=re(!1),a=re(!1),u={isZoomIn:!1,isZoomOut:!1,initial:void 0};t({rootEl:r}),pe(()=>o.zoom,v=>K(v)),Qe(()=>{o.touchDevice?Dt(r,"touchstart",N):(Dt(r,"mousedown",h),Dt(window,"wheel",D))}),zo({onKeyDown:v=>{var b;if(!o.busy&&((b=r.value)==null||b.focus(),!(v.key==="Meta"||v.key==="Control")&&(v.ctrlKey||v.metaKey)))switch(v.key){case"0":K(1);break;case"-":K(s.value-.2),v.preventDefault();break;case"=":case"+":K(s.value+.2),v.preventDefault();break}},onKeyUp:v=>{o.zooming&&!(v.ctrlKey||v.metaKey)&&E()}});function c(v){a.value!==v&&(a.value=v,v?o.playController.pause():(i("dragEnd"),o.playController.resume()))}let f={x:0,y:0},p={x:0,y:0};function h(v){if(v.button!==0)return;const b=r.value;b&&(f={x:v.clientX,y:v.clientY},p={x:b.scrollLeft,y:b.scrollTop},window.addEventListener("mousemove",y),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",y),setTimeout(()=>c(!1))},{once:!0}),v.preventDefault(),v.stopPropagation())}function y(v){const b=v.clientX-f.x,j=v.clientY-f.y;if(!a.value&&Math.abs(b)<.5&&Math.abs(j)<.5)return;c(!0);const ee=r.value;ee&&(ee.scrollLeft=p.x-b,ee.scrollTop=p.y-j)}let x={distance:0,zoom:s.value,x:0,y:0},L=!1;function N(v){o.busy||(L=o.pinchToZoome&&v.touches.length===2,L&&(i("update:zooming",!0),c(!0),v.stopPropagation(),v.preventDefault(),x={distance:B(v),zoom:s.value,x:(v.touches[0].clientX+v.touches[1].clientX)/2,y:(v.touches[0].clientY+v.touches[1].clientY)/2}),(L||o.longStrip&&o.playController.isPlaying.value)&&window.addEventListener("touchend",Z,{once:!0}))}function Z(){var ee;if(L=!1,o.zooming){c(!1),E();return}if(!a.value)return;const v=nt(()=>{var le;c(!1),(le=r.value)==null||le.removeEventListener("scroll",j)},200),b=setTimeout(v,200);(ee=r.value)==null||ee.addEventListener("scroll",j);function j(){clearTimeout(b),v()}}function O(v){if(!L&&!(o.longStrip&&o.playController.isPlaying.value)||(c(!0),!o.zooming)||(v.stopPropagation(),v.preventDefault(),v.touches.length<2))return;const j=B(v)/x.distance;te(Math.ceil(j*x.zoom*100)/100,x)}const w=nt(()=>l.value=!1,100);let g=!1;const S=nt(()=>{g=!1},30);function D(v){if(o.busy)return;let b=o.zooming;if(g||(g=!0,b=v.ctrlKey||v.metaKey,b&&i("update:zooming",!0)),S(),b){v.stopPropagation(),v.preventDefault();const j=Math.ceil((s.value+v.deltaY*-.01)*100)/100;te(j,{x:v.clientX,y:v.clientY});return}o.horizontal&&(l.value||(l.value=!0),w(),v.deltaY&&(r.value&&(r.value.scrollLeft+=v.deltaY*(o.rtl?-1:1)),v.stopPropagation()))}function B(v){return Math.hypot(v.touches[0].clientX-v.touches[1].clientX,v.touches[0].clientY-v.touches[1].clientY)}const C={x:0,y:0,ts:0};function H(v){if(a.value||o.zooming)return;const b=r.value;if(!b||X(b,v)||(i("click"),o.playController.isPlaying.value))return;const{clientX:j,clientY:ee}=v,{x:le,y:we,ts:ke}=C;C.x=j,C.y=ee,C.ts=new Date().getTime();const xe=C.ts-ke;xe>250||xe<10||Math.abs(le-j)>40||Math.abs(we-ee)>40||(C.ts=0,C.x=0,C.y=0,k(j,ee))}function X(v,b){if(o.playController.isPlaying.value)return!1;const j=o.tapZone;if(j===Di.none)return!1;const ee=o.fullScreen?0:o.spaceTop,le=v.clientHeight-ee,we=Math.max(0,b.clientY-ee),ke=o.horizontal?v.clientWidth:le;let xe=!1,Le=!1;if(j){const{prevZones:Ae,nextZones:Ke}=ml[o.tapZone],it=Math.floor(we/le*3);let ft=Math.floor(b.clientX/v.clientWidth*3);o.rtl&&(ft=2-ft);const Me=it*3+ft;xe=Ae.includes(Me),Le=!xe&&Ke.includes(Me)}else{const Ke=(o.horizontal?o.rtl?ke-b.clientX:b.clientX:we)/ke,it=o.horizontal?.2:.15;xe=Ke<=it&&o.pageIndex>0,Le=!xe&&Ke>=1-it}if(!xe&&!Le)return!1;if(o.longStrip){const Ae=(xe?-1:1)*.75*ke;o.horizontal?v.scrollLeft=v.scrollLeft+(o.rtl?-1:1)*Ae:v.scrollTop=Math.max(0,v.scrollTop+Ae)}else xe?i("prev"):Le&&i("next");return!0}async function k(v,b){const j=s.value===1?2:1;await K(j,{x:v,y:b}),E()}function E(){i("update:zooming",!1),u.initial=void 0,u.isZoomIn=!1,u.isZoomOut=!1}function Y(){if(u.initial)return;const v=r.value;if(!v)return;const b=v.querySelector(`[data-index="${o.pageIndex}"],[data-index2="${o.pageIndex}"]`)??void 0;b&&(u.initial={el:b,rect:b.getBoundingClientRect()})}function te(v,b){if(u.isZoomIn=u.isZoomIn||!u.isZoomOut&&v>1,u.isZoomIn&&v<1){K(1,b);return}if(u.isZoomOut=u.isZoomOut||!u.isZoomIn&&v<1,u.isZoomOut&&v>1){K(1,b);return}K(v,b)}async function K(v,b){const j=r.value,ee=Math.min(jo,Math.max(Do,v));if(!j||s.value===ee)return;Y();const{initial:le}=u;if(!le)return;const we=(b==null?void 0:b.x)??j.clientWidth/2,ke=(b==null?void 0:b.y)??j.clientHeight/2;s.value=ee,i("update:zoom",ee),await Pt();const{el:xe,rect:Le}=le,Ae=xe.offsetWidth/Le.width,Ke=xe.offsetHeight/Le.height;j.scrollLeft=xe.offsetLeft-Le.left*Ae+we*(Ae-1),j.scrollTop=xe.offsetTop-Le.top*Ke+ke*(Ke-1)}return(v,b)=>(P(),W("div",{ref_key:"rootEl",ref:r,tabindex:"0",class:ye(["w-full h-full overflow-auto scrollbar-none overscroll-contain scrollbar-none focus:outline-none touch-pan-x touch-pan-y",{"!snap-none":!e.longStrip&&(a.value||l.value||e.zooming),"cursor-grabbing":!e.touchDevice&&a.value,"overflow-hidden":e.zooming}]),style:De({"font-size":`${s.value}px`}),onClick:We(H,["stop"]),onTouchmoveCapture:We(O,["stop"])},[Te(v.$slots,"default")],38))}}),xd=Object.freeze(Object.defineProperty({__proto__:null,default:_l},Symbol.toStringTag,{value:"Module"})),_d='.loading-indicator{display:inline-block;height:80px;position:relative;width:80px}.loading-indicator:after,.loading-indicator:before{border-radius:9999px;border-style:solid;border-width:4px;box-sizing:border-box;display:block;position:absolute;--tw-border-opacity:1;animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border-color:rgb(184 92 56/var(--tw-border-opacity,1));content:"";opacity:1}.loading-indicator:after{animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:40px;opacity:0;top:40px;width:0}4.9%{height:8px;left:36px;opacity:0;top:36px;width:8px}5%{height:8px;left:36px;opacity:1;top:36px;width:8px}to{height:80px;left:0;opacity:0;top:0;width:80px}}',Sd={},kd={class:"loading-indicator"};function Cd(e,t){return P(),W("div",kd)}const Ri=be(Sd,[["render",Cd],["styles",[_d]]]),Td=Object.freeze(Object.defineProperty({__proto__:null,default:Ri},Symbol.toStringTag,{value:"Module"}));function Ni(e,t){return(e==null?void 0:e.querySelector(`[data-index="${t}"],[data-index2="${t}"]`))??void 0}const Id=["data-index"],Md={key:0,class:"img img--loading"},Ed=["src"],Pd=["data-index"],Sl=be(Ce({__name:"ReaderBody",props:{page:{type:Number},pageIndex:{type:Number},direction:{type:Number},isLongStrip:{type:Boolean},isVertical:{type:Boolean},isDouble:{type:Boolean},isRTL:{type:Boolean},pages:{type:Array},totalImgs:{type:Number},gap:{type:Number},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},playController:{type:Object},busy:{type:Boolean},fullScreen:{type:Boolean}},emits:["ready","update:zoom","update:zooming","update:playing","dragEnd","click","end","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=re(null),s=Q(()=>{var O;return(O=r.value)==null?void 0:O.rootEl});t({rootEl:s});const l=Oo(),a=Q(()=>{const{width:O,height:w}=l,g=o.isLongStrip?o.isVertical?O.value:w.value:Math.min(O.value,w.value);return Math.min(4,Math.max(1,Math.ceil(g/400-1)))*o.gap}),u=re(o.isLongStrip?{min:o.pageIndex-1,max:o.pageIndex}:x()),c=Q(()=>{const{min:O,max:w}=u.value,g={};for(let S=O;S<=w;S++)g[S]=!0;return g}),f=re(h()),p=Z(()=>{f.value=h()},100);pe(l.width,p),pe(l.height,p),pe(()=>o.pages,p),pe(()=>o.isLongStrip,p),pe(()=>o.isVertical,p);function h(){const O=l.width.value,w=l.height.value,{pages:g,isLongStrip:S,isVertical:D}=o;return g.map(B=>{var v;const C=B.some(b=>{var j;return(j=b.img)==null?void 0:j.isLoading}),H=B.map(b=>b.index),X={isLoading:C,indexes:H,visible:!1};if(C)return X;const k=B.map(({img:b})=>b).filter(Boolean);if(!k.length||(X.srcs=k.map(({src:b})=>b),k.every(b=>b.hasError)))return X;const Y=(v=k.find(b=>!b.hasError))==null?void 0:v.size;if(!Y)return X;const te=k.reduce((b,j)=>{var ee;return b+(((ee=j.size)==null?void 0:ee.width)??Y.width)},0),K=k.reduce((b,j)=>{var ee;return b+(((ee=j.size)==null?void 0:ee.height)??Y.height)},0)/k.length;return S&&D||!S&&O/te<w/K?(X.width=Math.min(O,te),X.height=K*(X.width/te)):(X.height=Math.min(w,K),X.width=te*(X.height/K)),X})}const y=Q(()=>{const O=o.isVertical?"width":"height";return f.value.map(w=>w[O]).filter(Boolean).sort((w,g)=>g-w)[0]});Qe(()=>{const O=Ni(s.value,o.pageIndex);O==null||O.scrollIntoView({behavior:"instant",block:"start"});let w,g=!1;ls(()=>{w!==o.pageIndex&&(w=o.pageIndex,S(),g||(g=!0,Pt(()=>i("ready"))))});async function S(){if(!o.isLongStrip){u.value=x();return}const D=Math.floor(o.page),B=Ni(s.value,D);if(!B)return;const C=+L(B).getAttribute("data-index"),H=+N(B).getAttribute("data-index");(C!==u.value.min||H!==u.value.max)&&(u.value={min:C,max:H})}});function x(){const{pageIndex:O}=o;return{min:O-(o.isDouble?5:3),max:O+(o.isDouble?6:3)}}function L(O,w=0){const g=O.previousElementSibling;if(!g)return O;const S=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?S>l.height.value*1.5:o.isRTL?S>l.width.value*2.5:S>l.width.value*1.5)?g:L(g,S)}function N(O,w=0){const g=O.nextElementSibling;if(!g)return O;const S=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?S>l.height.value*3.5:o.isRTL?S>l.width.value*1.5:S>l.width.value*2.5)?g:N(g,S)}function Z(O,w){let g;return()=>{g||(g??(g=setTimeout(()=>{g=void 0,O()},w)))}}return(O,w)=>(P(),me(_l,{ref_key:"gestureContainer",ref:r,"space-top":e.spaceTop,"full-screen":e.fullScreen,zoom:e.zoom,zooming:e.zooming,"pinch-to-zoome":e.pinchToZoome,"tap-zone":e.tapZone,"page-index":e.pageIndex,class:ye(["rbod",{"rbod--long-strip":e.isLongStrip,"rbod--paging":!e.isLongStrip,"rbod--vertical":e.isVertical,"rbod--rtl":e.isRTL,"rbod--1page":f.value.length===1}]),"play-controller":e.playController,horizontal:!e.isVertical,rtl:e.isRTL,"touch-device":e.touchDevice,busy:e.busy,"long-strip":e.isLongStrip,style:De({"--gap":`${a.value}em`,"--space-top":`${e.spaceTop}px`,"--screen-width-em":G(l).width.value+"em","--screen-height-em":G(l).height.value+"em",...e.isLongStrip?{"--max-size-em":y.value+"em"}:{}}),"onUpdate:zoom":w[0]||(w[0]=g=>i("update:zoom",g)),"onUpdate:zooming":w[1]||(w[1]=g=>i("update:zooming",g)),onDragEnd:w[2]||(w[2]=()=>i("dragEnd")),onClick:w[3]||(w[3]=()=>i("click")),onPrev:w[4]||(w[4]=()=>i("prev")),onNext:w[5]||(w[5]=()=>i("next"))},{default:ue(()=>[(P(!0),W(Ie,null,Zt(f.value,g=>{var S;return P(),W("div",Dn({key:e.direction+"_"+g.indexes[0],"data-index":g.indexes[0]},{ref_for:!0},g.indexes.length>1?{"data-index2":g.indexes[1]}:{}),[!((S=g.srcs)!=null&&S.length)||g.isLoading?(P(),W("div",Md,[c.value[g.indexes[0]]?(P(),me(Ri,{key:0})):$e("",!0)])):g.srcs.length==1?(P(),me(Rr(c.value[g.indexes[0]]?"img":"div"),Dn({key:1,class:"img"},{ref_for:!0},c.value[g.indexes[0]]?{src:g.srcs[0]}:{},{style:{width:g.width!==void 0?g.width+"em":"",height:g.height!==void 0?g.height+"em":""}}),null,16,["style"])):(P(),W("div",{key:2,class:ye(["img img--double",{"flex-row-reverse":e.isRTL}]),style:De({width:g.width!==void 0?g.width+a.value+"em":"",height:g.height!==void 0?g.height+"em":""})},[g.indexes.some(D=>c.value[D])?(P(!0),W(Ie,{key:0},Zt(g.srcs,D=>(P(),W("div",{key:D},[q("img",{src:D},null,8,Ed)]))),128)):$e("",!0)],6))],16,Id)}),128)),q("div",{class:"last","data-index":e.totalImgs},[Te(O.$slots,"end")],8,Pd)]),_:3},8,["space-top","full-screen","zoom","zooming","pinch-to-zoome","tap-zone","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;width:100%}.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: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>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{scroll-snap-type:y var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging.rbod--vertical>div{width:var(--screen-width-em)}.rbod--paging:not(.rbod--vertical){scroll-snap-type:x var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging:not(.rbod--vertical)>div{height:var(--screen-height-em)}.rbod--paging .img--loading{height:100%;width:100%}.rbod--paging .img.img--double{align-items:center;background-color:transparent;display:flex;gap:var(--gap);justify-content:center}.rbod--paging .img.img--double div{display:flex;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rbod--paging .img.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}.rbod .img,.rbod>div{margin:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod .img{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));-o-object-fit:contain;object-fit:contain}.rbod .img--loading{align-items:center;background-color:transparent;display:flex;justify-content:center}"]]]),$d=Object.freeze(Object.defineProperty({__proto__:null,default:Sl},Symbol.toStringTag,{value:"Module"})),Od={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},Ad={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},zd={class:"flex justify-between items-end"},Ld={class:"inline-block children-pointer-events-auto"},Dd={class:"inline-flex flex-col items-end gap-4 children-pointer-events-auto"},jd={class:"inline-block z-20 relative"},Bd={key:1,class:"fixed inline-block left-1/2 -translate-x-1/2 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3"},kl=be(Ce({__name:"ReaderLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},fullScreen:{type:Boolean},zooming:{type:Boolean},rtl:{type:Boolean},spaceTop:{type:null}},setup(e,{expose:t}){const n={mounted:i=>i.showModal(),beforeUnmount:i=>i.close()},o=re(null);return t({rootEl:o}),(i,r)=>xt((P(),W("dialog",Od,[q("div",{ref_key:"rootEl",ref:o,id:"reader-layout",class:ye({"cursor-none":e.idle,"cursor-default":!e.idle,"bg-black":e.immediate||!e.loading,"opacity-0":!e.immediate&&e.loading,"duration-200 transition-colors":!e.immediate})},[e.loading&&e.immediate?(P(),W("div",Ad,[J(Ri)])):$e("",!0),Te(i.$slots,"default"),q("div",{id:"controls",class:ye(["fixed pointer-events-none cursor-auto left-0 top-0 w-full h-full flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3",{"opacity-100 z-20":!e.fullScreen,"opacity-0 -z-10":e.fullScreen}])},[q("div",{class:"flex gap-1 items-center children-pointer-events-auto relative z-30 flex-shrink-0 2xs:gap-3",style:De({paddingTop:`${e.spaceTop||0}px`})},[Te(i.$slots,"back"),Te(i.$slots,"exit"),Te(i.$slots,"chapter-nav")],4),q("div",zd,[q("div",Ld,[Te(i.$slots,"page-nav")]),q("div",Dd,[Te(i.$slots,"entry"),q("div",jd,[Te(i.$slots,"settings")]),Te(i.$slots,"full-screen"),Te(i.$slots,"play"),Te(i.$slots,"break-first")])]),q("div",{class:ye(["fixed pointer-events-none left-0 right-0 bottom-0",{"flex justify-end":e.rtl}])},[Te(i.$slots,"progress")],2)],2),!e.fullScreen||e.zooming?(P(),W("div",Bd,[Te(i.$slots,"reset-zoom")])):$e("",!0)],2)])),[[n]])}}),[["styles",["#reader-layout{direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%;--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}"]]]),Rd=Object.freeze(Object.defineProperty({__proto__:null,default:kl},Symbol.toStringTag,{value:"Module"})),Cl=be(Ce({__name:"ReaderTour",emits:["hide"],setup(e,{emit:t}){const n=t,o=re(null),i=re(0),r=re([]),s=Q(()=>r.value[i.value]),l=Qs(a,500);Qe(()=>{const f=tl(o),p=nt(()=>u({width:f.width.value,height:f.height.value}),50);p(),pe(f.width,p),pe(f.height,p)});function a(){i.value>=r.value.length-1?n("hide"):i.value++}function u(f){const p=c();r.value=p.map(({rect:h,text:y})=>{const x=h.top<f.height-h.bottom,L=h.left<f.width-h.right;return{text:y,style:{left:`${h.left}px`,top:`${h.top}px`,width:`${h.width}px`,height:`${h.height}px`},textStyle:{left:L?`${h.left-12}px`:void 0,right:L?void 0:`${f.width-h.left}px`,top:x?`${h.bottom+12}px`:`${h.top+20}px`,textAlign:x?void 0:"right",transform:x?void 0:"translateY(-50%)"}}}),i.value>=r.value.length&&(i.value=r.value.length-1)}function c(){var h;const f=(h=o.value)==null?void 0:h.parentElement;if(!f)return[];const p=[];return f.querySelectorAll("[data-tour]").forEach(y=>{var N;const x=(N=y.getAttribute("data-tour"))==null?void 0:N.trim();if(!(x!=null&&x.length))return;const L=y.getBoundingClientRect();p.push({rect:L,text:x})}),p}return(f,p)=>{var h,y;return P(),W(Ie,null,[q("div",{class:ye(["fixed inset-0 bg-black bg-opacity-50 duration-500",{"opacity-0":!s.value,"opacity-100":!!s.value}])},null,2),q("div",{ref_key:"root",ref:o,class:"tour",onClick:p[0]||(p[0]=We((...x)=>G(l)&&G(l)(...x),["stop"]))},[s.value?(P(),W("div",{key:i.value,class:"tour__target",style:De(s.value.style)},null,4)):$e("",!0),(P(),W("div",{key:i.value,class:"tour__text",style:De((h=s.value)==null?void 0:h.textStyle)},Je(((y=s.value)==null?void 0:y.text)??""),5))],512)],64)}}}),[["styles",[".tour{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:20}.tour__target{border-radius:9999px;border-width:2px;--tw-border-opacity:1;animation:tour-target-anim .5s forwards;border-color:rgb(120 113 108/var(--tw-border-opacity,1));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%{transform:scale(3);--tw-border-opacity:0;opacity:0}to{transform:scale(1);--tw-border-opacity:1;opacity:.9}}@keyframes tour-text-anim{0%{opacity:0}to{opacity:1}}@keyframes tour-text-bounce{0%{margin-top:0}to{margin-top:10px}}"]]]),Nd=Object.freeze(Object.defineProperty({__proto__:null,default:Cl},Symbol.toStringTag,{value:"Module"})),Vd={},Fd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Hd(e,t){return P(),W("svg",Fd,[...t[0]||(t[0]=[q("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)])])}const Tl=be(Vd,[["render",Hd]]),Wd=Object.freeze(Object.defineProperty({__proto__:null,default:Tl},Symbol.toStringTag,{value:"Module"})),Kd={},Ud={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function qd(e,t){return P(),W("svg",Ud,[...t[0]||(t[0]=[q("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)])])}const Il=be(Kd,[["render",qd]]),Zd=Object.freeze(Object.defineProperty({__proto__:null,default:Il},Symbol.toStringTag,{value:"Module"})),Yd={},Xd={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Gd(e,t){return P(),W("svg",Xd,[...t[0]||(t[0]=[q("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)])])}const Ml=be(Yd,[["render",Gd]]),Jd=Object.freeze(Object.defineProperty({__proto__:null,default:Ml},Symbol.toStringTag,{value:"Module"})),Qd={},ep={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function tp(e,t){return P(),W("svg",ep,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"},null,-1)])])}const El=be(Qd,[["render",tp]]),np=Object.freeze(Object.defineProperty({__proto__:null,default:El},Symbol.toStringTag,{value:"Module"})),op={},ip={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function rp(e,t){return P(),W("svg",ip,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"},null,-1)])])}const Pl=be(op,[["render",rp]]),sp=Object.freeze(Object.defineProperty({__proto__:null,default:Pl},Symbol.toStringTag,{value:"Module"})),lp={},ap={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 56"};function cp(e,t){return P(),W("svg",ap,[...t[0]||(t[0]=[q("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)])])}const $l=be(lp,[["render",cp]]),up=Object.freeze(Object.defineProperty({__proto__:null,default:$l},Symbol.toStringTag,{value:"Module"})),fp={},dp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function pp(e,t){return P(),W("svg",dp,[...t[0]||(t[0]=[q("g",{fill:"none"},[q("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"}),q("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)])])}const Ol=be(fp,[["render",pp]]),hp=Object.freeze(Object.defineProperty({__proto__:null,default:Ol},Symbol.toStringTag,{value:"Module"})),gp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function vp(e,t){return P(),W("svg",mp,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM6 14v4h4v2H4v-6h2Zm14 0v6h-6v-2h4v-4h2Z"},null,-1)])])}const Al=be(gp,[["render",vp]]),bp=Object.freeze(Object.defineProperty({__proto__:null,default:Al},Symbol.toStringTag,{value:"Module"})),yp={},wp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function xp(e,t){return P(),W("svg",wp,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M14 20v-6h6v2h-4v4h-2Zm-6 0v-4H4v-2h6v6H8Zm12-10h-6V4h2v4h4v2Zm-10 0H4V8h4V4h2v6Z"},null,-1)])])}const zl=be(yp,[["render",xp]]),_p=Object.freeze(Object.defineProperty({__proto__:null,default:zl},Symbol.toStringTag,{value:"Module"})),Sp={},kp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Cp(e,t){return P(),W("svg",kp,[...t[0]||(t[0]=[q("path",{fill:"currentColor",d:"M19 12.998h-6v6h-2v-6H5v-2h6v-6h2v6h6z"},null,-1)])])}const Ll=be(Sp,[["render",Cp]]),Tp=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),Ip={},Mp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Ep(e,t){return P(),W("svg",Mp,[...t[0]||(t[0]=[q("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)])])}const Dl=be(Ip,[["render",Ep]]),Pp=Object.freeze(Object.defineProperty({__proto__:null,default:Dl},Symbol.toStringTag,{value:"Module"}));function Wn(e=0){return new Promise(t=>setTimeout(t,e))}function jl(e){const t=async(n,o)=>{var i;if(!n.toBlob){if(o)return;const r=n.cloneNode(),s=(i=r.getContext)==null?void 0:i.call(r,"2d");if(!s)return;try{s.drawImage(e,0,0)}catch{return}return t(r,!0)}return await new Promise(r=>{const s=l=>{if(!l)return r(void 0);const a=URL.createObjectURL(l);r(a)};try{n.toBlob(s,"image/jpeg",1)}catch{r(void 0)}})};return t(e,!1)}let Bo;async function $p(e,t){if(Bo||!t.startsWith("blob:"))return t;if(Bo===void 0){try{if((await fetch(t)).ok)return Bo=!0,t}catch{}Bo=!1}e.complete||await new Promise(a=>{let u=0;const c=setInterval(()=>{e.complete?(a(),clearInterval(c)):++u>=30&&a()},100)});const o=e.naturalWidth,i=e.naturalHeight;if(!o||!i)return;const r=document.createElement("canvas"),s=r.getContext("2d");return r.width=o,r.height=i,s==null||s.drawImage(e,0,0,o,i),await jl(r)}function Op(e){const t=new Set,n=e.getAttributeNames(),o=n.indexOf("src"),i=o!==-1;i&&(n.splice(o,1),n.push("src"));for(const r of n){if(r==="srcset"||i&&r===":src"||r!=="data-url"&&r!=="data-original"&&!r.includes("src"))continue;const s=e.getAttribute(r);s&&(r==="src"&&e.naturalWidth&&e.naturalWidth<200||t.add(s.replace(/(\n|\t)/g," ").trim()))}return Array.from(t)}function Vi(e,t){return e>=75&&t>=50&&(e>=200||t>=200)}class Ap{constructor({onChanged:t}){ze(this,"isMounted",!0);ze(this,"elsDisposeCallbacksMap",new Map);ze(this,"onChanged");this.onChanged=t}dispose(){this.isMounted=!1,this.elsDisposeCallbacksMap.forEach(t=>t()),this.elsDisposeCallbacksMap=new Map,this.onChanged=()=>{}}async download(t){if(!this.isMounted)return;const n=t.el,o=!!n&&n instanceof HTMLImageElement,i=n?o?Op(n):[await jl(n)].filter(Boolean):[t.src].filter(Boolean);if(!(!n&&!i.length||!this.isMounted)){if(n&&!this.elsDisposeCallbacksMap.has(n))if(o){let r=i.slice(-1)[0];const s=new MutationObserver(l=>{l.some(u=>{if(u.attributeName!=="src")return!1;const c=r;return r=n.getAttribute("src"),!!r&&c!==r})&&this.download(t)});s.observe(n,{attributes:!0}),this.elsDisposeCallbacksMap.set(n,()=>s.disconnect())}else{const r=n.getContext("2d");if(r){const s=r.drawImage.bind(r),l=r.putImageData.bind(r),a=(u,c,f)=>(setTimeout(()=>this.download(t),100),u.apply(c,f));try{r.drawImage=new Proxy(s,{apply:a}),r.putImageData=new Proxy(l,{apply:a})}catch{}this.elsDisposeCallbacksMap.set(n,()=>{try{r.drawImage=s,r.putImageData=l}catch{}})}}i.length&&(this.onChanged(t,{src:i[0],isLoading:!0,hasError:!1}),await this.downloadRawImage(t,i))}}async downloadRawImage(t,n){const o=t.el instanceof HTMLImageElement?t.el:void 0;for(let i=0;i<n.length;i++){const r=n[i],s=o?await $p(o,r):r;if(!s||!this.isMounted)return;const l=await zp(s,o,a=>{this.isMounted&&this.onChanged(t,{src:s,size:a,isLoading:!1,hasError:!1})});if(l.ok||!this.isMounted)return;i===n.length-1&&this.onChanged(t,{src:s,isLoading:!1,hasError:!!l.error,invalid:!!l.invalid,size:l.size})}}}async function zp(e,t,n){return(t==null?void 0:t.src)===e&&t.naturalWidth&&t.naturalHeight?(n({width:t.naturalWidth,height:t.naturalHeight}),t.complete?{ok:!0}:new Promise(o=>{t.addEventListener("load",()=>o({ok:!0}),{once:!0})})):await new Promise(o=>{const i=new Image,r=setInterval(()=>{const{naturalWidth:s,naturalHeight:l}=i;if(l&&s){const a={width:s,height:l};Vi(s,l)?n(a):o({invalid:!0,size:a}),clearInterval(r)}},20);i.onerror=()=>{o({error:!0}),clearInterval(r)},i.onload=()=>setTimeout(()=>o({ok:!0}),25),i.src=e})}const Lp=3;class Dp{constructor(t){ze(this,"download");ze(this,"threads");ze(this,"completedItems");ze(this,"promisesMap",new Map);this.download=t.download}dispose(){var t;(t=this.threads)==null||t.dispose(),this.threads=void 0,this.completedItems=void 0}run({activeIndex:t,items:n}){var r;if(this.completedItems===n)return;this.completedItems=void 0,(r=this.threads)==null||r.dispose();let o=Math.max(0,t-1),i=!0;this.threads=new jp(Lp,()=>{const s=n[o];if(!s){this.completedItems=n;return}i&&o===n.length-1?(i=!1,o=t-2):i?o++:o--;const l=s.src??s.el;if(l){const u=this.promisesMap.get(l);if(u)return u}const a=this.download(s);return l&&this.promisesMap.set(l,a),a}),this.threads.exec()}}class jp{constructor(t,n){ze(this,"isDisposed",!1);this.limit=t,this.getNext=n}dispose(){this.isDisposed=!0}exec(){for(let t=0;t<this.limit;t++)this.next()}async next(){if(this.isDisposed)return;const t=this.getNext();t&&(await t,await Wn(20),this.next())}}class Bl{constructor(){ze(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 Bp(e,t){let n=[t??document.documentElement];const o=e.split("->");for(let i=0;i<o.length;i++){const r=o[i];n=n.map(s=>Array.from((s.shadowRoot??s).querySelectorAll(r))).flat()}return n}function Kn(e,t){if(e instanceof HTMLOptionElement){const n=e.parentElement instanceof HTMLOptGroupElement?e.parentElement.parentElement:e.parentElement;if(!n||!(n instanceof HTMLSelectElement))return;const o=e.getAttribute("value")||"";if(n.value===o)return;n.value=o,n.dispatchEvent(new Event("change"));return}e instanceof HTMLAnchorElement&&(t==null?void 0:t.preventDefault)!==!1&&e.addEventListener("click",n=>n.preventDefault(),{once:!0}),e.click(),e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0})),e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0}))}async function Rp(e){const{lstrip:t,lstripBtn:n}=e||{};if(!t||!n||!!document.querySelector(t))return!1;const i=n.split(";");for(const r of i)if(!await Np(r.trim()))return!1;return!0}async function Np(e){const t=await bn(50,30,()=>document.querySelector(e));return t?(Kn(t),await Wn(),!0):!1}class Vp{constructor({spec:t,onChanged:n}){ze(this,"spec");ze(this,"onChanged");ze(this,"rawImages",[]);ze(this,"isMounted",!0);ze(this,"loadRawImagesTs");ze(this,"imgListenersMap",new Map);ze(this,"disconnectObservers");ze(this,"contentEl");ze(this,"reloadRawImages",nt(()=>{this.contentEl&&this.loadRawImages(this.contentEl)},100));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 i;const t=new MutationObserver(this.reloadRawImages),n=(i=this.spec)!=null&&i.imgDivs?void 0:(()=>{let r=window.innerWidth;return new ResizeObserver(nt(()=>{const s=window.innerWidth;if(s!==r){r=s;return}this.reloadRawImages()},50))})();this.disconnectObservers=async()=>{t.disconnect(),n==null||n.disconnect()};let o=!1;this.loadContentEl(r=>{this.contentEl!==r&&(this.contentEl=r,t.disconnect(),n==null||n.disconnect(),t.observe(this.contentEl,{childList:!0,subtree:!0}),n==null||n.observe(this.contentEl),o?this.reloadRawImages():(o=!0,this.loadRawImages(this.contentEl)))})}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 Rp(this.spec),o=(l=this.spec)==null?void 0:l.content;if(!o){t(document.body);return}let i=await bn(n?100:1,10,()=>{for(const a of o.split(",")){const u=document.querySelector(a);if(u)return u}});if(!i)return;t(i);let r=0;const s=async()=>{if(this.isMounted&&!(i!=null&&i.isConnected)){if(r=0,i=await bn(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 this.loadFromImgDivs(t,o):this.loadFromContentEl(t);this.loadRawImagesTs!==n||!t.isConnected||!this.isMounted||this.setRawImages(i)}async loadFromImgDivs(t,n){const o=Bp(n,t);if(!o.length)return this.loadFromContentEl(t);const i=new Bl;return o.map(s=>{const l=Array.from(s.querySelectorAll("img,canvas"));for(const a of l){if(!i.check(a)){this.observeInvalidImgEl(a);continue}if(a instanceof HTMLCanvasElement){if(Rl(a))return{el:a,parentEl:s}}else if(a instanceof HTMLImageElement){if(Nl(a))return{el:a,parentEl:s};this.observeInvalidImgEl(a)}}return{parentEl:s}})}loadFromContentEl(t){const n=[],o={},i=new Bl;return Array.from(t.querySelectorAll("img,canvas")).forEach(s=>{if(!i.check(s)){this.observeInvalidImgEl(s);return}if(s instanceof HTMLCanvasElement)Rl(s)&&n.push({el:s});else if(s instanceof HTMLImageElement)if(Nl(s)){const l=s.getAttribute("src");if(l){const a=o[l];if(a!==void 0&&a!==-1){n.splice(a,1);return}o[l]=n.length}n.push({el:s})}else this.observeInvalidImgEl(s)}),n}observeInvalidImgEl(t){if(!(t instanceof HTMLImageElement)||this.imgListenersMap.has(t))return;const n=()=>{t.removeEventListener("load",n),this.imgListenersMap.delete(t),this.reloadRawImages()};this.imgListenersMap.set(t,n),t.addEventListener("load",n)}}function Rl(e){return e.isConnected&&Vi(e.width,e.height)}function Nl(e){if(!e.isConnected)return!1;const t=e.getBoundingClientRect();return!t.width||!t.height||Vi(t.width,t.height)}const Ro="mp-scroll-container";class Fi{constructor(){ze(this,"scrollEl")}dispose(){var t;(t=this.scrollEl)==null||t.classList.remove(Ro)}scrollTo({rawImages:t,page:n,skipIfVisible:o,isScrollDown:i,isScrollExact:r,fallbackScrollEl:s}){var L;const l=Math.floor(n),a=t[Math.min(t.length-1,l)];if(!a)return;const u=a.el??a.parentEl??(a.src?document.querySelector(`img[src^="${a.src}"]`):void 0);if(!u)return;const c=u.getBoundingClientRect();if(o&&c.top<=0&&c.top+c.height>0)return;const f=Fi.getScrollable(u,s);if(!f)return;const{el:p,top:h}=f;s!==document.documentElement&&!p.classList.contains(Ro)&&(p!==this.scrollEl&&((L=this.scrollEl)==null||L.classList.remove(Ro),this.scrollEl=p),p.classList.add(Ro));const y=n>=t.length?c.height:r?n%1*c.height:i?Math.max(0,c.height-window.innerHeight/2):-window.innerHeight/2,x={top:h+y,behavior:"instant"};p.scrollTo(x),p!==document.documentElement&&document.documentElement.scrollTo(x)}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 u=0;return r.forEach((c,f)=>{u+=f===l?c-s:c}),{el:i,top:u}};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 Fp(e){if(document.documentElement.scrollTop<700)return 0;const n=Array.from(document.querySelectorAll("img[src]")).filter(o=>e.includes(o.src)).map(o=>({el:o}));return Vl(n)}function Hp(e){var C,H,X;const t=(C=e.raw.value)==null?void 0:C.isWebtoon,n=re(t===!1),o=re(t);let i=!1;const r=e.touchDevice&&!navigator.userAgent.toLowerCase().includes("android"),s=((X=(H=e.raw.value)==null?void 0:H.imgs)==null?void 0:X.filter(Boolean))??[];let l=e.isAutoShow!==!1?e.page.value:s.length?Fp(s):void 0,a=s.map(k=>({src:k})),u,c;const f=new Map,p=({src:k,el:E})=>{const Y=E??k;return Y?f.get(Y):void 0},h=re(s.map(k=>({src:k,isLoading:!0,hasError:!1}))),y=()=>{const k=[];a.forEach(E=>{const{src:Y,el:te}=E,K=te??Y,v=K?f.get(K):void 0;(K&&!(v!=null&&v.invalid)||E.parentEl)&&k.push(v)}),h.value=k};let x=setTimeout(e.onTimeout,2e4);const L=()=>{x&&(clearTimeout(x),x=void 0)};let N=0,Z=0;const O=4,w=new Ap({onChanged(k,E){const Y=k.el??k.src;if(!Y||(f.set(Y,E),y(),E.isLoading))return;if(E.hasError){if(c||o.value!==void 0)return;c=setTimeout(()=>{c=void 0,o.value===void 0&&e.onError("Failed to load images")},3e3);return}const{size:te,invalid:K}=E;if(!(!te||K)){if(!o.value&&Z<O){const v=i?a:a.filter(({el:ke,src:xe})=>xe||!(ke&&ke instanceof HTMLImageElement&&!f.has(ke)));let b=v.indexOf(k);if(i&&b>4||b===-1&&(k.el&&(b=v.findIndex(ke=>ke.el===k.el)),b===-1))return;const j=b>Math.min(1,v.length-3)&&b<Math.max(v.length-2,3),ee=te.width/te.height;ee>2&&N++;const le=ee<.5||N>=O,we=!le&&.65<ee&&ee<.75;we&&Z++,o.value!==le&&(j||le)&&(o.value=le),j&&n.value!=we&&(n.value=!0),o.value===void 0&&we&&Z===O&&(o.value=!1)}B()}}}),g=new Dp({download:async k=>{!(k.el&&f.has(k.el))&&!(k.src&&f.has(k.src))&&await w.download(k)}}),S=()=>{g.run({items:a,activeIndex:Math.min(a.length-1,Math.floor(e.page.value))})},D=new Fi;if(s.length)S();else{let k=!1;u=new Vp({spec:e.spec,async onChanged(E){var Y;if(a=E,y(),!e.raw.value&&!E.length){e.onError("no_img");return}(Y=e.spec)!=null&&Y.imgDivs&&!k&&e.isAutoShow!==!1&&e.page.value&&(k=!0,D.scrollTo({rawImages:E,page:e.page.value,skipIfVisible:!0,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0}),await Wn(1)),l===void 0&&e.isAutoShow===!1&&(l=Vl(E)),S()}})}ui(()=>{w.dispose(),g.dispose(),u==null||u.dispose(),c&&clearTimeout(c),D.dispose(),i&&D.scrollTo({rawImages:a,page:e.page.value,fallbackScrollEl:document.documentElement,isScrollExact:!0})});function B(){if(i||o.value===void 0||l===void 0)return;const k=Math.max(0,Math.min(l,a.length)),E=Math.min(Math.floor(k),a.length-1);if(E>=1){const te=a[E];if(!te||!p(te)){e.isAutoShow&&D.scrollTo({rawImages:a,page:E,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0});return}for(let K=E;K<a.length;K++){const v=p(a[K]);if(!v)return;if(!v.invalid){if(!v.size&&!v.hasError)return;break}}for(let K=E-1;K>=0;K--){const{src:v,el:b}=a[K],j=b??v;if(!j)break;const ee=f.get(j);if(!ee)return;if(!ee.invalid){if(!ee.size&&!ee.hasError)return;break}}}if(i)return;i=!0,L(),e.onReady(k);let Y=!0;pe(()=>Math.floor(e.page.value),(te,K)=>{te===K&&!Y||(D.scrollTo({rawImages:a,page:te,isScrollDown:K===void 0||te>K||a.length===1,skipIfVisible:Y&&a.length>1,fallbackScrollEl:r?document.body:document.documentElement}),Y=!1,K??(K=-1),S())},{immediate:!0})}return{asyncImgs:Q(()=>h.value),isWebtoon:Q(()=>o.value??!1),isManga:Q(()=>n.value)}}function Wp(e,t,n){return Q(()=>t.value?Fl(e.value,n.value):e.value.map((o,i)=>[{img:o,index:i}]))}function Fl(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})),...Fl(e.slice(r.length),t&&i,n+r.length)]}function Kp(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=re(t&&e>0?Math.max(0,e):+(sessionStorage.getItem("tk:page")??"0")||e);return Q({get:()=>o.value,set:i=>{o.value=i,sessionStorage.setItem("tk:page",i+"")}})}function Up(){sessionStorage.removeItem("tk:page"),sessionStorage.removeItem("tk:page:path")}const Hi=40;function qp({page:e,totalImgs:t,direction:n,style:o,isLongStrip:i,isVertical:r,isRTL:s,spaceTop:l,scrollEl:a,isWebtoon:u,interferePlayer:c,onChangedPage:f,onInitialized:p,onFinished:h}){let y=!1,x=!1,L=!1,N;const Z=nt(H,300),O=Qs(()=>{H(),Z()},300),w=b=>(D(b),nt(D,50)(b));async function g(){B(e.value,{smooth:!1,ensureLastImgVisibility:!0})}function S(){var b;x=!0,p(),X(),(b=a.value)==null||b.addEventListener("scroll",O),setTimeout(()=>{const{width:j,height:ee}=Oo();pe(j,()=>{r.value&&w(e.value)}),pe(ee,()=>{r.value||w(e.value)}),pe(o,()=>w(e.value)),pe(n,()=>w(e.value)),/iPad|iPhone|iPod/.test(navigator.userAgent)&&pe(t,()=>{s.value&&w(e.value)})},300)}async function D(b){if(!(!x||y)){if(y=!0,await Pt(),E()===b){y=!1;return}B(b)}}function B(b,{smooth:j,ensureLastImgVisibility:ee=!1}={smooth:!1}){const le=a.value;if(!le)return;y=!0;const we=async()=>{await Pt(),y=!1,x||S()},ke=Math.floor(b),xe=Ni(le,ke);if(!xe){we();return}c(async()=>{await C(le,!i.value&&j,async()=>{await v(le,xe,{smooth:j,page:b,ensureLastImgVisibility:ee})}),await we()})}async function C(b,j,ee){j&&b.style.setProperty("scroll-snap-type","none"),await ee(),j&&b.style.removeProperty("scroll-snap-type")}function H(){if(y)return;const b=E();b!==void 0&&b!==e.value&&f(b),X()}function X(){L||!L&&k()&&(L=!0,h())}function k(){const b=a.value;if(!b)return!1;const j=i.value?u.value?3:!r.value&&b.clientWidth>b.clientHeight?2.25:2.5:2;return r.value?b.scrollHeight-b.scrollTop<b.clientHeight*j:b.scrollWidth-(s.value?-b.scrollLeft:b.scrollLeft)<b.clientWidth*j}function E(){const b=Y();return b?(+b.getAttribute("data-index")||0)+(i.value?te(b):0):void 0}function Y(){var j;if(N??(N=a.value.getRootNode()),!N)return;const b=(j=N.elementsFromPoint)==null?void 0:j.call(N,r.value||!i.value?window.innerWidth/2:s.value?window.innerWidth-Hi:Hi,r.value&&i.value?l.value||Hi:window.innerHeight/2);if(b)for(let ee=0;ee<b.length;ee++){const le=b[ee];if(le.hasAttribute("data-index"))return le;if(le===a.value)break}}function te(b){const j=b.getBoundingClientRect();return r.value?Math.abs(j.top-l.value)/j.height:s.value?Math.max(0,j.right-a.value.clientWidth)/j.width:Math.abs(j.left)/j.width}let K=!1;async function v(b,j,ee){if(K)return;const le=j.getBoundingClientRect();if(!i.value){if(r.value){if(le.top<=0&&le.bottom>=b.clientHeight)return}else if(le.left<=0&&le.right>=b.clientWidth)return}K=!0;const we=r.value?b.scrollTop:b.scrollLeft,ke=ee.page,xe=i.value?ke%1:0,Le=await bn(30,10,async()=>{await Wn();let Me;if(!(j.offsetHeight<10))return i.value?r.value?Me=j.offsetTop+xe*j.offsetHeight-l.value:s.value?Me=j.offsetLeft-b.clientWidth+j.offsetWidth-xe*j.offsetWidth:Me=j.offsetLeft+xe*j.offsetWidth:r.value?Me=j.offsetTop+(le.top>0?0:le.height-b.clientHeight):Me=j.offsetLeft+(le.left>0?0:le.width-b.clientWidth),ke>.5&&Math.abs(Me)<100?void 0:Me})??0,Ae=ee.ensureLastImgVisibility?r.value?Math.min(Le,b.scrollHeight-b.clientHeight*2):s.value?Math.max(Le,-(b.scrollWidth-b.clientWidth*2)):Math.min(Le,b.scrollWidth-b.clientWidth*2):Le;if(!ee.smooth){r.value?b.scrollTop=Ae:b.scrollLeft=Ae,K=!1;return}const Ke=Ae-we,it=30;let ft=0;return new Promise(Me=>{(function on(){const d=Zp(ft,we,Ke,it);r.value?b.scrollTop=d:b.scrollLeft=d,ft++,ft<=it?requestAnimationFrame(on):(Me(),K=!1)})()})}return{init:g,goToPage:B}}function Zp(e,t,n,o){return n*(Math.pow(e/o-1,3)+1)+t}function Yp({autoPlay:e,touchDevice:t,scrollEl:n,isVertical:o,isRTL:i,isLongStrip:r,speed:s}){const l=re(e||sessionStorage.getItem("tk:playing")==="true"),a=Q({get:()=>l.value,set:S=>{l.value=S,sessionStorage.setItem("tk:playing",S?"true":"false")}}),u=re(!1);let c,f;const p=nt(w,100),h=nt(()=>{u.value=!0},t?2e3:1e3),y=()=>setTimeout(()=>{u.value=!1,h()},30);y(),t||Dt(window,"mousemove",y),Qe(()=>{t||pe(Pi(),D=>{a.value&&(D==="visible"?w():f==null||f())}),pe(s,()=>x()),pe(r,S=>{S||N()})}),qt(N);async function x(S){a.value&&(f==null||f()),S&&(await Pt(),await S()),a.value&&p()}function L(){a.value?N():Z()}function N(){a.value&&(a.value=!1,f==null||f(),y())}function Z(){!a.value&&r.value&&(a.value=!0,w(),y())}function O(){f==null||f()}function w(){const S=n.value;if(!a.value||!S)return;const D=o.value?S.scrollHeight-S.clientHeight:S.scrollWidth-S.clientWidth,B=g();if(D<=B){N();return}f=()=>{c=Date.now(),f=void 0};const C=Date.now();c=C;const H=.1*s.value,X=o.value?"scrollTop":"scrollLeft";let k=Date.now(),E=0;const Y=()=>{if(c!==C)return;const te=Date.now(),K=te-k;k=te;const v=H*K+E;v>=1?(E=v%1,S[X]+=(v-E)*(i.value?-1:1)):E=v,setTimeout(Y,1)};Y()}function g(){const S=n.value;return o.value?S.scrollTop:i.value?-S.scrollLeft:S.scrollLeft}return{isPlaying:a,isIdle:u,toggle:L,play:Z,pause:O,resume:w,stop:N,interfere:x,awake:y}}function Xp({raw:e,spec:t,siteMeta:n,onSelect:o}){var H,X,k;const{vol:i,inferVol:r,chap:s,title:l,slug:a,basePath:u}=e,c=t==null?void 0:t.chapter;let f=-1;async function p(E,Y){if(o){o({...E});return}if(E.slug){h(E.slug,Y);return}if(E.elIndex===void 0||!(c!=null&&c.sel))return;let te=null;document.querySelector(c.sel)||(c!=null&&c.trigger&&(te=document.querySelector(c.trigger)),te&&(Kn(te),await new Promise(v=>setTimeout(()=>v(),50))));const K=c&&c.sel&&!c.url?document.querySelectorAll(c.sel):void 0;K!=null&&K[E.elIndex]&&(Kn(K[E.elIndex]),te&&document.querySelector(c.sel)&&Kn(te))}function h(E,Y){const te=Gp(u,E,(n==null?void 0:n.trailing)??!0);Y?window.open(te,"_blank","noopener"):location.href=te}function y(E){const Y=O[E];return Y?te=>p(Y,te):void 0}function x(E,Y,te){if(Y)h(Y,te);else if(E){const K=document.querySelector(E);K&&Kn(K,{preventDefault:!1})}}const L=i??r,N=c==null?void 0:c.url,Z=((H=l.chapters)==null?void 0:H.filter(E=>E.slug||!N&&E.elIndex!==void 0))??[],O=Z.length>1?Z:[],w=(X=e.prev)==null?void 0:X.slug,g=(k=e.next)==null?void 0:k.slug,S=t!=null&&t.prev&&typeof t.prev!="string"?t.prev.sel??t.prevBtn:t==null?void 0:t.prevBtn,D=t!=null&&t.next&&typeof t.next!="string"?t.next.sel??t.nextBtn:t==null?void 0:t.nextBtn;let B=w||S&&!O.length&&document.body.querySelector(S)?E=>x(S,w,E):void 0,C=g||D&&!O.length&&document.body.querySelector(D)?E=>x(D,g,E):void 0;if(O.length){if(N&&(f=O.findIndex(E=>E.slug===e.slug)),f===-1&&(f=O.findIndex(E=>(E.vol??E.inferVol)===L&&E.chap===s)),N&&f===-1&&(f=O.findIndex(E=>E.slug&&a.startsWith(`${E.slug}-`)&&a.length-E.slug.length>3)),f!==-1)B??(B=y(f+1)),C??(C=y(f-1));else if(!w&&!g){const E=O.findIndex(Y=>{const te=Y.vol??Y.inferVol;return L===void 0||te===void 0||L===te?Y.chap<s:te<L});E!==-1?(B=y(E),C=y(E-1)):C=y(O.length-1)}}return{activeIndex:f,activeLabel:Hl({vol:i,chap:s}),prev:B,next:C,chapters:O.map(E=>({label:Hl(E),select:Y=>p(E,Y)}))}}function Hl({vol:e,chap:t}){return e==null?`Ch.${t}`:`Vol.${e} ch.${t}`}function Gp(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("?")}function Jp(e){return e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e)):e}var Un=(e=>(e[e.never=0]="never",e[e.move=1]="move",e[e.firstMove=2]="firstMove",e[e.onLoad=3]="onLoad",e))(Un||{});const Qp={class:"flex justify-center items-center gap-1 pl-1 pr-2 h-full"},eh={key:0,class:"ml-auto inline-flex gap-[1px] scale-95 origin-right"},Wl=be(Ce({inheritAttrs:!1,__name:"App",props:{immediate:{type:Boolean},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},fullScreen:{type:Boolean},touchDevice:{type:Boolean},entryId:{type:String},autoPlay:{type:Boolean},readerStyle:{type:Number},direction:{type:Number},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean},autoNextSeconds:{type:Number},defaultSpeed:{type:Number},defaultGap:{type:Number},hideControlsEvent:{type:Number},progressSize:{type:Number},pinchToZoom:{type:Boolean},tapZone:{type:Number}},emits:["error","crash","ready","pageChanged","fullScreenChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences"],setup(e,{emit:t}){const n=e,o=t;let i=!1;jr((T,I,se)=>{if(!i){i=!0;const Ue=`(2.1.1) ${(I==null?void 0:I.$options.name)??(I==null?void 0:I.$options.__name)??(I==null?void 0:I.$options.__file)}.${se}: ${Jp(T)}`;o("crash",Ue)}return!1});let r=!1,s;const l=re(!1),a=re(!1),u=qu({touchDevice:n.touchDevice}),c=Kp(n.page,n.isAutoShow),f=Q(()=>n.immediate||l.value?n.spaceTop??0:0),{asyncImgs:p,isWebtoon:h}=Hp({raw:Q(()=>n.raw),spec:n.spec,page:c,touchDevice:n.touchDevice,isAutoShow:n.isAutoShow,async onReady(T){Le(T),l.value=!0},onError:()=>{o("error"),R()},onTimeout:()=>o("timeout")}),{direction:y,style:x,isRTL:L,isDouble:N,isVertical:Z,isLongStrip:O,gap:w,speed:g,zoom:S,breakFirst:D}=$f({isWebtoon:h,titleName:Q(()=>{var T;return(T=n.raw)==null?void 0:T.title.name}),defaultStyle:Q(()=>n.readerStyle),defaultDirection:Q(()=>n.direction),defaultGap:Q(()=>n.defaultGap),defaultSpeed:Q(()=>n.defaultSpeed)}),B=re(!1),C=Wp(p,N,D),H=Q(()=>p.value.length),X=Q(()=>c.value>=H.value),k=Q(()=>n.raw?Xp({raw:n.raw,spec:n.spec,siteMeta:n.siteMeta,onSelect:n.offlineMode?T=>o("selectChapter",T):void 0}):void 0),E=re(null),Y=re(null),te=re(!1),K=re(!1),v=Yp({autoPlay:!n.tourEnabled&&n.autoPlay,touchDevice:n.touchDevice,scrollEl:Q(()=>{var T;return(T=E.value)==null?void 0:T.rootEl}),speed:g,isRTL:L,isVertical:Z,isLongStrip:O}),b=Q(()=>!n.touchDevice&&v.isIdle.value&&!u.value&&!B.value),j=Q({get(){return S.value},set(T){v.interfere(()=>{S.value=T})}}),ee=qp({page:c,totalImgs:H,style:x,direction:y,isLongStrip:O,isVertical:Z,isRTL:L,spaceTop:f,isWebtoon:h,scrollEl:Q(()=>{var T;return(T=E.value)==null?void 0:T.rootEl}),interferePlayer:T=>v.interfere(T),onChangedPage:Le,onInitialized(){o("ready"),a.value=!0,s=Ae(),n.hideControlsEvent===Un.onLoad&&M(!0)},onFinished:()=>o("finished")}),le=Q(()=>Math.floor(c.value)),we=Q(()=>O.value?c.value:N.value?V():Math.floor(c.value)),ke=()=>v.interfere(()=>Wn(100));nf().addListener({onKeyDown:T=>{if(n.tourEnabled)return;const I=O.value&&Z.value,se=O.value&&!Z.value,ge=!O.value&&Z.value,Ue=!O.value&&!Z.value;switch(T.key){case" ":T.preventDefault(),O.value?(de(!1),v.toggle()):M();break;case"ArrowUp":case"PageUp":I?ke():ge&&le.value!==0&&(T.preventDefault(),$());break;case"ArrowDown":case"PageDown":I?ke():ge&&!X.value&&(T.preventDefault(),F());break;case"ArrowLeft":se?ke():Ue?(T.preventDefault(),z()):Z.value&&on();break;case"ArrowRight":se?ke():Ue?(T.preventDefault(),A()):Z.value&&Me();break;case"Escape":T.preventDefault();break}},onKeyUp:T=>{switch(T.key){case"b":D.value=!D.value;break;case"f":U();break;case"t":ne();break;case"h":de();break}}}),Ru(()=>o("hapticFeedback")),Dt("fullscreenchange",()=>{te.value=!!document.fullscreenElement}),n.touchDevice&&pe(Pi(),I=>{I==="hidden"&&(v.isPlaying.value?v.stop():n.fullScreen&&M(!1))}),pe(v.isPlaying,T=>{T||M(!1),o("playingChanged",T)}),pe(v.isIdle,T=>{v.isPlaying.value&&M(T)}),pe(u,T=>{!T&&v.isIdle.value?v.awake():T&&n.fullScreen&&M()});function Le(T){if(c.value===T)return;const I=p.value.length;if(T<0||T>=I+1)return;const se=Math.floor(T*100)/100;if(se===c.value)return;const ge=c.value;if(c.value=se,o("pageChanged",se),T>=I){M(!1),v.stop();return}if(T<.01&&ge>T){M(!1),v.awake();return}const rt=n.hideControlsEvent??Un.firstMove;if(!r&&rt===Un.firstMove){(O.value?s!==void 0&&Math.abs(Ae()-s)>300:Math.abs(ge-T)>=1)&&M(!0);return}!v.isPlaying.value&&rt===Un.move&&M(!0)}function Ae(){var I;const T=(I=E.value)==null?void 0:I.rootEl;return T?Z.value?T.scrollTop:L.value?-T.scrollLeft:T.scrollLeft:0}function Ke(){!n.touchDevice&&!O.value&&ee.goToPage(le.value,{smooth:!0})}function it(){if(v.isPlaying.value){!n.fullScreen||!n.touchDevice?v.stop():v.awake();return}M()}function ft(T){n.offlineMode&&(T.preventDefault(),o("pressedBack"))}function Me(T=!1){var I,se;(se=(I=k.value)==null?void 0:I.next)==null||se.call(I,T)}function on(T=!1){var I,se;(se=(I=k.value)==null?void 0:I.prev)==null||se.call(I,T)}function d(T){L.value?Me(_(T)):on(_(T))}function m(T){L.value?on(_(T)):Me(_(T))}function _(T){return!n.touchDevice&&(T.ctrlKey||T.metaKey)}function z(){L.value?F():$()}function A(){L.value?$():F()}function $(){var se;const T=C.value,I=X.value?T[T.length-1][0].index:(se=T[V()-1])==null?void 0:se[0].index;I!==void 0?ee.goToPage(I):on()}function F(){var T,I;if(X.value)Me();else{const se=((I=(T=C.value[V()+1])==null?void 0:T[0])==null?void 0:I.index)??p.value.length;ee.goToPage(se)}}function V(){const T=le.value,I=C.value.findIndex(se=>se.some(({index:ge})=>ge===T));return I===-1?C.value.length-1:I}function R(){if(n.offlineMode){o("pressedBack");return}Up(),o("dispose")}async function M(T){if(u.value&&!n.fullScreen)return;const I=typeof T=="boolean"?T:!n.fullScreen;I!==n.fullScreen&&(r=!0,o("fullScreenChanged",I),I&&setTimeout(()=>{n.fullScreen&&u.value&&o("fullScreenChanged",!1)},100))}function ne(){n.entryId?ae():oe()}function U(){var T,I;document.fullscreenElement?document.exitFullscreen():(I=(T=Y.value)==null?void 0:T.rootEl)==null||I.requestFullscreen()}function oe(){v.stop(),o("addEntry")}function ae(){v.stop(),o("openEntry",n.entryId)}function de(T){K.value!==T&&(K.value=!K.value,K.value&&v.isPlaying.value&&v.stop())}return(T,I)=>e.immediate||l.value?(P(),me(kl,{key:0,ref_key:"root",ref:Y,loading:!a.value,immediate:!!e.immediate,"full-screen":!!e.fullScreen,zooming:B.value,idle:b.value,"space-top":f.value,rtl:G(L),onClick:I[15]||(I[15]=We(()=>{},["stop"]))},bo({settings:ue(()=>{var se;return[J(cl,{"reader-style":G(x),"onUpdate:readerStyle":I[6]||(I[6]=ge=>Oe(x)?x.value=ge:null),direction:G(y),"onUpdate:direction":I[7]||(I[7]=ge=>Oe(y)?y.value=ge:null),gap:G(w),"onUpdate:gap":I[8]||(I[8]=ge=>Oe(w)?w.value=ge:null),speed:G(g),"onUpdate:speed":I[9]||(I[9]=ge=>Oe(g)?g.value=ge:null),zoom:j.value,"onUpdate:zoom":I[10]||(I[10]=ge=>j.value=ge),name:(se=e.raw)==null?void 0:se.title.name,webtoon:G(h),disabled:!l.value,onMore:I[11]||(I[11]=()=>o("openDefaultPreferences"))},null,8,["reader-style","direction","gap","speed","zoom","name","webtoon","disabled"])]}),"reset-zoom":ue(()=>[J(Eo,{name:"fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ue(()=>[B.value||G(S)!==1?(P(),me(fl,{key:0,zoom:j.value,onClick:I[14]||(I[14]=We(()=>j.value=1,["stop"])),class:"duration-200"},null,8,["zoom"])):$e("",!0)]),_:1})]),default:ue(()=>[l.value?(P(),me(Sl,{key:0,ref_key:"body",ref:E,zoom:j.value,"onUpdate:zoom":I[0]||(I[0]=se=>j.value=se),zooming:B.value,"onUpdate:zooming":I[1]||(I[1]=se=>B.value=se),page:G(c),"page-index":le.value,pages:G(C),"total-imgs":G(p).length,direction:G(y),gap:G(w),"is-long-strip":G(O),isRTL:G(L),"is-double":G(N),"is-vertical":G(Z),"space-top":f.value||0,busy:G(u),"play-controller":G(v),"touch-device":e.touchDevice,"pinch-to-zoome":e.pinchToZoom??!0,"tap-zone":e.tapZone,"full-screen":!!e.fullScreen,onReady:G(ee).init,onPrev:$,onNext:F,onClick:it,onDragEnd:Ke,onWheelPassive:I[2]||(I[2]=()=>G(v).interfere())},bo({_:2},[l.value&&G(p).length?{name:"end",fn:ue(()=>{var se;return[J(nl,{"has-next":!!((se=k.value)!=null&&se.next),"offline-mode":!!e.offlineMode,seconds:e.autoNextSeconds??5,onNext:Me,onHide:R},bo({_:2},[G(S)===1&&!e.entryId&&e.raw&&!e.offlineMode?{name:"bottom-center",fn:ue(()=>[J(Ai,{class:"bg-primary w-min !h-9 !bg-opacity-100",onClick:ne},{default:ue(()=>[q("div",Qp,[J(Ll,{class:"flex-shrink-0 w-auto"}),I[16]||(I[16]=q("span",{class:"text-sm"},"Add to library",-1))])]),_:1})]),key:"0"}:void 0]),1032,["has-next","offline-mode","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","play-controller","touch-device","pinch-to-zoome","tap-zone","full-screen","onReady"])):$e("",!0),a.value&&!X.value&&!e.tourEnabled?(P(),me(vl,{key:1,direction:G(y),"tap-zone":e.tapZone},null,8,["direction","tap-zone"])):$e("",!0),a.value&&!X.value?(P(),me(wl,{key:2,playing:!!G(v).isPlaying.value},null,8,["playing"])):$e("",!0),K.value?(P(),me(bl,{key:3,"touch-device":e.touchDevice,onHide:de},null,8,["touch-device"])):$e("",!0),e.tourEnabled?(P(),me(Cl,{key:4,onHide:I[3]||(I[3]=()=>o("tourEnabledChanged",!1))})):$e("",!0)]),_:2},[e.raw||e.offlineMode?{name:"back",fn:ue(()=>[J(ct,{href:e.offlineMode||!e.raw?"#":e.raw.title.url,title:"Back to manga","enable-haptic-feedback":"",onClick:ft},{default:ue(()=>[J(Tl)]),_:1},8,["href"])]),key:"0"}:void 0,!e.touchDevice&&!e.offlineMode?{name:"exit",fn:ue(()=>[J(ct,{title:"Hide reader","data-tour":"You have entered reader mode, press here to return to the original page",onClick:R},{default:ue(()=>[J(Dl)]),_:1})]),key:"1"}:void 0,k.value?{name:"chapter-nav",fn:ue(()=>{var se;return[J(gl,{"touch-device":e.touchDevice,"chapter-spec":(se=e.spec)==null?void 0:se.chapter,data:k.value,onGetHiddenChapters:I[4]||(I[4]=()=>o("getHiddenChapters")),onChaptersDialogOpen:I[5]||(I[5]=()=>M(!0))},null,8,["touch-device","chapter-spec","data"]),k.value.next||k.value.prev?(P(),W("div",eh,[J(ct,{title:`${G(L)?"Next":"Prev"} chapter (←)`,disabled:G(L)?!k.value.next:!k.value.prev,class:"!rounded-r-none","enable-haptic-feedback":"",onClick:d},{default:ue(()=>[J(El)]),_:1},8,["title","disabled"]),J(ct,{title:`${G(L)?"Prev":"Next"} chapter (→)`,disabled:G(L)?!k.value.prev:!k.value.next,class:"!rounded-l-none","enable-haptic-feedback":"",onClick:m},{default:ue(()=>[J(Pl)]),_:1},8,["title","disabled"])])):$e("",!0)]}),key:"2"}:void 0,G(C).length?{name:"page-nav",fn:ue(()=>[J(yl,{"model-value":le.value,disabled:!a.value,pages:G(C),"total-imgs":G(p).length,"onUpdate:modelValue":G(ee).goToPage},null,8,["model-value","disabled","pages","total-imgs","onUpdate:modelValue"])]),key:"3"}:void 0,!e.offlineMode&&e.raw?{name:"entry",fn:ue(()=>[J(ct,{title:e.entryId?"View entry (T)":"Add to library (T)","data-tour":"Prress here to add to your collection",onClick:ne},{default:ue(()=>[e.entryId?(P(),me(Ml,{key:0})):(P(),me(Il,{key:1}))]),_:1},8,["title"])]),key:"4"}:void 0,e.touchDevice?void 0:{name:"full-screen",fn:ue(()=>[J(ct,{title:`${te.value?"Exit":"Enter"} fullscreen (F)`,onClick:U},{default:ue(()=>[te.value?(P(),me(zl,{key:0})):(P(),me(Al,{key:1}))]),_:1},8,["title"])]),key:"5"},G(O)?{name:"play",fn:ue(()=>[J(ct,{"data-tour":"Press here to play like a video",title:`${G(v).isPlaying.value?"Pause":"Play"} (Space)`,disabled:!a.value,onClick:I[12]||(I[12]=()=>G(v).toggle())},{default:ue(()=>[G(v).isPlaying.value?(P(),me(ji,{key:0})):(P(),me(Bi,{key:1}))]),_:1},8,["title","disabled"])]),key:"6"}:void 0,G(N)?{name:"break-first",fn:ue(()=>[J(ct,{title:"Break 1st page (B)","data-tour":"Press here to separate the first page from double-page mode",disabled:!a.value,onClick:I[13]||(I[13]=()=>D.value=!G(D))},{default:ue(()=>[G(D)?(P(),me(Ol,{key:0})):(P(),me($l,{key:1}))]),_:1},8,["disabled"])]),key:"7"}:void 0,e.progressSize!==0&&!X.value?{name:"progress",fn:ue(()=>[J(xl,{value:we.value,total:G(C).length,"long-strip":G(O),height:e.progressSize??2,rtl:G(L)},null,8,["value","total","long-strip","height","rtl"])]),key:"8"}:void 0]),1032,["loading","immediate","full-screen","zooming","idle","space-top","rtl"])):$e("",!0)}}),[["styles",['*,: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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}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-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;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{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-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]:where(:not([hidden=until-found])){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%}.container,svg{width:100%}@media (min-width:300px){.container{max-width:300px}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.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}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\\/2{left:50%}.left-10{left:40px}.left-9{left:36px}.right-0{right:0}.top-0{top:0}.top-1\\/2{top:50%}.top-10{top:40px}.top-9{top:36px}.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-2{margin-bottom:8px}.mb-5{margin-bottom:20px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.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-9{height:36px!important}.h-0{height:0}.h-1{height:4px}.h-1\\/3{height:33.333333%}.h-10{height:40px}.h-12{height:48px}.h-14{height:56px}.h-16{height:64px}.h-2{height:8px}.h-20{height:80px}.h-24{height:96px}.h-28{height:112px}.h-4{height:16px}.h-5{height:20px}.h-9{height:36px}.h-\\[101\\%\\]{height:101%}.h-full{height:100%}.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-0{width:0}.w-1{width:4px}.w-1\\/3{width:33.333333%}.w-10{width:40px}.w-12{width:48px}.w-14{width:56px}.w-2{width:8px}.w-20{width:80px}.w-24{width:96px}.w-28{width:112px}.w-4{width:16px}.w-40{width:160px}.w-5{width:20px}.w-\\[4\\.8rem\\]{width:76.8px}.w-auto{width:auto}.w-full{width:100%}.w-min{width:-moz-min-content;width:min-content}.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\\.5{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\\.5{--tw-translate-y:-6px}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.translate-y-0{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-0{--tw-translate-y:0px}.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-90{--tw-rotate:-90deg}.-rotate-90,.rotate-180{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-180{--tw-rotate:180deg}.rotate-90{--tw-rotate:90deg}.rotate-90,.scale-95{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-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-y-90{--tw-scale-y:.9}.scale-y-90,.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}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.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-2{gap:8px}.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-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-xl{border-radius:12px}.\\!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-xl{border-top-left-radius:12px;border-top-right-radius:12px}.border-2{border-width:2px}.border-4{border-width:4px}.border-t-\\[1px\\]{border-top-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-stone-400{--tw-border-opacity:1;border-color:rgb(168 162 158/var(--tw-border-opacity,1))}.border-stone-600{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity,1))}.border-textPrimary{--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1))}.border-opacity-30{--tw-border-opacity:.3}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(184 92 56/var(--tw-bg-opacity,1))}.bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.bg-stone-300{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.bg-stone-600{--tw-bg-opacity:1;background-color:rgb(87 83 78/var(--tw-bg-opacity,1))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity,1))}.bg-stone-900{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.bg-textPrimary{--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.\\!bg-opacity-100{--tw-bg-opacity:1!important}.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-0\\.5{padding:2px}.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\\.5{padding-bottom:6px;padding-top:6px}.py-2{padding-bottom:8px;padding-top:8px}.pb-12{padding-bottom:48px}.pb-6{padding-bottom:24px}.pb-7{padding-bottom:28px}.pl-1{padding-left:4px}.pr-2{padding-right:8px}.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}.font-normal{font-weight:400}.lowercase{text-transform:lowercase}.leading-none{line-height:1}.text-stone-100{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity,1))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity,1))}.text-stone-800{--tw-text-opacity:1;color:rgb(41 37 36/var(--tw-text-opacity,1))}.text-textPrimary{--tw-text-opacity:1;color:rgb(251 130 82/var(--tw-text-opacity,1))}.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)}.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)}.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,1))}.hover\\:bg-stone-300:hover{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.hover\\:bg-stone-900:hover{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity:.1}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:.5}.hover\\:bg-opacity-80:hover{--tw-bg-opacity:.8}.hover\\:text-stone-100:hover{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}.hover\\:text-stone-400:hover{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity,1))}}.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,1))}.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\\:mb-0{margin-bottom:0}.sm\\:mb-8{margin-bottom:32px}.sm\\:flex{display:flex}.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\\:pb-6{padding-bottom:24px}.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}.lg\\:pb-4{padding-bottom:16px}}@media (min-width:1280px){.xl\\:px-12{padding-left:48px;padding-right:48px}}']]]),th=Object.freeze(Object.defineProperty({__proto__:null,default:Wl},Symbol.toStringTag,{value:"Module"})),nh=Object.freeze(Object.defineProperty({__proto__:null,default:Ce({__name:"IntersectionWrapper",emits:["visible"],setup(e,{emit:t}){const n=t,o=re(null),i=re(!1);return Qe(async()=>{await Pt(),$i(o,r=>{const s=r.some(l=>l.isIntersecting);s!==i.value&&(i.value=s),s&&n("visible")})}),(r,s)=>(P(),W("div",{ref_key:"root",ref:o},[Te(r.$slots,"default",{visible:i.value})],512))}})},Symbol.toStringTag,{value:"Module"})),oh={},ih={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function rh(e,t){return P(),W("svg",ih,[...t[0]||(t[0]=[q("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)])])}const sh=Object.freeze(Object.defineProperty({__proto__:null,default:be(oh,[["render",rh]])},Symbol.toStringTag,{value:"Module"})),lh={},ah={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function ch(e,t){return P(),W("svg",ah,[...t[0]||(t[0]=[q("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)])])}const uh=Object.freeze(Object.defineProperty({__proto__:null,default:be(lh,[["render",ch]])},Symbol.toStringTag,{value:"Module"})),fh="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]),html.gear-second>body~*{visibility:hidden!important}html.gear-second>body~*{display:none!important;height:0!important;left:100%!important;max-height:0!important;max-width:0!important;opacity:0!important;pointer-events:none!important;top:100%!important;width:0!important}.mp-scroll-container{max-height:100vh!important;overflow:hidden!important}html:has(body.mp-scroll-container){overflow:auto!important}",nn="gear-second",Wi={immediate:void 0,raw:void 0,spec:void 0,siteMeta: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,offlineMode:void 0,autoNextSeconds:void 0,defaultGap:void 0,progressSize:void 0,hideControlsEvent:void 0,pinchToZoom:void 0,tapZone:void 0,onError:void 0,onCrash:void 0,onDispose:void 0,onFullScreenChanged:void 0,onPageChanged:void 0,onOpenEntry:void 0,onAddEntry:void 0,onFinished:void 0,onHapticFeedback:void 0,onPressedBack:void 0,onSelectChapter:void 0,onTimeout:void 0,onOpenDefaultPreferences:void 0},ot={promise:void 0,data:ro({...Wi})};async function dh(e){return ot.promise?(ot.data.raw=e.raw,await ot.promise):(ot.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(nn),Object.assign(ot.data,Wi),ot.promise=void 0)},u=nt(p=>{var h;return!n&&((h=e.onPageChanged)==null?void 0:h.call(e,p))},300);Object.assign(ot.data,Wi,e,{immediate:l,onReady(){l||(c(),document.documentElement.classList.add(nn))},onError(){var p,h;a(),o?((p=e.onDispose)==null||p.call(e),(h=e.onError)==null||h.call(e)):f()},onDispose:()=>{var p;a(),(p=e==null?void 0:e.onDispose)==null||p.call(e)},onFullScreenChanged:p=>{var h;ot.data.fullScreen=p,(h=e.onFullScreenChanged)==null||h.call(e,p)},onPageChanged:p=>{ot.data.page=p,!(s>=p)&&(s=p,u(p))},onTourEnabledChanged:p=>{ot.data.tourEnabled=p}}),ph().then(()=>{if(n){f();return}r=document.createElement(nn),l?(document.documentElement.classList.add(nn),document.body.appendChild(r),setTimeout(c)):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(nn),document.body.appendChild(r))},100)});function c(){o||(o=!0,t({updateArgs(p){Object.assign(ot.data,p)},dispose:a}))}function f(){o||t(void 0)}}),await ot.promise)}async function ph(){if(window.customElements.get(nn))return;const e=document.createElement("style"),t=fh;e.appendChild(document.createTextNode(t)),document.head.appendChild(e);const n=hu({styles:[await hh()],data:()=>({readerData:ot.data}),render(){return _s(Wl,this.readerData)}});window.customElements.define(nn,n)}async function hh(){const e=Object.assign({"./App.vue":th,"./components/AutoNext.vue":Uu,"./components/BaseButton.vue":Yu,"./components/BottomSheet.vue":lf,"./components/ButtonDropdown.vue":td,"./components/ButtonIcon.vue":Xu,"./components/ButtonReaderSettings.vue":Af,"./components/ButtonResetZoom.vue":Nf,"./components/ChapterNav.vue":nd,"./components/DirectionToast.vue":ld,"./components/DropdownMenu.vue":Gf,"./components/GesturesContainer.vue":xd,"./components/HelpScreen.vue":ad,"./components/InputPercentage.vue":uf,"./components/InputSelect.vue":pf,"./components/IntersectionWrapper.vue":nh,"./components/LoadingIndicator.vue":Td,"./components/PageNav.vue":cd,"./components/PauseToast.vue":bd,"./components/ProgressBar.vue":wd,"./components/ReaderBody.vue":$d,"./components/ReaderLayout.vue":Rd,"./components/ReaderTour.vue":Nd,"./components/TableField.vue":mf,"./components/icons/IconBack.vue":Wd,"./components/icons/IconBookmarkNew.vue":Zd,"./components/icons/IconBookmarked.vue":Jd,"./components/icons/IconChevronLeft.vue":np,"./components/icons/IconChevronRight.vue":sp,"./components/icons/IconClose.vue":ef,"./components/icons/IconDouble.vue":up,"./components/icons/IconDoubleSkip.vue":hp,"./components/icons/IconExclamationCircle.vue":sh,"./components/icons/IconFullscreen.vue":bp,"./components/icons/IconFullscreenExit.vue":_p,"./components/icons/IconHelp.vue":uh,"./components/icons/IconLoading.vue":Wf,"./components/icons/IconMoreVert.vue":wf,"./components/icons/IconNext.vue":sd,"./components/icons/IconPause.vue":pd,"./components/icons/IconPlay.vue":vd,"./components/icons/IconPlus.vue":Tp,"./components/icons/IconReaderExit.vue":Pp,"./components/icons/IconSettings.vue":kf,"./components/icons/IconTriangle.vue":Zf,"./components/icons/IconZoom.vue":jf}),t=[];for(const n in e){const o=e[n];t.push(o.default.styles)}return t.join("")}return dh});
|