@e-llm-studio/citation 0.0.225 → 0.0.227
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/README.md +90 -26
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js +1 -1
- package/dist/cjs/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
- package/dist/cjs/features/DualCitation/RuleBookCitationApiComponent.js +2 -0
- package/dist/cjs/features/DualCitation/RuleBookCitationApiComponent.js.map +1 -0
- package/dist/cjs/features/DualCitation/RuleBookCitationComponent.js +2 -0
- package/dist/cjs/features/DualCitation/RuleBookCitationComponent.js.map +1 -0
- package/dist/cjs/features/DualCitation/SourceBQDataCompnent.js +2 -0
- package/dist/cjs/features/DualCitation/SourceBQDataCompnent.js.map +1 -0
- package/dist/cjs/features/DualCitation/SourceBQDataCompnent.module.css.js +2 -0
- package/dist/cjs/features/DualCitation/SourceBQDataCompnent.module.css.js.map +1 -0
- package/dist/cjs/features/InstantLearningCitation/InstantLearningCitationComponent.js +1 -1
- package/dist/cjs/features/ParentCitationComponent/ParentCitationComponent.js +1 -1
- package/dist/cjs/features/ParentCitationComponent/citationTypes.js +2 -0
- package/dist/cjs/features/ParentCitationComponent/citationTypes.js.map +1 -0
- package/dist/cjs/features/RulebookCitations/RuleBookCitationApi.js +1 -1
- package/dist/cjs/features/RulebookCitations/RuleBookCitationWrapper.js +1 -1
- package/dist/cjs/features/SplitterCitations/SplitterCitationsComponent.js +1 -1
- package/dist/cjs/features/TextualGuidelines/TextualGuideLinesComponent.js +1 -1
- package/dist/cjs/features/TextualGuidelines/TextualGuidelines.module.css.js +1 -1
- package/dist/cjs/hooks/useOnDemandCitationFetch.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/service/onDemandApi.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js +1 -1
- package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js +1 -1
- package/dist/features/DualCitation/RuleBookCitationApiComponent.js +2 -0
- package/dist/features/DualCitation/RuleBookCitationApiComponent.js.map +1 -0
- package/dist/features/DualCitation/RuleBookCitationComponent.js +2 -0
- package/dist/features/DualCitation/RuleBookCitationComponent.js.map +1 -0
- package/dist/features/DualCitation/SourceBQDataCompnent.js +2 -0
- package/dist/features/DualCitation/SourceBQDataCompnent.js.map +1 -0
- package/dist/features/DualCitation/SourceBQDataCompnent.module.css.js +2 -0
- package/dist/features/DualCitation/SourceBQDataCompnent.module.css.js.map +1 -0
- package/dist/features/InstantLearningCitation/InstantLearningCitationComponent.js +1 -1
- package/dist/features/ParentCitationComponent/ParentCitationComponent.js +1 -1
- package/dist/features/ParentCitationComponent/citationTypes.js +2 -0
- package/dist/features/ParentCitationComponent/citationTypes.js.map +1 -0
- package/dist/features/RulebookCitations/RuleBookCitationApi.js +1 -1
- package/dist/features/RulebookCitations/RuleBookCitationWrapper.js +1 -1
- package/dist/features/SplitterCitations/SplitterCitationsComponent.js +1 -1
- package/dist/features/TextualGuidelines/TextualGuideLinesComponent.js +1 -1
- package/dist/features/TextualGuidelines/TextualGuidelines.module.css.js +1 -1
- package/dist/hooks/useOnDemandCitationFetch.js +1 -1
- package/dist/index.js +1 -1
- package/dist/service/onDemandApi.js +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts +4 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.d.ts +2 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.types.d.ts +162 -0
- package/dist/types/src/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.types.d.ts.map +1 -0
- package/dist/types/src/features/DualCitation/RuleBookCitationApiComponent.d.ts +20 -0
- package/dist/types/src/features/DualCitation/RuleBookCitationApiComponent.d.ts.map +1 -0
- package/dist/types/src/features/DualCitation/RuleBookCitationComponent.d.ts +31 -0
- package/dist/types/src/features/DualCitation/RuleBookCitationComponent.d.ts.map +1 -0
- package/dist/types/src/features/DualCitation/SourceBQDataCompnent.d.ts +36 -0
- package/dist/types/src/features/DualCitation/SourceBQDataCompnent.d.ts.map +1 -0
- package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationComponent.d.ts +15 -2
- package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationComponent.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearningCitation/InstantLearningCitationTest.d.ts.map +1 -1
- package/dist/types/src/features/InstantLearningCitation/types/Types.d.ts +5 -1
- package/dist/types/src/features/InstantLearningCitation/types/Types.d.ts.map +1 -1
- package/dist/types/src/features/ParentCitationComponent/DualRuleBookBqCitationTest.d.ts +4 -0
- package/dist/types/src/features/ParentCitationComponent/DualRuleBookBqCitationTest.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/DualRuleBookGptCitationTest.d.ts +4 -0
- package/dist/types/src/features/ParentCitationComponent/DualRuleBookGptCitationTest.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts +3 -126
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.d.ts.map +1 -1
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.types.d.ts +229 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponent.types.d.ts.map +1 -0
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts +0 -7
- package/dist/types/src/features/ParentCitationComponent/ParentCitationComponentTest.d.ts.map +1 -1
- package/dist/types/src/features/ParentCitationComponent/citationTypes.d.ts +14 -0
- package/dist/types/src/features/ParentCitationComponent/citationTypes.d.ts.map +1 -0
- package/dist/types/src/features/RulebookCitations/RuleBookCitation.types.d.ts +40 -0
- package/dist/types/src/features/RulebookCitations/RuleBookCitation.types.d.ts.map +1 -0
- package/dist/types/src/features/RulebookCitations/RuleBookCitationApi.d.ts +2 -15
- package/dist/types/src/features/RulebookCitations/RuleBookCitationApi.d.ts.map +1 -1
- package/dist/types/src/features/RulebookCitations/RuleBookCitationWrapper.d.ts +19 -5
- package/dist/types/src/features/RulebookCitations/RuleBookCitationWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RulebookCitations/RuleBookCitationWrapperTest.d.ts +0 -2
- package/dist/types/src/features/RulebookCitations/RuleBookCitationWrapperTest.d.ts.map +1 -1
- package/dist/types/src/features/SplitterCitations/SplitterCitationsComponent.d.ts +1 -0
- package/dist/types/src/features/SplitterCitations/SplitterCitationsComponent.d.ts.map +1 -1
- package/dist/types/src/features/TextualGuidelines/TextualGuideLinesComponent.d.ts +13 -1
- package/dist/types/src/features/TextualGuidelines/TextualGuideLinesComponent.d.ts.map +1 -1
- package/dist/types/src/features/TextualGuidelines/TextualGuidelines.types.d.ts +81 -0
- package/dist/types/src/features/TextualGuidelines/TextualGuidelines.types.d.ts.map +1 -0
- package/dist/types/src/hooks/useOnDemandCitationFetch.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/service/onDemandApi.d.ts +1 -1
- package/dist/types/src/service/onDemandApi.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react"),r=require("./TextualGuidelines.module.css.js"),s=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),a=function(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")},o=function(e,n){var t=e.map(a).filter(Boolean),i=n.map(a).filter(Boolean);if(0===t.length||0===i.length)return 0;var r=new Set(t),s=new Set(i),o=0;return r.forEach(function(e){s.has(e)&&o++}),2*o/(r.size+s.size)},l=function(t){var i=0;return t.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(t){var s="bold-".concat(i);return i+=t.length,t.startsWith("**")&&t.endsWith("**")||t.startsWith("__")&&t.endsWith("__")?n.jsx("strong",e.__assign({className:r.default.boldText},{children:t.slice(2,-2)}),s):t})};exports.default=function(a){a.index;var d=a.TextualGuideLines,c=a.HighlightedWords,h=a.InternalGptReasoningData,u=a.headerTitle,g=void 0===u?"Textual Guidelines":u,x=a.useVariantHighlight,f=void 0!==x&&x,p=a.fuzzyThreshold,v=void 0===p?.8:p,m=t.useState(0),I=m[0],_=m[1],b=t.useState(new Set),j=b[0],y=b[1],w=t.useRef([]),C=[];c.forEach(function(e){(function(e,n,t){void 0===t&&(t=.8);var i=n.trim().split(/\s+/).filter(Boolean);if(0===i.length)return[];for(var r,s=[],a=/\S+/g;null!==(r=a.exec(e));)s.push({word:r[0],start:r.index,end:r.index+r[0].length});for(var l=i.length,d=[],c=Math.max(1,l-1);c<=l+2;c++)for(var h=0;h<=s.length-c;h++){var u=s.slice(h,h+c),g=o(i,u.map(function(e){return e.word}));g>=t&&d.push({startIndex:u[0].start,endIndex:u[u.length-1].end,score:g})}if(0===d.length)return[];d.sort(function(e,n){return n.score-e.score});for(var x=[],f=function(e){x.some(function(n){return e.startIndex<n.endIndex&&e.endIndex>n.startIndex})||x.push(e)},p=0,v=d;p<v.length;p++)f(v[p]);return x})(d,e,v).forEach(function(e){return C.push(e)})}),C.sort(function(e,n){return e.startIndex-n.startIndex});for(var k=[],T=0,z=C;T<z.length;T++){var N=z[T],S=k.at(-1);(!S||N.startIndex>=S.endIndex)&&k.push(N)}var D=k.map(function(e,n){return{text:d.substring(e.startIndex,e.endIndex),startIndex:e.startIndex,endIndex:e.endIndex,highlightIndex:n}}),L=D.length;t.useEffect(function(){L>0&&(_(0),setTimeout(function(){var e;null===(e=w.current[0])||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50))},[L]);var M,q,E,G,R=function(e){y(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})};return n.jsxs("div",e.__assign({className:r.default.expandedContainer,style:{marginLeft:"1rem",display:"flex",flexDirection:"column",height:"100%",border:"none"}},{children:[n.jsxs("div",e.__assign({className:r.default.expandedHeader,style:{backgroundColor:"white",border:"none"}},{children:[n.jsx("span",e.__assign({className:r.default.headerTitle,style:{backgroundColor:"white"}},{children:g})),n.jsx("div",e.__assign({className:r.default.headerActions},{children:L>=1&&n.jsxs(n.Fragment,{children:[n.jsxs("span",e.__assign({style:{fontSize:"12px",color:"#888"}},{children:[I+1," / ",L]})),n.jsx("button",e.__assign({onClick:function(){if(0!==L){var e=I>0?I-1:L-1;_(e),setTimeout(function(){var n;null===(n=w.current[e])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50)}},disabled:I<=0,style:{padding:"2px 4px",cursor:I<=0?"not-allowed":"pointer",opacity:I<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:n.jsx(i.ChevronUp,{size:14,color:"#64748b"})})),n.jsx("button",e.__assign({onClick:function(){if(0!==L){var e=I<L-1?I+1:0;_(e),setTimeout(function(){var n;null===(n=w.current[e])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50)}},disabled:I>=L-1,style:{padding:"2px 4px",cursor:I>=L-1?"not-allowed":"pointer",opacity:I>=L-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:n.jsx(i.ChevronDown,{size:14,color:"#64748b"})}))]})}))]})),n.jsx("div",e.__assign({className:r.default.contentArea,style:{flex:1,maxHeight:"none",height:"auto",overflowY:"auto",border:"1px solid #eee",borderRadius:"4px",padding:"1rem"}},{children:n.jsx("div",e.__assign({className:r.default.contentInner},{children:(M=d.split("\n"),q=0,E=0,G=[],M.forEach(function(t){var a=q,o=q+t.length;q+=t.length+1;var c=/^(\s*)(-|\*|\d+\.)\s+/.exec(t),u=/^(Title|Description|Training-basis):\s*/i.exec(t);u&&(E=0),c&&(E+=1);var g=!!c,x=!!u,p=c?c[0].length:0,v=a+p,m=D.filter(function(e){return e.startIndex<o&&e.endIndex>v}),_="line-".concat(a),b=function(t,i,s){x?G.push(n.jsx("span",e.__assign({className:r.default.headerLine},{children:t}),i)):g?G.push(n.jsxs("span",e.__assign({className:r.default.listItemLine,style:{paddingLeft:c[1]?"1rem":"0"}},{children:[s&&n.jsxs("span",e.__assign({className:r.default.listCounter},{children:[E,"."]})),n.jsx("span",{children:t})]}),i)):G.push(n.jsx("span",e.__assign({className:r.default.blockLine},{children:t}),i))};if(0===m.length)b(l(t.substring(p)),_,!0);else{for(var y=v,C=[],k=!0,T=function(t){var a=Math.max(t.startIndex,v),c=Math.min(t.endIndex,o);if(a>=c)return"continue";if(a>y){var u=d.substring(y,a);C.push(n.jsx("span",{children:l(u)},"t-".concat(y)))}var g=t.highlightIndex===I,x=f?g?"".concat(r.default.highlight," ").concat(r.default.highlightActiveVariant):r.default.highlightVariant:g?"".concat(r.default.highlight," ").concat(r.default.highlightActive):r.default.highlight,p=j.has(t.highlightIndex);if(C.push(n.jsxs("span",e.__assign({ref:function(e){w.current[t.highlightIndex]=e},className:x,role:"button",tabIndex:0,onClick:function(){return R(t.highlightIndex)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||R(t.highlightIndex)},style:{display:"inline-flex",alignItems:"center",gap:"2px",cursor:"pointer"}},{children:[d.substring(a,c),p?n.jsx(i.ChevronUp,{size:12,style:{flexShrink:0}}):n.jsx(i.ChevronDown,{size:12,style:{flexShrink:0}})]}),"h-".concat(t.highlightIndex))),y=c,p&&h[t.highlightIndex]){var m=k?_:"".concat(_,"-chunk-").concat(a);b(C,m,k),k=!1,C=[],G.push(n.jsx("div",e.__assign({style:{marginTop:"0.5rem",marginBottom:"0.5rem"}},{children:n.jsx(s.default,{item:e.__assign(e.__assign({},h[t.highlightIndex]),{confidence_score:void 0}),headerTitle:"GPT - Gemini 3.1 Flash Lite",iconsConfig:{ChevronDownIcon:i.ChevronDown,ChevronUpIcon:i.ChevronUp,MaximizeIcon:i.Maximize2,CloseIcon:i.X},bodyHeight:"100%",disableMaximize:!0,index:t.highlightIndex})}),"expanded-".concat(t.highlightIndex)))}},z=0,N=m;z<N.length;z++)T(N[z]);if(y<o&&C.push(n.jsx("span",{children:l(d.substring(y,o))},"t-end-".concat(o))),C.length>0||k){var S=k?_:"".concat(_,"-tail");b(C,S,k)}}}),G)}))}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("lucide-react"),l=require("./TextualGuidelines.module.css.js"),a=require("../CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),s=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.filter(Boolean).join(" ")},o=function(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")},r=function(e,n){var i=e.map(o).filter(Boolean),t=n.map(o).filter(Boolean);if(0===i.length||0===t.length)return 0;var l=new Set(i),a=new Set(t),s=0;return l.forEach(function(e){a.has(e)&&s++}),2*s/(l.size+a.size)},h=function(i){var t=0;return i.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(i){var a="bold-".concat(t);return t+=i.length,i.startsWith("**")&&i.endsWith("**")||i.startsWith("__")&&i.endsWith("__")?n.jsx("strong",e.__assign({className:l.default.boldText},{children:i.slice(2,-2)}),a):i})};exports.default=function(o){o.index;var d=o.TextualGuideLines,c=o.HighlightedWords,u=o.InternalGptReasoningData,g=o.headerTitle,v=void 0===g?"Textual Guidelines":g,x=o.IgptHeaderTitle,f=void 0===x?"GPT - Gemini 3.1 Flash Lite":x,_=o.useVariantHighlight,m=void 0!==_&&_,p=o.fuzzyThreshold,I=void 0===p?.8:p,j=o.onAccordionToggle,C=o.isInternalGptReasoningLoading,y=void 0!==C&&C,b=o.themeTokens,L=o.classNames,N=o.styles,w=i.useState(0),T=w[0],k=w[1],A=i.useState(new Set),z=A[0],B=A[1],V=i.useRef([]),D=[];c.forEach(function(e){(function(e,n,i){void 0===i&&(i=.8);var t=n.trim().split(/\s+/).filter(Boolean);if(0===t.length)return[];for(var l,a=[],s=/\S+/g;null!==(l=s.exec(e));)a.push({word:l[0],start:l.index,end:l.index+l[0].length});for(var o=t.length,h=[],d=Math.max(1,o-1);d<=o+2;d++)for(var c=0;c<=a.length-d;c++){var u=a.slice(c,c+d),g=r(t,u.map(function(e){return e.word}));g>=i&&h.push({startIndex:u[0].start,endIndex:u[u.length-1].end,score:g})}if(0===h.length)return[];h.sort(function(e,n){return n.score-e.score});for(var v=[],x=function(e){v.some(function(n){return e.startIndex<n.endIndex&&e.endIndex>n.startIndex})||v.push(e)},f=0,_=h;f<_.length;f++)x(_[f]);return v})(d,e,I).forEach(function(e){return D.push(e)})}),D.sort(function(e,n){return e.startIndex-n.startIndex});for(var G=[],M=0,R=D;M<R.length;M++){var E=R[M],S=G.at(-1);(!S||E.startIndex>=S.endIndex)&&G.push(E)}var U=G.map(function(e,n){return{text:d.substring(e.startIndex,e.endIndex),startIndex:e.startIndex,endIndex:e.endIndex,highlightIndex:n}}),q=U.length;i.useEffect(function(){q>0&&(k(0),setTimeout(function(){var e;null===(e=V.current[0])||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50))},[q]);var H,P,W,F,K=function(e,n){B(function(i){var t=new Set(i),l=!t.has(e);return t.has(e)?t.delete(e):t.add(e),null==j||j({highlightIndex:e,phrase:n,isExpanded:l}),t})};return n.jsxs("div",e.__assign({className:s(l.default.expandedContainer,null==L?void 0:L.container),style:e.__assign(e.__assign({},b),null==N?void 0:N.container)},{children:[n.jsxs("div",e.__assign({className:s(l.default.expandedHeader,null==L?void 0:L.header),style:null==N?void 0:N.header},{children:[n.jsx("span",e.__assign({className:s(l.default.headerTitle,null==L?void 0:L.headerTitle),style:null==N?void 0:N.headerTitle},{children:v})),n.jsx("div",e.__assign({className:s(l.default.headerActions,null==L?void 0:L.headerActions),style:null==N?void 0:N.headerActions},{children:q>=1&&n.jsxs(n.Fragment,{children:[n.jsxs("span",e.__assign({className:s(l.default.navCounter,null==L?void 0:L.navCounter),style:null==N?void 0:N.navCounter},{children:[T+1," / ",q]})),n.jsx("button",e.__assign({onClick:function(){if(0!==q){var e=T>0?T-1:q-1;k(e),setTimeout(function(){var n;null===(n=V.current[e])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50)}},disabled:T<=0,className:s(l.default.navButton,null==L?void 0:L.navButtonPrev),style:null==N?void 0:N.navButtonPrev},{children:n.jsx(t.ChevronUp,{size:14,className:l.default.navButtonIcon})})),n.jsx("button",e.__assign({onClick:function(){if(0!==q){var e=T<q-1?T+1:0;k(e),setTimeout(function(){var n;null===(n=V.current[e])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50)}},disabled:T>=q-1,className:s(l.default.navButton,null==L?void 0:L.navButtonNext),style:null==N?void 0:N.navButtonNext},{children:n.jsx(t.ChevronDown,{size:14,className:l.default.navButtonIcon})}))]})}))]})),n.jsx("div",e.__assign({className:s(l.default.contentArea,null==L?void 0:L.contentArea),style:null==N?void 0:N.contentArea},{children:n.jsx("div",e.__assign({className:s(l.default.contentInner,null==L?void 0:L.contentInner),style:null==N?void 0:N.contentInner},{children:(H=d.split("\n"),P=0,W=0,F=[],H.forEach(function(i){var o=P,r=P+i.length;P+=i.length+1;var c=/^(\s*)(-|\*|\d+\.)\s+/.exec(i),g=/^(Title|Description|Training-basis):\s*/i.exec(i);g&&(W=0),c&&(W+=1);var v=!!c,x=!!g,_=c?c[0].length:0,p=o+_,I=U.filter(function(e){return e.startIndex<r&&e.endIndex>p}),j="line-".concat(o),C=function(i,t,a,o){x?F.push(n.jsx("span",e.__assign({className:s(l.default.headerLine,null==L?void 0:L.headerLine),style:null==N?void 0:N.headerLine},{children:i}),t)):v?F.push(n.jsxs("span",e.__assign({className:s(l.default.listItemLine,null==L?void 0:L.listItemLine),style:e.__assign({paddingLeft:c[1]?"1rem":"0"},null==N?void 0:N.listItemLine)},{children:[a&&n.jsxs("span",e.__assign({className:s(l.default.listCounter,null==L?void 0:L.listCounter),style:null==N?void 0:N.listCounter},{children:[W,"."]})),n.jsx("span",{children:i})]}),t)):F.push(n.jsx("span",e.__assign({className:s(l.default.blockLine,null==L?void 0:L.blockLine),style:null==N?void 0:N.blockLine},{children:i}),t))},b=v&&1===I.length&&I[0].startIndex<=p&&I[0].endIndex>=r;if(0===I.length)C(h(i.substring(_)),j,!0);else if(b){var w=I[0],k=w.highlightIndex===T,A=z.has(w.highlightIndex),B=m?k?"".concat(l.default.highlightBlockRow," ").concat(l.default.highlightActiveVariant):"".concat(l.default.highlightBlockRow," ").concat(l.default.highlightVariantRow):k?"".concat(l.default.highlightBlockRow," ").concat(l.default.highlightActive):l.default.highlightBlockRow;F.push(n.jsxs("span",e.__assign({ref:function(e){V.current[w.highlightIndex]=e},className:"".concat(l.default.listItemLine," ").concat(B),role:"button",tabIndex:0,onClick:function(){return K(w.highlightIndex,w.text)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||K(w.highlightIndex,w.text)},style:{paddingLeft:c[1]?"1rem":"0"}},{children:[n.jsxs("span",e.__assign({className:l.default.listCounter},{children:[W,"."]})),n.jsx("span",{children:h(d.substring(p,r))}),A?n.jsx(t.ChevronUp,{size:12,style:{verticalAlign:"middle",marginLeft:"2px"}}):n.jsx(t.ChevronDown,{size:12,style:{verticalAlign:"middle",marginLeft:"2px"}})]}),j)),A&&u[w.highlightIndex]?F.push(n.jsx("div",e.__assign({style:{marginTop:"0.5rem",marginBottom:"0.5rem"}},{children:n.jsx(a.default,{item:e.__assign(e.__assign({},u[w.highlightIndex]),{confidence_score:void 0}),headerTitle:f||"GPT - Gemini 3.1 Flash Lite",iconsConfig:{ChevronDownIcon:t.ChevronDown,ChevronUpIcon:t.ChevronUp,MaximizeIcon:t.Maximize2,CloseIcon:t.X},bodyHeight:"100%",disableMaximize:!0,index:w.highlightIndex})}),"expanded-".concat(w.highlightIndex))):A&&y&&F.push(n.jsxs("div",e.__assign({className:l.default.loadingContainer},{children:[n.jsx(t.Loader2,{size:16,className:l.default.spinnerIcon}),n.jsx("span",{children:"Loading..."})]}),"loading-".concat(w.highlightIndex)))}else{var D=p,G=[],M=!0,R=I[0],E=R.highlightIndex===T;m?E?"".concat(l.default.highlight," ").concat(l.default.highlightActiveVariant):l.default.highlightVariant:E?"".concat(l.default.highlight," ").concat(l.default.highlightActive):l.default.highlight,v&&R.startIndex;for(var S=function(i){var o=Math.max(i.startIndex,p),c=Math.min(i.endIndex,r);if(o>=c)return"continue";if(o>D){var g=d.substring(D,o);G.push(n.jsx("span",{children:h(g)},"t-".concat(D)))}var v=i.highlightIndex===T,x=m?v?s(l.default.highlight,l.default.highlightActiveVariant,null==L?void 0:L.highlight,null==L?void 0:L.highlightActiveVariant):s(l.default.highlightVariant,null==L?void 0:L.highlightVariant):v?s(l.default.highlight,l.default.highlightActive,null==L?void 0:L.highlight,null==L?void 0:L.highlightActive):s(l.default.highlight,null==L?void 0:L.highlight),_=m?v?e.__assign(e.__assign({},null==N?void 0:N.highlight),null==N?void 0:N.highlightActiveVariant):e.__assign({},null==N?void 0:N.highlightVariant):v?e.__assign(e.__assign({},null==N?void 0:N.highlight),null==N?void 0:N.highlightActive):e.__assign({},null==N?void 0:N.highlight),I=z.has(i.highlightIndex);if(G.push(n.jsxs("span",e.__assign({ref:function(e){V.current[i.highlightIndex]=e},className:x,role:"button",tabIndex:0,onClick:function(){return K(i.highlightIndex,i.text)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||K(i.highlightIndex,i.text)},style:e.__assign({display:"inline-flex",alignItems:"center",gap:"2px",cursor:"pointer"},_)},{children:[d.substring(o,c),I?n.jsx(t.ChevronUp,{size:12,style:{verticalAlign:"middle",marginLeft:"2px"}}):n.jsx(t.ChevronDown,{size:12,style:{verticalAlign:"middle",marginLeft:"2px"}})]}),"h-".concat(i.highlightIndex))),D=c,I&&u[i.highlightIndex]){var b=M?j:"".concat(j,"-chunk-").concat(o);C(G,b,M),M=!1,G=[],F.push(n.jsx("div",e.__assign({style:{marginTop:"0.5rem",marginBottom:"0.5rem"}},{children:n.jsx(a.default,{item:e.__assign(e.__assign({},u[i.highlightIndex]),{confidence_score:void 0}),headerTitle:f||"GPT - Gemini 3.1 Flash Lite",iconsConfig:{ChevronDownIcon:t.ChevronDown,ChevronUpIcon:t.ChevronUp,MaximizeIcon:t.Maximize2,CloseIcon:t.X},bodyHeight:"100%",disableMaximize:!0,index:i.highlightIndex})}),"expanded-".concat(i.highlightIndex)))}else I&&y&&(b=M?j:"".concat(j,"-chunk-").concat(o),C(G,b,M),M=!1,G=[],F.push(n.jsxs("div",e.__assign({className:l.default.loadingContainer},{children:[n.jsx(t.Loader2,{size:16,className:l.default.spinnerIcon}),n.jsx("span",{children:"Loading..."})]}),"loading-".concat(i.highlightIndex))))},q=0,H=I;q<H.length;q++)S(H[q]);if(D<r&&G.push(n.jsx("span",{children:h(d.substring(D,r))},"t-end-".concat(r))),G.length>0||M){var X=M?j:"".concat(j,"-tail");C(G,X,M)}}}),F)}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=TextualGuideLinesComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".TextualGuidelines-module_container__RJDOE{display:flex;flex-direction:column;gap:.5rem}.TextualGuidelines-module_itemRow__kQWzv{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem}.TextualGuidelines-module_indexNumber__tprYt{color:#475467;font-weight:500}.TextualGuidelines-module_textContent__3JD9T{color:#475467;flex:1;max-width:none}.TextualGuidelines-module_paraphraseButton__FuN0v{align-items:center;background:#0000;border:none;border-radius:.375rem;cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.TextualGuidelines-module_paraphraseText__o5VEv{color:#2563eb;font-weight:500;text-align:start}.TextualGuidelines-module_paraphraseStar__omUYz{color:#2563eb;padding-right:.25rem}.TextualGuidelines-module_chevronIcon__jxUNm{color:#2563eb;height:1rem;transition:transform .2s;width:1rem}.TextualGuidelines-module_chevronIconRotated__oyLRq{transform:rotate(180deg)}.TextualGuidelines-module_expandedContainer__ku2Qy{border:solid #e5e7eb;border-radius:.5rem;border-width:1px 1px 2px;margin-left:1.5rem;margin-top:.5rem;overflow:hidden}.TextualGuidelines-module_expandedHeader__5OOd1{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.25rem .75rem}.TextualGuidelines-module_headerTitle__6vpFm{font-size:.875rem;font-weight:400}.TextualGuidelines-module_headerActions__tAYsZ{align-items:center;display:flex;gap:.5rem}.TextualGuidelines-module_navigationContainer__DAz7T{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.TextualGuidelines-module_navButton__wpCGR{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.TextualGuidelines-module_navButton__wpCGR:hover{background-color:#f3f4f6}.TextualGuidelines-module_navIcon__Aa93S{color:#6b7280;height:1.25rem;width:1.25rem}.TextualGuidelines-module_navCounter__MbQnG{color:#4b5563;font-size:.875rem;min-width:2.25rem;text-align:center}.TextualGuidelines-module_confidenceBadge__ue2t4{align-items:center;background-color:#f0fdf4;border:2px solid #3ac894;border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.TextualGuidelines-module_confidenceStar__vucHk{color:#059669;font-size:.75rem}.TextualGuidelines-module_confidenceScore__rK7mq{color:#059669;font-size:.875rem;font-weight:600}.TextualGuidelines-module_maximizeButton__Lg43k{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.TextualGuidelines-module_maximizeButton__Lg43k:hover{background-color:#e5e7eb}.TextualGuidelines-module_maximizeIcon__RETCs{color:#6b7280;height:1.25rem;width:1.25rem}.TextualGuidelines-module_contentArea__2k4vh{font-size:.875rem;max-height:11rem;overflow-y:auto;padding:.5rem .75rem;scroll-behavior:smooth}.TextualGuidelines-module_contentInner__2uMSz{line-height:1.5rem}.TextualGuidelines-module_footer__AQG-E{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.TextualGuidelines-module_trainingTitle__HH--J{font-size:.875rem;font-style:italic;font-weight:300}.TextualGuidelines-module_trainingTitleLink__s7Oqw{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;font-size:.8rem;font-weight:600;gap:.25rem}.TextualGuidelines-module_modalDialog__OtQxY{background:#0000;border:none;left:50%;margin:0;max-height:none;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.TextualGuidelines-module_modalDialog__OtQxY::backdrop{background-color:#0006}.TextualGuidelines-module_modalContainer__sEVUZ{background-color:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.TextualGuidelines-module_modalHeader__BN8z5{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.TextualGuidelines-module_modalHeaderTitle__gJp9R{font-size:1rem;font-weight:500}.TextualGuidelines-module_modalHeaderActions__oupri{align-items:center;display:flex;gap:.5rem}.TextualGuidelines-module_modalNavContainer__UTxad{align-items:center;background-color:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.TextualGuidelines-module_modalNavButton__DLNmC{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.TextualGuidelines-module_modalNavButton__DLNmC:hover{background-color:#e5e7eb}.TextualGuidelines-module_closeButton__hkkeO{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.TextualGuidelines-module_closeButton__hkkeO:hover{background-color:#e5e7eb}.TextualGuidelines-module_closeIcon__qhupP{color:#4b5563;height:1.25rem;width:1.25rem}.TextualGuidelines-module_modalContent__wzOBu{flex:1;font-size:.875rem;overflow-y:auto;padding:.75rem 1rem;scroll-behavior:smooth}.TextualGuidelines-module_modalContentInner__Txziz{line-height:1.75rem}.TextualGuidelines-module_modalFooter__jkbjh{justify-content:flex-end;padding:.5rem 1rem}.TextualGuidelines-module_modalFooterSource__9PLRg,.TextualGuidelines-module_modalFooter__jkbjh{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0}.TextualGuidelines-module_modalFooterSource__9PLRg{justify-content:flex-start;padding:1rem}.TextualGuidelines-module_blockLine__f-gTN{display:block}.TextualGuidelines-module_headerLine__Ic1ja{display:block;font-weight:400}.TextualGuidelines-module_listItemLine__2E-57{display:block}.TextualGuidelines-module_listCounter__Ws3UU{display:inline-block;font-weight:500;text-align:left;width:1.5rem}.TextualGuidelines-module_boldText__vZBdP{font-weight:600}.TextualGuidelines-module_highlight__CGXvE{background-color:#fef08a;border-radius:.25rem;padding:0 .125rem;transition:all .2s}.TextualGuidelines-module_highlightActive__--Ns5{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px 0 #0000000d}.TextualGuidelines-module_highlightActiveVariant__6gPK9{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.TextualGuidelines-module_highlightVariant__7YZ7W{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.TextualGuidelines-module_highlightButton__zjZxQ{border:none;cursor:pointer;display:inline;font:inherit}"));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(e)}(),exports.default={container:"TextualGuidelines-module_container__RJDOE",itemRow:"TextualGuidelines-module_itemRow__kQWzv",indexNumber:"TextualGuidelines-module_indexNumber__tprYt",textContent:"TextualGuidelines-module_textContent__3JD9T",paraphraseButton:"TextualGuidelines-module_paraphraseButton__FuN0v",paraphraseText:"TextualGuidelines-module_paraphraseText__o5VEv",paraphraseStar:"TextualGuidelines-module_paraphraseStar__omUYz",chevronIcon:"TextualGuidelines-module_chevronIcon__jxUNm",chevronIconRotated:"TextualGuidelines-module_chevronIconRotated__oyLRq",expandedContainer:"TextualGuidelines-module_expandedContainer__ku2Qy",expandedHeader:"TextualGuidelines-module_expandedHeader__5OOd1",headerTitle:"TextualGuidelines-module_headerTitle__6vpFm",headerActions:"TextualGuidelines-module_headerActions__tAYsZ",navigationContainer:"TextualGuidelines-module_navigationContainer__DAz7T",navButton:"TextualGuidelines-module_navButton__wpCGR",navIcon:"TextualGuidelines-module_navIcon__Aa93S",navCounter:"TextualGuidelines-module_navCounter__MbQnG",confidenceBadge:"TextualGuidelines-module_confidenceBadge__ue2t4",confidenceStar:"TextualGuidelines-module_confidenceStar__vucHk",confidenceScore:"TextualGuidelines-module_confidenceScore__rK7mq",maximizeButton:"TextualGuidelines-module_maximizeButton__Lg43k",maximizeIcon:"TextualGuidelines-module_maximizeIcon__RETCs",contentArea:"TextualGuidelines-module_contentArea__2k4vh",contentInner:"TextualGuidelines-module_contentInner__2uMSz",footer:"TextualGuidelines-module_footer__AQG-E",trainingTitle:"TextualGuidelines-module_trainingTitle__HH--J",trainingTitleLink:"TextualGuidelines-module_trainingTitleLink__s7Oqw",modalDialog:"TextualGuidelines-module_modalDialog__OtQxY",modalContainer:"TextualGuidelines-module_modalContainer__sEVUZ",modalHeader:"TextualGuidelines-module_modalHeader__BN8z5",modalHeaderTitle:"TextualGuidelines-module_modalHeaderTitle__gJp9R",modalHeaderActions:"TextualGuidelines-module_modalHeaderActions__oupri",modalNavContainer:"TextualGuidelines-module_modalNavContainer__UTxad",modalNavButton:"TextualGuidelines-module_modalNavButton__DLNmC",closeButton:"TextualGuidelines-module_closeButton__hkkeO",closeIcon:"TextualGuidelines-module_closeIcon__qhupP",modalContent:"TextualGuidelines-module_modalContent__wzOBu",modalContentInner:"TextualGuidelines-module_modalContentInner__Txziz",modalFooter:"TextualGuidelines-module_modalFooter__jkbjh",modalFooterSource:"TextualGuidelines-module_modalFooterSource__9PLRg",blockLine:"TextualGuidelines-module_blockLine__f-gTN",headerLine:"TextualGuidelines-module_headerLine__Ic1ja",listItemLine:"TextualGuidelines-module_listItemLine__2E-57",listCounter:"TextualGuidelines-module_listCounter__Ws3UU",boldText:"TextualGuidelines-module_boldText__vZBdP",highlight:"TextualGuidelines-module_highlight__CGXvE",highlightActive:"TextualGuidelines-module_highlightActive__--Ns5",highlightActiveVariant:"TextualGuidelines-module_highlightActiveVariant__6gPK9",highlightVariant:"TextualGuidelines-module_highlightVariant__7YZ7W",highlightButton:"TextualGuidelines-module_highlightButton__zjZxQ"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".TextualGuidelines-module_expandedContainer__ku2Qy{background-color:var(--tg-container-bg,#0000);border:none;display:flex;flex-direction:column;height:100%;margin-left:var(--tg-container-margin-left,1rem)}.TextualGuidelines-module_expandedHeader__5OOd1{align-items:center;background-color:var(--tg-header-bg,#fff);border:var(--tg-header-border,none);display:flex;justify-content:space-between;padding:var(--tg-header-padding,.25rem .75rem)}.TextualGuidelines-module_headerTitle__6vpFm{background-color:var(--tg-header-title-bg,#fff);color:var(--tg-header-title-color,inherit);font-size:var(--tg-header-title-font-size,.875rem);font-weight:var(--tg-header-title-font-weight,400)}.TextualGuidelines-module_headerActions__tAYsZ{align-items:center;display:flex;gap:.5rem}.TextualGuidelines-module_navCounter__MbQnG{color:var(--tg-nav-counter-color,#888);font-size:var(--tg-nav-counter-font-size,12px)}.TextualGuidelines-module_navButton__wpCGR{align-items:center;background:var(--tg-nav-button-bg,#fff);border:1px solid var(--tg-nav-button-border,#ddd);border-radius:var(--tg-nav-button-border-radius,3px);cursor:pointer;display:flex;padding:2px 4px}.TextualGuidelines-module_navButton__wpCGR:disabled{cursor:not-allowed;opacity:.4}.TextualGuidelines-module_navButtonIcon__urm3b{color:var(--tg-nav-button-icon-color,#64748b)}.TextualGuidelines-module_contentArea__2k4vh{background-color:var(--tg-content-bg,#0000);border:1px solid var(--tg-content-border,#eee);border-radius:var(--tg-content-border-radius,4px);color:var(--tg-content-text-color,inherit);flex:1;height:auto;max-height:none;overflow-y:auto;padding:var(--tg-content-padding,1rem)}.TextualGuidelines-module_contentInner__2uMSz{line-height:var(--tg-content-line-height,1.5rem)}.TextualGuidelines-module_blockLine__f-gTN{display:block}.TextualGuidelines-module_headerLine__Ic1ja{display:block;font-weight:var(--tg-header-line-font-weight,400)}.TextualGuidelines-module_listItemLine__2E-57{display:block}.TextualGuidelines-module_listCounter__Ws3UU{display:inline-block;font-weight:var(--tg-list-counter-font-weight,500);text-align:left;width:var(--tg-list-counter-width,1.5rem)}.TextualGuidelines-module_highlightBlockRow__SH9zT{background-color:#fef08a;border-radius:.375rem;cursor:pointer;margin:.125rem 0;padding:.375rem .5rem;transition:all .2s}.TextualGuidelines-module_highlightVariantRow__rh6pM{background-color:#eef2ff;border-radius:.375rem;color:#6366f1;cursor:pointer;font-weight:500;margin:.125rem 0;padding:.375rem .5rem;transition:all .2s}.TextualGuidelines-module_boldText__vZBdP{font-weight:var(--tg-bold-text-font-weight,600)}.TextualGuidelines-module_loadingContainer__QbqYw{align-items:center;color:#6b7280;display:flex;font-size:.875rem;gap:.5rem;margin-bottom:.5rem;margin-top:.5rem;padding:.75rem 1rem}.TextualGuidelines-module_spinnerIcon__a8skc{animation:TextualGuidelines-module_spin__ZXbNj 1s linear infinite}@keyframes TextualGuidelines-module_spin__ZXbNj{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.TextualGuidelines-module_highlight__CGXvE{background-color:var(--tg-highlight-bg,#fef08a);border-radius:var(--tg-highlight-border-radius,.25rem);color:var(--tg-highlight-color,inherit);padding:0 .125rem;transition:all .2s}.TextualGuidelines-module_highlightActive__--Ns5{background-color:var(--tg-highlight-active-bg,#fde047);border:1px solid var(--tg-highlight-active-border,#eab308);box-shadow:var(--tg-highlight-active-shadow,0 1px 2px 0 #0000000d);color:var(--tg-highlight-active-color,inherit)}.TextualGuidelines-module_highlightVariant__7YZ7W{background-color:var(--tg-highlight-variant-bg,#eef2ff);border-radius:var(--tg-highlight-border-radius,.25rem);box-decoration-break:clone;-webkit-box-decoration-break:clone;color:var(--tg-highlight-variant-color,#6366f1);font-weight:500;padding:0 .125rem;transition:all .2s}.TextualGuidelines-module_highlightActiveVariant__6gPK9{background-color:var(--tg-highlight-variant-active-bg,#e0e7ff);border:1px solid var(--tg-highlight-variant-active-border,#5c75f4);box-shadow:0 1px 2px 0 #0000000d;color:var(--tg-highlight-variant-active-color,#6366f1);font-weight:500}.TextualGuidelines-module_highlightButton__zjZxQ{border:none;cursor:pointer;display:inline;font:inherit}"));const i=document.head||document.getElementsByTagName("head")[0]||document.documentElement;i&&i.appendChild(e)}(),exports.default={expandedContainer:"TextualGuidelines-module_expandedContainer__ku2Qy",expandedHeader:"TextualGuidelines-module_expandedHeader__5OOd1",headerTitle:"TextualGuidelines-module_headerTitle__6vpFm",headerActions:"TextualGuidelines-module_headerActions__tAYsZ",navCounter:"TextualGuidelines-module_navCounter__MbQnG",navButton:"TextualGuidelines-module_navButton__wpCGR",navButtonIcon:"TextualGuidelines-module_navButtonIcon__urm3b",contentArea:"TextualGuidelines-module_contentArea__2k4vh",contentInner:"TextualGuidelines-module_contentInner__2uMSz",blockLine:"TextualGuidelines-module_blockLine__f-gTN",headerLine:"TextualGuidelines-module_headerLine__Ic1ja",listItemLine:"TextualGuidelines-module_listItemLine__2E-57",listCounter:"TextualGuidelines-module_listCounter__Ws3UU",highlightBlockRow:"TextualGuidelines-module_highlightBlockRow__SH9zT",highlightVariantRow:"TextualGuidelines-module_highlightVariantRow__rh6pM",boldText:"TextualGuidelines-module_boldText__vZBdP",loadingContainer:"TextualGuidelines-module_loadingContainer__QbqYw",spinnerIcon:"TextualGuidelines-module_spinnerIcon__a8skc",spin:"TextualGuidelines-module_spin__ZXbNj",highlight:"TextualGuidelines-module_highlight__CGXvE",highlightActive:"TextualGuidelines-module_highlightActive__--Ns5",highlightVariant:"TextualGuidelines-module_highlightVariant__7YZ7W",highlightActiveVariant:"TextualGuidelines-module_highlightActiveVariant__6gPK9",highlightButton:"TextualGuidelines-module_highlightButton__zjZxQ"};
|
|
2
2
|
//# sourceMappingURL=TextualGuidelines.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),i=require("react"),t=require("@tanstack/react-query"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),i=require("react"),t=require("@tanstack/react-query"),o=require("../service/onDemandApi.js"),e=function(n,i,t){var o;return Array.isArray(n)?Array.isArray(i)&&0!==i.length?Number.isNaN(t)?(console.warn("[findCitation] citationNumber is NaN"),null):null!==(o=n.find(function(n){var o,e=function(n){var i,t,o,e,a;if(null==n)return console.warn("[getCitationType] received null or undefined citation"),"";var r=null!==(a=null!==(e=null!==(t=null===(i=null==n?void 0:n.customMetaData)||void 0===i?void 0:i.type)&&void 0!==t?t:null===(o=null==n?void 0:n.customMetadata)||void 0===o?void 0:o.type)&&void 0!==e?e:null==n?void 0:n.type)&&void 0!==a?a:"";return r||console.warn("[getCitationType] citation has no resolvable type field",n),r}(n);return(null===(o=function(n){var i;return null==n?(console.warn("[getCitationNumber] received null or undefined citation"),""):(null==n.citation_number&&console.warn("[getCitationNumber] citation is missing citation_number field",n),null!==(i=null==n?void 0:n.citation_number)&&void 0!==i?i:"")}(n))||void 0===o?void 0:o.toString())===t.toString()&&i.some(function(n){return null==e?void 0:e.includes(n)})}))&&void 0!==o?o:null:(console.warn("[findCitation] citationTypes is empty or falsy",i),null):(console.warn("[findCitation] citations is not an array",n),null)};exports.useOnDemandCitationFetch=function(a){var r=a.msg,l=a.citationType,u=a.citationNumber,c=a.enabled,s=void 0!==c&&c,d=a.accessToken,v=a.baseUrl,_=a.orgName,f=a.citationAssistantProcessingName,m=a.citationAgentName,h=(null==r?void 0:r.requestId)||(null==r?void 0:r.id)||"",y=i.useMemo(function(){return function(n){switch(n){case"artifact_chunks":return["artifact_chunks","scanned_doc_citation","scanned_doc_citations"];case"rai_artifact_citation":return["rai_artifact_citation","rai_artifact_citations"];case"json_chunks":return["json_chunks"];case"scanned_doc_citation":return["scanned_doc_citation","scanned_doc_citations","artifact_chunks"];case"scanned_doc_citations":return["scanned_doc_citations","scanned_doc_citation","artifact_chunks"];default:return[n]}}(l)},[l]),g=function(){switch(l){case"artifact_chunks":case"scanned_doc_citations":return"scanned_doc_citation";case"rai_artifact_citation":return"rai_artifact_citation";default:return l}}(),p=(null==r?void 0:r.isEcgPayloadActive)?i.useMemo(function(){return["onDemandCitationFetch",h,g,null==r?void 0:r.customCitationId]},[h,g,null==r?void 0:r.customCitationId]):i.useMemo(function(){return["onDemandCitationFetch",h,g,u]},[h,g,u]),C=i.useMemo(function(){return e(null==r?void 0:r.citations,y,u)},[null==r?void 0:r.citations,y,u]),b=Boolean(s&&h&&g&&v&&_&&!Number.isNaN(u)&&!C),N=d,w=!0===(null==r?void 0:r.isStreamEnd),A=t.useQuery({queryKey:p,queryFn:function(){return n.__awaiter(void 0,void 0,void 0,function(){var i,t,e,a,l,c,s,d;return n.__generator(this,function(n){switch(n.label){case 0:return[4,o.fetchOnDemandCitation(h,g,u,null!==(t=null==r?void 0:r.content)&&void 0!==t?t:"",N,v,null!=f?f:"",_,null!=m?m:"",null!==(e=null==r?void 0:r.isEcgPayloadActive)&&void 0!==e&&e,null!==(a=null==r?void 0:r.ecg_agent_name)&&void 0!==a?a:"",null!==(l=null==r?void 0:r.customCitationId)&&void 0!==l?l:"",null!==(c=null==r?void 0:r.plan_id)&&void 0!==c?c:"",null!==(s=null==r?void 0:r.ui_chat_history)&&void 0!==s?s:void 0)];case 1:if((i=n.sent()).error||!i.responseData)throw new Error((null===(d=i.error)||void 0===d?void 0:d.errorMessage)||"Failed to fetch on-demand citation");return[2,i.responseData]}})})},enabled:b&&w&&Boolean(null==r?void 0:r.content),staleTime:1/0,cacheTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1}),M=i.useMemo(function(){var n,i,t,o,a,l,c,s=null!==(t=null===(i=null===(n=A.data)||void 0===n?void 0:n.result)||void 0===i?void 0:i.citations)&&void 0!==t?t:[];return Array.isArray(s)&&0!==s.length?(null==r?void 0:r.customCitationId)?null!==(a=null!==(o=s.find(function(n){var i,t,o=null!==(t=null!==(i=null==n?void 0:n.title)&&void 0!==i?i:null==n?void 0:n.display_name)&&void 0!==t?t:"";return"string"==typeof o&&o.includes(r.customCitationId)}))&&void 0!==o?o:s[0])&&void 0!==a?a:null:null!==(c=null!==(l=e(s,y,u))&&void 0!==l?l:s[0])&&void 0!==c?c:null:null},[null==r?void 0:r.customCitationId,u,y,A.data]);return{citation:null!=C?C:M,isFetching:A.isFetching,isLoading:A.isLoading,isComplete:A.isSuccess,status:A.status,refetch:A.refetch}};
|
|
2
2
|
//# sourceMappingURL=useOnDemandCitationFetch.js.map
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),o=require("./features/Bookemon/Bookemon.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/CodeCitation/CodeCitation.js"),t=require("./features/ProjectAccordion/ProjectAccordion.js"),i=require("./features/BookCitation/BookCitation.js"),o=require("./features/Bookemon/Bookemon.js"),r=require("./features/PdfEditorCitation/PdfEditorCitation.js"),n=require("./features/CitationRenderer/CitationRenderer.js"),a=require("./features/CitationRenderer/MarkdownRenderer.js"),s=require("./features/CodeCitation/_components/CodeEditor.js"),C=require("./features/PaginatedTable/PaginatedTable.js"),u=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js"),p=require("./features/ChatCitation/ChatCitationRenderer.js"),l=require("./features/CognitiveDecisioning/CognitiveDecisioningWrapper.js"),d=require("./features/PdfViewer/PdfViewer.js"),f=require("./features/CognitiveDecisioning/FaqCitation/FaqCitation.js"),x=require("./features/RequirementAiCitations/ImageCitation/ImageCitationContent.js"),g=require("./features/RequirementAiCitations/VideoCitation/VideoCitationContent.js"),m=require("./features/RequirementAiCitations/FileCitation/FileCitationContent.js"),c=require("./features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js"),q=require("./features/MarkdownWithImageCitation/MarkdownWithImageCitation.js"),j=require("./features/RequirementAiCitations/AiReasoning/AiReasoningCitation.js"),R=require("./features/TableCitation/TableCitationContent.js"),S=require("./features/CitationViewer/CitationsViewer.js"),I=require("./features/ExcelCitation/ExcelCitations.js"),T=require("./features/ScannedDocCitation/ScannedDocCitation.js"),D=require("./features/ChatDrawer/ChatDrawer.js"),w=require("./features/ChatDrawer/constants/ChatDrawer.js"),b=require("./features/SplitterCitations/SplitterCitationsComponent.js"),E=require("./features/DualCitation/SourceBQDataCompnent.js"),W=require("./features/CognitiveCompare/CognitiveCompare.js"),h=require("./features/CognitiveInternalgptReasoning/CognitiveInternalgptCoreComponent.js"),P=require("./features/TextualGuidelines/TextualGuideLinesComponent.js"),v=require("./features/RulebookCitations/RuleBookCitationWrapper.js"),A=require("./features/IngestionStatus/IngestionStatusComponent.js"),k=require("./features/ManageRemainders/ManageReminders.js"),F=require("./features/GptWebCitation/GptWebCitation.js"),V=require("./hooks/useOnDemandCitationFetch.js"),G=require("./features/InstantLearningCitation/InstantLearningCitationComponent.js"),U=require("./features/ParentCitationComponent/ParentCitationComponent.js"),_=require("./features/GptWebCitation/utils/citationData.utils.js"),M=require("./features/GptWebCitation/types.js");exports.CodeCitation=e.default,exports.ProjectAccordian=t.default,exports.BookCitation=i.default,exports.Bookemon=o.default,exports.PdfCitation=r.PdfEditorCitation,exports.CitationRenderer=n.default,exports.MarkdownRenderer=a.default,Object.defineProperty(exports,"DiagnosticSeverity",{enumerable:!0,get:function(){return s.DiagnosticSeverity}}),exports.PaginatedTable=C.default,exports.InternalgptReasoningComponent=u.default,exports.NonWebReasoningComponent=u.default,exports.ChatCitation=p.default,exports.CognitiveDecisioningCard=l.default,exports.PdfViewer=d.default,exports.FaqCitation=f.default,exports.ImageCitationContent=x.default,exports.VideoCitationContent=g.default,exports.FileCitationContent=m.default,exports.WebCitationWithImageContent=c.default,exports.MarkdownWithImageCitation=q.default,exports.AiReasoningCitation=j.default,exports.TableCitationContent=R.default,exports.CitationsViewer=S.default,exports.ExcelCitation=I.default,exports.ScannedDocCitation=T.default,exports.ChatDrawer=D.default,exports.FILE_INGESTION_STATUS=w.FILE_INGESTION_STATUS,exports.SUMMARY_EXPAND_HEIGHT_NUDGE=w.SUMMARY_EXPAND_HEIGHT_NUDGE,exports.TRUNCATE_THRESHOLD=w.TRUNCATE_THRESHOLD,exports.SplitterCitationsComponent=b.default,exports.SourcesBQCitation=E.SourcesBQCitation,exports.findSourceCitation=E.findSourceCitation,exports.parseSourcesBQHref=E.parseSourcesBQHref,exports.CognitiveCompare=W.default,exports.CognitiveInternalgptCoreComponent=h.default,exports.TextualGuideLinesComponent=P.default,exports.RuleBookCitationWrapper=v.default,exports.IngestionStatusChip=A.IngestionStatusChip,exports.IngestionStatusComponent=A.IngestionStatusComponent,exports.ManageReminders=k.ManageReminders,exports.GptWebCitation=F.default,exports.useOnDemandCitationFetch=V.useOnDemandCitationFetch,exports.InstantLearningCitationWrapper=G.default,exports.ParentCitationComponent=U.default,exports.extractLearnedFromUrl=_.extractLearnedFromUrl,exports.extractRelevanceScoreFromContent=_.extractRelevanceScoreFromContent,exports.extractTopicFromContent=_.extractTopicFromContent,exports.getWebCitationImageUrl=_.getWebCitationImageUrl,exports.mapCitationDataToDisplay=_.mapCitationDataToDisplay,exports.resolveSkeletonVisitUrl=_.resolveSkeletonVisitUrl,exports.sanitizeExternalUrl=_.sanitizeExternalUrl,Object.defineProperty(exports,"CitationType",{enumerable:!0,get:function(){return M.CitationType}}),exports.allowsGptCitationView=M.allowsGptCitationView,exports.allowsWebCitationView=M.allowsWebCitationView,exports.showsCitationViewToggle=M.showsCitationViewToggle;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("axios"),t=require("./apicache.service.js"),n=require("../types/onDemandApi.types.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r),o=72e5,i=function(e){if(e&&"object"==typeof e){var r=e;return"string"==typeof r.message?r.message:"string"==typeof r.errorMessage?r.errorMessage:"string"==typeof r.error?r.error:r.error&&"object"==typeof r.error&&"string"==typeof r.error.message?r.error.message:"string"==typeof r.details?r.details:r}},c=function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){if(s.default.isAxiosError(r)){if("ECONNABORTED"===(t=r).code)return[2,{type:n.NetworkErrorType.TIMEOUT,message:"The request took too long to complete. Please try again.",originalError:r}];if(t.message.includes("net::ERR_NETWORK_CHANGED")||t.message.includes("net::ERR_INTERNET_DISCONNECTED")||t.message.includes("net::ERR_NAME_NOT_RESOLVED"))return[2,{type:n.NetworkErrorType.INTERNET_DISCONNECTED,message:"Internet connection issue detected. Please check your network.",originalError:r}];if(t.message.includes("Network Error")||"ERR_NETWORK"===t.code||t.message.includes("net::ERR_CONNECTION_REFUSED")||t.message.includes("net::ERR_EMPTY_RESPONSE"))return[2,{type:n.NetworkErrorType.SERVER_UNREACHABLE,message:"Unable to connect to server. The service may be down or unreachable.",originalError:r}];if(t.response&&t.response.status>=500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:"Service Unavailable. Server error (".concat(t.response.status,")."),status:t.response.status,originalError:r}];if(t.response&&t.response.status>=400&&t.response.status<500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:i(t.response.data)||"Request failed with status code ".concat(t.response.status),status:t.response.status,originalError:r}]}return[2,{type:n.NetworkErrorType.UNKNOWN_ERROR,message:"An unexpected error occurred. Please try again later.",originalError:r}]})})},u=function(r,t){void 0===t&&(t=18e4);var n=s.default.create({baseURL:r,timeout:t});return n.interceptors.request.use(function(r){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,r]})})},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),[2,Promise.reject(t)]}})})}),n.interceptors.response.use(function(e){return e},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),console.error("API Request Failed:",t),[2,Promise.reject(t)]}})})}),n},p=function(e,r,t){return"".concat(e,":").concat(r,":").concat(JSON.stringify(t||{}))},l=u(),_=function(r,t,a){return e.__awaiter(void 0,void 0,void 0,function(){var s,o,i,p,_,d,E;return e.__generator(this,function(g){switch(g.label){case 0:switch(g.trys.push([0,13,,15]),s=(null==a?void 0:a.baseURL)?u(a.baseURL):l,i=(o=a||{}).data,p=o.config,_=void 0,r.toLowerCase()){case"get":return[3,1];case"post":return[3,3];case"put":return[3,5];case"patch":return[3,7];case"delete":return[3,9]}return[3,11];case 1:return[4,s.get(t,p)];case 2:case 4:case 6:case 8:case 10:return _=g.sent(),[3,12];case 3:return[4,s.post(t,i,p)];case 5:return[4,s.put(t,i,p)];case 7:return[4,s.patch(t,i,p)];case 9:return d=e.__assign(e.__assign({},p),{data:i}),[4,s.delete(t,d)];case 11:throw new Error("Unsupported method: ".concat(r));case 12:return[2,{responseData:_.data,error:null}];case 13:return(E=g.sent()).type&&Object.values(n.NetworkErrorType).includes(E.type)?[2,{responseData:null,error:E}]:[4,c(E)];case 14:return[2,{responseData:null,error:g.sent()}];case 15:return[2]}})})},d=function(r,a,s){return e.__awaiter(void 0,void 0,void 0,function(){var i,c,u,l,d,E,g,f,y,v,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("axios"),t=require("./apicache.service.js"),n=require("../types/onDemandApi.types.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r),o=72e5,i=function(e){if(e&&"object"==typeof e){var r=e;return"string"==typeof r.message?r.message:"string"==typeof r.errorMessage?r.errorMessage:"string"==typeof r.error?r.error:r.error&&"object"==typeof r.error&&"string"==typeof r.error.message?r.error.message:"string"==typeof r.details?r.details:r}},c=function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){if(s.default.isAxiosError(r)){if("ECONNABORTED"===(t=r).code)return[2,{type:n.NetworkErrorType.TIMEOUT,message:"The request took too long to complete. Please try again.",originalError:r}];if(t.message.includes("net::ERR_NETWORK_CHANGED")||t.message.includes("net::ERR_INTERNET_DISCONNECTED")||t.message.includes("net::ERR_NAME_NOT_RESOLVED"))return[2,{type:n.NetworkErrorType.INTERNET_DISCONNECTED,message:"Internet connection issue detected. Please check your network.",originalError:r}];if(t.message.includes("Network Error")||"ERR_NETWORK"===t.code||t.message.includes("net::ERR_CONNECTION_REFUSED")||t.message.includes("net::ERR_EMPTY_RESPONSE"))return[2,{type:n.NetworkErrorType.SERVER_UNREACHABLE,message:"Unable to connect to server. The service may be down or unreachable.",originalError:r}];if(t.response&&t.response.status>=500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:"Service Unavailable. Server error (".concat(t.response.status,")."),status:t.response.status,originalError:r}];if(t.response&&t.response.status>=400&&t.response.status<500)return[2,{type:n.NetworkErrorType.SERVER_ERROR,message:i(t.response.data)||"Request failed with status code ".concat(t.response.status),status:t.response.status,originalError:r}]}return[2,{type:n.NetworkErrorType.UNKNOWN_ERROR,message:"An unexpected error occurred. Please try again later.",originalError:r}]})})},u=function(r,t){void 0===t&&(t=18e4);var n=s.default.create({baseURL:r,timeout:t});return n.interceptors.request.use(function(r){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){return[2,r]})})},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),[2,Promise.reject(t)]}})})}),n.interceptors.response.use(function(e){return e},function(r){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c(r)];case 1:return t=e.sent(),console.error("API Request Failed:",t),[2,Promise.reject(t)]}})})}),n},p=function(e,r,t){return"".concat(e,":").concat(r,":").concat(JSON.stringify(t||{}))},l=u(),_=function(r,t,a){return e.__awaiter(void 0,void 0,void 0,function(){var s,o,i,p,_,d,E;return e.__generator(this,function(g){switch(g.label){case 0:switch(g.trys.push([0,13,,15]),s=(null==a?void 0:a.baseURL)?u(a.baseURL):l,i=(o=a||{}).data,p=o.config,_=void 0,r.toLowerCase()){case"get":return[3,1];case"post":return[3,3];case"put":return[3,5];case"patch":return[3,7];case"delete":return[3,9]}return[3,11];case 1:return[4,s.get(t,p)];case 2:case 4:case 6:case 8:case 10:return _=g.sent(),[3,12];case 3:return[4,s.post(t,i,p)];case 5:return[4,s.put(t,i,p)];case 7:return[4,s.patch(t,i,p)];case 9:return d=e.__assign(e.__assign({},p),{data:i}),[4,s.delete(t,d)];case 11:throw new Error("Unsupported method: ".concat(r));case 12:return[2,{responseData:_.data,error:null}];case 13:return(E=g.sent()).type&&Object.values(n.NetworkErrorType).includes(E.type)?[2,{responseData:null,error:E}]:[4,c(E)];case 14:return[2,{responseData:null,error:g.sent()}];case 15:return[2]}})})},d=function(r,a,s){return e.__awaiter(void 0,void 0,void 0,function(){var i,c,u,l,d,E,g,f,y,h,v,R,m,N;return e.__generator(this,function(T){switch(T.label){case 0:return c=(i=s||{}).data,u=i.params,l=i.config,d=i.errorMessage,E=i.baseURL,g=i.cacheOption,f=i.shouldCache,y=null!==(N=null==g?void 0:g.ttl)&&void 0!==N?N:o,h=(null==g?void 0:g.key)||p(r,a,u),(null==g?void 0:g.forceRefresh)||(null==g?void 0:g.skipCache)?[3,2]:[4,t.apiCache.get(h)];case 1:if(v=T.sent())return[2,{responseData:v.data,error:null,cacheMeta:{isFromCache:!0,timestamp:v.timestamp,ttl:v.ttl,cacheKey:h}}];T.label=2;case 2:return R=e.__assign(e.__assign({},l),u&&{params:u}),[4,_(r,a,{data:c,config:R,baseURL:E})];case 3:return m=T.sent(),!(null==g?void 0:g.skipCache)&&null!=m.responseData&&(!f||f(m.responseData))?[4,t.apiCache.set(h,m.responseData,y)]:[3,5];case 4:T.sent(),T.label=5;case 5:return[2,{responseData:m.responseData,error:m.error?{errorMessage:m.error.type===n.NetworkErrorType.INTERNET_DISCONNECTED||m.error.type===n.NetworkErrorType.SLOW_CONNECTION||m.error.type===n.NetworkErrorType.TIMEOUT?m.error.message:m.error.type===n.NetworkErrorType.SERVER_UNREACHABLE?"Unable to connect to server. Please try again later.":d||m.error.message,errorObjData:m.error}:null,cacheMeta:{isFromCache:!1,timestamp:Date.now(),ttl:y,cacheKey:h}}]}})})};Object.defineProperty(exports,"NetworkErrorType",{enumerable:!0,get:function(){return n.NetworkErrorType}}),exports.DEFAULT_CACHE_TTL=o,exports.createApiInstance=u,exports.fetchOnDemandCitation=function(r,t,n,a,s,o,i,c,u,p,l,_,E,g){return e.__awaiter(void 0,void 0,void 0,function(){var s,f,y,h;return e.__generator(this,function(v){return s="artifact_chunks"===t||"scanned_doc_citation"===t?"artifact_chunks":t,f=p?_:"".concat(s,"_").concat(n),[2,d(y="post",h="/api/chat/chatResponse",{baseURL:o,data:{name:i||"citationsprocessing",organizationName:c,prompt:"",useAgent:{agent_name:u||"ProcessCitationsAgent",arguments:e.__assign(e.__assign({citation_type:t,is_primary_agent_request:!1},p&&{check_possible_citation_payload:!1}),{ui_request_body:e.__assign(e.__assign(e.__assign({llm_formatted_response:a,request_id:r,max_concurrent_citations:10,citation_id:f},p&&l&&{ecg_agent_name:l}),p&&E&&{plan_id:E}),p&&g&&{ui_chat_history:g})})}},config:{headers:{"Content-Type":"application/json"},withCredentials:!0},errorMessage:"Failed to fetch on-demand citation",cacheOption:{key:"".concat(y,":").concat(h,":onDemandCitation:").concat(r,":").concat(t,":").concat(p?_:n)},shouldCache:function(e){var r;return Array.isArray(null===(r=null==e?void 0:e.result)||void 0===r?void 0:r.citations)&&Boolean(e.result.citations[0])}})]})})},exports.generateCacheKey=p,exports.makeApiRequest=_,exports.makeApiRequestWithTTLCache=d;
|
|
2
2
|
//# sourceMappingURL=onDemandApi.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as n}from"tslib";import{jsxs as i,jsx as t,Fragment as l}from"react/jsx-runtime";import{useMemo as r,useState as o,useRef as a,useEffect as c}from"react";import{ExternalLink as s,ChevronUp as d,ChevronDown as u}from"lucide-react";import h from"./CognitiveNonWebSearchReasoning.module.css.js";var m=function(e){return e.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(e,i){return e.startsWith("**")&&e.endsWith("**")||e.startsWith("__")&&e.endsWith("__")?t("strong",n({className:h.boldText},{children:e.slice(2,-2)}),i):e})},p=function(p){var g=p.item,v=p.headerTitle;p.index;var f=p.iconsConfig,b=p.DocumentTitle,x=p.previewCallback,N=p.bodyHeight,C=p.disableMaximize,I=void 0!==C&&C,y=p.splitterCustomStyle,k=void 0!==y&&y,H=g.dataSource,w=g.confidence_score,T=g.trainingDataTitle,L=null==f?void 0:f.ChevronDownIcon,z=null==f?void 0:f.ChevronUpIcon,S=null==f?void 0:f.MaximizeIcon,_=null==f?void 0:f.CloseIcon,B=r(function(){var n=(H?H.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),i=0,t=n.map(function(e){var n=e.startsWith("<highlight>"),t={text:n?e.replace(/<\/?highlight>/g,""):e,isHighlight:n,highlightIndex:n?i:-1};return n&&i++,t}),l=t.filter(function(e){return e.isHighlight}).length,r=[],o=[];return t.forEach(function(n){var i=n.text,t=n.isHighlight,l=n.highlightIndex;i.split("\n").forEach(function(n,i){i>0&&((o.length>0||r.length>0)&&r.push(e([],o,!0)),o=[]),n&&o.push({text:n,isHighlight:t,highlightIndex:l})})}),o.length>0&&r.push(e([],o,!0)),{processedLines:r.map(function(e){var n=e.map(function(e){return e.text}).join(""),i=n.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:e,isListItem:!!i,isHeader:!!n.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==i?void 0:i[1])||"",content:(null==i?void 0:i[3])||n}}),totalHighlights:l}},[H]),D=B.processedLines,R=B.totalHighlights,W=o(0),j=W[0],A=W[1],F=a(null),M=a(null),V=a(null),E=a([]),$=a([]);c(function(){E.current=E.current.slice(0,R),$.current=$.current.slice(0,R)},[R]),c(function(){if(R>0){A(0);var e=setTimeout(function(){var e;null===(e=E.current[0])||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(e)}}},[R]);var U=function(e,n){setTimeout(function(){var i=n?$.current[e]:E.current[e];null==i||i.scrollIntoView({behavior:"smooth",block:"center"})},50)},Y=function(e){if(void 0===e&&(e=!1),R){var n=j>0?j-1:R-1;A(n),U(n,e)}},q=function(e){if(void 0===e&&(e=!1),R){var n=j<R-1?j+1:0;A(n),U(n,e)}},G=function(e){var l=e?$:E,r=0;return D.map(function(e,o){e.isHeader&&(r=0),e.isListItem&&(r+=1);var a=function(){return e.segments.map(function(i,r){var o=i.isHighlight&&i.highlightIndex===j,a=i.text;return e.isListItem&&0===r&&(a=i.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),i.isHighlight?t("span",n({ref:function(e){e&&(l.current[i.highlightIndex]=e)},className:"".concat(h.highlight).concat(o?" ".concat(h.highlightActive):"")},{children:m(a)}),r):t("span",{children:m(a)},r)})};return e.isHeader?t("span",n({className:h.headerLine},{children:a()}),o):e.isListItem?i("span",n({className:h.listItemLine,style:{paddingLeft:e.indent?"1rem":"0"}},{children:[i("span",n({className:h.listCounter},{children:[r,"."]})),t("span",{children:a()})]}),o):t("span",n({className:h.blockLine},{children:a()}),o)})},J=function(e){return R>1?i("div",n({className:e?h.modalNavContainer:h.navigationContainer},{children:[z&&t("button",n({onClick:function(){return Y(e)},className:e?h.modalNavButton:h.navButton},{children:t(z,{className:h.navIcon})})),i("span",n({className:h.navCounter},{children:[j+1,"/",R]})),L&&t("button",n({onClick:function(){return q(e)},className:e?h.modalNavButton:h.navButton},{children:t(L,{className:h.navIcon})}))]})):null},K=null!=w?i("span",n({className:h.confidenceBadge},{children:[t("span",n({className:h.confidenceStar},{children:"✦"})),i("span",n({className:h.confidenceScore},{children:[w,"%"]}))]})):null,O=k?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,P=i(l,{children:[T&&t("div",n({className:h.footer,style:O},{children:t("span",n({className:h.trainingTitle},{children:T}))})),b&&t("div",n({className:h.modalFooterSource,style:O},{children:i("button",n({type:"button",onClick:function(){return null==x?void 0:x()},className:h.trainingTitleLink},{children:[b,t(s,{size:16,color:"#2563eb"})]}))}))]});return i(l,{children:[i("div",n({className:h.expandedContainer,style:n(n({},N?{height:"".concat(N),display:"flex",flexDirection:"column"}:void 0),k?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0)},{children:[i("div",n({className:h.expandedHeader,style:k?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0},{children:[t("span",n({className:h.headerTitle},{children:v})),i("div",n({className:h.headerActions},{children:[k?R>1&&i(l,{children:[i("span",n({style:{fontSize:"12px",color:"#888"}},{children:[j+1," / ",R]})),t("button",n({onClick:function(){return Y(!0)},disabled:j<=0,style:{padding:"2px 4px",cursor:j<=0?"not-allowed":"pointer",opacity:j<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:t(d,{size:14,color:"#64748b"})})),t("button",n({onClick:function(){return q(!0)},disabled:j>=R-1,style:{padding:"2px 4px",cursor:j>=R-1?"not-allowed":"pointer",opacity:j>=R-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:t(u,{size:14,color:"#64748b"})}))]}):J(!0),K,!I&&S&&t("button",n({onClick:function(){var e;return null===(e=V.current)||void 0===e?void 0:e.showModal()},className:h.maximizeButton,title:"View fullscreen"},{children:t(S,{className:h.maximizeIcon})}))]}))]})),t("div",n({ref:F,className:h.contentArea,style:n(n({},N?{flex:1,maxHeight:"none",overflowY:"auto",minHeight:0}:void 0),k?{padding:"1rem 1.5rem"}:void 0)},{children:t("div",n({className:h.contentInner},{children:G(!1)}))})),P]})),!I&&t("dialog",n({ref:V,className:h.modalDialog,onClick:function(e){var n;e.target===V.current&&(null===(n=V.current)||void 0===n||n.close())}},{children:i("div",n({className:h.modalContainer},{children:[i("div",n({className:h.modalHeader},{children:[t("span",n({className:h.modalHeaderTitle},{children:v})),i("div",n({className:h.modalHeaderActions},{children:[k?R>1&&i(l,{children:[i("span",n({style:{fontSize:"12px",color:"#888"}},{children:[j+1," / ",R]})),"just chill",t("button",n({onClick:function(){return Y(!0)},disabled:j<=0,style:{padding:"2px 4px",cursor:j<=0?"not-allowed":"pointer",opacity:j<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:t(d,{size:14,color:"#64748b"})})),t("button",n({onClick:function(){return q(!0)},disabled:j>=R-1,style:{padding:"2px 4px",cursor:j>=R-1?"not-allowed":"pointer",opacity:j>=R-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:t(u,{size:14,color:"#64748b"})}))]}):J(!0),K,_&&t("button",n({onClick:function(){var e;return null===(e=V.current)||void 0===e?void 0:e.close()},className:h.closeButton,title:"Close"},{children:t(_,{className:h.closeIcon})}))]}))]})),t("div",n({ref:M,className:h.modalContent},{children:t("div",n({className:h.modalContentInner},{children:G(!0)}))})),T&&t("div",n({className:h.modalFooter},{children:t("span",n({className:h.trainingTitle},{children:T}))})),b&&t("div",n({className:h.modalFooterSource},{children:i("button",n({type:"button",onClick:function(){var e;null==x||x(),null===(e=V.current)||void 0===e||e.close()},className:h.trainingTitleLink},{children:[b,t(s,{size:16,color:"#2563eb"})]}))}))]}))}))]})};export{p as default};
|
|
1
|
+
import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as l,jsx as i,Fragment as o}from"react/jsx-runtime";import{useMemo as t,useState as r,useRef as d,useEffect as a}from"react";import{ExternalLink as s,ChevronUp as c,ChevronDown as u}from"lucide-react";import v from"./CognitiveNonWebSearchReasoning.module.css.js";var h=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.filter(Boolean).join(" ")},m=function(n){return n.split(/(\*\*.*?\*\*|__.*?__)/g).map(function(n,l){return n.startsWith("**")&&n.endsWith("**")||n.startsWith("__")&&n.endsWith("__")?i("strong",e({className:v.boldText},{children:n.slice(2,-2)}),l):n})},g=function(g){var p=g.item,f=g.headerTitle;g.index;var x=g.iconsConfig,y=g.DocumentTitle,b=g.previewCallback,N=g.bodyHeight,C=g.disableMaximize,I=void 0!==C&&C,k=g.splitterCustomStyle,T=void 0!==k&&k,H=g.themeTokens,L=g.classNames,B=g.styles,w=p.dataSource,z=p.confidence_score,S=p.trainingDataTitle,A=null==x?void 0:x.ChevronDownIcon,F=null==x?void 0:x.ChevronUpIcon,_=null==x?void 0:x.MaximizeIcon,D=null==x?void 0:x.CloseIcon,R=t(function(){var e=(w?w.replace(/\\n/g,"\n").replace(/\n+/g,"\n"):"").split(/(<highlight>[\s\S]*?<\/highlight>)/g),l=0,i=e.map(function(n){var e=n.startsWith("<highlight>"),i={text:e?n.replace(/<\/?highlight>/g,""):n,isHighlight:e,highlightIndex:e?l:-1};return e&&l++,i}),o=i.filter(function(n){return n.isHighlight}).length,t=[],r=[];return i.forEach(function(e){var l=e.text,i=e.isHighlight,o=e.highlightIndex;l.split("\n").forEach(function(e,l){l>0&&((r.length>0||t.length>0)&&t.push(n([],r,!0)),r=[]),e&&r.push({text:e,isHighlight:i,highlightIndex:o})})}),r.length>0&&t.push(n([],r,!0)),{processedLines:t.map(function(n){var e=n.map(function(n){return n.text}).join(""),l=e.match(/^(\s*)(-|\*|\d+\.)\s+(.*)$/);return{segments:n,isListItem:!!l,isHeader:!!e.match(/^(Title|Description|Training-basis):\s*(.*)$/i),indent:(null==l?void 0:l[1])||"",content:(null==l?void 0:l[3])||e}}),totalHighlights:o}},[w]),W=R.processedLines,j=R.totalHighlights,M=r(0),V=M[0],E=M[1],$=d(null),U=d(null),Y=d(null),q=d([]),G=d([]);a(function(){q.current=q.current.slice(0,j),G.current=G.current.slice(0,j)},[j]),a(function(){if(j>0){E(0);var n=setTimeout(function(){var n;null===(n=q.current[0])||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},50);return function(){return clearTimeout(n)}}},[j]);var J=function(n,e){setTimeout(function(){var l=e?G.current[n]:q.current[n];null==l||l.scrollIntoView({behavior:"smooth",block:"center"})},50)},K=function(n){if(void 0===n&&(n=!1),j){var e=V>0?V-1:j-1;E(e),J(e,n)}},O=function(n){if(void 0===n&&(n=!1),j){var e=V<j-1?V+1:0;E(e),J(e,n)}},P=function(n){var o=n?G:q,t=0;return W.map(function(n,r){n.isHeader&&(t=0),n.isListItem&&(t+=1);var d=function(){return n.segments.map(function(l,t){var r=l.isHighlight&&l.highlightIndex===V,d=l.text;return n.isListItem&&0===t&&(d=l.text.replace(/^(\s*)(-|\*|\d+\.)\s+/,"")),l.isHighlight?i("span",e({ref:function(n){n&&(o.current[l.highlightIndex]=n)},className:h(v.highlight,r?v.highlightActive:void 0,null==L?void 0:L.highlight,r?null==L?void 0:L.highlightActive:void 0),style:r?e(e({},null==B?void 0:B.highlight),null==B?void 0:B.highlightActive):null==B?void 0:B.highlight},{children:m(d)}),t):i("span",{children:m(d)},t)})};return n.isHeader?i("span",e({className:h(v.headerLine,null==L?void 0:L.headerLine),style:null==B?void 0:B.headerLine},{children:d()}),r):n.isListItem?l("span",e({className:h(v.listItemLine,null==L?void 0:L.listItemLine),style:e({paddingLeft:n.indent?"1rem":"0"},null==B?void 0:B.listItemLine)},{children:[l("span",e({className:h(v.listCounter,null==L?void 0:L.listCounter),style:null==B?void 0:B.listCounter},{children:[t,"."]})),i("span",{children:d()})]}),r):i("span",e({className:h(v.blockLine,null==L?void 0:L.blockLine),style:null==B?void 0:B.blockLine},{children:d()}),r)})},Q=function(n){return j>1?l("div",e({className:h(n?v.modalNavContainer:v.navigationContainer,n?null==L?void 0:L.modalNavContainer:null==L?void 0:L.navigationContainer),style:n?null==B?void 0:B.modalNavContainer:null==B?void 0:B.navigationContainer},{children:[F&&i("button",e({onClick:function(){return K(n)},className:h(n?v.modalNavButton:v.navButton,null==L?void 0:L.navButton),style:null==B?void 0:B.navButton},{children:i(F,{className:h(v.navIcon,null==L?void 0:L.navIcon),style:null==B?void 0:B.navIcon})})),l("span",e({className:h(v.navCounter,null==L?void 0:L.navCounter),style:null==B?void 0:B.navCounter},{children:[V+1,"/",j]})),A&&i("button",e({onClick:function(){return O(n)},className:h(n?v.modalNavButton:v.navButton,null==L?void 0:L.navButton),style:null==B?void 0:B.navButton},{children:i(A,{className:h(v.navIcon,null==L?void 0:L.navIcon),style:null==B?void 0:B.navIcon})}))]})):null},X=null!=z?l("span",e({className:h(v.confidenceBadge,null==L?void 0:L.confidenceBadge),style:null==B?void 0:B.confidenceBadge},{children:[i("span",e({className:v.confidenceStar},{children:"✦"})),l("span",e({className:v.confidenceScore},{children:[z,"%"]}))]})):null,Z=T?{backgroundColor:"white",padding:"1rem 1.5rem"}:void 0,nn=l(o,{children:[S&&i("div",e({className:h(v.footer,null==L?void 0:L.footer),style:e(e({},Z),null==B?void 0:B.footer)},{children:i("span",e({className:h(v.trainingTitle,null==L?void 0:L.trainingTitle),style:null==B?void 0:B.trainingTitle},{children:S}))})),y&&i("div",e({className:h(v.modalFooterSource,null==L?void 0:L.modalFooterSource),style:e(e({},Z),null==B?void 0:B.modalFooterSource)},{children:l("button",e({type:"button",onClick:function(){return null==b?void 0:b()},className:h(v.trainingTitleLink,null==L?void 0:L.trainingTitleLink),style:null==B?void 0:B.trainingTitleLink},{children:[y,i(s,{size:16,color:"#2563eb"})]}))}))]});return l(o,{children:[l("div",e({className:h(v.expandedContainer,null==L?void 0:L.expandedContainer),style:e(e(e(e({},H),N?{height:"".concat(N),display:"flex",flexDirection:"column"}:void 0),T?{border:"none",borderRadius:0,marginLeft:"0px",marginTop:"0px"}:void 0),null==B?void 0:B.expandedContainer)},{children:[l("div",e({className:h(v.expandedHeader,null==L?void 0:L.expandedHeader),style:e(e({},T?{backgroundColor:"white",padding:"0.5rem 1.5rem"}:void 0),null==B?void 0:B.expandedHeader)},{children:[i("span",e({className:h(v.headerTitle,null==L?void 0:L.headerTitle),style:null==B?void 0:B.headerTitle},{children:f})),l("div",e({className:h(v.headerActions,null==L?void 0:L.headerActions),style:null==B?void 0:B.headerActions},{children:[T?j>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[V+1," / ",j]})),i("button",e({onClick:function(){return K(!0)},disabled:V<=0,style:{padding:"2px 4px",cursor:V<=0?"not-allowed":"pointer",opacity:V<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(c,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return O(!0)},disabled:V>=j-1,style:{padding:"2px 4px",cursor:V>=j-1?"not-allowed":"pointer",opacity:V>=j-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):Q(!1),X,!I&&_&&i("button",e({onClick:function(){var n;return null===(n=Y.current)||void 0===n?void 0:n.showModal()},className:h(v.maximizeButton,null==L?void 0:L.maximizeButton),style:null==B?void 0:B.maximizeButton,title:"View fullscreen"},{children:i(_,{className:v.maximizeIcon})}))]}))]})),i("div",e({ref:$,className:h(v.contentArea,null==L?void 0:L.contentArea),style:e(e(e({},N?{flex:1,maxHeight:"300px",overflowY:"scroll",minHeight:0}:void 0),T?{padding:"1rem 1.5rem"}:void 0),null==B?void 0:B.contentArea)},{children:i("div",e({className:h(v.contentInner,null==L?void 0:L.contentInner),style:null==B?void 0:B.contentInner},{children:P(!1)}))})),nn]})),!I&&i("dialog",e({ref:Y,className:v.modalDialog,onClick:function(n){var e;n.target===Y.current&&(null===(e=Y.current)||void 0===e||e.close())}},{children:l("div",e({className:h(v.modalContainer,null==L?void 0:L.modalContainer),style:null==B?void 0:B.modalContainer},{children:[l("div",e({className:h(v.modalHeader,null==L?void 0:L.modalHeader),style:null==B?void 0:B.modalHeader},{children:[i("span",e({className:h(v.modalHeaderTitle,null==L?void 0:L.modalHeaderTitle),style:null==B?void 0:B.modalHeaderTitle},{children:f})),l("div",e({className:h(v.modalHeaderActions,null==L?void 0:L.modalHeaderActions),style:null==B?void 0:B.modalHeaderActions},{children:[T?j>1&&l(o,{children:[l("span",e({style:{fontSize:"12px",color:"#888"}},{children:[V+1," / ",j]})),i("button",e({onClick:function(){return K(!0)},disabled:V<=0,style:{padding:"2px 4px",cursor:V<=0?"not-allowed":"pointer",opacity:V<=0?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(c,{size:14,color:"#64748b"})})),i("button",e({onClick:function(){return O(!0)},disabled:V>=j-1,style:{padding:"2px 4px",cursor:V>=j-1?"not-allowed":"pointer",opacity:V>=j-1?.4:1,border:"1px solid #ddd",borderRadius:"3px",background:"white",display:"flex",alignItems:"center"}},{children:i(u,{size:14,color:"#64748b"})}))]}):Q(!0),X,D&&i("button",e({onClick:function(){var n;return null===(n=Y.current)||void 0===n?void 0:n.close()},className:h(v.closeButton,null==L?void 0:L.closeButton),style:null==B?void 0:B.closeButton,title:"Close"},{children:i(D,{className:h(v.closeIcon,null==L?void 0:L.closeIcon),style:null==B?void 0:B.closeIcon})}))]}))]})),i("div",e({ref:U,className:h(v.modalContent,null==L?void 0:L.modalContent),style:null==B?void 0:B.modalContent},{children:i("div",e({className:h(v.modalContentInner,null==L?void 0:L.modalContentInner),style:null==B?void 0:B.modalContentInner},{children:P(!0)}))})),S&&i("div",e({className:h(v.modalFooter,null==L?void 0:L.modalFooter),style:null==B?void 0:B.modalFooter},{children:i("span",e({className:h(v.trainingTitle,null==L?void 0:L.trainingTitle),style:null==B?void 0:B.trainingTitle},{children:S}))})),y&&i("div",e({className:h(v.modalFooterSource,null==L?void 0:L.modalFooterSource),style:null==B?void 0:B.modalFooterSource},{children:l("button",e({type:"button",onClick:function(){var n;null==b||b(),null===(n=Y.current)||void 0===n||n.close()},className:h(v.trainingTitleLink,null==L?void 0:L.trainingTitleLink),style:null==B?void 0:B.trainingTitleLink},{children:[y,i(s,{size:16,color:"#2563eb"})]}))}))]}))}))]})};export{g as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveInternalgptCoreComponent.js.map
|
package/dist/features/CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as a,jsx as n}from"react/jsx-runtime";import{useState as t}from"react";import i from"./CognitiveNonWebSearchReasoning.module.css.js";import o from"./CognitiveInternalgptCoreComponent.js";var r=function(r){var l=r.item,s=r.index,c=r.iconsConfig,m=r.headerTitle,p=void 0===m?"GPT - Gemini 2.5 Flash":m,d=r.previewCallback,h=r.DocumentTitle,u=r.disableMaximize,v=void 0!==u&&u,C=r.splitterCustomStyle,f=void 0!==C&&C,b=null==c?void 0:c.ChevronDownIcon,N=t(!1),x=N[0],g=N[1];return a("div",e({className:i.container},{children:[a("div",e({className:i.itemRow},{children:["number"==typeof s&&a("span",e({className:i.indexNumber},{children:[s+1,"."]})),a("div",e({className:i.textContent},{children:[n("span",{children:null==l?void 0:l.text}),(null==l?void 0:l.paraphrase)&&a("button",e({type:"button",onClick:function(){return g(!x)},className:i.paraphraseButton},{children:[a("span",e({className:i.paraphraseText},{children:[n("span",e({className:i.paraphraseStar},{children:"✦"})),l.paraphrase]})),b&&n(b,{className:"".concat(i.chevronIcon).concat(x?" ".concat(i.chevronIconRotated):"")})]}))]}))]})),x&&n(o,{item:l,headerTitle:p,iconsConfig:c,DocumentTitle:h,previewCallback:d,disableMaximize:v,splitterCustomStyle:f})]}))};export{r as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveInternalgptReasoningComponent.js.map
|
package/dist/features/CognitiveInternalgptReasoning/CognitiveNonWebSearchReasoning.module.css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU",highlightActiveVariant:"CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp",highlightVariant:"CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ",highlightButton:"CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:.5rem}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:.875rem;gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:#475467;font-weight:500}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:#475467;flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:#0000;border:none;border-radius:.375rem;cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:#2563eb;font-weight:500;text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:#2563eb;padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:#2563eb;height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{border:solid #e5e7eb;border-radius:.5rem;border-width:1px 1px 2px;margin-left:1.5rem;margin-top:.5rem;overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.25rem .75rem}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{font-size:.875rem;font-weight:400}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:#f3f4f6}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:#4b5563;font-size:.875rem;min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:#f0fdf4;border:2px solid #3ac894;border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:#059669;font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:#059669;font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:#6b7280;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{font-size:.875rem;max-height:11rem;overflow-y:auto;padding:.5rem .75rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:1.5rem}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{font-size:.875rem;font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;font-size:.8rem;font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:none;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:#f2f4f7;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{font-size:1rem;font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:#f3f4f6;border:1px solid #e5e7eb;border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:#e5e7eb}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:#4b5563;height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{flex:1;font-size:.875rem;overflow-y:auto;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:1.75rem}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{align-items:center;background-color:#f2f4f7;border-top:1px solid #e5e7eb;display:flex;flex-shrink:0;justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:400}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:500;text-align:left;width:1.5rem}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:600}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:#fef08a;border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:#fde047;border:1px solid #eab308;box-shadow:0 1px 2px 0 #0000000d}.CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb{border:none;cursor:pointer;display:inline;font:inherit}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
|
|
1
|
+
var e={container:"CognitiveNonWebSearchReasoning-module_container__koQEN",itemRow:"CognitiveNonWebSearchReasoning-module_itemRow__lRmgs",indexNumber:"CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg",textContent:"CognitiveNonWebSearchReasoning-module_textContent__327fx",paraphraseButton:"CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe",paraphraseText:"CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty",paraphraseStar:"CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR",chevronIcon:"CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw",chevronIconRotated:"CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP",expandedContainer:"CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9",expandedHeader:"CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb",headerTitle:"CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI",headerActions:"CognitiveNonWebSearchReasoning-module_headerActions__j1P4u",navigationContainer:"CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG",navButton:"CognitiveNonWebSearchReasoning-module_navButton__aOaMv",navIcon:"CognitiveNonWebSearchReasoning-module_navIcon__uLme4",navCounter:"CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc",confidenceBadge:"CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3",confidenceStar:"CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S",confidenceScore:"CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK",maximizeButton:"CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-",maximizeIcon:"CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez",contentArea:"CognitiveNonWebSearchReasoning-module_contentArea__hVoLL",contentInner:"CognitiveNonWebSearchReasoning-module_contentInner__df-34",footer:"CognitiveNonWebSearchReasoning-module_footer__CNE8q",trainingTitle:"CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh",trainingTitleLink:"CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U",modalDialog:"CognitiveNonWebSearchReasoning-module_modalDialog__eGApe",modalContainer:"CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01",modalHeader:"CognitiveNonWebSearchReasoning-module_modalHeader__qglof",modalHeaderTitle:"CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X",modalHeaderActions:"CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip",modalNavContainer:"CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP",modalNavButton:"CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24",closeButton:"CognitiveNonWebSearchReasoning-module_closeButton__S23zi",closeIcon:"CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG",modalContent:"CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv",modalContentInner:"CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo",modalFooter:"CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn",modalFooterSource:"CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt",blockLine:"CognitiveNonWebSearchReasoning-module_blockLine__FwGYE",headerLine:"CognitiveNonWebSearchReasoning-module_headerLine__0j5p4",listItemLine:"CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O",listCounter:"CognitiveNonWebSearchReasoning-module_listCounter__esNpx",boldText:"CognitiveNonWebSearchReasoning-module_boldText__suAp2",highlight:"CognitiveNonWebSearchReasoning-module_highlight__EMAz5",highlightActive:"CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU",highlightActiveVariant:"CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp",highlightVariant:"CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ",highlightButton:"CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const o=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;o&&e.setAttribute("nonce",o),e.appendChild(document.createTextNode(".CognitiveNonWebSearchReasoning-module_container__koQEN{display:flex;flex-direction:column;gap:var(--cr-container-gap,.5rem)}.CognitiveNonWebSearchReasoning-module_itemRow__lRmgs{align-items:flex-start;display:flex;font-size:var(--cr-item-row-font-size,.875rem);gap:.5rem}.CognitiveNonWebSearchReasoning-module_indexNumber__wP5hg{color:var(--cr-index-color,#475467);font-weight:var(--cr-index-font-weight,500)}.CognitiveNonWebSearchReasoning-module_textContent__327fx{color:var(--cr-text-content-color,#475467);flex:1;max-width:none}.CognitiveNonWebSearchReasoning-module_paraphraseButton__VS6Qe{align-items:center;background:var(--cr-paraphrase-button-bg,#0000);border:none;border-radius:var(--cr-paraphrase-button-border-radius,.375rem);cursor:pointer;display:inline-flex;gap:.25rem;justify-content:flex-start;padding:.125rem .375rem}.CognitiveNonWebSearchReasoning-module_paraphraseText__n5dty{color:var(--cr-paraphrase-color,#2563eb);font-weight:var(--cr-paraphrase-font-weight,500);text-align:start}.CognitiveNonWebSearchReasoning-module_paraphraseStar__YUnqR{color:var(--cr-paraphrase-color,#2563eb);padding-right:.25rem}.CognitiveNonWebSearchReasoning-module_chevronIcon__ZeXjw{color:var(--cr-chevron-color,#2563eb);height:1rem;transition:transform .2s;width:1rem}.CognitiveNonWebSearchReasoning-module_chevronIconRotated__WkRiP{transform:rotate(180deg)}.CognitiveNonWebSearchReasoning-module_expandedContainer__2UPr9{background-color:var(--cr-expanded-container-bg,#0000);border:solid var(--cr-expanded-container-border,#e5e7eb);border-radius:var(--cr-expanded-container-border-radius,.5rem);border-width:1px 1px 2px;margin-left:var(--cr-expanded-container-margin-left,1.5rem);margin-top:var(--cr-expanded-container-margin-top,.5rem);overflow:hidden}.CognitiveNonWebSearchReasoning-module_expandedHeader__QjKjb{align-items:center;background-color:var(--cr-header-bg,#f2f4f7);border-bottom:1px solid var(--cr-header-border,#e5e7eb);display:flex;justify-content:space-between;padding:var(--cr-header-padding,.25rem .75rem)}.CognitiveNonWebSearchReasoning-module_headerTitle__VvMwI{color:var(--cr-header-title-color,inherit);font-size:var(--cr-header-title-font-size,.875rem);font-weight:var(--cr-header-title-font-weight,400)}.CognitiveNonWebSearchReasoning-module_headerActions__j1P4u{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_navigationContainer__G0VtG{align-items:center;background-color:var(--cr-nav-container-bg,#fff);border:1px solid var(--cr-nav-container-border,#e5e7eb);border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_navButton__aOaMv:hover{background-color:var(--cr-nav-button-hover-bg,#f3f4f6)}.CognitiveNonWebSearchReasoning-module_navIcon__uLme4{color:var(--cr-nav-icon-color,#6b7280);height:var(--cr-nav-icon-size,1.25rem);width:var(--cr-nav-icon-size,1.25rem)}.CognitiveNonWebSearchReasoning-module_navCounter__nj1Xc{color:var(--cr-nav-counter-color,#4b5563);font-size:var(--cr-nav-counter-font-size,.875rem);min-width:2.25rem;text-align:center}.CognitiveNonWebSearchReasoning-module_confidenceBadge__-ElB3{align-items:center;background-color:var(--cr-confidence-badge-bg,#f0fdf4);border:2px solid var(--cr-confidence-badge-border,#3ac894);border-radius:9999px;display:inline-flex;gap:.25rem;padding:.25rem .5rem}.CognitiveNonWebSearchReasoning-module_confidenceStar__4Rq0S{color:var(--cr-confidence-star-color,#059669);font-size:.75rem}.CognitiveNonWebSearchReasoning-module_confidenceScore__uLcnK{color:var(--cr-confidence-score-color,#059669);font-size:.875rem;font-weight:600}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_maximizeButton__Xwwu-:hover{background-color:var(--cr-maximize-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_maximizeIcon__eFZez{color:var(--cr-maximize-icon-color,#6b7280);height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_contentArea__hVoLL{background-color:var(--cr-content-area-bg,#0000);color:var(--cr-content-area-color,inherit);font-size:var(--cr-content-area-font-size,.875rem);max-height:var(--cr-content-area-max-height,11rem);overflow-y:auto;padding:var(--cr-content-area-padding,.5rem .75rem);scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_contentInner__df-34{line-height:var(--cr-content-line-height,1.5rem)}.CognitiveNonWebSearchReasoning-module_footer__CNE8q{align-items:center;background-color:var(--cr-footer-bg,#f2f4f7);border-top:1px solid var(--cr-footer-border,#e5e7eb);display:flex;justify-content:flex-end}.CognitiveNonWebSearchReasoning-module_trainingTitle__CHFlh{color:var(--cr-training-title-color,inherit);font-size:var(--cr-training-title-font-size,.875rem);font-style:italic;font-weight:300}.CognitiveNonWebSearchReasoning-module_trainingTitleLink__0lu-U{align-items:center;background:none;border:none;color:var(--cr-training-link-color,inherit);cursor:pointer;display:inline-flex;font-size:var(--cr-training-link-font-size,.8rem);font-weight:600;gap:.25rem}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe{background:#0000;border:none;left:50%;margin:0;max-height:300px;max-width:none;overflow:visible;padding:0;position:fixed;top:50%;transform:translate(-50%,-50%)}.CognitiveNonWebSearchReasoning-module_modalDialog__eGApe::backdrop{background-color:#0006}.CognitiveNonWebSearchReasoning-module_modalContainer__-dZ01{background-color:var(--cr-modal-container-bg,#fff);border-radius:var(--cr-modal-container-border-radius,.75rem);box-shadow:0 25px 50px -12px #00000040;display:flex;flex-direction:column;max-height:80vh;max-width:900px;overflow:hidden;width:80vw}.CognitiveNonWebSearchReasoning-module_modalHeader__qglof{align-items:center;background-color:var(--cr-modal-header-bg,#f2f4f7);border-bottom:1px solid var(--cr-modal-header-border,#e5e7eb);display:flex;justify-content:space-between;padding:.75rem .5rem .75rem 1rem;width:100%}.CognitiveNonWebSearchReasoning-module_modalHeaderTitle__hDo1X{color:var(--cr-modal-header-title-color,inherit);font-size:var(--cr-modal-header-title-font-size,1rem);font-weight:500}.CognitiveNonWebSearchReasoning-module_modalHeaderActions__NGmip{align-items:center;display:flex;gap:.5rem}.CognitiveNonWebSearchReasoning-module_modalNavContainer__Q-OrP{align-items:center;background-color:var(--cr-modal-nav-container-bg,#f3f4f6);border:1px solid var(--cr-nav-container-border,#e5e7eb);border-radius:.5rem;display:flex;padding:.25rem}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24{align-items:center;background:#0000;border:none;border-radius:9999px;cursor:pointer;display:flex;justify-content:center;padding:0;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_modalNavButton__6cQ24:hover{background-color:var(--cr-modal-nav-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi{align-items:center;background:#0000;border:none;border-radius:.25rem;cursor:pointer;display:flex;justify-content:center;padding:.25rem;transition:background-color .2s}.CognitiveNonWebSearchReasoning-module_closeButton__S23zi:hover{background-color:var(--cr-close-button-hover-bg,#e5e7eb)}.CognitiveNonWebSearchReasoning-module_closeIcon__f7kaG{color:var(--cr-close-icon-color,#4b5563);height:1.25rem;width:1.25rem}.CognitiveNonWebSearchReasoning-module_modalContent__4U2Jv{background-color:var(--cr-modal-content-bg,#0000);color:var(--cr-modal-content-color,inherit);flex:1;font-size:var(--cr-modal-content-font-size,.875rem);overflow-y:scroll;padding:.75rem 1rem;scroll-behavior:smooth}.CognitiveNonWebSearchReasoning-module_modalContentInner__63tzo{line-height:var(--cr-modal-content-line-height,1.75rem)}.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{justify-content:flex-end;padding:.5rem 1rem}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt,.CognitiveNonWebSearchReasoning-module_modalFooter__hXBqn{align-items:center;background-color:var(--cr-modal-footer-bg,#f2f4f7);border-top:1px solid var(--cr-modal-footer-border,#e5e7eb);display:flex;flex-shrink:0}.CognitiveNonWebSearchReasoning-module_modalFooterSource__MOlgt{justify-content:flex-start;padding:1rem}.CognitiveNonWebSearchReasoning-module_blockLine__FwGYE{display:block}.CognitiveNonWebSearchReasoning-module_headerLine__0j5p4{display:block;font-weight:var(--cr-header-line-font-weight,400)}.CognitiveNonWebSearchReasoning-module_listItemLine__yKx2O{display:block}.CognitiveNonWebSearchReasoning-module_listCounter__esNpx{display:inline-block;font-weight:var(--cr-list-counter-font-weight,500);text-align:left;width:var(--cr-list-counter-width,1.5rem)}.CognitiveNonWebSearchReasoning-module_boldText__suAp2{font-weight:var(--cr-bold-font-weight,600)}.CognitiveNonWebSearchReasoning-module_highlight__EMAz5{background-color:var(--cr-highlight-bg,#fef08a);border-radius:.25rem;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightActive__FFvuU{background-color:var(--cr-highlight-active-bg,#fde047);border:1px solid var(--cr-highlight-active-border,#eab308);box-shadow:0 1px 2px 0 #0000000d}.CognitiveNonWebSearchReasoning-module_highlightActiveVariant__-gqMp{background-color:#e0e7ff;border:1px solid #5c75f4;box-shadow:0 1px 2px 0 #0000000d;color:#6366f1;font-weight:500}.CognitiveNonWebSearchReasoning-module_highlightVariant__PYgtJ{background-color:#eef2ff;border-radius:.25rem;color:#6366f1;font-weight:500;padding:0 .125rem;transition:all .2s}.CognitiveNonWebSearchReasoning-module_highlightButton__XvkBb{border:none;cursor:pointer;display:inline;font:inherit}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveNonWebSearchReasoning.module.css.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__awaiter as t,__generator as n}from"tslib";var e=function(t){return t.endsWith("/")?t.slice(0,-1):t};function o(t){var n;return null!==(n=null==t?void 0:t.toLowerCase().includes("json"))&&void 0!==n&&n}function r(o,r){return t(this,void 0,void 0,function(){var t,i,l;return n(this,function(n){switch(n.label){case 0:return t=o.startsWith("gs://")?o:"gs://".concat(o),i=e(r),[4,fetch("".concat(i,"/gcs/get-signed-url/"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({gsutil_url:t})})];case 1:if(!(l=n.sent()).ok)throw new Error("Failed to get signed URL: ".concat(l.statusText));return[4,l.json()];case 2:return[2,n.sent()]}})})}function i(o,r){var i,l,s,c,a;return t(this,void 0,void 0,function(){var t,u,d,v;return n(this,function(n){switch(n.label){case 0:return t=e(r),u=o.startsWith("gs://")?o.replace("gs://",""):o,[4,fetch("".concat(t,"/gcs/get-file-content"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({file_path:u})})];case 1:if(!(d=n.sent()).ok)throw new Error("Failed to fetch file content: ".concat(d.statusText));return[4,d.json()];case 2:return v=n.sent(),[2,null!==(a=null!==(s=null!==(l=null===(i=null==v?void 0:v.responseData)||void 0===i?void 0:i.content)&&void 0!==l?l:null==v?void 0:v.content)&&void 0!==s?s:null===(c=null==v?void 0:v.responseData)||void 0===c?void 0:c.file_content)&&void 0!==a?a:""]}})})}function l(t,n){var e;try{for(var o=n.split("."),r=t,i=0,l=o;i<l.length;i++){var s=l[i],c=s.match(/^(\w+)\[(\d+)\]$/);if(c){var a=c[1],u=c[2];r=null===(e=null==r?void 0:r[a])||void 0===e?void 0:e[Number(u)]}else r=null==r?void 0:r[s];if(null==r)return null}return r}catch(t){return console.error("Nested extraction error",t),null}}export{i as getFileContent,l as getNestedValue,r as getSignedUrl,o as isJSONFile};
|
|
2
|
+
//# sourceMappingURL=RuleBookCitationApiComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuleBookCitationApiComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as i,__awaiter as e,__generator as l}from"tslib";import{jsxs as n,jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{Loader2 as a}from"lucide-react";import d from"../TextualGuidelines/TextualGuideLinesComponent.js";import{getNestedValue as u,isJSONFile as s,getFileContent as c,getSignedUrl as v}from"./RuleBookCitationApiComponent.js";var f=function(f){var g,p,h,m,x,b,y=f.data,_=f.msg,C=f.citationIndex,D=f.guidelines,k=void 0===D?[]:D,T=f.url,I=f.additionalClassNames,R=f.headerTitle,w=void 0===R?"Rule Book Citation":R,L=f.InternalGptReasoningData,A=void 0===L?[]:L,G=f.IgptHeaderTitle,H=f.isDataProvided,j=void 0!==H&&H,B=f.textualContent,N=f.phraseToHighlight,S=f.onAccordionToggle,E=f.isInternalGptReasoningLoading,U=void 0!==E&&E;console.log("Max Latest code 6.0");var M=Math.max((null!==(p=null!==(g=null==y?void 0:y.citationNumber)&&void 0!==g?g:C)&&void 0!==p?p:1)-1,0),O=(null==_?void 0:_.requestId)||(null==_?void 0:_.id)||"",q=t(null),z=q[0],F=q[1],J=t(null),P=J[0],V=J[1],W=t(null),K=W[0],Q=W[1],X=t(!1),Y=X[0],Z=X[1],$=t(null),ii=$[0],ei=$[1];r(function(){var i,e,l,n;if(!j&&!z){if(null===(i=null==y?void 0:y.fileDetails)||void 0===i?void 0:i.file_id)return ei(null),F(y.fileDetails.file_id),void V(y.fileDetails.phrase_to_highlight||null);var o=(null!==(n=null===(l=null===(e=null==_?void 0:_.artifactSearchData)||void 0===e?void 0:e.ruleBookData)||void 0===l?void 0:l.rulebook_citations)&&void 0!==n?n:[])[M];if(!o)return ei("Citation not found at the specified index."),F(null),void V(null);if(!o.file_id)return ei("Citation data is missing file_id."),F(null),void V(null);Q(null),ei(null),F(o.file_id),V(o.phrase_to_highlight||null)}},[j,O,M,z,null===(h=null==y?void 0:y.fileDetails)||void 0===h?void 0:h.file_id,null===(m=null==y?void 0:y.fileDetails)||void 0===m?void 0:m.phrase_to_highlight,null===(b=null===(x=null==_?void 0:_.artifactSearchData)||void 0===x?void 0:x.ruleBookData)||void 0===b?void 0:b.rulebook_citations]),r(function(){if(!j)if(z){var i=Array.isArray(k)?k:Object.values(k||{}).flat();e(void 0,void 0,void 0,function(){var e,n,o,t,r,a,d,f;return l(this,function(l){switch(l.label){case 0:if(!(null==(e=i.find(function(i){return i.id===z}))?void 0:e.gcsUrl))return ei("File URL not found."),[2];l.label=1;case 1:return l.trys.push([1,4,5,6]),Z(!0),ei(null),[4,v(e.gcsUrl,null!=T?T:"")];case 2:if(null==(n=l.sent())?void 0:n.error)throw new Error(n.error);return o=(null===(f=e.name)||void 0===f?void 0:f.toLowerCase().split(".").pop())||"",s(o)?[4,c(e.gcsUrl,null!=T?T:"")]:[2];case 3:if(!(null==(t=l.sent())?void 0:t.trim()))throw new Error("Empty file content returned from the backend.");return r=JSON.parse(t),a=u(r,"data.artifactData.userStorySnapshot[0].value"),Q(a||""),[3,6];case 4:return d=l.sent(),console.error(d),ei(d.message||"An error occurred while loading file contents."),Q(null),[3,6];case 5:return Z(!1),[7];case 6:return[2]}})})}else Q(null)},[j,z,k,T]);var li=!j&&Y,ni=j?N||null:P,oi=j?B||"":(null==K?void 0:K.replace(/\\\./g,"."))||"",ti=j?!!B:!!K;return n("div",i({className:null==I?void 0:I.container,style:{width:"100%",minHeight:"100px",backgroundColor:"transparent"}},{children:[li&&n("div",i({style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100px",gap:"8px"}},{children:[o(a,{style:{animation:"spin 1s linear infinite"},size:24}),o("span",{children:"Loading content..."})]})),ii&&!li&&n("div",i({style:{padding:"12px",backgroundColor:"#fee2e2",border:"1px solid #fca5a5",borderRadius:"4px",color:"#991b1b",marginBottom:"12px"}},{children:[o("strong",{children:"Error:"})," ",ii]})),!li&&!ii&&ti&&o("div",i({style:{marginTop:"12px"}},{children:o(d,{TextualGuideLines:oi,HighlightedWords:ni?[ni]:[],InternalGptReasoningData:A,index:0,headerTitle:w,useVariantHighlight:!1,IgptHeaderTitle:G,onAccordionToggle:S,isInternalGptReasoningLoading:U})})),!li&&!ii&&!ti&&o("div",i({style:{padding:"12px",backgroundColor:"#f3f4f6",border:"1px solid #d1d5db",borderRadius:"4px",color:"#6b7280",textAlign:"center"}},{children:"No content available."})),o("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "})]}))};export{f as default};
|
|
2
|
+
//# sourceMappingURL=RuleBookCitationComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuleBookCitationComponent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as t,__spreadArray as e}from"tslib";import{jsx as n,Fragment as r,jsxs as a}from"react/jsx-runtime";import{useState as i,useRef as l,useEffect as c}from"react";import{ChevronUp as o,ChevronDown as s,ChevronLeft as u,ChevronRight as d}from"lucide-react";import h from"./SourceBQDataCompnent.module.css.js";function m(t){if(!t)return null;try{var e=t.startsWith("./")?"relative://"+t.slice(2):t.startsWith("?")?"relative://?"+t.slice(1):t,n=e.indexOf("?"),r=-1===n?e:e.slice(0,n),a=-1===n?"":e.slice(n+1),i=r.match(/columnName=([^&?#]+)/i),l=i?decodeURIComponent(i[1]):"",c=new URLSearchParams(a),o=c.get("citation_type")||"",s=c.get("sku_id")||"",u=c.get("citationNumber")||"";return"bq_data"===o&&s?{columnName:l,citationNumber:u,citationType:o,skuId:s}:null}catch(t){return null}}function f(t,e){if(!t||"object"!=typeof t)return null;for(var n=0,r=Object.entries(t);n<r.length;n++){var a=r[n],i=a[0];if(null==(f=a[1])?void 0:f.citations)for(var l=0,c=Object.values(f.citations);l<c.length;l++)for(var o=c[l],s=0,u=Object.values(o);s<u.length;s++){var d=u[s];if(Array.isArray(d)&&d.some(function(t){return String(t).trim()===String(e).trim()}))return[i,f]}}for(var h=0,m=Object.entries(t);h<m.length;h++){var f,v=m[h];i=v[0];if((null==(f=v[1])?void 0:f.citations)&&"string"==typeof f.gap&&"number"==typeof f.score&&"string"==typeof f.reasoning)return[i,f]}return null}var v=function(r){var o=r.bqData,s=r.highlightedColumns,m=l(null),f=i(0),v=f[0],b=f[1],g=Object.keys(o),p=Math.max.apply(Math,e(e([],Object.values(o).map(function(t){return Array.isArray(t)?t.length:1}),!1),[0],!1)),N=g.map(function(t,e){return s.includes(t)?e:-1}).filter(function(t){return-1!==t}),y=N.length>1,j=0===v,O=v===N.length-1;return c(function(){if(0!==N.length&&m.current){var t=setTimeout(function(){var t=m.current;if(t){var e=N[v],n=t.querySelectorAll("thead th")[e];if(n){var r=Math.max(0,n.offsetLeft-t.clientWidth/2+n.offsetWidth/2);t.scrollTo({left:r,behavior:"smooth"})}}},100);return function(){return clearTimeout(t)}}},[v,N]),a("div",t({className:h.tableCard},{children:[a("div",t({className:h.tableHeader},{children:[n("span",t({className:h.tableTitle},{children:"attributes"})),y&&a("div",t({className:h.tableNav},{children:[n("button",t({onClick:function(){return b(function(t){return Math.max(0,t-1)})},disabled:j,className:"".concat(h.navButton," ").concat(j?h.navButtonDisabled:""),"aria-label":"Previous highlighted column"},{children:n(u,{size:14})})),a("span",t({className:h.navStep},{children:[v+1,"/",N.length]})),n("button",t({onClick:function(){return b(function(t){return Math.min(N.length-1,t+1)})},disabled:O,className:"".concat(h.navButton," ").concat(O?h.navButtonDisabled:""),"aria-label":"Next highlighted column"},{children:n(d,{size:14})}))]}))]})),n("div",t({ref:m,className:h.tableScroll},{children:n("div",t({className:h.tableScrollInner},{children:a("table",t({className:h.table},{children:[n("thead",{children:n("tr",t({className:h.tableHeadRow},{children:g.map(function(e){return n("th",t({className:"".concat(h.th," ").concat(s.includes(e)?h.thHighlighted:"")},{children:e}),e)})}))}),n("tbody",t({className:h.tbody},{children:Array.from({length:p}).map(function(e,r){return n("tr",t({className:h.tr},{children:g.map(function(e){var a,i=o[e],l=Array.isArray(i)?i[r]:0===r?i:"";return n("td",t({className:"".concat(h.td," ").concat(s.includes(e)?h.tdHighlighted:"")},{children:(a=l,null==a?"-":"object"==typeof a?JSON.stringify(a):String(a))}),"".concat(e,"-").concat(r))})}),r)})}))]}))}))})),n("div",t({className:h.tableFooter},{children:a("span",t({className:h.tableFooterText},{children:[p," ",1===p?"row":"rows"," from BigQuery"]}))}))]}))},b=function(e){var l,c,u=e.hrefParams,d=e.sourceObj,m=e.children,f=e.defaultOpen,b=e.showChevron,g=void 0===b||b,p=i(null!=f&&f),N=p[0],y=p[1];if(!u||!d)return n(r,{});var j=u.columnName,O=u.citationNumber,S=u.skuId,A=O.split("".concat(S,"-"))[1],C=null!==(c=null===(l=d.citations)||void 0===l?void 0:l[O])&&void 0!==c?c:null,x=C?Object.fromEntries(Object.entries(C).map(function(t){var e=t[0],n=t[1];return[e,Array.isArray(n)?n:[n]]})):null,k=j?[j]:[];return a("span",t({className:h.wrapper},{children:[a("span",t({className:h.trigger,onClick:function(){return y(function(t){return!t})}},{children:[n("span",{children:m}),g&&n("span",t({className:h.triggerChevron},{children:n(N?o:s,{size:12})}))]})),N&&n("div",t({className:h.content},{children:x?n(v,{bqData:x,highlightedColumns:k}):a("div",t({className:h.emptyState},{children:["No data available for citation ",A,"."]}))}))]}))};export{b as SourcesBQCitation,f as findSourceCitation,m as parseSourcesBQHref};
|
|
2
|
+
//# sourceMappingURL=SourceBQDataCompnent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourceBQDataCompnent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={wrapper:"SourceBQDataCompnent-module_wrapper__Ug2Nc",trigger:"SourceBQDataCompnent-module_trigger__OfOZJ",triggerChevron:"SourceBQDataCompnent-module_triggerChevron__BEgjU",content:"SourceBQDataCompnent-module_content__wxAqE",fadeSlideIn:"SourceBQDataCompnent-module_fadeSlideIn__q-iNK",emptyState:"SourceBQDataCompnent-module_emptyState__urOTX",tableCard:"SourceBQDataCompnent-module_tableCard__AHvn8",tableHeader:"SourceBQDataCompnent-module_tableHeader__bcgFi",tableTitle:"SourceBQDataCompnent-module_tableTitle__BhAhV",tableNav:"SourceBQDataCompnent-module_tableNav__sZVYk",navButton:"SourceBQDataCompnent-module_navButton__8lZgb",navButtonDisabled:"SourceBQDataCompnent-module_navButtonDisabled__M1VaD",navStep:"SourceBQDataCompnent-module_navStep__-htGN",tableScroll:"SourceBQDataCompnent-module_tableScroll__Kwztb",tableScrollInner:"SourceBQDataCompnent-module_tableScrollInner__SW95U",table:"SourceBQDataCompnent-module_table__gQ3Rf",tableHeadRow:"SourceBQDataCompnent-module_tableHeadRow__cR-fA",th:"SourceBQDataCompnent-module_th__Dvqyq",thHighlighted:"SourceBQDataCompnent-module_thHighlighted__UM6n7",tbody:"SourceBQDataCompnent-module_tbody__l5CR8",tr:"SourceBQDataCompnent-module_tr__5--et",td:"SourceBQDataCompnent-module_td__dlEeI",tdHighlighted:"SourceBQDataCompnent-module_tdHighlighted__PrYAy",tableFooter:"SourceBQDataCompnent-module_tableFooter__buQN7",tableFooterText:"SourceBQDataCompnent-module_tableFooterText__po2-A"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".SourceBQDataCompnent-module_wrapper__Ug2Nc{display:inline;margin-left:.25rem;vertical-align:initial}.SourceBQDataCompnent-module_trigger__OfOZJ{align-items:center;color:#3b82f6;cursor:pointer;display:inline-flex;font-size:.875rem;font-weight:400}.SourceBQDataCompnent-module_triggerChevron__BEgjU{align-items:center;display:inline-flex;flex-shrink:0;margin-left:.25rem}.SourceBQDataCompnent-module_content__wxAqE{animation:SourceBQDataCompnent-module_fadeSlideIn__q-iNK .2s ease-out;margin-top:.5rem;width:100%}@keyframes SourceBQDataCompnent-module_fadeSlideIn__q-iNK{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}.SourceBQDataCompnent-module_emptyState__urOTX{background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:.75rem;color:#9ca3af;font-size:.75rem;font-style:italic;padding:1rem;text-align:center}.SourceBQDataCompnent-module_tableCard__AHvn8{background-color:#fff;border:1px solid #e5e7eb;border-radius:.75rem;box-shadow:0 1px 2px #0000000d}.SourceBQDataCompnent-module_tableHeader__bcgFi{align-items:center;border-bottom:1px solid #f3f4f6;display:flex;justify-content:space-between;padding:.5rem .75rem}.SourceBQDataCompnent-module_tableTitle__BhAhV{color:#4b5563;font-size:.75rem;font-weight:600}.SourceBQDataCompnent-module_tableNav__sZVYk{align-items:center;display:flex;gap:.375rem}.SourceBQDataCompnent-module_navButton__8lZgb{align-items:center;border:1px solid #d1d5db;border-radius:9999px;box-shadow:0 1px 2px #0000000d;color:#6b7280;cursor:pointer;display:flex;height:1.5rem;justify-content:center;transition:background-color .15s ease;width:1.5rem}.SourceBQDataCompnent-module_navButton__8lZgb:hover{background-color:#f9fafb}.SourceBQDataCompnent-module_navButtonDisabled__M1VaD{border-color:#e5e7eb;box-shadow:none;color:#d1d5db;cursor:not-allowed}.SourceBQDataCompnent-module_navButtonDisabled__M1VaD:hover{background-color:initial}.SourceBQDataCompnent-module_navStep__-htGN{color:#6b7280;font-size:.75rem;font-variant-numeric:tabular-nums;font-weight:500}.SourceBQDataCompnent-module_tableScroll__Kwztb{max-height:260px;overflow:auto;width:100%}.SourceBQDataCompnent-module_tableScrollInner__SW95U{display:inline-block;min-width:100%;vertical-align:middle}.SourceBQDataCompnent-module_table__gQ3Rf{border-collapse:collapse;font-size:.75rem;min-width:100%;text-align:left}.SourceBQDataCompnent-module_tableHeadRow__cR-fA{background-color:#f9fafb;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:10}.SourceBQDataCompnent-module_th__Dvqyq{border-right:1px solid #e5e7eb;color:#374151;font-weight:600;min-width:120px;padding:.75rem 1rem;white-space:nowrap}.SourceBQDataCompnent-module_th__Dvqyq:last-child{border-right:none}.SourceBQDataCompnent-module_thHighlighted__UM6n7{background-color:#fef9c3}.SourceBQDataCompnent-module_tbody__l5CR8,.SourceBQDataCompnent-module_tbody__l5CR8 tr+tr{border-top:1px solid #f3f4f6}.SourceBQDataCompnent-module_tr__5--et:hover{background-color:#f9fafb80}.SourceBQDataCompnent-module_td__dlEeI{border-right:1px solid #e5e7eb;color:#4b5563;min-width:120px;padding:.75rem 1rem;vertical-align:top;white-space:normal;word-break:break-word}.SourceBQDataCompnent-module_td__dlEeI:last-child{border-right:none}.SourceBQDataCompnent-module_tdHighlighted__PrYAy{background-color:#fefce8}.SourceBQDataCompnent-module_tableFooter__buQN7{border-top:1px solid #f3f4f6;padding:.5rem .75rem;text-align:right}.SourceBQDataCompnent-module_tableFooterText__po2-A{color:#9ca3af;font-size:.75rem;font-weight:500}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
|
+
//# sourceMappingURL=SourceBQDataCompnent.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourceBQDataCompnent.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as n}from"tslib";import{jsx as i}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{__assign as n}from"tslib";import{jsx as i}from"react/jsx-runtime";import{useRef as o,useState as t,useMemo as e,useEffect as r}from"react";import{convertILRuleToCognitiveDecisioningData as l}from"./types/Types.js";import{InstantLearningCitation as a}from"./InstantLearningCitation.js";import c from"../CitationRenderer/CitationRenderer.js";import{CitationIcon as d}from"../../assests/icons/CitationsIcon.js";var s=function(s){var u,p,h,v,f,m=s.ilLearning,g=s.ilLearningHighlights,C=void 0===g?[]:g,b=s.comparisonHighlights,x=void 0===b?[]:b,w=s.decisionStrength,y=void 0===w?"":w,I=s.linkTitle,B=s.onCitationToggle,F=s.config,R=o(null),S=t(!1),T=S[0],k=S[1],A=e(function(){return x.flatMap(function(n){return n.attributesToBehighlighted||[]})},[x]),D=e(function(){return m?n(n({},l(n(n({},m),{decision_strength:y}))),{il_learning_highlights:C}):null},[m,C,y]);r(function(){if(T){var n=setTimeout(function(){var n;null===(n=R.current)||void 0===n||n.scrollIntoView({behavior:"smooth",block:"center"})},100);return function(){return clearTimeout(n)}}},[T]);return i("span",n({className:"citation-span",ref:R},{children:i(c,{inLineCitation:!0,citationTitle:I,citationIcon:null!==(u=null==F?void 0:F.citationIcon)&&void 0!==u?u:D?i(d,{}):null,citationComponent:D?i(a,n({},D)):void 0,chevronDownComponent:null!==(p=null==F?void 0:F.chevronDownIcon)&&void 0!==p?p:i(function(){return i("span",n({"aria-hidden":!0,className:"md-chevron",style:{color:D?"#1A847C":"#6D28D9"}},{children:i("svg",n({viewBox:"0 0 20 20",fill:"currentColor"},{children:i("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 0 1 1.06.02L10 10.128l3.71-2.9a.75.75 0 1 1 .92 1.18l-4.2 3.28a.75.75 0 0 1-.92 0l-4.2-3.28a.75.75 0 0 1-.02-1.12z",clipRule:"evenodd"})}))}))},{}),chevronUpComponent:null!==(h=null==F?void 0:F.chevronUpIcon)&&void 0!==h?h:i(function(){return i("span",n({"aria-hidden":!0,className:"md-chevron",style:{color:D?"#1A847C":"#6D28D9"}},{children:i("svg",n({viewBox:"0 0 20 20",fill:"currentColor"},{children:i("path",{fillRule:"evenodd",d:"M14.77 12.79a.75.75 0 0 1-1.06-.02L10 9.872l-3.71 2.9a.75.75 0 1 1-.92-1.18l4.2-3.28a.75.75 0 0 1 .92 0l4.2 3.28a.75.75 0 0 1 .02 1.12z",clipRule:"evenodd"})}))}))},{}),styles:{pillButton:n({fontFamily:'"Inter", sans-serif',background:"transparent",padding:0,margin:0,marginBottom:"2px",fontSize:"12px",lineHeight:"140%",fontWeight:500,color:D?"#1A847C":"rgb(109, 40, 217)",cursor:"pointer",whiteSpace:"nowrap",border:"none",display:"inline-flex",alignItems:"center",gap:"4px",verticalAlign:"middle"},null===(v=null==F?void 0:F.slotStyles)||void 0===v?void 0:v.pillButton),citationContent:n({backgroundColor:"#F5F3FF66",border:"1px solid #A78BFA",borderRadius:"6px",padding:"0.75rem",fontFamily:'"Inter", sans-serif',fontSize:"12px",fontWeight:400,lineHeight:"140%",color:"#1e293b",boxShadow:"none",width:"100%",height:"fit-content",minHeight:"38vh",margin:"0 auto",overflowWrap:"break-word"},null===(f=null==F?void 0:F.slotStyles)||void 0===f?void 0:f.citationContent)},additionalCallbackForPillButton:function(){var n=!T;k(n),B&&B(A,"",n)}})}))};export{s as default};
|
|
2
2
|
//# sourceMappingURL=InstantLearningCitationComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as o}from"react";import{ChevronDown as e,ChevronUp as a,Maximize2 as l,X as r,ExternalLink as d}from"lucide-react";import s from"dayjs";import c from"../ScannedDocCitation/ScannedDocCitation.js";import u from"../InstantLearningCitation/InstantLearningCitationComponent.js";import g from"../InstantLearningCitation/SlashLoader.js";import v from"../CognitiveInternalgptReasoning/CognitiveInternalgptReasoningComponent.js";import h from"../RequirementAiCitations/ImageCitation/ImageCitationContent.js";import C from"../RequirementAiCitations/WebCitation/WebCitationWithImageContent.js";import m from"../ChatCitation/ChatCitationRenderer.js";import p from"../DualCitation/RuleBookCitationComponent.js";import f from"../CitationRenderer/CitationRenderer.js";import D from"../SplitterCitations/SplitterCitationsComponent.js";import{SourcesBQCitation as T}from"../DualCitation/SourceBQDataCompnent.js";import{CITATION_TYPES as I}from"./citationTypes.js";var b=function(i,t,n){if(!i)throw new Error("[ParentCitationComponent] ".concat(t,': missing required field "').concat(n,'" in customMetaData'))},P=function(i,t){if(!Object.values(i).some(Boolean))throw new Error("[ParentCitationComponent] ".concat(t,': missing one of "').concat(Object.keys(i).join('", "'),'" in customMetaData'))},S=function(_){var L,R,w,A,U,x,j,y,B,k,G,H,E,O,N,W,F,M,z,q,Q,K,J,V,X,Y=_.href,Z=_.children,$=_.isStreaming,ii=_.onCitationToggle,ti=_.chatCitationConfig,ni=_.scannedDocCitationConfig,oi=_.ruleBookCitationConfig,ei=_.ilCitationConfig,ai=_.gptCitationConfig,li=_.scannedDocCitationData,ri=_.ilCitationData,di=_.chatCitationData,si=_.gptCitationData,ci=_.webCitationData,ui=_.imageCitationData,gi=_.bqCitationData,vi=_.title,hi=_.citationIcon,Ci=_.isDualCitationFlag,mi=void 0!==Ci&&Ci,pi=o(!1),fi=pi[0],Di=pi[1];if($)return t("span",i({style:{display:"inline-flex",alignItems:"center",gap:"0.25rem",fontWeight:500,color:"#6D28D9"}},{children:[n("span",{children:Z}),n(g,{})]}));try{var Ti=new URL(Y,"http://example.com"),Ii=Ti.searchParams.get("citationNumber"),bi=Ti.searchParams.get("decisionStrength"),Pi=Ti.searchParams.get("citation_type"),Si=mi||Pi===I.DUAL;if(!Ii)return null;if(Pi===I.SCANNED_DOC){var _i=null==li?void 0:li.pages;if(null==_i?void 0:_i.length)return n(c,i({pages:_i,subHeadingText:null==li?void 0:li.artifactTitle},ni));b(null==li?void 0:li.gsUrl,"scanned_doc_citation","gs_url");var Li=[li.gsUrl],Ri=(null!==(L=null==li?void 0:li.highlightedCoordinates)&&void 0!==L?L:[]).map(function(i,t){return{pageIndex:t,bboxes:[i]}});return n(c,i({images:Li,highlights:Ri},ni))}if(Pi===I.IL){b(null==ri?void 0:ri.ilLearning,"IL","il_learning");var wi=Z||(null==ri?void 0:ri.linkText)||(null==ri?void 0:ri.citationSource)||String(null!==(R=null==ri?void 0:ri.citationNumber)&&void 0!==R?R:1);return n(u,{ilLearning:ri.ilLearning,ilLearningHighlights:null==ri?void 0:ri.ilLearningHighlights,comparisonHighlights:null==ri?void 0:ri.comparisonHighlights,decisionStrength:bi||(null==ri?void 0:ri.decisionStrength)||"",linkTitle:wi,onCitationToggle:null!=ii?ii:function(){},config:ei})}if(Pi===I.CHAT){var Ai=null!=ti?ti:{},Ui=null===(A=null!==(w=null==di?void 0:di.chatData)&&void 0!==w?w:[])||void 0===A?void 0:A.map(function(t){return i(i({},t),{timeStamp:s(t.timeStamp)})}),xi=!!(null==di?void 0:di.ruleBookContent);return n(m,{showRootContainer:null===(U=Ai.showRootContainer)||void 0===U||U,reversePanels:Ai.reversePanels,isRenderedCustomComponent:Ai.isRenderedCustomComponent,modalContainerStyle:Ai.modalContainerStyle,additionalData:Ai.additionalData,closePreview:Ai.closePreview,selectedIdFromReason:null!==(x=Ai.selectedIdFromReason)&&void 0!==x?x:void 0,rootContainer:i(i({},Ai.rootContainer),{relevanceScore:null==di?void 0:di.relevanceScore}),chatContainer:i(i({},Ai.chatContainer),{chatData:Ui,summarizedTab:i(i({},null===(j=Ai.chatContainer)||void 0===j?void 0:j.summarizedTab),{chip:i({isActive:!0,show:!0},null===(B=null===(y=Ai.chatContainer)||void 0===y?void 0:y.summarizedTab)||void 0===B?void 0:B.chip)}),detailedTab:i(i({},null===(k=Ai.chatContainer)||void 0===k?void 0:k.detailedTab),{chip:i({isActive:!1},null===(H=null===(G=Ai.chatContainer)||void 0===G?void 0:G.detailedTab)||void 0===H?void 0:H.chip)})}),ruleBookContainer:xi?i(i({},Ai.ruleBookContainer),{data:{content:di.ruleBookContent,highlighted_texts:null!==(E=null==di?void 0:di.ruleBookHighlights)&&void 0!==E?E:[]}}):void 0})}if(Pi===I.GPT){var ji=null==si?void 0:si.value,yi=null!==(O=null==ji?void 0:ji.text)&&void 0!==O?O:null===(N=null==si?void 0:si.dataSources)||void 0===N?void 0:N[0],Bi=null!==(W=null==ji?void 0:ji.label)&&void 0!==W?W:null===(F=null==si?void 0:si.trainingDataTitle)||void 0===F?void 0:F[0],ki=null!==(M=null==ji?void 0:ji.paraphrase)&&void 0!==M?M:null===(z=null==si?void 0:si.paraphrase)||void 0===z?void 0:z[0];P({data_sources:yi,training_data_title:Bi},I.GPT);var Gi={text:"",dataSource:yi,trainingDataTitle:Bi,paraphrase:ki},Hi=null!==(q=null==ai?void 0:ai.iconsConfig)&&void 0!==q?q:{ChevronDownIcon:e,ChevronUpIcon:a,MaximizeIcon:l,CloseIcon:r};return n(v,{item:Gi,headerTitle:null!==(Q=null==ai?void 0:ai.headerTitle)&&void 0!==Q?Q:"GPT - Gemini 3.5 Flash",iconsConfig:Hi,previewCallback:null==ai?void 0:ai.previewCallback,DocumentTitle:null==ai?void 0:ai.DocumentTitle,disableMaximize:Si})}if(Pi===I.WEB){!function(i,t,n){b(i,t,n);try{new URL(i)}catch(o){throw new Error("[ParentCitationComponent] ".concat(t,': "').concat(n,'" is not a valid URL: "').concat(i,'"'))}}(null==ci?void 0:ci.link,I.WEB,"link");var Ei=ci.link,Oi=Z||(null==ci?void 0:ci.citationSource)||Ei;return(null==ci?void 0:ci.screenshotUrl)?n(C,{url:Ei,label:Oi,gsUtilPath:null==ci?void 0:ci.gsUtilPath,signedUrl:ci.screenshotUrl,relevanceScore:null==ci?void 0:ci.relevanceScore,visitIcon:d,PreviewDialogCloseIcon:r}):n("a",i({href:Ei,target:"_blank",rel:"noreferrer"},{children:Oi}))}if(Pi===I.IMAGE)return P({gs_util_path:null==ui?void 0:ui.gsUtilPath,signed_url:null==ui?void 0:ui.signedUrl},I.IMAGE),n(h,{citationTitle:Z||(null==ui?void 0:ui.citationSource),gsUtilPath:null==ui?void 0:ui.gsUtilPath,signedUrl:null==ui?void 0:ui.signedUrl,relevanceScore:null==ui?void 0:ui.relevanceScore});if(Pi===I.BQ_DATA)return P({href_params:null==gi?void 0:gi.hrefParams,source_obj:null==gi?void 0:gi.sourceObj},I.BQ_DATA),n(T,i({hrefParams:gi.hrefParams,sourceObj:gi.sourceObj,showChevron:!1,defaultOpen:!0},{children:Z||""}));if(Pi===I.RULEBOOK){var Ni=Ii?parseInt(Ii,10):0;return n(p,{url:null!==(K=null==oi?void 0:oi.url)&&void 0!==K?K:"",data:{citationNumber:null!==(V=null===(J=null==oi?void 0:oi.data)||void 0===J?void 0:J.citationNumber)&&void 0!==V?V:Ni,fileDetails:null===(X=null==oi?void 0:oi.data)||void 0===X?void 0:X.fileDetails},msg:null==oi?void 0:oi.msg,citationIndex:null==oi?void 0:oi.citationIndex,guidelines:null==oi?void 0:oi.guidelines,additionalClassNames:null==oi?void 0:oi.additionalClassNames,headerTitle:null==oi?void 0:oi.headerTitle,InternalGptReasoningData:null==oi?void 0:oi.InternalGptReasoningData,isDataProvided:null==oi?void 0:oi.isDataProvided,textualContent:null==oi?void 0:oi.textualContent,phraseToHighlight:null==oi?void 0:oi.phraseToHighlight,IgptHeaderTitle:null==oi?void 0:oi.IgptHeaderTitle,isInternalGptReasoningLoading:null==oi?void 0:oi.isInternalGptReasoningLoading,onAccordionToggle:null==oi?void 0:oi.onAccordionToggle})}if(Pi===I.IL_RULEBOOK)return n(p,{headerTitle:null==oi?void 0:oi.headerTitle,InternalGptReasoningData:null==oi?void 0:oi.InternalGptReasoningData,isDataProvided:null==oi?void 0:oi.isDataProvided,textualContent:null==oi?void 0:oi.textualContent,phraseToHighlight:null==oi?void 0:oi.phraseToHighlight,IgptHeaderTitle:null==oi?void 0:oi.IgptHeaderTitle,onAccordionToggle:null==oi?void 0:oi.onAccordionToggle,isInternalGptReasoningLoading:null==oi?void 0:oi.isInternalGptReasoningLoading});if(Pi===I.DUAL){var Wi=Ti.searchParams.get("left_citation_type"),Fi=Ti.searchParams.get("right_citation_type");if(Wi===I.DUAL||Fi===I.DUAL)return console.error("left or right citation type cant be dual_citation"),null;var Mi=function(i,t){var n="".concat(i,"."),o="left"===i?"right.":"left.",e=new URLSearchParams;return Ti.searchParams.forEach(function(i,t){"citation_type"!==t&&"left_citation_type"!==t&&"right_citation_type"!==t&&(t.startsWith(n)||t.startsWith(o)||e.set(t,i))}),Ti.searchParams.forEach(function(i,t){t.startsWith(n)&&e.set(t.slice(n.length),i)}),t&&e.set("citation_type",t),"?".concat(e.toString())},zi=Mi("left",Wi),qi=Mi("right",Fi),Qi=Z||vi||"Source and Guidelines",Ki=function(i){switch(i){case I.SCANNED_DOC:return{scannedDocCitationData:li,scannedDocCitationConfig:ni};case I.IL:return{ilCitationData:ri,ilCitationConfig:ei};case I.CHAT:return{chatCitationData:di,chatCitationConfig:ti};case I.GPT:return{gptCitationData:si,gptCitationConfig:ai};case I.WEB:return{webCitationData:ci};case I.IMAGE:return{imageCitationData:ui};case I.BQ_DATA:return{bqCitationData:gi};case I.RULEBOOK:return{ruleBookCitationConfig:oi};default:return{}}};return n(f,{inLineCitation:!0,citationTitle:Qi,citationIcon:hi,isOpen:fi,onToggle:function(){return Di(function(i){return!i})},styles:{pillButton:{fontSize:"14px",margin:"0px",padding:"0px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",background:"white",border:"none"},citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}},citationComponent:n(D,{left:n(S,i({href:zi,onCitationToggle:ii},Ki(Wi),{isDualCitationFlag:!0})),right:n(S,i({href:qi,onCitationToggle:ii,isDualCitationFlag:!0},Ki(Fi))),header:{title:Qi,showDocIcon:!1},openInFullscreen:!0,fullscreenOnly:!0,onFullscreenClose:function(){return Di(!1)}})})}console.warn('[ParentCitationComponent] unhandled citation_type: "'.concat(Pi,'"'))}catch(i){return console.error(i),null}return null};export{S as default};
|
|
2
2
|
//# sourceMappingURL=ParentCitationComponent.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t={SCANNED_DOC:"scanned_doc_citation",IL:"IL",CHAT:"chat_citation",GPT:"gpt_citation",WEB:"web_citation",IMAGE:"image_citation",BQ_DATA:"bq_data",RULEBOOK:"rulebook_citation",IL_RULEBOOK:"il_rulebook_citation",DUAL:"dual_citation"};export{t as CITATION_TYPES};
|
|
2
|
+
//# sourceMappingURL=citationTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citationTypes.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function r(r){var l;return null!==(l=null==r?void 0:r.toLowerCase().includes("json"))&&void 0!==l&&l}function l(r,l){var n;try{for(var e=l.split("."),o=r,t=0,u=e;t<u.length;t++){var i=u[t],v=i.match(/^(\w+)\[(\d+)\]$/);if(v){var a=v[1],d=v[2];o=null===(n=null==o?void 0:o[a])||void 0===n?void 0:n[Number(d)]}else o=null==o?void 0:o[i];if(null==o)return null}return o}catch(r){return console.error("Nested extraction error",r),null}}export{l as getNestedValue,r as isJSONFile};
|
|
2
2
|
//# sourceMappingURL=RuleBookCitationApi.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as r,__generator as
|
|
1
|
+
import{__assign as e,__awaiter as r,__generator as i}from"tslib";import{jsxs as n,jsx as l}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{Loader2 as a}from"lucide-react";import d from"../TextualGuidelines/TextualGuideLinesComponent.js";import{getNestedValue as s,isJSONFile as u}from"./RuleBookCitationApi.js";var c=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.filter(Boolean).join(" ")},v=function(v){var g,f,p,m,h=v.data,b=v.msg,x=v.citationIndex,y=v.guidelines,C=void 0===y?[]:y,N=v.additionalClassNames,_=v.getSignedUrl,k=v.getFileContent,w=v.themeTokens,D=v.classNames,T=v.styles;console.log("Latest code 4.0");var j=Math.max((null!==(f=null!==(g=null==h?void 0:h.citationNumber)&&void 0!==g?g:x)&&void 0!==f?f:1)-1,0),I=(null==b?void 0:b.requestId)||(null==b?void 0:b.id)||"",A=o(null),G=A[0],R=A[1],S=o(null),B=S[0],E=S[1],L=o(null),U=L[0],H=L[1],O=o(!1),W=O[0],q=O[1],F=o(null),z=F[0],J=F[1];t(function(){var e,r,i,n;if(!G){if(null===(e=null==h?void 0:h.fileDetails)||void 0===e?void 0:e.file_id)return J(null),R(h.fileDetails.file_id),void E(h.fileDetails.phrase_to_highlight||null);var l=(null!==(n=null===(i=null===(r=null==b?void 0:b.artifactSearchData)||void 0===r?void 0:r.ruleBookData)||void 0===i?void 0:i.rulebook_citations)&&void 0!==n?n:[])[j];if(!l)return J("Citation not found at the specified index."),R(null),void E(null);if(!l.file_id)return J("Citation data is missing file_id."),R(null),void E(null);H(null),J(null),R(l.file_id),E(l.phrase_to_highlight||null)}},[I,j,G,null===(p=null==h?void 0:h.fileDetails)||void 0===p?void 0:p.file_id,null===(m=null==h?void 0:h.fileDetails)||void 0===m?void 0:m.phrase_to_highlight]),t(function(){if(G){var e=Array.isArray(C)?C:Object.values(C||{}).flat();r(void 0,void 0,void 0,function(){var r,n,l,o,t,a,d,c;return i(this,function(i){switch(i.label){case 0:if(!(null==(r=e.find(function(e){return e.id===G}))?void 0:r.gcsUrl))return[2];if(!_||!k)return J("Required API handlers (getSignedUrl/getFileContent) were not provided."),[2];i.label=1;case 1:return i.trys.push([1,4,5,6]),q(!0),J(null),[4,_(r.gcsUrl)];case 2:if(null==(n=i.sent())?void 0:n.error)throw new Error(n.error);return l=(null===(c=r.name)||void 0===c?void 0:c.toLowerCase().split(".").pop())||"",u(l)?[4,k(r.gcsUrl)]:[2];case 3:if(!(null==(o=i.sent())?void 0:o.trim()))throw new Error("Empty file content returned from the backend.");return t=JSON.parse(o),a=s(t,"data.artifactData.userStorySnapshot[0].value"),H(a||""),[3,6];case 4:return d=i.sent(),console.error(d),J(d.message||"An error occurred while loading file contents."),H(null),[3,6];case 5:return q(!1),[7];case 6:return[2]}})})}else H(null)},[G,C,_,k]);var M=W,P=(null==U?void 0:U.replace(/\\\./g,"."))||"",V=w?Object.fromEntries(Object.entries(w).filter(function(e){return e[0].startsWith("--tg-")})):void 0;return n("div",e({className:c(null==N?void 0:N.container,null==D?void 0:D.container),style:e(e({width:"100%",minHeight:"var(--rb-container-min-height, 100px)",backgroundColor:"var(--rb-container-bg, transparent)"},w),null==T?void 0:T.container)},{children:[M&&n("div",e({className:c(null==D?void 0:D.loadingContainer),style:e({display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100px",gap:"var(--rb-loading-gap, 8px)",color:"var(--rb-loading-color, inherit)"},null==T?void 0:T.loadingContainer)},{children:[l(a,{className:c(null==D?void 0:D.loadingIcon),style:e({animation:"spin 1s linear infinite"},null==T?void 0:T.loadingIcon),size:24}),l("span",e({className:c(null==D?void 0:D.loadingText),style:null==T?void 0:T.loadingText},{children:"Loading content..."}))]})),z&&!M&&n("div",e({className:c(null==D?void 0:D.errorContainer),style:e({padding:"var(--rb-error-padding, 12px)",backgroundColor:"var(--rb-error-bg, #fee2e2)",border:"1px solid var(--rb-error-border, #fca5a5)",borderRadius:"var(--rb-error-border-radius, 4px)",color:"var(--rb-error-color, #991b1b)",marginBottom:"12px"},null==T?void 0:T.errorContainer)},{children:[l("strong",{children:"Error:"})," ",z]})),!M&&!z&&U&&l("div",e({className:c(null==D?void 0:D.contentWrapper),style:e({marginTop:"var(--rb-content-margin-top, 12px)"},null==T?void 0:T.contentWrapper)},{children:l(d,{TextualGuideLines:P,HighlightedWords:B?[B]:[],InternalGptReasoningData:[],index:0,headerTitle:"Rule Book Citation",useVariantHighlight:!1,themeTokens:V,classNames:null==D?void 0:D.textualGuidelines,styles:null==T?void 0:T.textualGuidelines})})),!M&&!z&&!U&&l("div",e({className:c(null==D?void 0:D.emptyContainer),style:e({padding:"var(--rb-empty-padding, 12px)",backgroundColor:"var(--rb-empty-bg, #f3f4f6)",border:"1px solid var(--rb-empty-border, #d1d5db)",borderRadius:"var(--rb-empty-border-radius, 4px)",color:"var(--rb-empty-color, #6b7280)",textAlign:"center"},null==T?void 0:T.emptyContainer)},{children:"No content available."})),l("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "})]}))};export{v as default};
|
|
2
2
|
//# sourceMappingURL=RuleBookCitationWrapper.js.map
|