1import{m as e,l as t,R as n}from"./vendor-misc-DUP22bK2.js";import{aq as a,bR as r,eF as o,h5 as s,ak as i,bN as l,T as d,eq as c,ar as h,c8 as u,dN as m,gg as p,g$ as x,a0 as b,a1 as f,fi as g,gl as w,gm as k,a7 as v,a as y,c3 as j,ck as Z,fY as N,aI as C,gn as E,c2 as T,bT as F,eb as I,dk as S,f6 as A,eQ as D,bU as _,B,U as $,fj as L,af as M,ai as q,eN as z,bd as P,fq as O,h6 as R,gz as H,gq as W,t as G,z as U,h3 as J,dn as V}from"./index-x7cAXa-6.js";import{g as K,c as Y,r as Q,b as X,S as ee}from"./StudySheet-DZx2eQ2R.js";import{c as te,S as ne}from"./useVerseMemorize-CqsgXgOv.js";import{f as ae,s as re,b as oe}from"./tierSections-C4onGmjG.js";import{b as se,g as ie,t as le}from"./contentFavorites-DdSYU7Dg.js";import{trackLiteEvent as de}from"./liteAnalytics-B8ZwBBt0.js";import{u as ce,r as he,c as ue,a as me}from"./useNextStepTracking-9_FBL6pO.js";import{C as pe}from"./ChapterQuizEntry-CaPONtas.js";import{fetchAvailableChapters as xe}from"./chapterQuiz-BFkxeZDw.js";import{textForLang as be,convertToSimplified as fe,convertToTraditional as ge,htmlForLang as we}from"./traditional-chinese-2pkNGbDt.js";import{chapterQuizKey as ke}from"./chapterQuizCore-BDm58LAE.js";import{G as ve,cZ as ye,bi as je,f as Ze,c5 as Ne,br as Ce,b1 as Ee,d7 as Te,cb as Fe,cm as Ie,aa as Se,b7 as Ae,d0 as De,cw as _e,ay as Be,cP as $e,ci as Le,b_ as Me,bm as qe,bZ as ze,P as Pe,t as Oe,at as Re,au as He,bc as We,u as Ge,aQ as Ue,cU as Je,cM as Ve,c4 as Ke,M as Ye,R as Qe,O as Xe,Q as et,aP as tt,v as nt,cp as at,S as rt,T as ot,e as st,ap as it}from"./vendor-icons-vC33TuHE.js";import{f as lt}from"./fillTemplate-D-zmJcmb.js";import{a as dt,s as ct}from"./textToSpeech-0TfR-IcC.js";import{u as ht,i as ut,f as mt,c as pt,r as xt,S as bt,b as ft,a as gt,A as wt,g as kt,h as vt}from"./copyWithToast-B9hFO_J-.js";import{O as yt,o as jt}from"./originalLanguageSources-zWUCGb7d.js";import{s as Zt,b as Nt}from"./langLab-DdXGK4Gd.js";import{f as Ct}from"./originalPronunciation-BKAMblHB.js";import{f as Et}from"./langLab-1xDgjord.js";import{f as Tt,G as Ft}from"./GrammarHelperSheet-DTqmbbfY.js";import{E as It}from"./ExhibitDrawer-B-pHI1u5.js";import{fetchExhibit as St}from"./museum-BJ-U0RNl.js";import{u as At,I as Dt}from"./InlineMdBoldToolbar-Dw4XKJVD.js";import{u as _t}from"./useScripturePeek-Cvk9aoWN.js";import{b as Bt}from"./AnnotationNoteSheet-eNoX1e7o.js";import{E as $t}from"./admin-ckK65VX3.js";import{a as Lt,u as Mt,s as qt}from"./bibleIllustrations-Dacd2bJh.js";import{p as zt}from"./markdownParser-DEIJFl6v.js";import{u as Pt}from"./vendor-i18n-B2TU2mS1.js";import{R as Ot}from"./RelatedPosters-DsFKYb7j.js";import"./vendor-supabase-TkIFdNNf.js";import"./chinese-language-CLYDn-o3.js";import"./ChapterBadges-Bchl3jlh.js";import"./scriptureRef-CfrgaEkT.js";import"./geminiTTS-DwaZdgye.js";import"./ChapterQuizSheet-CMeBROgQ.js";import"./inlineMarkdown-xGO4AIxO.js";import"./ContentRating-BGnsLYkl.js";import"./contentRatings-Dx3VUgMK.js";import"./googleTTS-BRO7Ma83.js";import"./annotationCard-BlMhJwDP.js";import"./clipboard-CvMPH2Rq.js";import"./ScripturePeekSheet-DhADNULZ.js";import"./VersesMissingNotice-BjB06FJP.js";import"./catalog-BIvy0mVU.js";function Rt(e,t){var n,a;if(!e||!t.length)return e;if("undefined"==typeof window||"undefined"==typeof DOMParser)return e;const r=t.map(e=>e.toLowerCase()).filter(Boolean);if(!r.length)return e;try{const t=(new DOMParser).parseFromString(e,"text/html"),o=t.createTreeWalker(t.body,NodeFilter.SHOW_TEXT,null),s=[];for(;;){const e=o.nextNode();if(!e)break;const t=e.parentElement;if(!t)continue;const n=t.tagName;if("SCRIPT"===n||"STYLE"===n||t.closest("[data-bible-search-mark]"))continue;if("http://www.w3.org/2000/svg"===t.namespaceURI&&!t.closest("text"))continue;const a=(e.nodeValue||"").toLowerCase();r.some(e=>a.includes(e))&&s.push(e)}for(const e of s){const o=e.nodeValue||"",s=o.toLowerCase(),i=[];for(const e of r){let t=0;for(;;){const n=s.indexOf(e,t);if(n<0)break;i.push([n,n+e.length]),t=n+e.length}}i.sort((e,t)=>e[0]-t[0]||t[1]-e[1]);const l=[];let d=-1;for(const[e,t]of i)e>=d&&(l.push([e,t]),d=t);if(!l.length)continue;const c=t.createDocumentFragment();let h=0;for(const[a,r]of l){a>h&&c.appendChild(t.createTextNode(o.slice(h,a)));const s="http://www.w3.org/2000/svg"===(null==(n=e.parentElement)?void 0:n.namespaceURI)?t.createElementNS("http://www.w3.org/2000/svg","tspan"):t.createElement("mark");s.setAttribute("data-bible-search-mark","1"),s.textContent=o.slice(a,r),c.appendChild(s),h=r}h<o.length&&c.appendChild(t.createTextNode(o.slice(h))),null==(a=e.parentNode)||a.replaceChild(c,e)}return t.body.innerHTML}catch{return e}}let Ht=null;async function Wt(e,t){if(!e||!Number.isFinite(t)||t<1)return null;Ht||(Ht=async function(){const e=new Map;try{const t=[...await r()||[]].sort((e,t)=>
1(e.weekNum||0)-(t.weekNum||0));for(const n of t){const t=o(n.scripture);if(t)for(const r of t.chapters){const t=a(r.book,r.chapter);e.has(t)||e.set(t,{weekNum:n.weekNum,questId:n.id,title:String(n.title||"")})}}}catch{}return e}());return(await Ht).get(a(e,t))??null}const Gt={"1 Corinthians:12":[{nationId:"vn",nationZh:"è¶å",workTitleZh:"ææä¸å£"},{nationId:"za",nationZh:"åé",workTitleZh:"叿"},{nationId:"it",nationZh:"æå¤§å©",workTitleZh:"æç天æå¥³å"},{nationId:"ar",nationZh:"é¿æ ¹å»·",workTitleZh:"æ°¸èªå"},{nationId:"ug",nationZh:"ä¹å¹²è¾¾",workTitleZh:"塿¨å¥³ç"},{nationId:"am",nationZh:"äºç¾å°¼äº",workTitleZh:"ç¾å½äºº"}],"1 Corinthians:13":[{nationId:"sa",nationZh:"æ²ç¹é¿æä¼¯",workTitleZh:"å·´æå¡éä¸å·´æå¡"},{nationId:"hu",nationZh:"åçå©",workTitleZh:"ãé¨ã"}],"1 Corinthians:3":[{nationId:"kr",nationZh:"é©å½",workTitleZh:"米纳é"}],"1 Corinthians:6":[{nationId:"mn",nationZh:"èå¤",workTitleZh:"å®è´§å"},{nationId:"bd",nationZh:"åå æå½",workTitleZh:"çµè§æº"},{nationId:"ht",nationZh:"æµ·å°",workTitleZh:"å¼å¸ãç¼çãè®°å¿"}],"1 John:4":[{nationId:"ph",nationZh:"è²å¾å®¾",workTitleZh:"å¥è¿¹"}],"1 Kings:17":[{nationId:"sy",nationZh:"åå©äº",workTitleZh:"æå¤±å»äºå½±åçé£å¤©"}],"1 Kings:19":[{nationId:"kr",nationZh:"é©å½",workTitleZh:"ç¬èªçæ´»ç人们"},{nationId:"au",nationZh:"澳大å©äº",workTitleZh:"ååå大婿"},{nationId:"ir",nationZh:"伿",workTitleZh:"樱æ¡çæ»å³"},{nationId:"is",nationZh:"å°å²",workTitleZh:"ãå®å®ç天使ã"}],"1 Peter:3":[{nationId:"mn",nationZh:"èå¤",workTitleZh:"é£ä¹å"}],"1 Samuel:16":[{nationId:"dz",nationZh:"é¿å°åå©äº",workTitleZh:"å¸ç®å¡"}],"1 Samuel:8":[{nationId:"pk",nationZh:"å·´åºæ¯å¦",workTitleZh:"ä¸ä¸ªèæçç¸çæ¡ä»¶"}],"1 Thessalonians:5":[{nationId:"iq",nationZh:"伿å
",workTitleZh:"梦"}],"1 Timothy:3":[{nationId:"ng",nationZh:"å°¼æ¥å©äº",workTitleZh:"ç´«æ¨æ§¿"}],"1 Timothy:5":[{nationId:"th",nationZh:"æ³°å½",workTitleZh:"姥姥çå¤å"},{nationId:"pe",nationZh:"ç§é²",workTitleZh:"æ°¸æ"}],"2 Corinthians:1":[{nationId:"ca",nationZh:"å æ¿å¤§",workTitleZh:"ææèå¸"}],"2 Corinthians:4":[{nationId:"tr",nationZh:"åè³å
¶",workTitleZh:"éª"},{nationId:"cl",nationZh:"æºå©",workTitleZh:"ä¸"}],"Acts:17":[{nationId:"ca",nationZh:"å æ¿å¤§",workTitleZh:"å¿«è·è
é¿å¡çº³æ±é¿ç¹"},{nationId:"gr",nationZh:"å¸è
",workTitleZh:"çç"},{nationId:"lb",nationZh:"é»å·´å«©",workTitleZh:"å
ç¥"},{nationId:"pg",nationZh:"å·´å¸äºæ°å å
äº",workTitleZh:"ä¸çä¸ä¸å¹´"}],"Acts:2":[{nationId:"nz",nationZh:"æ°è¥¿å
°",workTitleZh:"鲸éªå£«"},{nationId:"ua",nationZh:"ä¹å
å
°",workTitleZh:"è¯éãç§å¸æå°ã"},{nationId:"pg",nationZh:"å·´å¸äºæ°å å
äº",workTitleZh:"æ¯äº²å«æäºå°ç¹æ®"}],"Acts:5":[{nationId:"ro",nationZh:"ç½é©¬å°¼äº",workTitleZh:"ç»åè
乿"},{nationId:"tz",nationZh:"妿¡å°¼äº",workTitleZh:"æé¯"},{nationId:"cz",nationZh:"æ·å
",workTitleZh:"好å
µå¸
å
"}],"Colossians:2":[{nationId:"my",nationZh:"马æ¥è¥¿äº",workTitleZh:"åå·«"},{nationId:"it",nationZh:"æå¤§å©",workTitleZh:"å¥è¿¹"}],"Colossians:3":[{nationId:"nl",nationZh:"è·å
°",workTitleZh:"æ§æ ¼"},{nationId:"no",nationZh:"æªå¨",workTitleZh:"æææ¥çå¦ä¸é¢"}],"Deuteronomy:10":[{nationId:"gr",nationZh:"å¸è
",workTitleZh:"馿å
±åå½"},{nationId:"pk",nationZh:"å·´åºæ¯å¦",workTitleZh:"游é¼"},{nationId:"be",nationZh:"æ¯å©æ¶",workTitleZh:"æé䏿´å¥å¡"}],"Deuteronomy:16":[{nationId:"ar",nationZh:"é¿æ ¹å»·",workTitleZh:"è°ä¸æ ·çåç¼"}],"Deuteronomy:19":[{nationId:"dk",nationZh:"丹麦",workTitleZh:"ç©ç"},{nationId:"sy",nationZh:"åå©äº",workTitleZh:"è¶å¢"}],"Deuteronomy:24":[{nationId:"ph",nationZh:"è²å¾å®¾",workTitleZh:"æææ¥éç¾çå"},{nationId:"be",nationZh:"æ¯å©æ¶",workTitleZh:"ç½å¡å¡"},{nationId:"mm",nationZh:"ç¼
ç¸",workTitleZh:"åè§ç¦å"}],"Ecclesiastes:12":[{nationId:"es",nationZh:"西çç",workTitleZh:"é£ä¹å½±"}],"Ecclesiastes:3":[{nationId:"cz",nationZh:"æ·å
",workTitleZh:"严å¯çè§çå车"}],"Ecclesiastes:4":[{nationId:"sd",nationZh:"è丹",workTitleZh:"è°è®ºæ æ¨"},{nationId:"kp",nationZh:"æé²",workTitleZh:"æ§è¯"}
1],"Ecclesiastes:8":[{nationId:"mx",nationZh:"墨西å¥",workTitleZh:"佩德ç½Â·å·´æè«"}],"Ecclesiastes:9":[{nationId:"ps",nationZh:"巴忝å¦",workTitleZh:"å æ²ï¼æçç±"}],"Ephesians:1":[{nationId:"ca",nationZh:"å æ¿å¤§",workTitleZh:"绿山å¢çå®å¦®"}],"Ephesians:2":[{nationId:"gb",nationZh:"è±å½",workTitleZh:"轻轻ææ"},{nationId:"fr",nationZh:"æ³å½",workTitleZh:"æ²æ¨ä¸ç"},{nationId:"mx",nationZh:"墨西å¥",workTitleZh:"æå·²ä¸å¨è¿é"},{nationId:"it",nationZh:"æå¤§å©",workTitleZh:"é¿æé¿"},{nationId:"lb",nationZh:"é»å·´å«©",workTitleZh:"西è´é²ç¹"},{nationId:"kw",nationZh:"ç§å¨ç¹",workTitleZh:"竹竿"}],"Ephesians:4":[{nationId:"za",nationZh:"åé",workTitleZh:"é¤äºçç¸ï¼å«æ ææ"},{nationId:"es",nationZh:"西çç",workTitleZh:"è巢幽çµ"},{nationId:"cz",nationZh:"æ·å
",workTitleZh:"æ æè
çæå"},{nationId:"mm",nationZh:"ç¼
ç¸",workTitleZh:"鱿忡è
¿"}],"Ephesians:5":[{nationId:"kr",nationZh:"é©å½",workTitleZh:"çç"},{nationId:"ph",nationZh:"è²å¾å®¾",workTitleZh:"ä¸å年代"},{nationId:"nz",nationZh:"æ°è¥¿å
°",workTitleZh:"æå£«å¥å
µ"},{nationId:"cl",nationZh:"æºå©",workTitleZh:"å¹½çµä¹å®¶"},{nationId:"ro",nationZh:"ç½é©¬å°¼äº",workTitleZh:"éä½"},{nationId:"cu",nationZh:"å¤å·´",workTitleZh:"é²è¥¿äº"},{nationId:"mz",nationZh:"è«æ¡æ¯å
",workTitleZh:"ã妮å¯åï¼ä¸åå¤å¦»å©å§»æ
äºã"},{nationId:"pt",nationZh:"è¡èç",workTitleZh:"ãéå¡å¤Â·é·ä¼æ¯éä¸ä¹å¹´ã"}],"Ephesians:6":[{nationId:"my",nationZh:"马æ¥è¥¿äº",workTitleZh:"ä¸è·¯æä½ "},{nationId:"ca",nationZh:"å æ¿å¤§",workTitleZh:"åå"},{nationId:"mn",nationZh:"èå¤",workTitleZh:"å°é»çççª"},{nationId:"ug",nationZh:"ä¹å¹²è¾¾",workTitleZh:"é¿æ¯è¥¿å°¼äºç¼å¹´å²"}],"Exodus:18":[{nationId:"kg",nationZh:"åå°åæ¯æ¯å¦",workTitleZh:"å·å
ç人"}],"Exodus:20":[{nationId:"ge",nationZh:"æ ¼é²åäº",workTitleZh:"第å
«ç§äººçï¼ç®ç»å¸éå°å¡ï¼"}],"Exodus:35":[{nationId:"ug",nationZh:"ä¹å¹²è¾¾",workTitleZh:"è°æäºäºåå
æ¯éé¿ï¼"},{nationId:"cd",nationZh:"åææ°ä¸»å
±åå½",workTitleZh:"éæ²è¨äº¤åæ²"},{nationId:"am",nationZh:"äºç¾å°¼äº",workTitleZh:"ç³æ¦´çé¢è²"}],"Ezekiel:18":[{nationId:"sy",nationZh:"åå©äº",workTitleZh:"ç±æ
ç黿é¢"}],"Ezekiel:34":[{nationId:"pl",nationZh:"æ³¢å
°",workTitleZh:"åºç£å£ä½"}],"Galatians:3":[{nationId:"us",nationZh:"ç¾å½",workTitleZh:"为奴åäºå¹´"},{nationId:"eg",nationZh:"åå",workTitleZh:"请å¿è§æª"},{nationId:"np",nationZh:"å°¼æ³å°",workTitleZh:"黿¯é¸¡"}],"Galatians:5":[{nationId:"tr",nationZh:"åè³å
¶",workTitleZh:"èªç±ä¹è·¯"}],"Galatians:6":[{nationId:"se",nationZh:"çå
¸",workTitleZh:"ä¸ä¸ªå«æ¬§ç»´çç·äººå³å®å»æ»"},{nationId:"no",nationZh:"æªå¨",workTitleZh:"å
鿝æ±Â·æå¤«å
°æ¯è¾¾ç¹"},{nationId:"cz",nationZh:"æ·å
",workTitleZh:"çå½ä¸ä¸è½æ¿åä¹è½»"},{nationId:"ge",nationZh:"æ ¼é²åäº",workTitleZh:"æçå¿«ä¹å®¶åº"}],"Genesis:1":[{nationId:"sd",nationZh:"è丹",workTitleZh:"åè¿å£è"}],"Genesis:16":[{nationId:"be",nationZh:"æ¯å©æ¶",workTitleZh:"é»å§å¦¹è¡"},{nationId:"uz",nationZh:"ä¹å
¹å«å
æ¯å¦",workTitleZh:"æ³ä¸½è¾¾ç两å馿"},{nationId:"jo",nationZh:"约æ¦",workTitleZh:"çæ±"}],"Genesis:2":[{nationId:"cr",nationZh:"奿¯è¾¾é»å ",workTitleZh:"ãçå¤å¡çç¯å¥³äººã"}],"Genesis:33":[{nationId:"cu",nationZh:"å¤å·´",workTitleZh:"梦è§å¤å·´"}],"Habakkuk:2":[{nationId:"cd",nationZh:"åææ°ä¸»å
±åå½",workTitleZh:"83 å·çµè½¦"}],"Hebrews:13":[{nationId:"au",nationZh:"澳大å©äº",workTitleZh:"幸è¿éç¨"},{nationId:"se",nationZh:"çå
¸",workTitleZh:"ç§»æ°"},{nationId:"ru",nationZh:"ä¿ç½æ¯",workTitleZh:"ä¼ä¸Â·æ°å°¼ç´¢ç»´å¥çä¸å¤©"},{nationId:"il",nationZh:"以è²åï¼ç°ä»£å½å®¶ï¼",workTitleZh:"ä¹éæ¥è®¿"}],"Hebrews:9":[{nationId:"th",nationZh:"æ³°å½",workTitleZh:"è½å¬ååä¸çå¸ç±³åå"}],"Isaiah:1":[{nationId:"et",nationZh:"åå¡ä¿æ¯äº",workTitleZh:"åæ°"},{nationId:"ua",nationZh:"ä¹å
å
°",workTitleZh:"å
æä»£å
"},{nationId:"jo",nationZh:"约æ¦",workTitleZh:"使¿æ¯ç·å©"},{nationId:"sa",nationZh:"æ²ç¹é¿æä¼¯",workTitleZh:"鸽åç项å"},{nationId:"af",nationZh:"é¿å¯æ±",workTitleZh:"è´æ»ç»çä¿¡"}],"Isaiah:10":[{nationId:"dz",nationZh:"é¿å°åå©äº",workTitleZh:"é¿å°åå°ä¹æ"}],"Isaiah:42":[{nationId:"lk",nationZh:"æ¯éå
°å¡",workTitleZh:"æ»ç¨½å°å"},{nationId:"mn",nationZh:"èå¤",workTitleZh:"åæ³£çéªé©¼"},{nationId:"ru",nationZh:"ä¿ç½æ¯",workTitleZh:"é«ä¸ªå¿"}],"Isaiah:5":[{nationId:"be",nationZh:"æ¯å©æ¶",workTitleZh:"æ¯å©æ¶çæ²ä¼¤"}],"Isaiah:58":[{nationId:"br",nationZh:"巴西",workTitleZh:"ä¸å¸ä¹å"}
1,{nationId:"ma",nationZh:"æ©æ´å¥",workTitleZh:"åªä¸ºé¢å
"},{nationId:"ht",nationZh:"æµ·å°",workTitleZh:"鲿°´ä¸»äºº"},{nationId:"ps",nationZh:"巴忝å¦",workTitleZh:"200 ç±³"}],"James:1":[{nationId:"ph",nationZh:"è²å¾å®¾",workTitleZh:"å°åå"},{nationId:"fr",nationZh:"æ³å½",workTitleZh:"æç«éæ¥"},{nationId:"eg",nationZh:"åå",workTitleZh:"碰æ"},{nationId:"tz",nationZh:"妿¡å°¼äº",workTitleZh:"妿¡å°¼äºå车"},{nationId:"uz",nationZh:"ä¹å
¹å«å
æ¯å¦",workTitleZh:"ä½ ä¸æ¯å¤å¿"},{nationId:"cu",nationZh:"å¤å·´",workTitleZh:"èèä¸å·§å
å"},{nationId:"ge",nationZh:"æ ¼é²åäº",workTitleZh:"èè²å±±èï¼æä¸å¯æè®®çæ
äº"}],"James:2":[{nationId:"kr",nationZh:"é©å½",workTitleZh:"å¯çè«"},{nationId:"eg",nationZh:"åå",workTitleZh:"äºåºæ¯æ©å
¬å¯"},{nationId:"it",nationZh:"æå¤§å©",workTitleZh:"å·èªè¡è½¦ç人"},{nationId:"se",nationZh:"çå
¸",workTitleZh:"åç¡æ»"},{nationId:"pl",nationZh:"æ³¢å
°",workTitleZh:"ç©å¶"},{nationId:"bd",nationZh:"åå æå½",workTitleZh:"æ³¥é¸"},{nationId:"no",nationZh:"æªå¨",workTitleZh:"饥饿"},{nationId:"cl",nationZh:"æºå©",workTitleZh:"马ä¸å¡"},{nationId:"np",nationZh:"å°¼æ³å°",workTitleZh:"ç½æ¥"},{nationId:"ir",nationZh:"伿",workTitleZh:"å°éå"},{nationId:"kh",nationZh:"æ¬å寨",workTitleZh:"稻ç°äºº"},{nationId:"dz",nationZh:"é¿å°åå©äº",workTitleZh:"穷人ä¹å"}],"James:3":[{nationId:"th",nationZh:"æ³°å½",workTitleZh:"å¤å³"},{nationId:"fr",nationZh:"æ³å½",workTitleZh:"å¢å£ä¹é´"},{nationId:"cl",nationZh:"æºå©",workTitleZh:"æ®é女人"}],"James:5":[{nationId:"us",nationZh:"ç¾å½",workTitleZh:"ç¾å½å·¥å"},{nationId:"bd",nationZh:"åå æå½",workTitleZh:"åå æå¶é "},{nationId:"nl",nationZh:"è·å
°",workTitleZh:"马å
æ¯Â·å弿å°"},{nationId:"ec",nationZh:"åçå¤å°",workTitleZh:"ç¦è¥¿è¬æ"}],"Jeremiah:29":[{nationId:"ir",nationZh:"伿",workTitleZh:"æå¨ä¼æé¿å¤§"}],"Jeremiah:31":[{nationId:"mg",nationZh:"é©¬è¾¾å æ¯å ",workTitleZh:"ãåªå°ï¼1947ã"}],"Jeremiah:6":[{nationId:"lk",nationZh:"æ¯éå
°å¡",workTitleZh:"被éå¿çåå°"}],"Job:19":[{nationId:"ru",nationZh:"ä¿ç½æ¯",workTitleZh:"å©ç»´å¦"}],"John:1":[{nationId:"ng",nationZh:"å°¼æ¥å©äº",workTitleZh:"ç¦è§£"},{nationId:"pe",nationZh:"ç§é²",workTitleZh:"彩å¡ç·å©"},{nationId:"pk",nationZh:"å·´åºæ¯å¦",workTitleZh:"ä¹å"},{nationId:"ma",nationZh:"æ©æ´å¥",workTitleZh:"èè²é¿è¢"},{nationId:"ae",nationZh:"é¿èé
",workTitleZh:"æµ·ä¹å½±"}],"John:10":[{nationId:"fr",nationZh:"æ³å½",workTitleZh:"人ä¸ç¥"},{nationId:"ma",nationZh:"æ©æ´å¥",workTitleZh:"ä¸å¸ç马"},{nationId:"sd",nationZh:"è丹",workTitleZh:"ä½ ä¼å¨äºå岿¶æ»å»"}],"John:11":[{nationId:"be",nationZh:"æ¯å©æ¶",workTitleZh:"亲å¯"}],"John:12":[{nationId:"ke",nationZh:"è¯å°¼äº",workTitleZh:"ä¸ç²éº¦ç§"}],"John:19":[{nationId:"iq",nationZh:"伿å
",workTitleZh:"æ´å°¸äºº"}],"John:4":[{nationId:"kg",nationZh:"åå°åæ¯æ¯å¦",workTitleZh:"贾米æ"}],"John:8":[{nationId:"ar",nationZh:"é¿æ ¹å»·",workTitleZh:"宿¹è¯´æ³"},{nationId:"lb",nationZh:"é»å·´å«©",workTitleZh:"ç¦ç³"},{nationId:"mu",nationZh:"æ¯éæ±æ¯",workTitleZh:"ãä¼èèµ°åºåºå¢ã"}],"John:9":[{nationId:"za",nationZh:"åé",workTitleZh:"æ¨æ¥"},{nationId:"ug",nationZh:"ä¹å¹²è¾¾",workTitleZh:"éå¾"},{nationId:"pg",nationZh:"å·´å¸äºæ°å å
äº",workTitleZh:"é³é±¼"}],"Jonah:4":[{nationId:"kr",nationZh:"é©å½",workTitleZh:"å¯é³"}],"Leviticus:19":[{nationId:"ng",nationZh:"å°¼æ¥å©äº",workTitleZh:"è¿å°±æ¯æçæ¿æ"},{nationId:"kz",nationZh:"åè¨å
æ¯å¦",workTitleZh:"ç»æ¯å¤§æç礼ç©"},{nationId:"lk",nationZh:"æ¯éå
°å¡",workTitleZh:"æµæµªç迪æ½"},{nationId:"gr",nationZh:"å¸è
",workTitleZh:"ä»å°¼äº"}],"Leviticus:25":[{nationId:"au",nationZh:"澳大å©äº",workTitleZh:"åå ¡"}],"Luke:10":[{nationId:"ro",nationZh:"ç½é©¬å°¼äº",workTitleZh:"å±±ä¹å¤"},{nationId:"tz",nationZh:"妿¡å°¼äº",workTitleZh:"女å¿ä»¬"},{nationId:"ec",nationZh:"åçå¤å°",workTitleZh:"æå¤è¿"},{nationId:"sy",nationZh:"åå©äº",workTitleZh:"æ´ç©´éçå»é¢"}],"Luke:12":[{nationId:"lr",nationZh:"婿¯éäº",workTitleZh:"ãç³æ»©ä¹å±ã"}
1],"Luke:14":[{nationId:"pg",nationZh:"å·´å¸äºæ°å å
äº",workTitleZh:"å¾å¡çº³ï¼è°è¯¥è´è´£"}],"Luke:15":[{nationId:"jp",nationZh:"æ¥æ¬",workTitleZh:"æ ç¼ç¤¾ä¼"},{nationId:"id",nationZh:"å°åº¦å°¼è¥¿äº",workTitleZh:"ç
§çéå£åº"},{nationId:"iq",nationZh:"伿å
",workTitleZh:"å·´æ¯ä¼¦ä¹å"}],"Luke:18":[{nationId:"mx",nationZh:"墨西å¥",workTitleZh:"æ´é£é¨"},{nationId:"cd",nationZh:"åææ°ä¸»å
±åå½",workTitleZh:"顺æµèä¸å°éæ²è¨"}],"Luke:19":[{nationId:"za",nationZh:"åé",workTitleZh:"é»å¸®æ´å¾"},{nationId:"se",nationZh:"çå
¸",workTitleZh:"åä¸è¡ç¼"},{nationId:"ke",nationZh:"è¯å°¼äº",workTitleZh:"å
ç½æ¯åæ¡å½"},{nationId:"es",nationZh:"西çç",workTitleZh:"å¹³è¡æ¯äº²"},{nationId:"ec",nationZh:"åçå¤å°",workTitleZh:"é¼ ãèåä¸çªè´¼"},{nationId:"af",nationZh:"é¿å¯æ±",workTitleZh:"追é£çç人"}],"Luke:22":[{nationId:"jp",nationZh:"æ¥æ¬",workTitleZh:"æ²é»"}],"Luke:24":[{nationId:"dk",nationZh:"丹麦",workTitleZh:"å·´è´ç¹ä¹å®´"}],"Luke:3":[{nationId:"sd",nationZh:"è丹",workTitleZh:"åè§ï¼æ±èå¨
"}],"Mark:10":[{nationId:"eg",nationZh:"åå",workTitleZh:"å¼ç½ä¸é¨æ²"},{nationId:"it",nationZh:"æå¤§å©",workTitleZh:"è±¹"},{nationId:"ke",nationZh:"è¯å°¼äº",workTitleZh:"ç»ç女å©"},{nationId:"lb",nationZh:"é»å·´å«©",workTitleZh:"ä½ä»¥ä¸ºå®¶"},{nationId:"uz",nationZh:"ä¹å
¹å«å
æ¯å¦",workTitleZh:"æ·æ°å
"},{nationId:"mm",nationZh:"ç¼
ç¸",workTitleZh:"å§ä¾£"},{nationId:"sa",nationZh:"æ²ç¹é¿æä¼¯",workTitleZh:"ç¦åè¾¾"},{nationId:"af",nationZh:"é¿å¯æ±",workTitleZh:"奥è¨ç"}],"Mark:12":[{nationId:"np",nationZh:"å°¼æ³å°",workTitleZh:"ç½è²å¤§å°"}],"Mark:3":[{nationId:"nl",nationZh:"è·å
°",workTitleZh:"å®ä¸å°¼å¨
å®¶æ"}],"Mark:7":[{nationId:"kz",nationZh:"åè¨å
æ¯å¦",workTitleZh:"é¿æä¹è·¯"}],"Mark:8":[{nationId:"mm",nationZh:"ç¼
ç¸",workTitleZh:"ç»ç宫殿"}],"Mark:9":[{nationId:"se",nationZh:"çå
¸",workTitleZh:"第ä¸å°å°"},{nationId:"ec",nationZh:"åçå¤å°",workTitleZh:"æ°´ä¹å¥³ç"},{nationId:"iq",nationZh:"伿å
",workTitleZh:"ä¹é¾ä¹ä¼é£"}],"Matthew:10":[{nationId:"in",nationZh:"å°åº¦",workTitleZh:"ä¸å»å¤§é¹å®è±å"}],"Matthew:13":[{nationId:"id",nationZh:"å°åº¦å°¼è¥¿äº",workTitleZh:"å¤©è¹æéå°å¦"}],"Matthew:18":[{nationId:"au",nationZh:"澳大å©äº",workTitleZh:"é²å
篱ç¬"},{nationId:"tr",nationZh:"åè³å
¶",workTitleZh:"é马"},{nationId:"cz",nationZh:"æ·å
",workTitleZh:"ç»æä¸ä¸ªç¸"},{nationId:"kg",nationZh:"åå°åæ¯æ¯å¦",workTitleZh:"ç½è½®è¹"},{nationId:"kh",nationZh:"æ¬å寨",workTitleZh:"ä»ä»¬å
æäºæç¶äº²"}
1,{nationId:"jo",nationZh:"约æ¦",workTitleZh:"å¸å¸"},{nationId:"ru",nationZh:"ä¿ç½æ¯",workTitleZh:"塿马ä½å¤«å
å¼"},{nationId:"cu",nationZh:"å¤å·´",workTitleZh:"è¡ä¸º"},{nationId:"am",nationZh:"äºç¾å°¼äº",workTitleZh:"æä»¬åæä»¬çå±±"},{nationId:"il",nationZh:"以è²åï¼ç°ä»£å½å®¶ï¼",workTitleZh:"æ¿è¯º"}],"Matthew:19":[{nationId:"uz",nationZh:"ä¹å
¹å«å
æ¯å¦",workTitleZh:"æ§æ¥"}],"Matthew:2":[{nationId:"mx",nationZh:"墨西å¥",workTitleZh:"ç«å¤"}],"Matthew:23":[{nationId:"ph",nationZh:"è²å¾å®¾",workTitleZh:"ä¸è®¸ç¯æ"},{nationId:"ro",nationZh:"ç½é©¬å°¼äº",workTitleZh:"åæä¸å¨ä¸¤å¤©"}],"Matthew:25":[{nationId:"gb",nationZh:"è±å½",workTitleZh:"ææ¯å¸è±å
"},{nationId:"fr",nationZh:"æ³å½",workTitleZh:"åè§ï¼å©å们"},{nationId:"pl",nationZh:"æ³¢å
°",workTitleZh:"绿è²è¾¹å¢"}],"Matthew:5":[{nationId:"fi",nationZh:"è¬å
°",workTitleZh:"ãæ å士å
µã"}],"Matthew:7":[{nationId:"cu",nationZh:"å¤å·´",workTitleZh:"ä½åº¦å¼åçåå¿"}],"Micah:2":[{nationId:"kz",nationZh:"åè¨å
æ¯å¦",workTitleZh:"æ¿ä¸»"},{nationId:"ke",nationZh:"è¯å°¼äº",workTitleZh:"èµ°åºéæ´²"},{nationId:"kh",nationZh:"æ¬å寨",workTitleZh:"ç½æ¥¼"},{nationId:"ru",nationZh:"ä¿ç½æ¯",workTitleZh:"ç¥é·ä¼å¡çå¼äºç¼ç"},{nationId:"dz",nationZh:"é¿å°åå©äº",workTitleZh:"ç½ç«å²æ"}],"Micah:4":[{nationId:"es",nationZh:"西çç",workTitleZh:"é¿å°å¡ææ¯"}],"Micah:6":[{nationId:"za",nationZh:"åé",workTitleZh:"åæ³£å§ï¼äº²ç±çç¥å½"},{nationId:"ar",nationZh:"é¿æ ¹å»·",workTitleZh:"é¿æ ¹å»·ï¼1985"},{nationId:"lb",nationZh:"é»å·´å«©",workTitleZh:"ç¾è¾±"},{nationId:"uz",nationZh:"ä¹å
¹å«å
æ¯å¦",workTitleZh:"å¤ä¸æ¼"},{nationId:"cd",nationZh:"åææ°ä¸»å
±åå½",workTitleZh:"ç»´ç¦Â·éç¦ï¼"},{nationId:"ht",nationZh:"æµ·å°",workTitleZh:"å¸ç§ç¹è°ææ¡"},{nationId:"il",nationZh:"以è²åï¼ç°ä»£å½å®¶ï¼",workTitleZh:"离å©è¯è®¼"},{nationId:"ch",nationZh:"ç士",workTitleZh:"ãèå¦è¿ä¹¡ã"}],"Nehemiah:8":[{nationId:"pg",nationZh:"å·´å¸äºæ°å å
äº",workTitleZh:"ç½å
ç"}],"Numbers:35":[{nationId:"mn",nationZh:"èå¤",workTitleZh:"ä¸ççè¡ç®¡"}],"Philemon:16":[{nationId:"sg",nationZh:"æ°å å¡",workTitleZh:"ç¸å¦ä¸å¨å®¶"},{nationId:"tz",nationZh:"妿¡å°¼äº",workTitleZh:"天å "},{nationId:"om",nationZh:"é¿æ¼",workTitleZh:"天ä½"}],"Philippians:1":[{nationId:"de",nationZh:"å¾·å½",workTitleZh:"ç±ä¸ä¹¦ç®"},{nationId:"dz",nationZh:"é¿å°åå©äº",workTitleZh:"人ä¸ä¸å¸"}],"Philippians:2":[{nationId:"mx",nationZh:"墨西å¥",workTitleZh:"ç½é©¬"},{nationId:"cd",nationZh:"åææ°ä¸»å
±åå½",workTitleZh:"æ¯æ¨å£ç»"},{nationId:"am",nationZh:"äºç¾å°¼äº",workTitleZh:"æ¥å"}],"Proverbs:11":[{nationId:"sa",nationZh:"æ²ç¹é¿æä¼¯",workTitleZh:"å©é
å¾å¥³å©"}],"Proverbs:15":[{nationId:"ro",nationZh:"ç½é©¬å°¼äº",workTitleZh:"è«ç½æ¢
ç¹ä¸å®¶"}],"Proverbs:18":[{nationId:"lk",nationZh:"æ¯éå
°å¡",workTitleZh:"䏿éçæåº"},{nationId:"tr",nationZh:"åè³å
¶",workTitleZh:"å°äºç»äºå¾äº"},{nationId:"nl",nationZh:"è·å
°",workTitleZh:"è¢å»"},{nationId:"pk",nationZh:"å·´åºæ¯å¦",workTitleZh:"é£è¾ä¹ç"},{nationId:"ir",nationZh:"伿",workTitleZh:"䏿¬¡å«ç¦»"},{nationId:"jo",nationZh:"约æ¦",workTitleZh:"æ³å°å"},{nationId:"sd",nationZh:"è丹",workTitleZh:"ååç©"},{nationId:"ge",nationZh:"æ ¼é²åäº",workTitleZh:"é«å 索山èçè¯æå½åº¦ï¼æ ¼é²åäº"},{nationId:"il",nationZh:"以è²åï¼ç°ä»£å½å®¶ï¼",workTitleZh:"é¿è´¾ç±³"}],"Proverbs:23":[{nationId:"dk",nationZh:"丹麦",workTitleZh:"é
精计å"}],"Proverbs:24":[{nationId:"ua",nationZh:"ä¹å
å
°",workTitleZh:"å¤å¿é¢"}],"Proverbs:31":[{nationId:"eg",nationZh:"åå",workTitleZh:"广åº"},{nationId:"nz",nationZh:"æ°è¥¿å
°",workTitleZh:"é¢ç´è¯¾"},{nationId:"pe",nationZh:"ç§é²",workTitleZh:"æ å乿"},{nationId:"es",nationZh:"西çç",workTitleZh:"æ²é»æ£ä¹"},{nationId:"bd",nationZh:"åå æå½",workTitleZh:"䏿¡å«æå¡æ¯çæ²³"},{nationId:"nl",nationZh:"è·å
°",workTitleZh:"å®å¦®æ¥è®°"},{nationId:"np",nationZh:"å°¼æ³å°",workTitleZh:"å¸å°å¸è¨åå¡é¦"},{nationId:"jo",nationZh:"约æ¦",workTitleZh:"é¿å¸Â·æä¼å¾·è¹é¿"},{nationId:"sa",nationZh:"æ²ç¹é¿æä¼¯",workTitleZh:"å®ç¾åé人"},{nationId:"af",nationZh:"é¿å¯æ±",workTitleZh:"å
»å®¶ä¹äºº"},{nationId:"ie",nationZh:"ç±å°å
°",workTitleZh:"ãåè¿æ ·çå°äºã"}],"Proverbs:4":[{nationId:"ke",nationZh:"è¯å°¼äº",workTitleZh:"æå¹´é¿çå°å¦ç"}],"Psalms:10":[{nationId:"lk",nationZh:"æ¯éå
°å¡",workTitleZh:"马é·é¿å°æ¢
è¾¾çä¸ä¸ªæäº®"},{nationId:"tz",nationZh:"妿¡å°¼äº",workTitleZh:"æ¥ä¸"},{nationId:"sy",nationZh:"åå©äº",workTitleZh:"壳"},{nationId:"il",nationZh:"以è²åï¼ç°ä»£å½å®¶ï¼",workTitleZh:"ç»è"},{nationId:"ly",nationZh:"婿¯äº",workTitleZh:"ã彿¥ã"}],"Psalms:103":[{nationId:"np",nationZh:"å°¼æ³å°",workTitleZh:"å¡çº³å©èè°"}],"Psalms:104":[{nationId:"kz",nationZh:"åè¨å
æ¯å¦",workTitleZh:"ééé¦"}],"Psalms:126":[{nationId:"ht",nationZh:"æµ·å°",workTitleZh:"æµ·å°ï¼
1æçç±"}],"Psalms:13":[{nationId:"cl",nationZh:"æºå©",workTitleZh:"èå"},{nationId:"dk",nationZh:"丹麦",workTitleZh:"è±è°·"}],"Psalms:137":[{nationId:"au",nationZh:"澳大å©äº",workTitleZh:"èå®ç³"},{nationId:"pe",nationZh:"ç§é²",workTitleZh:"æ·±æ²çæ²³æµ"},{nationId:"ua",nationZh:"ä¹å
å
°",workTitleZh:"æ©è²çåå°"},{nationId:"mm",nationZh:"ç¼
ç¸",workTitleZh:"æ¥èªç»¿é¬¼ä¹å°"}],"Psalms:139":[{nationId:"gb",nationZh:"è±å½",workTitleZh:"æ··æ²å°å¹´æ¶"},{nationId:"kg",nationZh:"åå°åæ¯æ¯å¦",workTitleZh:"è´ä»è¯ç®å°"}],"Psalms:24":[{nationId:"ge",nationZh:"æ ¼é²åäº",workTitleZh:"çç±³å²"}],"Psalms:27":[{nationId:"nz",nationZh:"æ°è¥¿å
°",workTitleZh:"æ¯å©ç·å©"}],"Psalms:56":[{nationId:"ca",nationZh:"å æ¿å¤§",workTitleZh:"å°ç¬¬å®é©¬"},{nationId:"pe",nationZh:"ç§é²",workTitleZh:"伤å¿ç奶水"},{nationId:"pk",nationZh:"å·´åºæ¯å¦",workTitleZh:"éé»ä¹æ°´"},{nationId:"kh",nationZh:"æ¬å寨",workTitleZh:"æ®ç¼ºå½±å"}],"Psalms:68":[{nationId:"nz",nationZh:"æ°è¥¿å
°",workTitleZh:"追æéè®äºº"},{nationId:"ec",nationZh:"åçå¤å°",workTitleZh:"é¿å°è"},{nationId:"ma",nationZh:"æ©æ´å¥",workTitleZh:"é¿é·æç¦ï¼è¡å¤´çå"}],"Psalms:78":[{nationId:"ps",nationZh:"巴忝å¦",workTitleZh:"å©ä¸çæ¶å
"}],"Psalms:82":[{nationId:"af",nationZh:"é¿å¯æ±",workTitleZh:"ç¿çåé³"},{nationId:"ps",nationZh:"巴忝å¦",workTitleZh:"å®é¨äºº"}],"Psalms:88":[{nationId:"ir",nationZh:"伿",workTitleZh:"ç²æ"}],"Psalms:9":[{nationId:"tr",nationZh:"åè³å
¶",workTitleZh:"åå£"}],"Psalms:90":[{nationId:"us",nationZh:"ç¾å½",workTitleZh:"å«åè¯å¥¹"},{nationId:"gr",nationZh:"å¸è
",workTitleZh:"æ°¸æå䏿¥"},{nationId:"no",nationZh:"æªå¨",workTitleZh:"ä¸ç䏿ç³ç³ç人"},{nationId:"ps",nationZh:"巴忝å¦",workTitleZh:"çå±"}],"Revelation:7":[{nationId:"no",nationZh:"æªå¨",workTitleZh:"å¼è·¯å
é"},{nationId:"ug",nationZh:"ä¹å¹²è¾¾",workTitleZh:"æç»´è¯ºä¹æ"}],"Romans:11":[{nationId:"pl",nationZh:"æ³¢å
°",workTitleZh:"修女ä¼è¾¾"}],"Romans:12":[{nationId:"ng",nationZh:"å°¼æ¥å©äº",workTitleZh:"åè½®é»æ¥"},{nationId:"pl",nationZh:"æ³¢å
°",workTitleZh:"ç°ç¬ä¸é»ç³"},{nationId:"ar",nationZh:"é¿æ ¹å»·",workTitleZh:"èè®æ
äº"},{nationId:"gr",nationZh:"å¸è
",workTitleZh:"è¹æ"},{nationId:"bd",nationZh:"åå æå½",workTitleZh:"é»éæ¶ä»£"},{nationId:"ua",nationZh:"ä¹å
å
°",workTitleZh:"被éå¿ç¥å
çé´å½±"},{nationId:"kh",nationZh:"æ¬å寨",workTitleZh:"é³ä¹äººç"},{nationId:"iq",nationZh:"伿å
",workTitleZh:"å·´æ ¼è¾¾æªå®¢"},{nationId:"am",nationZh:"äºç¾å°¼äº",workTitleZh:"åè¤ä¹æ"},{nationId:"al",nationZh:"é¿å°å·´å°¼äº",workTitleZh:"ãç³å¤´å纪äºã"}],"Romans:16":[{nationId:"ma",nationZh:"æ©æ´å¥",workTitleZh:"大象ä¹å¹´"}],"Romans:2":[{nationId:"id",nationZh:"å°åº¦å°¼è¥¿äº",workTitleZh:"ææ®æ¼ç»"}],"Romans:7":[{nationId:"dk",nationZh:"丹麦",workTitleZh:"奿¬åæ ¹ä¸é¨æ²"}],"Ruth:1":[{nationId:"kg",nationZh:"åå°åæ¯æ¯å¦",workTitleZh:"天ä¸ç游ç§"},{nationId:"ht",nationZh:"æµ·å°",workTitleZh:"å¼é·è¾¾"}],"Song of Solomon:8":[{nationId:"kz",nationZh:"åè¨å
æ¯å¦",workTitleZh:"å°å¥³åå«å
"}]};const Ut=({tone:e,bg:n,icon:a,title:r,meta:o,onClick:s,target:i})=>t.jsxs("button",{"data-next-target":i,onClick:s,className:"group flex items-center gap-2.5 px-3.5 py-3 rounded-xl bg-white border border-[#E6E2D6] transition-colors text-left hover:border-[color:var(--cns-tone)]",style:{"--cns-tone":`${e}99`},children:[t.jsx("span",{className:"flex-none w-8 h-8 rounded-lg flex items-center justify-center",style:{background:n},children:a}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-[13px] font-medium text-[#2D2A22] truncate",children:r}),t.jsx("span",{className:"block text-[13px] text-[#64748B] truncate",children:o})]}),t.jsx(Ze,{className:"flex-none w-4 h-4 text-[#64748B] transition-colors"})]}),Jt=({book:n,chapter:a,bookZh:r,onReady:o})=>{const m=s(),p=ce("wiki",a>=1?`${n}:${a}`:null),[x,b]=e.useState(null),[f,g]=e.useState([]),[w,k]=e.useState(!1),[v,y]=e.useState(!1),[j,Z]=e.useState(!1),N=a>=1?function(e,t){return!e||!Number.isFinite(t)||t<1?[]:Gt[`${e}:${t}`]??[]}(n,a):[],C=h(n),E=i(r);if(e.useEffect(()=>{if(!n||a<1)return void y(!0);let e=!1;return y(!1),Promise.all([Wt(n,a),l(n,a).catch(()=>[])]).then(([t,n])=>{e||(b(t),g((n||[]).slice(0,2).map(e=>({slug:e.slug,title:String(e.title||"")}))),y(!0))}).catch(()=>{e||y(!0)}),()=>{e=!0}},[n,a]),e.useEffect(()=>{if(!n||a<1)return void Z(!0);let e=!0;return Z(!1),xe().then(t=>{e&&(k(t.has(ke(n,a))),Z(!0))}).catch(()=>{e&&Z(!0)}),()=>{e=!1}},[n,a]),e.useEffect(()=>{v&&j&&(null==o||o())},[v,j,o]),a<1)return null;if(!w&&!x&&0===f.length&&0===N.length)return null;const T=u();return t.jsxs("section",{ref:p.ref,onClickCapture:p.onClickCapture,className:"mt-8 px-4 py-4 rounded-2xl bg-[#FFFCF5] border-2 border-[#
1E6E2D6]",children:[t.jsx("h3",{className:"text-[13px] font-semibold text-[#6B6557] mb-1",children:m("读å®è¿ä¸ç« ï¼è¿å¯ä»¥å¾åªå¿èµ°ï¼")}),t.jsx("p",{className:"text-[13px] text-[#64748B] mb-3 leading-relaxed",children:`${E} ${a} ${m(C)}${m("ââå䏿®µç»æï¼ç«å
è¿æè¿å æ¡è·¯ã")}`}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[w&&t.jsx("div",{"data-next-target":"chapterQuiz",className:"contents",children:t.jsx(pe,{book:n,chapter:a,variant:"card",isAvailable:!0})}),x&&t.jsx(Ut,{tone:d.reading.tone,bg:d.reading.bg,icon:t.jsx(ve,{className:"w-4 h-4",style:{color:d.reading.tone}}),title:m("è·çé读读è¿ä¸å¨"),meta:`${m(d.reading.nameZh)} · ${m("第")} ${x.weekNum} ${m("å¨")}${x.title?` · ${be(x.title,T)}`:""}`,onClick:()=>c("bibleJourneyRPG",{bibleJourneyQuestId:x.questId}),target:"reading"}),N.slice(0,2).map(e=>t.jsx(Ut,{tone:d.nations.tone,bg:d.nations.bg,icon:t.jsx(ye,{className:"w-4 h-4",style:{color:d.nations.tone}}),title:m("æä¸ä»½ä»¥è¿æ®µç»æå
±ççæå"),meta:`${m(d.nations.nameZh)} · ${m(e.nationZh)}ã${m(e.workTitleZh)}ã`,onClick:()=>c("nations",{nationId:e.nationId}),target:"nations"},e.nationId+e.workTitleZh)),f.map(e=>t.jsx(Ut,{tone:d.library.tone,bg:d.library.bg,icon:t.jsx(je,{className:"w-4 h-4",style:{color:d.library.tone}}),title:be(e.title,T),meta:`${m(d.library.nameZh)} · ${m("讲å°è¿ä¸ç« ")}`,onClick:()=>c("libraryArticle",{librarySlug:e.slug}),target:"library"},e.slug))]})]})},Vt="wiki-handout-print-portal",Kt=`\n#${Vt} { display: none; }\n@media print {\n html, body {\n height: auto !important;\n min-height: 0 !important;\n overflow: visible !important;\n background: #fff !important;\n }\n body.wiki-handout-printing > *:not(#${Vt}) { display: none !important; }\n body.wiki-handout-printing > #${Vt} {\n position: static !important;\n display: block !important;\n width: auto !important;\n height: auto !important;\n overflow: visible !important;\n }\n #${Vt} #wiki-handout-print-region {\n position: static !important;\n display: block !important;\n width: 100% !important;\n height: auto !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: visible !important;\n border: none !important;\n border-radius: 0 !important;\n background: #fff !important;\n }\n @page { size: A4 portrait; margin: 14mm 16mm; }\n .bw-handout-rich { font-size: 11.5pt; line-height: 1.75; }\n .bw-handout-questions { break-inside: auto; }\n .bw-handout-q { break-inside: avoid; }\n .bw-handout-prayer-block { break-inside: avoid; }\n .bw-handout-prayer-notes { min-height: 38mm; }\n .bw-handout-h2 { font-size: 13.5pt; }\n .bw-handout-qtext, .bw-handout-qnum, .bw-handout-prayer { font-size: 11.5pt; line-height: 1.7; }\n .bw-handout-qhint { font-size: 10pt; }\n .bw-handout-qlabel { font-size: 9pt; }\n}\n@keyframes bw-handout-sheet-up {\n from { transform: translateY(24px); opacity: 0.7; }\n to { transform: translateY(0); opacity: 1; }\n}\n.bw-handout-sheet { animation: bw-handout-sheet-up 220ms cubic-bezier(0.22, 1, 0.36, 1); }\n@media (min-width: 768px) {\n .bw-handout-sheet { animation: none; }\n}\n.bw-handout-rich { font-size: 17px; line-height: 1.85; color: #3A352B; overflow-wrap: break-word; }\n.bw-handout-rich h2 { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 1.18em; font-weight: 600; color: #3D5A2D; border-bottom: 1px solid #DDD8CC; padding-bottom: 0.25em; margin: 1.4em 0 0.7em; }\n.bw-handout-rich h3 { font-size: 1.06em; font-weight: 600; color: #4F5B45; margin: 1.2em 0 0.5em; }\n.bw-handout-rich p { margin: 0.55em 0; }\n.bw-handout-rich ul, .bw-handout-rich ol { padding-inline-start: 1.5em; margin: 0.55em 0; }\n.bw-handout-rich li { margin: 0.3em 0; }\n.bw-handout-rich blockquote { border-inline-start: 3px solid #9CB58A; background: rgba(156, 181, 138, 0.10); margin: 0.8em 0; padding: 0.5em 0.9em; border-radius: 6px; }\n.bw-handout-rich blockquote p { margin: 0.3em 0; }\n.bw-handout-rich table { border-collapse: collapse; margin: 0.9em 0; font-size: 0.92em; }\n.bw-handout-rich th, .bw-handout-rich td { border: 1px solid #DDD8CC; padding: 0.35em 0.6em; text-align: start; }\n.bw-handout-rich th { background: #F5F1E8; }\n.bw-handout-rich strong { color: #3D5A2D; }\n/* æ·±è²æ¨¡å¼ï¼#199ï¼ï¼ä¸é¢è¿æ¹ç¨ tag éæ©å¨åæ»äºè²å·ï¼å
¨å± tailwind æè²è¦çå±\n å¤ä¸çï¼å®æ text-*ãbg-* ç±»åå¹é
ï¼ï¼æåºä¸æ£æä¸æ é¢ç䏿¸
ï¼\n @media screen æ¯ä¸ºäºè®©æå°æ¶ä»èµ°ä¸é¢çé»è®¤æ·±åç½çº¸ï¼ä¸è¢«å¤é´è²å¸¦èµ° */\n@media screen {\n html.dark .bw-handout-rich { color: #E6DED0; }\n html.dark .bw-handout-rich h2 { color: #9DCB78; border-bottom-color: #38332A; }\n html.dark .bw-handout-rich h3 { color: #A8BCA0; }\n html.dark .bw-handout-rich blockquote { border-inline-start-color: #8FAE6E; background: rgba(156, 181, 138, 0.16); }\n html.dark .bw-handout-rich th, html.dark .bw-handout-rich td { border-color: #38332A; }\n html.dark .bw-handout-rich th { background: #2A251E; color: #ECE6D8; }\n html.dark .bw-handout-rich strong { color: #9DCB78; }\n}\n\n/* è®¨è®ºé¢ / åºç¨ç¥·åæçï¼è·æ£æ .bct-rich-text åä¸å¥ç¼©æ¾é¶æ¢¯ï¼æ¡é¢/ææºé»è®¤/æ¾å¤§/è¶
大ï¼ï¼\n å¦å讨论é¢åºå® 16px 伿¯æ£æå°ä¸æªââææºä¸æ¾å¤§æ¡£å°¤å
¶ææ¾ã */\n.bw-handout-h2 { font-size: 20px; }\n.bw-handout-qnum { font-size: 17px; }\n.bw-handout-qlabel { font-size: 13px; }\n.bw-handout-qtext { font-size: 17px; line-height: 1.85; }\n.bw-handout-qhint { font-size: 14px; line-height: 1.7; }\n.bw-handout-prayer { font-size: 17px; line-height: 1.9; }\n.bw-handout-prayer-notes {\n min-height: 144px;\n background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 34px, #DDD8CC 35px);\n}\nhtml.text-scale-large .bw-handout-h2 { font-size: 20px; }\nhtml.text-scale-large .bw-handout-qtext,\nhtml.text-scale-large .bw-handout-qnum,\nhtml.text-scale-large .bw-handout-prayer { font-size: 18px; }\nhtml.text-scale-large .bw-handout-qhint { font-size: 14.5px; }\nhtml.text-scale-xlarge .bw-handout-h2 { font-size: 22px; }\nhtml.text-scale-xlarge .bw-handout-qtext,\nhtml.text-scale-xlarge .bw-handout-qnum,\nhtml.text-scale-xlarge .bw-handout-prayer { font-size: 20px; }\nhtml.text-scale-xlarge .bw-handout-qhint { font-size: 15px; }\n@media (max-width: 768px) {\n .bw-handout-h2 { font-size: 20px; }\n .bw-handout-qnum { font-size: 18px; }\n .bw-handout-qlabel { font-size: 13px; }\n .bw-handout-qtext { font-size: 18px; }\n .bw-handout-qhint { font-size: 14.5px; }\n .bw-handout-prayer { font-size: 18px; }\n html.text-scale-large .bw-handout-h2 { font-size: 22px; }\n html.text-scale-large .bw-handout-qtext,\n html.text-scale-large .bw-handout-qnum,\n html.text-scale-large .bw-handout-prayer { font-size: 20px; }\n html.text-scale-large .bw-handout-qhint { font-size: 15px; }\n html.text-scale-xlarge .bw-handout-h2 { font-size: 24px; }\n html.text-scale-xlarge .bw-handout-qtext,\n html.text-scale-xlarge .bw-handout-qnum,\n html.text-scale-xlarge .bw-handout-prayer { font-size: 22px; }\n html.text-scale-xlarge .bw-handout-qhint { font-size: 15.5px; }\n}
1\n`,Yt=["warmup","observe","interpret","apply"];function Qt(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent||"",t=/AppleWebKit/i.test(e),n=(navigator.maxTouchPoints||0)>1||"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches;return t&&n}const Xt=({book:a,chapter:r,bookZh:o,articleTitle:i,simpleHtml:l,standardHtml:d,onClose:c})=>{const h=s(),y=x(),j=e.useRef(null),[Z,N]=e.useState(!0),[C,E]=e.useState(!1),[T,F]=e.useState(!0),[I,S]=e.useState(!0),[A,D]=e.useState(null),[_,B]=e.useState(""),[$,L]=e.useState(!1),[M,q]=e.useState(!1),[z,P]=e.useState(!1),[O,R]=e.useState(""),[H,W]=e.useState(""),[G,U]=e.useState(null);e.useEffect(()=>(null==y||y.setOverlayOpen(!0),()=>null==y?void 0:y.setOverlayOpen(!1)),[y]);const J=n.useCallback(()=>{L(!0),q(!1),(async(e,t,n)=>{if(!m())throw new Error("OFFLINE");const{data:a,error:r}=await p.from("bible_wiki_study_questions").select("questions, prayer").eq("book",e).eq("chapter",t).maybeSingle();if(!r&&Array.isArray(null==a?void 0:a.questions)&&a.questions.length>=4)return{questions:a.questions,prayer:"string"==typeof a.prayer?a.prayer:""};const{data:o,error:s}=await p.functions.invoke("wiki-study-questions",{body:{book:e,chapter:t,bookZh:n}});if(s)throw new Error(s.message||(null==r?void 0:r.message)||"study questions failed");if(!(null==o?void 0:o.success)||!Array.isArray(o.questions))throw new Error((null==o?void 0:o.message)||"study questions failed");return{questions:o.questions,prayer:"string"==typeof o.prayer?o.prayer:""}})(a,r,o).then(e=>{D(e.questions),B(e.prayer)}).catch(e=>{console.error("wiki handout study questions failed:",e),q(!0)}).finally(()=>L(!1))},[a,r,o]);e.useEffect(()=>{J()},[J]);const V=n.useCallback(()=>{var e;null==(e=document.getElementById(Vt))||e.remove(),document.body.classList.remove("wiki-handout-printing")},[]),K=n.useCallback(()=>{const e=j.current;if(!e)return;V();const t=document.createElement("div");t.id=Vt,t.setAttribute("aria-hidden","true"),t.appendChild(e.cloneNode(!0)),document.body.appendChild(t),document.body.classList.add("wiki-handout-printing")},[V]);e.useEffect(()=>(window.addEventListener("beforeprint",K),window.addEventListener("afterprint",V),()=>{window.removeEventListener("beforeprint",K),window.removeEventListener("afterprint",V),V()}),[V,K]);const Y=()=>{try{if(K(),"function"!=typeof window.print)return void w(h("导åºå¤±è´¥ï¼å½åç¯å¢ä¸æ¯ææå°å¯¼åº"));window.print(),Qt()&&window.setTimeout(()=>{k(h("è¥æ²¡æå¼¹åºæå°é¢æ¿ï¼è¯·ç¨æµè§å¨èåéçãæå°ãæãå享ãä¿å PDFã"))},700)}catch(e){V(),w(h("导åºå¤±è´¥ï¼å½åç¯å¢ä¸æ¯ææå°å¯¼åº")),console.error("wiki handout print failed:",e)}},Q=e.useMemo(()=>{if(!A)return[];const e=u();return Yt.flatMap(e=>A.filter(t=>t.section===e)).map(t=>({...t,q:be(t.q,e),hint:t.hint?be(t.hint,e):void 0}))},[A]),X={warmup:h("æåº"),observe:h("è§å¯ç»æ"),interpret:h("ç解信æ¯"),apply:h("çæ´»åºç¨")},ee=0===r?`ã${o}ã· ${h("å
¨å·ç»¼è§")}`:`ã${o}ã${h("第 {0} ç« ").replace("{0}",String(r))}`,te=(new Date).toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric"}),ne=async()=>{if(j.current){P(!0);try{await async function(){var e;
1(null==(e=document.fonts)?void 0:e.ready)&&await Promise.race([document.fonts.ready.then(()=>{}),new Promise(e=>window.setTimeout(e,1500))])}();const{toPng:e}=await v(async()=>{const{toPng:e}=await import("./vendor-shared-CDq_mVLO.js");return{toPng:e}},[]),t=await e(j.current,{pixelRatio:2,backgroundColor:"#FFFCF5",cacheBust:!0}),n=`${o}${r>0?`-${r}`:""}-${h("æ¥ç»è®²ä¹")}.png`;if(Qt())return U({src:t,filename:n}),void k(h("ææºç«¯ï¼é¿æå¾ç â ä¿åå¾çï¼çµè端ï¼ç¹å»ä¸è½½"));const a=document.createElement("a");a.href=t,a.download=n,document.body.appendChild(a),a.click(),a.remove()}catch(e){w(h("çæé¿å¾å¤±è´¥ï¼å¯æ¹ç¨ãæå° / å PDFãã")),console.error("wiki handout long-image export failed:",e)}finally{P(!1)}}},ae=e=>"inline-flex h-9 items-center gap-1.5 rounded-full border px-3.5 text-[13px] font-semibold transition "+(e?"border-[#8FAE6E] bg-[#CFE0BB] text-[#3D5A2D]":"border-[#DED6C8] bg-[#FFFCF5] text-[#6B6557] hover:bg-[#F0EDE2]"),re=e=>"inline-flex h-10 min-w-0 items-center justify-center rounded-xl border px-1 text-[13px] font-semibold transition "+(e?"border-[#8FAE6E] bg-[#DDE8D0] text-[#3D5A2D] shadow-[inset_0_0_0_1px_rgba(143,174,110,0.12)]":"border-[#DED6C8] bg-[#FFFCF5] text-[#797266]");return t.jsxs("div",{className:"bw-handout-overlay fixed inset-x-0 top-0 bottom-[calc(64px+env(safe-area-inset-bottom,0px))] z-[60] flex items-end bg-[rgba(20,18,12,0.48)] backdrop-blur-[2px] md:inset-0 md:block md:overflow-auto md:bg-[rgba(20,18,12,0.55)]",children:[t.jsx("style",{children:Kt}),t.jsx("button",{type:"button",onClick:c,className:"wiki-handout-noprint absolute inset-0 md:hidden","aria-label":h("å
³éæ¥ç»è®²ä¹")}),t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`${ee} · ${h("æ¥ç»è®²ä¹")}`,className:"bw-handout-shell bw-handout-sheet relative z-[1] flex max-h-[calc(88*var(--vh-unit)_-_64px_-_env(safe-area-inset-bottom,0px))] w-full flex-col overflow-hidden rounded-t-[28px] bg-[#F4F2EC] shadow-[0_-12px_40px_rgba(40,35,25,0.16)] md:min-h-full md:max-h-none md:overflow-visible md:rounded-none md:bg-transparent md:shadow-none",children:[t.jsxs("div",{className:"wiki-handout-noprint shrink-0 border-b border-[#DDD8CC] bg-[#F4F2EC] px-4 pb-3 pt-2 md:hidden",children:[t.jsx("div",{className:"mx-auto mb-2 h-1 w-11 rounded-full bg-[#D2CCBE]","aria-hidden":"true"}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{className:"min-w-0 truncate text-[16px] font-semibold text-[#2D2A22]",style:{fontFamily:'"Noto Serif SC","Songti SC",serif'},children:[ee," · ",h("æ¥ç»è®²ä¹")]}),t.jsx(b,{onClick:c,label:h("å
³é")})]}),t.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[t.jsxs("button",{type:"button",onClick:Y,className:"inline-flex h-11 items-center justify-center gap-2 rounded-xl bg-[#4F7942] px-3 text-[14px] font-semibold text-white transition active:bg-[#43663A]",children:[t.jsx(Ne,{className:"h-[18px] w-[18px]"}),h("æå° / å PDF")]}),t.jsxs("button",{type:"button",disabled:z,onClick:ne,className:"inline-flex h-11 items-center justify-center gap-2 rounded-xl border border-[#BFCDB2] bg-[#F7FAF3] px-3 text-[14px] font-semibold text-[#4F7942] transition active:bg-[#EAF1E3] disabled:opacity-60",children:[z?t.jsx(Ce,{className:"h-[18px] w-[18px] animate-spin"}):t.jsx(Ee,{className:"h-[18px] w-[18px]"}),h("ä¿åé¿å¾")]})]}),t.jsxs("div",{className:"mt-2.5 grid grid-cols-4 gap-1.5",children:[t.jsx("button",{type:"button","aria-pressed":Z,"aria-label":h(0===r?"å
¨ä¹¦å¯¼è¯»":"æ¬ç« 导读"),title:h(0===r?"å
¨ä¹¦å¯¼è¯»":"æ¬ç« 导读"),onClick:()=>N(e=>!e),className:re(Z),children:h("导读")}),t.jsx("button",{type:"button","aria-pressed":C,"aria-label":h(0===r?"å
¨ä¹¦è¯¦è§£":"éè详解"),title:h(0===r?"å
¨ä¹¦è¯¦è§£":"éè详解"),onClick:()=>E(e=>!e),className:re(C),children:h("详解")}),t.jsx("button",{type:"button","aria-pressed":T,"aria-label":h("æ¥ç»è®¨è®ºé¢"),title:h("æ¥ç»è®¨è®ºé¢"),onClick:()=>F(e=>!e),className:re(T),children:h("讨论é¢")}),t.jsx("button",{type:"button","aria-pressed":I,"aria-label":h("åºç¨ç¥·å"),title:h("åºç¨ç¥·å"),onClick:()=>S(e=>!e),className:re(I),children:h("祷å")})]}),t.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-2",children:[t.jsx("input",{type:"text",value:O,onChange:e=>R(e.target.value),placeholder:h("带é¢äººï¼éå¡«ï¼"),"aria-label":h("带é¢äººï¼éå¡«ï¼"),className:"h-10 min-w-0 rounded-xl border border-[#DED6C8] bg-[#FFFCF5] px-3 text-[16px] text-[#3A352B] placeholder:text-[#AAA294] focus:border-[#8FAE6E] focus:outline-none"}),t.jsx("input",{type:"text",value:H,onChange:e=>W(e.target.value),placeholder:h("å°ç»åï¼éå¡«ï¼"),"aria-label":h("å°ç»åï¼éå¡«ï¼"),className:"h-10 min-w-0 rounded-xl border border-[#DED6C8] bg-[#FFFCF5] px-3 text-[16px] text-[#3A352B] placeholder:text-[#AAA294] focus:border-[#8FAE6E] focus:outline-none"})]})]}),t.jsxs("div",{className:"wiki-handout-noprint sticky top-0 z-10 hidden bg-[#F4F2EC] px-4 py-3 shadow-sm md:block",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("span",{className:"min-w-0 truncate text-[14px] font-semibold text-[#2D2A22]",style:{fontFamily:'"Noto Serif SC","Songti SC",serif'},children:[ee," · ",h("æ¥ç»è®²ä¹")]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsxs("button",{type:"button",onClick:Y,className:"inline-flex h-9 items-center gap-1.5 rounded-full bg-[#4F7942] px-3.5 text-[13px] font-semibold text-white transition hover:bg-[#43663A]",children:[t.jsx(Ne,{className:"h-4 w-4"}),h("æå° / å PDF")]}),t.jsxs("button",{type:"button",disabled:z,onClick:ne,className:"hidden sm:inline-flex h-9 items-center gap-1.5 rounded-full border border-[#DED6C8] bg-[#FFFCF5] px-3.5 text-[13px] font-semibold text-[#4F7942] transition hover:bg-[#F1F7EA] disabled:opacity-60",children:[z?t.jsx(Ce,{className:"h-4 w-4 animate-spin"}):t.jsx(Ee,{className:"h-4 w-4"}),h("ä¿åé¿å¾")]}),t.jsx("button",{type:"button",onClick:c,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-[#DED6C8] bg-[#FFFCF5] text-[#42526B] transition hover:bg-[#F1EBDD]","aria-label":h("å
³é"),children:t.jsx(Te,{className:"h-5 w-5"})})]})]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[t.jsx("button",{type:"button",onClick:()=>N(e=>!e),className:ae(Z),children:h(0===r?"å
¨ä¹¦å¯¼è¯»":"æ¬ç« 导读")}),t.jsx("button",{type:"button",onClick:()=>E(e=>!e),className:ae(C),children:h(0===r?"å
¨ä¹¦è¯¦è§£":"éè详解")}),t.jsx("button",{type:"button",onClick:()=>F(e=>!e),className:ae(T),children:h("æ¥ç»è®¨è®ºé¢")}),t.jsx("button",{type:"button",onClick:()=>S(e=>!e),className:ae(I),children:h("åºç¨ç¥·å")}),t.jsxs("button",{type:"button",disabled:z,onClick:ne,className:`sm:hidden ${ae(!1)}`,children:[z?t.jsx(Ce,{className:"h-4 w-4 animate-spin"}):t.jsx(Ee,{className:"h-4 w-4"}),h("ä¿åé¿å¾")]})]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[t.jsx("input",{type:"text",value:O,onChange:e=>R(e.target.value),placeholder:h("带é¢äººï¼éå¡«ï¼"),className:"h-9 w-[128px] rounded-full border border-[#DED6C8] bg-[#FFFCF5] px-3.5 text-[13px] text-[#3A352B] placeholder:text-[#B3AC9C] focus:outline-none focus:border-[#8FAE6E]"}),t.jsx("input",{type:"text",value:H,onChange:e=>W(e.target.value),placeholder:h("å°ç»åï¼éå¡«ï¼"),className:"h-9 w-[128px] rounded-full border border-[#DED6C8] bg-[#FFFCF5] px-3.5 text-[13px] text-[#3A352B] placeholder:text-[#B3AC9C] focus:outline-none focus:border-[#8FAE6E]"})]})]}),t.jsxs("div",{className:"bw-handout-scroll min-h-0 flex-1 overflow-y-auto overscroll-contain md:overflow-visible",children:[t.jsx("div",{className:"mx-auto mb-4 mt-3 max-w-[760px] px-3 md:my-4",children:t.jsxs("div",{id:"wiki-handout-print-region",ref:j,className:"rounded-[10px] bg-[#FFFCF5] p-6 sm:p-8",children:[t.jsxs("div",{className:"mb-5 border-b-2 border-[#DDD8CC] pb-4 text-center",children:[t.jsx("p",{className:"text-[13px] tracking-wide text-[#64748B]",children:h("ç¾å®è§£ç» · æ¥ç»è®²ä¹")}),t.jsx("h1",{className:"mt-1.5 text-[26px] font-bold text-[#2D2A22]",style:{fontFamily:'"Noto Serif SC","Songti SC",serif'},children:ee}),i&&t.jsx("p",{className:"mt-1 text-[15px] text-[#6B6557]",children:be(i,u())}),t.jsx("p",{className:"mt-1.5 text-[13px] text-[#64748B]",children:te}),t.jsxs("div",{className:"mt-2 flex items-center justify-center gap-5 text-[13px] text-[#64748B]",children:[t.jsxs("span",{className:"inline-flex items-center gap-1",children:[h("带é¢äºº"),"ï¼",t.jsx("span",{className:O.trim()?"font-medium text-[#3A352B]":"inline-block h-4 min-w-[64px] border-b border-[#C9C2AE]",children:O.trim()})]}),t.jsxs("span",{className:"inline-flex items-center gap-1",children:[h("å°ç»"),"ï¼",t.jsx("span",{className:H.trim()?"font-medium text-[#3A352B]":"inline-block h-4 min-w-[64px] border-b border-[#C9C2AE]",children:H.trim()})]})]})]}),Z&&!!l&&t.jsx("div",{className:"bw-handout-rich bct-rich-text",dangerouslySetInnerHTML:{__html:l}}
1),C&&!!d&&t.jsx("div",{className:Z?"mt-6 border-t border-[#E6E2D6] pt-4":"",children:t.jsx("div",{className:"bw-handout-rich bct-rich-text",dangerouslySetInnerHTML:{__html:d}})}),T&&t.jsxs("div",{className:"bw-handout-questions mt-7 border-t-2 border-[#DDD8CC] pt-5",children:[t.jsx("h2",{className:"bw-handout-h2 font-semibold text-[#3D5A2D]",style:{fontFamily:'"Noto Serif SC","Songti SC",serif'},children:h("å°ç»è®¨è®ºé¢")}),$&&t.jsxs("div",{id:"wiki-handout-q-loading",className:"mt-3 flex items-center gap-2 text-[14px] text-[#64748B]",children:[t.jsx(Ce,{className:"h-4 w-4 animate-spin"}),h("æ£å¨é¢å¤è®¨è®ºé¢â¦ï¼æ¬ç« 馿¬¡çæçº¦éååéï¼")]}),!$&&M&&t.jsxs("div",{className:"mt-3 flex items-center gap-2.5 text-[14px] text-[#64748B]",children:[t.jsx("span",{children:h("è®¨è®ºé¢ææ¶æ²¡è½é¢å¤å¥½ã")}),t.jsxs("button",{type:"button",onClick:J,className:"inline-flex items-center gap-1 rounded-full border border-[#DED6C8] bg-[#FFFCF5] px-2.5 py-1 text-[13px] font-semibold text-[#4F7942] hover:bg-[#F1F7EA]",children:[t.jsx(Fe,{className:"h-3.5 w-3.5"}),h("éè¯")]})]}),!$&&!M&&Q.length>0&&t.jsx("ol",{className:"mt-3 space-y-3.5",children:Q.map((e,n)=>t.jsx("li",{className:"bw-handout-q",children:t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsxs("span",{className:"bw-handout-qnum shrink-0 font-bold text-[#4F7942]",style:{fontFamily:'"Noto Serif SC","Songti SC",serif'},children:[n+1,"."]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"bw-handout-qlabel me-1.5 inline-block rounded bg-[#EFE9DC] px-1.5 py-0.5 align-[2px] text-[#64748B]",children:X[e.section]}),t.jsx("span",{className:"bw-handout-qtext text-[#3A352B]",children:e.q}),e.hint&&t.jsxs("p",{className:"bw-handout-qhint mt-1 text-[#64748B]",children:[h("å¸¦é¢æç¤º"),"ï¼",e.hint]})]})]})},n))})]}),I&&t.jsxs("div",{className:"bw-handout-prayer-block mt-7 border-t-2 border-[#DDD8CC] pt-5",children:[t.jsx("h2",{className:"bw-handout-h2 font-semibold text-[#3D5A2D]",style:{fontFamily:'"Noto Serif SC","Songti SC",serif'},children:h("åºç¨ç¥·å")}),$&&!T&&t.jsxs("div",{className:"mt-3 flex items-center gap-2 text-[14px] text-[#64748B]",children:[t.jsx(Ce,{className:"h-4 w-4 animate-spin"}),h("æ£å¨é¢å¤è®¨è®ºé¢â¦ï¼æ¬ç« 馿¬¡çæçº¦éååéï¼")]}),!$&&M&&!T&&t.jsxs("div",{className:"mt-3 flex items-center gap-2.5 text-[14px] text-[#64748B]",children:[t.jsx("span",{children:h("ç¥·åæææ¶æ²¡è½é¢å¤å¥½ã")}),t.jsxs("button",{type:"button",onClick:J,className:"inline-flex items-center gap-1 rounded-full border border-[#DED6C8] bg-[#FFFCF5] px-2.5 py-1 text-[13px] font-semibold text-[#4F7942] hover:bg-[#F1F7EA]",children:[t.jsx(Fe,{className:"h-3.5 w-3.5"}),h("éè¯")]})]}),!$&&!M&&_&&t.jsx("div",{className:"bw-handout-prayer mt-3 rounded-[6px] px-4 py-3.5 text-[#3A352B]",style:{borderInlineStart:"3px solid #9CB58A",background:"rgba(156, 181, 138, 0.10)"},children:be(_,u())}),t.jsx("div",{className:"bw-handout-prayer-notes mt-3","aria-hidden":"true"})]}),t.jsx("div",{className:"mt-8 border-t border-[#E6E2D6] pt-3 text-center text-[13px] text-[#64748B]",children:h("å£ç»Â·ç¾å®ä¹¦ · baibaoshu.net")})]})}),t.jsx(f,{className:"wiki-handout-noprint mx-auto mb-2 max-w-[760px] md:hidden",onOpenFeedback:()=>{c(),g()},showSeparatorsOnMobile:!0})]})]}),G&&t.jsx("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/55 p-4",onClick:()=>U(null),children:t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":h("ä¿åé¿å¾"),className:"max-h-[88vh] w-full max-w-[460px] overflow-hidden rounded-2xl bg-[#F4F2EC] shadow-2xl",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-[#DDD8CC] px-4 py-3",children:[t.jsx("span",{className:"text-[15px] font-semibold text-[#2D2A22]",children:h("ä¿åé¿å¾")}),t.jsx("button",{type:"button",onClick:()=>U(null),className:"inline-flex h-9 w-9 items-center justify-center rounded-full text-[#6B6557] hover:bg-[#E9E4D8]","aria-label":h("å
³é"),children:t.jsx(Te,{className:"h-5 w-5"})})]}),t.jsx("div",{className:"max-h-[calc(88vh-112px)] overflow-auto bg-[#EDE8DC] p-3",children:t.jsx("img",{src:G.src,alt:h("æ¥ç»è®²ä¹"),className:"mx-auto block w-full max-w-[360px] rounded-lg bg-white shadow"})}),t.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-[#DDD8CC] px-4 py-3",children:[t.jsx("p",{className:"min-w-0 text-[13px] leading-relaxed text-[#6B6557]",children:h("ææºç«¯ï¼é¿æå¾ç â
1 ä¿åå¾çï¼çµè端ï¼ç¹å»ä¸è½½")}),t.jsx("a",{href:G.src,download:G.filename,className:"shrink-0 rounded-full bg-[#4F7942] px-3.5 py-2 text-[13px] font-semibold text-white",children:h("ä¿åå¾ç")})]})]})})]})},en=/^\s*\d+[\.ãï¼\s]/,tn=/^\s*[ï¼(][ä¸äºä¸åäºå
ä¸å
«ä¹å]+[)ï¼]/;function nn(e){if(!e||"undefined"==typeof DOMParser)return e;const t=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html"),n=t.body,a=Array.from(n.querySelectorAll("h2"));if(0===a.length)return e;a.forEach((e,t)=>{e.id=`wiki-section-${t}`});const r=a[0],o=Array.from(n.querySelectorAll("strong, b")).filter(e=>{var t,n;if(n=e,!(r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING))return!1;const a=e.parentElement;if(!a)return!1;const o=(null==(t=a.textContent)?void 0:t.trim())||"";return en.test(o)||tn.test(o)}),s=Math.min(o.length,a.length);for(let i=0;i<s;i++){const e=o[i],n=t.createElement("a");for(n.className="wiki-section-link",n.setAttribute("href",`#wiki-section-${i}`);e.firstChild;)n.appendChild(e.firstChild);e.appendChild(n)}return n.innerHTML}const an=/^[\sã\[]*æ¬ç« é¥è[\sã\]]*$/;const rn={"æ§çº¦èæ¯":"ctx","æ§çº¦åæ":"ctx","为ä½å¼ç¨":"why","æ°çº¦å¼ç¨":"why","åºéª":"fulfil","仿¥åºç¨":"apply"},on=/<li>\s*(æ§çº¦èæ¯|æ§çº¦åæ|为ä½å¼ç¨|æ°çº¦å¼ç¨|åºéª|仿¥åºç¨)ï¼/g,sn=/<ul([^>]*)>(\s*<li class="bw-ot-step)/g,ln=new RegExp("<h3([^>]*)>(\\d[^<ï¼ï¼]*?)ï¼(ç´æ¥é¢è¨åºéª|åéåºéª|é¢è¡¨åºéª|主é¢åºéª|ç»¼åæ§æ¦æ¬|综åå¼ç¨Â·åæ ¹å
³è|ç´æ¥å¼ç¨|æå¼å
¸æ
)(·[^ï¼ï¼]*?)? · ([^ï¼ï¼]*?)ï¼</h3>","g"),dn=(e,t)=>{const n=e.match(/\sclass="([^"]*)"/);return n?e.replace(n[0],` class="${n[1]} ${t}"`):`${e} class="${t}"`};const cn=/^(\s*)(\d{1,3}\s*ç« )(?=\s*[ï¼:])/,hn=/^(\s*)([â â¡â¢â£â¤â¥â¦â§â¨â©]\s*\d{1,3}(?::\d{1,3}(?:\s*[ââ-]\s*\d{1,3})?)?\s*[·ã».]\s*[^ï¼:,ï¼]+?)(?=\s*[ï¼:,ï¼])/,un=/^\d{1,3}\s*ç« (?:\s*[ï¼:]|$)/,mn=/^[â â¡â¢â£â¤â¥â¦â§â¨â©]\s*\d{1,3}(?::\d{1,3}(?:\s*[ââ-]\s*\d{1,3})?)?\s*[·ã».]/,pn=e=>{const t=e.textContent||"",n=(e=>{for(const t of Array.from(e.childNodes))if(3!==t.nodeType||(t.textContent||"").trim())return t;return null})(e);if(!n)return null;if(1===n.nodeType&&"STRONG"===n.tagName){const e=(n.textContent||"").trim();return un.test(e)?{kind:"chapter",bold:!0,start:0,end:0}:mn.test(e)?{kind:"section",bold:!0,start:0,end:0}:null}const a=t.match(cn);if(a){const e=a[1].length;return{kind:"chapter",bold:!1,start:e,end:e+a[2].length}}const r=t.match(hn);if(r){const e=r[1].length;return{kind:"section",bold:!1,start:e,end:e+r[2].length}}return null},xn=(e,t)=>{const n=[],a=e=>{3!==e.nodeType?e.childNodes.forEach(a):n.push(e)};a(e);let r=0;for(const o of n){const e=o.data.length;if(t<=r+e)return{node:o,offset:t-r};r+=e}return null};function bn(e){if(!e||"undefined"==typeof DOMParser)return e;const t=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html");return t.body.querySelectorAll("ul, ol").forEach(e=>{const n=Array.from(e.children).filter(e=>"LI"===e.tagName).map(e=>({li:e,match:pn(e)})).filter(e=>!!e.match);["chapter","section"].forEach(e=>{const a=n.filter(t=>t.match.kind===e);a.some(e=>e.match.bold)&&a.some(e=>!e.match.bold)&&a.forEach(e=>{e.match.bold||((e,t,n)=>{const a=xn(t,n.start),r=xn(t,n.end);if(!a||!r)return;const o=e.createRange();o.setStart(a.node,a.offset),o.setEnd(r.node,r.offset);const s=e.createElement("strong");s.appendChild(o.extractContents()),o.insertNode(s)})(t,e.li,e.match)})})}),t.body.innerHTML}const fn=["ææ©","å£çµ","祷å","ç约","夿´»","ç§°ä¹","ææ¯","åºè®¸"];function gn(e,t){const n=fe(t).replace(/ã/g," ").split(/\s+/).filter(Boolean);if(!n.length)return 0;const a=e.toLowerCase();let r=0;for(const o of n)for(const e of new Set([o,ge(o)])){const t=e.toLowerCase();if(!t)continue;let n=0;for(;;){const e=a.indexOf(t,n);if(e<0)break;r++,n=e+t.length}}return r}const wn=({open:n,onClose:a,chapterLabel:r,tierPlainTexts:o,onHighlightInChapter:i,onWholeBibleSearch:l})=>{const d=s(),[c,h]=e.useState(""),[u,m]=e.useState([]),p=e.useRef(null),x=c.trim();e.useEffect(()=>{if(!n)return;h(""),m(K());const e=setTimeout(()=>{var e;return null==(e=p.current)?void 0:e.focus()},360);return()=>clearTimeout(e)},[n]);const b=e.useMemo(()=>x?function(e,t){for(const n of e){const e=gn(n,t);if(e>0)return e}return 0}(o,x):0,[o,x]),f=()=>
1{x&&(m(X(x)),a(),i(x))};return t.jsxs(y,{open:n,onClose:a,title:d("æç´¢"),meta:r,children:[t.jsxs("div",{className:"relative mb-3",children:[t.jsx(Ie,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#64748B] pointer-events-none"}),t.jsx("input",{ref:p,type:"search",value:c,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&f()},placeholder:d("卿¬ç« 䏿¥æ¾â¦"),className:"w-full pl-9 pr-9 py-2.5 rounded-xl bg-white border border-stone-200 text-[15px] text-slate-800 placeholder:text-slate-400 focus:outline-none focus:border-[#7A9C5E] focus:ring-2 focus:ring-[#7A9C5E]/25 transition-colors",enterKeyHint:"search"}),c&&t.jsx("button",{type:"button",onClick:()=>{var e;h(""),null==(e=p.current)||e.focus()},className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-1 rounded-full text-slate-500 hover:text-slate-700 hover:bg-slate-100 transition-colors","aria-label":d("æ¸
é¤"),children:t.jsx(Te,{className:"w-4 h-4"})})]}),x?t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:f,disabled:0===b,className:"w-full flex items-center gap-3 mb-2.5 px-3.5 py-3 rounded-xl border text-left transition-colors "+(b>0?"bg-[#EEF7D8] border-[#9CB58A] hover:bg-[#E4F1C8]":"bg-[#F5F1E8] border-stone-200 cursor-default"),children:[t.jsx(Ie,{className:"w-5 h-5 flex-shrink-0 "+(b>0?"text-[#4F7942]":"text-slate-500"),strokeWidth:1.6}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-[15px] font-semibold "+(b>0?"text-[#3D5A2D]":"text-slate-500"),children:b>0?t.jsxs(t.Fragment,{children:[d("æ¬ç« æ¾å°")," ",b," ",d("å¤")]}):t.jsxs(t.Fragment,{children:[d("æ¬ç« æªæ¾å°"),"ã",x,"ã"]})}),t.jsx("div",{className:"text-[13px] text-slate-500",children:d(b>0?"卿¬ç« å
é«äº®å®ä½":"è¯è¯æ©å±å°æ´æ¬å£ç»")})]}),b>0&&t.jsx(Ze,{className:"w-4 h-4 text-[#4F7942] flex-shrink-0"})]}),t.jsxs("button",{type:"button",onClick:()=>{x&&X(x),a(),l(x)},className:"w-full flex items-center gap-3 px-3.5 py-3 rounded-xl border border-[#E6E2D6] bg-[#FFFCF5] hover:border-[#7A9C5E]/70 text-left transition-colors",children:[t.jsx(Ie,{className:"w-5 h-5 text-slate-500 flex-shrink-0",strokeWidth:1.6}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"text-[15px] font-medium text-slate-800",children:[d("卿´æ¬å£ç»ä¸æç´¢"),"ã",x,"ã"]}),t.jsx("div",{className:"text-[13px] text-slate-500",children:d("è§£ç»å
¨æ / åªçç»æ · æ§çº¦ / æ°çº¦")})]}),t.jsx(Ze,{className:"w-4 h-4 text-slate-500 flex-shrink-0"})]})]}):t.jsxs("div",{className:"space-y-4",children:[u.length>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[t.jsx(Se,{className:"w-3.5 h-3.5 text-slate-500"}),t.jsx("span",{className:"text-[13px] text-slate-500",children:d("æè¿æç´¢")}),t.jsx("button",{type:"button",onClick:()=>{Y(),m([])},className:"ml-auto text-[13px] text-slate-500 hover:text-slate-600 transition-colors",children:d("æ¸
é¤")})]}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:u.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 pl-2.5 pr-1.5 py-1 rounded-full bg-white border border-stone-200 text-[13px] text-slate-600 hover:border-[#7A9C5E]/70 transition-colors",children:[t.jsx("button",{type:"button",onClick:()=>{var t;h(e),null==(t=p.current)||t.focus()},className:"max-w-[10rem] truncate",children:e}),t.jsx("button",{type:"button",onClick:()=>{m(Q(e))},"aria-label":d("å é¤"),className:"p-0.5 rounded-full text-slate-500 hover:text-slate-600 hover:bg-slate-100 transition-colors",children:t.jsx(Te,{className:"w-3 h-3"})})]},e))})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[t.jsx(Ie,{className:"w-3.5 h-3.5 text-slate-500"}),t.jsx("span",{className:"text-[13px] text-slate-500",children:d("è¯è¯æç´¢")})]}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:fn.map(e=>t.jsx("button",{type:"button",onClick:()=>{var t;h(e),null==(t=p.current)||t.focus()},className:"px-2.5 py-1 rounded-full bg-white border border-stone-200 text-[13px] text-slate-600 hover:border-[#7A9C5E]/70 transition-colors",children:e},e))})]})]})]})};function kn(e,t,n){return!e||n<1||e.book!==t||e.chapter!==n||!Number.isInteger(e.verse)||e.verse<1?null:e}yt.MORPHGNT.name,yt.MORPHGNT.attribution,yt.MORPHGNT.license;const vn={"N-":"åè¯","V-":"å¨è¯","A-":"形容è¯",RA:"å è¯",RP:"人称代è¯",RR:"å
³ç³»ä»£è¯",RD:"æç¤ºä»£è¯",RI:"çé®/ä¸å®ä»£è¯","C-":"è¿è¯","D-":"å¯è¯","P-":"ä»è¯","I-":"æå¹è¯","X-":"å°åè¯"},yn={1:"第ä¸äººç§°",2:"第äºäººç§°",3:"第ä¸äººç§°"},jn={P:"ç°å¨æ¶",I:"æªå®ææ¶",F:"å°æ¥æ¶",A:"ä¸å®è¿å»æ¶",X:"宿æ¶",Y:"è¿å»å®ææ¶"},Zn={A:"主å¨",M:"ä¸å¨",P:"被å¨"},Nn={I:"ç´è¯´è¯æ°",D:"å½ä»¤è¯æ°",S:"èæè¯æ°",O:"ç¥æ¿è¯æ°",N:"ä¸å®å¼",P:"åè¯"},Cn={N:"ä¸»æ ¼",G:"屿 ¼",D:"䏿 ¼",A:"å®¾æ ¼",V:"弿 ¼"}
1,En={S:"åæ°",P:"夿°"},Tn={M:"鳿§",F:"é´æ§",N:"䏿§"},Fn={C:"æ¯è¾çº§",S:"æé«çº§"};const In={"α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"Ä","θ":"th","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"x","ο":"o","Ï":"p","Ï":"r","Ï":"s","Ï":"s","Ï":"t","Ï
":"y","Ï":"ph","Ï":"ch","Ï":"ps","Ï":"Å"};function Sn(e){const t=Array.from(e.normalize("NFD").toLowerCase());let n="";for(let a=0;a<t.length;a+=1){const e=t[a],r=In[e];if(!r)continue;const o=[];for(;a+1<t.length&&new RegExp("\\p{M}","u").test(t[a+1]);)o.push(t[++a]);const s=o.includes("Ì");let i=r+(o.includes("Í
")?"i":"");s&&(i="Ï"===e?"rh":`h${i}`),n+=i}return n}function An(e){return e.normalize("NFD").replace(/[Ì-ͯ᾽-῾]/g,"").normalize("NFC").toLowerCase().replace(/[^Ͱ-Ï¿á¼-á¿¿]/g,"")}const Dn={n:"åè¯",v:"å¨è¯",a:"形容è¯",ai:"çé®å½¢å®¹è¯",r:"代è¯",rp:"人称代è¯",rd:"æç¤ºä»£è¯",ri:"çé®ä»£è¯",rr:"å
³ç³»ä»£è¯",ru:"ä¸å®ä»£è¯",rf:"å身代è¯",ra:"å è¯",c:"è¿è¯",x:"è¿è¯/å©è¯è¯",i:"æå¹è¯",p:"ä»è¯",d:"å¯è¯",dr:"å
³ç³»å¯è¯",drp:"å¯è¯å 人称代è¯",crp:"è¿è¯å 人称代è¯",rre:"ç¸äºä»£è¯",t:"è´¨è¯"},_n={n:"ä¸»æ ¼",g:"屿 ¼",d:"䏿 ¼",a:"å®¾æ ¼",v:"弿 ¼"},Bn={s:"åæ°",p:"夿°",d:"åæ°"},$n={m:"鳿§",f:"é´æ§",n:"䏿§"},Ln={1:"第ä¸äººç§°",2:"第äºäººç§°",3:"第ä¸äººç§°"},Mn={c:"æ¯è¾çº§",s:"æé«çº§"},qn={p:"ç°å¨æ¶",i:"æªå®ææ¶",f:"å°æ¥æ¶",a:"ç®åè¿å»æ¶",b:"第äºç®åè¿å»æ¶",e:"è¿å»æ¶",x:"宿æ¶",c:"第äºå®ææ¶",d:"宿æ¶",y:"è¿å»å®ææ¶"},zn={a:"主å¨",m:"ä¸å¨",p:"被å¨",n:"ä¸å¨å½¢ä¸»å¨æ",o:"被å¨å½¢ä¸»å¨æ"},Pn={i:"ç´è¯´è¯æ°",d:"å½ä»¤è¯æ°",s:"èæè¯æ°",o:"ç¥æ¿è¯æ°",n:"ä¸å®å¼",p:"åè¯"},On=new Set(["n","a","ai","r","rp","rd","ri","rr","ru","rf","ra","rre"]);function Rn(e){return e.normalize("NFD").replace(new RegExp("\\p{M}
1","gu"),"").replace(/[^\u05d0-\u05ea]/g,"")}function Hn(e,t){const n=String(t||"").trim().match(/^[GH]?0*(\d{1,5})$/i);if(!n)return null;const a=Number(n[1]);return!Number.isInteger(a)||a<1?null:"hbo"===e&&a>8674?{short:`FHL ${a}`,label:"FHL è¯å½¢ç¼å·",kind:"fhl-form"}:{short:`${"hbo"===e?"H":"G"}${a}`,label:"Strong ç¼å·",kind:"strong"}}const Wn="var(--readable-card, #FFFCF5)",Gn="var(--readable-paper, #FAF9F6)",Un="#F5F1E8",Jn="var(--readable-line, #E6E2D6)",Vn="#4F7942",Kn="var(--readable-green-wash, #E1ECD5)",Yn='"Noto Serif SC", "Source Han Serif SC", "Songti SC", serif',Qn="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#4F7942]/40 focus-visible:ring-offset-2";function Xn(e,n="data"){const a="ai"===n?{color:"var(--readable-gold, #7A4F11)",background:"#FBE7B6"}:{color:"var(--readable-sage, #3D5A2D)",background:Kn};return t.jsx("span",{className:"inline-flex min-h-7 items-center rounded-full px-2.5 text-[13px] font-medium",style:a,children:e})}function ea(e,n){const a={fact:{color:"var(--readable-sage, #3D5A2D)",background:Kn},grammar:{color:"#2C5E73",background:"#E2F0F3"},interpretation:{color:"var(--readable-gold, #70470F)",background:"#FFF0C8"},pastoral:{color:"#6B5135",background:"#EFE5D4"}};return t.jsx("span",{className:"inline-flex min-h-7 items-center rounded-full px-2.5 text-[13px] font-semibold",style:a[n],children:e})}const ta={high:"æ¨è®ºææ¡è¾é«",medium:"æ¨è®ºéæ´å¤ä¸ä¸æ",low:"è¾è°¨æ
çæ¨è®º"};function na(e,t){var n,a;const r=t.corpus.startsWith("FHL_");return{parseLabel:"grc"===e?r?function(e,t){const n=(e||"").trim().toLowerCase(),a=(t||"").trim().toLowerCase(),r=[Dn[n]].filter(Boolean);return"v"===n?(r.push(qn[a[0]],zn[a[1]],Pn[a[2]]),"p"===a[2]&&a.length>=6?r.push(_n[a[3]],Bn[a[4]],$n[a[5]]):r.push(Ln[a[3]],Bn[a[4]])):On.has(n)&&(r.push(_n[a[0]],Bn[a[1]],$n[a[2]]),"a"===n||"ai"===n?r.push(Mn[a[3]]):r.push(Ln[a[3]])),r.filter(Boolean).join("·")}(t.pos,t.parse):function(e,t){const n=vn[(e||"").trim()]||"",a=(t||"").padEnd(8,"-");return[n,...[yn[a[0]],jn[a[1]],Zn[a[2]],Nn[a[3]],Cn[a[4]],En[a[5]],Tn[a[6]],Fn[a[7]]].filter(Boolean)].filter(Boolean).join("·")||n||""}(t.pos,t.parse):t.morphologyZh||"",beginnerNote:"grc"===e?r?function(e,t){const n=(e||"").trim().toLowerCase(),a=(t||"").trim().toLowerCase(),r=[];if("ra"===n&&r.push("å è¯å¸®å©è®¤åºå®æéå®çåè¯ï¼ä¸æå¸¸ä¸ä¼éåè¯åºæ¥"),"p"===n&&r.push("ä»è¯è¡¨è¾¾è¯ä¸è¯ä¹é´çå
³ç³»ï¼è¦è¿ååé¢çæ ¼ä½ä¸èµ·çè§£"),"c"!==n&&"x"!==n||r.push("è¿ä¸ªè¿æ¥è¯æååæææ¥èµ·æ¥ï¼è¦çæå¹¶åã转ææå æå
³ç³»"),"v"===n){const e={p:"ç°å¨æ¶éå¸¸ä»æç»æè¿è¡çè§åº¦è§å¯å¨ä½",i:"æªå®ææ¶é常æåè¿å»æ£å¨è¿è¡æåå¤åççå¨ä½",f:"å°æ¥æ¶æå¨ä½æ¾å¨å°æ¥æé¢æä¸",a:"ç®åè¿å»æ¶é常æå¨ä½ä½ä¸ºä¸ä¸ªæ´ä½æ¥è§å¯ï¼ä¸çäºå¨ä½åªåç䏿¬¡",b:"第äºç®åè¿å»æ¶é常æå¨ä½ä½ä¸ºä¸ä¸ªæ´ä½æ¥è§å¯ï¼ä¸çäºå¨ä½åªåç䏿¬¡",x:"宿æ¶å¼ºè°å¨ä½å·²ç»åçï¼å¹¶å
³æ³¨ä»ç¶åå¨çç»æ",c:"宿æ¶å¼ºè°å¨ä½å·²ç»åçï¼å¹¶å
³æ³¨ä»ç¶åå¨çç»æ",d:"宿æ¶å¼ºè°å¨ä½å·²ç»åçï¼å¹¶å
³æ³¨ä»ç¶åå¨çç»æ",y:"è¿å»å®ææ¶å
³æ³¨è¿å»æä¸ç¹ä»¥åå·²ç»å½¢æçç»æ"},t={m:"ä¸å¨è¡¨ç¤ºå¨ä½ä¸ä¸»è¯èªèº«æå¯åå
³ç³»",p:"被å¨è¡¨ç¤ºä¸»è¯æ¿åè¿ä¸ªå¨ä½",n:"è¿ä¸ªè¯éç¨ä¸å¨è¯å½¢ï¼ä½æä¹æä¸»å¨çè§£",o:"è¿ä¸ªè¯éç¨è¢«å¨è¯å½¢ï¼ä½æä¹æä¸»å¨çè§£"},n={d:"å½ä»¤è¯æ°å¸¦åºå½ä»¤ãè¯·æ±æåå",s:"èæè¯æ°å¸¸è¡¨è¾¾ç®çãå¯è½ææå¾
ï¼å
·ä½ææè¦çä¸ä¸æ",n:"ä¸å®å¼æå¨ä½å½ä½ä¸ä¸ªæ´ä½æ¦å¿µæ¥ä½¿ç¨",p:"åè¯ç¨æ¥è¡¥å
å¨ä½ææè¿°ï¼å主å¥çå
³ç³»è¦çä¸ä¸æ"};e[a[0]]&&r.push(e[a[0]]),t[a[1]]&&r.push(t[a[1]]),n[a[2]]&&r.push(n[a[2]])}else if(On.has(n)){const e={n:"ä¸»æ ¼é常æ åºä¸»è¯æè¡¨è¯",g:"屿 ¼é常表达æå±ãæ¥æºæå
³ç³»",d:"䏿 ¼é常表达对象ãå·¥å
·ææå¨",a:"å®¾æ ¼é常æ åºå¨ä½ç对象ï¼ä¹å¯è½è¡¨è¾¾æ¹åæèå´",v:"弿 ¼ç¨äºç´æ¥ç§°å¼æäºº"};e[a[0]]&&r.push(e[a[0]])}return r.slice(0,3).join("ï¼")}(t.pos,t.parse):function(e,t){const n=(e||"").trim(),a=(t||"").padEnd(8,"-"),r=[];if("RA"===n&&r.push("å è¯å¸®å©è®¤åºå®æéå®çåè¯ï¼ä¸æå¸¸ä¸ä¼éåè¯åºæ¥"),"P-"===n&&r.push("ä»è¯è¡¨è¾¾è¯ä¸è¯ä¹é´çå
³ç³»ï¼è¦è¿ååé¢çæ ¼ä½ä¸èµ·çè§£"),"C-"===n&&r.push("è¿è¯æååæææ¥èµ·æ¥ï¼çæå®æ¯å¨å¹¶åã转æè¿æ¯è¯´æåå "),"V-"===n){const e={P:"ç°å¨æ¶éå¸¸ä»æç»æè¿è¡çè§åº¦è§å¯å¨ä½",I:"æªå®ææ¶é常æåè¿å»æ£å¨è¿è¡æåå¤åççå¨ä½",F:"å°æ¥æ¶æå¨ä½æ¾å¨å°æ¥æé¢æä¸",A:"ä¸å®è¿å»æ¶é常æå¨ä½ä½ä¸ºä¸ä¸ªæ´ä½æ¥è§å¯ï¼ä¸çäºå¨ä½åªåç䏿¬¡",X:"宿æ¶å¼ºè°å¨ä½å·²ç»åçï¼å¹¶å
³æ³¨ä»ç¶åå¨çç»æ",Y:"è¿å»å®ææ¶å
³æ³¨è¿å»æä¸ç¹ä»¥åå·²ç»å½¢æçç»æ"},t={M:"ä¸å¨è¡¨ç¤ºå¨ä½ä¸ä¸»è¯èªèº«æå¯åå
³ç³»",P:"被å¨è¡¨ç¤ºä¸»è¯æ¿åè¿ä¸ªå¨ä½"},n={D:"å½ä»¤è¯æ°å¸¦åºå½ä»¤ãè¯·æ±æåå",S:"èæè¯æ°å¸¸è¡¨è¾¾ç®çãå¯è½ææå¾
ï¼å
·ä½ææè¦çä¸ä¸æ",N:"ä¸å®å¼æå¨ä½å½ä½ä¸ä¸ªæ´ä½æ¦å¿µæ¥ä½¿ç¨",P:"åè¯ç¨æ¥è¡¥å
å¨ä
1½ææè¿°ï¼å主å¥çå
³ç³»è¦çä¸ä¸æ"};e[a[1]]&&r.push(e[a[1]]),t[a[2]]&&r.push(t[a[2]]),n[a[3]]&&r.push(n[a[3]])}else{const e={N:"ä¸»æ ¼é常æ åºä¸»è¯æè¡¨è¯",G:"屿 ¼é常表达æå±ãæ¥æºæå
³ç³»",D:"䏿 ¼é常表达对象ãå·¥å
·ææå¨",A:"å®¾æ ¼é常æ åºå¨ä½ç对象ï¼ä¹å¯è½è¡¨è¾¾æ¹åæèå´",V:"弿 ¼ç¨äºç´æ¥ç§°å¼æäºº"};e[a[4]]&&r.push(e[a[4]])}return r.slice(0,3).join("ï¼")}(t.pos,t.parse):"",compactMorphology:(null==(a=null==(n=t.morphologyZh)?void 0:n.split(/[ï¼ï¼ã]/)[0])?void 0:a.trim())||"",surfaceTranslit:"grc"===e?Sn(t.surface):"",lemmaTranslit:t.transliteration||("grc"===e?Sn(t.lemma):""),numberLabel:Hn(e,t.strongNo)}}const aa=({bookKey:n,bookZh:a,bookEn:r,chapter:o,verse:s,lang:i,onClose:l})=>{var d,c,h,u,m;const[b,f]=e.useState(null),[g,w]=e.useState(""),[k,v]=e.useState(""),[y,Z]=e.useState(""),[N,C]=e.useState(null),[E,T]=e.useState(!1),[F,I]=e.useState({}),[S,A]=e.useState(null),[D,_]=e.useState(null),[B,$]=e.useState(null),[L,M]=e.useState(null),[q,z]=e.useState(!1),[P,O]=e.useState(null),R=e.useId(),H=e.useRef(null),W=e.useRef(null),G=e.useRef(null),U=e.useRef(null),J=e.useRef(null),V=e.useRef(0),K=x(),Y=null==K?void 0:K.setOverlayOpen,Q="hbo"===i,X=function(e,t,n,a){if("grc"===e)return"greek";if("jeremiah"===t&&10===n&&11===a)return"aramaic";if("ezra"===t){if(4===n&&a>=8)return"aramaic";if(5===n)return"aramaic";if(6===n&&a<=18)return"aramaic";if(7===n&&a>=12&&a<=26)return"aramaic"}if("daniel"===t){if(2===n&&4===a)return"hebrew-aramaic";if(2===n&&a>=5)return"aramaic";if(n>=3&&n<=6)return"aramaic";if(7===n&&a<=28)return"aramaic"}return"hebrew"}(i,n,o,s),ee="greek"===(te=X)?"å¸è
æ":"aramaic"===te?"äºå
°æ":"hebrew-aramaic"===te?"å¸ä¼¯æ¥æä¸äºå
°ææ··å":"å¸ä¼¯æ¥æ";var te;const ne=function(e){return"greek"===e||"hebrew"===e}(X),ae="grc"===i?"el-GR":"he-IL",re="grc"===i?"TISCH":"WLC",oe="grc"===i?"Tischendorf 8thï¼å
¬æé¢åï¼":"Westminster Leningrad Codexï¼å
¬æé¢åï¼",se="grc"===i?"ç°ä»£å¸è
è¯ WaveNet è¯é³":"ç°ä»£ä»¥è²åå¸ä¼¯æ¥è¯ WaveNet è¯é³",ie="grc"===i?`éç¨ Google ${se}ï¼è¿æ¯ç°ä»£å¸è
è¯è¯»æ³ï¼ä¸æ°çº¦æ¶ä»£ç读é³ä¸åï¼åªç¨æ¥å¸®å©è®¤åºãè®°ä½åæã`:`éç¨ Google ${se}ï¼è¿æ¯ç°ä»£ä»¥è²åå¸ä¼¯æ¥è¯è¯»æ³ï¼ä¸æ§çº¦æ¶ä»£ç读é³ä¸åï¼åªç¨æ¥å¸®å©è®¤åºãè®°ä½åæã`,le="hebrew-aramaic"===X?"æ¬è横跨å¸ä¼¯æ¥æä¸äºå
°æï¼æä¸æä¾æ´èæéè¯è¯»é³ï¼ä»¥å
ç¨ç°ä»£å¸ä¼¯æ¥è¯åå
äºå
°æã":"æ¬æ®µæ¯äºå
°æï¼æä¸æä¾è¯»é³ï¼ä»¥å
ç¨ç°ä»£å¸ä¼¯æ¥è¯åå
äºå
°æã",de=e.useCallback(()=>{var e;V.current+=1,null==(e=U.current)||e.pause(),U.current=null,J.current&&URL.revokeObjectURL(J.current),J.current=null,"undefined"!=typeof window&&window.speechSynthesis&&window.speechSynthesis.cancel(),_(null)},[]);e.useEffect(()=>{let e=!0;return de(),f(null),w(""),v(""),Z(""),async function(e,t,n,a){const r=await p.rpc("get_original_words_for_verse",{p_lang:e,p_book_key:t,p_chapter:n,p_verse:a});let o=r.data||[],s=!r.error;if(r.error){console.error("[originalWords] éè RPC æä¸å¯ç¨ï¼å°è¯è¿ç§»æåªè¯»é级",r.error);const i=await p.from("bible_original_words").select("corpus, position, surface, lemma, pos, parse, strong_no, gloss_zh, morphology_zh, remark_zh, source_revision").eq("lang",e).eq("book_key",t).eq("chapter",n).eq("verse",a).order("position",{ascending:!0});if(i.error)return console.error("[originalWords] 读åéè¯å¤±è´¥",i.error),[];o=i.data||[],s=!1}const i=o.map(e=>({corpus:e.corpus,position:e.position,surface:e.surface,lemma:e.lemma,pos:e.pos,parse:e.parse,strongNo:e.strong_no||void 0,sourceGloss:e.gloss_zh||void 0,morphologyZh:e.morphology_zh||void 0,remarkZh:e.remark_zh||void 0,sourceRevision:e.source_revision||void 0,occurrences:e.occurrences??void 0,sourceName:e.source_name||void 0,sourceLicense:e.source_license||void 0,sourceUrl:e.source_url||void 0,licenseUrl:e.license_url||void 0})),l="hbo"===e?"FHL_WLC":"FHL_WH",d=i.filter(e=>e.corpus===l),c=d.length?d:i;if(!c.length)return[];const h=[...new Set(c.map(e=>e.lemma))],u=[...new Set(c.map(e=>e.corpus))],m=new Map;
1if(s)for(const p of c)"number"==typeof p.occurrences&&m.set(`${p.corpus}|${p.lemma}`,p.occurrences);else{const{data:t,error:n}=await p.from("bible_lemma_stats").select("corpus, lemma, occurrences").eq("lang",e).in("corpus",u).in("lemma",h);n&&console.error("[originalWords] 读åè¯é¢å¤±è´¥",n);for(const e of t||[])m.set(`${e.corpus}|${e.lemma}`,e.occurrences)}const{data:x,error:b}=await p.from("original_vocab").select("lemma, transliteration, gloss_zh, pos_zh, note").eq("lang",e).eq("published",!0).in("lemma",h);b&&console.error("[originalWords] 读åå·²æ ¸è¯æ¡å¤±è´¥",b);const f=new Map((x||[]).map(e=>[e.lemma,e]));return c.map(e=>{const t=f.get(e.lemma);return{...e,occurrences:m.get(`${e.corpus}|${e.lemma}`)??e.occurrences,transliteration:null==t?void 0:t.transliteration,gloss:(null==t?void 0:t.gloss_zh)||e.sourceGloss,posZh:null==t?void 0:t.pos_zh,vocabNote:(null==t?void 0:t.note)??void 0}})}(i,n,o,s).then(t=>{e&&f(t)}).catch(()=>{e&&f([])}),Promise.all([j(r,o,re).catch(()=>[]),j(r,o,"CUV").catch(()=>[]),j(r,o,"WEB").catch(()=>[])]).then(([t,n,a])=>{var r,o,i;e&&(w((null==(r=t.find(e=>e.verse===s))?void 0:r.text)||""),v((null==(o=n.find(e=>e.verse===s))?void 0:o.text)||""),Z((null==(i=a.find(e=>e.verse===s))?void 0:i.text)||""))}),C(null),T(!1),I({}),A(null),_(null),$(null),M(null),O(null),()=>{e=!1}},[i,n,r,o,s,re,de]),e.useEffect(()=>()=>{var e;V.current+=1,null==(e=U.current)||e.pause(),J.current&&URL.revokeObjectURL(J.current),"undefined"!=typeof window&&window.speechSynthesis&&window.speechSynthesis.cancel()},[]),e.useEffect(()=>{G.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const e=document.body.style.overflow;document.body.style.overflow="hidden",null==Y||Y(!0);const t=window.requestAnimationFrame(()=>{var e;return null==(e=W.current)?void 0:e.focus()}),n=e=>{if("Escape"===e.key)return e.preventDefault(),void l();if("Tab"!==e.key||!H.current)return;const t=Array.from(H.current.querySelectorAll('button:not([disabled]), summary, a[href], [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled"));if(!t.length)return;const n=t[0],a=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",n),()=>{var a;window.cancelAnimationFrame(t),document.removeEventListener("keydown",n),document.body.style.overflow=e,null==Y||Y(!1),null==(a=G.current)||a.focus()}},[l,Y]);const ce=e.useMemo(()=>Boolean(g)&&Boolean(null==b?void 0:b.length)&&("grc"===i?!function(e,t){const n=e.split(/\s+/).map(An).filter(Boolean),a=t.map(An).filter(Boolean);return n.length===a.length&&n.every((e,t)=>e===a[t])}(g,(b||[]).map(e=>e.surface)):!function(e,t){const n=Rn(e),a=Rn(t.join(""));return Boolean(n)&&n===a}(g,(b||[]).map(e=>e.surface))),[i,g,b]),he=e.useMemo(()=>(null==b?void 0:b.length)?jt(b[0].corpus):null,[b]),ue=e.useMemo(()=>[...new Set((b||[]).map(e=>e.sourceRevision).filter(Boolean))].join("ã"),[b]),me=e.useMemo(()=>null===N?null:(null==b?void 0:b.find(e=>e.position===N))||null,[N,b]),pe=e.useMemo(()=>me?na(i,me):null,[me,i]),xe=me?`${me.corpus}|${me.lemma}`:"",be=me?F[xe]:void 0,fe=(null==be?void 0:be.filter(e=>e!==s))||[],ge=me?`surface:${me.position}:${me.surface}`:"",we=me?`lemma:${me.position}:${me.lemma}`:"",ke=e.useMemo(()=>{if(!me||!pe)return[];const e=["è¯å
¸å½¢",pe.parseLabel,me.morphologyZh,me.posZh].filter(Boolean).join(" · ");return Tt(i,e)},[me,pe,i]),ve=e.useCallback(async(e,t,n,a)=>{if(!ne)return void A(le);if((null==D?void 0:D.key)===n)return void de();de();const r=V.current+1;V.current=r,A(null),_({key:n,status:"loading"});try{const o=await Ct(e,i,a);if(V.current!==r)return;const s=URL.createObjectURL(new Blob([o],{type:"audio/mpeg"})),l=new Audio(s);U.current=l,J.current=s;const d=()=>{V.current===r&&de()},c=()=>{V.current===r&&(de(),Zt(e,ae,!0)?A(`äºç«¯é³é¢ææ¾å¤±è´¥ï¼å·²æ¹ç¨è¿å°è®¾å¤ç${"grc"===i?"å¸è
è¯":"å¸ä¼¯æ¥è¯"}è¯é³ææ¾${t}ã`):A(`é³é¢ææ¾å¤±è´¥ï¼è¿å°è®¾å¤ä¹æ²¡æå¯ç¨ç${"grc"===i?"å¸è
è¯":"å¸ä¼¯æ¥è¯"}è¯é³ï¼ææ¶æ æ³ææ¾${t}ã`))};l.addEventListener("ended",d,{once:!0}),l.addEventListener("error",c,{once:!0}),await l.play(),V.current===r&&_({key:n,status:"playing"})}catch{if(V.current!==r)return;_(null),Zt(e,ae,!0)?A(`Google è¯é³ææ¶ä¸å¯ç¨ï¼å·²æ¹ç¨è¿å°è®¾å¤ç${"grc"===i?"å¸è
è¯":"å¸ä¼¯æ¥è¯"}è¯é³ææ¾${t}ã`):A(`Google è¯é³ææ¶ä¸å¯ç¨ï¼è¿å°è®¾å¤ä¹æ²¡æå¯ç¨ç${"grc"===i?"å¸è
è¯":"å¸ä¼¯æ¥è¯"}è¯é³ï¼ææ¶æ æ³ææ¾${t}ã`)}},[le,i,ne,ae,null==D?void 0:D.key,de]),ye=e.useCallback(e=>{const t=N!==e.position,a=`surface:${e.position}:${e.surface}`;if($(null),C(t?e.position:null),!t)return void((null==D?void 0:D.key)===a&&de());ne&&ve(e.surface,"æ¬èè¯å½¢",a,"word");const r=`${e.corpus}|${e.lemma}`;void 0===F[r]&&(I(e=>({...e,[r]:null})),async function(e,t,n,a,r){const{data:o,error:s}=await p.rpc("get_original_lemma_verses_in_chapter",{p_lang:e,p_corpus:t,p_lemma:n,p_book_key:a,p_chapter:r});return s?(console.error("[originalWords] è¯»åæ¬ç« åè¯å¤±è´¥",s),[]):[...new Set((o||[]).map(e=>e.verse))]}(i,e.corpus,e.lemma,n,o).then(e=>I(t=>({...t,[r]:e}))).catch(()=>I(e=>({...e,[r]:[]}))))}
1,[N,n,o,F,i,ve,ne,null==D?void 0:D.key,de]),je=e.useCallback(async()=>{const e=Et(i),t=null==e?void 0:e.versions[0];if(e&&t){z(!0),O(null);try{const r=await Nt({lang:i,versionCode:t.code,langName:e.nameZh,versionName:t.nameZh,bookKey:n,chapter:o,verse:s,refZh:`${a} ${o}:${s}`,registerNote:e.registerNote,traps:e.learnerTraps,analysisMode:!0});M(r.lesson)}catch(r){O(r instanceof Error?r.message:"æ·±å
¥è§£éçæå¤±è´¥ï¼è¯·åè¯ä¸æ¬¡")}finally{z(!1)}}},[i,n,a,o,s]);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"fixed inset-0 z-[90]",style:{background:"rgba(20,18,12,0.45)",backdropFilter:"blur(2px)"},onClick:l,"aria-hidden":"true"}),t.jsxs("div",{ref:H,className:"fixed inset-x-0 bottom-0 z-[95] mx-auto flex max-h-[calc(88*var(--vh-unit))] max-w-[620px] flex-col shadow-sm",style:{background:Wn,borderRadius:"18px 18px 0 0"},role:"dialog","aria-modal":"true","aria-labelledby":R,children:[t.jsxs("div",{className:"px-5 pt-3",style:{background:"var(--readable-warm, #F4F2EC)",borderRadius:"18px 18px 0 0"},children:[t.jsx("div",{className:"mx-auto mb-3 h-1 w-9 rounded-full",style:{background:"#DDD8CC"}}),t.jsxs("div",{className:"flex items-center justify-between gap-3 pb-3",children:[t.jsxs("h2",{id:R,className:"text-[21px] text-slate-800",style:{fontFamily:Yn},children:[a," ",o,":",s," · åæ"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{type:"button",onClick:()=>T(e=>!e),className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full ${Qn}`,style:{color:"var(--readable-sage, #3D5A2D)",background:E?Kn:Un},"aria-label":"æ¥çåé³ãè¯å½¢ä¸ç¼å·è¯´æ","aria-expanded":E,"aria-controls":`${R}-reference-help`,children:t.jsx(Ae,{size:19,"aria-hidden":"true"})}),t.jsx("button",{ref:W,type:"button",onClick:l,className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full ${Qn}`,"aria-label":"å
³éåææ½å±",children:t.jsx(Te,{size:20,className:"text-slate-600","aria-hidden":"true"})})]})]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto px-5 pb-8 pt-4",children:[E&&t.jsxs("div",{id:`${R}-reference-help`,className:"mb-4 space-y-2 rounded-2xl border-2 p-4 text-[15px] leading-[1.8] text-slate-700",style:{borderColor:Jn,background:Un},children:[t.jsxs("p",{children:[t.jsx("span",{className:"font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"åé³ï¼"}),ne?ie:le]}),t.jsxs("p",{children:[t.jsx("span",{className:"font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"è¯å½¢ï¼"}),"è¿é¡¹èµæå¸®å©è®¤åºåç¼ãè¯å¹²æè¯å°¾ï¼å®å¨æ¬å¥ä¸çå
·ä½ä½ç¨ï¼ä»è¦ç»åååæå¤æã"]}),t.jsxs("p",{children:[t.jsx("span",{className:"font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"ç¼å·ï¼"}),"Gï¼H æ¯ Strong ç¼å·ï¼FHL æ¯ä¿¡æç±çè¯å½¢æ£ç´¢ç¼å·ï¼ç¼å·å¸®å©æ¥è¯å
¸ï¼ä¸ç´æ¥å³å®æ¬å¥è¯ä¹ã"]}),t.jsxs("p",{children:[t.jsx("span",{className:"font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"åºæ¬ï¼"}),"æ´èç»æä¸éè¯èµæå嫿 ææ¥æºï¼ä¸ååºæ¬å¯è½æåé¢å·®å¼ï¼ä¸è½æºæ¢°å¯¹é½ã"]}),t.jsxs("p",{children:[t.jsx("span",{className:"font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"转åï¼"}),"åæ¯è½¬ååªæ¯æåæåæ¯æ¢åææä¸åæ¯ï¼ä¸çåäºè¯»é³ã"]})]}),t.jsxs("section",{"aria-label":"ç»æä¸åæ",children:[t.jsxs("div",{className:"space-y-3",children:[(k||y)&&t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:Jn,background:Gn},children:[k&&t.jsxs("div",{children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold text-slate-700",children:"å忬"}),Xn("ä¸è±è¯æ¬")]}),t.jsx("p",{className:"text-[18px] leading-[1.9] text-slate-800",children:k})]}),y&&t.jsxs("div",{className:k?"mt-4 border-t-2 pt-4":"",style:k?{borderColor:Jn}:void 0,children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold text-slate-700",children:"WEB · World English Bible"}),!k&&Xn("ä¸è±è¯æ¬")]}),t.jsx("p",{className:"text-[18px] leading-[1.8] text-slate-700",lang:"en",children:y})]})]}),g&&t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:Jn,background:Wn},children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("span",{className:"text-[15px] font-semibold text-slate-700",children:[ee,"åæ"]}),ne?t.jsxs("button",{type:"button",onClick:()=>{ve(g,"æ´èåæ","whole-verse","verse")},className:`inline-flex min-h-9 items-center gap-1.5 rounded-full px-3 text-[13px] font-semibold ${Qn}`,style:{color:"var(--readable-sage, #3D5A2D)",background:Kn},children:["whole-verse"===(null==D?void 0:D.key)&&"loading"===D.status?t.jsx(Ce,{size:15,className:"animate-spin","aria-hidden":"true"}):t.jsx(De,{size:15,"aria-hidden":"true"}),"whole-verse"===(null==D?void 0:D.key)?"loading"===D.status?"æ£å¨åå¤â¦":"ææ¾ä¸ Â· ç¹æ¤åæ¢":"嬿´èåæ"]}):Xn("æä¸æä¾æè¯»")]}),(!(null==b?void 0:b.length)||ce)&&t.jsx("p",{className:"text-[24px] leading-[1.9] text-slate-800",dir:Q?"rtl":void 0,children:g}),null===b&&t.jsxs("div",{className:"mt-3 flex items-center gap-2 text-[15px] text-slate-600",children:[t.jsx(Ce,{size:17,className:"animate-spin",style:{color:"var(--readable-sage, #4F7942)"},"aria-hidden":"true"}),"æ£å¨åè¿ä¸èçéè¯èµæâ¦"]}),0===(null==b?void 0:b.length)&&t.jsx("p",{className:"mt-3 text-[15px] leading-[1.8] text-slate-600",children:"è¿ä¸èææ¶æ²¡æå¯æ ¸å¯¹çéè¯èµæï¼è¯·å
仿´èåæä¸è¯æ¬å¯¹ç
§é
读ã"}),(null==b?void 0:b.length)?t.jsxs("div",{className:ce?"mt-4 border-t-2 pt-4":"",style:ce?{borderColor:Jn}:void 0,children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold text-slate-700",children:ce?"éè¯æ æ³¨åºæ¬ · ç¹è¯æ¥ç":"ç¹ä¸ä¸ªè¯ï¼æ¥çååä¸ Strong ç¼å·"}),Xn(`${b[0].corpus} · æ¯è¯å¯ç¹`)]}),Q&&t.jsxs("p",{className:"mb-1 text-[13px] leading-relaxed text-slate-500",children:["é
读æç¤ºï¼",ee,"请ä»å³å左读ã"]}),t.jsx("div",{className:"flex flex-wrap items-start gap-x-1 gap-y-2",dir:Q?"rtl":"ltr",lang:"hbo"===i?"he":"el",role:"list","aria-label":`${ee}éè¯åæï¼æ¯ä¸ªè¯é½å¯ç¹å»æ¥çèµæ`,children:b.map(e=>{const n=N===e.position,a=Hn(i,e.strongNo);return t.jsx("span",{role:"listitem",className:"inline",children:t.jsxs("button",{type:"button",onClick:()=>ye(e),className:`inline-flex min-h-[56px] flex-col items-center justify-start rounded-md px-0.5 py-1 transition-colors ${Qn}`,style:{color:n?"var(--readable-sage, #3D5A2D)":"#1E293B",background:"transparent"},"aria-expanded":n,"aria-controls":n?`${R}-selected-word`:void 0,"aria-label":`第 ${e.position} è¯ï¼${e.surface}${a?`ï¼${a.short}`:""}ï¼ææ¾æ¬èè¯å½¢å¹¶æ¥çè¯è¯èµæ`,children:[t.jsx("span",{className:"border-b-2 pb-0.5 text-[24px] leading-tight",style:{borderBottomColor:n?Vn:"transparent"},children:e.surface}),a&&t.jsx("span",{className:"mt-0.5 text-[13px] font-medium tabular-nums text-slate-500",dir:"ltr",children:a.short})]})},`verse-word-${e.corpus}-${e.position}`)}
1)}),me&&pe&&t.jsxs("div",{id:`${R}-selected-word`,className:"mt-3 rounded-2xl border-2 p-4",style:{borderColor:Vn,background:"var(--readable-green-wash, #F3F7EC)"},"aria-live":"polite",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("span",{className:"text-[15px] font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:["第 ",me.position," è¯"]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ea("è¯å
¸äºå®","fact"),pe.numberLabel&&t.jsx("span",{className:"inline-flex min-h-7 items-center rounded-full px-2.5 text-[13px] font-semibold tabular-nums",dir:"ltr",style:{color:"var(--readable-sage, #3D5A2D)",background:Wn},children:pe.numberLabel.short})]})]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[t.jsx("span",{className:"text-[26px] text-slate-800",dir:Q?"rtl":void 0,children:me.surface}),pe.surfaceTranslit&&t.jsxs("span",{className:"text-[15px] text-slate-600",children:["åæ¯è½¬å ",pe.surfaceTranslit]})]}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-baseline gap-x-2 gap-y-1",children:[t.jsx("span",{className:"text-[15px] font-medium text-slate-600",children:"è¯å
¸å½¢"}),t.jsx("span",{className:"text-[23px] text-slate-800",dir:Q?"rtl":void 0,children:me.lemma}),pe.lemmaTranslit&&t.jsxs("span",{className:"text-[15px] text-slate-600",children:["åæ¯è½¬å ",pe.lemmaTranslit]})]}),ne&&t.jsxs("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:[t.jsxs("button",{type:"button",onClick:()=>{ve(me.surface,"æ¬èè¯å½¢",ge,"word")},className:`flex min-h-11 items-center justify-center gap-2 rounded-xl border-2 px-3 text-[15px] font-medium ${Qn}`,style:{borderColor:Jn,color:"var(--readable-sage, #3D5A2D)",background:Wn},children:[(null==D?void 0:D.key)===ge&&"loading"===D.status?t.jsx(Ce,{size:17,className:"animate-spin","aria-hidden":"true"}):t.jsx(De,{size:17,"aria-hidden":"true"}),(null==D?void 0:D.key)===ge?"loading"===D.status?"æ£å¨åå¤â¦":"ææ¾ä¸ Â· ç¹æ¤åæ¢":"é嬿¬èè¯å½¢"]}),t.jsxs("button",{type:"button",onClick:()=>{ve(me.lemma,"è¯å
¸å½¢",we,"word")},className:`flex min-h-11 items-center justify-center gap-2 rounded-xl border-2 px-3 text-[15px] font-medium ${Qn}`,style:{borderColor:Vn,color:"var(--readable-sage, #3D5A2D)",background:Kn},children:[(null==D?void 0:D.key)===we&&"loading"===D.status?t.jsx(Ce,{size:17,className:"animate-spin","aria-hidden":"true"}):t.jsx(De,{size:17,"aria-hidden":"true"}),(null==D?void 0:D.key)===we?"loading"===D.status?"æ£å¨åå¤â¦":"ææ¾ä¸ Â· ç¹æ¤åæ¢":"å¬è¯å
¸å½¢"]})]}),t.jsxs("dl",{className:"mt-2 space-y-1 text-[15px] leading-[1.8] text-slate-700",children:[(me.gloss||me.sourceGloss)&&t.jsxs("div",{className:"flex gap-2",children:[t.jsx("dt",{className:"shrink-0 text-slate-500",children:"ç®ä¹"}),t.jsx("dd",{children:me.gloss||me.sourceGloss})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("dt",{className:"shrink-0 text-slate-500",children:"è¯å½¢"}),t.jsx("dd",{children:pe.parseLabel||pe.compactMorphology||me.posZh||"ææ éå¸¦å½¢ææ æ³¨"})]})]}),ke.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-[15px] font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:[t.jsx(Ae,{size:16,"aria-hidden":"true"}),"çæè¿äºæ ç¾"]}),t.jsx("div",{className:"flex flex-wrap gap-2","aria-label":"ä¸è¿ä¸ªè¯æå
³çç®æè¯æ³",children:ke.map(({entry:e,label:n})=>t.jsxs("button",{type:"button",onClick:()=>$({entryId:e.id,label:n}),className:`inline-flex min-h-10 items-center gap-1.5 rounded-full border-2 px-3 text-[15px] font-medium ${Qn}`,style:{borderColor:"#C7DDE3",color:"#2C5E73",background:"#F3F9FA"},"aria-label":`æ¥ç${n}çç®æè¯æ³è¯´æ`,children:[n,t.jsx(Ae,{size:14,"aria-hidden":"true"})]},e.id))})]}),(pe.beginnerNote||me.vocabNote||me.remarkZh)&&t.jsxs("div",{className:"mt-3 rounded-xl border-2 p-3",style:{borderColor:Jn,background:Wn},children:[t.jsx("div",{className:"text-[15px] font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"grc"===i&&pe.beginnerNote?"è¿ä¸è¯å½¢å¨å¥ä¸åä»ä¹":"è¯è¯è¡¥å
"}),pe.beginnerNote&&t.jsx("p",{className:"mt-1 text-[18px] leading-[1.8] text-slate-700",children:pe.beginnerNote}),me.vocabNote&&t.jsx("p",{className:"mt-2 text-[15px] leading-[1.8] text-slate-600",children:me.vocabNote.replace(/\*\*/g,"")}),me.remarkZh&&me.remarkZh!==me.vocabNote&&t.jsx("p",{className:"mt-2 text-[15px] leading-[1.8] text-slate-600",children:me.remarkZh})]}),t.jsxs("div",{className:"mt-3 text-[15px] leading-[1.8] text-slate-600",children:["number"==typeof me.occurrences&&t.jsxs("p",{children:["è¿ä¸ªè¯å
¸å½¢å¨","grc"===i?"æ°çº¦":"æ§çº¦","åºç° ",t.jsx("span",{className:"font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:me.occurrences})," 次ã"]}
1),pe.numberLabel&&t.jsxs("p",{children:[pe.numberLabel.label,"ï¼",t.jsx("span",{dir:"ltr",className:"tabular-nums",children:pe.numberLabel.short})]}),null===be&&t.jsx("p",{children:"æ£å¨æ¾æ¬ç« éçåè¯â¦"}),fe.length>0&&t.jsxs("p",{children:["æ¬ç« è¿åºç°å¨ç¬¬ ",fe.join("ã")," èã"]}),be&&0===fe.length&&t.jsx("p",{children:"æ¬ç« å
¶ä»ç»è没æååºç°è¿ä¸ªè¯å
¸å½¢ã"})]}),t.jsxs("details",{className:"mt-3 rounded-xl border-2 px-3 py-2",style:{borderColor:Jn,background:Wn},children:[t.jsx("summary",{className:`min-h-11 cursor-pointer py-2 text-[15px] font-medium text-slate-600 ${Qn}`,children:"妿¯æ ç¾"}),t.jsxs("p",{className:"pb-2 text-[15px] leading-[1.8] text-slate-600",children:[pe.parseLabel||me.morphologyZh||"è¿ä¸ä¸ªè¯æ²¡æéå¸¦å½¢ææ æ³¨ã",me.pos||me.parse?`ï¼${[me.pos,me.parse].filter(Boolean).join(" · ")}ï¼`:""]})]})]})]}):null,!ne&&t.jsx("p",{className:"mt-3 rounded-xl border-2 p-3 text-[15px] leading-[1.8] text-slate-700",style:{borderColor:"#D6B36A",background:"#FFF7DF"},children:le})]})]}),ce&&t.jsx("p",{className:"mt-3 rounded-xl border-2 p-3 text-[15px] leading-[1.8] text-slate-700",style:{borderColor:"#D6B36A",background:"#FFF7DF"},children:"grc"===i?"æ¬èå±ç¤ºç»æä¸éè¯æ 注éç¨çå¸è
æåºæ¬æåé¢å·®å¼ï¼è¯·ä¸è¦æä¸¤è¡æºæ¢°å°éå对é½ã":`æ¬èå±ç¤ºç ${ee} ç»æä¸éè¯èµææå颿åè¯å·®å¼ï¼è¯·å
ææ´èçè§£ï¼ä¸è¦æºæ¢°éå对é½ã`}),t.jsx("p",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:S||("loading"===(null==D?void 0:D.status)?"æ£å¨åå¤åæè¯»é³":"playing"===(null==D?void 0:D.status)?"æ£å¨ææ¾åæè¯»é³":"")}),S&&t.jsx("p",{className:"mt-3 rounded-xl border-2 p-3 text-[15px] leading-[1.8] text-slate-700",style:{borderColor:Jn,background:Un},children:S})]}),t.jsxs("section",{className:"mt-6","aria-labelledby":`${R}-insight`,children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("h3",{id:`${R}-insight`,className:"text-[19px] font-semibold text-slate-800",style:{fontFamily:Yn},children:"æ·±å
¥è¯»è¿ä¸è"}),Xn("AI è¾
å©","ai")]}),t.jsx("p",{className:"text-[15px] leading-[1.8] text-slate-600",children:"AI æ ¹æ®å¯æ ¸å¯¹çç»æä¸è¯å½¢èµææ´çè§£éï¼ä¸æ¹ä¾æ®åæ¨è®ºææ¡ç± AI ç»åºï¼æªç»åææå¸éæ¡å®¡æ ¸ã请ç»åä¸ä¸ææ¥èã"}),t.jsxs("div",{className:"mt-3 flex flex-wrap gap-2","aria-label":"åæåæçåä¸ªå±æ¬¡",children:[ea("1 èµæäºå®","fact"),ea("2 è¯æ³è§£é","grammar"),ea("3 éç»æ¨è®º","interpretation"),ea("4 ç§å
»åºç¨","pastoral")]}),!L&&t.jsx("button",{type:"button",onClick:je,disabled:q,className:`mt-3 flex min-h-12 w-full items-center justify-center gap-2 rounded-full border-2 px-4 text-[15px] font-medium disabled:opacity-70 ${Qn}`,style:{borderColor:Vn,color:"var(--readable-sage, #3D5A2D)",background:Kn},children:q?t.jsxs(t.Fragment,{children:[t.jsx(Ce,{size:17,className:"animate-spin","aria-hidden":"true"})," æ£å¨æåä¸ªå±æ¬¡æ´çè¿èç»æâ¦"]}):t.jsxs(t.Fragment,{children:[t.jsx(_e,{size:17,"aria-hidden":"true"})," æ·±å
¥è¯»è¿ä¸è"]})}),P&&t.jsx("p",{className:"mt-2 text-[15px] leading-[1.7] text-red-700",role:"alert",children:P}),L&&t.jsxs("div",{className:"mt-4 space-y-3",children:[L.contextScope&&t.jsxs("p",{className:"text-[15px] leading-[1.8] text-slate-600",children:["æ¬æ¬¡ä¸ä¸æï¼",L.contextScope]}),L.verseConfidence&&"high"!==L.verseConfidence&&t.jsxs("p",{className:"rounded-xl border-2 p-3 text-[15px] leading-[1.8]",style:{borderColor:"#D6B36A",background:"#FFF7DF",color:"var(--readable-gold, #70470F)"},children:["è¿ä¸å¤ä¸å忬ç¼å·å¯è½æ²¡æå®å
¨å¯¹é½ï¼ä»¥ä¸è§£éçåææªè¾éè¦åæ ¸å¯¹ã",L.verseNote?`ï¼${L.verseNote}ï¼`:""]}),L.literal&&t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:Jn,background:Gn},children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"è´´è¿åæçè¾
å©ç´è¯"}),Xn("䏿¯å¯ä¸è¯æ³","ai")]}),t.jsx("p",{className:"text-[18px] leading-[1.9] text-slate-800",children:L.literal})]}),((null==(d=L.context)?void 0:d.before)||(null==(c=L.context)?void 0:c.after))&&t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:Jn,background:Wn},children:[t.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold text-slate-700",children:"æ¾åååæ"}),ea("éç»æ¨è®º","interpretation")]}),t.jsxs("div",{className:"space-y-3",children:[L.context.before&&t.jsxs("p",{className:"text-[18px] leading-[1.8] text-slate-700",children:[t.jsx("span",{className:"font-semibold text-slate-800",children:"åæææ ·å¼å
¥ï¼"}),L.context.before]}),L.context.after&&t.jsxs("p",{className:"text-[18px] leading-[1.8] text-slate-700",children:[t.jsx("span",{className:"font-semibold text-slate-800",children:"åæææ ·æ¨è¿ï¼"}),L.context.after]})]})]}),(null==(h=L.grammar)?void 0:h.length)?t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:"#C7DDE3",background:"#F3F9FA"},children:[t.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold text-slate-700",children:"è¿äºè¯æ³ææ ·å¸®å©çè§£"}),ea("è¯æ³è§£é","grammar")]}),t.jsx("div",{className:"space-y-3",children:L.grammar.map((e,n)=>t.jsxs("p",{className:"text-[18px] leading-[1.8] text-slate-700",children:[t.jsx("span",{className:"font-semibold text-slate-800",children:e.point}),"ï¼",e.explain]},`grammar-${n}`))})]}):null,(null==(u=L.interpretation)?void 0:u.length)?t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:"#E2C98F",background:"#FFF9EA"},children:[t.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold text-slate-700",children:"è¿èç»æå¯ä»¥ææ ·çè§£"}),ea("éç»æ¨è®º","interpretation")]}),t.jsx("div",{className:"space-y-4",children:L.interpretation.map((e,n)=>t.jsxs("div",{children:[t.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[t.jsx("p",{className:"text-[18px] font-semibold leading-[1.8] text-slate-800",children:e.claim}),t.jsx("span",{className:"text-[13px] text-slate-500",children:ta[e.confidence]})]}),t.jsxs("p",{className:"mt-1 text-[15px] leading-[1.8] text-slate-600",children:["便®ï¼",e.basis]})]},`interpretation-${n}`))})]}):null,(null==(m=L.pitfalls)?void 0:m.length)?t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:Jn,background:Un},children:[t.jsx("div",{className:"mb-2 text-[15px] font-semibold text-slate-700",children:"è§£éè¾¹ç"}),t.jsx("ul",{className:"list-disc space-y-1 ps-5",children:L.pitfalls.map((e,n)=>t.jsx("li",{className:"text-[18px] leading-[1.8] text-slate-700",children:e},n))})]}):null,L.application&&t.jsxs("div",{className:"rounded-2xl border-2 p-4",style:{borderColor:"#CFE0BB",background:Kn},children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[15px] font-semibold",style:{color:"var(--readable-sage, #3D5A2D)"},children:"黿³ä¸ååº"}),ea("ç§å
»åºç¨","pastoral")]}),t.jsx("p",{className:"text-[18px] leading-[1.9] text-slate-800",children:L.application})]})]})]}),t.jsxs("div",{className:"mt-6 border-t-2 pt-3 text-[13px] leading-[1.8] text-slate-500",style:{borderColor:Jn},children:[t.jsxs("p",{children:["ååæ¬ï¼æ¬ç«ç»æåºä¸å¸ç · åæï¼",oe]}),he?t.jsxs("p",{children:["éè¯èµæï¼",t.jsx("a",{className:"underline underline-offset-2",href:he.sourceUrl,target:"_blank",rel:"noreferrer",children:he.attribution})," · ",t.jsx("a",{className:"underline underline-offset-2",href:he.licenseUrl,target:"_blank",rel:"noreferrer",children:he.license}),ue?` · èµæçæ¬ ${ue}`:""]}):null,t.jsx("p",{children:"AI å
容已ä¸è¯å
¸äºå®åå±ï¼è¯·ç»åæ´æ®µä¸ä¸ææ¥èã"})]})]})]}),B&&t.jsx(Ft,{lang:i,initialEntryId:B.entryId,matchedLabel:B.label,manageOverlayNav:!1,onClose:()=>$(null)})]})},ra=(e,t)=>`bct_modinvite_${e}_${t}`,oa="days",sa="declined",ia="snooze",la="done",da=e=>{try{return localStorage.getItem(e)||""}catch{return""}},ca=(e,t)=>{try{localStorage.setItem(e,t)}catch{}};
1function ha(e,t=Z(),n=Date.now()){if(t.includes(e))return ca(ra(e,la),"1"),!1;if(function(e){return"1"===da(ra(e,la))}(e))return!1;const a=n<(Number(da(ra(e,ia)))||0),r=(e=>new Date(e).toISOString().slice(0,10))(n),o=da(ra(e,oa)).split(",").filter(Boolean);return o.includes(r)||(o.push(r),ca(ra(e,oa),o.slice(-10).join(","))),!a&&o.length>=2}const ua=({open:n,onClose:a,book:r,chapter:o,userId:i,onSaved:l})=>{const d=s(),[c,h]=e.useState(!1),[u,m]=e.useState(!1),[p,x]=e.useState(""),[b,f]=e.useState(""),[g,k]=e.useState(""),[v,y]=e.useState(null);e.useEffect(()=>{n&&(y(null),h(!0),ae(r,o).then(e=>{e?(x(e.markdown),f(e.markdown),k(e.hash)):(y(d("æªæ¾å°è¯¥ç« èç MD ç身ï¼DB 䏿 æ¤ç« ï¼")),x(""),f(""),k(""))}).catch(e=>{console.error("[BibleWikiMdEditorSheet] fetch error:",e),y(`${d("æå MD 失败")}ï¼${(null==e?void 0:e.message)||e}`),x(""),f(""),k("")}).finally(()=>h(!1)))},[n,r,o,d]),e.useEffect(()=>{if(!n)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",document.body.classList.add("editing-md"),()=>{document.body.style.overflow=e,document.body.classList.remove("editing-md")}},[n]);const j=p!==b,Z=async()=>{if(j&&!u){if(!(await C({title:d("æ¾å¼æªä¿åçä¿®æ¹ï¼"),message:d("å
³éåæªä¿åçå
容ä¼ä¸¢å¤±ã"),confirmText:d("æ¾å¼"),cancelText:d("ç»§ç»ç¼è¾"),danger:!0})))return}a()};return n?t.jsx("div",{className:"fixed inset-0 z-[60] flex items-end bg-black/40 backdrop-blur-sm",onClick:e=>{e.target===e.currentTarget&&Z()},children:t.jsxs("div",{className:"w-full bg-[#FAF9F6] rounded-t-2xl shadow-2xl flex flex-col",style:{height:"92vh"},children:[t.jsx("div",{className:"flex justify-center py-2",children:t.jsx("div",{className:"w-10 h-1 rounded-full bg-[#D4CFC0]"})}),t.jsxs("div",{className:"flex items-center justify-between px-4 pb-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Be,{className:"w-4 h-4 text-[#7A4F11] flex-shrink-0"}),t.jsxs("h2",{className:"text-base font-bold text-[#2D2A22] truncate",children:[d("ç¼è¾ MD ç身")," · ",r," ",0===o?d("导论"):o]})]}),t.jsx("button",{onClick:Z,className:"p-1.5 rounded-lg hover:bg-[#F0EDE2] text-[#6B6557] flex-shrink-0","aria-label":d("å
³é"),children:t.jsx(Te,{className:"w-5 h-5"})})]}),t.jsx("div",{className:"px-4 pb-2",children:t.jsx("div",{className:"text-[13px] text-[#7A6F50] bg-[#FFF7E0] border border-[#F0E0B0] rounded-lg px-3 py-2 leading-relaxed",children:d("ä¿ååç«å³åå
¥ DB source_mdï¼çº¿ä¸è®¿é®è
å·æ°å³å¯çå°æ°çï¼ãæ§çæ¬ä¼èªå¨å½æ¡£å° history 表ï¼å¯éæ¶åæ»ãæ¬å° MD æä»¶æ¯å¤© 03:00 UTC èªå¨åæ¥å gitã")})}),t.jsx("div",{className:"flex-1 min-h-0 overflow-hidden px-3 pb-2",children:c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Ce,{className:"w-6 h-6 animate-spin text-amber-500"})}):t.jsx("textarea",{value:p,onChange:e=>x(e.target.value),spellCheck:!1,className:"w-full h-full resize-none rounded-lg border border-[#E6E2D6] bg-white p-3 font-mono text-[13px] leading-[1.7] text-[#2D2A22] focus:outline-none focus:border-amber-400",placeholder:d("卿¤ç²è´´æç¼è¾ Markdown å
¨æâ¦")})}),v&&t.jsx("div",{className:"px-4 pb-2",children:t.jsxs("div",{className:"flex items-start gap-2 text-[13px] text-red-700 bg-red-50 border border-red-200 rounded-lg px-3 py-2",children:[t.jsx($e,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),t.jsx("span",{className:"leading-relaxed",children:v})]})}),t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 border-t border-[#E6E2D6] bg-[#FAF9F6]",children:[t.jsxs("div",{className:"text-[13px] text-[#6B6557] flex items-center gap-2 flex-wrap",children:[t.jsxs("span",{children:[p.length.toLocaleString()," ",d("å符")]}),j&&t.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 text-amber-800 font-medium",children:d("ææªä¿åä¿®æ¹")})]}),t.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[t.jsx("button",{onClick:Z,disabled:u,className:"px-3 py-1.5 rounded-lg text-sm border border-[#E6E2D6] text-[#6B6557] bg-[#FFFCF5] hover:bg-[#F0EDE2] disabled:opacity-50",children:d("åæ¶")}),t.jsxs("button",{onClick:async()=>{var e;if(!j)return void w(d("å
容没æåå"));m(!0),y(null);const t=await re(p,i,{savedVia:"web",expectedDbHash:g});if(m(!1),!t.success)return void(t.conflict?y(d("ä¿åå²çªï¼DB èªä½ æå¼å已被å«äººæ¹è¿ã请å
³éåéæ°æå¼ä»¥æææ°çï¼ä½ çå
容ä»å¨åªè´´æ¿å¯å¤å¶ä¿çï¼ã")):y(t.message||d("ä¿å失败")));const n=(null==(e=t.warnings)?void 0:e.length)||0;E(n>
10?d("å·²ä¿å")+` · ${n} `+d("个è¦åï¼è§æ§å¶å°ï¼"):d("å·²ä¿å")),n>0&&t.warnings,null==l||l(),a()},disabled:u||!j||c,className:"inline-flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium bg-amber-500 text-white hover:bg-amber-600 disabled:opacity-50 disabled:cursor-not-allowed",children:[u?t.jsx(Ce,{className:"w-4 h-4 animate-spin"}):t.jsx(Le,{className:"w-4 h-4"}),d("ä¿å")]})]})]})]})}):null},ma={heading:"æ é¢",paragraph:"段è½",blockquote:"å¼ç¨",list:"å表",table:"è¡¨æ ¼",code:"代ç ",html:"HTML",diagram:"ç»æå¾"},pa=({open:n,onClose:a,sourceMd:r,expectedDbHash:o,target:i,book:l,chapter:d,userId:c,onSaved:h})=>{const u=s(),[m,p]=e.useState(""),[x,b]=e.useState(""),[f,g]=e.useState(!1),[k,v]=e.useState(null),y=e.useRef(null);e.useLayoutEffect(()=>{const e=y.current;e&&n&&(e.style.height="auto",e.style.height=e.scrollHeight+"px")},[m,n]),e.useEffect(()=>{if(!n||!i)return p(""),b(""),void v(null);const e=r.slice(i.start,i.end);p(e),b(e),v(null)},[n,i,r]),e.useEffect(()=>{if(!n)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",document.body.classList.add("editing-md"),()=>{document.body.style.overflow=e,document.body.classList.remove("editing-md")}},[n]);const j=m!==x,Z=async()=>{if(j&&!f){if(!(await C({title:u("æ¾å¼æªä¿åçä¿®æ¹ï¼"),message:u("å
³éåè¿ä¸æ®µçä¿®æ¹ä¼ä¸¢å¤±ã"),confirmText:u("æ¾å¼"),cancelText:u("ç»§ç»ç¼è¾"),danger:!0})))return}a()};return n&&i?t.jsx("div",{className:"fixed inset-0 z-[60] flex items-end bg-black/40 backdrop-blur-sm",onClick:e=>{e.target===e.currentTarget&&Z()},children:t.jsxs("div",{className:"w-full bg-[#FAF9F6] rounded-t-2xl shadow-2xl flex flex-col",style:{maxHeight:"90vh"},children:[t.jsx("div",{className:"flex justify-center py-2",children:t.jsx("div",{className:"w-10 h-1 rounded-full bg-[#D4CFC0]"})}),t.jsxs("div",{className:"flex items-center justify-between px-4 pb-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Me,{className:"w-4 h-4 text-[#7A4F11] flex-shrink-0"}),t.jsxs("h2",{className:"text-base font-bold text-[#2D2A22] truncate",children:[u("ç¼è¾")," · ",ma[i.type]||i.type," ·"," ",t.jsxs("span",{className:"text-[#6B6557] font-normal",children:[l," ",0===d?u("导论"):d]})]})]}),t.jsx("button",{onClick:Z,className:"p-1.5 rounded-lg hover:bg-[#F0EDE2] text-[#6B6557] flex-shrink-0","aria-label":u("å
³é"),children:t.jsx(Te,{className:"w-5 h-5"})})]}),t.jsx("div",{className:"px-4 pb-2",children:t.jsxs("div",{className:"text-[13px] text-[#7A6F50] bg-[#FFF7E0] border border-[#F0E0B0] rounded-lg px-3 py-1.5 leading-relaxed",children:[u("åªç¼è¾è¿ä¸æ®µï¼ä¿ååæ´ç¯ source_md ä¼ç¨æ°å
å®¹æ¿æ¢ ["),i.start,"â",i.end,u("]ï¼æ§çèªå¨å½æ¡£å° historyã")]})}),t.jsx("div",{className:"px-3 pb-2 overflow-y-auto",children:t.jsx("textarea",{ref:y,value:m,onChange:e=>p(e.target.value),spellCheck:!1,autoFocus:!0,rows:4,className:"w-full resize-none rounded-lg border border-[#E6E2D6] bg-white p-3 font-mono text-[13px] leading-[1.7] text-[#2D2A22] focus:outline-none focus:border-amber-400 overflow-hidden"})}),k&&t.jsx("div",{className:"px-4 pb-2",children:t.jsxs("div",{className:"flex items-start gap-2 text-[13px] text-red-700 bg-red-50 border border-red-200 rounded-lg px-3 py-2",children:[t.jsx($e,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),t.jsx("span",{className:"leading-relaxed",children:k})]})}),t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 border-t border-[#E6E2D6] bg-[#FAF9F6]",children:[t.jsxs("div",{className:"text-[13px] text-[#6B6557] flex items-center gap-2 flex-wrap",children:[t.jsxs("span",{children:[m.length," ",u("å符")]}),j&&t.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 text-amber-800 font-medium",children:u("ææªä¿åä¿®æ¹")})]}),t.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[t.jsx("button",{onClick:Z,disabled:f,className:"px-3 py-1.5 rounded-lg text-sm border border-[#E6E2D6] text-[#6B6557] bg-[#FFFCF5] hover:bg-[#F0EDE2] disabled:opacity-50",children:u("åæ¶")}),t.jsxs("button",{onClick:async()=>
1{if(!i)return;if(!j)return void w(u("å
容没æåå"));let e;try{e=he(r,i.start,i.end,m)}catch(n){return void v((null==n?void 0:n.message)||u("æ¿æ¢å¤±è´¥"))}g(!0),v(null);const t=await re(e,c,{savedVia:"web",expectedDbHash:o});g(!1),t.success?(E(u("å·²ä¿å")),null==h||h(e),a()):t.conflict?v(u("ä¿åå²çªï¼DB èªä½ æå¼å已被æ¹è¿ã请å
³éåéæ°æå¼ä»¥æææ°çï¼ä½ è¿ä¸æ®µçå
容å¯å
å¤å¶å°å«å¤ä¿çï¼ã")):v(t.message||u("ä¿å失败"))},disabled:f||!j,className:"inline-flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium bg-amber-500 text-white hover:bg-amber-600 disabled:opacity-50 disabled:cursor-not-allowed",children:[f?t.jsx(Ce,{className:"w-4 h-4 animate-spin"}):t.jsx(Le,{className:"w-4 h-4"}),u("ä¿å")]})]})]})]})}):null},xa=new Set(["baibaoshu.net","www.baibaoshu.net","scripturetrove.com","www.scripturetrove.com"]),ba={amber:"[&_h2]:text-[#7A4F11] [&_h2]:border-[#E6BA59]/60 [&_h3[data-bw-collapsible]]:text-[#7A4F11] [&_th]:bg-[#FBE7B6] [&_th]:text-[#7A4F11] [&_blockquote]:border-[#E6BA59] [&_blockquote]:bg-[#FBE7B6]/45 [&_a]:text-[#7A4F11] dark:[&_h2]:text-[#E0C078] dark:[&_h2]:border-[#7A6234] dark:[&_h3[data-bw-collapsible]]:text-[#E0C078] dark:[&_th]:bg-[#3A3220] dark:[&_th]:text-[#E6C888] dark:[&_blockquote]:border-[#7A6234] dark:[&_blockquote]:bg-[#2E2A1C] dark:[&_a]:text-[#E6C888]",emerald:"[&_h2]:text-[#4F7942] [&_h2]:border-[#9CB58A]/60 [&_h3[data-bw-collapsible]]:text-[#4F7942] [&_th]:bg-[#E8F4D0] [&_th]:text-[#3D5A2D] [&_blockquote]:border-[#9CB58A] [&_blockquote]:bg-[#EEF7D8]/80 [&_a]:text-[#4F7942] dark:[&_h2]:text-[#9DCB78] dark:[&_h2]:border-[#5C7A4A] dark:[&_h3[data-bw-collapsible]]:text-[#9DCB78] dark:[&_th]:bg-[#26311E] dark:[&_th]:text-[#AAD088] dark:[&_blockquote]:border-[#5C7A4A] dark:[&_blockquote]:bg-[#222A1A] dark:[&_a]:text-[#AAD088]",indigo:"[&_h2]:text-[#245B83] [&_h2]:border-[#B7D7EA]/70 [&_h3[data-bw-collapsible]]:text-[#245B83] [&_th]:bg-[#E4F2FB] [&_th]:text-[#245B83] [&_blockquote]:border-[#B7D7EA] [&_blockquote]:bg-[#E4F2FB]/60 [&_a]:text-[#245B83] dark:[&_h2]:text-[#9CC7E8] dark:[&_h2]:border-[#4F6F88] dark:[&_h3[data-bw-collapsible]]:text-[#9CC7E8] dark:[&_th]:bg-[#1E2C35] dark:[&_th]:text-[#B8DAF0] dark:[&_blockquote]:border-[#4F6F88] dark:[&_blockquote]:bg-[#1B2830] dark:[&_a]:text-[#B8DAF0]"},fa=({children:e,className:n=""})=>t.jsxs("div",{className:`xl:grid xl:grid-cols-[minmax(0,50rem)_184px] xl:justify-center xl:gap-6 xl:items-start ${n}`,children:[t.jsx("div",{className:"min-w-0",children:e}),t.jsx("div",{className:"hidden xl:block w-[184px]","aria-hidden":!0})]}),ga=(e,t)=>`bwiki-expanded-${e}-${t}`,wa=(e,t)=>{try{const n=sessionStorage.getItem(ga(e,t));return n?JSON.parse(n):{}}catch{return{}}},ka=(e,t,n)=>{try{const a=wa(e,t);sessionStorage.setItem(ga(e,t),JSON.stringify({...a,...n}))}catch{}},va=(e,t,n)=>e,ya=({book:n,chapter:a,user:r,zenMode:o=!1,onShowAllBooks:l,onCloseAllBooks:d,allBooksOpen:h=!1,mobileNavAboveOverlay:m=!1})=>{const p=s(),{linkify:b,linkifyBare:f,openScriptureRef:g,openScripture:v,closeScripture:y,scriptureOpen:j,sheet:C}=_t(),[R,W]=e.useState(null),[U,J]=e.useState(!0),V=`${n}:${a}`,[K,Y]=e.useState(null),Q=e.useCallback(()=>Y(V),[V]),X=e.useRef(null),[ee,ne]=e.useState(!1),[ae,ce]=e.useState([]),he=x();e.useEffect(()=>{var e;if(!ee)return;null==he||he.setOverlayOpen(!0);const t=new Set,n=[];return null==(e=X.current)||e.querySelectorAll("h2[id]").forEach(e=>{const a=e.getAttribute("id")||"",r=(e.textContent||"").replace(/\s+/g," ").trim();a&&r&&!t.has(a)&&(t.add(a),n.push({id:a,text:r}))}),ce(n),()=>null==he?void 0:he.setOverlayOpen(!1)},[ee]);const[pe,xe]=e.useState([]),[we,ke]=e.useState(null),ve=kn(we,n,a);e.useEffect(()=>{ke(e=>kn(e,n,a))},[n,a]);const ye="bct_wiki_show_original_chip",[je,Ze]=e.useState(()=>{try{return"1"===localStorage.getItem(ye)}catch{return!1}}),Ne=e.useCallback(()=>{Ze(e=>{const t=!e;try{localStorage.setItem(ye,t?"1":"0")}catch{}return t&&ha("originalLang")&&Ie(!0),t})},[]),[Fe,Ie]=e.useState(!1);e.useEffect(()=>{let e=!1;if(n&&!(a<=0))return T(n,a).then(t=>{e||xe(t)}),()=>{e=!0};xe([])},[n,a]);const[Se,Ae]=e.useState(()=>!(!r||!r.isPlatformAdmin&&!r.isSystemAdmin)),[De,_e]=e.useState(!1),[$e,Me]=e.useState(null),[et,tt]=e.useState(null),[nt,at]=e.useState(null),rt=e.useRef(()=>{}),[ot,st]=e.useState(!1),[it,vt]=e.useState(null),[yt,jt]=e.useState(null),[Zt,Nt]=e.useState(null);e.useEffect(()=>{if(!r)return void Ae(!1);if(r.isPlatformAdmin||r.isSystemAdmin)return void Ae(!0);if(!r.isQuestionBankAdmin)return void Ae(!1);let e=!1;return $t(r.id).then(t=>{e||Ae(t.some(e=>
1"bible_wiki"===e.permissionType&&"all"===e.resourceId))}).catch(()=>{e||Ae(!1)}),()=>{e=!0}},[null==r?void 0:r.id,null==r?void 0:r.isPlatformAdmin,null==r?void 0:r.isSystemAdmin,null==r?void 0:r.isQuestionBankAdmin]);const[Ct,Et]=e.useState(!1),[Tt,Ft]=e.useState("overview"),Pt=At({sourceMd:null==R?void 0:R.sourceMd,enabled:!!(Se&&De&&"overview"===Tt&&r),containerRef:X,saveMd:async e=>{if(!r)return{success:!1,message:"æªç»å½"};const t=await re(e,r.id,{savedVia:"web",expectedDbHash:null==R?void 0:R.sourceMdHash});if(t.success&&t.newHash&&W(e=>e?{...e,sourceMdHash:t.newHash}:e),!t.success&&t.conflict){try{const e=await F(n,a,{bypassEdge:!0});e&&W(e)}catch(o){}return{success:!1,message:"ä¿åè¢«åæ¶ï¼è¿ä¸ç« 已被ä»äººæåå°ä¿®æ¹ï¼å·²èªå¨å è½½ææ°çæ¬ï¼è¯·éæ°å°è¯ã"}}return{success:t.success,message:t.message}},onSourceMdChanged:e=>{const t=window.scrollY;W(t=>t?{...t,sourceMd:e}:t);const n=()=>window.scrollTo({top:t,behavior:"auto"});requestAnimationFrame(()=>{n(),requestAnimationFrame(()=>{n(),setTimeout(n,50),setTimeout(n,200)})})}}),[Ot,Ht]=e.useState(()=>wa(n,a).simple??!0),[Wt,Gt]=e.useState(()=>!!wa(n,a).standard),[Ut,Vt]=e.useState(()=>!!wa(n,a).advanced),Kt=e.useCallback(()=>{I(n,a,null==r?void 0:r.id)&&Ma(S())},[n,a,null==r?void 0:r.id]);e.useEffect(()=>{de("page_view","/study-article",{category:"study",dedupKey:"pv:study"})},[]);const Yt=e.useCallback(()=>{Ht(e=>{const t=!e;return ka(n,a,{simple:t}),t&&Kt(),t})},[n,a,Kt]),Qt=e.useCallback(()=>{Gt(e=>{const t=!e;return ka(n,a,{standard:t}),t&&Kt(),t})},[n,a,Kt]),en=e.useCallback(()=>{Vt(e=>{const t=!e;return ka(n,a,{advanced:t}),t&&Kt(),t})},[n,a,Kt]),[tn,cn]=e.useState(null),[hn,un]=e.useState(null),[mn,pn]=e.useState(!1),xn=e.useRef(null),fn=e.useRef(0),[gn,vn]=e.useState(!1),[yn,jn]=e.useState(0),Zn=e.useRef(null),Nn=e.useRef(null),[Cn,En]=e.useState(null),Tn=[.75,1,1.25,1.5,1.75,2],Fn="bct_wiki_narrator_rate",[In,Sn]=e.useState(()=>{try{const e=Number(localStorage.getItem(Fn));return Tn.includes(e)?e:1}catch{return 1}}),[An,Dn]=e.useState(!1),_n=e.useRef(null),[Bn,$n]=e.useState({simple:new Map,standard:new Map}),Ln=e.useCallback(()=>{const e=X.current;e&&e.querySelectorAll(".tts-section-btn").forEach(e=>{const t=e;t.classList.remove("animate-pulse"),t.style.background="transparent",t.style.color=t.classList.contains("tts-has-audio")?"#8B6BB3":"#64748B"})},[]),Mn=e.useCallback((e,t,n)=>{const a=X.current;if(!a)return;Ln();const r=a.querySelector(`.tts-section-btn[data-tts-tier="${e}"][data-tts-section="${t}"]`);r&&("loading"===n?(r.style.color="#8B6BB3",r.classList.add("animate-pulse")):(r.style.color="#fff",r.style.background="#8B6BB3"))},[Ln]),qn=e.useCallback((e,t)=>{if(Zn.current){const n=String(t||0);Zn.current.max!==n&&(Zn.current.max=n),Zn.current.value=String(Math.min(e,t||0))}Nn.current&&(Nn.current.textContent=`${ja(e)} / ${ja(t)}`)},[]),zn=e.useCallback(()=>{fn.current++;const e=xn.current;e&&(e.pause(),e.src=""),xn.current=null,cn(null),un(null),pn(!1),vn(!1),jn(0),En(null),Dn(!1),Ln()},[Ln]);e.useEffect(()=>{zn()},[n,a,zn]),e.useEffect(()=>{hn&&qn(0,0)},[hn,qn]);const Pn=e.useCallback(e=>{const t=xn.current;t&&isFinite(e)&&(t.currentTime=e,qn(e,t.duration||0))},[qn]);e.useCallback(e=>{const t=xn.current;t&&Pn(Math.max(0,Math.min(t.duration||0,t.currentTime+e)))},[Pn]),e.useCallback(e=>{Sn(e);try{localStorage.setItem(Fn,String(e))}catch{}const t=xn.current;t&&(t.playbackRate=e),Dn(!1)},[]),e.useEffect(()=>{if(!An)return;const e=e=>{_n.current&&!_n.current.contains(e.target)&&Dn(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[An]);const On=e.useRef([]),Rn=e.useRef(!1),Hn=e.useRef(!1),Wn=e.useRef(0),[Gn,Un]=e.useState(null),[Jn,Vn]=e.useState(null),Kn=e.useCallback(e=>{var t;const n=X.current;if(!n)return;const a=[];let r=e.parentElement;for(;r&&r!==n;)r.classList.contains("bw-collapsible-content")&&"none"===r.style.display&&a.push(r),r=r.parentElement;for(let o=a.length-1;o>=0;o--){const e=a[o];"none"===e.style.display&&(null==(t=e.previousElementSibling)||t.click())}},[]),Yn=e.useCallback((e,t)=>{const n=()=>{const e=X.current,t=(null==Jn?void 0:Jn.tier)?null==e?void 0:e.querySelector(`[data-bible-tier="${Jn.tier}"]`):e;return Array.from((null==t?void 0:t.querySelectorAll("[data-bible-search-mark]"))||[])},a=n();
1if(On.current=a,!a.length)return;Rn.current=!0;const r=!1!==(null==t?void 0:t.scroll),o=(e%a.length+a.length)%a.length;Wn.current=o,a.forEach((e,t)=>e.setAttribute("data-current",t===o?"1":"0"));const s=a[o];Kn(s),Un(e=>e?{...e,current:o}:{total:a.length,current:o}),r&&requestAnimationFrame(()=>requestAnimationFrame(()=>{if(Wn.current!==o)return;const e=n();On.current=e,e.forEach((e,t)=>e.setAttribute("data-current",t===o?"1":"0"));const t=e[o];(null==t?void 0:t.isConnected)&&t.scrollIntoView({behavior:"smooth",block:"center"})}))},[Kn,Jn]),Qn=e.useCallback(()=>{On.current=[],Un(null),Vn(null)},[]);e.useEffect(()=>()=>{On.current=[],Rn.current=!1,Hn.current=!1,Wn.current=0,Un(null),Vn(null)},[n,a]),e.useEffect(()=>{if(U||!R)return;let e=null,t=null,n=null;try{const a=new URLSearchParams(window.location.search);e=a.get("q"),t=a.get("tier"),n=a.get("verse")}catch{return}if(!e||e.length<1)return;"simple"===t?Ht(!0):"standard"===t?Gt(!0):"advanced"===t&&Vt(!0);const a=e,r=n&&parseInt(n,10)||null;Vn(e=>e&&e.query===a&&e.tier===t&&e.verse===r?e:(Rn.current=!1,Hn.current=!1,Wn.current=0,{query:a,tier:t,verse:r}))},[U,R,n,a]),e.useEffect(()=>{if(U||!R)return;let e=null,t=null,n=!1;try{const a=new URLSearchParams(window.location.search);e=a.get("tier"),t=a.get("verse"),n=!!a.get("q")}catch{return}if(n)return;if(!e)return;"simple"===e?Ht(!0):"standard"===e?Gt(!0):"advanced"===e&&Vt(!0);const r=t?parseInt(t,10):0;if(!r||r<1)return;let o=0,s=0,i=null;const l=()=>{const t=X.current;if(!t)return o++,void(o<30&&(i=setTimeout(l,100)));const n=t.querySelector(`[data-bible-tier="${e}"]`);if(!n)return o++,void(o<30&&(i=setTimeout(l,100)));const d=Array.from(n.querySelectorAll("h2, h3")),c=new RegExp(`(?:^|[^\\d])${a}\\s*[:ï¼]\\s*(\\d+)(?:\\s*[-â]\\s*(\\d+))?`);let h=null;for(const e of d){const t=(e.textContent||"").match(c);if(!t)continue;const n=parseInt(t[1],10),a=t[2]?parseInt(t[2],10):n;if(r>=n&&r<=a){h=e;break}}if(!h)return o++,o<30?void(i=setTimeout(l,100)):void 0;if(("H2"===h.tagName||"H3"===h.tagName)&&"1"!==h.dataset.bwCollapsible&&(o++,o<30))return void(i=setTimeout(l,100));Kn(h);const u=h.nextElementSibling;!!u&&u.classList.contains("bw-collapsible-content")&&"none"===u.style.display&&h.click();const m=h.nextElementSibling;let p=h;if(null==m?void 0:m.classList.contains("bw-collapsible-content")){const e=m.querySelectorAll('blockquote[data-bw-collapsible="1"]'),t=new RegExp(`^${a}\\s*[:ï¼]\\s*(\\d+)(?:\\s*[-â,]\\s*(\\d+))?`);for(const n of Array.from(e)){const e=n.querySelector("strong, b"),a=((null==e?void 0:e.textContent)||"").trim().match(t);if(!a)continue;const o=parseInt(a[1],10),s=a[2]?parseInt(a[2],10):o;if(r>=o&&r<=s){const e=n.nextElementSibling;!!e&&e.classList.contains("bw-collapsible-content")&&"none"===e.style.display&&n.click(),p=n;break}}}if(p.setAttribute("data-bible-verse-mark","1"),!document.getElementById("bw-verse-pulse-style")){const e=document.createElement("style");e.id="bw-verse-pulse-style",e.textContent='@keyframes bwVersePulse{0%{background:#FBE7B6}70%{background:#FFF6E0}100%{background:transparent}}[data-bible-verse-mark="1"]{animation:bwVersePulse 3.2s ease forwards;border-radius:6px;padding:0.15em 0.4em;margin-left:-0.4em}',document.head.appendChild(e)}const x=p,b=()=>x.scrollIntoView({behavior:"auto",block:"start"});requestAnimationFrame(()=>{requestAnimationFrame(()=>{b(),setTimeout(b,150),setTimeout(b,400)})}),++s<8&&(i=setTimeout(l,250))};return i=setTimeout(l,250),()=>{i&&clearTimeout(i)}},[U,R,n,a]);const[Xn,ea]=e.useState(null),[ta,na]=e.useState(!1),[oa,ma]=e.useState(!1),[ba,ga]=e.useState(!1),[ya,Za]=e.useState(!1),[Na,Ca]=e.useState([]),[Ea,Ta]=e.useState(null),[Fa,Ia]=e.useState(null),[Sa,Aa]=e.useState(!1),[Da,_a]=e.useState(new Set),[Ba,$a]=e.useState(()=>(null==r?void 0:r.id)?se(r.id,"wiki"):new Set),[La,Ma]=e.useState(()=>(A(),S())),qa=`${n}:${a}`,Wa=Ba.has(qa);e.useEffect(()=>{if(!(null==r?void 0:r.id))return;let e=!1;return ie(r.id,"wiki").then(t=>{e||$a(t)}),D(r.id).then(t=>{e||Ma(t)}),()=>{e=!0}},[null==r?void 0:r.id]);const Ga=()=>{var e;if(!(null==r?void 0:r.id))return void k(p("ç»å½åæè½æ¶è"));const t=Wa;$a(e=>{const n=new Set(e);return t?n.delete(qa):n.add(qa),n});const o=(null==(e=B.find(e=>e.name===n))?void 0:e.nameZh)||n;le(r.id,{kind:"wiki",refId:qa,title:0===a?`${o} 导论`:`${o} 第${a}ç« `,nav:{bibleWikiBook:n,bibleWikiChapter:String(a)}}).then(e=>{e.success||($a(e=>{const n=new Set(e);return t?n.add(qa):n.delete(qa),n}),w(e.message||p("æ¶è没ä¿åæåï¼è¯·åè¯ä¸æ¬¡")))})},Ua=async()=>{var e,t;if(!R)return;const n=i((null==(e=B.find(e=>e.name===R.book))?void 0:e.nameZh)||R.book),a=0===R.chapter?`${n} ${p("导论")}`:p("{0} {1} ç« ").replace("{0}",n).replace("{1}",String(R.chapter)),r=`${z()}/bibleWikiArticle?book=${encodeURIComponent(R.book)}&chapter=${R.chapter}`,o=`ã${a}ã· ${p($.study.zh)}`,s=(R.sourceMd||"").replace(/^---[\s\S]*?---\s*/,"").match(/ã\s*ä¸ä¸æè\s*ã([\s\S]*?)(?=ã[^ã]+ã|={3,}|$)/),l=((null==s?void 0:s[1])||"").replace(/[#*>`_~\-=\[\]\(\)]/g,"").replace(/\s+/g," ").trim(),d=be(l||(R.title||"").trim(),u())||p($.study.zh),c=`${o}\n\n${d}\n\n${r}`,h="https:"===window.location.protocol||"localhost"===window.location.hostname;if("function"==typeof navigator.share&&h)try{return await navigator.share({title:o,text:d,url:r}),void E(p("å享æå"))}catch(m){if("AbortError"===(null==m?void 0:m.name))return}try{if(null==(t=navigator.clipboard)?void 0:t.writeText)await navigator.clipboard.writeText(c);else{const e=document.createElement("textarea");e.value=c,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}E(p("å·²å¤å¶ï¼æ é¢ + ç®ä» + 龿¥ï¼ï¼å¯ç²è´´å享ç»å¼å
å§å¦¹"))}catch{w(p("å¤å¶å¤±è´¥"))}},Ja=e.useRef(Ua);Ja.current=Ua,e.useEffect(()=>{const e=()=>{Ja.current()};return window.addEventListener("bcct:wiki-share",e),()=>window.removeEventListener("bcct:wiki-share",e)},[]),e.useEffect(()=>{let e=!1;return _().then(t=>{if(e)return;const a=new Set;
1t.forEach(e=>{e.book===n&&a.add(e.chapter)}),_a(a)}).catch(()=>{}),()=>{e=!0}},[n]);const Va=e.useMemo(()=>B.find(e=>e.name===n),[n]),{pct:Ka,scrollable:Ya}=function(t,n=!0){const[a,r]=e.useState(0),[o,s]=e.useState(!1);return e.useEffect(()=>{r(0),s(!1)},[t]),e.useEffect(()=>{if(!n)return;const e=()=>{const e=document.documentElement.scrollHeight-window.innerHeight,t=e>240;if(s(t),!t)return;const n=Math.max(0,Math.min(100,window.scrollY/e*100));r(e=>Math.abs(e-n)>=1||0===n||n>=100?n:e)};return e(),window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[t,n]),{pct:a,scrollable:o}}(`${n}:${a}`,!!R),Qa=e.useMemo(()=>B.findIndex(e=>e.name===n),[n]);e.useEffect(()=>{if(!n)return;let e=!1;J(!0),Ft("overview"),ma(!1),ea(null),ga(!1);const t=wa(n,a);return Ht(t.simple??!0),Gt(!!t.standard),Vt(!!t.advanced),F(n,a,{bypassEdge:Se}).then(t=>{e||(W(t),J(!1))}).catch(()=>{e||J(!1)}),Lt(n,a).then(t=>{e||(ea(t),ma(!0))}).catch(()=>{}),()=>{e=!0}},[n,a,Se]),e.useEffect(()=>{var e;if(n&&a>=0){const t=i((null==(e=B.find(e=>e.name===n))?void 0:e.nameZh)||n),r=0===a?`${t} ${p("导论")}`:p("{0} {1} ç« ").replace("{0}",t).replace("{1}",String(a)),o=((null==R?void 0:R.title)||"").trim(),s=0===a&&o?o:o?`${o} · ${r}`:r,l=document.title;return document.title=`${s} · ${p($.study.zh)}`,()=>{document.title=l}}},[n,a,null==R?void 0:R.title]),e.useEffect(()=>{var e;if(!n||a<0||!R||R.book!==n||R.chapter!==a)return;const t=(null==(e=B.find(e=>e.name===n))?void 0:e.nameZh)||n,r=0===a?`${t} å
¨ä¹¦å¯¼è®º`:`${t} ${a} ç« `;return window.dispatchEvent(new CustomEvent("ai-chat:page-resource",{detail:{resource:`${$.study.zh} · ${r}`,key:`bibleWikiArticle:${n}-${a}`}})),()=>{window.dispatchEvent(new CustomEvent("ai-chat:page-resource",{detail:null}))}},[n,a,null==R?void 0:R.book,null==R?void 0:R.chapter]),e.useEffect(()=>{"scrollRestoration"in history&&(history.scrollRestoration="manual")},[]),e.useEffect(()=>{const e=`bwiki-scroll-${n}-${a}`;let t;const r=()=>{try{sessionStorage.setItem(e,String(Math.round(window.scrollY)))}catch{}},o=()=>{clearTimeout(t),t=setTimeout(r,200)},s=()=>{clearTimeout(t),r()};return window.addEventListener("scroll",o,{passive:!0}),window.addEventListener("beforeunload",s),window.addEventListener("pagehide",s),()=>{clearTimeout(t),window.removeEventListener("scroll",o),window.removeEventListener("beforeunload",s),window.removeEventListener("pagehide",s)}},[n,a]),e.useLayoutEffect(()=>{if(U||K!==V)return;try{const e=new URLSearchParams(window.location.search);if(e.get("tier")||e.get("verse")||e.get("q"))return}catch{}const e=wa(n,a);if(!e.simple&&!e.standard&&!e.advanced)return void window.scrollTo({top:0,behavior:"auto"});const t=`bwiki-scroll-${n}-${a}`,r=sessionStorage.getItem(t);if(!r)return void window.scrollTo({top:0,behavior:"auto"});const o=parseInt(r,10);if(!o)return void window.scrollTo({top:0,behavior:"auto"});const s=()=>{const e=Math.max(0,document.documentElement.scrollHeight-window.innerHeight);window.scrollTo({top:Math.min(o,e),behavior:"auto"})},i=[];let l=0,d=0,c=0;const h=()=>{c++;document.documentElement.scrollHeight>=o+.5*window.innerHeight&&s(),c<8&&i.push(setTimeout(h,80))};return l=requestAnimationFrame(()=>{s(),d=requestAnimationFrame(h)}),i.push(setTimeout(s,250)),i.push(setTimeout(s,600)),()=>{cancelAnimationFrame(l),cancelAnimationFrame(d),i.forEach(clearTimeout)}},[U,K,V,n,a]),e.useCallback(()=>{oa||ta||(na(!0),Lt(n,a).then(e=>{ea(e),na(!1),ma(!0)}))},[n,a,oa,ta]);const Xa=async(e,t)=>{Ia(e);try{const r=await Mt(n,a,t),o=[...Na];o[e]={...o[e],url:r},o[e].title||(o[e].title=t.name.replace(/\.[^.]+$/,"").replace(/[_-]/g," ")),Ca(o)}catch(r){w((null==r?void 0:r.message)||p("ä¸ä¼ 失败"))}finally{Ia(null)}},er=e.useMemo(()=>{if(a>0)return{book:n,chapter:a-1};if(Qa>0){const e=B[Qa-1];return{book:e.name,chapter:e.chapters}}return null},[n,a,Qa]),tr=e.useMemo(()=>{if(Va&&a<Va.chapters)return{book:n,chapter:a+1};if(Qa<B.length-1){return{book:B[Qa+1].name,chapter:0}}return null},[n,a,Va,Qa]),nr=(null==Va?void 0:Va.nameZh)||n,ar=e=>e?dt(function(e){if(!e||"undefined"==typeof DOMParser)return e;const t=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html").body,n=Array.from(t.querySelectorAll("h2"));for(const a of n){const e=(a.textContent||"").trim();if(!an.test(e))continue;let t=a.nextElementSibling;for(;t;){const e=t.tagName.toLowerCase();if("h1"===e||"h2"===e||"hr"===e)break;"blockquote"===e&&t.classList.add("key-verse"),t=t.nextElementSibling}}return t.innerHTML}(nn((e=>{if(!e||"undefined"==typeof DOMParser)return e;const t=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html");
1return t.body.querySelectorAll(".play-ancient").forEach(e=>e.remove()),t.body.querySelectorAll(".ancient-text").forEach(e=>{const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}),t.body.innerHTML})(O(e))))):"",rr=e=>{if(!e)return"";let t=b(e);return t=bn(t),t=function(e){if(!e)return e;const t=-1!==e.indexOf("æ§çº¦èæ¯ï¼");ln.lastIndex=0;const n=ln.test(e);if(ln.lastIndex=0,!t&&!n)return e;let a=e;return t&&(a=a.replace(on,(e,t)=>`<li class="bw-ot-step bw-ot-${rn[t]}"><span class="bw-ot-label">${t}</span>`),a=a.replace(sn,(e,t,n)=>`<ul${dn(t,"bw-ot-steps")}>${n}`)),n&&(a=a.replace(ln,(e,t,n,a,r,o)=>{const s=r?`${r.slice(1)} · `:"";return`<h3${dn(t,"bw-ot-entry")}>${n.trim()}<span class="bw-ot-tag bw-ot-tag-${(e=>/åºéª$/.test(e)||e.startsWith("综å")?"fulfil":"cite")(a)}">${a}</span><span class="bw-ot-src">${s}${o}</span></h3>`})),a}(t),t=f(t,`ã${nr}ã`),P(t,e=>be(e,u()))},or=e.useMemo(()=>{if(!(null==R?void 0:R.sourceMd))return null;const e=zt(R.sourceMd),t=ue(R.sourceMd);return{simple:me(e.contentSimpleMd,e.contentSimpleHtml,t.simple),standard:me(e.contentStandardMd,e.contentStandardHtml,t.standard),advanced:me(e.contentAdvancedMd,e.contentAdvancedHtml,t.advanced),simpleMd:e.contentSimpleMd,standardMd:e.contentStandardMd,simpleHtmlRaw:e.contentSimpleHtml,standardHtmlRaw:e.contentStandardHtml}},[null==R?void 0:R.sourceMd]),[sr,ir]=e.useState(!1),lr=e.useMemo(()=>{if(!sr||!or)return null;const e=e=>P(bn(O(e||"")),e=>be(e,u()));return{simple:e(or.simpleHtmlRaw),standard:e(or.standardHtmlRaw)}},[sr,or]),dr=e.useMemo(()=>({simple:oe((null==or?void 0:or.simpleMd)||""),standard:oe((null==or?void 0:or.standardMd)||"")}),[or]),cr=e.useCallback(async(e,t)=>{},[dr,tn,zn,n,a,In,qn,p,Mn,Ln]);e.useCallback(()=>{const e=xn.current;e&&(e.paused?e.play().then(()=>vn(!0)).catch(()=>{}):(e.pause(),vn(!1)))},[]),e.useEffect(()=>{$n({simple:new Map,standard:new Map})},[n,a]);const hr=(null==or?void 0:or.simple)??"",ur=(null==or?void 0:or.standard)??"",mr=(null==or?void 0:or.advanced)??"",pr=e.useMemo(()=>ar(hr),[hr,u()]),xr=e.useMemo(()=>ar(ur),[ur,u()]),br=e.useMemo(()=>ar(mr),[mr,u()]),fr=e.useMemo(()=>te(rr(pr)),[pr,b,f,nr,u()]),gr=e.useMemo(()=>te(rr(xr)),[xr,b,f,nr,u()]),wr=e.useMemo(()=>function(e,t,n,a){if(!e||!n.length||"undefined"==typeof DOMParser)return e;const r=new Map,o=[];for(const u of n)if("verse"===u.anchorType&&null!=u.verseStart){const e=r.get(u.verseStart)||[];e.push(u),r.set(u.verseStart,e)}else o.push(u);const s=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html"),i=s.body,l=new RegExp(`^\\s*${t}:(\\d+)`),d=e=>{if("BLOCKQUOTE"!==e.tagName)return null;const t=e.querySelector("strong");if(!t)return null;const n=(t.textContent||"").match(l);return n?parseInt(n[1],10):null},c=(e,t,n="verse")=>{const r=s.createElement("div");r.className="bw-related",r.setAttribute("data-bw-related-scope",n),r.setAttribute("contenteditable","false");const o=s.createElement("div");o.className="bw-related-label",o.textContent=t,r.appendChild(o);for(const i of e){const e=s.createElement("button");e.type="button",e.className="bw-related-link",e.setAttribute("data-related-slug",i.slug);const t=s.createElement("span");t.className="bw-related-title",t.textContent=i.title,e.appendChild(t);const n=a(i.category);if(n){const t=s.createElement("span");t.className="bw-related-cat",t.textContent=n,e.appendChild(t)}r.appendChild(e)}return r},h=[];i.querySelectorAll("blockquote").forEach(e=>{const t=d(e);null!=t&&h.push({verse:t,el:e})});for(const[u,m]of r){const e=h.findIndex(e=>e.verse===u);if(-1===e){o.push(...m);continue}const t=h[e].el;let n=t.nextSibling,a=null;for(;n;){if(1===n.nodeType){const e=n;if(null!=d(e)||"H2"===e.tagName||"H3"===e.tagName){a=e;break}}n=n.nextSibling}const r=c(m,"延伸é
读");a&&a.parentNode===t.parentNode?t.parentNode.insertBefore(r,a):t.parentNode.appendChild(r)}return o.length&&i.appendChild(c(o,"æ¬ç« 延伸é
读","chapter")),i.innerHTML}(gr,a,pe,e=>{const t=G.find(t=>t.id===e);return t?p(t.label):""}),[gr,a,pe,p]),kr=e.useMemo(()=>je?function(e,t,n="åæ"){if(!e||!Number.isInteger(t)||t<1||"undefined"==typeof DOMParser)return e;const a=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html"),r=new RegExp(`^\\s*${t}:(\\d+)(?:\\s*[-ââ~]\\s*(\\d+)(?!:))?`);let o=0;
1return a.body.querySelectorAll("blockquote").forEach(e=>{const t=e.querySelector("strong");if(!t)return;const s=(t.textContent||"").match(r);if(!s)return;if(e.querySelector("[data-original-verse]"))return;const i=parseInt(s[1],10),l=s[2]?parseInt(s[2],10):i,d=l>i&&l-i+1<=6?Array.from({length:l-i+1},(e,t)=>i+t):[i],c=t.parentElement||e;d.forEach(e=>{const t=a.createElement("button");t.className="bw-original-chip",t.setAttribute("data-original-verse",String(e)),t.setAttribute("contenteditable","false"),t.setAttribute("type","button"),t.textContent=d.length>1?`${n} ${e}`:n,c.appendChild(t),o+=1})}),o?a.body.innerHTML:e}(wr,a,p("åæ")):wr,[wr,a,p,je]),vr=e.useMemo(()=>te(rr(br)),[br,b,f,nr,u()]),yr=!!(fr||gr||vr),jr=e.useMemo(()=>{if(!Jn)return[];const e=Jn.query.replace(/ã/g," ").split(/\s+/).filter(Boolean);return Array.from(new Set(e.flatMap(e=>[e,ge(e)]))).filter(Boolean)},[Jn]),Zr=e.useMemo(()=>new Set(Bn.simple.keys()),[Bn]),Nr=e.useMemo(()=>new Set(Bn.standard.keys()),[Bn]),{annotations:Cr,create:Er,update:Tr,remove:Fr}=ht({module:"wiki",refKey:R?`${n}:${a}`:null,userId:(null==r?void 0:r.id)??null,enabled:!!R}),Ir="overview"===Tt&&!De&&!!R,{selection:Sr,clear:Ar,liveRange:Dr}=ut({enabled:Ir,containerRef:X}),_r=e.useMemo(()=>{if(!Sr)return null;const e=Dr();if(!e)return null;const t=e.startContainer,n=1===t.nodeType?t:t.parentElement,a=null==n?void 0:n.closest("[data-bible-tier]");if(!a)return null;const r=a.getAttribute("data-bible-tier"),o=mt(a,e);return o&&r?{tier:r,anchor:o}:null},[Sr]),Br=(e,t)=>Cr.find(n=>n.tier===e&&t.mdStart<n.mdEnd&&n.mdStart<t.mdEnd),$r=()=>{var e;const t=i((null==(e=B.find(e=>e.name===n))?void 0:e.nameZh)||n);return a?p("{0} {1} ç« ").replace("{0}",t).replace("{1}",String(a)):t},Lr=e=>lt(p("æå¨è¯»ãç¾å®è§£ç»ã{0}ï¼è¯»å°ã{1}ãè¿å¥è¯ï¼è½å¸®æçè§£ä¸ä¸åï¼"),$r(),e);rt.current=(e,t)=>{const n=Cr.find(t=>t.id===e);n&&Me({annotation:n,rect:t})},e.useEffect(()=>{if(!Cr.length)return;let e="";try{e=sessionStorage.getItem("bct:anno-scroll")||""}catch{}if(!e)return;const t=Cr.find(t=>t.id===e);if(!t)return;try{sessionStorage.removeItem("bct:anno-scroll")}catch{}"simple"===t.tier?Ht(!0):"standard"===t.tier?Gt(!0):"advanced"===t.tier&&Vt(!0);let n=0;const a=()=>{const t=document.querySelector(`.anno-hl[data-anno-id="${e}"]`);if(t){Kn(t),window.setTimeout(()=>{const n=document.querySelector(`.anno-hl[data-anno-id="${e}"]`)||t;n.scrollIntoView({behavior:"smooth",block:"center"}),n.classList.add("anno-flash")},200);try{history.replaceState(history.state,"",window.location.pathname+window.location.search)}catch{}}else n++<30&&window.setTimeout(a,160)};window.setTimeout(a,300)},[Cr.length,n,a]);const Mr=e=>!!Jn&&jr.length>0&&(!Jn.tier||Jn.tier===e),qr=e.useMemo(()=>va(Mr("simple")?Rt(fr,jr):fr),[fr,jr,Jn,Zr]),zr=e.useMemo(()=>va(Mr("standard")?Rt(kr,jr):kr),[kr,jr,Jn,Nr]),Pr=e.useMemo(()=>Mr("advanced")?Rt(vr,jr):vr,[vr,jr,Jn]),Or=e.useMemo(()=>pt(qr,Cr.filter(e=>"simple"===e.tier),new Set,xt),[qr,Cr]),Rr=e.useMemo(()=>pt(zr,Cr.filter(e=>"standard"===e.tier),new Set,xt),[zr,Cr]),Hr=e.useMemo(()=>pt(Pr,Cr.filter(e=>"advanced"===e.tier),new Set,xt),[Pr,Cr]);e.useEffect(()=>{tn&&(mn?Mn(tn.tier,tn.idx,"loading"):gn&&Mn(tn.tier,tn.idx,"playing"))},[qr,zr,mn,gn,tn,Mn]),e.useEffect(()=>{if(!Jn||U||!R||!jr.length)return;if(!document.getElementById("bw-search-mark-style")){const e=document.createElement("style");e.id="bw-search-mark-style",e.textContent='[data-bible-search-mark]{background:#FCF26B;color:#1A1A1A;border-radius:3px;padding:0 1px;}[data-bible-search-mark][data-current="1"]{background:#FFE13D;color:#1A1A1A;box-shadow:0 0 0 1.5px #E8C400;}tspan[data-bible-search-mark]{fill:#1A1A1A;stroke:#FCF26B;stroke-width:3px;stroke-linejoin:round;paint-order:stroke fill;}tspan[data-bible-search-mark][data-current="1"]{stroke:#E8C400;stroke-width:4px;}',document.head.appendChild(e)}const e=[],t=()=>{var e;const t=X.current;if(!t)return;const n=(Jn.tier?t.querySelector(`[data-bible-tier="${Jn.tier}"]`):t)||t;if(null!==n.querySelector("h2")&&!n.querySelector('[data-bw-collapsible="1"]'))return;const r=Array.from(n.querySelectorAll("[data-bible-search-mark]"));if(!r.length)return;On.current=r;let o=Math.min(Wn.current,r.length-1);if(!Rn.current&&Jn.verse){const e=r.findIndex(e=>function(e,t,n,a){let r=e.parentElement;for(;r&&r!==a;){if("BLOCKQUOTE"===r.tagName){const e=r.querySelector("strong, b"),a=((null==e?void 0:e.textContent)||"").trim().match(/^(\d+)\s*[:ï¼]\s*(\d+)[a-z]?(?:\s*[-â,]\s*(\d+))?/);if(a&&parseInt(a[1],10)===n){const e=parseInt(a[2],10),n=a[3]?parseInt(a[3],10):e;return t>=e&&t<=n}return!1}r=r.parentElement}return!1}(e,Jn.verse,a,n));e>=0&&(o=e)}Wn.current=o,Un(e=>e&&e.total===r.length&&e.current===o?e:{total:r.length,current:o}),"1"!==(null==(e=r[o])?void 0:e.getAttribute("data-current"))&&r.forEach((e,t)=>e.setAttribute("data-current",t===o?"1":"0")),Kn(r[o])};let n=0;const r=()=>{if(t(),!Hn.current&&!Rn.current){const e=On.current[Wn.current];e&&e.isConnected&&null!==e.offsetParent&&(e.scrollIntoView({behavior:"auto",block:"center"}),Hn.current=!0)}++n<16&&e.push(setTimeout(r,200))};return e.push(setTimeout(r,250)),()=>{e.forEach(clearTimeout)}},[Jn,U,R,jr,qr,zr,Pr,Yn]);const[Wr,Gr]=e.useState(!1);e.useEffect(()=>{const e=()=>Gr(!0);return window.addEventListener("bcct:wiki-article-search",e),()=>window.removeEventListener("bcct:wiki-article-search",e)},[]);const Ur=e.useMemo(()=>[fr,kr,vr].map(e=>(e||"").replace(/<[^>]+>/g," ")),[fr,kr,vr]),Jr=e.useMemo(()=>{var e;const t=i((null==(e=B.find(e=>e.name===n))?void 0:e.nameZh)||n);return 0===a?`${t} · ${p("导论")}`:`${t} ${a} ${p("ç« ")}`},[n,a,p]),Vr=e.useCallback(e=>
1{const t=fe(e),n=Array.from(new Set([t,ge(t)])).filter(Boolean).map(e=>e.toLowerCase()),a=e=>{const t=e.replace(/<[^>]+>/g," ").toLowerCase();return n.some(e=>e&&t.includes(e))},r=a(fr)?"simple":a(kr)?"standard":a(vr)?"advanced":"simple";"simple"===r?Ht(!0):"standard"===r?Gt(!0):Vt(!0),Rn.current=!1,Hn.current=!1,Wn.current=0,Vn({query:e,tier:r,verse:null})},[fr,kr,vr]),Kr=e.useCallback(e=>{window.dispatchEvent(new CustomEvent("bcct:wiki-whole-search",{detail:{q:e}}))},[]);e.useEffect(()=>{const e=X.current;if(!e)return;const t=t=>{const r=t.target,o=null==r?void 0:r.closest(".lib-scripture-ref");if(o)return t.preventDefault(),t.stopPropagation(),void g(o);null==r||r.closest(".tts-section-btn");const s=null==r?void 0:r.closest("[data-related-slug]");if(s){t.preventDefault();const e=s.getAttribute("data-related-slug");return void(e&&c("libraryArticle",{librarySlug:e}))}const i=null==r?void 0:r.closest("[data-original-verse]");if(i){t.preventDefault();const e=parseInt(i.getAttribute("data-original-verse")||"",10);return void(Number.isInteger(e)&&e>0&&a>0&&ke({book:n,chapter:a,verse:e}))}const l=null==r?void 0:r.closest("a[href]");if(l&&0===t.button&&!t.metaKey&&!t.ctrlKey&&!t.shiftKey&&!t.altKey&&!l.hasAttribute("download")){const e=l.getAttribute("href")||"",n=(e=>{const t=e.trim();if(!t||t.startsWith("#")||/^(mailto|tel|sms):/i.test(t))return null;try{const e=/^museum(\?|#|$)/.test(t)?`/${t}`:t,n="undefined"!=typeof window?window.location.origin:"https://baibaoshu.net",a=new URL(e,n),r="undefined"!=typeof window?window.location.hostname:a.hostname;if(a.hostname!==r&&!xa.has(a.hostname))return null;if("/museum"!==(a.pathname.replace(/\/+$/,"")||"/"))return null;const o=a.searchParams.get("exhibit")||void 0,s=a.searchParams.get("hall")||void 0;return o||s?{museumExhibit:o,museumHall:s}:null}catch{return null}})(e);if(n)return t.preventDefault(),t.stopPropagation(),void(n.museumExhibit?St(n.museumExhibit).then(e=>{e&&Nt(e)}):c("museum",n));const a=(e=>{const t=e.trim();if(!t||t.startsWith("#")||/^(mailto|tel|sms):/i.test(t))return null;try{const e=/^libraryArticle(\?|#|$)/.test(t)?`/${t}`:t,n="undefined"!=typeof window?window.location.origin:"https://baibaoshu.net",a=new URL(e,n),r="undefined"!=typeof window?window.location.hostname:a.hostname;if(a.hostname!==r&&!xa.has(a.hostname))return null;if("/libraryArticle"!==(a.pathname.replace(/\/+$/,"")||"/"))return null;const o=a.searchParams.get("slug")||"";return o?{librarySlug:o,libraryQuery:a.searchParams.get("q")||void 0}:null}catch{return null}})(e);if(a)return t.preventDefault(),t.stopPropagation(),void c("libraryArticle",a)}const d=null==r?void 0:r.closest("button.play-ancient");if(d){t.preventDefault(),t.stopPropagation();const e=d.getAttribute("data-text")||"",n=d.getAttribute("data-lang")||"he-IL";if(!e)return;const a={"he-IL":"he-IL-Wavenet-D","el-GR":"el-GR-Wavenet-A"};return d.classList.add("play-ancient-active"),void ct(e,void 0,()=>d.classList.remove("play-ancient-active"),()=>d.classList.remove("play-ancient-active"),void 0,{voiceName:a[n],languageCode:n,forceGoogle:!0,speakingRate:.85})}const h=null==r?void 0:r.closest(".anno-hl");if(h){t.preventDefault(),t.stopPropagation();const e=h.getAttribute("data-anno-id");return void(e&&rt.current(e,h.getBoundingClientRect()))}const u=null==r?void 0:r.closest("a");if(!u)return;const m=u.getAttribute("href")||"";if(u.classList.contains("wiki-section-link")){t.preventDefault();const n=m.replace("#","");if(!n)return;const a=e.querySelector(`#${CSS.escape(n)}`);a&&a.scrollIntoView({behavior:"smooth",block:"start"})}};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},[fr,gr,vr,cr,g]),e.useEffect(()=>{const e=X.current;if(!e||!Se)return;let t=!1;const n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1,(()=>{const t=Array.from(e.querySelectorAll('[data-md-editable="1"]'));for(const e of t){if(e.querySelector(":scope > .md-edit-pen"))continue;const t=document.createElement("button");t.type="button",t.className="md-edit-pen",t.setAttribute("aria-label","ç¼è¾è¿ä¸æ®µ"),t.title="ç¼è¾è¿ä¸æ®µ",t.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4z"/></svg>',e.appendChild(t)}})()}))};n();const a=setTimeout(n,80),r=setTimeout(n,250),o=new MutationObserver(()=>n());o.observe(e,{childList:!0,subtree:!0});const s=e=>{const t=e.target,n=null==t?void 0:t.closest(".md-edit-pen");if(!n)return;e.preventDefault(),e.stopPropagation();const a=n.parentElement;if(!a)return;const r=Number(a.getAttribute("data-md-start")),o=Number(a.getAttribute("data-md-end")),s=a.getAttribute("data-md-type")||"paragraph";!Number.isFinite(r)||!Number.isFinite(o)||r<0||o<0||vt({start:r,end:o,type:s})};
1return e.addEventListener("click",s,!0),()=>{clearTimeout(a),clearTimeout(r),o.disconnect(),e.removeEventListener("click",s,!0)}},[Se,fr,gr,vr,Ot,Wt,Ut]),e.useEffect(()=>{const e=X.current;if(!e)return;const t=e=>{const t=e.target;if(null==t?void 0:t.closest(".md-edit-pen"))return;const n=null==t?void 0:t.closest(".bw-diagram-wrap");if(!n)return;const a=n.querySelector("svg");if(!a)return;const r=Number((a.getAttribute("viewBox")||"").split(" ")[2])||720;jt({svg:a.outerHTML,w:r})};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},[fr,gr,vr]),e.useEffect(()=>{if(!yt)return;const e=e=>{"Escape"===e.key&&jt(null)};return document.addEventListener("keydown",e),document.body.classList.add("zoom-open"),()=>{document.removeEventListener("keydown",e),document.body.classList.remove("zoom-open")}},[yt]);const Yr=e=>{c("bibleWikiArticle",{bibleWikiBook:e.book,bibleWikiChapter:String(e.chapter)})},Qr="shrink-0 h-10 sm:h-9 inline-flex items-center justify-center gap-1.5 px-3 rounded-lg text-[13px] sm:text-sm text-[#6B6557] hover:bg-[#F0EDE2] hover:text-[#2D2A22] bg-[#FFFCF5] border border-[#E6E2D6] transition-colors whitespace-nowrap";return t.jsxs("div",{className:"min-h-screen bg-[#FAF9F6] dark:bg-[#1A1714]",children:[Ya&&t.jsx("div",{className:"fixed top-0 left-0 right-0 z-[90] h-[3px] bg-transparent pointer-events-none","aria-hidden":"true",children:t.jsx("div",{className:"h-full bg-gradient-to-r from-[#FFA989] to-[#B85138] transition-[width] duration-150 ease-out",style:{width:`${Ka}%`}})}),t.jsx(Dt,{selection:Pt.selection,saving:Pt.saving,onToggle:Pt.toggle}),Sr&&Ir&&t.jsx(bt,{range:Dr()||Sr.range}),Sr&&Ir&&t.jsx(ft,{rect:Sr.rect,canAnnotate:!!_r,onHighlight:e=>{if(_r){const t=Br(_r.tier,_r.anchor);t?Tr(t.id,{color:e}):Er({anchor:_r.anchor,color:e,tier:_r.tier})}Ar()},onNote:()=>{_r&&Sr&&at({mode:"create",quote:Sr.text,color:"yellow",note:"",tier:_r.tier,anchor:_r.anchor}),Ar()},onCopy:()=>{Sr&&kt(Sr.text,p),Ar()},onReportError:()=>{L(Sr.text),Ar()},onAskBond:()=>{Sr&&M(Lr(Sr.text)),Ar()},onMakeCard:()=>{Sr&&tt({quote:Sr.text,source:$r(),track:{module:"wiki",entry:"toolbar"}}),Ar()}}),nt&&t.jsx(Bt,{open:!!nt,mode:nt.mode,quote:nt.quote,initialColor:nt.color,initialNote:nt.note,onSave:(e,t)=>{if(nt){if("create"===nt.mode&&nt.anchor&&nt.tier){const n=Br(nt.tier,nt.anchor);n?Tr(n.id,{color:e,note:t}):Er({anchor:nt.anchor,color:e,note:t,tier:nt.tier})}else"edit"===nt.mode&&nt.annoId&&Tr(nt.annoId,{color:e,note:t});at(null)}},onClose:()=>at(null),onDelete:"edit"===nt.mode&&nt.annoId?()=>{nt.annoId&&Fr(nt.annoId),at(null)}:void 0}),$e&&t.jsx(gt,{annotation:$e.annotation,rect:$e.rect,onChangeColor:e=>{Tr($e.annotation.id,{color:e}),Me(t=>t?{...t,annotation:{...t.annotation,color:e}}:null)},onEditNote:()=>{const e=$e.annotation;at({mode:"edit",quote:e.quote,color:e.color,note:e.note||"",annoId:e.id}),Me(null)},onDelete:()=>{Fr($e.annotation.id),Me(null)},onAskBond:()=>{M(Lr($e.annotation.quote)),Me(null)},onMakeCard:()=>{const e=$e.annotation;tt({quote:e.quote,note:e.note||void 0,source:$r(),track:{module:"wiki",entry:"popover"}}),Me(null)},onClose:()=>Me(null)}),t.jsx(wt,{data:et,onClose:()=>tt(null)}),ve&&Va&&t.jsx(aa,{bookKey:Va.name.toLowerCase().replace(/\s+/g,""),bookZh:Va.nameZh,bookEn:Va.name,chapter:ve.chapter,verse:ve.verse,lang:"NT"===Va.testament?"grc":"hbo",onClose:()=>ke(null)}),sr&&lr&&t.jsx(Xt,{book:n,chapter:a,bookZh:Va?q(Va):n,articleTitle:(null==R?void 0:R.title)||"",simpleHtml:lr.simple,standardHtml:lr.standard,onClose:()=>ir(!1)}),!U&&R&&t.jsx("button",{onClick:()=>ne(!0),"aria-label":p("æ¬ç« ç®å½"),title:p("æ¬ç« ç®å½ï¼è·³å°åå°èï¼"),className:"wiki-left-fab bct-tuck-left fixed left-4 md:left-6 z-40 w-12 h-12 rounded-full flex items-center justify-center bg-[#FFFCF5] text-[#4F7942] border border-[#E6E2D6] transition-all active:scale-95 hover:scale-105 hover:border-[#8FAE6E] shadow-[0_3px_10px_rgba(28,25,23,0.08),0_6px_20px_rgba(28,25,23,0.06)] "+(Se?"bottom-52 md:bottom-56":"bottom-[calc(4.5rem+env(safe-area-inset-bottom,0px))] md:bottom-24"),children:t.jsx(qe,{className:"w-5 h-5"})}),ee&&t.jsxs("div",{className:"fixed inset-0 z-[60]",role:"dialog","aria-modal":"true",children:[t.jsx("div",{className:"absolute inset-0 bg-[rgba(20,18,12,0.45)]",style:{backdropFilter:"blur(2px)",animation:"bwTocFade 0.28s ease"},onClick:()=>ne(!1)}),t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 mx-auto max-w-[560px] bg-[#FFFCF5] rounded-t-[18px] max-h-[82vh] flex flex-col",style:{animation:"bwTocUp 0.32s cubic-bezier(.16,1,.3,1)"},children:[t.jsx("div",{className:"flex-shrink-0 pt-2 pb-1 flex justify-center",children:t.jsx("div",{className:"w-9 h-1 rounded-full bg-[#DDD8CC]"})}),t.jsxs("div",{className:"flex-shrink-0 px-5 py-2.5 flex items-center justify-between bg-[#F4F2EC] rounded-t-[18px]",children:[t.jsx("span",{className:"text-[18px] font-semibold text-slate-800",style:{fontFamily:'"Noto Serif SC", "Source Han Serif SC", serif'},children:p("æ¬ç« ç®å½")}),t.jsx("button",{onClick:()=>ne(!1),"aria-label":p("å
³é"),className:"w-9 h-9 rounded-full hover:bg-[#
1EDE9DD] flex items-center justify-center transition-colors",children:t.jsx(Te,{className:"w-5 h-5 text-slate-600"})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2 pb-6",children:0===ae.length?t.jsx("div",{className:"px-2 py-8 text-center text-[15px] text-slate-500",children:p("æ¬ç« ææ å¯è·³è½¬çå°è")}):ae.map(e=>t.jsx("button",{onClick:()=>{const t=document.getElementById(e.id);null==t||t.scrollIntoView({behavior:"smooth",block:"start"}),ne(!1)},className:"w-full text-left px-3 py-2.5 rounded-xl hover:bg-[#F5F1E8] active:bg-[#EFEAE0] transition-colors text-[16px] text-slate-700 leading-snug",children:e.text},e.id))})]})]}),Se&&(null==R?void 0:R.sourceMd)&&t.jsx("button",{onClick:()=>_e(e=>!e),"aria-pressed":De,"aria-label":p(De?"éåºå ç²æ¨¡å¼":"å¼å¯å ç²æ¨¡å¼"),title:p(De?"éåºå ç²æ¨¡å¼ï¼åç¹ä¸ä¸ï¼":"å¼å¯å ç²æ¨¡å¼ï¼é䏿å â æµ®å±å ç²ï¼"),className:"wiki-left-fab fixed bottom-[calc(4.5rem+env(safe-area-inset-bottom,0px))] left-4 md:bottom-24 md:left-6 z-40 w-12 h-12 rounded-full font-bold text-base flex items-center justify-center transition-all active:scale-95 hover:scale-105 "+(De?"bg-amber-500 text-white shadow-[0_3px_10px_rgba(245,158,11,0.4),0_6px_20px_rgba(28,25,23,0.12)] hover:bg-amber-600":"bg-white text-slate-500 border border-slate-200 shadow-[0_3px_10px_rgba(28,25,23,0.08),0_6px_20px_rgba(28,25,23,0.06)] hover:text-amber-700 hover:border-amber-300"),children:"B"}),Se&&R&&r&&t.jsx("button",{onClick:()=>st(!0),"aria-label":p("ç¼è¾ MD ç身"),title:p("ç¼è¾ MD çèº«ï¼æ´ç¯ Markdownï¼"),className:"wiki-left-fab fixed bottom-[calc(8rem+env(safe-area-inset-bottom,0px))] left-4 md:bottom-40 md:left-6 z-40 w-12 h-12 rounded-full flex items-center justify-center transition-all active:scale-95 hover:scale-105 bg-white text-slate-500 border border-slate-200 shadow-[0_3px_10px_rgba(28,25,23,0.08),0_6px_20px_rgba(28,25,23,0.06)] hover:text-amber-700 hover:border-amber-300",children:t.jsx(ze,{className:"w-5 h-5"})}),Se&&r&&t.jsx(ua,{open:ot,onClose:()=>st(!1),book:n,chapter:a,userId:r.id,onSaved:()=>{F(n,a,{bypassEdge:!0}).then(e=>W(e))}}),Se&&r&&(null==R?void 0:R.sourceMd)&&t.jsx(pa,{open:!!it,onClose:()=>vt(null),sourceMd:R.sourceMd,expectedDbHash:R.sourceMdHash||"",target:it,book:n,chapter:a,userId:r.id,onSaved:e=>{W(t=>t?{...t,sourceMd:e}:t),F(n,a,{bypassEdge:!0}).then(e=>W(e))}}),t.jsx(It,{exhibit:Zt,onClose:()=>Nt(null),onOpenScripture:(e,t,n)=>{Nt(null),c("bibleWikiArticle",{bibleWikiBook:e,bibleWikiChapter:String(t),bibleWikiVerse:n?String(n):void 0})},onOpenPlace:e=>{Nt(null),c("geography",{geoPlace:e})}}),yt&&t.jsxs("div",{className:"fixed inset-0 z-[100] bg-black/80 overflow-auto bw-zoom flex items-center justify-center p-3",onClick:()=>jt(null),role:"dialog","aria-modal":"true",children:[t.jsx("button",{onClick:e=>{e.stopPropagation(),jt(null)},"aria-label":p("å
³é"),className:"fixed top-4 right-4 z-[101] w-11 h-11 rounded-full bg-white text-slate-700 flex items-center justify-center shadow-xl active:scale-95 hover:bg-slate-100",children:t.jsx(Te,{className:"w-5 h-5"})}),t.jsx("div",{onClick:e=>e.stopPropagation(),style:{width:`max(${yt.w}px, 92vw)`},dangerouslySetInnerHTML:{__html:yt.svg}})]}),t.jsx("style",{children:"\n /* éè详解æ¯èæçãåæãå¾½ç« ï¼å
å¶ã䏿¢ç»æ */\n .bw-original-chip {\n display: inline-flex; align-items: center;\n margin-inline-start: 6px; padding: 1px 7px;\n border: 1px solid #E6E2D6; border-radius: 999px;\n background: #FFFCF5; color: #4F7942;\n font-size: 13px; line-height: 1.6; vertical-align: middle;\n cursor: pointer; user-select: none;\n }\n .bw-original-chip:active { background: #E1ECD5; }\n "}),Se&&t.jsx("style",{children:'\n [data-md-editable="1"] {\n position: relative;\n }\n [data-md-editable="1"] > .md-edit-pen {\n position: absolute;\n top: 4px;\n right: 4px;\n width: 22px;\n height: 22px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n border: 1px solid #E6E2D6;\n background: var(--paper-card, #FFFCF5);\n color: #7A4F11;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.12s ease, background 0.12s ease;\n z-index: 5;\n padding: 0;\n line-height: 0;\n }\n [data-md-editable="1"]:hover > .md-edit-pen,\n [data-md-editable="1"] > .md-edit-pen:focus-visible,\n [data-md-editable="1"] > .md-edit-pen:hover {\n opacity: 1;\n }\n [data-md-editable="1"] > .md-edit-pen:hover {\n background: #FFF7E0;\n border-color: #F0E0B0;\n }\n /* æ é¢æå æé®åºä¸ç¬å¾æ ä¼äº right-4pxï¼ç»ç¬å¾æ å¤è®©ä¸äº */\n h2[data-md-editable="1"] > .md-edit-pen,\n h3[data-md-editable="1"] > .md-edit-pen {\n right: 32px;\n }\n'}),C,!o&&t.jsx("div",{className:"sticky top-0 z-10 backdrop-blur-md border-b border-[#
1E6E2D6] dark:border-[#38332A] px-4 py-3 bg-[rgba(250,249,246,0.92)] dark:bg-[rgba(26,23,20,0.92)]",style:{paddingTop:"calc(0.75rem + env(safe-area-inset-top, 0px))"},children:t.jsxs("div",{className:"max-w-5xl mx-auto flex items-center gap-3",children:[t.jsx("button",{onClick:()=>{if(n)try{sessionStorage.setItem("bibleWikiScrollTo",n)}catch{}c("bibleWiki",Va?{bibleWikiTestament:Va.testament}:void 0)},className:"p-1.5 rounded-lg hover:bg-[#F0EDE2] dark:hover:bg-[#2E2920] transition-colors",children:t.jsx(Pe,{className:"w-5 h-5 text-[#6B6557] dark:text-[#B3AC9C]"})}),t.jsx(Oe,{className:"w-5 h-5 text-[#7A4F11] dark:text-[#D9A44B]"}),t.jsxs("h1",{className:"text-lg font-bold text-[#2D2A22] dark:text-[#ECE6D8] truncate",children:[p((null==Va?void 0:Va.nameZh)||n)," ",0===a?p("导论"):p("第{0}ç« ").replace("{0}",String(a))]})]})}),t.jsx("div",{className:"max-w-7xl mx-auto px-3 sm:px-4 py-5 "+(o?"pb-[calc(6rem+env(safe-area-inset-bottom,0px))] md:pb-20":"pb-[calc(6rem+env(safe-area-inset-bottom,0px))] md:pb-24"),children:U?t.jsxs("div",{className:"max-w-5xl mx-auto space-y-4",role:"status","aria-live":"polite",children:[t.jsxs("div",{className:"rounded-2xl border-2 border-[#E6E2D6] bg-[#FFFCF5] px-4 py-4",children:[t.jsxs("div",{className:"flex items-center gap-2 text-[#6B6557]",children:[t.jsx(Ce,{className:"w-4 h-4 animate-spin text-[#4F7942]"}),t.jsxs("span",{className:"text-[15px] font-medium",children:[p("æ£å¨å è½½")," ",p((null==Va?void 0:Va.nameZh)||n)," ",0===a?p("导论"):p("第{0}ç« ").replace("{0}",String(a))]})]}),t.jsxs("div",{className:"mt-4 space-y-2.5 animate-pulse","aria-hidden":!0,children:[t.jsx("div",{className:"h-4 w-3/4 rounded bg-[#EFEAE0]"}),t.jsx("div",{className:"h-4 w-full rounded bg-[#F1ECE1]"}),t.jsx("div",{className:"h-4 w-10/12 rounded bg-[#F1ECE1]"})]})]}),t.jsx("div",{className:"animate-pulse space-y-3","aria-hidden":!0,children:[["#FBE7B6","#E6BA59"],["#EEF7D8","#9CB58A"],["#E4F2FB","#B7D7EA"]].map(([e,n],a)=>t.jsx("div",{className:"rounded-xl overflow-hidden bg-[#FFFCF5]",children:t.jsx("div",{className:"border-l-4 px-4 py-3",style:{backgroundColor:`${e}55`,borderLeftColor:n},children:t.jsx("div",{className:"h-5 w-32 rounded bg-[#EFEAE0]"})})},a))})]}):R||0!==a?t.jsxs(t.Fragment,{children:[(null==R?void 0:R.title)&&t.jsx("h2",{className:"text-xl font-bold text-slate-800 mb-4",children:be(R.title,u())}),t.jsx(fa,{className:"mb-4",children:t.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[t.jsx(Oa,{variant:"top",book:n,chapter:a,currentBook:Va,prev:er,next:tr,isLearned:Wa,zenMode:o,navButtonClass:Qr,goTo:Yr,onOpenChapterPicker:()=>Aa(!0),onOpenScripture:v,onToggleLearned:Ga,onOpenHandout:()=>ir(!0),onShare:Ua}),t.jsxs("div",{className:"flex gap-1 flex-shrink-0 items-center flex-wrap",children:[t.jsxs("button",{type:"button",onClick:()=>c("myAnnotations"),"aria-label":p("æçç¬è®°æ¬"),title:p("æçç¬è®°æ¬"),className:`${Qr} md:hidden`,children:[t.jsx(Oe,{className:"w-4 h-4"}),t.jsx("span",{children:p("æçç¬è®°")})]}),t.jsx(Pa,{className:"md:hidden",isLearned:Wa,onToggle:Ga}),Se&&R&&t.jsx("button",{onClick:async()=>{if(!r||!R||Ct)return;const e="published"===R.status?"draft":"published",t=R.status;W(t=>t?{...t,status:e}:t),Et(!0);const n=await H(r.id,R.id,e);if(Et(!1),!n.success)return W(e=>e?{...e,status:t}:e),void w(n.message||p("忢åå¸ç¶æå¤±è´¥"));E(p("published"===e?"å·²åå¸":"å·²æ¤å为è稿"))},disabled:Ct,title:"published"===R.status?p("ç¹å»æ¤å为è稿"):p("ç¹å»åå¸"),"aria-pressed":"published"===R.status,className:"inline-flex items-center gap-1 px-2 py-0.5 text-[13px] font-medium rounded border transition-colors mr-1 disabled:opacity-60 "+("published"===R.status?"bg-emerald-50 text-emerald-700 border-emerald-300 hover:bg-emerald-100":"bg-amber-100 text-amber-800 border-amber-300 hover:bg-amber-200"),children:"published"===R.status?t.jsxs(t.Fragment,{children:[t.jsx(Re,{className:"w-3 h-3"})," ",p("å·²åå¸")]}):t.jsxs(t.Fragment,{children:[t.jsx(He,{className:"w-3 h-3"})," ",p("æªåå¸")]})}),!o&&t.jsxs("button",{onClick:()=>Ft("overview"),className:"flex items-center gap-1.5 px-3.5 py-2 text-base font-medium rounded-lg transition-all",style:"overview"===Tt?{background:"#C9912E",color:"white"}:{background:"#FBE7B6",color:"#7A4F11"},onMouseEnter:e=>{"overview"!==Tt&&(e.currentTarget.style.background="#F8DC95")},onMouseLeave:e=>{"overview"!==Tt&&(e.currentTarget.style.background="#FBE7B6")},children:[t.jsx(Oe,{className:"w-4 h-4"})," ",p("导è§")]}),!1,t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[t.jsx(We,{className:"w-4 h-4",style:{color:"var(--readable-sage, #4F7942)"}}),t.jsx("span",{className:"text-base font-medium",style:{color:"var(--readable-sage, #4F7942)"},children:p("åæ")}),t.jsx("button",{type:"button",onClick:Ne,role:"switch","aria-checked":je,"aria-label":p("åææ¥è¯å¼å
³"),title:p(je?"å
³éåææ¥è¯":"å¼å¯åææ¥è¯"),className:"relative inline-flex h-6 w-10 items-center rounded-full transition-colors duration-300 flex-shrink-0 "+(je?"bg-[#4F7942]":"bg-[#DED6C8]"),children:t.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform duration-300 "+(je?"translate-x-5":"translate-x-1")})})]})]}),Fe&&t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 rounded-xl px-3 py-2 text-[13px]",style:{background:"#F3F6EC",color:"#3D
15A2D"},children:[t.jsx(We,{className:"w-4 h-4 flex-shrink-0"}),t.jsx("span",{className:"flex-1 min-w-[10rem]",children:p("常çåæçè¯ï¼å¯ä»¥æãå£ç»åæãæ¾å°é¦é¡µï¼éæ¶è¿å¾å»ã")}),t.jsx("button",{type:"button",className:"rounded-lg px-3 py-1 font-medium",style:{background:"#4F7942",color:"#FFFDF7"},onClick:()=>{!function(e){const t=Z();t.includes(e)||N([...t,e]),ca(ra(e,la),"1")}("originalLang"),Ie(!1)},children:p("æ¾å°é¦é¡µ")}),t.jsx("button",{type:"button",className:"rounded-lg px-3 py-1",style:{color:"#6B7A5A"},onClick:()=>{!function(e,t=Date.now()){const n=(Number(da(ra(e,sa)))||0)+1;ca(ra(e,sa),String(n)),n>=2?ca(ra(e,la),"1"):ca(ra(e,ia),String(t+2592e6))}("originalLang"),Ie(!1)},children:p("ä¸ç¨")})]})]})}),"overview"===Tt&&t.jsxs("div",{className:"xl:grid xl:grid-cols-[minmax(0,50rem)_184px] xl:justify-center xl:gap-6 xl:items-start",children:[t.jsx("article",{ref:X,className:"space-y-4 mb-8 min-w-0",children:yr?t.jsxs(t.Fragment,{children:[fr&&t.jsx(Ha,{id:"bwiki-tier-simple",title:p(0===a?"å
¨ä¹¦å¯¼è¯»":"æ¬ç« 导读"),subtitle:p(0===a?"è¿å·ä¹¦ · ä½è
ä¸åä½èæ¯ Â· ç§è
çå¿ Â· åæ":"ä¸ä¸æè · 段è½ç»æ · é¥è · ç§è
çå¿ Â· åæ"),icon:t.jsx(Oe,{className:"w-5 h-5"}),expanded:Ot,onToggle:Yt,bgClass:"bg-[#FFFCF5] dark:bg-[#242019]",borderClass:"border-l-4 border-l-[#E6BA59] dark:border-l-[#8A6E32] bg-[#FBE7B6]/30 dark:bg-[#E6BA59]/10",headerClass:"text-[#7A4F11] dark:text-[#E0C078]",accent:"amber",html:Or,tier:"simple",book:n,chapter:a}),gr&&t.jsx(Ha,{id:"bwiki-tier-standard",title:p(0===a?"å
¨ä¹¦è¯¦è§£":"éè详解"),subtitle:p(0===a?"å
¨ä¹¦ç»æ · 主线èç» Â· æ ¸å¿ä¸»é¢":"段è½ç²¾è§£ · éèéä¹"),icon:t.jsx(Be,{className:"w-5 h-5"}),expanded:Wt,onToggle:Qt,bgClass:"bg-[#FFFCF5] dark:bg-[#242019]",borderClass:"border-l-4 border-l-[#9CB58A] dark:border-l-[#5C7A4A] bg-[#EEF7D8]/50 dark:bg-[#9CB58A]/12",headerClass:"text-[#3D5A2D] dark:text-[#9DCB78]",accent:"emerald",html:Rr,tier:"standard",book:n,chapter:a}),vr&&t.jsx(Ha,{id:"bwiki-tier-advanced",title:p("ç¥å¦è¿æ·±"),subtitle:p(0===a?"å
³é®è¯ · æä½ä¸ä¿®è¾ · ç¥å¦å² · æ°çº¦åå · å¤è¿ä¸":"è¯æ± · ç¥å¦è¦ç¹ · 人ç©åæ · æ°çº¦åå · 主é¢è¿½è¸ª"),icon:t.jsx(Ge,{className:"w-5 h-5"}),expanded:Ut,onToggle:en,bgClass:"bg-[#FFFCF5] dark:bg-[#242019]",borderClass:"border-l-4 border-l-[#B7D7EA] dark:border-l-[#4F6F88] bg-[#E4F2FB]/60 dark:bg-[#B7D7EA]/12",headerClass:"text-[#245B83] dark:text-[#9CC7E8]",accent:"indigo",html:Hr,tier:"advanced",book:n,chapter:a})]}):t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Be,{className:"w-10 h-10 text-slate-500 mx-auto mb-3"}),t.jsx("p",{className:"text-sm text-slate-500",children:p("ææ éç»å
容")})]})},(null==R?void 0:R.sourceMd)??""),t.jsx(za,{hasAnyContent:yr,articleRef:X,chapter:a,simpleExpanded:Ot,standardExpanded:Wt,advancedExpanded:Ut,hasSimple:!!fr,hasStandard:!!gr,hasAdvanced:!!vr,goToTier:e=>{"simple"!==e||Ot||Yt(),"standard"!==e||Wt||Qt(),"advanced"!==e||Ut||en(),window.setTimeout(()=>{var t;null==(t=document.getElementById(`bwiki-tier-${e}`))||t.scrollIntoView({behavior:"smooth",block:"start"})},30)}})]}),"illustrations"===Tt&&t.jsxs("div",{className:"space-y-4 mb-8",children:[Se&&!ba&&oa&&t.jsx("div",{className:"flex justify-end",children:t.jsxs("button",{onClick:()=>{Ca((null==Xn?void 0:Xn.images)?JSON.parse(JSON.stringify(Xn.images)):[]),ga(!0)},className:"flex items-center gap-1 px-3 py-1.5 text-sm text-teal-700 hover:bg-teal-50 rounded-lg border border-teal-200 transition-colors",children:[t.jsx(ze,{className:"w-3.5 h-3.5"})," ",p("ç¼è¾å¾è§£")]})}),ba&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-teal-50 border border-teal-200 rounded-lg p-4",children:[t.jsxs("p",{className:"text-sm text-teal-800 mb-3",children:[t.jsx("strong",{children:p("ç¼è¾æ¨¡å¼ï¼")}),p("ä¸ä¼ å¾çæå¡«åURLï¼è®¾ç½®æ é¢å说æã")]}),t.jsx("div",{className:"space-y-3",children:Na.map((e,n)=>t.jsxs("div",{className:"bg-white rounded-lg border border-slate-200 p-3 flex gap-3 items-start",children:[t.jsx("div",{className:"text-slate-500 pt-2",children:t.jsx(Ue,{className:"w-4 h-4"})}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{type:"text",value:e.url,onChange:e=>{const t=[...Na];t[n]={...t[n],url:e.target.value},Ca(t)},placeholder:p("å¾ç URLï¼æç¹å³ä¾§ä¸ä¼ ï¼"),className:"flex-1 px-3 py-2 border border-slate-300 rounded-lg text-sm"}),t.jsxs("label",{className:"flex items-center gap-1 px-3 py-2 rounded-lg text-sm font-medium cursor-pointer transition-colors "+(Fa===n?"bg-slate-100 text-slate-500 cursor-wait":"bg-teal-50 text-teal-700 hover:bg-teal-100 border border-teal-200"),children:[Fa===n?t.jsx(Ce,{className:"w-4 h-4 animate-spin"}):t.jsx(Je,{className:"w-4 h-4"}),t.jsx("span",{className:"hidden sm:inline",children:p(Fa===n?"ä¸ä¼ ä¸":"ä¸ä¼ ")}),t.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:null!==Fa,onChange:e=>{var t;const a=null==(t=e.target.files)?void 0:t[0];
1a&&Xa(n,a),e.target.value=""}})]})]}),t.jsx("input",{type:"text",value:e.title,onChange:e=>{const t=[...Na];t[n]={...t[n],title:e.target.value},Ca(t)},placeholder:p("æ é¢ï¼å¦ï¼ä»¥è²ååºåå路线å¾ï¼"),className:"w-full px-3 py-2 border border-slate-300 rounded-lg text-sm"}),t.jsx("input",{type:"text",value:e.description||"",onChange:e=>{const t=[...Na];t[n]={...t[n],description:e.target.value},Ca(t)},placeholder:p("说æï¼å¯éï¼"),className:"w-full px-3 py-2 border border-slate-300 rounded-lg text-sm"}),e.url&&t.jsx("img",{src:e.url,alt:e.title,className:"max-h-32 rounded-lg border border-slate-200 object-contain"})]}),t.jsx("button",{onClick:()=>Ca(Na.filter((e,t)=>t!==n)),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:t.jsx(Ve,{className:"w-4 h-4"})})]},n))}),t.jsxs("div",{className:"mt-3 flex gap-2",children:[t.jsxs("button",{onClick:()=>Ca([...Na,{url:"",title:"",description:""}]),className:"flex-1 flex items-center gap-1 px-3 py-2 text-sm text-teal-700 hover:bg-teal-100 rounded-lg border border-dashed border-teal-300 transition-colors justify-center",children:[t.jsx(Ke,{className:"w-4 h-4"})," ",p("æ·»å ï¼å¡«URLï¼")]}),t.jsxs("label",{className:"flex-1 flex items-center gap-1 px-3 py-2 text-sm text-teal-700 hover:bg-teal-100 rounded-lg border border-dashed border-teal-300 transition-colors justify-center cursor-pointer",children:[t.jsx(Je,{className:"w-4 h-4"})," ",p("ä¸ä¼ å¾ç"),t.jsx("input",{type:"file",accept:"image/*",multiple:!0,className:"hidden",disabled:null!==Fa,onChange:async e=>{const t=e.target.files;if(t&&0!==t.length){for(const e of Array.from(t)){const t=Na.length;Ca(t=>[...t,{url:"",title:e.name.replace(/\.[^.]+$/,"").replace(/[_-]/g," "),description:""}]),await Xa(t,e)}e.target.value=""}}})]})]})]}),t.jsxs("div",{className:"flex justify-end gap-3",children:[t.jsxs("button",{onClick:()=>ga(!1),className:"px-4 py-2 text-sm text-slate-600 hover:bg-slate-100 rounded-lg border border-slate-300",children:[t.jsx(Te,{className:"w-4 h-4 inline mr-1"}),p("åæ¶")]}),t.jsxs("button",{onClick:async()=>{if(!r)return;Za(!0);const e=await qt(r.id,n,a,Na.filter(e=>e.url.trim()));if(Za(!1),e.success){E(p("ä¿åæå")),ga(!1);const e=await Lt(n,a);ea(e)}else w(e.message||p("ä¿å失败"))},disabled:ya,className:"flex items-center gap-2 px-5 py-2 bg-teal-600 hover:bg-teal-700 text-white rounded-lg text-sm font-medium disabled:opacity-50",children:[ya?t.jsx(Ce,{className:"w-4 h-4 animate-spin"}):t.jsx(Le,{className:"w-4 h-4"}),p("ä¿å")]})]})]}),!ba&&(ta?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Ce,{className:"w-6 h-6 animate-spin text-teal-500"})}):Xn&&Xn.images.length>0?t.jsx("div",{className:"space-y-6",children:Xn.images.map((e,n)=>t.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 overflow-hidden shadow-sm",children:[t.jsx("div",{className:"cursor-zoom-in",onClick:()=>Ta(e.url),children:t.jsx("img",{src:e.url,alt:e.title,className:"w-full object-contain max-h-[70vh]",loading:"lazy"})}),t.jsxs("div",{className:"px-4 py-3 text-center",children:[t.jsx("h3",{className:"font-semibold text-slate-800 text-[15px]",children:e.title}),e.description&&t.jsx("p",{className:"text-sm text-slate-600 mt-1 leading-relaxed",children:e.description})]})]},n))}):t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Ee,{className:"w-10 h-10 text-slate-500 mx-auto mb-3"}),t.jsx("p",{className:"text-sm text-slate-500",children:p("ææ å¾è§£å
容")})]})),Ea&&t.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4",onClick:()=>Ta(null),children:[t.jsx("button",{className:"absolute top-4 right-4 text-white/80 hover:text-white p-2",onClick:()=>Ta(null),children:t.jsx(Te,{className:"w-6 h-6"})}),t.jsx("img",{src:Ea,alt:"",className:"max-w-full max-h-full object-contain rounded-lg",onClick:e=>e.stopPropagation()})]})]}),t.jsx(fa,{children:t.jsx(Jt,{book:n,chapter:a,bookZh:(null==Va?void 0:Va.nameZh)||n,onReady:Q},`chapter-next-step-${n}-${a}`)}),t.jsx(fa,{children:t.jsx("div",{className:"flex justify-between pt-4 border-t border-slate-200",children:t.jsx(Oa,{book:n,chapter:a,currentBook:Va,prev:er,next:tr,isLearned:Wa,zenMode:o,navButtonClass:Qr,goTo:Yr,onOpenChapterPicker:()=>Aa(!0),onOpenScripture:v,onToggleLearned:Ga,onOpenHandout:()=>ir(!0),onShare:Ua})})})]}):t.jsxs("div",{className:"text-center py-20",children:[t.jsx(Be,{className:"w-12 h-12 text-slate-500 mx-auto mb-4"}),t.jsxs("h3",{className:"text-lg font-semibold text-slate-500 mb-2",children:[p((null==Va?void 0:Va.nameZh)||n)," ",0===a?p("导论"):p("第{0}ç« ").replace("{0}",String(a))]}),t.jsx("p",{className:"text-sm text-slate-500 mb-6",children:p("ææ éç»å
容")}),t.jsx("div",{className:"flex justify-center",children:t.jsx(Oa,{book:n,chapter:a,currentBook:Va,prev:er,next:tr,isLearned:Wa,zenMode:o,navButtonClass:Qr,goTo:Yr,onOpenChapterPicker:()=>Aa(!0),onOpenScripture:v,onToggleLearned:Ga,onOpenHandout:()=>ir(!0),onShare:Ua})})]})}),!U&&R&&Va&&!ee&&!Sa&&t.jsx(Ra,{book:n,chapter:a,currentBook:Va,mobileNavAboveOverlay:m,allBooksOpen:h,scriptureOpen:j,handoutOpen:sr,canOpenHandout:!!or,onCloseAllBooks:d,onOpenAllBooks:()=>{l?l():Aa(!0)},onCloseScripture:y,onSetHandoutOpen:ir,onSetChapterPickerOpen:Aa,onOpenScripture:v}),Sa&&Va&&t.jsxs(t.Fragment,{children:[t.jsx("style",{children:"\n @keyframes chpicker-slide-up {\n from { transform: translateX(-50%) translateY(100%); }\n to { transform: translateX(-50%) translateY(0); }\n }\n @keyframes chpicker-fade-in { from { opacity: 0; } to { opacity: 1; } }\n "}),t.jsx("div",{className:"fixed inset-0 z-[60]",style:{background:"rgba(20, 18, 12, 0.45)",backdropFilter:"blur(2px)",animation:"chpicker-fade-in 0.25s ease-out"},onClick:()=>Aa(!1),"aria-hidden":"true"}),t.jsxs("aside",{className:"fixed bottom-0 left-1/2 w-full max-w-[440px] z-[70] bg-[#FAF9F6] rounded-t-3xl max-h-[82vh] flex flex-col shadow-2xl",style:{transform:"translateX(-50%)",animation:"chpicker-slide-up 0.32s cubic-bezier(0.16, 1, 0.3, 1)"},onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":p("éæ©ç« è"),children:[t.jsxs("header",{className:"px-5 pt-2.5 pb-3 border-b border-stone-200/60 flex-shrink-0",children:[t.jsx("button",{type:"button",onClick:()=>Aa(!1),"aria-label":p("å
³é"),className:"block w-9 h-1 bg-stone-300 rounded-full mx-auto mb-3 hover:bg-stone-400 transition-colors"}),t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("h3",{className:"text-[16px] font-medium text-slate-800 tracking-[0.04em] m-0 truncate",style:{fontFamily:'"Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif'},children:[q(Va)," · ",p("éæ©ç« è")]}),t.jsx("button",{type:"button",onClick:()=>{Aa(!1),l?l():c("bibleWiki")},className:"flex-shrink-0 inline-flex items-center px-3 py-1.5 rounded-full text-[13px] font-medium border border-stone-200 bg-white text-slate-600 hover:bg-stone-50 hover:text-slate-800 transition-colors",style:{fontFamily:'"Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif'},children:p("å
¨é¨ä¹¦å·")})]})]}),t.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:t.jsxs("div",{className:"grid grid-cols-6 sm:grid-cols-8 gap-1.5",children:[(()=>{const e=Da.has(0),r=Ba.has(`${n}:0`),o=La.has(`${n}:0`);return t.jsxs("button",{onClick:e?()=>{Aa(!1),Yr({book:n,chapter:0})}:void 0,disabled:!e,className:`relative col-span-2 h-9 rounded-lg text-[13px] font-medium border transition-colors ${e?"bg-[#CFE0BB] text-[#3D5A2D] border-[#8FAE6E] hover:bg-[#BED4A4]":"bg-[#F5F1E8] text-[#64748B] border-[#
1E6E2D6] cursor-default"} ${0===a?"ring-2 ring-[#3D5A2D]":""}`,children:[p("导论"),r?t.jsx("span",{className:"absolute -bottom-1 -right-1 w-3.5 h-3.5 rounded-full bg-[#3D5A2D] ring-2 ring-[#FAF9F6] dark:ring-[#1A1714] flex items-center justify-center",children:t.jsx(Ye,{className:"w-2.5 h-2.5 text-white",strokeWidth:3.5})}):o&&t.jsx("span",{className:"absolute -bottom-1 -right-1 w-2 h-2 rounded-full bg-[#7A9C5E] dark:bg-[#9CB58A] ring-2 ring-[#FAF9F6] dark:ring-[#1A1714]",title:p("读è¿")})]})})(),Array.from({length:Va.chapters},(e,t)=>t+1).map(e=>{const r=Da.has(e),o=Ba.has(`${n}:${e}`),s=La.has(`${n}:${e}`);return t.jsxs("button",{onClick:r?()=>{Aa(!1),Yr({book:n,chapter:e})}:void 0,disabled:!r,className:`relative h-9 rounded-lg text-[13px] font-medium border transition-colors ${r?"bg-[#CFE0BB] text-[#3D5A2D] border-[#8FAE6E] hover:bg-[#BED4A4]":"bg-[#F5F1E8] text-[#64748B] border-[#E6E2D6] cursor-default"} ${a===e?"ring-2 ring-[#3D5A2D]":""}`,children:[e,o?t.jsx("span",{className:"absolute -bottom-1 -right-1 w-3.5 h-3.5 rounded-full bg-[#3D5A2D] ring-2 ring-[#FAF9F6] dark:ring-[#1A1714] flex items-center justify-center",children:t.jsx(Ye,{className:"w-2.5 h-2.5 text-white",strokeWidth:3.5})}):s&&t.jsx("span",{className:"absolute -bottom-1 -right-1 w-2 h-2 rounded-full bg-[#7A9C5E] dark:bg-[#9CB58A] ring-2 ring-[#FAF9F6] dark:ring-[#1A1714]",title:p("读è¿")})]},e)})]})})]})]}),t.jsx(wn,{open:Wr,onClose:()=>Gr(!1),chapterLabel:Jr,tierPlainTexts:Ur,onHighlightInChapter:Vr,onWholeBibleSearch:Kr}),Gn&&Gn.total>0&&t.jsxs("div",{className:"fixed left-1/2 -translate-x-1/2 z-[80] flex items-center gap-0.5 pl-3 pr-1.5 py-1.5 rounded-full bg-white/95 backdrop-blur border border-stone-200 shadow-lg",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 16px)"},children:[t.jsxs("span",{className:"text-[13px] text-slate-600 tabular-nums mr-1",children:[Gn.current+1,"/",Gn.total]}),t.jsx("button",{type:"button",onClick:()=>Yn(Gn.current-1),"aria-label":p("ä¸ä¸å¤"),className:"w-8 h-8 rounded-full flex items-center justify-center text-slate-600 hover:bg-slate-100 transition-colors",children:t.jsx(Qe,{className:"w-4 h-4"})}),t.jsx("button",{type:"button",onClick:()=>Yn(Gn.current+1),"aria-label":p("ä¸ä¸å¤"),className:"w-8 h-8 rounded-full flex items-center justify-center text-slate-600 hover:bg-slate-100 transition-colors",children:t.jsx(Xe,{className:"w-4 h-4"})}),t.jsx("span",{className:"w-px h-5 bg-stone-200 mx-0.5"}),t.jsx("button",{type:"button",onClick:Qn,"aria-label":p("å
³é"),className:"w-8 h-8 rounded-full flex items-center justify-center text-slate-500 hover:bg-slate-100 transition-colors",children:t.jsx(Te,{className:"w-4 h-4"})})]}),false]})};function ja(e){if(!isFinite(e)||e<0)return"0:00";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,"0")}`}function Za(e,t){if("1"===e.dataset.bwCollapsible)return;const n=[];let a=e.nextElementSibling;for(;a&&!t(a);)n.push(a),a=a.nextElementSibling;if(e.dataset.bwCollapsible="1",0===n.length)return;const r=document.createElement("div");r.className=`bw-collapsible-content bw-collapsible-content-${e.tagName.toLowerCase()}`,r.style.display="none",n.forEach(e=>r.appendChild(e)),e.insertAdjacentElement("afterend",r),e.style.cursor="pointer",e.style.userSelect="none",e.style.position="relative",e.style.paddingRight="44px","H2"===e.tagName?(e.style.marginTop="24px",e.style.marginBottom="8px"):"H3"===e.tagName&&(e.style.marginTop="14px",e.style.marginBottom="6px");const o=document.createElement("button");o.type="button",o.className="bw-collapse-indicator",o.dataset.state="collapsed",o.setAttribute("aria-label",W("å±å¼ææ¶èµ·æ¬æ®µ")),o.title=W("å±å¼ææ¶èµ·æ¬æ®µ"),o.innerHTML=Ta;const s="H2"===e.tagName||"H3"===e.tagName?"top:50%;transform:translateY(-50%);":"top:14px;";o.style.cssText=`position:absolute;${s}right:12px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;color:currentColor;opacity:0.7;flex-shrink:0;border:0;background:transparent;padding:0;cursor:pointer;touch-action:manipulation;`,e.appendChild(o)}
1const Na=/^\d+\s*:\s*\d+[a-z]?(?:\s*[â\-,]\s*\d+[a-z]?)*(?=$|\s|["'ââãã])/i,Ca=/^\d+\s*:\s*\d+[a-z]?(?:\s*[â\-,]\s*\d+[a-z]?)*\s*$/i;function Ea(e){const t=e.firstElementChild,n=t&&"P"===t.tagName?t:e,a=(n.textContent||"").replace(/\s+/g," ").trim();if(Na.test(a))return!0;const r=n.querySelector("strong, b");if(r){const e=n.firstChild;if(e&&e.nodeType===Node.TEXT_NODE){if((e.textContent||"").trim().length>0)return!1}const t=(r.textContent||"").trim();if(Ca.test(t))return!0}return Na.test(a)}const Ta='<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>',Fa='<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"></polyline></svg>',Ia=(e,t)=>`bwiki-collapsible-${e}-${t}`,Sa=(e,t)=>{try{const n=sessionStorage.getItem(Ia(e,t));return n?JSON.parse(n):{}}catch{return{}}},Aa=(e,t,n,a)=>{const r=Sa(t,n);if("simple"===a&&void 0===r[a]){const t=e.querySelector("h2");return new Set(t?[_a(t)]:[])}return new Set(r[a]||[])},Da=(e,t,n,a)=>{try{const r=Sa(e,t);r[n]=a,sessionStorage.setItem(Ia(e,t),JSON.stringify(r))}catch{}},_a=e=>fe((e.textContent||"").trim()).slice(0,80),Ba=e=>{const t=e.nextElementSibling;(null==t?void 0:t.classList.contains("bw-collapsible-content"))&&(t.style.display="");const n=e.querySelector(".bw-collapse-indicator");n&&(n.innerHTML=Fa,n.dataset.state="expanded"),"BLOCKQUOTE"===e.tagName&&(e.style.borderLeftColor="transparent")},$a=e=>{const t=e.nextElementSibling;(null==t?void 0:t.classList.contains("bw-collapsible-content"))&&(t.style.display="none");const n=e.querySelector(".bw-collapse-indicator");n&&(n.innerHTML=Ta,n.dataset.state="collapsed"),"BLOCKQUOTE"===e.tagName&&(e.style.borderLeftColor="")},La=(e,t)=>{Array.from(e.querySelectorAll("blockquote")).forEach(e=>{Ea(e)&&(Za(e,e=>"chapter"===e.dataset.bwRelatedScope||("H2"===e.tagName||"H3"===e.tagName||"BLOCKQUOTE"===e.tagName&&Ea(e))),(null==t?void 0:t.has(_a(e)))&&Ba(e))})},Ma=(e,t)=>{Array.from(e.querySelectorAll("h2")).forEach(e=>{Za(e,e=>"H2"===e.tagName),(null==t?void 0:t.has(_a(e)))&&Ba(e)});Array.from(e.querySelectorAll("h3")).forEach(e=>{Za(e,e=>"H2"===e.tagName||"H3"===e.tagName),(null==t?void 0:t.has(_a(e)))&&Ba(e)})};function qa(e,t,n,a,r){const o=!(!n||"number"!=typeof a||!t);let s=null,i=!1,l=null,d=!1,c=0,h=!1;const u=e=>{const t=e.touches[0];if(!t)return;const n=e.target;s={x:t.clientX,y:t.clientY},i=!1,c=0,h=!!(null==n?void 0:n.closest('[data-bw-collapsible="1"]'))},m=e=>{if(!s)return;const t=e.touches[0];t&&Math.hypot(t.clientX-s.x,t.clientY-s.y)>8&&(i=!0,h=!1)},p=e=>{const t=e.target;l={x:e.clientX,y:e.clientY},d=!1,c=0,h=!!(null==t?void 0:t.closest('[data-bw-collapsible="1"]'))},x=e=>{l&&Math.hypot(e.clientX-l.x,e.clientY-l.y)>8&&(d=!0,h=!1)},b=()=>{c=Date.now()+800,h=!1},f=u=>{if(Date.now()<c||i||d)return s=null,i=!1,l=null,d=!1,c=0,void(h=!1);const m=u.target;if(!m)return;const p=m.closest(".bw-collapse-indicator");if(m.closest("a, button, input, textarea, .lib-scripture-ref, .anno-hl")&&!p)return;const x=m.closest('[data-bw-collapsible="1"]');if(!x||!e.contains(x))return;const b=x.nextElementSibling;if(!b||!b.classList.contains("bw-collapsible-content"))return;const f="none"!==b.style.display;if(f&&!h)return;b.style.display=f?"none":"";const g=x.querySelector(".bw-collapse-indicator");g&&(g.innerHTML=f?Ta:Fa,g.dataset.state=f?"collapsed":"expanded"),"BLOCKQUOTE"===x.tagName&&(x.style.borderLeftColor=f?"":"transparent"),(()=>{if(!o)return;const r=[];Array.from(e.querySelectorAll('[data-bw-collapsible="1"]')).forEach(e=>{const t=e.querySelector(".bw-collapse-indicator");"expanded"===(null==t?void 0:t.dataset.state)&&r.push(_a(e))}),Da(n,a,t,r)})(),null==r||r(),h=!1};return e.addEventListener("touchstart",u,{passive:!0}),e.addEventListener("touchmove",m,{passive:!0}),e.addEventListener("pointerdown",p,{passive:!0}),e.addEventListener("pointermove",x,{passive:!0}),e.addEventListener("wheel",b,{passive:!0}),e.addEventListener("click",f),()=>{e.removeEventListener("touchstart",u),e.removeEventListener("touchmove",m),e.removeEventListener("pointerdown",p),e.removeEventListener("pointermove",x),e.removeEventListener("wheel",b),e.removeEventListener("click",f)}}const za=({hasAnyContent:n,articleRef:a,chapter:r,simpleExpanded:o,standardExpanded:i,advancedExpanded:l,hasSimple:d,hasStandard:c,hasAdvanced:h,goToTier:u})=>{const m=s(),[p,x]=e.useState(null);if(e.useLayoutEffect(()=>{if(!n)return;let e=0;const t=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{var e;const t=document.querySelector(".online-users-sidebar"),n=t?window.getComputedStyle(t):null,r=t&&"none"!==(null==n?void 0:n.display)?t.getBoundingClientRect():null,o=((null==r?void 0:r.left)||window.innerWidth)-184-24,s=null==(e=a.current)?void 0:e.getBoundingClientRect(),i=s?s.right+24:o;x(Math.max(16,Math.min(i,o)))})};t();const r=[window.setTimeout(t,120),window.setTimeout(t,500)];return window.addEventListener("resize",t),()=>{cancelAnimationFrame(e),r.forEach(window.clearTimeout),window.removeEventListener("resize",t)}},[n,a]),!n)return null;const b=[{key:"simple",label:m(0===r?"å
¨ä¹¦å¯¼è¯»":"æ¬ç« 导读"),hint:m(0===r?"èæ¯ · ç»æ · åæ":"èç» Â· é¥è · åæ"),color:"#7A4F11",bg:"#FFF7E0",border:"#E6BA59",active:o,show:d},{key:"standard",label:m(0===r?"å
¨ä¹¦è¯¦è§£":"éè详解"),hint:m(0===r?"ç»æ · 主线":"æ®µè½ Â· éä¹"),color:"#3D
15A2D",bg:"#F0F7E6",border:"#CFE0BB",active:i,show:c},{key:"advanced",label:m("ç¥å¦è¿æ·±"),hint:m("è¯æ± · ä¸»é¢ Â· åå"),color:"#245B83",bg:"#E4F2FB",border:"#B7D7EA",active:l,show:h}].filter(e=>e.show);return t.jsx("aside",{className:"hidden xl:block fixed top-24 z-[9] w-[184px] max-h-[calc(100vh-7rem)] overflow-y-auto",style:null==p?{visibility:"hidden"}:{left:`${p}px`},children:t.jsxs("div",{className:"border-l border-[#E6E2D6] pl-4 py-1",children:[t.jsx("div",{className:"text-[13px] text-slate-500 mb-2",children:m("æ¬ç« ç®å½")}),t.jsx("div",{className:"space-y-1.5",children:b.map(e=>t.jsxs("button",{type:"button",onClick:()=>u(e.key),className:"w-full text-left rounded-lg border px-3 py-2 transition-colors hover:brightness-[0.98]",style:{backgroundColor:e.bg,borderColor:e.active?e.border:"transparent",boxShadow:e.active?`inset 3px 0 0 ${e.border}`:void 0,color:e.color},"aria-pressed":e.active,children:[t.jsx("span",{className:"block text-[14px] font-medium leading-5",children:e.label}),t.jsx("span",{className:"block text-[13px] leading-4 mt-0.5 opacity-75",children:e.hint})]},e.key))})]})})},Pa=({className:e="",isLearned:n,onToggle:a})=>{const r=s();return t.jsxs("button",{type:"button",onClick:a,"aria-pressed":n,title:r(n?"åæ¶æ¶è":"æ¶èæ¬ç« "),className:`shrink-0 h-10 sm:h-9 inline-flex items-center justify-center gap-1.5 px-3 rounded-lg text-[13px] sm:text-sm border transition-colors whitespace-nowrap ${n?"bg-[#CFE0BB] text-[#3D5A2D] border-[#8FAE6E] hover:bg-[#BED4A4]":"bg-[#FFFCF5] text-[#6B6557] border-[#E6E2D6] hover:bg-[#F0EDE2] hover:text-[#2D2A22]"} ${e}`,children:[t.jsx(Ye,{className:"w-4 h-4",strokeWidth:n?2.5:2}),t.jsx("span",{children:r(n?"å·²æ¶è":"æ¶èæ¬ç« ")})]})},Oa=({variant:e="bottom",book:n,chapter:a,currentBook:r,prev:o,next:i,isLearned:l,zenMode:d,navButtonClass:h,goTo:u,onOpenChapterPicker:m,onOpenScripture:p,onToggleLearned:x,onOpenHandout:b,onShare:f})=>{const g=s(),w="top"===e,k=0===a?1:a;return t.jsxs("div",{className:(w?"hidden md:flex":"flex")+" items-center gap-2 w-full sm:w-auto flex-wrap",children:[!w&&(o?t.jsxs("button",{onClick:()=>u(o),className:h,title:0===o.chapter?g("导论"):g("ä¸ä¸ç« "),children:[t.jsx(Pe,{className:"w-4 h-4"}),t.jsx("span",{children:0===o.chapter?g("导论"):g("ä¸ä¸ç« ")})]}):t.jsx("div",{})),!w&&(i?t.jsxs("button",{onClick:()=>u(i),className:h,title:0===i.chapter?g("导论"):g("ä¸ä¸ç« "),children:[t.jsx("span",{children:0===i.chapter?g("导论"):g("ä¸ä¸ç« ")}),t.jsx(et,{className:"w-4 h-4"})]}):t.jsx("div",{})),r&&t.jsxs("button",{onClick:m,className:`${h} ${w?"":"max-md:hidden"}`,title:g("å
¨é¨ç« è"),children:[t.jsx(tt,{className:"w-4 h-4"}),t.jsx("span",{children:g("å
¨é¨")})]}),r&&R()&&t.jsxs("button",{onClick:()=>p({book:n,chapter:k,bookZh:q(r),mode:"chapter"}),className:`${h} ${w?"":"max-md:hidden"}`,title:g("读æ¬ç« ç»æ"),children:[t.jsx(nt,{className:"w-4 h-4"}),t.jsx("span",{children:g("æ¬ç« ç»æ")})]}),!w&&t.jsxs("button",{onClick:x,title:g(l?"åæ¶æ¶è":"æ¶èæ¬ç« "),className:"max-md:hidden shrink-0 h-10 sm:h-9 md:inline-flex items-center justify-center gap-1.5 px-3 rounded-lg text-[13px] sm:text-sm border transition-colors whitespace-nowrap "+(l?"bg-[#CFE0BB] text-[#3D5A2D] border-[#8FAE6E] hover:bg-[#BED4A4]":"bg-[#FFFCF5] text-[#6B6557] border-[#E6E2D6] hover:bg-[#F0EDE2] hover:text-[#2D2A22]"),children:[t.jsx(Ye,{className:"w-4 h-4",strokeWidth:l?2.5:2}),t.jsx("span",{children:g(l?"å·²æ¶è":"æ¶èæ¬ç« ")})]}),t.jsxs("button",{onClick:b,title:g("æ¥ç»è®²ä¹ï¼æå° / å PDF / 讨论é¢ï¼"),className:`${h} ${w?"":"max-md:hidden"}`,children:[t.jsx(Be,{className:"w-4 h-4"}),t.jsx("span",{children:g("æ¥ç»è®²ä¹")})]}),t.jsxs("button",{onClick:()=>c("myAnnotations"),title:g("æçç¬è®°æ¬"),className:`${h} ${w?"":"max-md:hidden"}`,children:[t.jsx(Oe,{className:"w-4 h-4"}),t.jsx("span",{children:g("æçç¬è®°")})]}),!w&&!d&&t.jsxs("button",{onClick:f,title:g("å享ç»å¼å
å§å¦¹"),className:h,children:[t.jsx(at,{className:"w-4 h-4"}),t.jsx("span",{children:g("å享")})]})]})},Ra=({book:e,chapter:n,currentBook:a,mobileNavAboveOverlay:r,allBooksOpen:o,scriptureOpen:i,handoutOpen:l,canOpenHandout:d,onCloseAllBooks:c,onOpenAllBooks:h,onCloseScripture:u,onSetHandoutOpen:m,onSetChapterPickerOpen:p,onOpenScripture:x})=>{const b=s(),f=!!a&&!!R(),g=0===n?1:n;return t.jsx("nav",{className:`fixed inset-x-0 bottom-0 ${r?"z-[80]":"z-30"} md:hidden`,"aria-label":b("主导èª"),children:t.jsxs("div",{className:"grid grid-cols-3 border-t border-stone-200/70 bg-[#FAF9F6]",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[t.jsxs("button",{type:"button",onClick:()=>{o?null==c||c():(u(),m(!1),h())},"aria-pressed":o,"aria-label":b("å
¨é¨ç« è"),title:b("å
¨é¨ç« è"),className:"flex min-h-[56px] flex-col items-center justify-center gap-1 py-2 text-[13px] font-semibold tracking-[0.02em] text-[#6B6557] transition-colors hover:text-[#3D5A2D]",children:[t.jsx(tt,{className:"h-[22px] w-[22px]",strokeWidth:2}),t.jsx("span",{children:b("å
¨é¨")}
1)]}),t.jsxs("button",{type:"button",onClick:()=>{if(f&&a){if(i)return void u();m(!1),p(!1),null==c||c(),x({book:e,chapter:g,bookZh:q(a),mode:"chapter",presentation:"wiki-mobile-nav"})}},disabled:!f,"aria-pressed":i,"aria-label":b("æ¬ç« ç»æ"),title:b("读æ¬ç« ç»æ"),className:"flex min-h-[56px] flex-col items-center justify-center gap-1 py-2 text-[13px] font-semibold tracking-[0.02em] text-[#6B6557] transition-colors hover:text-[#3D5A2D] disabled:cursor-not-allowed disabled:text-slate-300",children:[t.jsx(nt,{className:"h-[22px] w-[22px]",strokeWidth:2}),t.jsx("span",{children:b("æ¬ç« ç»æ")})]}),t.jsxs("button",{type:"button",onClick:()=>{l?m(!1):(u(),p(!1),null==c||c(),m(!0))},disabled:!d,"aria-pressed":l,"aria-label":b("æ¥ç»è®²ä¹"),title:b("æ¥ç»è®²ä¹ï¼æå° / å PDF / 讨论é¢ï¼"),className:"flex min-h-[56px] flex-col items-center justify-center gap-1 py-2 text-[13px] font-semibold tracking-[0.02em] text-[#6B6557] transition-colors hover:text-[#3D5A2D] disabled:cursor-not-allowed disabled:text-slate-300",children:[t.jsx(Be,{className:"h-[22px] w-[22px]",strokeWidth:2}),t.jsx("span",{children:b("æ¥ç»è®²ä¹")})]})]})})},Ha=({id:n,title:a,subtitle:r,icon:o,expanded:i,onToggle:l,bgClass:d,headerClass:c,borderClass:h,accent:u="amber",html:m,tier:p,book:x,chapter:b})=>{const f=e.useRef(null),{i18n:g}=Pt(),w=s(),[k,v]=e.useState(0),[y,j]=e.useState({total:0,open:0}),Z=e.useRef({wheelGhostClickUntil:0,closeArmed:!1,pointerStart:null,pointerMoved:!1,touchStart:null,touchMoved:!1}),N=e.useMemo(()=>we(vt(function(e,t,n,a){if(!e||"undefined"==typeof DOMParser)return e;try{const r=(new DOMParser).parseFromString(`<body>${e}</body>`,"text/html").body,o=n&&"number"==typeof a&&t?Aa(r,n,a,t):new Set;return Ma(r,o),"standard"===t&&La(r,o),r.innerHTML}catch{return e}}(m,p,x,b),g.language),g.language),[m,p,x,b,k,g.language]);e.useLayoutEffect(()=>{if(!i)return void j({total:0,open:0});const e=f.current;if(!e)return;const t=x&&"number"==typeof b&&p?Aa(e,x,b,p):void 0;return Ma(e,t),"standard"===p&&La(e,t),t&&((e,t)=>{const n=Array.from(e.querySelectorAll('[data-bw-collapsible="1"]'));for(const a of n)t.has(_a(a))?Ba(a):$a(a)})(e,t),j((e=>{const t=Array.from(e.querySelectorAll('[data-bw-collapsible="1"]'));let n=0;for(const a of t){const e=a.nextElementSibling;(null==e?void 0:e.classList.contains("bw-collapsible-content"))&&"none"!==e.style.display&&n++}return{total:t.length,open:n}})(e)),qa(e,p,x,b,()=>v(e=>e+1))},[N,i,p,x,b]);const C=y.total>0&&y.open>=y.total;return t.jsxs("div",{id:n,className:`rounded-xl overflow-hidden ${d}`,children:[t.jsx("div",{className:`flex items-center ${h||""}`,children:t.jsxs("button",{onClick:e=>{const t=Z.current;if(Date.now()<t.wheelGhostClickUntil||t.pointerMoved||t.touchMoved)return t.wheelGhostClickUntil=0,t.pointerStart=null,t.touchStart=null,t.pointerMoved=!1,t.touchMoved=!1,void(t.closeArmed=!1);i&&!t.closeArmed||(l(),t.closeArmed=!1)},onWheel:()=>{Z.current.wheelGhostClickUntil=Date.now()+800,Z.current.closeArmed=!1},onPointerDown:e=>{Z.current.wheelGhostClickUntil=0,Z.current.closeArmed=i,Z.current.pointerStart={x:e.clientX,y:e.clientY},Z.current.pointerMoved=!1},onPointerMove:e=>{const t=Z.current.pointerStart;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>8&&(Z.current.pointerMoved=!0,Z.current.closeArmed=!1)},onTouchStart:e=>{const t=e.touches[0];t&&(Z.current.wheelGhostClickUntil=0,Z.current.closeArmed=i,Z.current.touchStart={x:t.clientX,y:t.clientY},Z.current.touchMoved=!1)},onTouchMove:e=>{const t=Z.current.touchStart,n=e.touches[0];t&&n&&Math.hypot(n.clientX-t.x,n.clientY-t.y)>8&&(Z.current.touchMoved=!0,Z.current.closeArmed=!1)},className:"flex-1 min-w-0 px-4 py-3 flex items-center justify-between hover:opacity-80 transition-opacity",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:c,children:o}),t.jsx("span",{className:`font-semibold text-base ${c}`,children:a}),t.jsx("span",{className:"text-sm text-[#78716C] dark:text-[#B3AC9C] hidden sm:inline truncate",children:r})]}),i?t.jsx(Qe,{className:"w-4 h-4 text-slate-500 flex-shrink-0"}):t.jsx(Xe,{className:"w-4 h-4 text-slate-500 flex-shrink-0"})]})}),i&&y.total>0&&t.jsx("div",{className:"px-4 pb-1 -mt-1 flex justify-end",children:t.jsxs("button",{type:"button",onClick:()=>{const e=f.current;e&&(((e,t,n,a,r)=>{const o=Array.from(e.querySelectorAll('[data-bw-collapsible="1"]'));
1o.forEach(e=>t?Ba(e):$a(e)),a&&"number"==typeof r&&n&&Da(a,r,n,t?o.map(_a):[])})(e,!C,p,x,b),v(e=>e+1))},className:"inline-flex items-center gap-1 rounded-full border border-[#E6E2D6] dark:border-[#3A3730] px-2.5 py-1 text-[13px] text-[#4F7942] dark:text-[#9CB58A] hover:bg-[#EDE9DD] dark:hover:bg-[#2C2A25] transition-colors",children:[C?t.jsx(rt,{className:"w-3.5 h-3.5",strokeWidth:1.8}):t.jsx(ot,{className:"w-3.5 h-3.5",strokeWidth:1.8}),w(C?"æ¶èµ·å
¨é¨":"å±å¼å
¨é¨")]})}),i&&t.jsx(ne,{ref:f,className:`px-4 pb-4 bct-rich-text bible-wiki-rich-text max-w-none text-[17px] leading-[1.85] text-slate-700\n [&_p]:my-4\n [&_img]:rounded-xl [&_img]:max-w-full [&_img]:h-auto [&_img]:my-3\n [&_h1]:text-[21px] [&_h1]:font-bold [&_h1]:text-slate-800 dark:[&_h1]:text-[#ECE6D8] [&_h1]:mt-5 [&_h1]:mb-2.5 [&_h1]:leading-snug\n [&_h2]:text-[19px] [&_h2]:font-bold [&_h2]:mt-11 [&_h2]:mb-3 [&_h2]:leading-snug [&_h2]:pb-2.5 [&_h2]:border-b [&_h2]:border-dashed\n [&_h2[id]]:scroll-mt-16\n [&_h3]:text-[17px] [&_h3]:font-semibold [&_h3]:text-slate-800 dark:[&_h3]:text-[#ECE6D8] [&_h3]:mt-5 [&_h3]:mb-2 [&_h3]:leading-snug\n [&_h3[data-bw-collapsible]]:ml-3 sm:[&_h3[data-bw-collapsible]]:ml-4 [&_.bw-collapsible-content-h3]:ml-3 sm:[&_.bw-collapsible-content-h3]:ml-4\n [&_h4]:text-[15px] [&_h4]:font-semibold [&_h4]:text-slate-800 dark:[&_h4]:text-[#ECE6D8] [&_h4]:mt-3 [&_h4]:mb-1.5\n [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_table]:border-collapse [&_table]:my-4 [&_table]:text-[15px] [&_table]:rounded-lg [&_table]:border [&_table]:border-slate-200 dark:[&_table]:border-[#38332A]\n [&_th]:font-semibold [&_th]:px-2.5 [&_th]:py-2 [&_th]:text-left [&_th]:align-top [&_th]:border [&_th]:border-slate-200 dark:[&_th]:border-[#403A2F]\n [&_td]:px-2.5 [&_td]:py-2 [&_td]:align-top [&_td]:break-words [&_td]:max-w-[24em] [&_td]:border [&_td]:border-slate-200 dark:[&_td]:border-[#38332A]\n [&_tr:nth-child(even)]:bg-slate-50 dark:[&_tr:nth-child(even)]:bg-[#201C15]\n [&_blockquote]:my-4 [&_blockquote]:px-4 [&_blockquote]:py-3 [&_blockquote]:border-l-4 [&_blockquote]:rounded-r-lg [&_blockquote]:italic\n [&_blockquote_p]:my-1.5\n [&_ul]:my-3.5 [&_ul]:pl-6 [&_ul]:list-disc\n [&_ol]:my-3.5 [&_ol]:pl-6 [&_ol]:list-decimal\n [&_li]:my-1.5\n [&_hr]:border-0 [&_hr]:border-t [&_hr]:border-slate-200 dark:[&_hr]:border-[#38332A] [&_hr]:my-5\n [&_strong]:text-slate-800 dark:[&_strong]:text-[#ECE6D8]\n [&_a]:underline\n [&_.wiki-section-link]:text-[#4F7942] dark:[&_.wiki-section-link]:text-[#9DCB78] [&_.wiki-section-link]:decoration-dotted [&_.wiki-section-link:hover]:decoration-solid\n [&_.wiki-deep-link]:text-indigo-600 dark:[&_.wiki-deep-link]:text-[#A9C0E8] [&_.wiki-deep-link]:no-underline [&_.wiki-deep-link:hover]:underline\n [&_.verse-chip]:text-[#4F7942] dark:[&_.verse-chip]:text-[#9DCB78] [&_.verse-chip]:underline [&_.verse-chip]:decoration-dotted [&_.verse-chip]:decoration-[#9CB58A]/60 [&_.verse-chip]:underline-offset-[3px] [&_.verse-chip]:cursor-pointer [&_.verse-chip]:whitespace-nowrap\n [&_.ancient-text]:font-serif [&_.ancient-text]:text-slate-900 dark:[&_.ancient-text]:text-[#F2ECDE]\n [&_.play-ancient]:inline-flex [&_.play-ancient]:items-center [&_.play-ancient]:justify-center\n [&_.play-ancient]:ml-1 [&_.play-ancient]:mr-0.5 [&_.play-ancient]:bg-transparent [&_.play-ancient]:border-0 [&_.play-ancient]:p-0\n [&_.play-ancient]:text-indigo-600 [&_.play-ancient]:cursor-pointer [&_.play-ancient]:align-middle [&_.play-ancient]:transition-colors\n [&_.play-ancient:hover]:text-indigo-800\n [&_.play-ancient-active]:text-indigo-700 [&_.play-ancient-active]:animate-pulse\n [&_pre]:bg-slate-100 dark:[&_pre]:bg-[#211D16] [&_pre]:rounded-lg [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:my-3 [&_pre]:text-[14px]\n [&_code]:bg-slate-100 dark:[&_code]:bg-[#2A251E] [&_code]:rounded [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:text-[14px] ${ba[u]}`,"data-bible-tier":p,html:N})]})},Wa={fontFamily:'"Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif'},Ga="bct_study_book",Ua=({user:n,initialBook:a,initialChapter:r})=>{const o=s(),i=B.find(e=>e.name===a||e.nameZh===a),l=(null==i?void 0:i.name)||a,d="number"==typeof r&&r>=0?r:1,[h,u]=e.useState(!1),[m,p]=e.useState(!1),[x,b]=e.useState(!1),[f,g]=e.useState("");e.useEffect(()=>{const e=e=>{var t;const n=(null==(t=e.detail)?void 0:t.q)||"";g(n),b(!0),p(!1),u(!0)};return window.addEventListener("bcct:wiki-whole-search",e),()=>window.removeEventListener("bcct:wiki-whole-search",e)},[]);const w=e.useContext(U).size>0,k=J(),[v,y]=e.useState(48),j=e.useRef(null);e.useEffect(()=>{const e=()=>{j.current&&y(j.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.useEffect(()=>{if(i)try{localStorage.setItem(Ga,JSON.stringify({testament:"OT"===i.testament?"æ§çº¦":"æ°çº¦",name:i.nameZh,chapter:d}))}catch{}}
1,[i,d]);return t.jsxs("div",{className:"min-h-screen flex flex-col",style:{background:"var(--paper, #FAF9F6)",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:v},children:[t.jsx("div",{ref:j,className:`fixed top-0 left-0 right-0 ${w?"lg:right-48":""} z-30 transition-transform duration-300 ${k?"translate-y-0":"-translate-y-full"}`,style:{background:"var(--paper, #FAF9F6)",paddingTop:"env(safe-area-inset-top, 0px)"},children:t.jsxs("div",{className:"relative px-4 pt-2 pb-2 max-w-5xl mx-auto w-full flex items-center min-h-[36px]",children:[t.jsxs("button",{type:"button",onClick:()=>V(()=>c("dashboard")),"aria-label":o("è¿å"),className:"inline-flex items-center gap-1.5 text-[14px] text-slate-500 hover:text-slate-800 transition-colors px-2 py-1 -ml-2",style:Wa,children:[t.jsx(st,{className:"w-4 h-4",strokeWidth:1.6}),o("è¿å")]}),i&&t.jsxs("button",{type:"button",onClick:()=>{b(!1),p(!0),u(!0)},"aria-label":o("æ¢ä¸å·ææ¢ä¸ç« "),title:o("æ¢ä¸å·ææ¢ä¸ç« "),className:"absolute left-1/2 -translate-x-1/2 max-w-[56%] inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[15px] font-medium text-slate-800 tracking-[0.06em] whitespace-nowrap hover:bg-slate-100 active:bg-slate-100 transition-colors",style:Wa,children:[t.jsxs("span",{className:"truncate",children:[o(i.nameZh),0===d?o(" · 导论"):` ${o("第{0}ç« ").replace("{0}",String(d))}`]}),t.jsx(Xe,{className:"w-3.5 h-3.5 shrink-0 text-slate-500",strokeWidth:1.8,"aria-hidden":!0})]}),t.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[i&&t.jsx("button",{type:"button",onClick:()=>c("geography",{geoBook:l}),"aria-label":o("æ¬å·å°å¾"),title:o("å¨å£ç»å°å¾ä¸çæ¬å·å°å"),className:"inline-flex items-center justify-center w-9 h-9 rounded-full text-slate-600 hover:bg-sky-50 hover:text-sky-600 transition-colors",children:t.jsx(it,{className:"w-[18px] h-[18px]",strokeWidth:1.6})}),t.jsx("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("bcct:wiki-article-search")),"aria-label":o("æç´¢"),title:o("æç´¢ç»æ"),className:"inline-flex items-center justify-center w-9 h-9 rounded-full text-slate-600 hover:bg-slate-100 hover:text-slate-800 transition-colors",children:t.jsx(Ie,{className:"w-[18px] h-[18px]",strokeWidth:1.6})}),t.jsx("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("bcct:wiki-share")),"aria-label":o("å享"),title:o("å享ç»å¼å
å§å¦¹"),className:"inline-flex items-center justify-center w-9 h-9 rounded-full text-slate-600 hover:bg-slate-100 hover:text-slate-800 transition-colors",children:t.jsx(at,{className:"w-[18px] h-[18px]",strokeWidth:1.6})})]})]})}),t.jsx("div",{className:"flex-1",children:t.jsx(ya,{book:l,chapter:d,user:n,zenMode:!0,allBooksOpen:h,mobileNavAboveOverlay:m,onShowAllBooks:()=>{b(!1),p(!0),u(!0)},onCloseAllBooks:()=>{u(!1),p(!1),b(!1),g("")}})}),t.jsx(Ot,{book:l,chapter:d}),t.jsx(ee,{open:h,onClose:()=>{u(!1),p(!1),b(!1),g("")},currentBookName:(null==i?void 0:i.nameZh)??"",currentChapter:d,user:n,onSelect:e=>{const t=B.find(t=>t.nameZh===e.name);if(t){try{localStorage.setItem(Ga,JSON.stringify({testament:e.testament,name:e.name,chapter:e.chapter??1}))}catch{}u(!1),p(!1),c("bibleWikiArticle",{bibleWikiBook:t.name,bibleWikiChapter:String(e.chapter??1)})}},keepBottomNavVisible:m,autoFocusSearch:x,initialQuery:f})]})};export{Ua as StudyZen};
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.