@e-llm-studio/citation 0.0.137 → 0.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
- package/dist/cjs/features/CitationViewer/components/AudioWaveform.js +1 -1
- package/dist/cjs/features/CodeCitation/_components/CodeEditor.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/cjs/features/RequirementAiCitations/FileCitation/FileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAiCitations/VideoCitation/VideoCitationContent.js +1 -1
- package/dist/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
- package/dist/features/CitationViewer/components/AudioWaveform.js +1 -1
- package/dist/features/CodeCitation/_components/CodeEditor.js +1 -1
- package/dist/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/features/RequirementAiCitations/FileCitation/FileCitationContent.js +1 -1
- package/dist/features/RequirementAiCitations/VideoCitation/VideoCitationContent.js +1 -1
- package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts.map +1 -1
- package/dist/types/src/features/CitationViewer/components/AudioWaveform.d.ts.map +1 -1
- package/dist/types/src/features/CodeCitation/_components/CodeEditor.d.ts +1 -1
- package/dist/types/src/features/CodeCitation/_components/CodeEditor.d.ts.map +1 -1
- package/dist/types/src/features/DatagestMon/EpubPreviewer/EpubPreview.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAiCitations/FileCitation/FileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAiCitations/VideoCitation/VideoCitationContent.d.ts.map +1 -1
- package/package.json +72 -35
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),a=require("@mui/material/Skeleton"),s=require("react"),i=require("react-markdown"),o=require("rehype-raw"),r=require("remark-breaks"),l=require("../utils/highlight.js"),c=require("../../../utils/sanitizeHtml.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(n),g=u(a),x=u(i),h=u(o),p=u(r),f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){var a,i,o;n.data;var r=n.updateQuotesToHighLight,u=n.handleFetchManuscriptElements,_=n.BookIsbn,m=n.title,y=n.highlightTerms,v=n.onHighlightMatch,b=n.defaultPages,j=s.useRef(!0);s.useEffect(function(){return function(){j.current=!1}},[]);var k=s.useState([]),S=k[0],T=k[1],C=s.useState(null!==(a=null==b?void 0:b.quotes)&&void 0!==a?a:1),q=C[0],w=C[1],L=s.useState(!1),N=L[0],E=L[1],B=s.useState(!0),F=B[0],D=B[1],M=s.useState(0),H=M[0],P=M[1],W=s.useState([]),z=W[0],I=W[1],R=s.useState(null!==(i=null==b?void 0:b.characters)&&void 0!==i?i:1),A=R[0],G=R[1],K=s.useState(!1),Y=K[0],O=K[1],Q=s.useState(!0),V=Q[0],J=Q[1],U=s.useState(0),X=U[0],Z=U[1],$=s.useState([]),ee=$[0],te=$[1],ne=s.useState(null!==(o=null==b?void 0:b.locations)&&void 0!==o?o:1),ae=ne[0],se=ne[1],ie=s.useState(!1),oe=ie[0],re=ie[1],le=s.useState(!0),ce=le[0],ue=le[1],de=s.useState(0),ge=de[0],xe=de[1],he=s.useState({list:"",index:-1,page:1}),pe=he[0],fe=he[1],_e=s.useRef(!1),me=s.useRef(null);s.useEffect(function(){if(null==y?void 0:y.length){var e=y.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;S.forEach(function(e,a){!n&&t(e.text)&&(fe({list:"notable",index:a,page:q}),null==v||v(!0),n=!0)}),ee.forEach(function(e,a){!n&&t(e.name)&&(fe({list:"geo_location",index:a,page:ae}),null==v||v(!0),n=!0)}),z.forEach(function(e,a){n||!t(e.name)&&!t(e.description)||(fe({list:"key_character",index:a,page:A}),null==v||v(!0),n=!0)})}},[y,S,ee,z,q,ae,A]),s.useEffect(function(){-1!==pe.index&&(N||oe||Y||requestAnimationFrame(function(){requestAnimationFrame(function(){var e,t=null===(e=me.current)||void 0===e?void 0:e.querySelector('[data-selected="true"]');null==t||t.scrollIntoView({behavior:"smooth",block:"center"})})}))},[pe,N,oe,Y]),s.useEffect(function(){b&&(b.quotes&&w(b.quotes),b.locations&&se(b.locations),b.characters&&G(b.characters))},[b]),s.useEffect(function(){_e.current=!1},[y]);var ye=function(t){var n=t.endpoint,a=t.page,s=t.isbn,i=t.setData,o=t.setLoading,r=t.setHasMore,l=t.setTotalPage,c=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,d,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,u({endpoint:n,page:a,pageSize:10,isbn:s,title:c})];case 2:return t=e.sent(),j.current?(i((null==t?void 0:t.data)||[]),l((null===(d=null==t?void 0:t.pagination)||void 0===d?void 0:d.totalPages)||0),r(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return j.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){ye({endpoint:"notable-quotes",page:q,isbn:_,setData:T,setLoading:E,setHasMore:D,setTotalPage:P,title:m})},[q]),s.useEffect(function(){ye({endpoint:"notable-characters",page:A,isbn:_,setData:I,setLoading:O,setHasMore:J,setTotalPage:Z,title:m})},[A]),s.useEffect(function(){ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})},[ae]),t.jsxs("div",e.__assign({ref:me,className:"book-elements-container"},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:f.quotesPadding},{children:[N?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:f.quoteCard},{children:[t.jsx(g.default,{variant:"text",width:"60%",height:28}),t.jsx(g.default,{variant:"text",width:"40%",height:20}),t.jsx(g.default,{variant:"text",width:"25%",height:20}),t.jsx(g.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===S.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-quotes",page:q,isbn:_,setData:T,setLoading:E,setHasMore:D,setTotalPage:P,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:S.map(function(n,a){var s="notable"===pe.list&&pe.page===q&&pe.index===a;return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:e.__assign(e.__assign({},f.quoteCard),{borderColor:s?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"notable",page:q,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})},"data-selected":"notable"===pe.list&&pe.page===q&&pe.index===a?"true":void 0},{children:[y&&y.length>0?t.jsx("p",{style:f.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.text,y))}}):t.jsx("p",e.__assign({style:f.quoteText,className:"book-elements-quote-text"},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:f.quoteMeta,className:"book-elements-quote-meta"},{children:[l.processTextWithHighlight(n.chapter,y)," ",t.jsx("br",{})," ",l.processTextWithHighlight(n.page,y)]})),t.jsxs("p",e.__assign({style:f.quoteAuthor},{children:["— ",l.processTextWithHighlight(null==n?void 0:n.author,y)]}))]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!F&&t.jsx(d.default,{disabled:N,count:H,page:q,onChange:function(e,t){return w(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({className:"book-elements-geo-wrapper",style:e.__assign(e.__assign({},f.quotesPadding),{marginBottom:"8px"})},{children:[oe?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(g.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ee.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:ee.map(function(n,a){var s="geo_location"===pe.list&&pe.page===ae&&pe.index===a;return t.jsxs("span",e.__assign({"data-selected":"geo_location"===pe.list&&pe.page===ae&&pe.index===a?"true":void 0,style:f.geoLocationFlex},{children:[t.jsx("span",e.__assign({className:"book-elements-geo-text",style:e.__assign(e.__assign({},f.geoText),{fontWeight:s?"700":"",textDecoration:s?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"geo_location",page:ae,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.name,y))}}):null==n?void 0:n.name})),a<ee.length-1&&t.jsx("span",{style:f.geoDivider})]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ce&&t.jsx(d.default,{disabled:oe,count:ge,page:ae,onChange:function(e,t){return se(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.charactersContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),Y?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f.characterCard),{flexBasis:"40%"})},{children:[t.jsx(g.default,{variant:"circular",style:e.__assign(e.__assign({},f.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(g.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===z.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-characters",page:A,isbn:_,setData:I,setLoading:O,setHasMore:J,setTotalPage:Z,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({className:"book-elements-characters-grid",style:f.charactersGrid},{children:z.map(function(n,a){var s=e.__assign(e.__assign({},f.avatar),{backgroundColor:n.bg,color:n.color}),i="key_character"===pe.list&&pe.page===A&&pe.index===a;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e.__assign(e.__assign({},f.characterCard),{borderColor:i?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:fe({list:"key_character",page:A,index:a}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===pe.list&&pe.page===A&&pe.index===a?"true":void 0},{children:[t.jsx("div",e.__assign({style:s},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({className:"book-elements-char-name",style:e.__assign(e.__assign({},f.charName),{margin:0})},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(n.name,y))}}):n.name})),t.jsx("p",e.__assign({className:"book-elements-char-desc",style:e.__assign(e.__assign({},f.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(x.default,e.__assign({remarkPlugins:[p.default],rehypePlugins:[h.default],components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:0}},a))}}},{children:l.processTextWithHighlight(null==n?void 0:n.description,y)}))}))]}))]}),a)})}))}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&t.jsx(d.default,{count:X,disabled:Y,page:A,onChange:function(e,t){return G(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("@mui/material/Pagination"),a=require("@mui/material/Skeleton"),s=require("react"),i=require("react-markdown"),o=require("rehype-raw"),r=require("remark-breaks"),l=require("../utils/highlight.js"),c=require("../../../utils/sanitizeHtml.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(n),g=u(a),x=u(i),h=u(o),p=u(r),f={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(n){var a,i,o;n.data;var r=n.updateQuotesToHighLight,u=n.handleFetchManuscriptElements,_=n.BookIsbn,m=n.title,y=n.highlightTerms,v=n.onHighlightMatch,b=n.defaultPages,j=s.useRef(!0);s.useEffect(function(){return function(){j.current=!1}},[]);var k=s.useState([]),T=k[0],S=k[1],C=s.useState(null!==(a=null==b?void 0:b.quotes)&&void 0!==a?a:1),q=C[0],w=C[1],L=s.useState(!1),N=L[0],B=L[1],E=s.useState(!0),D=E[0],F=E[1],M=s.useState(0),H=M[0],P=M[1],W=s.useState([]),z=W[0],I=W[1],R=s.useState(null!==(i=null==b?void 0:b.characters)&&void 0!==i?i:1),G=R[0],K=R[1],Y=s.useState(!1),A=Y[0],O=Y[1],Q=s.useState(!0),J=Q[0],U=Q[1],V=s.useState(0),X=V[0],Z=V[1],$=s.useState([]),ee=$[0],te=$[1],ne=s.useState(null!==(o=null==b?void 0:b.locations)&&void 0!==o?o:1),ae=ne[0],se=ne[1],ie=s.useState(!1),oe=ie[0],re=ie[1],le=s.useState(!0),ce=le[0],ue=le[1],de=s.useState(0),ge=de[0],xe=de[1],he=s.useState({list:"",index:-1,page:1}),pe=he[0],fe=he[1],_e=s.useRef(!1),me=s.useRef(null);s.useEffect(function(){if(null==y?void 0:y.length){var e=y.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;T.forEach(function(e,a){!n&&t(e.text)&&(fe({list:"notable",index:a,page:q}),null==v||v(!0),n=!0)}),ee.forEach(function(e,a){!n&&t(e.name)&&(fe({list:"geo_location",index:a,page:ae}),null==v||v(!0),n=!0)}),z.forEach(function(e,a){n||!t(e.name)&&!t(e.description)||(fe({list:"key_character",index:a,page:G}),null==v||v(!0),n=!0)})}},[y,T,ee,z,q,ae,G]),s.useEffect(function(){b&&(b.quotes&&w(b.quotes),b.locations&&se(b.locations),b.characters&&K(b.characters))},[b]),s.useEffect(function(){_e.current=!1},[y]);var ye=function(t){var n=t.endpoint,a=t.page,s=t.isbn,i=t.setData,o=t.setLoading,r=t.setHasMore,l=t.setTotalPage,c=t.title;return e.__awaiter(void 0,void 0,void 0,function(){var t,d,g,x;return e.__generator(this,function(e){switch(e.label){case 0:o(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,u({endpoint:n,page:a,pageSize:10,isbn:s,title:c})];case 2:return t=e.sent(),j.current?(i((null==t?void 0:t.data)||[]),l((null===(d=null==t?void 0:t.pagination)||void 0===d?void 0:d.totalPages)||0),r(!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasNext)&&!(null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.hasPrevious)),[3,4]):[2];case 3:return j.current&&o(!1),[7];case 4:return[2]}})})};return s.useEffect(function(){ye({endpoint:"notable-quotes",page:q,isbn:_,setData:S,setLoading:B,setHasMore:F,setTotalPage:P,title:m})},[q]),s.useEffect(function(){ye({endpoint:"notable-characters",page:G,isbn:_,setData:I,setLoading:O,setHasMore:U,setTotalPage:Z,title:m})},[G]),s.useEffect(function(){ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})},[ae]),t.jsxs("div",e.__assign({ref:me,className:"book-elements-container"},{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:f.quotesPadding},{children:[N?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:f.quoteCard},{children:[t.jsx(g.default,{variant:"text",width:"60%",height:28}),t.jsx(g.default,{variant:"text",width:"40%",height:20}),t.jsx(g.default,{variant:"text",width:"25%",height:20}),t.jsx(g.default,{variant:"text",width:"30%",height:20})]}),n)})})):0===T.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-quotes",page:q,isbn:_,setData:S,setLoading:B,setHasMore:F,setTotalPage:P,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:T.map(function(n,a){var s="notable"===pe.list&&pe.page===q&&pe.index===a;return t.jsxs("div",e.__assign({className:"book-elements-quote-card",style:e.__assign(e.__assign({},f.quoteCard),{borderColor:s?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"notable",page:q,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}})})},"data-selected":"notable"===pe.list&&pe.page===q&&pe.index===a?"true":void 0},{children:[y&&y.length>0?t.jsx("p",{style:f.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.text,y))}}):t.jsx("p",e.__assign({style:f.quoteText,className:"book-elements-quote-text"},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:f.quoteMeta,className:"book-elements-quote-meta"},{children:[l.processTextWithHighlight(n.chapter,y)," ",t.jsx("br",{})," ",l.processTextWithHighlight(n.page,y)]})),t.jsxs("p",e.__assign({style:f.quoteAuthor},{children:["— ",l.processTextWithHighlight(null==n?void 0:n.author,y)]}))]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!D&&t.jsx(d.default,{disabled:N,count:H,page:q,onChange:function(e,t){return w(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({className:"book-elements-geo-wrapper",style:e.__assign(e.__assign({},f.quotesPadding),{marginBottom:"8px"})},{children:[oe?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return t.jsx(g.default,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===ee.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"geo-locations",page:ae,isbn:_,setData:te,setLoading:re,setHasMore:ue,setTotalPage:xe,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:ee.map(function(n,a){var s="geo_location"===pe.list&&pe.page===ae&&pe.index===a;return t.jsxs("span",e.__assign({"data-selected":"geo_location"===pe.list&&pe.page===ae&&pe.index===a?"true":void 0,style:f.geoLocationFlex},{children:[t.jsx("span",e.__assign({className:"book-elements-geo-text",style:e.__assign(e.__assign({},f.geoText),{fontWeight:s?"700":"",textDecoration:s?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),fe({list:"geo_location",page:ae,index:a}),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(null==n?void 0:n.name,y))}}):null==n?void 0:n.name})),a<ee.length-1&&t.jsx("span",{style:f.geoDivider})]}),a)})}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ce&&t.jsx(d.default,{disabled:oe,count:ge,page:ae,onChange:function(e,t){return se(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:f.charactersContainer},{children:[t.jsx("p",e.__assign({style:f.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),A?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f.characterCard),{flexBasis:"40%"})},{children:[t.jsx(g.default,{variant:"circular",style:e.__assign(e.__assign({},f.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(g.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}}),t.jsx(g.default,{variant:"text",style:{flex:"1"}})]}))]}),n)})})):0===z.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:f.retryButton,onClick:function(){return ye({endpoint:"notable-characters",page:G,isbn:_,setData:I,setLoading:O,setHasMore:U,setTotalPage:Z,title:m})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({className:"book-elements-characters-grid",style:f.charactersGrid},{children:z.map(function(n,a){var s=e.__assign(e.__assign({},f.avatar),{backgroundColor:n.bg,color:n.color}),i="key_character"===pe.list&&pe.page===G&&pe.index===a;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e.__assign(e.__assign({},f.characterCard),{borderColor:i?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,s;return e.__generator(this,function(e){switch(e.label){case 0:fe({list:"key_character",page:G,index:a}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(s=null==n?void 0:n.chunkIds)||void 0===s?void 0:s.length)>0?[4,r(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===pe.list&&pe.page===G&&pe.index===a?"true":void 0},{children:[t.jsx("div",e.__assign({style:s},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({className:"book-elements-char-name",style:e.__assign(e.__assign({},f.charName),{margin:0})},{children:y&&y.length>0?t.jsx("span",{dangerouslySetInnerHTML:{__html:c.sanitizeHtml(l.highlightTermsFunc(n.name,y))}}):n.name})),t.jsx("p",e.__assign({className:"book-elements-char-desc",style:e.__assign(e.__assign({},f.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(x.default,e.__assign({remarkPlugins:[p.default],rehypePlugins:[h.default],components:{p:function(n){n.node;var a=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:0}},a))}}},{children:l.processTextWithHighlight(null==n?void 0:n.description,y)}))}))]}))]}),a)})}))}),t.jsx("div",e.__assign({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!J&&t.jsx(d.default,{count:X,disabled:A,page:G,onChange:function(e,t){return K(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("./StormeeChatCitation.module.css.js");function a(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}function i(i){var u=i.src,o=i.highlights,l=void 0===o?[]:o,c=i.onTimeUpdate,d=i.timestampStart,f=void 0===d?0:d,v=i.timestampEnd,g=i.iconsConfig,h=t.useRef(null),p=t.useRef(null),m=t.useRef(null),j=t.useState(!1),_=j[0],w=j[1],x=t.useState("00:00"),b=x[0],y=x[1],S=t.useState("00:00"),P=S[0],C=S[1],R=t.useState(null),N=R[0],D=R[1],z=t.useState(!0),E=z[0],O=z[1],q=t.useState(!1),A=q[0],k=q[1],M=t.useState(null),T=M[0],W=M[1],B=t.useRef(null),F=t.useRef(null),I=null==g?void 0:g.PlayIcon,L=null==g?void 0:g.PauseIcon;t.useEffect(function(){Promise.all([Promise.resolve().then(function(){return a(require("wavesurfer.js"))}),Promise.resolve().then(function(){return a(require("wavesurfer.js/dist/plugins/regions.js"))})]).then(function(e){var r=e[0],t=e[1];B.current=r.default,F.current=t.default,k(!0)}).catch(function(){W("wavesurfer.js is not installed. Run: npm install wavesurfer.js"),O(!1)})},[]),t.useEffect(function(){if(A&&h.current&&B.current&&F.current){var e=null,r=!1;return function(){try{D(null),O(!0);var t=function(e){if(e.startsWith("gs://")){var r=e.replace("gs://","");return"https://storage.googleapis.com/".concat(r)}return e}(u);e=B.current.create({container:h.current,waveColor:"#D0D5DD",progressColor:"#9CA3AF",cursorColor:"#6B7280",barWidth:2,barRadius:3,height:72,normalize:!0,url:t}),p.current=e,m.current=e.registerPlugin(F.current.create()),e.on("ready",function(){if(!r){var t=e.getDuration();C(s(t)),O(!1),void 0!==v&&v>f&&m.current&&m.current.addRegion({start:f,end:v,color:"rgb(254, 239, 137)",drag:!1,resize:!1}),l.forEach(function(e){var r;m.current.addRegion({start:e.start,end:e.end,color:null!==(r=e.color)&&void 0!==r?r:"rgb(254, 239, 137)",drag:!1,resize:!1})})}}),e.on("error",function(){r||(D("Audio preview unavailable"),O(!1))}),e.on("audioprocess",function(r){y(s(r)),null==c||c(r),void 0!==v&&r>=v&&e.isPlaying()&&(e.pause(),e.seekTo(f/e.getDuration()))}),e.on("play",function(){return w(!0)}),e.on("pause",function(){return w(!1)})}catch(e){if(r)return;D("Failed to initialize audio player"),O(!1)}}(),function(){var e;r=!0,null===(e=p.current)||void 0===e||e.destroy()}}},[A,u,l,c,f,v]);return T?r.jsx("div",e.__assign({className:n.default.awContainer},{children:r.jsx("div",e.__assign({className:n.default.awError},{children:T}))})):r.jsxs("div",e.__assign({className:n.default.awContainer},{children:[N&&r.jsx("div",e.__assign({className:n.default.awError},{children:"Audio preview is unavailable for this item."})),E&&!N&&r.jsx("div",e.__assign({className:n.default.awLoading},{children:"Loading audio..."})),!N&&r.jsxs("div",e.__assign({className:n.default.awRow},{children:[r.jsx("button",e.__assign({onClick:function(){p.current&&(p.current.isPlaying()?p.current.pause():(void 0!==v&&p.current.seekTo(f/p.current.getDuration()),p.current.play()))},className:n.default.awPlayBtn,disabled:!!N||E},{children:_?L?r.jsx(L,{size:20}):r.jsx("span",{children:"⏸"}):I?r.jsx(I,{size:20}):r.jsx("span",{children:"▶"})})),r.jsx("div",{ref:h,className:n.default.awWaveform})]})),r.jsxs("div",e.__assign({className:n.default.awTime},{children:[b," / ",P]}))]}))}function s(e){var r=Math.floor(e/60),t=Math.floor(e%60);return"".concat(String(r).padStart(2,"0"),":").concat(String(t).padStart(2,"0"))}exports.AudioWaveform=i,exports.default=i;
|
|
2
2
|
//# sourceMappingURL=AudioWaveform.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),r=require("../../../utils/codeCitations.utils.js");function o(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}exports.DiagnosticSeverity=void 0,(e=exports.DiagnosticSeverity||(exports.DiagnosticSeverity={}))[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Information=2]="Information",e[e.Hint=3]="Hint";exports.default=function(e){var a=e.startIndex,l=e.endIndex,s=e.language,d=e.editorHeight,u=e.editorWidth,c=e.code,g=e.isHighlightingEnabled,v=e.isDarkModeEnabled,f=e.openHighlightedCodeDetails,h=e.highlightCodeStatsLine;e.setHighlightCodeStatsLine;var m=e.highlightCodeStatsVariable;e.setHighlightCodeStatsVariable,e.setHighlightIndexes;var p=e.isExpanded,x=e.highlightIndexes,y=e.diagnostics,S=e.diagnosticStylesBySeverity,b=i.useRef(null),I=i.useRef([]);i.useRef([]);var j=i.useRef([]),C=i.useRef([]),O=i.useMemo(function(){return a},[a]),R=i.useMemo(function(){return l},[l]),L=i.useState(null),D=L[0],w=L[1],E=i.useState(null),M=E[0],k=E[1],H=i.useState(null),N=H[0],_=H[1],q=i.useState(void 0),P=q[0],V=q[1],W=i.useState(null),F=W[0],T=W[1];i.useEffect(function(){Promise.all([Promise.resolve().then(function(){return o(require("@monaco-editor/react"))}),Promise.resolve().then(function(){return o(require("highlight.js/lib/core"))})]).then(function(e){var n=e[0],t=e[1];_(function(){return n.default});var i=t.default.highlightAuto(c).language;V(i)}).catch(function(){T("Code editor dependencies not installed. Run: npm install @monaco-editor/react highlight.js")})},[c]);var z=i.useMemo(function(){return S&&"object"==typeof S&&Object.entries(S).map(function(e){var n=e[0],t=e[1],i=[];return t.style&&i.push(".".concat(r.generateClassName(t.style,+n,!0)," {\n").concat(r.cssPropertiesToString(t.style),"\n}")),t.lightModeStyle&&i.push(".".concat(r.generateClassName(t.lightModeStyle,+n,!1)," {\n").concat(r.cssPropertiesToString(t.lightModeStyle),"\n}")),i.join("\n")}).join("\n")},[S]);i.useEffect(function(){return function(){var e;(null===(e=b.current)||void 0===e?void 0:e._resizeObserver)&&b.current._resizeObserver.disconnect()}},[]),i.useEffect(function(){if(g&&D&&b.current&&M){var e=D.start,n=D.end;if(A(b.current,e,n,h,m),-1===a&&y&&y.length>0){var t=y[0].range,i=t.lineStart,r=t.lineEnd;A(b.current,i,r,h,m)}}},[D,M,g,h,m]),i.useEffect(function(){var e,n,t;if(M&&b.current&&g){var i=b.current;if(x&&(null===(e=Object.keys(x))||void 0===e?void 0:e.length)>0&&-1!==(null==x?void 0:x.startIndex)&&-1!==(null==x?void 0:x.endIndex)){var r=i.deltaDecorations(I.current,[{range:new M.Range(x.startIndex,1,x.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);I.current=r}if(h&&(null===(n=Object.keys(h))||void 0===n?void 0:n.length)>0&&-1!==(null==h?void 0:h.startIndex)&&-1!==(null==h?void 0:h.endIndex)&&(null==h?void 0:h.name)){r=i.deltaDecorations(I.current,[{range:new M.Range(h.startIndex,1,h.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);I.current=r}if(m&&(null===(t=Object.keys(m))||void 0===t?void 0:t.length)>0&&-1!==(null==m?void 0:m.startIndex)&&-1!==(null==m?void 0:m.endIndex)&&(null==h?void 0:h.name)){r=i.deltaDecorations(j.current,[{range:new M.Range(m.startIndex,1,m.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);j.current=r}}},[a,l,g,M,h,JSON.stringify(m)]),i.useEffect(function(){if(M&&b.current&&(null==y?void 0:y.length)&&S){var e=b.current,n=y.map(function(e){var n,t,i=r.getClassNameFromDiagnostic(e.severity,null==v||v,S);return{range:new M.Range(e.range.lineStart,null!==(n=e.range.columnStart)&&void 0!==n?n:1,e.range.lineEnd,null!==(t=e.range.columnEnd)&&void 0!==t?t:1),options:{className:i,isWholeLine:void 0===e.range.columnStart}}});C.current=e.deltaDecorations(C.current,n)}},[y,S,M,v]);var A=i.useCallback(function(e,n,t,i,r){var o,a;if(M&&e&&g){var l=e.getModel();l&&(n=Math.max(-1,n),(t=Math.min(t,l.getLineCount()))<n&&(t=n),requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new M.Range(n,1,t,1),M.editor.ScrollType.Smooth),e.setSelection(new M.Range(n,1,t+1,1))}),i&&-1!==(null==i?void 0:i.startIndex)&&-1!==(null==i?void 0:i.endIndex)&&requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new M.Range(i.startIndex,1,i.endIndex,1),M.editor.ScrollType.Smooth),e.setSelection(new M.Range(i.startIndex,1,i.endIndex+1,1))}),0===(null===(o=Object.keys(r))||void 0===o?void 0:o.length)&&e.getContribution("editor.contrib.findController").getState().change({isRevealed:!1},!1),(null===(a=Object.keys(r))||void 0===a?void 0:a.length)>0&&(requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new M.Range(r.startIndex,1,r.endIndex,1),M.editor.ScrollType.Smooth),e.setSelection(new M.Range(r.startIndex,1,r.endIndex+1,1))}),e.trigger("keyboard","actions.find"),e.getAction("actions.find").run(),e.getContribution("editor.contrib.findController").getState().change({searchString:(null==r?void 0:r.variableName)||"",isRevealed:!0},!1)))}},[M,g,a,l,null==h?void 0:h.startIndex,null==h?void 0:h.endIndex,m]);i.useEffect(function(){if(b.current&&M&&g){var e=b.current,n=e.onDidLayoutChange(function(){if(A(e,a,l,h,m),-1===a&&y&&y.length>0){var n=y[0].range,t=n.lineStart,i=n.lineEnd;A(e,t,i,h,m)}});return function(){return n.dispose()}}},[A,a,l,g,null==h?void 0:h.startIndex,null==h?void 0:h.endIndex,m,p]);var B=i.useCallback(function(e,n){A(e,O,R),b.current=e,k(n),w({start:O,end:R});var t=e.getContainerDomNode(),i=new ResizeObserver(function(){e.layout()});if(i.observe(t),b.current._resizeObserver=i,g){var r=e.getDomNode(),o=document.createElement("div");null==r||r.appendChild(o);var a=function(){var n=e.getTopForLineNumber(O)-e.getScrollTop();o.style.top="".concat(n,"px")};e.onDidScrollChange(a),a()}},[a,l,g,f]);return F?t.jsx("div",n.__assign({style:{color:"red",fontSize:"12px",padding:"8px"}},{children:F})):N?t.jsxs(t.Fragment,{children:[t.jsx(N,{height:d,width:u,defaultLanguage:P||s,defaultValue:c,theme:v?"vs-dark":"vs-light",onMount:B,beforeMount:function(e){e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0})},options:{minimap:{enabled:!0},overviewRulerLanes:3,fontFamily:"Plus Jakarta Sans, sans-serif",scrollBeyondLastLine:!1,readOnly:!0,smoothScrolling:!0,automaticLayout:!0,lineDecorationsWidth:10,padding:{top:20,bottom:20}}}),t.jsxs("style",{children:[z,".myLineHighlight { background-color: rgba(0, 122, 204, 0.3); }"]})]}):t.jsx("div",n.__assign({style:{padding:"8px",color:"#666"}},{children:"Loading code editor..."}))};
|
|
2
2
|
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("@react-pdf-viewer/core"),s=require("./PdfStyle.js"),t=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),i=require("@react-pdf-viewer/core"),s=require("./PdfStyle.js"),t="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js";exports.default=function(l){var o=l.pdfUrl,d=l.plugins,n=l.onLoad;return r.jsx("div",e.__assign({style:s.pdfStyles.pdfConatiner},{children:r.jsx(i.Worker,e.__assign({workerUrl:t},{children:r.jsx(i.Viewer,{fileUrl:o,defaultScale:i.SpecialZoomLevel.ActualSize,plugins:d,onDocumentLoad:n})}))}))},exports.pdfWorker=t;
|
|
2
2
|
//# sourceMappingURL=PdfContainer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),t=require("../components/CitationAIConfidenceDisplay.js"),l=require("./FileCitationContent.module.css.js");function r(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,t.get?t:{enumerable:!0,get:function(){return e[n]}})}}),i.default=e,Object.freeze(i)}exports.default=function(s){var o,a,d,c,u,f,v=null===(o=null==s?void 0:s.closeCitationConfig)||void 0===o?void 0:o.CloseIcon,g=null===(a=null==s?void 0:s.cachingConfig)||void 0===a?void 0:a.queryClient,h=s.styles,p=["getSignedUrl",(null==s?void 0:s.gsUtilPath)||""],C=null!==(c=null===(d=s.cachingConfig)||void 0===d?void 0:d.useGetSignedUrlQuery)&&void 0!==c?c:function(e,i){return{data:void 0}},j=null!==(f=null===(u=s.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlMutation)&&void 0!==f?f:function(e){return{mutate:function(e){},isPending:!1}},y=C((null==s?void 0:s.gsUtilPath)||"",p).data,_=j((null==s?void 0:s.gsUtilPath)||""),m=_.mutate,x=_.isPending,P=n.useState(null),U=P[0],w=P[1],b=n.useState(null),D=b[0],N=b[1];n.useEffect(function(){Promise.resolve().then(function(){return r(require("@react-pdf-viewer/core"))}).then(function(e){w({Worker:e.Worker,Viewer:e.Viewer})}).catch(function(){N("@react-pdf-viewer/core is not installed. Run: npm install @react-pdf-viewer/core")})},[]),n.useEffect(function(){s.signedUrl||(s.gsUtilPath?((null==g?void 0:g.getQueryData)?g.getQueryData(p):void 0)||m({gsUtilPath:s.gsUtilPath}):console.error("Error -> FileCitationContent: gsUtilPath is required to fetch signed URL"))},[s.gsUtilPath,s.signedUrl,g,m]);var k=function(n){if(D)return i.jsx("div",e.__assign({style:{color:"red",fontSize:"12px"}},{children:D}));if(!U)return i.jsx("div",{children:"Loading PDF viewer..."});var t=U.Worker,l=U.Viewer;return i.jsx(t,e.__assign({workerUrl:"https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js"},{children:i.jsx(l,{fileUrl:n})}))};return i.jsxs("div",e.__assign({className:l.default.container,style:null==h?void 0:h.container},{children:[i.jsxs("div",e.__assign({className:l.default.header,style:null==h?void 0:h.header},{children:[i.jsx("h2",e.__assign({className:l.default.title,style:null==h?void 0:h.title},{children:s.title})),(null==s?void 0:s.closeCitationConfig)?i.jsxs("div",e.__assign({className:l.default.headerActions,style:null==h?void 0:h.headerActions},{children:[t.renderCitationAIConfidenceDisplay(s.relevanceScore,!1,null==h?void 0:h.aiConfidenceDisplayPill),i.jsx("div",{className:l.default.divider,style:null==h?void 0:h.divider}),v&&i.jsx("div",e.__assign({className:l.default.closeIconWrapper,style:null==h?void 0:h.closeIconWrapper,onClick:s.closeCitationConfig.handleCloseCitationPreview},{children:i.jsx(v,{className:l.default.closeIcon})}))]})):i.jsx(i.Fragment,{children:t.renderCitationAIConfidenceDisplay(s.relevanceScore,!0,null==h?void 0:h.aiConfidenceDisplayPill)})]})),i.jsx("div",e.__assign({className:l.default.contentContainer,style:null==h?void 0:h.contentContainer},{children:i.jsx("div",e.__assign({className:l.default.pdfWrapper,style:null==h?void 0:h.pdfWrapper},{children:(null==s?void 0:s.signedUrl)?k(s.signedUrl):!x&&y?k(y):null}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=FileCitationContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),n=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),l=require("react"),n=require("../components/CitationAIConfidenceDisplay.js"),t=require("@mui/material"),s=require("./VideoCitationContent.module.css.js");function r(e){if(e&&e.__esModule)return e;var i=Object.create(null);return e&&Object.keys(e).forEach(function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(i,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}}),i.default=e,Object.freeze(i)}exports.default=function(o){var a,d,c,u,v,g,f=null===(a=null==o?void 0:o.closeCitationConfig)||void 0===a?void 0:a.CloseIcon,h=null===(d=null==o?void 0:o.cachingConfig)||void 0===d?void 0:d.queryClient,p=o.styles,y=l.useState(null),C=y[0],m=y[1],_=l.useState(null),j=_[0],x=_[1],P=["getSignedUrl",(null==o?void 0:o.gsUtilPath)||""],U=null!==(u=null===(c=o.cachingConfig)||void 0===c?void 0:c.useGetSignedUrlQuery)&&void 0!==u?u:function(e,i){return{data:void 0}},N=null!==(g=null===(v=o.cachingConfig)||void 0===v?void 0:v.useGetSignedUrlMutation)&&void 0!==g?g:function(e){return{mutate:function(){},isPending:!1}},q=U((null==o?void 0:o.gsUtilPath)||"",P).data,b=N((null==o?void 0:o.gsUtilPath)||""),S=b.mutate,D=b.isPending;l.useEffect(function(){Promise.resolve().then(function(){return r(require("react-player"))}).then(function(e){m(function(){return e.default})}).catch(function(){x("react-player is not installed. Run: npm install react-player")})},[]),l.useEffect(function(){var e;o.videoUrl||(o.gsUtilPath?(null===(e=null==h?void 0:h.getQueryData)||void 0===e?void 0:e.call(h,P))||S({gsUtilPath:o.gsUtilPath}):console.error("Error -> VideoCitationContent: gsUtilPath is required to fetch signed URL"))},[o.gsUtilPath,o.videoUrl,h,S,P]);var I=o.videoUrl||q,O=e.__assign({controls:!0,playing:!1,loop:!1,muted:!1,volume:.8,width:"100%",height:"100%"},o.playerConfig);return i.jsxs("div",e.__assign({className:s.default.container,style:null==p?void 0:p.container},{children:[i.jsxs("div",e.__assign({className:s.default.header,style:null==p?void 0:p.header},{children:[i.jsx("h2",e.__assign({className:s.default.title,style:null==p?void 0:p.title},{children:(null==o?void 0:o.citationTitle)||"Video Reference"})),(null==o?void 0:o.closeCitationConfig)?i.jsxs("div",e.__assign({className:s.default.headerRight,style:null==p?void 0:p.headerRight},{children:[n.renderCitationAIConfidenceDisplay(o.relevanceScore,!1,null==p?void 0:p.aiConfidenceDisplayPill),i.jsx("div",{className:s.default.divider,style:null==p?void 0:p.divider}),f&&i.jsx("div",e.__assign({className:s.default.closeIconWrapper,style:null==p?void 0:p.closeIconWrapper,onClick:o.closeCitationConfig.handleCloseCitationPreview},{children:i.jsx(f,{className:s.default.closeIcon})}))]})):n.renderCitationAIConfidenceDisplay(o.relevanceScore,!0,null==p?void 0:p.aiConfidenceDisplayPill)]})),I?j?i.jsx("div",e.__assign({style:{color:"red",fontSize:"12px"}},{children:j})):C?i.jsx("div",e.__assign({className:s.default.videoWrapper,style:null==p?void 0:p.videoWrapper},{children:C&&i.jsx(C,{src:I,controls:O.controls,playing:O.playing,loop:O.loop,muted:O.muted,volume:O.volume,style:{width:O.width,height:O.height}})})):i.jsxs("div",e.__assign({className:s.default.loaderContainer,style:null==p?void 0:p.loaderContainer},{children:[i.jsx(t.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"}}),i.jsx("span",e.__assign({className:s.default.loaderText,style:null==p?void 0:p.loaderText},{children:"Loading Player..."}))]})):D?i.jsxs("div",e.__assign({className:s.default.loaderContainer,style:null==p?void 0:p.loaderContainer},{children:[i.jsx("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i.jsx(t.CircularProgress,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i.jsx("span",e.__assign({className:s.default.loaderText,style:null==p?void 0:p.loaderText},{children:"Loading Video..."}))]})):null]}))};
|
|
2
2
|
//# sourceMappingURL=VideoCitationContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n,__rest as o}from"tslib";import{jsxs as r,jsx as a,Fragment as i}from"react/jsx-runtime";import l from"@mui/material/Pagination";import s from"@mui/material/Skeleton";import{useRef as c,useEffect as d,useState as u}from"react";import p from"react-markdown";import h from"rehype-raw";import g from"remark-breaks";import{highlightTermsFunc as x,processTextWithHighlight as f}from"../utils/highlight.js";import{sanitizeHtml as m}from"../../../utils/sanitizeHtml.js";var y={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},v=function(v){var b,k,T;v.data;var C=v.updateQuotesToHighLight,w=v.handleFetchManuscriptElements,S=v.BookIsbn,q=v.title,L=v.highlightTerms,N=v.onHighlightMatch,B=v.defaultPages,D=c(!0);d(function(){return function(){D.current=!1}},[]);var M=u([]),E=M[0],F=M[1],P=u(null!==(b=null==B?void 0:B.quotes)&&void 0!==b?b:1),I=P[0],_=P[1],H=u(!1),W=H[0],z=H[1],R=u(!0),j=R[0],A=R[1],G=u(0),K=G[0],Y=G[1],Q=u([]),O=Q[0],V=Q[1],J=u(null!==(k=null==B?void 0:B.characters)&&void 0!==k?k:1),U=J[0],X=J[1],Z=u(!1),$=Z[0],ee=Z[1],te=u(!0),ne=te[0],oe=te[1],re=u(0),ae=re[0],ie=re[1],le=u([]),se=le[0],ce=le[1],de=u(null!==(T=null==B?void 0:B.locations)&&void 0!==T?T:1),ue=de[0],pe=de[1],he=u(!1),ge=he[0],xe=he[1],fe=u(!0),me=fe[0],ye=fe[1],ve=u(0),be=ve[0],ke=ve[1],Te=u({list:"",index:-1,page:1}),Ce=Te[0],we=Te[1],Se=c(!1),qe=c(null);d(function(){if(null==L?void 0:L.length){var e=L.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;E.forEach(function(e,o){!n&&t(e.text)&&(we({list:"notable",index:o,page:I}),null==N||N(!0),n=!0)}),se.forEach(function(e,o){!n&&t(e.name)&&(we({list:"geo_location",index:o,page:ue}),null==N||N(!0),n=!0)}),O.forEach(function(e,o){n||!t(e.name)&&!t(e.description)||(we({list:"key_character",index:o,page:U}),null==N||N(!0),n=!0)})}},[L,E,se,O,I,ue,U]),d(function(){-1!==Ce.index&&(W||ge||$||requestAnimationFrame(function(){requestAnimationFrame(function(){var e,t=null===(e=qe.current)||void 0===e?void 0:e.querySelector('[data-selected="true"]');null==t||t.scrollIntoView({behavior:"smooth",block:"center"})})}))},[Ce,W,ge,$]),d(function(){B&&(B.quotes&&_(B.quotes),B.locations&&pe(B.locations),B.characters&&X(B.characters))},[B]),d(function(){Se.current=!1},[L]);var Le=function(e){var o=e.endpoint,r=e.page,a=e.isbn,i=e.setData,l=e.setLoading,s=e.setHasMore,c=e.setTotalPage,d=e.title;return t(void 0,void 0,void 0,function(){var e,t,u,p;return n(this,function(n){switch(n.label){case 0:l(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,w({endpoint:o,page:r,pageSize:10,isbn:a,title:d})];case 2:return e=n.sent(),D.current?(i((null==e?void 0:e.data)||[]),c((null===(t=null==e?void 0:e.pagination)||void 0===t?void 0:t.totalPages)||0),s(!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.hasPrevious)),[3,4]):[2];case 3:return D.current&&l(!1),[7];case 4:return[2]}})})};return d(function(){Le({endpoint:"notable-quotes",page:I,isbn:S,setData:F,setLoading:z,setHasMore:A,setTotalPage:Y,title:q})},[I]),d(function(){Le({endpoint:"notable-characters",page:U,isbn:S,setData:V,setLoading:ee,setHasMore:oe,setTotalPage:ie,title:q})},[U]),d(function(){Le({endpoint:"geo-locations",page:ue,isbn:S,setData:ce,setLoading:xe,setHasMore:ye,setTotalPage:ke,title:q})},[ue]),r("div",e({ref:qe,className:"book-elements-container"},{children:[r("div",e({style:{marginBottom:"24px"}},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),r("div",e({style:y.quotesPadding},{children:[W?a("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return r("div",e({className:"book-elements-quote-card",style:y.quoteCard},{children:[a(s,{variant:"text",width:"60%",height:28}),a(s,{variant:"text",width:"40%",height:20}),a(s,{variant:"text",width:"25%",height:20}),a(s,{variant:"text",width:"30%",height:20})]}),t)})})):0===E.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",a("button",e({style:y.retryButton,onClick:function(){return Le({endpoint:"notable-quotes",page:I,isbn:S,setData:F,setLoading:z,setHasMore:A,setTotalPage:Y,title:q})}},{children:"Retry"}))]})):a(i,{children:E.map(function(o,i){var l="notable"===Ce.list&&Ce.page===I&&Ce.index===i;return r("div",e({className:"book-elements-quote-card",style:e(e({},y.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),we({list:"notable",page:I,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.text,"Notable Quotes",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}})})},"data-selected":"notable"===Ce.list&&Ce.page===I&&Ce.index===i?"true":void 0},{children:[L&&L.length>0?a("p",{style:y.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:m(x(null==o?void 0:o.text,L))}}):a("p",e({style:y.quoteText,className:"book-elements-quote-text"},{children:null==o?void 0:o.text})),r("p",e({style:y.quoteMeta,className:"book-elements-quote-meta"},{children:[f(o.chapter,L)," ",a("br",{})," ",f(o.page,L)]})),r("p",e({style:y.quoteAuthor},{children:["— ",f(null==o?void 0:o.author,L)]}))]}),i)})}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!j&&a(l,{disabled:W,count:K,page:I,onChange:function(e,t){return _(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:y.geoLocationsContainer},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),r("div",e({className:"book-elements-geo-wrapper",style:e(e({},y.quotesPadding),{marginBottom:"8px"})},{children:[ge?a("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return a(s,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===se.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",a("button",e({style:y.retryButton,onClick:function(){return Le({endpoint:"geo-locations",page:ue,isbn:S,setData:ce,setLoading:xe,setHasMore:ye,setTotalPage:ke,title:q})}},{children:"Retry"}))]})):a(i,{children:se.map(function(o,i){var l="geo_location"===Ce.list&&Ce.page===ue&&Ce.index===i;return r("span",e({"data-selected":"geo_location"===Ce.list&&Ce.page===ue&&Ce.index===i?"true":void 0,style:y.geoLocationFlex},{children:[a("span",e({className:"book-elements-geo-text",style:e(e({},y.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),we({list:"geo_location",page:ue,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.name,"Key Geo Locations",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight location:",e),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:L&&L.length>0?a("span",{dangerouslySetInnerHTML:{__html:m(x(null==o?void 0:o.name,L))}}):null==o?void 0:o.name})),i<se.length-1&&a("span",{style:y.geoDivider})]}),i)})}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!me&&a(l,{disabled:ge,count:be,page:ue,onChange:function(e,t){return pe(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:y.charactersContainer},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),$?a("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return r("div",e({style:e(e({},y.characterCard),{flexBasis:"40%"})},{children:[a(s,{variant:"circular",style:e(e({},y.avatar),{flexShrink:0})}),r("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[a(s,{variant:"text",style:{flex:"1",flexShrink:0}}),a(s,{variant:"text",style:{flex:"1"}}),a(s,{variant:"text",style:{flex:"1"}}),a(s,{variant:"text",style:{flex:"1"}})]}))]}),t)})})):0===O.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",a("button",e({style:y.retryButton,onClick:function(){return Le({endpoint:"notable-characters",page:U,isbn:S,setData:V,setLoading:ee,setHasMore:oe,setTotalPage:ie,title:q})}},{children:"Retry"}))]})):a(i,{children:a("div",e({className:"book-elements-characters-grid",style:y.charactersGrid},{children:O.map(function(i,l){var s=e(e({},y.avatar),{backgroundColor:i.bg,color:i.color}),c="key_character"===Ce.list&&Ce.page===U&&Ce.index===l;return r("div",e({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e(e({},y.characterCard),{borderColor:c?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:we({list:"key_character",page:U,index:l}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(i.name,"Key Characters",i.chunkIds,0)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:return e=n.sent(),console.error("Failed to highlight character:",e),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===Ce.list&&Ce.page===U&&Ce.index===l?"true":void 0},{children:[a("div",e({style:s},{children:i.initials})),r("div",e({style:{display:"flex",flexDirection:"column"}},{children:[a("p",e({className:"book-elements-char-name",style:e(e({},y.charName),{margin:0})},{children:L&&L.length>0?a("span",{dangerouslySetInnerHTML:{__html:m(x(i.name,L))}}):i.name})),a("p",e({className:"book-elements-char-desc",style:e(e({},y.charDesc),{margin:0,marginTop:"4px"})},{children:a(p,e({remarkPlugins:[g],rehypePlugins:[h],components:{p:function(t){t.node;var n=o(t,["node"]);return a("p",e({style:{marginTop:0}},n))}}},{children:f(null==i?void 0:i.description,L)}))}))]}))]}),l)})}))}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ne&&a(l,{count:ae,disabled:$,page:U,onChange:function(e,t){return X(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};export{v as default};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n,__rest as o}from"tslib";import{jsxs as r,jsx as a,Fragment as i}from"react/jsx-runtime";import l from"@mui/material/Pagination";import s from"@mui/material/Skeleton";import{useRef as c,useEffect as d,useState as u}from"react";import p from"react-markdown";import g from"rehype-raw";import h from"remark-breaks";import{highlightTermsFunc as x,processTextWithHighlight as f}from"../utils/highlight.js";import{sanitizeHtml as m}from"../../../utils/sanitizeHtml.js";var y={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},v=function(v){var b,k,T;v.data;var C=v.updateQuotesToHighLight,w=v.handleFetchManuscriptElements,S=v.BookIsbn,L=v.title,N=v.highlightTerms,q=v.onHighlightMatch,B=v.defaultPages,D=c(!0);d(function(){return function(){D.current=!1}},[]);var M=u([]),E=M[0],P=M[1],F=u(null!==(b=null==B?void 0:B.quotes)&&void 0!==b?b:1),_=F[0],H=F[1],I=u(!1),W=I[0],z=I[1],R=u(!0),j=R[0],G=R[1],K=u(0),Y=K[0],A=K[1],Q=u([]),O=Q[0],J=Q[1],U=u(null!==(k=null==B?void 0:B.characters)&&void 0!==k?k:1),V=U[0],X=U[1],Z=u(!1),$=Z[0],ee=Z[1],te=u(!0),ne=te[0],oe=te[1],re=u(0),ae=re[0],ie=re[1],le=u([]),se=le[0],ce=le[1],de=u(null!==(T=null==B?void 0:B.locations)&&void 0!==T?T:1),ue=de[0],pe=de[1],ge=u(!1),he=ge[0],xe=ge[1],fe=u(!0),me=fe[0],ye=fe[1],ve=u(0),be=ve[0],ke=ve[1],Te=u({list:"",index:-1,page:1}),Ce=Te[0],we=Te[1],Se=c(!1),Le=c(null);d(function(){if(null==N?void 0:N.length){var e=N.map(function(e){return e.toLowerCase()}),t=function(t){return t&&e.some(function(e){return t.toLowerCase().includes(e)})},n=!1;E.forEach(function(e,o){!n&&t(e.text)&&(we({list:"notable",index:o,page:_}),null==q||q(!0),n=!0)}),se.forEach(function(e,o){!n&&t(e.name)&&(we({list:"geo_location",index:o,page:ue}),null==q||q(!0),n=!0)}),O.forEach(function(e,o){n||!t(e.name)&&!t(e.description)||(we({list:"key_character",index:o,page:V}),null==q||q(!0),n=!0)})}},[N,E,se,O,_,ue,V]),d(function(){B&&(B.quotes&&H(B.quotes),B.locations&&pe(B.locations),B.characters&&X(B.characters))},[B]),d(function(){Se.current=!1},[N]);var Ne=function(e){var o=e.endpoint,r=e.page,a=e.isbn,i=e.setData,l=e.setLoading,s=e.setHasMore,c=e.setTotalPage,d=e.title;return t(void 0,void 0,void 0,function(){var e,t,u,p;return n(this,function(n){switch(n.label){case 0:l(!0),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,w({endpoint:o,page:r,pageSize:10,isbn:a,title:d})];case 2:return e=n.sent(),D.current?(i((null==e?void 0:e.data)||[]),c((null===(t=null==e?void 0:e.pagination)||void 0===t?void 0:t.totalPages)||0),s(!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.hasPrevious)),[3,4]):[2];case 3:return D.current&&l(!1),[7];case 4:return[2]}})})};return d(function(){Ne({endpoint:"notable-quotes",page:_,isbn:S,setData:P,setLoading:z,setHasMore:G,setTotalPage:A,title:L})},[_]),d(function(){Ne({endpoint:"notable-characters",page:V,isbn:S,setData:J,setLoading:ee,setHasMore:oe,setTotalPage:ie,title:L})},[V]),d(function(){Ne({endpoint:"geo-locations",page:ue,isbn:S,setData:ce,setLoading:xe,setHasMore:ye,setTotalPage:ke,title:L})},[ue]),r("div",e({ref:Le,className:"book-elements-container"},{children:[r("div",e({style:{marginBottom:"24px"}},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Notable Quotes"})),r("div",e({style:y.quotesPadding},{children:[W?a("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return r("div",e({className:"book-elements-quote-card",style:y.quoteCard},{children:[a(s,{variant:"text",width:"60%",height:28}),a(s,{variant:"text",width:"40%",height:20}),a(s,{variant:"text",width:"25%",height:20}),a(s,{variant:"text",width:"30%",height:20})]}),t)})})):0===E.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",a("button",e({style:y.retryButton,onClick:function(){return Ne({endpoint:"notable-quotes",page:_,isbn:S,setData:P,setLoading:z,setHasMore:G,setTotalPage:A,title:L})}},{children:"Retry"}))]})):a(i,{children:E.map(function(o,i){var l="notable"===Ce.list&&Ce.page===_&&Ce.index===i;return r("div",e({className:"book-elements-quote-card",style:e(e({},y.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),we({list:"notable",page:_,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.text,"Notable Quotes",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}})})},"data-selected":"notable"===Ce.list&&Ce.page===_&&Ce.index===i?"true":void 0},{children:[N&&N.length>0?a("p",{style:y.quoteText,className:"book-elements-quote-text",dangerouslySetInnerHTML:{__html:m(x(null==o?void 0:o.text,N))}}):a("p",e({style:y.quoteText,className:"book-elements-quote-text"},{children:null==o?void 0:o.text})),r("p",e({style:y.quoteMeta,className:"book-elements-quote-meta"},{children:[f(o.chapter,N)," ",a("br",{})," ",f(o.page,N)]})),r("p",e({style:y.quoteAuthor},{children:["— ",f(null==o?void 0:o.author,N)]}))]}),i)})}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!j&&a(l,{disabled:W,count:Y,page:_,onChange:function(e,t){return H(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:y.geoLocationsContainer},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Key Geo Locations"})),r("div",e({className:"book-elements-geo-wrapper",style:e(e({},y.quotesPadding),{marginBottom:"8px"})},{children:[he?a("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(e){return a(s,{variant:"rectangular",width:100,height:20,style:{borderRadius:"8px"}},e)})})):0===se.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",a("button",e({style:y.retryButton,onClick:function(){return Ne({endpoint:"geo-locations",page:ue,isbn:S,setData:ce,setLoading:xe,setHasMore:ye,setTotalPage:ke,title:L})}},{children:"Retry"}))]})):a(i,{children:se.map(function(o,i){var l="geo_location"===Ce.list&&Ce.page===ue&&Ce.index===i;return r("span",e({"data-selected":"geo_location"===Ce.list&&Ce.page===ue&&Ce.index===i?"true":void 0,style:y.geoLocationFlex},{children:[a("span",e({className:"book-elements-geo-text",style:e(e({},y.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),we({list:"geo_location",page:ue,index:i}),(null===(t=null==o?void 0:o.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(o.name,"Key Geo Locations",o.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight location:",e),[3,4];case 4:return[2]}})})},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:N&&N.length>0?a("span",{dangerouslySetInnerHTML:{__html:m(x(null==o?void 0:o.name,N))}}):null==o?void 0:o.name})),i<se.length-1&&a("span",{style:y.geoDivider})]}),i)})}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!me&&a(l,{disabled:he,count:be,page:ue,onChange:function(e,t){return pe(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:y.charactersContainer},{children:[a("p",e({style:y.sectionTitle,className:"book-elements-section-title"},{children:"Key Characters"})),$?a("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map(function(t){return r("div",e({style:e(e({},y.characterCard),{flexBasis:"40%"})},{children:[a(s,{variant:"circular",style:e(e({},y.avatar),{flexShrink:0})}),r("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[a(s,{variant:"text",style:{flex:"1",flexShrink:0}}),a(s,{variant:"text",style:{flex:"1"}}),a(s,{variant:"text",style:{flex:"1"}}),a(s,{variant:"text",style:{flex:"1"}})]}))]}),t)})})):0===O.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",a("button",e({style:y.retryButton,onClick:function(){return Ne({endpoint:"notable-characters",page:V,isbn:S,setData:J,setLoading:ee,setHasMore:oe,setTotalPage:ie,title:L})}},{children:"Retry"}))]})):a(i,{children:a("div",e({className:"book-elements-characters-grid",style:y.charactersGrid},{children:O.map(function(i,l){var s=e(e({},y.avatar),{backgroundColor:i.bg,color:i.color}),c="key_character"===Ce.list&&Ce.page===V&&Ce.index===l;return r("div",e({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},className:"book-elements-character-card",style:e(e({},y.characterCard),{borderColor:c?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:we({list:"key_character",page:V,index:l}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,C(i.name,"Key Characters",i.chunkIds,0)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:return e=n.sent(),console.error("Failed to highlight character:",e),[3,5];case 5:return[2]}})})},"data-selected":"key_character"===Ce.list&&Ce.page===V&&Ce.index===l?"true":void 0},{children:[a("div",e({style:s},{children:i.initials})),r("div",e({style:{display:"flex",flexDirection:"column"}},{children:[a("p",e({className:"book-elements-char-name",style:e(e({},y.charName),{margin:0})},{children:N&&N.length>0?a("span",{dangerouslySetInnerHTML:{__html:m(x(i.name,N))}}):i.name})),a("p",e({className:"book-elements-char-desc",style:e(e({},y.charDesc),{margin:0,marginTop:"4px"})},{children:a(p,e({remarkPlugins:[h],rehypePlugins:[g],components:{p:function(t){t.node;var n=o(t,["node"]);return a("p",e({style:{marginTop:0}},n))}}},{children:f(null==i?void 0:i.description,N)}))}))]}))]}),l)})}))}),a("div",e({className:"book-elements-pagination",style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!ne&&a(l,{count:ae,disabled:$,page:V,onChange:function(e,t){return X(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]}))};export{v as default};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as n,jsxs as e}from"react/jsx-runtime";import{useRef as t,useState as a,useEffect as i}from"react";import o from"./StormeeChatCitation.module.css.js";function l(l){var c=l.src,s=l.highlights,d=void 0===s?[]:s,f=l.onTimeUpdate,v=l.timestampStart,m=void 0===v?0:v,g=l.timestampEnd,p=l.iconsConfig,h=t(null),w=t(null),y=t(null),C=a(!1),b=C[0],N=C[1],j=a("00:00"),D=j[0],P=j[1],z=a("00:00"),S=z[0],R=z[1],A=a(null),E=A[0],T=A[1],k=a(!0),W=k[0],x=k[1],B=a(!1),F=B[0],I=B[1],L=a(null),M=L[0],U=L[1],q=t(null),G=t(null),H=null==p?void 0:p.PlayIcon,J=null==p?void 0:p.PauseIcon;i(function(){Promise.all([import("wavesurfer.js"),import("wavesurfer.js/dist/plugins/regions.js")]).then(function(r){var n=r[0],e=r[1];q.current=n.default,G.current=e.default,I(!0)}).catch(function(){U("wavesurfer.js is not installed. Run: npm install wavesurfer.js"),x(!1)})},[]),i(function(){if(F&&h.current&&q.current&&G.current){var r=null,n=!1;return function(){try{T(null),x(!0);var e=function(r){if(r.startsWith("gs://")){var n=r.replace("gs://","");return"https://storage.googleapis.com/".concat(n)}return r}(c);r=q.current.create({container:h.current,waveColor:"#D0D5DD",progressColor:"#9CA3AF",cursorColor:"#6B7280",barWidth:2,barRadius:3,height:72,normalize:!0,url:e}),w.current=r,y.current=r.registerPlugin(G.current.create()),r.on("ready",function(){if(!n){var e=r.getDuration();R(u(e)),x(!1),void 0!==g&&g>m&&y.current&&y.current.addRegion({start:m,end:g,color:"rgb(254, 239, 137)",drag:!1,resize:!1}),d.forEach(function(r){var n;y.current.addRegion({start:r.start,end:r.end,color:null!==(n=r.color)&&void 0!==n?n:"rgb(254, 239, 137)",drag:!1,resize:!1})})}}),r.on("error",function(){n||(T("Audio preview unavailable"),x(!1))}),r.on("audioprocess",function(n){P(u(n)),null==f||f(n),void 0!==g&&n>=g&&r.isPlaying()&&(r.pause(),r.seekTo(m/r.getDuration()))}),r.on("play",function(){return N(!0)}),r.on("pause",function(){return N(!1)})}catch(r){if(n)return;T("Failed to initialize audio player"),x(!1)}}(),function(){var r;n=!0,null===(r=w.current)||void 0===r||r.destroy()}}},[F,c,d,f,m,g]);return M?n("div",r({className:o.awContainer},{children:n("div",r({className:o.awError},{children:M}))})):e("div",r({className:o.awContainer},{children:[E&&n("div",r({className:o.awError},{children:"Audio preview is unavailable for this item."})),W&&!E&&n("div",r({className:o.awLoading},{children:"Loading audio..."})),!E&&e("div",r({className:o.awRow},{children:[n("button",r({onClick:function(){w.current&&(w.current.isPlaying()?w.current.pause():(void 0!==g&&w.current.seekTo(m/w.current.getDuration()),w.current.play()))},className:o.awPlayBtn,disabled:!!E||W},{children:b?J?n(J,{size:20}):n("span",{children:"⏸"}):H?n(H,{size:20}):n("span",{children:"▶"})})),n("div",{ref:h,className:o.awWaveform})]})),e("div",r({className:o.awTime},{children:[D," / ",S]}))]}))}function u(r){var n=Math.floor(r/60),e=Math.floor(r%60);return"".concat(String(n).padStart(2,"0"),":").concat(String(e).padStart(2,"0"))}export{l as AudioWaveform,l as default};
|
|
2
2
|
//# sourceMappingURL=AudioWaveform.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useRef as r,useMemo as o,useState as a,useEffect as l,useCallback as d}from"react";import{generateClassName as u,cssPropertiesToString as s,getClassNameFromDiagnostic as c}from"../../../utils/codeCitations.utils.js";var g;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Information=2]="Information",e[e.Hint=3]="Hint"}(g||(g={}));var v=function(g){var v=g.startIndex,h=g.endIndex,f=g.language,m=g.editorHeight,p=g.editorWidth,x=g.code,I=g.isHighlightingEnabled,y=g.isDarkModeEnabled,S=g.openHighlightedCodeDetails,b=g.highlightCodeStatsLine;g.setHighlightCodeStatsLine;var C=g.highlightCodeStatsVariable;g.setHighlightCodeStatsVariable,g.setHighlightIndexes;var L=g.isExpanded,R=g.highlightIndexes,w=g.diagnostics,O=g.diagnosticStylesBySeverity,j=r(null),D=r([]);r([]);var H=r([]),k=r([]),E=o(function(){return v},[v]),M=o(function(){return h},[h]),N=a(null),V=N[0],W=N[1],z=a(null),A=z[0],F=z[1],T=a(null),q=T[0],_=T[1],B=a(void 0),J=B[0],P=B[1],G=a(null),K=G[0],Q=G[1];l(function(){Promise.all([import("@monaco-editor/react"),import("highlight.js/lib/core")]).then(function(e){var n=e[0],t=e[1];_(function(){return n.default});var i=t.default.highlightAuto(x).language;P(i)}).catch(function(){Q("Code editor dependencies not installed. Run: npm install @monaco-editor/react highlight.js")})},[x]);var U=o(function(){return O&&"object"==typeof O&&Object.entries(O).map(function(e){var n=e[0],t=e[1],i=[];return t.style&&i.push(".".concat(u(t.style,+n,!0)," {\n").concat(s(t.style),"\n}")),t.lightModeStyle&&i.push(".".concat(u(t.lightModeStyle,+n,!1)," {\n").concat(s(t.lightModeStyle),"\n}")),i.join("\n")}).join("\n")},[O]);l(function(){return function(){var e;(null===(e=j.current)||void 0===e?void 0:e._resizeObserver)&&j.current._resizeObserver.disconnect()}},[]),l(function(){if(I&&V&&j.current&&A){var e=V.start,n=V.end;if(X(j.current,e,n,b,C),-1===v&&w&&w.length>0){var t=w[0].range,i=t.lineStart,r=t.lineEnd;X(j.current,i,r,b,C)}}},[V,A,I,b,C]),l(function(){var e,n,t;if(A&&j.current&&I){var i=j.current;if(R&&(null===(e=Object.keys(R))||void 0===e?void 0:e.length)>0&&-1!==(null==R?void 0:R.startIndex)&&-1!==(null==R?void 0:R.endIndex)){var r=i.deltaDecorations(D.current,[{range:new A.Range(R.startIndex,1,R.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);D.current=r}if(b&&(null===(n=Object.keys(b))||void 0===n?void 0:n.length)>0&&-1!==(null==b?void 0:b.startIndex)&&-1!==(null==b?void 0:b.endIndex)&&(null==b?void 0:b.name)){r=i.deltaDecorations(D.current,[{range:new A.Range(b.startIndex,1,b.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);D.current=r}if(C&&(null===(t=Object.keys(C))||void 0===t?void 0:t.length)>0&&-1!==(null==C?void 0:C.startIndex)&&-1!==(null==C?void 0:C.endIndex)&&(null==b?void 0:b.name)){r=i.deltaDecorations(H.current,[{range:new A.Range(C.startIndex,1,C.endIndex,1),options:{isWholeLine:!0,className:"myLineHighlight"}}]);H.current=r}}},[v,h,I,A,b,JSON.stringify(C)]),l(function(){if(A&&j.current&&(null==w?void 0:w.length)&&O){var e=j.current,n=w.map(function(e){var n,t,i=c(e.severity,null==y||y,O);return{range:new A.Range(e.range.lineStart,null!==(n=e.range.columnStart)&&void 0!==n?n:1,e.range.lineEnd,null!==(t=e.range.columnEnd)&&void 0!==t?t:1),options:{className:i,isWholeLine:void 0===e.range.columnStart}}});k.current=e.deltaDecorations(k.current,n)}},[w,O,A,y]);var X=d(function(e,n,t,i,r){var o,a;if(A&&e&&I){var l=e.getModel();l&&(n=Math.max(-1,n),(t=Math.min(t,l.getLineCount()))<n&&(t=n),requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new A.Range(n,1,t,1),A.editor.ScrollType.Smooth),e.setSelection(new A.Range(n,1,t+1,1))}),i&&-1!==(null==i?void 0:i.startIndex)&&-1!==(null==i?void 0:i.endIndex)&&requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new A.Range(i.startIndex,1,i.endIndex,1),A.editor.ScrollType.Smooth),e.setSelection(new A.Range(i.startIndex,1,i.endIndex+1,1))}),0===(null===(o=Object.keys(r))||void 0===o?void 0:o.length)&&e.getContribution("editor.contrib.findController").getState().change({isRevealed:!1},!1),(null===(a=Object.keys(r))||void 0===a?void 0:a.length)>0&&(requestAnimationFrame(function(){e.revealRangeInCenterIfOutsideViewport(new A.Range(r.startIndex,1,r.endIndex,1),A.editor.ScrollType.Smooth),e.setSelection(new A.Range(r.startIndex,1,r.endIndex+1,1))}),e.trigger("keyboard","actions.find"),e.getAction("actions.find").run(),e.getContribution("editor.contrib.findController").getState().change({searchString:(null==r?void 0:r.variableName)||"",isRevealed:!0},!1)))}},[A,I,v,h,null==b?void 0:b.startIndex,null==b?void 0:b.endIndex,C]);l(function(){if(j.current&&A&&I){var e=j.current,n=e.onDidLayoutChange(function(){if(X(e,v,h,b,C),-1===v&&w&&w.length>0){var n=w[0].range,t=n.lineStart,i=n.lineEnd;X(e,t,i,b,C)}});return function(){return n.dispose()}}},[X,v,h,I,null==b?void 0:b.startIndex,null==b?void 0:b.endIndex,C,L]);var Y=d(function(e,n){X(e,E,M),j.current=e,F(n),W({start:E,end:M});var t=e.getContainerDomNode(),i=new ResizeObserver(function(){e.layout()});if(i.observe(t),j.current._resizeObserver=i,I){var r=e.getDomNode(),o=document.createElement("div");null==r||r.appendChild(o);var a=function(){var n=e.getTopForLineNumber(E)-e.getScrollTop();o.style.top="".concat(n,"px")};e.onDidScrollChange(a),a()}},[v,h,I,S]);return K?n("div",e({style:{color:"red",fontSize:"12px",padding:"8px"}},{children:K})):q?t(i,{children:[n(q,{height:m,width:p,defaultLanguage:J||f,defaultValue:x,theme:y?"vs-dark":"vs-light",onMount:Y,beforeMount:function(e){e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0})},options:{minimap:{enabled:!0},overviewRulerLanes:3,fontFamily:"Plus Jakarta Sans, sans-serif",scrollBeyondLastLine:!1,readOnly:!0,smoothScrolling:!0,automaticLayout:!0,lineDecorationsWidth:10,padding:{top:20,bottom:20}}}),t("style",{children:[U,".myLineHighlight { background-color: rgba(0, 122, 204, 0.3); }"]})]}):n("div",e({style:{padding:"8px",color:"#666"}},{children:"Loading code editor..."}))};export{g as DiagnosticSeverity,v as default};
|
|
2
2
|
//# sourceMappingURL=CodeEditor.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import{Worker as
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import{Worker as t,Viewer as o,SpecialZoomLevel as i}from"@react-pdf-viewer/core";import{pdfStyles as l}from"./PdfStyle.js";var d="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js",n=function(n){var f=n.pdfUrl,p=n.plugins,a=n.onLoad;return e("div",r({style:l.pdfConatiner},{children:e(t,r({workerUrl:d},{children:e(o,{fileUrl:f,defaultScale:i.ActualSize,plugins:p,onDocumentLoad:a})}))}))};export{n as default,d as pdfWorker};
|
|
2
2
|
//# sourceMappingURL=PdfContainer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as e,jsx as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as e,jsx as n,Fragment as l}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{renderCitationAIConfidenceDisplay as r}from"../components/CitationAIConfidenceDisplay.js";import d from"./FileCitationContent.module.css.js";var a=function(a){var s,c,u,v,f,g,h=null===(s=null==a?void 0:a.closeCitationConfig)||void 0===s?void 0:s.CloseIcon,p=null===(c=null==a?void 0:a.cachingConfig)||void 0===c?void 0:c.queryClient,m=a.styles,C=["getSignedUrl",(null==a?void 0:a.gsUtilPath)||""],U=null!==(v=null===(u=a.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlQuery)&&void 0!==v?v:function(i,e){return{data:void 0}},y=null!==(g=null===(f=a.cachingConfig)||void 0===f?void 0:f.useGetSignedUrlMutation)&&void 0!==g?g:function(i){return{mutate:function(i){},isPending:!1}},P=U((null==a?void 0:a.gsUtilPath)||"",C).data,w=y((null==a?void 0:a.gsUtilPath)||""),N=w.mutate,k=w.isPending,W=t(null),D=W[0],S=W[1],j=t(null),I=j[0],x=j[1];o(function(){import("@react-pdf-viewer/core").then(function(i){S({Worker:i.Worker,Viewer:i.Viewer})}).catch(function(){x("@react-pdf-viewer/core is not installed. Run: npm install @react-pdf-viewer/core")})},[]),o(function(){a.signedUrl||(a.gsUtilPath?((null==p?void 0:p.getQueryData)?p.getQueryData(C):void 0)||N({gsUtilPath:a.gsUtilPath}):console.error("Error -> FileCitationContent: gsUtilPath is required to fetch signed URL"))},[a.gsUtilPath,a.signedUrl,p,N]);var A=function(e){if(I)return n("div",i({style:{color:"red",fontSize:"12px"}},{children:I}));if(!D)return n("div",{children:"Loading PDF viewer..."});var l=D.Worker,t=D.Viewer;return n(l,i({workerUrl:"https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js"},{children:n(t,{fileUrl:e})}))};return e("div",i({className:d.container,style:null==m?void 0:m.container},{children:[e("div",i({className:d.header,style:null==m?void 0:m.header},{children:[n("h2",i({className:d.title,style:null==m?void 0:m.title},{children:a.title})),(null==a?void 0:a.closeCitationConfig)?e("div",i({className:d.headerActions,style:null==m?void 0:m.headerActions},{children:[r(a.relevanceScore,!1,null==m?void 0:m.aiConfidenceDisplayPill),n("div",{className:d.divider,style:null==m?void 0:m.divider}),h&&n("div",i({className:d.closeIconWrapper,style:null==m?void 0:m.closeIconWrapper,onClick:a.closeCitationConfig.handleCloseCitationPreview},{children:n(h,{className:d.closeIcon})}))]})):n(l,{children:r(a.relevanceScore,!0,null==m?void 0:m.aiConfidenceDisplayPill)})]})),n("div",i({className:d.contentContainer,style:null==m?void 0:m.contentContainer},{children:n("div",i({className:d.pdfWrapper,style:null==m?void 0:m.pdfWrapper},{children:(null==a?void 0:a.signedUrl)?A(a.signedUrl):!k&&P?A(P):null}))}))]}))};export{a as default};
|
|
2
2
|
//# sourceMappingURL=FileCitationContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as l}from"tslib";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useEffect as n}from"react";import{renderCitationAIConfidenceDisplay as t}from"../components/CitationAIConfidenceDisplay.js";import{CircularProgress as r}from"@mui/material";import a from"./VideoCitationContent.module.css.js";var d=function(d){var s,c,u,v,h,m,g=null===(s=null==d?void 0:d.closeCitationConfig)||void 0===s?void 0:s.CloseIcon,p=null===(c=null==d?void 0:d.cachingConfig)||void 0===c?void 0:c.queryClient,y=d.styles,f=o(null),C=f[0],U=f[1],P=o(null),N=P[0],x=P[1],F=["getSignedUrl",(null==d?void 0:d.gsUtilPath)||""],S=null!==(v=null===(u=d.cachingConfig)||void 0===u?void 0:u.useGetSignedUrlQuery)&&void 0!==v?v:function(l,e){return{data:void 0}},I=null!==(m=null===(h=d.cachingConfig)||void 0===h?void 0:h.useGetSignedUrlMutation)&&void 0!==m?m:function(l){return{mutate:function(){},isPending:!1}},R=S((null==d?void 0:d.gsUtilPath)||"",F).data,T=I((null==d?void 0:d.gsUtilPath)||""),k=T.mutate,w=T.isPending;n(function(){import("react-player").then(function(l){U(function(){return l.default})}).catch(function(){x("react-player is not installed. Run: npm install react-player")})},[]),n(function(){var l;d.videoUrl||(d.gsUtilPath?(null===(l=null==p?void 0:p.getQueryData)||void 0===l?void 0:l.call(p,F))||k({gsUtilPath:d.gsUtilPath}):console.error("Error -> VideoCitationContent: gsUtilPath is required to fetch signed URL"))},[d.gsUtilPath,d.videoUrl,p,k,F]);var D=d.videoUrl||R,V=l({controls:!0,playing:!1,loop:!1,muted:!1,volume:.8,width:"100%",height:"100%"},d.playerConfig);return e("div",l({className:a.container,style:null==y?void 0:y.container},{children:[e("div",l({className:a.header,style:null==y?void 0:y.header},{children:[i("h2",l({className:a.title,style:null==y?void 0:y.title},{children:(null==d?void 0:d.citationTitle)||"Video Reference"})),(null==d?void 0:d.closeCitationConfig)?e("div",l({className:a.headerRight,style:null==y?void 0:y.headerRight},{children:[t(d.relevanceScore,!1,null==y?void 0:y.aiConfidenceDisplayPill),i("div",{className:a.divider,style:null==y?void 0:y.divider}),g&&i("div",l({className:a.closeIconWrapper,style:null==y?void 0:y.closeIconWrapper,onClick:d.closeCitationConfig.handleCloseCitationPreview},{children:i(g,{className:a.closeIcon})}))]})):t(d.relevanceScore,!0,null==y?void 0:y.aiConfidenceDisplayPill)]})),D?N?i("div",l({style:{color:"red",fontSize:"12px"}},{children:N})):C?i("div",l({className:a.videoWrapper,style:null==y?void 0:y.videoWrapper},{children:C&&i(C,{src:D,controls:V.controls,playing:V.playing,loop:V.loop,muted:V.muted,volume:V.volume,style:{width:V.width,height:V.height}})})):e("div",l({className:a.loaderContainer,style:null==y?void 0:y.loaderContainer},{children:[i(r,{size:48,thickness:4,style:{color:"#4F85FF"}}),i("span",l({className:a.loaderText,style:null==y?void 0:y.loaderText},{children:"Loading Player..."}))]})):w?e("div",l({className:a.loaderContainer,style:null==y?void 0:y.loaderContainer},{children:[i("style",{children:".mui-circular-progress-circle { stroke-linecap: round; }"}),i(r,{size:48,thickness:4,style:{color:"#4F85FF"},classes:{circle:"mui-circular-progress-circle"}}),i("span",l({className:a.loaderText,style:null==y?void 0:y.loaderText},{children:"Loading Video..."}))]})):null]}))};export{d as default};
|
|
2
2
|
//# sourceMappingURL=VideoCitationContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookElementsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookElementsCard/BookElementsCard.tsx"],"names":[],"mappings":"AASA,OAAO,wBAAwB,CAAC;AA0IhC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,EAAE,CAAC;IACpB,IAAI,EAAG,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,EAAE,YAAY,EAAG,MAAM,KAAK,IAAI,CAAC;IACnH,6BAA6B,EAAE,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACN,EAAE;QACD,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAG,MAAM,CAAA;KACf,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,QAAA,MAAM,gBAAgB,sIASnB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"BookElementsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookElementsCard/BookElementsCard.tsx"],"names":[],"mappings":"AASA,OAAO,wBAAwB,CAAC;AA0IhC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,EAAE,CAAC;IACpB,IAAI,EAAG,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,EAAE,YAAY,EAAG,MAAM,KAAK,IAAI,CAAC;IACnH,6BAA6B,EAAE,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACN,EAAE;QACD,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAG,MAAM,CAAA;KACf,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,QAAA,MAAM,gBAAgB,sIASnB,qBAAqB,4CA6iBvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioWaveform.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CitationViewer/components/AudioWaveform.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AudioWaveform.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CitationViewer/components/AudioWaveform.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAoBhD,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,kBAAkB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,UAAe,EACf,YAAY,EACZ,cAAkB,EAClB,YAAY,EACZ,WAAW,GACZ,EAAE,kBAAkB,2CAqNpB;AAQD,eAAe,aAAa,CAAC"}
|
|
@@ -25,6 +25,6 @@ interface CodeEditorProps {
|
|
|
25
25
|
diagnostics?: IDiagnostic[];
|
|
26
26
|
diagnosticStylesBySeverity?: IDiagnosticStylesBySeverity;
|
|
27
27
|
}
|
|
28
|
-
declare const CodeEditor: ({ startIndex, endIndex, language, editorHeight, editorWidth, code, isHighlightingEnabled, isDarkModeEnabled, openHighlightedCodeDetails, highlightCodeStatsLine, setHighlightCodeStatsLine, highlightCodeStatsVariable, setHighlightCodeStatsVariable, setHighlightIndexes, isExpanded, highlightIndexes, diagnostics, diagnosticStylesBySeverity }: CodeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const CodeEditor: ({ startIndex, endIndex, language, editorHeight, editorWidth, code, isHighlightingEnabled, isDarkModeEnabled, openHighlightedCodeDetails, highlightCodeStatsLine, setHighlightCodeStatsLine, highlightCodeStatsVariable, setHighlightCodeStatsVariable, setHighlightIndexes, isExpanded, highlightIndexes, diagnostics, diagnosticStylesBySeverity, }: CodeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export default CodeEditor;
|
|
30
30
|
//# sourceMappingURL=CodeEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CodeCitation/_components/CodeEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CodeCitation/_components/CodeEditor.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAO5F,oBAAY,kBAAkB;IAAG,KAAK,IAAI;IAAE,OAAO,IAAI;IAAE,WAAW,IAAI;IAAE,IAAI,IAAI;CAAE;AAEpF,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0BAA0B,CAAC,EAAE,GAAG,CAAC;IACjC,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,yBAAyB,CAAC,EAAE,GAAG,CAAC;IAChC,0BAA0B,EAAE,GAAG,CAAC;IAChC,6BAA6B,EAAE,GAAG,CAAC;IACnC,mBAAmB,CAAC,EAAE,GAAG,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,GAAG,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,0BAA0B,CAAC,EAAE,2BAA2B,CAAC;CAC1D;AAED,QAAA,MAAM,UAAU,yVAmBb,eAAe,4CAmXjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EpubPreview.d.ts","sourceRoot":"","sources":["../../../../../../src/features/DatagestMon/EpubPreviewer/EpubPreview.tsx"],"names":[],"mappings":"AAUA,UAAU,KAAK;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;
|
|
1
|
+
{"version":3,"file":"EpubPreview.d.ts","sourceRoot":"","sources":["../../../../../../src/features/DatagestMon/EpubPreviewer/EpubPreview.tsx"],"names":[],"mappings":"AAUA,UAAU,KAAK;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAoBD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,2CAkLzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfContainer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PdfContainer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfContainer.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,EAAE,MAAwE,CAAC;AAGjG,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,YAAY,gCAAiC,KAAK,4CAavD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/types/src/features/RequirementAiCitations/FileCitation/FileCitationContent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileCitationContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAiCitations/FileCitation/FileCitationContent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FileCitationContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAiCitations/FileCitation/FileCitationContent.tsx"],"names":[],"mappings":";AAOA,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE;QACpB,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC;QAC7B,0BAA0B,EAAE,MAAM,IAAI,CAAC;KACxC,CAAC;IACF,aAAa,CAAC,EAAE;QACd,WAAW,EAAE,GAAG,CAAC;QACjB,oBAAoB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC;QACtE,uBAAuB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,GAAG,CAAC;KACtD,CAAC;IACF,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACjC,uBAAuB,CAAC,EAAE;YACxB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAKD,QAAA,MAAM,mBAAmB,UAAW,MAAM,4CAyJzC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/types/src/features/RequirementAiCitations/VideoCitation/VideoCitationContent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoCitationContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAiCitations/VideoCitation/VideoCitationContent.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"VideoCitationContent.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAiCitations/VideoCitation/VideoCitationContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,UAAU,MAAM;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE;QACpB,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC;QAC7B,0BAA0B,EAAE,MAAM,IAAI,CAAC;KACxC,CAAC;IACF,aAAa,CAAC,EAAE;QACd,WAAW,EAAE,GAAG,CAAC;QACjB,oBAAoB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC;QACtE,uBAAuB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,GAAG,CAAC;KACtD,CAAC;IACF,YAAY,CAAC,EAAE;QACb,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAClC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACtC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACjC,uBAAuB,CAAC,EAAE;YACxB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAED,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAuM1C,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-llm-studio/citation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.138",
|
|
4
4
|
"author": "Devesh Patel",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -175,35 +175,17 @@
|
|
|
175
175
|
"@react-pdf-viewer/page-navigation": "^3.12.0",
|
|
176
176
|
"@react-pdf-viewer/search": "^3.12.0",
|
|
177
177
|
"@react-pdf-viewer/zoom": "^3.12.0",
|
|
178
|
+
"highlight.js": "^11.11.1",
|
|
179
|
+
"pdfjs-dist": "^3.11.174",
|
|
180
|
+
"react-player": "^3.4.0",
|
|
181
|
+
"react-reader": "^2.0.13",
|
|
182
|
+
"wavesurfer.js": "^7.12.1",
|
|
178
183
|
"@rollup/plugin-commonjs": "28.0.2",
|
|
179
184
|
"@rollup/plugin-json": "6.1.0",
|
|
180
185
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
181
186
|
"@rollup/plugin-strip": "3.0.4",
|
|
182
187
|
"@rollup/plugin-url": "^8.0.2",
|
|
183
188
|
"@svgr/rollup": "8.1.0",
|
|
184
|
-
"@types/react": "17.0.83",
|
|
185
|
-
"@types/react-dom": "17.0.26",
|
|
186
|
-
"@types/react-router-dom": "5.3.3",
|
|
187
|
-
"@types/react-syntax-highlighter": "^15.5.13",
|
|
188
|
-
"@types/react-window": "^1.8.8",
|
|
189
|
-
"ajv": "8.12.0",
|
|
190
|
-
"ajv-keywords": "5.1.0",
|
|
191
|
-
"axios": "1.7.9",
|
|
192
|
-
"highlight.js": "^11.11.1",
|
|
193
|
-
"moment": "2.29.4",
|
|
194
|
-
"moment-timezone": "0.5.34",
|
|
195
|
-
"pdfjs-dist": "^3.11.174",
|
|
196
|
-
"react-markdown": "^8.0.7",
|
|
197
|
-
"react-reader": "^2.0.13",
|
|
198
|
-
"react-resizable-panels": "^3.0.6",
|
|
199
|
-
"react-router-dom": "5.2.0",
|
|
200
|
-
"react-scripts": ">=5.0.1",
|
|
201
|
-
"react-syntax-highlighter": "^15.6.1",
|
|
202
|
-
"react-virtualized-auto-sizer": "^1.0.26",
|
|
203
|
-
"react-window": "^1.8.11",
|
|
204
|
-
"rehype-raw": "^7.0.0",
|
|
205
|
-
"remark-breaks": "^4.0.0",
|
|
206
|
-
"remark-gfm": "^4.0.1",
|
|
207
189
|
"rollup": "2.79.2",
|
|
208
190
|
"rollup-plugin-babel": "4.4.0",
|
|
209
191
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
@@ -212,30 +194,85 @@
|
|
|
212
194
|
"rollup-plugin-terser": "7.0.2",
|
|
213
195
|
"rollup-plugin-typescript2": "0.36.0",
|
|
214
196
|
"rollup-plugin-visualizer": "5.12.0",
|
|
215
|
-
"ts-loader": "9.5.1",
|
|
216
197
|
"typescript": "4.9.5",
|
|
198
|
+
"ts-loader": "9.5.1",
|
|
199
|
+
"@types/react": "17.0.83",
|
|
200
|
+
"@types/react-dom": "17.0.26",
|
|
201
|
+
"@types/react-router-dom": "5.3.3",
|
|
202
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
203
|
+
"@types/react-window": "^1.8.8",
|
|
204
|
+
"ajv": "8.12.0",
|
|
205
|
+
"ajv-keywords": "5.1.0",
|
|
206
|
+
"react-scripts": ">=5.0.1",
|
|
207
|
+
"react-router-dom": "5.2.0",
|
|
217
208
|
"webpack-bundle-analyzer": "^4.10.2"
|
|
218
209
|
},
|
|
219
210
|
"peerDependencies": {
|
|
211
|
+
"react": ">=16.8.0 <19.0.0",
|
|
212
|
+
"react-dom": ">=16.8.0 <19.0.0",
|
|
213
|
+
"@mui/material": "^6.5.0",
|
|
214
|
+
"@emotion/react": "^11.13.5",
|
|
215
|
+
"@emotion/styled": "^11.13.0",
|
|
216
|
+
"pdfjs-dist": "^3.11.174",
|
|
220
217
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
221
218
|
"@react-pdf-viewer/page-navigation": "^3.12.0",
|
|
222
219
|
"@react-pdf-viewer/search": "^3.12.0",
|
|
223
220
|
"@react-pdf-viewer/zoom": "^3.12.0",
|
|
224
|
-
"
|
|
225
|
-
"react": "
|
|
226
|
-
"react
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
|
|
221
|
+
"wavesurfer.js": "^7.12.1",
|
|
222
|
+
"react-player": "^3.4.0",
|
|
223
|
+
"@monaco-editor/react": "^4.7.0",
|
|
224
|
+
"react-reader": "^2.0.13",
|
|
225
|
+
"highlight.js": "^11.11.1",
|
|
226
|
+
"@mui/icons-material": "^6.5.0"
|
|
227
|
+
},
|
|
228
|
+
"peerDependenciesMeta": {
|
|
229
|
+
"@mui/icons-material": {
|
|
230
|
+
"optional": true
|
|
231
|
+
},
|
|
232
|
+
"pdfjs-dist": {
|
|
233
|
+
"optional": true
|
|
234
|
+
},
|
|
235
|
+
"@react-pdf-viewer/core": {
|
|
236
|
+
"optional": true
|
|
237
|
+
},
|
|
238
|
+
"@react-pdf-viewer/page-navigation": {
|
|
239
|
+
"optional": true
|
|
240
|
+
},
|
|
241
|
+
"@react-pdf-viewer/search": {
|
|
242
|
+
"optional": true
|
|
243
|
+
},
|
|
244
|
+
"@react-pdf-viewer/zoom": {
|
|
245
|
+
"optional": true
|
|
246
|
+
},
|
|
247
|
+
"wavesurfer.js": {
|
|
248
|
+
"optional": true
|
|
249
|
+
},
|
|
250
|
+
"react-player": {
|
|
251
|
+
"optional": true
|
|
252
|
+
},
|
|
253
|
+
"@monaco-editor/react": {
|
|
254
|
+
"optional": true
|
|
255
|
+
},
|
|
256
|
+
"react-reader": {
|
|
257
|
+
"optional": true
|
|
258
|
+
},
|
|
259
|
+
"highlight.js": {
|
|
260
|
+
"optional": true
|
|
261
|
+
}
|
|
231
262
|
},
|
|
232
263
|
"dependencies": {
|
|
233
264
|
"dayjs": "^1.11.19",
|
|
234
265
|
"dompurify": "^3.3.1",
|
|
235
266
|
"lucide-react": "^0.562.0",
|
|
236
267
|
"pdf-collaborative-tool": "^0.7.0",
|
|
237
|
-
"react-
|
|
238
|
-
"react-
|
|
239
|
-
"
|
|
268
|
+
"react-markdown": "^8.0.7",
|
|
269
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
270
|
+
"rehype-raw": "^7.0.0",
|
|
271
|
+
"remark-gfm": "^4.0.1",
|
|
272
|
+
"remark-breaks": "^4.0.0",
|
|
273
|
+
"react-window": "^1.8.11",
|
|
274
|
+
"react-virtualized-auto-sizer": "^1.0.26",
|
|
275
|
+
"react-resizable-panels": "^3.0.6",
|
|
276
|
+
"axios": "^1.7.9"
|
|
240
277
|
}
|
|
241
278
|
}
|