vendor: 9,158 bytes, lines 1-2
1import{i as Te,j as n,w as De}from"./index-CGi0bt1A.js";import{r as S}from"./react-D88zDUjx.js";import{getLookups as ze}from"./lookupsApi-CH4kcInp.js";import{bulkCollectToLoom as _e}from"./collectionsApi-DdIrCYUQ.js";import"./epub-iBTXOzSI.js";var ge={};(function r(o,a,d,l){var g=!!(o.Worker&&o.Blob&&o.Promise&&o.OffscreenCanvas&&o.OffscreenCanvasRenderingContext2D&&o.HTMLCanvasElement&&o.HTMLCanvasElement.prototype.transferControlToOffscreen&&o.URL&&o.URL.createObjectURL),x=typeof Path2D=="function"&&typeof DOMMatrix=="function",j=function(){if(!o.OffscreenCanvas)return!1;try{var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var u=t.transferToImageBitmap();e.createPattern(u,"no-repeat")}catch{return!1}return!0}();function h(){}function i(t){var e=a.exports.Promise,u=e!==void 0?e:o.Promise;return typeof u=="function"?new u(t):(t(h,h),null)}var $=function(t,e){return{transform:function(u){if(t)return u;if(e.has(u))return e.get(u);var c=new OffscreenCanvas(u.width,u.height),p=c.getContext("2d");return p.drawImage(u,0,0),e.set(u,c),c},clear:function(){e.clear()}}}(j,new Map),N=function(){var t=Math.floor(16.666666666666668),e,u,c={},p=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(e=function(y){var w=Math.random();return c[w]=requestAnimationFrame(function m(k){p===k||p+t-1<k?(p=k,delete c[w],y()):c[w]=requestAnimationFrame(m)}),w},u=function(y){c[y]&&cancelAnimationFrame(c[y])}):(e=function(y){return setTimeout(y,t)},u=function(y){return clearTimeout(y)}),{frame:e,cancel:u}}(),F=function(){var t,e,u={};function c(p){function y(w,m){p.postMessage({options:w||{},callback:m})}p.init=function(m){var k=m.transferControlToOffscreen();p.postMessage({canvas:k},[k])},p.fire=function(m,k,C){if(e)return y(m,null),e;var P=Math.random().toString(36).slice(2);return e=i(function(A){function B(W){W.data.callback===P&&(delete u[P],p.removeEventListener("message",B),e=null,$.clear(),C(),A())}p.addEventListener("message",B),y(m,P),u[P]=B.bind(null,{data:{callback:P}})}),e},p.reset=function(){p.postMessage({reset:!0});for(var m in u)u[m](),delete u[m]}}return function(){if(t)return t;if(!d&&g){var p=["var CONFETTI, SIZE = {}, module = {};","("+r.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 2`);try{t=new Worker(URL.createObjectURL(new Blob([p])))}catch(y){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",y),null}c(t)}return t}}(),f={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function D(t,e){return e?e(t):t}function L(t){return t!=null}function b(t,e,u){return D(t&&L(t[e])?t[e]:f[e],u)}function _(t){return t<0?0:Math.floor(t)}function O(t,e){return Math.floor(Math.random()*(e-t))+t}function z(t){return parseInt(t,16)}function R(t){return t.map(V)}function V(t){var e=String(t).replace(/[^0-9a-f]/gi,"");return e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),{r:z(e.substring(0,2)),g:z(e.substring(2,4)),b:z(e.substring(4,6))}}function I(t){var e=b(t,"origin",Object);return e.x=b(e,"x",Number),e.y=b(e,"y",Number),e}function G(t){t.width=document.documentElement.clientWidth,t.height=document.documentElement.clientHeight}function v(t){var e=t.getBoundingClientRect();t.width=e.width,t.height=e.height}function J(t){var e=document.createElement("canvas");return e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=t,e}function K(t,e,u,c,p,y,w,m,k){t.save(),t.translate(e,u),t.rotate(y),t.scale(c,p),t.arc(0,0,1,w,m,k),t.restore()}function X(t){var e=t.angle*(Math.PI/180),u=t.spread*(Math.PI/180);return{x:t.x,y:t.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:t.startVelocity*.5+Math.random()*t.startVelocity,angle2D:-e+(.5*u-Math.random()*u),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:t.color,shape:t.shape,tick:0,totalTicks:t.ticks,decay:t.decay,drift:t.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:t.gravity*3,ovalScalar:.6,scalar:t.scalar,flat:t.flat}}function H(t,e){e.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.x+10*e.scalar,e.wobbleY=e.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);var u=e.tick++/e.totalTicks,c=e.x+e.random*e.tiltCos,p=e.y+e.random*e.tiltSin,y=e.wobbleX+e.random*e.tiltCos,w=e.wobbleY+e.random*e.tiltSin;if(t.fillStyle="rgba("+e.color.r+", "+e.color.g+", "+e.color.b+", "+(1-u)+")",t.beginPath(),x&&e.shape.type==="path"&&typeof e.shape.path=="string"&&Array.isArray(e.shape.matrix))t.fill(re(e.shape.path,e.shape.matrix,e.x,e.y,Math.abs(y-c)*.1,Math.abs(w-p)*.1,Math.PI/10*e.wobble));else if(e.shape.type==="bitmap"){var m=Math.PI/10*e.wobble,k=Math.abs(y-c)*.1,C=Math.abs(w-p)*.1,P=e.shape.bitmap.width*e.scalar,A=e.shape.bitmap.height*e.scalar,B=new DOMMatrix([Math.cos(m)*k,Math.sin(m)*k,-Math.sin(m)*C,Math.cos(m)*C,e.x,e.y]);B.multiplySelf(new DOMMatrix(e.shape.matrix));var W=t.createPattern($.transform(e.shape.bitmap),"no-repeat");W.setTransform(B),t.globalAlpha=1-u,t.fillStyle=W,t.fillRect(e.x-P/2,e.y-A/2,P,A),t.globalAlpha=1}else if(e.shape==="circle")t.ellipse?t.ellipse(e.x,e.y,Math.abs(y-c)*e.ovalScalar,Math.abs(w-p)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI):K(t,e.x,e.y,Math.abs(y-c)*e.ovalScalar,Math.abs(w-p)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI);else if(e.shape==="star")for(var T=Math.PI/2*3,s=4*e.scalar,E=8*e.scalar,M=e.x,Y=e.y,q=5,Q=Math.PI/q;q--;)M=e.x+Math.cos(T)*E,Y=e.y+Math.sin(T)*E,t.lineTo(M,Y),T+=Q,M=e.x+Math.cos(T)*s,Y=e.y+Math.sin(T)*s,t.lineTo(M,Y),T+=Q;else t.moveTo(Math.floor(e.x),Math.floor(e.y)),t.lineTo(Math.floor(e.wobbleX),Math.floor(p)),t.lineTo(Math.floor(y),Math.floor(w)),t.lineTo(Math.floor(c),Math.floor(e.wobbleY));return t.closePath(),t.fill(),e.tick<e.totalTicks}function ee(t,e,u,c,p){var y=e.slice(),w=t.getContext("2d"),m,k,C=i(function(P){function A(){m=k=null,w.clearRect(0,0,c.width,c.height),$.clear(),p(),P()}function B(){d&&!(c.width===l.width&&c.height===l.height)&&(c.width=t.width=l.width,c.height=t.height=l.height),!c.width&&!c.height&&(u(t),c.width=t.width,c.height=t.height),w.clearRect(0,0,c.width,c.height),y=y.filter(function(W){return H(w,W)}),y.length?m=N.frame(B):A()}m=N.frame(B),k=A});return{addFettis:function(P){return y=y.concat(P),C},canvas:t,promise:C,reset:function(){m&&N.cancel(m),k&&k()}}}function Z(t,e){var u=!t,c=!!b(e||{},"resize"),p=!1,y=b(e,"disableForReducedMotion",Boolean),w=g&&!!b(e||{},"useWorker"),m=w?F():null,k=u?G:v,C=t&&m?!!t.__confetti_initialized:!1,P=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,A;function B(T,s,E){for(var M=b(T,"particleCount",_),Y=b(T,"angle",Number),q=b(T,"spread",Number),Q=b(T,"startVelocity",Number),Ee=b(T,"decay",Number),Ae=b(T,"gravity",Number),$e=b(T,"drift",Number),xe=b(T,"colors",R),Re=b(T,"ticks",Number),we=b(T,"shapes"),Pe=b(T,"scalar"),Le=!!b(T,"flat"),ke=I(T),Me=M,fe=[],Ie=t.width*ke.x,Be=t.height*ke.y;Me--;)fe.push(X({x:Ie,y:Be,angle:Y,spread:q,startVelocity:Q,color:xe[Me%xe.length],shape:we[O(0,we.length)],ticks:Re,decay:Ee,gravity:Ae,drift:$e,scalar:Pe,flat:Le}));return A?A.addFettis(fe):(A=ee(t,fe,k,s,E),A.promise)}function W(T){var s=y||b(T,"disableForReducedMotion",Boolean),E=b(T,"zIndex",Number);if(s&&P)return i(function(Q){Q()});u&&A?t=A.canvas:u&&!t&&(t=J(E),document.body.appendChild(t)),c&&!C&&k(t);var M={width:t.width,height:t.height};m&&!C&&m.init(t),C=!0,m&&(t.__confetti_initialized=!0);function Y(){if(m){var Q={getBoundingClientRect:function(){if(!u)return t.getBoundingClientRect()}};k(Q),m.postMessage({resize:{width:Q.width,height:Q.height}});return}M.width=M.height=null}function q(){A=null,c&&(p=!1,o.removeEventListener("resize",Y)),u&&t&&(document.body.contains(t)&&document.body.removeChild(t),t=null,C=!1)}return c&&!p&&(p=!0,o.addEventListener("resize",Y,!1)),m?m.fire(T,M,q):B(T,M,q)}return W.reset=function(){m&&m.reset(),A&&A.reset()},W}var ne;function oe(){return ne||(ne=Z(null,{useWorker:!0,resize:!0})),ne}function re(t,e,u,c,p,y,w){var m=new Path2D(t),k=new Path2D;k.addPath(m,new DOMMatrix(e));
2var C=new Path2D;return C.addPath(k,new DOMMatrix([Math.cos(w)*p,Math.sin(w)*p,-Math.sin(w)*y,Math.cos(w)*y,u,c])),C}function he(t){if(!x)throw new Error("path confetti are not supported in this browser");var e,u;typeof t=="string"?e=t:(e=t.path,u=t.matrix);var c=new Path2D(e),p=document.createElement("canvas"),y=p.getContext("2d");if(!u){for(var w=1e3,m=w,k=w,C=0,P=0,A,B,W=0;W<w;W+=2)for(var T=0;T<w;T+=2)y.isPointInPath(c,W,T,"nonzero")&&(m=Math.min(m,W),k=Math.min(k,T),C=Math.max(C,W),P=Math.max(P,T));A=C-m,B=P-k;var s=10,E=Math.min(s/A,s/B);u=[E,0,0,E,-Math.round(A/2+m)*E,-Math.round(B/2+k)*E]}return{type:"path",path:e,matrix:u}}function ue(t){var e,u=1,c="#000000",p='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof t=="string"?e=t:(e=t.text,u="scalar"in t?t.scalar:u,p="fontFamily"in t?t.fontFamily:p,c="color"in t?t.color:c);var y=10*u,w=""+y+"px "+p,m=new OffscreenCanvas(y,y),k=m.getContext("2d");k.font=w;var C=k.measureText(e),P=Math.ceil(C.actualBoundingBoxRight+C.actualBoundingBoxLeft),A=Math.ceil(C.actualBoundingBoxAscent+C.actualBoundingBoxDescent),B=2,W=C.actualBoundingBoxLeft+B,T=C.actualBoundingBoxAscent+B;P+=B+B,A+=B+B,m=new OffscreenCanvas(P,A),k=m.getContext("2d"),k.font=w,k.fillStyle=c,k.fillText(e,W,T);var s=1/u;return{type:"bitmap",bitmap:m.transferToImageBitmap(),matrix:[s,0,0,s,-P*s/2,-A*s/2]}}a.exports=function(){return oe().apply(this,arguments)},a.exports.reset=function(){oe().reset()},a.exports.create=Z,a.exports.shapeFromPath=he,a.exports.shapeFromText=ue})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),ge,!1);const se=ge.exports;ge.exports.create;const de=440,ve=100,je=22,We=18,Ve=.72,me=14,pe=[5*60*1e3,20*60*1e3,45*60*1e3,90*60*1e3],Oe=[2,2.8,3.6,4.5,5.5];function Je(r){for(let o=0;o<pe.length;o++)if(r<=pe[o])return o;return pe.length}function Ue(r){if(!r||r.length===0)return[];const o=r.length;return r.map((a,d)=>{const l=o===1?de/2:je+d/(o-1)*(de-je*2),g=Math.sin(d*Ve+.4)*We,x=ve/2+g,j=a.total_ms||0,h=Je(j);return{x:l,y:x,tier:h,r:Oe[h],date:a.date,total_ms:j}})}function Ge(r){if(r.length===0)return"";if(r.length===1)return`M ${r[0].x} ${r[0].y}`;let o=`M ${r[0].x} ${r[0].y}`;for(let a=0;a<r.length-1;a++){const d=r[a-1]||r[a],l=r[a],g=r[a+1],x=r[a+2]||g,j=l.x+(g.x-d.x)/6,h=l.y+(g.y-d.y)/6,i=g.x-(x.x-l.x)/6,$=g.y-(x.y-l.y)/6;o+=` C ${j.toFixed(2)} ${h.toFixed(2)}, ${i.toFixed(2)} ${$.toFixed(2)}, ${g.x.toFixed(2)} ${g.y.toFixed(2)}`}return o}function ie(r,o){const a=new Date(r+"T12:00:00");return o==="zh"||o==="zh-TW"?`${a.getFullYear()}å¹´${a.getMonth()+1}æ${a.getDate()}æ¥`:o==="ja"?`${a.getFullYear()}å¹´${a.getMonth()+1}æ${a.getDate()}æ¥`:o==="fr"?`${a.getDate()}/${a.getMonth()+1}/${a.getFullYear()}`:`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()]} ${a.getDate()}, ${a.getFullYear()}`}function Ce(r,o){const a=Math.max(1,Math.round(r/6e4));if(a<60)return o("reader.minutesShort",{n:a});const d=Math.floor(a/60),l=a%60;return l===0?o("reader.hoursShort",{n:d}):o("reader.hoursMinutesShort",{h:d,m:l})}function He({days:r}){const{t:o,language:a}=Te(),[d,l]=S.useState(null),g=S.useRef(null),x=r||[],j=Math.max(1,Math.ceil(x.length/me)),[h,i]=S.useState(j-1);S.useEffect(()=>{i(v=>Math.min(v,j-1))},[j]);const $=h*me,N=S.useMemo(()=>x.slice($,$+me),[x,$]),F=S.useMemo(()=>Ue(N),[N]),f=S.useMemo(()=>Ge(F),[F]),D=h===0,L=h===j-1,b=j>1,_=S.useCallback(()=>{i(v=>Math.max(0,v-1)),l(null)},[]),O=S.useCallback(()=>{i(v=>Math.min(j-1,v+1)),l(null)},[j]),z=S.useCallback(v=>{b&&(v.key==="ArrowLeft"?(v.preventDefault(),_()):v.key==="ArrowRight"&&(v.preventDefault(),O()))},[b,_,O]),R=S.useCallback((v,J)=>{const K=g.current;if(!K)return;const X=K.getBoundingClientRect(),H=J.x/de,ee=J.y/ve;l({key:J.date,left:H*X.width,top:ee*X.height-12,date:ie(J.date,a),duration:Ce(J.total_ms,o)})},[a,o]),V=S.useCallback(()=>l(null),[]);if(!F.length)return null;const I=F[0],G=F[F.length-1];return n.jsxs("div",{className:"book-journey",ref:g,"aria-label":o("reader.bookFinishedJourneyLabel"),onKeyDown:z,children:[n.jsxs("div",{className:"book-journey-header",children:[n.jsx("div",{className:"book-journey-eyebrow",children:o("reader.bookFinishedJourneyLabel")}),b&&n.jsxs("div",{className:"book-journey-page-indicator","aria-live":"polite",children:[h+1," / ",j]})]}),n.jsxs("div",{className:"book-journey-canvas",children:[b&&n.jsx("button",{type:"button",className:"book-journey-arrow book-journey-arrow-prev",onClick:_,disabled:D,"aria-label":o("reader.bookFinishedJourneyPrev"),title:o("reader.bookFinishedJourneyPrev"),children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"15 18 9 12 15 6"})})}),n.jsxs("svg",{className:"book-journey-svg",viewBox:`0 0 ${de} ${ve}`,preserveAspectRatio:"none",role:"img",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"journeyPathGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#306F6F"}),n.jsx("stop",{offset:"55%",stopColor:"#4BA29C"}),n.jsx("stop",{offset:"100%",stopColor:"#C4956A"})]})}),n.jsx("path",{className:"book-journey-path",d:f,fill:"none",stroke:"url
2(#journeyPathGradient)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),F.map((v,J)=>{const K=$+J,X=K===0,H=K===x.length-1,ee=["book-journey-stop",`book-journey-stop-tier-${v.tier}`,X?"is-start":"",H?"is-end":"",(d==null?void 0:d.key)===v.date?"is-active":""].filter(Boolean).join(" ");return n.jsxs("g",{className:ee,transform:`translate(${v.x} ${v.y})`,onMouseEnter:Z=>R(Z,v),onMouseLeave:V,onClick:Z=>{Z.stopPropagation(),R(Z,v)},tabIndex:0,role:"button","aria-label":`${ie(v.date,a)} · ${Ce(v.total_ms,o)}`,children:[n.jsx("circle",{r:"12",fill:"transparent"}),v.tier>=3&&n.jsx("circle",{className:"book-journey-stop-halo",r:v.r+4.5}),v.tier>=2&&n.jsx("circle",{className:"book-journey-stop-ring",r:v.r+2.5}),v.tier>=4&&n.jsx("circle",{className:"book-journey-stop-pulse",r:v.r+2.5}),n.jsx("circle",{className:"book-journey-stop-dot",r:v.r})]},v.date)}),L&&G&&n.jsxs("g",{transform:`translate(${G.x} ${G.y})`,"aria-hidden":!0,children:[n.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"-14",stroke:"#2D5A4A",strokeWidth:"1.2",strokeLinecap:"round"}),n.jsx("path",{d:"M 0 -14 L 10 -10.5 L 0 -7.5 Z",fill:"#C4956A"})]})]},h),b&&n.jsx("button",{type:"button",className:"book-journey-arrow book-journey-arrow-next",onClick:O,disabled:L,"aria-label":o("reader.bookFinishedJourneyNext"),title:o("reader.bookFinishedJourneyNext"),children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}),d&&n.jsxs("div",{className:"book-journey-tooltip",style:{left:d.left,top:d.top},role:"status",children:[n.jsx("span",{className:"book-journey-tooltip-date",children:d.date}),n.jsx("span",{className:"book-journey-tooltip-sep",children:" · "}),n.jsx("span",{className:"book-journey-tooltip-duration",children:d.duration})]})]}),n.jsxs("div",{className:"book-journey-endpoints",children:[n.jsx("span",{className:"book-journey-endpoint-left",children:ie(I.date,a)}),n.jsx("span",{className:"book-journey-endpoint-right",children:ie(G.date,a)})]})]})}const U=1080,te=1440,le="#306F6F",ye="#4BA29C",ce="#C4956A",Se="#1F2D2A",be="#6B7A76",Ne="#FAF6EE";function qe(r,o,a,d){const l=[];let g="";const x=i=>/[ã-é¿¿ï¤-ï«¿ê°-í¯]/.test(i),j=[];let h="";for(const i of o)i===" "?(h&&(j.push(h),h=""),j.push(" ")):x(i)?(h&&(j.push(h),h=""),j.push(i)):h+=i;h&&j.push(h);for(const i of j){const $=g+i;if(r.measureText($).width>a&&g?(l.push(g.trimEnd()),g=i===" "?"":i):g=$,l.length>=d)break}if(g&&l.length<d&&l.push(g.trimEnd()),l.length===d){let i=l[d-1];for(;r.measureText(i+"â¦").width>a&&i.length>1;)i=i.slice(0,-1);l.length===d&&j.length&&!g&&(l[d-1]=i+"â¦")}return l}function Fe(r,o){const a=new Date(r+"T12:00:00");return o==="zh"||o==="zh-TW"?`${a.getFullYear()}.${String(a.getMonth()+1).padStart(2,"0")}.${String(a.getDate()).padStart(2,"0")}`:o==="ja"?`${a.getFullYear()}.${String(a.getMonth()+1).padStart(2,"0")}.${String(a.getDate()).padStart(2,"0")}`:`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()]} ${a.getDate()}, ${a.getFullYear()}`}function Ye(r,o){const a=Math.max(1,Math.round(r/6e4));if(a<60)return o!=null&&o.startsWith("zh")?`${a} åé`:o==="ja"?`${a} å`:`${a} min`;const d=Math.floor(a/60),l=a%60;return o!=null&&o.startsWith("zh")?l?`${d} æ¶ ${l} å`:`${d} å°æ¶`:o==="ja"?l?`${d} æé ${l} å`:`${d} æé`:l?`${d} hr ${l} min`:`${d} hr`}function Ke(r,o,a,d,l){if(!l.length)return;const g=40,x=28,j=l.length,h=l.map((F,f)=>{const D=o-d/2+g+f/Math.max(1,j-1)*(d-g*2),L=a+Math.sin(f*.72+.4)*x;return{x:D,y:L,tier:F.tier}}),i=r.createLinearGradient(h[0].x,0,h[h.length-1].x,0);i.addColorStop(0,le),i.addColorStop(.55,ye),i.addColorStop(1,ce),r.strokeStyle=i,r.lineWidth=4,r.lineCap="round",r.beginPath(),r.moveTo(h[0].x,h[0].y);for(let F=0;F<h.length-1;F++){const f=h[F-1]||h[F],D=h[F],L=h[F+1],b=h[F+2]||L,_=D.x+(L.x-f.x)/6,O=D.y+(L.y-f.y)/6,z=L.x-(b.x-D.x)/6,R=L.y-(b.y-D.y)/6;r.bezierCurveTo(_,O,z,R,L.x,L.y)}r.stroke();const $=[6,8,10,12,15];h.forEach((F,f)=>{r.fillStyle=Ne,r.strokeStyle=f===h.length-1?ce:ye,r.lineWidth=3;const D=$[F.tier]||6;r.beginPath(),r.arc(F.x,F.y,D,0,Math.PI*2),r.fill(),r.stroke()});const N=h[h.length-1];r.strokeStyle="#2D5A4A",r.lineWidth=3,r.beginPath(),r.moveTo(N.x,N.y-15),r.lineTo(N.x,N.y-40),r.stroke(),r.fillStyle=ce,r.beginPath(),r.moveTo(N.x,N.y-40),r.lineTo(N.x+22,N.y-32),r.lineTo(N.x,N.y-23),r.closePath(),r.fill()}function Ze(r){const o=[5,20,45,90].map(a=>a*60*1e3);for(let a=0;a<o.length;a++)if(r<=o[a])return a;return 4}function Xe({title:r,finishedCount:o,totalMs:a,highlights:d,notes:l,days:g=[],language:x="en"}){const j=Math.min(window.devicePixelRatio||1,2),h=document.createElement("canvas");h.width=U*j,h.height=te*j,h.style.width=`${U}px`,h.style.height=`${te}px`;const i=h.getContext("2d");i.scale(j,j);const $=i.createRadialGradient(U/2,te*.35,100,U/2,te/2,te*.8);$.addColorStop(0,"#FFFDF6"),$.addColorStop(1,Ne),i.fillStyle=$,i.fillRect(0,0,U,te);const N=i.createLinearGradient(0,0,U,0);N.addColorStop(0,le),N.addColorStop(.55,ye),N.addColorStop(1,ce),i.fillStyle=N,i.fillRect(60,72,U-120,6);const F={zh:"读å®äº","zh-TW":"è®å®äº",ja:"èªã¿çµãã",fr:"Terminé",en:"FINISHED"}[x]||"FINISHED";i.fillStyle=le,i.font='600 32px -apple-system, "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif',i.textAlign="center",i.fillText(F,U/2,140),i.fillStyle=Se,i.font='600 72px "Playfair Display", Georgia, "Noto Serif SC", "Noto Serif", serif';const f=U-160,D=qe(i,r,f,3),L=90,b=240;D.forEach((I,G)=>{i.fillText(I,U/2,b+G*L)});const _=b+(D.length-1)*L,O={zh:`è¿æ¯æå¨ EaseVerse 读å®ç第 ${o} æ¬ä¹¦`,"zh-TW":`鿝æå¨ EaseVerse è®å®ç第 ${o} æ¬æ¸`,ja:`EaseVerse ã§èªã¿çµãã ${o} åç®ã®æ¬`,fr:`Mon ${o}${o===1?"er":"e"} livre terminé sur EaseVerse`,en:`My book #${o} finished on EaseVerse`}[x]||`My book #${o} finished on EaseVerse`;i.fillStyle=be,i.font='400 30px -apple-system, "PingFang SC", system-ui, sans-serif',i.fillText(O,U/2,_+100);const z=_+180,R=[];if(a>=6e4&&R.push(Ye(a,x)),d>0){const I=x!=null&&x.startsWith("zh")?"é«äº®":x==="ja"?"ãã¤ã©ã¤ã":"highlights";R.push(`${d} ${I}`)}if(l>0){const I=x!=null&&x.startsWith("zh")?"ç¬è®°":x==="ja"?"ãã¼ã":"notes";R.push(`${l} ${I}`)}if(R.length&&(i.fillStyle=Se,i.font='500 38px -apple-system, "PingFang SC", system-ui, sans-serif',i.fillText(R.join(" · "),U/2,z)),g.length>0){let I=g;if(g.length>14){const J=g.length/14;I=Array.from({length:14},(K,X)=>g[Math.floor(X*J)])}const G=I.map(J=>({tier:Ze(J.total_ms||0)}
2)),v=z+180;Ke(i,U/2,v,820,G),i.fillStyle=be,i.font='400 26px -apple-system, "PingFang SC", system-ui, sans-serif',i.textAlign="left",i.fillText(Fe(g[0].date,x),U/2-410+40,v+80),i.textAlign="right",i.fillText(Fe(g[g.length-1].date,x),U/2+410-40,v+80)}i.textAlign="center",i.fillStyle=le,i.font='600 34px "Playfair Display", Georgia, serif',i.fillText("EaseVerse",U/2,te-140),i.fillStyle=be,i.font='400 22px -apple-system, "PingFang SC", system-ui, sans-serif';const V={zh:"ä½ çé
读ä¼ä¼´","zh-TW":"ä½ çé±è®å¤¥ä¼´",ja:"èªæ¸ã®ãã¼ããã¼",fr:"Votre compagnon de lecture",en:"your reading companion"}[x]||"your reading companion";return i.fillText(V,U/2,te-100),h}function Qe(r){return new Promise(o=>{r.toBlob(a=>o(a),"image/png")})}const ae="https://easeverse.ink",et=2e3,tt=2e3;function rt(r,o){const a=Math.round(r/6e4);if(a<60)return o("reader.minutesShort",{n:a});const d=Math.floor(a/60),l=a%60;return l===0?o("reader.hoursShort",{n:d}):o("reader.hoursMinutesShort",{h:d,m:l})}function nt(r){return r>=1e3?(r/1e3).toFixed(1).replace(/\.0$/,"")+"k":String(r)}function ot(){if(typeof window>"u"||!window.matchMedia)return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function at(){try{const r=window.AudioContext||window.webkitAudioContext;if(!r)return;const o=new r,a=o.currentTime,d=o.sampleRate,l=o.createGain();l.gain.value=.9,l.connect(o.destination);const g=.025,x=o.createBuffer(1,Math.floor(d*g),d),j=x.getChannelData(0);for(let V=0;V<j.length;V++)j[V]=(Math.random()*2-1)*Math.exp(-V/j.length*7);const h=o.createBufferSource();h.buffer=x;const i=o.createBiquadFilter();i.type="bandpass",i.frequency.value=2400,i.Q.value=.9;const $=o.createBiquadFilter();$.type="highpass",$.frequency.value=400;const N=o.createGain();N.gain.value=.75,h.connect($).connect(i).connect(N).connect(l),h.start(a),h.stop(a+g);const F=o.createOscillator(),f=o.createGain();F.type="sine",F.frequency.setValueAtTime(150,a),F.frequency.exponentialRampToValueAtTime(55,a+.09),f.gain.setValueAtTime(1e-4,a),f.gain.exponentialRampToValueAtTime(.55,a+.004),f.gain.exponentialRampToValueAtTime(1e-4,a+.13),F.connect(f).connect(l),F.start(a),F.stop(a+.15);const D=.3,L=o.createBuffer(1,Math.floor(d*D),d),b=L.getChannelData(0);for(let V=0;V<b.length;V++)b[V]=(Math.random()*2-1)*Math.exp(-V/b.length*2.2);const _=o.createBufferSource();_.buffer=L;const O=o.createBiquadFilter();O.type="highpass";const z=a+.015;O.frequency.setValueAtTime(2800,z),O.frequency.exponentialRampToValueAtTime(9e3,z+D);const R=o.createGain();R.gain.setValueAtTime(1e-4,z),R.gain.exponentialRampToValueAtTime(.22,z+.02),R.gain.exponentialRampToValueAtTime(1e-4,z+D),_.connect(O).connect(R).connect(l),_.start(z),_.stop(z+D),setTimeout(()=>{try{o.close()}catch{}},600)}catch{}}function it(){const r=Date.now()+et,o=["#306F6F","#27B88D","#C4956A","#E5C9A8","#5FB9B2"];se({particleCount:140,spread:90,startVelocity:55,origin:{x:.5,y:.6},colors:o,zIndex:10012});const a=()=>{Date.now()>r||(se({particleCount:30,angle:60,spread:55,startVelocity:50,origin:{x:0,y:.7},colors:o,zIndex:10012}),se({particleCount:30,angle:120,spread:55,startVelocity:50,origin:{x:1,y:.7},colors:o,zIndex:10012}),window.setTimeout(a,250))};window.setTimeout(a,250)}function ut({book:r,session:o,flushPromise:a,finishedCount:d=1,stats:l,totalWordCount:g,onDismiss:x,variant:j="modal",revisit:h=!1,notes:i=[],canonicalBookId:$=null,getToken:N=null,sourceBookId:F=null}){const{t:f,language:D}=Te(),L=ot(),b=j==="inline",_=!b&&!h,[O,z]=S.useState(L||!_),[R,V]=S.useState(null),[I,G]=S.useState(null),[v,J]=S.useState(()=>new Set),[K,X]=S.useState(!1),[H,ee]=S.useState(null),[Z,ne]=S.useState(null),oe=S.useRef(null),re=S.useRef(null);S.useEffect(()=>{if(!(L||!_))return it(),at(),oe.current=window.setTimeout(()=>z(!0),tt),()=>{oe.current&&window.clearTimeout(oe.current);try{se.reset()}catch{}}},[L,_]),S.useEffect(()=>{if(!(r!=null&&r.id))return;let s=!1;return(async()=>{try{a&&await a}catch{}try{const M=await De.getBookDailyStats(r.id);s||V((M==null?void 0:M.days)||[])}catch{s||V([])}})(),()=>{s=!0}},[r==null?void 0:r.id,a]),S.useEffect(()=>{if(!$||!N){G([]);return}let s=!1;return(async()=>{try{const E=N();if(!E){s||G([]);return}const M=await ze(E,$,{limit:200});if(s)return;G(((M==null?void 0:M.lookups)||[]).slice().sort((Y,q)=>(q.weight||0)-(Y.weight||0)))}catch{s||G([])}})(),()=>{s=!0}},[$,N]);const he=S.useCallback(s=>{J(E=>{const M=new Set(E);return M.has(s)?M.delete(s):M.add(s),M})},[]),ue=S.useCallback(()=>{J(s=>{const E=I||[];return E.length>0&&s.size>=E.length?new Set:new Set(E.map(M=>M.word))})},[I]),t=S.useCallback(async()=>{const s=N==null?void 0:N();if(!s||v.size===0||H==="loading")return;const E=(I||[]).filter(M=>v.has(M.word)).map(M=>({word:M.word,explanation:M.hint||null,language:M.lang||null}));if(E.length!==0){ee("loading");try{const M=await _e(s,E,{source_canonical_book_id:$,source_book_id:F,source_title:r==null?void 0:r.title,source_type:"reader"});ee(M),J(new Set)}catch{ee({error:!0})}}},[N,v,I,$,F,r==null?void 0:r.title,H]);S.useEffect(()=>{const s=E=>{E.key==="Escape"&&(E.stopPropagation(),x())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[x]);const e=S.useCallback(()=>{x()},[x]),u=S.useCallback(s=>{s.stopPropagation()},[]),c=S.useCallback((s,E)=>{re.current&&window.clearTimeout(re.current),ne({type:s,text:E}),re.current=window.setTimeout(()=>ne(null),3200)},[]);S.useEffect(()=>()=>{re.current&&window.clearTimeout(re.current)},[]);const p=(l==null?void 0:l.highlights)??0,y=(l==null?void 0:l.notes)??0,w=(l==null?void 0:l.bookmarks)??0,m=R?R.reduce((s,E)=>s+(E.total_ms||0),0):(o==null?void 0:o.ms)||0,k=m>=6e4,C=f("reader.bookFinishedShareText",{title:(r==null?void 0:r.title)||"",n:d,url:ae}),P=S.useCallback(async s=>{try{const E=Xe({title:(r==null?void 0:r.title)||"",finishedCount:d,totalMs:m,highlights:p,notes:y,days:R||[],language:D}),M=await Qe(E);if(!M)throw new Error("poster blob null");const Y=URL.createObjectURL(M),q=document.createElement("a");q.href=Y,q.download=`EaseVerse-${((r==null?void 0:r.title)||"book").replace(/[\s\\/:*?"<>|]+/g,"_").slice(0,40)}.png`,document.body.appendChild(q),q.click(),q.remove(),window.setTimeout(()=>URL.revokeObjectURL(Y),3e3);try{await navigator.clipboard.writeText(C)}catch{}c("poster",f(s))}catch{c("error",f("reader.bookFinishedShareFailed"))}},[r==null?void 0:r.title,d,m,p,y,R,D,C,c,f]),A=S.useCallback(s=>{try{window.open(s,"_blank","noopener,noreferrer")}catch{c("error",f("reader.bookFinishedShareFailed"))}},[c,f]),B=S.useCallback(async()=>{try{await navigator.clipboard.writeText(C),c("copied",f("reader.bookFinishedShareWechatReady"))}catch{c("error",f("reader.bookFinishedShareFailed"))}},[C,c,f]),W=S.useCallback(async()=>{try{await navigator.clipboard.writeText(ae),c("copied",f("reader.bookFinishedShareLinkCopied"))}catch{c("error",f("reader.bookFinishedShareFailed"))}},[c,f]),T=[{id:"wechat",color:"#07C160",label:"reader.bookFinishedShareWechat",onClick:B,icon:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"
2currentColor","aria-hidden":!0,children:[n.jsx("path",{d:"M8.6 4.3c-3.5 0-6.4 2.4-6.4 5.3 0 1.6.9 3 2.4 4l-.6 1.9 2.2-1.1c.8.2 1.5.3 2.3.3.2 0 .4 0 .6 0-.1-.4-.2-.9-.2-1.3 0-2.8 2.6-5 5.9-5 .2 0 .4 0 .6 0-.5-2.4-3.2-4.1-6.8-4.1zm-2 2.3c.4 0 .8.4.8.8 0 .5-.4.8-.8.8s-.9-.3-.9-.8c0-.4.4-.8.9-.8zm4.2 0c.4 0 .8.4.8.8 0 .5-.4.8-.8.8s-.8-.3-.8-.8c0-.4.4-.8.8-.8z"}),n.jsx("path",{d:"M21.8 14.4c0-2.4-2.5-4.4-5.5-4.4-3.1 0-5.5 2-5.5 4.4s2.4 4.4 5.5 4.4c.6 0 1.2-.1 1.7-.2l1.7.9-.4-1.5c1.4-.8 2.5-2 2.5-3.6zm-7-1.2c-.3 0-.6-.3-.6-.6 0-.4.3-.6.6-.6.4 0 .7.2.7.6 0 .3-.3.6-.7.6zm3.5 0c-.3 0-.6-.3-.6-.6 0-.4.3-.6.6-.6.4 0 .7.2.7.6 0 .3-.3.6-.7.6z"})]})},{id:"weibo",color:"#E6162D",label:"reader.bookFinishedShareWeibo",onClick:()=>A(`https://service.weibo.com/share/share.php?url=${encodeURIComponent(ae)}&title=${encodeURIComponent(C)}`),icon:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M10.3 20.2c-4.8.5-9-1.7-9.3-4.8-.3-3.2 3.3-6.1 8.2-6.6 4.8-.5 9 1.7 9.3 4.8.3 3.1-3.3 6.1-8.2 6.6zm4.5-8.3c-.5-.1-.7-.2-.5-.7.4-1 .5-1.9 0-2.5-.9-1.1-3.4-.7-6.3.5 0 0-.9.4-.7-.3.4-1.3.3-2.4-.3-3-1.4-1.4-5 0-8.1 3.2C-.9 11.4-2.3 14 -1.6 15.5c1.5 3 8 4.8 13.3 2.6 5-2 5.7-5.5 3.1-6.2zm2.1-7.3c-1.2-1.3-2.9-1.8-4.5-1.5 0 0 0 0 0 0-.3 0-.5.3-.5.7 0 .3.3.6.6.6 1.1-.2 2.4.1 3.2 1.1.9 1 1.1 2.3.7 3.4 0 0 0 0 0 0-.2.3-.1.7.3.8.4.1.7-.1.8-.4v0c.7-1.6.4-3.4-.6-4.7zm-2 1.6c-.6-.7-1.5-.9-2.3-.7 0 0 0 0 0 0-.3.1-.5.4-.4.7.1.3.3.5.6.4.4-.1.9 0 1.2.4.3.4.4.9.2 1.3v0c-.1.3 0 .7.3.8.3.1.7 0 .8-.3v0c.3-.9.1-1.9-.4-2.6z"})})},{id:"xhs",color:"#FF2442",label:"reader.bookFinishedShareXhs",onClick:()=>P("reader.bookFinishedShareXhsReady"),icon:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("path",{d:"M12 21s-7-4.5-7-11a5 5 0 0 1 9-3 5 5 0 0 1 9 3c0 6.5-7 11-7 11H12z"}),n.jsx("path",{d:"M12 9v6M9 12h6"})]})},{id:"x",color:"#000000",label:"reader.bookFinishedShareX",onClick:()=>A(`https://x.com/intent/post?text=${encodeURIComponent(C)}`),icon:n.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M18.3 2h3.3l-7.2 8.2L23 22h-6.7l-5.2-6.8L5.1 22H1.8l7.7-8.8L1.5 2h6.9l4.7 6.2L18.3 2zm-1.2 18h1.8L7.1 4H5.2l11.9 16z"})})},{id:"ig",color:"#E4405F",label:"reader.bookFinishedShareIg",onClick:()=>P("reader.bookFinishedShareIgReady"),icon:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"5"}),n.jsx("circle",{cx:"12",cy:"12",r:"4"}),n.jsx("circle",{cx:"17.5",cy:"6.5",r:"1",fill:"currentColor"})]})},{id:"fb",color:"#1877F2",label:"reader.bookFinishedShareFb",onClick:()=>A(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(ae)}"e=${encodeURIComponent(C)}`),icon:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M14 8V6a2 2 0 0 1 2-2h2V2h-2a4 4 0 0 0-4 4v2h-2v2h2v10h2V10h3l1-2h-4z"})})},{id:"line",color:"#06C755",label:"reader.bookFinishedShareLine",onClick:()=>A(`https://social-plugins.line.me/lineit/share?url=${encodeURIComponent(ae)}&text=${encodeURIComponent(C)}`),icon:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M22 10.6c0-4.6-4.6-8.3-10.2-8.3S1.6 6 1.6 10.6c0 4.1 3.7 7.5 8.6 8.2.3.1.8.2 1 .4.1.2.1.5.1.7l-.2 1c0 .3-.2 1.2 1 .6 1.2-.5 6.7-4 9.1-6.8 1.8-2 2.8-4 2.8-4.1zM8.1 13.3c0 .1-.1.2-.2.2h-3c-.1 0-.2
20-.2-.1l-.1-.1V8.8c0-.1.1-.2.2-.2h.7c.1 0 .2.1.2.2v3.4h1.8c.1 0 .2.1.2.2v.8c.1.1.4.1.4.1zm1.9 0c0 .1-.1.2-.2.2h-.7c-.1 0-.2-.1-.2-.2V8.8c0-.1.1-.2.2-.2h.7c.1 0 .2.1.2.2v4.5zm4.8 0c0 .1-.1.2-.2.2h-.7l-.1-.1-2.1-2.8v2.7c0 .1-.1.2-.2.2h-.7c-.1 0-.2-.1-.2-.2V8.8c0-.1.1-.2.2-.2h.8l2 2.7V8.8c0-.1.1-.2.2-.2h.7c.1 0 .2.1.2.2v4.5zm4-3.7c0 .1-.1.2-.2.2h-1.8v.7h1.8c.1 0 .2.1.2.2v.7c0 .1-.1.2-.2.2h-1.8v.7h1.8c.1 0 .2.1.2.2v.7c0 .1-.1.2-.2.2h-3c-.1 0-.2-.1-.2-.2V8.8c0-.1.1-.2.2-.2h3c.1 0 .2.1.2.2v.8z"})})},{id:"tg",color:"#229ED9",label:"reader.bookFinishedShareTg",onClick:()=>A(`https://t.me/share/url?url=${encodeURIComponent(ae)}&text=${encodeURIComponent(C)}`),icon:n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:n.jsx("path",{d:"M21.8 4.2L2.8 11.5c-1.3.5-1.3 1.2-.3 1.5l4.9 1.5 11.2-7.1c.5-.3 1-.1.6.2l-9 8.2v0l-.3 5c.5 0 .7-.2 1-.5l2.4-2.3 5 3.7c.9.5 1.6.3 1.8-.8l3.4-15.8c.3-1.4-.5-2-1.7-1.6z"})})},{id:"copy",color:"#6B7A76",label:"reader.bookFinishedShareCopy",onClick:W,icon:n.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}];return n.jsx("div",{className:`${b?"book-finished-inline":"book-finished-overlay"}${O?" book-finished-overlay--card-visible":""}`,onClick:b?void 0:e,role:"dialog","aria-modal":b?void 0:"true","aria-labelledby":"book-finished-title",children:O&&n.jsxs("div",{className:`book-finished-card${b?" book-finished-card--inline":""}`,onClick:u,children:[n.jsx("div",{className:"book-finished-eyebrow",children:f(h?"reader.bookJourneyRevisitEyebrow":"reader.bookFinishedEyebrow")}),n.jsx("h2",{id:"book-finished-title",className:"book-finished-title",children:(r==null?void 0:r.title)||""}),!h&&n.jsx("p",{className:"book-finished-subtitle",children:f("reader.bookFinishedOrdinal",{n:d})}),n.jsxs("div",{className:"book-finished-stats",role:"list",children:[k&&n.jsxs("div",{className:"book-finished-stat",role:"listitem",children:[n.jsx("div",{className:"book-finished-stat-value",children:rt(m,f)}),n.jsx("div",{className:"book-finished-stat-label",children:f("reader.bookFinishedLabelTotalTime")})]}),g>0&&n.jsxs("div",{className:"book-finished-stat",role:"listitem",children:[n.jsx("div",{className:"book-finished-stat-value",children:nt(g)}),n.jsx("div",{className:"book-finished-stat-label",children:f("reader.bookFinishedLabelBookLength")})]}),p>0&&n.jsxs("div",{className:"book-finished-stat",role:"listitem",children:[n.jsx("div",{className:"book-finished-stat-value",children:p}),n.jsx("div",{className:"book-finished-stat-label",children:f("reader.bookFinishedLabelHighlights")})]}),y>0&&n.jsxs("div",{className:"book-finished-stat",role:"listitem",children:[n.jsx("div",{className:"book-finished-stat-value",children:y}),n.jsx("div",{className:"book-finished-stat-label",children:f("reader.bookFinishedLabelNotes")})]}),w>0&&n.jsxs("div",{className:"book-finished-stat",role:"listitem",children:[n.jsx("div",{className:"book-finished-stat-value",children:w}),n.jsx("div",{className:"book-finished-stat-label",children:f("reader.bookFinishedLabelBookmarks")})]})]}),R&&R.length>0&&n.jsx(He,{days:R}),I&&I.length>0&&n.jsxs("section",{className:"book-finished-section",children:[n.jsxs("div",{className:"book-finished-section-head",children:[n.jsx("span",{className:"book-finished-section-label",children:f("reader.bookJourneyWordsLabel")}),n.jsxs("div",{className:"book-finished-section-actions",children:[n.jsx("button",{type:"button",className:"book-finished-selectall",onClick:ue,children:v.size>=I.length?f("reader.bookJourneyDeselectAll"):f("reader.bookJourneySelectAll")}),n.jsx("span",{className:"book-finished-section-count",children:I.length})]})]}),n.jsxs("div",{className:"book-finished-words",children:[(K?I:I.slice(0,15)).map(s=>n.jsxs("button",{type:"button",className:`book-finished-word${v.has(s.word)?" is-selected":""}`,onClick:()=>he(s.word),children:[s.word,s.weight>1&&n.jsx("sup",{className:"book-finished-word-count",children:s.weight})]},s.word)),I.length>15&&!K&&n.jsx("button",{type:"button",className:"book-finished-word-more",onClick:()=>X(!0),children:f("reader.bookJourneyShowAll")})]}),n.jsxs("div",{className:"book-finished-loom-row",children:[n.jsxs("button",{type:"button",className:"book-finished-loom-btn",disabled:v.size===0||H==="loading",onClick:t,children:[f("reader.bookJourneyAddToLoom"),v.size>0?` · ${v.size}`:""]}),H&&H!=="loading"&&!H.error&&n.jsxs("span",{className:"book-finished-loom-result",children:[f("reader.bookJourneyLoomAdded",{added:H.added}),H.blocked_by_limit>0?` · ${f("reader.bookJourneyLoomLimited",{n:H.blocked_by_limit})}`:""]})]})]}),i&&i.length>0&&n.jsxs("section",{className:"book-finished-section",children:[n.jsxs("div",{className:"book-finished-section-head",children:[n.jsx("span",{className:"book-finished-section-label",children:f("reader.bookJourneyNotesLabel")}),n.jsx("span",{className:"book-finished-section-count",children:i.length})]}),n.jsx("div",{className:"book-finished-notes-list",children:i.slice(0,20).map(s=>n.jsxs("div",{className:"book-finished-note",children:[s.selected_text&&n.jsx("div",{className:"book-finished-note-quote",children:s.selected_text}),s.content&&n.jsx("div",{className:"book-finished-note-content",children:s.content})]},s.id))})]}),n.jsxs("div",{className:"book-finished-share-row","aria-label":f("reader.bookFinishedShareGroup"),children:[n.jsx("div",{className:"book-finished-share-label",children:f("reader.bookFinishedShareGroup")}),n.jsx("div",{className:"book-finished-share-icons",children:T.map(s=>n.jsx("button",{type:"button",className:`book-finished-share-icon book-finished-share-icon--${s.id}`,style:{"--share-color":s.color},onClick:s.onClick,"aria-label":f(s.label),title:f(s.label),"data-share-platform":s.id,children:s.icon},s.id))})]}),n.jsx("div",{className:"book-finished-actions",children:n.jsx("button",{type:"button",className:"book-finished-close-btn",onClick:x,autoFocus:!0,children:f(b?"reader.bookJourneyBackToReading":"reader.bookFinishedClose")})}),Z&&n.jsx("div",{className:`book-finished-share-toast book-finished-share-toast--${Z.type}`,role:"status",children:Z.text})]})})}export{ut as default}; 3//# sourceMappingURL=BookFinishedCelebration-BkonXdsM.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.