PageSourceSearch

https://tc-study.pages.dev/assets/EmptyStateLayout-BFkIW5-P.js

js tc-study.pages.dev collected 2026-10-03 05:57:48 UTC 143,550 bytes, 29 lines download raw bytes

1import{c as z,a4 as We,i as St,b2 as er,au as ye,bc as Et,bd as wt,G as tr}from"./index-D3hdjuCy.js";import{g as rr,a as B,j as v,_ as P}from"./linked-panels-DM92FWso.js";import{t as ar,e as nr,R as ir,m as sr}from"./resourceInfoModalProps-CW7T-uPy.js";import{I as or}from"./info-Dme1fK4l.js";import{g as It}from"./tabShortLabel-BIqa4Knu.js";import{C as cr}from"./code-UnGbHjFK.js";function lr(e,i){for(var s=0;s<i.length;s++){const r=i[s];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(r,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const pr=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],qa=z("book-marked",pr);const hr=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]],dr=z("book-text",hr);const ur=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],La=z("chevron-down",ur);const yr=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Wa=z("chevron-up",yr);const fr=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Ba=z("funnel",fr);const mr=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Va=z("link",mr);const gr=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Da=z("list",gr);const br=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ua=z("message-circle-question-mark",br);const Nr=[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M9.5 8h5",key:"11mslq"}],["path",{d:"M9.5 12H16",key:"ktog6x"}],["path",{d:"M9.5 16H14",key:"p1seyn"}]],Fa=z("notebook-text",Nr);function Ie(e){return typeof e=="object"&&e!==null}function Rt(e){if(typeof e=="string")return e;if(!Array.isArray(e))return"";let i="";for(const s of e)typeof s=="string"?i+=s:Ie(s)&&s.type==="text"&&typeof s.content=="string"&&(i+=s.content);return i}function Ha(e){const i=[],s={verseSid:""},r=o=>{for(const a of o)typeof a!="string"&&Ie(a)&&(a.type==="verse"&&typeof a.sid=="string"&&(s.verseSid=a.sid),a.type==="char"&&a.marker==="w"&&s.verseSid&&i.push({verseSid:s.verseSid,content:Rt(a.content)}),Array.isArray(a.content)&&r(a.content))};return r(e.content??[]),i}function Re(e){const i=e.match(/^(\S+)\s+(\d+):(\d+)$/);return i?{bookCode:i[1],chapter:parseInt(i[2],10),verse:parseInt(i[3],10)}:null}var $={},Ne={},K={},ke={},Be;function kr(){return Be||(Be=1,Object.defineProperty(ke,"__esModule",{value:!0})),ke}var F={},Ve;function jt(){return Ve||(Ve=1,Object.defineProperty(F,"__esModule",{value:!0}),F.defaultMarkers=F.syntaxByRole=F.syntaxByType=void 0,F.syntaxByType={paragraph:{syntax:{pattern:["content"],
1closedBy:[{template:"same-type"}]},allowsAttributes:!1,hasSpecialContent:!1,contentType:"mixed"},character:{syntax:{pattern:["content"],closedBy:[{template:"closing-marker"},{context:"NoteContent"},{type:"paragraph"}]},allowsAttributes:!1,hasSpecialContent:!1,contentType:"mixed"},milestone:{syntax:{pattern:["attributes"],closedBy:[{template:"self-closing"}]},allowsAttributes:!0,hasSpecialContent:!1,contentType:"none",implicitAttributes:{sid:{description:"Section identifier",type:"string"},eid:{description:"End identifier",type:"string"}}},note:{syntax:{pattern:["special-content","mergeable-markers","content"],closedBy:[{template:"closing-marker"},{type:"paragraph"}]},allowsAttributes:!1,hasSpecialContent:!0,contentType:"mixed",specialContent:{direct:{attributeName:"caller",parseUntil:["whitespace"],required:!0,contentType:"text"},mergeable:[{attributeName:"category",sourceMarkers:["cat"],extractionMethod:"textContent",parseOrder:"immediate",priority:1}]},implicitAttributes:{caller:{description:"The id of the note",type:"string"},category:{description:"The category of the note",type:"string"}}}},F.syntaxByRole={identification:{syntax:{pattern:["special-content","content"],closedBy:[{match:"\\"}]}}},F.defaultMarkers={id:{displayName:"File identification information",type:"paragraph",context:["ScriptureContent"],label:"book",hasSpecialContent:!0,specialContent:{direct:{attributeName:"code",parseUntil:["whitespace"],required:!0,contentType:"word"}},styleType:"book",syntax:{pattern:["special-content","content"],closedBy:[{match:"\\"}]}},usfm:{displayName:"File markup version information",type:"paragraph",context:["ScriptureContent"]},ide:{displayName:"File encoding information",type:"paragraph",context:["ScriptureContent"],styleType:"para"},h:{displayName:"Running header text for a book (basic)",type:"paragraph",context:["ScriptureContent"],styleType:"para",role:"identification",syntax:{pattern:["content"],
1closedBy:[{match:"\\"}]}},h1:{displayName:"Running header text",type:"paragraph",context:["ScriptureContent"],styleType:"para"},h2:{displayName:"Running header text, left side of page",type:"paragraph",context:["ScriptureContent"],styleType:"para"},h3:{displayName:"Running header text, right side of page",type:"paragraph",context:["ScriptureContent"],styleType:"para"},toc1:{displayName:"Long table of contents text",type:"paragraph",context:["ScriptureContent"],styleType:"para"},toc2:{displayName:"Short table of contents text",type:"paragraph",context:["ScriptureContent"],styleType:"para"},toc3:{displayName:"Book Abbreviation",type:"paragraph",context:["ScriptureContent"],styleType:"para"},toca1:{displayName:"Alternative language long table of contents text",type:"paragraph",context:["ScriptureContent"],styleType:"para"},toca2:{displayName:"Alternative language short table of contents text",type:"paragraph",context:["ScriptureContent"],styleType:"para"},toca3:{displayName:"Alternative language book Abbreviation",type:"paragraph",context:["ScriptureContent"],styleType:"para"},rem:{displayName:"Comments and remarks",type:"paragraph",context:["ScriptureContent"],styleType:"para",tags:["nonpublishable","nonvernacular"]},sts:{displayName:"Status of this file",type:"paragraph",context:["ScriptureContent"],styleType:"para",tags:["nonpublishable","nonvernacular"]},restore:{displayName:"Project restore information",type:"paragraph",context:["ScriptureContent"],styleType:"para",tags:["nonpublishable","nonvernacular"]},imt:{displayName:"Introduction major title, level 1 (if single level) (basic)",type:"paragraph",styleType:"para"},imt1:{displayName:"Introduction major title, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},imt2:{displayName:"Introduction major title, level 2",type:"paragraph",styleType:"para"},imt3:{displayName:"Introduction major title, level 3",type:"paragraph",styleType:"para"},imt4:{displayName:"Introduction major title, level 4 (usually within parenthesis)",type:"paragraph",styleType:"para"},imte:{displayName:"Introduction major title at introduction end, level 1 (if single level)",type:"paragraph",styleType:"para"},imte1:{displayName:"Introduction major title at introduction end, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},imte2:{displayName:"Introduction major title at introduction end, level 2",type:"paragraph",styleType:"para"},is:{displayName:"Introduction section heading, level 1 (if single level) (basic)",type:"paragraph",styleType:"para"},is1:{displayName:"Introduction section heading, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},is2:{displayName:"Introduction section heading, level 2",type:"paragraph",styleType:"para"},iot:{displayName:"Introduction outline title (basic)",type:"paragraph",styleType:"para"},io:{displayName:"Introduction outline text, level 1 (if single level)",type:"paragraph",styleType:"para"},io1:{displayName:"Introduction outline text, level 1 (if multiple levels) (basic)",type:"paragraph",styleType:"para"},io2:{displayName:"Introduction outline text, level 2",type:"paragraph",styleType:"para"},io3:{displayName:"Introduction outline text, level 3",type:"paragraph",styleType:"para"},io4:{displayName:"Introduction outline text, level 4",type:"paragraph",styleType:"para"},ior:{displayName:"Introduction references range for outline entry; for marking references separately",type:"character",styleType:"char"},ip:{displayName:"Introduction prose paragraph (basic)",type:"paragraph",styleType:"para"},im:{displayName:"Introduction prose paragraph, with no first line indent (may occur after poetry)",type:"paragraph",styleType:"para"},ipi:{displayName:"Introduction prose paragraph, indented, with first line indent",type:"paragraph",styleType:"para"},imi:{displayName:"Introduction prose paragraph text, indented, with no first line indent",type:"paragraph",styleType:"para"},ili:{displayName:"A list entry, level 1 (if single level)",type:"paragraph",styleType:"para"},ili1:{displayName:"A list entry, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},ili2:{displayName:"A list entry, level 2",type:"paragraph",styleType:"para"},ipq:{displayName:"Introduction prose paragraph, quote from the body text",type:"paragraph",styleType:"para"},imq:{displayName:"Introduction prose paragraph, quote from the body text, with no first line indent",type:"paragraph",styleType:"para"},ipr:{displayName:"Introduction prose paragraph, right aligned",type:"paragraph",styleType:"para"},ib:{displayName:"Introduction blank line",type:"paragraph",role:"break",styleType:"para"},iq:{displayName:"Introduction poetry text, level 1 (if single level)",type:"paragraph",styleType:"para"},iq1:{displayName:"Introduction poetry text, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},iq2:{displayName:"Introduction poetry text, level 2",type:"paragraph",styleType:"para"},iq3:{displayName:"Introduction poetry text, level 3",type:"paragraph",styleType:"para"},iex:{displayName:"Introduction explanatory or bridge text (e.g. explanation of missing book in Short Old Testament)",type:"paragraph",styleType:"para"},iqt:{displayName:"For quoted scripture text appearing in the introduction",type:"character",styleType:"char"},ie:{displayName:"Introduction ending marker",type:"paragraph",styleType:"para"},c:{displayName:"Chapter number (necessary for normal Paratext operation)",type:"paragraph",hasSpecialContent:!0,specialContent:{direct:{attributeName:"number",parseUntil:["whitespace"],required:!0,contentType:"number"},mergeable:[{attributeName:"altnumber",sourceMarkers:["ca"],extractionMethod:"specialContent"},{attributeName:"pubnumber",sourceMarkers:["cp"],extractionMethod:"specialContent"}]},styleType:"chapter",syntax:{pattern:["special-content","mergeable-markers"]}},ca:{displayName:"Second (alternate) chapter number (for coding dual versification; useful for places where different traditions of chapter breaks need to be supported in the same translation)",type:"character",hasSpecialContent:!0,mergesInto:{markers:["c"]},mergeAs:"altnumber"},cp:{displayName:"Published chapter number (chapter string that should appear in the published text)",type:"paragraph",hasSpecialContent:!0,mergesInto:{markers:["c"]},mergeAs:"pubnumber"},cl:{displayName:'Chapter label used for translations that add a word such as "Chapter" before chapter numbers (e.g. Psalms). The subsequent text is the chapter label.',type:"paragraph",styleType:"para"},cd:{displayName:"Chapter displayName (Publishing option D, e.g. in Russian Bibles)",type:"paragraph",styleType:"para"},v:{displayName:"A verse number (Necessary for normal paratext operation) (basic)",type:"character",hasSpecialContent:!0,specialContent:{direct:{attributeName:"number",parseUntil:["whitespace"],required:!0,contentType:"number-reference"},mergeable:[{attributeName:"altnumber",sourceMarkers:["va"],extractionMethod:"specialContent"},{attributeName:"pubnumber",sourceMarkers:["vp"],extractionMethod:"specialContent"}]},styleType:"verse",syntax:{pattern:["special-content","mergeable-markers"]}}
1,va:{displayName:"Second (alternate) verse number (for coding dual numeration in Psalms; see also NRSV Exo 22.1-4)",type:"character",hasSpecialContent:!0,mergesInto:{markers:["v"]},mergeAs:"altnumber"},vp:{displayName:"Published verse marker (verse string that should appear in the published text)",type:"character",hasSpecialContent:!0,mergesInto:{markers:["v"]},mergeAs:"pubnumber"},p:{displayName:"paragraph text, with first line indent (basic)",type:"paragraph",styleType:"para"},m:{displayName:"paragraph text, with no first line indent (may occur after poetry) (basic)",type:"paragraph",styleType:"para"},po:{displayName:"Letter opening",type:"paragraph",styleType:"para"},pr:{displayName:"Text refrain (paragraph text, right aligned)",type:"paragraph",styleType:"para"},cls:{displayName:"Letter Closing",type:"paragraph",styleType:"para"},pmo:{displayName:"Embedded text opening",type:"paragraph",styleType:"para"},pm:{displayName:"Embedded text paragraph",type:"paragraph",styleType:"para"},pmc:{displayName:"Embedded text closing",type:"paragraph",styleType:"para"},pmr:{displayName:'Embedded text refrain (e.g. Then all the people shall say, "Amen!")',type:"paragraph",styleType:"para"},pi:{displayName:"paragraph text, level 1 indent (if sinlge level), with first line indent; often used for discourse (basic)",type:"paragraph",styleType:"para"},pi1:{displayName:"paragraph text, level 1 indent (if multiple levels), with first line indent; often used for discourse",type:"paragraph",styleType:"para"},pi2:{displayName:"paragraph text, level 2 indent, with first line indent; often used for discourse",type:"paragraph",styleType:"para"},pi3:{displayName:"paragraph text, level 3 indent, with first line indent; often used for discourse",type:"paragraph",styleType:"para"},pc:{displayName:"paragraph text, centered (for Inscription)",type:"paragraph",styleType:"para"},mi:{displayName:"paragraph text, indented, with no first line indent; often used for discourse",type:"paragraph",styleType:"para"},nb:{displayName:"paragraph text, with no break from previous paragraph text (at chapter boundary) (basic)",type:"paragraph",styleType:"para"},q:{displayName:"Poetry text, level 1 indent (if single level)",type:"paragraph",styleType:"para"},q1:{displayName:"Poetry text, level 1 indent (if multiple levels) (basic)",type:"paragraph",styleType:"para"},q2:{displayName:"Poetry text, level 2 indent (basic)",type:"paragraph",styleType:"para"},q3:{displayName:"Poetry text, level 3 indent",type:"paragraph",styleType:"para"},q4:{displayName:"Poetry text, level 4 indent",type:"paragraph",styleType:"para"},qc:{displayName:"Poetry text, centered",type:"paragraph",styleType:"para"},qr:{displayName:"Poetry text, Right Aligned",type:"paragraph",styleType:"para"},qs:{displayName:"Poetry text, Selah",type:"character",styleType:"char"},qa:{displayName:"Poetry text, Acrostic marker/heading",type:"paragraph",styleType:"para"},qac:{displayName:"Poetry text, Acrostic markup of the first character of a line of acrostic poetry",type:"character",styleType:"char"},qm:{displayName:"Poetry text, embedded, level 1 indent (if single level)",type:"paragraph",styleType:"para"},qm1:{displayName:"Poetry text, embedded, level 1 indent (if multiple levels)",type:"paragraph",styleType:"para"},qm2:{displayName:"Poetry text, embedded, level 2 indent",type:"paragraph",styleType:"para"},qm3:{displayName:"Poetry text, embedded, level 3 indent",type:"paragraph",styleType:"para"},qd:{displayName:"A Hebrew musical performance annotation, similar in content to Hebrew descriptive title.",type:"paragraph",styleType:"para"},b:{displayName:"Poetry text stanza break (e.g. stanza break) (basic)",type:"paragraph",role:"break",styleType:"para"},mt:{displayName:"The main title of the book (if single level)",type:"paragraph",styleType:"para"},mt1:{displayName:"The main title of the book (if multiple levels) (basic)",type:"paragraph",styleType:"para"},mt2:{displayName:"A secondary title usually occurring before the main title (basic)",type:"paragraph",styleType:"para"},mt3:{displayName:"A secondary title occurring after the main title",type:"paragraph",styleType:"para"},mt4:{displayName:"A small secondary title sometimes occuring within parentheses",type:"paragraph",styleType:"para"},mte:{displayName:"The main title of the book repeated at the end of the book, level 1 (if single level)",type:"paragraph",styleType:"para"},mte1:{displayName:"The main title of the book repeated at the end of the book, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},mte2:{displayName:"A secondary title occurring before or after the 'ending' main title",type:"paragraph",styleType:"para"},ms:{displayName:"A major section division heading, level 1 (if single level) (basic)",type:"paragraph",styleType:"para"},mse:{displayName:"A major section division ending heading, level 1 (if single level)",type:"paragraph",styleType:"para"},ms1:{displayName:"A major section division heading, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},ms2:{displayName:"A major section division heading, level 2",type:"paragraph",styleType:"para"},ms2e:{displayName:"A major section division ending heading, level 2",type:"paragraph",styleType:"para"},ms3:{displayName:"A major section division heading, level 3",type:"paragraph",styleType:"para"},ms3e:{displayName:"A major section division ending heading, level 3",type:"paragraph",styleType:"para"},mr:{displayName:"A major section division references range heading (basic)",type:"paragraph",styleType:"para"},s:{displayName:"A section heading, level 1 (if single level) (basic)",type:"paragraph",styleType:"para"},s1:{displayName:"A section heading, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},s1e:{displayName:"A section ending heading, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},s2:{displayName:"A section heading, level 2 (e.g. Proverbs 22-24)",type:"paragraph",styleType:"para"},s2e:{displayName:"A section ending heading, level 2",type:"paragraph",styleType:"para"},s3:{displayName:'A section heading, level 3 (e.g. Genesis "The First Day")',type:"paragraph",styleType:"para"},s3e:{displayName:"A section ending heading, level 3",type:"paragraph",styleType:"para"},s4:{displayName:"A section heading, level 4",type:"paragraph",styleType:"para"},s4e:{displayName:"A section ending heading, level 4",type:"paragraph",styleType:"para"},sr:{displayName:"A section division references range heading",type:"paragraph",styleType:"para"},r:{displayName:"Parallel reference(s) (basic)",type:"paragraph",styleType:"para"},sp:{displayName:"A heading, to identify the speaker (e.g. Job)",type:"paragraph",styleType:"para"},d:{displayName:"A Hebrew text heading, to provide displayName (e.g. Psalms)",type:"paragraph",styleType:"para"}
1,sd:{displayName:"Vertical space used to divide the text into sections, level 1 (if single level)",type:"paragraph",role:"break",styleType:"para"},sd1:{displayName:"Vertical space used to divide the text into sections, level 1 (if multiple levels)",type:"paragraph",role:"break",styleType:"para"},sd2:{displayName:"Vertical space used to divide the text into sections, level 2",type:"paragraph",role:"break",styleType:"para"},sd3:{displayName:"Vertical space used to divide the text into sections, level 3",type:"paragraph",role:"break",styleType:"para"},sd4:{displayName:"Vertical space used to divide the text into sections, level 4",type:"paragraph",role:"break",styleType:"para"},tr:{displayName:"A new table row (basic)",type:"paragraph",styleType:"table:row"},th1:{displayName:"A table heading, column 1",type:"character",styleType:"table:cell"},th2:{displayName:"A table heading, column 2",type:"character",styleType:"table:cell"},th3:{displayName:"A table heading, column 3",type:"character",styleType:"table:cell"},th4:{displayName:"A table heading, column 4",type:"character",styleType:"table:cell"},th5:{displayName:"A table heading, column 5",type:"character",styleType:"table:cell"},th6:{displayName:"A table heading, column 6",type:"character",styleType:"table:cell"},th7:{displayName:"A table heading, column 7",type:"character",styleType:"table:cell"},th8:{displayName:"A table heading, column 4",type:"character",styleType:"table:cell"},tc1:{displayName:"A table cell item, column 1",type:"character",styleType:"table:cell"},tc2:{displayName:"A table cell item, column 2",type:"character",styleType:"table:cell"},tc3:{displayName:"A table cell item, column 3",type:"character",styleType:"table:cell"},tc4:{displayName:"A table cell item, column 4",type:"character",styleType:"table:cell"},tc5:{displayName:"A table cell item, column 5",type:"character",styleType:"table:cell"},tc6:{displayName:"A table cell item, column 6",type:"character",styleType:"table:cell"},tc7:{displayName:"A table cell item, column 7",type:"character",styleType:"table:cell"},tc8:{displayName:"A table cell item, column 8",type:"character",styleType:"table:cell"},thc1:{displayName:"A table heading, column 1, center aligned",type:"character",styleType:"table:cell"},thc2:{displayName:"A table heading, column 2, center aligned",type:"character",styleType:"table:cell"},thc3:{displayName:"A table heading, column 3, center aligned",type:"character",styleType:"table:cell"},thc4:{displayName:"A table heading, column 4, center aligned",type:"character",styleType:"table:cell"},thc5:{displayName:"A table heading, column 5, center aligned",type:"character",styleType:"table:cell"},thc6:{displayName:"A table heading, column 6, center aligned",type:"character",styleType:"table:cell"},thc7:{displayName:"A table heading, column 7, center aligned",type:"character",styleType:"table:cell"},thc8:{displayName:"A table heading, column 8, center aligned",type:"character",styleType:"table:cell"},tcc1:{displayName:"A table cell item, column 1, center aligned",type:"character",styleType:"table:cell"},tcc2:{displayName:"A table cell item, column 2, center aligned",type:"character",styleType:"table:cell"},tcc3:{displayName:"A table cell item, column 3, center aligned",type:"character",styleType:"table:cell"},tcc4:{displayName:"A table cell item, column 4, center aligned",type:"character",styleType:"table:cell"},tcc5:{displayName:"A table cell item, column 5, center aligned",type:"character",styleType:"table:cell"},tcc6:{displayName:"A table cell item, column 6, center aligned",type:"character",styleType:"table:cell"},tcc7:{displayName:"A table cell item, column 7, center aligned",type:"character",styleType:"table:cell"},tcc8:{displayName:"A table cell item, column 8, center aligned",type:"character",styleType:"table:cell"},thr1:{displayName:"A table heading, column 1, right aligned",type:"character",styleType:"table:cell"},thr2:{displayName:"A table heading, column 2, right aligned",type:"character",styleType:"table:cell"},thr3:{displayName:"A table heading, column 3, right aligned",type:"character",styleType:"table:cell"},thr4:{displayName:"A table heading, column 4, right aligned",type:"character",styleType:"table:cell"},thr5:{displayName:"A table heading, column 5, right aligned",type:"character",styleType:"table:cell"},thr6:{displayName:"A table heading, column 6, right aligned",type:"character",styleType:"table:cell"},thr7:{displayName:"A table heading, column 7, right aligned",type:"character",styleType:"table:cell"},thr8:{displayName:"A table heading, column 8, right aligned",type:"character",styleType:"table:cell"}
1,tcr1:{displayName:"A table cell item, column 1, right aligned",type:"character",styleType:"table:cell"},tcr2:{displayName:"A table cell item, column 2, right aligned",type:"character",styleType:"table:cell"},tcr3:{displayName:"A table cell item, column 3, right aligned",type:"character",styleType:"table:cell"},tcr4:{displayName:"A table cell item, column 4, right aligned",type:"character",styleType:"table:cell"},tcr5:{displayName:"A table cell item, column 5, right aligned",type:"character",styleType:"table:cell"},tcr6:{displayName:"A table cell item, column 6, right aligned",type:"character",styleType:"table:cell"},tcr7:{displayName:"A table cell item, column 7, right aligned",type:"character",styleType:"table:cell"},tcr8:{displayName:"A table cell item, column 8, right aligned",type:"character",styleType:"table:cell"},lh:{displayName:"List header (introductory remark)",type:"paragraph",styleType:"para"},li:{displayName:"A list entry, level 1 (if single level)",type:"paragraph",styleType:"para"},li1:{displayName:"A list entry, level 1 (if multiple levels) (basic)",type:"paragraph",styleType:"para"},li2:{displayName:"A list entry, level 2 (basic)",type:"paragraph",styleType:"para"},li3:{displayName:"A list entry, level 3",type:"paragraph",styleType:"para"},li4:{displayName:"A list entry, level 4",type:"paragraph",styleType:"para"},lf:{displayName:"List footer (concluding remark)",type:"paragraph",styleType:"para"},lim:{displayName:"An embedded list entry, level 1 (if single level)",type:"paragraph",styleType:"para"},lim1:{displayName:"An embedded list entry, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},lim2:{displayName:"An embedded list entry, level 2",type:"paragraph",styleType:"para"},lim3:{displayName:"An embedded list item, level 3",type:"paragraph",styleType:"para"},lim4:{displayName:"An embedded list entry, level 4",type:"paragraph",styleType:"para"},litl:{displayName:"List entry total text",type:"character",styleType:"char"},lik:{displayName:"Structure list entry key text",type:"character",styleType:"char"},liv:{displayName:"Structured list entry value 1 content (if single value)",type:"character",styleType:"char"},liv1:{displayName:"Structured list entrt value 1 content (if multiple values)",type:"character",styleType:"char"},liv2:{displayName:"Structured list entry value 2 content",type:"character",styleType:"char"},liv3:{displayName:"Structured list entry value 3 content",type:"character",styleType:"char"},liv4:{displayName:"Structured list entry value 4 content",type:"character",styleType:"char"},f:{displayName:"A Footnote text item (basic)",type:"note",hasSpecialContent:!0,specialContent:{direct:{attributeName:"caller",parseUntil:["whitespace"],required:!0,contentType:"text"},mergeable:[{attributeName:"category",sourceMarkers:["cat"],extractionMethod:"textContent",parseOrder:"immediate",priority:1}]},implicitAttributes:{caller:{description:"The id of the footnote",type:"string"},cat:{description:"The category of the footnote",type:"string"}},styleType:"note"},fe:{displayName:"An Endnote text item",type:"note",context:["NoteContent"],hasSpecialContent:!0,specialContent:{direct:{attributeName:"caller",parseUntil:["whitespace"],required:!0,contentType:"text"},mergeable:[{attributeName:"category",sourceMarkers:["cat"],extractionMethod:"textContent",parseOrder:"immediate",priority:1}]},implicitAttributes:{caller:{description:"The id of the endnote",type:"string"},cat:{description:"The category of the endnote",type:"string"}},styleType:"note"},fr:{displayName:"The origin reference for the footnote (basic)",type:"character",context:["NoteContent"],styleType:"char"},ft:{displayName:"Footnote text, Protocanon (basic)",type:"character",context:["NoteContent"],styleType:"char"},fk:{displayName:"A footnote keyword (basic)",type:"character",context:["NoteContent"],styleType:"char"},fq:{displayName:"A footnote scripture quote or alternate rendering (basic)",type:"character",context:["NoteContent"],styleType:"char"},fqa:{displayName:"A footnote alternate rendering for a portion of scripture text",type:"character",context:["NoteContent"],styleType:"char"},fl:{displayName:'A footnote label text item, for marking or "labelling" the type or alternate translation being provided in the note.',type:"character",context:["NoteContent"],styleType:"char"}
1,fw:{displayName:"A footnote witness list, for distinguishing a list of sigla representing witnesses in critical editions.",type:"character",context:["NoteContent"],styleType:"char"},fp:{displayName:"A Footnote additional paragraph marker",type:"character",context:["NoteContent"],styleType:"char"},fs:{displayName:"A summary text for the concept/idea/quotation from the scripture translation for which the note is being provided.",type:"character",context:["NoteContent"],styleType:"char"},fv:{displayName:"A verse number within the footnote text",type:"character",context:["NoteContent"],styleType:"char"},fdc:{displayName:"Footnote text, applies to Deuterocanon only",type:"character",context:["NoteContent"],styleType:"char"},fm:{displayName:"An additional footnote marker location for a previous footnote",type:"character",context:["NoteContent"],styleType:"char"},x:{displayName:"A list of cross references (basic)",type:"note",hasSpecialContent:!0,specialContent:{direct:{attributeName:"caller",parseUntil:["whitespace"],required:!0,contentType:"text"},mergeable:[{attributeName:"category",sourceMarkers:["cat"],extractionMethod:"textContent",parseOrder:"immediate",priority:1}]},implicitAttributes:{caller:{description:"The id of the cross reference",type:"string"},cat:{description:"The category of the cross reference",type:"string"}},styleType:"note"},xo:{displayName:"The cross reference origin reference (basic)",type:"character",context:["NoteContent"],styleType:"char"},xop:{displayName:"Published cross reference origin reference (origin reference that should appear in the published text)",type:"character",context:["NoteContent"],styleType:"char"},xt:{displayName:"The cross reference target reference(s), protocanon only (basic)",type:"character",context:["NoteContent"],styleType:"char"},xta:{displayName:"Cross reference target references added text",type:"character",context:["NoteContent"],styleType:"char"},xk:{displayName:"A cross reference keyword",type:"character",context:["NoteContent"],styleType:"char"},xq:{displayName:"A cross-reference quotation from the scripture text",type:"character",context:["NoteContent"],styleType:"char"},xot:{displayName:"Cross-reference target reference(s), Old Testament only",type:"character",context:["NoteContent"],styleType:"char"},xnt:{displayName:"Cross-reference target reference(s), New Testament only",type:"character",context:["NoteContent"],styleType:"char"},xdc:{displayName:"Cross-reference target reference(s), Deuterocanon only",type:"character",context:["NoteContent"],styleType:"char"},rq:{displayName:"A cross-reference indicating the source text for the preceding quotation.",type:"character",styleType:"char"},ef:{displayName:"Study Bible extended footnote (basic)",type:"note",hasSpecialContent:!0,specialContent:{direct:{attributeName:"caller",parseUntil:["whitespace"],required:!0,contentType:"text"},mergeable:[{attributeName:"category",sourceMarkers:["cat"],extractionMethod:"textContent",parseOrder:"immediate",priority:1}]},implicitAttributes:{caller:{description:"The id of the extended footnote",type:"string"},cat:{description:"The category of the extended footnote",type:"string"}},styleType:"note"},ex:{displayName:"List of study Bible extended cross references",type:"note",hasSpecialContent:!0,specialContent:{direct:{attributeName:"caller",parseUntil:["whitespace"],required:!0,contentType:"text"},mergeable:[{attributeName:"category",sourceMarkers:["cat"],extractionMethod:"textContent",parseOrder:"immediate",priority:1}]},implicitAttributes:{caller:{description:"The id of the extended cross reference",type:"string"},cat:{description:"The category of the extended cross reference",type:"string"}},styleType:"note"},esb:{displayName:"Study Bible sidebar (mini article)",type:"paragraph",closedBy:"esbe",sectionContainer:!0,implicitAttributes:{cat:{description:"The category of the study Bible sidebar",type:"string"}},styleType:"sidebar"},esbe:{displayName:"Study Bible sidebar ending",type:"paragraph",closes:"esb"},erq:{displayName:"Study Bible reflective questions",type:"paragraph",closedBy:"erqe",sectionContainer:!0,styleType:"para"},erqe:{displayName:"Study Bible reflective questions ending",type:"paragraph",closes:"erq",styleType:"para"},cat:{displayName:"Study note category",type:"character",mergesInto:{markers:["esb"],types:["note"]},mergeAs:"category",styleType:"char"},qt:{displayName:"For Old Testament quoted text appearing in the New Testament (basic)",type:"character",styleType:"char"}
1,nd:{displayName:"For name of deity (basic)",type:"character",styleType:"char"},tl:{displayName:"For transliterated words",type:"character",styleType:"char"},dc:{displayName:"Deuterocanonical/LXX additions or insertions in the Protocanonical text",type:"character",styleType:"char"},bk:{displayName:"For the quoted name of a book",type:"character",styleType:"char"},sig:{displayName:"For the signature of the author of an Epistle",type:"character",styleType:"char"},pn:{displayName:"For a proper name",type:"character",styleType:"char"},png:{displayName:"For a geographic proper name",type:"character",styleType:"char"},addpn:{displayName:"For chinese words to be dot underline & underline",type:"character",styleType:"char"},wj:{displayName:"For marking the words of Jesus",type:"character",styleType:"char"},k:{displayName:"For a keyword",type:"character",allowsAttributes:!0,defaultAttribute:"key",attributes:{key:{description:"The keyword or search term for this glossary entry",type:"string"}},styleType:"char"},sls:{displayName:"To represent where the original text is in a secondary language or from an alternate text source",type:"character",styleType:"char"},ord:{displayName:"For the text portion of an ordinal number",type:"character",styleType:"char"},add:{displayName:"For a translational addition to the text",type:"character",styleType:"char"},lit:{displayName:"For a comment or note inserted for liturgical use",type:"paragraph",styleType:"para"},no:{displayName:"A character style, use normal text",type:"character",styleType:"char"},it:{displayName:"A character style, use italic text",type:"character",styleType:"char"},bd:{displayName:"A character style, use bold text",type:"character",styleType:"char"},bdit:{displayName:"A character style, use bold + italic text",type:"character",styleType:"char"},em:{displayName:"A character style, use emphasized text style",type:"character",styleType:"char"},sc:{displayName:"A character style, for small capitalization text",type:"character",styleType:"char"},sup:{displayName:"A character style, for superscript text. Typically for use in critical edition footnotes.",type:"character",styleType:"char"},pb:{displayName:"Page Break used for new reader portions and children's bibles where content is controlled by the page",type:"paragraph",styleType:"para"},fig:{displayName:"Illustration [Columns to span, height, filename, caption text]",label:"figure",type:"character",allowsAttributes:!0,styleType:"figure",attributes:{src:{description:"The filename of the illustration",type:"string",required:!0},size:{description:"Illustration relative size",type:"string",values:["col","span"],required:!0},ref:{description:"Scripture reference",type:"string",required:!0},alt:{description:"Short, free-form description of image.",type:"string"},loc:{description:"Location / range. Specify a range of references at which the illustration might be inserted.",type:"string"},copy:{description:"Rights holder/copyright information.",type:"string"}}},jmp:{displayName:"For associating linking attributes to a span of text",type:"character",styleType:"char",allowsAttributes:!0,defaultAttribute:"href",attributes:{href:{description:"Identifies the resource being linked to as a URI",type:"string"},title:{description:"The title of the linked resource",type:"string"},"link-href":{description:"USJ/USX-style link URI (same role as href in some USFM sources)",type:"string"},"link-title":{description:"USJ/USX-style link title (same role as title in some USFM sources)",type:"string"},id:{description:"A unique identifier for a specific content location (i.e. an anchor).",type:"string"}}},pro:{displayName:"For indicating pronunciation in CJK texts",type:"character",styleType:"char"},rb:{displayName:"Ruby gloss.",type:"character",styleType:"char",allowsAttributes:!0,defaultAttribute:"gloss",attributes:{gloss:{description:"Ruby gloss characters",type:"string"}}},w:{displayName:"A wordlist text item",type:"character",styleType:"char",allowsAttributes:!0,defaultAttribute:"lemma",attributes:{lemma:{description:"Citation form for the term in the glossary",type:"string"},strong:{description:"Strong's ID in the form H#### (Hebrew) or G#### (Greek)",type:"string"},srcloc:{description:"Location of the word in the source text",type:"string"}},syntax:{pattern:["content","attributes"],closedBy:[{template:"closing-marker"}]}},wh:{displayName:"A Hebrew wordlist text item",type:"character",styleType:"char"},wg:{displayName:"A Greek Wordlist text item",type:"character",styleType:"char"}
1,wa:{displayName:"An Aramaic Wordlist text item",type:"character",styleType:"char"},ndx:{displayName:"A subject index text item",type:"character",styleType:"char"},periph:{displayName:"Periheral content division marker.",allowsAttributes:!0,attributes:{id:{description:"The id of the peripheral content",type:"string"}},hasSpecialContent:!0,specialContent:{direct:{attributeName:"alt",parseUntil:["nextMarker","attributes"],required:!0,contentType:"text"}},implicitAttributes:{alt:{description:"The type of peripheral content",type:"string"}},type:"paragraph",styleType:"periph",syntax:{pattern:["special-content","attributes","content"],closedBy:[{marker:"periph"}]}},p1:{displayName:"Front or back matter text paragraph, level 1 (if multiple levels)",type:"paragraph",styleType:"para"},p2:{displayName:"Front or back matter text paragraph, level 2 (if multiple levels)",type:"paragraph",styleType:"para"},k1:{displayName:"Concordance main entry text or keyword, level 1",type:"paragraph",styleType:"para"},k2:{displayName:"Concordance main entry text or keyword, level 2",type:"paragraph",styleType:"para"},xtSee:{displayName:"Concordance and Names Index markup for an alternate entry target reference.",type:"character",styleType:"char"},xtSeeAlso:{displayName:"Concordance and Names Index markup for an additional entry target reference.",type:"character",styleType:"char"},ph:{displayName:"paragraph text, with level 1 hanging indent (if single level)",type:"paragraph",styleType:"para"},ph1:{displayName:"paragraph text, with level 1 hanging indent (if multiple levels)",type:"paragraph",styleType:"para"},ph2:{displayName:"paragraph text, with level 2 hanging indent",type:"paragraph",styleType:"para"},ph3:{displayName:"paragraph text, with level 3 hanging indent",type:"paragraph",styleType:"para"},phi:{displayName:"paragraph text, indented with hanging indent",type:"paragraph",styleType:"para"},tr1:{displayName:"A table Row",type:"paragraph",styleType:"table:row"},tr2:{displayName:"A table Row",type:"paragraph",styleType:"table:row"},ps:{displayName:"paragraph text, no break with next paragraph text at chapter boundary",type:"paragraph",styleType:"para"},psi:{displayName:"paragraph text, indented, with no break with next paragraph text (at chapter boundary)",type:"paragraph",styleType:"para"},wr:{displayName:"A Wordlist text item",type:"character",styleType:"char"},pub:{displayName:"Front matter publication data",type:"paragraph",styleType:"para"},toc:{displayName:"Front matter table of contents",type:"paragraph",styleType:"para"},pref:{displayName:"Front matter preface",type:"paragraph",styleType:"para"},ref:{displayName:"Scripture reference",type:"character",styleType:"ref",allowsAttributes:!0,defaultAttribute:"loc",attributes:{loc:{description:"Use for explicitely identifying the target scripture reference",type:"string"},gen:{description:"Set the value to true to indicate that a <ref> tag was auto-generated",type:"boolean"}}},intro:{displayName:"Front matter introduction",type:"paragraph",styleType:"para"},conc:{displayName:"Back matter concordance",type:"paragraph",styleType:"para"},glo:{displayName:"Back matter glossary",type:"paragraph",styleType:"para"},idx:{displayName:"Back matter index",type:"paragraph",styleType:"para"},maps:{displayName:"Back matter map index",type:"paragraph",styleType:"para"},cov:{displayName:"Other peripheral materials - cover",type:"paragraph",styleType:"para"},spine:{displayName:"Other peripheral materials - spine",type:"paragraph",styleType:"para"},pubinfo:{displayName:"Publication information - Lang,Credit,Version,Copies,Publisher,Id,Logo",type:"paragraph",styleType:"para"},"zpa-xb":{displayName:"Book Ref",type:"character",styleType:"char"},"zpa-xc":{displayName:"Chapter Ref",type:"character",styleType:"char"},"zpa-xv":{displayName:"Verse Ref",type:"character",styleType:"char"},"zpa-d":{displayName:"Description",type:"character",styleType:"char"},ts:{displayName:"Translator's section",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{sid:{description:"Section identifier for the translator section",type:"string"}}},"ts-s":{displayName:"Translator's section start milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{sid:{description:"Section identifier for the translator section",type:"string"}}},"ts-e":{displayName:"Translator's section end milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{eid:{description:"End identifier for the translator section",type:"string"}}},"qt-s":{displayName:"Quotation start milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{sid:{description:"Section identifier for the quotation",type:"string"},who:{description:"Who is speaking in the quotation",type:"string"}}},"qt-e":{displayName:"Quotation end milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{eid:{description:"End identifier for the quotation",type:"string"}}},"qt1-s":{displayName:"Quotation level 1 start milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{sid:{description:"Section identifier for the level 1 quotation",type:"string"},who:{description:"Who is speaking in the quotation",type:"string"}}},"qt1-e":{displayName:"Quotation level 1 end milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{eid:{description:"End identifier for the level 1 quotation",type:"string"}}},"qt2-s":{displayName:"Quotation level 2 start milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{sid:{description:"Section identifier for the level 2 quotation",type:"string"},who:{description:"Who is speaking in the quotation",type:"string"}}},"qt2-e":{displayName:"Quotation level 2 end milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{eid:{description:"End identifier for the level 2 quotation",type:"string"}}},t:{displayName:"",type:"milestone",styleType:"ms"},efe:{type:"note",styleType:"note",implicitAttributes:{caller:{description:"The id of the endnote",type:"string"},cat:{description:"The category of the endnote",type:"string"}}},efm:{type:"character",styleType:"char"},"zaln-s":{displayName:"Alignment start milestone",type:"milestone",styleType:"ms",allowsAttributes:!0,attributes:{who:{description:"Optional metadata (e.g. speaker) carried on the alignment start milestone",type:"string"}
1,"x-strong":{description:"Strong number reference",type:"string"},"x-lemma":{description:"Lemma form",type:"string"},"x-morph":{description:"Morphological information",type:"string"},"x-occurrence":{description:"Occurrence number",type:"string"},"x-occurrences":{description:"Total occurrences",type:"string"},"x-content":{description:"Original language content",type:"string"}}},"zaln-e":{displayName:"Alignment end milestone",type:"milestone",styleType:"ms"}}),F}var ie={},De;function Tr(){if(De)return ie;De=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.USFMMarkerRegistry=void 0;const e=jt();class i{static isAsciiLetter(r){const o=r.charCodeAt(0);return o>=65&&o<=90||o>=97&&o<=122}static isAsciiDigit(r){const o=r.charCodeAt(0);return o>=48&&o<=57}static matchTableCellMarker(r){for(const o of i.TABLE_PREFIXES){if(!r.startsWith(o))continue;const a=r.slice(o.length);if(i.matchTableCellNumericSuffix(a))return{prefix:o}}return null}static matchTableCellNumericSuffix(r){const o=r.length;let a=0;if(a>=o||!i.isAsciiDigit(r[a]))return!1;for(;a<o&&i.isAsciiDigit(r[a]);)a++;if(a===o)return!0;if(r[a]!=="-")return!1;a++;const p=a;for(;a<o&&i.isAsciiDigit(r[a]);)a++;return a===o&&a>p}static parseGenericMarkerForm(r){const o=r.length;let a=0;if(a>=o||!i.isAsciiLetter(r[a]))return null;for(;a<o&&i.isAsciiLetter(r[a]);)a++;if(a<o&&r[a]==="-")for(a++;a<o&&i.isAsciiLetter(r[a]);)a++;const p=r.slice(0,a),f=a;for(;a<o&&i.isAsciiDigit(r[a]);)a++;const n=r.slice(f,a);let c;if(a<o){if(r[a]!=="-"||(a++,a>=o||r[a]!=="s"&&r[a]!=="e"))return null;c=r.slice(a-1,a+1),a++}return a!==o?null:{baseMarker:p,level:n,milestoneSuffix:c}}static isWellFormedMarkerSyntax(r){return i.matchTableCellMarker(r)!==null||i.parseGenericMarkerForm(r)!==null}constructor(){this.markerData={}}static getInstance(r){if(!i.instance&&(i.instance=new i,i.instance.initializeMarkers(i.DEFAULT_MARKERS),r))for(const[o,a]of Object.entries(r))i.instance.markerData[o]=a;return i.instance}initializeMarkers(r){this.markerData=r}getMarkerInfo(r,o){if(!r||typeof r!="string")throw new Error("Invalid marker: Marker must be a non-empty string");function a(f){if(f.length>i.MAX_MARKER_STRING_LENGTH)return;const n=this.markerData[f];if(n){const T=e.syntaxByType[n.type];if(T){const x={...T,...n};return T.implicitAttributes&&n.implicitAttributes&&(x.implicitAttributes={...T.implicitAttributes,...n.implicitAttributes}),T.attributes&&"attributes"in n&&n.attributes&&(x.attributes={...T.attributes,...n.attributes}),T.specialContent&&n.specialContent&&(x.specialContent={...T.specialContent,...n.specialContent},T.specialContent.mergeable&&n.specialContent.mergeable&&(x.specialContent.mergeable=[...T.specialContent.mergeable,...n.specialContent.mergeable])),x}return n}const c=i.matchTableCellMarker(f);if(c){const{prefix:T}=c,x=T+"1",N=this.markerData[x];if(N){const y=e.syntaxByType[N.type];return y?{...y,...N}:N}}const t=i.parseGenericMarkerForm(f);if(!t)return;const{baseMarker:l,level:u,milestoneSuffix:d}=t,m=u&&d?l+u:l,g=this.markerData[m];if(g){const T=e.syntaxByType[g.type];return T?{...T,...g}:g}}const p=a.call(this,r);if(p)return o?p[o]:p}addMarker(r,o){if(r.length>i.MAX_MARKER_STRING_LENGTH)throw new Error(`Invalid marker format: marker exceeds maximum length (${i.MAX_MARKER_STRING_LENGTH})`);if(!i.isWellFormedMarkerSyntax(r))throw new Error(`Invalid marker format: ${r}`);if(this.markerData[r])throw new Error(`Marker already exists: ${r}`);this.markerData[r]=o}isValidMarker(r){return!r||typeof r!="string"||r.length>i.MAX_MARKER_STRING_LENGTH?!1:!!this.markerData[r]||i.isWellFormedMarkerSyntax(r)}getMarkerType(r){return this.getMarkerInfo(r,"type")}getMarkerSyntax(r){const o=this.getMarkerInfo(r);return o?o.syntax?o.syntax:e.syntaxByType[o.type]?.syntax:void 0}}return ie.USFMMarkerRegistry=i,i.MAX_MARKER_STRING_LENGTH=128,i.TABLE_PREFIXES=["thr","tcr","thc","tcc","th","tc"],i.DEFAULT_MARKERS=e.defaultMarkers,ie}var Ue;function fe(){return Ue||(Ue=1,(function(e){var i=K&&K.__createBinding||(Object.create?(function(r,o,a,p){p===void 0&&(p=a);var f=Object.getOwnPropertyDescriptor(o,a);(!f||("get"in f?!o.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,p,f)}):(function(r,o,a,p){p===void 0&&(p=a),r[p]=o[a]})),s=K&&K.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&i(o,r,a)};
1Object.defineProperty(e,"__esModule",{value:!0}),s(kr(),e),s(jt(),e),s(Tr(),e)})(K)),K}var Q={},X={},se={},Fe;function vr(){if(Fe)return se;Fe=1,Object.defineProperty(se,"__esModule",{value:!0}),se.MarkerTypeEnum=void 0;var e;return(function(i){i.PARAGRAPH="paragraph",i.CHARACTER="character",i.NOTE="note",i.NOTE_CONTENT="noteContent",i.MILESTONE="milestone"})(e||(se.MarkerTypeEnum=e={})),se}var Y={},He;function xr(){if(He)return Y;He=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.UniversalVisitorDispatcher=void 0,Y.visitUniversal=i,Y.visitUniversalChildren=s;class e{static visit(o,a){return typeof o=="string"?a.visitText(o):"accept"in o&&typeof o.accept=="function"?o.accept(a):this.dispatchPlainUSJ(o,a)}static visitChildren(o,a){if(typeof o=="string")return[];const p=this.getContent(o);return Array.isArray(p)?p.map(f=>this.visit(f,a)):[]}static getContent(o){if(typeof o!="string"){if("getChildren"in o&&typeof o.getChildren=="function"){const a=o.getChildren();return Array.isArray(a)?a:[a]}return o.content}}static dispatchPlainUSJ(o,a){switch(o.type){case"book":return a.visitBook?.(o)??a.visitParagraph(o);case"chapter":return a.visitChapter?.(o)??a.visitParagraph(o);case"para":case"paragraph":return a.visitParagraph(o);case"char":case"character":return a.visitCharacter(o);case"verse":return a.visitVerse?.(o)??a.visitCharacter(o);case"note":return a.visitNote(o);case"ms":case"milestone":return a.visitMilestone(o);case"root":return a.visitRoot?.(o)??a.visitParagraph(o);case"text":return a.visitText(o);case"ref":return a.visitRef?.(o)??a.visitCharacter(o);default:if(o.marker){const f=o.marker;return this.isParagraphMarker(f)?a.visitParagraph(o):a.visitCharacter(o)}return a.visitParagraph(o)}}static isParagraphMarker(o){return["p","q","q1","q2","q3","m","pi","pi1","pi2","s","s1","s2","s3","s4","h","toc1","toc2","toc3","mt","mt1","mt2","mt3","mt4","id","c","b"].some(p=>o.startsWith(p))}}Y.UniversalVisitorDispatcher=e;function i(r,o){return e.visit(r,o)}function s(r,o){return e.visitChildren(r,o)}return Y}var W={},ze;function Pr(){if(ze)return W;ze=1,Object.defineProperty(W,"__esModule",{value:!0}),W.isEnhancedBookNode=e,W.isEnhancedChapterNode=i,W.isEnhancedParagraphNode=s,W.isEnhancedCharacterNode=r,W.isEnhancedVerseNode=o,W.isEnhancedNoteNode=a,W.isEnhancedMilestoneNode=p,W.isEnhancedTextNode=f,W.isEnhancedRefNode=n,W.isEnhancedTableNode=c,W.isEnhancedTableRowNode=t,W.isEnhancedTableCellNode=l,W.hasEnhancedMethods=u,W.toPlainUSJ=d,W.toUSJDocument=m;function e(g){return g?.type==="book"}function i(g){return g?.type==="chapter"}function s(g){return g?.type==="para"}function r(g){return g?.type==="char"}function o(g){return g?.type==="verse"}function a(g){return g?.type==="note"}function p(g){return g?.type==="ms"}function f(g){return g?.type==="text"}function n(g){return g?.type==="ref"}function c(g){return g?.type==="table"}function t(g){return g?.type==="table:row"}function l(g){return g?.type==="table:cell"}function u(g){return g&&typeof g.getParent=="function"&&typeof g.accept=="function"}function d(g){return"type"in g&&g.type==="text"?g.content:JSON.parse(JSON.stringify(g))}function m(g,T="3.1"){return{type:"USJ",version:T,content:g.map(x=>d(x))}}return W}var I={},Je;function _r(){if(Je)return I;Je=1,Object.defineProperty(I,"__esModule",{value:!0}),I.EnhancedTextNodeImpl=I.EnhancedMilestoneNodeImpl=I.EnhancedNoteNodeImpl=I.EnhancedVerseNodeImpl=I.EnhancedCharacterNodeImpl=I.EnhancedParagraphNodeImpl=I.EnhancedChapterNodeImpl=I.EnhancedBookNodeImpl=I.EnhancedRootNodeImpl=void 0,I.createEnhancedBook=t,I.createEnhancedChapter=l,I.createEnhancedParagraph=u,I.createEnhancedCharacter=d,I.createEnhancedVerse=m,I.createEnhancedNote=g,I.createEnhancedMilestone=T,I.createEnhancedText=x;class e{constructor(y,k){this.index=y,this.parent=k}getParent(){return this.parent}getNextSibling(){const y=this.getParent();if(!y)return;const k=y.getChildren();if(Array.isArray(k))return k[this.index+1]}getPreviousSibling(){const y=this.getParent();if(!y)return;const k=y.getChildren();if(Array.isArray(k))return k[this.index-1]}}class i{constructor(y){this.content=y,this.type="root"}getChildren(){return this.content}}I.EnhancedRootNodeImpl=i;class s extends e{constructor(y,k=[],_=0,E){super(_,E),this.code=y,this.content=k,this.type="book",this.marker="id"}getChildren(){return this.content.join(" ")}accept(y){return y.visitBook?.(this)??y.visitParagraph(this)}acceptWithContext(y,k){return y.visitBook?.(this,k)??y.visitParagraph(this,k)}}I.EnhancedBookNodeImpl=s;
1class r extends e{constructor(y,k,_,E,R=0,V){super(R,V),this.number=y,this.sid=k,this.altnumber=_,this.pubnumber=E,this.type="chapter",this.marker="c"}getChildren(){return[]}accept(y){return y.visitChapter?.(this)??y.visitParagraph(this)}acceptWithContext(y,k){return y.visitChapter?.(this,k)??y.visitParagraph(this,k)}}I.EnhancedChapterNodeImpl=r;class o extends e{constructor(y,k=[],_,E=0,R){super(E,R),this.marker=y,this.content=k,this.sid=_,this.type="para"}getChildren(){return this.content||[]}accept(y){return y.visitParagraph(this)}acceptWithContext(y,k){return y.visitParagraph(this,k)}}I.EnhancedParagraphNodeImpl=o;class a extends e{constructor(y,k=[],_={},E=0,R){super(E,R),this.marker=y,this.content=k,this.type="char",Object.entries(_).forEach(([V,S])=>{this[V]=S})}getChildren(){return this.content||[]}accept(y){return y.visitCharacter(this)}acceptWithContext(y,k){return y.visitCharacter(this,k)}}I.EnhancedCharacterNodeImpl=a;class p extends e{constructor(y,k,_,E,R,V=0,S){super(V,S),this.marker=y,this.number=k,this.sid=_,this.altnumber=E,this.pubnumber=R,this.type="verse"}getChildren(){return[]}accept(y){return y.visitVerse?.(this)??y.visitCharacter(this)}acceptWithContext(y,k){return y.visitVerse?.(this,k)??y.visitCharacter(this,k)}}I.EnhancedVerseNodeImpl=p;class f extends e{constructor(y,k=[],_,E=0,R){super(E,R),this.marker=y,this.content=k,this.caller=_,this.type="note"}getChildren(){return this.content||[]}accept(y){return y.visitNote(this)}acceptWithContext(y,k){return y.visitNote(this,k)}}I.EnhancedNoteNodeImpl=f;class n extends e{constructor(y,k={},_,E,R,V=0,S){super(V,S),this.marker=y,this.sid=_,this.eid=E,this.who=R,this.type="ms",Object.entries(k).forEach(([O,L])=>{this[O]=L})}getChildren(){return[]}accept(y){return y.visitMilestone(this)}acceptWithContext(y,k){return y.visitMilestone(this,k)}}I.EnhancedMilestoneNodeImpl=n;class c extends e{constructor(y,k=0,_){super(k,_),this.content=y,this.type="text"}getChildren(){return this.content}accept(y){return y.visitText(this)}acceptWithContext(y,k){return y.visitText(this,k)}}I.EnhancedTextNodeImpl=c;function t(N,y=[],k=0,_){return new s(N,y,k,_)}function l(N,y={}){return new r(N,y.sid,y.altnumber,y.pubnumber,y.index||0,y.parent)}function u(N,y=[],k={}){return new o(N,y,k.sid,k.index||0,k.parent)}function d(N,y=[],k={},_=0,E){return new a(N,y,k,_,E)}function m(N,y,k={}){return new p(N,y,k.sid,k.altnumber,k.pubnumber,k.index||0,k.parent)}function g(N,y=[],k,_=0,E){return new f(N,y,k,_,E)}function T(N,y={},k={}){return new n(N,y,k.sid,k.eid,k.who,k.index||0,k.parent)}function x(N,y=0,k){return new c(N,y,k)}return I}var H={},Ge;function Cr(){if(Ge)return H;Ge=1,Object.defineProperty(H,"__esModule",{value:!0}),H.USJNodeAdapter=void 0,H.createUSJAdapter=i,H.adaptUSJDocument=s,H.convertUSJWithExistingVisitor=r,H.isUSJAdapter=o;class e{constructor(p,f,n=0){this.usjNode=p,this.parent=f,this.index=n,this.type=this.mapUSJTypeToASTType(p.type),this.marker=p.marker,this.content=this.wrapChildren(p.content)}getParent(){return this.parent}getNextSibling(){if(!this.parent)return;const p=this.parent.getChildren();if(Array.isArray(p))return p[this.index+1]}getPreviousSibling(){if(!this.parent)return;const p=this.parent.getChildren();if(Array.isArray(p))return p[this.index-1]}getChildren(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content:[]}accept(p){switch(this.type){case"paragraph":return p.visitParagraph(this);case"character":return p.visitCharacter(this);case"note":return p.visitNote(this);case"text":return p.visitText(this);case"milestone":return p.visitMilestone(this);default:return p.visitParagraph(this)}}acceptWithContext(p,f){switch(this.type){case"paragraph":return p.visitParagraph(this,f);case"character":return p.visitCharacter(this,f);case"note":return p.visitNote(this,f);case"text":return p.visitText(this,f);case"milestone":return p.visitMilestone(this,f);default:return p.visitParagraph(this,f)}}getUSJProperty(p){return this.usjNode[p]}getOriginalUSJNode(){return this.usjNode}mapUSJTypeToASTType(p){switch(p){case"book":case"chapter":case"para":return"paragraph";case"char":case"verse":return"character";case"note":return"note";case"ms":return"milestone";default:return"paragraph"}}wrapChildren(p){return typeof p=="string"?p:Array.isArray(p)?p.map((f,n)=>typeof f=="string"?f:new e(f,this,n)):[]}}H.USJNodeAdapter=e;function i(a){return new e(a)}function s(a){return!a.content||!Array.isArray(a.content)?[]:a.content.map((p,f)=>new e(p,void 0,f))}function r(a,p){return s(a).map(n=>n.accept(p))}function o(a){return a instanceof e}return H}var $e;function Ar(){return $e||($e=1,(function(e){var i=X&&X.__createBinding||(Object.create?(function(n,c,t,l){l===void 0&&(l=t);var u=Object.getOwnPropertyDescriptor(c,t);(!u||("get"in u?!c.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return c[t]}}),Object.defineProperty(n,l,u)}):(function(n,c,t,l){l===void 0&&(l=t),n[l]=c[t]})),s=X&&X.__exportStar||function(n,c){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(c,t)&&i(c,n,t)};
1Object.defineProperty(e,"__esModule",{value:!0}),e.isParagraphNode=r,e.isCharacterNode=o,e.isTextNode=a,e.isNoteNode=p,e.isMilestoneNode=f;function r(n){return n.type==="paragraph"}function o(n){return n.type==="character"}function a(n){return n.type==="text"}function p(n){return n.type==="note"}function f(n){return n.type==="milestone"}s(vr(),e),s(xr(),e),s(Pr(),e),s(_r(),e),s(Cr(),e)})(X)),X}var oe={},Ke;function Mr(){return Ke||(Ke=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.UsjTypes=void 0,oe.UsjTypes={structural:{book:"book",chapter:"chapter",para:"para",table:"table",sidebar:"sidebar",figure:"figure",optbreak:"optbreak"},inline:{ref:"ref",char:"char",verse:"verse",ms:"ms",note:"note",whitespace:"whitespace","table:row":"table:row","table:cell":"table:cell"}}),oe}var Te={},Qe;function Sr(){return Qe||(Qe=1,Object.defineProperty(Te,"__esModule",{value:!0})),Te}var ve={},Xe;function Er(){return Xe||(Xe=1,Object.defineProperty(ve,"__esModule",{value:!0})),ve}var Z={},xe={},Ye;function wr(){return Ye||(Ye=1,Object.defineProperty(xe,"__esModule",{value:!0})),xe}var Pe={},Ze;function Ir(){return Ze||(Ze=1,Object.defineProperty(Pe,"__esModule",{value:!0})),Pe}var _e={},et;
1function Rr(){return et||(et=1,Object.defineProperty(_e,"__esModule",{value:!0})),_e}var Ce={},tt;function jr(){return tt||(tt=1,Object.defineProperty(Ce,"__esModule",{value:!0})),Ce}var Ae={},rt;function Or(){return rt||(rt=1,Object.defineProperty(Ae,"__esModule",{value:!0})),Ae}var Me={},at;function qr(){return at||(at=1,Object.defineProperty(Me,"__esModule",{value:!0})),Me}var Se={},nt;function Lr(){return nt||(nt=1,Object.defineProperty(Se,"__esModule",{value:!0})),Se}var ue={},it;function Wr(){if(it)return ue;it=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.isProjectPushStale=e;function e(i){return i.kind==="stale"}return ue}var Ee={},st;function Br(){return st||(st=1,Object.defineProperty(Ee,"__esModule",{value:!0})),Ee}var we={},ot;function Vr(){return ot||(ot=1,Object.defineProperty(we,"__esModule",{value:!0})),we}var ct;function Dr(){return ct||(ct=1,(function(e){var i=Z&&Z.__createBinding||(Object.create?(function(r,o,a,p){p===void 0&&(p=a);var f=Object.getOwnPropertyDescriptor(o,a);(!f||("get"in f?!o.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,p,f)}):(function(r,o,a,p){p===void 0&&(p=a),r[p]=o[a]})),s=Z&&Z.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&i(o,r,a)};Object.defineProperty(e,"__esModule",{value:!0}),s(wr(),e),s(Ir(),e),s(Rr(),e),s(jr(),e),s(Or(),e),s(qr(),e),s(Lr(),e),s(Wr(),e),s(Br(),e),s(Vr(),e)})(Z)),Z}var lt;function me(){return lt||(lt=1,(function(e){var i=Q&&Q.__createBinding||(Object.create?(function(r,o,a,p){p===void 0&&(p=a);var f=Object.getOwnPropertyDescriptor(o,a);(!f||("get"in f?!o.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,p,f)}):(function(r,o,a,p){p===void 0&&(p=a),r[p]=o[a]})),s=Q&&Q.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&i(o,r,a)};Object.defineProperty(e,"__esModule",{value:!0}),s(Ar(),e),s(Mr(),e),s(Sr(),e),s(Er(),e),s(Dr(),e)})(Q)),Q}var C={},pt;function ae(){if(pt)return C;pt=1,Object.defineProperty(C,"__esModule",{value:!0}),C.ParsedTableCellNode=C.ParsedTableRowNode=C.ParsedTableNode=C.ParsedRefNode=C.ParsedOptbreakNode=C.ParsedSidebarNode=C.ParsedTextNode=C.ParsedMilestoneNode=C.ParsedNoteNode=C.ParsedVerseNode=C.ParsedCharacterNode=C.ParsedParagraphNode=C.ParsedChapterNode=C.ParsedBookNode=C.ParsedRootNode=C.BaseEnhancedUSJNode=void 0,C.createParsedBook=N,C.createParsedChapter=y,C.createParsedParagraph=k,C.createParsedCharacter=_,C.createParsedVerse=E,C.createParsedNote=R,C.createParsedMilestone=V,C.createParsedText=S,C.createParsedSidebar=O,C.createParsedOptbreak=L,C.createParsedRef=q,C.createParsedTable=D,C.createParsedTableRow=ge,C.createParsedTableCell=be;const e=me(),i=fe();class s{constructor(h,b){Object.defineProperty(this,"_index",{value:h,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(this,"_parent",{value:b,writable:!0,enumerable:!1,configurable:!0})}getParent(){return this._parent}getNextSibling(){const h=this.getParent();if(!h)return;const b=h.getChildren();if(Array.isArray(b))return b[this._index+1]}getPreviousSibling(){const h=this.getParent();if(!h)return;const b=h.getChildren();if(Array.isArray(b))return b[this._index-1]}}C.BaseEnhancedUSJNode=s;class r{constructor(h){this.content=h,this.type="root"}getChildren(){return this.content}toJSON(){return{type:"USJ",version:"3.1",content:this.content.map(h=>(0,e.toPlainUSJ)(h))}}}C.ParsedRootNode=r;class o extends s{constructor(h,b=[],M=0,w){super(M,w),this.code=h,this.content=b,this.type="book",this.marker="id"}getChildren(){return this.content.join(" ")}accept(h){return h.visitBook?h.visitBook(this):h.visitParagraph(this)}acceptWithContext(h,b){return h.visitBook?h.visitBook(this,b):h.visitParagraph(this,b)}}C.ParsedBookNode=o;class a extends s{constructor(h,b,M,w,j=0,U){super(j,U),this.number=h,this.type="chapter",this.marker="c",b&&(this.sid=b),M&&(this.altnumber=M),w&&(this.pubnumber=w)}getChildren(){return[]}accept(h){return h.visitChapter?h.visitChapter(this):h.visitParagraph(this)}acceptWithContext(h,b){return h.visitChapter?h.visitChapter(this,b):h.visitParagraph(this,b)}}C.ParsedChapterNode=a;class p extends s{constructor(h,b=[],M,w=0,j){super(w,j),this.marker=h,this.content=b,this.type="para",M&&(this.sid=M)}getChildren(){return this.content||[]}accept(h){return h.visitParagraph(this)}acceptWithContext(h,b){return h.visitParagraph(this,b)}
1toJSON(){const h={type:this.type,marker:this.marker};return i.USFMMarkerRegistry.getInstance().getMarkerInfo(this.marker)?.role!=="break"&&(h.content=this.content.map(w=>w.toJSON?w.toJSON():w)),this.sid&&(h.sid=this.sid),h}}C.ParsedParagraphNode=p;class f extends s{constructor(h,b=[],M={},w=0,j){super(w,j),this.marker=h,this.content=b,this.type="char",Object.entries(M).forEach(([U,ne])=>{this[U]=ne})}getChildren(){return this.content||[]}accept(h){return h.visitCharacter(this)}acceptWithContext(h,b){return h.visitCharacter(this,b)}}C.ParsedCharacterNode=f;class n extends s{constructor(h,b,M,w,j,U=0,ne){super(U,ne),this.marker=h,this.number=b,this.type="verse",M&&(this.sid=M),w&&(this.altnumber=w),j&&(this.pubnumber=j)}getChildren(){return[]}accept(h){return h.visitVerse?h.visitVerse(this):h.visitCharacter(this)}acceptWithContext(h,b){return h.visitVerse?h.visitVerse(this,b):h.visitCharacter(this,b)}}C.ParsedVerseNode=n;class c extends s{constructor(h,b=[],M,w,j=0,U){super(j,U),this.marker=h,this.content=b,this.caller=M,this.category=w,this.type="note"}getChildren(){return this.content||[]}accept(h){return h.visitNote(this)}acceptWithContext(h,b){return h.visitNote(this,b)}toJSON(){const h={type:this.type,marker:this.marker,content:this.content.map(b=>b.toJSON?b.toJSON():b)};return this.caller&&(h.caller=this.caller),this.category&&(h.category=this.category),h}}C.ParsedNoteNode=c;class t extends s{constructor(h,b={},M,w,j,U=0,ne){super(U,ne),this.marker=h,this.type="ms",M&&(this.sid=M),w&&(this.eid=w),j&&(this.who=j),Object.entries(b).forEach(([Yt,Zt])=>{this[Yt]=Zt})}getChildren(){return[]}accept(h){return h.visitMilestone(this)}acceptWithContext(h,b){return h.visitMilestone(this,b)}}C.ParsedMilestoneNode=t;class l extends s{constructor(h,b=0,M){super(b,M),this.content=h,this.type="text"}getChildren(){return this.content}accept(h){return h.visitText(this)}acceptWithContext(h,b){return h.visitText(this,b)}toJSON(){return this.content}}C.ParsedTextNode=l;class u extends s{constructor(h=[],b,M=0,w){super(M,w),this.content=h,this.category=b,this.type="sidebar",this.marker="esb"}getChildren(){return this.content}accept(h){return h.visitSidebar?h.visitSidebar(this):h.visitParagraph(this)}acceptWithContext(h,b){return h.visitSidebar?h.visitSidebar(this,b):h.visitParagraph(this,b)}toJSON(){const h={type:this.type,marker:this.marker,content:this.content.map(b=>b.toJSON?b.toJSON():b)};return this.category&&(h.category=this.category),h}}C.ParsedSidebarNode=u;class d extends s{constructor(h=0,b){super(h,b),this.type="optbreak"}getChildren(){return[]}accept(h){return h.visitOptbreak?h.visitOptbreak(this):h.visitCharacter(this)}acceptWithContext(h,b){return h.visitOptbreak?h.visitOptbreak(this,b):h.visitCharacter(this,b)}toJSON(){return{type:"optbreak"}}}C.ParsedOptbreakNode=d;class m extends s{constructor(h,b=[],M,w=0,j){super(w,j),this.loc=h,this.content=b,this.gen=M,this.type="ref",M!==void 0&&(this.gen=M)}getChildren(){return this.content||[]}accept(h){return h.visitRef?h.visitRef(this):h.visitCharacter(this)}acceptWithContext(h,b){return h.visitRef?h.visitRef(this,b):h.visitCharacter(this,b)}toJSON(){const h={type:this.type,loc:this.loc,content:this.content?this.content.map(b=>(0,e.toPlainUSJ)(b)):[]};return this.gen!==void 0&&(h.gen=this.gen),h}}C.ParsedRefNode=m;class g extends s{constructor(h=[],b=0,M){super(b,M),this.content=h,this.type="table"}getChildren(){return this.content||[]}accept(h){return h.visitTable?h.visitTable(this):h.visitParagraph(this)}acceptWithContext(h,b){return h.visitTable?h.visitTable(this,b):h.visitParagraph(this,b)}toJSON(){return{type:this.type,content:this.content?this.content.map(h=>(0,e.toPlainUSJ)(h)):[]}}}C.ParsedTableNode=g;class T extends s{constructor(h=[],b=0,M){super(b,M),this.content=h,this.type="table:row",this.marker="tr"}getChildren(){return this.content||[]}accept(h){return h.visitTableRow?h.visitTableRow(this):h.visitParagraph(this)}acceptWithContext(h,b){return h.visitTableRow?h.visitTableRow(this,b):h.visitParagraph(this,b)}toJSON(){return{type:this.type,marker:this.marker,content:this.content?this.content.map(h=>(0,e.toPlainUSJ)(h)):[]}}}C.ParsedTableRowNode=T;class x extends s{constructor(h,b,M=[],w,j=0,U){super(j,U),this.marker=h,this.align=b,this.content=M,this.colspan=w,this.type="table:cell",w&&(this.colspan=w)}getChildren(){return this.content||[]}accept(h){return h.visitTableCell?h.visitTableCell(this):h.visit
1Character(this)}acceptWithContext(h,b){return h.visitTableCell?h.visitTableCell(this,b):h.visitCharacter(this,b)}toJSON(){const h={type:this.type,marker:this.marker,align:this.align,content:this.content?this.content.map(b=>(0,e.toPlainUSJ)(b)):[]};return this.colspan&&(h.colspan=this.colspan),h}}C.ParsedTableCellNode=x;function N(A,h=[],b=0,M){return new o(A,h,b,M)}function y(A,h={}){return new a(A,h.sid,h.altnumber,h.pubnumber,h.index||0,h.parent)}function k(A,h=[],b={}){return new p(A,h,b.sid,b.index||0,b.parent)}function _(A,h=[],b={},M=0,w){return new f(A,h,b,M,w)}function E(A,h,b={}){return new n(A,h,b.sid,b.altnumber,b.pubnumber,b.index||0,b.parent)}function R(A,h=[],b,M,w=0,j){return new c(A,h,b,M,w,j)}function V(A,h={},b={}){return new t(A,h,b.sid,b.eid,b.who,b.index||0,b.parent)}function S(A,h=0,b){return new l(A,h,b)}function O(A=[],h,b=0,M){return new u(A,h,b,M)}function L(A=0,h){return new d(A,h)}function q(A,h=[],b,M=0,w){return new m(A,h,b,M,w)}function D(A=[],h=0,b){return new g(A,h,b)}function ge(A=[],h=0,b){return new T(A,h,b)}function be(A,h,b=[],M,w=0,j){return new x(A,h,b,M,w,j)}return C}var J={},ht;function dt(){if(ht)return J;ht=1,Object.defineProperty(J,"__esModule",{value:!0}),J.attachParserNodeMeta=r,J.getParserNodeId=o,J.getParserSourceSpan=a,J.finalizeParsedTree=n,J.propagateSourceSpans=c;const e=ae(),i="_nodeId",s="_sourceSpan";function r(t,l){Object.defineProperty(t,i,{value:l.nodeId,writable:!1,enumerable:!1,configurable:!0}),l.sourceSpan&&Object.defineProperty(t,s,{value:{...l.sourceSpan},writable:!1,enumerable:!1,configurable:!0})}function o(t){if(!t||typeof t!="object")return;const l=Object.getOwnPropertyDescriptor(t,i)?.value;return typeof l=="number"?l:void 0}function a(t){if(!t||typeof t!="object")return;const l=Object.getOwnPropertyDescriptor(t,s)?.value;if(l&&typeof l=="object"&&typeof l.start=="number"&&typeof l.end=="number")return l}function p(t){return typeof t=="object"&&t!==null&&typeof t.getChildren=="function"}function f(t){const l=t.getChildren?.();return Array.isArray(l)?l:[]}function n(t,l){const u=l?.sourceSpans??l?.rootSourceSpans;let d=1;function m(g,T){const x=T instanceof e.ParsedRootNode?void 0:T;for(let N=0;N<g.length;N++){const y=g[N];if(typeof y=="string"||!p(y))continue;const k=y;Object.defineProperty(k,"_parent",{value:x,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(k,"_index",{value:N,writable:!0,enumerable:!1,configurable:!0});const _=u?.get(k);r(k,{nodeId:d++,..._?{sourceSpan:_}:{}});const E=f(y);E.length>0&&m(E,k)}}m(t.content,t)}function c(t){function l(u){const d=u,m=a(d);if(m)return m;const g=f(u);let T;for(const x of g){if(typeof x=="string")continue;const N=l(x);N&&(T=T?{start:Math.min(T.start,N.start),end:Math.max(T.end,N.end)}:{...N})}if(T){const x=o(d);return x!==void 0&&r(d,{nodeId:x,sourceSpan:T}),T}}for(const u of t.content)typeof u!="string"&&p(u)&&l(u)}return J}var ut;function Ur(){return ut||(ut=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParserSourceSpan=e.getParserNodeId=e.attachParserNodeMeta=e.propagateSourceSpans=e.finalizeParsedTree=e.USFMParser=void 0;const i=fe(),s=me(),r=ae(),o=dt();class a{constructor(n){this.pos=0,this.input="",this.rootNode=null,this.logs=[],this.positionVisits=new Map,this.MAX_VISITS=1e3,this.currentMethod="",this.inferredMarkers={},this.currentBookCode="",this.currentChapter="",this.currentVerse="",this.sourceSpans=new WeakMap,this.trackPositions=n?.positionTracking??!1,this.markerRegistry=i.USFMMarkerRegistry.getInstance(n?.customMarkers);const c=n?.logger,t=n?.silentConsole??!1;this.emitConsoleWarn=l=>{c?.warn?c.warn(l):t||console.warn(l)},this.emitConsoleError=l=>{c?.error?c.error(l):t||console.error(l)},this.recordSourcePositions=n?.sourcePositions??!1}getInferredMarkers(){return{...this.inferredMarkers}}clearInferredMarkers(){this.inferredMarkers={}}hasInferredMarkers(){return Object.keys(this.inferredMarkers).length>0}parse(n){return typeof n=="string"&&this.load(n),this.setPosition(0),this.trackPositions&&this.positionVisits.clear(),this.currentBookCode="",this.currentChapter="",this.currentVerse="",this.sourceSpans=new WeakMap,this.currentMethod="parse",this.rootNode=this.parseNodes(),(0,o.finalizeParsedTree)(this.rootNode,this.recordSourcePositions?{sourceSpans:this.sourceSpans}:void 0),this.recordSourcePositions&&this.rootNode&&(0,o.propagateSourceSpans)(this.rootNode),this}parseChapter(n,c,t){return this.load(n),this.setPosition(0),this.trackPositions&&this.positionVisits.clear(),this.currentBookCode=c.trim(),this.currentChapter=String(t),this.currentVerse="",this.sourceSpans=new WeakMap,this.currentMethod="parseChapter",this.rootNode=this.parseNodes(),(0,o.finalizeParsedTree)(this.rootNode,this.recordSourcePositions?{sourceSpans:this.sourceSpans}:void 0),this.recordSourcePositions&&this.rootNode&&(0,o.propagateSourceSpans)(this.rootNode),this}load(n){return this.input=n,this}getNodes(){return this.rootNode?.content||[]}getRootNode(){return this.rootNode}toJSON(){return this.rootNode?.toJSON()||{type:"USJ",version:"3.1",content:[]}}getInput(){return this.input}normalize(){return this.input=this.normalizeWhitespace(this.input),this}getLogs(){return this.logs}clearLogs(){this.logs=[]}getMarkerStyleType(n){return n?.styleType}parseNodes(){const n=new r.ParsedRootNode([]);for(;this.pos<this.input.length;){this.movePosition(0,!0,"parseNodes");const c=this.getCurrentCharacter();
1if(c==="\\"){const t=this.pos,{marker:l,isNested:u,markerInfo:d}=this.parseMarker(),m=T=>{n.content.push(T),this.recordSourcePositions&&this.sourceSpans.set(T,{start:t,end:this.pos})};if(!l)continue;if(l==="usfm"){const T=this.parseSpecialContent().trim();T!==a.SUPPORTED_USJ_VERSION&&this.logWarning(`USFM version mismatch: found version ${T}, but USJ output supports version ${a.SUPPORTED_USJ_VERSION}. This may cause compatibility issues.`);continue}const g=this.getMarkerStyleType(d);switch(d?.type){case s.MarkerTypeEnum.PARAGRAPH:if(g==="book")m(this.parseBook(l,n.content.length));else if(g==="chapter")m(this.parseChapterMarker(l,n.content.length));else if(g==="table:row")m(this.parseTable(n.content.length));else if(d.sectionContainer)m(this.parseSection(l,n.content.length));else{if(d.closes)continue;d.role==="break"?m(this.parseBreakParagraph(l,n.content.length)):m(this.parseEnhancedParagraph(l,n.content.length))}break;case s.MarkerTypeEnum.CHARACTER:m(g==="verse"?this.parseVerse(l,n.content.length):this.parseEnhancedCharacter(l,u,n.content.length));break;case s.MarkerTypeEnum.NOTE:m(this.parseNote(l,n.content.length));break;case s.MarkerTypeEnum.MILESTONE:m(this.parseEnhancedMilestone(l,n.content.length));break}}else if(this.isWhitespace(c))this.advance(!1);else{const t=n.content.length>0?n.content[n.content.length-1]:void 0;if(!this.allowsImplicitRootTextAfter(t)){const{context:l,pointer:u}=this.getContextAndPointer(this.pos);this.logWarning(`Unexpected character outside a paragraph: '${c}'
2Context: ${l}
3         ${u}`)}{const l=this.pos,u=this.parseEnhancedText(!1,n.content.length);u&&(n.content.push(u),this.recordSourcePositions&&this.sourceSpans.set(u,{start:l,end:this.pos}))}}}return n}allowsImplicitRootTextAfter(n){if(!n||typeof n!="object")return!1;switch(n.type){case"verse":case"chapter":case"note":case"text":case"char":case"ms":case"optbreak":case"ref":return!0;default:return!1}}logWarning(n){this.logs.push({type:"warn",message:n}),this.emitConsoleWarn(n)}logError(n){this.logs.push({type:"error",message:n}),this.emitConsoleError(n)}isLineBreakingWhitespace(n){return n===`
4`||n==="\r"||n==="\f"}isNonLineBreakingWhitespace(n){return n===" "||n==="	"||n==="\v"||n===" "}isWhitespace(n){return this.isLineBreakingWhitespace(n)||this.isNonLineBreakingWhitespace(n)}isNewline(n){return this.isLineBreakingWhitespace(n)}normalizeNewlineToSpace(n,c,t=!0){const l=n.trimEnd(),u=n.length!==l.length;let d=c+1;const m=d<this.input.length&&this.isNonLineBreakingWhitespace(this.input[d]);for(;d<this.input.length&&this.isNonLineBreakingWhitespace(this.input[d]);)d++;const g=d<this.input.length?this.input[d]:"",T=g==="\\",x=this.isLineBreakingWhitespace(g);let N=!1;if(T){const k=this.peekNextMarker(this.input,d+1);k&&(N=this.markerRegistry.getMarkerInfo(k)?.type===s.MarkerTypeEnum.MILESTONE)}let y;return l.length===0?y="":g===""?y=u?l+" ":l:N&&!t?y=l:u||m?y=l+" ":x?y=l:y=l+" ",{normalizedContent:y,skipToPos:d}}normalizeWhitespace(n){const c=n.replace(/\r\n|\r|\n\n/g,`
5`).replace(/\s+/g," ");let t="",l=0,u=!1,d=!1;for(;l<c.length;){const m=c[l];if(m==="\\"){const g=this.peekNextMarker(c,l+1);if(!g){t+=m,l++,d=!1,u=!1;continue}const T=this.markerRegistry.getMarkerType(g),x=this.markerRegistry.getMarkerInfo(g),N=this.getMarkerStyleType(x);if(T===s.MarkerTypeEnum.PARAGRAPH){!d&&t.length>0&&(t=t.trimEnd()+`
6`);const y=this.peekNextMarkerAfterCurrent(c,l,g);y.hasContent&&(y.isText||y.marker&&y.markerType!==s.MarkerTypeEnum.PARAGRAPH&&y.marker!=="v"&&y.marker)}else if(N==="verse")!d&&t.length>0&&(t=t.trimEnd()+`
7`);else if(N==="chapter")!d&&t.length>0&&(t=t.trimEnd()+`
8`);else if(T===s.MarkerTypeEnum.CHARACTER||T===s.MarkerTypeEnum.NOTE){const y=t.trimEnd();y.length>0&&!d&&(t=y+" ")}t+=m,l++,d=!1,u=!1;continue}this.isWhitespace(m)?(this.isNewline(m)?(d||(t+=`
9`),d=!0):u||(t+=" ",d=!1),u=!0):(t+=m,u=!1,d=!1),l++}return t}peekNextMarkerAfterCurrent(n,c,t){let l=c+1+t.length;for(;l<n.length&&this.isNonLineBreakingWhitespace(n[l]);)l++;if(l>=n.length||this.isLineBreakingWhitespace(n[l]))return{isText:!1,hasContent:!1};if(n[l]==="\\"){const u=this.peekNextMarker(n,l+1);if(u){const d=this.markerRegistry.getMarkerType(u);return{marker:u,markerType:d,isText:!1,hasContent:!0}}}return{isText:!0,hasContent:!0}}peekNextNonWhitespace(n,c){let t=c;for(;t<n.length;){if(!this.isWhitespace(n[t]))return n[t];t++}return""}peekNextMarker(n,c){let t="",l=c;for(;l<n.length;){const u=n[l];if(this.isWhitespace(u)||u==="\\")break;if(u==="+"||u==="*")return"";t+=u,l++}return t}preserveSignificantWhitespace(){this.pos<this.input.length&&this.input[this.pos]===" "&&this.advance(!1)}movePosition(n,c=!1,t){if(t&&(this.currentMethod=t),c&&this.trackPositions){const l=this.positionVisits.get(this.pos)||0;if(this.positionVisits.set(this.pos,l+1),l>this.MAX_VISITS){const{context:u,pointer:d}=this.getContextAndPointer(this.pos);throw new Error(`Potential infinite loop detected in ${this.currentMethod} at position ${this.pos}.
10Context: ${u}
11         ${d}`)}}this.pos+=n}advance(n=!1){this.movePosition(1,n)}retreat(n=!1){this.movePosition(-1,n)}setPosition(n,c=!1){const t=n-this.pos;this.movePosition(t,c)}getCurrentPosition(){return this.pos}restorePosition(n,c=!1){this.setPosition(n,c)}
11parseMarker(){if(this.advance(!1),this.pos<this.input.length&&this.input[this.pos]==="*")return this.advance(!1),{marker:"",isNested:!1,cleanMarker:"",markerInfo:void 0,isClosingMarker:!1};const n=this.pos<this.input.length&&this.input[this.pos]==="+";n&&this.advance(!1);let c="";for(;this.pos<this.input.length;){const u=this.input[this.pos];if(this.isWhitespace(u)||u==="*"||u==="\\")break;c+=u,this.advance(!0)}const t=this.pos<this.input.length&&this.input[this.pos]==="*";this.preserveSignificantWhitespace();let l=this.markerRegistry.getMarkerInfo(c);return!l&&c&&(l=this.handleCustomMarker(c)),{marker:c,isNested:n,cleanMarker:this.cleanMarkerSuffix(c),markerInfo:l,isClosingMarker:t}}handleCustomMarker(n){const c=this.determineCustomMarkerType(n);let t;switch(c){case s.MarkerTypeEnum.CHARACTER:t={type:"character"};break;case s.MarkerTypeEnum.MILESTONE:t={type:"milestone"};break;case s.MarkerTypeEnum.PARAGRAPH:t={type:"paragraph"};break}return t&&(this.markerRegistry.addMarker(n,t),this.inferredMarkers[n]=t,this.logWarning(`Unsupported marker in USFM: '\\${n}', inferred as ${c}, please add it to the customMarkers option parameter in the USFMParser constructor to stop seeing this warning`)),t}getContextAndPointer(n){const c=this.input.slice(Math.max(0,n-20),Math.min(this.input.length,n+20)),t=" ".repeat(Math.min(20,n))+"^";return{context:c,pointer:t}}determineCustomMarkerType(n){return this.isMilestoneMarker(n)?s.MarkerTypeEnum.MILESTONE:this.checkForPrecedingLineBreak(n)?s.MarkerTypeEnum.PARAGRAPH:s.MarkerTypeEnum.CHARACTER}checkForPrecedingLineBreak(n){const c=this.getCurrentPosition();for(this.pos-=n.length+2;this.pos>0;){const t=this.input[this.pos-1];if(this.isLineBreakingWhitespace(t))return this.restorePosition(c,!1),!0;if(!this.isNonLineBreakingWhitespace(t))break;this.retreat(!1)}return this.restorePosition(c,!1),!1}isMilestoneMarker(n){if(this.markerRegistry.getMarkerInfo(n)?.type==="milestone"||n.endsWith("-s")||n.endsWith("-e"))return!0;const t=this.getCurrentPosition();let l=!1;for(;this.pos<this.input.length;){const u=this.input[this.pos];if(u==="\\"&&this.pos+1<this.input.length&&this.input[this.pos+1]==="*"){l=!0;break}if(u==="\\"||this.isLineBreakingWhitespace(u))break;this.advance(!1)}return this.restorePosition(t,!1),l}isTableCellMarker(n){const c=this.markerRegistry.getMarkerInfo(n);return this.getMarkerStyleType(c)==="table:cell"}cleanMarkerSuffix(n){let c=n;return(c.endsWith("-s")||c.endsWith("-e"))&&(c=c.slice(0,-2)),c.match(/\w\d$/)&&(c=c.slice(0,-1)),c}getFollowingMarker(){for(;this.pos<this.input.length;){this.movePosition(0,!0,"getFollowingMarker");const n=this.input[this.pos];if(this.isWhitespace(n)){this.advance(!1);continue}else if(n==="\\"){const{marker:c,cleanMarker:t,markerInfo:l}=this.peekMarker();return{marker:c,cleanMarker:t,markerInfo:l}}else return{marker:"",cleanMarker:"",markerInfo:void 0}}return{marker:"",cleanMarker:"",markerInfo:void 0}}peekMarker(){const n=this.getCurrentPosition();this.advance(!1);let c="";for(;this.pos<this.input.length;){const l=this.input[this.pos];if(this.isWhitespace(l)||l==="*"||l==="\\")break;c+=l,this.advance(!0)}this.restorePosition(n,!1);const t=c?this.markerRegistry.getMarkerInfo(c):void 0;return{marker:c,cleanMarker:this.cleanMarkerSuffix(c),markerInfo:t}}getCurrentCharacter(){return this.input[this.pos]}getNextCharacter(n=1){return this.input[this.pos+n]}getPreviousCharacter(n=1){return this.input[this.pos-n]}parseAttributes(n){this.advance(!1);const c={};let t="",l="",u=!1,d=!1;for(;this.pos<this.input.length&&this.input[this.pos]===" ";)this.advance(!1);let m=!0,g=this.pos,T=!1;for(;g<this.input.length;){const y=this.input[g];if(y==="\\")break;if(y==="="){T=!0,m=!1;break}if(y===" "&&!T)break;g++}const N=(n?this.markerRegistry.getMarkerInfo(n):void 0)?.defaultAttribute;if(m&&N){let y="";for(;this.pos<this.input.length;){const k=this.input[this.pos];if(k==="\\")break;y+=k,this.advance(!1)}for(y&&(c[N]=y.trim());this.pos<this.input.length&&this.input[this.pos]===" ";)this.advance(!1)}for(;this.pos<this.input.length;){this.movePosition(0,!0,"parseAttributes");const y=this.input[this.pos];if(y==='"'){d=!d,this.advance(!1);continue}if(!d){if(y==="\\"){t&&l&&(c[t.trim()]=l.trim().replace(/^"|"$/g,""));break}if(y==="="){u=!0,this.advance(!1);continue}if(y===" "){t&&l&&(c[t.trim()]=l.trim().replace(/^"|"$/g,""),t="",l="",u=!1),this.advance(!1);continue}}u?d&&this.isNewline(y)?(l.length===0||!this.isWhitespace(l[l.length-1]))&&
11(l+=" "):l+=y:t+=y,this.advance(!1)}return t&&l&&(c[t.trim()]=l.trim().replace(/^"|"$/g,"")),c}visit(n){return this.getNodes().map(c=>c.accept(n))}visitWithContext(n,c){return this.getNodes().map(t=>t.acceptWithContext(n,c))}parseBook(n,c){for(;this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter());)this.advance(!1);let t="";for(;this.pos<this.input.length;){const d=this.getCurrentCharacter();if(this.isWhitespace(d))break;t+=d,this.advance(!1)}this.currentBookCode=t,this.currentChapter="",this.currentVerse="";const l=[];let u="";for(;this.pos<this.input.length;){const d=this.getCurrentCharacter();if(d==="\\"){const{markerInfo:m}=this.peekMarker();if(m?.type===s.MarkerTypeEnum.PARAGRAPH)break}if(this.isLineBreakingWhitespace(d))break;u+=d,this.advance(!1)}return u.trim()&&l.push(u.trim()),(0,r.createParsedBook)(t,l,c)}parseChapterMarker(n,c){for(;this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter());)this.advance(!1);let t="";for(;this.pos<this.input.length;){const d=this.getCurrentCharacter();if(this.isWhitespace(d)||d==="\\")break;t+=d,this.advance(!1)}this.currentChapter=t,this.currentVerse="";const l=this.currentBookCode&&this.currentBookCode.trim()?`${this.currentBookCode} ${t}`:void 0,u=(0,r.createParsedChapter)(t,{sid:l,index:c});for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length||this.getCurrentCharacter()!=="\\"));){const d=this.getCurrentPosition(),{marker:m,markerInfo:g}=this.parseMarker();if(this.canMarkerMergeInto(g,"c")&&g?.mergeAs){this.skipWhitespace();let T="";if(g.type==="character"){const x="\\"+m+"*";for(;this.pos<this.input.length;){if(this.input.startsWith(x,this.pos)){this.pos+=x.length;break}T+=this.getCurrentCharacter(),this.advance(!1)}}else T=this.parseSpecialContent();u[g.mergeAs]=T.trim();continue}else{this.restorePosition(d,!1);break}}return u}parseVerse(n,c,t){for(;this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter());)this.advance(!1);let l="";for(;this.pos<this.input.length;){const m=this.getCurrentCharacter();if(this.isWhitespace(m)||m==="\\")break;l+=m,this.advance(!1)}this.currentVerse=l;const u=this.currentBookCode&&this.currentBookCode.trim()&&this.currentChapter&&this.currentChapter.trim()?`${this.currentBookCode} ${this.currentChapter}:${l}`:void 0;this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter())&&this.advance(!1);const d=(0,r.createParsedVerse)(n,l,{sid:u,index:c});for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length||this.getCurrentCharacter()!=="\\"));){const m=this.getCurrentPosition(),{marker:g,markerInfo:T}=this.parseMarker();if(this.canMarkerMergeInto(T,"v")&&T?.mergeAs){this.skipWhitespace();let x="";if(T.type==="character"){const N="\\"+g+"*";for(;this.pos<this.input.length;){if(this.input.startsWith(N,this.pos)){this.pos+=N.length;break}x+=this.getCurrentCharacter(),this.advance(!1)}}else x=this.parseSpecialContent();d[T.mergeAs]=x.trim();continue}else{this.restorePosition(m,!1);break}}return t!==void 0&&this.recordSourcePositions&&this.sourceSpans.set(d,{start:t,end:this.pos}),d}parseEnhancedParagraph(n,c){const t=(0,r.createParsedParagraph)(n,[],{index:c});if(this.markerRegistry.getMarkerInfo(n)?.role==="break")return t;for(this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter())&&this.advance(!1);this.pos<this.input.length;){this.movePosition(0,!0,"parseEnhancedParagraph");const u=this.getCurrentCharacter();if(u==="\\"){const d=this.getCurrentPosition(),{marker:m,isNested:g,markerInfo:T}=this.parseMarker();if(T?.type===s.MarkerTypeEnum.PARAGRAPH){if(t.content.length>0){const x=t.content[t.content.length-1];x.type==="text"&&(x.content=x.content.trimEnd())}this.restorePosition(d,!1);break}switch(T?.type){case s.MarkerTypeEnum.MILESTONE:t.content.push(this.parseEnhancedMilestone(m,t.content.length));break;case s.MarkerTypeEnum.CHARACTER:this.getMarkerStyleType(T)==="verse"?t.content.push(this.parseVerse(m,t.content.length,d)):t.content.push(this.parseEnhancedCharacter(m,g,t.content.length));break;case s.MarkerTypeEnum.NOTE:t.content.push(this.parseNote(m,t.content.length));break;default:{const x=this.parseEnhancedText(!0,t.content.length);x&&t.content.push(x);break}}}else if(u==="/"&&this.getNextCharacter()==="/"){this.advance(!1),this.advance(!1);const{createParsedOptbreak:d}=ae();t.content.push(d(t.content.length))}else if(this.isLineBreakingWhitespace(u)){const{marker:d,markerInfo:m}=this.getFollowingMarker();if(!d){const T=this.parseEnhancedText(!0,t.content.length);T&&t.content.push(T);continue}if(!m||m.type===s.MarkerTypeEnum.PARAGRAPH)break;if(t.content.length===0)continue;const g=t.content[t.content.length-1];if(g.type==="text"){g.content=g.content.trimEnd()+" ";continue}t.content.push((0,r.createParsedText)(" ",t.content.length));continue}else{const d=this.parseEnhancedText(!0,t.content.length);d&&t.content.push(d)}}return t}parseEnhancedCharacter(n,c,t){const l=this.markerRegistry.getMarkerInfo(n);if(this.getMarkerStyleType(l)==="ref")return this.parseRefMarker(t);const d=(0,r.createParsedCharacter)(n,[],{},t);let m="";const g=`\\${c?"+":""}${n}*`;for(;this.pos<this.input.length;){if(this.input.startsWith(g,this.pos)){m&&(d.content.push((0,r.createParsedText)(m,d.content.length)),m=""),this.pos+=g.length;break}const T=this.input[this.pos];if(T==="\\"){const{marker:x,markerInfo:N}=this.peekMarker();if(N?.type===s.MarkerTypeEnum.PARAGRAPH)break;m&&(d.content.push((0,r.createParsedText)(m,d.content.length)),m="");const{marker:y,isNested:k,markerInfo:_}=this.parseMarker();
11switch(_?.type){case s.MarkerTypeEnum.NOTE:d.content.push(this.parseNote(y,d.content.length));break;case s.MarkerTypeEnum.MILESTONE:d.content.push(this.parseEnhancedMilestone(y,d.content.length));break;default:const E=this.parseEnhancedCharacter(y,k,0);d.content.length>0,d.content.push(E);break}}else if(T==="/"&&this.getNextCharacter()==="/"){m&&(d.content.push((0,r.createParsedText)(m,d.content.length)),m=""),this.advance(!1),this.advance(!1);const{createParsedOptbreak:x}=ae();d.content.push(x(d.content.length))}else if(T==="|"){const x=this.parseAttributes(n);Object.entries(x).forEach(([N,y])=>{d[N]=y})}else if(this.isLineBreakingWhitespace(T)){const x=this.normalizeNewlineToSpace(m,this.pos,!0);m=x.normalizedContent,this.pos=x.skipToPos}else m+=T,this.advance(!1)}return m&&d.content.push((0,r.createParsedText)(m,d.content.length)),d}parseRefMarker(n){let c="",t="",l=!1;const u="\\ref*";for(;this.pos<this.input.length;){if(this.input.startsWith(u,this.pos)){this.pos+=u.length;break}const m=this.input[this.pos];if(m==="|"&&!l){l=!0,this.advance(!1);continue}l?t+=m:c+=m,this.advance(!1)}const d=c.trim()?[(0,r.createParsedText)(c.trim(),0)]:[];return(0,r.createParsedRef)(t.trim(),d,void 0,n)}nextLineBreakIndex(n){const c=this.input.indexOf(`
12`,n),t=this.input.indexOf("\r",n);return c===-1&&t===-1?this.input.length:c===-1?t:t===-1?c:Math.min(c,t)}hasAnotherNoteCloseAhead(n,c){const t=`\\${n}*`,l=this.nextLineBreakIndex(c),u=this.input.indexOf(t,c);if(u===-1||u>=l)return!1;const d=`\\${n} `,m=this.input.indexOf(d,c);return!(m!==-1&&m<u)}parseNote(n,c){const t=(0,r.createParsedNote)(n,[],void 0,void 0,c);for(;this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter());)this.advance(!1);if(this.markerRegistry.getMarkerInfo(n)?.type===s.MarkerTypeEnum.NOTE){const N=this.getCurrentCharacter(),y=this.pos+1<this.input.length?this.getNextCharacter():"";!this.isWhitespace(N)&&this.isWhitespace(y)&&(t.caller=N,this.advance(!1),this.skipWhitespace())}for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length||this.getCurrentCharacter()!=="\\"));){const N=this.getCurrentPosition(),{marker:y,markerInfo:k}=this.parseMarker();if(this.canMarkerMergeInto(k,n)&&k?.mergeAs){this.skipWhitespace();let _="";if(k.type==="character"){const E="\\"+y+"*";for(;this.pos<this.input.length;){if(this.input.startsWith(E,this.pos)){this.pos+=E.length;break}_+=this.getCurrentCharacter(),this.advance(!1)}}else _=this.parseSpecialContent();t[k.mergeAs]=_.trim();continue}else{this.restorePosition(N,!1);break}}let u="";const d=[],m=()=>d.length>0?d[d.length-1]:null,g=()=>{if(!u)return;const N=m();N?N.content.push((0,r.createParsedText)(u,N.content.length,N)):t.content.push((0,r.createParsedText)(u,t.content.length,t)),u=""},T=N=>{d.length===0&&t.content.push(N)},x=`\\${n}*`;for(;this.pos<this.input.length;){if(this.input.startsWith(x,this.pos)){if(g(),d.length>0){const y=d.pop();if(T(y),this.pos+=x.length,d.length===0){if((y.marker==="fqa"||y.marker==="fdc")&&this.hasAnotherNoteCloseAhead(n,this.pos))continue;break}continue}this.pos+=x.length;break}const N=this.getCurrentCharacter();if(N==="\\"){const{marker:y,markerInfo:k}=this.peekMarker();if(k?.type===s.MarkerTypeEnum.PARAGRAPH||y==="c")break;const{marker:_,isNested:E,markerInfo:R,isClosingMarker:V}=this.parseMarker(),S=L=>L?.context?.includes("NoteContent"),O=m();if(V&&O&&O.marker===_){u&&O.content.push((0,r.createParsedText)(u,O.content.length));const L=d.pop();T(L),u="",this.advance(!1);continue}if(R&&S(R)){if(g(),m()){const q=d.pop();T(q)}d.push((0,r.createParsedCharacter)(_,[],{},0))}else{const L=`\\${_}*`,q=m();if(q&&_===q.marker&&this.input.startsWith(L,this.pos-_.length-1)){u&&(q.content.push((0,r.createParsedText)(u,q.content.length)),u="");const D=d.pop();T(D),this.pos<this.input.length&&this.input[this.pos]==="*"&&this.advance(!1)}else if(u&&(m()?m().content.push((0,r.createParsedText)(u,m().content.length)):t.content.push((0,r.createParsedText)(u,t.content.length)),u=""),m()){const D=this.parseEnhancedCharacter(_,E,m().content.length);m().content.push(D)}else{const D=this.parseEnhancedCharacter(_,E,t.content.length);t.content.push(D)}}}else if(N==="/"&&this.getNextCharacter()==="/"){u&&(m()?m().content.push((0,r.createParsedText)(u,m().content.length)):t.content.push((0,r.createParsedText)(u,t.content.length)),u=""),this.advance(!1),this.advance(!1);const{createParsedOptbreak:y}=ae();m()?m().content.push(y(m().content.length)):t.content.push(y(t.content.length))}else if(this.isLineBreakingWhitespace(N)){const y=this.normalizeNewlineToSpace(u,this.pos);u=y.normalizedContent,this.pos=y.skipToPos}else u+=N,this.advance(!1)}for(g();d.length>0;){const N=d.pop();T(N)}return t}parseEnhancedMilestone(n,c){let t={};for(this.pos<this.input.length&&this.input[this.pos]==="|"&&(t=this.parseAttributes(n));this.pos<this.input.length;){if(this.input[this.pos]==="\\"&&this.pos+1<this.input.length&&this.input[this.pos+1]==="*"){this.pos+=2;break}this.advance(!1)}return this.skipWhitespace(),(0,r.createParsedMilestone)(n,t,{index:c})}parseEnhancedText(n,c){const t=this.pos;let l="";for(;this.pos<this.input.length;){this.movePosition(0,!0,"parseEnhancedText");const d=this.input[this.pos];if(d==="/"&&this.getNextCharacter()==="/"||d==="\\")break;if(this.isLineBreakingWhitespace(d)){const m=this.normalizeNewlineToSpace(l,this.pos,n);
12l=m.normalizedContent,this.pos=m.skipToPos}else l+=d,this.advance(!1)}if(l==="")return null;const u=(0,r.createParsedText)(l,c);return this.recordSourcePositions&&this.sourceSpans.set(u,{start:t,end:this.pos}),u}parseSection(n,c){const l=this.markerRegistry.getMarkerInfo(n)?.closedBy,u=(0,r.createParsedSidebar)([],void 0,c);for(this.skipWhitespace();this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length||this.getCurrentCharacter()!=="\\"));){const d=this.getCurrentPosition(),{marker:m,markerInfo:g}=this.parseMarker();if(this.canMarkerMergeInto(g,"esb")&&g?.mergeAs){this.skipWhitespace();let T="";if(g.type==="character"){const x="\\"+m+"*";for(;this.pos<this.input.length;){if(this.input.startsWith(x,this.pos)){this.pos+=x.length;break}T+=this.getCurrentCharacter(),this.advance(!1)}}else T=this.parseSpecialContent();u[g.mergeAs]=T.trim();continue}else{this.restorePosition(d,!1);break}}for(;this.pos<this.input.length;){this.movePosition(0,!0,"parseSection");const d=this.getCurrentCharacter();if(d==="\\"){const m=this.getCurrentPosition(),{marker:g}=this.parseMarker();if(g===l)break;this.restorePosition(m,!1);const{marker:T,markerInfo:x}=this.parseMarker();if(x?.type===s.MarkerTypeEnum.PARAGRAPH)u.content.push(this.parseEnhancedParagraph(T,u.content.length));else if(x?.type===s.MarkerTypeEnum.CHARACTER){this.restorePosition(m,!1);{const N=this.parseEnhancedText(!1,u.content.length);N&&u.content.push(N)}}else{this.restorePosition(m,!1);{const N=this.parseEnhancedText(!1,u.content.length);N&&u.content.push(N)}}}else if(this.isWhitespace(d))this.advance(!1);else{const m=this.parseEnhancedText(!1,u.content.length);m&&u.content.push(m)}}return u}parseBreakParagraph(n,c){return(0,r.createParsedParagraph)(n,[],{index:c})}skipWhitespace(){for(;this.pos<this.input.length&&this.isWhitespace(this.getCurrentCharacter());)this.advance(!1)}parseSpecialContent(){let n="";for(;this.pos<this.input.length&&!this.isLineBreakingWhitespace(this.getCurrentCharacter())&&this.getCurrentCharacter()!=="\\";)n+=this.getCurrentCharacter(),this.advance(!1);return n.trim()}canMarkerMergeInto(n,c){if(!n?.mergesInto)return!1;const t=this.markerRegistry.getMarkerInfo(c);return this.checkMergeSpecification(n.mergesInto,c,t)}checkMergeSpecification(n,c,t){return n&&typeof n=="object"&&!Array.isArray(n)?this.checkMergeTargetObject(n,c,t):Array.isArray(n)?n.some(l=>this.checkMergeTargetObject(l,c,t)):!1}checkMergeTargetObject(n,c,t){return!n||typeof n!="object"?!1:!!(n.markers&&Array.isArray(n.markers)&&n.markers.includes(c)||n.types&&Array.isArray(n.types)&&t?.type&&n.types.includes(t.type)||n.roles&&Array.isArray(n.roles)&&t?.role&&n.roles.includes(t.role))}parseTable(n){const c=[];for(c.push(this.parseTableRow(c.length));this.pos<this.input.length;){this.movePosition(0,!0,"parseTable");const t=this.getCurrentCharacter();if(t==="\\"){const l=this.getCurrentPosition(),{marker:u,markerInfo:d}=this.parseMarker();if(this.getMarkerStyleType(d)==="table:row")c.push(this.parseTableRow(c.length));else if(d?.type===s.MarkerTypeEnum.PARAGRAPH){this.restorePosition(l,!1);break}else{this.restorePosition(l,!1);break}}else if(this.isWhitespace(t))this.advance(!1);else break}return(0,r.createParsedTable)(c,n)}parseTableRow(n){const c=[];for(this.skipWhitespace();this.pos<this.input.length;){this.movePosition(0,!0,"parseTableRow");const t=this.getCurrentCharacter();if(t==="\\"){const l=this.getCurrentPosition(),{marker:u,markerInfo:d}=this.parseMarker();if(this.getMarkerStyleType(d)==="table:cell")c.push(this.parseTableCell(u,c.length));else if(d?.type===s.MarkerTypeEnum.PARAGRAPH){this.restorePosition(l,!1);break}else{this.restorePosition(l,!1);break}}else{if(this.isLineBreakingWhitespace(t))break;if(this.isWhitespace(t))this.advance(!1);else break}}return(0,r.createParsedTableRow)(c,n)}parseTableCell(n,c){const{align:t,colspan:l,baseMarker:u}=this.parseTableCellProperties(n),d=[];let m="";for(;this.pos<this.input.length;){this.movePosition(0,!0,"parseTableCell");const g=this.getCurrentCharacter();if(g==="\\"){const{marker:T}=this.peekMarker(),x=this.markerRegistry.getMarkerInfo(T),N=this.getMarkerStyleType(x);if(N==="table:cell"||N==="table:row")break;m&&(d.push((0,r.createParsedText)(m,d.length)),m="");const{marker:y,isNested:k,markerInfo:_}=this.parseMarker();_?.type===s.MarkerTypeEnum.CHARACTER?d.push(this.parseEnhancedCharacter(y,k,d.length)):m+="\\"+y+" "}else{if(this.isLineBreakingWhitespace(g))break;m+=g,this.advance(!1)}}return m&&d.push((0,r.createParsedText)(m,d.length)),(0,r.createParsedTableCell)(u,t,d,l,c)}parseTableCellProperties(n){let c="start";n.startsWith("thr")||n.startsWith("tcr")?c="end":(n.startsWith("thc")||n.startsWith("tcc"))&&(c="center");let t,l=n;const u=n.lastIndexOf("-");if(u>0){const d=n.slice(u+1),m=n.slice(0,u);let g=d.length>0;for(let T=0;g&&T<d.length;
12T++){const x=d.charCodeAt(T);(x<48||x>57)&&(g=!1)}if(g){let T=m.length;for(;T>0;){const N=m.charCodeAt(T-1);if(N<48||N>57)break;T--}const x=m.slice(T);if(x.length>0){const N=parseInt(x,10);t=(parseInt(d,10)-N+1).toString(),l=m}}}return{align:c,colspan:t,baseMarker:l}}}e.USFMParser=a,a.SUPPORTED_USJ_VERSION="3.1";var p=dt();Object.defineProperty(e,"finalizeParsedTree",{enumerable:!0,get:function(){return p.finalizeParsedTree}}),Object.defineProperty(e,"propagateSourceSpans",{enumerable:!0,get:function(){return p.propagateSourceSpans}}),Object.defineProperty(e,"attachParserNodeMeta",{enumerable:!0,get:function(){return p.attachParserNodeMeta}}),Object.defineProperty(e,"getParserNodeId",{enumerable:!0,get:function(){return p.getParserNodeId}}),Object.defineProperty(e,"getParserSourceSpan",{enumerable:!0,get:function(){return p.getParserSourceSpan}})})(Ne)),Ne}var ee={},ce={},yt;function Fr(){if(yt)return ce;yt=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.MarkerHandler=void 0;const e=fe(),i=me();let s=class{constructor(o){this.markerRegistry=e.USFMMarkerRegistry.getInstance(o)}getMarkerInfo(o){return this.markerRegistry.getMarkerInfo(o)}cleanMarkerSuffix(o){let a=o;return(a.endsWith("-s")||a.endsWith("-e"))&&(a=a.slice(0,-2)),a.match(/\w\d$/)&&(a=a.slice(0,-1)),a}determineCustomMarkerType(o,a,p){return a?i.MarkerTypeEnum.MILESTONE:p?i.MarkerTypeEnum.PARAGRAPH:i.MarkerTypeEnum.CHARACTER}handleCustomMarker(o,a,p){const f=this.determineCustomMarkerType(o,a,p);let n;switch(f){case i.MarkerTypeEnum.CHARACTER:n={type:i.MarkerTypeEnum.CHARACTER};break;case i.MarkerTypeEnum.MILESTONE:n={type:i.MarkerTypeEnum.MILESTONE};break;case i.MarkerTypeEnum.PARAGRAPH:n={type:i.MarkerTypeEnum.PARAGRAPH};break}return n&&this.markerRegistry.addMarker(o,n),n}};return ce.MarkerHandler=s,ce}var le={},ft;function Hr(){if(ft)return le;
12ft=1,Object.defineProperty(le,"__esModule",{value:!0}),le.NodeFactory=void 0;let e=class{createNode(s,r,o){throw new Error("NodeFactory needs to be refactored - use main parser createNode method")}createTextNode(s,r,o){return this.createNode({type:"text",content:s},r,o)}createParagraphNode(s,r,o,a){return this.createNode({type:"paragraph",marker:s,attributes:r},o,a)}createCharacterNode(s,r,o,a){return this.createNode({type:"character",marker:s,attributes:r},o,a)}createNoteNode(s,r,o,a){return this.createNode({type:"note",marker:s,attributes:r},o,a)}createMilestoneNode(s,r,o,a){return this.createNode({type:"milestone",marker:s,attributes:r},o,a)}};return le.NodeFactory=e,le}var pe={},mt;function zr(){if(mt)return pe;mt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.PositionTracker=void 0;let e=class{constructor(s){this.pos=0,this.positionVisits=new Map,this.MAX_VISITS=1e3,this.currentMethod="",this.trackPositions=s}movePosition(s,r=!1,o){if(o&&(this.currentMethod=o),r&&this.trackPositions){const a=this.positionVisits.get(this.pos)||0;if(this.positionVisits.set(this.pos,a+1),a>this.MAX_VISITS)throw new Error(`Potential infinite loop detected in ${this.currentMethod} at position ${this.pos}.`)}this.pos+=s}advance(s=!1){this.movePosition(1,s)}retreat(s=!1){this.movePosition(-1,s)}setPosition(s,r=!1){const o=s-this.pos;this.movePosition(o,r)}getPosition(){return this.pos}savePosition(){return this.pos}restorePosition(s,r=!1){this.setPosition(s,r)}clear(){this.pos=0,this.positionVisits.clear()}};return pe.PositionTracker=e,pe}var he={},gt;function Jr(){if(gt)return he;gt=1,Object.defineProperty(he,"__esModule",{value:!0}),he.WhitespaceHandler=void 0;const e=me();let i=class{isLineBreakingWhitespace(r){return r===`
13`||r==="\r"||r==="\f"}isNonLineBreakingWhitespace(r){return r===" "||r==="	"||r==="\v"||r===" "}isWhitespace(r){return this.isLineBreakingWhitespace(r)||this.isNonLineBreakingWhitespace(r)}normalizeWhitespace(r,o){const a=r.replace(/\r\n|\r/g,`
14`);let p="",f=0,n=!1,c=!1;for(;f<a.length;){const t=a[f];if(t==="\\"){const l=this.peekNextMarker(a,f+1),u=o.getMarkerInfo(l);if(u?.type===e.MarkerTypeEnum.PARAGRAPH)!c&&p.length>0&&(p=p.trimEnd()+`
15`);else if(u?.type===e.MarkerTypeEnum.CHARACTER||u?.type===e.MarkerTypeEnum.NOTE){const d=p.trimEnd();d.length>0&&!c&&(p=d+" ")}p+=t,f++,c=!1,n=!1;continue}this.isWhitespace(t)?(this.isLineBreakingWhitespace(t)?(c||(p+=`
16`),c=!0):n||(p+=" ",c=!1),n=!0):(p+=t,n=!1,c=!1),f++}return p}peekNextMarker(r,o){let a="",p=o;for(;p<r.length;){const f=r[p];if(this.isWhitespace(f)||f==="\\")break;if(f==="+"||f==="*")return"";a+=f,p++}return a}};return he.WhitespaceHandler=i,he}var bt;function Gr(){return bt||(bt=1,(function(e){var i=ee&&ee.__createBinding||(Object.create?(function(r,o,a,p){p===void 0&&(p=a);var f=Object.getOwnPropertyDescriptor(o,a);(!f||("get"in f?!o.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,p,f)}):(function(r,o,a,p){p===void 0&&(p=a),r[p]=o[a]})),s=ee&&ee.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&i(o,r,a)};Object.defineProperty(e,"__esModule",{value:!0}),s(Fr(),e),s(Hr(),e),s(zr(),e),s(Jr(),e)})(ee)),ee}var te={},Nt;function $r(){return Nt||(Nt=1,(function(e){var i=te&&te.__createBinding||(Object.create?(function(c,t,l,u){u===void 0&&(u=l);var d=Object.getOwnPropertyDescriptor(t,l);(!d||("get"in d?!t.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return t[l]}}),Object.defineProperty(c,u,d)}):(function(c,t,l,u){u===void 0&&(u=l),c[u]=t[l]})),s=te&&te.__exportStar||function(c,t){for(var l in c)l!=="default"&&!Object.prototype.hasOwnProperty.call(t,l)&&i(t,c,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.MilestoneUSFMNode=e.NoteUSFMNode=e.TextUSFMNode=e.CharacterUSFMNode=e.ParagraphUSFMNode=void 0;class r{constructor(t,l){const u=t,d=l;this.getParent=()=>d,this.getNextSibling=()=>d?.content?.[u+1],this.getPreviousSibling=()=>d?.content?.[u-1]}getChildren(){return this.content||[]}}class o extends r{constructor(t){super(t.index,t.parent),this.type="paragraph",this.marker=t.marker,this.content=t.content}accept(t){return t.visitParagraph(this)}acceptWithContext(t,l){return t.visitParagraph(this,l)}}e.ParagraphUSFMNode=o;class a extends r{constructor(t){super(t.index,t.parent),this.type="character",this.marker=t.marker,this.content=t.content,this.attributes=t.attributes}accept(t){return t.visitCharacter(this)}acceptWithContext(t,l){return t.visitCharacter(this,l)}}e.CharacterUSFMNode=a;class p extends r{constructor(t){super(t.index,t.parent),this.type="text",this.content=t.content}accept(t){return t.visitText(this)}acceptWithContext(t,l){return t.visitText(this,l)}}e.TextUSFMNode=p;class f extends r{constructor(t){super(t.index,t.parent),this.type="note",this.marker=t.marker,this.content=t.content,this.caller=t.caller}accept(t){return t.visitNote(this)}acceptWithContext(t,l){return t.visitNote(this,l)}}e.NoteUSFMNode=f;class n extends r{constructor(t){super(t.index,t.parent),this.type="milestone",this.marker=t.marker,this.milestoneType=t.milestoneType,this.attributes=t.attributes}accept(t){return t.visitMilestone(this)}acceptWithContext(t,l){return t.visitMilestone(this,l)}}e.MilestoneUSFMNode=n,s(ae(),e)})(te)),te}var kt;function Kr(){return kt||(kt=1,(function(e){var i=$&&$.__createBinding||(Object.create?(function(r,o,a,p){p===void 0&&(p=a);var f=Object.getOwnPropertyDescriptor(o,a);(!f||("get"in f?!o.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,p,f)}):(function(r,o,a,p){p===void 0&&(p=a),r[p]=o[a]})),s=$&&$.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&i(o,r,a)};
16Object.defineProperty(e,"__esModule",{value:!0}),s(Ur(),e),s(fe(),e),s(Gr(),e),s($r(),e)})($)),$}var Ot=Kr();const Qr=rr(Ot),Xr=lr({__proto__:null,default:Qr},[Ot]);function Yr(){const e=Xr,i=e.USFMParser;if(typeof i=="function")return i;const s=e.default;if(s&&typeof s=="object"&&typeof s.USFMParser=="function")return s.USFMParser;if(typeof s=="function")return s;throw new Error("[usj-processor] USFMParser not found in @usfm-tools/parser (CJS/ESM interop failed). Run: bun install")}const Ka=Yr(),Zr=new Set(["p","q","q1","q2","q3","q4","qa","qr","qc","qm","qm1","qm2","qm3","qd","b","m","mi","pi","pi1","pi2","li","li1","li2","li3","nb","pc","pr","cls","pmo","pm","pmc","pmr","po"]),qt=new Set(["s","s1","s2","s3","s4","r","ms","ms1","mr","d","sp","sr"]),Lt=new Set(["mt","mt1","mt2","mt3","mt4","mte","mte1","imt","imt1","imt2","is","is1","is2","iot","io","io1","io2","ip","ipi","im","imi","ipq","imq","ipr","iex"]),ea=new Set(["f","fe","x"]),ta=new Set(["id","h","toc1","toc2","toc3","ide","sts","rem","usfm"]);function ra(e){switch(e){case"q":case"q1":case"qm":case"qm1":case"li":case"li1":return 1;case"q2":case"qm2":case"pi":case"pi1":case"li2":return 2;case"q3":case"qm3":case"pi2":case"li3":return 3;case"q4":return 4;default:return 0}}function aa(e){return e==="b"?"break":qt.has(e)?"heading":Lt.has(e)?"intro":"para"}function Wt(e,i){return`${e}:${i}`}function na(e){const i=new Map;for(const s of e.chapters)for(const r of s.verses)i.set(Wt(s.number,r.number),[...r.tokens]);return i}function ia(e){if(e.verse<=0)return;const i=Wt(e.chapter,e.verse),s=e.queues.get(i);if(!(!s||s.length===0))return s.shift()}function de(e,i,s){for(const r of e){if(typeof r=="string"){r.length>0&&s.push({kind:"text",text:r,chapter:i.chapter});continue}if(!Ie(r))continue;const o=String(r.marker??""),a=typeof r.type=="string"?r.type:"";if(a==="chapter"){const p=typeof r.number=="number"?r.number:typeof r.number=="string"?parseInt(r.number,10):NaN;Number.isFinite(p)&&(i.chapter=p,i.verse=0);continue}if(a==="verse"){let p=typeof r.number=="number"?r.number:typeof r.number=="string"?parseInt(r.number,10):NaN;if(!Number.isFinite(p)&&typeof r.sid=="string"){const f=Re(r.sid);f&&(i.chapter=f.chapter,p=f.verse)}Number.isFinite(p)&&(i.verse=p,s.push({kind:"verse",chapter:i.chapter,verse:p})),Array.isArray(r.content)&&de(r.content,i,s);continue}if(!ta.has(o)){if(a==="char"&&o==="w"){const p=Rt(r.content),f=ia(i);f?s.push({kind:"token",token:f,chapter:i.chapter}):p&&s.push({kind:"text",text:p,chapter:i.chapter});continue}if(!ea.has(o)){if(Lt.has(o)||qt.has(o)){s.push({kind:"para-break",marker:o||"s",chapter:i.chapter});const p=[];Array.isArray(r.content)&&de(r.content,i,p);for(const f of p)f.kind==="text"?s.push({kind:"heading",text:f.text,chapter:f.chapter}):f.kind==="token"?s.push({kind:"heading",text:f.token.content,chapter:f.chapter}):f.kind!=="para-break"&&s.push(f);continue}if(Zr.has(o)||a==="para"){s.push({kind:"para-break",marker:o||"p",chapter:i.chapter||1}),Array.isArray(r.content)&&de(r.content,i,s);continue}Array.isArray(r.content)&&de(r.content,i,s)}}}}function sa(e){const i=[];let s=null;const r=()=>{s&&((s.inline.length>0||s.role==="break"||s.marker==="b")&&i.push(s),s=null)},o=(a,p)=>{r(),s={marker:a,role:aa(a),indentLevel:ra(a),chapterNumber:p,inline:[],verseNumbers:[]}};for(const a of e){if(a.kind==="para-break"){o(a.marker,a.chapter||1);continue}if(s||o("p",a.chapter||1),a.chapter>0&&s.chapterNumber===0&&(s.chapterNumber=a.chapter),a.kind==="verse"){s.inline.push({kind:"verse",chapterNumber:a.chapter,verseNumber:a.verse}),s.verseNumbers.includes(a.verse)||s.verseNumbers.push(a.verse);continue}if(a.kind==="token"){s.inline.push({kind:"token",token:a.token});const p=Re(a.token.verseRef);p&&!s.verseNumbers.includes(p.verse)&&s.verseNumbers.push(p.verse);continue}if(a.kind==="heading"){s.inline.push({kind:"heading",text:a.text});continue}if(a.kind==="text"){if(a.text.trim().length===0&&s.inline.length===0)continue;s.inline.push({kind:"text",text:a.text})}}return r(),i}function Qa(e,i){const s={chapter:0,verse:0,queues:na(i)},r=[];return de(e.content??[],s,r),sa(r)}function Bt(e){return Re(e.verseRef)}function oa(e,i){for(let s=i;s<e.length;s++){const r=e[s];if(r.kind==="verse")return{chapter:r.chapterNumber,verse:r.verseNumber};if(r.kind==="token"){const o=Bt(r.token);if(o)return o}}return null}function je(e,i){return!e||i.kind!=="token"?!1:e.kind==="text"?!/\s$/.test(e.text):e.kind==="verse"||e.kind==="token"||e.kind==="heading"}function Vt(e,i,s){const r=[],o=[];let a=i,p=null;const f=(c,t)=>{a=c,p=t},n=(c,t)=>s(c,t);for(let c=0;c<e.length;c++){const t=e[c];if(t.kind==="verse"){if(f(t.chapterNumber,t.verseNumber),!n(t.chapterNumber,t.verseNumber))continue;r.push(t),o.includes(t.verseNumber)||o.push(t.verseNumber);continue}if(t.kind==="token"){const l=Bt(t.token);if(l&&f(l.chapter,l.verse),p===null||!n(a,p))continue;r.push(t),o.includes(p)||o.push(p);continue}
16if(t.kind==="heading"){r.push(t);continue}if(t.kind==="text"){let l=a,u=p;if(u===null){const d=oa(e,c+1);if(!d)continue;l=d.chapter,u=d.verse}if(u===null||!n(l,u))continue;r.push(t)}}return{inline:r,verseNumbers:o}}function ca(e,i){if(e.verseNumbers.length===0||e.verseNumbers.every(r=>i(e.chapterNumber,r)))return e;const s=Vt(e.inline,e.chapterNumber,i);return s.inline.length===0&&e.role!=="break"&&e.marker!=="b"?null:{...e,inline:s.inline,verseNumbers:s.verseNumbers}}function Xa(e,i,s){const r=[];for(const o of e){const p=Vt(o.inline,o.chapterNumber||i,(f,n)=>f===i&&n===s).inline.filter(f=>f.kind!=="verse");p.length!==0&&(r.length>0&&je(r[r.length-1],p[0])&&r.push({kind:"text",text:" "}),r.push(...p))}for(;r.length>0;){const o=r[0];if(o.kind!=="text"||o.text.trim()!=="")break;r.shift()}for(;r.length>0;){const o=r[r.length-1];if(o.kind!=="text"||o.text.trim()!=="")break;r.pop()}return r}function Ya(e,i){const s=i.chapters&&i.chapters.length>0?new Set(i.chapters):null,r=n=>!s||s.has(n.chapterNumber);if(!i.includeVerse)return e.filter(r);const o=i.includeVerse,a=new Set;e.forEach((n,c)=>{r(n)&&n.verseNumbers.some(t=>o(n.chapterNumber,t))&&a.add(c)});const p=new Set(a);for(const n of a)for(let c=n-1;c>=0;c--){const t=e[c];if(!r(t)||t.verseNumbers.length>0)break;if(t.role==="heading"||t.role==="intro"||t.role==="break"){p.add(c);continue}break}const f=[];return e.forEach((n,c)=>{if(!p.has(c))return;const t=ca(n,o);t&&f.push(t)}),f}const Dt=new Set(["ar","he","hbo","fa","ur","yi","ku"]);function Za(e,i,s){return e==="rtl"||e==="ltr"?e:i==="rtl"||i==="ltr"?i:s&&Dt.has(s.toLowerCase())?"rtl":"ltr"}function en(e){return!!e&&Dt.has(e.toLowerCase())}function la(e){return`p-1.5 rounded-md transition-colors ${e?"bg-accent-soft text-accent hover:bg-accent/15":"text-fg-muted hover:bg-muted hover:text-fg-secondary"}`}function pa(e){const i=e?ar(e):null,s=i?.key??null,r=!!i?.readme?.trim(),[o,a]=B.useState(null);if(B.useEffect(()=>{if(!e||!s){a(null);return}if(r){a({key:s,docs:{},done:!0});return}let c=!1;return a({key:s,docs:{},done:!1}),(async()=>{const t=await nr(e);c||a({key:s,docs:t,done:!0})})(),()=>{c=!0}},[e,s,r]),!i||!s)return{modalResource:null,loadingBody:!1};const p=o?.key===s?o:null,f=p?.docs,n=!r&&!p?.done;return{modalResource:{...i,readme:i.readme?.trim()?i.readme:f?.readme,license:i.license?.trim()?i.license:f?.license||i.license},loadingBody:n}}function tn({resource:e}){const[i,s]=B.useState(!1),{modalResource:r,loadingBody:o}=pa(i?e:null);return v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",onClick:()=>s(!0),title:"Resource info","aria-label":"Resource info","aria-pressed":i,className:la(i),children:v.jsx(or,{className:"w-4 h-4","aria-hidden":!0})}),r?v.jsx(ir,{isOpen:i,onClose:()=>s(!1),resource:r,loadingBody:o}):null]})}function ha(e){return e.normalize("NFD").replace(new RegExp("\\p{M}","gu"),"").toLowerCase()}const G=ha;function da(e){return e.foldedSemanticId=G(e.semanticId),e.foldedAlignedIds=e.alignedOriginalWordIds.map(G),e}function rn(e){for(const i of e.chapters)for(const s of i.verses)for(const r of s.tokens)da(r);return e}function an(e){return e?e.foldedSemanticId&&e.foldedAlignedIdSet?e:{...e,foldedSemanticId:G(e.semanticId),foldedAlignedIdSet:new Set((e.alignedSemanticIds??[]).map(G))}:null}function Ut(e){return e.foldedSemanticId!==void 0?{semanticId:e.foldedSemanticId,alignedOriginalWordIds:e.foldedAlignedIds??[]}:{semanticId:G(e.semanticId),alignedOriginalWordIds:e.alignedOriginalWordIds.map(G)}}function Ft(e){return e?e.foldedSemanticId!==void 0&&e.foldedAlignedIdSet?{semanticId:e.foldedSemanticId,alignedSemanticIds:e.foldedAlignedIdSet}:{semanticId:G(e.semanticId),alignedSemanticIds:new Set((e.alignedSemanticIds??[]).map(G))}:null}function nn(e,i){const s=Ft(i);if(!s)return!1;const r=Ut(e);return!!(r.semanticId===s.semanticId||r.alignedOriginalWordIds.includes(s.semanticId)||s.alignedSemanticIds.has(r.semanticId)||r.alignedOriginalWordIds.length>0&&s.alignedSemanticIds.size>0&&r.alignedOriginalWordIds.some(o=>s.alignedSemanticIds.has(o)))}function Oe(e,i){const s=Ut(e),r=Ft(i.highlightTarget);let o=!1,a=!1;r&&(i.isOriginalLanguage?s.semanticId===r.semanticId?(o=!0,a=!0):r.alignedSemanticIds.size>0&&(o=r.alignedSemanticIds.has(s.semanticId)):s.semanticId===r.semanticId?(o=!0,a=!0):s.alignedOriginalWordIds.length>0?s.alignedOriginalWordIds.includes(r.semanticId)?(o=!0,a=!0):r.alignedSemanticIds.size>0&&(o=s.alignedOriginalWordIds.some(n=>r.alignedSemanticIds.has(n))):r.alignedSemanticIds.has(s.semanticId)&&(o=!0));let p=!1;const f=i.underlinedSemanticIds;return f&&f.size>0&&(p=f.has(s.semanticId)||s.alignedOriginalWordIds.some(n=>f.has(n))),{isHighlighted:o,isSelected:a,isUnderlined:p}}const Tt=["","pl-6","pl-10","pl-14","pl-16"];function ua(e){return e<=0?"":Tt[Math.min(e,Tt.length-1)]??"pl-16"}function ya(e,i,s){const r=ua(s),o="leading-relaxed text-lg text-scripture-fg";return i==="break"||e==="b"?"h-3":i==="heading"||i==="intro"?e==="s2"||e==="s3"||e==="s4"?`mt-4 mb-2 text-base italic text-fg-secondary text-center ${r}`:`mt-5 mb-3 text-base font-semibold text-scripture-fg text-center ${r}`:e==="qc"?`${o} text-center mb-2 ${r}`:e==="qr"?`${o} text-right mb-2 ${r}`:s>0||e.startsWith("q")?`${o} mb-1 ${r}`:`${o} mb-3 ${r}`}
16const qe=B.memo(function({token:i,index:s,isHighlighted:r,isSelected:o,isUnderlined:a=!1,onTokenClick:p,isOriginalLanguage:f}){const n=c=>{c.stopPropagation(),p(i)};return v.jsx("span",{onClick:n,"data-token-semantic-id":i.semanticId,"data-highlighted":r||o?"true":void 0,"data-underlined":a?"true":void 0,className:`
17        rounded px-0.5 transition-all inline-block cursor-pointer hover:bg-muted text-scripture-fg
18        ${r||o?"bg-highlight highlighted-token":""}
19        ${a?"underline decoration-dotted decoration-underline decoration-1 underline-offset-3":""}
20      `,style:{minHeight:"1.5rem"},role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),n())},"aria-pressed":r||o,children:i.content})}),sn=B.memo(function({block:i,blockIndex:s,highlightTarget:r,underlinedSemanticIds:o,onTokenClick:a,onVerseClick:p,isOriginalLanguage:f}){const n=ya(i.marker,i.role,i.indentLevel);if(i.role==="break"||i.marker==="b")return v.jsx("div",{className:n,"data-usj-marker":i.marker,"aria-hidden":!0});const c=t=>je(i.inline[t-1],i.inline[t]);return v.jsx("div",{className:n,"data-usj-marker":i.marker,"data-usj-role":i.role,children:i.inline.map((t,l)=>{if(t.kind==="verse")return v.jsx("span",{className:"text-sm font-bold text-blue-600 mr-1.5 select-none cursor-pointer hover:text-blue-700 align-super",onClick:g=>{g.stopPropagation(),p?.(t.chapterNumber,t.verseNumber)},role:"button",tabIndex:0,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p?.(t.chapterNumber,t.verseNumber))},"aria-label":`Verse ${t.verseNumber}`,children:t.verseNumber},`v-${s}-${t.chapterNumber}:${t.verseNumber}-${l}`);if(t.kind==="heading")return v.jsx("span",{className:"text-scripture-fg",children:t.text},`h-${s}-${l}`);if(t.kind==="text")return v.jsx(B.Fragment,{children:t.text},`t-${s}-${l}`);const{isHighlighted:u,isSelected:d,isUnderlined:m}=Oe(t.token,{highlightTarget:r,underlinedSemanticIds:o,isOriginalLanguage:f});return v.jsxs(B.Fragment,{children:[c(l)?" ":null,v.jsx(qe,{token:t.token,index:l,isHighlighted:u,isSelected:d,isUnderlined:m,onTokenClick:a,isOriginalLanguage:f})]},`tok-${t.token.semanticId}-${l}`)})})});function vt(e){if(!e)return null;const i=e.match(/:(\d+)$/);return i?parseInt(i[1],10):null}function fa(e,i,s){const r=vt(e?.verseRef),o=vt(i?.verseRef);return s===r||s===o}function ma(e,i,s,r,o){return e.map((a,p)=>{if(a.kind==="text"||a.kind==="heading")return v.jsx(B.Fragment,{children:a.text},`t-${p}`);if(a.kind!=="token")return null;const{isHighlighted:f,isSelected:n,isUnderlined:c}=Oe(a.token,{highlightTarget:i,underlinedSemanticIds:s,isOriginalLanguage:o});return v.jsxs(B.Fragment,{children:[je(e[p-1],a)?" ":null,v.jsx(qe,{token:a.token,index:p,isHighlighted:f,isSelected:n,isUnderlined:c,onTokenClick:r,isOriginalLanguage:o})]},`token-${a.token.semanticId}-${p}`)})}const on=B.memo(function({verse:i,chapterNumber:s,displayInline:r,highlightTarget:o,underlinedSemanticIds:a,onTokenClick:p,onVerseClick:f,isOriginalLanguage:n}){const c=()=>r&&r.length>0?ma(r,o,a,p,n):!i.tokens||i.tokens.length===0?i.text?v.jsx("span",{className:"text-scripture-muted italic",children:i.text}):v.jsxs("span",{className:"text-danger italic",children:["[No content available for verse ",i.number,"]"]}):i.tokens.map((t,l)=>{const{isHighlighted:u,isSelected:d,isUnderlined:m}=Oe(t,{highlightTarget:o,underlinedSemanticIds:a,isOriginalLanguage:n});return v.jsxs(B.Fragment,{children:[v.jsx(qe,{token:t,index:l,isHighlighted:u,isSelected:d,isUnderlined:m,onTokenClick:p,isOriginalLanguage:n}),l<i.tokens.length-1?" ":null]},`token-${t.semanticId}-${l}`)});return v.jsxs("div",{className:"mb-2 leading-relaxed",children:[v.jsxs("span",{className:"text-sm font-bold text-accent mr-2 select-none cursor-pointer hover:text-accent-hover",onClick:t=>{t.stopPropagation(),f?.(s,i.number)},role:"button",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),f?.(s,i.number))},"aria-label":`Verse ${i.number}`,children:[i.number," "]}),v.jsx("span",{className:"text-lg text-scripture-fg",children:c()})]})},(e,i)=>e.verse!==i.verse||e.displayInline!==i.displayInline||e.underlinedSemanticIds!==i.underlinedSemanticIds||e.onTokenClick!==i.onTokenClick||e.onVerseClick!==i.onVerseClick||e.isOriginalLanguage!==i.isOriginalLanguage||e.chapterNumber!==i.chapterNumber?!1:e.highlightTarget===i.highlightTarget?!0:!fa(e.highlightTarget,i.highlightTarget,i.verse.number)),Le={gen:()=>P(()=>import("./gen-CNyhJ7XS.js"),[]).then(e=>({sections:e.genSections,metadata:e.genMetadata})),exo:()=>P(()=>import("./exo-DO2pUZgv.js"),[]).then(e=>({sections:e.exoSections,metadata:e.exoMetadata})),lev:()=>P(()=>import("./lev-D4ELJnD5.js"),[]).then(e=>({sections:e.levSections,metadata:e.levMetadata})),num:()=>P(()=>import("./num-DQaVtslD.js"),[]).then(e=>({sections:e.numSections,metadata:e.numMetadata})),deu:()=>P(()=>import("./deu-CDFdG7dz.js"),[]).then(e=>({sections:e.deuSections,metadata:e.deuMetadata})),jos:()=>P(()=>import("./jos-Be6fEY4j.js"),[]).then(e=>({sections:e.josSections,metadata:e.josMetadata})),jdg:()=>P(()=>import("./jdg-74ph-DrI.js"),[]).then(e=>({sections:e.jdgSections,metadata:e.jdgMetadata})),rut:()=>P(()=>import("./rut-CeizeY-M.js"),[]).then(e=>({sections:e.rutSections,metadata:e.rutMetadata})),"1sa":()=>P(()=>import("./1sa-L4LXW1wM.js"),[]).then(e=>({sections:e.book1saSections,metadata:e.book1saMetadata})),"2sa":()=>P(()=>import("./2sa-B4dQxk1a.js"),[]).then(e=>({sections:e.book2saSections,metadata:e.book2saMetadata})),"1ki":()=>P(()=>import("./1ki-Bt5Z_DrS.js"),[]).then(e=>({sections:e.book1kiSections,metadata:e.book1kiMetadata})),"2ki":()=>P(()=>import("./2ki-B1vSURCQ.js"),[]).then(e=>({sections:e.book2kiSections,metadata:e.book2kiMetadata})),"1ch":()=>P(()=>import("./1ch-CjmfFfxw.js"),[]).then(e=>({sections:e.book1chSections,metadata:e.book1chMetadata})),"2ch":()=>P(()=>import("./2ch-DSR_KQTL.js"),[]).then(e=>({sections:e.book2chSections,metadata:e.book2chMetadata})),ezr:()=>P(()=>import("./ezr-U-2KU6bV.js"),[]).then(e=>({sections:e.ezrSections,metadata:e.ezrMetadata})),neh:()=>P(()=>import("./neh-C4p4JONE.js"),[]).then(e=>({sections:e.nehSections,metadata:e.nehMetadata})),est:()=>P(()=>import("./est-D8GtpleE.js"),[]).then(e=>({sections:e.estSections,metadata:e.estMetadata})),job:()=>P(()=>import("./job-C_ogKSu4.js"),[]).then(e=>({sections:e.jobSections,metadata:e.jobMetadata})),psa:()=>P(()=>import("./psa-BF4PVQMO.js"),[]).then(e=>({sections:e.psaSections,metadata:e.psaMetadata})),pro:()=>P(()=>import("./pro-DorXSR03.js"),[]).then(e=>({sections:e.proSections,metadata:e.proMetadata})),ecc:()=>P(()=>import("./ecc-D3ieZ49U.js"),[]).then(e=>({sections:e.eccSections,metadata:e.eccMetadata})),sng:()=>P(()=>import("./sng-DrtchO-u.js"),[]).then(e=>({sections:e.sngSections,metadata:e.sngMetadata})),isa:()=>P(()=>import("./isa-CZNTAgOE.js"),[]).then(e=>({sections:e.isaSections,metadata:e.isaMetadata})),jer:()=>P(()=>import("./jer-CEur8WKq.js"),[]).then(e=>({sections:e.jerSections,metadata:e.jerMetadata})),lam:()=>P(()=>import("./lam-CxYLHhVF.js"),[]).then(e=>({sections:e.lamSections,metadata:e.lamMetadata})),ezk:()=>P(()=>import("./ezk-BE5Ts8EN.js"),[]).then(e=>({sections:e.ezkSections,metadata:e.ezkMetadata})),dan:()=>P(()=>import("./dan-vWvyjEBz.js"),[]).then(e=>({sections:e.danSections,metadata:e.danMetadata})),hos:()=>P(()=>
20import("./hos-CuLc5n-d.js"),[]).then(e=>({sections:e.hosSections,metadata:e.hosMetadata})),jol:()=>P(()=>import("./jol-CSXjCOvU.js"),[]).then(e=>({sections:e.jolSections,metadata:e.jolMetadata})),amo:()=>P(()=>import("./amo-DHGOJvne.js"),[]).then(e=>({sections:e.amoSections,metadata:e.amoMetadata})),oba:()=>P(()=>import("./oba-Bqn8xjYa.js"),[]).then(e=>({sections:e.obaSections,metadata:e.obaMetadata})),jon:()=>P(()=>import("./jon-ylOVwdBu.js"),[]).then(e=>({sections:e.jonSections,metadata:e.jonMetadata})),mic:()=>P(()=>import("./mic-COdNG7xf.js"),[]).then(e=>({sections:e.micSections,metadata:e.micMetadata})),nam:()=>P(()=>import("./nam-DbloPzVr.js"),[]).then(e=>({sections:e.namSections,metadata:e.namMetadata})),hab:()=>P(()=>import("./hab-abRjMjHO.js"),[]).then(e=>({sections:e.habSections,metadata:e.habMetadata})),zep:()=>P(()=>import("./zep-Pu4tKkvw.js"),[]).then(e=>({sections:e.zepSections,metadata:e.zepMetadata})),hag:()=>P(()=>import("./hag-D20XU0WK.js"),[]).then(e=>({sections:e.hagSections,metadata:e.hagMetadata})),zec:()=>P(()=>import("./zec-DM8-2ql9.js"),[]).then(e=>({sections:e.zecSections,metadata:e.zecMetadata})),mal:()=>P(()=>import("./mal-2TR9bgwj.js"),[]).then(e=>({sections:e.malSections,metadata:e.malMetadata})),mat:()=>P(()=>import("./mat-DHvyJVJa.js"),[]).then(e=>({sections:e.matSections,metadata:e.matMetadata})),mrk:()=>P(()=>import("./mrk-B1-Hc3si.js"),[]).then(e=>({sections:e.mrkSections,metadata:e.mrkMetadata})),luk:()=>P(()=>import("./luk-tR2Em0-X.js"),[]).then(e=>({sections:e.lukSections,metadata:e.lukMetadata})),jhn:()=>P(()=>import("./jhn-BvPLN64j.js"),[]).then(e=>({sections:e.jhnSections,metadata:e.jhnMetadata})),act:()=>P(()=>import("./act-D_W7C11s.js"),[]).then(e=>({sections:e.actSections,metadata:e.actMetadata})),rom:()=>P(()=>import("./rom-DGl9cRTY.js"),[]).then(e=>({sections:e.romSections,metadata:e.romMetadata})),"1co":()=>P(()=>import("./1co-BUASHBIR.js"),[]).then(e=>({sections:e.book1coSections,metadata:e.book1coMetadata})),"2co":()=>P(()=>import("./2co-B_qldn0x.js"),[]).then(e=>({sections:e.book2coSections,metadata:e.book2coMetadata})),gal:()=>P(()=>import("./gal-aaHoj7Sk.js"),[]).then(e=>({sections:e.galSections,metadata:e.galMetadata})),eph:()=>P(()=>import("./eph-C9LyYYHO.js"),[]).then(e=>({sections:e.ephSections,metadata:e.ephMetadata})),php:()=>P(()=>import("./php-CSslOeC_.js"),[]).then(e=>({sections:e.phpSections,metadata:e.phpMetadata})),col:()=>P(()=>import("./col-B2ovxokg.js"),[]).then(e=>({sections:e.colSections,metadata:e.colMetadata})),"1th":()=>P(()=>import("./1th-DObgD6Jr.js"),[]).then(e=>({sections:e.book1thSections,metadata:e.book1thMetadata})),"2th":()=>P(()=>import("./2th-ARUcmj3b.js"),[]).then(e=>({sections:e.book2thSections,metadata:e.book2thMetadata})),"1ti":()=>P(()=>import("./1ti-Bk4zAtAS.js"),[]).then(e=>({sections:e.book1tiSections,metadata:e.book1tiMetadata})),"2ti":()=>P(()=>import("./2ti-IY9tITa6.js"),[]).then(e=>({sections:e.book2tiSections,metadata:e.book2tiMetadata})),tit:()=>P(()=>import("./tit-C7El6Kv4.js"),[]).then(e=>({sections:e.titSections,metadata:e.titMetadata})),phm:()=>P(()=>import("./phm-Bkkawulc.js"),[]).then(e=>({sections:e.phmSections,metadata:e.phmMetadata})),heb:()=>P(()=>import("./heb-B1m9q-gw.js"),[]).then(e=>({sections:e.hebSections,metadata:e.hebMetadata})),jas:()=>P(()=>import("./jas-CUzs09df.js"),[]).then(e=>({sections:e.jasSections,metadata:e.jasMetadata})),"1pe":()=>P(()=>import("./1pe-C-2otQfe.js"),[]).then(e=>({sections:e.book1peSections,metadata:e.book1peMetadata})),"2pe":()=>P(()=>import("./2pe-Btt3uQBO.js"),[]).then(e=>({sections:e.book2peSections,metadata:e.book2peMetadata})),"1jn":()=>P(()=>import("./1jn-DWC7BNnw.js"),[]).then(e=>({sections:e.book1jnSections,metadata:e.book1jnMetadata})),"2jn":()=>P(()=>import("./2jn-DfxNum2K.js"),[]).then(e=>({sections:e.book2jnSections,metadata:e.book2jnMetadata})),"3jn":()=>P(()=>import("./3jn-BUJ8-AlN.js"),[]).then(e=>({sections:e.book3jnSections,metadata:e.book3jnMetadata})),jud:()=>P(()=>import("./jud-DIsvoNrF.js"),[]).then(e=>({sections:e.judSections,metadata:e.judMetadata})),rev:()=>P(()=>import("./rev-CqeqSNj_.js"),[]).then(e=>({sections:e.revSections,metadata:e.revMetadata}))};async function cn(e){const i=Le[e.toLowerCase()];if(!i)return[];try{const{sections:s}=await i();return s}catch(s){return console.warn(`Failed to load default sections for ${e}:`,s),[]}}async function ln(e){const i=Le[e.toLowerCase()];if(!i)return null;try{const{metadata:s}=await i();return s}catch(s){return console.warn(`Failed to load default sections metadata for ${e}:`,s),null}}function pn(e){return e.toLowerCase()in Le}function hn(e){return e.loadingOriginal?!1:!!(e.originalContent&&e.originalContent.length>0)}function dn(e){return!e.hasTargetTokens||!e.tokensMatchPassage||!e.quoteBuildReady}function Ht(e){return e.hasAlignedTokens?"aligned":e.alignmentPending?"pending":e.olQuote?.trim()?"ol-fallback":"none"}function xt(e,i){const s=i?.toLowerCase();if(!s)return i.toUpperCase();const r=e?.ingredients||e?.contentMetadata?.ingredients||e?.metadata?.contentMetadata?.ingredients;if(r?.length){const a=r.find(p=>p.identifier?.toLowerCase()===s);if(a?.title)return a.title}const o=e?.toc?.books;if(o?.length){const a=o.find(p=>(p.code||p.identifier)?.toLowerCase()===s);if(a?.name)return a.name}return i.toUpperCase()}function un(e,i,s){const r=xt(e,s);return r!==s.toUpperCase()?r:xt(i,s)}function yn(e,i,s){if(!s)return{bookPart:e,numberPart:i};const[r,o]=i.split(":"),a=o!==void 0?`${o}:${r}`:i;return{bookPart:e,numberPart:a}}const ga={gen:"Genesis",exo:"Exodus",lev:"Leviticus",num:"Numbers",deu:"Deuteronomy",jos:"Joshua",jdg:"Judges",rut:"Ruth","1sa":"1 Samuel","2sa":"2 Samuel","1ki":"1 Kings","2ki":"2 Kings","1ch":"
201 Chronicles","2ch":"2 Chronicles",ezr:"Ezra",neh:"Nehemiah",est:"Esther",job:"Job",psa:"Psalms",pro:"Proverbs",ecc:"Ecclesiastes",sng:"Song of Solomon",isa:"Isaiah",jer:"Jeremiah",lam:"Lamentations",ezk:"Ezekiel",dan:"Daniel",hos:"Hosea",jol:"Joel",amo:"Amos",oba:"Obadiah",jon:"Jonah",mic:"Micah",nam:"Nahum",hab:"Habakkuk",zep:"Zephaniah",hag:"Haggai",zec:"Zechariah",mal:"Malachi",mat:"Matthew",mrk:"Mark",luk:"Luke",jhn:"John",act:"Acts",rom:"Romans","1co":"1 Corinthians","2co":"2 Corinthians",gal:"Galatians",eph:"Ephesians",php:"Philippians",col:"Colossians","1th":"1 Thessalonians","2th":"2 Thessalonians","1ti":"1 Timothy","2ti":"2 Timothy",tit:"Titus",phm:"Philemon",heb:"Hebrews",jas:"James","1pe":"1 Peter","2pe":"2 Peter","1jn":"1 John","2jn":"2 John","3jn":"3 John",jud:"Jude",rev:"Revelation"};function fn(e){return ga[e.toLowerCase()]||e.toUpperCase()}const mn="flex-1 overflow-y-auto bg-surface",gn="flex items-center gap-chrome-tight px-chrome py-chrome-tight bg-muted/50 rounded-md",bn="w-3.5 h-3.5 text-fg-secondary",Nn="ml-auto px-1.5 py-0.5 bg-surface text-fg-secondary rounded-full text-micro font-medium",zt="bg-surface hover:border-border border-border-subtle",Jt="bg-highlight/15 border-border",ba="underline decoration-dotted decoration-underline decoration-1 underline-offset-2",Gt="mt-2 pt-2 border-t border-border-subtle",$t="flex items-center gap-1.5 w-full text-left text-sm font-medium transition-colors",Na=`${$t} text-accent-fg hover:text-accent`,ka=`${$t} text-warning-fg hover:text-warning`,Kt="w-3.5 h-3.5 flex-shrink-0";function Qt(e){return e.kind==="twl"?!!e.twPreviewPending&&!e.twPreview:e.obsMode?!1:e.quoteStatus==="pending"}function Ta(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function va(e,i){if(!e)return[];const s=i?.trim()??"";if(!s)return[{text:e,underline:!1}];const r=new RegExp(`(?<![\\p{L}\\p{M}\\p{N}])${Ta(s)}(?![\\p{L}\\p{M}\\p{N}])`,"giu"),o=[];let a=0;for(const p of e.matchAll(r)){const f=p.index??0;f>a&&o.push({text:e.slice(a,f),underline:!1}),o.push({text:p[0],underline:!0}),a=f+p[0].length}return a<e.length&&o.push({text:e.slice(a),underline:!1}),o.length>0?o:[{text:e,underline:!1}]}function re({quote:e,filterText:i}){const s=va(e,i);return s.length===1&&!s[0]?.underline?e:v.jsx(v.Fragment,{children:s.map((r,o)=>r.underline?v.jsx("span",{className:ba,"data-filter-mark":"",children:r.text},o):v.jsx("span",{children:r.text},o))})}function xa(e,i,s){const r=Pa(e,s);if(r)return r;const o=_a(i,s);return o||null}function Pa(e,i){const s=/(\d+):(\d+)(?:[-–](?:(\d+):)?(\d+))?/,r=e.match(s);if(!r)return null;const o=parseInt(r[1],10),a=parseInt(r[2],10),p=r[3],f=r[4],n={book:i,chapter:o,verse:a};return f&&(n.endVerse=parseInt(f,10),p&&(n.endChapter=parseInt(p,10))),n}function _a(e,i){const s=/(?:\.\.\/)+(?:([a-z]{3})\/)?(\d+)\/(\d+)\.md/i,r=e.match(s);if(!r)return null;const o=r[1],a=parseInt(r[2],10),p=parseInt(r[3],10);return{book:o?o.toLowerCase():i,chapter:a,verse:p}}const Pt="w-full text-start mb-stack px-chrome py-chrome-tight bg-chip-quote hover:bg-chip-quote-hover rounded-md transition-colors duration-150",_t="w-full text-start mb-stack px-chrome py-chrome-tight bg-chip-quote rounded-md border border-border-subtle",kn=B.memo(function({note:i,isSelected:s,onClick:r,onQuoteClick:o,onSupportReferenceClick:a,onEntryLinkClick:p,targetResourceId:f,resourceKey:n,languageDirection:c="ltr",taTitle:t="Learn more",isLoadingTATitle:l=!1,getEntryTitle:u,obsMode:d=!1,tokenFilter:m=null}){const[g,T]=B.useState(!1),x=We(S=>S.currentReference.book),N=!!(i.alignedTokens&&i.alignedTokens.length>0),y=i.quoteStatus??Ht({hasAlignedTokens:N,alignmentPending:!1,olQuote:i.quote}),k=Qt({kind:"tn",obsMode:d,quoteStatus:y}),_=m?.content??null,E=St(S=>f?S.loadedResources[f]:void 0),R=It(f,E),V=B.useCallback((S,O,L)=>{if(O==="rc"&&S.startsWith("rc://")){const q=er(S);if(!q.isValid){console.warn("🔗 [TN] Invalid rc:// link:",S);return}if((q.resourceType==="words"||q.resourceType==="academy")&&p&&n){const D=n.split("/"),ge=D[0]||"unfoldingWord",be=D.length>=2?D[1].split("_")[0]:"en",A=`${ge}/${be}/${q.resourceAbbrev}`;p(A,q.entryId);return}if(a){a(S);return}}if(O==="relative"&&L&&x){const q=xa(L,S,x);if(q){B.startTransition(()=>{We.getState().navigateToReference(q)});return}}console.warn("🔗 [TN] Unhandled link:",{href:S,linkType:O,linkText:L})},[x,p,a,n]);return v.jsxs("div",{className:`
21        group rounded-md p-content cursor-pointer transition-colors duration-150 border
22        ${s?Jt:zt}
23
24      `,onClick:()=>{r(i),(N||d)&&o&&o(i)},role:"article","aria-label":"Translation note",children:[N&&v.jsx("button",{onClick:S=>{S.stopPropagation(),o&&o(i)},className:Pt,title:"Click to highlight these words in scripture",dir:c,children:v.jsxs("div",{className:"text-base leading-relaxed",dir:c,children:[v.jsxs("span",{className:"italic text-fg-secondary",children:["“",i.alignedTokens.map((S,O)=>{if(S.type==="whitespace"||S.type==="text")return v.jsx("span",{children:v.jsx(re,{quote:S.content,filterText:_})},S.semanticId||O);const L=O>
240?i.alignedTokens[O-1]:null,q=O>0&&L?.type!=="gap"&&L?.type!=="whitespace"&&L?.type!=="text"&&S.type!=="punctuation"&&S.type!=="gap";return v.jsxs("span",{children:[q&&" ",v.jsx(re,{quote:S.content,filterText:_})]},S.semanticId||O)}),"”"]}),R&&v.jsx("span",{className:"ms-2 px-1.5 py-0.5 bg-surface/80 backdrop-blur rounded text-[10px] text-chip-quote-fg font-medium",children:R})]})}),!N&&!d&&y==="pending"&&v.jsx("div",{className:`${_t} animate-pulse`,role:"status",title:"Building quote","aria-label":"Building quote",children:v.jsx(ye,{size:"sm",label:"Building quote",className:"text-fg-muted"})}),!N&&!d&&y==="ol-fallback"&&i.quote?.trim()&&v.jsx("div",{className:_t,title:"Original language phrase (target language alignment not available)",dir:c,children:v.jsxs("div",{className:"text-base leading-relaxed",dir:c,children:[v.jsxs("span",{className:"italic text-fg-secondary",children:["“",v.jsx(re,{quote:i.quote,filterText:_}),"”"]}),R&&v.jsx("span",{className:"ms-2 px-1.5 py-0.5 bg-surface/80 backdrop-blur rounded text-[10px] text-chip-quote-fg font-medium",children:R})]})}),!N&&d&&i.quote&&i.quote.trim().length>0&&v.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),o?.(i)},className:Pt,title:"Click to highlight this phrase in the story frame",dir:c,children:v.jsxs("div",{className:"text-base leading-relaxed",dir:c,children:[v.jsxs("span",{className:"italic text-fg-secondary",children:["“",v.jsx(re,{quote:i.quote,filterText:_}),"”"]}),R&&v.jsx("span",{className:"ms-2 px-1.5 py-0.5 bg-surface/80 backdrop-blur rounded text-[10px] text-chip-quote-fg font-medium",children:R})]})}),k?v.jsx("div",{className:"relative",dir:c,role:"status",title:"Loading excerpt","aria-label":"Loading excerpt",children:v.jsx(Et,{className:"text-base leading-relaxed"})}):i.note?v.jsxs("div",{className:"relative",dir:c,children:[g?v.jsx("pre",{className:"text-xs text-fg-secondary leading-relaxed whitespace-pre-wrap font-mono bg-muted p-2.5 rounded-lg overflow-x-auto",children:i.note}):v.jsx(wt,{content:i.note,className:"text-base text-fg-secondary leading-relaxed prose prose-base max-w-none prose-headings:text-fg prose-p:text-fg-secondary prose-strong:text-fg prose-a:text-accent",onInternalLinkClick:V,getEntryTitle:u}),v.jsx("button",{onClick:S=>{S.stopPropagation(),T(!g)},className:"absolute top-0 right-0 p-1 text-fg-muted hover:text-fg-secondary hover:bg-muted rounded-md transition-colors opacity-0 group-hover:opacity-100",title:g?"Show rendered markdown":"Show raw markdown",children:v.jsx(cr,{className:"w-3.5 h-3.5"})})]}):null,i.supportReference&&i.supportReference.startsWith("rc://")&&v.jsx("div",{className:Gt,onClick:S=>S.stopPropagation(),children:v.jsxs("button",{type:"button",onClick:S=>{S.stopPropagation(),a&&a(i.supportReference)},className:ka,title:`Learn more: ${t}`,"aria-label":`Learn more: ${t}`,children:[v.jsx(tr,{className:Kt}),l?v.jsx(ye,{size:"sm",label:"Loading title",className:"text-fg-muted"}):v.jsx("span",{children:t})]})}),i.tags&&i.tags.trim()&&v.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:i.tags.split(",").filter(Boolean).map((S,O)=>v.jsx("span",{className:"px-1.5 py-0.5 bg-muted text-fg-secondary rounded text-[10px]",children:S.trim()},O))})]})}),Ct="w-full text-start mb-stack px-chrome py-chrome-tight bg-chip-quote hover:bg-chip-quote-hover rounded-md transition-colors duration-150",At="w-full text-start mb-stack px-chrome py-chrome-tight bg-chip-quote rounded-md border border-border-subtle",Tn=B.memo(function({link:i,isSelected:s,twTitle:r,isLoadingTitle:o,twPreview:a=null,isLoadingPreview:p=!1,onTitleClick:f,onQuoteClick:n,tokenFilter:c,targetResourceId:t,languageDirection:l="ltr",obsMode:u=!1}){const d=i,m=d.alignedTokens,g=!!(m&&m.length>0),T=d.quoteStatus??Ht({hasAlignedTokens:g,alignmentPending:!1,olQuote:i.origWords}),x=Qt({kind:"twl",obsMode:u,twPreview:a,twPreviewPending:p}),N=c?.content??null,y=St(_=>t?_.loadedResources[t]:void 0),k=It(t,y);return v.jsxs("div",{className:`
25        group rounded-md p-content cursor-pointer transition-colors duration-150 border
26        ${s?Jt:zt}
27
28      `,onClick:g||u?()=>n(i):void 0,role:"article","aria-label":"Translation words link",title:g||u?u?"Click to highlight in the story frame":"Click to highlight these words in scripture":void 0,children:[g&&v.jsx("button",{onClick:_=>{_.stopPropagation(),n(i)},className:Ct,title:"Click to highlight these words in scripture",dir:l,children:v.jsxs("div",{className:"text-base leading-relaxed",children:[v.jsxs("span",{className:"italic text-fg-secondary",children:["“",m.map((_,E)=>v.jsxs("span",{children:[E>0&&" ",v.jsx(re,{quote:_.content,filterText:N})]},_.semanticId||E)),"”"]}
28),k&&v.jsx("span",{className:"ml-2 px-1.5 py-0.5 bg-surface/80 backdrop-blur rounded text-[10px] text-chip-quote-fg font-medium",children:k})]})}),!g&&!u&&T==="pending"&&v.jsx("div",{className:`${At} animate-pulse`,role:"status",title:"Building quote","aria-label":"Building quote",children:v.jsx(ye,{size:"sm",label:"Building quote",className:"text-fg-muted"})}),!g&&!u&&T==="ol-fallback"&&i.origWords?.trim()&&v.jsx("div",{className:At,title:"Original language phrase (target language alignment not available)",dir:l,children:v.jsxs("div",{className:"text-base leading-relaxed",children:[v.jsxs("span",{className:"italic text-fg-secondary",children:["“",v.jsx(re,{quote:i.origWords,filterText:N}),"”"]}),k&&v.jsx("span",{className:"ml-2 px-1.5 py-0.5 bg-surface/80 backdrop-blur rounded text-[10px] text-chip-quote-fg font-medium",children:k})]})}),!g&&u&&i.origWords&&i.origWords.trim().length>0&&v.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),n(i)},className:Ct,title:"Click to highlight this phrase in the story frame",dir:l,children:v.jsxs("div",{className:"text-base leading-relaxed",children:[v.jsxs("span",{className:"italic text-fg-secondary",children:["“",v.jsx(re,{quote:i.origWords,filterText:N}),"”"]}),k&&v.jsx("span",{className:"ml-2 px-1.5 py-0.5 bg-surface/80 backdrop-blur rounded text-[10px] text-chip-quote-fg font-medium",children:k})]})}),x?v.jsx("div",{className:"mt-1.5",dir:l,role:"status",title:"Loading excerpt","aria-label":"Loading excerpt",children:v.jsx(Et,{className:"text-base leading-relaxed"})}):a?v.jsx("div",{className:"mt-1.5",dir:l,children:v.jsx(wt,{content:a,className:"text-base text-fg-secondary leading-relaxed prose prose-base max-w-none prose-headings:text-fg prose-p:text-fg-secondary prose-strong:text-fg prose-a:text-accent"})}):null,v.jsx("div",{className:Gt,onClick:_=>_.stopPropagation(),children:v.jsxs("button",{type:"button",onClick:_=>{_.stopPropagation(),f(i)},className:Na,title:`View Translation Words article: ${r}`,"aria-label":`View Translation Words article: ${r}`,children:[v.jsx(dr,{className:Kt}),o?v.jsx(ye,{size:"sm",label:"Loading title",className:"text-fg-muted"}):v.jsx("span",{children:r})]})})]})}),Xt=B.createContext(null);function vn({value:e,children:i}){return v.jsx(Xt.Provider,{value:e,children:i})}function xn(){return B.useContext(Xt)}function Ca(e,i){if(i)return e[i]??Object.values(e).find(s=>s?.key===i||s?.id===i)}function Pn(e,i,s){if(!e)return;let r;if(i&&(r=i instanceof Map?i.get(e):i[e],!r))if(i instanceof Map){for(const a of i.values())if(a?.key===e||a?.id===e){r=a;break}}else r=Object.values(i).find(a=>a?.key===e||a?.id===e);const o=Ca(s,e);return r?sr(r,o):o}const Mt="flex flex-col items-center justify-center py-8 text-fg-muted gap-3 px-4",Aa="w-12 h-12 opacity-50",Ma="text-sm text-fg-secondary text-center max-w-sm",Sa="inline-flex items-center gap-1.5 p-1.5 rounded-md text-accent hover:bg-accent-soft";function _n({children:e,className:i}){return v.jsx("div",{className:i?`${Mt} ${i}`:Mt,children:e})}function Cn({icon:e}){return v.jsx(e,{className:Aa,"aria-hidden":!0})}function An({children:e}){return v.jsx("p",{className:Ma,children:e})}function Mn({icon:e,label:i,shortLabel:s,onClick:r}){return v.jsxs("button",{type:"button",onClick:r,className:Sa,title:i,"aria-label":i,children:[v.jsx(e,{className:"w-5 h-5","aria-hidden":!0}),v.jsx("span",{className:"text-sm font-medium",children:s})]})}export{Ht as A,dr as B,La as C,dn as D,_n as E,Ba as F,hn as G,vn as H,mn as I,un as J,gn as K,Va as L,Ua as M,Fa as N,bn as O,yn as P,Nn as Q,tn as R,pa as S,kn as T,Ka as U,on as V,Tn as W,xn as X,Aa as Y,Wa as a,Cn as b,An as c,Mn as d,qa as e,Za as f,xt as g,fn as h,en as i,cn as j,Da as k,Pn as l,Ha as m,Qa as n,Ya as o,Re as p,sn as q,Xa as r,ha as s,la as t,pn as u,ln as v,rn as w,nn as x,G as y,an as z};
29//# sourceMappingURL=EmptyStateLayout-BFkIW5-P.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.